@treasuredata/tdx 0.16.4 → 0.16.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.d.ts +4 -0
- package/dist/commands/agent-test-command.d.ts.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/agent-test-command.js.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/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/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/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/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.d.ts +7 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/connection-cache.d.ts.map +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/connection-cache.js.map +1 -1
- package/dist/core/constants.d.ts +22 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/constants.js.map +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.d.ts.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/keychain.js.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.d.ts.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/user-cache.js.map +1 -1
- package/dist/core/version.d.ts +2 -2
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +2 -0
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.d.ts +3 -6
- package/dist/sdk/agent/test/evaluator.d.ts.map +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/evaluator.js.map +1 -1
- package/dist/sdk/agent/test/executor.d.ts +57 -1
- package/dist/sdk/agent/test/executor.d.ts.map +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/executor.js.map +1 -1
- package/dist/sdk/agent/test/index.d.ts +2 -2
- package/dist/sdk/agent/test/index.d.ts.map +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/index.js.map +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.d.ts.map +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/test/parser.js.map +1 -1
- package/dist/sdk/agent/test/types.d.ts +44 -0
- package/dist/sdk/agent/test/types.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +13 -0
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +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.d.ts +6 -0
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.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/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.d.ts.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/chat-cache.js.map +1 -1
- package/dist/sdk/llm/index.d.ts +11 -3
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/llm.d.ts +39 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/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/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.d.ts +88 -0
- package/dist/utils/global-cache.d.ts.map +1 -0
- package/dist/utils/global-cache.js +1 -0
- package/dist/utils/global-cache.js.map +1 -0
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.d.ts +48 -0
- package/dist/utils/local-cache.d.ts.map +1 -0
- package/dist/utils/local-cache.js +1 -0
- package/dist/utils/local-cache.js.map +1 -0
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts +10 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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/tdx-logger.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x359ae3=a15_0x10c4;(function(_0x13e8da,_0x2081a6){const _0x736d81=a15_0x10c4,_0x5113ce=_0x13e8da();while(!![]){try{const _0x219de0=-parseInt(_0x736d81(0xa9))/0x1+-parseInt(_0x736d81(0xae))/0x2+parseInt(_0x736d81(0xb3))/0x3*(-parseInt(_0x736d81(0xa8))/0x4)+-parseInt(_0x736d81(0xb8))/0x5+parseInt(_0x736d81(0xbd))/0x6+-parseInt(_0x736d81(0xac))/0x7+parseInt(_0x736d81(0xa7))/0x8;if(_0x219de0===_0x2081a6)break;else _0x5113ce['push'](_0x5113ce['shift']());}catch(_0xebbca7){_0x5113ce['push'](_0x5113ce['shift']());}}}(a15_0x4dc5,0x87c63));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a15_0x10c4(_0x5586b1,_0x10cf8b){_0x5586b1=_0x5586b1-0xa7;const _0x4dc57a=a15_0x4dc5();let _0x10c428=_0x4dc57a[_0x5586b1];return _0x10c428;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{['name']='describe';[a15_0x359ae3(0xc8)]=a15_0x359ae3(0xaf);async[a15_0x359ae3(0xc6)](_0x2bfa6b){const _0x387d44=a15_0x359ae3;return this[_0x387d44(0xb0)](_0x2bfa6b);}async[a15_0x359ae3(0xb0)](_0x3c055d){const _0x5b43a2=a15_0x359ae3,{options:_0x6966fb,args:_0x529e64,tdx:_0xfa5d40}=_0x3c055d;let _0x21b373;try{_0x21b373=parseTableReference(_0x529e64[0x0]);const _0x3e9735=_0x6966fb['database'];!_0x21b373['database']&&_0x3e9735&&(_0x21b373[_0x5b43a2(0xb1)]=_0x3e9735);const _0x2d4bf6=validateTableDescribeReference(_0x21b373);if(_0x2d4bf6)return console['error'](_0x5b43a2(0xc2)+_0x2d4bf6),0x1;}catch(_0x59c066){return console[_0x5b43a2(0xc4)](_0x5b43a2(0xc2)+_0x59c066[_0x5b43a2(0xc1)]),0x1;}const _0x3df0ec=_0x21b373['database'],_0x7de608=_0x21b373[_0x5b43a2(0xba)];try{_0x6966fb[_0x5b43a2(0xc0)]&&(console[_0x5b43a2(0xc4)](_0x5b43a2(0xb5)+_0x6966fb['site']),console['error'](_0x5b43a2(0xb9)+_0x3df0ec),console[_0x5b43a2(0xc4)](_0x5b43a2(0xb7)+_0x7de608));const _0x2056bd=await withSpinner(_0x5b43a2(0xb2)+_0x3df0ec+'.'+_0x7de608+'...',()=>_0xfa5d40[_0x5b43a2(0xb4)][_0x5b43a2(0xb0)](_0x3df0ec,_0x7de608),{'verbose':_0x6966fb[_0x5b43a2(0xc0)]}),_0x1930c1=_0x2056bd[_0x5b43a2(0xbe)];if(_0x1930c1[_0x5b43a2(0xbb)]===0x0)return console[_0x5b43a2(0xc4)](_0x5b43a2(0xb6)),console[_0x5b43a2(0xc4)](_0x5b43a2(0xc3)+_0x3df0ec+'.'+_0x7de608+'\x27\x20does\x20not\x20exist'),0x1;return console[_0x5b43a2(0xc4)](_0x5b43a2(0xc5)+_0x1930c1[_0x5b43a2(0xbb)]+_0x5b43a2(0xad)+(_0x1930c1[_0x5b43a2(0xbb)]!==0x1?'s':'')+'\x20in\x20'+_0x3df0ec+'.'+_0x7de608),await handleSDKOutput(_0x1930c1,_0x6966fb),0x0;}catch(_0x147b82){if(_0x147b82 instanceof SDKError)return console[_0x5b43a2(0xc4)](_0x5b43a2(0xc2)+_0x147b82[_0x5b43a2(0xc1)]),_0x147b82[_0x5b43a2(0xaa)]&&console[_0x5b43a2(0xc4)]('\x20\x20Cause:\x20'+_0x147b82[_0x5b43a2(0xaa)]),0x1;throw _0x147b82;}}[a15_0x359ae3(0xbf)](_0x42f571){const _0x427aec=a15_0x359ae3;if(_0x42f571[_0x427aec(0xab)]['length']===0x0)return _0x427aec(0xbc);if(_0x42f571[_0x427aec(0xab)]['length']>0x1)return _0x427aec(0xc7);return undefined;}}function a15_0x4dc5(){const _0x460123=['data','validate','verbose','message','Error:\x20','Table\x20\x27','error','✔\x20Found\x20','execute','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','description','9635608WyJVOs','12cRPlQc','200798HsjHbW','cause','args','948626BVigkr','\x20column','492422onpeTO','Describe\x20table\x20schema','describeTable','database','Describing\x20table\x20','214329IzgiVz','query','Site:\x20','✖\x20Table\x20not\x20found','Table:\x20','1234840CTwAdM','Database:\x20','table','length','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','2373024UdqInQ'];a15_0x4dc5=function(){return _0x460123;};return a15_0x4dc5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x469af2=a16_0xbbc7;(function(_0x3f741a,_0x3395ec){const _0x3093aa=a16_0xbbc7,_0x56f9fa=_0x3f741a();while(!![]){try{const _0x3a4558=parseInt(_0x3093aa(0x165))/0x1+-parseInt(_0x3093aa(0x1a5))/0x2*(parseInt(_0x3093aa(0x163))/0x3)+-parseInt(_0x3093aa(0x19d))/0x4+-parseInt(_0x3093aa(0x16c))/0x5+-parseInt(_0x3093aa(0x12c))/0x6*(parseInt(_0x3093aa(0x17d))/0x7)+-parseInt(_0x3093aa(0x126))/0x8+parseInt(_0x3093aa(0x122))/0x9;if(_0x3a4558===_0x3395ec)break;else _0x56f9fa['push'](_0x56f9fa['shift']());}catch(_0x30f51a){_0x56f9fa['push'](_0x56f9fa['shift']());}}}(a16_0x2182,0x3c98a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';function a16_0x2182(){const _0x2fc9be=['engage:workspace:show','Updating\x20workspace\x20\x27','filter','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','1978292EYKYwr','updateCampaign','Engage\x20workspace\x20set\x20to:\x20','duplicateCampaign','List\x20campaigns','Operation\x20cancelled','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Fetching\x20campaign\x20\x27','175000UipGzv','limit','createCampaign','listTemplates','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:campaign:launch','emailSenderId','17498394CiBgqI','List\x20email\x20templates','engage:campaign:resume','Duplicating\x20campaign\x20\x27','3906824giJfbN','keys','Verifying\x20workspace\x20\x27','workspace','createWorkspace','Error:\x20--html\x20is\x20required','11010jsLlCm','Launching\x20campaign\x20\x27','segment','full','engage:templates','engage:template:show','Creating\x20campaign\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','html','\x27?\x20This\x20cannot\x20be\x20undone.','fromEntries','Duplicate\x20a\x20campaign','deleteWorkspace','subject','editorType','Fetching\x20template\x20\x27','Pause\x20a\x20campaign','segmentId','type','Delete\x20a\x20workspace','deleteTemplate','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','\x27\x20deleted\x20successfully','Deleting\x20campaign\x20\x27','getCampaign','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','engage:campaign:duplicate','Template\x20\x27','timezone','Pausing\x20campaign\x20\x27','data','Fetching\x20workspace\x20\x27','getWorkspaceFull','Updating\x20campaign\x20\x27','length','getTemplateFull','execute','name','engage','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','MISSING_ARGUMENT','engage:template:create','resolveWorkspaceId','engage:workspace:update','engage:campaign:show','yes','\x27...','Workspace\x20is\x20required\x20for\x20this\x20operation','plaintext','engage:workspace:create','engage:campaign:update','Delete\x20a\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','status','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','9McODAP','Launch\x20a\x20campaign','123702LXKVDO','Error:\x20Workspace\x20name\x20is\x20required','Error:\x20--name\x20is\x20required','log','engage_workspace','Workspace\x20\x27','engage:template:delete','1844100hwOykd','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Fetching\x20templates...','entries','Update\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Delete\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','resumeCampaign','getWorkspace','List\x20workspaces','Error:\x20--subject\x20is\x20required','Resuming\x20campaign\x20\x27','Fetching\x20campaigns...','Creating\x20template\x20\x27','updateWorkspace','784YMHPME','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Deleting\x20workspace\x20\x27','engage:workspaces','Deleting\x20template\x20\x27','engage:campaign:pause','verbose','error','startAt','resolvePathToResource','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Create\x20an\x20email\x20template','Creating\x20workspace\x20\x27','deleteCampaign','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','createTemplate','engage:campaign:create','description','listWorkspaces','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Campaign\x20\x27','engage:workspace:use','parentName','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Show\x20email\x20template\x20details'];a16_0x2182=function(){return _0x2fc9be;};return a16_0x2182();}import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x2c2885,_0xdeffdc,_0x1aaa28=![]){const _0x79d507=a16_0xbbc7;if(_0x2c2885[_0x79d507(0x129)])return await _0xdeffdc[_0x79d507(0x152)]['resolveWorkspaceId'](_0x2c2885[_0x79d507(0x129)]);const _0x1bdd9a=loadSessionContext(_0x2c2885['session']);if(_0x1bdd9a?.[_0x79d507(0x169)])return await _0xdeffdc['engage'][_0x79d507(0x156)](_0x1bdd9a[_0x79d507(0x169)]);if(_0x1aaa28)throw new SDKError(ErrorCode[_0x79d507(0x154)],_0x79d507(0x15b),undefined,{'helpText':_0x79d507(0x162)});return undefined;}async function resolveSegmentFromOptions(_0x31b4d5,_0x1be268){const _0x5e472f=a16_0xbbc7;if(!_0x31b4d5[_0x5e472f(0x12e)])return{};const _0x580f5d=_0x31b4d5[_0x5e472f(0x12e)],_0x4beb48=await _0x1be268[_0x5e472f(0x12e)][_0x5e472f(0x187)](_0x580f5d);return{'audienceId':_0x4beb48['parentId'],'audienceName':_0x4beb48[_0x5e472f(0x194)],..._0x4beb48[_0x5e472f(0x13d)]&&{'segmentId':_0x4beb48[_0x5e472f(0x13d)],'segmentName':_0x4beb48['segmentName']}};}function buildConnectorConfig(_0x1d9a60){const _0xfc0c7c=a16_0xbbc7,_0x2350d0=_0x1d9a60[_0xfc0c7c(0x121)],_0x15e188=_0x1d9a60['jsonColumns'];if(!_0x2350d0&&!_0x15e188)return undefined;return{..._0x2350d0&&{'emailSenderId':_0x2350d0},..._0x15e188&&{'jsonColumns':_0x15e188}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x469af2(0x151)]='engage:campaigns';[a16_0x469af2(0x18f)]=a16_0x469af2(0x1a1);async[a16_0x469af2(0x150)](_0x5351b9){const _0x4db609=a16_0x469af2,{options:_0x47b43e,args:_0x7e93b5,tdx:_0x28208d}=_0x5351b9,_0x517a50=_0x7e93b5[0x0],_0x407e49=resolveLimit(_0x47b43e[_0x4db609(0x1a6)],DEFAULT_LLM_LIMIT),_0x1064a6=_0x47b43e,_0x5c6637=_0x1064a6['type'],_0x2b42f9=_0x1064a6[_0x4db609(0x161)],_0x3d3e5d=await resolveWorkspaceIdFromOptions(_0x1064a6,_0x28208d),_0x68c948=await withSpinner(_0x4db609(0x17a),()=>_0x28208d['engage']['listCampaigns']({'type':_0x5c6637,'status':_0x2b42f9,'workspaceId':_0x3d3e5d,'limit':_0x407e49}),{'verbose':_0x47b43e['verbose']});let _0x5cbb32=_0x68c948[_0x4db609(0x14a)];return _0x517a50&&(_0x5cbb32=_0x68c948[_0x4db609(0x14a)][_0x4db609(0x199)](_0x55e78d=>matchGlobPattern(_0x55e78d['name'],_0x517a50))),await handleSDKOutput(_0x5cbb32,_0x47b43e),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x158);[a16_0x469af2(0x18f)]='Show\x20campaign\x20details';async[a16_0x469af2(0x150)](_0x72c789){const _0xdda30=a16_0x469af2,{options:_0x1e2d07,args:_0x297815,tdx:_0x40ae84}=_0x72c789;if(_0x297815[_0xdda30(0x14e)]===0x0)return console[_0xdda30(0x185)](_0xdda30(0x133)),console[_0xdda30(0x185)](_0xdda30(0x141)),0x1;const _0x51ba00=_0x297815[0x0],_0xd9dd2c=_0x1e2d07,_0x41d39e=await resolveWorkspaceIdFromOptions(_0xd9dd2c,_0x40ae84),_0x3d60df=_0xd9dd2c['full'];if(_0x3d60df){const _0x276c3d=await withSpinner('Fetching\x20campaign\x20\x27'+_0x51ba00+_0xdda30(0x15a),()=>_0x40ae84[_0xdda30(0x152)]['getCampaignFull'](_0x51ba00,_0x41d39e),{'verbose':_0x1e2d07[_0xdda30(0x184)]});await handleSDKOutput([_0x276c3d],_0x1e2d07);}else{const _0x5ed827=await withSpinner(_0xdda30(0x1a4)+_0x51ba00+_0xdda30(0x15a),()=>_0x40ae84[_0xdda30(0x152)][_0xdda30(0x144)](_0x51ba00,_0x41d39e),{'verbose':_0x1e2d07[_0xdda30(0x184)]});await handleSDKOutput([_0x5ed827],_0x1e2d07);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x18e);[a16_0x469af2(0x18f)]='Create\x20a\x20new\x20campaign';async[a16_0x469af2(0x150)](_0x802c70){const _0x38087a=a16_0x469af2,{options:_0x5835d6,tdx:_0x5a91fd}=_0x802c70,_0x2d1ec8=_0x5835d6,_0x5ea397=_0x2d1ec8[_0x38087a(0x151)],_0x3f85ba=_0x2d1ec8[_0x38087a(0x13e)];if(!_0x5ea397)return console[_0x38087a(0x185)](_0x38087a(0x167)),console['error'](_0x38087a(0x195)),0x1;if(!_0x3f85ba)return console[_0x38087a(0x185)](_0x38087a(0x19b)),console[_0x38087a(0x185)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x2d0e53=await resolveWorkspaceIdFromOptions(_0x2d1ec8,_0x5a91fd,!![]),_0x482696=await resolveSegmentFromOptions(_0x2d1ec8,_0x5a91fd),_0x5796da=buildConnectorConfig(_0x2d1ec8),_0x2ce560={'name':_0x5ea397,'campaignType':_0x3f85ba,'workspaceId':_0x2d0e53,'description':_0x2d1ec8[_0x38087a(0x18f)],..._0x482696,'connectorConfig':_0x5796da,'startAt':_0x2d1ec8[_0x38087a(0x186)],'timezone':_0x2d1ec8[_0x38087a(0x148)]},_0x5c84ba=await withSpinner(_0x38087a(0x132)+_0x5ea397+_0x38087a(0x15a),()=>_0x5a91fd['engage'][_0x38087a(0x1a7)](_0x2ce560));return await handleSDKOutput([_0x5c84ba[_0x38087a(0x14a)]],_0x5835d6),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x15e);['description']='Update\x20a\x20campaign';async['execute'](_0xa70fb2){const _0x396962=a16_0x469af2,{options:_0x907602,args:_0x4decd8,tdx:_0x52d976}=_0xa70fb2;if(_0x4decd8['length']===0x0)return console[_0x396962(0x185)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x396962(0x185)](_0x396962(0x18c)),0x1;const _0x30702d=_0x4decd8[0x0],_0xafc8e7=_0x907602,_0x3968ad=await resolveWorkspaceIdFromOptions(_0xafc8e7,_0x52d976),_0x4129be=await resolveSegmentFromOptions(_0xafc8e7,_0x52d976),_0x16be24=buildConnectorConfig(_0xafc8e7),_0x493372={'name':_0xafc8e7[_0x396962(0x151)],'description':_0xafc8e7['description'],..._0x4129be,'connectorConfig':_0x16be24,'startAt':_0xafc8e7[_0x396962(0x186)],'timezone':_0xafc8e7[_0x396962(0x148)]},_0x536585=Object[_0x396962(0x136)](Object['entries'](_0x493372)[_0x396962(0x199)](([,_0x54e79a])=>_0x54e79a!==undefined));if(Object[_0x396962(0x127)](_0x536585)[_0x396962(0x14e)]===0x0)return console[_0x396962(0x185)](_0x396962(0x153)),console[_0x396962(0x185)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x1b57dd=await withSpinner(_0x396962(0x14d)+_0x30702d+'\x27...',()=>_0x52d976[_0x396962(0x152)][_0x396962(0x19e)](_0x30702d,_0x536585,_0x3968ad),{'verbose':_0x907602[_0x396962(0x184)]});return await handleSDKOutput([_0x1b57dd[_0x396962(0x14a)]],_0x907602),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x469af2(0x151)]='engage:campaign:delete';[a16_0x469af2(0x18f)]=a16_0x469af2(0x15f);async['execute'](_0x4fa6a2){const _0x37b24a=a16_0x469af2,{options:_0x5bc4e9,args:_0x25a342,tdx:_0xbf6e29}=_0x4fa6a2;if(_0x25a342['length']===0x0)return console[_0x37b24a(0x185)](_0x37b24a(0x133)),console[_0x37b24a(0x185)](_0x37b24a(0x174)),0x1;const _0x36bed5=_0x25a342[0x0],_0x11ff6c=_0x5bc4e9,_0x5cf5de=await resolveWorkspaceIdFromOptions(_0x11ff6c,_0xbf6e29);if(!_0x5bc4e9[_0x37b24a(0x159)]){const _0x53eaf1=await confirm(_0x37b24a(0x188)+_0x36bed5+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x53eaf1)return console[_0x37b24a(0x168)](_0x37b24a(0x1a2)),0x0;}return await withSpinner(_0x37b24a(0x143)+_0x36bed5+_0x37b24a(0x15a),()=>_0xbf6e29[_0x37b24a(0x152)][_0x37b24a(0x18b)](_0x36bed5,_0x5cf5de),{'verbose':_0x5bc4e9[_0x37b24a(0x184)]}),console['log'](_0x37b24a(0x192)+_0x36bed5+_0x37b24a(0x142)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x120);[a16_0x469af2(0x18f)]=a16_0x469af2(0x164);async[a16_0x469af2(0x150)](_0x2fd170){const _0x4536b3=a16_0x469af2,{options:_0x5a2d7d,args:_0x333d28,tdx:_0x497a06}=_0x2fd170;if(_0x333d28[_0x4536b3(0x14e)]===0x0)return console[_0x4536b3(0x185)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x4536b3(0x19a)),0x1;const _0x5efb39=_0x333d28[0x0],_0x17e71c=_0x5a2d7d,_0x20d1fd=await resolveWorkspaceIdFromOptions(_0x17e71c,_0x497a06);return await withSpinner(_0x4536b3(0x12d)+_0x5efb39+_0x4536b3(0x15a),()=>_0x497a06[_0x4536b3(0x152)]['launchCampaign'](_0x5efb39,_0x20d1fd),{'verbose':_0x5a2d7d['verbose']}),console['log'](_0x4536b3(0x192)+_0x5efb39+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x183);['description']=a16_0x469af2(0x13c);async[a16_0x469af2(0x150)](_0xb9a8b7){const _0x3f0d25=a16_0x469af2,{options:_0x304449,args:_0x532742,tdx:_0x150aa5}=_0xb9a8b7;if(_0x532742[_0x3f0d25(0x14e)]===0x0)return console[_0x3f0d25(0x185)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x3f0d25(0x185)](_0x3f0d25(0x17e)),0x1;const _0x3b08cd=_0x532742[0x0],_0x4ed78e=_0x304449,_0x1b4e40=await resolveWorkspaceIdFromOptions(_0x4ed78e,_0x150aa5);return await withSpinner(_0x3f0d25(0x149)+_0x3b08cd+_0x3f0d25(0x15a),()=>_0x150aa5['engage']['pauseCampaign'](_0x3b08cd,_0x1b4e40),{'verbose':_0x304449[_0x3f0d25(0x184)]}),console[_0x3f0d25(0x168)](_0x3f0d25(0x192)+_0x3b08cd+'\x27\x20paused\x20successfully'),0x0;}}function a16_0xbbc7(_0x4c9cd1,_0x2746fc){_0x4c9cd1=_0x4c9cd1-0x11e;const _0x21825f=a16_0x2182();let _0xbbc749=_0x21825f[_0x4c9cd1];return _0xbbc749;}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x124);['description']='Resume\x20a\x20paused\x20campaign';async['execute'](_0x4333b6){const _0xf7be76=a16_0x469af2,{options:_0x212a40,args:_0x4d63d0,tdx:_0x43cc51}=_0x4333b6;if(_0x4d63d0[_0xf7be76(0x14e)]===0x0)return console[_0xf7be76(0x185)](_0xf7be76(0x133)),console[_0xf7be76(0x185)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x9005e6=_0x4d63d0[0x0],_0x72eba3=_0x212a40,_0x550675=await resolveWorkspaceIdFromOptions(_0x72eba3,_0x43cc51);return await withSpinner(_0xf7be76(0x179)+_0x9005e6+_0xf7be76(0x15a),()=>_0x43cc51[_0xf7be76(0x152)][_0xf7be76(0x175)](_0x9005e6,_0x550675),{'verbose':_0x212a40[_0xf7be76(0x184)]}),console[_0xf7be76(0x168)]('Campaign\x20\x27'+_0x9005e6+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a16_0x469af2(0x146);[a16_0x469af2(0x18f)]=a16_0x469af2(0x137);async['execute'](_0x5d93bd){const _0x566206=a16_0x469af2,{options:_0x463ab4,args:_0xc38fa0,tdx:_0x1ab5d1}=_0x5d93bd;if(_0xc38fa0['length']===0x0)return console[_0x566206(0x185)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x566206(0x185)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x233322=_0xc38fa0[0x0],_0x327e3b=_0x463ab4,_0x51d961=await resolveWorkspaceIdFromOptions(_0x327e3b,_0x1ab5d1),_0x538805=await withSpinner(_0x566206(0x125)+_0x233322+'\x27...',()=>_0x1ab5d1[_0x566206(0x152)][_0x566206(0x1a0)](_0x233322,_0x51d961),{'verbose':_0x463ab4[_0x566206(0x184)]});return await handleSDKOutput([_0x538805[_0x566206(0x14a)]],_0x463ab4),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0x469af2(0x130);[a16_0x469af2(0x18f)]=a16_0x469af2(0x123);async[a16_0x469af2(0x150)](_0x273c47){const _0x5b1ed7=a16_0x469af2,{options:_0x45261e,args:_0x50f2b3,tdx:_0x45eaad}=_0x273c47,_0x477297=_0x50f2b3[0x0],_0x255c7b=resolveLimit(_0x45261e[_0x5b1ed7(0x1a6)],DEFAULT_LLM_LIMIT),_0x18cf4c=_0x45261e,_0x307ad1=await resolveWorkspaceIdFromOptions(_0x18cf4c,_0x45eaad),_0x576387=await withSpinner(_0x5b1ed7(0x16f),()=>_0x45eaad[_0x5b1ed7(0x152)][_0x5b1ed7(0x1a8)]({'workspaceId':_0x307ad1,'limit':_0x255c7b}),{'verbose':_0x45261e[_0x5b1ed7(0x184)]});let _0x15b5a4=_0x576387[_0x5b1ed7(0x14a)];return _0x477297&&(_0x15b5a4=_0x576387[_0x5b1ed7(0x14a)][_0x5b1ed7(0x199)](_0x39db4b=>matchGlobPattern(_0x39db4b[_0x5b1ed7(0x151)],_0x477297))),await handleSDKOutput(_0x15b5a4,_0x45261e),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a16_0x469af2(0x131);[a16_0x469af2(0x18f)]=a16_0x469af2(0x196);async[a16_0x469af2(0x150)](_0x3fdfa2){const _0x6a9563=a16_0x469af2,{options:_0x5dbe17,args:_0x3e3540,tdx:_0x233f5f}=_0x3fdfa2;if(_0x3e3540[_0x6a9563(0x14e)]===0x0)return console[_0x6a9563(0x185)](_0x6a9563(0x16d)),console[_0x6a9563(0x185)](_0x6a9563(0x145)),0x1;const _0x45c96f=_0x3e3540[0x0],_0x181597=_0x5dbe17,_0x4a8a07=await resolveWorkspaceIdFromOptions(_0x181597,_0x233f5f),_0x2fcafd=_0x181597[_0x6a9563(0x12f)];if(_0x2fcafd){const _0x2284fe=await withSpinner('Fetching\x20template\x20\x27'+_0x45c96f+_0x6a9563(0x15a),()=>_0x233f5f['engage'][_0x6a9563(0x14f)](_0x45c96f,_0x4a8a07),{'verbose':_0x5dbe17[_0x6a9563(0x184)]});await handleSDKOutput([_0x2284fe],_0x5dbe17);}else{const _0x3c338d=await withSpinner(_0x6a9563(0x13b)+_0x45c96f+_0x6a9563(0x15a),()=>_0x233f5f[_0x6a9563(0x152)]['getTemplate'](_0x45c96f,_0x4a8a07),{'verbose':_0x5dbe17['verbose']});await handleSDKOutput([_0x3c338d],_0x5dbe17);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x155);[a16_0x469af2(0x18f)]=a16_0x469af2(0x189);async[a16_0x469af2(0x150)](_0x55c8fd){const _0x5854df=a16_0x469af2,{options:_0x199427,tdx:_0x2d03f4}=_0x55c8fd,_0x1a3707=_0x199427,_0x5a4bda=_0x1a3707[_0x5854df(0x151)],_0x1d98cb=_0x1a3707[_0x5854df(0x139)],_0xcc051b=_0x1a3707[_0x5854df(0x134)];if(!_0x5a4bda)return console[_0x5854df(0x185)](_0x5854df(0x167)),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x1d98cb)return console[_0x5854df(0x185)](_0x5854df(0x178)),0x1;if(!_0xcc051b)return console[_0x5854df(0x185)](_0x5854df(0x12b)),0x1;const _0x552edc=await resolveWorkspaceIdFromOptions(_0x1a3707,_0x2d03f4,!![]),_0xe5322e={'name':_0x5a4bda,'subjectTemplate':_0x1d98cb,'htmlTemplate':_0xcc051b,'workspaceId':_0x552edc,'plaintextTemplate':_0x1a3707[_0x5854df(0x15c)],'editorType':_0x1a3707[_0x5854df(0x13a)]},_0x48092f=await withSpinner(_0x5854df(0x17b)+_0x5a4bda+_0x5854df(0x15a),()=>_0x2d03f4[_0x5854df(0x152)][_0x5854df(0x18d)](_0xe5322e));return await handleSDKOutput([_0x48092f[_0x5854df(0x14a)]],_0x199427),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']='engage:template:update';['description']=a16_0x469af2(0x171);async[a16_0x469af2(0x150)](_0x4ee18c){const _0x27fc7c=a16_0x469af2,{options:_0x248544,args:_0x1164e1,tdx:_0x584bbc}=_0x4ee18c;if(_0x1164e1[_0x27fc7c(0x14e)]===0x0)return console['error'](_0x27fc7c(0x16d)),console[_0x27fc7c(0x185)]('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x5312c8=_0x1164e1[0x0],_0x47db3b=_0x248544,_0x964854=await resolveWorkspaceIdFromOptions(_0x47db3b,_0x584bbc),_0x494880={'name':_0x47db3b[_0x27fc7c(0x151)],'subjectTemplate':_0x47db3b[_0x27fc7c(0x139)],'htmlTemplate':_0x47db3b[_0x27fc7c(0x134)],'plaintextTemplate':_0x47db3b[_0x27fc7c(0x15c)]},_0x53cf16=Object[_0x27fc7c(0x136)](Object[_0x27fc7c(0x170)](_0x494880)[_0x27fc7c(0x199)](([,_0x1b444d])=>_0x1b444d!==undefined));if(Object[_0x27fc7c(0x127)](_0x53cf16)[_0x27fc7c(0x14e)]===0x0)return console[_0x27fc7c(0x185)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x27fc7c(0x11e)),0x1;const _0x458d47=await withSpinner('Updating\x20template\x20\x27'+_0x5312c8+_0x27fc7c(0x15a),()=>_0x584bbc[_0x27fc7c(0x152)]['updateTemplate'](_0x5312c8,_0x53cf16,_0x964854),{'verbose':_0x248544[_0x27fc7c(0x184)]});return await handleSDKOutput([_0x458d47[_0x27fc7c(0x14a)]],_0x248544),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x16b);['description']=a16_0x469af2(0x173);async[a16_0x469af2(0x150)](_0x27fa00){const _0x17f7f8=a16_0x469af2,{options:_0x190dce,args:_0x2e69b7,tdx:_0x36fc55}=_0x27fa00;if(_0x2e69b7['length']===0x0)return console[_0x17f7f8(0x185)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x17f7f8(0x185)](_0x17f7f8(0x172)),0x1;const _0x153a68=_0x2e69b7[0x0],_0xd84f8a=_0x190dce,_0x437836=await resolveWorkspaceIdFromOptions(_0xd84f8a,_0x36fc55);if(!_0x190dce['yes']){const _0x26c67b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x153a68+_0x17f7f8(0x135));if(!_0x26c67b)return console[_0x17f7f8(0x168)](_0x17f7f8(0x1a2)),0x0;}return await withSpinner(_0x17f7f8(0x182)+_0x153a68+'\x27...',()=>_0x36fc55[_0x17f7f8(0x152)][_0x17f7f8(0x140)](_0x153a68,_0x437836),{'verbose':_0x190dce[_0x17f7f8(0x184)]}),console[_0x17f7f8(0x168)](_0x17f7f8(0x147)+_0x153a68+_0x17f7f8(0x142)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x181);[a16_0x469af2(0x18f)]=a16_0x469af2(0x177);async[a16_0x469af2(0x150)](_0xdf7a){const _0x50fbeb=a16_0x469af2,{options:_0x59f8f5,args:_0x423d8d,tdx:_0x35f96b}=_0xdf7a,_0x24d9ed=_0x423d8d[0x0],_0x4d4a95=resolveLimit(_0x59f8f5['limit'],DEFAULT_LLM_LIMIT),_0x8dfbdc=await withSpinner('Fetching\x20workspaces...',()=>_0x35f96b[_0x50fbeb(0x152)][_0x50fbeb(0x190)]({'limit':_0x4d4a95}),{'verbose':_0x59f8f5[_0x50fbeb(0x184)]});let _0x1ed674=_0x8dfbdc['data'];return _0x24d9ed&&(_0x1ed674=_0x8dfbdc[_0x50fbeb(0x14a)][_0x50fbeb(0x199)](_0x187a9e=>matchGlobPattern(_0x187a9e[_0x50fbeb(0x151)],_0x24d9ed))),await handleSDKOutput(_0x1ed674,_0x59f8f5),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x469af2(0x151)]=a16_0x469af2(0x197);[a16_0x469af2(0x18f)]='Show\x20workspace\x20details';async[a16_0x469af2(0x150)](_0x543ba3){const _0x398f1e=a16_0x469af2,{options:_0x457d18,args:_0x20c76c,tdx:_0x104451}=_0x543ba3;if(_0x20c76c[_0x398f1e(0x14e)]===0x0)return console[_0x398f1e(0x185)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x398f1e(0x185)](_0x398f1e(0x160)),0x1;const _0x51063e=_0x20c76c[0x0],_0x19d64a=_0x457d18,_0x3dcb35=_0x19d64a[_0x398f1e(0x12f)];if(_0x3dcb35){const _0x3adc94=await withSpinner('Fetching\x20workspace\x20\x27'+_0x51063e+_0x398f1e(0x15a),()=>_0x104451[_0x398f1e(0x152)][_0x398f1e(0x14c)](_0x51063e),{'verbose':_0x457d18[_0x398f1e(0x184)]});await handleSDKOutput([_0x3adc94],_0x457d18);}else{const _0x1e47af=await withSpinner(_0x398f1e(0x14b)+_0x51063e+'\x27...',()=>_0x104451['engage'][_0x398f1e(0x176)](_0x51063e),{'verbose':_0x457d18[_0x398f1e(0x184)]});await handleSDKOutput([_0x1e47af],_0x457d18);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a16_0x469af2(0x15d);[a16_0x469af2(0x18f)]='Create\x20a\x20workspace';async[a16_0x469af2(0x150)](_0x348e3a){const _0x135958=a16_0x469af2,{options:_0x460666,tdx:_0x21e049}=_0x348e3a,_0x4cd00=_0x460666,_0x196b20=_0x4cd00['name'];if(!_0x196b20)return console['error']('Error:\x20--name\x20is\x20required'),console[_0x135958(0x185)](_0x135958(0x191)),0x1;const _0x3f81c1={'name':_0x196b20,'description':_0x4cd00[_0x135958(0x18f)]},_0x56d81e=await withSpinner(_0x135958(0x18a)+_0x196b20+'\x27...',()=>_0x21e049['engage'][_0x135958(0x12a)](_0x3f81c1));return await handleSDKOutput([_0x56d81e['data']],_0x460666),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']=a16_0x469af2(0x157);[a16_0x469af2(0x18f)]='Update\x20a\x20workspace';async[a16_0x469af2(0x150)](_0xd2e93e){const _0x5bc0c1=a16_0x469af2,{options:_0x59b5bf,args:_0x1632ac,tdx:_0x142d83}=_0xd2e93e;if(_0x1632ac[_0x5bc0c1(0x14e)]===0x0)return console[_0x5bc0c1(0x185)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x5bc0c1(0x185)](_0x5bc0c1(0x19c)),0x1;const _0x334c88=_0x1632ac[0x0],_0x41428d=_0x59b5bf,_0xa87af4={'name':_0x41428d[_0x5bc0c1(0x151)],'description':_0x41428d[_0x5bc0c1(0x18f)]},_0xa86b53=Object[_0x5bc0c1(0x136)](Object[_0x5bc0c1(0x170)](_0xa87af4)[_0x5bc0c1(0x199)](([,_0x40fc76])=>_0x40fc76!==undefined));if(Object['keys'](_0xa86b53)[_0x5bc0c1(0x14e)]===0x0)return console[_0x5bc0c1(0x185)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error']('Options:\x20--name,\x20--description'),0x1;const _0x21f9d2=await withSpinner(_0x5bc0c1(0x198)+_0x334c88+_0x5bc0c1(0x15a),()=>_0x142d83[_0x5bc0c1(0x152)][_0x5bc0c1(0x17c)](_0x334c88,_0xa86b53),{'verbose':_0x59b5bf[_0x5bc0c1(0x184)]});return await handleSDKOutput([_0x21f9d2[_0x5bc0c1(0x14a)]],_0x59b5bf),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x469af2(0x151)]='engage:workspace:delete';[a16_0x469af2(0x18f)]=a16_0x469af2(0x13f);async[a16_0x469af2(0x150)](_0x496965){const _0xbcb984=a16_0x469af2,{options:_0x5bbaff,args:_0x2b5091,tdx:_0x52288b}=_0x496965;if(_0x2b5091[_0xbcb984(0x14e)]===0x0)return console['error'](_0xbcb984(0x16e)),console['error'](_0xbcb984(0x17f)),0x1;const _0xa10510=_0x2b5091[0x0];if(!_0x5bbaff['yes']){const _0x600922=await confirm(_0xbcb984(0x11f)+_0xa10510+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x600922)return console['log'](_0xbcb984(0x1a2)),0x0;}return await withSpinner(_0xbcb984(0x180)+_0xa10510+_0xbcb984(0x15a),()=>_0x52288b[_0xbcb984(0x152)][_0xbcb984(0x138)](_0xa10510),{'verbose':_0x5bbaff[_0xbcb984(0x184)]}),console['log'](_0xbcb984(0x16a)+_0xa10510+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x469af2(0x193);['description']=a16_0x469af2(0x1a3);async['execute'](_0x2ff165){const _0x562056=a16_0x469af2,{options:_0x42fb69,args:_0xb2c4a,tdx:_0x359dce}=_0x2ff165;if(_0xb2c4a['length']===0x0)return console[_0x562056(0x185)](_0x562056(0x166)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x3e4683=_0xb2c4a[0x0];await withSpinner(_0x562056(0x128)+_0x3e4683+'\x27...',()=>_0x359dce[_0x562056(0x152)][_0x562056(0x156)](_0x3e4683));const _0x5a68a6=_0x42fb69['session']||undefined;return saveSessionContext({'engage_workspace':_0x3e4683},_0x5a68a6),console['log'](_0x562056(0x19f)+_0x3e4683),console[_0x562056(0x168)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
1
|
+
const a16_0x5718b5=a16_0x1ecb;(function(_0x35b5c7,_0x3740e2){const _0x10af41=a16_0x1ecb,_0x19cceb=_0x35b5c7();while(!![]){try{const _0xe0371f=parseInt(_0x10af41(0x1e7))/0x1+parseInt(_0x10af41(0x1b1))/0x2*(parseInt(_0x10af41(0x1df))/0x3)+parseInt(_0x10af41(0x1e5))/0x4+parseInt(_0x10af41(0x1fb))/0x5+parseInt(_0x10af41(0x1fd))/0x6+parseInt(_0x10af41(0x1f7))/0x7*(-parseInt(_0x10af41(0x202))/0x8)+-parseInt(_0x10af41(0x22f))/0x9*(parseInt(_0x10af41(0x200))/0xa);if(_0xe0371f===_0x3740e2)break;else _0x19cceb['push'](_0x19cceb['shift']());}catch(_0x5594ad){_0x19cceb['push'](_0x19cceb['shift']());}}}(a16_0x4a9c,0xf0850));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x8bb508,_0xe0399c,_0x3f08d7=![]){const _0xeea34e=a16_0x1ecb;if(_0x8bb508[_0xeea34e(0x1c3)])return await _0xe0399c[_0xeea34e(0x1ba)]['resolveWorkspaceId'](_0x8bb508[_0xeea34e(0x1c3)]);const _0x80119a=loadSessionContext(_0x8bb508[_0xeea34e(0x21e)]);if(_0x80119a?.[_0xeea34e(0x212)])return await _0xe0399c['engage'][_0xeea34e(0x233)](_0x80119a[_0xeea34e(0x212)]);if(_0x3f08d7)throw new SDKError(ErrorCode[_0xeea34e(0x1be)],_0xeea34e(0x211),undefined,{'helpText':_0xeea34e(0x1ca)});return undefined;}async function resolveSegmentFromOptions(_0x36416a,_0x5a575b){const _0x16f7e4=a16_0x1ecb;if(!_0x36416a[_0x16f7e4(0x1f3)])return{};const _0x3b7039=_0x36416a['segment'],_0x12c9c9=await _0x5a575b[_0x16f7e4(0x1f3)][_0x16f7e4(0x1bc)](_0x3b7039);return{'audienceId':_0x12c9c9[_0x16f7e4(0x1bd)],'audienceName':_0x12c9c9[_0x16f7e4(0x1d2)],..._0x12c9c9[_0x16f7e4(0x22e)]&&{'segmentId':_0x12c9c9[_0x16f7e4(0x22e)],'segmentName':_0x12c9c9[_0x16f7e4(0x20b)]}};}function buildConnectorConfig(_0x489007){const _0x563bde=a16_0x1ecb,_0x432346=_0x489007['emailSenderId'],_0x409a78=_0x489007[_0x563bde(0x223)];if(!_0x432346&&!_0x409a78)return undefined;return{..._0x432346&&{'emailSenderId':_0x432346},..._0x409a78&&{'jsonColumns':_0x409a78}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1d5);['description']=a16_0x5718b5(0x1d4);async[a16_0x5718b5(0x1ae)](_0x15b629){const _0x435970=a16_0x5718b5,{options:_0x5c27eb,args:_0x2397f0,tdx:_0x252398}=_0x15b629,_0x38091c=_0x2397f0[0x0],_0x462952=resolveLimit(_0x5c27eb['limit'],DEFAULT_LLM_LIMIT),_0x137ef=_0x5c27eb,_0x354e95=_0x137ef['type'],_0x5a147e=_0x137ef[_0x435970(0x1e2)],_0x462854=await resolveWorkspaceIdFromOptions(_0x137ef,_0x252398),_0x4811af=await withSpinner(_0x435970(0x1e8),()=>_0x252398[_0x435970(0x1ba)][_0x435970(0x1d6)]({'type':_0x354e95,'status':_0x5a147e,'workspaceId':_0x462854,'limit':_0x462952}),{'verbose':_0x5c27eb[_0x435970(0x1c8)]});let _0x22de6d=_0x4811af[_0x435970(0x208)];return _0x38091c&&(_0x22de6d=_0x4811af[_0x435970(0x208)][_0x435970(0x1cd)](_0x267cee=>matchGlobPattern(_0x267cee[_0x435970(0x1cc)],_0x38091c))),await handleSDKOutput(_0x22de6d,_0x5c27eb),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1c7);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x204);async[a16_0x5718b5(0x1ae)](_0x3605da){const _0x4fec26=a16_0x5718b5,{options:_0x2f086,args:_0x13d68f,tdx:_0x25b25c}=_0x3605da;if(_0x13d68f[_0x4fec26(0x207)]===0x0)return console['error'](_0x4fec26(0x1bf)),console[_0x4fec26(0x1ef)](_0x4fec26(0x216)),0x1;const _0x24a4cf=_0x13d68f[0x0],_0x1a2436=_0x2f086,_0x69222=await resolveWorkspaceIdFromOptions(_0x1a2436,_0x25b25c),_0x3c8030=_0x1a2436[_0x4fec26(0x1ec)];if(_0x3c8030){const _0x285fa4=await withSpinner(_0x4fec26(0x218)+_0x24a4cf+'\x27...',()=>_0x25b25c['engage'][_0x4fec26(0x22c)](_0x24a4cf,_0x69222),{'verbose':_0x2f086[_0x4fec26(0x1c8)]});await handleSDKOutput([_0x285fa4],_0x2f086);}else{const _0x262d1b=await withSpinner(_0x4fec26(0x218)+_0x24a4cf+_0x4fec26(0x1b7),()=>_0x25b25c['engage'][_0x4fec26(0x231)](_0x24a4cf,_0x69222),{'verbose':_0x2f086['verbose']});await handleSDKOutput([_0x262d1b],_0x2f086);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x213);[a16_0x5718b5(0x235)]='Create\x20a\x20new\x20campaign';async[a16_0x5718b5(0x1ae)](_0x5585b6){const _0x4f0be0=a16_0x5718b5,{options:_0x13841a,tdx:_0x1654f3}=_0x5585b6,_0x481502=_0x13841a,_0x5062d0=_0x481502[_0x4f0be0(0x1cc)],_0x4cef4c=_0x481502[_0x4f0be0(0x22d)];if(!_0x5062d0)return console[_0x4f0be0(0x1ef)](_0x4f0be0(0x215)),console['error'](_0x4f0be0(0x1d8)),0x1;if(!_0x4cef4c)return console[_0x4f0be0(0x1ef)](_0x4f0be0(0x20a)),console[_0x4f0be0(0x1ef)](_0x4f0be0(0x1d8)),0x1;const _0x568ce8=await resolveWorkspaceIdFromOptions(_0x481502,_0x1654f3,!![]),_0x32bb4f=await resolveSegmentFromOptions(_0x481502,_0x1654f3),_0x51f2c1=buildConnectorConfig(_0x481502),_0x569be5={'name':_0x5062d0,'campaignType':_0x4cef4c,'workspaceId':_0x568ce8,'description':_0x481502[_0x4f0be0(0x235)],..._0x32bb4f,'connectorConfig':_0x51f2c1,'startAt':_0x481502[_0x4f0be0(0x203)],'timezone':_0x481502['timezone']},_0x1919d7=await withSpinner(_0x4f0be0(0x226)+_0x5062d0+'\x27...',()=>_0x1654f3[_0x4f0be0(0x1ba)][_0x4f0be0(0x21b)](_0x569be5));return await handleSDKOutput([_0x1919d7['data']],_0x13841a),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1d0);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1ad);async[a16_0x5718b5(0x1ae)](_0x47dc81){const _0x41e03c=a16_0x5718b5,{options:_0x346e01,args:_0x3ef185,tdx:_0x23d3a0}=_0x47dc81;if(_0x3ef185[_0x41e03c(0x207)]===0x0)return console['error'](_0x41e03c(0x1bf)),console[_0x41e03c(0x1ef)](_0x41e03c(0x1f5)),0x1;const _0x37871f=_0x3ef185[0x0],_0x37bf13=_0x346e01,_0x3ec82e=await resolveWorkspaceIdFromOptions(_0x37bf13,_0x23d3a0),_0x3eb584=await resolveSegmentFromOptions(_0x37bf13,_0x23d3a0),_0x33e15f=buildConnectorConfig(_0x37bf13),_0x5cb2ee={'name':_0x37bf13['name'],'description':_0x37bf13['description'],..._0x3eb584,'connectorConfig':_0x33e15f,'startAt':_0x37bf13['startAt'],'timezone':_0x37bf13[_0x41e03c(0x232)]},_0x8e87a6=Object[_0x41e03c(0x1b4)](Object[_0x41e03c(0x1b3)](_0x5cb2ee)[_0x41e03c(0x1cd)](([,_0x123104])=>_0x123104!==undefined));if(Object[_0x41e03c(0x1dd)](_0x8e87a6)['length']===0x0)return console[_0x41e03c(0x1ef)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error']('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x30d5fd=await withSpinner(_0x41e03c(0x1fe)+_0x37871f+'\x27...',()=>_0x23d3a0[_0x41e03c(0x1ba)][_0x41e03c(0x205)](_0x37871f,_0x8e87a6,_0x3ec82e),{'verbose':_0x346e01[_0x41e03c(0x1c8)]});return await handleSDKOutput([_0x30d5fd[_0x41e03c(0x208)]],_0x346e01),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a16_0x5718b5(0x1c2);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1ab);async['execute'](_0x21bcba){const _0x674b59=a16_0x5718b5,{options:_0xc3c27a,args:_0x17427c,tdx:_0x32d228}=_0x21bcba;if(_0x17427c[_0x674b59(0x207)]===0x0)return console['error'](_0x674b59(0x1bf)),console[_0x674b59(0x1ef)](_0x674b59(0x20f)),0x1;const _0x2a8fe7=_0x17427c[0x0],_0x48fc6d=_0xc3c27a,_0x4e1a3d=await resolveWorkspaceIdFromOptions(_0x48fc6d,_0x32d228);if(!_0xc3c27a[_0x674b59(0x1f9)]){const _0x5be481=await confirm(_0x674b59(0x21a)+_0x2a8fe7+_0x674b59(0x1cb));if(!_0x5be481)return console[_0x674b59(0x1f6)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x674b59(0x21f)+_0x2a8fe7+_0x674b59(0x1b7),()=>_0x32d228[_0x674b59(0x1ba)]['deleteCampaign'](_0x2a8fe7,_0x4e1a3d),{'verbose':_0xc3c27a[_0x674b59(0x1c8)]}),console['log'](_0x674b59(0x1b5)+_0x2a8fe7+_0x674b59(0x1ed)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1af);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1c5);async[a16_0x5718b5(0x1ae)](_0x31b7bd){const _0x149e93=a16_0x5718b5,{options:_0x540b3c,args:_0x1d4495,tdx:_0x400e1c}=_0x31b7bd;if(_0x1d4495['length']===0x0)return console[_0x149e93(0x1ef)](_0x149e93(0x1bf)),console[_0x149e93(0x1ef)](_0x149e93(0x1ee)),0x1;const _0x57287e=_0x1d4495[0x0],_0x3fafb4=_0x540b3c,_0x436e20=await resolveWorkspaceIdFromOptions(_0x3fafb4,_0x400e1c);return await withSpinner(_0x149e93(0x1ea)+_0x57287e+_0x149e93(0x1b7),()=>_0x400e1c[_0x149e93(0x1ba)][_0x149e93(0x230)](_0x57287e,_0x436e20),{'verbose':_0x540b3c[_0x149e93(0x1c8)]}),console['log'](_0x149e93(0x1b5)+_0x57287e+_0x149e93(0x1ac)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:campaign:pause';[a16_0x5718b5(0x235)]='Pause\x20a\x20campaign';async[a16_0x5718b5(0x1ae)](_0x12fe8f){const _0x241470=a16_0x5718b5,{options:_0x248123,args:_0x5a90e0,tdx:_0x1f775f}=_0x12fe8f;if(_0x5a90e0[_0x241470(0x207)]===0x0)return console[_0x241470(0x1ef)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x241470(0x1ef)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0xd4d9a8=_0x5a90e0[0x0],_0x33a15d=_0x248123,_0x9642cb=await resolveWorkspaceIdFromOptions(_0x33a15d,_0x1f775f);return await withSpinner('Pausing\x20campaign\x20\x27'+_0xd4d9a8+_0x241470(0x1b7),()=>_0x1f775f[_0x241470(0x1ba)][_0x241470(0x209)](_0xd4d9a8,_0x9642cb),{'verbose':_0x248123[_0x241470(0x1c8)]}),console[_0x241470(0x1f6)](_0x241470(0x1b5)+_0xd4d9a8+_0x241470(0x1d1)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:campaign:resume';[a16_0x5718b5(0x235)]='Resume\x20a\x20paused\x20campaign';async['execute'](_0x183408){const _0x11eeaa=a16_0x5718b5,{options:_0x5caf49,args:_0x26e2b5,tdx:_0x211210}=_0x183408;if(_0x26e2b5[_0x11eeaa(0x207)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x11eeaa(0x1db)),0x1;const _0x6cde9=_0x26e2b5[0x0],_0x2cac26=_0x5caf49,_0x5c12d2=await resolveWorkspaceIdFromOptions(_0x2cac26,_0x211210);return await withSpinner(_0x11eeaa(0x1da)+_0x6cde9+_0x11eeaa(0x1b7),()=>_0x211210[_0x11eeaa(0x1ba)][_0x11eeaa(0x1cf)](_0x6cde9,_0x5c12d2),{'verbose':_0x5caf49['verbose']}),console['log']('Campaign\x20\x27'+_0x6cde9+_0x11eeaa(0x1fc)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1e0);['description']=a16_0x5718b5(0x1f1);async[a16_0x5718b5(0x1ae)](_0x497982){const _0x4298c5=a16_0x5718b5,{options:_0x262097,args:_0x4ecbd0,tdx:_0x4aa269}=_0x497982;if(_0x4ecbd0[_0x4298c5(0x207)]===0x0)return console['error'](_0x4298c5(0x1bf)),console[_0x4298c5(0x1ef)](_0x4298c5(0x21c)),0x1;const _0x2beca2=_0x4ecbd0[0x0],_0x2449ff=_0x262097,_0x5c50ad=await resolveWorkspaceIdFromOptions(_0x2449ff,_0x4aa269),_0x169e1e=await withSpinner(_0x4298c5(0x1b6)+_0x2beca2+_0x4298c5(0x1b7),()=>_0x4aa269[_0x4298c5(0x1ba)][_0x4298c5(0x221)](_0x2beca2,_0x5c50ad),{'verbose':_0x262097[_0x4298c5(0x1c8)]});return await handleSDKOutput([_0x169e1e[_0x4298c5(0x208)]],_0x262097),0x0;}}function a16_0x1ecb(_0x38fa3e,_0x595111){_0x38fa3e=_0x38fa3e-0x1ab;const _0x4a9c1b=a16_0x4a9c();let _0x1ecbc3=_0x4a9c1b[_0x38fa3e];return _0x1ecbc3;}export class EngageTemplatesCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x234);['description']='List\x20email\x20templates';async[a16_0x5718b5(0x1ae)](_0x2778d8){const _0x33616b=a16_0x5718b5,{options:_0x9a5ea3,args:_0x4afd38,tdx:_0x5a6936}=_0x2778d8,_0x4f1e6f=_0x4afd38[0x0],_0x9fab09=resolveLimit(_0x9a5ea3[_0x33616b(0x1bb)],DEFAULT_LLM_LIMIT),_0x4c4502=_0x9a5ea3,_0x114fd3=await resolveWorkspaceIdFromOptions(_0x4c4502,_0x5a6936),_0x228bb4=await withSpinner(_0x33616b(0x1ff),()=>_0x5a6936[_0x33616b(0x1ba)][_0x33616b(0x1f2)]({'workspaceId':_0x114fd3,'limit':_0x9fab09}),{'verbose':_0x9a5ea3[_0x33616b(0x1c8)]});let _0x438870=_0x228bb4[_0x33616b(0x208)];return _0x4f1e6f&&(_0x438870=_0x228bb4['data'][_0x33616b(0x1cd)](_0x59f5ad=>matchGlobPattern(_0x59f5ad['name'],_0x4f1e6f))),await handleSDKOutput(_0x438870,_0x9a5ea3),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x20e);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1b0);async[a16_0x5718b5(0x1ae)](_0x3ad0f9){const _0x385352=a16_0x5718b5,{options:_0x6aed2f,args:_0x3ac7ab,tdx:_0x1215fa}=_0x3ad0f9;if(_0x3ac7ab[_0x385352(0x207)]===0x0)return console[_0x385352(0x1ef)](_0x385352(0x1b9)),console[_0x385352(0x1ef)]('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x5d7a63=_0x3ac7ab[0x0],_0x366222=_0x6aed2f,_0x2d6ea5=await resolveWorkspaceIdFromOptions(_0x366222,_0x1215fa),_0x358a6a=_0x366222[_0x385352(0x1ec)];if(_0x358a6a){const _0x5a5f46=await withSpinner(_0x385352(0x219)+_0x5d7a63+_0x385352(0x1b7),()=>_0x1215fa[_0x385352(0x1ba)][_0x385352(0x22a)](_0x5d7a63,_0x2d6ea5),{'verbose':_0x6aed2f[_0x385352(0x1c8)]});await handleSDKOutput([_0x5a5f46],_0x6aed2f);}else{const _0x3e171e=await withSpinner(_0x385352(0x219)+_0x5d7a63+_0x385352(0x1b7),()=>_0x1215fa[_0x385352(0x1ba)][_0x385352(0x229)](_0x5d7a63,_0x2d6ea5),{'verbose':_0x6aed2f[_0x385352(0x1c8)]});await handleSDKOutput([_0x3e171e],_0x6aed2f);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:template:create';[a16_0x5718b5(0x235)]=a16_0x5718b5(0x217);async[a16_0x5718b5(0x1ae)](_0x3ac5c6){const _0x23c1cf=a16_0x5718b5,{options:_0x4450a1,tdx:_0x49c11c}=_0x3ac5c6,_0xbe5812=_0x4450a1,_0x2d2fb5=_0xbe5812['name'],_0xcb2ed5=_0xbe5812['subject'],_0x51317d=_0xbe5812['html'];if(!_0x2d2fb5)return console[_0x23c1cf(0x1ef)](_0x23c1cf(0x215)),console[_0x23c1cf(0x1ef)](_0x23c1cf(0x227)),0x1;if(!_0xcb2ed5)return console['error'](_0x23c1cf(0x1e9)),0x1;if(!_0x51317d)return console[_0x23c1cf(0x1ef)](_0x23c1cf(0x210)),0x1;const _0xa65232=await resolveWorkspaceIdFromOptions(_0xbe5812,_0x49c11c,!![]),_0x23e8d8={'name':_0x2d2fb5,'subjectTemplate':_0xcb2ed5,'htmlTemplate':_0x51317d,'workspaceId':_0xa65232,'plaintextTemplate':_0xbe5812['plaintext'],'editorType':_0xbe5812[_0x23c1cf(0x1dc)]},_0x2726f8=await withSpinner('Creating\x20template\x20\x27'+_0x2d2fb5+'\x27...',()=>_0x49c11c[_0x23c1cf(0x1ba)][_0x23c1cf(0x1e1)](_0x23e8d8));return await handleSDKOutput([_0x2726f8[_0x23c1cf(0x208)]],_0x4450a1),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:template:update';[a16_0x5718b5(0x235)]='Update\x20an\x20email\x20template';async['execute'](_0x2ab12f){const _0x10848e=a16_0x5718b5,{options:_0x4c2eb7,args:_0x40a945,tdx:_0x1a16c8}=_0x2ab12f;if(_0x40a945[_0x10848e(0x207)]===0x0)return console[_0x10848e(0x1ef)](_0x10848e(0x1b9)),console[_0x10848e(0x1ef)](_0x10848e(0x236)),0x1;const _0x5c3a60=_0x40a945[0x0],_0x1ee728=_0x4c2eb7,_0x696fc3=await resolveWorkspaceIdFromOptions(_0x1ee728,_0x1a16c8),_0x5bf89a={'name':_0x1ee728[_0x10848e(0x1cc)],'subjectTemplate':_0x1ee728[_0x10848e(0x222)],'htmlTemplate':_0x1ee728[_0x10848e(0x1c9)],'plaintextTemplate':_0x1ee728[_0x10848e(0x228)]},_0x2850a1=Object[_0x10848e(0x1b4)](Object[_0x10848e(0x1b3)](_0x5bf89a)[_0x10848e(0x1cd)](([,_0x582e05])=>_0x582e05!==undefined));if(Object['keys'](_0x2850a1)[_0x10848e(0x207)]===0x0)return console[_0x10848e(0x1ef)](_0x10848e(0x21d)),console[_0x10848e(0x1ef)](_0x10848e(0x1c0)),0x1;const _0x29bf57=await withSpinner('Updating\x20template\x20\x27'+_0x5c3a60+_0x10848e(0x1b7),()=>_0x1a16c8['engage']['updateTemplate'](_0x5c3a60,_0x2850a1,_0x696fc3),{'verbose':_0x4c2eb7['verbose']});return await handleSDKOutput([_0x29bf57[_0x10848e(0x208)]],_0x4c2eb7),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1e4);[a16_0x5718b5(0x235)]='Delete\x20an\x20email\x20template';async[a16_0x5718b5(0x1ae)](_0x10c542){const _0x184e0f=a16_0x5718b5,{options:_0x51dcac,args:_0x4f37b4,tdx:_0x3635f8}=_0x10c542;if(_0x4f37b4[_0x184e0f(0x207)]===0x0)return console[_0x184e0f(0x1ef)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x184e0f(0x1ef)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x8e464a=_0x4f37b4[0x0],_0x2c6d82=_0x51dcac,_0x46692a=await resolveWorkspaceIdFromOptions(_0x2c6d82,_0x3635f8);if(!_0x51dcac[_0x184e0f(0x1f9)]){const _0x157c0f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x8e464a+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x157c0f)return console['log'](_0x184e0f(0x1f4)),0x0;}return await withSpinner(_0x184e0f(0x20c)+_0x8e464a+_0x184e0f(0x1b7),()=>_0x3635f8[_0x184e0f(0x1ba)][_0x184e0f(0x220)](_0x8e464a,_0x46692a),{'verbose':_0x51dcac[_0x184e0f(0x1c8)]}),console[_0x184e0f(0x1f6)]('Template\x20\x27'+_0x8e464a+_0x184e0f(0x1ed)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:workspaces';[a16_0x5718b5(0x235)]='List\x20workspaces';async[a16_0x5718b5(0x1ae)](_0x204831){const _0x1d56b5=a16_0x5718b5,{options:_0x1c06cf,args:_0x2a5508,tdx:_0x8bb03b}=_0x204831,_0x5c422d=_0x2a5508[0x0],_0xf171fc=resolveLimit(_0x1c06cf[_0x1d56b5(0x1bb)],DEFAULT_LLM_LIMIT),_0x18443c=await withSpinner('Fetching\x20workspaces...',()=>_0x8bb03b['engage']['listWorkspaces']({'limit':_0xf171fc}),{'verbose':_0x1c06cf[_0x1d56b5(0x1c8)]});let _0x5b212d=_0x18443c['data'];return _0x5c422d&&(_0x5b212d=_0x18443c[_0x1d56b5(0x208)][_0x1d56b5(0x1cd)](_0x56365b=>matchGlobPattern(_0x56365b[_0x1d56b5(0x1cc)],_0x5c422d))),await handleSDKOutput(_0x5b212d,_0x1c06cf),0x0;}}function a16_0x4a9c(){const _0x4b6feb=['error','engage:workspace:delete','Duplicate\x20a\x20campaign','listTemplates','segment','Operation\x20cancelled','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','log','9284443iudaWx','Workspace\x20\x27','yes','engage:workspace:update','3105585zuOexP','\x27\x20resumed\x20successfully','5890026SebkGq','Updating\x20campaign\x20\x27','Fetching\x20templates...','60380jbEPCA','engage:workspace:create','8xxnswu','startAt','Show\x20campaign\x20details','updateCampaign','Show\x20workspace\x20details','length','data','pauseCampaign','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','segmentName','Deleting\x20template\x20\x27','Engage\x20workspace\x20set\x20to:\x20','engage:template:show','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Error:\x20--html\x20is\x20required','Workspace\x20is\x20required\x20for\x20this\x20operation','engage_workspace','engage:campaign:create','updateWorkspace','Error:\x20--name\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Create\x20an\x20email\x20template','Fetching\x20campaign\x20\x27','Fetching\x20template\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','createCampaign','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','session','Deleting\x20campaign\x20\x27','deleteTemplate','duplicateCampaign','subject','jsonColumns','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Creating\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','plaintext','getTemplate','getTemplateFull','deleteWorkspace','getCampaignFull','type','segmentId','5634XWgyPU','launchCampaign','getCampaign','timezone','resolveWorkspaceId','engage:templates','description','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Delete\x20a\x20campaign','\x27\x20launched\x20successfully','Update\x20a\x20campaign','execute','engage:campaign:launch','Show\x20email\x20template\x20details','912026njzGcb','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','entries','fromEntries','Campaign\x20\x27','Duplicating\x20campaign\x20\x27','\x27...','Updating\x20workspace\x20\x27','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','engage','limit','resolvePathToResource','parentId','MISSING_ARGUMENT','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Create\x20a\x20workspace','engage:campaign:delete','workspace','Verifying\x20workspace\x20\x27','Launch\x20a\x20campaign','engage:workspace:show','engage:campaign:show','verbose','html','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','\x27?\x20This\x20cannot\x20be\x20undone.','name','filter','Creating\x20workspace\x20\x27','resumeCampaign','engage:campaign:update','\x27\x20paused\x20successfully','parentName','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','List\x20campaigns','engage:campaigns','listCampaigns','Fetching\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Options:\x20--name,\x20--description','Resuming\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','editorType','keys','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','12yiogHW','engage:campaign:duplicate','createTemplate','status','createWorkspace','engage:template:delete','3977596NHOmJz','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','1670066vEVmHk','Fetching\x20campaigns...','Error:\x20--subject\x20is\x20required','Launching\x20campaign\x20\x27','Set\x20workspace\x20context\x20for\x20Engage\x20commands','full','\x27\x20deleted\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'];a16_0x4a9c=function(){return _0x4b6feb;};return a16_0x4a9c();}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1c6);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x206);async['execute'](_0x53de1d){const _0x468499=a16_0x5718b5,{options:_0x2fa37b,args:_0x2d1332,tdx:_0x4b58a1}=_0x53de1d;if(_0x2d1332['length']===0x0)return console[_0x468499(0x1ef)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x468499(0x1ef)](_0x468499(0x225)),0x1;const _0x529250=_0x2d1332[0x0],_0xd72e1d=_0x2fa37b,_0x5609dc=_0xd72e1d[_0x468499(0x1ec)];if(_0x5609dc){const _0x3ae9e0=await withSpinner('Fetching\x20workspace\x20\x27'+_0x529250+'\x27...',()=>_0x4b58a1[_0x468499(0x1ba)]['getWorkspaceFull'](_0x529250),{'verbose':_0x2fa37b[_0x468499(0x1c8)]});await handleSDKOutput([_0x3ae9e0],_0x2fa37b);}else{const _0x2cf79f=await withSpinner(_0x468499(0x1d7)+_0x529250+_0x468499(0x1b7),()=>_0x4b58a1[_0x468499(0x1ba)]['getWorkspace'](_0x529250),{'verbose':_0x2fa37b[_0x468499(0x1c8)]});await handleSDKOutput([_0x2cf79f],_0x2fa37b);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x201);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1c1);async[a16_0x5718b5(0x1ae)](_0x18c34d){const _0x577956=a16_0x5718b5,{options:_0x5e7c7f,tdx:_0x369ba5}=_0x18c34d,_0x493261=_0x5e7c7f,_0x5b4d18=_0x493261[_0x577956(0x1cc)];if(!_0x5b4d18)return console[_0x577956(0x1ef)](_0x577956(0x215)),console[_0x577956(0x1ef)](_0x577956(0x1d3)),0x1;const _0x2ff63a={'name':_0x5b4d18,'description':_0x493261[_0x577956(0x235)]},_0x280d15=await withSpinner(_0x577956(0x1ce)+_0x5b4d18+_0x577956(0x1b7),()=>_0x369ba5['engage'][_0x577956(0x1e3)](_0x2ff63a));return await handleSDKOutput([_0x280d15[_0x577956(0x208)]],_0x5e7c7f),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1fa);[a16_0x5718b5(0x235)]='Update\x20a\x20workspace';async[a16_0x5718b5(0x1ae)](_0x3cb90d){const _0x7593fc=a16_0x5718b5,{options:_0x530bae,args:_0x12337d,tdx:_0x5bc619}=_0x3cb90d;if(_0x12337d['length']===0x0)return console[_0x7593fc(0x1ef)](_0x7593fc(0x1b2)),console[_0x7593fc(0x1ef)](_0x7593fc(0x1e6)),0x1;const _0x374a2d=_0x12337d[0x0],_0x4a625c=_0x530bae,_0x134580={'name':_0x4a625c[_0x7593fc(0x1cc)],'description':_0x4a625c[_0x7593fc(0x235)]},_0x420152=Object[_0x7593fc(0x1b4)](Object[_0x7593fc(0x1b3)](_0x134580)['filter'](([,_0x5867aa])=>_0x5867aa!==undefined));if(Object['keys'](_0x420152)[_0x7593fc(0x207)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x7593fc(0x1d9)),0x1;const _0x553aec=await withSpinner(_0x7593fc(0x1b8)+_0x374a2d+_0x7593fc(0x1b7),()=>_0x5bc619[_0x7593fc(0x1ba)][_0x7593fc(0x214)](_0x374a2d,_0x420152),{'verbose':_0x530bae['verbose']});return await handleSDKOutput([_0x553aec[_0x7593fc(0x208)]],_0x530bae),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1f0);['description']='Delete\x20a\x20workspace';async[a16_0x5718b5(0x1ae)](_0xcd03f6){const _0x33bb3d=a16_0x5718b5,{options:_0x34787f,args:_0x44e99c,tdx:_0x4dcb35}=_0xcd03f6;if(_0x44e99c[_0x33bb3d(0x207)]===0x0)return console[_0x33bb3d(0x1ef)](_0x33bb3d(0x1b2)),console[_0x33bb3d(0x1ef)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x567e3f=_0x44e99c[0x0];if(!_0x34787f[_0x33bb3d(0x1f9)]){const _0x4e5082=await confirm(_0x33bb3d(0x224)+_0x567e3f+_0x33bb3d(0x1cb));if(!_0x4e5082)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x567e3f+_0x33bb3d(0x1b7),()=>_0x4dcb35[_0x33bb3d(0x1ba)][_0x33bb3d(0x22b)](_0x567e3f),{'verbose':_0x34787f[_0x33bb3d(0x1c8)]}),console[_0x33bb3d(0x1f6)](_0x33bb3d(0x1f8)+_0x567e3f+_0x33bb3d(0x1ed)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:workspace:use';[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1eb);async[a16_0x5718b5(0x1ae)](_0x12357f){const _0x4e03cb=a16_0x5718b5,{options:_0x8a8b5e,args:_0xbfef63,tdx:_0x4dee93}=_0x12357f;if(_0xbfef63[_0x4e03cb(0x207)]===0x0)return console['error']('Error:\x20Workspace\x20name\x20is\x20required'),console['error'](_0x4e03cb(0x1de)),0x1;const _0x57ad51=_0xbfef63[0x0];await withSpinner(_0x4e03cb(0x1c4)+_0x57ad51+'\x27...',()=>_0x4dee93[_0x4e03cb(0x1ba)][_0x4e03cb(0x233)](_0x57ad51));const _0x5ed542=_0x8a8b5e[_0x4e03cb(0x21e)]||undefined;return saveSessionContext({'engage_workspace':_0x57ad51},_0x5ed542),console[_0x4e03cb(0x1f6)](_0x4e03cb(0x20d)+_0x57ad51),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a17_0x298d66=a17_0x5472;function a17_0x5472(_0x4452ae,_0x2da21d){_0x4452ae=_0x4452ae-0x82;const _0x4269a8=a17_0x4269();let _0x5472c2=_0x4269a8[_0x4452ae];return _0x5472c2;}(function(_0x213376,_0x273254){const _0x3bd909=a17_0x5472,_0x299c60=_0x213376();while(!![]){try{const _0x3ddc9b=-parseInt(_0x3bd909(0xa9))/0x1+-parseInt(_0x3bd909(0x90))/0x2+parseInt(_0x3bd909(0xbb))/0x3*(parseInt(_0x3bd909(0xae))/0x4)+parseInt(_0x3bd909(0xc0))/0x5*(-parseInt(_0x3bd909(0xa1))/0x6)+-parseInt(_0x3bd909(0xa3))/0x7+parseInt(_0x3bd909(0xc4))/0x8+parseInt(_0x3bd909(0xa7))/0x9;if(_0x3ddc9b===_0x273254)break;else _0x299c60['push'](_0x299c60['shift']());}catch(_0x5c1c43){_0x299c60['push'](_0x299c60['shift']());}}}(a17_0x4269,0x57dc0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{[a17_0x298d66(0xa6)]=a17_0x298d66(0xba);['description']=a17_0x298d66(0x9a);async['execute'](_0x4f714){const _0x39d2d5=a17_0x298d66,{options:_0x1136b5,tdx:_0x5a0cc0}=_0x4f714;try{const _0x2875aa=resolveLimit(_0x1136b5[_0x39d2d5(0xb1)],DEFAULT_DISPLAY_LIMIT),_0x1ed8b7=_0x1136b5[_0x39d2d5(0xad)];_0x1136b5[_0x39d2d5(0xaf)]&&(console[_0x39d2d5(0x99)](_0x39d2d5(0xbf)+_0x2875aa+_0x39d2d5(0xbc)),_0x1ed8b7&&console[_0x39d2d5(0x99)](_0x39d2d5(0xcc)+_0x1ed8b7));const _0x35dc49=await withSpinner(_0x39d2d5(0xb6),()=>_0x5a0cc0[_0x39d2d5(0xba)]['list']({'from':0x0,'to':_0x2875aa-0x1,'status':_0x1ed8b7}),{'verbose':_0x1136b5[_0x39d2d5(0xaf)]}),_0x872227=_0x35dc49[_0x39d2d5(0xc5)];console['error'](_0x39d2d5(0x88)+_0x872227[_0x39d2d5(0xa8)]+'\x20job'+(_0x872227[_0x39d2d5(0xa8)]!==0x1?'s':''));const _0x18c6e2=_0x872227['map'](_0x217c2c=>{const _0x21f5e8=_0x39d2d5;let _0x4b2351;if(_0x217c2c[_0x21f5e8(0xa2)]&&_0x217c2c[_0x21f5e8(0x94)]){const _0x41bc7=new Date(_0x217c2c[_0x21f5e8(0xa2)])[_0x21f5e8(0xb4)](),_0x5c3695=new Date(_0x217c2c['end_at'])[_0x21f5e8(0xb4)]();_0x4b2351=Math['round']((_0x5c3695-_0x41bc7)/0x3e8);}return{'job_id':_0x217c2c['job_id'],'type':_0x217c2c[_0x21f5e8(0xb9)],'status':_0x217c2c[_0x21f5e8(0xad)],'user_name':_0x217c2c[_0x21f5e8(0x82)],'duration_sec':_0x4b2351,'created_at':_0x217c2c['created_at'],'started_at':_0x217c2c[_0x21f5e8(0xa2)],'end_at':_0x217c2c[_0x21f5e8(0x94)]};});return await handleSDKOutput(_0x18c6e2,_0x1136b5),0x0;}catch(_0x2cb1c4){if(_0x2cb1c4 instanceof SDKError)return console[_0x39d2d5(0x99)](_0x39d2d5(0xaa)+_0x2cb1c4[_0x39d2d5(0xbe)]),_0x2cb1c4[_0x39d2d5(0xcb)]&&console[_0x39d2d5(0x99)](_0x39d2d5(0xb8)+_0x2cb1c4[_0x39d2d5(0xcb)]),0x1;throw _0x2cb1c4;}}}export class JobShowCommand extends BaseCommand{[a17_0x298d66(0xa6)]=a17_0x298d66(0x9f);[a17_0x298d66(0xc3)]=a17_0x298d66(0x8c);async[a17_0x298d66(0x92)](_0x59aee0){const _0x1f12fa=a17_0x298d66,{options:_0x3c3f68,args:_0x391e13,tdx:_0x1c7d28}=_0x59aee0,_0x4d4a0b=_0x391e13[0x0];if(!_0x4d4a0b)return console['error'](_0x1f12fa(0xca)),console[_0x1f12fa(0x99)](_0x1f12fa(0x83)),0x1;try{const _0x3ef940=await withSpinner(_0x1f12fa(0xc6),()=>_0x1c7d28['jobs'][_0x1f12fa(0xbd)](_0x4d4a0b),{'verbose':_0x3c3f68[_0x1f12fa(0xaf)]}),_0x3aa726=_0x3ef940[_0x1f12fa(0xc5)];let _0x5686d3;if(_0x3aa726[_0x1f12fa(0xa2)]&&_0x3aa726[_0x1f12fa(0x94)]){const _0x5a73ab=new Date(_0x3aa726[_0x1f12fa(0xa2)])['getTime'](),_0x426a54=new Date(_0x3aa726[_0x1f12fa(0x94)])[_0x1f12fa(0xb4)]();_0x5686d3=Math[_0x1f12fa(0x96)]((_0x426a54-_0x5a73ab)/0x3e8);}const _0x1b43a7={'job_id':_0x3aa726[_0x1f12fa(0xab)],'type':_0x3aa726[_0x1f12fa(0xb9)],'status':_0x3aa726[_0x1f12fa(0xad)],..._0x3aa726[_0x1f12fa(0x82)]&&{'user_name':_0x3aa726[_0x1f12fa(0x82)]},..._0x5686d3!==undefined&&{'duration_sec':_0x5686d3},..._0x3aa726['created_at']&&{'created_at':_0x3aa726[_0x1f12fa(0x98)]},..._0x3aa726[_0x1f12fa(0xa2)]&&{'started_at':_0x3aa726[_0x1f12fa(0xa2)]},..._0x3aa726[_0x1f12fa(0x94)]&&{'end_at':_0x3aa726[_0x1f12fa(0x94)]},..._0x3aa726[_0x1f12fa(0x93)]&&{'database':_0x3aa726['database']},..._0x3aa726[_0x1f12fa(0x84)]!==undefined&&{'priority':_0x3aa726['priority']},..._0x3aa726[_0x1f12fa(0x8f)]&&{'url':_0x3aa726[_0x1f12fa(0x8f)]},..._0x3aa726[_0x1f12fa(0x9d)]&&{'query':_0x3aa726[_0x1f12fa(0x9d)]},..._0x3aa726['debug']&&{'debug':_0x3aa726['debug']}};return await handleSingleObjectOutput(_0x1b43a7,_0x3c3f68),0x0;}catch(_0x207319){if(_0x207319 instanceof SDKError)return console[_0x1f12fa(0x99)](_0x1f12fa(0xaa)+_0x207319[_0x1f12fa(0xbe)]),_0x207319['cause']&&console[_0x1f12fa(0x99)](_0x1f12fa(0xb8)+_0x207319['cause']),0x1;throw _0x207319;}}}export class JobKillCommand extends BaseCommand{['name']=a17_0x298d66(0x8a);[a17_0x298d66(0xc3)]=a17_0x298d66(0xa0);async[a17_0x298d66(0x92)](_0x28a96d){const _0x5848cf=a17_0x298d66,{options:_0x8841bc,args:_0x1b9b6a,tdx:_0x328351}=_0x28a96d,_0x55d0ef=_0x1b9b6a[0x0];if(!_0x55d0ef)return console['error'](_0x5848cf(0xca)),console[_0x5848cf(0x99)](_0x5848cf(0xb2)),0x1;try{if(!_0x8841bc['yes']){const _0xee07dd=await confirm(_0x5848cf(0xc1)+_0x55d0ef+'?');if(!_0xee07dd)return console[_0x5848cf(0x99)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x328351[_0x5848cf(0xba)][_0x5848cf(0xa5)](_0x55d0ef),{'verbose':_0x8841bc[_0x5848cf(0xaf)]}),console[_0x5848cf(0x99)](_0x5848cf(0x85)+_0x55d0ef),console[_0x5848cf(0x99)](_0x5848cf(0xb7)+_0x55d0ef+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}catch(_0x353335){if(_0x353335 instanceof SDKError)return console['error'](_0x5848cf(0xaa)+_0x353335[_0x5848cf(0xbe)]),_0x353335['cause']&&console[_0x5848cf(0x99)]('\x20\x20Cause:\x20'+_0x353335[_0x5848cf(0xcb)]),0x1;throw _0x353335;}}}export class JobSubmitCommand extends BaseCommand{[a17_0x298d66(0xa6)]='job:submit';[a17_0x298d66(0xc3)]=a17_0x298d66(0x89);async[a17_0x298d66(0x92)](_0x3d3079){const _0x2c3ae5=a17_0x298d66,{options:_0x423872,args:_0x90ee5e,tdx:_0xcb3b7f}=_0x3d3079;try{const _0x26bcf6=_0x423872[_0x2c3ae5(0x86)]||'trino',_0x2e7cd7=_0x423872[_0x2c3ae5(0x9c)],_0x2d0b15=_0x423872['database']||_0x2c3ae5(0x8e);if(_0x26bcf6!==_0x2c3ae5(0xc7)&&_0x26bcf6!==_0x2c3ae5(0xb0))return console[_0x2c3ae5(0x99)]('Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'),0x1;let _0x5ce017;if(_0x2e7cd7){if(_0x90ee5e[0x0])return console[_0x2c3ae5(0x99)](_0x2c3ae5(0x97)),0x1;const _0x3c8f31=readSqlStatementsFromFile(_0x2e7cd7);if(_0x3c8f31[_0x2c3ae5(0xa8)]===0x0)return console['error']('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x3c8f31[_0x2c3ae5(0xa8)]>0x1)return console[_0x2c3ae5(0x99)]('Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'),0x1;_0x5ce017=_0x3c8f31[0x0];}else{if(!_0x90ee5e[0x0])return console['error'](_0x2c3ae5(0xc9)),console[_0x2c3ae5(0x99)]('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0x5ce017=_0x90ee5e[0x0];}_0x423872[_0x2c3ae5(0xaf)]&&(console['error'](_0x2c3ae5(0x95)+_0x26bcf6),console[_0x2c3ae5(0x99)](_0x2c3ae5(0xc2)+_0x2d0b15),console[_0x2c3ae5(0x99)](_0x2c3ae5(0xb3)+_0x5ce017[_0x2c3ae5(0xb5)](0x0,0x64)+(_0x5ce017['length']>0x64?_0x2c3ae5(0x9b):'')));const _0x4721df=await withSpinner('Submitting\x20job...',()=>_0xcb3b7f['jobs']['submit'](_0x2d0b15,_0x5ce017,_0x26bcf6),{'verbose':_0x423872[_0x2c3ae5(0xaf)]}),_0x5ec2d7=_0x4721df['data'];return console[_0x2c3ae5(0x99)]('✔\x20Job\x20submitted'),console[_0x2c3ae5(0x99)](_0x2c3ae5(0xc8)+_0x5ec2d7[_0x2c3ae5(0xab)]),await handleSDKOutput([_0x5ec2d7],_0x423872),0x0;}catch(_0x363bdd){if(_0x363bdd instanceof SDKError)return console['error'](_0x2c3ae5(0xaa)+_0x363bdd[_0x2c3ae5(0xbe)]),_0x363bdd[_0x2c3ae5(0xcb)]&&console[_0x2c3ae5(0x99)](_0x2c3ae5(0xb8)+_0x363bdd['cause']),0x1;throw _0x363bdd;}}}function a17_0x4269(){const _0x560079=['status','754996YkZPzF','verbose','hive','limit','Usage:\x20job\x20kill\x20<job-id>','Query:\x20','getTime','substring','Listing\x20jobs...','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','\x20\x20Cause:\x20','type','jobs','6MIEftc','\x20jobs','show','message','Limit:\x20','110gqyPCN','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Database:\x20','description','5079536hsbTga','data','Getting\x20job\x20details...','trino','\x20\x20Job\x20ID:\x20','Error:\x20Query\x20is\x20required','Error:\x20Job\x20ID\x20is\x20required','cause','Status\x20filter:\x20','user_name','Usage:\x20job\x20show\x20<job-id>','priority','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','jobType','job:result','✔\x20Found\x20','Submit\x20a\x20job','job:kill','\x20row','Show\x20job\x20details','✔\x20Retrieved\x20','information_schema','url','485968xbYWLd','result','execute','database','end_at','Job\x20type:\x20','round','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','created_at','error','List\x20jobs','...','file','query','Getting\x20job\x20results...','job:show','Kill\x20a\x20job','10446XfZVWS','start_at','1023372refVXY','Get\x20job\x20results','kill','name','2356569uiLZlm','length','486927qBQEmY','Error:\x20','job_id','Usage:\x20job\x20result\x20<job-id>'];a17_0x4269=function(){return _0x560079;};return a17_0x4269();}export class JobResultCommand extends BaseCommand{[a17_0x298d66(0xa6)]=a17_0x298d66(0x87);[a17_0x298d66(0xc3)]=a17_0x298d66(0xa4);async['execute'](_0x4714ba){const _0x5b9f53=a17_0x298d66,{options:_0x38b524,args:_0x48a55e,tdx:_0x5376e5}=_0x4714ba,_0x2bc1d8=_0x48a55e[0x0];if(!_0x2bc1d8)return console[_0x5b9f53(0x99)](_0x5b9f53(0xca)),console[_0x5b9f53(0x99)](_0x5b9f53(0xac)),0x1;try{const _0x6ff3f4=await withSpinner(_0x5b9f53(0x9e),()=>_0x5376e5[_0x5b9f53(0xba)][_0x5b9f53(0x91)](_0x2bc1d8),{'verbose':_0x38b524['verbose']}),_0x150a1f=_0x6ff3f4[_0x5b9f53(0xc5)];return console[_0x5b9f53(0x99)](_0x5b9f53(0x8d)+_0x150a1f[_0x5b9f53(0xa8)]+_0x5b9f53(0x8b)+(_0x150a1f[_0x5b9f53(0xa8)]!==0x1?'s':'')),await handleSDKOutput(_0x150a1f,_0x38b524),0x0;}catch(_0xe3ed93){if(_0xe3ed93 instanceof SDKError)return console[_0x5b9f53(0x99)](_0x5b9f53(0xaa)+_0xe3ed93[_0x5b9f53(0xbe)]),_0xe3ed93[_0x5b9f53(0xcb)]&&console[_0x5b9f53(0x99)](_0x5b9f53(0xb8)+_0xe3ed93[_0x5b9f53(0xcb)]),0x1;throw _0xe3ed93;}}}
|
|
1
|
+
const a17_0x3d544b=a17_0x104a;(function(_0x2396da,_0x41cd61){const _0x1ec6b2=a17_0x104a,_0x571240=_0x2396da();while(!![]){try{const _0x2e2c4b=parseInt(_0x1ec6b2(0x12c))/0x1*(parseInt(_0x1ec6b2(0x12e))/0x2)+parseInt(_0x1ec6b2(0x152))/0x3+parseInt(_0x1ec6b2(0x144))/0x4*(parseInt(_0x1ec6b2(0x13b))/0x5)+parseInt(_0x1ec6b2(0x146))/0x6+-parseInt(_0x1ec6b2(0x13d))/0x7+-parseInt(_0x1ec6b2(0x11f))/0x8*(-parseInt(_0x1ec6b2(0x134))/0x9)+-parseInt(_0x1ec6b2(0x149))/0xa;if(_0x2e2c4b===_0x41cd61)break;else _0x571240['push'](_0x571240['shift']());}catch(_0x46b878){_0x571240['push'](_0x571240['shift']());}}}(a17_0x1984,0x97683));import{BaseCommand}from'./command.js';function a17_0x1984(){const _0x387d1a=['error','name','cause','data','map','execute','19sHHbBm','kill','80366MRkeeq','List\x20jobs','\x27\x20to\x20verify\x20the\x20job\x20status','information_schema','url','message','9AQejci','submit','\x20\x20Job\x20ID:\x20','Limit:\x20','priority','file','show','113840HEEfxi','...','7105861KaTmPi','limit','hive','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','✔\x20Job\x20submitted','Usage:\x20job\x20kill\x20<job-id>','trino','64BqiAxZ','\x20\x20Cause:\x20','4153806PDDAEX','Error:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','7876710ZXxkfP','getTime','database','job_id','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Status\x20filter:\x20','Submit\x20a\x20job','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','jobType','838014wiVlvD','result','Submitting\x20job...','start_at','query','verbose','Listing\x20jobs...','\x20job','jobs','Usage:\x20job\x20show\x20<job-id>','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','end_at','Submitting\x20kill\x20request...','\x20jobs','type','created_at','length','round','Query:\x20','Show\x20job\x20details','Error:\x20Job\x20ID\x20is\x20required','user_name','description','debug','Cancelled','2588424Fxwpkv','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','job:show','substring','status','job:kill','Usage:\x20job\x20result\x20<job-id>'];a17_0x1984=function(){return _0x387d1a;};return a17_0x1984();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a17_0x104a(_0x55c029,_0x2dd456){_0x55c029=_0x55c029-0x112;const _0x1984b0=a17_0x1984();let _0x104afd=_0x1984b0[_0x55c029];return _0x104afd;}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{['name']=a17_0x3d544b(0x15a);[a17_0x3d544b(0x11c)]=a17_0x3d544b(0x12f);async[a17_0x3d544b(0x12b)](_0x50e68f){const _0x128c6d=a17_0x3d544b,{options:_0x30c4d7,tdx:_0x49808d}=_0x50e68f;try{const _0x926787=resolveLimit(_0x30c4d7[_0x128c6d(0x13e)],DEFAULT_DISPLAY_LIMIT),_0x3991c8=_0x30c4d7[_0x128c6d(0x123)];_0x30c4d7[_0x128c6d(0x157)]&&(console[_0x128c6d(0x126)](_0x128c6d(0x137)+_0x926787+_0x128c6d(0x113)),_0x3991c8&&console['error'](_0x128c6d(0x14e)+_0x3991c8));const _0x5b4a79=await withSpinner(_0x128c6d(0x158),()=>_0x49808d[_0x128c6d(0x15a)]['list']({'from':0x0,'to':_0x926787-0x1,'status':_0x3991c8}),{'verbose':_0x30c4d7[_0x128c6d(0x157)]}),_0x2cac58=_0x5b4a79[_0x128c6d(0x129)];console[_0x128c6d(0x126)]('✔\x20Found\x20'+_0x2cac58['length']+_0x128c6d(0x159)+(_0x2cac58[_0x128c6d(0x116)]!==0x1?'s':''));const _0x6627c3=_0x2cac58[_0x128c6d(0x12a)](_0x22bc3a=>{const _0x3c027e=_0x128c6d;let _0x39ce01;if(_0x22bc3a[_0x3c027e(0x155)]&&_0x22bc3a['end_at']){const _0x2ee4e6=new Date(_0x22bc3a[_0x3c027e(0x155)])[_0x3c027e(0x14a)](),_0x33520f=new Date(_0x22bc3a[_0x3c027e(0x15d)])[_0x3c027e(0x14a)]();_0x39ce01=Math[_0x3c027e(0x117)]((_0x33520f-_0x2ee4e6)/0x3e8);}return{'job_id':_0x22bc3a[_0x3c027e(0x14c)],'type':_0x22bc3a['type'],'status':_0x22bc3a[_0x3c027e(0x123)],'user_name':_0x22bc3a['user_name'],'duration_sec':_0x39ce01,'created_at':_0x22bc3a[_0x3c027e(0x115)],'started_at':_0x22bc3a[_0x3c027e(0x155)],'end_at':_0x22bc3a[_0x3c027e(0x15d)]};});return await handleSDKOutput(_0x6627c3,_0x30c4d7),0x0;}catch(_0x19df60){if(_0x19df60 instanceof SDKError)return console[_0x128c6d(0x126)]('Error:\x20'+_0x19df60[_0x128c6d(0x133)]),_0x19df60[_0x128c6d(0x128)]&&console['error']('\x20\x20Cause:\x20'+_0x19df60[_0x128c6d(0x128)]),0x1;throw _0x19df60;}}}export class JobShowCommand extends BaseCommand{[a17_0x3d544b(0x127)]=a17_0x3d544b(0x121);['description']=a17_0x3d544b(0x119);async[a17_0x3d544b(0x12b)](_0x5ee0d5){const _0x3c3ffb=a17_0x3d544b,{options:_0x309c17,args:_0x1d4688,tdx:_0x455536}=_0x5ee0d5,_0x829507=_0x1d4688[0x0];if(!_0x829507)return console[_0x3c3ffb(0x126)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x3c3ffb(0x126)](_0x3c3ffb(0x15b)),0x1;try{const _0x4195c5=await withSpinner('Getting\x20job\x20details...',()=>_0x455536[_0x3c3ffb(0x15a)][_0x3c3ffb(0x13a)](_0x829507),{'verbose':_0x309c17[_0x3c3ffb(0x157)]}),_0x5401cf=_0x4195c5[_0x3c3ffb(0x129)];let _0x30804e;if(_0x5401cf[_0x3c3ffb(0x155)]&&_0x5401cf[_0x3c3ffb(0x15d)]){const _0x5c9266=new Date(_0x5401cf[_0x3c3ffb(0x155)])[_0x3c3ffb(0x14a)](),_0x7e408=new Date(_0x5401cf[_0x3c3ffb(0x15d)])['getTime']();_0x30804e=Math[_0x3c3ffb(0x117)]((_0x7e408-_0x5c9266)/0x3e8);}const _0x46be1c={'job_id':_0x5401cf[_0x3c3ffb(0x14c)],'type':_0x5401cf[_0x3c3ffb(0x114)],'status':_0x5401cf[_0x3c3ffb(0x123)],..._0x5401cf[_0x3c3ffb(0x11b)]&&{'user_name':_0x5401cf[_0x3c3ffb(0x11b)]},..._0x30804e!==undefined&&{'duration_sec':_0x30804e},..._0x5401cf[_0x3c3ffb(0x115)]&&{'created_at':_0x5401cf['created_at']},..._0x5401cf['start_at']&&{'started_at':_0x5401cf['start_at']},..._0x5401cf[_0x3c3ffb(0x15d)]&&{'end_at':_0x5401cf[_0x3c3ffb(0x15d)]},..._0x5401cf[_0x3c3ffb(0x14b)]&&{'database':_0x5401cf['database']},..._0x5401cf[_0x3c3ffb(0x138)]!==undefined&&{'priority':_0x5401cf[_0x3c3ffb(0x138)]},..._0x5401cf[_0x3c3ffb(0x132)]&&{'url':_0x5401cf[_0x3c3ffb(0x132)]},..._0x5401cf['query']&&{'query':_0x5401cf[_0x3c3ffb(0x156)]},..._0x5401cf[_0x3c3ffb(0x11d)]&&{'debug':_0x5401cf[_0x3c3ffb(0x11d)]}};return await handleSingleObjectOutput(_0x46be1c,_0x309c17),0x0;}catch(_0x4ff566){if(_0x4ff566 instanceof SDKError)return console[_0x3c3ffb(0x126)](_0x3c3ffb(0x147)+_0x4ff566[_0x3c3ffb(0x133)]),_0x4ff566[_0x3c3ffb(0x128)]&&console[_0x3c3ffb(0x126)](_0x3c3ffb(0x145)+_0x4ff566[_0x3c3ffb(0x128)]),0x1;throw _0x4ff566;}}}export class JobKillCommand extends BaseCommand{['name']=a17_0x3d544b(0x124);['description']='Kill\x20a\x20job';async[a17_0x3d544b(0x12b)](_0x4887f2){const _0x16cd02=a17_0x3d544b,{options:_0x4a3a11,args:_0x2fcc1f,tdx:_0x3c157a}=_0x4887f2,_0x2e9746=_0x2fcc1f[0x0];if(!_0x2e9746)return console[_0x16cd02(0x126)](_0x16cd02(0x11a)),console['error'](_0x16cd02(0x142)),0x1;try{if(!_0x4a3a11['yes']){const _0x24fc09=await confirm(_0x16cd02(0x148)+_0x2e9746+'?');if(!_0x24fc09)return console[_0x16cd02(0x126)](_0x16cd02(0x11e)),0x0;}return await withSpinner(_0x16cd02(0x112),()=>_0x3c157a[_0x16cd02(0x15a)][_0x16cd02(0x12d)](_0x2e9746),{'verbose':_0x4a3a11[_0x16cd02(0x157)]}),console[_0x16cd02(0x126)](_0x16cd02(0x150)+_0x2e9746),console[_0x16cd02(0x126)](_0x16cd02(0x15c)+_0x2e9746+_0x16cd02(0x130)),0x0;}catch(_0x310ddd){if(_0x310ddd instanceof SDKError)return console[_0x16cd02(0x126)]('Error:\x20'+_0x310ddd[_0x16cd02(0x133)]),_0x310ddd[_0x16cd02(0x128)]&&console[_0x16cd02(0x126)](_0x16cd02(0x145)+_0x310ddd['cause']),0x1;throw _0x310ddd;}}}export class JobSubmitCommand extends BaseCommand{[a17_0x3d544b(0x127)]='job:submit';[a17_0x3d544b(0x11c)]=a17_0x3d544b(0x14f);async['execute'](_0x23df54){const _0x350b33=a17_0x3d544b,{options:_0x1f35f6,args:_0x12b0c6,tdx:_0x18b2d4}=_0x23df54;try{const _0x5b11d2=_0x1f35f6[_0x350b33(0x151)]||_0x350b33(0x143),_0x333e35=_0x1f35f6[_0x350b33(0x139)],_0x2db7d6=_0x1f35f6[_0x350b33(0x14b)]||_0x350b33(0x131);if(_0x5b11d2!==_0x350b33(0x143)&&_0x5b11d2!==_0x350b33(0x13f))return console[_0x350b33(0x126)](_0x350b33(0x120)),0x1;let _0x249270;if(_0x333e35){if(_0x12b0c6[0x0])return console['error'](_0x350b33(0x140)),0x1;const _0x26e299=readSqlStatementsFromFile(_0x333e35);if(_0x26e299[_0x350b33(0x116)]===0x0)return console[_0x350b33(0x126)]('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x26e299[_0x350b33(0x116)]>0x1)return console[_0x350b33(0x126)]('Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'),0x1;_0x249270=_0x26e299[0x0];}else{if(!_0x12b0c6[0x0])return console[_0x350b33(0x126)]('Error:\x20Query\x20is\x20required'),console[_0x350b33(0x126)](_0x350b33(0x14d)),0x1;_0x249270=_0x12b0c6[0x0];}_0x1f35f6[_0x350b33(0x157)]&&(console[_0x350b33(0x126)]('Job\x20type:\x20'+_0x5b11d2),console[_0x350b33(0x126)]('Database:\x20'+_0x2db7d6),console[_0x350b33(0x126)](_0x350b33(0x118)+_0x249270[_0x350b33(0x122)](0x0,0x64)+(_0x249270['length']>0x64?_0x350b33(0x13c):'')));const _0x5bf2e4=await withSpinner(_0x350b33(0x154),()=>_0x18b2d4[_0x350b33(0x15a)][_0x350b33(0x135)](_0x2db7d6,_0x249270,_0x5b11d2),{'verbose':_0x1f35f6[_0x350b33(0x157)]}),_0x52c64e=_0x5bf2e4[_0x350b33(0x129)];return console[_0x350b33(0x126)](_0x350b33(0x141)),console['error'](_0x350b33(0x136)+_0x52c64e[_0x350b33(0x14c)]),await handleSDKOutput([_0x52c64e],_0x1f35f6),0x0;}catch(_0x153fc4){if(_0x153fc4 instanceof SDKError)return console[_0x350b33(0x126)](_0x350b33(0x147)+_0x153fc4[_0x350b33(0x133)]),_0x153fc4['cause']&&console[_0x350b33(0x126)]('\x20\x20Cause:\x20'+_0x153fc4[_0x350b33(0x128)]),0x1;throw _0x153fc4;}}}export class JobResultCommand extends BaseCommand{[a17_0x3d544b(0x127)]='job:result';['description']='Get\x20job\x20results';async[a17_0x3d544b(0x12b)](_0x2df51d){const _0x15dba3=a17_0x3d544b,{options:_0x5f4a15,args:_0x163b8d,tdx:_0x108c25}=_0x2df51d,_0x15a770=_0x163b8d[0x0];if(!_0x15a770)return console[_0x15dba3(0x126)]('Error:\x20Job\x20ID\x20is\x20required'),console['error'](_0x15dba3(0x125)),0x1;try{const _0x1a57be=await withSpinner('Getting\x20job\x20results...',()=>_0x108c25[_0x15dba3(0x15a)][_0x15dba3(0x153)](_0x15a770),{'verbose':_0x5f4a15['verbose']}),_0x46cdfa=_0x1a57be[_0x15dba3(0x129)];return console[_0x15dba3(0x126)]('✔\x20Retrieved\x20'+_0x46cdfa[_0x15dba3(0x116)]+'\x20row'+(_0x46cdfa[_0x15dba3(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x46cdfa,_0x5f4a15),0x0;}catch(_0x3127f7){if(_0x3127f7 instanceof SDKError)return console[_0x15dba3(0x126)]('Error:\x20'+_0x3127f7[_0x15dba3(0x133)]),_0x3127f7[_0x15dba3(0x128)]&&console[_0x15dba3(0x126)]('\x20\x20Cause:\x20'+_0x3127f7[_0x15dba3(0x128)]),0x1;throw _0x3127f7;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x5ceb5b=a18_0x49fe;(function(_0xbcafba,_0x7af78d){const _0x4fa3e2=a18_0x49fe,_0x213966=_0xbcafba();while(!![]){try{const _0x4dcc3b=parseInt(_0x4fa3e2(0x141))/0x1+-parseInt(_0x4fa3e2(0xc6))/0x2+-parseInt(_0x4fa3e2(0x116))/0x3+-parseInt(_0x4fa3e2(0xfd))/0x4*(-parseInt(_0x4fa3e2(0xe8))/0x5)+parseInt(_0x4fa3e2(0x17c))/0x6+-parseInt(_0x4fa3e2(0xbc))/0x7*(-parseInt(_0x4fa3e2(0xbb))/0x8)+-parseInt(_0x4fa3e2(0xc5))/0x9;if(_0x4dcc3b===_0x7af78d)break;else _0x213966['push'](_0x213966['shift']());}catch(_0x37d6e6){_0x213966['push'](_0x213966['shift']());}}}(a18_0x3f33,0x92942));import a18_0x2db01d from'chalk';import a18_0xeb7b53 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';function a18_0x49fe(_0x1b26e6,_0x560318){_0x1b26e6=_0x1b26e6-0xb4;const _0x3f3301=a18_0x3f33();let _0x49fe9a=_0x3f3301[_0x1b26e6];return _0x49fe9a;}import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function formatJourneyState(_0x3bf8df){const _0x4f902e=a18_0x49fe;switch(_0x3bf8df){case _0x4f902e(0xdd):return a18_0x2db01d[_0x4f902e(0x184)](_0x4f902e(0x11c));case _0x4f902e(0xff):return a18_0x2db01d['dim']('(draft)');case'paused':return a18_0x2db01d[_0x4f902e(0x110)](_0x4f902e(0xfb));case _0x4f902e(0x11a):return a18_0x2db01d['blue'](_0x4f902e(0xd1));case _0x4f902e(0x14b):return a18_0x2db01d['dim'](_0x4f902e(0xdb));default:return'('+_0x3bf8df+')';}}function formatJourneyItem(_0x4d0b37,_0x1bc3d2='',_0xdc4558){const _0x3ba674=a18_0x49fe,_0x17d6e9=formatJourneyState(_0x4d0b37[_0x3ba674(0xde)]),_0x378448=_0xdc4558?hyperlink(_0x4d0b37[_0x3ba674(0xf4)],_0xdc4558):_0x4d0b37[_0x3ba674(0xf4)];return _0x1bc3d2+_0x3ba674(0x108)+_0x378448+'\x20'+_0x17d6e9;}function escapeRegex(_0x5b7e2c){const _0x5e955f=a18_0x49fe;return _0x5b7e2c[_0x5e955f(0x151)](/[.*+?^${}()|[\]\\]/g,_0x5e955f(0xe6));}function globToRegex(_0x24d69f){const _0x2f342e=a18_0x49fe,_0x48422f=_0x24d69f[_0x2f342e(0x182)]('*')[_0x2f342e(0x14a)](escapeRegex);return new RegExp(_0x48422f[_0x2f342e(0xe7)]('.*'),'i');}function buildRuleToNameMapping(_0x122349){const _0x41ffc0=a18_0x49fe,_0x18bad8=new Map();if(_0x122349['segments'])for(const [_0x54d5b8,_0x4356cd]of Object[_0x41ffc0(0x131)](_0x122349[_0x41ffc0(0xe5)])){if(_0x4356cd[_0x41ffc0(0xc2)]){const _0x5459f7=serializeRule(_0x4356cd[_0x41ffc0(0xc2)]),_0x15ba53=_0x18bad8[_0x41ffc0(0x13d)](_0x5459f7);_0x15ba53?_0x15ba53[_0x41ffc0(0x164)](_0x54d5b8):_0x18bad8[_0x41ffc0(0xc1)](_0x5459f7,[_0x54d5b8]);}}return _0x18bad8;}async function resolveJourneyTarget(_0x5e40ef,_0xa39607,_0x1c9afb){const _0x1c05d1=a18_0x49fe;if(isYamlFilePath(_0x5e40ef))try{const _0x379ccf=await resolveYamlFilePath(_0x5e40ef);return _0x1c9afb&&(console['error'](_0x1c05d1(0x109)+_0x5e40ef),console['error']('\x20\x20Parent\x20segment:\x20'+_0x379ccf[_0x1c05d1(0xd5)]),console[_0x1c05d1(0x145)]('\x20\x20Name:\x20'+_0x379ccf['segmentName']),console['error'](_0x1c05d1(0x112)+(_0x379ccf[_0x1c05d1(0x117)]||_0x1c05d1(0xb7)))),{'journeyName':_0x379ccf[_0x1c05d1(0x187)],'parentSegment':_0x379ccf[_0x1c05d1(0xd5)],'resolved':_0x379ccf};}catch(_0x3a0297){throw new SDKError(ErrorCode[_0x1c05d1(0xbf)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x3a0297[_0x1c05d1(0xeb)]);}if(!_0xa39607)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1c05d1(0x130));return{'journeyName':_0x5e40ef,'parentSegment':_0xa39607};}export class JourneyListCommand extends BaseCommand{[a18_0x5ceb5b(0x174)]=a18_0x5ceb5b(0x15f);[a18_0x5ceb5b(0x189)]=a18_0x5ceb5b(0x167);async[a18_0x5ceb5b(0xf0)](_0x93ef40){const _0x4d6640=a18_0x5ceb5b,{options:_0x258b0f,args:_0x4d91c2,tdx:_0x3fa01}=_0x93ef40,_0xca9233=_0x4d91c2[0x0],_0x490559=_0x258b0f[_0x4d6640(0xd5)];if(!_0x490559)return console[_0x4d6640(0x145)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x4d6640(0x145)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x1911ca=await withSpinner(_0x4d6640(0x154),()=>_0x3fa01[_0x4d6640(0x156)][_0x4d6640(0xd6)](_0x490559),{'verbose':_0x258b0f[_0x4d6640(0x173)]}),_0x1dbc07=_0x1911ca[_0x4d6640(0x10a)];_0x258b0f[_0x4d6640(0x173)]&&(console[_0x4d6640(0x145)]('Parent\x20segment:\x20'+_0x490559+_0x4d6640(0xf1)+_0x1dbc07+')'),_0xca9233&&console['error'](_0x4d6640(0xf3)+_0xca9233));const _0x324f7b=await withSpinner(_0x4d6640(0x13a),()=>_0x3fa01[_0x4d6640(0x156)][_0x4d6640(0x180)](_0x1dbc07),{'verbose':_0x258b0f['verbose']}),_0x666820=_0x324f7b[_0x4d6640(0x10a)],_0x277918=_0x666820[_0x4d6640(0x134)],_0x2ffa7f=await withSpinner(_0x4d6640(0x13e),()=>_0x3fa01[_0x4d6640(0x177)][_0x4d6640(0x135)](_0x1dbc07,_0x277918),{'verbose':_0x258b0f['verbose']});let _0x20152f=_0x2ffa7f[_0x4d6640(0x10a)][_0x4d6640(0xcf)];const _0x3fd039=_0x2ffa7f['data']['folders'],_0x11d559=new Map();for(const _0x408956 of _0x3fd039){_0x11d559[_0x4d6640(0xc1)](_0x408956['id'],_0x408956['name']);}if(_0xca9233){const _0x246b3f=globToRegex(_0xca9233);_0x20152f=_0x20152f[_0x4d6640(0x144)](_0x158d1f=>_0x246b3f['test'](_0x158d1f[_0x4d6640(0xf4)]));}console[_0x4d6640(0x145)](_0x4d6640(0xe4)+_0x20152f[_0x4d6640(0x175)]+_0x4d6640(0xb8)+(_0x20152f[_0x4d6640(0x175)]!==0x1?'s':''));const _0x39fc4b=_0x258010=>{const _0x17014e=_0x4d6640;return getConsoleNextUrl(_0x258b0f[_0x17014e(0x14f)],_0x17014e(0x128)+_0x1dbc07+_0x17014e(0x163)+_0x258010+_0x17014e(0xcd));};if(_0x258b0f[_0x4d6640(0x102)]==='table')await handleSDKOutput(_0x20152f,_0x258b0f);else{if(_0x258b0f[_0x4d6640(0x102)]===_0x4d6640(0x18c)){const _0x51d882=_0x20152f['map'](_0x3fd90a=>({..._0x3fd90a,'url':_0x39fc4b(_0x3fd90a['id'])}));await handleSDKOutput(_0x51d882,_0x258b0f);}else{console[_0x4d6640(0xef)]('['+_0x490559+']');const _0x36314e=new Map(),_0xa7b47f=[];for(const _0xbf7791 of _0x20152f){if(!_0xbf7791[_0x4d6640(0x122)]||_0xbf7791[_0x4d6640(0x122)]===_0x277918)_0xa7b47f[_0x4d6640(0x164)](_0xbf7791);else{const _0x56a6fa=_0x36314e[_0x4d6640(0x13d)](_0xbf7791[_0x4d6640(0x122)])||[];_0x56a6fa[_0x4d6640(0x164)](_0xbf7791),_0x36314e[_0x4d6640(0xc1)](_0xbf7791['folderId'],_0x56a6fa);}}const _0x4ff0c5=(_0x14ece1,_0xc2d5d7)=>_0x14ece1[_0x4d6640(0xf4)][_0x4d6640(0x176)](_0xc2d5d7[_0x4d6640(0xf4)],undefined,{'sensitivity':_0x4d6640(0x13b)});_0xa7b47f[_0x4d6640(0x118)](_0x4ff0c5);for(const _0x3f9a2b of _0xa7b47f){console[_0x4d6640(0xef)](formatJourneyItem(_0x3f9a2b,'',_0x39fc4b(_0x3f9a2b['id'])));}const _0x18e24e=[..._0x36314e[_0x4d6640(0x131)]()][_0x4d6640(0x118)]((_0xc6a953,_0x171bf3)=>{const _0x548f86=_0x4d6640,_0xedfb0d=_0x11d559[_0x548f86(0x13d)](_0xc6a953[0x0])||_0xc6a953[0x0],_0x58bf12=_0x11d559[_0x548f86(0x13d)](_0x171bf3[0x0])||_0x171bf3[0x0];return _0xedfb0d[_0x548f86(0x176)](_0x58bf12,undefined,{'sensitivity':_0x548f86(0x13b)});});for(const [_0x138256,_0x3e9665]of _0x18e24e){const _0x346830=_0x11d559[_0x4d6640(0x13d)](_0x138256)||_0x138256;console['log']('📁\x20'+_0x346830),_0x3e9665['sort'](_0x4ff0c5);for(const _0x3a513f of _0x3e9665){console['log'](formatJourneyItem(_0x3a513f,'\x20\x20',_0x39fc4b(_0x3a513f['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a18_0x5ceb5b(0x133);[a18_0x5ceb5b(0x189)]=a18_0x5ceb5b(0xea);async[a18_0x5ceb5b(0xf0)](_0x4aeccb){const _0xbc3535=a18_0x5ceb5b,{options:_0x2b52e0,args:_0x3410e2,tdx:_0x15d550}=_0x4aeccb,_0x259c1b=_0x3410e2[0x0];if(!_0x259c1b)return console[_0xbc3535(0x145)](_0xbc3535(0x150)),console[_0xbc3535(0x145)](_0xbc3535(0x16d)),console['error'](_0xbc3535(0x12a)),console[_0xbc3535(0x145)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x2b52e0[_0xbc3535(0x173)]&&console[_0xbc3535(0x145)](_0xbc3535(0x11e)+_0x259c1b);const _0x1c3808=await resolveJourneyTarget(_0x259c1b,_0x2b52e0[_0xbc3535(0xd5)],_0x2b52e0['verbose']),_0x5dfe88=await withSpinner(_0xbc3535(0x154),()=>_0x15d550[_0xbc3535(0x156)][_0xbc3535(0xd6)](_0x1c3808['parentSegment']),{'verbose':_0x2b52e0[_0xbc3535(0x173)]}),_0x54f6a1=_0x5dfe88['data'],_0x36dfdc=await withSpinner(_0xbc3535(0x105),()=>_0x15d550['journey'][_0xbc3535(0x12d)](_0x54f6a1,_0x1c3808['journeyName']),{'verbose':_0x2b52e0[_0xbc3535(0x173)]}),_0x333060=_0x36dfdc[_0xbc3535(0x10a)];if(_0x2b52e0[_0xbc3535(0x111)]){const _0x3ca45e=getConsoleNextUrl(_0x2b52e0[_0xbc3535(0x14f)],_0xbc3535(0x128)+_0x54f6a1+_0xbc3535(0x163)+_0x333060+_0xbc3535(0xdc));return console[_0xbc3535(0x145)](a18_0x2db01d[_0xbc3535(0x184)]('✔')+_0xbc3535(0x17d)+a18_0x2db01d[_0xbc3535(0x10d)](_0x3ca45e)),openBrowser(_0x3ca45e),0x0;}const _0x24153a=await withSpinner(_0xbc3535(0x161),()=>_0x15d550[_0xbc3535(0x177)][_0xbc3535(0x17b)](_0x333060),{'verbose':_0x2b52e0[_0xbc3535(0x173)]}),_0x3a6c7a=_0x24153a[_0xbc3535(0x10a)],_0x3f88aa=_0x2b52e0[_0xbc3535(0x18a)];let _0x4ac6c0;if(_0x3f88aa)try{const _0x179233=await withSpinner(_0xbc3535(0xbd),()=>_0x15d550[_0xbc3535(0x177)][_0xbc3535(0x140)](_0x333060),{'verbose':_0x2b52e0[_0xbc3535(0x173)]});_0x4ac6c0=_0x179233['data'];}catch{_0x2b52e0[_0xbc3535(0x173)]&&console[_0xbc3535(0x145)](_0xbc3535(0x10e));}const _0x4936b9=getConsoleNextUrl(_0x2b52e0[_0xbc3535(0x14f)],'/app/ps/'+_0x54f6a1+_0xbc3535(0x163)+_0x333060+_0xbc3535(0xdc)),_0x3ba4f7={'id':_0x3a6c7a['id'],'name':_0x3a6c7a[_0xbc3535(0xcc)][_0xbc3535(0x174)],'description':_0x3a6c7a['attributes'][_0xbc3535(0x189)],'state':_0x3a6c7a[_0xbc3535(0xcc)][_0xbc3535(0xde)],'paused':_0x3a6c7a['attributes'][_0xbc3535(0xb4)],'reentry_mode':_0x3a6c7a[_0xbc3535(0xcc)][_0xbc3535(0x16a)],'stages':_0x3a6c7a[_0xbc3535(0xcc)][_0xbc3535(0x136)]?.[_0xbc3535(0x175)]||0x0,..._0x3a6c7a[_0xbc3535(0xcc)]['goal']&&{'goal':_0x3a6c7a[_0xbc3535(0xcc)][_0xbc3535(0x107)]['name']},..._0x4ac6c0&&{'statistics':{'total_entered':_0x4ac6c0[_0xbc3535(0x17f)],'goal_achieved':_0x4ac6c0[_0xbc3535(0x15d)],'goal_rate':_0x4ac6c0[_0xbc3535(0x12c)],'stages':_0x4ac6c0[_0xbc3535(0x17e)]}},'url':_0x4936b9};return await handleSingleObjectOutput(_0x3ba4f7,_0x2b52e0),0x0;}}function a18_0x3f33(){const _0x104a48=['attributes','/j/da','add','journeys','Pausing\x20journey...','(completed)','repeat','find','connection','parentSegment','resolveParentId','stageName','Cancelled','resolveSegment','journeyBundleId','(archived)','/j/da/je','launched','state','\x20\x20-\x20','Target\x20directory:\x20','Usage:\x20journey\x20stats\x20<name-or-path>','Parent\x20segment:\x20','type','✔\x20Found\x20','segments','\x5c$&','join','1449215ZibyZt','Fetching\x20','Show\x20journey\x20details','message','entered','pause','no_parent','log','execute','\x20(ID:\x20','population','Pattern:\x20','journeyBundleName','\x20unchanged\x20files','Error:\x20Journey\x20\x27','yes','Journey\x20name:\x20','.yml','Pause\x20a\x20running\x20journey','(paused)','Warning:\x20Stage\x20\x22','4rpHXME','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','draft','segmentPushCommand','session','format','journeyName','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Resolving\x20journey...','journeyId','goal','🗺️\x20','Resolved\x20YAML\x20file:\x20','data','No\x20journeys\x20found','journey:push','cyan','\x20\x20Statistics\x20not\x20available','\x20files?','yellow','web','\x20\x20Folder\x20path:\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','args','size','2430855gGYLES','folderPath','sort','red','completed','✔\x20All\x20files\x20are\x20up\x20to\x20date','(running)','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Input:\x20','Found\x20','then','buildIdToNameMap','folderId','isNew','Usage:\x20journey\x20resume\x20<name-or-path>','No\x20statistics\x20available\x20for\x20journey:\x20','Target\x20file:\x20','✔\x20Pulled\x20','/app/ps/','has','Options:','root\x20folder','goalRate','resolveJourneyId','\x20journey\x20files\x20to\x20','buildIdToEmailMap','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','entries','stringify','journey:view','rootFolderId','listJourneysWithFolders','journeyStages','diff','Export\x20journey(s)\x20as\x20YAML\x20files','\x27\x20not\x20found\x20in\x20','Fetching\x20parent\x20segment...','base','setPhase','get','Listing\x20journeys...','Listing\x20folders...','getStatistics','1132935YVXmXg','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','versionNumber','filter','error','cwd','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)','parentName','Fetching\x20users\x20for\x20email\x20resolution...','map','archived','\x22\x20paused','utf-8','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','site','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','replace','filePath','values','Resolving\x20parent\x20segment...','hasChanges','segment','Resume\x20a\x20paused\x20journey','conversionRate','Warning:\x20Could\x20not\x20resolve\x20segment\x20','\x20->\x20','\x20=\x20','resourceName','totalGoalAchieved','\x20journeys','journey:list','journey:pull','Getting\x20journey\x20details...','resume','/e/','push','helpText','options','List\x20journeys\x20in\x20current\x20context','file','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','reentryMode','activationParams','\x20versions)','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','getSegment','exited','\x20changed\x20files','Warning:\x20Could\x20not\x20resolve\x20activation\x20','activation_','verbose','name','length','localeCompare','journey','Error:\x20','\x20(rule\x20match)','parent_segment','getJourney','1819986xjrBiC','\x20Opening\x20','stages','totalEntered','getParentFull','targetDir','split','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','content','Write\x20','segmentName','✔\x20Context\x20set:\x20','description','includeStats','...','json','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','paused','dim','user','(root)','\x20journey','\x0aPull\x20summary:','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','24ouzjOP','338401JKCpSJ','Getting\x20journey\x20statistics...','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','INVALID_ARGUMENT','relativePath','set','rule','toLowerCase','journey:resume','2716488AqutPd','317270WzNETf','Folder\x20path:\x20','relative','\x20new\x20files','absolutePath','getActivation'];a18_0x3f33=function(){return _0x104a48;};return a18_0x3f33();}export class JourneyStatsCommand extends BaseCommand{[a18_0x5ceb5b(0x174)]='journey:stats';[a18_0x5ceb5b(0x189)]='Show\x20journey\x20statistics';async['execute'](_0x41292e){const _0x1b4f9c=a18_0x5ceb5b,{options:_0x1e7969,args:_0x2525a1,tdx:_0x33a6f0}=_0x41292e,_0x103721=_0x2525a1[0x0];if(!_0x103721)return console[_0x1b4f9c(0x145)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x1b4f9c(0x145)](_0x1b4f9c(0xe1)),0x1;_0x1e7969[_0x1b4f9c(0x173)]&&console[_0x1b4f9c(0x145)](_0x1b4f9c(0x11e)+_0x103721);const _0xd7d206=await resolveJourneyTarget(_0x103721,_0x1e7969['parentSegment'],_0x1e7969['verbose']),_0x334dcd=await withSpinner(_0x1b4f9c(0x154),()=>_0x33a6f0[_0x1b4f9c(0x156)][_0x1b4f9c(0xd6)](_0xd7d206[_0x1b4f9c(0xd5)]),{'verbose':_0x1e7969[_0x1b4f9c(0x173)]}),_0x1a7a2d=_0x334dcd[_0x1b4f9c(0x10a)],_0x50c6b3=await withSpinner(_0x1b4f9c(0x105),()=>_0x33a6f0['journey'][_0x1b4f9c(0x12d)](_0x1a7a2d,_0xd7d206[_0x1b4f9c(0x103)]),{'verbose':_0x1e7969[_0x1b4f9c(0x173)]}),_0x4b042d=_0x50c6b3[_0x1b4f9c(0x10a)],_0x910a6a=await withSpinner(_0x1b4f9c(0xbd),()=>_0x33a6f0[_0x1b4f9c(0x177)][_0x1b4f9c(0x140)](_0x4b042d),{'verbose':_0x1e7969[_0x1b4f9c(0x173)]}),_0x4a0514=_0x910a6a[_0x1b4f9c(0x10a)];if(!_0x4a0514||_0x4a0514[_0x1b4f9c(0x106)]===null)return console['error'](_0x1b4f9c(0x125)+_0xd7d206[_0x1b4f9c(0x103)]),console[_0x1b4f9c(0x145)](_0x1b4f9c(0xba)),0x0;const _0x4c1e3e={'journey_id':_0x4a0514['journeyId'],'total_entered':_0x4a0514['totalEntered'],'goal_achieved':_0x4a0514[_0x1b4f9c(0x15d)],'goal_rate':_0x4a0514[_0x1b4f9c(0x12c)],'stages':_0x4a0514[_0x1b4f9c(0x17e)]?.['map'](_0x5ca95b=>({'name':_0x5ca95b[_0x1b4f9c(0xd7)],'population':_0x5ca95b['population'],'entered':_0x5ca95b[_0x1b4f9c(0xec)],'exited':_0x5ca95b[_0x1b4f9c(0x16f)],'conversion_rate':_0x5ca95b[_0x1b4f9c(0x158)]}))},_0x39fdb8=_0x1e7969['stage'];if(_0x39fdb8&&_0x4a0514[_0x1b4f9c(0x17e)]){const _0x1c4746=_0x4a0514['stages'][_0x1b4f9c(0xd3)](_0x5c16bd=>_0x5c16bd[_0x1b4f9c(0xd7)][_0x1b4f9c(0xc3)]()===_0x39fdb8[_0x1b4f9c(0xc3)]());if(_0x1c4746)return await handleSingleObjectOutput({'stage_name':_0x1c4746[_0x1b4f9c(0xd7)],'population':_0x1c4746[_0x1b4f9c(0xf2)],'entered':_0x1c4746['entered'],'exited':_0x1c4746[_0x1b4f9c(0x16f)],'conversion_rate':_0x1c4746[_0x1b4f9c(0x158)]},_0x1e7969),0x0;console[_0x1b4f9c(0x145)](_0x1b4f9c(0xfc)+_0x39fdb8+'\x22\x20not\x20found');}return await handleSingleObjectOutput(_0x4c1e3e,_0x1e7969),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a18_0x5ceb5b(0x174)]='journey:pause';['description']=a18_0x5ceb5b(0xfa);async[a18_0x5ceb5b(0xf0)](_0xe7ae8e){const _0x22a2c8=a18_0x5ceb5b,{options:_0x4609d0,args:_0x529b05,tdx:_0x2771d8}=_0xe7ae8e,_0x49841d=_0x529b05[0x0];if(!_0x49841d)return console[_0x22a2c8(0x145)](_0x22a2c8(0x150)),console[_0x22a2c8(0x145)]('Usage:\x20journey\x20pause\x20<name-or-path>'),0x1;_0x4609d0[_0x22a2c8(0x173)]&&console[_0x22a2c8(0x145)](_0x22a2c8(0x11e)+_0x49841d);const _0x3f4360=await resolveJourneyTarget(_0x49841d,_0x4609d0[_0x22a2c8(0xd5)],_0x4609d0['verbose']),_0x2dde3b=await withSpinner(_0x22a2c8(0x154),()=>_0x2771d8['segment']['resolveParentId'](_0x3f4360['parentSegment']),{'verbose':_0x4609d0[_0x22a2c8(0x173)]}),_0x8ccaea=_0x2dde3b[_0x22a2c8(0x10a)],_0x17a913=await withSpinner(_0x22a2c8(0x105),()=>_0x2771d8['journey'][_0x22a2c8(0x12d)](_0x8ccaea,_0x3f4360[_0x22a2c8(0x103)]),{'verbose':_0x4609d0[_0x22a2c8(0x173)]}),_0x2f976f=_0x17a913[_0x22a2c8(0x10a)];if(!_0x4609d0[_0x22a2c8(0xf7)]){const _0x4b9498=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x3f4360[_0x22a2c8(0x103)]+'\x22?');if(!_0x4b9498)return console[_0x22a2c8(0x145)]('Cancelled'),0x0;}const _0x21e17d=await withSpinner(_0x22a2c8(0xd0),()=>_0x2771d8[_0x22a2c8(0x177)][_0x22a2c8(0xed)](_0x2f976f),{'verbose':_0x4609d0[_0x22a2c8(0x173)]}),_0x385df6=_0x21e17d[_0x22a2c8(0x10a)];return console[_0x22a2c8(0x145)]('✔\x20Journey\x20\x22'+_0x385df6[_0x22a2c8(0xcc)][_0x22a2c8(0x174)]+_0x22a2c8(0x14c)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x5ceb5b(0x174)]=a18_0x5ceb5b(0xc4);['description']=a18_0x5ceb5b(0x157);async[a18_0x5ceb5b(0xf0)](_0x413124){const _0x521fca=a18_0x5ceb5b,{options:_0x5a8c7d,args:_0x1bcb59,tdx:_0xa40c67}=_0x413124,_0x4efa52=_0x1bcb59[0x0];if(!_0x4efa52)return console[_0x521fca(0x145)](_0x521fca(0x150)),console[_0x521fca(0x145)](_0x521fca(0x124)),0x1;_0x5a8c7d[_0x521fca(0x173)]&&console[_0x521fca(0x145)](_0x521fca(0x11e)+_0x4efa52);const _0x2abc4f=await resolveJourneyTarget(_0x4efa52,_0x5a8c7d[_0x521fca(0xd5)],_0x5a8c7d['verbose']),_0x1f455b=await withSpinner(_0x521fca(0x154),()=>_0xa40c67[_0x521fca(0x156)][_0x521fca(0xd6)](_0x2abc4f[_0x521fca(0xd5)]),{'verbose':_0x5a8c7d['verbose']}),_0x1d61dd=_0x1f455b[_0x521fca(0x10a)],_0x28cded=await withSpinner(_0x521fca(0x105),()=>_0xa40c67[_0x521fca(0x177)][_0x521fca(0x12d)](_0x1d61dd,_0x2abc4f[_0x521fca(0x103)]),{'verbose':_0x5a8c7d[_0x521fca(0x173)]}),_0x414d27=_0x28cded[_0x521fca(0x10a)];if(!_0x5a8c7d['yes']){const _0x35a12f=await confirm(_0x521fca(0xbe)+_0x2abc4f['journeyName']+'\x22?');if(!_0x35a12f)return console[_0x521fca(0x145)](_0x521fca(0xd8)),0x0;}const _0x24a254=await withSpinner('Resuming\x20journey...',()=>_0xa40c67[_0x521fca(0x177)][_0x521fca(0x162)](_0x414d27),{'verbose':_0x5a8c7d[_0x521fca(0x173)]}),_0x1d3069=_0x24a254['data'];return console[_0x521fca(0x145)]('✔\x20Journey\x20\x22'+_0x1d3069[_0x521fca(0xcc)][_0x521fca(0x174)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a18_0x5ceb5b(0x160);[a18_0x5ceb5b(0x189)]=a18_0x5ceb5b(0x138);async['execute'](_0x3c6d60){const _0x4218f1=a18_0x5ceb5b,{options:_0x18ba6c,args:_0x8e6f3a,tdx:_0x234979}=_0x3c6d60,_0x105155=_0x18ba6c,_0x119000=_0x8e6f3a[0x0],_0x2eb6dd=_0x119000&&isYamlFilePath(_0x119000),_0x534972=await resolveTarget({'arg':_0x2eb6dd?_0x119000:undefined,'contextParent':_0x18ba6c[_0x4218f1(0xd5)],'cwd':process[_0x4218f1(0x146)]()});if(!isSuccessfulResolution(_0x534972))return _0x534972['errorCode']===_0x4218f1(0xee)?(console['error'](a18_0x2db01d[_0x4218f1(0x110)](_0x4218f1(0x169))),console[_0x4218f1(0x145)](_0x4218f1(0x147)),console[_0x4218f1(0x145)](_0x4218f1(0x14e)),console[_0x4218f1(0x145)](_0x4218f1(0x142)),console[_0x4218f1(0x145)](_0x4218f1(0xfe))):(console['error'](a18_0x2db01d[_0x4218f1(0x119)](_0x4218f1(0x178)+_0x534972[_0x4218f1(0xeb)]+'\x0a')),_0x534972['helpText']&&console[_0x4218f1(0x145)](a18_0x2db01d[_0x4218f1(0x10d)](_0x534972[_0x4218f1(0x165)]))),0x1;let _0x176883=_0x2eb6dd?undefined:_0x119000,_0x955ec1,_0x28819f;_0x534972[_0x4218f1(0xe3)]==='file'&&(_0x176883=_0x534972[_0x4218f1(0x15c)],_0x955ec1=_0x534972[_0x4218f1(0x152)],_0x28819f=_0x534972[_0x4218f1(0x117)]);const _0xe87cbf=_0x534972[_0x4218f1(0x148)],_0x5380be=_0x534972[_0x4218f1(0x181)];_0x105155[_0x4218f1(0x173)]&&(console[_0x4218f1(0x145)](_0x4218f1(0xe2)+_0xe87cbf),console[_0x4218f1(0x145)](_0x4218f1(0xe0)+_0x5380be),_0x176883&&console['error'](_0x4218f1(0xf8)+_0x176883),_0x955ec1&&console['error'](_0x4218f1(0x126)+_0x955ec1),_0x28819f&&console[_0x4218f1(0x145)](_0x4218f1(0xc7)+_0x28819f));const _0x30598b=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x234979[_0x4218f1(0x156)]['resolveParentId'](_0xe87cbf),{'verbose':_0x18ba6c[_0x4218f1(0x173)]}),_0x1bd2b5=_0x30598b[_0x4218f1(0x10a)],[_0x59f034,_0x51028c]=await Promise['all']([withSpinner(_0x4218f1(0x13e),()=>_0x234979['journey']['listJourneysFromParentSegment'](_0x1bd2b5,undefined,{'includeAllVersions':!![]}),{'verbose':_0x18ba6c[_0x4218f1(0x173)]}),withSpinner(_0x4218f1(0x13f),()=>_0x234979['segment']['listFolders'](_0x1bd2b5),{'verbose':_0x18ba6c[_0x4218f1(0x173)]})]);let _0x166956=_0x59f034[_0x4218f1(0x10a)];const _0x4a6cd7=_0x51028c[_0x4218f1(0x10a)],_0x562164=buildFolderIdToPathMap(_0x4a6cd7);if(_0x176883){const _0x7b7a24=_0x166956[_0x4218f1(0x144)](_0x141099=>_0x141099[_0x4218f1(0xf4)][_0x4218f1(0xc3)]()===_0x176883[_0x4218f1(0xc3)]());if(_0x7b7a24[_0x4218f1(0x175)]===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x176883),console[_0x4218f1(0x145)](_0x4218f1(0x18d)),0x1;_0x166956=_0x7b7a24;}if(_0x28819f!==undefined){const _0x58f916=_0x166956[_0x4218f1(0x144)](_0x3c3f20=>{const _0x2074cd=_0x3c3f20['folderId']?_0x562164['get'](_0x3c3f20['folderId'])||'':'';return _0x2074cd===_0x28819f;});if(_0x58f916['length']===0x0&&_0x166956[_0x4218f1(0x175)]>0x0){console[_0x4218f1(0x145)](_0x4218f1(0xf6)+_0x176883+_0x4218f1(0x139)+(_0x28819f||_0x4218f1(0x12b))),console['error'](_0x4218f1(0x11d));for(const _0xefadef of _0x166956){const _0x70dea2=_0xefadef['folderId']?_0x562164[_0x4218f1(0x13d)](_0xefadef[_0x4218f1(0x122)])||'':'';console[_0x4218f1(0x145)](_0x4218f1(0xdf)+(_0x70dea2||_0x4218f1(0xb7))+'/'+_0xefadef[_0x4218f1(0xf4)]);}return 0x1;}_0x166956=_0x58f916;}if(_0x166956[_0x4218f1(0x175)]===0x0)return console[_0x4218f1(0x145)](_0x4218f1(0x10b)),0x0;const _0x29ac3e=new Map();for(const _0x23d69e of _0x166956){const _0x3f7dfe=_0x23d69e[_0x4218f1(0xda)];!_0x29ac3e['has'](_0x3f7dfe)&&_0x29ac3e[_0x4218f1(0xc1)](_0x3f7dfe,[]),_0x29ac3e[_0x4218f1(0x13d)](_0x3f7dfe)['push'](_0x23d69e);}for(const _0x25aebd of _0x29ac3e[_0x4218f1(0x153)]()){_0x25aebd[_0x4218f1(0x118)]((_0x49436d,_0x250488)=>(_0x49436d['versionNumber']||0x0)-(_0x250488['versionNumber']||0x0));}const _0x4ddef4=[],[_0x86b3e,_0x1649db]=await Promise['all']([withSpinner(_0x4218f1(0x149),()=>_0x234979[_0x4218f1(0xb6)][_0x4218f1(0x12f)](),{'verbose':_0x18ba6c[_0x4218f1(0x173)]})[_0x4218f1(0x120)](_0x149419=>_0x149419['data']),withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',()=>_0x234979[_0x4218f1(0xd4)][_0x4218f1(0x121)](),{'verbose':_0x18ba6c[_0x4218f1(0x173)]})['then'](_0x348c05=>_0x348c05[_0x4218f1(0x10a)])]);for(const _0x36463b of _0x29ac3e[_0x4218f1(0x153)]()){const _0xda7386=_0x36463b[0x0]['journeyBundleName'],_0x4cc8bc=_0x36463b[0x0][_0x4218f1(0x122)],_0x25ea03=_0x4cc8bc?_0x562164['get'](_0x4cc8bc)||'':'',_0x593338=_0x25ea03?a18_0xeb7b53[_0x4218f1(0xe7)](_0x5380be,_0x25ea03):_0x5380be,_0xe5546f=_0x955ec1||a18_0xeb7b53[_0x4218f1(0xe7)](_0x593338,sanitizeFileName(_0xda7386)+_0x4218f1(0xf9));let _0x41bed3,_0x2ce976;if(existsSync(_0xe5546f))try{const _0x1776d5=readFileSync(_0xe5546f,'utf-8'),_0x6a2f14=parseYamlString(_0x1776d5);_0x2ce976=_0x6a2f14,_0x41bed3=buildRuleToNameMapping(_0x6a2f14),_0x105155[_0x4218f1(0x173)]&&_0x41bed3[_0x4218f1(0x115)]>0x0&&console['error'](_0x4218f1(0x11f)+_0x41bed3[_0x4218f1(0x115)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0xda7386);}catch(_0x31abb1){_0x105155[_0x4218f1(0x173)]&&console[_0x4218f1(0x145)](_0x4218f1(0x104)+_0x31abb1[_0x4218f1(0xeb)]);}const _0x22aa36=[],_0x127905=new Set(),_0x3e45f2=new Map(),_0x1a0d51=new Map(),_0xfa32cf=new Set(),_0x520d42=new Map(),_0x31cf89=new Map(),_0x37d0b9=createJumpTargetCache();await withProgressSpinner(_0x4218f1(0xe9)+_0xda7386+_0x4218f1(0x18b),async _0xe37970=>{const _0x40c19f=_0x4218f1;for(const _0x20f376 of _0x36463b){const _0x32c005=_0x36463b[_0x40c19f(0x175)]>0x1?_0x20f376[_0x40c19f(0xf4)]+'\x20v'+(_0x20f376[_0x40c19f(0x143)]||0x1):_0x20f376[_0x40c19f(0xf4)];_0xe37970[_0x40c19f(0x13c)](_0x40c19f(0xe9)+_0x32c005);const _0x427b41=await _0x234979[_0x40c19f(0x177)][_0x40c19f(0x17b)](_0x20f376['id']),_0x1f37a4=_0x427b41[_0x40c19f(0xcc)]?.['audienceId'],_0x599a4={'resolveSegment':async _0x35d9cb=>{const _0x12ca33=_0x40c19f;if(!_0x1f37a4)return{'name':_0x35d9cb,'isJourneyLocal':![]};const _0x4114d9=_0x3e45f2['get'](_0x35d9cb);if(_0x4114d9)return _0x4114d9;try{const _0x582bf6=await _0x234979['segment'][_0x12ca33(0x16e)](_0x1f37a4,_0x35d9cb),_0x32b9a6=_0x582bf6['kind']===SEGMENT_KIND_JOURNEY;let _0x26099c,_0x14619f=_0x582bf6[_0x12ca33(0x174)];if(_0x32b9a6&&_0x582bf6['rule']){const _0x526565=await segmentResponseToDef(_0x582bf6,{'resolveSegmentName':async _0x932be7=>{const _0x4564a4=_0x12ca33,_0xea970f=_0x3e45f2['get'](_0x932be7);if(_0xea970f)return _0xea970f[_0x4564a4(0x174)];const _0x3a349e=await _0x599a4[_0x4564a4(0xd9)](_0x932be7);return _0x3a349e[_0x4564a4(0x174)];}}),_0x5a3b74=_0x526565[_0x12ca33(0xc2)];_0x26099c={'description':_0x582bf6[_0x12ca33(0x189)],'rule':_0x5a3b74};const _0x3f3d15=serializeRule(_0x5a3b74),_0x390f06=_0x1a0d51[_0x12ca33(0x13d)](_0x3f3d15);if(_0x390f06)_0x14619f=_0x390f06,_0x26099c=undefined,_0x105155[_0x12ca33(0x173)]&&console[_0x12ca33(0x145)](_0x12ca33(0x113)+_0x582bf6[_0x12ca33(0x174)]+_0x12ca33(0x15a)+_0x390f06);else{let _0x37aba6=![];if(_0x41bed3){const _0x46bb19=_0x41bed3[_0x12ca33(0x13d)](_0x3f3d15);if(_0x46bb19){const _0x14d7b8=_0x46bb19['find'](_0x2ed3e1=>!_0x127905[_0x12ca33(0x129)](_0x2ed3e1));_0x14d7b8&&(_0x14619f=_0x14d7b8,_0x127905[_0x12ca33(0xce)](_0x14d7b8),_0x1a0d51[_0x12ca33(0xc1)](_0x3f3d15,_0x14d7b8),_0x37aba6=!![],_0x105155['verbose']&&console['error']('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x14d7b8+_0x12ca33(0x179)));}}if(!_0x37aba6){const _0x1ecfe4=generateJourneyLocalName(_0x582bf6[_0x12ca33(0x174)]);_0x1ecfe4&&(_0x14619f=_0x1ecfe4);let _0x331e3b=_0x14619f,_0x407699=0x2;while(_0x127905[_0x12ca33(0x129)](_0x331e3b)){_0x331e3b=_0x14619f+'_'+_0x407699,_0x407699++;}_0x127905[_0x12ca33(0xce)](_0x331e3b),_0x1a0d51[_0x12ca33(0xc1)](_0x3f3d15,_0x331e3b),_0x14619f=_0x331e3b;}}}const _0x1ae402={'name':_0x14619f,'isJourneyLocal':_0x32b9a6,'definition':_0x26099c};return _0x3e45f2[_0x12ca33(0xc1)](_0x35d9cb,_0x1ae402),_0x1ae402;}catch(_0x29e9d9){return _0x18ba6c[_0x12ca33(0x173)]&&console[_0x12ca33(0x145)](_0x12ca33(0x159)+_0x35d9cb+':\x20'+_0x29e9d9[_0x12ca33(0xeb)]),{'name':_0x35d9cb,'isJourneyLocal':![]};}},'resolveActivation':async _0x4a6834=>{const _0x4fe766=_0x40c19f,_0x44f788=_0x520d42[_0x4fe766(0x13d)](_0x4a6834);if(_0x44f788)return _0x44f788;try{const _0x2a7530=await _0x234979[_0x4fe766(0x177)][_0x4fe766(0xcb)](_0x20f376['id'],_0x4a6834),_0x411a42=journeyActivationStepToYaml(_0x2a7530,_0x86b3e,_0x1649db),_0x5ac07d=JSON[_0x4fe766(0x132)]({'name':_0x411a42['name'],'connection':_0x411a42[_0x4fe766(0xd4)],'connector_config':_0x411a42['connector_config']}),_0x413409=_0x31cf89['get'](_0x5ac07d);if(_0x413409){const _0x335170={'name':_0x413409,'isJourneyLocal':!![],'definition':_0x411a42};return _0x520d42[_0x4fe766(0xc1)](_0x4a6834,_0x335170),_0x335170;}const _0x20287c=_0x2a7530[_0x4fe766(0xcc)][_0x4fe766(0x16b)][_0x4fe766(0x174)]||_0x4a6834,_0x382afc=sanitizeYamlKey(_0x20287c)||_0x4fe766(0x172)+_0x4a6834;let _0x51ce45=_0x382afc,_0xd058a2=0x2;while(_0xfa32cf[_0x4fe766(0x129)](_0x51ce45)){_0x51ce45=_0x382afc+'_'+_0xd058a2,_0xd058a2++;}_0xfa32cf[_0x4fe766(0xce)](_0x51ce45),_0x31cf89[_0x4fe766(0xc1)](_0x5ac07d,_0x51ce45);const _0x193a0c={'name':_0x51ce45,'isJourneyLocal':!![],'definition':_0x411a42};return _0x520d42[_0x4fe766(0xc1)](_0x4a6834,_0x193a0c),_0x193a0c;}catch(_0x29788e){return _0x18ba6c[_0x4fe766(0x173)]&&console[_0x4fe766(0x145)](_0x4fe766(0x171)+_0x4a6834+':\x20'+_0x29788e[_0x4fe766(0xeb)]),{'name':_0x4a6834,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5a155a,_0x1414de)=>{const _0x13888a=_0x40c19f;return resolveJumpTarget(_0x5a155a,_0x1414de,_0x37d0b9,_0x2604b1=>_0x234979[_0x13888a(0x177)][_0x13888a(0x17b)](_0x2604b1));}},_0x14bdbf=await journeyResponseToDef(_0x427b41,_0x599a4);_0x22aa36['push']({'item':_0x20f376,'yaml':_0x14bdbf});}},{'verbose':_0x18ba6c[_0x4218f1(0x173)]});const _0x5205db=buildMergedJourneyDef(_0x22aa36,_0x41bed3),_0x2f3907=normalizeJourneyDef(_0x5205db,_0x2ce976),_0x46d382=toYamlString(_0x2f3907),_0x75cccf=_0x955ec1||a18_0xeb7b53[_0x4218f1(0xe7)](_0x593338,sanitizeFileName(_0xda7386)+'.yml');!_0x955ec1&&_0x25ea03&&!existsSync(_0x593338)&&mkdirSync(_0x593338,{'recursive':!![]});const _0x23fd04=a18_0xeb7b53[_0x4218f1(0xc8)](process[_0x4218f1(0x146)](),_0x75cccf);if(existsSync(_0x75cccf)){const _0x94b94=readFileSync(_0x75cccf,'utf-8'),_0x36977f=generateDiff(_0x94b94,_0x46d382),_0x4c44c0=hasChanges(_0x36977f);_0x4ddef4[_0x4218f1(0x164)]({'relativePath':_0x23fd04,'absolutePath':_0x75cccf,'content':_0x46d382,'isNew':![],'hasChanges':_0x4c44c0,'diff':_0x4c44c0?formatDiffWithColors(_0x36977f):undefined});}else _0x4ddef4[_0x4218f1(0x164)]({'relativePath':_0x23fd04,'absolutePath':_0x75cccf,'content':_0x46d382,'isNew':!![],'hasChanges':![]});}const _0x37c440=_0x4ddef4[_0x4218f1(0x144)](_0x20670f=>_0x20670f[_0x4218f1(0x123)]),_0x4422bc=_0x4ddef4[_0x4218f1(0x144)](_0x146631=>!_0x146631[_0x4218f1(0x123)]&&_0x146631[_0x4218f1(0x155)]),_0xa2828e=_0x4ddef4['filter'](_0xa6cd66=>!_0xa6cd66[_0x4218f1(0x123)]&&!_0xa6cd66[_0x4218f1(0x155)]),_0xb81309=_0x166956[_0x4218f1(0x175)],_0x4eba46=_0x29ac3e[_0x4218f1(0x115)],_0x1e7569=_0xb81309>_0x4eba46?'\x20('+_0xb81309+_0x4218f1(0x16c):'';console['error'](_0x4218f1(0xb9)),console['error']('\x20\x20'+a18_0x2db01d[_0x4218f1(0x10d)](_0x4eba46+_0x4218f1(0x15e))+a18_0x2db01d[_0x4218f1(0xb5)](_0x1e7569)),console[_0x4218f1(0x145)]('\x20\x20'+a18_0x2db01d['green']('+\x20'+_0x37c440['length']+_0x4218f1(0xc9))),console[_0x4218f1(0x145)]('\x20\x20'+a18_0x2db01d[_0x4218f1(0x110)]('~\x20'+_0x4422bc[_0x4218f1(0x175)]+_0x4218f1(0x170))),console[_0x4218f1(0x145)]('\x20\x20'+a18_0x2db01d['dim']('=\x20'+_0xa2828e[_0x4218f1(0x175)]+_0x4218f1(0xf5))),console[_0x4218f1(0x145)]('\x20\x20Target:\x20'+a18_0x2db01d[_0x4218f1(0x10d)](_0x5380be)+'\x0a');if(_0x4422bc[_0x4218f1(0x175)]>0x0)for(const _0x4ae55f of _0x4422bc){console[_0x4218f1(0x145)]('\x0aChanges\x20to\x20\x27'+_0x4ae55f[_0x4218f1(0xc0)]+'\x27:'),console[_0x4218f1(0x145)]('─'[_0x4218f1(0xd2)](0x3c)),console[_0x4218f1(0x145)](_0x4ae55f[_0x4218f1(0x137)]),console['error']('─'[_0x4218f1(0xd2)](0x3c));}if(_0x105155['dryRun'])return console[_0x4218f1(0x145)](a18_0x2db01d[_0x4218f1(0x110)](_0x4218f1(0x183))),0x0;if(_0x37c440[_0x4218f1(0x175)]===0x0&&_0x4422bc[_0x4218f1(0x175)]===0x0)return console[_0x4218f1(0x145)](a18_0x2db01d['green'](_0x4218f1(0x11b))),saveSessionContext({'parent_segment':_0xe87cbf},_0x105155[_0x4218f1(0x101)]),console[_0x4218f1(0x145)](a18_0x2db01d[_0x4218f1(0x184)]('✔\x20Context\x20set:\x20'+a18_0x2db01d[_0x4218f1(0xb5)](_0x4218f1(0x17a))+_0x4218f1(0x15b)+a18_0x2db01d[_0x4218f1(0x10d)](_0xe87cbf))),0x0;if(!_0x105155[_0x4218f1(0xf7)]&&(_0x37c440[_0x4218f1(0x175)]>0x0||_0x4422bc['length']>0x0)){const _0x2eeafa=await confirmKey(_0x4218f1(0x186)+(_0x37c440[_0x4218f1(0x175)]+_0x4422bc['length'])+_0x4218f1(0x10f));if(!_0x2eeafa)return console[_0x4218f1(0x145)]('Aborted.'),0x1;}!existsSync(_0x5380be)&&mkdirSync(_0x5380be,{'recursive':!![]});for(const _0x291837 of _0x4ddef4){(_0x291837[_0x4218f1(0x123)]||_0x291837[_0x4218f1(0x155)])&&writeFileSync(_0x291837[_0x4218f1(0xca)],_0x291837[_0x4218f1(0x185)],_0x4218f1(0x14d));}return console[_0x4218f1(0x145)](a18_0x2db01d['green'](_0x4218f1(0x127)+(_0x37c440['length']+_0x4422bc['length'])+_0x4218f1(0x12e)+_0x5380be)),saveSessionContext({'parent_segment':_0xe87cbf},_0x105155[_0x4218f1(0x101)]),console[_0x4218f1(0x145)](a18_0x2db01d['green'](_0x4218f1(0x188)+a18_0x2db01d[_0x4218f1(0xb5)]('parent_segment')+_0x4218f1(0x15b)+a18_0x2db01d[_0x4218f1(0x10d)](_0xe87cbf))),0x0;}}export class JourneyPushCommand extends BaseCommand{[a18_0x5ceb5b(0x174)]=a18_0x5ceb5b(0x10c);[a18_0x5ceb5b(0x189)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';['segmentPushCommand']=new SegmentPushCommand();async[a18_0x5ceb5b(0xf0)](_0x182bbc){const _0x307c35=a18_0x5ceb5b,_0x288965=_0x182bbc[_0x307c35(0x114)][0x0];let _0x110ffc;if(_0x288965){const _0x1fcad5=await resolveTarget({'arg':_0x288965,'contextParent':_0x182bbc[_0x307c35(0x166)][_0x307c35(0xd5)],'cwd':process[_0x307c35(0x146)]()});isSuccessfulResolution(_0x1fcad5)&&_0x1fcad5[_0x307c35(0xe3)]===_0x307c35(0x168)&&(_0x110ffc=_0x1fcad5[_0x307c35(0x152)]);}const _0x4e10d3={..._0x182bbc,'options':{..._0x182bbc['options'],'journeysOnly':!![],..._0x110ffc&&{'singleFilePath':_0x110ffc}}};return this[_0x307c35(0x100)][_0x307c35(0xf0)](_0x4e10d3);}}
|
|
1
|
+
const a18_0x4b99e4=a18_0x5d42;(function(_0x4abf2c,_0x282ab2){const _0x514244=a18_0x5d42,_0x4b3b57=_0x4abf2c();while(!![]){try{const _0x763a1f=-parseInt(_0x514244(0x243))/0x1+parseInt(_0x514244(0x218))/0x2*(-parseInt(_0x514244(0x24e))/0x3)+-parseInt(_0x514244(0x251))/0x4*(parseInt(_0x514244(0x1e8))/0x5)+parseInt(_0x514244(0x234))/0x6+parseInt(_0x514244(0x1bc))/0x7+-parseInt(_0x514244(0x1f4))/0x8+parseInt(_0x514244(0x231))/0x9;if(_0x763a1f===_0x282ab2)break;else _0x4b3b57['push'](_0x4b3b57['shift']());}catch(_0xf94ac1){_0x4b3b57['push'](_0x4b3b57['shift']());}}}(a18_0x2794,0x3a494));import a18_0x4f49ab from'chalk';import a18_0x56ab2f from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a18_0x5d42(_0x1cc9be,_0x551a02){_0x1cc9be=_0x1cc9be-0x1b2;const _0x279413=a18_0x2794();let _0x5d42fc=_0x279413[_0x1cc9be];return _0x5d42fc;}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function formatJourneyState(_0x5c80f3){const _0x1ff2f1=a18_0x5d42;switch(_0x5c80f3){case _0x1ff2f1(0x1b7):return a18_0x4f49ab[_0x1ff2f1(0x21a)](_0x1ff2f1(0x1ce));case _0x1ff2f1(0x1b3):return a18_0x4f49ab[_0x1ff2f1(0x1f7)](_0x1ff2f1(0x219));case'paused':return a18_0x4f49ab[_0x1ff2f1(0x283)](_0x1ff2f1(0x246));case _0x1ff2f1(0x229):return a18_0x4f49ab[_0x1ff2f1(0x1c2)](_0x1ff2f1(0x1d4));case _0x1ff2f1(0x232):return a18_0x4f49ab[_0x1ff2f1(0x1f7)](_0x1ff2f1(0x21c));default:return'('+_0x5c80f3+')';}}function formatJourneyItem(_0x489fb0,_0x16512c='',_0x34f763){const _0xfea6fe=a18_0x5d42,_0x17bd2f=formatJourneyState(_0x489fb0[_0xfea6fe(0x276)]),_0x2d4b33=_0x34f763?hyperlink(_0x489fb0[_0xfea6fe(0x266)],_0x34f763):_0x489fb0['journeyBundleName'];return _0x16512c+_0xfea6fe(0x21f)+_0x2d4b33+'\x20'+_0x17bd2f;}function escapeRegex(_0x1aea33){const _0x5dddef=a18_0x5d42;return _0x1aea33['replace'](/[.*+?^${}()|[\]\\]/g,_0x5dddef(0x1d8));}function a18_0x2794(){const _0x32dcab=['/j/da','base','(root)','\x22\x20not\x20found','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','buildIdToNameMap','Parent\x20segment:\x20','absolutePath','250100akzGsj','dryRun','Fetching\x20','(paused)','📁\x20','folders','journeyBundleId','listJourneysWithFolders','filter','Cancelled','No\x20statistics\x20available\x20for\x20journey:\x20','593025DRpCGp','totalEntered','log','550736PxGvsv','Error:\x20Journey\x20\x27','options','Fetching\x20users\x20for\x20email\x20resolution...','format','add','getJourney','journeyStages','test','folderId','stringify','journeyName','journeys','Export\x20journey(s)\x20as\x20YAML\x20files','Warning:\x20Stage\x20\x22','user','kind','execute','✔\x20All\x20files\x20are\x20up\x20to\x20date','relativePath','INVALID_ARGUMENT','journeyBundleName','split','Listing\x20folders...','\x20->\x20','stageName','journey:list','segments','parent_segment','stage','Resolving\x20journey...','resolveSegment','Target\x20directory:\x20','.yml','\x20new\x20files','getParentFull','utf-8','state','\x20(ID:\x20','map','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','goalRate','Show\x20journey\x20details','Getting\x20journey\x20details...','setPhase','all','No\x20journeys\x20found','resolveJourneyId','journeyId','\x22\x20paused','yellow','Resolved\x20YAML\x20file:\x20','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','reentryMode','listFolders','Getting\x20journey\x20statistics...','Show\x20journey\x20statistics','description','\x20=\x20','draft','message','\x27\x20not\x20found\x20in\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','launched','Options:','journey:pause','Listing\x20journeys...','includeStats','198625KYXbMh','entered','stages','verbose','Usage:\x20journey\x20stats\x20<name-or-path>','sort','blue','site','data','has','errorCode','connection','rule','\x0aChanges\x20to\x20\x27','/e/','segment','Resume\x20a\x20paused\x20journey','Found\x20','(running)','type','\x20journeys','\x20\x20Statistics\x20not\x20available','\x20\x20Preserving\x20local\x20segment\x20name:\x20','table','(completed)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','diff','Usage:\x20journey\x20pause\x20<name-or-path>','\x5c$&','\x20\x20Consolidating\x20duplicate\x20segment:\x20','/j/da/je','cwd','repeat','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20files?','entries','Resolving\x20parent\x20segment...','\x20\x20Name:\x20','exited','toLowerCase','\x20Opening\x20','Error:\x20Parent\x20segment\x20context\x20required','find','length','5HPtgmH','✔\x20Journey\x20\x22','root\x20folder','population','✔\x20Context\x20set:\x20','Fetching\x20parent\x20segment...','conversionRate','buildIdToEmailMap','content','activation_','\x20versions)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','3724056CrpdIZ','\x20(rule\x20match)','Usage:\x20journey\x20resume\x20<name-or-path>','dim','no_parent','hasChanges','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x22\x20resumed','parentName','\x20journey','session','totalGoalAchieved','segmentName','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','then','name','values','/app/ps/','size','web','journey:resume','cyan','paused','resolveParentId','args','Input:\x20','versionNumber','journey:push','getActivation','journey','folderPath','segmentPushCommand','...','\x20\x20-\x20','\x20\x20Folder\x20path:\x20','journey:view','2yRasxt','(draft)','green','localeCompare','(archived)','Error:\x20','attributes','🗺️\x20','error','listJourneysFromParentSegment','get','getStatistics','set','Fetching\x20connections\x20for\x20name\x20resolution...','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','connector_config','rootFolderId','completed','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x20changed\x20files','parentSegment','push','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','yes','join','10497852JacRJw','archived','Target\x20file:\x20','569418mLSYYT','getSegment','file','Pausing\x20journey...','red','Pattern:\x20'];a18_0x2794=function(){return _0x32dcab;};return a18_0x2794();}function globToRegex(_0x36df95){const _0x4e9c54=a18_0x5d42,_0x4a1c3e=_0x36df95[_0x4e9c54(0x267)]('*')[_0x4e9c54(0x278)](escapeRegex);return new RegExp(_0x4a1c3e['join']('.*'),'i');}function buildRuleToNameMapping(_0x717cee){const _0x237f5c=a18_0x5d42,_0x30ef72=new Map();if(_0x717cee[_0x237f5c(0x26c)])for(const [_0x575df8,_0x206e49]of Object[_0x237f5c(0x1df)](_0x717cee[_0x237f5c(0x26c)])){if(_0x206e49[_0x237f5c(0x1c8)]){const _0x2f405f=serializeRule(_0x206e49[_0x237f5c(0x1c8)]),_0x3eef99=_0x30ef72[_0x237f5c(0x222)](_0x2f405f);_0x3eef99?_0x3eef99[_0x237f5c(0x22d)](_0x575df8):_0x30ef72[_0x237f5c(0x224)](_0x2f405f,[_0x575df8]);}}return _0x30ef72;}async function resolveJourneyTarget(_0x1a1934,_0x4f5cbc,_0x4e0408){const _0x39bb48=a18_0x5d42;if(isYamlFilePath(_0x1a1934))try{const _0x437470=await resolveYamlFilePath(_0x1a1934);return _0x4e0408&&(console[_0x39bb48(0x220)](_0x39bb48(0x284)+_0x1a1934),console[_0x39bb48(0x220)]('\x20\x20Parent\x20segment:\x20'+_0x437470[_0x39bb48(0x22c)]),console[_0x39bb48(0x220)](_0x39bb48(0x1e1)+_0x437470[_0x39bb48(0x200)]),console['error'](_0x39bb48(0x216)+(_0x437470[_0x39bb48(0x212)]||'(root)'))),{'journeyName':_0x437470[_0x39bb48(0x200)],'parentSegment':_0x437470['parentSegment'],'resolved':_0x437470};}catch(_0x4c4ca6){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x39bb48(0x23f)+_0x4c4ca6['message']);}if(!_0x4f5cbc)throw new SDKError(ErrorCode[_0x39bb48(0x265)],_0x39bb48(0x201));return{'journeyName':_0x1a1934,'parentSegment':_0x4f5cbc};}export class JourneyListCommand extends BaseCommand{[a18_0x4b99e4(0x203)]=a18_0x4b99e4(0x26b);[a18_0x4b99e4(0x28b)]='List\x20journeys\x20in\x20current\x20context';async[a18_0x4b99e4(0x262)](_0x2ccb63){const _0x1a2cca=a18_0x4b99e4,{options:_0x13ece7,args:_0x2c425c,tdx:_0x2dda6a}=_0x2ccb63,_0x2b547c=_0x2c425c[0x0],_0x2a4d8c=_0x13ece7['parentSegment'];if(!_0x2a4d8c)return console[_0x1a2cca(0x220)](_0x1a2cca(0x1e5)),console[_0x1a2cca(0x220)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x4ae282=await withSpinner(_0x1a2cca(0x1e0),()=>_0x2dda6a[_0x1a2cca(0x1cb)]['resolveParentId'](_0x2a4d8c),{'verbose':_0x13ece7[_0x1a2cca(0x1bf)]}),_0x515ae8=_0x4ae282['data'];_0x13ece7[_0x1a2cca(0x1bf)]&&(console['error']('Parent\x20segment:\x20'+_0x2a4d8c+_0x1a2cca(0x277)+_0x515ae8+')'),_0x2b547c&&console[_0x1a2cca(0x220)](_0x1a2cca(0x239)+_0x2b547c));const _0x13f043=await withSpinner(_0x1a2cca(0x1ed),()=>_0x2dda6a['segment'][_0x1a2cca(0x274)](_0x515ae8),{'verbose':_0x13ece7[_0x1a2cca(0x1bf)]}),_0x592798=_0x13f043['data'],_0x1a4a70=_0x592798[_0x1a2cca(0x228)],_0x29561e=await withSpinner(_0x1a2cca(0x1ba),()=>_0x2dda6a[_0x1a2cca(0x211)][_0x1a2cca(0x24a)](_0x515ae8,_0x1a4a70),{'verbose':_0x13ece7['verbose']});let _0x23d8b0=_0x29561e['data'][_0x1a2cca(0x25d)];const _0x27f33a=_0x29561e[_0x1a2cca(0x1c4)][_0x1a2cca(0x248)],_0x3d82a8=new Map();for(const _0x4619ea of _0x27f33a){_0x3d82a8[_0x1a2cca(0x224)](_0x4619ea['id'],_0x4619ea[_0x1a2cca(0x203)]);}if(_0x2b547c){const _0x92cb6d=globToRegex(_0x2b547c);_0x23d8b0=_0x23d8b0[_0x1a2cca(0x24b)](_0x3262e4=>_0x92cb6d[_0x1a2cca(0x259)](_0x3262e4[_0x1a2cca(0x266)]));}console[_0x1a2cca(0x220)]('✔\x20Found\x20'+_0x23d8b0[_0x1a2cca(0x1e7)]+_0x1a2cca(0x1fd)+(_0x23d8b0[_0x1a2cca(0x1e7)]!==0x1?'s':''));const _0x346a74=_0x38c3a8=>{const _0x48eef4=_0x1a2cca;return getConsoleNextUrl(_0x13ece7[_0x48eef4(0x1c3)],_0x48eef4(0x205)+_0x515ae8+_0x48eef4(0x1ca)+_0x38c3a8+_0x48eef4(0x23a));};if(_0x13ece7[_0x1a2cca(0x255)]===_0x1a2cca(0x1d3))await handleSDKOutput(_0x23d8b0,_0x13ece7);else{if(_0x13ece7[_0x1a2cca(0x255)]==='json'){const _0x2746e8=_0x23d8b0['map'](_0x1e01ab=>({..._0x1e01ab,'url':_0x346a74(_0x1e01ab['id'])}));await handleSDKOutput(_0x2746e8,_0x13ece7);}else{console[_0x1a2cca(0x250)]('['+_0x2a4d8c+']');const _0x3ab157=new Map(),_0x3c4eb6=[];for(const _0x4c6e48 of _0x23d8b0){if(!_0x4c6e48[_0x1a2cca(0x25a)]||_0x4c6e48[_0x1a2cca(0x25a)]===_0x1a4a70)_0x3c4eb6[_0x1a2cca(0x22d)](_0x4c6e48);else{const _0x2af127=_0x3ab157[_0x1a2cca(0x222)](_0x4c6e48[_0x1a2cca(0x25a)])||[];_0x2af127[_0x1a2cca(0x22d)](_0x4c6e48),_0x3ab157[_0x1a2cca(0x224)](_0x4c6e48[_0x1a2cca(0x25a)],_0x2af127);}}const _0x205490=(_0x152b0d,_0x40925f)=>_0x152b0d[_0x1a2cca(0x266)][_0x1a2cca(0x21b)](_0x40925f[_0x1a2cca(0x266)],undefined,{'sensitivity':'base'});_0x3c4eb6[_0x1a2cca(0x1c1)](_0x205490);for(const _0x195601 of _0x3c4eb6){console[_0x1a2cca(0x250)](formatJourneyItem(_0x195601,'',_0x346a74(_0x195601['id'])));}const _0x222f1a=[..._0x3ab157[_0x1a2cca(0x1df)]()][_0x1a2cca(0x1c1)]((_0x5c6a79,_0x25d41e)=>{const _0x319e5=_0x1a2cca,_0x1b6a0a=_0x3d82a8[_0x319e5(0x222)](_0x5c6a79[0x0])||_0x5c6a79[0x0],_0x46c080=_0x3d82a8[_0x319e5(0x222)](_0x25d41e[0x0])||_0x25d41e[0x0];return _0x1b6a0a[_0x319e5(0x21b)](_0x46c080,undefined,{'sensitivity':_0x319e5(0x23b)});});for(const [_0x12e5d2,_0x46eeb0]of _0x222f1a){const _0x14e9c0=_0x3d82a8[_0x1a2cca(0x222)](_0x12e5d2)||_0x12e5d2;console[_0x1a2cca(0x250)](_0x1a2cca(0x247)+_0x14e9c0),_0x46eeb0['sort'](_0x205490);for(const _0x247352 of _0x46eeb0){console[_0x1a2cca(0x250)](formatJourneyItem(_0x247352,'\x20\x20',_0x346a74(_0x247352['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a18_0x4b99e4(0x203)]=a18_0x4b99e4(0x217);[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x27b);async[a18_0x4b99e4(0x262)](_0x4f64c2){const _0x2d77d3=a18_0x4b99e4,{options:_0x4fb21b,args:_0x1db8b7,tdx:_0x421ab1}=_0x4f64c2,_0xa75af4=_0x1db8b7[0x0];if(!_0xa75af4)return console['error'](_0x2d77d3(0x279)),console[_0x2d77d3(0x220)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x2d77d3(0x220)](_0x2d77d3(0x1b8)),console[_0x2d77d3(0x220)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x4fb21b[_0x2d77d3(0x1bf)]&&console['error'](_0x2d77d3(0x20d)+_0xa75af4);const _0x105cb8=await resolveJourneyTarget(_0xa75af4,_0x4fb21b[_0x2d77d3(0x22c)],_0x4fb21b[_0x2d77d3(0x1bf)]),_0x1dd1ed=await withSpinner(_0x2d77d3(0x1e0),()=>_0x421ab1[_0x2d77d3(0x1cb)][_0x2d77d3(0x20b)](_0x105cb8[_0x2d77d3(0x22c)]),{'verbose':_0x4fb21b[_0x2d77d3(0x1bf)]}),_0x4d467a=_0x1dd1ed['data'],_0x3e2266=await withSpinner(_0x2d77d3(0x26f),()=>_0x421ab1[_0x2d77d3(0x211)][_0x2d77d3(0x280)](_0x4d467a,_0x105cb8['journeyName']),{'verbose':_0x4fb21b[_0x2d77d3(0x1bf)]}),_0x3cbcf4=_0x3e2266[_0x2d77d3(0x1c4)];if(_0x4fb21b[_0x2d77d3(0x207)]){const _0x5855db=getConsoleNextUrl(_0x4fb21b[_0x2d77d3(0x1c3)],_0x2d77d3(0x205)+_0x4d467a+_0x2d77d3(0x1ca)+_0x3cbcf4+_0x2d77d3(0x1da));return console[_0x2d77d3(0x220)](a18_0x4f49ab[_0x2d77d3(0x21a)]('✔')+_0x2d77d3(0x1e4)+a18_0x4f49ab[_0x2d77d3(0x209)](_0x5855db)),openBrowser(_0x5855db),0x0;}const _0x381832=await withSpinner(_0x2d77d3(0x27c),()=>_0x421ab1['journey'][_0x2d77d3(0x257)](_0x3cbcf4),{'verbose':_0x4fb21b[_0x2d77d3(0x1bf)]}),_0x3c3936=_0x381832['data'],_0x4f6cfc=_0x4fb21b[_0x2d77d3(0x1bb)];let _0x2f69e6;if(_0x4f6cfc)try{const _0x128637=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x421ab1[_0x2d77d3(0x211)][_0x2d77d3(0x223)](_0x3cbcf4),{'verbose':_0x4fb21b[_0x2d77d3(0x1bf)]});_0x2f69e6=_0x128637[_0x2d77d3(0x1c4)];}catch{_0x4fb21b[_0x2d77d3(0x1bf)]&&console[_0x2d77d3(0x220)](_0x2d77d3(0x1d1));}const _0x3f036a=getConsoleNextUrl(_0x4fb21b[_0x2d77d3(0x1c3)],'/app/ps/'+_0x4d467a+_0x2d77d3(0x1ca)+_0x3cbcf4+_0x2d77d3(0x1da)),_0x14c656={'id':_0x3c3936['id'],'name':_0x3c3936['attributes'][_0x2d77d3(0x203)],'description':_0x3c3936['attributes'][_0x2d77d3(0x28b)],'state':_0x3c3936['attributes']['state'],'paused':_0x3c3936['attributes'][_0x2d77d3(0x20a)],'reentry_mode':_0x3c3936['attributes'][_0x2d77d3(0x287)],'stages':_0x3c3936[_0x2d77d3(0x21e)][_0x2d77d3(0x258)]?.[_0x2d77d3(0x1e7)]||0x0,..._0x3c3936[_0x2d77d3(0x21e)]['goal']&&{'goal':_0x3c3936[_0x2d77d3(0x21e)]['goal'][_0x2d77d3(0x203)]},..._0x2f69e6&&{'statistics':{'total_entered':_0x2f69e6['totalEntered'],'goal_achieved':_0x2f69e6[_0x2d77d3(0x1ff)],'goal_rate':_0x2f69e6[_0x2d77d3(0x27a)],'stages':_0x2f69e6[_0x2d77d3(0x1be)]}},'url':_0x3f036a};return await handleSingleObjectOutput(_0x14c656,_0x4fb21b),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x4b99e4(0x203)]='journey:stats';[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x28a);async[a18_0x4b99e4(0x262)](_0x44b428){const _0x91b79d=a18_0x4b99e4,{options:_0x2ebe0d,args:_0x610d3b,tdx:_0x417f19}=_0x44b428,_0xa86b41=_0x610d3b[0x0];if(!_0xa86b41)return console[_0x91b79d(0x220)](_0x91b79d(0x279)),console[_0x91b79d(0x220)](_0x91b79d(0x1c0)),0x1;_0x2ebe0d[_0x91b79d(0x1bf)]&&console[_0x91b79d(0x220)](_0x91b79d(0x20d)+_0xa86b41);const _0x48846f=await resolveJourneyTarget(_0xa86b41,_0x2ebe0d['parentSegment'],_0x2ebe0d[_0x91b79d(0x1bf)]),_0x5b1092=await withSpinner(_0x91b79d(0x1e0),()=>_0x417f19['segment'][_0x91b79d(0x20b)](_0x48846f[_0x91b79d(0x22c)]),{'verbose':_0x2ebe0d[_0x91b79d(0x1bf)]}),_0x57c4d5=_0x5b1092['data'],_0x1c4199=await withSpinner('Resolving\x20journey...',()=>_0x417f19[_0x91b79d(0x211)][_0x91b79d(0x280)](_0x57c4d5,_0x48846f['journeyName']),{'verbose':_0x2ebe0d[_0x91b79d(0x1bf)]}),_0x85c83b=_0x1c4199['data'],_0x4b39ea=await withSpinner(_0x91b79d(0x289),()=>_0x417f19[_0x91b79d(0x211)][_0x91b79d(0x223)](_0x85c83b),{'verbose':_0x2ebe0d[_0x91b79d(0x1bf)]}),_0x32b41b=_0x4b39ea[_0x91b79d(0x1c4)];if(!_0x32b41b||_0x32b41b[_0x91b79d(0x281)]===null)return console['error'](_0x91b79d(0x24d)+_0x48846f[_0x91b79d(0x25c)]),console['error'](_0x91b79d(0x22e)),0x0;const _0x4f8308={'journey_id':_0x32b41b[_0x91b79d(0x281)],'total_entered':_0x32b41b[_0x91b79d(0x24f)],'goal_achieved':_0x32b41b['totalGoalAchieved'],'goal_rate':_0x32b41b[_0x91b79d(0x27a)],'stages':_0x32b41b[_0x91b79d(0x1be)]?.['map'](_0x451db9=>({'name':_0x451db9[_0x91b79d(0x26a)],'population':_0x451db9[_0x91b79d(0x1eb)],'entered':_0x451db9[_0x91b79d(0x1bd)],'exited':_0x451db9[_0x91b79d(0x1e2)],'conversion_rate':_0x451db9[_0x91b79d(0x1ee)]}))},_0x4558e8=_0x2ebe0d[_0x91b79d(0x26e)];if(_0x4558e8&&_0x32b41b[_0x91b79d(0x1be)]){const _0x44bc33=_0x32b41b['stages']['find'](_0x25f5bc=>_0x25f5bc[_0x91b79d(0x26a)]['toLowerCase']()===_0x4558e8[_0x91b79d(0x1e3)]());if(_0x44bc33)return await handleSingleObjectOutput({'stage_name':_0x44bc33['stageName'],'population':_0x44bc33[_0x91b79d(0x1eb)],'entered':_0x44bc33['entered'],'exited':_0x44bc33['exited'],'conversion_rate':_0x44bc33[_0x91b79d(0x1ee)]},_0x2ebe0d),0x0;console[_0x91b79d(0x220)](_0x91b79d(0x25f)+_0x4558e8+_0x91b79d(0x23d));}return await handleSingleObjectOutput(_0x4f8308,_0x2ebe0d),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a18_0x4b99e4(0x203)]=a18_0x4b99e4(0x1b9);[a18_0x4b99e4(0x28b)]='Pause\x20a\x20running\x20journey';async['execute'](_0x1b469a){const _0xf31240=a18_0x4b99e4,{options:_0x362287,args:_0x344ac6,tdx:_0x27b740}=_0x1b469a,_0x27db30=_0x344ac6[0x0];if(!_0x27db30)return console[_0xf31240(0x220)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0xf31240(0x220)](_0xf31240(0x1d7)),0x1;_0x362287[_0xf31240(0x1bf)]&&console['error'](_0xf31240(0x20d)+_0x27db30);const _0x40d97e=await resolveJourneyTarget(_0x27db30,_0x362287['parentSegment'],_0x362287[_0xf31240(0x1bf)]),_0x3a7670=await withSpinner(_0xf31240(0x1e0),()=>_0x27b740[_0xf31240(0x1cb)][_0xf31240(0x20b)](_0x40d97e[_0xf31240(0x22c)]),{'verbose':_0x362287[_0xf31240(0x1bf)]}),_0x27f09d=_0x3a7670[_0xf31240(0x1c4)],_0x585531=await withSpinner(_0xf31240(0x26f),()=>_0x27b740[_0xf31240(0x211)][_0xf31240(0x280)](_0x27f09d,_0x40d97e['journeyName']),{'verbose':_0x362287[_0xf31240(0x1bf)]}),_0x197d72=_0x585531[_0xf31240(0x1c4)];if(!_0x362287[_0xf31240(0x22f)]){const _0x59da69=await confirm(_0xf31240(0x22a)+_0x40d97e[_0xf31240(0x25c)]+'\x22?');if(!_0x59da69)return console['error'](_0xf31240(0x24c)),0x0;}const _0x403731=await withSpinner(_0xf31240(0x237),()=>_0x27b740[_0xf31240(0x211)]['pause'](_0x197d72),{'verbose':_0x362287[_0xf31240(0x1bf)]}),_0x212b75=_0x403731[_0xf31240(0x1c4)];return console['error'](_0xf31240(0x1e9)+_0x212b75[_0xf31240(0x21e)]['name']+_0xf31240(0x282)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a18_0x4b99e4(0x208);[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x1cc);async['execute'](_0x1a6224){const _0x5b4525=a18_0x4b99e4,{options:_0x594a0a,args:_0xc08f56,tdx:_0x276c6b}=_0x1a6224,_0x1fe052=_0xc08f56[0x0];if(!_0x1fe052)return console[_0x5b4525(0x220)](_0x5b4525(0x279)),console['error'](_0x5b4525(0x1f6)),0x1;_0x594a0a['verbose']&&console[_0x5b4525(0x220)](_0x5b4525(0x20d)+_0x1fe052);const _0x5e9f53=await resolveJourneyTarget(_0x1fe052,_0x594a0a[_0x5b4525(0x22c)],_0x594a0a[_0x5b4525(0x1bf)]),_0x1dae21=await withSpinner(_0x5b4525(0x1e0),()=>_0x276c6b['segment'][_0x5b4525(0x20b)](_0x5e9f53[_0x5b4525(0x22c)]),{'verbose':_0x594a0a['verbose']}),_0x3080d2=_0x1dae21[_0x5b4525(0x1c4)],_0x55164b=await withSpinner(_0x5b4525(0x26f),()=>_0x276c6b['journey'][_0x5b4525(0x280)](_0x3080d2,_0x5e9f53['journeyName']),{'verbose':_0x594a0a[_0x5b4525(0x1bf)]}),_0x181006=_0x55164b[_0x5b4525(0x1c4)];if(!_0x594a0a['yes']){const _0x3ce34a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x5e9f53[_0x5b4525(0x25c)]+'\x22?');if(!_0x3ce34a)return console[_0x5b4525(0x220)](_0x5b4525(0x24c)),0x0;}const _0x339850=await withSpinner('Resuming\x20journey...',()=>_0x276c6b[_0x5b4525(0x211)]['resume'](_0x181006),{'verbose':_0x594a0a['verbose']}),_0x9623a=_0x339850[_0x5b4525(0x1c4)];return console[_0x5b4525(0x220)]('✔\x20Journey\x20\x22'+_0x9623a[_0x5b4525(0x21e)][_0x5b4525(0x203)]+_0x5b4525(0x1fb)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']='journey:pull';[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x25e);async[a18_0x4b99e4(0x262)](_0x12a848){const _0xedcc21=a18_0x4b99e4,{options:_0x32c224,args:_0x567c61,tdx:_0x24e730}=_0x12a848,_0x2b8019=_0x32c224,_0x1d31d4=_0x567c61[0x0],_0x4a1577=_0x1d31d4&&isYamlFilePath(_0x1d31d4),_0x3e19df=await resolveTarget({'arg':_0x4a1577?_0x1d31d4:undefined,'contextParent':_0x32c224[_0xedcc21(0x22c)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3e19df))return _0x3e19df[_0xedcc21(0x1c6)]===_0xedcc21(0x1f8)?(console[_0xedcc21(0x220)](a18_0x4f49ab['yellow'](_0xedcc21(0x286))),console['error'](_0xedcc21(0x1b6)),console[_0xedcc21(0x220)](_0xedcc21(0x1f3)),console[_0xedcc21(0x220)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0xedcc21(0x220)](_0xedcc21(0x1d5))):(console[_0xedcc21(0x220)](a18_0x4f49ab[_0xedcc21(0x238)](_0xedcc21(0x21d)+_0x3e19df['message']+'\x0a')),_0x3e19df['helpText']&&console[_0xedcc21(0x220)](a18_0x4f49ab['cyan'](_0x3e19df['helpText']))),0x1;let _0x4c642d=_0x4a1577?undefined:_0x1d31d4,_0x5f5abb,_0x27acbb;_0x3e19df[_0xedcc21(0x1cf)]===_0xedcc21(0x236)&&(_0x4c642d=_0x3e19df['resourceName'],_0x5f5abb=_0x3e19df[_0xedcc21(0x285)],_0x27acbb=_0x3e19df[_0xedcc21(0x212)]);const _0x5e26a5=_0x3e19df[_0xedcc21(0x1fc)],_0x1a5b0d=_0x3e19df['targetDir'];_0x2b8019[_0xedcc21(0x1bf)]&&(console['error'](_0xedcc21(0x241)+_0x5e26a5),console[_0xedcc21(0x220)](_0xedcc21(0x271)+_0x1a5b0d),_0x4c642d&&console[_0xedcc21(0x220)]('Journey\x20name:\x20'+_0x4c642d),_0x5f5abb&&console[_0xedcc21(0x220)](_0xedcc21(0x233)+_0x5f5abb),_0x27acbb&&console[_0xedcc21(0x220)]('Folder\x20path:\x20'+_0x27acbb));const _0x31d160=await withSpinner(_0xedcc21(0x1e0),()=>_0x24e730[_0xedcc21(0x1cb)]['resolveParentId'](_0x5e26a5),{'verbose':_0x32c224[_0xedcc21(0x1bf)]}),_0x312a84=_0x31d160[_0xedcc21(0x1c4)],[_0x203d91,_0x22d25c]=await Promise[_0xedcc21(0x27e)]([withSpinner(_0xedcc21(0x1ba),()=>_0x24e730[_0xedcc21(0x211)][_0xedcc21(0x221)](_0x312a84,undefined,{'includeAllVersions':!![]}),{'verbose':_0x32c224[_0xedcc21(0x1bf)]}),withSpinner(_0xedcc21(0x268),()=>_0x24e730[_0xedcc21(0x1cb)][_0xedcc21(0x288)](_0x312a84),{'verbose':_0x32c224[_0xedcc21(0x1bf)]})]);let _0x2db758=_0x203d91[_0xedcc21(0x1c4)];const _0x484d93=_0x22d25c[_0xedcc21(0x1c4)],_0x7bb7d5=buildFolderIdToPathMap(_0x484d93);if(_0x4c642d){const _0x3e7d67=_0x2db758[_0xedcc21(0x24b)](_0x1d78e6=>_0x1d78e6[_0xedcc21(0x266)][_0xedcc21(0x1e3)]()===_0x4c642d['toLowerCase']());if(_0x3e7d67[_0xedcc21(0x1e7)]===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x4c642d),console[_0xedcc21(0x220)](_0xedcc21(0x1fa)),0x1;_0x2db758=_0x3e7d67;}if(_0x27acbb!==undefined){const _0x278e36=_0x2db758[_0xedcc21(0x24b)](_0x2ffe95=>{const _0x2fdf69=_0xedcc21,_0x41761a=_0x2ffe95[_0x2fdf69(0x25a)]?_0x7bb7d5[_0x2fdf69(0x222)](_0x2ffe95[_0x2fdf69(0x25a)])||'':'';return _0x41761a===_0x27acbb;});if(_0x278e36[_0xedcc21(0x1e7)]===0x0&&_0x2db758['length']>0x0){console[_0xedcc21(0x220)](_0xedcc21(0x252)+_0x4c642d+_0xedcc21(0x1b5)+(_0x27acbb||_0xedcc21(0x1ea))),console[_0xedcc21(0x220)](_0xedcc21(0x226));for(const _0x5ebed8 of _0x2db758){const _0x423586=_0x5ebed8['folderId']?_0x7bb7d5[_0xedcc21(0x222)](_0x5ebed8['folderId'])||'':'';console['error'](_0xedcc21(0x215)+(_0x423586||_0xedcc21(0x23c))+'/'+_0x5ebed8[_0xedcc21(0x266)]);}return 0x1;}_0x2db758=_0x278e36;}if(_0x2db758[_0xedcc21(0x1e7)]===0x0)return console['error'](_0xedcc21(0x27f)),0x0;const _0x122b97=new Map();for(const _0x5b7ad1 of _0x2db758){const _0x3f17fc=_0x5b7ad1[_0xedcc21(0x249)];!_0x122b97[_0xedcc21(0x1c5)](_0x3f17fc)&&_0x122b97[_0xedcc21(0x224)](_0x3f17fc,[]),_0x122b97[_0xedcc21(0x222)](_0x3f17fc)[_0xedcc21(0x22d)](_0x5b7ad1);}for(const _0xf0c8f of _0x122b97['values']()){_0xf0c8f[_0xedcc21(0x1c1)]((_0x56aba4,_0x1d63dc)=>(_0x56aba4[_0xedcc21(0x20e)]||0x0)-(_0x1d63dc[_0xedcc21(0x20e)]||0x0));}const _0x184f4c=[],[_0xb5b43f,_0x4146fe]=await Promise[_0xedcc21(0x27e)]([withSpinner(_0xedcc21(0x254),()=>_0x24e730[_0xedcc21(0x260)][_0xedcc21(0x1ef)](),{'verbose':_0x32c224[_0xedcc21(0x1bf)]})[_0xedcc21(0x202)](_0x4345a2=>_0x4345a2['data']),withSpinner(_0xedcc21(0x225),()=>_0x24e730['connection'][_0xedcc21(0x240)](),{'verbose':_0x32c224['verbose']})[_0xedcc21(0x202)](_0x45731a=>_0x45731a[_0xedcc21(0x1c4)])]);for(const _0x5bb60c of _0x122b97[_0xedcc21(0x204)]()){const _0x39e7d8=_0x5bb60c[0x0]['journeyBundleName'],_0x4ceadf=_0x5bb60c[0x0][_0xedcc21(0x25a)],_0x10d402=_0x4ceadf?_0x7bb7d5[_0xedcc21(0x222)](_0x4ceadf)||'':'',_0x12bc0d=_0x10d402?a18_0x56ab2f[_0xedcc21(0x230)](_0x1a5b0d,_0x10d402):_0x1a5b0d,_0x5363a1=_0x5f5abb||a18_0x56ab2f[_0xedcc21(0x230)](_0x12bc0d,sanitizeFileName(_0x39e7d8)+_0xedcc21(0x272));let _0x3b1049,_0x359aed;if(existsSync(_0x5363a1))try{const _0x4534bd=readFileSync(_0x5363a1,_0xedcc21(0x275)),_0x727ad3=parseYamlString(_0x4534bd);_0x359aed=_0x727ad3,_0x3b1049=buildRuleToNameMapping(_0x727ad3),_0x2b8019[_0xedcc21(0x1bf)]&&_0x3b1049[_0xedcc21(0x206)]>0x0&&console[_0xedcc21(0x220)](_0xedcc21(0x1cd)+_0x3b1049[_0xedcc21(0x206)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x39e7d8);}catch(_0x330aef){_0x2b8019[_0xedcc21(0x1bf)]&&console[_0xedcc21(0x220)](_0xedcc21(0x1dd)+_0x330aef['message']);}const _0x4ac376=[],_0x25b300=new Set(),_0x34b9a4=new Map(),_0x1d8d00=new Map(),_0x40962e=new Set(),_0x5f4b7e=new Map(),_0xfb58df=new Map(),_0x54e49b=createJumpTargetCache();await withProgressSpinner(_0xedcc21(0x245)+_0x39e7d8+_0xedcc21(0x214),async _0x1e6624=>{const _0x4c19bc=_0xedcc21;for(const _0x3d9a0f of _0x5bb60c){const _0x2835b9=_0x5bb60c[_0x4c19bc(0x1e7)]>0x1?_0x3d9a0f[_0x4c19bc(0x266)]+'\x20v'+(_0x3d9a0f[_0x4c19bc(0x20e)]||0x1):_0x3d9a0f['journeyBundleName'];_0x1e6624[_0x4c19bc(0x27d)](_0x4c19bc(0x245)+_0x2835b9);const _0x2c903e=await _0x24e730[_0x4c19bc(0x211)]['getJourney'](_0x3d9a0f['id']),_0xd134b6=_0x2c903e[_0x4c19bc(0x21e)]?.['audienceId'],_0xb02592={'resolveSegment':async _0x167ed7=>{const _0x1de78c=_0x4c19bc;if(!_0xd134b6)return{'name':_0x167ed7,'isJourneyLocal':![]};const _0x291957=_0x34b9a4[_0x1de78c(0x222)](_0x167ed7);if(_0x291957)return _0x291957;try{const _0x5ed54d=await _0x24e730[_0x1de78c(0x1cb)][_0x1de78c(0x235)](_0xd134b6,_0x167ed7),_0x1c6a6e=_0x5ed54d[_0x1de78c(0x261)]===SEGMENT_KIND_JOURNEY;let _0x158d06,_0x1cdd6a=_0x5ed54d[_0x1de78c(0x203)];if(_0x1c6a6e&&_0x5ed54d[_0x1de78c(0x1c8)]){const _0x5094e3=await segmentResponseToDef(_0x5ed54d,{'resolveSegmentName':async _0x581756=>{const _0x17a234=_0x1de78c,_0x2e3c56=_0x34b9a4[_0x17a234(0x222)](_0x581756);if(_0x2e3c56)return _0x2e3c56[_0x17a234(0x203)];const _0x3aed65=await _0xb02592[_0x17a234(0x270)](_0x581756);return _0x3aed65[_0x17a234(0x203)];}}),_0x5aa49e=_0x5094e3[_0x1de78c(0x1c8)];_0x158d06={'description':_0x5ed54d['description'],'rule':_0x5aa49e};const _0x5adf1d=serializeRule(_0x5aa49e),_0x1e52fb=_0x1d8d00[_0x1de78c(0x222)](_0x5adf1d);if(_0x1e52fb)_0x1cdd6a=_0x1e52fb,_0x158d06=undefined,_0x2b8019[_0x1de78c(0x1bf)]&&console[_0x1de78c(0x220)](_0x1de78c(0x1d9)+_0x5ed54d[_0x1de78c(0x203)]+_0x1de78c(0x269)+_0x1e52fb);else{let _0x111b1e=![];if(_0x3b1049){const _0x43cc8f=_0x3b1049[_0x1de78c(0x222)](_0x5adf1d);if(_0x43cc8f){const _0x11a6ca=_0x43cc8f[_0x1de78c(0x1e6)](_0xcab21e=>!_0x25b300[_0x1de78c(0x1c5)](_0xcab21e));_0x11a6ca&&(_0x1cdd6a=_0x11a6ca,_0x25b300[_0x1de78c(0x256)](_0x11a6ca),_0x1d8d00[_0x1de78c(0x224)](_0x5adf1d,_0x11a6ca),_0x111b1e=!![],_0x2b8019[_0x1de78c(0x1bf)]&&console[_0x1de78c(0x220)](_0x1de78c(0x1d2)+_0x11a6ca+_0x1de78c(0x1f5)));}}if(!_0x111b1e){const _0x36cff9=generateJourneyLocalName(_0x5ed54d[_0x1de78c(0x203)]);_0x36cff9&&(_0x1cdd6a=_0x36cff9);let _0x5096b2=_0x1cdd6a,_0x5ad78a=0x2;while(_0x25b300[_0x1de78c(0x1c5)](_0x5096b2)){_0x5096b2=_0x1cdd6a+'_'+_0x5ad78a,_0x5ad78a++;}_0x25b300[_0x1de78c(0x256)](_0x5096b2),_0x1d8d00[_0x1de78c(0x224)](_0x5adf1d,_0x5096b2),_0x1cdd6a=_0x5096b2;}}}const _0xdf02de={'name':_0x1cdd6a,'isJourneyLocal':_0x1c6a6e,'definition':_0x158d06};return _0x34b9a4['set'](_0x167ed7,_0xdf02de),_0xdf02de;}catch(_0x2ffd36){return _0x32c224[_0x1de78c(0x1bf)]&&console[_0x1de78c(0x220)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x167ed7+':\x20'+_0x2ffd36['message']),{'name':_0x167ed7,'isJourneyLocal':![]};}},'resolveActivation':async _0x3bd39f=>{const _0x4b1bed=_0x4c19bc,_0x1cf9cf=_0x5f4b7e['get'](_0x3bd39f);if(_0x1cf9cf)return _0x1cf9cf;try{const _0xf47ee6=await _0x24e730[_0x4b1bed(0x211)][_0x4b1bed(0x210)](_0x3d9a0f['id'],_0x3bd39f),_0x3e5205=journeyActivationStepToYaml(_0xf47ee6,_0xb5b43f,_0x4146fe),_0xb7e22b=JSON[_0x4b1bed(0x25b)]({'name':_0x3e5205[_0x4b1bed(0x203)],'connection':_0x3e5205[_0x4b1bed(0x1c7)],'connector_config':_0x3e5205[_0x4b1bed(0x227)]}),_0x5cd40c=_0xfb58df[_0x4b1bed(0x222)](_0xb7e22b);if(_0x5cd40c){const _0x5af45c={'name':_0x5cd40c,'isJourneyLocal':!![],'definition':_0x3e5205};return _0x5f4b7e['set'](_0x3bd39f,_0x5af45c),_0x5af45c;}const _0xf1394a=_0xf47ee6[_0x4b1bed(0x21e)]['activationParams'][_0x4b1bed(0x203)]||_0x3bd39f,_0x18121e=sanitizeYamlKey(_0xf1394a)||_0x4b1bed(0x1f1)+_0x3bd39f;let _0x43ed34=_0x18121e,_0x3b860b=0x2;while(_0x40962e[_0x4b1bed(0x1c5)](_0x43ed34)){_0x43ed34=_0x18121e+'_'+_0x3b860b,_0x3b860b++;}_0x40962e[_0x4b1bed(0x256)](_0x43ed34),_0xfb58df[_0x4b1bed(0x224)](_0xb7e22b,_0x43ed34);const _0x4647f8={'name':_0x43ed34,'isJourneyLocal':!![],'definition':_0x3e5205};return _0x5f4b7e[_0x4b1bed(0x224)](_0x3bd39f,_0x4647f8),_0x4647f8;}catch(_0x2a71a1){return _0x32c224[_0x4b1bed(0x1bf)]&&console[_0x4b1bed(0x220)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x3bd39f+':\x20'+_0x2a71a1[_0x4b1bed(0x1b4)]),{'name':_0x3bd39f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0xb6e9a5,_0x1ad84a)=>{const _0x1f40af=_0x4c19bc;return resolveJumpTarget(_0xb6e9a5,_0x1ad84a,_0x54e49b,_0x52f736=>_0x24e730[_0x1f40af(0x211)]['getJourney'](_0x52f736));}},_0x255fbb=await journeyResponseToDef(_0x2c903e,_0xb02592);_0x4ac376[_0x4c19bc(0x22d)]({'item':_0x3d9a0f,'yaml':_0x255fbb});}},{'verbose':_0x32c224['verbose']});const _0x2c2225=buildMergedJourneyDef(_0x4ac376,_0x3b1049),_0x4f906b=normalizeJourneyDef(_0x2c2225,_0x359aed),_0x219a77=toYamlString(_0x4f906b),_0x5dd8ed=_0x5f5abb||a18_0x56ab2f['join'](_0x12bc0d,sanitizeFileName(_0x39e7d8)+_0xedcc21(0x272));!_0x5f5abb&&_0x10d402&&!existsSync(_0x12bc0d)&&mkdirSync(_0x12bc0d,{'recursive':!![]});const _0x4089ae=a18_0x56ab2f['relative'](process[_0xedcc21(0x1db)](),_0x5dd8ed);if(existsSync(_0x5dd8ed)){const _0x24ee52=readFileSync(_0x5dd8ed,'utf-8'),_0x40e934=generateDiff(_0x24ee52,_0x219a77),_0x46c70c=hasChanges(_0x40e934);_0x184f4c[_0xedcc21(0x22d)]({'relativePath':_0x4089ae,'absolutePath':_0x5dd8ed,'content':_0x219a77,'isNew':![],'hasChanges':_0x46c70c,'diff':_0x46c70c?formatDiffWithColors(_0x40e934):undefined});}else _0x184f4c[_0xedcc21(0x22d)]({'relativePath':_0x4089ae,'absolutePath':_0x5dd8ed,'content':_0x219a77,'isNew':!![],'hasChanges':![]});}const _0x4fa970=_0x184f4c[_0xedcc21(0x24b)](_0x12873a=>_0x12873a['isNew']),_0x595b54=_0x184f4c[_0xedcc21(0x24b)](_0x2f3093=>!_0x2f3093['isNew']&&_0x2f3093[_0xedcc21(0x1f9)]),_0x51e2a6=_0x184f4c[_0xedcc21(0x24b)](_0x5c1517=>!_0x5c1517['isNew']&&!_0x5c1517[_0xedcc21(0x1f9)]),_0x4af0b6=_0x2db758[_0xedcc21(0x1e7)],_0x1889f0=_0x122b97[_0xedcc21(0x206)],_0x485f8c=_0x4af0b6>_0x1889f0?'\x20('+_0x4af0b6+_0xedcc21(0x1f2):'';console[_0xedcc21(0x220)]('\x0aPull\x20summary:'),console[_0xedcc21(0x220)]('\x20\x20'+a18_0x4f49ab[_0xedcc21(0x209)](_0x1889f0+_0xedcc21(0x1d0))+a18_0x4f49ab[_0xedcc21(0x1f7)](_0x485f8c)),console[_0xedcc21(0x220)]('\x20\x20'+a18_0x4f49ab['green']('+\x20'+_0x4fa970[_0xedcc21(0x1e7)]+_0xedcc21(0x273))),console[_0xedcc21(0x220)]('\x20\x20'+a18_0x4f49ab[_0xedcc21(0x283)]('~\x20'+_0x595b54['length']+_0xedcc21(0x22b))),console[_0xedcc21(0x220)]('\x20\x20'+a18_0x4f49ab[_0xedcc21(0x1f7)]('=\x20'+_0x51e2a6[_0xedcc21(0x1e7)]+'\x20unchanged\x20files')),console[_0xedcc21(0x220)]('\x20\x20Target:\x20'+a18_0x4f49ab['cyan'](_0x1a5b0d)+'\x0a');if(_0x595b54[_0xedcc21(0x1e7)]>0x0)for(const _0x336c5a of _0x595b54){console[_0xedcc21(0x220)](_0xedcc21(0x1c9)+_0x336c5a[_0xedcc21(0x264)]+'\x27:'),console[_0xedcc21(0x220)]('─'[_0xedcc21(0x1dc)](0x3c)),console[_0xedcc21(0x220)](_0x336c5a[_0xedcc21(0x1d6)]),console[_0xedcc21(0x220)]('─'[_0xedcc21(0x1dc)](0x3c));}if(_0x2b8019[_0xedcc21(0x244)])return console[_0xedcc21(0x220)](a18_0x4f49ab[_0xedcc21(0x283)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4fa970[_0xedcc21(0x1e7)]===0x0&&_0x595b54[_0xedcc21(0x1e7)]===0x0)return console['error'](a18_0x4f49ab[_0xedcc21(0x21a)](_0xedcc21(0x263))),saveSessionContext({'parent_segment':_0x5e26a5},_0x2b8019[_0xedcc21(0x1fe)]),console[_0xedcc21(0x220)](a18_0x4f49ab[_0xedcc21(0x21a)](_0xedcc21(0x1ec)+a18_0x4f49ab['dim'](_0xedcc21(0x26d))+_0xedcc21(0x1b2)+a18_0x4f49ab['cyan'](_0x5e26a5))),0x0;if(!_0x2b8019['yes']&&(_0x4fa970['length']>0x0||_0x595b54['length']>0x0)){const _0x47d6e6=await confirmKey('Write\x20'+(_0x4fa970[_0xedcc21(0x1e7)]+_0x595b54['length'])+_0xedcc21(0x1de));if(!_0x47d6e6)return console[_0xedcc21(0x220)]('Aborted.'),0x1;}!existsSync(_0x1a5b0d)&&mkdirSync(_0x1a5b0d,{'recursive':!![]});for(const _0x41eea4 of _0x184f4c){(_0x41eea4['isNew']||_0x41eea4[_0xedcc21(0x1f9)])&&writeFileSync(_0x41eea4[_0xedcc21(0x242)],_0x41eea4[_0xedcc21(0x1f0)],_0xedcc21(0x275));}return console[_0xedcc21(0x220)](a18_0x4f49ab['green']('✔\x20Pulled\x20'+(_0x4fa970[_0xedcc21(0x1e7)]+_0x595b54['length'])+'\x20journey\x20files\x20to\x20'+_0x1a5b0d)),saveSessionContext({'parent_segment':_0x5e26a5},_0x2b8019[_0xedcc21(0x1fe)]),console[_0xedcc21(0x220)](a18_0x4f49ab[_0xedcc21(0x21a)](_0xedcc21(0x1ec)+a18_0x4f49ab[_0xedcc21(0x1f7)](_0xedcc21(0x26d))+_0xedcc21(0x1b2)+a18_0x4f49ab['cyan'](_0x5e26a5))),0x0;}}export class JourneyPushCommand extends BaseCommand{[a18_0x4b99e4(0x203)]=a18_0x4b99e4(0x20f);[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x23e);[a18_0x4b99e4(0x213)]=new SegmentPushCommand();async[a18_0x4b99e4(0x262)](_0x3f6e07){const _0x5007ba=a18_0x4b99e4,_0x3dc2db=_0x3f6e07[_0x5007ba(0x20c)][0x0];let _0x312613;if(_0x3dc2db){const _0x4712d1=await resolveTarget({'arg':_0x3dc2db,'contextParent':_0x3f6e07[_0x5007ba(0x253)][_0x5007ba(0x22c)],'cwd':process['cwd']()});isSuccessfulResolution(_0x4712d1)&&_0x4712d1[_0x5007ba(0x1cf)]==='file'&&(_0x312613=_0x4712d1[_0x5007ba(0x285)]);}const _0x470969={..._0x3f6e07,'options':{..._0x3f6e07[_0x5007ba(0x253)],'journeysOnly':!![],..._0x312613&&{'singleFilePath':_0x312613}}};return this[_0x5007ba(0x213)][_0x5007ba(0x262)](_0x470969);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x48c801=a19_0x2a9c;function a19_0x2a9c(_0x1429bc,_0x80ea64){_0x1429bc=_0x1429bc-0xf2;const _0xee3ce2=a19_0xee3c();let _0x2a9c29=_0xee3ce2[_0x1429bc];return _0x2a9c29;}(function(_0x3fddc3,_0x3e2207){const _0x1fc378=a19_0x2a9c,_0x299fbc=_0x3fddc3();while(!![]){try{const _0x26372c=-parseInt(_0x1fc378(0x126))/0x1+parseInt(_0x1fc378(0x101))/0x2+-parseInt(_0x1fc378(0x11b))/0x3*(-parseInt(_0x1fc378(0xfc))/0x4)+parseInt(_0x1fc378(0x129))/0x5*(parseInt(_0x1fc378(0x10a))/0x6)+-parseInt(_0x1fc378(0x10e))/0x7+-parseInt(_0x1fc378(0x11d))/0x8+-parseInt(_0x1fc378(0x109))/0x9*(-parseInt(_0x1fc378(0xf2))/0xa);if(_0x26372c===_0x3e2207)break;else _0x299fbc['push'](_0x299fbc['shift']());}catch(_0xab2f6e){_0x299fbc['push'](_0x299fbc['shift']());}}}(a19_0xee3c,0x6c2e3));function a19_0xee3c(){const _0xbd4dfd=['parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','name','yellow','\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','endsWith','.yml','✔\x20All\x20','hasErrors','Validation\x20failed:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','verbose','green','157482EJZzOr','\x20error(s)','2758848gdBLQe','helpText','Error:\x20Directory\x20not\x20found:\x20','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','Validate\x20journey\x20YAML\x20files','No\x20journey\x20YAML\x20files\x20found\x20in\x20','skippedCount','cyan','warnings','781376DzNTAV','description','invalidCount','445uDluiW','9835030LElOtC','errorCode','error','length','file','dim','.yaml','filePath','journey:validate','\x20valid','32JGcvzX','valid','no_parent','parentSegment','filter','801884fXfmIG','journey','\x20segment\x20file(s)\x20skipped)','validCount','type','red','log','message','9dgYnkY','23934rhXfhC','\x20warning(s)\x20found','cwd','warningCount','4130553YJPWcp'];a19_0xee3c=function(){return _0xbd4dfd;};return a19_0xee3c();}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 a19_0x19d6e7 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a19_0x48c801(0x110)]=a19_0x48c801(0xfa);[a19_0x48c801(0x127)]=a19_0x48c801(0x121);async['execute'](_0x1b8645){const _0x2c1332=a19_0x48c801,{options:_0x38c02b,args:_0x204dbc}=_0x1b8645,_0x58afa6=_0x38c02b,_0x498ce0=await resolveTarget({'arg':_0x204dbc[0x0],'contextParent':_0x38c02b[_0x2c1332(0xff)],'cwd':process[_0x2c1332(0x10c)]()});if(!isSuccessfulResolution(_0x498ce0))return _0x498ce0[_0x2c1332(0xf3)]===_0x2c1332(0xfe)?(console[_0x2c1332(0xf4)](a19_0x19d6e7[_0x2c1332(0x111)](_0x2c1332(0x10f))),console[_0x2c1332(0xf4)](_0x2c1332(0x120)),console[_0x2c1332(0xf4)](_0x2c1332(0x112)),console[_0x2c1332(0xf4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a19_0x19d6e7[_0x2c1332(0x106)]('Error:\x20'+_0x498ce0[_0x2c1332(0x108)]+'\x0a')),_0x498ce0[_0x2c1332(0x11e)]&&console[_0x2c1332(0xf4)](a19_0x19d6e7[_0x2c1332(0x124)](_0x498ce0[_0x2c1332(0x11e)]))),0x1;const _0x38ae1f=_0x498ce0['targetDir'],_0x365e2b=_0x498ce0[_0x2c1332(0x105)]===_0x2c1332(0xf6)?_0x498ce0[_0x2c1332(0xf9)]:undefined;if(!_0x365e2b&&!existsSync(_0x38ae1f))return console[_0x2c1332(0xf4)](a19_0x19d6e7['red'](_0x2c1332(0x11f)+_0x38ae1f+'\x0a')),0x1;let _0x4cbcce;if(_0x365e2b){if(!_0x365e2b[_0x2c1332(0x113)](_0x2c1332(0x114))&&!_0x365e2b[_0x2c1332(0x113)](_0x2c1332(0xf8)))return console['error'](a19_0x19d6e7[_0x2c1332(0x106)](_0x2c1332(0x118)+_0x365e2b+'\x0a')),0x1;_0x4cbcce=[_0x365e2b];}else _0x4cbcce=findYamlFiles(_0x38ae1f);if(_0x4cbcce['length']===0x0)return console['error'](a19_0x19d6e7[_0x2c1332(0x106)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x38ae1f+'\x0a')),0x1;const _0x3b5278=validateYamlFiles(_0x4cbcce,_0x38ae1f,{'filterType':_0x2c1332(0x102)}),_0x2e523f=calculateSummary(_0x3b5278),_0x30df72=_0x3b5278[_0x2c1332(0x100)](isValidationResult);if(_0x30df72['length']===0x0)return console[_0x2c1332(0xf4)](a19_0x19d6e7['yellow'](_0x2c1332(0x122)+_0x38ae1f+'\x0a')),_0x2e523f['skippedCount']>0x0&&console['error'](a19_0x19d6e7[_0x2c1332(0xf7)]('('+_0x2e523f['skippedCount']+_0x2c1332(0x103))),0x0;for(const _0x15d860 of _0x3b5278){if(!isValidationResult(_0x15d860)){_0x58afa6[_0x2c1332(0x119)]&&console['log'](a19_0x19d6e7[_0x2c1332(0xf7)]('-\x20'+_0x15d860['relativePath']+'\x20(skipped:\x20'+_0x15d860['reason']+')'));continue;}const {relativePath:_0x8b1247,source:_0x491148,result:_0x3138e6}=_0x15d860;if(_0x3138e6[_0x2c1332(0xfd)]&&_0x3138e6[_0x2c1332(0x125)][_0x2c1332(0xf5)]===0x0)_0x58afa6[_0x2c1332(0x119)]&&console['log'](a19_0x19d6e7[_0x2c1332(0x11a)]('✔\x20'+_0x8b1247));else _0x3138e6[_0x2c1332(0xfd)]?(console[_0x2c1332(0x107)](a19_0x19d6e7[_0x2c1332(0x111)]('⚠\x20'+_0x8b1247+':\x20'+_0x3138e6[_0x2c1332(0x125)][_0x2c1332(0xf5)]+'\x20warning(s)')),console[_0x2c1332(0x107)](formatValidationResult(_0x3138e6,_0x491148,_0x8b1247))):(console['log'](a19_0x19d6e7[_0x2c1332(0x106)]('✖\x20'+_0x8b1247+':\x20'+_0x3138e6['errors'][_0x2c1332(0xf5)]+_0x2c1332(0x11c))),console['log'](formatValidationResult(_0x3138e6,_0x491148,_0x8b1247)));}return console[_0x2c1332(0x107)](''),_0x2e523f[_0x2c1332(0x116)]?(console[_0x2c1332(0x107)](a19_0x19d6e7[_0x2c1332(0x106)](_0x2c1332(0x117)+_0x2e523f[_0x2c1332(0x128)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x2e523f[_0x2c1332(0x104)]+_0x2c1332(0xfb))),_0x2e523f['warningCount']>0x0&&console[_0x2c1332(0x107)](a19_0x19d6e7['yellow'](_0x2e523f[_0x2c1332(0x10d)]+_0x2c1332(0x10b))),_0x2e523f[_0x2c1332(0x123)]>0x0&&console[_0x2c1332(0x107)](a19_0x19d6e7[_0x2c1332(0xf7)](_0x2e523f[_0x2c1332(0x123)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x2c1332(0x107)](a19_0x19d6e7[_0x2c1332(0x11a)](_0x2c1332(0x115)+_0x2e523f['validCount']+'\x20journey(s)\x20valid')),_0x2e523f[_0x2c1332(0x10d)]>0x0&&console[_0x2c1332(0x107)](a19_0x19d6e7[_0x2c1332(0x111)](_0x2e523f[_0x2c1332(0x10d)]+_0x2c1332(0x10b))),_0x2e523f['skippedCount']>0x0&&console[_0x2c1332(0x107)](a19_0x19d6e7[_0x2c1332(0xf7)](_0x2e523f[_0x2c1332(0x123)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}
|