@treasuredata/tdx 0.10.0 β 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-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/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +73 -3
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.d.ts +1 -1
- package/dist/core/command-output.d.ts.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.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/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/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.d.ts +32 -4
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.d.ts +10 -6
- package/dist/sdk/connection-validator.d.ts.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection-validator.js.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/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/cdp.d.ts +5 -2
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/index.d.ts +74 -4
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x3b6605=a15_0x2875;(function(_0x2ca161,_0x2143f3){const _0x128f84=a15_0x2875,_0x58b998=_0x2ca161();while(!![]){try{const _0x3282d6=-parseInt(_0x128f84(0x7f))/0x1+-parseInt(_0x128f84(0x76))/0x2*(parseInt(_0x128f84(0x80))/0x3)+parseInt(_0x128f84(0x82))/0x4+parseInt(_0x128f84(0x70))/0x5*(parseInt(_0x128f84(0x67))/0x6)+parseInt(_0x128f84(0x89))/0x7+-parseInt(_0x128f84(0x88))/0x8*(-parseInt(_0x128f84(0x86))/0x9)+parseInt(_0x128f84(0x68))/0xa;if(_0x3282d6===_0x2143f3)break;else _0x58b998['push'](_0x58b998['shift']());}catch(_0x4975f4){_0x58b998['push'](_0x58b998['shift']());}}}(a15_0x2b43,0x53dc7));import{BaseCommand}from'./command.js';function a15_0x2875(_0x3d1af2,_0x4b2942){_0x3d1af2=_0x3d1af2-0x66;const _0x2b4375=a15_0x2b43();let _0x28754c=_0x2b4375[_0x3d1af2];return _0x28754c;}import{SDKError}from'../sdk/index.js';function a15_0x2b43(){const _0x7dfd07=['10hvMNWC','Describe\x20table\x20schema','Table\x20\x27','cause','name','Error:\x20','912196NPFJVR','data','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','site','table','\x27\x20does\x20not\x20exist','verbose','error','length','631846QJFLYU','3JlzMUz','validate','359316hbDKuX','Describing\x20table\x20','...','database','1015407MNJyMw','description','48ydWMxd','1113140noXJeb','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','\x20\x20Cause:\x20','431310leocPN','3618820tzHVwh','β\x20Found\x20','β\x20Table\x20not\x20found','\x20in\x20','describeTable','args','message','Database:\x20'];a15_0x2b43=function(){return _0x7dfd07;};return a15_0x2b43();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x3b6605(0x74)]='describe';[a15_0x3b6605(0x87)]=a15_0x3b6605(0x71);async[a15_0x3b6605(0x8a)](_0x531ba6){return this['describeTable'](_0x531ba6);}async['describeTable'](_0x3faeb9){const _0x184a6f=a15_0x3b6605,{options:_0x10abc3,args:_0xadddd3,tdx:_0x41c183}=_0x3faeb9;let _0x201f00;try{_0x201f00=parseTableReference(_0xadddd3[0x0]);const _0x31c7c6=_0x10abc3[_0x184a6f(0x85)];!_0x201f00[_0x184a6f(0x85)]&&_0x31c7c6&&(_0x201f00['database']=_0x31c7c6);const _0x13bad4=validateTableDescribeReference(_0x201f00);if(_0x13bad4)return console[_0x184a6f(0x7d)](_0x184a6f(0x75)+_0x13bad4),0x1;}catch(_0x2f04c6){return console['error'](_0x184a6f(0x75)+_0x2f04c6[_0x184a6f(0x6e)]),0x1;}const _0x165a5a=_0x201f00['database'],_0xb4b7ca=_0x201f00[_0x184a6f(0x7a)];try{_0x10abc3[_0x184a6f(0x7c)]&&(console[_0x184a6f(0x7d)]('Site:\x20'+_0x10abc3[_0x184a6f(0x79)]),console[_0x184a6f(0x7d)](_0x184a6f(0x6f)+_0x165a5a),console[_0x184a6f(0x7d)]('Table:\x20'+_0xb4b7ca));const _0x379700=await withSpinner(_0x184a6f(0x83)+_0x165a5a+'.'+_0xb4b7ca+_0x184a6f(0x84),()=>_0x41c183['query'][_0x184a6f(0x6c)](_0x165a5a,_0xb4b7ca),{'verbose':_0x10abc3[_0x184a6f(0x7c)]}),_0x46d052=_0x379700[_0x184a6f(0x77)];if(_0x46d052['length']===0x0)return console[_0x184a6f(0x7d)](_0x184a6f(0x6a)),console[_0x184a6f(0x7d)](_0x184a6f(0x72)+_0x165a5a+'.'+_0xb4b7ca+_0x184a6f(0x7b)),0x1;return console[_0x184a6f(0x7d)](_0x184a6f(0x69)+_0x46d052[_0x184a6f(0x7e)]+'\x20column'+(_0x46d052[_0x184a6f(0x7e)]!==0x1?'s':'')+_0x184a6f(0x6b)+_0x165a5a+'.'+_0xb4b7ca),await handleSDKOutput(_0x46d052,_0x10abc3),0x0;}catch(_0x3fc3e9){if(_0x3fc3e9 instanceof SDKError)return console['error'](_0x184a6f(0x75)+_0x3fc3e9['message']),_0x3fc3e9[_0x184a6f(0x73)]&&console[_0x184a6f(0x7d)](_0x184a6f(0x66)+_0x3fc3e9[_0x184a6f(0x73)]),0x1;throw _0x3fc3e9;}}[a15_0x3b6605(0x81)](_0x4cad39){const _0x54f7d0=a15_0x3b6605;if(_0x4cad39[_0x54f7d0(0x6d)][_0x54f7d0(0x7e)]===0x0)return _0x54f7d0(0x78);if(_0x4cad39[_0x54f7d0(0x6d)]['length']>0x1)return _0x54f7d0(0x8b);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x455b27=a16_0x3cc2;(function(_0x37ec8c,_0x3a2104){const _0x364f1a=a16_0x3cc2,_0x2a42cf=_0x37ec8c();while(!![]){try{const _0x3fdbb7=-parseInt(_0x364f1a(0x195))/0x1*(-parseInt(_0x364f1a(0x1f8))/0x2)+parseInt(_0x364f1a(0x1bb))/0x3+parseInt(_0x364f1a(0x1c7))/0x4*(parseInt(_0x364f1a(0x192))/0x5)+parseInt(_0x364f1a(0x1fd))/0x6+-parseInt(_0x364f1a(0x191))/0x7*(-parseInt(_0x364f1a(0x1d3))/0x8)+parseInt(_0x364f1a(0x1e0))/0x9*(-parseInt(_0x364f1a(0x1d1))/0xa)+-parseInt(_0x364f1a(0x175))/0xb;if(_0x3fdbb7===_0x3a2104)break;else _0x2a42cf['push'](_0x2a42cf['shift']());}catch(_0x42cbb8){_0x2a42cf['push'](_0x2a42cf['shift']());}}}(a16_0xae4f,0x2b8f4));function a16_0x3cc2(_0x35b254,_0x1c1a35){_0x35b254=_0x35b254-0x172;const _0xae4fdd=a16_0xae4f();let _0x3cc279=_0xae4fdd[_0x35b254];return _0x3cc279;}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';function a16_0xae4f(){const _0x47d1fa=['createWorkspace','segmentName','session','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','56rpPYEf','146175jLXvKn','launchCampaign','getWorkspaceFull','6FOwRgk','Options:\x20--name,\x20--description','getWorkspace','Updating\x20campaign\x20\x27','Create\x20an\x20email\x20template','jsonColumns','entries','full','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','limit','engage:workspace:delete','\x27\x20launched\x20successfully','engage:template:create','Duplicate\x20a\x20campaign','List\x20email\x20templates','keys','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Error:\x20--subject\x20is\x20required','Pausing\x20campaign\x20\x27','data','getTemplate','status','createTemplate','Template\x20\x27','engage:templates','Operation\x20cancelled','timezone','Fetching\x20templates...','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:workspace:create','List\x20workspaces','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Delete\x20a\x20campaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','List\x20campaigns','\x27\x20deleted\x20successfully','startAt','engage:campaign:show','634536DWgSui','yes','engage:campaign:pause','Updating\x20template\x20\x27','engage:campaign:duplicate','Engage\x20workspace\x20set\x20to:\x20','subject','parentId','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','html','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','16zrDWDJ','name','deleteCampaign','engage','Create\x20a\x20new\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','engage_workspace','Campaign\x20\x27','verbose','Update\x20an\x20email\x20template','10oGWqkZ','engage:template:update','309512phFgts','length','engage:campaign:delete','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','updateWorkspace','execute','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','\x27?\x20This\x20cannot\x20be\x20undone.','Error:\x20Workspace\x20name\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:campaign:update','Update\x20a\x20campaign','engage:workspaces','388548kVNrEW','resolvePathToResource','error','listTemplates','Launching\x20campaign\x20\x27','Delete\x20a\x20workspace','listWorkspaces','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','filter','type','getTemplateFull','parentName','Fetching\x20template\x20\x27','Show\x20campaign\x20details','Fetching\x20workspace\x20\x27','Deleting\x20campaign\x20\x27','log','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Resuming\x20campaign\x20\x27','engage:workspace:use','deleteWorkspace','Creating\x20workspace\x20\x27','engage:campaigns','engage:campaign:resume','88300EPtkQN','resolveWorkspaceId','Creating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','description','1187280aKZyNh','Verifying\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Show\x20workspace\x20details','\x27...','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','deleteTemplate','fromEntries','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','9670672PBaYJj','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','MISSING_ARGUMENT','Fetching\x20campaign\x20\x27','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Pause\x20a\x20campaign','pauseCampaign','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','plaintext','Error:\x20--name\x20is\x20required','Update\x20a\x20workspace','workspace','Fetching\x20campaigns...','editorType','segment','Create\x20a\x20workspace','getCampaign','Resume\x20a\x20paused\x20campaign','updateCampaign','duplicateCampaign','engage:template:show','createCampaign','engage:workspace:update','Updating\x20workspace\x20\x27'];a16_0xae4f=function(){return _0x47d1fa;};return a16_0xae4f();}async function resolveWorkspaceIdFromOptions(_0x284815,_0x116462,_0x139b59=![]){const _0x43806f=a16_0x3cc2;if(_0x284815[_0x43806f(0x180)])return await _0x116462[_0x43806f(0x1ca)][_0x43806f(0x1f9)](_0x284815[_0x43806f(0x180)]);const _0x324740=loadSessionContext(_0x284815[_0x43806f(0x18f)]);if(_0x324740?.[_0x43806f(0x1cd)])return await _0x116462['engage'][_0x43806f(0x1f9)](_0x324740[_0x43806f(0x1cd)]);if(_0x139b59)throw new SDKError(ErrorCode[_0x43806f(0x177)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':_0x43806f(0x1c6)});return undefined;}async function resolveSegmentFromOptions(_0x32110f,_0x583ab1){const _0x327bc2=a16_0x3cc2;if(!_0x32110f[_0x327bc2(0x183)])return{};const _0xae5687=_0x32110f[_0x327bc2(0x183)],_0x280c4d=await _0x583ab1['segment'][_0x327bc2(0x1e1)](_0xae5687);return{'audienceId':_0x280c4d[_0x327bc2(0x1c2)],'audienceName':_0x280c4d[_0x327bc2(0x1eb)],..._0x280c4d['segmentId']&&{'segmentId':_0x280c4d['segmentId'],'segmentName':_0x280c4d[_0x327bc2(0x18e)]}};}function buildConnectorConfig(_0x12f64a){const _0x141abe=a16_0x3cc2,_0x2e1c06=_0x12f64a['emailSenderId'],_0x332cdd=_0x12f64a[_0x141abe(0x19a)];if(!_0x2e1c06&&!_0x332cdd)return undefined;return{..._0x2e1c06&&{'emailSenderId':_0x2e1c06},..._0x332cdd&&{'jsonColumns':_0x332cdd}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1f6);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1b7);async[a16_0x455b27(0x1d8)](_0x55240d){const _0x19c541=a16_0x455b27,{options:_0x44e115,args:_0x51ae11,tdx:_0x308c6b}=_0x55240d,_0x177a8d=_0x51ae11[0x0],_0x3255f4=resolveLimit(_0x44e115[_0x19c541(0x19e)],DEFAULT_LLM_LIMIT),_0x584924=_0x44e115,_0x23de61=_0x584924[_0x19c541(0x1e9)],_0x29756a=_0x584924[_0x19c541(0x1aa)],_0xbef5fe=await resolveWorkspaceIdFromOptions(_0x584924,_0x308c6b),_0x3251f2=await withSpinner(_0x19c541(0x181),()=>_0x308c6b[_0x19c541(0x1ca)]['listCampaigns']({'type':_0x23de61,'status':_0x29756a,'workspaceId':_0xbef5fe,'limit':_0x3255f4}),{'verbose':_0x44e115[_0x19c541(0x1cf)]});let _0xe09a91=_0x3251f2[_0x19c541(0x1a8)];return _0x177a8d&&(_0xe09a91=_0x3251f2[_0x19c541(0x1a8)][_0x19c541(0x1e8)](_0x33f890=>matchGlobPattern(_0x33f890[_0x19c541(0x1c8)],_0x177a8d))),await handleSDKOutput(_0xe09a91,_0x44e115),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1ba);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1ed);async[a16_0x455b27(0x1d8)](_0x17aae5){const _0x49ad19=a16_0x455b27,{options:_0x1e59ad,args:_0x4685d3,tdx:_0x1a2f9a}=_0x17aae5;if(_0x4685d3['length']===0x0)return console[_0x49ad19(0x1e2)](_0x49ad19(0x1b6)),console[_0x49ad19(0x1e2)](_0x49ad19(0x1ff)),0x1;const _0x52ad1d=_0x4685d3[0x0],_0x475c19=_0x1e59ad,_0x10b5db=await resolveWorkspaceIdFromOptions(_0x475c19,_0x1a2f9a),_0x26fcc0=_0x475c19['full'];if(_0x26fcc0){const _0x1f8736=await withSpinner(_0x49ad19(0x178)+_0x52ad1d+_0x49ad19(0x202),()=>_0x1a2f9a['engage']['getCampaignFull'](_0x52ad1d,_0x10b5db),{'verbose':_0x1e59ad[_0x49ad19(0x1cf)]});await handleSDKOutput([_0x1f8736],_0x1e59ad);}else{const _0x4b7d9b=await withSpinner(_0x49ad19(0x178)+_0x52ad1d+_0x49ad19(0x202),()=>_0x1a2f9a[_0x49ad19(0x1ca)][_0x49ad19(0x185)](_0x52ad1d,_0x10b5db),{'verbose':_0x1e59ad['verbose']});await handleSDKOutput([_0x4b7d9b],_0x1e59ad);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']='engage:campaign:create';[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1cb);async[a16_0x455b27(0x1d8)](_0x265084){const _0x518ee7=a16_0x455b27,{options:_0x4c3534,tdx:_0x32deb1}=_0x265084,_0x2a2268=_0x4c3534,_0x472ec8=_0x2a2268[_0x518ee7(0x1c8)],_0x3e009f=_0x2a2268[_0x518ee7(0x1e9)];if(!_0x472ec8)return console['error'](_0x518ee7(0x17e)),console[_0x518ee7(0x1e2)](_0x518ee7(0x1d6)),0x1;if(!_0x3e009f)return console[_0x518ee7(0x1e2)](_0x518ee7(0x1b1)),console[_0x518ee7(0x1e2)](_0x518ee7(0x1d6)),0x1;const _0x1f3f36=await resolveWorkspaceIdFromOptions(_0x2a2268,_0x32deb1,!![]),_0x3ad7e3=await resolveSegmentFromOptions(_0x2a2268,_0x32deb1),_0x269b46=buildConnectorConfig(_0x2a2268),_0x125d82={'name':_0x472ec8,'campaignType':_0x3e009f,'workspaceId':_0x1f3f36,'description':_0x2a2268[_0x518ee7(0x1fc)],..._0x3ad7e3,'connectorConfig':_0x269b46,'startAt':_0x2a2268['startAt'],'timezone':_0x2a2268[_0x518ee7(0x1af)]},_0x1df7c0=await withSpinner('Creating\x20campaign\x20\x27'+_0x472ec8+_0x518ee7(0x202),()=>_0x32deb1[_0x518ee7(0x1ca)][_0x518ee7(0x18a)](_0x125d82));return await handleSDKOutput([_0x1df7c0[_0x518ee7(0x1a8)]],_0x4c3534),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1dd);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1de);async[a16_0x455b27(0x1d8)](_0x8cc3af){const _0x129595=a16_0x455b27,{options:_0x546246,args:_0x57fb7e,tdx:_0x2e2be3}=_0x8cc3af;if(_0x57fb7e[_0x129595(0x1d4)]===0x0)return console[_0x129595(0x1e2)](_0x129595(0x1b6)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x1a9fcc=_0x57fb7e[0x0],_0x55e2ab=_0x546246,_0x16d6bd=await resolveWorkspaceIdFromOptions(_0x55e2ab,_0x2e2be3),_0x5d1050=await resolveSegmentFromOptions(_0x55e2ab,_0x2e2be3),_0x554aa8=buildConnectorConfig(_0x55e2ab),_0x2a92c5={'name':_0x55e2ab[_0x129595(0x1c8)],'description':_0x55e2ab[_0x129595(0x1fc)],..._0x5d1050,'connectorConfig':_0x554aa8,'startAt':_0x55e2ab[_0x129595(0x1b9)],'timezone':_0x55e2ab[_0x129595(0x1af)]},_0x57ef79=Object[_0x129595(0x173)](Object[_0x129595(0x19b)](_0x2a92c5)['filter'](([,_0x53774e])=>_0x53774e!==undefined));if(Object[_0x129595(0x1a4)](_0x57ef79)[_0x129595(0x1d4)]===0x0)return console[_0x129595(0x1e2)](_0x129595(0x1c3)),console[_0x129595(0x1e2)](_0x129595(0x1e7)),0x1;const _0x58b554=await withSpinner(_0x129595(0x198)+_0x1a9fcc+_0x129595(0x202),()=>_0x2e2be3[_0x129595(0x1ca)][_0x129595(0x187)](_0x1a9fcc,_0x57ef79,_0x16d6bd),{'verbose':_0x546246[_0x129595(0x1cf)]});return await handleSDKOutput([_0x58b554['data']],_0x546246),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1d5);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1b5);async[a16_0x455b27(0x1d8)](_0x29d7b1){const _0x4fc4cc=a16_0x455b27,{options:_0xdd45d8,args:_0x538926,tdx:_0x5838b3}=_0x29d7b1;if(_0x538926[_0x4fc4cc(0x1d4)]===0x0)return console[_0x4fc4cc(0x1e2)](_0x4fc4cc(0x1b6)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x17727e=_0x538926[0x0],_0x1c3ce0=_0xdd45d8,_0x5def41=await resolveWorkspaceIdFromOptions(_0x1c3ce0,_0x5838b3);if(!_0xdd45d8[_0x4fc4cc(0x1bc)]){const _0x208d0e=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x17727e+_0x4fc4cc(0x1da));if(!_0x208d0e)return console[_0x4fc4cc(0x1f0)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x4fc4cc(0x1ef)+_0x17727e+_0x4fc4cc(0x202),()=>_0x5838b3['engage'][_0x4fc4cc(0x1c9)](_0x17727e,_0x5def41),{'verbose':_0xdd45d8[_0x4fc4cc(0x1cf)]}),console[_0x4fc4cc(0x1f0)]('Campaign\x20\x27'+_0x17727e+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']='engage:campaign:launch';['description']='Launch\x20a\x20campaign';async[a16_0x455b27(0x1d8)](_0x10f0ba){const _0x30086e=a16_0x455b27,{options:_0x48e589,args:_0x1533e0,tdx:_0x147383}=_0x10f0ba;if(_0x1533e0[_0x30086e(0x1d4)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x30086e(0x1b4)),0x1;const _0x2f6e32=_0x1533e0[0x0],_0x395f47=_0x48e589,_0x5424b1=await resolveWorkspaceIdFromOptions(_0x395f47,_0x147383);return await withSpinner(_0x30086e(0x1e4)+_0x2f6e32+_0x30086e(0x202),()=>_0x147383[_0x30086e(0x1ca)][_0x30086e(0x193)](_0x2f6e32,_0x5424b1),{'verbose':_0x48e589[_0x30086e(0x1cf)]}),console[_0x30086e(0x1f0)](_0x30086e(0x1ce)+_0x2f6e32+_0x30086e(0x1a0)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1bd);['description']=a16_0x455b27(0x17a);async[a16_0x455b27(0x1d8)](_0x454313){const _0x5768ed=a16_0x455b27,{options:_0x1e39b2,args:_0x39e23a,tdx:_0x992bc7}=_0x454313;if(_0x39e23a[_0x5768ed(0x1d4)]===0x0)return console[_0x5768ed(0x1e2)](_0x5768ed(0x1b6)),console[_0x5768ed(0x1e2)](_0x5768ed(0x19d)),0x1;const _0x316c23=_0x39e23a[0x0],_0x2142ad=_0x1e39b2,_0x5a38ad=await resolveWorkspaceIdFromOptions(_0x2142ad,_0x992bc7);return await withSpinner(_0x5768ed(0x1a7)+_0x316c23+_0x5768ed(0x202),()=>_0x992bc7[_0x5768ed(0x1ca)][_0x5768ed(0x17b)](_0x316c23,_0x5a38ad),{'verbose':_0x1e39b2[_0x5768ed(0x1cf)]}),console['log'](_0x5768ed(0x1ce)+_0x316c23+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a16_0x455b27(0x1f7);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x186);async[a16_0x455b27(0x1d8)](_0xfbc6b8){const _0x2aea33=a16_0x455b27,{options:_0x1c26a8,args:_0x49a040,tdx:_0x51562a}=_0xfbc6b8;if(_0x49a040[_0x2aea33(0x1d4)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2aea33(0x1e2)](_0x2aea33(0x1fb)),0x1;const _0x4db6e7=_0x49a040[0x0],_0x320be7=_0x1c26a8,_0x234e87=await resolveWorkspaceIdFromOptions(_0x320be7,_0x51562a);return await withSpinner(_0x2aea33(0x1f2)+_0x4db6e7+_0x2aea33(0x202),()=>_0x51562a[_0x2aea33(0x1ca)]['resumeCampaign'](_0x4db6e7,_0x234e87),{'verbose':_0x1c26a8['verbose']}),console[_0x2aea33(0x1f0)](_0x2aea33(0x1ce)+_0x4db6e7+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1bf);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1a2);async[a16_0x455b27(0x1d8)](_0x1212bb){const _0x514659=a16_0x455b27,{options:_0x40bcf7,args:_0x31a827,tdx:_0x5350a3}=_0x1212bb;if(_0x31a827[_0x514659(0x1d4)]===0x0)return console['error'](_0x514659(0x1b6)),console[_0x514659(0x1e2)](_0x514659(0x1d9)),0x1;const _0x45bc72=_0x31a827[0x0],_0x45538e=_0x40bcf7,_0x5dee02=await resolveWorkspaceIdFromOptions(_0x45538e,_0x5350a3),_0x3f7953=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x45bc72+'\x27...',()=>_0x5350a3['engage'][_0x514659(0x188)](_0x45bc72,_0x5dee02),{'verbose':_0x40bcf7[_0x514659(0x1cf)]});return await handleSDKOutput([_0x3f7953[_0x514659(0x1a8)]],_0x40bcf7),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1ad);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1a3);async['execute'](_0x2374fc){const _0x40ecd7=a16_0x455b27,{options:_0x14bb3a,args:_0x27a98d,tdx:_0x5719ef}=_0x2374fc,_0x2f693f=_0x27a98d[0x0],_0x16c720=resolveLimit(_0x14bb3a[_0x40ecd7(0x19e)],DEFAULT_LLM_LIMIT),_0xc96e4d=_0x14bb3a,_0x327881=await resolveWorkspaceIdFromOptions(_0xc96e4d,_0x5719ef),_0x63d3ef=await withSpinner(_0x40ecd7(0x1b0),()=>_0x5719ef[_0x40ecd7(0x1ca)][_0x40ecd7(0x1e3)]({'workspaceId':_0x327881,'limit':_0x16c720}),{'verbose':_0x14bb3a[_0x40ecd7(0x1cf)]});let _0x3f76e3=_0x63d3ef['data'];return _0x2f693f&&(_0x3f76e3=_0x63d3ef['data'][_0x40ecd7(0x1e8)](_0x2226e6=>matchGlobPattern(_0x2226e6[_0x40ecd7(0x1c8)],_0x2f693f))),await handleSDKOutput(_0x3f76e3,_0x14bb3a),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x189);['description']='Show\x20email\x20template\x20details';async[a16_0x455b27(0x1d8)](_0x336a39){const _0x53dd10=a16_0x455b27,{options:_0x1af3c0,args:_0x10be4a,tdx:_0x4cabcb}=_0x336a39;if(_0x10be4a[_0x53dd10(0x1d4)]===0x0)return console[_0x53dd10(0x1e2)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x53dd10(0x1e2)](_0x53dd10(0x17c)),0x1;const _0x54af19=_0x10be4a[0x0],_0x38e1d6=_0x1af3c0,_0x5ac4e6=await resolveWorkspaceIdFromOptions(_0x38e1d6,_0x4cabcb),_0x2681e3=_0x38e1d6[_0x53dd10(0x19c)];if(_0x2681e3){const _0x217d35=await withSpinner('Fetching\x20template\x20\x27'+_0x54af19+_0x53dd10(0x202),()=>_0x4cabcb[_0x53dd10(0x1ca)][_0x53dd10(0x1ea)](_0x54af19,_0x5ac4e6),{'verbose':_0x1af3c0[_0x53dd10(0x1cf)]});await handleSDKOutput([_0x217d35],_0x1af3c0);}else{const _0x523a65=await withSpinner(_0x53dd10(0x1ec)+_0x54af19+_0x53dd10(0x202),()=>_0x4cabcb['engage'][_0x53dd10(0x1a9)](_0x54af19,_0x5ac4e6),{'verbose':_0x1af3c0[_0x53dd10(0x1cf)]});await handleSDKOutput([_0x523a65],_0x1af3c0);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']=a16_0x455b27(0x1a1);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x199);async['execute'](_0x53f22b){const _0x30edf0=a16_0x455b27,{options:_0x5f5874,tdx:_0x54da58}=_0x53f22b,_0x3e90ef=_0x5f5874,_0x5cbb99=_0x3e90ef[_0x30edf0(0x1c8)],_0x3a3bc7=_0x3e90ef['subject'],_0x4e0b06=_0x3e90ef[_0x30edf0(0x1c4)];if(!_0x5cbb99)return console['error'](_0x30edf0(0x17e)),console[_0x30edf0(0x1e2)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x3a3bc7)return console[_0x30edf0(0x1e2)](_0x30edf0(0x1a6)),0x1;if(!_0x4e0b06)return console[_0x30edf0(0x1e2)]('Error:\x20--html\x20is\x20required'),0x1;const _0x2f7946=await resolveWorkspaceIdFromOptions(_0x3e90ef,_0x54da58,!![]),_0xeaa226={'name':_0x5cbb99,'subjectTemplate':_0x3a3bc7,'htmlTemplate':_0x4e0b06,'workspaceId':_0x2f7946,'plaintextTemplate':_0x3e90ef['plaintext'],'editorType':_0x3e90ef[_0x30edf0(0x182)]},_0x1e7862=await withSpinner(_0x30edf0(0x1fa)+_0x5cbb99+'\x27...',()=>_0x54da58[_0x30edf0(0x1ca)][_0x30edf0(0x1ab)](_0xeaa226));return await handleSDKOutput([_0x1e7862['data']],_0x5f5874),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1d2);['description']=a16_0x455b27(0x1d0);async[a16_0x455b27(0x1d8)](_0x28e351){const _0x4bafb9=a16_0x455b27,{options:_0x206998,args:_0x597e5d,tdx:_0xb9a654}=_0x28e351;if(_0x597e5d['length']===0x0)return console[_0x4bafb9(0x1e2)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x4bafb9(0x176)),0x1;const _0x1f7acd=_0x597e5d[0x0],_0x49ec74=_0x206998,_0x48b763=await resolveWorkspaceIdFromOptions(_0x49ec74,_0xb9a654),_0x4d4a3d={'name':_0x49ec74[_0x4bafb9(0x1c8)],'subjectTemplate':_0x49ec74[_0x4bafb9(0x1c1)],'htmlTemplate':_0x49ec74['html'],'plaintextTemplate':_0x49ec74[_0x4bafb9(0x17d)]},_0x57e527=Object[_0x4bafb9(0x173)](Object[_0x4bafb9(0x19b)](_0x4d4a3d)[_0x4bafb9(0x1e8)](([,_0x40104c])=>_0x40104c!==undefined));if(Object[_0x4bafb9(0x1a4)](_0x57e527)['length']===0x0)return console[_0x4bafb9(0x1e2)](_0x4bafb9(0x1c3)),console['error'](_0x4bafb9(0x1f1)),0x1;const _0x5b39a3=await withSpinner(_0x4bafb9(0x1be)+_0x1f7acd+_0x4bafb9(0x202),()=>_0xb9a654[_0x4bafb9(0x1ca)]['updateTemplate'](_0x1f7acd,_0x57e527,_0x48b763),{'verbose':_0x206998[_0x4bafb9(0x1cf)]});return await handleSDKOutput([_0x5b39a3[_0x4bafb9(0x1a8)]],_0x206998),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x455b27(0x1c8)]='engage:template:delete';[a16_0x455b27(0x1fc)]='Delete\x20an\x20email\x20template';async[a16_0x455b27(0x1d8)](_0x52ba2c){const _0x1bfef4=a16_0x455b27,{options:_0x5c865f,args:_0x122941,tdx:_0x3c6fd0}=_0x52ba2c;if(_0x122941[_0x1bfef4(0x1d4)]===0x0)return console[_0x1bfef4(0x1e2)](_0x1bfef4(0x174)),console[_0x1bfef4(0x1e2)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0xaff0c3=_0x122941[0x0],_0x122569=_0x5c865f,_0x591141=await resolveWorkspaceIdFromOptions(_0x122569,_0x3c6fd0);if(!_0x5c865f[_0x1bfef4(0x1bc)]){const _0x2d11cf=await confirm(_0x1bfef4(0x1a5)+_0xaff0c3+_0x1bfef4(0x1da));if(!_0x2d11cf)return console[_0x1bfef4(0x1f0)](_0x1bfef4(0x1ae)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0xaff0c3+_0x1bfef4(0x202),()=>_0x3c6fd0['engage'][_0x1bfef4(0x172)](_0xaff0c3,_0x591141),{'verbose':_0x5c865f[_0x1bfef4(0x1cf)]}),console[_0x1bfef4(0x1f0)](_0x1bfef4(0x1ac)+_0xaff0c3+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1df);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1b3);async[a16_0x455b27(0x1d8)](_0x2e4014){const _0xc7c98e=a16_0x455b27,{options:_0x1d9cbb,args:_0x49f3e0,tdx:_0x2895d1}=_0x2e4014,_0x1b5a4e=_0x49f3e0[0x0],_0x150562=resolveLimit(_0x1d9cbb[_0xc7c98e(0x19e)],DEFAULT_LLM_LIMIT),_0x425649=await withSpinner('Fetching\x20workspaces...',()=>_0x2895d1['engage'][_0xc7c98e(0x1e6)]({'limit':_0x150562}),{'verbose':_0x1d9cbb[_0xc7c98e(0x1cf)]});let _0x425f3e=_0x425649['data'];return _0x1b5a4e&&(_0x425f3e=_0x425649[_0xc7c98e(0x1a8)][_0xc7c98e(0x1e8)](_0xf8d929=>matchGlobPattern(_0xf8d929[_0xc7c98e(0x1c8)],_0x1b5a4e))),await handleSDKOutput(_0x425f3e,_0x1d9cbb),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x455b27(0x1c8)]='engage:workspace:show';['description']=a16_0x455b27(0x201);async[a16_0x455b27(0x1d8)](_0x3b6684){const _0x5ec971=a16_0x455b27,{options:_0x47557e,args:_0x6aada8,tdx:_0x10dde2}=_0x3b6684;if(_0x6aada8[_0x5ec971(0x1d4)]===0x0)return console[_0x5ec971(0x1e2)](_0x5ec971(0x200)),console[_0x5ec971(0x1e2)](_0x5ec971(0x1c5)),0x1;const _0x4a9af2=_0x6aada8[0x0],_0x41c0c2=_0x47557e,_0x5071e4=_0x41c0c2['full'];if(_0x5071e4){const _0x303ce1=await withSpinner(_0x5ec971(0x1ee)+_0x4a9af2+_0x5ec971(0x202),()=>_0x10dde2[_0x5ec971(0x1ca)][_0x5ec971(0x194)](_0x4a9af2),{'verbose':_0x47557e['verbose']});await handleSDKOutput([_0x303ce1],_0x47557e);}else{const _0x2fae98=await withSpinner('Fetching\x20workspace\x20\x27'+_0x4a9af2+'\x27...',()=>_0x10dde2[_0x5ec971(0x1ca)][_0x5ec971(0x197)](_0x4a9af2),{'verbose':_0x47557e['verbose']});await handleSDKOutput([_0x2fae98],_0x47557e);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1b2);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x184);async[a16_0x455b27(0x1d8)](_0x4679de){const _0x4246ff=a16_0x455b27,{options:_0x4e8575,tdx:_0x5ae678}=_0x4679de,_0x458aec=_0x4e8575,_0x4d6d31=_0x458aec['name'];if(!_0x4d6d31)return console[_0x4246ff(0x1e2)](_0x4246ff(0x17e)),console[_0x4246ff(0x1e2)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x189c78={'name':_0x4d6d31,'description':_0x458aec[_0x4246ff(0x1fc)]},_0x2a1d32=await withSpinner(_0x4246ff(0x1f5)+_0x4d6d31+'\x27...',()=>_0x5ae678[_0x4246ff(0x1ca)][_0x4246ff(0x18d)](_0x189c78));return await handleSDKOutput([_0x2a1d32['data']],_0x4e8575),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x18b);['description']=a16_0x455b27(0x17f);async[a16_0x455b27(0x1d8)](_0x11f472){const _0x22379b=a16_0x455b27,{options:_0x59e5d1,args:_0x869bb9,tdx:_0x26ad92}=_0x11f472;if(_0x869bb9[_0x22379b(0x1d4)]===0x0)return console[_0x22379b(0x1e2)](_0x22379b(0x200)),console[_0x22379b(0x1e2)](_0x22379b(0x190)),0x1;const _0xbe90c1=_0x869bb9[0x0],_0x35f965=_0x59e5d1,_0x3fb01e={'name':_0x35f965[_0x22379b(0x1c8)],'description':_0x35f965[_0x22379b(0x1fc)]},_0x23892b=Object[_0x22379b(0x173)](Object[_0x22379b(0x19b)](_0x3fb01e)[_0x22379b(0x1e8)](([,_0x5d067d])=>_0x5d067d!==undefined));if(Object[_0x22379b(0x1a4)](_0x23892b)[_0x22379b(0x1d4)]===0x0)return console['error'](_0x22379b(0x1c3)),console[_0x22379b(0x1e2)](_0x22379b(0x196)),0x1;const _0x22e2c0=await withSpinner(_0x22379b(0x18c)+_0xbe90c1+'\x27...',()=>_0x26ad92['engage'][_0x22379b(0x1d7)](_0xbe90c1,_0x23892b),{'verbose':_0x59e5d1['verbose']});return await handleSDKOutput([_0x22e2c0[_0x22379b(0x1a8)]],_0x59e5d1),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x19f);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x1e5);async['execute'](_0x5efb96){const _0x3b5f56=a16_0x455b27,{options:_0x118675,args:_0x204548,tdx:_0x2745a1}=_0x5efb96;if(_0x204548[_0x3b5f56(0x1d4)]===0x0)return console['error'](_0x3b5f56(0x200)),console[_0x3b5f56(0x1e2)](_0x3b5f56(0x1cc)),0x1;const _0x15c33b=_0x204548[0x0];if(!_0x118675[_0x3b5f56(0x1bc)]){const _0x3d8040=await confirm(_0x3b5f56(0x1dc)+_0x15c33b+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x3d8040)return console['log'](_0x3b5f56(0x1ae)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x15c33b+'\x27...',()=>_0x2745a1[_0x3b5f56(0x1ca)][_0x3b5f56(0x1f4)](_0x15c33b),{'verbose':_0x118675['verbose']}),console[_0x3b5f56(0x1f0)]('Workspace\x20\x27'+_0x15c33b+_0x3b5f56(0x1b8)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x455b27(0x1c8)]=a16_0x455b27(0x1f3);[a16_0x455b27(0x1fc)]=a16_0x455b27(0x179);async[a16_0x455b27(0x1d8)](_0x10c698){const _0x3b7a22=a16_0x455b27,{options:_0x42988c,args:_0x5109cf,tdx:_0x6427f2}=_0x10c698;if(_0x5109cf['length']===0x0)return console[_0x3b7a22(0x1e2)](_0x3b7a22(0x1db)),console[_0x3b7a22(0x1e2)]('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x287aa3=_0x5109cf[0x0];await withSpinner(_0x3b7a22(0x1fe)+_0x287aa3+_0x3b7a22(0x202),()=>_0x6427f2[_0x3b7a22(0x1ca)][_0x3b7a22(0x1f9)](_0x287aa3));const _0x3335d5=_0x42988c[_0x3b7a22(0x18f)]||undefined;return saveSessionContext({'engage_workspace':_0x287aa3},_0x3335d5),console['log'](_0x3b7a22(0x1c0)+_0x287aa3),console[_0x3b7a22(0x1f0)](_0x3b7a22(0x203)),0x0;}}
|
|
1
|
+
const a16_0x12ae71=a16_0x2d19;(function(_0x170820,_0x3490ca){const _0x12fa28=a16_0x2d19,_0x35d13a=_0x170820();while(!![]){try{const _0x509982=parseInt(_0x12fa28(0x11f))/0x1+-parseInt(_0x12fa28(0x12b))/0x2*(-parseInt(_0x12fa28(0x116))/0x3)+-parseInt(_0x12fa28(0xc0))/0x4*(parseInt(_0x12fa28(0x129))/0x5)+-parseInt(_0x12fa28(0x139))/0x6+parseInt(_0x12fa28(0x11b))/0x7+parseInt(_0x12fa28(0x13d))/0x8*(parseInt(_0x12fa28(0xcc))/0x9)+parseInt(_0x12fa28(0xd4))/0xa;if(_0x509982===_0x3490ca)break;else _0x35d13a['push'](_0x35d13a['shift']());}catch(_0x24dc85){_0x35d13a['push'](_0x35d13a['shift']());}}}(a16_0x1fec,0x6fd13));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(_0xa68771,_0x4feab4,_0x4e3ede=![]){const _0x39b999=a16_0x2d19;if(_0xa68771[_0x39b999(0xea)])return await _0x4feab4[_0x39b999(0xef)][_0x39b999(0x125)](_0xa68771[_0x39b999(0xea)]);const _0x347b4a=loadSessionContext(_0xa68771[_0x39b999(0xb5)]);if(_0x347b4a?.[_0x39b999(0xfd)])return await _0x4feab4['engage'][_0x39b999(0x125)](_0x347b4a[_0x39b999(0xfd)]);if(_0x4e3ede)throw new SDKError(ErrorCode[_0x39b999(0xe6)],_0x39b999(0x104),undefined,{'helpText':_0x39b999(0x100)});return undefined;}async function resolveSegmentFromOptions(_0x37f0cf,_0x35e1cd){const _0x26d3db=a16_0x2d19;if(!_0x37f0cf[_0x26d3db(0x143)])return{};const _0x405344=_0x37f0cf['segment'],_0x41cbd1=await _0x35e1cd[_0x26d3db(0x143)][_0x26d3db(0x13c)](_0x405344);return{'audienceId':_0x41cbd1[_0x26d3db(0x121)],'audienceName':_0x41cbd1[_0x26d3db(0xff)],..._0x41cbd1['segmentId']&&{'segmentId':_0x41cbd1[_0x26d3db(0x142)],'segmentName':_0x41cbd1['segmentName']}};}function a16_0x2d19(_0x27146a,_0x97f83c){_0x27146a=_0x27146a-0xb3;const _0x1fec6c=a16_0x1fec();let _0x2d199a=_0x1fec6c[_0x27146a];return _0x2d199a;}function buildConnectorConfig(_0x56f7b5){const _0x2853a2=a16_0x2d19,_0x4b444a=_0x56f7b5[_0x2853a2(0x133)],_0x538e7e=_0x56f7b5['jsonColumns'];if(!_0x4b444a&&!_0x538e7e)return undefined;return{..._0x4b444a&&{'emailSenderId':_0x4b444a},..._0x538e7e&&{'jsonColumns':_0x538e7e}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a16_0x12ae71(0xfc);[a16_0x12ae71(0x141)]='List\x20campaigns';async[a16_0x12ae71(0xee)](_0x5e7a1b){const _0x106070=a16_0x12ae71,{options:_0x212886,args:_0x4650bf,tdx:_0x828a14}=_0x5e7a1b,_0x427157=_0x4650bf[0x0],_0x4f3132=resolveLimit(_0x212886[_0x106070(0xf6)],DEFAULT_LLM_LIMIT),_0xc909ec=_0x212886,_0x2f1fad=_0xc909ec[_0x106070(0xbe)],_0x5f508e=_0xc909ec[_0x106070(0xc6)],_0x4fc980=await resolveWorkspaceIdFromOptions(_0xc909ec,_0x828a14),_0x281bb9=await withSpinner(_0x106070(0x12f),()=>_0x828a14[_0x106070(0xef)][_0x106070(0x118)]({'type':_0x2f1fad,'status':_0x5f508e,'workspaceId':_0x4fc980,'limit':_0x4f3132}),{'verbose':_0x212886[_0x106070(0xcf)]});let _0x2938ca=_0x281bb9[_0x106070(0xf0)];return _0x427157&&(_0x2938ca=_0x281bb9[_0x106070(0xf0)][_0x106070(0xc2)](_0x54db2a=>matchGlobPattern(_0x54db2a[_0x106070(0x127)],_0x427157))),await handleSDKOutput(_0x2938ca,_0x212886),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x122);['description']=a16_0x12ae71(0x146);async['execute'](_0x37519e){const _0x2dc518=a16_0x12ae71,{options:_0x29c325,args:_0x324d43,tdx:_0x38dbd6}=_0x37519e;if(_0x324d43[_0x2dc518(0xbb)]===0x0)return console[_0x2dc518(0xcd)](_0x2dc518(0xca)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x4f4993=_0x324d43[0x0],_0x502098=_0x29c325,_0x15e1df=await resolveWorkspaceIdFromOptions(_0x502098,_0x38dbd6),_0x341c49=_0x502098['full'];if(_0x341c49){const _0xcf0296=await withSpinner('Fetching\x20campaign\x20\x27'+_0x4f4993+_0x2dc518(0x114),()=>_0x38dbd6[_0x2dc518(0xef)]['getCampaignFull'](_0x4f4993,_0x15e1df),{'verbose':_0x29c325[_0x2dc518(0xcf)]});await handleSDKOutput([_0xcf0296],_0x29c325);}else{const _0x2a0cd2=await withSpinner(_0x2dc518(0x111)+_0x4f4993+_0x2dc518(0x114),()=>_0x38dbd6[_0x2dc518(0xef)][_0x2dc518(0x147)](_0x4f4993,_0x15e1df),{'verbose':_0x29c325[_0x2dc518(0xcf)]});await handleSDKOutput([_0x2a0cd2],_0x29c325);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x112);[a16_0x12ae71(0x141)]=a16_0x12ae71(0x117);async[a16_0x12ae71(0xee)](_0x484d72){const _0x5701b7=a16_0x12ae71,{options:_0x1a0e56,tdx:_0x571dc9}=_0x484d72,_0x4a373b=_0x1a0e56,_0x5bec3c=_0x4a373b['name'],_0x4a954d=_0x4a373b[_0x5701b7(0xbe)];if(!_0x5bec3c)return console[_0x5701b7(0xcd)](_0x5701b7(0xc8)),console['error'](_0x5701b7(0x11d)),0x1;if(!_0x4a954d)return console['error']('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x5701b7(0xcd)](_0x5701b7(0x11d)),0x1;const _0x4ddf7f=await resolveWorkspaceIdFromOptions(_0x4a373b,_0x571dc9,!![]),_0x11efa3=await resolveSegmentFromOptions(_0x4a373b,_0x571dc9),_0x3f5e9a=buildConnectorConfig(_0x4a373b),_0x3c1de2={'name':_0x5bec3c,'campaignType':_0x4a954d,'workspaceId':_0x4ddf7f,'description':_0x4a373b['description'],..._0x11efa3,'connectorConfig':_0x3f5e9a,'startAt':_0x4a373b[_0x5701b7(0x13e)],'timezone':_0x4a373b['timezone']},_0x121b58=await withSpinner(_0x5701b7(0x12d)+_0x5bec3c+_0x5701b7(0x114),()=>_0x571dc9[_0x5701b7(0xef)]['createCampaign'](_0x3c1de2));return await handleSDKOutput([_0x121b58[_0x5701b7(0xf0)]],_0x1a0e56),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0xe1);['description']=a16_0x12ae71(0xe7);async['execute'](_0x6c3ac){const _0x3cbf69=a16_0x12ae71,{options:_0x5081db,args:_0xf948cf,tdx:_0x390006}=_0x6c3ac;if(_0xf948cf[_0x3cbf69(0xbb)]===0x0)return console[_0x3cbf69(0xcd)](_0x3cbf69(0xca)),console['error'](_0x3cbf69(0x11c)),0x1;const _0x4cb34e=_0xf948cf[0x0],_0x590bf4=_0x5081db,_0x213b3d=await resolveWorkspaceIdFromOptions(_0x590bf4,_0x390006),_0x5a05d1=await resolveSegmentFromOptions(_0x590bf4,_0x390006),_0x290260=buildConnectorConfig(_0x590bf4),_0x3e2e1f={'name':_0x590bf4['name'],'description':_0x590bf4[_0x3cbf69(0x141)],..._0x5a05d1,'connectorConfig':_0x290260,'startAt':_0x590bf4[_0x3cbf69(0x13e)],'timezone':_0x590bf4[_0x3cbf69(0xbd)]},_0x4a93bd=Object['fromEntries'](Object[_0x3cbf69(0xe0)](_0x3e2e1f)[_0x3cbf69(0xc2)](([,_0x575496])=>_0x575496!==undefined));if(Object[_0x3cbf69(0x13b)](_0x4a93bd)[_0x3cbf69(0xbb)]===0x0)return console['error'](_0x3cbf69(0x126)),console['error'](_0x3cbf69(0x145)),0x1;const _0x557827=await withSpinner('Updating\x20campaign\x20\x27'+_0x4cb34e+'\x27...',()=>_0x390006[_0x3cbf69(0xef)][_0x3cbf69(0xc5)](_0x4cb34e,_0x4a93bd,_0x213b3d),{'verbose':_0x5081db[_0x3cbf69(0xcf)]});return await handleSDKOutput([_0x557827[_0x3cbf69(0xf0)]],_0x5081db),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x120);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xd7);async['execute'](_0x3b6456){const _0x4b82bf=a16_0x12ae71,{options:_0x1d0c74,args:_0x227523,tdx:_0x3467f6}=_0x3b6456;if(_0x227523[_0x4b82bf(0xbb)]===0x0)return console[_0x4b82bf(0xcd)](_0x4b82bf(0xca)),console[_0x4b82bf(0xcd)](_0x4b82bf(0xda)),0x1;const _0x5288cc=_0x227523[0x0],_0x474ca9=_0x1d0c74,_0xb43175=await resolveWorkspaceIdFromOptions(_0x474ca9,_0x3467f6);if(!_0x1d0c74[_0x4b82bf(0xd2)]){const _0x571db4=await confirm(_0x4b82bf(0xe2)+_0x5288cc+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x571db4)return console[_0x4b82bf(0xe8)](_0x4b82bf(0x102)),0x0;}return await withSpinner(_0x4b82bf(0xf5)+_0x5288cc+_0x4b82bf(0x114),()=>_0x3467f6[_0x4b82bf(0xef)]['deleteCampaign'](_0x5288cc,_0xb43175),{'verbose':_0x1d0c74[_0x4b82bf(0xcf)]}),console['log'](_0x4b82bf(0xc1)+_0x5288cc+_0x4b82bf(0xf4)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x110);[a16_0x12ae71(0x141)]='Launch\x20a\x20campaign';async[a16_0x12ae71(0xee)](_0x125609){const _0xecc524=a16_0x12ae71,{options:_0xf9c6ef,args:_0x244177,tdx:_0x477b05}=_0x125609;if(_0x244177['length']===0x0)return console[_0xecc524(0xcd)](_0xecc524(0xca)),console['error'](_0xecc524(0x13f)),0x1;const _0x3d2800=_0x244177[0x0],_0x3044c3=_0xf9c6ef,_0x58ca24=await resolveWorkspaceIdFromOptions(_0x3044c3,_0x477b05);return await withSpinner(_0xecc524(0x134)+_0x3d2800+_0xecc524(0x114),()=>_0x477b05[_0xecc524(0xef)][_0xecc524(0xc9)](_0x3d2800,_0x58ca24),{'verbose':_0xf9c6ef['verbose']}),console[_0xecc524(0xe8)](_0xecc524(0xc1)+_0x3d2800+_0xecc524(0xf2)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0xb9);[a16_0x12ae71(0x141)]='Pause\x20a\x20campaign';async['execute'](_0xe220df){const _0x4700dc=a16_0x12ae71,{options:_0x371427,args:_0x3d677e,tdx:_0x50ab3f}=_0xe220df;if(_0x3d677e[_0x4700dc(0xbb)]===0x0)return console[_0x4700dc(0xcd)](_0x4700dc(0xca)),console[_0x4700dc(0xcd)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x3284a6=_0x3d677e[0x0],_0x33f0e7=_0x371427,_0x6e9f0d=await resolveWorkspaceIdFromOptions(_0x33f0e7,_0x50ab3f);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x3284a6+'\x27...',()=>_0x50ab3f[_0x4700dc(0xef)][_0x4700dc(0xec)](_0x3284a6,_0x6e9f0d),{'verbose':_0x371427[_0x4700dc(0xcf)]}),console[_0x4700dc(0xe8)](_0x4700dc(0xc1)+_0x3284a6+_0x4700dc(0xeb)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a16_0x12ae71(0xb6);['description']=a16_0x12ae71(0x107);async['execute'](_0x3cc549){const _0x52d8b9=a16_0x12ae71,{options:_0x289ca0,args:_0x325581,tdx:_0x21708a}=_0x3cc549;if(_0x325581['length']===0x0)return console[_0x52d8b9(0xcd)](_0x52d8b9(0xca)),console[_0x52d8b9(0xcd)](_0x52d8b9(0xf9)),0x1;const _0x3edcff=_0x325581[0x0],_0x21895e=_0x289ca0,_0x2395ca=await resolveWorkspaceIdFromOptions(_0x21895e,_0x21708a);return await withSpinner(_0x52d8b9(0x105)+_0x3edcff+_0x52d8b9(0x114),()=>_0x21708a[_0x52d8b9(0xef)][_0x52d8b9(0x135)](_0x3edcff,_0x2395ca),{'verbose':_0x289ca0[_0x52d8b9(0xcf)]}),console[_0x52d8b9(0xe8)]('Campaign\x20\x27'+_0x3edcff+_0x52d8b9(0x124)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']='engage:campaign:duplicate';[a16_0x12ae71(0x141)]=a16_0x12ae71(0xe4);async[a16_0x12ae71(0xee)](_0x4dfea0){const _0x11f4db=a16_0x12ae71,{options:_0x54e510,args:_0x4b953a,tdx:_0x56b85f}=_0x4dfea0;if(_0x4b953a['length']===0x0)return console[_0x11f4db(0xcd)](_0x11f4db(0xca)),console[_0x11f4db(0xcd)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x12bde2=_0x4b953a[0x0],_0x44cfb3=_0x54e510,_0x59c53e=await resolveWorkspaceIdFromOptions(_0x44cfb3,_0x56b85f),_0x225f9b=await withSpinner(_0x11f4db(0xfb)+_0x12bde2+_0x11f4db(0x114),()=>_0x56b85f[_0x11f4db(0xef)]['duplicateCampaign'](_0x12bde2,_0x59c53e),{'verbose':_0x54e510[_0x11f4db(0xcf)]});return await handleSDKOutput([_0x225f9b['data']],_0x54e510),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0x12ae71(0x132);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xfa);async[a16_0x12ae71(0xee)](_0x42ae2e){const _0x1cc9e3=a16_0x12ae71,{options:_0x46da1e,args:_0x420926,tdx:_0x58901e}=_0x42ae2e,_0x984653=_0x420926[0x0],_0x4bf790=resolveLimit(_0x46da1e['limit'],DEFAULT_LLM_LIMIT),_0x5ed718=_0x46da1e,_0x2e3bc7=await resolveWorkspaceIdFromOptions(_0x5ed718,_0x58901e),_0x13746c=await withSpinner(_0x1cc9e3(0xb4),()=>_0x58901e[_0x1cc9e3(0xef)][_0x1cc9e3(0x10b)]({'workspaceId':_0x2e3bc7,'limit':_0x4bf790}),{'verbose':_0x46da1e[_0x1cc9e3(0xcf)]});let _0x34d560=_0x13746c[_0x1cc9e3(0xf0)];return _0x984653&&(_0x34d560=_0x13746c[_0x1cc9e3(0xf0)][_0x1cc9e3(0xc2)](_0x437fc4=>matchGlobPattern(_0x437fc4[_0x1cc9e3(0x127)],_0x984653))),await handleSDKOutput(_0x34d560,_0x46da1e),0x0;}}function a16_0x1fec(){const _0x477fe8=['Deleting\x20campaign\x20\x27','limit','Fetching\x20workspaces...','Error:\x20--html\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','List\x20email\x20templates','Duplicating\x20campaign\x20\x27','engage:campaigns','engage_workspace','Template\x20\x27','parentName','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Fetching\x20template\x20\x27','Operation\x20cancelled','updateWorkspace','Workspace\x20is\x20required\x20for\x20this\x20operation','Resuming\x20campaign\x20\x27','Create\x20a\x20workspace','Resume\x20a\x20paused\x20campaign','editorType','getWorkspace','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','listTemplates','Delete\x20an\x20email\x20template','List\x20workspaces','fromEntries','Updating\x20workspace\x20\x27','engage:campaign:launch','Fetching\x20campaign\x20\x27','engage:campaign:create','Error:\x20Workspace\x20name\x20is\x20required','\x27...','Error:\x20--subject\x20is\x20required','380127vyoIxX','Create\x20a\x20new\x20campaign','listCampaigns','engage:template:create','engage:workspace:use','1905813jODUcU','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','plaintext','219974QPUslA','engage:campaign:delete','parentId','engage:campaign:show','engage:template:show','\x27\x20resumed\x20successfully','resolveWorkspaceId','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','name','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','25HdsXmR','Delete\x20a\x20workspace','10DDWqyt','full','Creating\x20campaign\x20\x27','createWorkspace','Fetching\x20campaigns...','listWorkspaces','Deleting\x20template\x20\x27','engage:templates','emailSenderId','Launching\x20campaign\x20\x27','resumeCampaign','engage:template:update','engage:workspace:delete','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','2815728jSqjSc','engage:workspace:show','keys','resolvePathToResource','6992gAEoVl','startAt','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','description','segmentId','segment','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Show\x20campaign\x20details','getCampaign','getTemplateFull','Fetching\x20templates...','session','engage:campaign:resume','Verifying\x20workspace\x20\x27','engage:template:delete','engage:campaign:pause','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','length','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','timezone','type','Deleting\x20workspace\x20\x27','480256SYNWhq','Campaign\x20\x27','filter','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Update\x20an\x20email\x20template','updateCampaign','status','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Error:\x20--name\x20is\x20required','launchCampaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','getTemplate','3618JgWTet','error','Updating\x20template\x20\x27','verbose','deleteTemplate','Engage\x20workspace\x20set\x20to:\x20','yes','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','504850oITUlP','Creating\x20template\x20\x27','Options:\x20--name,\x20--description','Delete\x20a\x20campaign','Show\x20email\x20template\x20details','getWorkspaceFull','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Update\x20a\x20workspace','Creating\x20workspace\x20\x27','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Fetching\x20workspace\x20\x27','\x27?\x20This\x20cannot\x20be\x20undone.','entries','engage:campaign:update','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','html','Duplicate\x20a\x20campaign','Set\x20workspace\x20context\x20for\x20Engage\x20commands','MISSING_ARGUMENT','Update\x20a\x20campaign','log','createTemplate','workspace','\x27\x20paused\x20successfully','pauseCampaign','Workspace\x20\x27','execute','engage','data','subject','\x27\x20launched\x20successfully','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x27\x20deleted\x20successfully'];a16_0x1fec=function(){return _0x477fe8;};return a16_0x1fec();}export class EngageTemplateShowCommand extends BaseCommand{['name']=a16_0x12ae71(0x123);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xd8);async[a16_0x12ae71(0xee)](_0xae6438){const _0xaa9c95=a16_0x12ae71,{options:_0x2a449d,args:_0x16da54,tdx:_0x208e99}=_0xae6438;if(_0x16da54[_0xaa9c95(0xbb)]===0x0)return console['error'](_0xaa9c95(0x10a)),console[_0xaa9c95(0xcd)]('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x30b4ae=_0x16da54[0x0],_0xfbbc20=_0x2a449d,_0x44dc3c=await resolveWorkspaceIdFromOptions(_0xfbbc20,_0x208e99),_0x395ca9=_0xfbbc20[_0xaa9c95(0x12c)];if(_0x395ca9){const _0x4f044f=await withSpinner(_0xaa9c95(0x101)+_0x30b4ae+'\x27...',()=>_0x208e99[_0xaa9c95(0xef)][_0xaa9c95(0xb3)](_0x30b4ae,_0x44dc3c),{'verbose':_0x2a449d['verbose']});await handleSDKOutput([_0x4f044f],_0x2a449d);}else{const _0x11cd15=await withSpinner(_0xaa9c95(0x101)+_0x30b4ae+'\x27...',()=>_0x208e99['engage'][_0xaa9c95(0xcb)](_0x30b4ae,_0x44dc3c),{'verbose':_0x2a449d[_0xaa9c95(0xcf)]});await handleSDKOutput([_0x11cd15],_0x2a449d);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x119);['description']='Create\x20an\x20email\x20template';async[a16_0x12ae71(0xee)](_0x4da13b){const _0x132447=a16_0x12ae71,{options:_0x4e12d2,tdx:_0x15932f}=_0x4da13b,_0x2d6275=_0x4e12d2,_0x1f7f07=_0x2d6275[_0x132447(0x127)],_0x4a40d9=_0x2d6275[_0x132447(0xf1)],_0x363b30=_0x2d6275[_0x132447(0xe3)];if(!_0x1f7f07)return console['error']('Error:\x20--name\x20is\x20required'),console['error'](_0x132447(0x144)),0x1;if(!_0x4a40d9)return console[_0x132447(0xcd)](_0x132447(0x115)),0x1;if(!_0x363b30)return console['error'](_0x132447(0xf8)),0x1;const _0x4c6042=await resolveWorkspaceIdFromOptions(_0x2d6275,_0x15932f,!![]),_0x1282f6={'name':_0x1f7f07,'subjectTemplate':_0x4a40d9,'htmlTemplate':_0x363b30,'workspaceId':_0x4c6042,'plaintextTemplate':_0x2d6275[_0x132447(0x11e)],'editorType':_0x2d6275[_0x132447(0x108)]},_0x35bd16=await withSpinner(_0x132447(0xd5)+_0x1f7f07+_0x132447(0x114),()=>_0x15932f[_0x132447(0xef)][_0x132447(0xe9)](_0x1282f6));return await handleSDKOutput([_0x35bd16['data']],_0x4e12d2),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x12ae71(0x136);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xc4);async[a16_0x12ae71(0xee)](_0x448397){const _0x316477=a16_0x12ae71,{options:_0x27e722,args:_0x53d4b6,tdx:_0x2341ad}=_0x448397;if(_0x53d4b6[_0x316477(0xbb)]===0x0)return console[_0x316477(0xcd)](_0x316477(0x10a)),console[_0x316477(0xcd)](_0x316477(0xba)),0x1;const _0xaed696=_0x53d4b6[0x0],_0x50c572=_0x27e722,_0xecb0f7=await resolveWorkspaceIdFromOptions(_0x50c572,_0x2341ad),_0x30d380={'name':_0x50c572['name'],'subjectTemplate':_0x50c572[_0x316477(0xf1)],'htmlTemplate':_0x50c572[_0x316477(0xe3)],'plaintextTemplate':_0x50c572[_0x316477(0x11e)]},_0x206e41=Object[_0x316477(0x10e)](Object['entries'](_0x30d380)['filter'](([,_0x55b040])=>_0x55b040!==undefined));if(Object[_0x316477(0x13b)](_0x206e41)['length']===0x0)return console['error'](_0x316477(0x126)),console['error'](_0x316477(0xdd)),0x1;const _0x312b70=await withSpinner(_0x316477(0xce)+_0xaed696+'\x27...',()=>_0x2341ad[_0x316477(0xef)]['updateTemplate'](_0xaed696,_0x206e41,_0xecb0f7),{'verbose':_0x27e722[_0x316477(0xcf)]});return await handleSDKOutput([_0x312b70[_0x316477(0xf0)]],_0x27e722),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0xb8);[a16_0x12ae71(0x141)]=a16_0x12ae71(0x10c);async['execute'](_0x40b6c5){const _0xfa72a5=a16_0x12ae71,{options:_0x11d4f6,args:_0x236613,tdx:_0x23af80}=_0x40b6c5;if(_0x236613[_0xfa72a5(0xbb)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0xfa72a5(0xcd)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x1b26cb=_0x236613[0x0],_0x24ebae=_0x11d4f6,_0x16f004=await resolveWorkspaceIdFromOptions(_0x24ebae,_0x23af80);if(!_0x11d4f6[_0xfa72a5(0xd2)]){const _0x48f57e=await confirm(_0xfa72a5(0xbc)+_0x1b26cb+_0xfa72a5(0xdf));if(!_0x48f57e)return console[_0xfa72a5(0xe8)](_0xfa72a5(0x102)),0x0;}return await withSpinner(_0xfa72a5(0x131)+_0x1b26cb+_0xfa72a5(0x114),()=>_0x23af80[_0xfa72a5(0xef)][_0xfa72a5(0xd0)](_0x1b26cb,_0x16f004),{'verbose':_0x11d4f6[_0xfa72a5(0xcf)]}),console[_0xfa72a5(0xe8)](_0xfa72a5(0xfe)+_0x1b26cb+_0xfa72a5(0xf4)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x12ae71(0x127)]='engage:workspaces';[a16_0x12ae71(0x141)]=a16_0x12ae71(0x10d);async[a16_0x12ae71(0xee)](_0x49af96){const _0x55318f=a16_0x12ae71,{options:_0x2d68ec,args:_0x2c756d,tdx:_0x5dba93}=_0x49af96,_0x54669c=_0x2c756d[0x0],_0x4de187=resolveLimit(_0x2d68ec[_0x55318f(0xf6)],DEFAULT_LLM_LIMIT),_0x577243=await withSpinner(_0x55318f(0xf7),()=>_0x5dba93[_0x55318f(0xef)][_0x55318f(0x130)]({'limit':_0x4de187}),{'verbose':_0x2d68ec[_0x55318f(0xcf)]});let _0x43700d=_0x577243[_0x55318f(0xf0)];return _0x54669c&&(_0x43700d=_0x577243[_0x55318f(0xf0)][_0x55318f(0xc2)](_0x58f26=>matchGlobPattern(_0x58f26[_0x55318f(0x127)],_0x54669c))),await handleSDKOutput(_0x43700d,_0x2d68ec),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x13a);[a16_0x12ae71(0x141)]='Show\x20workspace\x20details';async[a16_0x12ae71(0xee)](_0xca6976){const _0x4c4a7f=a16_0x12ae71,{options:_0x560baf,args:_0x4b822f,tdx:_0x3bbf91}=_0xca6976;if(_0x4b822f['length']===0x0)return console[_0x4c4a7f(0xcd)](_0x4c4a7f(0x128)),console[_0x4c4a7f(0xcd)](_0x4c4a7f(0xc7)),0x1;const _0x451d32=_0x4b822f[0x0],_0x522031=_0x560baf,_0x20ecc4=_0x522031[_0x4c4a7f(0x12c)];if(_0x20ecc4){const _0x722550=await withSpinner('Fetching\x20workspace\x20\x27'+_0x451d32+_0x4c4a7f(0x114),()=>_0x3bbf91['engage'][_0x4c4a7f(0xd9)](_0x451d32),{'verbose':_0x560baf['verbose']});await handleSDKOutput([_0x722550],_0x560baf);}else{const _0x507535=await withSpinner(_0x4c4a7f(0xde)+_0x451d32+_0x4c4a7f(0x114),()=>_0x3bbf91[_0x4c4a7f(0xef)][_0x4c4a7f(0x109)](_0x451d32),{'verbose':_0x560baf[_0x4c4a7f(0xcf)]});await handleSDKOutput([_0x507535],_0x560baf);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x12ae71(0x127)]='engage:workspace:create';[a16_0x12ae71(0x141)]=a16_0x12ae71(0x106);async[a16_0x12ae71(0xee)](_0x39b875){const _0x5272e9=a16_0x12ae71,{options:_0x40eb80,tdx:_0x16a046}=_0x39b875,_0x41eb74=_0x40eb80,_0x3e55d1=_0x41eb74[_0x5272e9(0x127)];if(!_0x3e55d1)return console['error'](_0x5272e9(0xc8)),console['error'](_0x5272e9(0x138)),0x1;const _0x4b8b51={'name':_0x3e55d1,'description':_0x41eb74[_0x5272e9(0x141)]},_0x2e8c1b=await withSpinner(_0x5272e9(0xdc)+_0x3e55d1+_0x5272e9(0x114),()=>_0x16a046[_0x5272e9(0xef)][_0x5272e9(0x12e)](_0x4b8b51));return await handleSDKOutput([_0x2e8c1b[_0x5272e9(0xf0)]],_0x40eb80),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x12ae71(0x127)]='engage:workspace:update';[a16_0x12ae71(0x141)]=a16_0x12ae71(0xdb);async[a16_0x12ae71(0xee)](_0x3b2d4b){const _0x3f1dd1=a16_0x12ae71,{options:_0x1acafd,args:_0x315d41,tdx:_0x4ee499}=_0x3b2d4b;if(_0x315d41[_0x3f1dd1(0xbb)]===0x0)return console[_0x3f1dd1(0xcd)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x3f1dd1(0xcd)](_0x3f1dd1(0xd3)),0x1;const _0x537f01=_0x315d41[0x0],_0x4e32a0=_0x1acafd,_0x3d8145={'name':_0x4e32a0[_0x3f1dd1(0x127)],'description':_0x4e32a0[_0x3f1dd1(0x141)]},_0x544a74=Object[_0x3f1dd1(0x10e)](Object['entries'](_0x3d8145)['filter'](([,_0x7f9ae1])=>_0x7f9ae1!==undefined));if(Object[_0x3f1dd1(0x13b)](_0x544a74)[_0x3f1dd1(0xbb)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3f1dd1(0xcd)](_0x3f1dd1(0xd6)),0x1;const _0x1b8c71=await withSpinner(_0x3f1dd1(0x10f)+_0x537f01+'\x27...',()=>_0x4ee499[_0x3f1dd1(0xef)][_0x3f1dd1(0x103)](_0x537f01,_0x544a74),{'verbose':_0x1acafd[_0x3f1dd1(0xcf)]});return await handleSDKOutput([_0x1b8c71['data']],_0x1acafd),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x12ae71(0x127)]=a16_0x12ae71(0x137);['description']=a16_0x12ae71(0x12a);async[a16_0x12ae71(0xee)](_0x50daaa){const _0x3c9467=a16_0x12ae71,{options:_0x3476c6,args:_0x18dac7,tdx:_0x509182}=_0x50daaa;if(_0x18dac7[_0x3c9467(0xbb)]===0x0)return console[_0x3c9467(0xcd)](_0x3c9467(0x128)),console[_0x3c9467(0xcd)](_0x3c9467(0x140)),0x1;const _0x1f6c84=_0x18dac7[0x0];if(!_0x3476c6[_0x3c9467(0xd2)]){const _0x107a0a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x1f6c84+_0x3c9467(0xdf));if(!_0x107a0a)return console[_0x3c9467(0xe8)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x3c9467(0xbf)+_0x1f6c84+_0x3c9467(0x114),()=>_0x509182[_0x3c9467(0xef)]['deleteWorkspace'](_0x1f6c84),{'verbose':_0x3476c6[_0x3c9467(0xcf)]}),console[_0x3c9467(0xe8)](_0x3c9467(0xed)+_0x1f6c84+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x12ae71(0x11a);[a16_0x12ae71(0x141)]=a16_0x12ae71(0xe5);async[a16_0x12ae71(0xee)](_0x5f2f00){const _0x179728=a16_0x12ae71,{options:_0x2b1f58,args:_0x1ab5a6,tdx:_0x288803}=_0x5f2f00;if(_0x1ab5a6['length']===0x0)return console[_0x179728(0xcd)](_0x179728(0x113)),console['error'](_0x179728(0xc3)),0x1;const _0x290387=_0x1ab5a6[0x0];await withSpinner(_0x179728(0xb7)+_0x290387+_0x179728(0x114),()=>_0x288803['engage'][_0x179728(0x125)](_0x290387));const _0x18f149=_0x2b1f58['session']||undefined;return saveSessionContext({'engage_workspace':_0x290387},_0x18f149),console[_0x179728(0xe8)](_0x179728(0xd1)+_0x290387),console['log'](_0x179728(0xf3)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a17_0x318003=a17_0x2e5c;(function(_0x4052e4,_0xe5982){const _0x1712d8=a17_0x2e5c,_0x37f56c=_0x4052e4();while(!![]){try{const _0x3a8e4c=-parseInt(_0x1712d8(0x104))/0x1+-parseInt(_0x1712d8(0xbd))/0x2+-parseInt(_0x1712d8(0xd6))/0x3+parseInt(_0x1712d8(0xe1))/0x4+parseInt(_0x1712d8(0xc8))/0x5*(-parseInt(_0x1712d8(0xfb))/0x6)+parseInt(_0x1712d8(0xc4))/0x7+parseInt(_0x1712d8(0xe8))/0x8;if(_0x3a8e4c===_0xe5982)break;else _0x37f56c['push'](_0x37f56c['shift']());}catch(_0xce80ff){_0x37f56c['push'](_0x37f56c['shift']());}}}(a17_0x3ace,0x715ff));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';function a17_0x2e5c(_0x189c68,_0x314a22){_0x189c68=_0x189c68-0xbc;const _0x3ace0a=a17_0x3ace();let _0x2e5c3b=_0x3ace0a[_0x189c68];return _0x2e5c3b;}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_0x318003(0xe4)]=a17_0x318003(0xfe);[a17_0x318003(0xf4)]=a17_0x318003(0xcf);async[a17_0x318003(0xc2)](_0xb5764a){const _0x5a9a41=a17_0x318003,{options:_0x478a8a,tdx:_0xe9bda8}=_0xb5764a;try{const _0x1c8cf0=resolveLimit(_0x478a8a[_0x5a9a41(0xd1)],DEFAULT_DISPLAY_LIMIT),_0x1701f9=_0x478a8a[_0x5a9a41(0xe0)];_0x478a8a[_0x5a9a41(0xf1)]&&(console[_0x5a9a41(0xd9)](_0x5a9a41(0x103)+_0x1c8cf0+_0x5a9a41(0x100)),_0x1701f9&&console[_0x5a9a41(0xd9)](_0x5a9a41(0xe5)+_0x1701f9));const _0x42786d=await withSpinner(_0x5a9a41(0x10d),()=>_0xe9bda8[_0x5a9a41(0xfe)][_0x5a9a41(0x10c)]({'from':0x0,'to':_0x1c8cf0-0x1,'status':_0x1701f9}),{'verbose':_0x478a8a[_0x5a9a41(0xf1)]}),_0x4bf25a=_0x42786d['data'];console['error'](_0x5a9a41(0x106)+_0x4bf25a['length']+'\x20job'+(_0x4bf25a['length']!==0x1?'s':''));const _0x3a8244=_0x4bf25a[_0x5a9a41(0xf9)](_0x568f32=>{const _0x3e8b6f=_0x5a9a41;let _0x21fec3;if(_0x568f32[_0x3e8b6f(0xf2)]&&_0x568f32[_0x3e8b6f(0xef)]){const _0x106d20=new Date(_0x568f32[_0x3e8b6f(0xf2)])[_0x3e8b6f(0xbf)](),_0x369ec3=new Date(_0x568f32[_0x3e8b6f(0xef)])[_0x3e8b6f(0xbf)]();_0x21fec3=Math[_0x3e8b6f(0xbe)]((_0x369ec3-_0x106d20)/0x3e8);}return{'job_id':_0x568f32[_0x3e8b6f(0x10a)],'type':_0x568f32[_0x3e8b6f(0x105)],'status':_0x568f32['status'],'user_name':_0x568f32[_0x3e8b6f(0xc1)],'duration_sec':_0x21fec3,'created_at':_0x568f32[_0x3e8b6f(0x10b)],'started_at':_0x568f32[_0x3e8b6f(0xf2)],'end_at':_0x568f32[_0x3e8b6f(0xef)]};});return await handleSDKOutput(_0x3a8244,_0x478a8a),0x0;}catch(_0x53389c){if(_0x53389c instanceof SDKError)return console[_0x5a9a41(0xd9)](_0x5a9a41(0xe3)+_0x53389c['message']),_0x53389c[_0x5a9a41(0x109)]&&console['error'](_0x5a9a41(0xc9)+_0x53389c[_0x5a9a41(0x109)]),0x1;throw _0x53389c;}}}function a17_0x3ace(){const _0x2aeb67=['job:kill','verbose','start_at','Job\x20type:\x20','description','result','β\x20Retrieved\x20','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','kill','map','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','1125834YCFdCU','submit','Usage:\x20job\x20kill\x20<job-id>','jobs','substring','\x20jobs','Usage:\x20job\x20result\x20<job-id>','debug','Limit:\x20','292197ABZFGB','type','β\x20Found\x20','Query:\x20','Get\x20job\x20results','cause','job_id','created_at','list','Listing\x20jobs...','Show\x20job\x20details','400590xzfaOD','round','getTime','message','user_name','execute','Error:\x20Job\x20ID\x20is\x20required','250509VyCvBE','Submit\x20a\x20job','job:submit','trino','15AfAfIC','\x20\x20Cause:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','priority','job:result','jobType','Database:\x20','List\x20jobs','job:show','limit','Submitting\x20job...','Getting\x20job\x20results...','yes','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','2420988YLktgY','\x20row','length','error','Cancelled','file','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','hive','information_schema','database','status','1780196KhlVCv','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Error:\x20','name','Status\x20filter:\x20','Getting\x20job\x20details...','show','14767616QVyZmH','Submitting\x20kill\x20request...','Usage:\x20job\x20show\x20<job-id>','Kill\x20a\x20job','\x20\x20Job\x20ID:\x20','url','query','end_at'];a17_0x3ace=function(){return _0x2aeb67;};return a17_0x3ace();}export class JobShowCommand extends BaseCommand{[a17_0x318003(0xe4)]=a17_0x318003(0xd0);['description']=a17_0x318003(0xbc);async[a17_0x318003(0xc2)](_0x334d7e){const _0x42391a=a17_0x318003,{options:_0x121fbf,args:_0x528ed9,tdx:_0x1229e5}=_0x334d7e,_0x331f04=_0x528ed9[0x0];if(!_0x331f04)return console['error']('Error:\x20Job\x20ID\x20is\x20required'),console['error'](_0x42391a(0xea)),0x1;try{const _0x3dc326=await withSpinner(_0x42391a(0xe6),()=>_0x1229e5[_0x42391a(0xfe)][_0x42391a(0xe7)](_0x331f04),{'verbose':_0x121fbf[_0x42391a(0xf1)]}),_0x5b3d59=_0x3dc326['data'];let _0x28f310;if(_0x5b3d59[_0x42391a(0xf2)]&&_0x5b3d59[_0x42391a(0xef)]){const _0xfe0e05=new Date(_0x5b3d59[_0x42391a(0xf2)])['getTime'](),_0x5d296a=new Date(_0x5b3d59[_0x42391a(0xef)])[_0x42391a(0xbf)]();_0x28f310=Math['round']((_0x5d296a-_0xfe0e05)/0x3e8);}const _0x2f5aea={'job_id':_0x5b3d59[_0x42391a(0x10a)],'type':_0x5b3d59[_0x42391a(0x105)],'status':_0x5b3d59[_0x42391a(0xe0)],..._0x5b3d59['user_name']&&{'user_name':_0x5b3d59[_0x42391a(0xc1)]},..._0x28f310!==undefined&&{'duration_sec':_0x28f310},..._0x5b3d59['created_at']&&{'created_at':_0x5b3d59['created_at']},..._0x5b3d59['start_at']&&{'started_at':_0x5b3d59[_0x42391a(0xf2)]},..._0x5b3d59[_0x42391a(0xef)]&&{'end_at':_0x5b3d59['end_at']},..._0x5b3d59[_0x42391a(0xdf)]&&{'database':_0x5b3d59[_0x42391a(0xdf)]},..._0x5b3d59[_0x42391a(0xcb)]!==undefined&&{'priority':_0x5b3d59[_0x42391a(0xcb)]},..._0x5b3d59['url']&&{'url':_0x5b3d59[_0x42391a(0xed)]},..._0x5b3d59[_0x42391a(0xee)]&&{'query':_0x5b3d59['query']},..._0x5b3d59[_0x42391a(0x102)]&&{'debug':_0x5b3d59[_0x42391a(0x102)]}};return await handleSingleObjectOutput(_0x2f5aea,_0x121fbf),0x0;}catch(_0x373449){if(_0x373449 instanceof SDKError)return console['error']('Error:\x20'+_0x373449[_0x42391a(0xc0)]),_0x373449[_0x42391a(0x109)]&&console[_0x42391a(0xd9)]('\x20\x20Cause:\x20'+_0x373449[_0x42391a(0x109)]),0x1;throw _0x373449;}}}export class JobKillCommand extends BaseCommand{[a17_0x318003(0xe4)]=a17_0x318003(0xf0);[a17_0x318003(0xf4)]=a17_0x318003(0xeb);async[a17_0x318003(0xc2)](_0x4ef8fb){const _0x1cfad5=a17_0x318003,{options:_0x4601d7,args:_0x5307c2,tdx:_0x2b5aee}=_0x4ef8fb,_0x49ebfa=_0x5307c2[0x0];if(!_0x49ebfa)return console['error'](_0x1cfad5(0xc3)),console['error'](_0x1cfad5(0xfd)),0x1;try{if(!_0x4601d7[_0x1cfad5(0xd4)]){const _0x4c85d1=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x49ebfa+'?');if(!_0x4c85d1)return console[_0x1cfad5(0xd9)](_0x1cfad5(0xda)),0x0;}return await withSpinner(_0x1cfad5(0xe9),()=>_0x2b5aee['jobs'][_0x1cfad5(0xf8)](_0x49ebfa),{'verbose':_0x4601d7[_0x1cfad5(0xf1)]}),console[_0x1cfad5(0xd9)](_0x1cfad5(0xd5)+_0x49ebfa),console[_0x1cfad5(0xd9)](_0x1cfad5(0xdc)+_0x49ebfa+_0x1cfad5(0xca)),0x0;}catch(_0x5ce36b){if(_0x5ce36b instanceof SDKError)return console[_0x1cfad5(0xd9)](_0x1cfad5(0xe3)+_0x5ce36b['message']),_0x5ce36b[_0x1cfad5(0x109)]&&console[_0x1cfad5(0xd9)](_0x1cfad5(0xc9)+_0x5ce36b[_0x1cfad5(0x109)]),0x1;throw _0x5ce36b;}}}export class JobSubmitCommand extends BaseCommand{['name']=a17_0x318003(0xc6);['description']=a17_0x318003(0xc5);async[a17_0x318003(0xc2)](_0x1ae5bc){const _0x1d007c=a17_0x318003,{options:_0x4eb195,args:_0x334d4f,tdx:_0x5210b4}=_0x1ae5bc;try{const _0x1499e1=_0x4eb195[_0x1d007c(0xcd)]||_0x1d007c(0xc7),_0x5daa28=_0x4eb195[_0x1d007c(0xdb)],_0x5a0590=_0x4eb195[_0x1d007c(0xdf)]||_0x1d007c(0xde);if(_0x1499e1!=='trino'&&_0x1499e1!==_0x1d007c(0xdd))return console[_0x1d007c(0xd9)](_0x1d007c(0xfa)),0x1;let _0x50da0f;if(_0x5daa28){if(_0x334d4f[0x0])return console[_0x1d007c(0xd9)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x2ec694=readSqlStatementsFromFile(_0x5daa28);if(_0x2ec694[_0x1d007c(0xd8)]===0x0)return console['error'](_0x1d007c(0xf7)),0x1;if(_0x2ec694[_0x1d007c(0xd8)]>0x1)return console[_0x1d007c(0xd9)]('Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'),0x1;_0x50da0f=_0x2ec694[0x0];}else{if(!_0x334d4f[0x0])return console[_0x1d007c(0xd9)]('Error:\x20Query\x20is\x20required'),console[_0x1d007c(0xd9)](_0x1d007c(0xe2)),0x1;_0x50da0f=_0x334d4f[0x0];}_0x4eb195[_0x1d007c(0xf1)]&&(console[_0x1d007c(0xd9)](_0x1d007c(0xf3)+_0x1499e1),console[_0x1d007c(0xd9)](_0x1d007c(0xce)+_0x5a0590),console[_0x1d007c(0xd9)](_0x1d007c(0x107)+_0x50da0f[_0x1d007c(0xff)](0x0,0x64)+(_0x50da0f[_0x1d007c(0xd8)]>0x64?'...':'')));const _0x415446=await withSpinner(_0x1d007c(0xd2),()=>_0x5210b4[_0x1d007c(0xfe)][_0x1d007c(0xfc)](_0x5a0590,_0x50da0f,_0x1499e1),{'verbose':_0x4eb195[_0x1d007c(0xf1)]}),_0xc4f85a=_0x415446['data'];return console[_0x1d007c(0xd9)]('β\x20Job\x20submitted'),console[_0x1d007c(0xd9)](_0x1d007c(0xec)+_0xc4f85a['job_id']),await handleSDKOutput([_0xc4f85a],_0x4eb195),0x0;}catch(_0x55b602){if(_0x55b602 instanceof SDKError)return console[_0x1d007c(0xd9)](_0x1d007c(0xe3)+_0x55b602[_0x1d007c(0xc0)]),_0x55b602[_0x1d007c(0x109)]&&console[_0x1d007c(0xd9)](_0x1d007c(0xc9)+_0x55b602['cause']),0x1;throw _0x55b602;}}}export class JobResultCommand extends BaseCommand{[a17_0x318003(0xe4)]=a17_0x318003(0xcc);[a17_0x318003(0xf4)]=a17_0x318003(0x108);async[a17_0x318003(0xc2)](_0x525179){const _0x5792cd=a17_0x318003,{options:_0xe96224,args:_0x1a3190,tdx:_0x397109}=_0x525179,_0x27c405=_0x1a3190[0x0];if(!_0x27c405)return console[_0x5792cd(0xd9)](_0x5792cd(0xc3)),console[_0x5792cd(0xd9)](_0x5792cd(0x101)),0x1;try{const _0x51420d=await withSpinner(_0x5792cd(0xd3),()=>_0x397109[_0x5792cd(0xfe)][_0x5792cd(0xf5)](_0x27c405),{'verbose':_0xe96224[_0x5792cd(0xf1)]}),_0x2cba70=_0x51420d['data'];return console[_0x5792cd(0xd9)](_0x5792cd(0xf6)+_0x2cba70['length']+_0x5792cd(0xd7)+(_0x2cba70[_0x5792cd(0xd8)]!==0x1?'s':'')),await handleSDKOutput(_0x2cba70,_0xe96224),0x0;}catch(_0x3aa0a9){if(_0x3aa0a9 instanceof SDKError)return console[_0x5792cd(0xd9)](_0x5792cd(0xe3)+_0x3aa0a9[_0x5792cd(0xc0)]),_0x3aa0a9['cause']&&console['error'](_0x5792cd(0xc9)+_0x3aa0a9[_0x5792cd(0x109)]),0x1;throw _0x3aa0a9;}}}
|
|
1
|
+
function a17_0x4512(){const _0x32f3d0=['Error:\x20','Getting\x20job\x20results...','Show\x20job\x20details','49670Oprjgu','\x27\x20to\x20verify\x20the\x20job\x20status','start_at','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','url','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','message','Limit:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','created_at','kill','substring','Get\x20job\x20results','job:kill','limit','round','\x20\x20Job\x20ID:\x20','query','Submit\x20a\x20job','Error:\x20Query\x20is\x20required','β\x20Job\x20submitted','type','105987seGsPv','Usage:\x20job\x20show\x20<job-id>','show','\x20\x20Cause:\x20','Query:\x20','3378OwtJya','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','job:show','yes','\x20row','48QloSHI','data','jobs','description','debug','3990304mxdhbQ','job_id','Submitting\x20job...','β\x20Retrieved\x20','status','Listing\x20jobs...','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Usage:\x20job\x20result\x20<job-id>','492440shIirn','name','user_name','32876rLKIjk','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','\x20job','information_schema','length','priority','error','verbose','Status\x20filter:\x20','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','352gcHIeF','job:result','cause','420mmWUTH','end_at','Error:\x20Job\x20ID\x20is\x20required','job:submit','Job\x20type:\x20','execute','β\x20Found\x20','3058452DscRJz','getTime','database','93JjARvo','result'];a17_0x4512=function(){return _0x32f3d0;};return a17_0x4512();}const a17_0x407ef7=a17_0x2246;(function(_0x258586,_0x30a6b6){const _0x242dec=a17_0x2246,_0x416d1c=_0x258586();while(!![]){try{const _0x5eefe0=-parseInt(_0x242dec(0x1c0))/0x1*(-parseInt(_0x242dec(0x19e))/0x2)+-parseInt(_0x242dec(0x17d))/0x3*(-parseInt(_0x242dec(0x1b3))/0x4)+parseInt(_0x242dec(0x1b0))/0x5*(-parseInt(_0x242dec(0x1a3))/0x6)+-parseInt(_0x242dec(0x199))/0x7+parseInt(_0x242dec(0x1a8))/0x8+-parseInt(_0x242dec(0x17a))/0x9+parseInt(_0x242dec(0x182))/0xa*(parseInt(_0x242dec(0x1bd))/0xb);if(_0x5eefe0===_0x30a6b6)break;else _0x416d1c['push'](_0x416d1c['shift']());}catch(_0x539a49){_0x416d1c['push'](_0x416d1c['shift']());}}}(a17_0x4512,0x74f34));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{['name']=a17_0x407ef7(0x1a5);[a17_0x407ef7(0x1a6)]='List\x20jobs';async['execute'](_0x5c2c5c){const _0x2a85ff=a17_0x407ef7,{options:_0x4620e0,tdx:_0x8b48f8}=_0x5c2c5c;try{const _0x212077=resolveLimit(_0x4620e0[_0x2a85ff(0x191)],DEFAULT_DISPLAY_LIMIT),_0x29d041=_0x4620e0[_0x2a85ff(0x1ac)];_0x4620e0['verbose']&&(console[_0x2a85ff(0x1b9)](_0x2a85ff(0x189)+_0x212077+'\x20jobs'),_0x29d041&&console[_0x2a85ff(0x1b9)](_0x2a85ff(0x1bb)+_0x29d041));const _0xc38a38=await withSpinner(_0x2a85ff(0x1ad),()=>_0x8b48f8['jobs']['list']({'from':0x0,'to':_0x212077-0x1,'status':_0x29d041}),{'verbose':_0x4620e0[_0x2a85ff(0x1ba)]}),_0x376b2d=_0xc38a38['data'];console[_0x2a85ff(0x1b9)](_0x2a85ff(0x179)+_0x376b2d['length']+_0x2a85ff(0x1b5)+(_0x376b2d['length']!==0x1?'s':''));const _0x14a933=_0x376b2d['map'](_0x562706=>{const _0x53fb39=_0x2a85ff;let _0x52f635;if(_0x562706['start_at']&&_0x562706[_0x53fb39(0x1c1)]){const _0x40d931=new Date(_0x562706[_0x53fb39(0x184)])[_0x53fb39(0x17b)](),_0x20dd80=new Date(_0x562706['end_at'])[_0x53fb39(0x17b)]();_0x52f635=Math[_0x53fb39(0x192)]((_0x20dd80-_0x40d931)/0x3e8);}return{'job_id':_0x562706[_0x53fb39(0x1a9)],'type':_0x562706[_0x53fb39(0x198)],'status':_0x562706[_0x53fb39(0x1ac)],'user_name':_0x562706[_0x53fb39(0x1b2)],'duration_sec':_0x52f635,'created_at':_0x562706[_0x53fb39(0x18c)],'started_at':_0x562706[_0x53fb39(0x184)],'end_at':_0x562706['end_at']};});return await handleSDKOutput(_0x14a933,_0x4620e0),0x0;}catch(_0x16825){if(_0x16825 instanceof SDKError)return console[_0x2a85ff(0x1b9)]('Error:\x20'+_0x16825[_0x2a85ff(0x188)]),_0x16825[_0x2a85ff(0x1bf)]&&console[_0x2a85ff(0x1b9)](_0x2a85ff(0x19c)+_0x16825[_0x2a85ff(0x1bf)]),0x1;throw _0x16825;}}}export class JobShowCommand extends BaseCommand{[a17_0x407ef7(0x1b1)]=a17_0x407ef7(0x1a0);['description']=a17_0x407ef7(0x181);async[a17_0x407ef7(0x178)](_0x5848ec){const _0x4f9108=a17_0x407ef7,{options:_0x8fd261,args:_0x1d37cb,tdx:_0x769971}=_0x5848ec,_0x1dca61=_0x1d37cb[0x0];if(!_0x1dca61)return console[_0x4f9108(0x1b9)](_0x4f9108(0x1c2)),console['error'](_0x4f9108(0x19a)),0x1;try{const _0x57104c=await withSpinner('Getting\x20job\x20details...',()=>_0x769971['jobs'][_0x4f9108(0x19b)](_0x1dca61),{'verbose':_0x8fd261['verbose']}),_0x149213=_0x57104c['data'];let _0x376055;if(_0x149213[_0x4f9108(0x184)]&&_0x149213[_0x4f9108(0x1c1)]){const _0x39541d=new Date(_0x149213[_0x4f9108(0x184)])['getTime'](),_0x9bd20d=new Date(_0x149213[_0x4f9108(0x1c1)])[_0x4f9108(0x17b)]();_0x376055=Math[_0x4f9108(0x192)]((_0x9bd20d-_0x39541d)/0x3e8);}const _0x30fabf={'job_id':_0x149213[_0x4f9108(0x1a9)],'type':_0x149213[_0x4f9108(0x198)],'status':_0x149213[_0x4f9108(0x1ac)],..._0x149213[_0x4f9108(0x1b2)]&&{'user_name':_0x149213['user_name']},..._0x376055!==undefined&&{'duration_sec':_0x376055},..._0x149213[_0x4f9108(0x18c)]&&{'created_at':_0x149213[_0x4f9108(0x18c)]},..._0x149213[_0x4f9108(0x184)]&&{'started_at':_0x149213[_0x4f9108(0x184)]},..._0x149213[_0x4f9108(0x1c1)]&&{'end_at':_0x149213['end_at']},..._0x149213[_0x4f9108(0x17c)]&&{'database':_0x149213[_0x4f9108(0x17c)]},..._0x149213[_0x4f9108(0x1b8)]!==undefined&&{'priority':_0x149213[_0x4f9108(0x1b8)]},..._0x149213[_0x4f9108(0x186)]&&{'url':_0x149213['url']},..._0x149213['query']&&{'query':_0x149213[_0x4f9108(0x194)]},..._0x149213[_0x4f9108(0x1a7)]&&{'debug':_0x149213['debug']}};return await handleSingleObjectOutput(_0x30fabf,_0x8fd261),0x0;}catch(_0x2b962c){if(_0x2b962c instanceof SDKError)return console[_0x4f9108(0x1b9)]('Error:\x20'+_0x2b962c[_0x4f9108(0x188)]),_0x2b962c['cause']&&console[_0x4f9108(0x1b9)](_0x4f9108(0x19c)+_0x2b962c[_0x4f9108(0x1bf)]),0x1;throw _0x2b962c;}}}export class JobKillCommand extends BaseCommand{[a17_0x407ef7(0x1b1)]=a17_0x407ef7(0x190);['description']='Kill\x20a\x20job';async[a17_0x407ef7(0x178)](_0x3299a7){const _0xd4c9eb=a17_0x407ef7,{options:_0x7c0a15,args:_0x2c07dc,tdx:_0x4e14cc}=_0x3299a7,_0x473568=_0x2c07dc[0x0];if(!_0x473568)return console[_0xd4c9eb(0x1b9)](_0xd4c9eb(0x1c2)),console[_0xd4c9eb(0x1b9)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x7c0a15[_0xd4c9eb(0x1a1)]){const _0x566352=await confirm(_0xd4c9eb(0x18a)+_0x473568+'?');if(!_0x566352)return console[_0xd4c9eb(0x1b9)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x4e14cc[_0xd4c9eb(0x1a5)][_0xd4c9eb(0x18d)](_0x473568),{'verbose':_0x7c0a15[_0xd4c9eb(0x1ba)]}),console[_0xd4c9eb(0x1b9)](_0xd4c9eb(0x1bc)+_0x473568),console['error'](_0xd4c9eb(0x185)+_0x473568+_0xd4c9eb(0x183)),0x0;}catch(_0x4dae8a){if(_0x4dae8a instanceof SDKError)return console[_0xd4c9eb(0x1b9)](_0xd4c9eb(0x17f)+_0x4dae8a[_0xd4c9eb(0x188)]),_0x4dae8a[_0xd4c9eb(0x1bf)]&&console[_0xd4c9eb(0x1b9)]('\x20\x20Cause:\x20'+_0x4dae8a['cause']),0x1;throw _0x4dae8a;}}}function a17_0x2246(_0x186425,_0x265ddf){_0x186425=_0x186425-0x178;const _0x45129d=a17_0x4512();let _0x2246ae=_0x45129d[_0x186425];return _0x2246ae;}export class JobSubmitCommand extends BaseCommand{[a17_0x407ef7(0x1b1)]=a17_0x407ef7(0x1c3);[a17_0x407ef7(0x1a6)]=a17_0x407ef7(0x195);async['execute'](_0x1c8f37){const _0x3b0bfa=a17_0x407ef7,{options:_0x4c949a,args:_0x3e0147,tdx:_0x2b7ae8}=_0x1c8f37;try{const _0x2cec28=_0x4c949a['jobType']||'trino',_0x287fd1=_0x4c949a['file'],_0x2bfcd8=_0x4c949a[_0x3b0bfa(0x17c)]||_0x3b0bfa(0x1b6);if(_0x2cec28!=='trino'&&_0x2cec28!=='hive')return console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x19f)),0x1;let _0x1e00aa;if(_0x287fd1){if(_0x3e0147[0x0])return console['error'](_0x3b0bfa(0x18b)),0x1;const _0x1777a1=readSqlStatementsFromFile(_0x287fd1);if(_0x1777a1[_0x3b0bfa(0x1b7)]===0x0)return console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x187)),0x1;if(_0x1777a1[_0x3b0bfa(0x1b7)]>0x1)return console['error'](_0x3b0bfa(0x1ae)),0x1;_0x1e00aa=_0x1777a1[0x0];}else{if(!_0x3e0147[0x0])return console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x196)),console['error'](_0x3b0bfa(0x1b4)),0x1;_0x1e00aa=_0x3e0147[0x0];}_0x4c949a['verbose']&&(console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x1c4)+_0x2cec28),console['error']('Database:\x20'+_0x2bfcd8),console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x19d)+_0x1e00aa[_0x3b0bfa(0x18e)](0x0,0x64)+(_0x1e00aa['length']>0x64?'...':'')));const _0x468049=await withSpinner(_0x3b0bfa(0x1aa),()=>_0x2b7ae8[_0x3b0bfa(0x1a5)]['submit'](_0x2bfcd8,_0x1e00aa,_0x2cec28),{'verbose':_0x4c949a[_0x3b0bfa(0x1ba)]}),_0x52a147=_0x468049[_0x3b0bfa(0x1a4)];return console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x197)),console[_0x3b0bfa(0x1b9)](_0x3b0bfa(0x193)+_0x52a147[_0x3b0bfa(0x1a9)]),await handleSDKOutput([_0x52a147],_0x4c949a),0x0;}catch(_0x4fb4bb){if(_0x4fb4bb instanceof SDKError)return console[_0x3b0bfa(0x1b9)]('Error:\x20'+_0x4fb4bb[_0x3b0bfa(0x188)]),_0x4fb4bb[_0x3b0bfa(0x1bf)]&&console['error'](_0x3b0bfa(0x19c)+_0x4fb4bb['cause']),0x1;throw _0x4fb4bb;}}}export class JobResultCommand extends BaseCommand{['name']=a17_0x407ef7(0x1be);[a17_0x407ef7(0x1a6)]=a17_0x407ef7(0x18f);async[a17_0x407ef7(0x178)](_0x1aa4f1){const _0x176279=a17_0x407ef7,{options:_0x2d1fc6,args:_0x2aeafe,tdx:_0x2807d9}=_0x1aa4f1,_0x1774de=_0x2aeafe[0x0];if(!_0x1774de)return console[_0x176279(0x1b9)](_0x176279(0x1c2)),console[_0x176279(0x1b9)](_0x176279(0x1af)),0x1;try{const _0x3381ee=await withSpinner(_0x176279(0x180),()=>_0x2807d9[_0x176279(0x1a5)][_0x176279(0x17e)](_0x1774de),{'verbose':_0x2d1fc6['verbose']}),_0x28cb14=_0x3381ee[_0x176279(0x1a4)];return console['error'](_0x176279(0x1ab)+_0x28cb14['length']+_0x176279(0x1a2)+(_0x28cb14[_0x176279(0x1b7)]!==0x1?'s':'')),await handleSDKOutput(_0x28cb14,_0x2d1fc6),0x0;}catch(_0x1c03c2){if(_0x1c03c2 instanceof SDKError)return console[_0x176279(0x1b9)](_0x176279(0x17f)+_0x1c03c2[_0x176279(0x188)]),_0x1c03c2[_0x176279(0x1bf)]&&console[_0x176279(0x1b9)](_0x176279(0x19c)+_0x1c03c2[_0x176279(0x1bf)]),0x1;throw _0x1c03c2;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x22f6ba=a18_0x2e15;(function(_0x3aa6ad,_0x182538){const _0x1ccd38=a18_0x2e15,_0x151e27=_0x3aa6ad();while(!![]){try{const _0x5b9920=parseInt(_0x1ccd38(0x252))/0x1+parseInt(_0x1ccd38(0x200))/0x2*(parseInt(_0x1ccd38(0x243))/0x3)+parseInt(_0x1ccd38(0x285))/0x4*(-parseInt(_0x1ccd38(0x275))/0x5)+parseInt(_0x1ccd38(0x2a9))/0x6+parseInt(_0x1ccd38(0x249))/0x7+-parseInt(_0x1ccd38(0x1f2))/0x8+-parseInt(_0x1ccd38(0x2a6))/0x9*(-parseInt(_0x1ccd38(0x291))/0xa);if(_0x5b9920===_0x182538)break;else _0x151e27['push'](_0x151e27['shift']());}catch(_0x3bc4a7){_0x151e27['push'](_0x151e27['shift']());}}}(a18_0x5d28,0xe2bff));import a18_0x56641b from'chalk';import a18_0x4c3176 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';function a18_0x5d28(){const _0x4d7972=['repeat','reentryMode','file','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','β\x20Context\x20set:\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','cyan','412586UNjRVA','verbose','parentSegment','folderPath','Show\x20journey\x20details','activation_','resolveParentId','\x20\x20Target:\x20','message','totalEntered','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)','\x0aChanges\x20to\x20\x27','Journey\x20name:\x20','type','totalGoalAchieved','Fetching\x20connections\x20for\x20name\x20resolution...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','state','setPhase','goal','journeyBundleId','draft','resolveSegment','absolutePath','paused','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','segmentPushCommand','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','green','\x20unchanged\x20files','Input:\x20','Listing\x20journeys...','Found\x20','π\x20','Resolving\x20journey...','Cancelled','parent_segment','β\x20Pulled\x20','Error:\x20Parent\x20segment\x20context\x20required','\x20->\x20','push','Usage:\x20journey\x20pause\x20<name-or-path>','population','/j/da/je','root\x20folder','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Usage:\x20journey\x20stats\x20<name-or-path>','journey:pause','buildIdToNameMap','journey:resume','\x20files?','site','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Pattern:\x20','replace','launched','filePath','listFolders','Show\x20journey\x20statistics','goalRate','\x20(ID:\x20','getJourney','test','\x20journey\x20files\x20to\x20','segmentName','includeStats','\x0aPull\x20summary:','15qXpzyD','resourceName','archived','listJourneysFromParentSegment','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Usage:\x20journey\x20resume\x20<name-or-path>','2209585NvloVx','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','join','\x20versions)','conversionRate','\x20\x20Name:\x20','web','journey:view','description','146965tYoavw','\x20\x20Statistics\x20not\x20available','versionNumber','journeyId','yes','Pause\x20a\x20running\x20journey','journey:list','stringify','Folder\x20path:\x20','journey:pull','get','helpText','json','\x27\x20not\x20found\x20in\x20','entered','options','Getting\x20journey\x20details...','Error:\x20','parentName','\x20\x20-\x20','targetDir','Aborted.','\x5c$&','rule','audienceId','Getting\x20journey\x20statistics...','segment','relative','stages','error','/e/','stageName','/app/ps/','execute','values','4395fFxlEY','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Journey\x20\x27','Fetching\x20folders...','split','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','pause','\x20(paused)','attributes','length','List\x20journeys\x20in\x20current\x20context','\x22\x20paused','Warning:\x20Stage\x20\x22','hasChanges','utf-8','connection','5788SfOvCg','getParentFull','find','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','No\x20journeys\x20found','then','Target\x20file:\x20','journey:stats','\x20\x20Parent\x20segment:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','log','30vvcmRx','Resolving\x20parent\x20segment...','isNew','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','(root)','.yml','name','all','Error:\x20Journey\x20not\x20found:\x20','segments','β\x20Journey\x20\x22','Listing\x20folders...','INVALID_ARGUMENT','rootFolderId','Export\x20journey(s)\x20as\x20YAML\x20files','Resolved\x20YAML\x20file:\x20','cwd','map','journey','session','4759110MuwqDk','add','diff','3830706RPiJCO','\x20journey','journeyName','Parent\x20segment:\x20','yellow','gray','activationParams','Fetching\x20','connector_config','getSegment','\x20journeys','\x22\x20resumed','toLowerCase','set','red','has','errorCode','dim','data','user','\x20\x20Folder\x20path:\x20','folderId','journeyStages','table','12145808KrRQTD','filter','entries','resolveJourneyId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','format','journeyBundleName'];a18_0x5d28=function(){return _0x4d7972;};return a18_0x5d28();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function formatJourneyState(_0x1d1734){const _0x40c1c7=a18_0x2e15;switch(_0x1d1734){case _0x40c1c7(0x237):return a18_0x56641b[_0x40c1c7(0x21c)](_0x1d1734);case _0x40c1c7(0x215):return a18_0x56641b[_0x40c1c7(0x2ae)](_0x1d1734);case _0x40c1c7(0x245):return a18_0x56641b[_0x40c1c7(0x2ba)](_0x1d1734);default:return _0x1d1734;}}function formatJourneyItem(_0x5790ca,_0x22685f='',_0x120de7){const _0x4975e4=a18_0x2e15,_0x216292=formatJourneyState(_0x5790ca[_0x4975e4(0x211)]),_0x58a170=_0x5790ca['paused']?a18_0x56641b[_0x4975e4(0x2ad)](_0x4975e4(0x27c)):'',_0x45094c=_0x120de7?'\x20'+a18_0x56641b[_0x4975e4(0x1ff)](_0x120de7):'';return _0x22685f+'πΊοΈ\x20'+_0x5790ca[_0x4975e4(0x1f8)]+'\x20('+_0x216292+')'+_0x58a170+_0x45094c;}function escapeRegex(_0x1007b0){const _0x5ae31b=a18_0x2e15;return _0x1007b0[_0x5ae31b(0x236)](/[.*+?^${}()|[\]\\]/g,_0x5ae31b(0x268));}function globToRegex(_0x2106c0){const _0x5de21a=a18_0x2e15,_0x2a01c9=_0x2106c0[_0x5de21a(0x279)]('*')[_0x5de21a(0x2a3)](escapeRegex);return new RegExp(_0x2a01c9[_0x5de21a(0x24b)]('.*'),'i');}function buildRuleToNameMapping(_0x301423){const _0x1a462f=a18_0x2e15,_0x1ba842=new Map();if(_0x301423[_0x1a462f(0x29b)])for(const [_0x1e7241,_0x3cbe8a]of Object[_0x1a462f(0x1f4)](_0x301423[_0x1a462f(0x29b)])){if(_0x3cbe8a[_0x1a462f(0x269)]){const _0x461721=serializeRule(_0x3cbe8a[_0x1a462f(0x269)]),_0x4ef60d=_0x1ba842[_0x1a462f(0x25c)](_0x461721);_0x4ef60d?_0x4ef60d['push'](_0x1e7241):_0x1ba842[_0x1a462f(0x2b6)](_0x461721,[_0x1e7241]);}}return _0x1ba842;}async function resolveJourneyTarget(_0x46a7db,_0x564557,_0x146c26){const _0x2d6b54=a18_0x2e15;if(isYamlFilePath(_0x46a7db))try{const _0x543a49=await resolveYamlFilePath(_0x46a7db);return _0x146c26&&(console[_0x2d6b54(0x26f)](_0x2d6b54(0x2a1)+_0x46a7db),console['error'](_0x2d6b54(0x28d)+_0x543a49[_0x2d6b54(0x202)]),console[_0x2d6b54(0x26f)](_0x2d6b54(0x24e)+_0x543a49[_0x2d6b54(0x240)]),console[_0x2d6b54(0x26f)](_0x2d6b54(0x1ee)+(_0x543a49[_0x2d6b54(0x203)]||'(root)'))),{'journeyName':_0x543a49['segmentName'],'parentSegment':_0x543a49['parentSegment'],'resolved':_0x543a49};}catch(_0xd8b8a4){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2d6b54(0x288)+_0xd8b8a4[_0x2d6b54(0x208)]);}if(!_0x564557)throw new SDKError(ErrorCode[_0x2d6b54(0x29e)],_0x2d6b54(0x1f6));return{'journeyName':_0x46a7db,'parentSegment':_0x564557};}export class JourneyListCommand extends BaseCommand{[a18_0x22f6ba(0x298)]=a18_0x22f6ba(0x258);[a18_0x22f6ba(0x251)]=a18_0x22f6ba(0x27f);async[a18_0x22f6ba(0x273)](_0x5cb200){const _0x2dc667=a18_0x22f6ba,{options:_0x314ce7,args:_0x6d5ca3,tdx:_0x24da65}=_0x5cb200,_0x4e33ff=_0x6d5ca3[0x0],_0x40bd59=_0x314ce7[_0x2dc667(0x24f)],_0x2744f4=_0x314ce7[_0x2dc667(0x202)];if(!_0x2744f4)return console[_0x2dc667(0x26f)](_0x2dc667(0x226)),console[_0x2dc667(0x26f)](_0x2dc667(0x210)),0x1;const _0x167e20=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x24da65['segment'][_0x2dc667(0x206)](_0x2744f4),{'verbose':_0x314ce7[_0x2dc667(0x201)]}),_0x1deaf4=_0x167e20['data'];_0x314ce7[_0x2dc667(0x201)]&&(console['error'](_0x2dc667(0x2ac)+_0x2744f4+_0x2dc667(0x23c)+_0x1deaf4+')'),_0x4e33ff&&console['error'](_0x2dc667(0x235)+_0x4e33ff));const [_0x20b375,_0x32b9f2,_0x5143f2]=await Promise[_0x2dc667(0x299)]([withSpinner('Fetching\x20parent\x20segment...',()=>_0x24da65[_0x2dc667(0x26c)][_0x2dc667(0x286)](_0x1deaf4),{'verbose':_0x314ce7[_0x2dc667(0x201)]}),withSpinner(_0x2dc667(0x278),()=>_0x24da65[_0x2dc667(0x26c)][_0x2dc667(0x239)](_0x1deaf4),{'verbose':_0x314ce7[_0x2dc667(0x201)]}),withSpinner(_0x2dc667(0x21f),()=>_0x24da65['journey'][_0x2dc667(0x246)](_0x1deaf4),{'verbose':_0x314ce7[_0x2dc667(0x201)]})]),_0x591611=_0x20b375[_0x2dc667(0x1ec)],_0x5c5a30=_0x32b9f2[_0x2dc667(0x1ec)];let _0x3b4b06=_0x5143f2[_0x2dc667(0x1ec)];const _0x35d715=_0x591611[_0x2dc667(0x29f)],_0x5e585d=new Map();for(const _0xe78908 of _0x5c5a30){_0x5e585d[_0x2dc667(0x2b6)](_0xe78908['id'],_0xe78908['name']);}if(_0x4e33ff){const _0x36faa5=globToRegex(_0x4e33ff);_0x3b4b06=_0x3b4b06[_0x2dc667(0x1f3)](_0x4b81eb=>_0x36faa5[_0x2dc667(0x23e)](_0x4b81eb[_0x2dc667(0x1f8)]));}console[_0x2dc667(0x26f)]('β\x20Found\x20'+_0x3b4b06[_0x2dc667(0x27e)]+_0x2dc667(0x2aa)+(_0x3b4b06[_0x2dc667(0x27e)]!==0x1?'s':''));const _0x3ded24=_0x3adc56=>{const _0x375eae=_0x2dc667;return getConsoleNextUrl(_0x314ce7[_0x375eae(0x233)],_0x375eae(0x272)+_0x1deaf4+_0x375eae(0x270)+_0x3adc56+'/j/da');};if(_0x314ce7[_0x2dc667(0x1f7)]===_0x2dc667(0x1f1))await handleSDKOutput(_0x3b4b06,_0x314ce7);else{if(_0x314ce7['format']===_0x2dc667(0x25e)){const _0xee05a5=_0x3b4b06[_0x2dc667(0x2a3)](_0x527c7f=>({..._0x527c7f,'url':_0x3ded24(_0x527c7f['id'])}));await handleSDKOutput(_0xee05a5,_0x314ce7);}else{console[_0x2dc667(0x290)]('['+_0x2744f4+']');const _0xf05118=new Map(),_0x579913=[];for(const _0x37f7dc of _0x3b4b06){if(!_0x37f7dc[_0x2dc667(0x1ef)]||_0x37f7dc[_0x2dc667(0x1ef)]===_0x35d715)_0x579913['push'](_0x37f7dc);else{const _0x2fc82a=_0xf05118[_0x2dc667(0x25c)](_0x37f7dc[_0x2dc667(0x1ef)])||[];_0x2fc82a[_0x2dc667(0x228)](_0x37f7dc),_0xf05118[_0x2dc667(0x2b6)](_0x37f7dc[_0x2dc667(0x1ef)],_0x2fc82a);}}for(const _0x634040 of _0x579913){const _0xd21451=_0x40bd59?_0x3ded24(_0x634040['id']):undefined;console[_0x2dc667(0x290)](formatJourneyItem(_0x634040,'',_0xd21451));}for(const [_0x1b265e,_0x4dc1a9]of _0xf05118){const _0x19498a=_0x5e585d[_0x2dc667(0x25c)](_0x1b265e)||_0x1b265e;console[_0x2dc667(0x290)](_0x2dc667(0x221)+_0x19498a);for(const _0x31f106 of _0x4dc1a9){const _0x174bb1=_0x40bd59?_0x3ded24(_0x31f106['id']):undefined;console[_0x2dc667(0x290)](formatJourneyItem(_0x31f106,'\x20\x20',_0x174bb1));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a18_0x22f6ba(0x298)]=a18_0x22f6ba(0x250);['description']=a18_0x22f6ba(0x204);async[a18_0x22f6ba(0x273)](_0x4e8336){const _0x1115e8=a18_0x22f6ba,{options:_0x4eea73,args:_0x3a920c,tdx:_0x3d68c7}=_0x4e8336,_0x4ce3ae=_0x3a920c[0x0];if(!_0x4ce3ae)return console[_0x1115e8(0x26f)](_0x1115e8(0x21b)),console['error'](_0x1115e8(0x1fe)),console[_0x1115e8(0x26f)]('Options:'),console[_0x1115e8(0x26f)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x4eea73[_0x1115e8(0x201)]&&console[_0x1115e8(0x26f)](_0x1115e8(0x21e)+_0x4ce3ae);const _0x2e915b=await resolveJourneyTarget(_0x4ce3ae,_0x4eea73['parentSegment'],_0x4eea73[_0x1115e8(0x201)]),_0x5ebbf0=await withSpinner(_0x1115e8(0x292),()=>_0x3d68c7[_0x1115e8(0x26c)][_0x1115e8(0x206)](_0x2e915b[_0x1115e8(0x202)]),{'verbose':_0x4eea73[_0x1115e8(0x201)]}),_0x167ac7=_0x5ebbf0[_0x1115e8(0x1ec)],_0x301a86=await withSpinner('Resolving\x20journey...',()=>_0x3d68c7[_0x1115e8(0x2a4)][_0x1115e8(0x1f5)](_0x167ac7,_0x2e915b[_0x1115e8(0x2ab)]),{'verbose':_0x4eea73[_0x1115e8(0x201)]}),_0x33317b=_0x301a86[_0x1115e8(0x1ec)];if(_0x4eea73[_0x1115e8(0x24f)]){const _0x47cba6=getConsoleNextUrl(_0x4eea73[_0x1115e8(0x233)],'/app/ps/'+_0x167ac7+'/e/'+_0x33317b+_0x1115e8(0x22b));return console[_0x1115e8(0x26f)](a18_0x56641b['green']('β')+'\x20Opening\x20'+a18_0x56641b[_0x1115e8(0x1ff)](_0x47cba6)),openBrowser(_0x47cba6),0x0;}const _0x5a57fa=await withSpinner(_0x1115e8(0x262),()=>_0x3d68c7['journey'][_0x1115e8(0x23d)](_0x33317b),{'verbose':_0x4eea73[_0x1115e8(0x201)]}),_0x280ed=_0x5a57fa['data'],_0x114d1a=_0x4eea73[_0x1115e8(0x241)];let _0x29d3c7;if(_0x114d1a)try{const _0x488d9b=await withSpinner(_0x1115e8(0x26b),()=>_0x3d68c7[_0x1115e8(0x2a4)]['getStatistics'](_0x33317b),{'verbose':_0x4eea73[_0x1115e8(0x201)]});_0x29d3c7=_0x488d9b[_0x1115e8(0x1ec)];}catch{_0x4eea73[_0x1115e8(0x201)]&&console['error'](_0x1115e8(0x253));}const _0x69a05a=getConsoleNextUrl(_0x4eea73[_0x1115e8(0x233)],_0x1115e8(0x272)+_0x167ac7+_0x1115e8(0x270)+_0x33317b+'/j/da/je'),_0x39f09d={'id':_0x280ed['id'],'name':_0x280ed[_0x1115e8(0x27d)][_0x1115e8(0x298)],'description':_0x280ed['attributes'][_0x1115e8(0x251)],'state':_0x280ed['attributes']['state'],'paused':_0x280ed[_0x1115e8(0x27d)][_0x1115e8(0x218)],'reentry_mode':_0x280ed[_0x1115e8(0x27d)][_0x1115e8(0x1fa)],'stages':_0x280ed[_0x1115e8(0x27d)][_0x1115e8(0x1f0)]?.['length']||0x0,..._0x280ed[_0x1115e8(0x27d)][_0x1115e8(0x213)]&&{'goal':_0x280ed[_0x1115e8(0x27d)]['goal'][_0x1115e8(0x298)]},..._0x29d3c7&&{'statistics':{'total_entered':_0x29d3c7[_0x1115e8(0x209)],'goal_achieved':_0x29d3c7[_0x1115e8(0x20e)],'goal_rate':_0x29d3c7['goalRate'],'stages':_0x29d3c7[_0x1115e8(0x26e)]}},'url':_0x69a05a};return await handleSingleObjectOutput(_0x39f09d,_0x4eea73),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x22f6ba(0x298)]=a18_0x22f6ba(0x28c);['description']=a18_0x22f6ba(0x23a);async['execute'](_0x210962){const _0x16e169=a18_0x22f6ba,{options:_0x165326,args:_0x4378bf,tdx:_0x19ceee}=_0x210962,_0x328ab7=_0x4378bf[0x0];if(!_0x328ab7)return console['error'](_0x16e169(0x21b)),console[_0x16e169(0x26f)](_0x16e169(0x22e)),0x1;_0x165326[_0x16e169(0x201)]&&console[_0x16e169(0x26f)](_0x16e169(0x21e)+_0x328ab7);const _0x17c3b6=await resolveJourneyTarget(_0x328ab7,_0x165326[_0x16e169(0x202)],_0x165326['verbose']),_0x2885f1=await withSpinner(_0x16e169(0x292),()=>_0x19ceee[_0x16e169(0x26c)][_0x16e169(0x206)](_0x17c3b6[_0x16e169(0x202)]),{'verbose':_0x165326[_0x16e169(0x201)]}),_0x44e724=_0x2885f1[_0x16e169(0x1ec)],_0x58b6c3=await withSpinner(_0x16e169(0x222),()=>_0x19ceee[_0x16e169(0x2a4)][_0x16e169(0x1f5)](_0x44e724,_0x17c3b6[_0x16e169(0x2ab)]),{'verbose':_0x165326['verbose']}),_0x3c5c2a=_0x58b6c3[_0x16e169(0x1ec)],_0x18ccb0=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x19ceee[_0x16e169(0x2a4)]['getStatistics'](_0x3c5c2a),{'verbose':_0x165326[_0x16e169(0x201)]}),_0x51d226=_0x18ccb0[_0x16e169(0x1ec)];if(!_0x51d226||_0x51d226[_0x16e169(0x255)]===null)return console[_0x16e169(0x26f)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x17c3b6[_0x16e169(0x2ab)]),console[_0x16e169(0x26f)](_0x16e169(0x294)),0x0;const _0x31cc0e={'journey_id':_0x51d226['journeyId'],'total_entered':_0x51d226[_0x16e169(0x209)],'goal_achieved':_0x51d226[_0x16e169(0x20e)],'goal_rate':_0x51d226[_0x16e169(0x23b)],'stages':_0x51d226[_0x16e169(0x26e)]?.[_0x16e169(0x2a3)](_0x36462a=>({'name':_0x36462a[_0x16e169(0x271)],'population':_0x36462a['population'],'entered':_0x36462a[_0x16e169(0x260)],'exited':_0x36462a['exited'],'conversion_rate':_0x36462a[_0x16e169(0x24d)]}))},_0x392947=_0x165326['stage'];if(_0x392947&&_0x51d226['stages']){const _0x3223de=_0x51d226[_0x16e169(0x26e)][_0x16e169(0x287)](_0x272604=>_0x272604[_0x16e169(0x271)][_0x16e169(0x2b5)]()===_0x392947[_0x16e169(0x2b5)]());if(_0x3223de)return await handleSingleObjectOutput({'stage_name':_0x3223de[_0x16e169(0x271)],'population':_0x3223de[_0x16e169(0x22a)],'entered':_0x3223de[_0x16e169(0x260)],'exited':_0x3223de['exited'],'conversion_rate':_0x3223de[_0x16e169(0x24d)]},_0x165326),0x0;console[_0x16e169(0x26f)](_0x16e169(0x281)+_0x392947+'\x22\x20not\x20found');}return await handleSingleObjectOutput(_0x31cc0e,_0x165326),0x0;}}export class JourneyPauseCommand extends BaseCommand{['name']=a18_0x22f6ba(0x22f);['description']=a18_0x22f6ba(0x257);async[a18_0x22f6ba(0x273)](_0x4d6440){const _0x315586=a18_0x22f6ba,{options:_0x332cc6,args:_0x4f0300,tdx:_0x168b93}=_0x4d6440,_0x4358aa=_0x4f0300[0x0];if(!_0x4358aa)return console['error'](_0x315586(0x21b)),console[_0x315586(0x26f)](_0x315586(0x229)),0x1;_0x332cc6[_0x315586(0x201)]&&console[_0x315586(0x26f)](_0x315586(0x21e)+_0x4358aa);const _0x3b2e92=await resolveJourneyTarget(_0x4358aa,_0x332cc6[_0x315586(0x202)],_0x332cc6[_0x315586(0x201)]),_0x2fee22=await withSpinner(_0x315586(0x292),()=>_0x168b93[_0x315586(0x26c)][_0x315586(0x206)](_0x3b2e92[_0x315586(0x202)]),{'verbose':_0x332cc6[_0x315586(0x201)]}),_0x57c242=_0x2fee22[_0x315586(0x1ec)],_0x3642fd=await withSpinner(_0x315586(0x222),()=>_0x168b93['journey']['resolveJourneyId'](_0x57c242,_0x3b2e92['journeyName']),{'verbose':_0x332cc6[_0x315586(0x201)]}),_0x2bf4c4=_0x3642fd[_0x315586(0x1ec)];if(!_0x332cc6[_0x315586(0x256)]){const _0x42cc84=await confirm(_0x315586(0x22d)+_0x3b2e92[_0x315586(0x2ab)]+'\x22?');if(!_0x42cc84)return console[_0x315586(0x26f)](_0x315586(0x223)),0x0;}const _0x188eb9=await withSpinner('Pausing\x20journey...',()=>_0x168b93['journey'][_0x315586(0x27b)](_0x2bf4c4),{'verbose':_0x332cc6['verbose']}),_0x468a48=_0x188eb9[_0x315586(0x1ec)];return console['error']('β\x20Journey\x20\x22'+_0x468a48[_0x315586(0x27d)]['name']+_0x315586(0x280)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x22f6ba(0x298)]=a18_0x22f6ba(0x231);[a18_0x22f6ba(0x251)]='Resume\x20a\x20paused\x20journey';async[a18_0x22f6ba(0x273)](_0x50413b){const _0x5a5d1d=a18_0x22f6ba,{options:_0x3f917e,args:_0x3d4aa2,tdx:_0x1cf3c9}=_0x50413b,_0x3daeda=_0x3d4aa2[0x0];if(!_0x3daeda)return console['error'](_0x5a5d1d(0x21b)),console[_0x5a5d1d(0x26f)](_0x5a5d1d(0x248)),0x1;_0x3f917e['verbose']&&console[_0x5a5d1d(0x26f)](_0x5a5d1d(0x21e)+_0x3daeda);const _0x3d0ee6=await resolveJourneyTarget(_0x3daeda,_0x3f917e[_0x5a5d1d(0x202)],_0x3f917e['verbose']),_0x14544d=await withSpinner(_0x5a5d1d(0x292),()=>_0x1cf3c9['segment'][_0x5a5d1d(0x206)](_0x3d0ee6[_0x5a5d1d(0x202)]),{'verbose':_0x3f917e[_0x5a5d1d(0x201)]}),_0xf0e9c8=_0x14544d[_0x5a5d1d(0x1ec)],_0x2aec39=await withSpinner(_0x5a5d1d(0x222),()=>_0x1cf3c9['journey']['resolveJourneyId'](_0xf0e9c8,_0x3d0ee6['journeyName']),{'verbose':_0x3f917e[_0x5a5d1d(0x201)]}),_0x3bb33c=_0x2aec39['data'];if(!_0x3f917e[_0x5a5d1d(0x256)]){const _0xf00542=await confirm(_0x5a5d1d(0x24a)+_0x3d0ee6[_0x5a5d1d(0x2ab)]+'\x22?');if(!_0xf00542)return console['error'](_0x5a5d1d(0x223)),0x0;}const _0x293491=await withSpinner('Resuming\x20journey...',()=>_0x1cf3c9['journey']['resume'](_0x3bb33c),{'verbose':_0x3f917e[_0x5a5d1d(0x201)]}),_0x23a90c=_0x293491[_0x5a5d1d(0x1ec)];return console[_0x5a5d1d(0x26f)](_0x5a5d1d(0x29c)+_0x23a90c[_0x5a5d1d(0x27d)]['name']+_0x5a5d1d(0x2b4)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a18_0x22f6ba(0x298)]=a18_0x22f6ba(0x25b);[a18_0x22f6ba(0x251)]=a18_0x22f6ba(0x2a0);async[a18_0x22f6ba(0x273)](_0x395f93){const _0x1fb5cc=a18_0x22f6ba,{options:_0x5c1328,args:_0x522a92,tdx:_0x434631}=_0x395f93,_0x53e15c=_0x5c1328,_0x15a954=_0x522a92[0x0],_0x4d7e27=_0x15a954&&isYamlFilePath(_0x15a954),_0x11b9be=await resolveTarget({'arg':_0x4d7e27?_0x15a954:undefined,'contextParent':_0x5c1328[_0x1fb5cc(0x202)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x11b9be))return _0x11b9be[_0x1fb5cc(0x2b9)]==='no_parent'?(console[_0x1fb5cc(0x26f)](a18_0x56641b[_0x1fb5cc(0x2ad)](_0x1fb5cc(0x276))),console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x20a)),console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x219)),console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x28f)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x1fb5cc(0x26f)](a18_0x56641b[_0x1fb5cc(0x2b7)](_0x1fb5cc(0x263)+_0x11b9be['message']+'\x0a')),_0x11b9be[_0x1fb5cc(0x25d)]&&console['error'](a18_0x56641b[_0x1fb5cc(0x1ff)](_0x11b9be[_0x1fb5cc(0x25d)]))),0x1;let _0x34d21f=_0x4d7e27?undefined:_0x15a954,_0x38a481,_0x587a65;_0x11b9be[_0x1fb5cc(0x20d)]===_0x1fb5cc(0x1fb)&&(_0x34d21f=_0x11b9be[_0x1fb5cc(0x244)],_0x38a481=_0x11b9be[_0x1fb5cc(0x238)],_0x587a65=_0x11b9be[_0x1fb5cc(0x203)]);const _0x4b8f39=_0x11b9be[_0x1fb5cc(0x264)],_0x3e007c=_0x11b9be[_0x1fb5cc(0x266)];_0x53e15c[_0x1fb5cc(0x201)]&&(console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x2ac)+_0x4b8f39),console[_0x1fb5cc(0x26f)]('Target\x20directory:\x20'+_0x3e007c),_0x34d21f&&console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x20c)+_0x34d21f),_0x38a481&&console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x28b)+_0x38a481),_0x587a65&&console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x25a)+_0x587a65));const _0x300b4c=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x434631[_0x1fb5cc(0x26c)][_0x1fb5cc(0x206)](_0x4b8f39),{'verbose':_0x5c1328[_0x1fb5cc(0x201)]}),_0x3c4fdb=_0x300b4c[_0x1fb5cc(0x1ec)],[_0xac00a2,_0x1c8c39]=await Promise[_0x1fb5cc(0x299)]([withSpinner(_0x1fb5cc(0x21f),()=>_0x434631[_0x1fb5cc(0x2a4)][_0x1fb5cc(0x246)](_0x3c4fdb),{'verbose':_0x5c1328[_0x1fb5cc(0x201)]}),withSpinner(_0x1fb5cc(0x29d),()=>_0x434631[_0x1fb5cc(0x26c)]['listFolders'](_0x3c4fdb),{'verbose':_0x5c1328[_0x1fb5cc(0x201)]})]);let _0x61a681=_0xac00a2[_0x1fb5cc(0x1ec)];const _0x5a156a=_0x1c8c39[_0x1fb5cc(0x1ec)],_0x4641dd=buildFolderIdToPathMap(_0x5a156a);if(_0x34d21f){const _0x4865f3=_0x61a681[_0x1fb5cc(0x1f3)](_0x42cf90=>_0x42cf90[_0x1fb5cc(0x1f8)][_0x1fb5cc(0x2b5)]()===_0x34d21f[_0x1fb5cc(0x2b5)]());if(_0x4865f3[_0x1fb5cc(0x27e)]===0x0)return console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x29a)+_0x34d21f),console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x1fc)),0x1;_0x61a681=_0x4865f3;}if(_0x587a65!==undefined){const _0x2b3fff=_0x61a681['filter'](_0x315c02=>{const _0x239e04=_0x1fb5cc,_0x1c6707=_0x315c02[_0x239e04(0x1ef)]?_0x4641dd[_0x239e04(0x25c)](_0x315c02[_0x239e04(0x1ef)])||'':'';return _0x1c6707===_0x587a65;});if(_0x2b3fff[_0x1fb5cc(0x27e)]===0x0&&_0x61a681[_0x1fb5cc(0x27e)]>0x0){console['error'](_0x1fb5cc(0x277)+_0x34d21f+_0x1fb5cc(0x25f)+(_0x587a65||_0x1fb5cc(0x22c))),console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x295));for(const _0x37897a of _0x61a681){const _0x57ba3e=_0x37897a[_0x1fb5cc(0x1ef)]?_0x4641dd[_0x1fb5cc(0x25c)](_0x37897a[_0x1fb5cc(0x1ef)])||'':'';console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x265)+(_0x57ba3e||_0x1fb5cc(0x296))+'/'+_0x37897a[_0x1fb5cc(0x1f8)]);}return 0x1;}_0x61a681=_0x2b3fff;}if(_0x61a681[_0x1fb5cc(0x27e)]===0x0)return console['error'](_0x1fb5cc(0x289)),0x0;const _0x20bb8f=new Map();for(const _0x197517 of _0x61a681){const _0x2b9959=_0x197517[_0x1fb5cc(0x214)];!_0x20bb8f[_0x1fb5cc(0x2b8)](_0x2b9959)&&_0x20bb8f[_0x1fb5cc(0x2b6)](_0x2b9959,[]),_0x20bb8f[_0x1fb5cc(0x25c)](_0x2b9959)[_0x1fb5cc(0x228)](_0x197517);}for(const _0x26166b of _0x20bb8f[_0x1fb5cc(0x274)]()){_0x26166b['sort']((_0x2cceab,_0x7305b2)=>(_0x2cceab[_0x1fb5cc(0x254)]||0x0)-(_0x7305b2[_0x1fb5cc(0x254)]||0x0));}const _0x34bd97=[],[_0x5ddc2b,_0x4efff6]=await Promise['all']([withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x434631[_0x1fb5cc(0x1ed)]['buildIdToEmailMap'](),{'verbose':_0x5c1328[_0x1fb5cc(0x201)]})[_0x1fb5cc(0x28a)](_0x29ae14=>_0x29ae14[_0x1fb5cc(0x1ec)]),withSpinner(_0x1fb5cc(0x20f),()=>_0x434631[_0x1fb5cc(0x284)][_0x1fb5cc(0x230)](),{'verbose':_0x5c1328[_0x1fb5cc(0x201)]})[_0x1fb5cc(0x28a)](_0x49ef2a=>_0x49ef2a[_0x1fb5cc(0x1ec)])]);for(const _0x19d358 of _0x20bb8f[_0x1fb5cc(0x274)]()){const _0x1b01f1=_0x19d358[0x0]['journeyBundleName'],_0x29e4a2=_0x19d358[0x0][_0x1fb5cc(0x1ef)],_0x223340=_0x29e4a2?_0x4641dd[_0x1fb5cc(0x25c)](_0x29e4a2)||'':'',_0x4de795=_0x223340?a18_0x4c3176['join'](_0x3e007c,_0x223340):_0x3e007c,_0x229662=_0x38a481||a18_0x4c3176['join'](_0x4de795,sanitizeFileName(_0x1b01f1)+_0x1fb5cc(0x297));let _0x19325f,_0x4fa21b;if(existsSync(_0x229662))try{const _0x24cee7=readFileSync(_0x229662,_0x1fb5cc(0x283)),_0x4d8797=parseYamlString(_0x24cee7);_0x4fa21b=_0x4d8797,_0x19325f=buildRuleToNameMapping(_0x4d8797),_0x53e15c['verbose']&&_0x19325f['size']>0x0&&console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x220)+_0x19325f['size']+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x1b01f1);}catch(_0x1fdaea){_0x53e15c['verbose']&&console['error'](_0x1fb5cc(0x27a)+_0x1fdaea[_0x1fb5cc(0x208)]);}const _0x5ab58a=[],_0x592c64=new Set(),_0x2a5d82=new Map(),_0x4ae18a=new Map(),_0x35c852=new Set(),_0x38ce6c=new Map(),_0x29874e=new Map(),_0x1f6f0d=createJumpTargetCache();await withProgressSpinner(_0x1fb5cc(0x2b0)+_0x1b01f1+'...',async _0x4d8397=>{const _0x263630=_0x1fb5cc;for(const _0x3c93ce of _0x19d358){const _0x38db70=_0x19d358['length']>0x1?_0x3c93ce[_0x263630(0x1f8)]+'\x20v'+(_0x3c93ce['versionNumber']||0x1):_0x3c93ce[_0x263630(0x1f8)];_0x4d8397[_0x263630(0x212)]('Fetching\x20'+_0x38db70);const _0x4a9aa3=await _0x434631[_0x263630(0x2a4)][_0x263630(0x23d)](_0x3c93ce['id']),_0x24007a=_0x4a9aa3['attributes']?.[_0x263630(0x26a)],_0x5947a2={'resolveSegment':async _0x7cea2f=>{const _0x2f6fbb=_0x263630;if(!_0x24007a)return{'name':_0x7cea2f,'isJourneyLocal':![]};const _0x7040e=_0x2a5d82[_0x2f6fbb(0x25c)](_0x7cea2f);if(_0x7040e)return _0x7040e;try{const _0x2d46b9=await _0x434631[_0x2f6fbb(0x26c)][_0x2f6fbb(0x2b2)](_0x24007a,_0x7cea2f),_0x2e8fc7=_0x2d46b9['kind']===SEGMENT_KIND_JOURNEY;let _0x2c5322,_0x458e00=_0x2d46b9[_0x2f6fbb(0x298)];if(_0x2e8fc7&&_0x2d46b9[_0x2f6fbb(0x269)]){const _0x5c7f23=await segmentResponseToDef(_0x2d46b9,{'resolveSegmentName':async _0x30da65=>{const _0x20b4fa=_0x2f6fbb,_0x36f60a=_0x2a5d82[_0x20b4fa(0x25c)](_0x30da65);if(_0x36f60a)return _0x36f60a[_0x20b4fa(0x298)];const _0x199c89=await _0x5947a2[_0x20b4fa(0x216)](_0x30da65);return _0x199c89[_0x20b4fa(0x298)];}}),_0x11f9b9=_0x5c7f23[_0x2f6fbb(0x269)];_0x2c5322={'description':_0x2d46b9[_0x2f6fbb(0x251)],'rule':_0x11f9b9};const _0x3da825=serializeRule(_0x11f9b9),_0x29a814=_0x4ae18a[_0x2f6fbb(0x25c)](_0x3da825);if(_0x29a814)_0x458e00=_0x29a814,_0x2c5322=undefined,_0x53e15c['verbose']&&console[_0x2f6fbb(0x26f)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x2d46b9[_0x2f6fbb(0x298)]+_0x2f6fbb(0x227)+_0x29a814);else{let _0x247b78=![];if(_0x19325f){const _0x3b0f34=_0x19325f[_0x2f6fbb(0x25c)](_0x3da825);if(_0x3b0f34){const _0x2e8c85=_0x3b0f34[_0x2f6fbb(0x287)](_0x3268ba=>!_0x592c64['has'](_0x3268ba));_0x2e8c85&&(_0x458e00=_0x2e8c85,_0x592c64[_0x2f6fbb(0x2a7)](_0x2e8c85),_0x4ae18a[_0x2f6fbb(0x2b6)](_0x3da825,_0x2e8c85),_0x247b78=!![],_0x53e15c[_0x2f6fbb(0x201)]&&console[_0x2f6fbb(0x26f)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x2e8c85+'\x20(rule\x20match)'));}}if(!_0x247b78){const _0x5bf400=generateJourneyLocalName(_0x2d46b9['name']);_0x5bf400&&(_0x458e00=_0x5bf400);let _0x6e6034=_0x458e00,_0x4858b5=0x2;while(_0x592c64[_0x2f6fbb(0x2b8)](_0x6e6034)){_0x6e6034=_0x458e00+'_'+_0x4858b5,_0x4858b5++;}_0x592c64[_0x2f6fbb(0x2a7)](_0x6e6034),_0x4ae18a[_0x2f6fbb(0x2b6)](_0x3da825,_0x6e6034),_0x458e00=_0x6e6034;}}}const _0x22b022={'name':_0x458e00,'isJourneyLocal':_0x2e8fc7,'definition':_0x2c5322};return _0x2a5d82[_0x2f6fbb(0x2b6)](_0x7cea2f,_0x22b022),_0x22b022;}catch(_0xb36e0){return _0x5c1328[_0x2f6fbb(0x201)]&&console[_0x2f6fbb(0x26f)](_0x2f6fbb(0x234)+_0x7cea2f+':\x20'+_0xb36e0[_0x2f6fbb(0x208)]),{'name':_0x7cea2f,'isJourneyLocal':![]};}},'resolveActivation':async _0x6366e0=>{const _0x44fc54=_0x263630,_0x459d4d=_0x38ce6c['get'](_0x6366e0);if(_0x459d4d)return _0x459d4d;try{const _0x1d3a08=await _0x434631[_0x44fc54(0x2a4)]['getActivation'](_0x3c93ce['id'],_0x6366e0),_0x4232d6=journeyActivationStepToYaml(_0x1d3a08,_0x5ddc2b,_0x4efff6),_0x58f622=JSON[_0x44fc54(0x259)]({'name':_0x4232d6['name'],'connection':_0x4232d6[_0x44fc54(0x284)],'connector_config':_0x4232d6[_0x44fc54(0x2b1)]}),_0x4487fa=_0x29874e['get'](_0x58f622);if(_0x4487fa){const _0x3d2c63={'name':_0x4487fa,'isJourneyLocal':!![],'definition':_0x4232d6};return _0x38ce6c[_0x44fc54(0x2b6)](_0x6366e0,_0x3d2c63),_0x3d2c63;}const _0x4b70a3=_0x1d3a08['attributes'][_0x44fc54(0x2af)][_0x44fc54(0x298)]||_0x6366e0,_0x4f3d11=sanitizeYamlKey(_0x4b70a3)||_0x44fc54(0x205)+_0x6366e0;let _0x571bde=_0x4f3d11,_0x4a0524=0x2;while(_0x35c852[_0x44fc54(0x2b8)](_0x571bde)){_0x571bde=_0x4f3d11+'_'+_0x4a0524,_0x4a0524++;}_0x35c852[_0x44fc54(0x2a7)](_0x571bde),_0x29874e[_0x44fc54(0x2b6)](_0x58f622,_0x571bde);const _0x2a75e5={'name':_0x571bde,'isJourneyLocal':!![],'definition':_0x4232d6};return _0x38ce6c['set'](_0x6366e0,_0x2a75e5),_0x2a75e5;}catch(_0x7c1ffa){return _0x5c1328[_0x44fc54(0x201)]&&console['error'](_0x44fc54(0x28e)+_0x6366e0+':\x20'+_0x7c1ffa[_0x44fc54(0x208)]),{'name':_0x6366e0,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x40d2b6,_0x50e0e5)=>{const _0x47165d=_0x263630;return resolveJumpTarget(_0x40d2b6,_0x50e0e5,_0x1f6f0d,_0x4ca445=>_0x434631[_0x47165d(0x2a4)][_0x47165d(0x23d)](_0x4ca445));}},_0x59f4be=await journeyResponseToDef(_0x4a9aa3,_0x5947a2);_0x5ab58a[_0x263630(0x228)]({'item':_0x3c93ce,'yaml':_0x59f4be});}},{'verbose':_0x5c1328[_0x1fb5cc(0x201)]});const _0x413e98=buildMergedJourneyDef(_0x5ab58a,_0x19325f),_0x261bc8=normalizeJourneyDef(_0x413e98,_0x4fa21b),_0x41352a=toYamlString(_0x261bc8),_0x3db3b1=_0x38a481||a18_0x4c3176[_0x1fb5cc(0x24b)](_0x4de795,sanitizeFileName(_0x1b01f1)+'.yml');!_0x38a481&&_0x223340&&!existsSync(_0x4de795)&&mkdirSync(_0x4de795,{'recursive':!![]});const _0x14b208=a18_0x4c3176[_0x1fb5cc(0x26d)](process[_0x1fb5cc(0x2a2)](),_0x3db3b1);if(existsSync(_0x3db3b1)){const _0x41f72f=readFileSync(_0x3db3b1,_0x1fb5cc(0x283)),_0x17ff5b=generateDiff(_0x41f72f,_0x41352a),_0x565ee4=hasChanges(_0x17ff5b);_0x34bd97[_0x1fb5cc(0x228)]({'relativePath':_0x14b208,'absolutePath':_0x3db3b1,'content':_0x41352a,'isNew':![],'hasChanges':_0x565ee4,'diff':_0x565ee4?formatDiffWithColors(_0x17ff5b):undefined});}else _0x34bd97[_0x1fb5cc(0x228)]({'relativePath':_0x14b208,'absolutePath':_0x3db3b1,'content':_0x41352a,'isNew':!![],'hasChanges':![]});}const _0x2c1867=_0x34bd97['filter'](_0x1a4e94=>_0x1a4e94[_0x1fb5cc(0x293)]),_0x5eda65=_0x34bd97['filter'](_0x556c61=>!_0x556c61[_0x1fb5cc(0x293)]&&_0x556c61['hasChanges']),_0x5e979d=_0x34bd97[_0x1fb5cc(0x1f3)](_0x177708=>!_0x177708['isNew']&&!_0x177708[_0x1fb5cc(0x282)]),_0x16fa88=_0x61a681[_0x1fb5cc(0x27e)],_0x4628b2=_0x20bb8f['size'],_0x503b13=_0x16fa88>_0x4628b2?'\x20('+_0x16fa88+_0x1fb5cc(0x24c):'';console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x242)),console[_0x1fb5cc(0x26f)]('\x20\x20'+a18_0x56641b['cyan'](_0x4628b2+_0x1fb5cc(0x2b3))+a18_0x56641b[_0x1fb5cc(0x2ba)](_0x503b13)),console[_0x1fb5cc(0x26f)]('\x20\x20'+a18_0x56641b[_0x1fb5cc(0x21c)]('+\x20'+_0x2c1867[_0x1fb5cc(0x27e)]+'\x20new\x20files')),console[_0x1fb5cc(0x26f)]('\x20\x20'+a18_0x56641b[_0x1fb5cc(0x2ad)]('~\x20'+_0x5eda65[_0x1fb5cc(0x27e)]+'\x20changed\x20files')),console[_0x1fb5cc(0x26f)]('\x20\x20'+a18_0x56641b[_0x1fb5cc(0x2ba)]('=\x20'+_0x5e979d[_0x1fb5cc(0x27e)]+_0x1fb5cc(0x21d))),console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x207)+a18_0x56641b[_0x1fb5cc(0x1ff)](_0x3e007c)+'\x0a');if(_0x5eda65[_0x1fb5cc(0x27e)]>0x0)for(const _0x147b35 of _0x5eda65){console[_0x1fb5cc(0x26f)](_0x1fb5cc(0x20b)+_0x147b35['relativePath']+'\x27:'),console[_0x1fb5cc(0x26f)]('β'['repeat'](0x3c)),console[_0x1fb5cc(0x26f)](_0x147b35[_0x1fb5cc(0x2a8)]),console['error']('β'[_0x1fb5cc(0x1f9)](0x3c));}if(_0x53e15c['dryRun'])return console[_0x1fb5cc(0x26f)](a18_0x56641b[_0x1fb5cc(0x2ad)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2c1867[_0x1fb5cc(0x27e)]===0x0&&_0x5eda65[_0x1fb5cc(0x27e)]===0x0)return console[_0x1fb5cc(0x26f)](a18_0x56641b[_0x1fb5cc(0x21c)]('β\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x4b8f39},_0x53e15c[_0x1fb5cc(0x2a5)]),console['error'](a18_0x56641b[_0x1fb5cc(0x21c)](_0x1fb5cc(0x1fd)+a18_0x56641b[_0x1fb5cc(0x2ba)](_0x1fb5cc(0x224))+'\x20=\x20'+a18_0x56641b['cyan'](_0x4b8f39))),0x0;if(!_0x53e15c[_0x1fb5cc(0x256)]&&(_0x2c1867[_0x1fb5cc(0x27e)]>0x0||_0x5eda65[_0x1fb5cc(0x27e)]>0x0)){const _0x162e34=await confirmKey('Write\x20'+(_0x2c1867[_0x1fb5cc(0x27e)]+_0x5eda65[_0x1fb5cc(0x27e)])+_0x1fb5cc(0x232));if(!_0x162e34)return console['error'](_0x1fb5cc(0x267)),0x1;}!existsSync(_0x3e007c)&&mkdirSync(_0x3e007c,{'recursive':!![]});for(const _0x30716b of _0x34bd97){(_0x30716b['isNew']||_0x30716b[_0x1fb5cc(0x282)])&&writeFileSync(_0x30716b[_0x1fb5cc(0x217)],_0x30716b['content'],_0x1fb5cc(0x283));}return console[_0x1fb5cc(0x26f)](a18_0x56641b[_0x1fb5cc(0x21c)](_0x1fb5cc(0x225)+(_0x2c1867[_0x1fb5cc(0x27e)]+_0x5eda65[_0x1fb5cc(0x27e)])+_0x1fb5cc(0x23f)+_0x3e007c)),saveSessionContext({'parent_segment':_0x4b8f39},_0x53e15c[_0x1fb5cc(0x2a5)]),console['error'](a18_0x56641b[_0x1fb5cc(0x21c)](_0x1fb5cc(0x1fd)+a18_0x56641b[_0x1fb5cc(0x2ba)]('parent_segment')+'\x20=\x20'+a18_0x56641b[_0x1fb5cc(0x1ff)](_0x4b8f39))),0x0;}}function a18_0x2e15(_0x4ec598,_0x1e284a){_0x4ec598=_0x4ec598-0x1ec;const _0x5d285b=a18_0x5d28();let _0x2e15a3=_0x5d285b[_0x4ec598];return _0x2e15a3;}export class JourneyPushCommand extends BaseCommand{['name']='journey:push';[a18_0x22f6ba(0x251)]=a18_0x22f6ba(0x247);[a18_0x22f6ba(0x21a)]=new SegmentPushCommand();async['execute'](_0x4f965e){const _0x1c99e5=a18_0x22f6ba,_0x479121={..._0x4f965e,'options':{..._0x4f965e[_0x1c99e5(0x261)],'journeysOnly':!![]}};return this[_0x1c99e5(0x21a)][_0x1c99e5(0x273)](_0x479121);}}
|
|
1
|
+
const a18_0x1f87e3=a18_0x61b5;(function(_0x1e6c7d,_0x1419c4){const _0x27cc0d=a18_0x61b5,_0x5d7756=_0x1e6c7d();while(!![]){try{const _0x3e4bfe=-parseInt(_0x27cc0d(0x7b))/0x1*(parseInt(_0x27cc0d(0x79))/0x2)+parseInt(_0x27cc0d(0x82))/0x3+parseInt(_0x27cc0d(0x9d))/0x4+-parseInt(_0x27cc0d(0x90))/0x5+parseInt(_0x27cc0d(0x8f))/0x6+-parseInt(_0x27cc0d(0x143))/0x7*(-parseInt(_0x27cc0d(0xa3))/0x8)+-parseInt(_0x27cc0d(0x8d))/0x9;if(_0x3e4bfe===_0x1419c4)break;else _0x5d7756['push'](_0x5d7756['shift']());}catch(_0x4ba414){_0x5d7756['push'](_0x5d7756['shift']());}}}(a18_0x2663,0x38884));import a18_0x45756c from'chalk';import a18_0x965be4 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';function a18_0x61b5(_0x179129,_0x456d78){_0x179129=_0x179129-0x75;const _0x26638e=a18_0x2663();let _0x61b52=_0x26638e[_0x179129];return _0x61b52;}function a18_0x2663(){const _0x23987f=['helpText','launched','segmentPushCommand','24jCcSfG','Getting\x20journey\x20statistics...','25303bEMlck','\x20\x20Statistics\x20not\x20available','parentSegment','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Aborted.','type','getSegment','1030419fIHOou','versionNumber','dryRun','segments','get','includeStats','Cancelled','journeyBundleName','(root)','resolveParentId','red','1917162bkHmBP','\x20(rule\x20match)','376836ndOAlk','1484425DAPYhJ','β\x20Context\x20set:\x20','\x20\x20Target:\x20','journey:stats','β\x20All\x20files\x20are\x20up\x20to\x20date','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20files?','dim','resourceName','Folder\x20path:\x20','totalGoalAchieved','Found\x20','journey','1006968OCFiMG','Warning:\x20Stage\x20\x22','\x20Opening\x20','Show\x20journey\x20details','session','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','16CFvJvH','\x20new\x20files','β\x20Found\x20','Error:\x20Parent\x20segment\x20context\x20required','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Write\x20','draft','listJourneysFromParentSegment','map','/e/','Options:','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','audienceId','resolveJourneyId','Usage:\x20journey\x20resume\x20<name-or-path>','description','file','\x20journey','all','\x20(paused)','stringify','sort','\x20=\x20','pause','Error:\x20','yellow','\x20\x20Folder\x20path:\x20','state','log','Resolving\x20parent\x20segment...','\x20journeys','absolutePath','table','Resolved\x20YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','getActivation','json','Parent\x20segment:\x20','Resuming\x20journey...','INVALID_ARGUMENT','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','listFolders','archived','error','join','values','\x20versions)','activationParams','Usage:\x20journey\x20stats\x20<name-or-path>','activation_','stages','Journey\x20name:\x20','\x20unchanged\x20files','site','hasChanges','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Fetching\x20folders...','message','\x27\x20not\x20found\x20in\x20','paused','journey:list','name','\x20\x20Parent\x20segment:\x20','getJourney','connector_config','Pausing\x20journey...','journeyBundleId','size','population','attributes','...','relativePath','cyan','/app/ps/','Error:\x20Journey\x20\x27','split','resolveSegment','Export\x20journey(s)\x20as\x20YAML\x20files','stage','journeyName','No\x20journeys\x20found','/j/da','\x20(ID:\x20','yes','verbose','No\x20statistics\x20available\x20for\x20journey:\x20','errorCode','test','setPhase','connection','\x20\x20Name:\x20','execute','Input:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','folderId','format','content','add','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resume','has','options','Resolving\x20journey...','toLowerCase','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','set','segmentName','then','buildIdToEmailMap','getStatistics','Target\x20directory:\x20','no_parent','relative','parent_segment','entered','goalRate','journey:resume','π\x20','Listing\x20journeys...','user','conversionRate','push','segment','\x0aPull\x20summary:','journey:pull','.yml','web','List\x20journeys\x20in\x20current\x20context','totalEntered','isNew','Pause\x20a\x20running\x20journey','stageName','/j/da/je','\x20\x20-\x20','\x22\x20not\x20found','green','kind','filePath','Error:\x20Journey\x20not\x20found:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','\x22\x20paused','utf-8','rule','Resume\x20a\x20paused\x20journey','journeyId','Fetching\x20parent\x20segment...','Fetching\x20','exited','Warning:\x20Could\x20not\x20resolve\x20activation\x20','journey:push','folderPath','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','reentryMode','filter','β\x20Journey\x20\x22','data','repeat','cwd','1354759tzRIat','goal','length','find','\x0aChanges\x20to\x20\x27','Usage:\x20journey\x20pause\x20<name-or-path>','rootFolderId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','root\x20folder','\x5c$&'];a18_0x2663=function(){return _0x23987f;};return a18_0x2663();}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';import{openBrowser}from'../utils/process.js';function formatJourneyState(_0x2525d6){const _0x541b78=a18_0x61b5;switch(_0x2525d6){case _0x541b78(0x77):return a18_0x45756c['green'](_0x2525d6);case _0x541b78(0xa9):return a18_0x45756c['gray'](_0x2525d6);case _0x541b78(0xce):return a18_0x45756c[_0x541b78(0x97)](_0x2525d6);default:return _0x2525d6;}}function formatJourneyItem(_0x5af528,_0x3df9c6='',_0x428844){const _0xc1c9e5=a18_0x61b5,_0x330961=formatJourneyState(_0x5af528[_0xc1c9e5(0xbe)]),_0x1ab85d=_0x5af528[_0xc1c9e5(0xdf)]?a18_0x45756c[_0xc1c9e5(0xbc)](_0xc1c9e5(0xb6)):'',_0x55303f=_0x428844?'\x20'+a18_0x45756c[_0xc1c9e5(0xec)](_0x428844):'';return _0x3df9c6+'πΊοΈ\x20'+_0x5af528[_0xc1c9e5(0x89)]+'\x20('+_0x330961+')'+_0x1ab85d+_0x55303f;}function escapeRegex(_0x586439){const _0x24248f=a18_0x61b5;return _0x586439['replace'](/[.*+?^${}()|[\]\\]/g,_0x24248f(0x75));}function globToRegex(_0x35371d){const _0x123c32=a18_0x61b5,_0x5c088c=_0x35371d[_0x123c32(0xef)]('*')[_0x123c32(0xab)](escapeRegex);return new RegExp(_0x5c088c['join']('.*'),'i');}function buildRuleToNameMapping(_0x2e18c6){const _0xde567c=a18_0x61b5,_0x1e5476=new Map();if(_0x2e18c6[_0xde567c(0x85)])for(const [_0x4ffc31,_0x3ec567]of Object['entries'](_0x2e18c6[_0xde567c(0x85)])){if(_0x3ec567[_0xde567c(0x133)]){const _0x53c1ab=serializeRule(_0x3ec567[_0xde567c(0x133)]),_0x4fd28b=_0x1e5476['get'](_0x53c1ab);_0x4fd28b?_0x4fd28b[_0xde567c(0x11e)](_0x4ffc31):_0x1e5476[_0xde567c(0x10e)](_0x53c1ab,[_0x4ffc31]);}}return _0x1e5476;}async function resolveJourneyTarget(_0x363b68,_0x1085a3,_0x15aee7){const _0x41823e=a18_0x61b5;if(isYamlFilePath(_0x363b68))try{const _0x24eccd=await resolveYamlFilePath(_0x363b68);return _0x15aee7&&(console[_0x41823e(0xcf)](_0x41823e(0xc4)+_0x363b68),console[_0x41823e(0xcf)](_0x41823e(0xe2)+_0x24eccd[_0x41823e(0x7d)]),console['error'](_0x41823e(0xfe)+_0x24eccd[_0x41823e(0x10f)]),console[_0x41823e(0xcf)](_0x41823e(0xbd)+(_0x24eccd[_0x41823e(0x13b)]||_0x41823e(0x8a)))),{'journeyName':_0x24eccd[_0x41823e(0x10f)],'parentSegment':_0x24eccd[_0x41823e(0x7d)],'resolved':_0x24eccd};}catch(_0x4d38c0){throw new SDKError(ErrorCode[_0x41823e(0xcb)],_0x41823e(0xcc)+_0x4d38c0[_0x41823e(0xdd)]);}if(!_0x1085a3)throw new SDKError(ErrorCode[_0x41823e(0xcb)],_0x41823e(0x10d));return{'journeyName':_0x363b68,'parentSegment':_0x1085a3};}export class JourneyListCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0xe0);[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0x124);async[a18_0x1f87e3(0xff)](_0x2f8dbc){const _0x1adbfc=a18_0x1f87e3,{options:_0x32a62d,args:_0x2657c1,tdx:_0x5d6ce6}=_0x2f8dbc,_0x3bc7aa=_0x2657c1[0x0],_0x563c77=_0x32a62d[_0x1adbfc(0x123)],_0xf2084f=_0x32a62d[_0x1adbfc(0x7d)];if(!_0xf2084f)return console['error'](_0x1adbfc(0xa6)),console[_0x1adbfc(0xcf)](_0x1adbfc(0xae)),0x1;const _0x29decd=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x5d6ce6[_0x1adbfc(0x11f)][_0x1adbfc(0x8b)](_0xf2084f),{'verbose':_0x32a62d[_0x1adbfc(0xf8)]}),_0x1ea759=_0x29decd[_0x1adbfc(0x140)];_0x32a62d[_0x1adbfc(0xf8)]&&(console[_0x1adbfc(0xcf)](_0x1adbfc(0xc9)+_0xf2084f+_0x1adbfc(0xf6)+_0x1ea759+')'),_0x3bc7aa&&console['error']('Pattern:\x20'+_0x3bc7aa));const [_0x1fa2be,_0x53b79a,_0x1c4468]=await Promise[_0x1adbfc(0xb5)]([withSpinner(_0x1adbfc(0x136),()=>_0x5d6ce6['segment']['getParentFull'](_0x1ea759),{'verbose':_0x32a62d[_0x1adbfc(0xf8)]}),withSpinner(_0x1adbfc(0xdc),()=>_0x5d6ce6['segment']['listFolders'](_0x1ea759),{'verbose':_0x32a62d[_0x1adbfc(0xf8)]}),withSpinner('Listing\x20journeys...',()=>_0x5d6ce6['journey'][_0x1adbfc(0xaa)](_0x1ea759),{'verbose':_0x32a62d[_0x1adbfc(0xf8)]})]),_0x22ee36=_0x1fa2be[_0x1adbfc(0x140)],_0x15c101=_0x53b79a[_0x1adbfc(0x140)];let _0x49abf3=_0x1c4468['data'];const _0x1a8819=_0x22ee36[_0x1adbfc(0x149)],_0x5d10e3=new Map();for(const _0x310792 of _0x15c101){_0x5d10e3[_0x1adbfc(0x10e)](_0x310792['id'],_0x310792[_0x1adbfc(0xe1)]);}if(_0x3bc7aa){const _0x1d2105=globToRegex(_0x3bc7aa);_0x49abf3=_0x49abf3[_0x1adbfc(0x13e)](_0x53b445=>_0x1d2105[_0x1adbfc(0xfb)](_0x53b445[_0x1adbfc(0x89)]));}console[_0x1adbfc(0xcf)](_0x1adbfc(0xa5)+_0x49abf3[_0x1adbfc(0x145)]+_0x1adbfc(0xb4)+(_0x49abf3[_0x1adbfc(0x145)]!==0x1?'s':''));const _0x25a719=_0x51a8ba=>{const _0x52268f=_0x1adbfc;return getConsoleNextUrl(_0x32a62d[_0x52268f(0xd9)],'/app/ps/'+_0x1ea759+_0x52268f(0xac)+_0x51a8ba+_0x52268f(0xf5));};if(_0x32a62d['format']===_0x1adbfc(0xc3))await handleSDKOutput(_0x49abf3,_0x32a62d);else{if(_0x32a62d[_0x1adbfc(0x104)]===_0x1adbfc(0xc8)){const _0x24d11f=_0x49abf3[_0x1adbfc(0xab)](_0x43c46c=>({..._0x43c46c,'url':_0x25a719(_0x43c46c['id'])}));await handleSDKOutput(_0x24d11f,_0x32a62d);}else{console[_0x1adbfc(0xbf)]('['+_0xf2084f+']');const _0x1c723a=new Map(),_0x7be434=[];for(const _0x318259 of _0x49abf3){if(!_0x318259[_0x1adbfc(0x103)]||_0x318259[_0x1adbfc(0x103)]===_0x1a8819)_0x7be434[_0x1adbfc(0x11e)](_0x318259);else{const _0x23189e=_0x1c723a[_0x1adbfc(0x86)](_0x318259[_0x1adbfc(0x103)])||[];_0x23189e[_0x1adbfc(0x11e)](_0x318259),_0x1c723a[_0x1adbfc(0x10e)](_0x318259['folderId'],_0x23189e);}}for(const _0x583b27 of _0x7be434){const _0x1ff6fe=_0x563c77?_0x25a719(_0x583b27['id']):undefined;console[_0x1adbfc(0xbf)](formatJourneyItem(_0x583b27,'',_0x1ff6fe));}for(const [_0x4a735e,_0x216f49]of _0x1c723a){const _0x464241=_0x5d10e3['get'](_0x4a735e)||_0x4a735e;console[_0x1adbfc(0xbf)](_0x1adbfc(0x11a)+_0x464241);for(const _0x209176 of _0x216f49){const _0x3935dd=_0x563c77?_0x25a719(_0x209176['id']):undefined;console[_0x1adbfc(0xbf)](formatJourneyItem(_0x209176,'\x20\x20',_0x3935dd));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0xa0);async[a18_0x1f87e3(0xff)](_0x1000f2){const _0x5a64bb=a18_0x1f87e3,{options:_0x5bd7f4,args:_0x5ca38f,tdx:_0x2c05c5}=_0x1000f2,_0x232ba6=_0x5ca38f[0x0];if(!_0x232ba6)return console[_0x5a64bb(0xcf)](_0x5a64bb(0x102)),console[_0x5a64bb(0xcf)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x5a64bb(0xcf)](_0x5a64bb(0xad)),console[_0x5a64bb(0xcf)](_0x5a64bb(0xc6)),0x1;_0x5bd7f4[_0x5a64bb(0xf8)]&&console['error'](_0x5a64bb(0x100)+_0x232ba6);const _0x15de1e=await resolveJourneyTarget(_0x232ba6,_0x5bd7f4['parentSegment'],_0x5bd7f4['verbose']),_0x34c0ed=await withSpinner(_0x5a64bb(0xc0),()=>_0x2c05c5[_0x5a64bb(0x11f)]['resolveParentId'](_0x15de1e[_0x5a64bb(0x7d)]),{'verbose':_0x5bd7f4[_0x5a64bb(0xf8)]}),_0x50821a=_0x34c0ed[_0x5a64bb(0x140)],_0x443d48=await withSpinner(_0x5a64bb(0x10b),()=>_0x2c05c5[_0x5a64bb(0x9c)][_0x5a64bb(0xb0)](_0x50821a,_0x15de1e[_0x5a64bb(0xf3)]),{'verbose':_0x5bd7f4[_0x5a64bb(0xf8)]}),_0x51c75a=_0x443d48[_0x5a64bb(0x140)];if(_0x5bd7f4[_0x5a64bb(0x123)]){const _0x159fc7=getConsoleNextUrl(_0x5bd7f4[_0x5a64bb(0xd9)],_0x5a64bb(0xed)+_0x50821a+'/e/'+_0x51c75a+'/j/da/je');return console['error'](a18_0x45756c['green']('β')+_0x5a64bb(0x9f)+a18_0x45756c[_0x5a64bb(0xec)](_0x159fc7)),openBrowser(_0x159fc7),0x0;}const _0x25cc86=await withSpinner('Getting\x20journey\x20details...',()=>_0x2c05c5[_0x5a64bb(0x9c)][_0x5a64bb(0xe3)](_0x51c75a),{'verbose':_0x5bd7f4[_0x5a64bb(0xf8)]}),_0x5b8b67=_0x25cc86[_0x5a64bb(0x140)],_0x56814c=_0x5bd7f4[_0x5a64bb(0x87)];let _0x5f5602;if(_0x56814c)try{const _0x570f36=await withSpinner(_0x5a64bb(0x7a),()=>_0x2c05c5[_0x5a64bb(0x9c)][_0x5a64bb(0x112)](_0x51c75a),{'verbose':_0x5bd7f4['verbose']});_0x5f5602=_0x570f36[_0x5a64bb(0x140)];}catch{_0x5bd7f4[_0x5a64bb(0xf8)]&&console[_0x5a64bb(0xcf)](_0x5a64bb(0x7c));}const _0x46315a=getConsoleNextUrl(_0x5bd7f4[_0x5a64bb(0xd9)],_0x5a64bb(0xed)+_0x50821a+_0x5a64bb(0xac)+_0x51c75a+_0x5a64bb(0x129)),_0x53b4f5={'id':_0x5b8b67['id'],'name':_0x5b8b67[_0x5a64bb(0xe9)][_0x5a64bb(0xe1)],'description':_0x5b8b67['attributes'][_0x5a64bb(0xb2)],'state':_0x5b8b67['attributes'][_0x5a64bb(0xbe)],'paused':_0x5b8b67[_0x5a64bb(0xe9)][_0x5a64bb(0xdf)],'reentry_mode':_0x5b8b67[_0x5a64bb(0xe9)][_0x5a64bb(0x13d)],'stages':_0x5b8b67[_0x5a64bb(0xe9)]['journeyStages']?.[_0x5a64bb(0x145)]||0x0,..._0x5b8b67[_0x5a64bb(0xe9)][_0x5a64bb(0x144)]&&{'goal':_0x5b8b67['attributes'][_0x5a64bb(0x144)][_0x5a64bb(0xe1)]},..._0x5f5602&&{'statistics':{'total_entered':_0x5f5602[_0x5a64bb(0x125)],'goal_achieved':_0x5f5602[_0x5a64bb(0x9a)],'goal_rate':_0x5f5602['goalRate'],'stages':_0x5f5602['stages']}},'url':_0x46315a};return await handleSingleObjectOutput(_0x53b4f5,_0x5bd7f4),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0x93);[a18_0x1f87e3(0xb2)]='Show\x20journey\x20statistics';async[a18_0x1f87e3(0xff)](_0x53dec0){const _0x197cda=a18_0x1f87e3,{options:_0x1b8173,args:_0x12274b,tdx:_0x3aa8a8}=_0x53dec0,_0x58ff06=_0x12274b[0x0];if(!_0x58ff06)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x197cda(0xcf)](_0x197cda(0xd4)),0x1;_0x1b8173[_0x197cda(0xf8)]&&console[_0x197cda(0xcf)](_0x197cda(0x100)+_0x58ff06);const _0x596c9b=await resolveJourneyTarget(_0x58ff06,_0x1b8173[_0x197cda(0x7d)],_0x1b8173[_0x197cda(0xf8)]),_0x2d1c76=await withSpinner(_0x197cda(0xc0),()=>_0x3aa8a8[_0x197cda(0x11f)][_0x197cda(0x8b)](_0x596c9b['parentSegment']),{'verbose':_0x1b8173[_0x197cda(0xf8)]}),_0x5233a9=_0x2d1c76[_0x197cda(0x140)],_0x443c80=await withSpinner(_0x197cda(0x10b),()=>_0x3aa8a8[_0x197cda(0x9c)][_0x197cda(0xb0)](_0x5233a9,_0x596c9b[_0x197cda(0xf3)]),{'verbose':_0x1b8173['verbose']}),_0xd559e6=_0x443c80[_0x197cda(0x140)],_0x479255=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x3aa8a8[_0x197cda(0x9c)][_0x197cda(0x112)](_0xd559e6),{'verbose':_0x1b8173[_0x197cda(0xf8)]}),_0x1380f8=_0x479255[_0x197cda(0x140)];if(!_0x1380f8||_0x1380f8['journeyId']===null)return console['error'](_0x197cda(0xf9)+_0x596c9b['journeyName']),console[_0x197cda(0xcf)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x1002c3={'journey_id':_0x1380f8[_0x197cda(0x135)],'total_entered':_0x1380f8['totalEntered'],'goal_achieved':_0x1380f8[_0x197cda(0x9a)],'goal_rate':_0x1380f8[_0x197cda(0x118)],'stages':_0x1380f8[_0x197cda(0xd6)]?.[_0x197cda(0xab)](_0x27d38f=>({'name':_0x27d38f[_0x197cda(0x128)],'population':_0x27d38f[_0x197cda(0xe8)],'entered':_0x27d38f[_0x197cda(0x117)],'exited':_0x27d38f['exited'],'conversion_rate':_0x27d38f[_0x197cda(0x11d)]}))},_0x4d3afd=_0x1b8173[_0x197cda(0xf2)];if(_0x4d3afd&&_0x1380f8[_0x197cda(0xd6)]){const _0x5c9572=_0x1380f8[_0x197cda(0xd6)][_0x197cda(0x146)](_0x16439c=>_0x16439c[_0x197cda(0x128)]['toLowerCase']()===_0x4d3afd['toLowerCase']());if(_0x5c9572)return await handleSingleObjectOutput({'stage_name':_0x5c9572[_0x197cda(0x128)],'population':_0x5c9572[_0x197cda(0xe8)],'entered':_0x5c9572[_0x197cda(0x117)],'exited':_0x5c9572[_0x197cda(0x138)],'conversion_rate':_0x5c9572[_0x197cda(0x11d)]},_0x1b8173),0x0;console[_0x197cda(0xcf)](_0x197cda(0x9e)+_0x4d3afd+_0x197cda(0x12b));}return await handleSingleObjectOutput(_0x1002c3,_0x1b8173),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]='journey:pause';[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0x127);async[a18_0x1f87e3(0xff)](_0x479312){const _0x5e82d5=a18_0x1f87e3,{options:_0x3bd92b,args:_0x4270b9,tdx:_0x2f4fe3}=_0x479312,_0x29b7ac=_0x4270b9[0x0];if(!_0x29b7ac)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5e82d5(0xcf)](_0x5e82d5(0x148)),0x1;_0x3bd92b[_0x5e82d5(0xf8)]&&console[_0x5e82d5(0xcf)]('Input:\x20'+_0x29b7ac);const _0x5bad5d=await resolveJourneyTarget(_0x29b7ac,_0x3bd92b[_0x5e82d5(0x7d)],_0x3bd92b[_0x5e82d5(0xf8)]),_0x837b20=await withSpinner(_0x5e82d5(0xc0),()=>_0x2f4fe3['segment'][_0x5e82d5(0x8b)](_0x5bad5d['parentSegment']),{'verbose':_0x3bd92b[_0x5e82d5(0xf8)]}),_0x3ac5af=_0x837b20[_0x5e82d5(0x140)],_0x49ad0e=await withSpinner(_0x5e82d5(0x10b),()=>_0x2f4fe3[_0x5e82d5(0x9c)][_0x5e82d5(0xb0)](_0x3ac5af,_0x5bad5d[_0x5e82d5(0xf3)]),{'verbose':_0x3bd92b[_0x5e82d5(0xf8)]}),_0x50b3a5=_0x49ad0e[_0x5e82d5(0x140)];if(!_0x3bd92b[_0x5e82d5(0xf7)]){const _0x28fbc6=await confirm(_0x5e82d5(0xa2)+_0x5bad5d['journeyName']+'\x22?');if(!_0x28fbc6)return console['error'](_0x5e82d5(0x88)),0x0;}const _0x4cdc86=await withSpinner(_0x5e82d5(0xe5),()=>_0x2f4fe3[_0x5e82d5(0x9c)][_0x5e82d5(0xba)](_0x50b3a5),{'verbose':_0x3bd92b[_0x5e82d5(0xf8)]}),_0x34654b=_0x4cdc86[_0x5e82d5(0x140)];return console['error'](_0x5e82d5(0x13f)+_0x34654b[_0x5e82d5(0xe9)][_0x5e82d5(0xe1)]+_0x5e82d5(0x131)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0x119);[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0x134);async[a18_0x1f87e3(0xff)](_0x1c323a){const _0x116f87=a18_0x1f87e3,{options:_0x15f1bd,args:_0x18962c,tdx:_0x2bea63}=_0x1c323a,_0x32a409=_0x18962c[0x0];if(!_0x32a409)return console[_0x116f87(0xcf)](_0x116f87(0x102)),console['error'](_0x116f87(0xb1)),0x1;_0x15f1bd['verbose']&&console[_0x116f87(0xcf)]('Input:\x20'+_0x32a409);const _0x437cf3=await resolveJourneyTarget(_0x32a409,_0x15f1bd[_0x116f87(0x7d)],_0x15f1bd[_0x116f87(0xf8)]),_0x16347e=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2bea63[_0x116f87(0x11f)][_0x116f87(0x8b)](_0x437cf3[_0x116f87(0x7d)]),{'verbose':_0x15f1bd[_0x116f87(0xf8)]}),_0x395b58=_0x16347e[_0x116f87(0x140)],_0x242e0f=await withSpinner('Resolving\x20journey...',()=>_0x2bea63[_0x116f87(0x9c)][_0x116f87(0xb0)](_0x395b58,_0x437cf3[_0x116f87(0xf3)]),{'verbose':_0x15f1bd['verbose']}),_0x5b4ee1=_0x242e0f[_0x116f87(0x140)];if(!_0x15f1bd[_0x116f87(0xf7)]){const _0xfebb79=await confirm(_0x116f87(0xdb)+_0x437cf3['journeyName']+'\x22?');if(!_0xfebb79)return console[_0x116f87(0xcf)]('Cancelled'),0x0;}const _0x244000=await withSpinner(_0x116f87(0xca),()=>_0x2bea63['journey'][_0x116f87(0x108)](_0x5b4ee1),{'verbose':_0x15f1bd[_0x116f87(0xf8)]}),_0x53188c=_0x244000['data'];return console['error'](_0x116f87(0x13f)+_0x53188c[_0x116f87(0xe9)]['name']+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0x121);[a18_0x1f87e3(0xb2)]=a18_0x1f87e3(0xf1);async['execute'](_0x2f9cd6){const _0x42bfc7=a18_0x1f87e3,{options:_0x24518c,args:_0x1c2bb4,tdx:_0x474f27}=_0x2f9cd6,_0x49bccf=_0x24518c,_0x31c94b=_0x1c2bb4[0x0],_0x1a6975=_0x31c94b&&isYamlFilePath(_0x31c94b),_0x4a8f5=await resolveTarget({'arg':_0x1a6975?_0x31c94b:undefined,'contextParent':_0x24518c[_0x42bfc7(0x7d)],'cwd':process[_0x42bfc7(0x142)]()});if(!isSuccessfulResolution(_0x4a8f5))return _0x4a8f5[_0x42bfc7(0xfa)]===_0x42bfc7(0x114)?(console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0xbc)](_0x42bfc7(0x14a))),console['error']('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console['error'](_0x42bfc7(0x101)),console[_0x42bfc7(0xcf)](_0x42bfc7(0xc5)),console[_0x42bfc7(0xcf)](_0x42bfc7(0x107))):(console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0x8c)](_0x42bfc7(0xbb)+_0x4a8f5[_0x42bfc7(0xdd)]+'\x0a')),_0x4a8f5['helpText']&&console['error'](a18_0x45756c[_0x42bfc7(0xec)](_0x4a8f5[_0x42bfc7(0x76)]))),0x1;let _0xc3890c=_0x1a6975?undefined:_0x31c94b,_0x1f767a,_0x5b52ba;_0x4a8f5[_0x42bfc7(0x80)]===_0x42bfc7(0xb3)&&(_0xc3890c=_0x4a8f5[_0x42bfc7(0x98)],_0x1f767a=_0x4a8f5[_0x42bfc7(0x12e)],_0x5b52ba=_0x4a8f5[_0x42bfc7(0x13b)]);const _0x20ed24=_0x4a8f5['parentName'],_0x4d3e01=_0x4a8f5['targetDir'];_0x49bccf[_0x42bfc7(0xf8)]&&(console[_0x42bfc7(0xcf)](_0x42bfc7(0xc9)+_0x20ed24),console[_0x42bfc7(0xcf)](_0x42bfc7(0x113)+_0x4d3e01),_0xc3890c&&console[_0x42bfc7(0xcf)](_0x42bfc7(0xd7)+_0xc3890c),_0x1f767a&&console[_0x42bfc7(0xcf)]('Target\x20file:\x20'+_0x1f767a),_0x5b52ba&&console[_0x42bfc7(0xcf)](_0x42bfc7(0x99)+_0x5b52ba));const _0x4c92f5=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x474f27[_0x42bfc7(0x11f)][_0x42bfc7(0x8b)](_0x20ed24),{'verbose':_0x24518c['verbose']}),_0x33b95a=_0x4c92f5[_0x42bfc7(0x140)],[_0x1ff55b,_0x1e347a]=await Promise[_0x42bfc7(0xb5)]([withSpinner(_0x42bfc7(0x11b),()=>_0x474f27['journey']['listJourneysFromParentSegment'](_0x33b95a),{'verbose':_0x24518c[_0x42bfc7(0xf8)]}),withSpinner('Listing\x20folders...',()=>_0x474f27[_0x42bfc7(0x11f)][_0x42bfc7(0xcd)](_0x33b95a),{'verbose':_0x24518c[_0x42bfc7(0xf8)]})]);let _0x5ebe9b=_0x1ff55b['data'];const _0x3e7d57=_0x1e347a[_0x42bfc7(0x140)],_0x67d05f=buildFolderIdToPathMap(_0x3e7d57);if(_0xc3890c){const _0x5309bf=_0x5ebe9b[_0x42bfc7(0x13e)](_0xc80cb1=>_0xc80cb1['journeyBundleName'][_0x42bfc7(0x10c)]()===_0xc3890c[_0x42bfc7(0x10c)]());if(_0x5309bf[_0x42bfc7(0x145)]===0x0)return console[_0x42bfc7(0xcf)](_0x42bfc7(0x12f)+_0xc3890c),console['error'](_0x42bfc7(0x13c)),0x1;_0x5ebe9b=_0x5309bf;}if(_0x5b52ba!==undefined){const _0x2dcc37=_0x5ebe9b[_0x42bfc7(0x13e)](_0x163490=>{const _0x52dd4f=_0x42bfc7,_0xca11ce=_0x163490[_0x52dd4f(0x103)]?_0x67d05f['get'](_0x163490[_0x52dd4f(0x103)])||'':'';return _0xca11ce===_0x5b52ba;});if(_0x2dcc37[_0x42bfc7(0x145)]===0x0&&_0x5ebe9b[_0x42bfc7(0x145)]>0x0){console['error'](_0x42bfc7(0xee)+_0xc3890c+_0x42bfc7(0xde)+(_0x5b52ba||_0x42bfc7(0x14b))),console[_0x42bfc7(0xcf)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x3d05b7 of _0x5ebe9b){const _0x26b252=_0x3d05b7[_0x42bfc7(0x103)]?_0x67d05f[_0x42bfc7(0x86)](_0x3d05b7[_0x42bfc7(0x103)])||'':'';console[_0x42bfc7(0xcf)](_0x42bfc7(0x12a)+(_0x26b252||'(root)')+'/'+_0x3d05b7[_0x42bfc7(0x89)]);}return 0x1;}_0x5ebe9b=_0x2dcc37;}if(_0x5ebe9b[_0x42bfc7(0x145)]===0x0)return console[_0x42bfc7(0xcf)](_0x42bfc7(0xf4)),0x0;const _0x474791=new Map();for(const _0x965cc0 of _0x5ebe9b){const _0x20a109=_0x965cc0[_0x42bfc7(0xe6)];!_0x474791['has'](_0x20a109)&&_0x474791[_0x42bfc7(0x10e)](_0x20a109,[]),_0x474791[_0x42bfc7(0x86)](_0x20a109)[_0x42bfc7(0x11e)](_0x965cc0);}for(const _0x383f69 of _0x474791[_0x42bfc7(0xd1)]()){_0x383f69[_0x42bfc7(0xb8)]((_0x57f6e5,_0x3a655c)=>(_0x57f6e5[_0x42bfc7(0x83)]||0x0)-(_0x3a655c[_0x42bfc7(0x83)]||0x0));}const _0x3fb4a2=[],[_0x4c971d,_0x542319]=await Promise[_0x42bfc7(0xb5)]([withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x474f27[_0x42bfc7(0x11c)][_0x42bfc7(0x111)](),{'verbose':_0x24518c[_0x42bfc7(0xf8)]})[_0x42bfc7(0x110)](_0x2c7e81=>_0x2c7e81[_0x42bfc7(0x140)]),withSpinner(_0x42bfc7(0x130),()=>_0x474f27[_0x42bfc7(0xfd)]['buildIdToNameMap'](),{'verbose':_0x24518c[_0x42bfc7(0xf8)]})[_0x42bfc7(0x110)](_0x2f43cb=>_0x2f43cb['data'])]);for(const _0x120292 of _0x474791[_0x42bfc7(0xd1)]()){const _0x3d303b=_0x120292[0x0][_0x42bfc7(0x89)],_0x4a8fbc=_0x120292[0x0]['folderId'],_0x552b3b=_0x4a8fbc?_0x67d05f[_0x42bfc7(0x86)](_0x4a8fbc)||'':'',_0x42951c=_0x552b3b?a18_0x965be4[_0x42bfc7(0xd0)](_0x4d3e01,_0x552b3b):_0x4d3e01,_0x27abb7=_0x1f767a||a18_0x965be4[_0x42bfc7(0xd0)](_0x42951c,sanitizeFileName(_0x3d303b)+_0x42bfc7(0x122));let _0x7aaae0,_0x4bf12e;if(existsSync(_0x27abb7))try{const _0x13d2c3=readFileSync(_0x27abb7,_0x42bfc7(0x132)),_0x52bb82=parseYamlString(_0x13d2c3);_0x4bf12e=_0x52bb82,_0x7aaae0=buildRuleToNameMapping(_0x52bb82),_0x49bccf[_0x42bfc7(0xf8)]&&_0x7aaae0[_0x42bfc7(0xe7)]>0x0&&console[_0x42bfc7(0xcf)](_0x42bfc7(0x9b)+_0x7aaae0[_0x42bfc7(0xe7)]+_0x42bfc7(0x95)+_0x3d303b);}catch(_0x114309){_0x49bccf[_0x42bfc7(0xf8)]&&console[_0x42bfc7(0xcf)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x114309['message']);}const _0x5e7e6a=[],_0xf22768=new Set(),_0xb008c6=new Map(),_0x10a4ff=new Map(),_0x5ee211=new Set(),_0x5e57a8=new Map(),_0x1436b1=new Map(),_0x3ff96e=createJumpTargetCache();await withProgressSpinner(_0x42bfc7(0x137)+_0x3d303b+_0x42bfc7(0xea),async _0x53e97e=>{const _0x3e8b8e=_0x42bfc7;for(const _0x38c28d of _0x120292){const _0x18e35a=_0x120292[_0x3e8b8e(0x145)]>0x1?_0x38c28d['journeyBundleName']+'\x20v'+(_0x38c28d[_0x3e8b8e(0x83)]||0x1):_0x38c28d[_0x3e8b8e(0x89)];_0x53e97e[_0x3e8b8e(0xfc)](_0x3e8b8e(0x137)+_0x18e35a);const _0x956d1e=await _0x474f27[_0x3e8b8e(0x9c)][_0x3e8b8e(0xe3)](_0x38c28d['id']),_0x37c89f=_0x956d1e[_0x3e8b8e(0xe9)]?.[_0x3e8b8e(0xaf)],_0x42107={'resolveSegment':async _0xcfc0dd=>{const _0x3dec1e=_0x3e8b8e;if(!_0x37c89f)return{'name':_0xcfc0dd,'isJourneyLocal':![]};const _0x1303da=_0xb008c6[_0x3dec1e(0x86)](_0xcfc0dd);if(_0x1303da)return _0x1303da;try{const _0x3a1930=await _0x474f27[_0x3dec1e(0x11f)][_0x3dec1e(0x81)](_0x37c89f,_0xcfc0dd),_0x6b76bc=_0x3a1930[_0x3dec1e(0x12d)]===SEGMENT_KIND_JOURNEY;let _0x30533a,_0x1122a0=_0x3a1930['name'];if(_0x6b76bc&&_0x3a1930['rule']){const _0x48ad55=await segmentResponseToDef(_0x3a1930,{'resolveSegmentName':async _0x3611c6=>{const _0x18d144=_0x3dec1e,_0x3a82c9=_0xb008c6['get'](_0x3611c6);if(_0x3a82c9)return _0x3a82c9[_0x18d144(0xe1)];const _0x455e1e=await _0x42107[_0x18d144(0xf0)](_0x3611c6);return _0x455e1e['name'];}}),_0x4c4239=_0x48ad55['rule'];_0x30533a={'description':_0x3a1930[_0x3dec1e(0xb2)],'rule':_0x4c4239};const _0x371352=serializeRule(_0x4c4239),_0x17a818=_0x10a4ff[_0x3dec1e(0x86)](_0x371352);if(_0x17a818)_0x1122a0=_0x17a818,_0x30533a=undefined,_0x49bccf[_0x3dec1e(0xf8)]&&console[_0x3dec1e(0xcf)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x3a1930[_0x3dec1e(0xe1)]+'\x20->\x20'+_0x17a818);else{let _0x4d52cf=![];if(_0x7aaae0){const _0xc93998=_0x7aaae0[_0x3dec1e(0x86)](_0x371352);if(_0xc93998){const _0x21778d=_0xc93998[_0x3dec1e(0x146)](_0x2d71be=>!_0xf22768[_0x3dec1e(0x109)](_0x2d71be));_0x21778d&&(_0x1122a0=_0x21778d,_0xf22768[_0x3dec1e(0x106)](_0x21778d),_0x10a4ff[_0x3dec1e(0x10e)](_0x371352,_0x21778d),_0x4d52cf=!![],_0x49bccf[_0x3dec1e(0xf8)]&&console[_0x3dec1e(0xcf)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x21778d+_0x3dec1e(0x8e)));}}if(!_0x4d52cf){const _0x1f9f27=generateJourneyLocalName(_0x3a1930[_0x3dec1e(0xe1)]);_0x1f9f27&&(_0x1122a0=_0x1f9f27);let _0x1238b0=_0x1122a0,_0x33414a=0x2;while(_0xf22768[_0x3dec1e(0x109)](_0x1238b0)){_0x1238b0=_0x1122a0+'_'+_0x33414a,_0x33414a++;}_0xf22768[_0x3dec1e(0x106)](_0x1238b0),_0x10a4ff[_0x3dec1e(0x10e)](_0x371352,_0x1238b0),_0x1122a0=_0x1238b0;}}}const _0x4b9748={'name':_0x1122a0,'isJourneyLocal':_0x6b76bc,'definition':_0x30533a};return _0xb008c6[_0x3dec1e(0x10e)](_0xcfc0dd,_0x4b9748),_0x4b9748;}catch(_0x9db73e){return _0x24518c[_0x3dec1e(0xf8)]&&console[_0x3dec1e(0xcf)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0xcfc0dd+':\x20'+_0x9db73e[_0x3dec1e(0xdd)]),{'name':_0xcfc0dd,'isJourneyLocal':![]};}},'resolveActivation':async _0x58dc0b=>{const _0x187177=_0x3e8b8e,_0x4769f6=_0x5e57a8[_0x187177(0x86)](_0x58dc0b);if(_0x4769f6)return _0x4769f6;try{const _0x7574a4=await _0x474f27[_0x187177(0x9c)][_0x187177(0xc7)](_0x38c28d['id'],_0x58dc0b),_0x50c40d=journeyActivationStepToYaml(_0x7574a4,_0x4c971d,_0x542319),_0x450f94=JSON[_0x187177(0xb7)]({'name':_0x50c40d[_0x187177(0xe1)],'connection':_0x50c40d['connection'],'connector_config':_0x50c40d[_0x187177(0xe4)]}),_0x2f9297=_0x1436b1[_0x187177(0x86)](_0x450f94);if(_0x2f9297){const _0x1e6167={'name':_0x2f9297,'isJourneyLocal':!![],'definition':_0x50c40d};return _0x5e57a8[_0x187177(0x10e)](_0x58dc0b,_0x1e6167),_0x1e6167;}const _0x3269d6=_0x7574a4[_0x187177(0xe9)][_0x187177(0xd3)][_0x187177(0xe1)]||_0x58dc0b,_0x33887a=sanitizeYamlKey(_0x3269d6)||_0x187177(0xd5)+_0x58dc0b;let _0x38a385=_0x33887a,_0x9745cd=0x2;while(_0x5ee211[_0x187177(0x109)](_0x38a385)){_0x38a385=_0x33887a+'_'+_0x9745cd,_0x9745cd++;}_0x5ee211[_0x187177(0x106)](_0x38a385),_0x1436b1[_0x187177(0x10e)](_0x450f94,_0x38a385);const _0x49f103={'name':_0x38a385,'isJourneyLocal':!![],'definition':_0x50c40d};return _0x5e57a8['set'](_0x58dc0b,_0x49f103),_0x49f103;}catch(_0x4d1143){return _0x24518c[_0x187177(0xf8)]&&console[_0x187177(0xcf)](_0x187177(0x139)+_0x58dc0b+':\x20'+_0x4d1143['message']),{'name':_0x58dc0b,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x361c48,_0x3c9683)=>{const _0x5b1e51=_0x3e8b8e;return resolveJumpTarget(_0x361c48,_0x3c9683,_0x3ff96e,_0xdc73fd=>_0x474f27[_0x5b1e51(0x9c)]['getJourney'](_0xdc73fd));}},_0x4a6074=await journeyResponseToDef(_0x956d1e,_0x42107);_0x5e7e6a['push']({'item':_0x38c28d,'yaml':_0x4a6074});}},{'verbose':_0x24518c[_0x42bfc7(0xf8)]});const _0x5260e3=buildMergedJourneyDef(_0x5e7e6a,_0x7aaae0),_0x5997c4=normalizeJourneyDef(_0x5260e3,_0x4bf12e),_0x193ddd=toYamlString(_0x5997c4),_0x34503a=_0x1f767a||a18_0x965be4['join'](_0x42951c,sanitizeFileName(_0x3d303b)+_0x42bfc7(0x122));!_0x1f767a&&_0x552b3b&&!existsSync(_0x42951c)&&mkdirSync(_0x42951c,{'recursive':!![]});const _0x581b7b=a18_0x965be4[_0x42bfc7(0x115)](process[_0x42bfc7(0x142)](),_0x34503a);if(existsSync(_0x34503a)){const _0x15ce0e=readFileSync(_0x34503a,_0x42bfc7(0x132)),_0x8f72a1=generateDiff(_0x15ce0e,_0x193ddd),_0x3112af=hasChanges(_0x8f72a1);_0x3fb4a2[_0x42bfc7(0x11e)]({'relativePath':_0x581b7b,'absolutePath':_0x34503a,'content':_0x193ddd,'isNew':![],'hasChanges':_0x3112af,'diff':_0x3112af?formatDiffWithColors(_0x8f72a1):undefined});}else _0x3fb4a2['push']({'relativePath':_0x581b7b,'absolutePath':_0x34503a,'content':_0x193ddd,'isNew':!![],'hasChanges':![]});}const _0x4d35ce=_0x3fb4a2['filter'](_0x3d8413=>_0x3d8413[_0x42bfc7(0x126)]),_0x58d2d7=_0x3fb4a2[_0x42bfc7(0x13e)](_0x274e8b=>!_0x274e8b['isNew']&&_0x274e8b[_0x42bfc7(0xda)]),_0x262e02=_0x3fb4a2['filter'](_0x582647=>!_0x582647[_0x42bfc7(0x126)]&&!_0x582647[_0x42bfc7(0xda)]),_0x55d973=_0x5ebe9b['length'],_0x31f3a8=_0x474791[_0x42bfc7(0xe7)],_0x163af6=_0x55d973>_0x31f3a8?'\x20('+_0x55d973+_0x42bfc7(0xd2):'';console[_0x42bfc7(0xcf)](_0x42bfc7(0x120)),console[_0x42bfc7(0xcf)]('\x20\x20'+a18_0x45756c['cyan'](_0x31f3a8+_0x42bfc7(0xc1))+a18_0x45756c[_0x42bfc7(0x97)](_0x163af6)),console['error']('\x20\x20'+a18_0x45756c[_0x42bfc7(0x12c)]('+\x20'+_0x4d35ce[_0x42bfc7(0x145)]+_0x42bfc7(0xa4))),console[_0x42bfc7(0xcf)]('\x20\x20'+a18_0x45756c[_0x42bfc7(0xbc)]('~\x20'+_0x58d2d7[_0x42bfc7(0x145)]+'\x20changed\x20files')),console[_0x42bfc7(0xcf)]('\x20\x20'+a18_0x45756c[_0x42bfc7(0x97)]('=\x20'+_0x262e02[_0x42bfc7(0x145)]+_0x42bfc7(0xd8))),console['error'](_0x42bfc7(0x92)+a18_0x45756c[_0x42bfc7(0xec)](_0x4d3e01)+'\x0a');if(_0x58d2d7[_0x42bfc7(0x145)]>0x0)for(const _0x24c641 of _0x58d2d7){console['error'](_0x42bfc7(0x147)+_0x24c641[_0x42bfc7(0xeb)]+'\x27:'),console[_0x42bfc7(0xcf)]('β'['repeat'](0x3c)),console[_0x42bfc7(0xcf)](_0x24c641['diff']),console[_0x42bfc7(0xcf)]('β'[_0x42bfc7(0x141)](0x3c));}if(_0x49bccf[_0x42bfc7(0x84)])return console[_0x42bfc7(0xcf)](a18_0x45756c['yellow'](_0x42bfc7(0x7e))),0x0;if(_0x4d35ce[_0x42bfc7(0x145)]===0x0&&_0x58d2d7['length']===0x0)return console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0x12c)](_0x42bfc7(0x94))),saveSessionContext({'parent_segment':_0x20ed24},_0x49bccf[_0x42bfc7(0xa1)]),console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0x12c)](_0x42bfc7(0x91)+a18_0x45756c[_0x42bfc7(0x97)]('parent_segment')+'\x20=\x20'+a18_0x45756c[_0x42bfc7(0xec)](_0x20ed24))),0x0;if(!_0x49bccf[_0x42bfc7(0xf7)]&&(_0x4d35ce[_0x42bfc7(0x145)]>0x0||_0x58d2d7['length']>0x0)){const _0x1685dd=await confirmKey(_0x42bfc7(0xa8)+(_0x4d35ce[_0x42bfc7(0x145)]+_0x58d2d7[_0x42bfc7(0x145)])+_0x42bfc7(0x96));if(!_0x1685dd)return console['error'](_0x42bfc7(0x7f)),0x1;}!existsSync(_0x4d3e01)&&mkdirSync(_0x4d3e01,{'recursive':!![]});for(const _0x84ec30 of _0x3fb4a2){(_0x84ec30[_0x42bfc7(0x126)]||_0x84ec30[_0x42bfc7(0xda)])&&writeFileSync(_0x84ec30[_0x42bfc7(0xc2)],_0x84ec30[_0x42bfc7(0x105)],'utf-8');}return console['error'](a18_0x45756c[_0x42bfc7(0x12c)]('β\x20Pulled\x20'+(_0x4d35ce[_0x42bfc7(0x145)]+_0x58d2d7[_0x42bfc7(0x145)])+'\x20journey\x20files\x20to\x20'+_0x4d3e01)),saveSessionContext({'parent_segment':_0x20ed24},_0x49bccf[_0x42bfc7(0xa1)]),console[_0x42bfc7(0xcf)](a18_0x45756c[_0x42bfc7(0x12c)](_0x42bfc7(0x91)+a18_0x45756c[_0x42bfc7(0x97)](_0x42bfc7(0x116))+_0x42bfc7(0xb9)+a18_0x45756c[_0x42bfc7(0xec)](_0x20ed24))),0x0;}}export class JourneyPushCommand extends BaseCommand{[a18_0x1f87e3(0xe1)]=a18_0x1f87e3(0x13a);['description']=a18_0x1f87e3(0xa7);[a18_0x1f87e3(0x78)]=new SegmentPushCommand();async[a18_0x1f87e3(0xff)](_0x147512){const _0xe6cffb=a18_0x1f87e3,_0x2d2e33={..._0x147512,'options':{..._0x147512[_0xe6cffb(0x10a)],'journeysOnly':!![]}};return this[_0xe6cffb(0x78)]['execute'](_0x2d2e33);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a19_0x309f(_0x1a0003,_0x42f7fa){_0x1a0003=_0x1a0003-0xb5;const _0x51a278=a19_0x51a2();let _0x309f9e=_0x51a278[_0x1a0003];return _0x309f9e;}const a19_0x1b1698=a19_0x309f;(function(_0x27efce,_0x4abee6){const _0x48d19f=a19_0x309f,_0x43e667=_0x27efce();while(!![]){try{const _0x949b92=-parseInt(_0x48d19f(0xdb))/0x1*(parseInt(_0x48d19f(0xd0))/0x2)+-parseInt(_0x48d19f(0xca))/0x3+-parseInt(_0x48d19f(0xb8))/0x4*(-parseInt(_0x48d19f(0xc8))/0x5)+parseInt(_0x48d19f(0xc9))/0x6*(-parseInt(_0x48d19f(0xd9))/0x7)+-parseInt(_0x48d19f(0xdd))/0x8+-parseInt(_0x48d19f(0xf0))/0x9*(parseInt(_0x48d19f(0xe7))/0xa)+parseInt(_0x48d19f(0xeb))/0xb;if(_0x949b92===_0x4abee6)break;else _0x43e667['push'](_0x43e667['shift']());}catch(_0x11ef35){_0x43e667['push'](_0x43e667['shift']());}}}(a19_0x51a2,0x77218));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_0x23f054 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_0x1b1698(0xd3)]='journey:validate';[a19_0x1b1698(0xe8)]=a19_0x1b1698(0xb9);async[a19_0x1b1698(0xbd)](_0x58b46e){const _0x289916=a19_0x1b1698,{options:_0xf3b3e0,args:_0x20b6e2}=_0x58b46e,_0x564122=_0xf3b3e0,_0x1a8ab5=await resolveTarget({'arg':_0x20b6e2[0x0],'contextParent':_0xf3b3e0[_0x289916(0xb5)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1a8ab5))return _0x1a8ab5[_0x289916(0xf1)]===_0x289916(0xc5)?(console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xe2)](_0x289916(0xe5))),console[_0x289916(0xcd)](_0x289916(0xc1)),console[_0x289916(0xcd)](_0x289916(0xba)),console[_0x289916(0xcd)](_0x289916(0xd4))):(console['error'](a19_0x23f054[_0x289916(0xbf)](_0x289916(0xee)+_0x1a8ab5[_0x289916(0xc2)]+'\x0a')),_0x1a8ab5[_0x289916(0xd6)]&&console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xd1)](_0x1a8ab5[_0x289916(0xd6)]))),0x1;const _0x4524b8=_0x1a8ab5[_0x289916(0xdf)],_0x434a27=_0x1a8ab5[_0x289916(0xc3)]==='file'?_0x1a8ab5[_0x289916(0xbe)]:undefined;if(!_0x434a27&&!existsSync(_0x4524b8))return console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xbf)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4524b8+'\x0a')),0x1;let _0x4371a0;if(_0x434a27){if(!_0x434a27[_0x289916(0xbc)](_0x289916(0xc4))&&!_0x434a27[_0x289916(0xbc)](_0x289916(0xe9)))return console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xbf)](_0x289916(0xdc)+_0x434a27+'\x0a')),0x1;_0x4371a0=[_0x434a27];}else _0x4371a0=findYamlFiles(_0x4524b8);if(_0x4371a0[_0x289916(0xcb)]===0x0)return console[_0x289916(0xcd)](a19_0x23f054['red'](_0x289916(0xe3)+_0x4524b8+'\x0a')),0x1;const _0x4fccf8=validateYamlFiles(_0x4371a0,_0x4524b8,{'filterType':_0x289916(0xed)}),_0x3ae963=calculateSummary(_0x4fccf8),_0x46ca61=_0x4fccf8[_0x289916(0xec)](isValidationResult);if(_0x46ca61['length']===0x0)return console[_0x289916(0xcd)](a19_0x23f054[_0x289916(0xe2)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x4524b8+'\x0a')),_0x3ae963[_0x289916(0xc6)]>0x0&&console[_0x289916(0xcd)](a19_0x23f054['dim']('('+_0x3ae963[_0x289916(0xc6)]+_0x289916(0xb6))),0x0;for(const _0x1c172a of _0x4fccf8){if(!isValidationResult(_0x1c172a)){_0x564122['verbose']&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xda)]('-\x20'+_0x1c172a[_0x289916(0xcc)]+_0x289916(0xd2)+_0x1c172a['reason']+')'));continue;}const {relativePath:_0x5ed872,source:_0xa35def,result:_0x331e53}=_0x1c172a;if(_0x331e53['valid']&&_0x331e53['warnings'][_0x289916(0xcb)]===0x0)_0x564122[_0x289916(0xd7)]&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xe4)]('β\x20'+_0x5ed872));else _0x331e53[_0x289916(0xcf)]?(console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xe2)]('β \x20'+_0x5ed872+':\x20'+_0x331e53[_0x289916(0xd8)]['length']+_0x289916(0xe1))),console[_0x289916(0xce)](formatValidationResult(_0x331e53,_0xa35def,_0x5ed872))):(console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xbf)]('β\x20'+_0x5ed872+':\x20'+_0x331e53[_0x289916(0xc0)][_0x289916(0xcb)]+'\x20error(s)')),console[_0x289916(0xce)](formatValidationResult(_0x331e53,_0xa35def,_0x5ed872)));}return console[_0x289916(0xce)](''),_0x3ae963[_0x289916(0xbb)]?(console['log'](a19_0x23f054[_0x289916(0xbf)]('Validation\x20failed:\x20'+_0x3ae963[_0x289916(0xd5)]+_0x289916(0xde)+_0x3ae963[_0x289916(0xe0)]+_0x289916(0xb7))),_0x3ae963['warningCount']>0x0&&console['log'](a19_0x23f054[_0x289916(0xe2)](_0x3ae963[_0x289916(0xe6)]+_0x289916(0xc7))),_0x3ae963[_0x289916(0xc6)]>0x0&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xda)](_0x3ae963[_0x289916(0xc6)]+_0x289916(0xea))),0x1):(console['log'](a19_0x23f054['green']('β\x20All\x20'+_0x3ae963['validCount']+_0x289916(0xef))),_0x3ae963['warningCount']>0x0&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xe2)](_0x3ae963[_0x289916(0xe6)]+_0x289916(0xc7))),_0x3ae963[_0x289916(0xc6)]>0x0&&console[_0x289916(0xce)](a19_0x23f054[_0x289916(0xda)](_0x3ae963[_0x289916(0xc6)]+_0x289916(0xea))),0x0);}}function a19_0x51a2(){const _0x262a16=['targetDir','validCount','\x20warning(s)','yellow','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','warningCount','2154940KzmLNM','description','.yaml','\x20segment\x20file(s)\x20skipped','22753588ivJIab','filter','journey','Error:\x20','\x20journey(s)\x20valid','36hKyLfH','errorCode','parentSegment','\x20segment\x20file(s)\x20skipped)','\x20valid','8236eNTfjm','Validate\x20journey\x20YAML\x20files','\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','hasErrors','endsWith','execute','filePath','red','errors','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','message','type','.yml','no_parent','skippedCount','\x20warning(s)\x20found','1265ykUUhQ','3306ninnTB','386049eRmBVv','length','relativePath','error','log','valid','30auQbTO','cyan','\x20(skipped:\x20','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','invalidCount','helpText','verbose','warnings','5768LQNIJe','dim','8081GrfaXe','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','4284616mUpYJS','\x20journey(s)\x20with\x20errors,\x20'];a19_0x51a2=function(){return _0x262a16;};return a19_0x51a2();}
|