@treasuredata/tdx 0.28.1 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/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/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +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.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.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.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/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/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x2ec8d9=a19_0x4e78;(function(_0x26b017,_0x4a1b99){const _0x48768d=a19_0x4e78,_0x7f2bbe=_0x26b017();while(!![]){try{const _0x400e09=parseInt(_0x48768d(0x1b1))/0x1*(-parseInt(_0x48768d(0x1bd))/0x2)+parseInt(_0x48768d(0x1c1))/0x3*(parseInt(_0x48768d(0x1d0))/0x4)+-parseInt(_0x48768d(0x1b2))/0x5+-parseInt(_0x48768d(0x1b7))/0x6+parseInt(_0x48768d(0x1cd))/0x7+parseInt(_0x48768d(0x1ad))/0x8+-parseInt(_0x48768d(0x1b3))/0x9*(-parseInt(_0x48768d(0x1c0))/0xa);if(_0x400e09===_0x4a1b99)break;else _0x7f2bbe['push'](_0x7f2bbe['shift']());}catch(_0x336e2f){_0x7f2bbe['push'](_0x7f2bbe['shift']());}}}(a19_0x20b9,0xb7be4));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a19_0x4e78(_0x3c8448,_0x584581){_0x3c8448=_0x3c8448-0x1a4;const _0x20b9ed=a19_0x20b9();let _0x4e7808=_0x20b9ed[_0x3c8448];return _0x4e7808;}import a19_0x3dca2f from'chalk';import a19_0x1f7219 from'path';function a19_0x20b9(){const _0x363e11=['Validation\x20failed:\x20','filter','4ZYguTE','4895105nTTKZJ','80460RhSUcl','warnings','\x20warning(s)\x20found','yellow','8409408OwxKIW','verbose','.yaml','\x20non-campaign\x20file(s)\x20skipped','validCount','log','174260BZSOrg','green','\x20error(s)','1220dNtVvK','3aQnPCE','red','Validate\x20campaign\x20YAML\x20files','execute','dim','\x20valid','error','✔\x20All\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20campaign(s)\x20valid','\x20non-campaign\x20file(s)\x20skipped)','resolve','3383709ErfByA','\x20campaign(s)\x20with\x20errors,\x20','campaign','3244588ASLXYG','skippedCount','endsWith','valid','cwd','name','length','description','Error:\x20Directory\x20not\x20found:\x20','dirname','.yml','errors','8772056nPEHeZ','warningCount'];a19_0x20b9=function(){return _0x363e11;};return a19_0x20b9();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a19_0x2ec8d9(0x1a6)]='engage:campaign:validate';[a19_0x2ec8d9(0x1a8)]=a19_0x2ec8d9(0x1c3);async[a19_0x2ec8d9(0x1c4)](_0x5b1f4b){const _0x1f2d64=a19_0x2ec8d9,{options:_0x57980a,args:_0x1e2269}=_0x5b1f4b,_0x1147da=_0x57980a,_0x118e2a=_0x1e2269[0x0],_0x24dda3=_0x118e2a?a19_0x1f7219[_0x1f2d64(0x1cc)](_0x118e2a):undefined,_0x414cf2=_0x24dda3?isYamlFile(_0x24dda3):![];let _0x4652f5,_0x1be171;if(_0x414cf2&&_0x24dda3)_0x4652f5=a19_0x1f7219[_0x1f2d64(0x1aa)](_0x24dda3),_0x1be171=_0x24dda3;else _0x24dda3?_0x4652f5=_0x24dda3:_0x4652f5=process[_0x1f2d64(0x1a5)]();if(!_0x1be171&&!existsSync(_0x4652f5))return console[_0x1f2d64(0x1c7)](a19_0x3dca2f[_0x1f2d64(0x1c2)](_0x1f2d64(0x1a9)+_0x4652f5+'\x0a')),0x1;let _0x4c8040;if(_0x1be171){if(!_0x1be171[_0x1f2d64(0x1d2)](_0x1f2d64(0x1ab))&&!_0x1be171[_0x1f2d64(0x1d2)](_0x1f2d64(0x1b9)))return console['error'](a19_0x3dca2f[_0x1f2d64(0x1c2)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1be171+'\x0a')),0x1;_0x4c8040=[_0x1be171];}else _0x4c8040=findYamlFiles(_0x4652f5);if(_0x4c8040[_0x1f2d64(0x1a7)]===0x0)return console[_0x1f2d64(0x1c7)](a19_0x3dca2f['red'](_0x1f2d64(0x1c9)+_0x4652f5+'\x0a')),0x1;const _0x199bc2=validateYamlFiles(_0x4c8040,_0x4652f5,{'filterType':_0x1f2d64(0x1cf)}),_0x49139d=calculateSummary(_0x199bc2),_0x111852=_0x199bc2[_0x1f2d64(0x1b0)](isValidationResult);if(_0x111852['length']===0x0)return console['error'](a19_0x3dca2f[_0x1f2d64(0x1b6)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x4652f5+'\x0a')),_0x49139d[_0x1f2d64(0x1d1)]>0x0&&console[_0x1f2d64(0x1c7)](a19_0x3dca2f[_0x1f2d64(0x1c5)]('('+_0x49139d['skippedCount']+_0x1f2d64(0x1cb))),0x0;for(const _0x11bbaf of _0x199bc2){if(!isValidationResult(_0x11bbaf)){_0x1147da[_0x1f2d64(0x1b8)]&&console['log'](a19_0x3dca2f[_0x1f2d64(0x1c5)]('-\x20'+_0x11bbaf['relativePath']+'\x20(skipped:\x20'+_0x11bbaf['reason']+')'));continue;}const {relativePath:_0x3dd6a9,source:_0x23f301,result:_0x30397a}=_0x11bbaf;if(_0x30397a[_0x1f2d64(0x1a4)]&&_0x30397a[_0x1f2d64(0x1b4)][_0x1f2d64(0x1a7)]===0x0)_0x1147da['verbose']&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1be)]('✔\x20'+_0x3dd6a9));else _0x30397a[_0x1f2d64(0x1a4)]?(console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1b6)]('⚠\x20'+_0x3dd6a9+':\x20'+_0x30397a[_0x1f2d64(0x1b4)][_0x1f2d64(0x1a7)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x30397a,_0x23f301,_0x3dd6a9))):(console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1c2)]('✖\x20'+_0x3dd6a9+':\x20'+_0x30397a[_0x1f2d64(0x1ac)][_0x1f2d64(0x1a7)]+_0x1f2d64(0x1bf))),console[_0x1f2d64(0x1bc)](formatValidationResult(_0x30397a,_0x23f301,_0x3dd6a9)));}return console[_0x1f2d64(0x1bc)](''),_0x49139d['hasErrors']?(console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1c2)](_0x1f2d64(0x1af)+_0x49139d['invalidCount']+_0x1f2d64(0x1ce)+_0x49139d[_0x1f2d64(0x1bb)]+_0x1f2d64(0x1c6))),_0x49139d[_0x1f2d64(0x1ae)]>0x0&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1b6)](_0x49139d[_0x1f2d64(0x1ae)]+_0x1f2d64(0x1b5))),_0x49139d['skippedCount']>0x0&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1c5)](_0x49139d[_0x1f2d64(0x1d1)]+_0x1f2d64(0x1ba))),0x1):(console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1be)](_0x1f2d64(0x1c8)+_0x49139d[_0x1f2d64(0x1bb)]+_0x1f2d64(0x1ca))),_0x49139d[_0x1f2d64(0x1ae)]>0x0&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f[_0x1f2d64(0x1b6)](_0x49139d[_0x1f2d64(0x1ae)]+_0x1f2d64(0x1b5))),_0x49139d['skippedCount']>0x0&&console[_0x1f2d64(0x1bc)](a19_0x3dca2f['dim'](_0x49139d[_0x1f2d64(0x1d1)]+_0x1f2d64(0x1ba))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x35e874=a20_0x6d0b;(function(_0x387c67,_0x1adc47){const _0x29688b=a20_0x6d0b,_0x3be909=_0x387c67();while(!![]){try{const _0x101a48=parseInt(_0x29688b(0x26a))/0x1*(parseInt(_0x29688b(0x254))/0x2)+-parseInt(_0x29688b(0x264))/0x3*(-parseInt(_0x29688b(0x270))/0x4)+-parseInt(_0x29688b(0x224))/0x5*(-parseInt(_0x29688b(0x274))/0x6)+-parseInt(_0x29688b(0x26d))/0x7*(-parseInt(_0x29688b(0x230))/0x8)+-parseInt(_0x29688b(0x221))/0x9+-parseInt(_0x29688b(0x233))/0xa+parseInt(_0x29688b(0x20c))/0xb;if(_0x101a48===_0x1adc47)break;else _0x3be909['push'](_0x3be909['shift']());}catch(_0x41f567){_0x3be909['push'](_0x3be909['shift']());}}}(a20_0x13b1,0x6eb25));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}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';import{getCampaignUrl}from'../sdk/client/endpoints.js';function a20_0x13b1(){const _0x2ade29=['updateTemplate','Update\x20a\x20workspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','engage:workspace:show','limit','engage:workspaces','\x27\x20launched\x20successfully','Update\x20a\x20campaign','data','8lwKUyg','Updating\x20campaign\x20\x27','Workspace\x20is\x20required\x20for\x20this\x20operation','5537870tJWdCJ','engage:campaign:duplicate','createCampaign','Delete\x20a\x20campaign','workspace','launchCampaign','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','deleteCampaign','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Error:\x20--name\x20is\x20required','startAt','Workspace\x20\x27','execute','\x27...','engage:campaign:resume','engage:workspace:delete','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','description','getTemplateFull','Error:\x20--html\x20is\x20required','fromEntries','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Engage\x20workspace\x20set\x20to:\x20','map','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','length','listCampaigns','engage','filter','listWorkspaces','10oorhJE','subject','engage:workspace:create','Create\x20a\x20workspace','List\x20email\x20templates','Launching\x20campaign\x20\x27','\x27\x20resumed\x20successfully','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','status','html','\x27?\x20This\x20cannot\x20be\x20undone.','deleteTemplate','full','MISSING_ARGUMENT','attributes','687801bZerzq','Operation\x20cancelled','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','jsonColumns','\x27\x20paused\x20successfully','engage:templates','31281IxMJEe','updateCampaign','pauseCampaign','2750699Wpeuql','plaintext','Verifying\x20workspace\x20\x27','4maEZau','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','engage:campaigns','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','66aJXkBX','engage:campaign:delete','log','List\x20workspaces','engage:workspace:use','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','yes','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaign:pause','segmentId','resolvePathToResource','Fetching\x20templates...','engage:template:show','resolveWorkspaceId','segment','Creating\x20workspace\x20\x27','format','error','name','getTemplate','engage:workspace:update','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Deleting\x20campaign\x20\x27','Create\x20a\x20new\x20campaign','type','session','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','parentName','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','timezone','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Create\x20an\x20email\x20template','jsonl','getCampaign','updateWorkspace','deleteWorkspace','engage:template:create','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','getCampaignFull','Pausing\x20campaign\x20\x27','emailSenderId','Fetching\x20workspace\x20\x27','5367010xvtxfj','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','engage:campaign:launch','listTemplates','Campaign\x20\x27','Pause\x20a\x20campaign','workspaceId','verbose','Creating\x20template\x20\x27','Fetching\x20campaign\x20\x27','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Template\x20\x27','getWorkspaceFull','Show\x20email\x20template\x20details','Options:\x20--name,\x20--description','parentId','List\x20campaigns','Updating\x20template\x20\x27','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','entries','3228516bnooCO','resumeCampaign','Show\x20campaign\x20details','45175kXisGz','engage:campaign:show','\x27\x20deleted\x20successfully'];a20_0x13b1=function(){return _0x2ade29;};return a20_0x13b1();}export async function resolveWorkspaceIdFromOptions(_0x4b4992,_0x541c9e,_0x2746ac=![]){const _0x1bce57=a20_0x6d0b;if(_0x4b4992[_0x1bce57(0x237)])return await _0x541c9e['engage'][_0x1bce57(0x1ee)](_0x4b4992[_0x1bce57(0x237)]);const _0x1b446e=loadSessionContext(_0x4b4992[_0x1bce57(0x1fb)]);if(_0x1b446e?.['engage_workspace'])return await _0x541c9e[_0x1bce57(0x251)][_0x1bce57(0x1ee)](_0x1b446e['engage_workspace']);if(_0x2746ac)throw new SDKError(ErrorCode[_0x1bce57(0x262)],_0x1bce57(0x232),undefined,{'helpText':_0x1bce57(0x23a)});return undefined;}async function resolveSegmentFromOptions(_0x70d6d0,_0x1f2cd2){const _0x3690e8=a20_0x6d0b;if(!_0x70d6d0[_0x3690e8(0x1ef)])return{};const _0x14a097=_0x70d6d0[_0x3690e8(0x1ef)],_0x1720e2=await _0x1f2cd2[_0x3690e8(0x1ef)][_0x3690e8(0x1eb)](_0x14a097);return{'audienceId':_0x1720e2[_0x3690e8(0x21c)],'audienceName':_0x1720e2[_0x3690e8(0x1fd)],..._0x1720e2['segmentId']&&{'segmentId':_0x1720e2[_0x3690e8(0x1ea)],'segmentName':_0x1720e2['segmentName']}};}function buildConnectorConfig(_0xac3cc4){const _0x379c22=a20_0x6d0b,_0x58d8fd=_0xac3cc4[_0x379c22(0x20a)],_0x996417=_0xac3cc4[_0x379c22(0x267)];if(!_0x58d8fd&&!_0x996417)return undefined;return{..._0x58d8fd&&{'emailSenderId':_0x58d8fd},..._0x996417&&{'jsonColumns':_0x996417}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a20_0x35e874(0x272);[a20_0x35e874(0x246)]=a20_0x35e874(0x21d);async[a20_0x35e874(0x240)](_0x536ade){const _0x402fe0=a20_0x35e874,{options:_0x1311f8,args:_0x26eb36,tdx:_0x219d29}=_0x536ade,_0x1e96db=_0x26eb36[0x0],_0x211ced=resolveLimit(_0x1311f8['limit'],DEFAULT_LLM_LIMIT),_0x57d139=_0x1311f8,_0x19837f=_0x57d139[_0x402fe0(0x1fa)],_0x92aa5=_0x57d139[_0x402fe0(0x25d)],_0x378e66=await resolveWorkspaceIdFromOptions(_0x57d139,_0x219d29),_0x537d71=await withSpinner('Fetching\x20campaigns...',()=>_0x219d29['engage'][_0x402fe0(0x250)]({'type':_0x19837f,'status':_0x92aa5,'workspaceId':_0x378e66,'limit':_0x211ced}),{'verbose':_0x1311f8[_0x402fe0(0x213)]});let _0x2d4f7c=_0x537d71['data'];_0x1e96db&&(_0x2d4f7c=_0x537d71[_0x402fe0(0x22f)][_0x402fe0(0x252)](_0x18edf7=>matchGlobPattern(_0x18edf7[_0x402fe0(0x1f3)],_0x1e96db)));const _0xdce3b2=_0x1311f8['site'];if(_0x1311f8[_0x402fe0(0x1f1)]==='json'||_0x1311f8[_0x402fe0(0x1f1)]===_0x402fe0(0x202)){const _0x907271=_0x2d4f7c[_0x402fe0(0x24c)](_0xefca0f=>({..._0xefca0f,'url':_0xefca0f[_0x402fe0(0x212)]?getCampaignUrl(_0xdce3b2,_0xefca0f[_0x402fe0(0x212)],_0xefca0f['id']):undefined}));await handleSDKOutput(_0x907271,_0x1311f8);}else await handleSDKOutput(_0x2d4f7c,_0x1311f8);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x225);[a20_0x35e874(0x246)]=a20_0x35e874(0x223);async[a20_0x35e874(0x240)](_0x13caf7){const _0x1080cb=a20_0x35e874,{options:_0x46921d,args:_0x26916d,tdx:_0x440f68}=_0x13caf7;if(_0x26916d[_0x1080cb(0x24f)]===0x0)return console[_0x1080cb(0x1f2)](_0x1080cb(0x1e5)),console[_0x1080cb(0x1f2)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x35454a=_0x26916d[0x0],_0x410137=_0x46921d,_0x55979c=await resolveWorkspaceIdFromOptions(_0x410137,_0x440f68),_0x592a5a=_0x410137['full'],_0x3271c8=_0x46921d['site'];if(_0x592a5a){const _0xe604d0=await withSpinner('Fetching\x20campaign\x20\x27'+_0x35454a+_0x1080cb(0x241),()=>_0x440f68[_0x1080cb(0x251)][_0x1080cb(0x208)](_0x35454a,_0x55979c),{'verbose':_0x46921d[_0x1080cb(0x213)]}),_0x13c3af=_0xe604d0['data'],_0xa039a6=_0x13c3af[_0x1080cb(0x263)]['workspaceId']?getCampaignUrl(_0x3271c8,_0x13c3af[_0x1080cb(0x263)]['workspaceId'],_0x13c3af['id']):undefined;await handleSDKOutput([{..._0x13c3af,..._0xa039a6&&{'url':_0xa039a6}}],_0x46921d);}else{const _0x4bc560=await withSpinner(_0x1080cb(0x215)+_0x35454a+_0x1080cb(0x241),()=>_0x440f68[_0x1080cb(0x251)][_0x1080cb(0x203)](_0x35454a,_0x55979c),{'verbose':_0x46921d[_0x1080cb(0x213)]}),_0x3ef9df=_0x4bc560[_0x1080cb(0x22f)],_0x18f0a2=_0x3ef9df[_0x1080cb(0x212)]?getCampaignUrl(_0x3271c8,_0x3ef9df['workspaceId'],_0x3ef9df['id']):undefined;await handleSingleObjectOutput({..._0x3ef9df,..._0x18f0a2&&{'url':_0x18f0a2}},_0x46921d);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']='engage:campaign:create';['description']=a20_0x35e874(0x1f9);async[a20_0x35e874(0x240)](_0x1955b1){const _0x4628b2=a20_0x35e874,{options:_0x360900,tdx:_0x298e31}=_0x1955b1,_0x3b6558=_0x360900,_0x27c016=_0x3b6558[_0x4628b2(0x1f3)],_0x31f7e2=_0x3b6558[_0x4628b2(0x1fa)];if(!_0x27c016)return console['error'](_0x4628b2(0x23d)),console['error'](_0x4628b2(0x271)),0x1;if(!_0x31f7e2)return console[_0x4628b2(0x1f2)](_0x4628b2(0x217)),console[_0x4628b2(0x1f2)](_0x4628b2(0x271)),0x1;const _0x2cf72a=await resolveWorkspaceIdFromOptions(_0x3b6558,_0x298e31,!![]),_0x245393=await resolveSegmentFromOptions(_0x3b6558,_0x298e31),_0x4d8a40=buildConnectorConfig(_0x3b6558),_0x1450ba={'name':_0x27c016,'campaignType':_0x31f7e2,'workspaceId':_0x2cf72a,'description':_0x3b6558[_0x4628b2(0x246)],..._0x245393,'connectorConfig':_0x4d8a40,'startAt':_0x3b6558[_0x4628b2(0x23e)],'timezone':_0x3b6558[_0x4628b2(0x1ff)]},_0x5ddba3=await withSpinner('Creating\x20campaign\x20\x27'+_0x27c016+'\x27...',()=>_0x298e31[_0x4628b2(0x251)][_0x4628b2(0x235)](_0x1450ba));return await handleSDKOutput([_0x5ddba3[_0x4628b2(0x22f)]],_0x360900),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a20_0x35e874(0x1f3)]='engage:campaign:update';[a20_0x35e874(0x246)]=a20_0x35e874(0x22e);async['execute'](_0x11ee26){const _0x506057=a20_0x35e874,{options:_0x430990,args:_0x166e93,tdx:_0x1ccc69}=_0x11ee26;if(_0x166e93['length']===0x0)return console[_0x506057(0x1f2)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x506057(0x1e8)),0x1;const _0x39b603=_0x166e93[0x0],_0x17fb01=_0x430990,_0x4de679=await resolveWorkspaceIdFromOptions(_0x17fb01,_0x1ccc69),_0x3f6ffc=await resolveSegmentFromOptions(_0x17fb01,_0x1ccc69),_0x28456c=buildConnectorConfig(_0x17fb01),_0x104295={'name':_0x17fb01[_0x506057(0x1f3)],'description':_0x17fb01['description'],..._0x3f6ffc,'connectorConfig':_0x28456c,'startAt':_0x17fb01[_0x506057(0x23e)],'timezone':_0x17fb01[_0x506057(0x1ff)]},_0x5dd2ae=Object[_0x506057(0x249)](Object[_0x506057(0x220)](_0x104295)[_0x506057(0x252)](([,_0x3d0340])=>_0x3d0340!==undefined));if(Object['keys'](_0x5dd2ae)[_0x506057(0x24f)]===0x0)return console[_0x506057(0x1f2)](_0x506057(0x273)),console[_0x506057(0x1f2)](_0x506057(0x25b)),0x1;const _0x1da5ba=await withSpinner(_0x506057(0x231)+_0x39b603+_0x506057(0x241),()=>_0x1ccc69[_0x506057(0x251)][_0x506057(0x26b)](_0x39b603,_0x5dd2ae,_0x4de679),{'verbose':_0x430990['verbose']});return await handleSDKOutput([_0x1da5ba[_0x506057(0x22f)]],_0x430990),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x275);['description']=a20_0x35e874(0x236);async[a20_0x35e874(0x240)](_0xb198c7){const _0x9343c5=a20_0x35e874,{options:_0x27839b,args:_0xf2e5fd,tdx:_0x223fd1}=_0xb198c7;if(_0xf2e5fd[_0x9343c5(0x24f)]===0x0)return console[_0x9343c5(0x1f2)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x9343c5(0x239)),0x1;const _0x23308d=_0xf2e5fd[0x0],_0x348e06=_0x27839b,_0x274199=await resolveWorkspaceIdFromOptions(_0x348e06,_0x223fd1);if(!_0x27839b[_0x9343c5(0x1e6)]){const _0x56a755=await confirm(_0x9343c5(0x1f7)+_0x23308d+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x56a755)return console[_0x9343c5(0x276)](_0x9343c5(0x265)),0x0;}return await withSpinner(_0x9343c5(0x1f8)+_0x23308d+_0x9343c5(0x241),()=>_0x223fd1['engage'][_0x9343c5(0x23b)](_0x23308d,_0x274199),{'verbose':_0x27839b[_0x9343c5(0x213)]}),console['log'](_0x9343c5(0x210)+_0x23308d+'\x27\x20deleted\x20successfully'),0x0;}}function a20_0x6d0b(_0x2de475,_0xed72b6){_0x2de475=_0x2de475-0x1e4;const _0x13b14b=a20_0x13b1();let _0x6d0b7e=_0x13b14b[_0x2de475];return _0x6d0b7e;}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x20e);[a20_0x35e874(0x246)]='Launch\x20a\x20campaign';async[a20_0x35e874(0x240)](_0x4c2dd8){const _0x7f0bd9=a20_0x35e874,{options:_0x2f4045,args:_0x5a5448,tdx:_0x2ba39c}=_0x4c2dd8;if(_0x5a5448['length']===0x0)return console[_0x7f0bd9(0x1f2)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x7f0bd9(0x1f2)](_0x7f0bd9(0x24d)),0x1;const _0x204834=_0x5a5448[0x0],_0x43cad8=_0x2f4045,_0x4aa6c4=await resolveWorkspaceIdFromOptions(_0x43cad8,_0x2ba39c);return await withSpinner(_0x7f0bd9(0x259)+_0x204834+_0x7f0bd9(0x241),()=>_0x2ba39c[_0x7f0bd9(0x251)][_0x7f0bd9(0x238)](_0x204834,_0x4aa6c4),{'verbose':_0x2f4045[_0x7f0bd9(0x213)]}),console['log']('Campaign\x20\x27'+_0x204834+_0x7f0bd9(0x22d)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a20_0x35e874(0x1e9);[a20_0x35e874(0x246)]=a20_0x35e874(0x211);async[a20_0x35e874(0x240)](_0xa03f90){const _0x2a3df6=a20_0x35e874,{options:_0x352b9d,args:_0x5b2810,tdx:_0x542e47}=_0xa03f90;if(_0x5b2810[_0x2a3df6(0x24f)]===0x0)return console[_0x2a3df6(0x1f2)](_0x2a3df6(0x1e5)),console[_0x2a3df6(0x1f2)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x4936b6=_0x5b2810[0x0],_0x44d7a1=_0x352b9d,_0x79fda6=await resolveWorkspaceIdFromOptions(_0x44d7a1,_0x542e47);return await withSpinner(_0x2a3df6(0x209)+_0x4936b6+_0x2a3df6(0x241),()=>_0x542e47[_0x2a3df6(0x251)][_0x2a3df6(0x26c)](_0x4936b6,_0x79fda6),{'verbose':_0x352b9d[_0x2a3df6(0x213)]}),console[_0x2a3df6(0x276)]('Campaign\x20\x27'+_0x4936b6+_0x2a3df6(0x268)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x242);[a20_0x35e874(0x246)]='Resume\x20a\x20paused\x20campaign';async[a20_0x35e874(0x240)](_0x21a35a){const _0x545397=a20_0x35e874,{options:_0x218132,args:_0x3cfabc,tdx:_0x231169}=_0x21a35a;if(_0x3cfabc[_0x545397(0x24f)]===0x0)return console[_0x545397(0x1f2)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x545397(0x1fc)),0x1;const _0x4e8dfc=_0x3cfabc[0x0],_0x438939=_0x218132,_0x1c074e=await resolveWorkspaceIdFromOptions(_0x438939,_0x231169);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x4e8dfc+_0x545397(0x241),()=>_0x231169[_0x545397(0x251)][_0x545397(0x222)](_0x4e8dfc,_0x1c074e),{'verbose':_0x218132['verbose']}),console[_0x545397(0x276)]('Campaign\x20\x27'+_0x4e8dfc+_0x545397(0x25a)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x234);[a20_0x35e874(0x246)]='Duplicate\x20a\x20campaign';async['execute'](_0x43b725){const _0x5ddf73=a20_0x35e874,{options:_0x463f9b,args:_0x2a61bb,tdx:_0x2d214c}=_0x43b725;if(_0x2a61bb[_0x5ddf73(0x24f)]===0x0)return console[_0x5ddf73(0x1f2)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x5ddf73(0x1f2)](_0x5ddf73(0x1e7)),0x1;const _0x5dd284=_0x2a61bb[0x0],_0x278961=_0x463f9b,_0x14a066=await resolveWorkspaceIdFromOptions(_0x278961,_0x2d214c),_0x48bec0=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x5dd284+'\x27...',()=>_0x2d214c[_0x5ddf73(0x251)]['duplicateCampaign'](_0x5dd284,_0x14a066),{'verbose':_0x463f9b['verbose']});return await handleSDKOutput([_0x48bec0['data']],_0x463f9b),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x269);[a20_0x35e874(0x246)]=a20_0x35e874(0x258);async['execute'](_0xba705){const _0x33b702=a20_0x35e874,{options:_0xc1d616,args:_0x36db82,tdx:_0x1c11d0}=_0xba705,_0x6e556=_0x36db82[0x0],_0x3370d2=resolveLimit(_0xc1d616['limit'],DEFAULT_LLM_LIMIT),_0x8ec6c4=_0xc1d616,_0x587d9d=await resolveWorkspaceIdFromOptions(_0x8ec6c4,_0x1c11d0),_0x2fe088=await withSpinner(_0x33b702(0x1ec),()=>_0x1c11d0[_0x33b702(0x251)][_0x33b702(0x20f)]({'workspaceId':_0x587d9d,'limit':_0x3370d2}),{'verbose':_0xc1d616[_0x33b702(0x213)]});let _0x52a5fd=_0x2fe088[_0x33b702(0x22f)];return _0x6e556&&(_0x52a5fd=_0x2fe088[_0x33b702(0x22f)][_0x33b702(0x252)](_0xe82856=>matchGlobPattern(_0xe82856[_0x33b702(0x1f3)],_0x6e556))),await handleSDKOutput(_0x52a5fd,_0xc1d616),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x1ed);[a20_0x35e874(0x246)]=a20_0x35e874(0x21a);async[a20_0x35e874(0x240)](_0x3e7142){const _0x5d3f87=a20_0x35e874,{options:_0x2665aa,args:_0x218140,tdx:_0x5bea6a}=_0x3e7142;if(_0x218140[_0x5d3f87(0x24f)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x5d3f87(0x1f2)](_0x5d3f87(0x1fe)),0x1;const _0x30485c=_0x218140[0x0],_0x3b5d78=_0x2665aa,_0xc7a874=await resolveWorkspaceIdFromOptions(_0x3b5d78,_0x5bea6a),_0x1f1a8d=_0x3b5d78['full'];if(_0x1f1a8d){const _0x214c7f=await withSpinner('Fetching\x20template\x20\x27'+_0x30485c+_0x5d3f87(0x241),()=>_0x5bea6a[_0x5d3f87(0x251)][_0x5d3f87(0x247)](_0x30485c,_0xc7a874),{'verbose':_0x2665aa[_0x5d3f87(0x213)]});await handleSDKOutput([_0x214c7f],_0x2665aa);}else{const _0xbf775f=await withSpinner('Fetching\x20template\x20\x27'+_0x30485c+_0x5d3f87(0x241),()=>_0x5bea6a[_0x5d3f87(0x251)][_0x5d3f87(0x1f4)](_0x30485c,_0xc7a874),{'verbose':_0x2665aa[_0x5d3f87(0x213)]});await handleSDKOutput([_0xbf775f],_0x2665aa);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x206);[a20_0x35e874(0x246)]=a20_0x35e874(0x201);async[a20_0x35e874(0x240)](_0x18afa6){const _0x423618=a20_0x35e874,{options:_0x1d84b9,tdx:_0x2cb55a}=_0x18afa6,_0x3e9c88=_0x1d84b9,_0x2b129c=_0x3e9c88[_0x423618(0x1f3)],_0x2cf2fc=_0x3e9c88[_0x423618(0x255)],_0x2bd97c=_0x3e9c88[_0x423618(0x25e)];if(!_0x2b129c)return console[_0x423618(0x1f2)](_0x423618(0x23d)),console[_0x423618(0x1f2)](_0x423618(0x244)),0x1;if(!_0x2cf2fc)return console['error']('Error:\x20--subject\x20is\x20required'),0x1;if(!_0x2bd97c)return console[_0x423618(0x1f2)](_0x423618(0x248)),0x1;const _0x393087=await resolveWorkspaceIdFromOptions(_0x3e9c88,_0x2cb55a,!![]),_0x141232={'name':_0x2b129c,'subjectTemplate':_0x2cf2fc,'htmlTemplate':_0x2bd97c,'workspaceId':_0x393087,'plaintextTemplate':_0x3e9c88[_0x423618(0x26e)],'editorType':_0x3e9c88['editorType']},_0x94a27=await withSpinner(_0x423618(0x214)+_0x2b129c+'\x27...',()=>_0x2cb55a['engage']['createTemplate'](_0x141232));return await handleSDKOutput([_0x94a27['data']],_0x1d84b9),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x35e874(0x1f3)]='engage:template:update';[a20_0x35e874(0x246)]='Update\x20an\x20email\x20template';async[a20_0x35e874(0x240)](_0x40a401){const _0x5524f9=a20_0x35e874,{options:_0x48e02e,args:_0x3acc5c,tdx:_0x39b82a}=_0x40a401;if(_0x3acc5c[_0x5524f9(0x24f)]===0x0)return console[_0x5524f9(0x1f2)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x5524f9(0x245)),0x1;const _0x47b556=_0x3acc5c[0x0],_0x5235f1=_0x48e02e,_0x228bdf=await resolveWorkspaceIdFromOptions(_0x5235f1,_0x39b82a),_0x15598f={'name':_0x5235f1[_0x5524f9(0x1f3)],'subjectTemplate':_0x5235f1['subject'],'htmlTemplate':_0x5235f1[_0x5524f9(0x25e)],'plaintextTemplate':_0x5235f1[_0x5524f9(0x26e)]},_0x515c96=Object[_0x5524f9(0x249)](Object[_0x5524f9(0x220)](_0x15598f)[_0x5524f9(0x252)](([,_0x2ff179])=>_0x2ff179!==undefined));if(Object['keys'](_0x515c96)[_0x5524f9(0x24f)]===0x0)return console[_0x5524f9(0x1f2)](_0x5524f9(0x273)),console['error'](_0x5524f9(0x21f)),0x1;const _0xd1825f=await withSpinner(_0x5524f9(0x21e)+_0x47b556+_0x5524f9(0x241),()=>_0x39b82a[_0x5524f9(0x251)][_0x5524f9(0x227)](_0x47b556,_0x515c96,_0x228bdf),{'verbose':_0x48e02e['verbose']});return await handleSDKOutput([_0xd1825f[_0x5524f9(0x22f)]],_0x48e02e),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a20_0x35e874(0x1f3)]='engage:template:delete';['description']='Delete\x20an\x20email\x20template';async[a20_0x35e874(0x240)](_0x5685dd){const _0x2f9dbf=a20_0x35e874,{options:_0x113f63,args:_0x31c969,tdx:_0x8b6c2a}=_0x5685dd;if(_0x31c969['length']===0x0)return console['error'](_0x2f9dbf(0x23c)),console[_0x2f9dbf(0x1f2)](_0x2f9dbf(0x25c)),0x1;const _0x4442c3=_0x31c969[0x0],_0x5d811c=_0x113f63,_0x519700=await resolveWorkspaceIdFromOptions(_0x5d811c,_0x8b6c2a);if(!_0x113f63[_0x2f9dbf(0x1e6)]){const _0x980cfc=await confirm(_0x2f9dbf(0x229)+_0x4442c3+_0x2f9dbf(0x25f));if(!_0x980cfc)return console[_0x2f9dbf(0x276)](_0x2f9dbf(0x265)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x4442c3+_0x2f9dbf(0x241),()=>_0x8b6c2a['engage'][_0x2f9dbf(0x260)](_0x4442c3,_0x519700),{'verbose':_0x113f63['verbose']}),console[_0x2f9dbf(0x276)](_0x2f9dbf(0x218)+_0x4442c3+_0x2f9dbf(0x226)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x22c);[a20_0x35e874(0x246)]=a20_0x35e874(0x277);async[a20_0x35e874(0x240)](_0x2c6814){const _0x1ab611=a20_0x35e874,{options:_0x43e8b0,args:_0x4f852a,tdx:_0x178c0c}=_0x2c6814,_0x3829fd=_0x4f852a[0x0],_0x4b5e92=resolveLimit(_0x43e8b0[_0x1ab611(0x22b)],DEFAULT_LLM_LIMIT),_0x1b6d99=await withSpinner('Fetching\x20workspaces...',()=>_0x178c0c[_0x1ab611(0x251)][_0x1ab611(0x253)]({'limit':_0x4b5e92}),{'verbose':_0x43e8b0['verbose']});let _0x5e1f07=_0x1b6d99[_0x1ab611(0x22f)];return _0x3829fd&&(_0x5e1f07=_0x1b6d99[_0x1ab611(0x22f)][_0x1ab611(0x252)](_0x4b7ab4=>matchGlobPattern(_0x4b7ab4[_0x1ab611(0x1f3)],_0x3829fd))),await handleSDKOutput(_0x5e1f07,_0x43e8b0),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x22a);[a20_0x35e874(0x246)]='Show\x20workspace\x20details';async['execute'](_0x1e64e6){const _0xc0b710=a20_0x35e874,{options:_0x5c4953,args:_0x49b513,tdx:_0x54734d}=_0x1e64e6;if(_0x49b513[_0xc0b710(0x24f)]===0x0)return console['error'](_0xc0b710(0x24a)),console[_0xc0b710(0x1f2)](_0xc0b710(0x24e)),0x1;const _0xecff9b=_0x49b513[0x0],_0x3dff1f=_0x5c4953,_0x2c596c=_0x3dff1f[_0xc0b710(0x261)];if(_0x2c596c){const _0x25b46d=await withSpinner('Fetching\x20workspace\x20\x27'+_0xecff9b+_0xc0b710(0x241),()=>_0x54734d[_0xc0b710(0x251)][_0xc0b710(0x219)](_0xecff9b),{'verbose':_0x5c4953[_0xc0b710(0x213)]});await handleSDKOutput([_0x25b46d],_0x5c4953);}else{const _0x3c98bf=await withSpinner(_0xc0b710(0x20b)+_0xecff9b+_0xc0b710(0x241),()=>_0x54734d[_0xc0b710(0x251)]['getWorkspace'](_0xecff9b),{'verbose':_0x5c4953['verbose']});await handleSDKOutput([_0x3c98bf],_0x5c4953);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a20_0x35e874(0x256);[a20_0x35e874(0x246)]=a20_0x35e874(0x257);async[a20_0x35e874(0x240)](_0x290ae1){const _0x58d4db=a20_0x35e874,{options:_0x578db8,tdx:_0x2a7f78}=_0x290ae1,_0x58bbd7=_0x578db8,_0x5caa2c=_0x58bbd7[_0x58d4db(0x1f3)];if(!_0x5caa2c)return console[_0x58d4db(0x1f2)]('Error:\x20--name\x20is\x20required'),console[_0x58d4db(0x1f2)](_0x58d4db(0x1f6)),0x1;const _0x5a60f0={'name':_0x5caa2c,'description':_0x58bbd7['description']},_0x42c8ff=await withSpinner(_0x58d4db(0x1f0)+_0x5caa2c+_0x58d4db(0x241),()=>_0x2a7f78[_0x58d4db(0x251)]['createWorkspace'](_0x5a60f0));return await handleSDKOutput([_0x42c8ff['data']],_0x578db8),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x1f5);[a20_0x35e874(0x246)]=a20_0x35e874(0x228);async[a20_0x35e874(0x240)](_0x4a203d){const _0x5eb54a=a20_0x35e874,{options:_0x3d54f2,args:_0x27b8bd,tdx:_0x4be4d8}=_0x4a203d;if(_0x27b8bd[_0x5eb54a(0x24f)]===0x0)return console[_0x5eb54a(0x1f2)](_0x5eb54a(0x24a)),console[_0x5eb54a(0x1f2)](_0x5eb54a(0x266)),0x1;const _0x539104=_0x27b8bd[0x0],_0x752b3=_0x3d54f2,_0xa60a10={'name':_0x752b3[_0x5eb54a(0x1f3)],'description':_0x752b3[_0x5eb54a(0x246)]},_0x4ff01=Object[_0x5eb54a(0x249)](Object[_0x5eb54a(0x220)](_0xa60a10)['filter'](([,_0x30940b])=>_0x30940b!==undefined));if(Object['keys'](_0x4ff01)[_0x5eb54a(0x24f)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x5eb54a(0x1f2)](_0x5eb54a(0x21b)),0x1;const _0x365196=await withSpinner('Updating\x20workspace\x20\x27'+_0x539104+_0x5eb54a(0x241),()=>_0x4be4d8[_0x5eb54a(0x251)][_0x5eb54a(0x204)](_0x539104,_0x4ff01),{'verbose':_0x3d54f2[_0x5eb54a(0x213)]});return await handleSDKOutput([_0x365196['data']],_0x3d54f2),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x243);[a20_0x35e874(0x246)]='Delete\x20a\x20workspace';async[a20_0x35e874(0x240)](_0x5acb7b){const _0x3966de=a20_0x35e874,{options:_0x56ccfe,args:_0x216e40,tdx:_0x394c62}=_0x5acb7b;if(_0x216e40[_0x3966de(0x24f)]===0x0)return console[_0x3966de(0x1f2)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x3966de(0x1f2)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x1419e0=_0x216e40[0x0];if(!_0x56ccfe['yes']){const _0x48f547=await confirm(_0x3966de(0x200)+_0x1419e0+_0x3966de(0x25f));if(!_0x48f547)return console[_0x3966de(0x276)](_0x3966de(0x265)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x1419e0+_0x3966de(0x241),()=>_0x394c62[_0x3966de(0x251)][_0x3966de(0x205)](_0x1419e0),{'verbose':_0x56ccfe[_0x3966de(0x213)]}),console['log'](_0x3966de(0x23f)+_0x1419e0+_0x3966de(0x226)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x35e874(0x1f3)]=a20_0x35e874(0x1e4);[a20_0x35e874(0x246)]=a20_0x35e874(0x216);async['execute'](_0x1f7b75){const _0x27e788=a20_0x35e874,{options:_0x18e55f,args:_0x3230e7,tdx:_0x3f841a}=_0x1f7b75;if(_0x3230e7[_0x27e788(0x24f)]===0x0)return console[_0x27e788(0x1f2)]('Error:\x20Workspace\x20name\x20is\x20required'),console[_0x27e788(0x1f2)](_0x27e788(0x207)),0x1;const _0x5d6578=_0x3230e7[0x0];await withSpinner(_0x27e788(0x26f)+_0x5d6578+_0x27e788(0x241),()=>_0x3f841a[_0x27e788(0x251)]['resolveWorkspaceId'](_0x5d6578));const _0x4f1a5b=_0x18e55f['session']||undefined;return saveSessionContext({'engage_workspace':_0x5d6578},_0x4f1a5b),console[_0x27e788(0x276)](_0x27e788(0x24b)+_0x5d6578),console['log'](_0x27e788(0x20d)),0x0;}}
|
|
1
|
+
const a20_0x1d3a8b=a20_0x45e1;(function(_0xea41bc,_0x432792){const _0x599993=a20_0x45e1,_0x38d99e=_0xea41bc();while(!![]){try{const _0x415f5e=-parseInt(_0x599993(0x9e))/0x1*(-parseInt(_0x599993(0x105))/0x2)+-parseInt(_0x599993(0xc0))/0x3+-parseInt(_0x599993(0xbe))/0x4+parseInt(_0x599993(0x103))/0x5+-parseInt(_0x599993(0xd2))/0x6+parseInt(_0x599993(0x104))/0x7*(parseInt(_0x599993(0x96))/0x8)+-parseInt(_0x599993(0xf7))/0x9*(-parseInt(_0x599993(0xf0))/0xa);if(_0x415f5e===_0x432792)break;else _0x38d99e['push'](_0x38d99e['shift']());}catch(_0x2d0826){_0x38d99e['push'](_0x38d99e['shift']());}}}(a20_0x2579,0x28249));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}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';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0xf03766,_0x58c92c,_0x32a86e=![]){const _0x3450e2=a20_0x45e1;if(_0xf03766[_0x3450e2(0xa5)])return await _0x58c92c[_0x3450e2(0xa6)][_0x3450e2(0x123)](_0xf03766[_0x3450e2(0xa5)]);const _0x2e82e2=loadSessionContext(_0xf03766[_0x3450e2(0xd3)]);if(_0x2e82e2?.[_0x3450e2(0xd0)])return await _0x58c92c[_0x3450e2(0xa6)][_0x3450e2(0x123)](_0x2e82e2[_0x3450e2(0xd0)]);if(_0x32a86e)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x3450e2(0x9a),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x166c24,_0x280fc0){const _0x1569de=a20_0x45e1;if(!_0x166c24['segment'])return{};const _0x558de5=_0x166c24['segment'],_0x588d97=await _0x280fc0[_0x1569de(0x110)][_0x1569de(0xe6)](_0x558de5);return{'audienceId':_0x588d97[_0x1569de(0x118)],'audienceName':_0x588d97[_0x1569de(0xdb)],..._0x588d97[_0x1569de(0xc9)]&&{'segmentId':_0x588d97[_0x1569de(0xc9)],'segmentName':_0x588d97['segmentName']}};}function buildConnectorConfig(_0x3796e2){const _0x5a266b=a20_0x45e1,_0x17174d=_0x3796e2['emailSenderId'],_0x3e38e4=_0x3796e2[_0x5a266b(0xfe)];if(!_0x17174d&&!_0x3e38e4)return undefined;return{..._0x17174d&&{'emailSenderId':_0x17174d},..._0x3e38e4&&{'jsonColumns':_0x3e38e4}};}export class EngageCampaignsCommand extends BaseCommand{['name']='engage:campaigns';[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xcc);async['execute'](_0x2c78bf){const _0x3ffe16=a20_0x1d3a8b,{options:_0x2a9568,args:_0x565e49,tdx:_0x1603bc}=_0x2c78bf,_0x3cda2d=_0x565e49[0x0],_0x109d80=resolveLimit(_0x2a9568['limit'],DEFAULT_LLM_LIMIT),_0x3546c6=_0x2a9568,_0x29fb4b=_0x3546c6[_0x3ffe16(0x92)],_0x13b91d=_0x3546c6['status'],_0x232f92=await resolveWorkspaceIdFromOptions(_0x3546c6,_0x1603bc),_0x4afeab=await withSpinner(_0x3ffe16(0x9c),()=>_0x1603bc[_0x3ffe16(0xa6)]['listCampaigns']({'type':_0x29fb4b,'status':_0x13b91d,'workspaceId':_0x232f92,'limit':_0x109d80}),{'verbose':_0x2a9568[_0x3ffe16(0x10b)]});let _0x28cbe4=_0x4afeab[_0x3ffe16(0x91)];_0x3cda2d&&(_0x28cbe4=_0x4afeab['data'][_0x3ffe16(0xb8)](_0x3a7954=>matchGlobPattern(_0x3a7954['name'],_0x3cda2d)));const _0x1a8b6f=_0x2a9568[_0x3ffe16(0x10c)];if(_0x2a9568['format']===_0x3ffe16(0xea)||_0x2a9568[_0x3ffe16(0x100)]===_0x3ffe16(0x97)){const _0x245b60=_0x28cbe4[_0x3ffe16(0xe9)](_0x4e504d=>({..._0x4e504d,'url':_0x4e504d['workspaceId']?getCampaignUrl(_0x1a8b6f,_0x4e504d['workspaceId'],_0x4e504d['id']):undefined}));await handleSDKOutput(_0x245b60,_0x2a9568);}else await handleSDKOutput(_0x28cbe4,_0x2a9568);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]='engage:campaign:show';[a20_0x1d3a8b(0x119)]='Show\x20campaign\x20details';async['execute'](_0x4d4054){const _0x1587c1=a20_0x1d3a8b,{options:_0x16ba29,args:_0x215374,tdx:_0x4c1f50}=_0x4d4054;if(_0x215374[_0x1587c1(0xa4)]===0x0)return console[_0x1587c1(0x98)](_0x1587c1(0x121)),console[_0x1587c1(0x98)](_0x1587c1(0xb9)),0x1;const _0x3a18a2=_0x215374[0x0],_0x1d2687=_0x16ba29,_0x4d0a93=await resolveWorkspaceIdFromOptions(_0x1d2687,_0x4c1f50),_0x505e38=_0x1d2687[_0x1587c1(0xdd)],_0x141f82=_0x16ba29[_0x1587c1(0x10c)];if(_0x505e38){const _0x42d39f=await withSpinner(_0x1587c1(0xb6)+_0x3a18a2+_0x1587c1(0xf1),()=>_0x4c1f50['engage'][_0x1587c1(0xf6)](_0x3a18a2,_0x4d0a93),{'verbose':_0x16ba29['verbose']}),_0x417225=_0x42d39f['data'],_0x333f2c=_0x417225[_0x1587c1(0xbb)][_0x1587c1(0x111)]?getCampaignUrl(_0x141f82,_0x417225[_0x1587c1(0xbb)][_0x1587c1(0x111)],_0x417225['id']):undefined;await handleSDKOutput([{..._0x417225,..._0x333f2c&&{'url':_0x333f2c}}],_0x16ba29);}else{const _0x8a10cb=await withSpinner(_0x1587c1(0xb6)+_0x3a18a2+_0x1587c1(0xf1),()=>_0x4c1f50[_0x1587c1(0xa6)][_0x1587c1(0xf8)](_0x3a18a2,_0x4d0a93),{'verbose':_0x16ba29[_0x1587c1(0x10b)]}),_0x55bdde=_0x8a10cb[_0x1587c1(0x91)],_0x5ce931=_0x55bdde['workspaceId']?getCampaignUrl(_0x141f82,_0x55bdde[_0x1587c1(0x111)],_0x55bdde['id']):undefined;await handleSingleObjectOutput({..._0x55bdde,..._0x5ce931&&{'url':_0x5ce931}},_0x16ba29);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]='engage:campaign:create';['description']=a20_0x1d3a8b(0x120);async['execute'](_0x29748b){const _0x5a2c01=a20_0x1d3a8b,{options:_0x52de9e,tdx:_0x426cd0}=_0x29748b,_0x5d947e=_0x52de9e,_0x3efdf6=_0x5d947e['name'],_0x1cbc3a=_0x5d947e[_0x5a2c01(0x92)];if(!_0x3efdf6)return console['error'](_0x5a2c01(0xbc)),console['error'](_0x5a2c01(0xaa)),0x1;if(!_0x1cbc3a)return console['error'](_0x5a2c01(0x9f)),console['error'](_0x5a2c01(0xaa)),0x1;const _0xb94b1a=await resolveWorkspaceIdFromOptions(_0x5d947e,_0x426cd0,!![]),_0x387ca2=await resolveSegmentFromOptions(_0x5d947e,_0x426cd0),_0x357b9c=buildConnectorConfig(_0x5d947e),_0x5437a7={'name':_0x3efdf6,'campaignType':_0x1cbc3a,'workspaceId':_0xb94b1a,'description':_0x5d947e[_0x5a2c01(0x119)],..._0x387ca2,'connectorConfig':_0x357b9c,'startAt':_0x5d947e[_0x5a2c01(0xfd)],'timezone':_0x5d947e['timezone']},_0x5a6162=await withSpinner(_0x5a2c01(0xda)+_0x3efdf6+_0x5a2c01(0xf1),()=>_0x426cd0[_0x5a2c01(0xa6)][_0x5a2c01(0xed)](_0x5437a7));return await handleSDKOutput([_0x5a6162[_0x5a2c01(0x91)]],_0x52de9e),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]='engage:campaign:update';['description']='Update\x20a\x20campaign';async[a20_0x1d3a8b(0xcb)](_0x5cb3b6){const _0x10cc83=a20_0x1d3a8b,{options:_0x6805fe,args:_0x18ed39,tdx:_0x4175d8}=_0x5cb3b6;if(_0x18ed39['length']===0x0)return console[_0x10cc83(0x98)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x10cc83(0x98)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x5870c2=_0x18ed39[0x0],_0x5b76c2=_0x6805fe,_0x3f6a38=await resolveWorkspaceIdFromOptions(_0x5b76c2,_0x4175d8),_0x130c29=await resolveSegmentFromOptions(_0x5b76c2,_0x4175d8),_0x32fe03=buildConnectorConfig(_0x5b76c2),_0x4255f0={'name':_0x5b76c2[_0x10cc83(0xe3)],'description':_0x5b76c2['description'],..._0x130c29,'connectorConfig':_0x32fe03,'startAt':_0x5b76c2[_0x10cc83(0xfd)],'timezone':_0x5b76c2[_0x10cc83(0xa7)]},_0xe42ad4=Object[_0x10cc83(0xcf)](Object[_0x10cc83(0xa8)](_0x4255f0)[_0x10cc83(0xb8)](([,_0x354aae])=>_0x354aae!==undefined));if(Object[_0x10cc83(0x11f)](_0xe42ad4)[_0x10cc83(0xa4)]===0x0)return console[_0x10cc83(0x98)](_0x10cc83(0xf5)),console[_0x10cc83(0x98)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x4689f5=await withSpinner(_0x10cc83(0xe7)+_0x5870c2+_0x10cc83(0xf1),()=>_0x4175d8['engage']['updateCampaign'](_0x5870c2,_0xe42ad4,_0x3f6a38),{'verbose':_0x6805fe[_0x10cc83(0x10b)]});return await handleSDKOutput([_0x4689f5[_0x10cc83(0x91)]],_0x6805fe),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xad);[a20_0x1d3a8b(0x119)]='Delete\x20a\x20campaign';async[a20_0x1d3a8b(0xcb)](_0x311732){const _0x2d6464=a20_0x1d3a8b,{options:_0x3cb157,args:_0x22d44d,tdx:_0x1fa995}=_0x311732;if(_0x22d44d[_0x2d6464(0xa4)]===0x0)return console['error'](_0x2d6464(0x121)),console['error'](_0x2d6464(0xdf)),0x1;const _0x50b2a4=_0x22d44d[0x0],_0x565c1c=_0x3cb157,_0x1b827f=await resolveWorkspaceIdFromOptions(_0x565c1c,_0x1fa995);if(!_0x3cb157['yes']){const _0x3415a5=await confirm(_0x2d6464(0x11c)+_0x50b2a4+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x3415a5)return console[_0x2d6464(0x113)](_0x2d6464(0xc2)),0x0;}return await withSpinner(_0x2d6464(0x11b)+_0x50b2a4+_0x2d6464(0xf1),()=>_0x1fa995['engage'][_0x2d6464(0xa3)](_0x50b2a4,_0x1b827f),{'verbose':_0x3cb157[_0x2d6464(0x10b)]}),console[_0x2d6464(0x113)](_0x2d6464(0xa9)+_0x50b2a4+_0x2d6464(0xba)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']=a20_0x1d3a8b(0xb2);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xd8);async[a20_0x1d3a8b(0xcb)](_0x2c4b68){const _0x1ba3db=a20_0x1d3a8b,{options:_0x5a3c21,args:_0x38fda5,tdx:_0x136891}=_0x2c4b68;if(_0x38fda5['length']===0x0)return console[_0x1ba3db(0x98)](_0x1ba3db(0x121)),console[_0x1ba3db(0x98)](_0x1ba3db(0x9d)),0x1;const _0x103959=_0x38fda5[0x0],_0x5d8535=_0x5a3c21,_0x208e95=await resolveWorkspaceIdFromOptions(_0x5d8535,_0x136891);return await withSpinner('Launching\x20campaign\x20\x27'+_0x103959+_0x1ba3db(0xf1),()=>_0x136891[_0x1ba3db(0xa6)]['launchCampaign'](_0x103959,_0x208e95),{'verbose':_0x5a3c21[_0x1ba3db(0x10b)]}),console[_0x1ba3db(0x113)]('Campaign\x20\x27'+_0x103959+_0x1ba3db(0xd6)),0x0;}}function a20_0x45e1(_0x47aa73,_0x30d549){_0x47aa73=_0x47aa73-0x90;const _0x25792f=a20_0x2579();let _0x45e102=_0x25792f[_0x47aa73];return _0x45e102;}export class EngageCampaignPauseCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xef);['description']=a20_0x1d3a8b(0xa2);async[a20_0x1d3a8b(0xcb)](_0xf5eb37){const _0xe9d02d=a20_0x1d3a8b,{options:_0x128fc2,args:_0xbd7918,tdx:_0x5797a9}=_0xf5eb37;if(_0xbd7918[_0xe9d02d(0xa4)]===0x0)return console[_0xe9d02d(0x98)](_0xe9d02d(0x121)),console[_0xe9d02d(0x98)](_0xe9d02d(0x11d)),0x1;const _0x501b1f=_0xbd7918[0x0],_0x517ece=_0x128fc2,_0x47e13c=await resolveWorkspaceIdFromOptions(_0x517ece,_0x5797a9);return await withSpinner(_0xe9d02d(0xf9)+_0x501b1f+'\x27...',()=>_0x5797a9['engage'][_0xe9d02d(0x10a)](_0x501b1f,_0x47e13c),{'verbose':_0x128fc2[_0xe9d02d(0x10b)]}),console[_0xe9d02d(0x113)](_0xe9d02d(0xa9)+_0x501b1f+_0xe9d02d(0xb3)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0x10e);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xe5);async[a20_0x1d3a8b(0xcb)](_0x55cbe2){const _0x1a763a=a20_0x1d3a8b,{options:_0x1b3e34,args:_0xabda97,tdx:_0x52a8a6}=_0x55cbe2;if(_0xabda97[_0x1a763a(0xa4)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x1a763a(0x98)](_0x1a763a(0xb1)),0x1;const _0x5436fd=_0xabda97[0x0],_0x5f2224=_0x1b3e34,_0x4947aa=await resolveWorkspaceIdFromOptions(_0x5f2224,_0x52a8a6);return await withSpinner(_0x1a763a(0x101)+_0x5436fd+_0x1a763a(0xf1),()=>_0x52a8a6[_0x1a763a(0xa6)][_0x1a763a(0x9b)](_0x5436fd,_0x4947aa),{'verbose':_0x1b3e34[_0x1a763a(0x10b)]}),console[_0x1a763a(0x113)](_0x1a763a(0xa9)+_0x5436fd+_0x1a763a(0xc6)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0x102);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xf2);async[a20_0x1d3a8b(0xcb)](_0x1c39d1){const _0x601b94=a20_0x1d3a8b,{options:_0x43fd17,args:_0x40fb1b,tdx:_0x1d26b5}=_0x1c39d1;if(_0x40fb1b[_0x601b94(0xa4)]===0x0)return console[_0x601b94(0x98)](_0x601b94(0x121)),console[_0x601b94(0x98)](_0x601b94(0xde)),0x1;const _0x242231=_0x40fb1b[0x0],_0x478318=_0x43fd17,_0x39d7b6=await resolveWorkspaceIdFromOptions(_0x478318,_0x1d26b5),_0x57da86=await withSpinner(_0x601b94(0xff)+_0x242231+'\x27...',()=>_0x1d26b5[_0x601b94(0xa6)][_0x601b94(0xca)](_0x242231,_0x39d7b6),{'verbose':_0x43fd17[_0x601b94(0x10b)]});return await handleSDKOutput([_0x57da86['data']],_0x43fd17),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a20_0x1d3a8b(0x122);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xcd);async[a20_0x1d3a8b(0xcb)](_0x61628b){const _0x230ff6=a20_0x1d3a8b,{options:_0xe89078,args:_0x5dac08,tdx:_0x4529aa}=_0x61628b,_0x13a737=_0x5dac08[0x0],_0x4973b6=resolveLimit(_0xe89078[_0x230ff6(0xd5)],DEFAULT_LLM_LIMIT),_0x16c5b1=_0xe89078,_0x32a450=await resolveWorkspaceIdFromOptions(_0x16c5b1,_0x4529aa),_0x447341=await withSpinner(_0x230ff6(0xe8),()=>_0x4529aa[_0x230ff6(0xa6)][_0x230ff6(0x108)]({'workspaceId':_0x32a450,'limit':_0x4973b6}),{'verbose':_0xe89078[_0x230ff6(0x10b)]});let _0x1e978b=_0x447341['data'];return _0x13a737&&(_0x1e978b=_0x447341[_0x230ff6(0x91)][_0x230ff6(0xb8)](_0x45bcda=>matchGlobPattern(_0x45bcda[_0x230ff6(0xe3)],_0x13a737))),await handleSDKOutput(_0x1e978b,_0xe89078),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0x99);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xbf);async[a20_0x1d3a8b(0xcb)](_0x4a2ff7){const _0x58a013=a20_0x1d3a8b,{options:_0x598b08,args:_0xeadf55,tdx:_0x1e4949}=_0x4a2ff7;if(_0xeadf55[_0x58a013(0xa4)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x58a013(0x115)),0x1;const _0x458ae4=_0xeadf55[0x0],_0x5bc6ea=_0x598b08,_0x2fd597=await resolveWorkspaceIdFromOptions(_0x5bc6ea,_0x1e4949),_0x566023=_0x5bc6ea[_0x58a013(0xdd)];if(_0x566023){const _0x29e51a=await withSpinner(_0x58a013(0xe2)+_0x458ae4+_0x58a013(0xf1),()=>_0x1e4949[_0x58a013(0xa6)]['getTemplateFull'](_0x458ae4,_0x2fd597),{'verbose':_0x598b08[_0x58a013(0x10b)]});await handleSDKOutput([_0x29e51a],_0x598b08);}else{const _0x38e281=await withSpinner(_0x58a013(0xe2)+_0x458ae4+_0x58a013(0xf1),()=>_0x1e4949['engage'][_0x58a013(0xd4)](_0x458ae4,_0x2fd597),{'verbose':_0x598b08['verbose']});await handleSDKOutput([_0x38e281],_0x598b08);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']='engage:template:create';['description']='Create\x20an\x20email\x20template';async[a20_0x1d3a8b(0xcb)](_0x4b1849){const _0x13a925=a20_0x1d3a8b,{options:_0x26a0e5,tdx:_0xfac02b}=_0x4b1849,_0x1309fa=_0x26a0e5,_0x218518=_0x1309fa[_0x13a925(0xe3)],_0x4a84f2=_0x1309fa[_0x13a925(0xeb)],_0x1872e9=_0x1309fa[_0x13a925(0xd7)];if(!_0x218518)return console['error'](_0x13a925(0xbc)),console[_0x13a925(0x98)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x4a84f2)return console[_0x13a925(0x98)](_0x13a925(0xa1)),0x1;if(!_0x1872e9)return console[_0x13a925(0x98)]('Error:\x20--html\x20is\x20required'),0x1;const _0x1c204d=await resolveWorkspaceIdFromOptions(_0x1309fa,_0xfac02b,!![]),_0x1c225c={'name':_0x218518,'subjectTemplate':_0x4a84f2,'htmlTemplate':_0x1872e9,'workspaceId':_0x1c204d,'plaintextTemplate':_0x1309fa[_0x13a925(0x114)],'editorType':_0x1309fa[_0x13a925(0xdc)]},_0xc6ab1a=await withSpinner(_0x13a925(0xd1)+_0x218518+'\x27...',()=>_0xfac02b[_0x13a925(0xa6)][_0x13a925(0xb7)](_0x1c225c));return await handleSDKOutput([_0xc6ab1a['data']],_0x26a0e5),0x0;}}function a20_0x2579(){const _0x396611=['createCampaign','Set\x20workspace\x20context\x20for\x20Engage\x20commands','engage:campaign:pause','100920phPApv','\x27...','Duplicate\x20a\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','updateTemplate','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','getCampaignFull','207mJVizy','getCampaign','Pausing\x20campaign\x20\x27','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','deleteTemplate','engage:workspace:show','startAt','jsonColumns','Duplicating\x20campaign\x20\x27','format','Resuming\x20campaign\x20\x27','engage:campaign:duplicate','276660oqRnnz','22449qWqWhQ','3458aJujKj','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Deleting\x20workspace\x20\x27','listTemplates','Delete\x20an\x20email\x20template','pauseCampaign','verbose','site','Creating\x20workspace\x20\x27','engage:campaign:resume','yes','segment','workspaceId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','log','plaintext','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Options:\x20--name,\x20--description','Delete\x20a\x20workspace','parentId','description','updateWorkspace','Deleting\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Update\x20an\x20email\x20template','keys','Create\x20a\x20new\x20campaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:templates','resolveWorkspaceId','Error:\x20Workspace\x20name\x20is\x20required','data','type','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','getWorkspaceFull','\x27?\x20This\x20cannot\x20be\x20undone.','488ICqEEO','jsonl','error','engage:template:show','Workspace\x20is\x20required\x20for\x20this\x20operation','resumeCampaign','Fetching\x20campaigns...','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','175rqzvvr','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:template:update','Error:\x20--subject\x20is\x20required','Pause\x20a\x20campaign','deleteCampaign','length','workspace','engage','timezone','entries','Campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Updating\x20template\x20\x27','Deleting\x20template\x20\x27','engage:campaign:delete','Engage\x20workspace\x20set\x20to:\x20','engage:template:delete','getWorkspace','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','engage:campaign:launch','\x27\x20paused\x20successfully','Fetching\x20workspace\x20\x27','Fetching\x20workspaces...','Fetching\x20campaign\x20\x27','createTemplate','filter','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','\x27\x20deleted\x20successfully','attributes','Error:\x20--name\x20is\x20required','Template\x20\x27','245788vypEcV','Show\x20email\x20template\x20details','799611AHBCGX','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Operation\x20cancelled','Create\x20a\x20workspace','engage:workspace:create','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','\x27\x20resumed\x20successfully','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','deleteWorkspace','segmentId','duplicateCampaign','execute','List\x20campaigns','List\x20email\x20templates','engage:workspaces','fromEntries','engage_workspace','Creating\x20template\x20\x27','1759446zwAXUK','session','getTemplate','limit','\x27\x20launched\x20successfully','html','Launch\x20a\x20campaign','Update\x20a\x20workspace','Creating\x20campaign\x20\x27','parentName','editorType','full','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','List\x20workspaces','Verifying\x20workspace\x20\x27','Fetching\x20template\x20\x27','name','engage:workspace:delete','Resume\x20a\x20paused\x20campaign','resolvePathToResource','Updating\x20campaign\x20\x27','Fetching\x20templates...','map','json','subject','engage:workspace:use'];a20_0x2579=function(){return _0x396611;};return a20_0x2579();}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a20_0x1d3a8b(0xa0);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0x11e);async['execute'](_0x41b2a7){const _0x55d312=a20_0x1d3a8b,{options:_0x26c307,args:_0x4c4d75,tdx:_0x5e191a}=_0x41b2a7;if(_0x4c4d75['length']===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x55d312(0x98)]('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x30caaf=_0x4c4d75[0x0],_0x10b380=_0x26c307,_0x2db5df=await resolveWorkspaceIdFromOptions(_0x10b380,_0x5e191a),_0x4f8b11={'name':_0x10b380[_0x55d312(0xe3)],'subjectTemplate':_0x10b380[_0x55d312(0xeb)],'htmlTemplate':_0x10b380[_0x55d312(0xd7)],'plaintextTemplate':_0x10b380[_0x55d312(0x114)]},_0x232827=Object[_0x55d312(0xcf)](Object[_0x55d312(0xa8)](_0x4f8b11)[_0x55d312(0xb8)](([,_0x206e23])=>_0x206e23!==undefined));if(Object[_0x55d312(0x11f)](_0x232827)['length']===0x0)return console[_0x55d312(0x98)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x55d312(0x98)](_0x55d312(0xc5)),0x1;const _0x3230d8=await withSpinner(_0x55d312(0xab)+_0x30caaf+_0x55d312(0xf1),()=>_0x5e191a[_0x55d312(0xa6)][_0x55d312(0xf4)](_0x30caaf,_0x232827,_0x2db5df),{'verbose':_0x26c307[_0x55d312(0x10b)]});return await handleSDKOutput([_0x3230d8[_0x55d312(0x91)]],_0x26c307),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xaf);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0x109);async[a20_0x1d3a8b(0xcb)](_0x199407){const _0x1c5276=a20_0x1d3a8b,{options:_0x10dd38,args:_0xc6706e,tdx:_0x10ce5b}=_0x199407;if(_0xc6706e['length']===0x0)return console[_0x1c5276(0x98)](_0x1c5276(0xc7)),console[_0x1c5276(0x98)](_0x1c5276(0xc1)),0x1;const _0x304e3e=_0xc6706e[0x0],_0x28398d=_0x10dd38,_0x29e7e2=await resolveWorkspaceIdFromOptions(_0x28398d,_0x10ce5b);if(!_0x10dd38[_0x1c5276(0x10f)]){const _0x5a52b4=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x304e3e+_0x1c5276(0x95));if(!_0x5a52b4)return console[_0x1c5276(0x113)](_0x1c5276(0xc2)),0x0;}return await withSpinner(_0x1c5276(0xac)+_0x304e3e+'\x27...',()=>_0x10ce5b[_0x1c5276(0xa6)][_0x1c5276(0xfb)](_0x304e3e,_0x29e7e2),{'verbose':_0x10dd38['verbose']}),console[_0x1c5276(0x113)](_0x1c5276(0xbd)+_0x304e3e+_0x1c5276(0xba)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xce);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xe0);async[a20_0x1d3a8b(0xcb)](_0x47e050){const _0x50c99f=a20_0x1d3a8b,{options:_0xcdf62f,args:_0x40c087,tdx:_0x1bfb5a}=_0x47e050,_0x42a149=_0x40c087[0x0],_0x64fc50=resolveLimit(_0xcdf62f[_0x50c99f(0xd5)],DEFAULT_LLM_LIMIT),_0x1c464e=await withSpinner(_0x50c99f(0xb5),()=>_0x1bfb5a[_0x50c99f(0xa6)]['listWorkspaces']({'limit':_0x64fc50}),{'verbose':_0xcdf62f[_0x50c99f(0x10b)]});let _0x5591d3=_0x1c464e[_0x50c99f(0x91)];return _0x42a149&&(_0x5591d3=_0x1c464e[_0x50c99f(0x91)][_0x50c99f(0xb8)](_0x37307e=>matchGlobPattern(_0x37307e[_0x50c99f(0xe3)],_0x42a149))),await handleSDKOutput(_0x5591d3,_0xcdf62f),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a20_0x1d3a8b(0xfc);[a20_0x1d3a8b(0x119)]='Show\x20workspace\x20details';async['execute'](_0x8942ff){const _0x581eb3=a20_0x1d3a8b,{options:_0x580810,args:_0x3a1b92,tdx:_0x4b28d0}=_0x8942ff;if(_0x3a1b92[_0x581eb3(0xa4)]===0x0)return console[_0x581eb3(0x98)](_0x581eb3(0x93)),console['error'](_0x581eb3(0x106)),0x1;const _0x2802bf=_0x3a1b92[0x0],_0x116f26=_0x580810,_0xbb2351=_0x116f26[_0x581eb3(0xdd)];if(_0xbb2351){const _0x235358=await withSpinner(_0x581eb3(0xb4)+_0x2802bf+_0x581eb3(0xf1),()=>_0x4b28d0['engage'][_0x581eb3(0x94)](_0x2802bf),{'verbose':_0x580810[_0x581eb3(0x10b)]});await handleSDKOutput([_0x235358],_0x580810);}else{const _0x28492a=await withSpinner('Fetching\x20workspace\x20\x27'+_0x2802bf+_0x581eb3(0xf1),()=>_0x4b28d0[_0x581eb3(0xa6)][_0x581eb3(0xb0)](_0x2802bf),{'verbose':_0x580810[_0x581eb3(0x10b)]});await handleSDKOutput([_0x28492a],_0x580810);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xc4);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xc3);async[a20_0x1d3a8b(0xcb)](_0x1becdc){const _0x2eca84=a20_0x1d3a8b,{options:_0x20d53c,tdx:_0x57aea8}=_0x1becdc,_0xd0f209=_0x20d53c,_0x1c29bb=_0xd0f209['name'];if(!_0x1c29bb)return console['error'](_0x2eca84(0xbc)),console[_0x2eca84(0x98)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x105b72={'name':_0x1c29bb,'description':_0xd0f209[_0x2eca84(0x119)]},_0xe03cd7=await withSpinner(_0x2eca84(0x10d)+_0x1c29bb+_0x2eca84(0xf1),()=>_0x57aea8['engage']['createWorkspace'](_0x105b72));return await handleSDKOutput([_0xe03cd7['data']],_0x20d53c),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']='engage:workspace:update';[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0xd9);async[a20_0x1d3a8b(0xcb)](_0x5126e9){const _0x51b133=a20_0x1d3a8b,{options:_0x189820,args:_0x54a097,tdx:_0xf43983}=_0x5126e9;if(_0x54a097['length']===0x0)return console[_0x51b133(0x98)](_0x51b133(0x93)),console['error'](_0x51b133(0xf3)),0x1;const _0x4cd64d=_0x54a097[0x0],_0x43c954=_0x189820,_0x206950={'name':_0x43c954[_0x51b133(0xe3)],'description':_0x43c954[_0x51b133(0x119)]},_0x710edc=Object[_0x51b133(0xcf)](Object['entries'](_0x206950)[_0x51b133(0xb8)](([,_0x1d078d])=>_0x1d078d!==undefined));if(Object[_0x51b133(0x11f)](_0x710edc)[_0x51b133(0xa4)]===0x0)return console[_0x51b133(0x98)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x51b133(0x98)](_0x51b133(0x116)),0x1;const _0x5dc7d2=await withSpinner('Updating\x20workspace\x20\x27'+_0x4cd64d+_0x51b133(0xf1),()=>_0xf43983['engage'][_0x51b133(0x11a)](_0x4cd64d,_0x710edc),{'verbose':_0x189820[_0x51b133(0x10b)]});return await handleSDKOutput([_0x5dc7d2['data']],_0x189820),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xe4);[a20_0x1d3a8b(0x119)]=a20_0x1d3a8b(0x117);async['execute'](_0x27f670){const _0x2b80a5=a20_0x1d3a8b,{options:_0x2e4b09,args:_0x746566,tdx:_0x44e837}=_0x27f670;if(_0x746566[_0x2b80a5(0xa4)]===0x0)return console['error'](_0x2b80a5(0x93)),console[_0x2b80a5(0x98)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x27a3b4=_0x746566[0x0];if(!_0x2e4b09[_0x2b80a5(0x10f)]){const _0x2c3872=await confirm(_0x2b80a5(0x112)+_0x27a3b4+_0x2b80a5(0x95));if(!_0x2c3872)return console[_0x2b80a5(0x113)](_0x2b80a5(0xc2)),0x0;}return await withSpinner(_0x2b80a5(0x107)+_0x27a3b4+_0x2b80a5(0xf1),()=>_0x44e837['engage'][_0x2b80a5(0xc8)](_0x27a3b4),{'verbose':_0x2e4b09['verbose']}),console[_0x2b80a5(0x113)]('Workspace\x20\x27'+_0x27a3b4+_0x2b80a5(0xba)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x1d3a8b(0xe3)]=a20_0x1d3a8b(0xec);['description']=a20_0x1d3a8b(0xee);async[a20_0x1d3a8b(0xcb)](_0x4c645b){const _0x46b03a=a20_0x1d3a8b,{options:_0x3cc3f8,args:_0x5498a1,tdx:_0x1b467a}=_0x4c645b;if(_0x5498a1['length']===0x0)return console[_0x46b03a(0x98)](_0x46b03a(0x90)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x51550c=_0x5498a1[0x0];await withSpinner(_0x46b03a(0xe1)+_0x51550c+_0x46b03a(0xf1),()=>_0x1b467a['engage'][_0x46b03a(0x123)](_0x51550c));const _0x42024f=_0x3cc3f8['session']||undefined;return saveSessionContext({'engage_workspace':_0x51550c},_0x42024f),console[_0x46b03a(0x113)](_0x46b03a(0xae)+_0x51550c),console[_0x46b03a(0x113)](_0x46b03a(0xfa)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x8609f0=a21_0x22d6;(function(_0x450296,_0xa1368f){const _0x136ced=a21_0x22d6,_0x289ba1=_0x450296();while(!![]){try{const _0x59a691=parseInt(_0x136ced(0x1b1))/0x1+-parseInt(_0x136ced(0x19e))/0x2*(parseInt(_0x136ced(0x1a2))/0x3)+parseInt(_0x136ced(0x19d))/0x4+parseInt(_0x136ced(0x19b))/0x5*(parseInt(_0x136ced(0x1ae))/0x6)+-parseInt(_0x136ced(0x18b))/0x7+-parseInt(_0x136ced(0x1ab))/0x8+parseInt(_0x136ced(0x178))/0x9*(parseInt(_0x136ced(0x1bd))/0xa);if(_0x59a691===_0xa1368f)break;else _0x289ba1['push'](_0x289ba1['shift']());}catch(_0x3711c7){_0x289ba1['push'](_0x289ba1['shift']());}}}(a21_0x9dde,0x33848));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a21_0x9dde(){const _0x1f8892=['\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','start_at','execute','Limit:\x20','\x20\x20Job\x20ID:\x20','round','debug','name','473238BrhLot','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','job:result','✔\x20Retrieved\x20','kill','job:submit','job:show','✔\x20Job\x20submitted','Submitting\x20kill\x20request...','status','Query:\x20','Kill\x20a\x20job','data','Job\x20type:\x20','Show\x20job\x20details','substring','user_name','information_schema','No\x20SQL\x20statements\x20found\x20in\x20file','1029238ScZzeq','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','✔\x20Found\x20','getTime','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','yes','priority','type','Submit\x20a\x20job','INVALID_ARGUMENT','file','created_at','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Getting\x20job\x20results...','error','url','5WftVSg','description','782100xiLcuG','36298BuyBTQ','database','\x20jobs','Listing\x20jobs...','39ZJfPQi','length','submit','verbose','Cancelled','...','show','trino','end_at','1820872eoRyPD','args','hive','2129766ibNcuL','jobs','query','60782zWmzDA','list','Getting\x20job\x20details...','\x27\x20to\x20verify\x20the\x20job\x20status','job_id','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','validate','\x20job','job:kill','map','Get\x20job\x20results','limit','40KbULJN'];a21_0x9dde=function(){return _0x1f8892;};return a21_0x9dde();}import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a21_0x22d6(_0x263ada,_0x563753){_0x263ada=_0x263ada-0x177;const _0x9ddee5=a21_0x9dde();let _0x22d613=_0x9ddee5[_0x263ada];return _0x22d613;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{[a21_0x8609f0(0x177)]='jobs';[a21_0x8609f0(0x19c)]='List\x20jobs';async['execute'](_0x33c3ed){const _0x9c4b5d=a21_0x8609f0,{options:_0x15012e,tdx:_0x53dfdb}=_0x33c3ed,_0x387aba=resolveLimit(_0x15012e[_0x9c4b5d(0x1bc)],DEFAULT_DISPLAY_LIMIT),_0x62a605=_0x15012e['status'];_0x15012e[_0x9c4b5d(0x1a5)]&&(console[_0x9c4b5d(0x199)](_0x9c4b5d(0x1c1)+_0x387aba+_0x9c4b5d(0x1a0)),_0x62a605&&console[_0x9c4b5d(0x199)]('Status\x20filter:\x20'+_0x62a605));const _0x1ccb64=await withSpinner(_0x9c4b5d(0x1a1),()=>_0x53dfdb[_0x9c4b5d(0x1af)][_0x9c4b5d(0x1b2)]({'from':0x0,'to':_0x387aba-0x1,'status':_0x62a605}),{'verbose':_0x15012e['verbose']}),_0x197286=_0x1ccb64[_0x9c4b5d(0x184)];console[_0x9c4b5d(0x199)](_0x9c4b5d(0x18d)+_0x197286[_0x9c4b5d(0x1a3)]+_0x9c4b5d(0x1b8)+(_0x197286[_0x9c4b5d(0x1a3)]!==0x1?'s':''));const _0x47aee6=_0x197286[_0x9c4b5d(0x1ba)](_0x3b403e=>{const _0x36510b=_0x9c4b5d;let _0x807a8b;if(_0x3b403e[_0x36510b(0x1bf)]&&_0x3b403e[_0x36510b(0x1aa)]){const _0x40f9dc=new Date(_0x3b403e[_0x36510b(0x1bf)])[_0x36510b(0x18e)](),_0x36d3ee=new Date(_0x3b403e[_0x36510b(0x1aa)])[_0x36510b(0x18e)]();_0x807a8b=Math['round']((_0x36d3ee-_0x40f9dc)/0x3e8);}return{'job_id':_0x3b403e[_0x36510b(0x1b5)],'type':_0x3b403e[_0x36510b(0x192)],'status':_0x3b403e['status'],'user_name':_0x3b403e[_0x36510b(0x188)],'duration_sec':_0x807a8b,'created_at':_0x3b403e[_0x36510b(0x196)],'started_at':_0x3b403e[_0x36510b(0x1bf)],'end_at':_0x3b403e[_0x36510b(0x1aa)]};});return await handleSDKOutput(_0x47aee6,_0x15012e),0x0;}}export class JobShowCommand extends BaseCommand{[a21_0x8609f0(0x177)]=a21_0x8609f0(0x17e);[a21_0x8609f0(0x19c)]=a21_0x8609f0(0x186);[a21_0x8609f0(0x1b7)](_0x495c8a){const _0x2999ef=a21_0x8609f0,_0x1f83b9=_0x495c8a[_0x2999ef(0x1ac)][0x0];if(!_0x1f83b9)return _0x2999ef(0x179);return undefined;}async[a21_0x8609f0(0x1c0)](_0xa940c7){const _0x32e24e=a21_0x8609f0,{options:_0x309426,args:_0x2a196a,tdx:_0x31d234}=_0xa940c7,_0x2894b7=_0x2a196a[0x0],_0x3110c0=await withSpinner(_0x32e24e(0x1b3),()=>_0x31d234[_0x32e24e(0x1af)][_0x32e24e(0x1a8)](_0x2894b7),{'verbose':_0x309426['verbose']}),_0x2764e5=_0x3110c0[_0x32e24e(0x184)];let _0x4551aa;if(_0x2764e5[_0x32e24e(0x1bf)]&&_0x2764e5[_0x32e24e(0x1aa)]){const _0x380d8a=new Date(_0x2764e5[_0x32e24e(0x1bf)])[_0x32e24e(0x18e)](),_0x44fb4f=new Date(_0x2764e5[_0x32e24e(0x1aa)])[_0x32e24e(0x18e)]();_0x4551aa=Math[_0x32e24e(0x1c3)]((_0x44fb4f-_0x380d8a)/0x3e8);}const _0x41c9c4={'job_id':_0x2764e5[_0x32e24e(0x1b5)],'type':_0x2764e5['type'],'status':_0x2764e5[_0x32e24e(0x181)],..._0x2764e5[_0x32e24e(0x188)]&&{'user_name':_0x2764e5['user_name']},..._0x4551aa!==undefined&&{'duration_sec':_0x4551aa},..._0x2764e5['created_at']&&{'created_at':_0x2764e5[_0x32e24e(0x196)]},..._0x2764e5['start_at']&&{'started_at':_0x2764e5[_0x32e24e(0x1bf)]},..._0x2764e5[_0x32e24e(0x1aa)]&&{'end_at':_0x2764e5['end_at']},..._0x2764e5[_0x32e24e(0x19f)]&&{'database':_0x2764e5[_0x32e24e(0x19f)]},..._0x2764e5[_0x32e24e(0x191)]!==undefined&&{'priority':_0x2764e5[_0x32e24e(0x191)]},..._0x2764e5[_0x32e24e(0x19a)]&&{'url':_0x2764e5[_0x32e24e(0x19a)]},..._0x2764e5[_0x32e24e(0x1b0)]&&{'query':_0x2764e5[_0x32e24e(0x1b0)]},..._0x2764e5[_0x32e24e(0x1c4)]&&{'debug':_0x2764e5[_0x32e24e(0x1c4)]}};return await handleSingleObjectOutput(_0x41c9c4,_0x309426),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a21_0x8609f0(0x1b9);[a21_0x8609f0(0x19c)]=a21_0x8609f0(0x183);[a21_0x8609f0(0x1b7)](_0x5640bf){const _0x2c5365=a21_0x8609f0,_0x30a3a4=_0x5640bf[_0x2c5365(0x1ac)][0x0];if(!_0x30a3a4)return _0x2c5365(0x18c);return undefined;}async[a21_0x8609f0(0x1c0)](_0x456fc3){const _0x33462d=a21_0x8609f0,{options:_0x13c681,args:_0x185b10,tdx:_0x4ff56e}=_0x456fc3,_0xe8e669=_0x185b10[0x0];if(!_0x13c681[_0x33462d(0x190)]){const _0x211004=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0xe8e669+'?');if(!_0x211004)return console[_0x33462d(0x199)](_0x33462d(0x1a6)),0x0;}return await withSpinner(_0x33462d(0x180),()=>_0x4ff56e[_0x33462d(0x1af)][_0x33462d(0x17c)](_0xe8e669),{'verbose':_0x13c681[_0x33462d(0x1a5)]}),console[_0x33462d(0x199)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0xe8e669),console[_0x33462d(0x199)](_0x33462d(0x1be)+_0xe8e669+_0x33462d(0x1b4)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a21_0x8609f0(0x177)]=a21_0x8609f0(0x17d);[a21_0x8609f0(0x19c)]=a21_0x8609f0(0x193);async[a21_0x8609f0(0x1c0)](_0x202e2b){const _0xf0dbcd=a21_0x8609f0,{options:_0x28fcf4,args:_0x3a96b8,tdx:_0x261986}=_0x202e2b,_0x19dff8=_0x28fcf4['jobType']||'trino',_0x67bc73=_0x28fcf4[_0xf0dbcd(0x195)],_0x602b1c=_0x28fcf4[_0xf0dbcd(0x19f)]||_0xf0dbcd(0x189),_0x42548f=_0x28fcf4['result'];if(_0x19dff8!==_0xf0dbcd(0x1a9)&&_0x19dff8!==_0xf0dbcd(0x1ad))throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],_0xf0dbcd(0x197));let _0x270613;if(_0x67bc73){if(_0x3a96b8[0x0])throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],_0xf0dbcd(0x1b6));const _0x17ed7b=readSqlStatementsFromFile(_0x67bc73);if(_0x17ed7b[_0xf0dbcd(0x1a3)]===0x0)throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],_0xf0dbcd(0x18a));if(_0x17ed7b['length']>0x1)throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x270613=_0x17ed7b[0x0];}else{if(!_0x3a96b8[0x0])throw new SDKError(ErrorCode[_0xf0dbcd(0x194)],_0xf0dbcd(0x18f));_0x270613=_0x3a96b8[0x0];}_0x28fcf4[_0xf0dbcd(0x1a5)]&&(console[_0xf0dbcd(0x199)](_0xf0dbcd(0x185)+_0x19dff8),console['error']('Database:\x20'+_0x602b1c),console['error'](_0xf0dbcd(0x182)+_0x270613[_0xf0dbcd(0x187)](0x0,0x64)+(_0x270613[_0xf0dbcd(0x1a3)]>0x64?_0xf0dbcd(0x1a7):'')));const _0x2a8e4f=await withSpinner('Submitting\x20job...',()=>_0x261986[_0xf0dbcd(0x1af)][_0xf0dbcd(0x1a4)](_0x602b1c,_0x270613,_0x19dff8,_0x42548f),{'verbose':_0x28fcf4['verbose']}),_0x114179=_0x2a8e4f['data'];return console[_0xf0dbcd(0x199)](_0xf0dbcd(0x17f)),console[_0xf0dbcd(0x199)](_0xf0dbcd(0x1c2)+_0x114179['job_id']),await handleSDKOutput([_0x114179],_0x28fcf4),0x0;}}export class JobResultCommand extends BaseCommand{[a21_0x8609f0(0x177)]=a21_0x8609f0(0x17a);['description']=a21_0x8609f0(0x1bb);[a21_0x8609f0(0x1b7)](_0x70895d){const _0x54fa3c=a21_0x8609f0,_0x327b49=_0x70895d[_0x54fa3c(0x1ac)][0x0];if(!_0x327b49)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a21_0x8609f0(0x1c0)](_0xf70026){const _0x292430=a21_0x8609f0,{options:_0x211914,args:_0x4eb2af,tdx:_0x326813}=_0xf70026,_0x4192b8=_0x4eb2af[0x0],_0xd52e30=await withSpinner(_0x292430(0x198),()=>_0x326813[_0x292430(0x1af)]['result'](_0x4192b8),{'verbose':_0x211914[_0x292430(0x1a5)]}),_0x12268f=_0xd52e30[_0x292430(0x184)];return console[_0x292430(0x199)](_0x292430(0x17b)+_0x12268f['length']+'\x20row'+(_0x12268f[_0x292430(0x1a3)]!==0x1?'s':'')),await handleSDKOutput(_0x12268f,_0x211914),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x242202=a22_0x5464;(function(_0x4c284e,_0x3b167c){const _0x4125cc=a22_0x5464,_0x493abb=_0x4c284e();while(!![]){try{const _0x2b2e11=-parseInt(_0x4125cc(0x1f7))/0x1*(-parseInt(_0x4125cc(0x1cd))/0x2)+-parseInt(_0x4125cc(0x1a8))/0x3+parseInt(_0x4125cc(0x232))/0x4+parseInt(_0x4125cc(0x1bd))/0x5*(-parseInt(_0x4125cc(0x268))/0x6)+-parseInt(_0x4125cc(0x283))/0x7*(parseInt(_0x4125cc(0x1ec))/0x8)+-parseInt(_0x4125cc(0x1ab))/0x9+parseInt(_0x4125cc(0x231))/0xa;if(_0x2b2e11===_0x3b167c)break;else _0x493abb['push'](_0x493abb['shift']());}catch(_0x1da234){_0x493abb['push'](_0x493abb['shift']());}}}(a22_0x7dd5,0xd682e));import a22_0x9964f3 from'chalk';import a22_0x212a4b from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0xd0bbb3){const _0xc43ea5=a22_0x5464;return!_0xd0bbb3&&(console[_0xc43ea5(0x26e)](_0xc43ea5(0x21b)),console[_0xc43ea5(0x26e)](_0xc43ea5(0x1b2))),!!_0xd0bbb3;}function withJsonFormat(_0x11eb13){const _0x24d1e3=a22_0x5464;if(!_0x11eb13['format']&&!_0x11eb13[_0x24d1e3(0x23b)]&&!_0x11eb13[_0x24d1e3(0x224)]&&!_0x11eb13[_0x24d1e3(0x223)])return{..._0x11eb13,'format':_0x24d1e3(0x23b),'json':!![]};return _0x11eb13;}function formatJourneyState(_0x1e44b2){const _0x5f1d03=a22_0x5464;switch(_0x1e44b2){case _0x5f1d03(0x208):return a22_0x9964f3[_0x5f1d03(0x1a7)](_0x5f1d03(0x1db));case'draft':return a22_0x9964f3['dim']('(draft)');case'paused':return a22_0x9964f3[_0x5f1d03(0x235)](_0x5f1d03(0x27d));case'completed':return a22_0x9964f3['blue']('(completed)');case _0x5f1d03(0x1eb):return a22_0x9964f3[_0x5f1d03(0x249)]('(archived)');default:return'('+_0x1e44b2+')';}}function formatJourneyItem(_0xaea76b,_0x4470e7='',_0x28c4b1){const _0x30298b=a22_0x5464,_0x516815=formatJourneyState(_0xaea76b[_0x30298b(0x1b0)]),_0x53eaa0=_0x28c4b1?hyperlink(_0xaea76b[_0x30298b(0x21a)],_0x28c4b1):_0xaea76b['journeyBundleName'];return _0x4470e7+_0x30298b(0x1c7)+_0x53eaa0+'\x20'+_0x516815;}function escapeRegex(_0x48a1fd){const _0x5761c1=a22_0x5464;return _0x48a1fd[_0x5761c1(0x196)](/[.*+?^${}()|[\]\\]/g,_0x5761c1(0x1cb));}function globToRegex(_0x37952d){const _0x27675a=a22_0x5464,_0x1454c1=_0x37952d[_0x27675a(0x1f3)]('*')['map'](escapeRegex);return new RegExp(_0x1454c1[_0x27675a(0x194)]('.*'),'i');}function a22_0x7dd5(){const _0x58e5c8=['rule','\x20\x20Name:\x20','root\x20folder','activationParams','green','1695804QxvdaX','tdx.json','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','2136492KNCAiT','push','size','journeyStages','resolveJourneyId','state','Getting\x20version\x20','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','session','\x20\x20Target:\x20','stageNameMap','audienceId','includeHistory','\x20journeys','Getting\x20journey\x20statistics...','journey:activations','Pausing\x20journey...','\x22\x20resumed','121185ntDBWs','folders','\x20=\x20','map','\x20\x20Preserving\x20local\x20segment\x20name:\x20','absolutePath','then','Resume\x20a\x20paused\x20journey','journey:version:create','journey:version:view','🗺️\x20','dryRun','\x22\x20paused','✔\x20Pulled\x20','\x5c$&','user','82yCiHHx','buildIdToNameMap','file','Database:\x20','completeMilestoneRate','length','getJourney','includeStats','entries','\x20Created\x20v','Parent\x20segment:\x20','✔\x20Journey\x20\x22','List\x20journeys\x20in\x20current\x20context','List\x20all\x20versions\x20of\x20a\x20journey','(running)','Input:\x20','base','renderStats','options','isNew','parentSegment','Pattern:\x20','hasPeriod','\x20journey','\x20files?','Options:','journey:stats','log','reentryMode','toLowerCase','archived','2011432TjQBGN','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','✔\x20All\x20files\x20are\x20up\x20to\x20date','Resolving\x20version...','Journey\x20name:\x20','all','createVersion','split','stringify','Error:\x20Stage\x20\x22','No\x20statistics\x20available\x20for\x20journey:\x20','11829EaPTGa','helpText','\x20journey\x20files\x20to\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journey:columns','columns','resolveParentId','/j/da/je','Error:\x20Invalid\x20version\x20number:\x20','updatedAt','/j/da','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','attributes','activation_','Available\x20stages:\x20','utf-8','\x22\x20not\x20found','launched','from','has','journeyName','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20Invalid\x20--type\x20\x22','Resolved\x20YAML\x20file:\x20','listVersions','Show\x20journey\x20statistics','segment','filter','conversion','\x20\x20Statistics\x20not\x20available','args','set','execute','segmentName','table','journeyBundleName','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','format','repeat','\x20versions)','Target\x20directory:\x20','No\x20journeys\x20found','resourceName','createdAt','tsv','jsonl','\x20(rule\x20match)','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Error:\x20Version\x20','add','-\x20no\x20files\x20written','Pause\x20a\x20running\x20journey','/app/ps/','Write\x20','site','\x20\x20Folder\x20path:\x20','\x0aChanges\x20to\x20\x27','kind','15025640UszSPH','5791456EBampl','\x20(ID:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','yellow','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','goal','activation','Fetching\x20users\x20and\x20connections...','json','Error:\x20Journey\x20not\x20found:\x20','folderId','\x20not\x20found.\x20Available:\x20','journey:resume','localeCompare','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','getStatistics','content','\x20activation','message','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','errorCode','(root)','dim','Table:\x20','stages','hasChanges','\x0aError:','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','enteredSize','\x20(draft)\x20—\x20\x22','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','data','Export\x20journey(s)\x20as\x20YAML\x20files','INVALID_ARGUMENT','getParentFull','exitOrJumpSize','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','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)','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','completionRate','journey:traffic','📁\x20','Getting\x20journey\x20traffic\x20data...','parent_segment','Error:\x20Journey\x20\x27','connection','Resolving\x20journey...','values','listJourneysFromParentSegment','Getting\x20journey\x20details...','List\x20activations\x20for\x20a\x20journey','\x27\x20not\x20found\x20in\x20','Getting\x20column\x20mapping...','372lLybRP','sort','diff','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Show\x20journey\x20details','error','buildIdToEmailMap','Listing\x20journeys...','rootFolderId','filePath','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','targetDir','relative','Error:\x20--version\x20option\x20is\x20required','segments','\x20\x20Parent\x20segment:\x20','name','journeyId','listJourneysWithFolders','bold','(paused)','exitOrJumpRate','type','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x0aPull\x20summary:','7KGfduC','paused','.yml','journeyBundleId','history','getSegment','description','\x20changed\x20files','Fetching\x20','get','goalSize',',\x20version:\x20','versionNumber','journeys','View\x20a\x20specific\x20version\x20of\x20a\x20journey','setPhase','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','pause','Folder\x20path:\x20','web','journey','yes','red','folderPath','\x20Opening\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Cancelled','join','Error:\x20','replace','find','Fetching\x20journeys\x20and\x20folders...','Fetching\x20parent\x20segment...','segmentPushCommand','verbose','/e/','Listing\x20journey\x20activations...','Found\x20','Target\x20file:\x20','cyan','Show\x20journey\x20table\x20column\x20mapping','Resolving\x20parent\x20segment...'];a22_0x7dd5=function(){return _0x58e5c8;};return a22_0x7dd5();}function buildRuleToNameMapping(_0x5130d1){const _0x2b008d=a22_0x5464,_0x31a0cb=new Map();if(_0x5130d1[_0x2b008d(0x277)])for(const [_0x33cb0e,_0x57ec6d]of Object[_0x2b008d(0x1d5)](_0x5130d1[_0x2b008d(0x277)])){if(_0x57ec6d['rule']){const _0x5d7ea6=serializeRule(_0x57ec6d[_0x2b008d(0x1a3)]),_0x3792ae=_0x31a0cb[_0x2b008d(0x182)](_0x5d7ea6);_0x3792ae?_0x3792ae[_0x2b008d(0x1ac)](_0x33cb0e):_0x31a0cb[_0x2b008d(0x216)](_0x5d7ea6,[_0x33cb0e]);}}return _0x31a0cb;}async function resolveJourneyIdFromInput(_0x1a1c6f,_0x41226d,_0x278e65){const _0x407dd0=a22_0x5464,_0x3c2f15=await resolveJourneyTarget(_0x1a1c6f,_0x41226d[_0x407dd0(0x1e1)],_0x41226d[_0x407dd0(0x19b)]),_0x56da36=_0x3c2f15[_0x407dd0(0x1e1)];if(!_0x56da36)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x407dd0(0x273));const _0x4fa25e=await withSpinner(_0x407dd0(0x1a2),()=>_0x278e65[_0x407dd0(0x211)][_0x407dd0(0x1fd)](_0x56da36),{'verbose':_0x41226d[_0x407dd0(0x19b)]}),_0x117186=_0x4fa25e['data'],_0x57285c=await withSpinner(_0x407dd0(0x261),()=>_0x278e65[_0x407dd0(0x18d)][_0x407dd0(0x1af)](_0x117186,_0x3c2f15[_0x407dd0(0x20b)]),{'verbose':_0x41226d[_0x407dd0(0x19b)]});return{'journeyId':_0x57285c['data'],'journeyName':_0x3c2f15[_0x407dd0(0x20b)],'parentSegmentId':_0x117186};}async function resolveJourneyTarget(_0x281544,_0x253dc0,_0x27287c){const _0x427ef2=a22_0x5464;if(isYamlFilePath(_0x281544))try{const _0x36cbcf=await resolveYamlFilePath(_0x281544);return _0x27287c&&(console['error'](_0x427ef2(0x20e)+_0x281544),console[_0x427ef2(0x26e)](_0x427ef2(0x278)+_0x36cbcf[_0x427ef2(0x1e1)]),console[_0x427ef2(0x26e)](_0x427ef2(0x1a4)+_0x36cbcf[_0x427ef2(0x218)]),console[_0x427ef2(0x26e)](_0x427ef2(0x22e)+(_0x36cbcf[_0x427ef2(0x190)]||_0x427ef2(0x248)))),{'journeyName':_0x36cbcf['segmentName'],'parentSegment':_0x36cbcf[_0x427ef2(0x1e1)],'resolved':_0x36cbcf};}catch(_0x281da7){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x427ef2(0x192)+_0x281da7['message']);}if(!_0x253dc0)throw new SDKError(ErrorCode[_0x427ef2(0x254)],_0x427ef2(0x257));return{'journeyName':_0x281544,'parentSegment':_0x253dc0};}export class JourneyListCommand extends BaseCommand{[a22_0x242202(0x279)]='journey:list';['description']=a22_0x242202(0x1d9);async['execute'](_0x337316){const _0x15dd0c=a22_0x242202,{options:_0x3501d1,args:_0x4dbe34,tdx:_0x4038ea}=_0x337316,_0x5c5122=_0x4dbe34[0x0],_0x3772c8=_0x3501d1[_0x15dd0c(0x1e1)];if(!_0x3772c8)return console[_0x15dd0c(0x26e)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x15dd0c(0x26e)](_0x15dd0c(0x251)),0x1;const _0x4795da=await withSpinner(_0x15dd0c(0x1a2),()=>_0x4038ea[_0x15dd0c(0x211)]['resolveParentId'](_0x3772c8),{'verbose':_0x3501d1[_0x15dd0c(0x19b)]}),_0x2e7066=_0x4795da[_0x15dd0c(0x252)];_0x3501d1['verbose']&&(console[_0x15dd0c(0x26e)](_0x15dd0c(0x1d7)+_0x3772c8+_0x15dd0c(0x233)+_0x2e7066+')'),_0x5c5122&&console[_0x15dd0c(0x26e)](_0x15dd0c(0x1e2)+_0x5c5122));const _0x4c94de=await withSpinner(_0x15dd0c(0x199),()=>_0x4038ea[_0x15dd0c(0x211)][_0x15dd0c(0x255)](_0x2e7066),{'verbose':_0x3501d1['verbose']}),_0x3df734=_0x4c94de[_0x15dd0c(0x252)],_0x123995=_0x3df734[_0x15dd0c(0x271)],_0x526a01=await withSpinner(_0x15dd0c(0x270),()=>_0x4038ea[_0x15dd0c(0x18d)][_0x15dd0c(0x27b)](_0x2e7066,_0x123995),{'verbose':_0x3501d1['verbose']});let _0x225d8b=_0x526a01['data'][_0x15dd0c(0x186)];const _0xe97875=_0x526a01[_0x15dd0c(0x252)][_0x15dd0c(0x1be)],_0x399674=new Map();for(const _0x3b0e64 of _0xe97875){_0x399674[_0x15dd0c(0x216)](_0x3b0e64['id'],_0x3b0e64['name']);}if(_0x5c5122){const _0x32d1db=globToRegex(_0x5c5122);_0x225d8b=_0x225d8b[_0x15dd0c(0x212)](_0x32fbad=>_0x32d1db['test'](_0x32fbad['journeyBundleName']));}console[_0x15dd0c(0x26e)]('✔\x20Found\x20'+_0x225d8b['length']+_0x15dd0c(0x1e4)+(_0x225d8b[_0x15dd0c(0x1d2)]!==0x1?'s':''));const _0x3cd71f=_0x54687b=>{const _0x18b9b0=_0x15dd0c;return getConsoleNextUrl(_0x3501d1['site'],_0x18b9b0(0x22b)+_0x2e7066+_0x18b9b0(0x19c)+_0x54687b+_0x18b9b0(0x201));};if(_0x3501d1[_0x15dd0c(0x21c)]===_0x15dd0c(0x219))await handleSDKOutput(_0x225d8b,_0x3501d1);else{if(_0x3501d1[_0x15dd0c(0x21c)]===_0x15dd0c(0x23b)){const _0x2a5dae=_0x225d8b[_0x15dd0c(0x1c0)](_0x26c6de=>({..._0x26c6de,'url':_0x3cd71f(_0x26c6de['id'])}));await handleSDKOutput(_0x2a5dae,_0x3501d1);}else{console['log']('['+_0x3772c8+']');const _0x3f321e=new Map(),_0x458106=[];for(const _0x22ae26 of _0x225d8b){if(!_0x22ae26[_0x15dd0c(0x23d)]||_0x22ae26['folderId']===_0x123995)_0x458106[_0x15dd0c(0x1ac)](_0x22ae26);else{const _0x47007d=_0x3f321e[_0x15dd0c(0x182)](_0x22ae26['folderId'])||[];_0x47007d['push'](_0x22ae26),_0x3f321e[_0x15dd0c(0x216)](_0x22ae26['folderId'],_0x47007d);}}const _0x32db9a=(_0x5cbdca,_0x47af0e)=>_0x5cbdca['journeyBundleName'][_0x15dd0c(0x240)](_0x47af0e[_0x15dd0c(0x21a)],undefined,{'sensitivity':_0x15dd0c(0x1dd)});_0x458106[_0x15dd0c(0x269)](_0x32db9a);for(const _0x16137e of _0x458106){console['log'](formatJourneyItem(_0x16137e,'',_0x3cd71f(_0x16137e['id'])));}const _0x3fdf51=[..._0x3f321e[_0x15dd0c(0x1d5)]()]['sort']((_0x3826b2,_0x214c14)=>{const _0x56068c=_0x15dd0c,_0x49c2f=_0x399674['get'](_0x3826b2[0x0])||_0x3826b2[0x0],_0x397da1=_0x399674['get'](_0x214c14[0x0])||_0x214c14[0x0];return _0x49c2f[_0x56068c(0x240)](_0x397da1,undefined,{'sensitivity':_0x56068c(0x1dd)});});for(const [_0x3110d,_0x1de229]of _0x3fdf51){const _0x3d3199=_0x399674[_0x15dd0c(0x182)](_0x3110d)||_0x3110d;console[_0x15dd0c(0x1e8)](_0x15dd0c(0x25c)+_0x3d3199),_0x1de229[_0x15dd0c(0x269)](_0x32db9a);for(const _0x533b7a of _0x1de229){console[_0x15dd0c(0x1e8)](formatJourneyItem(_0x533b7a,'\x20\x20',_0x3cd71f(_0x533b7a['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a22_0x242202(0x279)]='journey:view';['description']=a22_0x242202(0x26d);async['execute'](_0x8e192d){const _0x1ad34a=a22_0x242202,{options:_0x5bc80e,args:_0x19a228,tdx:_0x38e44a}=_0x8e192d,_0x5c8f22=_0x19a228[0x0];if(!_0x5c8f22)return console['error'](_0x1ad34a(0x21b)),console[_0x1ad34a(0x26e)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x1ad34a(0x26e)](_0x1ad34a(0x1e6)),console[_0x1ad34a(0x26e)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x5bc80e[_0x1ad34a(0x19b)]&&console[_0x1ad34a(0x26e)](_0x1ad34a(0x1dc)+_0x5c8f22);const {journeyId:_0x57e53b,parentSegmentId:_0x14fd68}=await resolveJourneyIdFromInput(_0x5c8f22,_0x5bc80e,_0x38e44a);if(_0x5bc80e[_0x1ad34a(0x18c)]){const _0x1e0ed5=getConsoleNextUrl(_0x5bc80e[_0x1ad34a(0x22d)],_0x1ad34a(0x22b)+_0x14fd68+_0x1ad34a(0x19c)+_0x57e53b+_0x1ad34a(0x1fe));return console['error'](a22_0x9964f3[_0x1ad34a(0x1a7)]('✔')+_0x1ad34a(0x191)+a22_0x9964f3[_0x1ad34a(0x1a0)](_0x1e0ed5)),openBrowser(_0x1e0ed5),0x0;}const _0x4222bf=await withSpinner(_0x1ad34a(0x264),()=>_0x38e44a[_0x1ad34a(0x18d)][_0x1ad34a(0x1d3)](_0x57e53b),{'verbose':_0x5bc80e[_0x1ad34a(0x19b)]}),_0x502d70=_0x4222bf[_0x1ad34a(0x252)],_0x44f2e7=_0x5bc80e[_0x1ad34a(0x1d4)];let _0x3d9875;if(_0x44f2e7)try{const _0x5e4e3c=await withSpinner(_0x1ad34a(0x1b9),()=>_0x38e44a['journey']['getStatistics'](_0x57e53b),{'verbose':_0x5bc80e['verbose']});_0x3d9875=_0x5e4e3c[_0x1ad34a(0x252)];}catch{_0x5bc80e[_0x1ad34a(0x19b)]&&console[_0x1ad34a(0x26e)](_0x1ad34a(0x214));}const _0x4b1727=getConsoleNextUrl(_0x5bc80e['site'],_0x1ad34a(0x22b)+_0x14fd68+_0x1ad34a(0x19c)+_0x57e53b+_0x1ad34a(0x1fe)),_0x534e62={'id':_0x502d70['id'],'name':_0x502d70[_0x1ad34a(0x203)]['name'],'description':_0x502d70[_0x1ad34a(0x203)][_0x1ad34a(0x17f)],'state':_0x502d70[_0x1ad34a(0x203)][_0x1ad34a(0x1b0)],'paused':_0x502d70[_0x1ad34a(0x203)][_0x1ad34a(0x17a)],'reentry_mode':_0x502d70[_0x1ad34a(0x203)][_0x1ad34a(0x1e9)],'stages':_0x502d70['attributes'][_0x1ad34a(0x1ae)]?.[_0x1ad34a(0x1d2)]||0x0,..._0x502d70[_0x1ad34a(0x203)][_0x1ad34a(0x238)]&&{'goal':_0x502d70[_0x1ad34a(0x203)][_0x1ad34a(0x238)][_0x1ad34a(0x279)]},..._0x3d9875&&{'statistics':{'size':_0x3d9875[_0x1ad34a(0x1ad)],'entered':_0x3d9875['enteredSize'],'goal_achieved':_0x3d9875[_0x1ad34a(0x183)],'completion_rate':_0x3d9875[_0x1ad34a(0x25a)],'exit_or_jump':_0x3d9875['exitOrJumpSize'],'exit_or_jump_rate':_0x3d9875[_0x1ad34a(0x27e)],'stages':_0x3d9875[_0x1ad34a(0x24b)]}},'url':_0x4b1727};return await handleSingleObjectOutput(_0x534e62,_0x5bc80e),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x242202(0x279)]=a22_0x242202(0x1e7);['description']=a22_0x242202(0x210);async[a22_0x242202(0x217)](_0x45062a){const _0x2753f3=a22_0x242202,{options:_0x16624c,args:_0xd7c495,tdx:_0xbb851}=_0x45062a,_0x280014=_0xd7c495[0x0];if(!requireNameOrPath(_0x280014))return 0x1;_0x16624c[_0x2753f3(0x19b)]&&console[_0x2753f3(0x26e)](_0x2753f3(0x1dc)+_0x280014);const _0x1f4c47=_0x16624c,_0xb9126d=_0x1f4c47['from'],_0x4053e1=_0x1f4c47['to'],_0x19d6e7=_0x1f4c47[_0x2753f3(0x1b7)],_0x2a66c4=_0x1f4c47['stage'];_0x19d6e7&&!_0xb9126d&&!_0x4053e1&&console[_0x2753f3(0x26e)](_0x2753f3(0x246));const _0x1ae4f7=_0x19d6e7?withJsonFormat(_0x16624c):_0x16624c,{journeyId:_0x2f7214,journeyName:_0x49a681}=await resolveJourneyIdFromInput(_0x280014,_0x1ae4f7,_0xbb851),_0x435a4e=_0xb9126d||_0x4053e1?{'from':_0xb9126d,'to':_0x4053e1}:undefined,_0x5c399b=await withSpinner(_0x2753f3(0x1b9),()=>Promise['all']([_0xbb851['journey'][_0x2753f3(0x1d3)](_0x2f7214),_0xbb851[_0x2753f3(0x18d)][_0x2753f3(0x242)](_0x2f7214,_0x435a4e)]),{'verbose':_0x1ae4f7[_0x2753f3(0x19b)]}),[_0x1ea4e7,_0x1818aa]=_0x5c399b['data'];if(!_0x1818aa||_0x1818aa[_0x2753f3(0x27a)]===null)return console[_0x2753f3(0x26e)](_0x2753f3(0x1f6)+_0x49a681),console[_0x2753f3(0x26e)](_0x2753f3(0x237)),0x0;const _0x1234e0=buildStageNameMap(_0x1ea4e7),_0x2b36c3=!!(_0x435a4e&&_0x1818aa['history']?.[_0x2753f3(0x1d2)]),_0x2fb582={'stageNameMap':_0x1234e0,'hasPeriod':_0x2b36c3,'includeHistory':!!_0x19d6e7};if(_0x2a66c4&&_0x1818aa['stages']){const _0x2d9ba3=_0x1818aa['stages'][_0x2753f3(0x197)](_0x225e0e=>{const _0x42c1f4=_0x2753f3,_0x16a21d=_0x1234e0[_0x42c1f4(0x182)](_0x225e0e['id'])??'';return _0x16a21d['toLowerCase']()===_0x2a66c4[_0x42c1f4(0x1ea)]();});if(_0x2d9ba3)return await handleSingleObjectOutput(formatStageStats(_0x2d9ba3,_0x2fb582),_0x1ae4f7),0x0;const _0x2b0497=_0x1818aa[_0x2753f3(0x24b)]['map'](_0x558f89=>_0x1234e0[_0x2753f3(0x182)](_0x558f89['id'])??_0x558f89['id']);return console[_0x2753f3(0x26e)](_0x2753f3(0x1f5)+_0x2a66c4+_0x2753f3(0x207)),console['error'](_0x2753f3(0x205)+_0x2b0497['join'](',\x20')),0x1;}const _0x24178d=_0x1818aa[_0x2753f3(0x24b)]?.[_0x2753f3(0x1c0)](_0x4cc6d9=>formatStageStats(_0x4cc6d9,_0x2fb582)),_0x3842d9=assembleJourneyStats(_0x1818aa,{'from':_0xb9126d,'to':_0x4053e1,'includeHistory':_0x19d6e7});return await this[_0x2753f3(0x1de)](_0x3842d9,_0x24178d??[],_0x1ae4f7),0x0;}async['renderStats'](_0x3d9809,_0x41038d,_0x455bab){const _0x1a1f96=a22_0x242202,_0x51ff55=_0x455bab[_0x1a1f96(0x21c)]===_0x1a1f96(0x23b)||_0x455bab[_0x1a1f96(0x21c)]===_0x1a1f96(0x224)||_0x455bab[_0x1a1f96(0x23b)]||_0x455bab['jsonl'];if(_0x51ff55){_0x3d9809[_0x1a1f96(0x24b)]=_0x41038d,await handleSingleObjectOutput(_0x3d9809,_0x455bab);return;}await handleSingleObjectOutput(_0x3d9809,_0x455bab);for(const _0x4639ef of _0x41038d){console[_0x1a1f96(0x1e8)](''),console[_0x1a1f96(0x1e8)](String(a22_0x9964f3[_0x1a1f96(0x1a0)][_0x1a1f96(0x27c)]('['+_0x4639ef['name']+']'))+a22_0x9964f3[_0x1a1f96(0x249)]('\x20'+_0x4639ef['id']));const {id:_0x359a54,name:_0x17d805,..._0x42a83d}=_0x4639ef;await handleSingleObjectOutput(_0x42a83d,_0x455bab);}}}function a22_0x5464(_0x3153ef,_0x15dfd1){_0x3153ef=_0x3153ef-0x17a;const _0x7dd567=a22_0x7dd5();let _0x5464f3=_0x7dd567[_0x3153ef];return _0x5464f3;}export class JourneyTrafficCommand extends BaseCommand{['name']=a22_0x242202(0x25b);['description']='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async['execute'](_0x9c01a){const _0x283593=a22_0x242202,{options:_0x142dfd,args:_0x73bfc,tdx:_0x3b841c}=_0x9c01a,_0x301654=_0x73bfc[0x0];if(!requireNameOrPath(_0x301654))return 0x1;_0x142dfd[_0x283593(0x19b)]&&console[_0x283593(0x26e)](_0x283593(0x1dc)+_0x301654);const _0x1377a9=_0x142dfd,_0xb0c20a=_0x1377a9['type'],_0x58d46d=_0x1377a9[_0x283593(0x209)],_0x1f234c=_0x1377a9['to'],_0x3d24a4=_0x1377a9['limit'];if(_0xb0c20a&&_0xb0c20a!==_0x283593(0x213)&&_0xb0c20a!==_0x283593(0x239))return console['error'](_0x283593(0x20d)+_0xb0c20a+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x2922ea=withJsonFormat(_0x142dfd),{journeyId:_0x3c5b70,journeyName:_0x101125}=await resolveJourneyIdFromInput(_0x301654,_0x2922ea,_0x3b841c),_0x3d3c86={'type':_0xb0c20a,'from':_0x58d46d,'to':_0x1f234c,'limit':_0x3d24a4},_0x3df5d0=await withSpinner(_0x283593(0x25d),()=>_0x3b841c[_0x283593(0x18d)]['getTrafficData'](_0x3c5b70,_0x3d3c86),{'verbose':_0x2922ea[_0x283593(0x19b)]}),_0x2fd31d=_0x3df5d0[_0x283593(0x252)],_0x51cf0f=_0x2fd31d['conversion']&&(_0x2fd31d[_0x283593(0x213)]['nodes'][_0x283593(0x1d2)]>0x0||_0x2fd31d[_0x283593(0x213)]['links'][_0x283593(0x1d2)]>0x0),_0x6f0ecc=_0x2fd31d['activation']&&_0x2fd31d[_0x283593(0x239)]['length']>0x0;if(!_0x51cf0f&&!_0x6f0ecc)return console[_0x283593(0x26e)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x101125),console[_0x283593(0x26e)](_0x283593(0x241)),_0x58d46d&&_0x1f234c&&console[_0x283593(0x26e)](_0x283593(0x26b)),0x0;return await handleSingleObjectOutput(_0x2fd31d,_0x2922ea),0x0;}}function formatStageStats(_0x4da35a,_0x106b7d){const _0x4bbf9f=a22_0x242202,_0x250f37=_0x106b7d[_0x4bbf9f(0x1e3)]&&_0x4da35a[_0x4bbf9f(0x17d)]?.[_0x4bbf9f(0x1d2)]?aggregateStageHistory(_0x4da35a['history']):{'size':_0x4da35a['size'],'entered':_0x4da35a[_0x4bbf9f(0x24f)],'milestone':_0x4da35a['milestoneSize'],'milestone_rate':_0x4da35a[_0x4bbf9f(0x1d1)],'exit_or_jump':_0x4da35a[_0x4bbf9f(0x256)],'exit_or_jump_rate':_0x4da35a[_0x4bbf9f(0x27e)]},_0x11d5e8={'id':_0x4da35a['id'],'name':_0x106b7d[_0x4bbf9f(0x1b5)][_0x4bbf9f(0x182)](_0x4da35a['id'])??_0x4da35a['id'],..._0x250f37};return _0x106b7d['hasPeriod']&&_0x106b7d[_0x4bbf9f(0x1b7)]&&_0x4da35a[_0x4bbf9f(0x17d)]&&(_0x11d5e8[_0x4bbf9f(0x17d)]=_0x4da35a[_0x4bbf9f(0x17d)]),_0x11d5e8;}export class JourneyPauseCommand extends BaseCommand{[a22_0x242202(0x279)]='journey:pause';[a22_0x242202(0x17f)]=a22_0x242202(0x22a);async[a22_0x242202(0x217)](_0x3d59c0){const _0x5a2c34=a22_0x242202,{options:_0x35e5ca,args:_0x4d25b7,tdx:_0x48023a}=_0x3d59c0,_0xc75628=_0x4d25b7[0x0];if(!requireNameOrPath(_0xc75628))return 0x1;_0x35e5ca[_0x5a2c34(0x19b)]&&console[_0x5a2c34(0x26e)]('Input:\x20'+_0xc75628);const {journeyId:_0x359e38,journeyName:_0x4c5128}=await resolveJourneyIdFromInput(_0xc75628,_0x35e5ca,_0x48023a);if(!_0x35e5ca[_0x5a2c34(0x18e)]){const _0x496c51=await confirm(_0x5a2c34(0x259)+_0x4c5128+'\x22?');if(!_0x496c51)return console['error'](_0x5a2c34(0x193)),0x0;}const _0x41232a=await withSpinner(_0x5a2c34(0x1bb),()=>_0x48023a[_0x5a2c34(0x18d)][_0x5a2c34(0x18a)](_0x359e38),{'verbose':_0x35e5ca[_0x5a2c34(0x19b)]}),_0x40f08a=_0x41232a[_0x5a2c34(0x252)];return console[_0x5a2c34(0x26e)](_0x5a2c34(0x1d8)+_0x40f08a['attributes'][_0x5a2c34(0x279)]+_0x5a2c34(0x1c9)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a22_0x242202(0x279)]=a22_0x242202(0x23f);['description']=a22_0x242202(0x1c4);async['execute'](_0x124046){const _0x55b30b=a22_0x242202,{options:_0x53c572,args:_0x23b456,tdx:_0x4e2581}=_0x124046,_0x5d613a=_0x23b456[0x0];if(!requireNameOrPath(_0x5d613a))return 0x1;_0x53c572[_0x55b30b(0x19b)]&&console['error']('Input:\x20'+_0x5d613a);const {journeyId:_0x2569ce,journeyName:_0x5b69bd}=await resolveJourneyIdFromInput(_0x5d613a,_0x53c572,_0x4e2581);if(!_0x53c572['yes']){const _0xed3cf=await confirm(_0x55b30b(0x281)+_0x5b69bd+'\x22?');if(!_0xed3cf)return console[_0x55b30b(0x26e)]('Cancelled'),0x0;}const _0x10e9e4=await withSpinner('Resuming\x20journey...',()=>_0x4e2581['journey']['resume'](_0x2569ce),{'verbose':_0x53c572[_0x55b30b(0x19b)]}),_0x226ac0=_0x10e9e4['data'];return console[_0x55b30b(0x26e)](_0x55b30b(0x1d8)+_0x226ac0['attributes']['name']+_0x55b30b(0x1bc)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x242202(0x279)]='journey:pull';[a22_0x242202(0x17f)]=a22_0x242202(0x253);async[a22_0x242202(0x217)](_0x72490a){const _0x11e314=a22_0x242202,{options:_0x3e2cfb,args:_0x1ae47c,tdx:_0x17ace5}=_0x72490a,_0x4c5071=_0x3e2cfb,_0x5edb1f=_0x1ae47c[0x0],_0x2a9316=_0x5edb1f&&isYamlFilePath(_0x5edb1f),_0x15e5a3=await resolveTarget({'arg':_0x2a9316?_0x5edb1f:undefined,'contextParent':_0x3e2cfb[_0x11e314(0x1e1)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x15e5a3))return _0x15e5a3[_0x11e314(0x247)]==='no_parent'?(console[_0x11e314(0x26e)](a22_0x9964f3[_0x11e314(0x235)](_0x11e314(0x236))),console[_0x11e314(0x26e)](_0x11e314(0x258)),console[_0x11e314(0x26e)](_0x11e314(0x1aa)),console['error'](_0x11e314(0x189)),console[_0x11e314(0x26e)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x11e314(0x26e)](a22_0x9964f3['red'](_0x11e314(0x195)+_0x15e5a3['message']+'\x0a')),_0x15e5a3[_0x11e314(0x1f8)]&&console[_0x11e314(0x26e)](a22_0x9964f3[_0x11e314(0x1a0)](_0x15e5a3[_0x11e314(0x1f8)]))),0x1;let _0x6779aa=_0x2a9316?undefined:_0x5edb1f,_0x53952d,_0x1f939b;_0x15e5a3[_0x11e314(0x27f)]===_0x11e314(0x1cf)&&(_0x6779aa=_0x15e5a3[_0x11e314(0x221)],_0x53952d=_0x15e5a3[_0x11e314(0x272)],_0x1f939b=_0x15e5a3['folderPath']);const _0x406258=_0x15e5a3['parentName'],_0x2f9398=_0x15e5a3[_0x11e314(0x274)];_0x4c5071[_0x11e314(0x19b)]&&(console[_0x11e314(0x26e)](_0x11e314(0x1d7)+_0x406258),console[_0x11e314(0x26e)](_0x11e314(0x21f)+_0x2f9398),_0x6779aa&&console[_0x11e314(0x26e)](_0x11e314(0x1f0)+_0x6779aa),_0x53952d&&console[_0x11e314(0x26e)](_0x11e314(0x19f)+_0x53952d),_0x1f939b&&console[_0x11e314(0x26e)](_0x11e314(0x18b)+_0x1f939b));const _0x32b39a=await withSpinner(_0x11e314(0x1a2),()=>_0x17ace5['segment']['resolveParentId'](_0x406258),{'verbose':_0x3e2cfb[_0x11e314(0x19b)]}),_0x54fad7=_0x32b39a['data'],{journeys:_0x3ccb32,folders:_0x53c0bd}=await withSpinner(_0x11e314(0x198),async()=>{const _0x42a692=_0x11e314,[_0x1b3474,_0x2c93b1]=await Promise[_0x42a692(0x1f1)]([_0x17ace5[_0x42a692(0x18d)][_0x42a692(0x263)](_0x54fad7,undefined,{'includeAllVersions':!![]}),_0x17ace5[_0x42a692(0x211)]['listFolders'](_0x54fad7)]);return{'journeys':_0x1b3474,'folders':_0x2c93b1};},{'verbose':_0x3e2cfb[_0x11e314(0x19b)]})[_0x11e314(0x1c3)](_0xa81a9c=>_0xa81a9c[_0x11e314(0x252)]);let _0x50b104=_0x3ccb32;const _0x3c4a9e=buildFolderIdToPathMap(_0x53c0bd);if(_0x6779aa){const _0x59c4aa=_0x50b104['filter'](_0x39dee8=>_0x39dee8['journeyBundleName']['toLowerCase']()===_0x6779aa[_0x11e314(0x1ea)]());if(_0x59c4aa[_0x11e314(0x1d2)]===0x0)return console[_0x11e314(0x26e)](_0x11e314(0x23c)+_0x6779aa),console[_0x11e314(0x26e)](_0x11e314(0x280)),0x1;_0x50b104=_0x59c4aa;}if(_0x1f939b!==undefined){const _0x1fbcfe=_0x50b104[_0x11e314(0x212)](_0x525b09=>{const _0x286f70=_0x11e314,_0x2ea965=_0x525b09[_0x286f70(0x23d)]?_0x3c4a9e['get'](_0x525b09['folderId'])||'':'';return _0x2ea965===_0x1f939b;});if(_0x1fbcfe[_0x11e314(0x1d2)]===0x0&&_0x50b104['length']>0x0){console[_0x11e314(0x26e)](_0x11e314(0x25f)+_0x6779aa+_0x11e314(0x266)+(_0x1f939b||_0x11e314(0x1a5))),console['error'](_0x11e314(0x20c));for(const _0x40b87c of _0x50b104){const _0x164d47=_0x40b87c['folderId']?_0x3c4a9e['get'](_0x40b87c[_0x11e314(0x23d)])||'':'';console['error']('\x20\x20-\x20'+(_0x164d47||'(root)')+'/'+_0x40b87c[_0x11e314(0x21a)]);}return 0x1;}_0x50b104=_0x1fbcfe;}if(_0x50b104['length']===0x0)return console['error'](_0x11e314(0x220)),0x0;const _0x5e580a=new Map();for(const _0x475e13 of _0x50b104){const _0x148cd8=_0x475e13['journeyBundleId'];!_0x5e580a[_0x11e314(0x20a)](_0x148cd8)&&_0x5e580a[_0x11e314(0x216)](_0x148cd8,[]),_0x5e580a[_0x11e314(0x182)](_0x148cd8)[_0x11e314(0x1ac)](_0x475e13);}for(const _0x2cd56f of _0x5e580a[_0x11e314(0x262)]()){_0x2cd56f[_0x11e314(0x269)]((_0xe2bd,_0xbff52d)=>(_0xe2bd[_0x11e314(0x185)]||0x0)-(_0xbff52d[_0x11e314(0x185)]||0x0));}const _0x5f0a32=[],{idToEmailMap:_0x25d582,connectionIdToNameMap:_0x3f9c7f}=await withSpinner(_0x11e314(0x23a),async()=>{const _0x31dae5=_0x11e314,[_0x36d0ec,_0x3ad80c]=await Promise['all']([_0x17ace5[_0x31dae5(0x1cc)][_0x31dae5(0x26f)](),_0x17ace5[_0x31dae5(0x260)][_0x31dae5(0x1ce)]()]);return{'idToEmailMap':_0x36d0ec,'connectionIdToNameMap':_0x3ad80c};},{'verbose':_0x3e2cfb[_0x11e314(0x19b)]})[_0x11e314(0x1c3)](_0xca8443=>_0xca8443[_0x11e314(0x252)]);for(const _0x2cc45e of _0x5e580a[_0x11e314(0x262)]()){const _0x14a4e7=_0x2cc45e[0x0][_0x11e314(0x21a)],_0x2589d9=_0x2cc45e[0x0]['folderId'],_0x58b1b2=_0x2589d9?_0x3c4a9e[_0x11e314(0x182)](_0x2589d9)||'':'',_0x25d21f=_0x58b1b2?a22_0x212a4b[_0x11e314(0x194)](_0x2f9398,_0x58b1b2):_0x2f9398,_0x2cf71b=_0x53952d||a22_0x212a4b[_0x11e314(0x194)](_0x25d21f,sanitizeFileName(_0x14a4e7)+_0x11e314(0x17b));let _0x17a7d3,_0x4d568a;if(existsSync(_0x2cf71b))try{const _0x50777b=readFileSync(_0x2cf71b,_0x11e314(0x206)),_0x2efc4c=parseYamlString(_0x50777b);_0x4d568a=_0x2efc4c,_0x17a7d3=buildRuleToNameMapping(_0x2efc4c),_0x4c5071[_0x11e314(0x19b)]&&_0x17a7d3[_0x11e314(0x1ad)]>0x0&&console[_0x11e314(0x26e)]('Found\x20'+_0x17a7d3['size']+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x14a4e7);}catch(_0x48ec5e){_0x4c5071[_0x11e314(0x19b)]&&console[_0x11e314(0x26e)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x48ec5e[_0x11e314(0x245)]);}const _0x30d98b=[],_0x28c5bc=new Set(),_0x776b00=new Map(),_0x3b042e=new Map(),_0x4c4077=new Set(),_0x1df3b8=new Map(),_0x157c09=new Map(),_0x42a8d3=createJumpTargetCache();await withProgressSpinner(_0x11e314(0x181)+_0x14a4e7+'...',async _0x5cd9e8=>{const _0x2a8b83=_0x11e314;for(const _0x475a5c of _0x2cc45e){const _0xbaccc8=_0x2cc45e[_0x2a8b83(0x1d2)]>0x1?_0x475a5c[_0x2a8b83(0x21a)]+'\x20v'+(_0x475a5c[_0x2a8b83(0x185)]||0x1):_0x475a5c['journeyBundleName'];_0x5cd9e8[_0x2a8b83(0x188)](_0x2a8b83(0x181)+_0xbaccc8);const _0x3dd951=await _0x17ace5['journey'][_0x2a8b83(0x1d3)](_0x475a5c['id']),_0x295514=_0x3dd951[_0x2a8b83(0x203)]?.[_0x2a8b83(0x1b6)],_0x3788a1={'resolveSegment':async _0x1d42c0=>{const _0x5048df=_0x2a8b83;if(!_0x295514)return{'name':_0x1d42c0,'isJourneyLocal':![]};const _0x434c91=_0x776b00['get'](_0x1d42c0);if(_0x434c91)return _0x434c91;try{const _0x286589=await _0x17ace5[_0x5048df(0x211)][_0x5048df(0x17e)](_0x295514,_0x1d42c0),_0x5147e0=_0x286589[_0x5048df(0x230)]===SEGMENT_KIND_JOURNEY;let _0x16fb47,_0x5b0d32=_0x286589['name'];if(_0x5147e0&&_0x286589[_0x5048df(0x1a3)]){const _0x615c47=await segmentResponseToDef(_0x286589,{'resolveSegmentName':async _0x58d546=>{const _0x2b8417=_0x5048df,_0x3660fd=_0x776b00[_0x2b8417(0x182)](_0x58d546);if(_0x3660fd)return _0x3660fd[_0x2b8417(0x279)];const _0x5c6cda=await _0x3788a1['resolveSegment'](_0x58d546);return _0x5c6cda[_0x2b8417(0x279)];}}),_0x1e6288=_0x615c47[_0x5048df(0x1a3)];_0x16fb47={'description':_0x286589[_0x5048df(0x17f)],'rule':_0x1e6288};const _0x2a8ab8=serializeRule(_0x1e6288),_0x4f2802=_0x3b042e['get'](_0x2a8ab8);if(_0x4f2802)_0x5b0d32=_0x4f2802,_0x16fb47=undefined,_0x4c5071['verbose']&&console['error'](_0x5048df(0x226)+_0x286589['name']+'\x20->\x20'+_0x4f2802);else{let _0x89eb85=![];if(_0x17a7d3){const _0x51aa24=_0x17a7d3[_0x5048df(0x182)](_0x2a8ab8);if(_0x51aa24){const _0x10f9b5=_0x51aa24[_0x5048df(0x197)](_0x39abf9=>!_0x28c5bc['has'](_0x39abf9));_0x10f9b5&&(_0x5b0d32=_0x10f9b5,_0x28c5bc[_0x5048df(0x228)](_0x10f9b5),_0x3b042e[_0x5048df(0x216)](_0x2a8ab8,_0x10f9b5),_0x89eb85=!![],_0x4c5071[_0x5048df(0x19b)]&&console[_0x5048df(0x26e)](_0x5048df(0x1c1)+_0x10f9b5+_0x5048df(0x225)));}}if(!_0x89eb85){const _0x594f0f=generateJourneyLocalName(_0x286589[_0x5048df(0x279)]);_0x594f0f&&(_0x5b0d32=_0x594f0f);let _0x33411e=_0x5b0d32,_0x552b15=0x2;while(_0x28c5bc[_0x5048df(0x20a)](_0x33411e)){_0x33411e=_0x5b0d32+'_'+_0x552b15,_0x552b15++;}_0x28c5bc[_0x5048df(0x228)](_0x33411e),_0x3b042e['set'](_0x2a8ab8,_0x33411e),_0x5b0d32=_0x33411e;}}}const _0x42cc17={'name':_0x5b0d32,'isJourneyLocal':_0x5147e0,'definition':_0x16fb47};return _0x776b00[_0x5048df(0x216)](_0x1d42c0,_0x42cc17),_0x42cc17;}catch(_0x1d76e3){return _0x3e2cfb[_0x5048df(0x19b)]&&console[_0x5048df(0x26e)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x1d42c0+':\x20'+_0x1d76e3[_0x5048df(0x245)]),{'name':_0x1d42c0,'isJourneyLocal':![]};}},'resolveActivation':async _0x471038=>{const _0xb56d4c=_0x2a8b83,_0x50af9d=_0x1df3b8[_0xb56d4c(0x182)](_0x471038);if(_0x50af9d)return _0x50af9d;try{const _0x38f008=await _0x17ace5['journey']['getActivation'](_0x475a5c['id'],_0x471038),_0x3a0e82=journeyActivationStepToYaml(_0x38f008,_0x25d582,_0x3f9c7f),_0x2ffd30=JSON[_0xb56d4c(0x1f4)]({'name':_0x3a0e82[_0xb56d4c(0x279)],'connection':_0x3a0e82[_0xb56d4c(0x260)],'connector_config':_0x3a0e82['connector_config']}),_0x1e8429=_0x157c09[_0xb56d4c(0x182)](_0x2ffd30);if(_0x1e8429){const _0x4e9ca8={'name':_0x1e8429,'isJourneyLocal':!![],'definition':_0x3a0e82};return _0x1df3b8[_0xb56d4c(0x216)](_0x471038,_0x4e9ca8),_0x4e9ca8;}const _0x5cec49=_0x38f008[_0xb56d4c(0x203)][_0xb56d4c(0x1a6)]['name']||_0x471038,_0xa9cfba=sanitizeYamlKey(_0x5cec49)||_0xb56d4c(0x204)+_0x471038;let _0x12b3d3=_0xa9cfba,_0x5542b5=0x2;while(_0x4c4077[_0xb56d4c(0x20a)](_0x12b3d3)){_0x12b3d3=_0xa9cfba+'_'+_0x5542b5,_0x5542b5++;}_0x4c4077[_0xb56d4c(0x228)](_0x12b3d3),_0x157c09[_0xb56d4c(0x216)](_0x2ffd30,_0x12b3d3);const _0x403a48={'name':_0x12b3d3,'isJourneyLocal':!![],'definition':_0x3a0e82};return _0x1df3b8[_0xb56d4c(0x216)](_0x471038,_0x403a48),_0x403a48;}catch(_0xbb23bb){return _0x3e2cfb[_0xb56d4c(0x19b)]&&console['error'](_0xb56d4c(0x234)+_0x471038+':\x20'+_0xbb23bb['message']),{'name':_0x471038,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5129ad,_0x21783c)=>{const _0xba65b9=_0x2a8b83;return resolveJumpTarget(_0x5129ad,_0x21783c,_0x42a8d3,_0x22fa5f=>_0x17ace5[_0xba65b9(0x18d)][_0xba65b9(0x1d3)](_0x22fa5f));}},_0x48fc6e=await journeyResponseToDef(_0x3dd951,_0x3788a1);_0x30d98b[_0x2a8b83(0x1ac)]({'item':_0x475a5c,'yaml':_0x48fc6e});}},{'verbose':_0x3e2cfb[_0x11e314(0x19b)]});const _0x1e0c05=buildMergedJourneyDef(_0x30d98b,_0x17a7d3),_0x1884df=normalizeJourneyDef(_0x1e0c05,_0x4d568a),_0x477c5d=toYamlString(_0x1884df),_0x12c865=_0x53952d||a22_0x212a4b['join'](_0x25d21f,sanitizeFileName(_0x14a4e7)+_0x11e314(0x17b));!_0x53952d&&_0x58b1b2&&!existsSync(_0x25d21f)&&mkdirSync(_0x25d21f,{'recursive':!![]});const _0x1665d4=a22_0x212a4b[_0x11e314(0x275)](process['cwd'](),_0x12c865);if(existsSync(_0x12c865)){const _0x3e7ed9=readFileSync(_0x12c865,_0x11e314(0x206)),_0x435bcb=generateDiff(_0x3e7ed9,_0x477c5d),_0x45a774=hasChanges(_0x435bcb);_0x5f0a32[_0x11e314(0x1ac)]({'relativePath':_0x1665d4,'absolutePath':_0x12c865,'content':_0x477c5d,'isNew':![],'hasChanges':_0x45a774,'diff':_0x45a774?formatDiffWithColors(_0x435bcb):undefined});}else _0x5f0a32[_0x11e314(0x1ac)]({'relativePath':_0x1665d4,'absolutePath':_0x12c865,'content':_0x477c5d,'isNew':!![],'hasChanges':![]});}const _0x14660b=_0x5f0a32[_0x11e314(0x212)](_0x3500cf=>_0x3500cf[_0x11e314(0x1e0)]),_0x3e37ee=_0x5f0a32['filter'](_0x2d910d=>!_0x2d910d[_0x11e314(0x1e0)]&&_0x2d910d['hasChanges']),_0x5cd20a=_0x5f0a32[_0x11e314(0x212)](_0x54593e=>!_0x54593e['isNew']&&!_0x54593e[_0x11e314(0x24c)]),_0x44ca25=_0x50b104[_0x11e314(0x1d2)],_0x3dd954=_0x5e580a['size'],_0x1b6786=_0x44ca25>_0x3dd954?'\x20('+_0x44ca25+_0x11e314(0x21e):'';console[_0x11e314(0x26e)](_0x11e314(0x282)),console['error']('\x20\x20'+a22_0x9964f3[_0x11e314(0x1a0)](_0x3dd954+_0x11e314(0x1b8))+a22_0x9964f3['dim'](_0x1b6786)),console[_0x11e314(0x26e)]('\x20\x20'+a22_0x9964f3['green']('+\x20'+_0x14660b['length']+'\x20new\x20files')),console[_0x11e314(0x26e)]('\x20\x20'+a22_0x9964f3[_0x11e314(0x235)]('~\x20'+_0x3e37ee[_0x11e314(0x1d2)]+_0x11e314(0x180))),console[_0x11e314(0x26e)]('\x20\x20'+a22_0x9964f3[_0x11e314(0x249)]('=\x20'+_0x5cd20a['length']+'\x20unchanged\x20files')),console[_0x11e314(0x26e)](_0x11e314(0x1b4)+a22_0x9964f3[_0x11e314(0x1a0)](_0x2f9398)+'\x0a');if(_0x3e37ee[_0x11e314(0x1d2)]>0x0)for(const _0x5afe64 of _0x3e37ee){console[_0x11e314(0x26e)](_0x11e314(0x22f)+_0x5afe64['relativePath']+'\x27:'),console[_0x11e314(0x26e)]('─'[_0x11e314(0x21d)](0x3c)),console['error'](_0x5afe64[_0x11e314(0x26a)]),console[_0x11e314(0x26e)]('─'[_0x11e314(0x21d)](0x3c));}if(_0x4c5071[_0x11e314(0x1c8)])return console[_0x11e314(0x26e)](a22_0x9964f3[_0x11e314(0x235)](_0x11e314(0x1fa))),0x0;if(_0x14660b[_0x11e314(0x1d2)]===0x0&&_0x3e37ee['length']===0x0)return console[_0x11e314(0x26e)](a22_0x9964f3['green'](_0x11e314(0x1ee))),saveSessionContext({'parent_segment':_0x406258},_0x4c5071[_0x11e314(0x1b3)]),console[_0x11e314(0x26e)](a22_0x9964f3[_0x11e314(0x1a7)]('✔\x20Context\x20set:\x20'+a22_0x9964f3[_0x11e314(0x249)]('parent_segment')+_0x11e314(0x1bf)+a22_0x9964f3[_0x11e314(0x1a0)](_0x406258))),0x0;if(!_0x4c5071['yes']&&(_0x14660b[_0x11e314(0x1d2)]>0x0||_0x3e37ee['length']>0x0)){if(!isInteractive())return console['error'](a22_0x9964f3[_0x11e314(0x18f)](_0x11e314(0x24d)),_0x11e314(0x26c)),console[_0x11e314(0x26e)](a22_0x9964f3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x38c5a2=await confirmKey(_0x11e314(0x22c)+(_0x14660b[_0x11e314(0x1d2)]+_0x3e37ee[_0x11e314(0x1d2)])+_0x11e314(0x1e5));if(!_0x38c5a2)return console[_0x11e314(0x26e)](a22_0x9964f3['yellow']('Aborted.'),_0x11e314(0x229)),0x1;}!existsSync(_0x2f9398)&&mkdirSync(_0x2f9398,{'recursive':!![]});const _0x4d9e49=a22_0x212a4b['join'](_0x2f9398,_0x11e314(0x1a9));writeFileSync(_0x4d9e49,createTdxConfigContent(_0x406258),'utf-8');for(const _0x9d98e of _0x5f0a32){(_0x9d98e[_0x11e314(0x1e0)]||_0x9d98e[_0x11e314(0x24c)])&&writeFileSync(_0x9d98e[_0x11e314(0x1c2)],_0x9d98e[_0x11e314(0x243)],_0x11e314(0x206));}return console[_0x11e314(0x26e)](a22_0x9964f3[_0x11e314(0x1a7)](_0x11e314(0x1ca)+(_0x14660b[_0x11e314(0x1d2)]+_0x3e37ee[_0x11e314(0x1d2)])+_0x11e314(0x1f9)+_0x2f9398)),saveSessionContext({'parent_segment':_0x406258},_0x4c5071[_0x11e314(0x1b3)]),console[_0x11e314(0x26e)](a22_0x9964f3['green']('✔\x20Context\x20set:\x20'+a22_0x9964f3[_0x11e314(0x249)](_0x11e314(0x25e))+_0x11e314(0x1bf)+a22_0x9964f3[_0x11e314(0x1a0)](_0x406258))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x242202(0x279)]=a22_0x242202(0x1fb);['description']=a22_0x242202(0x1a1);async[a22_0x242202(0x217)](_0x453145){const _0x3cd55c=a22_0x242202,{options:_0x4405f1,args:_0x211f20,tdx:_0x5485a1}=_0x453145,_0x648575=_0x211f20[0x0];if(!requireNameOrPath(_0x648575))return 0x1;_0x4405f1['verbose']&&console['error'](_0x3cd55c(0x1dc)+_0x648575);const {journeyId:_0x5e9660}=await resolveJourneyIdFromInput(_0x648575,_0x4405f1,_0x5485a1),_0x3418f1=await withSpinner(_0x3cd55c(0x267),()=>_0x5485a1[_0x3cd55c(0x18d)]['getColumnMapping'](_0x5e9660),{'verbose':_0x4405f1[_0x3cd55c(0x19b)]}),_0x28c6ff=_0x3418f1[_0x3cd55c(0x252)];return console['log'](_0x3cd55c(0x1d0)+_0x28c6ff['database']),console['log'](_0x3cd55c(0x24a)+_0x28c6ff[_0x3cd55c(0x219)]),await handleSDKOutput(_0x28c6ff[_0x3cd55c(0x1fc)],_0x4405f1),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a22_0x242202(0x1ba);[a22_0x242202(0x17f)]=a22_0x242202(0x265);async[a22_0x242202(0x217)](_0x1dcacc){const _0x3167a5=a22_0x242202,{options:_0x25f73,args:_0x2b49c1,tdx:_0x1da939}=_0x1dcacc,_0x47eb98=_0x2b49c1[0x0];if(!requireNameOrPath(_0x47eb98))return 0x1;_0x25f73[_0x3167a5(0x19b)]&&console[_0x3167a5(0x26e)](_0x3167a5(0x1dc)+_0x47eb98);const {journeyId:_0x4fd6c4}=await resolveJourneyIdFromInput(_0x47eb98,_0x25f73,_0x1da939),_0x5abc65=await withSpinner(_0x3167a5(0x19d),()=>_0x1da939[_0x3167a5(0x18d)]['listActivationsFlat'](_0x4fd6c4),{'verbose':_0x25f73[_0x3167a5(0x19b)]}),_0x554692=_0x5abc65[_0x3167a5(0x252)];return console['error'](_0x3167a5(0x19e)+_0x554692[_0x3167a5(0x1d2)]+_0x3167a5(0x244)+(_0x554692['length']!==0x1?'s':'')),await handleSDKOutput(_0x554692,_0x25f73),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x242202(0x279)]='journey:push';[a22_0x242202(0x17f)]=a22_0x242202(0x1ed);['segmentPushCommand']=new SegmentPushCommand();async[a22_0x242202(0x217)](_0x5e2bd2){const _0x429deb=a22_0x242202,_0x4d2ef6=_0x5e2bd2[_0x429deb(0x215)][0x0];let _0x1f95f9;if(_0x4d2ef6){const _0x128fac=await resolveTarget({'arg':_0x4d2ef6,'contextParent':_0x5e2bd2[_0x429deb(0x1df)][_0x429deb(0x1e1)],'cwd':process['cwd']()});isSuccessfulResolution(_0x128fac)&&_0x128fac['type']==='file'&&(_0x1f95f9=_0x128fac[_0x429deb(0x272)]);}const _0x14f363={..._0x5e2bd2,'options':{..._0x5e2bd2[_0x429deb(0x1df)],'journeysOnly':!![],..._0x1f95f9&&{'singleFilePath':_0x1f95f9}}};return this[_0x429deb(0x19a)][_0x429deb(0x217)](_0x14f363);}}export class JourneyVersionsCommand extends BaseCommand{['name']='journey:versions';['description']=a22_0x242202(0x1da);async[a22_0x242202(0x217)](_0x37d567){const _0x39ed86=a22_0x242202,{options:_0x4aedfd,args:_0x2c0b2c,tdx:_0x3b364c}=_0x37d567,_0x2359c7=_0x2c0b2c[0x0];if(!requireNameOrPath(_0x2359c7))return 0x1;if(_0x4aedfd[_0x39ed86(0x19b)])console[_0x39ed86(0x26e)](_0x39ed86(0x1dc)+_0x2359c7);const {journeyId:_0x231822}=await resolveJourneyIdFromInput(_0x2359c7,_0x4aedfd,_0x3b364c),_0x4c6480=await withSpinner('Listing\x20journey\x20versions...',()=>_0x3b364c['journey']['listVersions'](_0x231822),{'verbose':_0x4aedfd[_0x39ed86(0x19b)]}),{bundleName:_0x417753,versions:_0x4d03d4,latestJourneyId:_0x478cf1}=_0x4c6480[_0x39ed86(0x252)];console[_0x39ed86(0x26e)](_0x417753+':\x20'+_0x4d03d4[_0x39ed86(0x1d2)]+'\x20version'+(_0x4d03d4[_0x39ed86(0x1d2)]!==0x1?'s':''));const _0x42728f=_0x4d03d4[_0x39ed86(0x1c0)](_0x20389a=>({'version':_0x20389a[_0x39ed86(0x185)],'journey_id':_0x20389a[_0x39ed86(0x27a)],'name':_0x20389a['name'],'state':_0x20389a['state'],'paused':_0x20389a['paused'],'latest':_0x20389a[_0x39ed86(0x27a)]===_0x478cf1,'created_at':_0x20389a[_0x39ed86(0x222)]}));return await handleSDKOutput(_0x42728f,_0x4aedfd),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a22_0x242202(0x279)]=a22_0x242202(0x1c5);[a22_0x242202(0x17f)]=a22_0x242202(0x24e);async[a22_0x242202(0x217)](_0x2ad853){const _0x5285da=a22_0x242202,{options:_0x18c6fc,args:_0x59efb5,tdx:_0x314f3d}=_0x2ad853,_0x2145de=_0x59efb5[0x0];if(!requireNameOrPath(_0x2145de))return 0x1;if(_0x18c6fc[_0x5285da(0x19b)])console[_0x5285da(0x26e)]('Input:\x20'+_0x2145de);const {journeyId:_0x2e59aa,journeyName:_0x22c2eb}=await resolveJourneyIdFromInput(_0x2145de,_0x18c6fc,_0x314f3d);if(!_0x18c6fc['yes']){const _0x3842c9=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x22c2eb+'\x22?');if(!_0x3842c9)return console[_0x5285da(0x26e)](_0x5285da(0x193)),0x0;}const _0x2fbeaf=await withSpinner('Creating\x20new\x20version...',()=>_0x314f3d[_0x5285da(0x18d)][_0x5285da(0x1f2)](_0x2e59aa),{'verbose':_0x18c6fc[_0x5285da(0x19b)]}),_0x53a746=_0x2fbeaf[_0x5285da(0x252)];return console['error'](a22_0x9964f3[_0x5285da(0x1a7)]('✔')+_0x5285da(0x1d6)+_0x53a746[_0x5285da(0x203)][_0x5285da(0x185)]+_0x5285da(0x250)+_0x53a746[_0x5285da(0x203)][_0x5285da(0x279)]+'\x22'),console[_0x5285da(0x26e)]('\x20\x20Journey\x20ID:\x20'+_0x53a746['id']),await handleSingleObjectOutput({'id':_0x53a746['id'],'name':_0x53a746[_0x5285da(0x203)]['name'],'version':_0x53a746[_0x5285da(0x203)][_0x5285da(0x185)],'state':_0x53a746[_0x5285da(0x203)][_0x5285da(0x1b0)],'bundle_id':_0x53a746[_0x5285da(0x203)][_0x5285da(0x17c)],'created_at':_0x53a746[_0x5285da(0x203)][_0x5285da(0x222)]},_0x18c6fc),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a22_0x242202(0x1c6);[a22_0x242202(0x17f)]=a22_0x242202(0x187);async[a22_0x242202(0x217)](_0x48c944){const _0x4816e6=a22_0x242202,{options:_0x2bf225,args:_0x421e4e,tdx:_0x324f4a}=_0x48c944,_0x572053=_0x421e4e[0x0];if(!requireNameOrPath(_0x572053))return 0x1;const _0x2a774b=_0x2bf225['version'];if(!_0x2a774b)return console[_0x4816e6(0x26e)](_0x4816e6(0x276)),console[_0x4816e6(0x26e)](_0x4816e6(0x202)),0x1;const _0x210a2c=parseInt(_0x2a774b,0xa);if(isNaN(_0x210a2c)||_0x210a2c<0x1)return console[_0x4816e6(0x26e)](_0x4816e6(0x1ff)+_0x2a774b),0x1;if(_0x2bf225[_0x4816e6(0x19b)])console['error'](_0x4816e6(0x1dc)+_0x572053+_0x4816e6(0x184)+_0x210a2c);const {journeyId:_0x2cebd8,parentSegmentId:_0x536247}=await resolveJourneyIdFromInput(_0x572053,_0x2bf225,_0x324f4a),_0x2b0ec4=await withSpinner(_0x4816e6(0x1ef),()=>_0x324f4a[_0x4816e6(0x18d)][_0x4816e6(0x20f)](_0x2cebd8),{'verbose':_0x2bf225[_0x4816e6(0x19b)]}),{versions:_0xa6a081,latestJourneyId:_0x5b9727}=_0x2b0ec4[_0x4816e6(0x252)],_0x54a87b=_0xa6a081[_0x4816e6(0x197)](_0x5e8088=>_0x5e8088[_0x4816e6(0x185)]===_0x210a2c);if(!_0x54a87b){const _0xbc3e88=_0xa6a081[_0x4816e6(0x1c0)](_0x8a3426=>'v'+_0x8a3426[_0x4816e6(0x185)])[_0x4816e6(0x194)](',\x20');return console['error'](_0x4816e6(0x227)+_0x210a2c+_0x4816e6(0x23e)+_0xbc3e88),0x1;}const _0x38a95b=await withSpinner(_0x4816e6(0x1b1)+_0x210a2c+'\x20details...',()=>_0x324f4a['journey'][_0x4816e6(0x1d3)](_0x54a87b[_0x4816e6(0x27a)]),{'verbose':_0x2bf225[_0x4816e6(0x19b)]}),_0x330545=_0x38a95b[_0x4816e6(0x252)],_0x39ad95=getConsoleNextUrl(_0x2bf225[_0x4816e6(0x22d)],_0x4816e6(0x22b)+_0x536247+_0x4816e6(0x19c)+_0x54a87b[_0x4816e6(0x27a)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x330545['id'],'name':_0x330545[_0x4816e6(0x203)]['name'],'version':_0x330545[_0x4816e6(0x203)][_0x4816e6(0x185)],'description':_0x330545[_0x4816e6(0x203)][_0x4816e6(0x17f)],'state':_0x330545[_0x4816e6(0x203)][_0x4816e6(0x1b0)],'paused':_0x330545[_0x4816e6(0x203)]['paused'],'reentry_mode':_0x330545[_0x4816e6(0x203)][_0x4816e6(0x1e9)],'stages':_0x330545[_0x4816e6(0x203)][_0x4816e6(0x1ae)]?.[_0x4816e6(0x1d2)]||0x0,..._0x330545[_0x4816e6(0x203)][_0x4816e6(0x238)]&&{'goal':_0x330545['attributes'][_0x4816e6(0x238)]['name']},'latest':_0x54a87b[_0x4816e6(0x27a)]===_0x5b9727,'created_at':_0x330545[_0x4816e6(0x203)]['createdAt'],'updated_at':_0x330545[_0x4816e6(0x203)][_0x4816e6(0x200)],'url':_0x39ad95},_0x2bf225),0x0;}}
|
|
1
|
+
const a22_0x54fb49=a22_0x5170;function a22_0x442e(){const _0x5eefdb=['\x20\x20Consolidating\x20duplicate\x20segment:\x20','(root)','jsonl','/app/ps/','nodes','limit','Pattern:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Fetching\x20journeys\x20and\x20folders...','\x20(rule\x20match)','Aborted.','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Getting\x20column\x20mapping...','verbose','all','yes','createdAt','content','3010776NRZAam','journey:versions','length','folderPath','folderId','getJourney','push','red','journey:stats','localeCompare','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','411qmbsBD','updatedAt','Listing\x20journeys...','✔\x20Journey\x20\x22','3649176zLBSbY','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20unchanged\x20files','Cancelled','/j/da/je','test','renderStats','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','exitOrJumpSize','session','\x20journey\x20files\x20to\x20','map','paused','blue','\x0aError:','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','2677833DnVARF','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','buildIdToNameMap','database','listJourneysFromParentSegment','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','exitOrJumpRate','✔\x20All\x20files\x20are\x20up\x20to\x20date','diff','hasChanges','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','65vaKtcK','Folder\x20path:\x20','stringify','\x20version','\x0aChanges\x20to\x20\x27','cyan','set','Error:\x20Journey\x20not\x20found:\x20','Getting\x20journey\x20traffic\x20data...','...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','stageNameMap','data','Resume\x20a\x20paused\x20journey','Export\x20journey(s)\x20as\x20YAML\x20files','\x20(draft)\x20—\x20\x22','getTrafficData','journeyBundleId','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segmentPushCommand','history','Getting\x20version\x20','Pause\x20a\x20running\x20journey','journey:pull','Error:\x20Stage\x20\x22','join','includeHistory','connection','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','get','\x20journey','utf-8','size','tdx.json','isNew','INVALID_ARGUMENT','\x20details...','type','cwd','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','add','153940lHMpze','entries','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','parent_segment','relativePath','Journey\x20name:\x20','format','\x20not\x20found.\x20Available:\x20','name','message','Show\x20journey\x20details','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20->\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','then','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','✔\x20Found\x20','parentSegment','\x5c$&','\x20\x20Folder\x20path:\x20','find','journeyBundleName','journey:view','setPhase','conversion','green','repeat','\x27\x20not\x20found\x20in\x20','has','Database:\x20','journey:list','.yml','rootFolderId','\x22\x20not\x20found','journey:version:create','\x20changed\x20files','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','execute','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','journey','segments','journey:traffic','values','(completed)','6642jeBMzn','8qsNaAZ','archived','✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','description','\x20\x20Parent\x20segment:\x20','Error:\x20Version\x20','Getting\x20journey\x20statistics...','\x20=\x20','/j/da','resolveSegment','Parent\x20segment:\x20','Error:\x20','listActivationsFlat','Resolving\x20parent\x20segment...','journey:columns','enteredSize','Input:\x20','pause','Fetching\x20users\x20and\x20connections...','listFolders','\x20\x20Journey\x20ID:\x20','sort','listJourneysWithFolders','getActivation','journeyStages','Resolving\x20journey...','json','table','state','Getting\x20journey\x20details...','file','resume','base','attributes','resolveParentId','No\x20journeys\x20found','Listing\x20journey\x20activations...','split','replace','getStatistics','11yHLPZU','Show\x20journey\x20statistics','args','journey:pause','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Target\x20file:\x20','5042990HSpASx','/e/','Fetching\x20parent\x20segment...','listVersions','goal','Fetching\x20','no_parent','(running)','segment','helpText','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','from','journey:activations','segmentName','Warning:\x20Could\x20not\x20resolve\x20segment\x20','activationParams','getColumnMapping','\x20\x20Name:\x20','stages','Write\x20','-\x20no\x20files\x20written','yellow','Resolved\x20YAML\x20file:\x20','user','toLowerCase','Options:','Available\x20stages:\x20','site','Show\x20journey\x20table\x20column\x20mapping','✔\x20Context\x20set:\x20','targetDir','goalSize','journeyId','List\x20activations\x20for\x20a\x20journey','dim','includeStats','createVersion','error','versionNumber','5344724OeAOcE','\x20(ID:\x20','buildIdToEmailMap','completed','journey:push','draft','milestoneSize','launched','filter','\x20new\x20files','Resolving\x20version...','folders','Target\x20directory:\x20','errorCode','resourceName','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','hasPeriod','Pausing\x20journey...','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','reentryMode','parentName','log','\x20\x20Statistics\x20not\x20available','\x20activation','journey:version:view','completionRate','rule','activation'];a22_0x442e=function(){return _0x5eefdb;};return a22_0x442e();}(function(_0x213c45,_0x1604f2){const _0x5d5958=a22_0x5170,_0x3bffd6=_0x213c45();while(!![]){try{const _0x15e1d6=-parseInt(_0x5d5958(0x262))/0x1*(-parseInt(_0x5d5958(0x1d2))/0x2)+-parseInt(_0x5d5958(0x266))/0x3+parseInt(_0x5d5958(0x2ad))/0x4*(parseInt(_0x5d5958(0x282))/0x5)+-parseInt(_0x5d5958(0x257))/0x6+parseInt(_0x5d5958(0x229))/0x7+-parseInt(_0x5d5958(0x1d3))/0x8*(-parseInt(_0x5d5958(0x277))/0x9)+parseInt(_0x5d5958(0x202))/0xa*(-parseInt(_0x5d5958(0x1fc))/0xb);if(_0x15e1d6===_0x1604f2)break;else _0x3bffd6['push'](_0x3bffd6['shift']());}catch(_0x5b32f2){_0x3bffd6['push'](_0x3bffd6['shift']());}}}(a22_0x442e,0xabd4a));import a22_0x22ee6a from'chalk';import a22_0x1a2b3d from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x9664e){const _0x105b5a=a22_0x5170;return!_0x9664e&&(console[_0x105b5a(0x227)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x105b5a(0x227)](_0x105b5a(0x200))),!!_0x9664e;}function withJsonFormat(_0x7f34d8){const _0x5e43df=a22_0x5170;if(!_0x7f34d8[_0x5e43df(0x2b3)]&&!_0x7f34d8[_0x5e43df(0x1ee)]&&!_0x7f34d8['jsonl']&&!_0x7f34d8['tsv'])return{..._0x7f34d8,'format':_0x5e43df(0x1ee),'json':!![]};return _0x7f34d8;}function formatJourneyState(_0x3dd88c){const _0xc532e=a22_0x5170;switch(_0x3dd88c){case _0xc532e(0x230):return a22_0x22ee6a[_0xc532e(0x1bf)](_0xc532e(0x209));case _0xc532e(0x22e):return a22_0x22ee6a[_0xc532e(0x224)]('(draft)');case _0xc532e(0x272):return a22_0x22ee6a[_0xc532e(0x217)]('(paused)');case _0xc532e(0x22c):return a22_0x22ee6a[_0xc532e(0x273)](_0xc532e(0x1d1));case _0xc532e(0x1d4):return a22_0x22ee6a[_0xc532e(0x224)]('(archived)');default:return'('+_0x3dd88c+')';}}function formatJourneyItem(_0x1bae68,_0x5b800f='',_0x254fe7){const _0xa40704=a22_0x5170,_0x1161aa=formatJourneyState(_0x1bae68[_0xa40704(0x1f0)]),_0x4447ce=_0x254fe7?hyperlink(_0x1bae68['journeyBundleName'],_0x254fe7):_0x1bae68[_0xa40704(0x1bb)];return _0x5b800f+'🗺️\x20'+_0x4447ce+'\x20'+_0x1161aa;}function escapeRegex(_0x3393b4){const _0x498829=a22_0x5170;return _0x3393b4[_0x498829(0x1fa)](/[.*+?^${}()|[\]\\]/g,_0x498829(0x1b8));}function globToRegex(_0x80e001){const _0x3f5905=a22_0x5170,_0x2820b7=_0x80e001[_0x3f5905(0x1f9)]('*')['map'](escapeRegex);return new RegExp(_0x2820b7['join']('.*'),'i');}function buildRuleToNameMapping(_0x38e449){const _0x401f5f=a22_0x5170,_0x451f99=new Map();if(_0x38e449[_0x401f5f(0x1ce)])for(const [_0x42d717,_0x1de041]of Object[_0x401f5f(0x2ae)](_0x38e449[_0x401f5f(0x1ce)])){if(_0x1de041[_0x401f5f(0x243)]){const _0x2ad6c6=serializeRule(_0x1de041[_0x401f5f(0x243)]),_0x214f6a=_0x451f99[_0x401f5f(0x2a0)](_0x2ad6c6);_0x214f6a?_0x214f6a[_0x401f5f(0x25d)](_0x42d717):_0x451f99['set'](_0x2ad6c6,[_0x42d717]);}}return _0x451f99;}async function resolveJourneyIdFromInput(_0x424c6d,_0x39ac9c,_0x12f0df){const _0x499b20=a22_0x5170,_0x5367e4=await resolveJourneyTarget(_0x424c6d,_0x39ac9c[_0x499b20(0x1b7)],_0x39ac9c[_0x499b20(0x252)]),_0x3fc16b=_0x5367e4[_0x499b20(0x1b7)];if(!_0x3fc16b)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x499b20(0x281));const _0x4eb0bc=await withSpinner(_0x499b20(0x1e1),()=>_0x12f0df[_0x499b20(0x20a)]['resolveParentId'](_0x3fc16b),{'verbose':_0x39ac9c['verbose']}),_0x130c9f=_0x4eb0bc[_0x499b20(0x28e)],_0x38773b=await withSpinner(_0x499b20(0x1ed),()=>_0x12f0df[_0x499b20(0x1cd)]['resolveJourneyId'](_0x130c9f,_0x5367e4['journeyName']),{'verbose':_0x39ac9c[_0x499b20(0x252)]});return{'journeyId':_0x38773b['data'],'journeyName':_0x5367e4['journeyName'],'parentSegmentId':_0x130c9f};}async function resolveJourneyTarget(_0x50de11,_0x335fd3,_0x1de458){const _0x5b7a4a=a22_0x5170;if(isYamlFilePath(_0x50de11))try{const _0x477cc7=await resolveYamlFilePath(_0x50de11);return _0x1de458&&(console['error'](_0x5b7a4a(0x218)+_0x50de11),console['error'](_0x5b7a4a(0x1d8)+_0x477cc7[_0x5b7a4a(0x1b7)]),console[_0x5b7a4a(0x227)](_0x5b7a4a(0x213)+_0x477cc7[_0x5b7a4a(0x20f)]),console[_0x5b7a4a(0x227)](_0x5b7a4a(0x1b9)+(_0x477cc7[_0x5b7a4a(0x25a)]||_0x5b7a4a(0x246)))),{'journeyName':_0x477cc7[_0x5b7a4a(0x20f)],'parentSegment':_0x477cc7['parentSegment'],'resolved':_0x477cc7};}catch(_0xabe2d6){throw new SDKError(ErrorCode[_0x5b7a4a(0x2a6)],_0x5b7a4a(0x1cc)+_0xabe2d6[_0x5b7a4a(0x2b6)]);}if(!_0x335fd3)throw new SDKError(ErrorCode[_0x5b7a4a(0x2a6)],_0x5b7a4a(0x24c));return{'journeyName':_0x50de11,'parentSegment':_0x335fd3};}export class JourneyListCommand extends BaseCommand{['name']=a22_0x54fb49(0x1c4);[a22_0x54fb49(0x1d7)]='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x5e001d){const _0x2b74f5=a22_0x54fb49,{options:_0xacf7af,args:_0x37cccd,tdx:_0x3f0a00}=_0x5e001d,_0x54fb0e=_0x37cccd[0x0],_0x4623d8=_0xacf7af[_0x2b74f5(0x1b7)];if(!_0x4623d8)return console[_0x2b74f5(0x227)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x2b74f5(0x227)](_0x2b74f5(0x267)),0x1;const _0x50058b=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3f0a00[_0x2b74f5(0x20a)][_0x2b74f5(0x1f6)](_0x4623d8),{'verbose':_0xacf7af['verbose']}),_0x3636e7=_0x50058b[_0x2b74f5(0x28e)];_0xacf7af[_0x2b74f5(0x252)]&&(console[_0x2b74f5(0x227)]('Parent\x20segment:\x20'+_0x4623d8+_0x2b74f5(0x22a)+_0x3636e7+')'),_0x54fb0e&&console[_0x2b74f5(0x227)](_0x2b74f5(0x24b)+_0x54fb0e));const _0x24c3c4=await withSpinner(_0x2b74f5(0x204),()=>_0x3f0a00[_0x2b74f5(0x20a)]['getParentFull'](_0x3636e7),{'verbose':_0xacf7af[_0x2b74f5(0x252)]}),_0x4f7375=_0x24c3c4[_0x2b74f5(0x28e)],_0x31bf02=_0x4f7375[_0x2b74f5(0x1c6)],_0x51e0e9=await withSpinner(_0x2b74f5(0x264),()=>_0x3f0a00[_0x2b74f5(0x1cd)][_0x2b74f5(0x1ea)](_0x3636e7,_0x31bf02),{'verbose':_0xacf7af['verbose']});let _0x4e0ca0=_0x51e0e9[_0x2b74f5(0x28e)]['journeys'];const _0x5384d8=_0x51e0e9[_0x2b74f5(0x28e)][_0x2b74f5(0x234)],_0x556fb5=new Map();for(const _0x241882 of _0x5384d8){_0x556fb5[_0x2b74f5(0x288)](_0x241882['id'],_0x241882[_0x2b74f5(0x2b5)]);}if(_0x54fb0e){const _0x38932a=globToRegex(_0x54fb0e);_0x4e0ca0=_0x4e0ca0[_0x2b74f5(0x231)](_0x42c94c=>_0x38932a[_0x2b74f5(0x26b)](_0x42c94c[_0x2b74f5(0x1bb)]));}console[_0x2b74f5(0x227)](_0x2b74f5(0x1b6)+_0x4e0ca0['length']+_0x2b74f5(0x2a1)+(_0x4e0ca0[_0x2b74f5(0x259)]!==0x1?'s':''));const _0x4ba440=_0x16dede=>{const _0x592108=_0x2b74f5;return getConsoleNextUrl(_0xacf7af[_0x592108(0x21d)],_0x592108(0x248)+_0x3636e7+'/e/'+_0x16dede+_0x592108(0x1dc));};if(_0xacf7af[_0x2b74f5(0x2b3)]===_0x2b74f5(0x1ef))await handleSDKOutput(_0x4e0ca0,_0xacf7af);else{if(_0xacf7af[_0x2b74f5(0x2b3)]==='json'){const _0x23a9a6=_0x4e0ca0[_0x2b74f5(0x271)](_0x3a1467=>({..._0x3a1467,'url':_0x4ba440(_0x3a1467['id'])}));await handleSDKOutput(_0x23a9a6,_0xacf7af);}else{console[_0x2b74f5(0x23e)]('['+_0x4623d8+']');const _0x4be70d=new Map(),_0x348578=[];for(const _0x38ccb3 of _0x4e0ca0){if(!_0x38ccb3['folderId']||_0x38ccb3['folderId']===_0x31bf02)_0x348578[_0x2b74f5(0x25d)](_0x38ccb3);else{const _0x15b947=_0x4be70d[_0x2b74f5(0x2a0)](_0x38ccb3[_0x2b74f5(0x25b)])||[];_0x15b947[_0x2b74f5(0x25d)](_0x38ccb3),_0x4be70d[_0x2b74f5(0x288)](_0x38ccb3[_0x2b74f5(0x25b)],_0x15b947);}}const _0x50b333=(_0x304616,_0x29f29f)=>_0x304616['journeyBundleName']['localeCompare'](_0x29f29f['journeyBundleName'],undefined,{'sensitivity':_0x2b74f5(0x1f4)});_0x348578[_0x2b74f5(0x1e9)](_0x50b333);for(const _0x4458f7 of _0x348578){console[_0x2b74f5(0x23e)](formatJourneyItem(_0x4458f7,'',_0x4ba440(_0x4458f7['id'])));}const _0x495bbe=[..._0x4be70d['entries']()][_0x2b74f5(0x1e9)]((_0x4c0d3d,_0x4934c8)=>{const _0x47ec48=_0x2b74f5,_0x4a7b07=_0x556fb5['get'](_0x4c0d3d[0x0])||_0x4c0d3d[0x0],_0x12f7a2=_0x556fb5[_0x47ec48(0x2a0)](_0x4934c8[0x0])||_0x4934c8[0x0];return _0x4a7b07[_0x47ec48(0x260)](_0x12f7a2,undefined,{'sensitivity':_0x47ec48(0x1f4)});});for(const [_0x2bbff2,_0x11e895]of _0x495bbe){const _0x10777c=_0x556fb5[_0x2b74f5(0x2a0)](_0x2bbff2)||_0x2bbff2;console[_0x2b74f5(0x23e)]('📁\x20'+_0x10777c),_0x11e895[_0x2b74f5(0x1e9)](_0x50b333);for(const _0x22d667 of _0x11e895){console[_0x2b74f5(0x23e)](formatJourneyItem(_0x22d667,'\x20\x20',_0x4ba440(_0x22d667['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x1bc);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x2b7);async['execute'](_0x2cb409){const _0x5d0dfa=a22_0x54fb49,{options:_0x3259db,args:_0x4bd742,tdx:_0x490545}=_0x2cb409,_0xcf6795=_0x4bd742[0x0];if(!_0xcf6795)return console[_0x5d0dfa(0x227)](_0x5d0dfa(0x1b5)),console[_0x5d0dfa(0x227)](_0x5d0dfa(0x2af)),console[_0x5d0dfa(0x227)](_0x5d0dfa(0x21b)),console[_0x5d0dfa(0x227)](_0x5d0dfa(0x23b)),0x1;_0x3259db[_0x5d0dfa(0x252)]&&console[_0x5d0dfa(0x227)](_0x5d0dfa(0x1e4)+_0xcf6795);const {journeyId:_0x4b06bb,parentSegmentId:_0x15e6cd}=await resolveJourneyIdFromInput(_0xcf6795,_0x3259db,_0x490545);if(_0x3259db['web']){const _0x290b13=getConsoleNextUrl(_0x3259db[_0x5d0dfa(0x21d)],'/app/ps/'+_0x15e6cd+_0x5d0dfa(0x203)+_0x4b06bb+_0x5d0dfa(0x26a));return console['error'](a22_0x22ee6a['green']('✔')+'\x20Opening\x20'+a22_0x22ee6a['cyan'](_0x290b13)),openBrowser(_0x290b13),0x0;}const _0x8ced44=await withSpinner(_0x5d0dfa(0x1f1),()=>_0x490545[_0x5d0dfa(0x1cd)][_0x5d0dfa(0x25c)](_0x4b06bb),{'verbose':_0x3259db[_0x5d0dfa(0x252)]}),_0x5ad0b1=_0x8ced44['data'],_0x323efd=_0x3259db[_0x5d0dfa(0x225)];let _0x259192;if(_0x323efd)try{const _0x84e03=await withSpinner(_0x5d0dfa(0x1da),()=>_0x490545[_0x5d0dfa(0x1cd)][_0x5d0dfa(0x1fb)](_0x4b06bb),{'verbose':_0x3259db[_0x5d0dfa(0x252)]});_0x259192=_0x84e03[_0x5d0dfa(0x28e)];}catch{_0x3259db['verbose']&&console[_0x5d0dfa(0x227)](_0x5d0dfa(0x23f));}const _0x2ecb02=getConsoleNextUrl(_0x3259db[_0x5d0dfa(0x21d)],_0x5d0dfa(0x248)+_0x15e6cd+_0x5d0dfa(0x203)+_0x4b06bb+_0x5d0dfa(0x26a)),_0x5d1320={'id':_0x5ad0b1['id'],'name':_0x5ad0b1[_0x5d0dfa(0x1f5)][_0x5d0dfa(0x2b5)],'description':_0x5ad0b1['attributes']['description'],'state':_0x5ad0b1[_0x5d0dfa(0x1f5)][_0x5d0dfa(0x1f0)],'paused':_0x5ad0b1[_0x5d0dfa(0x1f5)][_0x5d0dfa(0x272)],'reentry_mode':_0x5ad0b1[_0x5d0dfa(0x1f5)]['reentryMode'],'stages':_0x5ad0b1['attributes'][_0x5d0dfa(0x1ec)]?.[_0x5d0dfa(0x259)]||0x0,..._0x5ad0b1[_0x5d0dfa(0x1f5)][_0x5d0dfa(0x206)]&&{'goal':_0x5ad0b1['attributes'][_0x5d0dfa(0x206)][_0x5d0dfa(0x2b5)]},..._0x259192&&{'statistics':{'size':_0x259192[_0x5d0dfa(0x2a3)],'entered':_0x259192[_0x5d0dfa(0x1e3)],'goal_achieved':_0x259192[_0x5d0dfa(0x221)],'completion_rate':_0x259192[_0x5d0dfa(0x242)],'exit_or_jump':_0x259192[_0x5d0dfa(0x26e)],'exit_or_jump_rate':_0x259192['exitOrJumpRate'],'stages':_0x259192[_0x5d0dfa(0x214)]}},'url':_0x2ecb02};return await handleSingleObjectOutput(_0x5d1320,_0x3259db),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x25f);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x1fd);async[a22_0x54fb49(0x1cb)](_0x525423){const _0x4c5645=a22_0x54fb49,{options:_0x1959ba,args:_0x5b1c85,tdx:_0x27e173}=_0x525423,_0x1c89f2=_0x5b1c85[0x0];if(!requireNameOrPath(_0x1c89f2))return 0x1;_0x1959ba[_0x4c5645(0x252)]&&console['error'](_0x4c5645(0x1e4)+_0x1c89f2);const _0x18e78a=_0x1959ba,_0x31164a=_0x18e78a[_0x4c5645(0x20d)],_0x46f93b=_0x18e78a['to'],_0x3b853e=_0x18e78a[_0x4c5645(0x29c)],_0x17f64c=_0x18e78a['stage'];_0x3b853e&&!_0x31164a&&!_0x46f93b&&console[_0x4c5645(0x227)](_0x4c5645(0x29f));const _0x3ad23f=_0x3b853e?withJsonFormat(_0x1959ba):_0x1959ba,{journeyId:_0x33ba1f,journeyName:_0x1f2cdc}=await resolveJourneyIdFromInput(_0x1c89f2,_0x3ad23f,_0x27e173),_0x2fb89f=_0x31164a||_0x46f93b?{'from':_0x31164a,'to':_0x46f93b}:undefined,_0x40ba4d=await withSpinner(_0x4c5645(0x1da),()=>Promise[_0x4c5645(0x253)]([_0x27e173[_0x4c5645(0x1cd)][_0x4c5645(0x25c)](_0x33ba1f),_0x27e173[_0x4c5645(0x1cd)][_0x4c5645(0x1fb)](_0x33ba1f,_0x2fb89f)]),{'verbose':_0x3ad23f[_0x4c5645(0x252)]}),[_0x290a2b,_0x2813c2]=_0x40ba4d[_0x4c5645(0x28e)];if(!_0x2813c2||_0x2813c2[_0x4c5645(0x222)]===null)return console[_0x4c5645(0x227)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x1f2cdc),console[_0x4c5645(0x227)](_0x4c5645(0x29e)),0x0;const _0x2416bd=buildStageNameMap(_0x290a2b),_0x45af28=!!(_0x2fb89f&&_0x2813c2[_0x4c5645(0x296)]?.[_0x4c5645(0x259)]),_0x4cc930={'stageNameMap':_0x2416bd,'hasPeriod':_0x45af28,'includeHistory':!!_0x3b853e};if(_0x17f64c&&_0x2813c2[_0x4c5645(0x214)]){const _0x2edc78=_0x2813c2[_0x4c5645(0x214)][_0x4c5645(0x1ba)](_0x1f23cf=>{const _0x436e98=_0x4c5645,_0x4e4ff7=_0x2416bd[_0x436e98(0x2a0)](_0x1f23cf['id'])??'';return _0x4e4ff7[_0x436e98(0x21a)]()===_0x17f64c['toLowerCase']();});if(_0x2edc78)return await handleSingleObjectOutput(formatStageStats(_0x2edc78,_0x4cc930),_0x3ad23f),0x0;const _0x4e92d0=_0x2813c2[_0x4c5645(0x214)]['map'](_0x3e916a=>_0x2416bd[_0x4c5645(0x2a0)](_0x3e916a['id'])??_0x3e916a['id']);return console['error'](_0x4c5645(0x29a)+_0x17f64c+_0x4c5645(0x1c7)),console['error'](_0x4c5645(0x21c)+_0x4e92d0['join'](',\x20')),0x1;}const _0x73d534=_0x2813c2['stages']?.[_0x4c5645(0x271)](_0x209708=>formatStageStats(_0x209708,_0x4cc930)),_0xb63a28=assembleJourneyStats(_0x2813c2,{'from':_0x31164a,'to':_0x46f93b,'includeHistory':_0x3b853e});return await this[_0x4c5645(0x26c)](_0xb63a28,_0x73d534??[],_0x3ad23f),0x0;}async[a22_0x54fb49(0x26c)](_0x41b65e,_0x22e3ff,_0x3c30bc){const _0x291994=a22_0x54fb49,_0xa6467d=_0x3c30bc[_0x291994(0x2b3)]===_0x291994(0x1ee)||_0x3c30bc[_0x291994(0x2b3)]===_0x291994(0x247)||_0x3c30bc[_0x291994(0x1ee)]||_0x3c30bc['jsonl'];if(_0xa6467d){_0x41b65e[_0x291994(0x214)]=_0x22e3ff,await handleSingleObjectOutput(_0x41b65e,_0x3c30bc);return;}await handleSingleObjectOutput(_0x41b65e,_0x3c30bc);for(const _0x2199a3 of _0x22e3ff){console[_0x291994(0x23e)](''),console[_0x291994(0x23e)](String(a22_0x22ee6a[_0x291994(0x287)]['bold']('['+_0x2199a3[_0x291994(0x2b5)]+']'))+a22_0x22ee6a[_0x291994(0x224)]('\x20'+_0x2199a3['id']));const {id:_0x28ed9b,name:_0x3071f3,..._0x136833}=_0x2199a3;await handleSingleObjectOutput(_0x136833,_0x3c30bc);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x1cf);[a22_0x54fb49(0x1d7)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a22_0x54fb49(0x1cb)](_0x295116){const _0x4b57ab=a22_0x54fb49,{options:_0x5c3f9f,args:_0x322dd1,tdx:_0x2b6a92}=_0x295116,_0x1f0d10=_0x322dd1[0x0];if(!requireNameOrPath(_0x1f0d10))return 0x1;_0x5c3f9f[_0x4b57ab(0x252)]&&console[_0x4b57ab(0x227)](_0x4b57ab(0x1e4)+_0x1f0d10);const _0x3c406b=_0x5c3f9f,_0x284475=_0x3c406b['type'],_0x1c3347=_0x3c406b[_0x4b57ab(0x20d)],_0xdf2e11=_0x3c406b['to'],_0x5a92a8=_0x3c406b[_0x4b57ab(0x24a)];if(_0x284475&&_0x284475!==_0x4b57ab(0x1be)&&_0x284475!==_0x4b57ab(0x244))return console[_0x4b57ab(0x227)]('Error:\x20Invalid\x20--type\x20\x22'+_0x284475+_0x4b57ab(0x238)),0x1;const _0x45dd66=withJsonFormat(_0x5c3f9f),{journeyId:_0x27c8ac,journeyName:_0x42d37a}=await resolveJourneyIdFromInput(_0x1f0d10,_0x45dd66,_0x2b6a92),_0x3a86af={'type':_0x284475,'from':_0x1c3347,'to':_0xdf2e11,'limit':_0x5a92a8},_0x49540a=await withSpinner(_0x4b57ab(0x28a),()=>_0x2b6a92[_0x4b57ab(0x1cd)][_0x4b57ab(0x292)](_0x27c8ac,_0x3a86af),{'verbose':_0x45dd66[_0x4b57ab(0x252)]}),_0x3edae9=_0x49540a['data'],_0x261864=_0x3edae9['conversion']&&(_0x3edae9['conversion'][_0x4b57ab(0x249)][_0x4b57ab(0x259)]>0x0||_0x3edae9[_0x4b57ab(0x1be)]['links'][_0x4b57ab(0x259)]>0x0),_0x16c8af=_0x3edae9[_0x4b57ab(0x244)]&&_0x3edae9[_0x4b57ab(0x244)]['length']>0x0;if(!_0x261864&&!_0x16c8af)return console[_0x4b57ab(0x227)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x42d37a),console['error']('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x1c3347&&_0xdf2e11&&console[_0x4b57ab(0x227)](_0x4b57ab(0x27c)),0x0;return await handleSingleObjectOutput(_0x3edae9,_0x45dd66),0x0;}}function formatStageStats(_0x5b7dd6,_0x2480bb){const _0x3c65f0=a22_0x54fb49,_0x585d22=_0x2480bb[_0x3c65f0(0x239)]&&_0x5b7dd6['history']?.['length']?aggregateStageHistory(_0x5b7dd6[_0x3c65f0(0x296)]):{'size':_0x5b7dd6[_0x3c65f0(0x2a3)],'entered':_0x5b7dd6[_0x3c65f0(0x1e3)],'milestone':_0x5b7dd6[_0x3c65f0(0x22f)],'milestone_rate':_0x5b7dd6['completeMilestoneRate'],'exit_or_jump':_0x5b7dd6[_0x3c65f0(0x26e)],'exit_or_jump_rate':_0x5b7dd6[_0x3c65f0(0x27d)]},_0x2fa20a={'id':_0x5b7dd6['id'],'name':_0x2480bb[_0x3c65f0(0x28d)][_0x3c65f0(0x2a0)](_0x5b7dd6['id'])??_0x5b7dd6['id'],..._0x585d22};return _0x2480bb['hasPeriod']&&_0x2480bb[_0x3c65f0(0x29c)]&&_0x5b7dd6[_0x3c65f0(0x296)]&&(_0x2fa20a[_0x3c65f0(0x296)]=_0x5b7dd6[_0x3c65f0(0x296)]),_0x2fa20a;}export class JourneyPauseCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x1ff);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x298);async[a22_0x54fb49(0x1cb)](_0x3e6c98){const _0x41dbb9=a22_0x54fb49,{options:_0x570c12,args:_0x4b6dd4,tdx:_0x3ff64e}=_0x3e6c98,_0x52cf30=_0x4b6dd4[0x0];if(!requireNameOrPath(_0x52cf30))return 0x1;_0x570c12[_0x41dbb9(0x252)]&&console[_0x41dbb9(0x227)](_0x41dbb9(0x1e4)+_0x52cf30);const {journeyId:_0x40fa27,journeyName:_0xf1cb84}=await resolveJourneyIdFromInput(_0x52cf30,_0x570c12,_0x3ff64e);if(!_0x570c12['yes']){const _0x2eeafb=await confirm(_0x41dbb9(0x278)+_0xf1cb84+'\x22?');if(!_0x2eeafb)return console['error'](_0x41dbb9(0x269)),0x0;}const _0x3d8e28=await withSpinner(_0x41dbb9(0x23a),()=>_0x3ff64e[_0x41dbb9(0x1cd)][_0x41dbb9(0x1e5)](_0x40fa27),{'verbose':_0x570c12[_0x41dbb9(0x252)]}),_0x5a2666=_0x3d8e28['data'];return console[_0x41dbb9(0x227)](_0x41dbb9(0x265)+_0x5a2666['attributes']['name']+'\x22\x20paused'),0x0;}}function a22_0x5170(_0x885f31,_0x2a5ce7){_0x885f31=_0x885f31-0x1b3;const _0x442ea9=a22_0x442e();let _0x517086=_0x442ea9[_0x885f31];return _0x517086;}export class JourneyResumeCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]='journey:resume';[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x28f);async[a22_0x54fb49(0x1cb)](_0x177087){const _0x484fd9=a22_0x54fb49,{options:_0x1c7f57,args:_0x10250c,tdx:_0x107c0b}=_0x177087,_0x2f49de=_0x10250c[0x0];if(!requireNameOrPath(_0x2f49de))return 0x1;_0x1c7f57['verbose']&&console[_0x484fd9(0x227)](_0x484fd9(0x1e4)+_0x2f49de);const {journeyId:_0x2a3093,journeyName:_0x2edde6}=await resolveJourneyIdFromInput(_0x2f49de,_0x1c7f57,_0x107c0b);if(!_0x1c7f57[_0x484fd9(0x254)]){const _0x4df230=await confirm(_0x484fd9(0x20c)+_0x2edde6+'\x22?');if(!_0x4df230)return console[_0x484fd9(0x227)](_0x484fd9(0x269)),0x0;}const _0x1318aa=await withSpinner('Resuming\x20journey...',()=>_0x107c0b[_0x484fd9(0x1cd)][_0x484fd9(0x1f3)](_0x2a3093),{'verbose':_0x1c7f57[_0x484fd9(0x252)]}),_0x374d8f=_0x1318aa[_0x484fd9(0x28e)];return console[_0x484fd9(0x227)](_0x484fd9(0x265)+_0x374d8f[_0x484fd9(0x1f5)][_0x484fd9(0x2b5)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a22_0x54fb49(0x299);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x290);async[a22_0x54fb49(0x1cb)](_0x364f37){const _0x45e3b2=a22_0x54fb49,{options:_0x274e6e,args:_0x578d1f,tdx:_0x3327e3}=_0x364f37,_0x2eeef3=_0x274e6e,_0x42dff3=_0x578d1f[0x0],_0x2f8a2c=_0x42dff3&&isYamlFilePath(_0x42dff3),_0x5b926e=await resolveTarget({'arg':_0x2f8a2c?_0x42dff3:undefined,'contextParent':_0x274e6e[_0x45e3b2(0x1b7)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5b926e))return _0x5b926e[_0x45e3b2(0x236)]===_0x45e3b2(0x208)?(console[_0x45e3b2(0x227)](a22_0x22ee6a['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x45e3b2(0x227)]('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[_0x45e3b2(0x227)](_0x45e3b2(0x250)),console[_0x45e3b2(0x227)](_0x45e3b2(0x261)),console[_0x45e3b2(0x227)](_0x45e3b2(0x26d))):(console[_0x45e3b2(0x227)](a22_0x22ee6a['red'](_0x45e3b2(0x1df)+_0x5b926e[_0x45e3b2(0x2b6)]+'\x0a')),_0x5b926e[_0x45e3b2(0x20b)]&&console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x287)](_0x5b926e['helpText']))),0x1;let _0x290d8c=_0x2f8a2c?undefined:_0x42dff3,_0xc92995,_0x4c2cf2;_0x5b926e[_0x45e3b2(0x2a8)]===_0x45e3b2(0x1f2)&&(_0x290d8c=_0x5b926e[_0x45e3b2(0x237)],_0xc92995=_0x5b926e['filePath'],_0x4c2cf2=_0x5b926e['folderPath']);const _0x1a9c2d=_0x5b926e[_0x45e3b2(0x23d)],_0x44241e=_0x5b926e[_0x45e3b2(0x220)];_0x2eeef3[_0x45e3b2(0x252)]&&(console[_0x45e3b2(0x227)](_0x45e3b2(0x1de)+_0x1a9c2d),console[_0x45e3b2(0x227)](_0x45e3b2(0x235)+_0x44241e),_0x290d8c&&console['error'](_0x45e3b2(0x2b2)+_0x290d8c),_0xc92995&&console['error'](_0x45e3b2(0x201)+_0xc92995),_0x4c2cf2&&console[_0x45e3b2(0x227)](_0x45e3b2(0x283)+_0x4c2cf2));const _0x3a4d14=await withSpinner(_0x45e3b2(0x1e1),()=>_0x3327e3['segment'][_0x45e3b2(0x1f6)](_0x1a9c2d),{'verbose':_0x274e6e[_0x45e3b2(0x252)]}),_0xf2b909=_0x3a4d14[_0x45e3b2(0x28e)],{journeys:_0x268a31,folders:_0x5189de}=await withSpinner(_0x45e3b2(0x24d),async()=>{const _0x2119d6=_0x45e3b2,[_0x3d53b1,_0x32f446]=await Promise['all']([_0x3327e3[_0x2119d6(0x1cd)][_0x2119d6(0x27b)](_0xf2b909,undefined,{'includeAllVersions':!![]}),_0x3327e3['segment'][_0x2119d6(0x1e7)](_0xf2b909)]);return{'journeys':_0x3d53b1,'folders':_0x32f446};},{'verbose':_0x274e6e[_0x45e3b2(0x252)]})[_0x45e3b2(0x1b4)](_0x21e62a=>_0x21e62a[_0x45e3b2(0x28e)]);let _0x41674f=_0x268a31;const _0x5d4402=buildFolderIdToPathMap(_0x5189de);if(_0x290d8c){const _0x53c533=_0x41674f[_0x45e3b2(0x231)](_0x11d73a=>_0x11d73a[_0x45e3b2(0x1bb)]['toLowerCase']()===_0x290d8c[_0x45e3b2(0x21a)]());if(_0x53c533['length']===0x0)return console[_0x45e3b2(0x227)](_0x45e3b2(0x289)+_0x290d8c),console[_0x45e3b2(0x227)](_0x45e3b2(0x2aa)),0x1;_0x41674f=_0x53c533;}if(_0x4c2cf2!==undefined){const _0x38781d=_0x41674f['filter'](_0x4f7f70=>{const _0x5947b9=_0x45e3b2,_0x18e0e1=_0x4f7f70[_0x5947b9(0x25b)]?_0x5d4402[_0x5947b9(0x2a0)](_0x4f7f70[_0x5947b9(0x25b)])||'':'';return _0x18e0e1===_0x4c2cf2;});if(_0x38781d[_0x45e3b2(0x259)]===0x0&&_0x41674f[_0x45e3b2(0x259)]>0x0){console[_0x45e3b2(0x227)]('Error:\x20Journey\x20\x27'+_0x290d8c+_0x45e3b2(0x1c1)+(_0x4c2cf2||'root\x20folder')),console[_0x45e3b2(0x227)](_0x45e3b2(0x1b3));for(const _0x39bd7d of _0x41674f){const _0x167281=_0x39bd7d[_0x45e3b2(0x25b)]?_0x5d4402[_0x45e3b2(0x2a0)](_0x39bd7d[_0x45e3b2(0x25b)])||'':'';console[_0x45e3b2(0x227)]('\x20\x20-\x20'+(_0x167281||_0x45e3b2(0x246))+'/'+_0x39bd7d[_0x45e3b2(0x1bb)]);}return 0x1;}_0x41674f=_0x38781d;}if(_0x41674f[_0x45e3b2(0x259)]===0x0)return console['error'](_0x45e3b2(0x1f7)),0x0;const _0x5663ef=new Map();for(const _0x5511c6 of _0x41674f){const _0x169cc3=_0x5511c6[_0x45e3b2(0x293)];!_0x5663ef[_0x45e3b2(0x1c2)](_0x169cc3)&&_0x5663ef[_0x45e3b2(0x288)](_0x169cc3,[]),_0x5663ef[_0x45e3b2(0x2a0)](_0x169cc3)[_0x45e3b2(0x25d)](_0x5511c6);}for(const _0xcf7d74 of _0x5663ef[_0x45e3b2(0x1d0)]()){_0xcf7d74[_0x45e3b2(0x1e9)]((_0x2d060f,_0x2ef3f3)=>(_0x2d060f[_0x45e3b2(0x228)]||0x0)-(_0x2ef3f3[_0x45e3b2(0x228)]||0x0));}const _0x417348=[],{idToEmailMap:_0x64bf01,connectionIdToNameMap:_0x5c95bc}=await withSpinner(_0x45e3b2(0x1e6),async()=>{const _0x5856ea=_0x45e3b2,[_0x33ac0a,_0x33a594]=await Promise[_0x5856ea(0x253)]([_0x3327e3[_0x5856ea(0x219)][_0x5856ea(0x22b)](),_0x3327e3[_0x5856ea(0x29d)][_0x5856ea(0x279)]()]);return{'idToEmailMap':_0x33ac0a,'connectionIdToNameMap':_0x33a594};},{'verbose':_0x274e6e[_0x45e3b2(0x252)]})[_0x45e3b2(0x1b4)](_0xedd3d6=>_0xedd3d6['data']);for(const _0x55383b of _0x5663ef['values']()){const _0x1632ed=_0x55383b[0x0][_0x45e3b2(0x1bb)],_0x30e33c=_0x55383b[0x0][_0x45e3b2(0x25b)],_0x1bf1da=_0x30e33c?_0x5d4402[_0x45e3b2(0x2a0)](_0x30e33c)||'':'',_0x114ced=_0x1bf1da?a22_0x1a2b3d[_0x45e3b2(0x29b)](_0x44241e,_0x1bf1da):_0x44241e,_0x4ad232=_0xc92995||a22_0x1a2b3d[_0x45e3b2(0x29b)](_0x114ced,sanitizeFileName(_0x1632ed)+_0x45e3b2(0x1c5));let _0xaa782d,_0x361b2e;if(existsSync(_0x4ad232))try{const _0x40a926=readFileSync(_0x4ad232,'utf-8'),_0x305ffe=parseYamlString(_0x40a926);_0x361b2e=_0x305ffe,_0xaa782d=buildRuleToNameMapping(_0x305ffe),_0x2eeef3[_0x45e3b2(0x252)]&&_0xaa782d[_0x45e3b2(0x2a3)]>0x0&&console['error']('Found\x20'+_0xaa782d[_0x45e3b2(0x2a3)]+_0x45e3b2(0x294)+_0x1632ed);}catch(_0x284a22){_0x2eeef3[_0x45e3b2(0x252)]&&console[_0x45e3b2(0x227)](_0x45e3b2(0x1ca)+_0x284a22[_0x45e3b2(0x2b6)]);}const _0xc1c42=[],_0x1ae2cd=new Set(),_0x1cf9b8=new Map(),_0x24bb86=new Map(),_0x210f10=new Set(),_0x50d761=new Map(),_0x4a86d4=new Map(),_0x2f4f5c=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x1632ed+_0x45e3b2(0x28b),async _0x56dcab=>{const _0x5c4bd1=_0x45e3b2;for(const _0x27b06d of _0x55383b){const _0x1e3f46=_0x55383b[_0x5c4bd1(0x259)]>0x1?_0x27b06d[_0x5c4bd1(0x1bb)]+'\x20v'+(_0x27b06d[_0x5c4bd1(0x228)]||0x1):_0x27b06d['journeyBundleName'];_0x56dcab[_0x5c4bd1(0x1bd)](_0x5c4bd1(0x207)+_0x1e3f46);const _0x52938f=await _0x3327e3[_0x5c4bd1(0x1cd)][_0x5c4bd1(0x25c)](_0x27b06d['id']),_0x2822e6=_0x52938f[_0x5c4bd1(0x1f5)]?.['audienceId'],_0x54cbd0={'resolveSegment':async _0xbac87e=>{const _0x1ec70a=_0x5c4bd1;if(!_0x2822e6)return{'name':_0xbac87e,'isJourneyLocal':![]};const _0x22395d=_0x1cf9b8[_0x1ec70a(0x2a0)](_0xbac87e);if(_0x22395d)return _0x22395d;try{const _0x3a60dc=await _0x3327e3[_0x1ec70a(0x20a)]['getSegment'](_0x2822e6,_0xbac87e),_0x1ea063=_0x3a60dc['kind']===SEGMENT_KIND_JOURNEY;let _0xb08e24,_0x2d1d84=_0x3a60dc[_0x1ec70a(0x2b5)];if(_0x1ea063&&_0x3a60dc[_0x1ec70a(0x243)]){const _0x7628f3=await segmentResponseToDef(_0x3a60dc,{'resolveSegmentName':async _0x471388=>{const _0x128f31=_0x1ec70a,_0x53a113=_0x1cf9b8[_0x128f31(0x2a0)](_0x471388);if(_0x53a113)return _0x53a113['name'];const _0x13e8d7=await _0x54cbd0[_0x128f31(0x1dd)](_0x471388);return _0x13e8d7[_0x128f31(0x2b5)];}}),_0xeb76d2=_0x7628f3[_0x1ec70a(0x243)];_0xb08e24={'description':_0x3a60dc[_0x1ec70a(0x1d7)],'rule':_0xeb76d2};const _0x278581=serializeRule(_0xeb76d2),_0x471e6e=_0x24bb86[_0x1ec70a(0x2a0)](_0x278581);if(_0x471e6e)_0x2d1d84=_0x471e6e,_0xb08e24=undefined,_0x2eeef3['verbose']&&console[_0x1ec70a(0x227)](_0x1ec70a(0x245)+_0x3a60dc['name']+_0x1ec70a(0x2b9)+_0x471e6e);else{let _0x6ffb64=![];if(_0xaa782d){const _0x5baaf4=_0xaa782d['get'](_0x278581);if(_0x5baaf4){const _0x168306=_0x5baaf4[_0x1ec70a(0x1ba)](_0x4987be=>!_0x1ae2cd[_0x1ec70a(0x1c2)](_0x4987be));_0x168306&&(_0x2d1d84=_0x168306,_0x1ae2cd[_0x1ec70a(0x2ac)](_0x168306),_0x24bb86[_0x1ec70a(0x288)](_0x278581,_0x168306),_0x6ffb64=!![],_0x2eeef3[_0x1ec70a(0x252)]&&console[_0x1ec70a(0x227)](_0x1ec70a(0x275)+_0x168306+_0x1ec70a(0x24e)));}}if(!_0x6ffb64){const _0x32d318=generateJourneyLocalName(_0x3a60dc['name']);_0x32d318&&(_0x2d1d84=_0x32d318);let _0x52e1ca=_0x2d1d84,_0xdd7abf=0x2;while(_0x1ae2cd['has'](_0x52e1ca)){_0x52e1ca=_0x2d1d84+'_'+_0xdd7abf,_0xdd7abf++;}_0x1ae2cd[_0x1ec70a(0x2ac)](_0x52e1ca),_0x24bb86[_0x1ec70a(0x288)](_0x278581,_0x52e1ca),_0x2d1d84=_0x52e1ca;}}}const _0x396fef={'name':_0x2d1d84,'isJourneyLocal':_0x1ea063,'definition':_0xb08e24};return _0x1cf9b8[_0x1ec70a(0x288)](_0xbac87e,_0x396fef),_0x396fef;}catch(_0x2ce76d){return _0x274e6e[_0x1ec70a(0x252)]&&console[_0x1ec70a(0x227)](_0x1ec70a(0x210)+_0xbac87e+':\x20'+_0x2ce76d[_0x1ec70a(0x2b6)]),{'name':_0xbac87e,'isJourneyLocal':![]};}},'resolveActivation':async _0x11b3c8=>{const _0x5a37ae=_0x5c4bd1,_0x363178=_0x50d761[_0x5a37ae(0x2a0)](_0x11b3c8);if(_0x363178)return _0x363178;try{const _0x2de21f=await _0x3327e3[_0x5a37ae(0x1cd)][_0x5a37ae(0x1eb)](_0x27b06d['id'],_0x11b3c8),_0x494ab7=journeyActivationStepToYaml(_0x2de21f,_0x64bf01,_0x5c95bc),_0x3821bf=JSON[_0x5a37ae(0x284)]({'name':_0x494ab7[_0x5a37ae(0x2b5)],'connection':_0x494ab7[_0x5a37ae(0x29d)],'connector_config':_0x494ab7['connector_config']}),_0x24bed8=_0x4a86d4[_0x5a37ae(0x2a0)](_0x3821bf);if(_0x24bed8){const _0x104d8f={'name':_0x24bed8,'isJourneyLocal':!![],'definition':_0x494ab7};return _0x50d761[_0x5a37ae(0x288)](_0x11b3c8,_0x104d8f),_0x104d8f;}const _0x7fdb94=_0x2de21f['attributes'][_0x5a37ae(0x211)]['name']||_0x11b3c8,_0xc0ee52=sanitizeYamlKey(_0x7fdb94)||'activation_'+_0x11b3c8;let _0x4f76ad=_0xc0ee52,_0x46ac8c=0x2;while(_0x210f10[_0x5a37ae(0x1c2)](_0x4f76ad)){_0x4f76ad=_0xc0ee52+'_'+_0x46ac8c,_0x46ac8c++;}_0x210f10[_0x5a37ae(0x2ac)](_0x4f76ad),_0x4a86d4[_0x5a37ae(0x288)](_0x3821bf,_0x4f76ad);const _0x40eede={'name':_0x4f76ad,'isJourneyLocal':!![],'definition':_0x494ab7};return _0x50d761['set'](_0x11b3c8,_0x40eede),_0x40eede;}catch(_0x4a05bb){return _0x274e6e[_0x5a37ae(0x252)]&&console[_0x5a37ae(0x227)](_0x5a37ae(0x276)+_0x11b3c8+':\x20'+_0x4a05bb[_0x5a37ae(0x2b6)]),{'name':_0x11b3c8,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x311d6f,_0x40a5f8)=>{const _0x135818=_0x5c4bd1;return resolveJumpTarget(_0x311d6f,_0x40a5f8,_0x2f4f5c,_0x30f6eb=>_0x3327e3['journey'][_0x135818(0x25c)](_0x30f6eb));}},_0x5343d0=await journeyResponseToDef(_0x52938f,_0x54cbd0);_0xc1c42[_0x5c4bd1(0x25d)]({'item':_0x27b06d,'yaml':_0x5343d0});}},{'verbose':_0x274e6e[_0x45e3b2(0x252)]});const _0x15d51d=buildMergedJourneyDef(_0xc1c42,_0xaa782d),_0x4bc0d4=normalizeJourneyDef(_0x15d51d,_0x361b2e),_0x4ec9ce=toYamlString(_0x4bc0d4),_0x2fa659=_0xc92995||a22_0x1a2b3d[_0x45e3b2(0x29b)](_0x114ced,sanitizeFileName(_0x1632ed)+'.yml');!_0xc92995&&_0x1bf1da&&!existsSync(_0x114ced)&&mkdirSync(_0x114ced,{'recursive':!![]});const _0x5c3869=a22_0x1a2b3d['relative'](process[_0x45e3b2(0x2a9)](),_0x2fa659);if(existsSync(_0x2fa659)){const _0x5917b3=readFileSync(_0x2fa659,_0x45e3b2(0x2a2)),_0x25a736=generateDiff(_0x5917b3,_0x4ec9ce),_0x5edbe0=hasChanges(_0x25a736);_0x417348[_0x45e3b2(0x25d)]({'relativePath':_0x5c3869,'absolutePath':_0x2fa659,'content':_0x4ec9ce,'isNew':![],'hasChanges':_0x5edbe0,'diff':_0x5edbe0?formatDiffWithColors(_0x25a736):undefined});}else _0x417348[_0x45e3b2(0x25d)]({'relativePath':_0x5c3869,'absolutePath':_0x2fa659,'content':_0x4ec9ce,'isNew':!![],'hasChanges':![]});}const _0x739bb8=_0x417348[_0x45e3b2(0x231)](_0x592a85=>_0x592a85[_0x45e3b2(0x2a5)]),_0x3c2094=_0x417348[_0x45e3b2(0x231)](_0xf92a7f=>!_0xf92a7f[_0x45e3b2(0x2a5)]&&_0xf92a7f['hasChanges']),_0x5eb9a5=_0x417348['filter'](_0x1c5dce=>!_0x1c5dce[_0x45e3b2(0x2a5)]&&!_0x1c5dce[_0x45e3b2(0x280)]),_0x30b6d5=_0x41674f[_0x45e3b2(0x259)],_0x228840=_0x5663ef[_0x45e3b2(0x2a3)],_0x31c5e6=_0x30b6d5>_0x228840?'\x20('+_0x30b6d5+'\x20versions)':'';console[_0x45e3b2(0x227)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a22_0x22ee6a[_0x45e3b2(0x287)](_0x228840+'\x20journeys')+a22_0x22ee6a['dim'](_0x31c5e6)),console['error']('\x20\x20'+a22_0x22ee6a['green']('+\x20'+_0x739bb8['length']+_0x45e3b2(0x232))),console[_0x45e3b2(0x227)]('\x20\x20'+a22_0x22ee6a['yellow']('~\x20'+_0x3c2094[_0x45e3b2(0x259)]+_0x45e3b2(0x1c9))),console[_0x45e3b2(0x227)]('\x20\x20'+a22_0x22ee6a[_0x45e3b2(0x224)]('=\x20'+_0x5eb9a5[_0x45e3b2(0x259)]+_0x45e3b2(0x268))),console['error']('\x20\x20Target:\x20'+a22_0x22ee6a[_0x45e3b2(0x287)](_0x44241e)+'\x0a');if(_0x3c2094['length']>0x0)for(const _0x162ab7 of _0x3c2094){console[_0x45e3b2(0x227)](_0x45e3b2(0x286)+_0x162ab7[_0x45e3b2(0x2b1)]+'\x27:'),console['error']('─'[_0x45e3b2(0x1c0)](0x3c)),console['error'](_0x162ab7[_0x45e3b2(0x27f)]),console[_0x45e3b2(0x227)]('─'[_0x45e3b2(0x1c0)](0x3c));}if(_0x2eeef3['dryRun'])return console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x217)](_0x45e3b2(0x1d6))),0x0;if(_0x739bb8[_0x45e3b2(0x259)]===0x0&&_0x3c2094[_0x45e3b2(0x259)]===0x0)return console[_0x45e3b2(0x227)](a22_0x22ee6a['green'](_0x45e3b2(0x27e))),saveSessionContext({'parent_segment':_0x1a9c2d},_0x2eeef3[_0x45e3b2(0x26f)]),console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x1bf)](_0x45e3b2(0x21f)+a22_0x22ee6a['dim'](_0x45e3b2(0x2b0))+_0x45e3b2(0x1db)+a22_0x22ee6a['cyan'](_0x1a9c2d))),0x0;if(!_0x2eeef3[_0x45e3b2(0x254)]&&(_0x739bb8[_0x45e3b2(0x259)]>0x0||_0x3c2094[_0x45e3b2(0x259)]>0x0)){if(!isInteractive())return console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x25e)](_0x45e3b2(0x274)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x224)](_0x45e3b2(0x2b8))),0x1;const _0x244a49=await confirmKey(_0x45e3b2(0x215)+(_0x739bb8[_0x45e3b2(0x259)]+_0x3c2094['length'])+'\x20files?');if(!_0x244a49)return console[_0x45e3b2(0x227)](a22_0x22ee6a['yellow'](_0x45e3b2(0x24f)),_0x45e3b2(0x216)),0x1;}!existsSync(_0x44241e)&&mkdirSync(_0x44241e,{'recursive':!![]});const _0x1e0e77=a22_0x1a2b3d[_0x45e3b2(0x29b)](_0x44241e,_0x45e3b2(0x2a4));writeFileSync(_0x1e0e77,createTdxConfigContent(_0x1a9c2d),'utf-8');for(const _0x258b7e of _0x417348){(_0x258b7e[_0x45e3b2(0x2a5)]||_0x258b7e[_0x45e3b2(0x280)])&&writeFileSync(_0x258b7e['absolutePath'],_0x258b7e[_0x45e3b2(0x256)],_0x45e3b2(0x2a2));}return console[_0x45e3b2(0x227)](a22_0x22ee6a['green'](_0x45e3b2(0x1d5)+(_0x739bb8[_0x45e3b2(0x259)]+_0x3c2094[_0x45e3b2(0x259)])+_0x45e3b2(0x270)+_0x44241e)),saveSessionContext({'parent_segment':_0x1a9c2d},_0x2eeef3['session']),console[_0x45e3b2(0x227)](a22_0x22ee6a[_0x45e3b2(0x1bf)](_0x45e3b2(0x21f)+a22_0x22ee6a[_0x45e3b2(0x224)](_0x45e3b2(0x2b0))+'\x20=\x20'+a22_0x22ee6a[_0x45e3b2(0x287)](_0x1a9c2d))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a22_0x54fb49(0x1e2);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x21e);async[a22_0x54fb49(0x1cb)](_0x40d615){const _0x310402=a22_0x54fb49,{options:_0x22c0cf,args:_0x52d26e,tdx:_0x1033c2}=_0x40d615,_0x585add=_0x52d26e[0x0];if(!requireNameOrPath(_0x585add))return 0x1;_0x22c0cf['verbose']&&console['error'](_0x310402(0x1e4)+_0x585add);const {journeyId:_0x372680}=await resolveJourneyIdFromInput(_0x585add,_0x22c0cf,_0x1033c2),_0x5462a2=await withSpinner(_0x310402(0x251),()=>_0x1033c2['journey'][_0x310402(0x212)](_0x372680),{'verbose':_0x22c0cf[_0x310402(0x252)]}),_0x14c2a4=_0x5462a2[_0x310402(0x28e)];return console[_0x310402(0x23e)](_0x310402(0x1c3)+_0x14c2a4[_0x310402(0x27a)]),console[_0x310402(0x23e)]('Table:\x20'+_0x14c2a4['table']),await handleSDKOutput(_0x14c2a4['columns'],_0x22c0cf),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x20e);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x223);async[a22_0x54fb49(0x1cb)](_0x4fcc18){const _0x55e615=a22_0x54fb49,{options:_0x2ee13e,args:_0x161eab,tdx:_0x4b9de6}=_0x4fcc18,_0x53664d=_0x161eab[0x0];if(!requireNameOrPath(_0x53664d))return 0x1;_0x2ee13e[_0x55e615(0x252)]&&console[_0x55e615(0x227)](_0x55e615(0x1e4)+_0x53664d);const {journeyId:_0x339d76}=await resolveJourneyIdFromInput(_0x53664d,_0x2ee13e,_0x4b9de6),_0x443e36=await withSpinner(_0x55e615(0x1f8),()=>_0x4b9de6[_0x55e615(0x1cd)][_0x55e615(0x1e0)](_0x339d76),{'verbose':_0x2ee13e[_0x55e615(0x252)]}),_0x5e62c2=_0x443e36[_0x55e615(0x28e)];return console[_0x55e615(0x227)]('Found\x20'+_0x5e62c2[_0x55e615(0x259)]+_0x55e615(0x240)+(_0x5e62c2[_0x55e615(0x259)]!==0x1?'s':'')),await handleSDKOutput(_0x5e62c2,_0x2ee13e),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x22d);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x2ab);[a22_0x54fb49(0x295)]=new SegmentPushCommand();async['execute'](_0x24f131){const _0x3b32af=a22_0x54fb49,_0x2ae73c=_0x24f131[_0x3b32af(0x1fe)][0x0];let _0x1ecf17;if(_0x2ae73c){const _0x4f9b96=await resolveTarget({'arg':_0x2ae73c,'contextParent':_0x24f131['options']['parentSegment'],'cwd':process[_0x3b32af(0x2a9)]()});isSuccessfulResolution(_0x4f9b96)&&_0x4f9b96['type']===_0x3b32af(0x1f2)&&(_0x1ecf17=_0x4f9b96['filePath']);}const _0x15f925={..._0x24f131,'options':{..._0x24f131['options'],'journeysOnly':!![],..._0x1ecf17&&{'singleFilePath':_0x1ecf17}}};return this[_0x3b32af(0x295)][_0x3b32af(0x1cb)](_0x15f925);}}export class JourneyVersionsCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x258);[a22_0x54fb49(0x1d7)]='List\x20all\x20versions\x20of\x20a\x20journey';async['execute'](_0x3066a1){const _0x3e63d5=a22_0x54fb49,{options:_0x4026dd,args:_0x1f77cc,tdx:_0x390bce}=_0x3066a1,_0x52703b=_0x1f77cc[0x0];if(!requireNameOrPath(_0x52703b))return 0x1;if(_0x4026dd[_0x3e63d5(0x252)])console['error'](_0x3e63d5(0x1e4)+_0x52703b);const {journeyId:_0x556be5}=await resolveJourneyIdFromInput(_0x52703b,_0x4026dd,_0x390bce),_0x161138=await withSpinner('Listing\x20journey\x20versions...',()=>_0x390bce[_0x3e63d5(0x1cd)][_0x3e63d5(0x205)](_0x556be5),{'verbose':_0x4026dd[_0x3e63d5(0x252)]}),{bundleName:_0x393dac,versions:_0x421fa3,latestJourneyId:_0x60e5fc}=_0x161138[_0x3e63d5(0x28e)];console[_0x3e63d5(0x227)](_0x393dac+':\x20'+_0x421fa3[_0x3e63d5(0x259)]+_0x3e63d5(0x285)+(_0x421fa3[_0x3e63d5(0x259)]!==0x1?'s':''));const _0x49a444=_0x421fa3[_0x3e63d5(0x271)](_0x5de1c0=>({'version':_0x5de1c0[_0x3e63d5(0x228)],'journey_id':_0x5de1c0[_0x3e63d5(0x222)],'name':_0x5de1c0['name'],'state':_0x5de1c0['state'],'paused':_0x5de1c0[_0x3e63d5(0x272)],'latest':_0x5de1c0[_0x3e63d5(0x222)]===_0x60e5fc,'created_at':_0x5de1c0['createdAt']}));return await handleSDKOutput(_0x49a444,_0x4026dd),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a22_0x54fb49(0x1c8);[a22_0x54fb49(0x1d7)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x54fb49(0x1cb)](_0x42db52){const _0x29dd21=a22_0x54fb49,{options:_0x5acc55,args:_0x4e81cc,tdx:_0x5b3b20}=_0x42db52,_0x45be32=_0x4e81cc[0x0];if(!requireNameOrPath(_0x45be32))return 0x1;if(_0x5acc55[_0x29dd21(0x252)])console[_0x29dd21(0x227)]('Input:\x20'+_0x45be32);const {journeyId:_0x4c7a96,journeyName:_0x12a0e5}=await resolveJourneyIdFromInput(_0x45be32,_0x5acc55,_0x5b3b20);if(!_0x5acc55[_0x29dd21(0x254)]){const _0x85696c=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x12a0e5+'\x22?');if(!_0x85696c)return console['error'](_0x29dd21(0x269)),0x0;}const _0x68d675=await withSpinner('Creating\x20new\x20version...',()=>_0x5b3b20[_0x29dd21(0x1cd)][_0x29dd21(0x226)](_0x4c7a96),{'verbose':_0x5acc55[_0x29dd21(0x252)]}),_0x12b762=_0x68d675[_0x29dd21(0x28e)];return console[_0x29dd21(0x227)](a22_0x22ee6a['green']('✔')+'\x20Created\x20v'+_0x12b762['attributes'][_0x29dd21(0x228)]+_0x29dd21(0x291)+_0x12b762[_0x29dd21(0x1f5)]['name']+'\x22'),console[_0x29dd21(0x227)](_0x29dd21(0x1e8)+_0x12b762['id']),await handleSingleObjectOutput({'id':_0x12b762['id'],'name':_0x12b762['attributes'][_0x29dd21(0x2b5)],'version':_0x12b762[_0x29dd21(0x1f5)]['versionNumber'],'state':_0x12b762['attributes']['state'],'bundle_id':_0x12b762[_0x29dd21(0x1f5)][_0x29dd21(0x293)],'created_at':_0x12b762[_0x29dd21(0x1f5)]['createdAt']},_0x5acc55),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a22_0x54fb49(0x2b5)]=a22_0x54fb49(0x241);[a22_0x54fb49(0x1d7)]=a22_0x54fb49(0x28c);async[a22_0x54fb49(0x1cb)](_0x186816){const _0x449a64=a22_0x54fb49,{options:_0xa70e4f,args:_0x18cac4,tdx:_0x460f32}=_0x186816,_0x18bb3a=_0x18cac4[0x0];if(!requireNameOrPath(_0x18bb3a))return 0x1;const _0x2ebcee=_0xa70e4f['version'];if(!_0x2ebcee)return console[_0x449a64(0x227)]('Error:\x20--version\x20option\x20is\x20required'),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x29a867=parseInt(_0x2ebcee,0xa);if(isNaN(_0x29a867)||_0x29a867<0x1)return console[_0x449a64(0x227)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x2ebcee),0x1;if(_0xa70e4f[_0x449a64(0x252)])console[_0x449a64(0x227)]('Input:\x20'+_0x18bb3a+',\x20version:\x20'+_0x29a867);const {journeyId:_0x5df0e3,parentSegmentId:_0x11ed7e}=await resolveJourneyIdFromInput(_0x18bb3a,_0xa70e4f,_0x460f32),_0x2af8a1=await withSpinner(_0x449a64(0x233),()=>_0x460f32[_0x449a64(0x1cd)]['listVersions'](_0x5df0e3),{'verbose':_0xa70e4f[_0x449a64(0x252)]}),{versions:_0x4cd7cd,latestJourneyId:_0x452e22}=_0x2af8a1[_0x449a64(0x28e)],_0x12c2b0=_0x4cd7cd[_0x449a64(0x1ba)](_0x21f133=>_0x21f133['versionNumber']===_0x29a867);if(!_0x12c2b0){const _0x312d30=_0x4cd7cd['map'](_0x2e4a8f=>'v'+_0x2e4a8f[_0x449a64(0x228)])[_0x449a64(0x29b)](',\x20');return console[_0x449a64(0x227)](_0x449a64(0x1d9)+_0x29a867+_0x449a64(0x2b4)+_0x312d30),0x1;}const _0x370af0=await withSpinner(_0x449a64(0x297)+_0x29a867+_0x449a64(0x2a7),()=>_0x460f32[_0x449a64(0x1cd)]['getJourney'](_0x12c2b0['journeyId']),{'verbose':_0xa70e4f[_0x449a64(0x252)]}),_0x2a6466=_0x370af0[_0x449a64(0x28e)],_0x1a8f4c=getConsoleNextUrl(_0xa70e4f[_0x449a64(0x21d)],_0x449a64(0x248)+_0x11ed7e+_0x449a64(0x203)+_0x12c2b0['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x2a6466['id'],'name':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x2b5)],'version':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x228)],'description':_0x2a6466['attributes'][_0x449a64(0x1d7)],'state':_0x2a6466['attributes'][_0x449a64(0x1f0)],'paused':_0x2a6466[_0x449a64(0x1f5)]['paused'],'reentry_mode':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x23c)],'stages':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x1ec)]?.[_0x449a64(0x259)]||0x0,..._0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x206)]&&{'goal':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x206)][_0x449a64(0x2b5)]},'latest':_0x12c2b0[_0x449a64(0x222)]===_0x452e22,'created_at':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x255)],'updated_at':_0x2a6466[_0x449a64(0x1f5)][_0x449a64(0x263)],'url':_0x1a8f4c},_0xa70e4f),0x0;}}
|