@treasuredata/tdx 0.29.2 → 0.29.3
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/upgrade-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.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/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/file-reader.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_0x58c2d9=a19_0xa163;function a19_0xa163(_0x32bea5,_0xc60d1b){_0x32bea5=_0x32bea5-0x10e;const _0x60a8aa=a19_0x60a8();let _0xa16301=_0x60a8aa[_0x32bea5];return _0xa16301;}(function(_0xf0675d,_0x426a3b){const _0x421ad3=a19_0xa163,_0x5b2e7f=_0xf0675d();while(!![]){try{const _0x5e2c05=parseInt(_0x421ad3(0x113))/0x1*(-parseInt(_0x421ad3(0x13a))/0x2)+parseInt(_0x421ad3(0x122))/0x3+-parseInt(_0x421ad3(0x112))/0x4*(-parseInt(_0x421ad3(0x130))/0x5)+-parseInt(_0x421ad3(0x137))/0x6*(-parseInt(_0x421ad3(0x134))/0x7)+parseInt(_0x421ad3(0x12a))/0x8+-parseInt(_0x421ad3(0x12f))/0x9+parseInt(_0x421ad3(0x12b))/0xa*(parseInt(_0x421ad3(0x118))/0xb);if(_0x5e2c05===_0x426a3b)break;else _0x5b2e7f['push'](_0x5b2e7f['shift']());}catch(_0x105f18){_0x5b2e7f['push'](_0x5b2e7f['shift']());}}}(a19_0x60a8,0xbb4f2));function a19_0x60a8(){const _0x3e3053=['Validate\x20campaign\x20YAML\x20files','4691814TTmijO','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20campaign(s)\x20valid','64TxHcbO','cwd','red','valid','validCount','hasErrors','resolve','5260SSdmml','21806kwtavQ','log','length','verbose','warnings','3434255gfpayn','reason','warningCount','relativePath','name','execute','\x20non-campaign\x20file(s)\x20skipped','\x20non-campaign\x20file(s)\x20skipped)','Validation\x20failed:\x20','\x20(skipped:\x20','91647mmxVlc','skippedCount','description','yellow','filter','campaign','endsWith','\x20campaign(s)\x20with\x20errors,\x20','5927544uyDlIz','40tFyWvh','error','errors','green','12402324uqJdUi','155BVbAoh','.yml','\x20warning(s)\x20found','engage:campaign:validate','7ZYvxFu','dim'];a19_0x60a8=function(){return _0x3e3053;};return a19_0x60a8();}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a19_0xea62fe from'chalk';import a19_0x209381 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a19_0x58c2d9(0x11c)]=a19_0x58c2d9(0x133);[a19_0x58c2d9(0x124)]=a19_0x58c2d9(0x136);async[a19_0x58c2d9(0x11d)](_0x4e9241){const _0x184bc7=a19_0x58c2d9,{options:_0x1fd2fa,args:_0x214ee3}=_0x4e9241,_0x1d61e0=_0x1fd2fa,_0x49882f=_0x214ee3[0x0],_0xc388b0=_0x49882f?a19_0x209381[_0x184bc7(0x111)](_0x49882f):undefined,_0x8be9ae=_0xc388b0?isYamlFile(_0xc388b0):![];let _0x52f4fc,_0x7bc464;if(_0x8be9ae&&_0xc388b0)_0x52f4fc=a19_0x209381['dirname'](_0xc388b0),_0x7bc464=_0xc388b0;else _0xc388b0?_0x52f4fc=_0xc388b0:_0x52f4fc=process[_0x184bc7(0x13b)]();if(!_0x7bc464&&!existsSync(_0x52f4fc))return console[_0x184bc7(0x12c)](a19_0xea62fe[_0x184bc7(0x13c)]('Error:\x20Directory\x20not\x20found:\x20'+_0x52f4fc+'\x0a')),0x1;let _0x24d0d2;if(_0x7bc464){if(!_0x7bc464[_0x184bc7(0x128)](_0x184bc7(0x131))&&!_0x7bc464['endsWith']('.yaml'))return console['error'](a19_0xea62fe[_0x184bc7(0x13c)](_0x184bc7(0x138)+_0x7bc464+'\x0a')),0x1;_0x24d0d2=[_0x7bc464];}else _0x24d0d2=findYamlFiles(_0x52f4fc);if(_0x24d0d2['length']===0x0)return console['error'](a19_0xea62fe['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x52f4fc+'\x0a')),0x1;const _0x31a711=validateYamlFiles(_0x24d0d2,_0x52f4fc,{'filterType':_0x184bc7(0x127)}),_0x3bada8=calculateSummary(_0x31a711),_0x57010a=_0x31a711[_0x184bc7(0x126)](isValidationResult);if(_0x57010a[_0x184bc7(0x115)]===0x0)return console[_0x184bc7(0x12c)](a19_0xea62fe[_0x184bc7(0x125)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x52f4fc+'\x0a')),_0x3bada8['skippedCount']>0x0&&console['error'](a19_0xea62fe[_0x184bc7(0x135)]('('+_0x3bada8[_0x184bc7(0x123)]+_0x184bc7(0x11f))),0x0;for(const _0x540578 of _0x31a711){if(!isValidationResult(_0x540578)){_0x1d61e0[_0x184bc7(0x116)]&&console[_0x184bc7(0x114)](a19_0xea62fe[_0x184bc7(0x135)]('-\x20'+_0x540578[_0x184bc7(0x11b)]+_0x184bc7(0x121)+_0x540578[_0x184bc7(0x119)]+')'));continue;}const {relativePath:_0xc08c7,source:_0x420c06,result:_0x26d1e2}=_0x540578;if(_0x26d1e2[_0x184bc7(0x10e)]&&_0x26d1e2[_0x184bc7(0x117)][_0x184bc7(0x115)]===0x0)_0x1d61e0[_0x184bc7(0x116)]&&console['log'](a19_0xea62fe[_0x184bc7(0x12e)]('✔\x20'+_0xc08c7));else _0x26d1e2[_0x184bc7(0x10e)]?(console['log'](a19_0xea62fe[_0x184bc7(0x125)]('⚠\x20'+_0xc08c7+':\x20'+_0x26d1e2[_0x184bc7(0x117)][_0x184bc7(0x115)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x26d1e2,_0x420c06,_0xc08c7))):(console[_0x184bc7(0x114)](a19_0xea62fe[_0x184bc7(0x13c)]('✖\x20'+_0xc08c7+':\x20'+_0x26d1e2[_0x184bc7(0x12d)][_0x184bc7(0x115)]+'\x20error(s)')),console[_0x184bc7(0x114)](formatValidationResult(_0x26d1e2,_0x420c06,_0xc08c7)));}return console[_0x184bc7(0x114)](''),_0x3bada8[_0x184bc7(0x110)]?(console['log'](a19_0xea62fe['red'](_0x184bc7(0x120)+_0x3bada8['invalidCount']+_0x184bc7(0x129)+_0x3bada8[_0x184bc7(0x10f)]+'\x20valid')),_0x3bada8[_0x184bc7(0x11a)]>0x0&&console[_0x184bc7(0x114)](a19_0xea62fe['yellow'](_0x3bada8[_0x184bc7(0x11a)]+_0x184bc7(0x132))),_0x3bada8[_0x184bc7(0x123)]>0x0&&console['log'](a19_0xea62fe[_0x184bc7(0x135)](_0x3bada8[_0x184bc7(0x123)]+_0x184bc7(0x11e))),0x1):(console['log'](a19_0xea62fe[_0x184bc7(0x12e)]('✔\x20All\x20'+_0x3bada8['validCount']+_0x184bc7(0x139))),_0x3bada8[_0x184bc7(0x11a)]>0x0&&console[_0x184bc7(0x114)](a19_0xea62fe[_0x184bc7(0x125)](_0x3bada8[_0x184bc7(0x11a)]+_0x184bc7(0x132))),_0x3bada8[_0x184bc7(0x123)]>0x0&&console[_0x184bc7(0x114)](a19_0xea62fe['dim'](_0x3bada8[_0x184bc7(0x123)]+_0x184bc7(0x11e))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x51fe15=a20_0x2f89;(function(_0x92a95f,_0x2d252b){const _0x567b35=a20_0x2f89,_0x35a913=_0x92a95f();while(!![]){try{const _0x251153=-parseInt(_0x567b35(0x139))/0x1*(-parseInt(_0x567b35(0x14a))/0x2)+parseInt(_0x567b35(0x133))/0x3+-parseInt(_0x567b35(0x110))/0x4+parseInt(_0x567b35(0x132))/0x5*(parseInt(_0x567b35(0xfd))/0x6)+parseInt(_0x567b35(0x117))/0x7*(-parseInt(_0x567b35(0xfc))/0x8)+parseInt(_0x567b35(0xdf))/0x9+parseInt(_0x567b35(0xf8))/0xa*(-parseInt(_0x567b35(0x151))/0xb);if(_0x251153===_0x2d252b)break;else _0x35a913['push'](_0x35a913['shift']());}catch(_0x3d7769){_0x35a913['push'](_0x35a913['shift']());}}}(a20_0x7e2e,0x53e87));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{readFileContent}from'../utils/file-reader.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(_0x2780ec,_0x1f02d9,_0x57e91c=![]){const _0x383a65=a20_0x2f89;if(_0x2780ec[_0x383a65(0x10a)])return await _0x1f02d9[_0x383a65(0xf4)][_0x383a65(0x13f)](_0x2780ec['workspace']);const _0x3f7cd5=loadSessionContext(_0x2780ec[_0x383a65(0xde)]);if(_0x3f7cd5?.[_0x383a65(0x144)])return await _0x1f02d9[_0x383a65(0xf4)][_0x383a65(0x13f)](_0x3f7cd5['engage_workspace']);if(_0x57e91c)throw new SDKError(ErrorCode[_0x383a65(0xdc)],_0x383a65(0xeb),undefined,{'helpText':_0x383a65(0x109)});return undefined;}async function resolveSegmentFromOptions(_0x87449a,_0x13d1ce){const _0x500a94=a20_0x2f89;if(!_0x87449a['segment'])return{};const _0x99d20a=_0x87449a['segment'],_0xb2990b=await _0x13d1ce[_0x500a94(0x11e)][_0x500a94(0xdd)](_0x99d20a);return{'audienceId':_0xb2990b[_0x500a94(0xca)],'audienceName':_0xb2990b['parentName'],..._0xb2990b[_0x500a94(0xcf)]&&{'segmentId':_0xb2990b[_0x500a94(0xcf)],'segmentName':_0xb2990b[_0x500a94(0x122)]}};}function buildConnectorConfig(_0x385e87){const _0x405376=a20_0x2f89,_0x56a541=_0x385e87['emailSenderId'],_0x98f397=_0x385e87[_0x405376(0x130)];if(!_0x56a541&&!_0x98f397)return undefined;return{..._0x56a541&&{'emailSenderId':_0x56a541},..._0x98f397&&{'jsonColumns':_0x98f397}};}function a20_0x2f89(_0xdfbf24,_0x1ba776){_0xdfbf24=_0xdfbf24-0xc5;const _0x7e2e3c=a20_0x7e2e();let _0x2f894a=_0x7e2e3c[_0xdfbf24];return _0x2f894a;}export class EngageCampaignsCommand extends BaseCommand{[a20_0x51fe15(0x12c)]=a20_0x51fe15(0xfe);['description']=a20_0x51fe15(0x11a);async[a20_0x51fe15(0x12f)](_0x43f433){const _0x189f16=a20_0x51fe15,{options:_0x18140f,args:_0x4e945e,tdx:_0x2e2604}=_0x43f433,_0x16debb=_0x4e945e[0x0],_0x55e72b=resolveLimit(_0x18140f[_0x189f16(0xf6)],DEFAULT_LLM_LIMIT),_0x186cc1=_0x18140f,_0x1dbb93=_0x186cc1[_0x189f16(0x146)],_0x48c684=_0x186cc1[_0x189f16(0xc7)],_0x480fef=await resolveWorkspaceIdFromOptions(_0x186cc1,_0x2e2604),_0x2be9d6=await withSpinner(_0x189f16(0x12e),()=>_0x2e2604[_0x189f16(0xf4)][_0x189f16(0x13e)]({'type':_0x1dbb93,'status':_0x48c684,'workspaceId':_0x480fef,'limit':_0x55e72b}),{'verbose':_0x18140f[_0x189f16(0x121)]});let _0x225fc8=_0x2be9d6[_0x189f16(0x105)];_0x16debb&&(_0x225fc8=_0x2be9d6[_0x189f16(0x105)][_0x189f16(0x124)](_0x2bc164=>matchGlobPattern(_0x2bc164[_0x189f16(0x12c)],_0x16debb)));const _0x23110f=_0x18140f[_0x189f16(0x10d)];if(_0x18140f[_0x189f16(0x116)]===_0x189f16(0xc8)||_0x18140f[_0x189f16(0x116)]==='jsonl'){const _0x479796=_0x225fc8['map'](_0xe75645=>({..._0xe75645,'url':_0xe75645[_0x189f16(0x11c)]?getCampaignUrl(_0x23110f,_0xe75645[_0x189f16(0x11c)],_0xe75645['id']):undefined}));await handleSDKOutput(_0x479796,_0x18140f);}else await handleSDKOutput(_0x225fc8,_0x18140f);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x51fe15(0x12c)]=a20_0x51fe15(0x119);[a20_0x51fe15(0xc6)]='Show\x20campaign\x20details';async[a20_0x51fe15(0x12f)](_0x30d7b5){const _0x558457=a20_0x51fe15,{options:_0x569891,args:_0x2bfcad,tdx:_0x1daebc}=_0x30d7b5;if(_0x2bfcad['length']===0x0)return console[_0x558457(0x136)](_0x558457(0xf9)),console[_0x558457(0x136)](_0x558457(0xef)),0x1;const _0x1a80b2=_0x2bfcad[0x0],_0x57a8ab=_0x569891,_0x20e3f3=await resolveWorkspaceIdFromOptions(_0x57a8ab,_0x1daebc),_0x21029b=_0x57a8ab[_0x558457(0x128)],_0x48e1af=_0x569891[_0x558457(0x10d)];if(_0x21029b){const _0x4c1e96=await withSpinner(_0x558457(0x138)+_0x1a80b2+_0x558457(0x140),()=>_0x1daebc[_0x558457(0xf4)][_0x558457(0xd9)](_0x1a80b2,_0x20e3f3),{'verbose':_0x569891[_0x558457(0x121)]}),_0x53ebae=_0x4c1e96[_0x558457(0x105)],_0x55550a=_0x53ebae['attributes'][_0x558457(0x11c)]?getCampaignUrl(_0x48e1af,_0x53ebae[_0x558457(0x10b)][_0x558457(0x11c)],_0x53ebae['id']):undefined;await handleSDKOutput([{..._0x53ebae,..._0x55550a&&{'url':_0x55550a}}],_0x569891);}else{const _0x5b99b4=await withSpinner(_0x558457(0x138)+_0x1a80b2+_0x558457(0x140),()=>_0x1daebc[_0x558457(0xf4)]['getCampaign'](_0x1a80b2,_0x20e3f3),{'verbose':_0x569891[_0x558457(0x121)]}),_0x40d4c7=_0x5b99b4[_0x558457(0x105)],_0x2c2f62=_0x40d4c7['workspaceId']?getCampaignUrl(_0x48e1af,_0x40d4c7[_0x558457(0x11c)],_0x40d4c7['id']):undefined;await handleSingleObjectOutput({..._0x40d4c7,..._0x2c2f62&&{'url':_0x2c2f62}},_0x569891);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a20_0x51fe15(0x12c)]='engage:campaign:create';[a20_0x51fe15(0xc6)]=a20_0x51fe15(0x102);async[a20_0x51fe15(0x12f)](_0x113069){const _0x53a49a=a20_0x51fe15,{options:_0x2c5110,tdx:_0x44bf38}=_0x113069,_0x2f950c=_0x2c5110,_0x4f4744=_0x2f950c[_0x53a49a(0x12c)],_0x5a0794=_0x2f950c['type'];if(!_0x4f4744)return console[_0x53a49a(0x136)](_0x53a49a(0x149)),console['error'](_0x53a49a(0x11d)),0x1;if(!_0x5a0794)return console[_0x53a49a(0x136)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x4706b9=await resolveWorkspaceIdFromOptions(_0x2f950c,_0x44bf38,!![]),_0x6c8a36=await resolveSegmentFromOptions(_0x2f950c,_0x44bf38),_0x4dc88d=buildConnectorConfig(_0x2f950c),_0x49e9c2={'name':_0x4f4744,'campaignType':_0x5a0794,'workspaceId':_0x4706b9,'description':_0x2f950c[_0x53a49a(0xc6)],..._0x6c8a36,'connectorConfig':_0x4dc88d,'startAt':_0x2f950c[_0x53a49a(0xe5)],'timezone':_0x2f950c[_0x53a49a(0x129)]},_0xe28504=await withSpinner('Creating\x20campaign\x20\x27'+_0x4f4744+'\x27...',()=>_0x44bf38[_0x53a49a(0xf4)][_0x53a49a(0x14d)](_0x49e9c2));return await handleSDKOutput([_0xe28504[_0x53a49a(0x105)]],_0x2c5110),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a20_0x51fe15(0x12c)]='engage:campaign:update';[a20_0x51fe15(0xc6)]=a20_0x51fe15(0xff);async[a20_0x51fe15(0x12f)](_0x3c5e5f){const _0x2d1b03=a20_0x51fe15,{options:_0x359cd9,args:_0x151490,tdx:_0x4e0a24}=_0x3c5e5f;if(_0x151490[_0x2d1b03(0x125)]===0x0)return console[_0x2d1b03(0x136)](_0x2d1b03(0xf9)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0xe60461=_0x151490[0x0],_0x28fada=_0x359cd9,_0x465647=await resolveWorkspaceIdFromOptions(_0x28fada,_0x4e0a24),_0x37a40b=await resolveSegmentFromOptions(_0x28fada,_0x4e0a24),_0x1808e7=buildConnectorConfig(_0x28fada),_0x53cc83={'name':_0x28fada[_0x2d1b03(0x12c)],'description':_0x28fada[_0x2d1b03(0xc6)],..._0x37a40b,'connectorConfig':_0x1808e7,'startAt':_0x28fada[_0x2d1b03(0xe5)],'timezone':_0x28fada['timezone']},_0x437f8a=Object[_0x2d1b03(0xf1)](Object[_0x2d1b03(0xfa)](_0x53cc83)['filter'](([,_0x4f238c])=>_0x4f238c!==undefined));if(Object[_0x2d1b03(0x111)](_0x437f8a)[_0x2d1b03(0x125)]===0x0)return console[_0x2d1b03(0x136)](_0x2d1b03(0xce)),console[_0x2d1b03(0x136)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x9e6039=await withSpinner('Updating\x20campaign\x20\x27'+_0xe60461+'\x27...',()=>_0x4e0a24[_0x2d1b03(0xf4)][_0x2d1b03(0xd0)](_0xe60461,_0x437f8a,_0x465647),{'verbose':_0x359cd9[_0x2d1b03(0x121)]});return await handleSDKOutput([_0x9e6039[_0x2d1b03(0x105)]],_0x359cd9),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a20_0x51fe15(0x12c)]='engage:campaign:delete';[a20_0x51fe15(0xc6)]=a20_0x51fe15(0xcb);async['execute'](_0x212da7){const _0xa8ccc5=a20_0x51fe15,{options:_0x1593c8,args:_0x43326b,tdx:_0x40d935}=_0x212da7;if(_0x43326b['length']===0x0)return console[_0xa8ccc5(0x136)](_0xa8ccc5(0xf9)),console[_0xa8ccc5(0x136)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x132936=_0x43326b[0x0],_0x2d362f=_0x1593c8,_0x388345=await resolveWorkspaceIdFromOptions(_0x2d362f,_0x40d935);if(!_0x1593c8[_0xa8ccc5(0x10e)]){const _0x45d932=await confirm(_0xa8ccc5(0x12a)+_0x132936+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x45d932)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner(_0xa8ccc5(0xd3)+_0x132936+_0xa8ccc5(0x140),()=>_0x40d935[_0xa8ccc5(0xf4)][_0xa8ccc5(0x120)](_0x132936,_0x388345),{'verbose':_0x1593c8[_0xa8ccc5(0x121)]}),console['log'](_0xa8ccc5(0x142)+_0x132936+_0xa8ccc5(0xe0)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x51fe15(0x12c)]=a20_0x51fe15(0x145);['description']='Launch\x20a\x20campaign';async[a20_0x51fe15(0x12f)](_0x100544){const _0x272add=a20_0x51fe15,{options:_0x15039e,args:_0x4b25ad,tdx:_0x1c2ae6}=_0x100544;if(_0x4b25ad[_0x272add(0x125)]===0x0)return console[_0x272add(0x136)](_0x272add(0xf9)),console[_0x272add(0x136)](_0x272add(0xc9)),0x1;const _0x6fc230=_0x4b25ad[0x0],_0x564f2a=_0x15039e,_0x551349=await resolveWorkspaceIdFromOptions(_0x564f2a,_0x1c2ae6);return await withSpinner(_0x272add(0x12d)+_0x6fc230+'\x27...',()=>_0x1c2ae6[_0x272add(0xf4)][_0x272add(0x118)](_0x6fc230,_0x551349),{'verbose':_0x15039e['verbose']}),console[_0x272add(0x112)](_0x272add(0x142)+_0x6fc230+_0x272add(0x126)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a20_0x51fe15(0x12c)]='engage:campaign:pause';[a20_0x51fe15(0xc6)]='Pause\x20a\x20campaign';async[a20_0x51fe15(0x12f)](_0xf41484){const _0x8aeb3c=a20_0x51fe15,{options:_0x3df629,args:_0x59c94c,tdx:_0x5d470e}=_0xf41484;if(_0x59c94c['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x8aeb3c(0x136)](_0x8aeb3c(0xea)),0x1;const _0x36ebec=_0x59c94c[0x0],_0x546c3e=_0x3df629,_0x3ba4d7=await resolveWorkspaceIdFromOptions(_0x546c3e,_0x5d470e);return await withSpinner(_0x8aeb3c(0x107)+_0x36ebec+_0x8aeb3c(0x140),()=>_0x5d470e[_0x8aeb3c(0xf4)]['pauseCampaign'](_0x36ebec,_0x3ba4d7),{'verbose':_0x3df629[_0x8aeb3c(0x121)]}),console['log']('Campaign\x20\x27'+_0x36ebec+_0x8aeb3c(0x13b)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a20_0x51fe15(0xd1);[a20_0x51fe15(0xc6)]='Resume\x20a\x20paused\x20campaign';async[a20_0x51fe15(0x12f)](_0x3e5108){const _0x2b03a0=a20_0x51fe15,{options:_0x112cc6,args:_0x35a55b,tdx:_0x5dea2e}=_0x3e5108;if(_0x35a55b[_0x2b03a0(0x125)]===0x0)return console['error'](_0x2b03a0(0xf9)),console[_0x2b03a0(0x136)](_0x2b03a0(0xfb)),0x1;const _0x5e00d5=_0x35a55b[0x0],_0x12c95c=_0x112cc6,_0x1b3a26=await resolveWorkspaceIdFromOptions(_0x12c95c,_0x5dea2e);return await withSpinner(_0x2b03a0(0x104)+_0x5e00d5+'\x27...',()=>_0x5dea2e[_0x2b03a0(0xf4)]['resumeCampaign'](_0x5e00d5,_0x1b3a26),{'verbose':_0x112cc6[_0x2b03a0(0x121)]}),console[_0x2b03a0(0x112)](_0x2b03a0(0x142)+_0x5e00d5+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x51fe15(0x12c)]='engage:campaign:duplicate';[a20_0x51fe15(0xc6)]=a20_0x51fe15(0x150);async['execute'](_0x3b76ca){const _0x21ae43=a20_0x51fe15,{options:_0x420f67,args:_0xe87b1e,tdx:_0x1dcceb}=_0x3b76ca;if(_0xe87b1e['length']===0x0)return console[_0x21ae43(0x136)](_0x21ae43(0xf9)),console[_0x21ae43(0x136)](_0x21ae43(0x115)),0x1;const _0x25ccd9=_0xe87b1e[0x0],_0x2c6aca=_0x420f67,_0x274688=await resolveWorkspaceIdFromOptions(_0x2c6aca,_0x1dcceb),_0x324c9a=await withSpinner(_0x21ae43(0xc5)+_0x25ccd9+_0x21ae43(0x140),()=>_0x1dcceb[_0x21ae43(0xf4)][_0x21ae43(0xf0)](_0x25ccd9,_0x274688),{'verbose':_0x420f67[_0x21ae43(0x121)]});return await handleSDKOutput([_0x324c9a[_0x21ae43(0x105)]],_0x420f67),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x51fe15(0x12c)]=a20_0x51fe15(0x13d);[a20_0x51fe15(0xc6)]='List\x20email\x20templates';async['execute'](_0xb4b502){const _0x474661=a20_0x51fe15,{options:_0x25079,args:_0x1ba674,tdx:_0x648951}=_0xb4b502,_0xbdd0f2=_0x1ba674[0x0],_0x4ec08c=resolveLimit(_0x25079['limit'],DEFAULT_LLM_LIMIT),_0x573381=_0x25079,_0xe9278f=await resolveWorkspaceIdFromOptions(_0x573381,_0x648951),_0x6da603=await withSpinner('Fetching\x20templates...',()=>_0x648951[_0x474661(0xf4)]['listTemplates']({'workspaceId':_0xe9278f,'limit':_0x4ec08c}),{'verbose':_0x25079[_0x474661(0x121)]});let _0x2750bf=_0x6da603[_0x474661(0x105)];return _0xbdd0f2&&(_0x2750bf=_0x6da603['data'][_0x474661(0x124)](_0x16ec3f=>matchGlobPattern(_0x16ec3f['name'],_0xbdd0f2))),await handleSDKOutput(_0x2750bf,_0x25079),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x51fe15(0x12c)]='engage:template:show';[a20_0x51fe15(0xc6)]=a20_0x51fe15(0x12b);async[a20_0x51fe15(0x12f)](_0x5e7b32){const _0x202e77=a20_0x51fe15,{options:_0x3f6b26,args:_0x588ced,tdx:_0x402934}=_0x5e7b32;if(_0x588ced[_0x202e77(0x125)]===0x0)return console[_0x202e77(0x136)](_0x202e77(0xe7)),console[_0x202e77(0x136)](_0x202e77(0x137)),0x1;const _0x41f8c3=_0x588ced[0x0],_0x517046=_0x3f6b26,_0x2d06cb=await resolveWorkspaceIdFromOptions(_0x517046,_0x402934),_0x4e0a3c=_0x517046[_0x202e77(0x128)];if(_0x4e0a3c){const _0x236530=await withSpinner('Fetching\x20template\x20\x27'+_0x41f8c3+'\x27...',()=>_0x402934[_0x202e77(0xf4)][_0x202e77(0xe9)](_0x41f8c3,_0x2d06cb),{'verbose':_0x3f6b26[_0x202e77(0x121)]});await handleSDKOutput([_0x236530],_0x3f6b26);}else{const _0x3343a5=await withSpinner('Fetching\x20template\x20\x27'+_0x41f8c3+_0x202e77(0x140),()=>_0x402934['engage'][_0x202e77(0x131)](_0x41f8c3,_0x2d06cb),{'verbose':_0x3f6b26[_0x202e77(0x121)]});await handleSDKOutput([_0x3343a5],_0x3f6b26);}return 0x0;}}function a20_0x7e2e(){const _0x225504=['Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','List\x20workspaces','startAt','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Error:\x20Workspace\x20name\x20is\x20required','getTemplateFull','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Workspace\x20is\x20required\x20for\x20this\x20operation','deleteWorkspace','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Operation\x20cancelled','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','duplicateCampaign','fromEntries','Fetching\x20workspaces...','createTemplate','engage','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','limit','Creating\x20workspace\x20\x27','8934230tDmmwY','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','entries','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','1122176bVZedl','80748BvuSye','engage:campaigns','Update\x20a\x20campaign','plaintext','engage:workspace:create','Create\x20a\x20new\x20campaign','engage:template:create','Resuming\x20campaign\x20\x27','data','Create\x20a\x20workspace','Pausing\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','workspace','attributes','\x27?\x20This\x20cannot\x20be\x20undone.','site','yes','engage:workspace:update','1466916TJClob','keys','log','engage:workspace:delete','Updating\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','format','7GDvRBm','launchCampaign','engage:campaign:show','List\x20campaigns','getWorkspace','workspaceId','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','segment','Delete\x20a\x20workspace','deleteCampaign','verbose','segmentName','Delete\x20an\x20email\x20template','filter','length','\x27\x20launched\x20successfully','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','full','timezone','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Show\x20email\x20template\x20details','name','Launching\x20campaign\x20\x27','Fetching\x20campaigns...','execute','jsonColumns','getTemplate','215ETYZSe','1402398JoOULI','editorType','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','error','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Fetching\x20campaign\x20\x27','17362ecmcqp','Workspace\x20\x27','\x27\x20paused\x20successfully','Error:\x20--subject\x20is\x20required','engage:templates','listCampaigns','resolveWorkspaceId','\x27...','Fetching\x20workspace\x20\x27','Campaign\x20\x27','Engage\x20workspace\x20set\x20to:\x20','engage_workspace','engage:campaign:launch','type','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Options:\x20--name,\x20--description','Error:\x20--name\x20is\x20required','8uxOslA','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Template\x20\x27','createCampaign','html','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','Duplicate\x20a\x20campaign','11RbJJjO','Duplicating\x20campaign\x20\x27','description','status','json','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','parentId','Delete\x20a\x20campaign','updateWorkspace','Verifying\x20workspace\x20\x27','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','segmentId','updateCampaign','engage:campaign:resume','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Deleting\x20campaign\x20\x27','subject','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','htmlFile','updateTemplate','Update\x20a\x20workspace','getCampaignFull','engage:template:delete','createWorkspace','MISSING_ARGUMENT','resolvePathToResource','session','5656527LyseeP','\x27\x20deleted\x20successfully','listWorkspaces','Updating\x20template\x20\x27'];a20_0x7e2e=function(){return _0x225504;};return a20_0x7e2e();}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x51fe15(0x12c)]=a20_0x51fe15(0x103);[a20_0x51fe15(0xc6)]='Create\x20an\x20email\x20template';async['execute'](_0x3b75ab){const _0x107c3f=a20_0x51fe15,{options:_0x34bfe7,tdx:_0x4cf24e}=_0x3b75ab,_0x1f995c=_0x34bfe7,_0x582f96=_0x1f995c[_0x107c3f(0x12c)],_0x47869f=_0x1f995c[_0x107c3f(0xd4)],_0x2f6b7f=_0x1f995c[_0x107c3f(0x14e)],_0x19b2c7=_0x1f995c[_0x107c3f(0xd6)];if(!_0x582f96)return console[_0x107c3f(0x136)]('Error:\x20--name\x20is\x20required'),console[_0x107c3f(0x136)](_0x107c3f(0xf5)),0x1;if(!_0x47869f)return console['error'](_0x107c3f(0x13c)),0x1;if(_0x2f6b7f&&_0x19b2c7)return console[_0x107c3f(0x136)](_0x107c3f(0x14f)),0x1;const _0x1ce8aa=_0x19b2c7?readFileContent(_0x19b2c7):_0x2f6b7f;if(!_0x1ce8aa)return console['error']('Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required'),0x1;const _0xfcc9c=await resolveWorkspaceIdFromOptions(_0x1f995c,_0x4cf24e,!![]),_0x15e6cd={'name':_0x582f96,'subjectTemplate':_0x47869f,'htmlTemplate':_0x1ce8aa,'workspaceId':_0xfcc9c,'plaintextTemplate':_0x1f995c[_0x107c3f(0x100)],'editorType':_0x1f995c[_0x107c3f(0x134)]},_0x3b2f58=await withSpinner('Creating\x20template\x20\x27'+_0x582f96+_0x107c3f(0x140),()=>_0x4cf24e[_0x107c3f(0xf4)][_0x107c3f(0xf3)](_0x15e6cd));return await handleSDKOutput([_0x3b2f58[_0x107c3f(0x105)]],_0x34bfe7),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']='engage:template:update';['description']='Update\x20an\x20email\x20template';async['execute'](_0x9c901){const _0x137d21=a20_0x51fe15,{options:_0x5583b7,args:_0x3c3e98,tdx:_0x1ac05c}=_0x9c901;if(_0x3c3e98[_0x137d21(0x125)]===0x0)return console['error'](_0x137d21(0xe7)),console[_0x137d21(0x136)](_0x137d21(0xe6)),0x1;const _0x537604=_0x3c3e98[0x0],_0x143669=_0x5583b7,_0x289018=_0x143669['html'],_0xb2a461=_0x143669[_0x137d21(0xd6)];if(_0x289018&&_0xb2a461)return console[_0x137d21(0x136)](_0x137d21(0x14f)),0x1;const _0x499ba5=_0xb2a461?readFileContent(_0xb2a461):_0x289018,_0x331485=await resolveWorkspaceIdFromOptions(_0x143669,_0x1ac05c),_0x10930d={'name':_0x143669[_0x137d21(0x12c)],'subjectTemplate':_0x143669['subject'],'htmlTemplate':_0x499ba5,'plaintextTemplate':_0x143669['plaintext']},_0x481f17=Object[_0x137d21(0xf1)](Object[_0x137d21(0xfa)](_0x10930d)[_0x137d21(0x124)](([,_0x3fa073])=>_0x3fa073!==undefined));if(Object[_0x137d21(0x111)](_0x481f17)[_0x137d21(0x125)]===0x0)return console[_0x137d21(0x136)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x137d21(0x136)](_0x137d21(0x127)),0x1;const _0x4db755=await withSpinner(_0x137d21(0xe2)+_0x537604+'\x27...',()=>_0x1ac05c[_0x137d21(0xf4)][_0x137d21(0xd7)](_0x537604,_0x481f17,_0x331485),{'verbose':_0x5583b7[_0x137d21(0x121)]});return await handleSDKOutput([_0x4db755['data']],_0x5583b7),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a20_0x51fe15(0x12c)]=a20_0x51fe15(0xda);[a20_0x51fe15(0xc6)]=a20_0x51fe15(0x123);async[a20_0x51fe15(0x12f)](_0xee5b57){const _0x2e91f1=a20_0x51fe15,{options:_0x3e3676,args:_0x9eb534,tdx:_0x11f687}=_0xee5b57;if(_0x9eb534[_0x2e91f1(0x125)]===0x0)return console[_0x2e91f1(0x136)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x2e91f1(0x136)](_0x2e91f1(0x108)),0x1;const _0x5b1468=_0x9eb534[0x0],_0x55af66=_0x3e3676,_0xa2f37e=await resolveWorkspaceIdFromOptions(_0x55af66,_0x11f687);if(!_0x3e3676[_0x2e91f1(0x10e)]){const _0x15d405=await confirm(_0x2e91f1(0xe3)+_0x5b1468+_0x2e91f1(0x10c));if(!_0x15d405)return console[_0x2e91f1(0x112)](_0x2e91f1(0xee)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x5b1468+_0x2e91f1(0x140),()=>_0x11f687[_0x2e91f1(0xf4)]['deleteTemplate'](_0x5b1468,_0xa2f37e),{'verbose':_0x3e3676['verbose']}),console[_0x2e91f1(0x112)](_0x2e91f1(0x14c)+_0x5b1468+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x51fe15(0x12c)]='engage:workspaces';[a20_0x51fe15(0xc6)]=a20_0x51fe15(0xe4);async['execute'](_0x5162ac){const _0x122da9=a20_0x51fe15,{options:_0x3329fb,args:_0x15817e,tdx:_0x36e935}=_0x5162ac,_0x146cc7=_0x15817e[0x0],_0x44ef28=resolveLimit(_0x3329fb[_0x122da9(0xf6)],DEFAULT_LLM_LIMIT),_0xacb39c=await withSpinner(_0x122da9(0xf2),()=>_0x36e935[_0x122da9(0xf4)][_0x122da9(0xe1)]({'limit':_0x44ef28}),{'verbose':_0x3329fb[_0x122da9(0x121)]});let _0x535e15=_0xacb39c[_0x122da9(0x105)];return _0x146cc7&&(_0x535e15=_0xacb39c['data'][_0x122da9(0x124)](_0x42a168=>matchGlobPattern(_0x42a168[_0x122da9(0x12c)],_0x146cc7))),await handleSDKOutput(_0x535e15,_0x3329fb),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']='engage:workspace:show';[a20_0x51fe15(0xc6)]='Show\x20workspace\x20details';async[a20_0x51fe15(0x12f)](_0x40284b){const _0x1220d0=a20_0x51fe15,{options:_0x3b2800,args:_0x2e6667,tdx:_0x13b0e6}=_0x40284b;if(_0x2e6667['length']===0x0)return console[_0x1220d0(0x136)](_0x1220d0(0xd2)),console[_0x1220d0(0x136)](_0x1220d0(0x135)),0x1;const _0xc86677=_0x2e6667[0x0],_0xc08272=_0x3b2800,_0x376431=_0xc08272[_0x1220d0(0x128)];if(_0x376431){const _0x1a36c1=await withSpinner('Fetching\x20workspace\x20\x27'+_0xc86677+_0x1220d0(0x140),()=>_0x13b0e6[_0x1220d0(0xf4)]['getWorkspaceFull'](_0xc86677),{'verbose':_0x3b2800[_0x1220d0(0x121)]});await handleSDKOutput([_0x1a36c1],_0x3b2800);}else{const _0x3f3da2=await withSpinner(_0x1220d0(0x141)+_0xc86677+_0x1220d0(0x140),()=>_0x13b0e6[_0x1220d0(0xf4)][_0x1220d0(0x11b)](_0xc86677),{'verbose':_0x3b2800[_0x1220d0(0x121)]});await handleSDKOutput([_0x3f3da2],_0x3b2800);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x51fe15(0x12c)]=a20_0x51fe15(0x101);[a20_0x51fe15(0xc6)]=a20_0x51fe15(0x106);async[a20_0x51fe15(0x12f)](_0x29ebf3){const _0x138d7f=a20_0x51fe15,{options:_0x2cf7e9,tdx:_0x28f007}=_0x29ebf3,_0x4182dc=_0x2cf7e9,_0x2223f4=_0x4182dc[_0x138d7f(0x12c)];if(!_0x2223f4)return console[_0x138d7f(0x136)](_0x138d7f(0x149)),console[_0x138d7f(0x136)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x7007f3={'name':_0x2223f4,'description':_0x4182dc[_0x138d7f(0xc6)]},_0x440d24=await withSpinner(_0x138d7f(0xf7)+_0x2223f4+'\x27...',()=>_0x28f007['engage'][_0x138d7f(0xdb)](_0x7007f3));return await handleSDKOutput([_0x440d24[_0x138d7f(0x105)]],_0x2cf7e9),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']=a20_0x51fe15(0x10f);['description']=a20_0x51fe15(0xd8);async[a20_0x51fe15(0x12f)](_0x15cdf4){const _0x4eb275=a20_0x51fe15,{options:_0x55cbf3,args:_0x4b076a,tdx:_0x405874}=_0x15cdf4;if(_0x4b076a[_0x4eb275(0x125)]===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x4eb275(0x147)),0x1;const _0x47d4af=_0x4b076a[0x0],_0x21ef08=_0x55cbf3,_0x421a28={'name':_0x21ef08[_0x4eb275(0x12c)],'description':_0x21ef08[_0x4eb275(0xc6)]},_0x135445=Object[_0x4eb275(0xf1)](Object[_0x4eb275(0xfa)](_0x421a28)[_0x4eb275(0x124)](([,_0x2afc70])=>_0x2afc70!==undefined));if(Object[_0x4eb275(0x111)](_0x135445)['length']===0x0)return console[_0x4eb275(0x136)](_0x4eb275(0xce)),console[_0x4eb275(0x136)](_0x4eb275(0x148)),0x1;const _0x3e0ab0=await withSpinner(_0x4eb275(0x114)+_0x47d4af+_0x4eb275(0x140),()=>_0x405874[_0x4eb275(0xf4)][_0x4eb275(0xcc)](_0x47d4af,_0x135445),{'verbose':_0x55cbf3['verbose']});return await handleSDKOutput([_0x3e0ab0[_0x4eb275(0x105)]],_0x55cbf3),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x51fe15(0x12c)]=a20_0x51fe15(0x113);[a20_0x51fe15(0xc6)]=a20_0x51fe15(0x11f);async[a20_0x51fe15(0x12f)](_0x381ee1){const _0x517e14=a20_0x51fe15,{options:_0xf930a4,args:_0x215a39,tdx:_0x57bb42}=_0x381ee1;if(_0x215a39['length']===0x0)return console['error'](_0x517e14(0xd2)),console[_0x517e14(0x136)](_0x517e14(0xed)),0x1;const _0x5392e3=_0x215a39[0x0];if(!_0xf930a4['yes']){const _0x46a23c=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x5392e3+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x46a23c)return console[_0x517e14(0x112)](_0x517e14(0xee)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x5392e3+_0x517e14(0x140),()=>_0x57bb42[_0x517e14(0xf4)][_0x517e14(0xec)](_0x5392e3),{'verbose':_0xf930a4[_0x517e14(0x121)]}),console['log'](_0x517e14(0x13a)+_0x5392e3+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x51fe15(0x12c)]='engage:workspace:use';[a20_0x51fe15(0xc6)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a20_0x51fe15(0x12f)](_0x108185){const _0xe86486=a20_0x51fe15,{options:_0x4d61b9,args:_0x17eee4,tdx:_0x592279}=_0x108185;if(_0x17eee4[_0xe86486(0x125)]===0x0)return console[_0xe86486(0x136)](_0xe86486(0xe8)),console[_0xe86486(0x136)](_0xe86486(0xd5)),0x1;const _0x1391df=_0x17eee4[0x0];await withSpinner(_0xe86486(0xcd)+_0x1391df+_0xe86486(0x140),()=>_0x592279[_0xe86486(0xf4)][_0xe86486(0x13f)](_0x1391df));const _0x433162=_0x4d61b9[_0xe86486(0xde)]||undefined;return saveSessionContext({'engage_workspace':_0x1391df},_0x433162),console[_0xe86486(0x112)](_0xe86486(0x143)+_0x1391df),console[_0xe86486(0x112)](_0xe86486(0x14b)),0x0;}}
|
|
1
|
+
const a20_0x5a59ef=a20_0xfbf5;(function(_0x51b720,_0x482d91){const _0x1cea4f=a20_0xfbf5,_0x225468=_0x51b720();while(!![]){try{const _0x551e73=parseInt(_0x1cea4f(0x198))/0x1*(parseInt(_0x1cea4f(0x1a6))/0x2)+-parseInt(_0x1cea4f(0x1c0))/0x3+-parseInt(_0x1cea4f(0x1a5))/0x4*(parseInt(_0x1cea4f(0x197))/0x5)+-parseInt(_0x1cea4f(0x19e))/0x6+-parseInt(_0x1cea4f(0x1f3))/0x7*(-parseInt(_0x1cea4f(0x1ae))/0x8)+-parseInt(_0x1cea4f(0x170))/0x9*(parseInt(_0x1cea4f(0x1a4))/0xa)+parseInt(_0x1cea4f(0x18a))/0xb*(parseInt(_0x1cea4f(0x1d8))/0xc);if(_0x551e73===_0x482d91)break;else _0x225468['push'](_0x225468['shift']());}catch(_0x5842b4){_0x225468['push'](_0x225468['shift']());}}}(a20_0x42d7,0xc6b18));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{readFileContent}from'../utils/file-reader.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(_0xa73eb4,_0x44f628,_0x2cae70=![]){const _0x2bd08c=a20_0xfbf5;if(_0xa73eb4[_0x2bd08c(0x161)])return await _0x44f628[_0x2bd08c(0x1f4)]['resolveWorkspaceId'](_0xa73eb4[_0x2bd08c(0x161)]);const _0x41b7ca=loadSessionContext(_0xa73eb4[_0x2bd08c(0x174)]);if(_0x41b7ca?.[_0x2bd08c(0x19c)])return await _0x44f628[_0x2bd08c(0x1f4)][_0x2bd08c(0x164)](_0x41b7ca[_0x2bd08c(0x19c)]);if(_0x2cae70)throw new SDKError(ErrorCode[_0x2bd08c(0x1cb)],_0x2bd08c(0x1de),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x9b8d7c,_0x4eb3eb){const _0x4e5354=a20_0xfbf5;if(!_0x9b8d7c[_0x4e5354(0x173)])return{};const _0x1df51c=_0x9b8d7c[_0x4e5354(0x173)],_0x1ebf0f=await _0x4eb3eb[_0x4e5354(0x173)][_0x4e5354(0x175)](_0x1df51c);return{'audienceId':_0x1ebf0f[_0x4e5354(0x179)],'audienceName':_0x1ebf0f[_0x4e5354(0x1ba)],..._0x1ebf0f[_0x4e5354(0x1a0)]&&{'segmentId':_0x1ebf0f[_0x4e5354(0x1a0)],'segmentName':_0x1ebf0f[_0x4e5354(0x160)]}};}function buildConnectorConfig(_0x15928a){const _0x3c30de=a20_0xfbf5,_0x5046d4=_0x15928a[_0x3c30de(0x194)],_0xc69985=_0x15928a['jsonColumns'];if(!_0x5046d4&&!_0xc69985)return undefined;return{..._0x5046d4&&{'emailSenderId':_0x5046d4},..._0xc69985&&{'jsonColumns':_0xc69985}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a20_0x5a59ef(0x17c);['description']=a20_0x5a59ef(0x1be);async['execute'](_0x365997){const _0x1087b7=a20_0x5a59ef,{options:_0x2c9714,args:_0x130deb,tdx:_0x3f994d}=_0x365997,_0x2f6851=_0x130deb[0x0],_0x4a7e78=resolveLimit(_0x2c9714[_0x1087b7(0x15e)],DEFAULT_LLM_LIMIT),_0x2f21dd=_0x2c9714,_0xefaf3e=_0x2f21dd[_0x1087b7(0x1e3)],_0x87b074=_0x2f21dd['status'],_0x3ddcc3=await resolveWorkspaceIdFromOptions(_0x2f21dd,_0x3f994d),_0x16c0cc=await withSpinner(_0x1087b7(0x1cc),()=>_0x3f994d[_0x1087b7(0x1f4)]['listCampaigns']({'type':_0xefaf3e,'status':_0x87b074,'workspaceId':_0x3ddcc3,'limit':_0x4a7e78}),{'verbose':_0x2c9714[_0x1087b7(0x186)]});let _0x5b0243=_0x16c0cc[_0x1087b7(0x1af)];_0x2f6851&&(_0x5b0243=_0x16c0cc[_0x1087b7(0x1af)][_0x1087b7(0x172)](_0x89cf82=>matchGlobPattern(_0x89cf82['name'],_0x2f6851)));const _0x252330=_0x2c9714[_0x1087b7(0x196)];if(_0x2c9714[_0x1087b7(0x189)]===_0x1087b7(0x166)||_0x2c9714[_0x1087b7(0x189)]==='jsonl'){const _0x1285e1=_0x5b0243[_0x1087b7(0x1ef)](_0x35cca9=>({..._0x35cca9,'url':_0x35cca9[_0x1087b7(0x1a1)]?getCampaignUrl(_0x252330,_0x35cca9['workspaceId'],_0x35cca9['id']):undefined}));await handleSDKOutput(_0x1285e1,_0x2c9714);}else await handleSDKOutput(_0x5b0243,_0x2c9714);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x1d5);['description']=a20_0x5a59ef(0x1f1);async['execute'](_0x12c88a){const _0x1ace15=a20_0x5a59ef,{options:_0x9e2bb9,args:_0x18e7d0,tdx:_0xb72c26}=_0x12c88a;if(_0x18e7d0['length']===0x0)return console['error'](_0x1ace15(0x1b3)),console[_0x1ace15(0x1f0)](_0x1ace15(0x181)),0x1;const _0x3e3aad=_0x18e7d0[0x0],_0x2dc53e=_0x9e2bb9,_0x5d41bd=await resolveWorkspaceIdFromOptions(_0x2dc53e,_0xb72c26),_0x1302df=_0x2dc53e['full'],_0x3cdd3c=_0x9e2bb9[_0x1ace15(0x196)];if(_0x1302df){const _0x4168f0=await withSpinner(_0x1ace15(0x191)+_0x3e3aad+_0x1ace15(0x18e),()=>_0xb72c26[_0x1ace15(0x1f4)][_0x1ace15(0x1d4)](_0x3e3aad,_0x5d41bd),{'verbose':_0x9e2bb9[_0x1ace15(0x186)]}),_0x10a629=_0x4168f0[_0x1ace15(0x1af)],_0x5888da=_0x10a629[_0x1ace15(0x1a8)]['workspaceId']?getCampaignUrl(_0x3cdd3c,_0x10a629['attributes'][_0x1ace15(0x1a1)],_0x10a629['id']):undefined;await handleSDKOutput([{..._0x10a629,..._0x5888da&&{'url':_0x5888da}}],_0x9e2bb9);}else{const _0x590c38=await withSpinner('Fetching\x20campaign\x20\x27'+_0x3e3aad+_0x1ace15(0x18e),()=>_0xb72c26[_0x1ace15(0x1f4)][_0x1ace15(0x176)](_0x3e3aad,_0x5d41bd),{'verbose':_0x9e2bb9[_0x1ace15(0x186)]}),_0x635fed=_0x590c38[_0x1ace15(0x1af)],_0x502a73=_0x635fed[_0x1ace15(0x1a1)]?getCampaignUrl(_0x3cdd3c,_0x635fed[_0x1ace15(0x1a1)],_0x635fed['id']):undefined;await handleSingleObjectOutput({..._0x635fed,..._0x502a73&&{'url':_0x502a73}},_0x9e2bb9);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x16e);[a20_0x5a59ef(0x1b7)]='Create\x20a\x20new\x20campaign';async[a20_0x5a59ef(0x1e8)](_0x27be1d){const _0x3cdd04=a20_0x5a59ef,{options:_0x489a2e,tdx:_0x13c4ed}=_0x27be1d,_0x2ac53b=_0x489a2e,_0x153e72=_0x2ac53b[_0x3cdd04(0x1dd)],_0x5cfea8=_0x2ac53b['type'];if(!_0x153e72)return console['error'](_0x3cdd04(0x16f)),console[_0x3cdd04(0x1f0)](_0x3cdd04(0x195)),0x1;if(!_0x5cfea8)return console[_0x3cdd04(0x1f0)](_0x3cdd04(0x1b4)),console[_0x3cdd04(0x1f0)](_0x3cdd04(0x195)),0x1;const _0x127f9c=await resolveWorkspaceIdFromOptions(_0x2ac53b,_0x13c4ed,!![]),_0x40b67a=await resolveSegmentFromOptions(_0x2ac53b,_0x13c4ed),_0x36dea6=buildConnectorConfig(_0x2ac53b),_0x5eaec2={'name':_0x153e72,'campaignType':_0x5cfea8,'workspaceId':_0x127f9c,'description':_0x2ac53b[_0x3cdd04(0x1b7)],..._0x40b67a,'connectorConfig':_0x36dea6,'startAt':_0x2ac53b[_0x3cdd04(0x1d2)],'timezone':_0x2ac53b['timezone']},_0x76d929=await withSpinner(_0x3cdd04(0x19d)+_0x153e72+'\x27...',()=>_0x13c4ed[_0x3cdd04(0x1f4)][_0x3cdd04(0x18b)](_0x5eaec2));return await handleSDKOutput([_0x76d929[_0x3cdd04(0x1af)]],_0x489a2e),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x1d9);[a20_0x5a59ef(0x1b7)]='Update\x20a\x20campaign';async['execute'](_0x2e0152){const _0x4fab30=a20_0x5a59ef,{options:_0x4a059c,args:_0x1bb1c0,tdx:_0x3ffec1}=_0x2e0152;if(_0x1bb1c0[_0x4fab30(0x180)]===0x0)return console[_0x4fab30(0x1f0)](_0x4fab30(0x1b3)),console[_0x4fab30(0x1f0)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x7c2dde=_0x1bb1c0[0x0],_0x28da4e=_0x4a059c,_0x388a12=await resolveWorkspaceIdFromOptions(_0x28da4e,_0x3ffec1),_0x2058bc=await resolveSegmentFromOptions(_0x28da4e,_0x3ffec1),_0x21af44=buildConnectorConfig(_0x28da4e),_0x39b157={'name':_0x28da4e['name'],'description':_0x28da4e['description'],..._0x2058bc,'connectorConfig':_0x21af44,'startAt':_0x28da4e[_0x4fab30(0x1d2)],'timezone':_0x28da4e[_0x4fab30(0x1c7)]},_0x59e9bb=Object[_0x4fab30(0x1c1)](Object[_0x4fab30(0x19a)](_0x39b157)['filter'](([,_0x44d036])=>_0x44d036!==undefined));if(Object[_0x4fab30(0x183)](_0x59e9bb)[_0x4fab30(0x180)]===0x0)return console[_0x4fab30(0x1f0)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x4fab30(0x1f0)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x4bd24e=await withSpinner('Updating\x20campaign\x20\x27'+_0x7c2dde+'\x27...',()=>_0x3ffec1[_0x4fab30(0x1f4)]['updateCampaign'](_0x7c2dde,_0x59e9bb,_0x388a12),{'verbose':_0x4a059c['verbose']});return await handleSDKOutput([_0x4bd24e[_0x4fab30(0x1af)]],_0x4a059c),0x0;}}function a20_0xfbf5(_0x5ba87a,_0x503745){_0x5ba87a=_0x5ba87a-0x15e;const _0x42d789=a20_0x42d7();let _0xfbf579=_0x42d789[_0x5ba87a];return _0xfbf579;}function a20_0x42d7(){const _0x2e2a1c=['Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','engage:workspace:create','engage:campaign:duplicate','Verifying\x20workspace\x20\x27','engage:campaign:create','Error:\x20--name\x20is\x20required','887589aitpTz','List\x20workspaces','filter','segment','session','resolvePathToResource','getCampaign','Fetching\x20template\x20\x27','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','parentId','Launching\x20campaign\x20\x27','html','engage:campaigns','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','subject','getWorkspaceFull','length','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','engage:campaign:delete','keys','Show\x20email\x20template\x20details','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','verbose','Creating\x20workspace\x20\x27','Delete\x20a\x20workspace','format','11rCMjjj','createCampaign','Update\x20a\x20workspace','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','\x27...','engage:template:create','resumeCampaign','Fetching\x20campaign\x20\x27','engage:workspace:delete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','emailSenderId','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','site','373735iLLZFM','137947DAFQcg','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','entries','duplicateCampaign','engage_workspace','Creating\x20campaign\x20\x27','863316LfoDgX','plaintext','segmentId','workspaceId','Delete\x20a\x20campaign','Error:\x20--subject\x20is\x20required','70tthFWA','20LDmjEP','10GNJtmn','engage:campaign:pause','attributes','Campaign\x20\x27','engage:templates','updateWorkspace','getTemplate','deleteCampaign','8wCXXJz','data','Operation\x20cancelled','Creating\x20template\x20\x27','Updating\x20workspace\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','\x27\x20resumed\x20successfully','Deleting\x20campaign\x20\x27','description','engage:template:update','Workspace\x20\x27','parentName','deleteWorkspace','\x27?\x20This\x20cannot\x20be\x20undone.','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','List\x20campaigns','createWorkspace','3085164Lrcdut','fromEntries','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Launch\x20a\x20campaign','htmlFile','Fetching\x20workspace\x20\x27','launchCampaign','timezone','yes','engage:template:show','List\x20email\x20templates','MISSING_ARGUMENT','Fetching\x20campaigns...','Options:\x20--name,\x20--description','updateTemplate','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','deleteTemplate','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','startAt','Fetching\x20workspaces...','getCampaignFull','engage:campaign:show','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','14781072CrIwJy','engage:campaign:update','Duplicating\x20campaign\x20\x27','log','engage:template:delete','name','Workspace\x20is\x20required\x20for\x20this\x20operation','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Update\x20an\x20email\x20template','full','type','Deleting\x20template\x20\x27','Create\x20a\x20workspace','Engage\x20workspace\x20set\x20to:\x20','listTemplates','execute','engage:campaign:launch','createTemplate','Resuming\x20campaign\x20\x27','listWorkspaces','Duplicate\x20a\x20campaign','getWorkspace','map','error','Show\x20campaign\x20details','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','7900991yIuIFX','engage','Deleting\x20workspace\x20\x27','limit','Template\x20\x27','segmentName','workspace','Error:\x20Workspace\x20name\x20is\x20required','Resume\x20a\x20paused\x20campaign','resolveWorkspaceId','Pause\x20a\x20campaign','json','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','engage:workspaces','\x27\x20deleted\x20successfully'];a20_0x42d7=function(){return _0x2e2a1c;};return a20_0x42d7();}export class EngageCampaignDeleteCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x182);[a20_0x5a59ef(0x1b7)]=a20_0x5a59ef(0x1a2);async[a20_0x5a59ef(0x1e8)](_0x5135be){const _0x39290a=a20_0x5a59ef,{options:_0x594cb5,args:_0x289792,tdx:_0x483e21}=_0x5135be;if(_0x289792[_0x39290a(0x180)]===0x0)return console[_0x39290a(0x1f0)](_0x39290a(0x1b3)),console['error'](_0x39290a(0x185)),0x1;const _0x514897=_0x289792[0x0],_0x59dd65=_0x594cb5,_0x3d1090=await resolveWorkspaceIdFromOptions(_0x59dd65,_0x483e21);if(!_0x594cb5[_0x39290a(0x1c8)]){const _0x3be477=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x514897+_0x39290a(0x1bc));if(!_0x3be477)return console[_0x39290a(0x1db)](_0x39290a(0x1b0)),0x0;}return await withSpinner(_0x39290a(0x1b6)+_0x514897+'\x27...',()=>_0x483e21['engage'][_0x39290a(0x1ad)](_0x514897,_0x3d1090),{'verbose':_0x594cb5['verbose']}),console[_0x39290a(0x1db)](_0x39290a(0x1a9)+_0x514897+_0x39290a(0x169)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x1e9);['description']=a20_0x5a59ef(0x1c3);async[a20_0x5a59ef(0x1e8)](_0x5c7b22){const _0x2cc382=a20_0x5a59ef,{options:_0x279421,args:_0x3d7ad4,tdx:_0x11451d}=_0x5c7b22;if(_0x3d7ad4[_0x2cc382(0x180)]===0x0)return console[_0x2cc382(0x1f0)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2cc382(0x1f0)](_0x2cc382(0x1f2)),0x1;const _0x39cc5b=_0x3d7ad4[0x0],_0x1a2a53=_0x279421,_0x545fbf=await resolveWorkspaceIdFromOptions(_0x1a2a53,_0x11451d);return await withSpinner(_0x2cc382(0x17a)+_0x39cc5b+'\x27...',()=>_0x11451d['engage'][_0x2cc382(0x1c6)](_0x39cc5b,_0x545fbf),{'verbose':_0x279421[_0x2cc382(0x186)]}),console[_0x2cc382(0x1db)](_0x2cc382(0x1a9)+_0x39cc5b+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x1a7);[a20_0x5a59ef(0x1b7)]=a20_0x5a59ef(0x165);async[a20_0x5a59ef(0x1e8)](_0x13cd11){const _0x34c4df=a20_0x5a59ef,{options:_0x435e04,args:_0x46ae48,tdx:_0x2edec8}=_0x13cd11;if(_0x46ae48['length']===0x0)return console[_0x34c4df(0x1f0)](_0x34c4df(0x1b3)),console[_0x34c4df(0x1f0)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x13bc9c=_0x46ae48[0x0],_0x59dc7b=_0x435e04,_0x297ff3=await resolveWorkspaceIdFromOptions(_0x59dc7b,_0x2edec8);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x13bc9c+_0x34c4df(0x18e),()=>_0x2edec8[_0x34c4df(0x1f4)]['pauseCampaign'](_0x13bc9c,_0x297ff3),{'verbose':_0x435e04[_0x34c4df(0x186)]}),console['log'](_0x34c4df(0x1a9)+_0x13bc9c+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']='engage:campaign:resume';['description']=a20_0x5a59ef(0x163);async[a20_0x5a59ef(0x1e8)](_0x5a134e){const _0x197694=a20_0x5a59ef,{options:_0x3880e1,args:_0x44ba68,tdx:_0x370bd9}=_0x5a134e;if(_0x44ba68[_0x197694(0x180)]===0x0)return console['error'](_0x197694(0x1b3)),console[_0x197694(0x1f0)](_0x197694(0x1d7)),0x1;const _0x4eda1a=_0x44ba68[0x0],_0x2ac122=_0x3880e1,_0x55c2d9=await resolveWorkspaceIdFromOptions(_0x2ac122,_0x370bd9);return await withSpinner(_0x197694(0x1eb)+_0x4eda1a+_0x197694(0x18e),()=>_0x370bd9[_0x197694(0x1f4)][_0x197694(0x190)](_0x4eda1a,_0x55c2d9),{'verbose':_0x3880e1[_0x197694(0x186)]}),console[_0x197694(0x1db)](_0x197694(0x1a9)+_0x4eda1a+_0x197694(0x1b5)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x16c);[a20_0x5a59ef(0x1b7)]=a20_0x5a59ef(0x1ed);async['execute'](_0x58c82d){const _0xf45629=a20_0x5a59ef,{options:_0x3b82c2,args:_0x2d3912,tdx:_0x415a18}=_0x58c82d;if(_0x2d3912['length']===0x0)return console[_0xf45629(0x1f0)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0xf45629(0x1f0)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x3a7d16=_0x2d3912[0x0],_0x536d40=_0x3b82c2,_0x12af8e=await resolveWorkspaceIdFromOptions(_0x536d40,_0x415a18),_0x23fc0f=await withSpinner(_0xf45629(0x1da)+_0x3a7d16+_0xf45629(0x18e),()=>_0x415a18[_0xf45629(0x1f4)][_0xf45629(0x19b)](_0x3a7d16,_0x12af8e),{'verbose':_0x3b82c2[_0xf45629(0x186)]});return await handleSDKOutput([_0x23fc0f['data']],_0x3b82c2),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x1aa);[a20_0x5a59ef(0x1b7)]=a20_0x5a59ef(0x1ca);async[a20_0x5a59ef(0x1e8)](_0x1d5688){const _0x2b6bdc=a20_0x5a59ef,{options:_0x3be557,args:_0x48ed65,tdx:_0x2aa56f}=_0x1d5688,_0x3740aa=_0x48ed65[0x0],_0x2ca57d=resolveLimit(_0x3be557['limit'],DEFAULT_LLM_LIMIT),_0x34a192=_0x3be557,_0x3ef8f1=await resolveWorkspaceIdFromOptions(_0x34a192,_0x2aa56f),_0x1d89e1=await withSpinner('Fetching\x20templates...',()=>_0x2aa56f[_0x2b6bdc(0x1f4)][_0x2b6bdc(0x1e7)]({'workspaceId':_0x3ef8f1,'limit':_0x2ca57d}),{'verbose':_0x3be557[_0x2b6bdc(0x186)]});let _0x2ce399=_0x1d89e1['data'];return _0x3740aa&&(_0x2ce399=_0x1d89e1[_0x2b6bdc(0x1af)]['filter'](_0xcd772c=>matchGlobPattern(_0xcd772c['name'],_0x3740aa))),await handleSDKOutput(_0x2ce399,_0x3be557),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x1c9);[a20_0x5a59ef(0x1b7)]=a20_0x5a59ef(0x184);async[a20_0x5a59ef(0x1e8)](_0x490dc2){const _0x1a9da4=a20_0x5a59ef,{options:_0x45f7d5,args:_0x1f5f32,tdx:_0x2af01c}=_0x490dc2;if(_0x1f5f32[_0x1a9da4(0x180)]===0x0)return console[_0x1a9da4(0x1f0)](_0x1a9da4(0x18d)),console[_0x1a9da4(0x1f0)]('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x13ca7e=_0x1f5f32[0x0],_0x62448b=_0x45f7d5,_0x2abda3=await resolveWorkspaceIdFromOptions(_0x62448b,_0x2af01c),_0x488bde=_0x62448b[_0x1a9da4(0x1e2)];if(_0x488bde){const _0x53a0c3=await withSpinner(_0x1a9da4(0x177)+_0x13ca7e+'\x27...',()=>_0x2af01c['engage']['getTemplateFull'](_0x13ca7e,_0x2abda3),{'verbose':_0x45f7d5[_0x1a9da4(0x186)]});await handleSDKOutput([_0x53a0c3],_0x45f7d5);}else{const _0x260e10=await withSpinner(_0x1a9da4(0x177)+_0x13ca7e+_0x1a9da4(0x18e),()=>_0x2af01c[_0x1a9da4(0x1f4)][_0x1a9da4(0x1ac)](_0x13ca7e,_0x2abda3),{'verbose':_0x45f7d5['verbose']});await handleSDKOutput([_0x260e10],_0x45f7d5);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x18f);[a20_0x5a59ef(0x1b7)]='Create\x20an\x20email\x20template';async[a20_0x5a59ef(0x1e8)](_0x1b0912){const _0x48752e=a20_0x5a59ef,{options:_0x2f3c28,tdx:_0x4b4e16}=_0x1b0912,_0x491286=_0x2f3c28,_0x140402=_0x491286[_0x48752e(0x1dd)],_0x25972f=_0x491286[_0x48752e(0x17e)],_0x534af7=_0x491286[_0x48752e(0x17b)],_0x17cff4=_0x491286[_0x48752e(0x1c4)];if(!_0x140402)return console['error'](_0x48752e(0x16f)),console[_0x48752e(0x1f0)](_0x48752e(0x16a)),0x1;if(!_0x25972f)return console[_0x48752e(0x1f0)](_0x48752e(0x1a3)),0x1;if(_0x534af7&&_0x17cff4)return console['error']('Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file'),0x1;const _0x472c72=_0x17cff4?readFileContent(_0x17cff4):_0x534af7;if(!_0x472c72)return console[_0x48752e(0x1f0)]('Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required'),0x1;const _0x46b6f9=await resolveWorkspaceIdFromOptions(_0x491286,_0x4b4e16,!![]),_0x8f2061={'name':_0x140402,'subjectTemplate':_0x25972f,'htmlTemplate':_0x472c72,'workspaceId':_0x46b6f9,'plaintextTemplate':_0x491286[_0x48752e(0x19f)],'editorType':_0x491286['editorType']},_0x2e0355=await withSpinner(_0x48752e(0x1b1)+_0x140402+_0x48752e(0x18e),()=>_0x4b4e16[_0x48752e(0x1f4)][_0x48752e(0x1ea)](_0x8f2061));return await handleSDKOutput([_0x2e0355[_0x48752e(0x1af)]],_0x2f3c28),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x1b8);['description']=a20_0x5a59ef(0x1e1);async[a20_0x5a59ef(0x1e8)](_0xe5e4b0){const _0x3d0ce8=a20_0x5a59ef,{options:_0x12294e,args:_0x206e4b,tdx:_0x4c462f}=_0xe5e4b0;if(_0x206e4b[_0x3d0ce8(0x180)]===0x0)return console[_0x3d0ce8(0x1f0)](_0x3d0ce8(0x18d)),console['error'](_0x3d0ce8(0x17d)),0x1;const _0x35a408=_0x206e4b[0x0],_0x325533=_0x12294e,_0x5e4ed0=_0x325533[_0x3d0ce8(0x17b)],_0x5217f3=_0x325533['htmlFile'];if(_0x5e4ed0&&_0x5217f3)return console[_0x3d0ce8(0x1f0)](_0x3d0ce8(0x178)),0x1;const _0x4c21ab=_0x5217f3?readFileContent(_0x5217f3):_0x5e4ed0,_0x566ddf=await resolveWorkspaceIdFromOptions(_0x325533,_0x4c462f),_0x24bc54={'name':_0x325533[_0x3d0ce8(0x1dd)],'subjectTemplate':_0x325533[_0x3d0ce8(0x17e)],'htmlTemplate':_0x4c21ab,'plaintextTemplate':_0x325533[_0x3d0ce8(0x19f)]},_0x5e6e44=Object[_0x3d0ce8(0x1c1)](Object[_0x3d0ce8(0x19a)](_0x24bc54)['filter'](([,_0x4e6162])=>_0x4e6162!==undefined));if(Object[_0x3d0ce8(0x183)](_0x5e6e44)[_0x3d0ce8(0x180)]===0x0)return console[_0x3d0ce8(0x1f0)](_0x3d0ce8(0x199)),console['error']('Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext'),0x1;const _0x236459=await withSpinner('Updating\x20template\x20\x27'+_0x35a408+'\x27...',()=>_0x4c462f[_0x3d0ce8(0x1f4)][_0x3d0ce8(0x1ce)](_0x35a408,_0x5e6e44,_0x566ddf),{'verbose':_0x12294e[_0x3d0ce8(0x186)]});return await handleSDKOutput([_0x236459[_0x3d0ce8(0x1af)]],_0x12294e),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a20_0x5a59ef(0x1dc);[a20_0x5a59ef(0x1b7)]='Delete\x20an\x20email\x20template';async[a20_0x5a59ef(0x1e8)](_0x20b215){const _0x934ade=a20_0x5a59ef,{options:_0xdd1824,args:_0x417ab3,tdx:_0x43dbe6}=_0x20b215;if(_0x417ab3[_0x934ade(0x180)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x934ade(0x1f0)](_0x934ade(0x1cf)),0x1;const _0x883797=_0x417ab3[0x0],_0x274758=_0xdd1824,_0xbd2ca1=await resolveWorkspaceIdFromOptions(_0x274758,_0x43dbe6);if(!_0xdd1824[_0x934ade(0x1c8)]){const _0x551581=await confirm(_0x934ade(0x193)+_0x883797+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x551581)return console[_0x934ade(0x1db)](_0x934ade(0x1b0)),0x0;}return await withSpinner(_0x934ade(0x1e4)+_0x883797+_0x934ade(0x18e),()=>_0x43dbe6[_0x934ade(0x1f4)][_0x934ade(0x1d0)](_0x883797,_0xbd2ca1),{'verbose':_0xdd1824[_0x934ade(0x186)]}),console[_0x934ade(0x1db)](_0x934ade(0x15f)+_0x883797+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x168);['description']=a20_0x5a59ef(0x171);async['execute'](_0x4e7f18){const _0x22bc0e=a20_0x5a59ef,{options:_0x88e851,args:_0x475999,tdx:_0x1e08b0}=_0x4e7f18,_0x4b5f10=_0x475999[0x0],_0x12e7b5=resolveLimit(_0x88e851[_0x22bc0e(0x15e)],DEFAULT_LLM_LIMIT),_0x271a75=await withSpinner(_0x22bc0e(0x1d3),()=>_0x1e08b0[_0x22bc0e(0x1f4)][_0x22bc0e(0x1ec)]({'limit':_0x12e7b5}),{'verbose':_0x88e851['verbose']});let _0x185537=_0x271a75['data'];return _0x4b5f10&&(_0x185537=_0x271a75[_0x22bc0e(0x1af)][_0x22bc0e(0x172)](_0x4200cf=>matchGlobPattern(_0x4200cf[_0x22bc0e(0x1dd)],_0x4b5f10))),await handleSDKOutput(_0x185537,_0x88e851),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']='engage:workspace:show';[a20_0x5a59ef(0x1b7)]='Show\x20workspace\x20details';async[a20_0x5a59ef(0x1e8)](_0x99e997){const _0x458047=a20_0x5a59ef,{options:_0x7b3ac9,args:_0x19f0b6,tdx:_0x57d683}=_0x99e997;if(_0x19f0b6[_0x458047(0x180)]===0x0)return console['error'](_0x458047(0x167)),console[_0x458047(0x1f0)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x458f5c=_0x19f0b6[0x0],_0x54562a=_0x7b3ac9,_0x5891cf=_0x54562a[_0x458047(0x1e2)];if(_0x5891cf){const _0x383d50=await withSpinner(_0x458047(0x1c5)+_0x458f5c+_0x458047(0x18e),()=>_0x57d683[_0x458047(0x1f4)][_0x458047(0x17f)](_0x458f5c),{'verbose':_0x7b3ac9[_0x458047(0x186)]});await handleSDKOutput([_0x383d50],_0x7b3ac9);}else{const _0xbfc74a=await withSpinner(_0x458047(0x1c5)+_0x458f5c+_0x458047(0x18e),()=>_0x57d683['engage'][_0x458047(0x1ee)](_0x458f5c),{'verbose':_0x7b3ac9[_0x458047(0x186)]});await handleSDKOutput([_0xbfc74a],_0x7b3ac9);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x16b);['description']=a20_0x5a59ef(0x1e5);async[a20_0x5a59ef(0x1e8)](_0x24b6c0){const _0x3b8c24=a20_0x5a59ef,{options:_0x4673ff,tdx:_0x414bfb}=_0x24b6c0,_0x30acba=_0x4673ff,_0x987e77=_0x30acba[_0x3b8c24(0x1dd)];if(!_0x987e77)return console[_0x3b8c24(0x1f0)]('Error:\x20--name\x20is\x20required'),console[_0x3b8c24(0x1f0)](_0x3b8c24(0x1bd)),0x1;const _0x456b67={'name':_0x987e77,'description':_0x30acba[_0x3b8c24(0x1b7)]},_0xaa11cc=await withSpinner(_0x3b8c24(0x187)+_0x987e77+'\x27...',()=>_0x414bfb[_0x3b8c24(0x1f4)][_0x3b8c24(0x1bf)](_0x456b67));return await handleSDKOutput([_0xaa11cc[_0x3b8c24(0x1af)]],_0x4673ff),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']='engage:workspace:update';['description']=a20_0x5a59ef(0x18c);async['execute'](_0x17403b){const _0x439cd4=a20_0x5a59ef,{options:_0x3ceedd,args:_0x555b09,tdx:_0x23ea13}=_0x17403b;if(_0x555b09[_0x439cd4(0x180)]===0x0)return console['error'](_0x439cd4(0x167)),console[_0x439cd4(0x1f0)](_0x439cd4(0x1e0)),0x1;const _0x671767=_0x555b09[0x0],_0x82ac=_0x3ceedd,_0x1c4591={'name':_0x82ac[_0x439cd4(0x1dd)],'description':_0x82ac[_0x439cd4(0x1b7)]},_0x2eb79d=Object[_0x439cd4(0x1c1)](Object['entries'](_0x1c4591)[_0x439cd4(0x172)](([,_0xb43f09])=>_0xb43f09!==undefined));if(Object[_0x439cd4(0x183)](_0x2eb79d)[_0x439cd4(0x180)]===0x0)return console[_0x439cd4(0x1f0)](_0x439cd4(0x199)),console[_0x439cd4(0x1f0)](_0x439cd4(0x1cd)),0x1;const _0x1ce565=await withSpinner(_0x439cd4(0x1b2)+_0x671767+'\x27...',()=>_0x23ea13[_0x439cd4(0x1f4)][_0x439cd4(0x1ab)](_0x671767,_0x2eb79d),{'verbose':_0x3ceedd[_0x439cd4(0x186)]});return await handleSDKOutput([_0x1ce565[_0x439cd4(0x1af)]],_0x3ceedd),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]=a20_0x5a59ef(0x192);[a20_0x5a59ef(0x1b7)]=a20_0x5a59ef(0x188);async[a20_0x5a59ef(0x1e8)](_0x1d4f4d){const _0x472d7f=a20_0x5a59ef,{options:_0x482d61,args:_0x5d50f3,tdx:_0x56cd02}=_0x1d4f4d;if(_0x5d50f3['length']===0x0)return console[_0x472d7f(0x1f0)](_0x472d7f(0x167)),console['error'](_0x472d7f(0x1c2)),0x1;const _0x21dd99=_0x5d50f3[0x0];if(!_0x482d61['yes']){const _0x4df3c2=await confirm(_0x472d7f(0x1df)+_0x21dd99+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x4df3c2)return console['log'](_0x472d7f(0x1b0)),0x0;}return await withSpinner(_0x472d7f(0x1f5)+_0x21dd99+_0x472d7f(0x18e),()=>_0x56cd02[_0x472d7f(0x1f4)][_0x472d7f(0x1bb)](_0x21dd99),{'verbose':_0x482d61[_0x472d7f(0x186)]}),console['log'](_0x472d7f(0x1b9)+_0x21dd99+_0x472d7f(0x169)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x5a59ef(0x1dd)]='engage:workspace:use';[a20_0x5a59ef(0x1b7)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a20_0x5a59ef(0x1e8)](_0x322154){const _0x5bb2f9=a20_0x5a59ef,{options:_0x136214,args:_0xcb4190,tdx:_0x51fdf9}=_0x322154;if(_0xcb4190['length']===0x0)return console[_0x5bb2f9(0x1f0)](_0x5bb2f9(0x162)),console[_0x5bb2f9(0x1f0)](_0x5bb2f9(0x1d1)),0x1;const _0x27772f=_0xcb4190[0x0];await withSpinner(_0x5bb2f9(0x16d)+_0x27772f+'\x27...',()=>_0x51fdf9[_0x5bb2f9(0x1f4)]['resolveWorkspaceId'](_0x27772f));const _0x11658f=_0x136214[_0x5bb2f9(0x174)]||undefined;return saveSessionContext({'engage_workspace':_0x27772f},_0x11658f),console[_0x5bb2f9(0x1db)](_0x5bb2f9(0x1e6)+_0x27772f),console['log'](_0x5bb2f9(0x1d6)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a21_0x53dc(_0x50f6cf,_0x10fe6c){_0x50f6cf=_0x50f6cf-0xac;const _0x373b3e=a21_0x373b();let _0x53dc6b=_0x373b3e[_0x50f6cf];return _0x53dc6b;}const a21_0x498a3b=a21_0x53dc;(function(_0x591ddf,_0x549085){const _0x5e7943=a21_0x53dc,_0x17d6ba=_0x591ddf();while(!![]){try{const _0x11e5c2=parseInt(_0x5e7943(0xf3))/0x1*(parseInt(_0x5e7943(0xf9))/0x2)+-parseInt(_0x5e7943(0xcd))/0x3*(-parseInt(_0x5e7943(0xcc))/0x4)+parseInt(_0x5e7943(0xbc))/0x5*(parseInt(_0x5e7943(0xe0))/0x6)+parseInt(_0x5e7943(0xbf))/0x7+parseInt(_0x5e7943(0xeb))/0x8*(parseInt(_0x5e7943(0xc6))/0x9)+parseInt(_0x5e7943(0xbe))/0xa+parseInt(_0x5e7943(0xb0))/0xb*(-parseInt(_0x5e7943(0xae))/0xc);if(_0x11e5c2===_0x549085)break;else _0x17d6ba['push'](_0x17d6ba['shift']());}catch(_0x453e9c){_0x17d6ba['push'](_0x17d6ba['shift']());}}}(a21_0x373b,0x20c7c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{[a21_0x498a3b(0xd3)]=a21_0x498a3b(0xd7);[a21_0x498a3b(0xe7)]=a21_0x498a3b(0xc1);async['execute'](_0x2e1602){const _0x5bd1b5=a21_0x498a3b,{options:_0x41758c,tdx:_0x471bf3}=_0x2e1602,_0x11e47c=resolveLimit(_0x41758c[_0x5bd1b5(0xdc)],DEFAULT_DISPLAY_LIMIT),_0x906f32=_0x41758c['status'];_0x41758c[_0x5bd1b5(0xd6)]&&(console[_0x5bd1b5(0xd2)](_0x5bd1b5(0xb6)+_0x11e47c+_0x5bd1b5(0xe6)),_0x906f32&&console[_0x5bd1b5(0xd2)](_0x5bd1b5(0xd8)+_0x906f32));const _0x5c6967=await withSpinner('Listing\x20jobs...',()=>_0x471bf3[_0x5bd1b5(0xd7)][_0x5bd1b5(0xbd)]({'from':0x0,'to':_0x11e47c-0x1,'status':_0x906f32}),{'verbose':_0x41758c['verbose']}),_0x4d86aa=_0x5c6967[_0x5bd1b5(0xec)];console['error']('✔\x20Found\x20'+_0x4d86aa[_0x5bd1b5(0xde)]+_0x5bd1b5(0xb9)+(_0x4d86aa[_0x5bd1b5(0xde)]!==0x1?'s':''));const _0x28313f=_0x4d86aa[_0x5bd1b5(0xb2)](_0x5cb914=>{const _0x2534d4=_0x5bd1b5;let _0xd616fd;if(_0x5cb914[_0x2534d4(0xb7)]&&_0x5cb914[_0x2534d4(0xf6)]){const _0x7b48dd=new Date(_0x5cb914[_0x2534d4(0xb7)])[_0x2534d4(0xb4)](),_0x4070da=new Date(_0x5cb914[_0x2534d4(0xf6)])[_0x2534d4(0xb4)]();_0xd616fd=Math[_0x2534d4(0xf5)]((_0x4070da-_0x7b48dd)/0x3e8);}return{'job_id':_0x5cb914[_0x2534d4(0xda)],'type':_0x5cb914[_0x2534d4(0xac)],'status':_0x5cb914[_0x2534d4(0xf8)],'user_name':_0x5cb914[_0x2534d4(0xc7)],'duration_sec':_0xd616fd,'created_at':_0x5cb914[_0x2534d4(0xee)],'started_at':_0x5cb914[_0x2534d4(0xb7)],'end_at':_0x5cb914['end_at']};});return await handleSDKOutput(_0x28313f,_0x41758c),0x0;}}export class JobShowCommand extends BaseCommand{[a21_0x498a3b(0xd3)]=a21_0x498a3b(0xc5);[a21_0x498a3b(0xe7)]=a21_0x498a3b(0xf4);[a21_0x498a3b(0xe9)](_0x59078b){const _0x172458=a21_0x498a3b,_0x4885cb=_0x59078b['args'][0x0];if(!_0x4885cb)return _0x172458(0xba);return undefined;}async[a21_0x498a3b(0xe1)](_0x450b33){const _0x17d765=a21_0x498a3b,{options:_0x173662,args:_0x4dbbd8,tdx:_0x5cca98}=_0x450b33,_0x176461=_0x4dbbd8[0x0],_0x45ba0b=await withSpinner(_0x17d765(0xb8),()=>_0x5cca98[_0x17d765(0xd7)][_0x17d765(0xf2)](_0x176461),{'verbose':_0x173662[_0x17d765(0xd6)]}),_0x1655f0=_0x45ba0b[_0x17d765(0xec)];let _0x2656f1;if(_0x1655f0[_0x17d765(0xb7)]&&_0x1655f0[_0x17d765(0xf6)]){const _0x535b61=new Date(_0x1655f0[_0x17d765(0xb7)])[_0x17d765(0xb4)](),_0x32d5dd=new Date(_0x1655f0[_0x17d765(0xf6)])[_0x17d765(0xb4)]();_0x2656f1=Math[_0x17d765(0xf5)]((_0x32d5dd-_0x535b61)/0x3e8);}const _0x114943={'job_id':_0x1655f0[_0x17d765(0xda)],'type':_0x1655f0['type'],'status':_0x1655f0[_0x17d765(0xf8)],..._0x1655f0['user_name']&&{'user_name':_0x1655f0[_0x17d765(0xc7)]},..._0x2656f1!==undefined&&{'duration_sec':_0x2656f1},..._0x1655f0['created_at']&&{'created_at':_0x1655f0['created_at']},..._0x1655f0[_0x17d765(0xb7)]&&{'started_at':_0x1655f0['start_at']},..._0x1655f0[_0x17d765(0xf6)]&&{'end_at':_0x1655f0[_0x17d765(0xf6)]},..._0x1655f0[_0x17d765(0xb5)]&&{'database':_0x1655f0[_0x17d765(0xb5)]},..._0x1655f0['priority']!==undefined&&{'priority':_0x1655f0['priority']},..._0x1655f0[_0x17d765(0xb3)]&&{'url':_0x1655f0[_0x17d765(0xb3)]},..._0x1655f0[_0x17d765(0xd0)]&&{'query':_0x1655f0[_0x17d765(0xd0)]},..._0x1655f0['debug']&&{'debug':_0x1655f0[_0x17d765(0xe8)]}};return await handleSingleObjectOutput(_0x114943,_0x173662),0x0;}}export class JobKillCommand extends BaseCommand{[a21_0x498a3b(0xd3)]=a21_0x498a3b(0xb1);[a21_0x498a3b(0xe7)]='Kill\x20a\x20job';[a21_0x498a3b(0xe9)](_0xdc5ef4){const _0x5b5a11=_0xdc5ef4['args'][0x0];if(!_0x5b5a11)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a21_0x498a3b(0xe1)](_0x1f724a){const _0x45d2c7=a21_0x498a3b,{options:_0x5dcfaf,args:_0x26916,tdx:_0x1bc9e4}=_0x1f724a,_0x5e5e0b=_0x26916[0x0];if(!_0x5dcfaf[_0x45d2c7(0xc3)]){const _0x317f50=await confirm(_0x45d2c7(0xd4)+_0x5e5e0b+'?');if(!_0x317f50)return console[_0x45d2c7(0xd2)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x1bc9e4[_0x45d2c7(0xd7)]['kill'](_0x5e5e0b),{'verbose':_0x5dcfaf[_0x45d2c7(0xd6)]}),console[_0x45d2c7(0xd2)](_0x45d2c7(0xc0)+_0x5e5e0b),console[_0x45d2c7(0xd2)](_0x45d2c7(0xf1)+_0x5e5e0b+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}function a21_0x373b(){const _0x4a4a99=['jobs','Status\x20filter:\x20','Job\x20type:\x20','job_id','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','limit','trino','length','job:result','6BsFzwt','execute','submit','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','\x20row','job:submit','\x20jobs','description','debug','validate','result','8LAIDEu','data','Getting\x20job\x20results...','created_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Database:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','show','3399ahKUot','Show\x20job\x20details','round','end_at','Submitting\x20job...','status','126kjnrIm','type','✔\x20Retrieved\x20','371796umkMTS','No\x20SQL\x20statements\x20found\x20in\x20file','308TwWjES','job:kill','map','url','getTime','database','Limit:\x20','start_at','Getting\x20job\x20details...','\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','file','1198235AOXaEZ','list','1289670CHKkku','1596147qfRWDK','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','List\x20jobs','...','yes','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','job:show','1057869RVmEMe','user_name','args','information_schema','INVALID_ARGUMENT','hive','13996SwCpPl','63eRIQkL','✔\x20Job\x20submitted','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','query','substring','error','name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Query:\x20','verbose'];a21_0x373b=function(){return _0x4a4a99;};return a21_0x373b();}export class JobSubmitCommand extends BaseCommand{['name']=a21_0x498a3b(0xe5);[a21_0x498a3b(0xe7)]='Submit\x20a\x20job';async[a21_0x498a3b(0xe1)](_0x3dff95){const _0x532397=a21_0x498a3b,{options:_0x46de0a,args:_0x568fc8,tdx:_0x422b33}=_0x3dff95,_0x50f573=_0x46de0a['jobType']||_0x532397(0xdd),_0x167c28=_0x46de0a[_0x532397(0xbb)],_0x187f44=_0x46de0a['database']||_0x532397(0xc9),_0x488786=_0x46de0a[_0x532397(0xea)];if(_0x50f573!==_0x532397(0xdd)&&_0x50f573!==_0x532397(0xcb))throw new SDKError(ErrorCode[_0x532397(0xca)],_0x532397(0xe3));let _0x55135f;if(_0x167c28){if(_0x568fc8[0x0])throw new SDKError(ErrorCode[_0x532397(0xca)],_0x532397(0xdb));const _0x20b9f6=readSqlStatementsFromFile(_0x167c28);if(_0x20b9f6[_0x532397(0xde)]===0x0)throw new SDKError(ErrorCode[_0x532397(0xca)],_0x532397(0xaf));if(_0x20b9f6['length']>0x1)throw new SDKError(ErrorCode[_0x532397(0xca)],_0x532397(0xc4));_0x55135f=_0x20b9f6[0x0];}else{if(!_0x568fc8[0x0])throw new SDKError(ErrorCode[_0x532397(0xca)],_0x532397(0xcf));_0x55135f=_0x568fc8[0x0];}_0x46de0a[_0x532397(0xd6)]&&(console[_0x532397(0xd2)](_0x532397(0xd9)+_0x50f573),console[_0x532397(0xd2)](_0x532397(0xf0)+_0x187f44),console[_0x532397(0xd2)](_0x532397(0xd5)+_0x55135f[_0x532397(0xd1)](0x0,0x64)+(_0x55135f['length']>0x64?_0x532397(0xc2):'')));const _0x3c6769=await withSpinner(_0x532397(0xf7),()=>_0x422b33[_0x532397(0xd7)][_0x532397(0xe2)](_0x187f44,_0x55135f,_0x50f573,_0x488786),{'verbose':_0x46de0a[_0x532397(0xd6)]}),_0x558792=_0x3c6769[_0x532397(0xec)];return console[_0x532397(0xd2)](_0x532397(0xce)),console[_0x532397(0xd2)]('\x20\x20Job\x20ID:\x20'+_0x558792[_0x532397(0xda)]),await handleSDKOutput([_0x558792],_0x46de0a),0x0;}}export class JobResultCommand extends BaseCommand{[a21_0x498a3b(0xd3)]=a21_0x498a3b(0xdf);[a21_0x498a3b(0xe7)]='Get\x20job\x20results';['validate'](_0x432680){const _0x2b9fb8=a21_0x498a3b,_0xc65405=_0x432680[_0x2b9fb8(0xc8)][0x0];if(!_0xc65405)return _0x2b9fb8(0xef);return undefined;}async[a21_0x498a3b(0xe1)](_0xdc5fa6){const _0x4961ee=a21_0x498a3b,{options:_0x2c5ffd,args:_0x24d876,tdx:_0x44a5e4}=_0xdc5fa6,_0x1e06f1=_0x24d876[0x0],_0x4c4d6b=await withSpinner(_0x4961ee(0xed),()=>_0x44a5e4[_0x4961ee(0xd7)][_0x4961ee(0xea)](_0x1e06f1),{'verbose':_0x2c5ffd[_0x4961ee(0xd6)]}),_0x1b5585=_0x4c4d6b[_0x4961ee(0xec)];return console[_0x4961ee(0xd2)](_0x4961ee(0xad)+_0x1b5585['length']+_0x4961ee(0xe4)+(_0x1b5585[_0x4961ee(0xde)]!==0x1?'s':'')),await handleSDKOutput(_0x1b5585,_0x2c5ffd),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x1027dc=a22_0x1928;(function(_0x3ea7a6,_0x4d7bda){const _0x3395cc=a22_0x1928,_0x38c6dc=_0x3ea7a6();while(!![]){try{const _0x228664=parseInt(_0x3395cc(0x77))/0x1*(parseInt(_0x3395cc(0xab))/0x2)+-parseInt(_0x3395cc(0xcb))/0x3*(-parseInt(_0x3395cc(0x8e))/0x4)+-parseInt(_0x3395cc(0xa9))/0x5*(parseInt(_0x3395cc(0x148))/0x6)+-parseInt(_0x3395cc(0x7e))/0x7*(parseInt(_0x3395cc(0xaf))/0x8)+parseInt(_0x3395cc(0x113))/0x9+-parseInt(_0x3395cc(0x112))/0xa+-parseInt(_0x3395cc(0xef))/0xb*(-parseInt(_0x3395cc(0x126))/0xc);if(_0x228664===_0x4d7bda)break;else _0x38c6dc['push'](_0x38c6dc['shift']());}catch(_0x44bf44){_0x38c6dc['push'](_0x38c6dc['shift']());}}}(a22_0x2cd0,0xa9ba4));import a22_0x416fe1 from'chalk';import a22_0x1cd360 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(_0x938cf8){const _0x274bde=a22_0x1928;return!_0x938cf8&&(console[_0x274bde(0xd4)](_0x274bde(0x150)),console[_0x274bde(0xd4)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x938cf8;}function withJsonFormat(_0x275247){const _0x5dbe7a=a22_0x1928;if(!_0x275247[_0x5dbe7a(0x157)]&&!_0x275247['json']&&!_0x275247['jsonl']&&!_0x275247[_0x5dbe7a(0x68)])return{..._0x275247,'format':_0x5dbe7a(0x12b),'json':!![]};return _0x275247;}function formatJourneyState(_0x37669a){const _0x3142a1=a22_0x1928;switch(_0x37669a){case _0x3142a1(0xed):return a22_0x416fe1['green'](_0x3142a1(0x11e));case _0x3142a1(0x81):return a22_0x416fe1[_0x3142a1(0xb4)]('(draft)');case'paused':return a22_0x416fe1[_0x3142a1(0xf8)](_0x3142a1(0x165));case'completed':return a22_0x416fe1['blue']('(completed)');case _0x3142a1(0x14a):return a22_0x416fe1[_0x3142a1(0xb4)]('(archived)');default:return'('+_0x37669a+')';}}function a22_0x2cd0(){const _0xb6f180=['file','push','\x22\x20paused','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','resourceName','then','resolveSegment','limit','Target\x20file:\x20','/app/ps/','yes','launched','journeyBundleId','33JCpRAx','Creating\x20new\x20version...','\x22\x20not\x20found','rule','conversion','getTrafficData','\x20activation','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20\x20Folder\x20path:\x20','yellow','resolveJourneyId','🗺️\x20','type','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20Opening\x20','Fetching\x20users\x20and\x20connections...','isNew','journeyId','updatedAt','versionNumber','📁\x20','segment','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','folderId','kind','✔\x20Found\x20','split','\x20(ID:\x20','Listing\x20journeys...','journey:view','reentryMode','Resolving\x20journey...','Cancelled','✔\x20Context\x20set:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','8806650GpyUPC','1682082XSQYPn','log','journey:traffic','filter','replace','Options:','\x20(rule\x20match)','journeyBundleName','args','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','data','(running)','(root)','Fetching\x20parent\x20segment...','Pattern:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Resolved\x20YAML\x20file:\x20','\x27\x20not\x20found\x20in\x20','\x20details...','771396rCXIHj','audienceId','links','Warning:\x20Could\x20not\x20resolve\x20segment\x20','listFolders','json','renderStats','...','Resolving\x20parent\x20segment...','add','execute','hasPeriod','Getting\x20journey\x20statistics...','completionRate','getLatestJourneyId','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','createdAt','\x20\x20-\x20','Fetching\x20','content','errorCode','size','green','Error:\x20Invalid\x20--type\x20\x22','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','completeMilestoneRate','hasChanges','description','history','Found\x20','length','folders','jsonl','\x20journey\x20files\x20to\x20','95694PorQma','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','archived','getJourney','Getting\x20journey\x20details...','Warning:\x20Could\x20not\x20resolve\x20activation\x20','red','options','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','includeHistory','Write\x20','goal','find','journey:versions','all','format','segmentName','helpText','\x20(draft)\x20—\x20\x22','\x0aPull\x20summary:','No\x20statistics\x20available\x20for\x20journey:\x20','join','bold','has','/j/da','name','Pausing\x20journey...','database','attributes','(paused)','set','\x20versions)','web','root\x20folder','tsv','journey','getParentFull','Error:\x20Journey\x20not\x20found:\x20','Input:\x20','message','Error:\x20Invalid\x20version\x20number:\x20','folderPath','table','localeCompare','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Pause\x20a\x20running\x20journey','repeat','site','journey:columns','9gjKAtj','Error:\x20Parent\x20segment\x20context\x20required','\x20\x20Consolidating\x20duplicate\x20segment:\x20','listActivationsFlat','connector_config','verbose','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','190939LkuhXP','version','INVALID_ARGUMENT','draft','getStatistics','journey:activations','base','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','test','goalSize','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20Created\x20v','Available\x20stages:\x20','milestoneSize','setPhase','connection','1750824bCDEQW','listJourneysFromParentSegment','enteredSize','\x20files?','.yml','segmentPushCommand','/e/','utf-8','getSegment','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Show\x20journey\x20table\x20column\x20mapping','\x20\x20Parent\x20segment:\x20','\x20\x20Name:\x20','journey:list','toLowerCase','parent_segment','\x20=\x20','Table:\x20','\x20->\x20','journey:resume','from','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','resolveParentId','stageNameMap','stages','\x20unchanged\x20files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','170IZtluU','journey:version:create','197834NkXSCv','getActivation','Database:\x20','\x20journey','8qQmoUC','segments','resume','state','session','dim','-\x20no\x20files\x20written','getColumnMapping','relative','activationParams','\x20\x20Journey\x20ID:\x20','journey:stats','relativePath','parentSegment','map','journeyStages','entries','Target\x20directory:\x20','\x0aError:','stage','Folder\x20path:\x20','includeStats','exitOrJumpSize','sort','values','cwd','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','parentName','6ALOdCT','\x0aChanges\x20to\x20\x27','\x22\x20resumed','/j/da/je','journey:version:view','Show\x20journey\x20statistics','pause','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Listing\x20journey\x20activations...','error','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','cyan','activation','Getting\x20version\x20','Error:\x20Stage\x20\x22','exitOrJumpRate','tdx.json','Fetching\x20journeys\x20and\x20folders...','get','diff','listVersions','Listing\x20journey\x20versions...','\x20\x20Preserving\x20local\x20segment\x20name:\x20'];a22_0x2cd0=function(){return _0xb6f180;};return a22_0x2cd0();}function formatJourneyItem(_0x457af6,_0x4c16d0='',_0x2e662e){const _0x502667=a22_0x1928,_0x28c4de=formatJourneyState(_0x457af6[_0x502667(0xb2)]),_0x9eba35=_0x2e662e?hyperlink(_0x457af6['journeyBundleName'],_0x2e662e):_0x457af6[_0x502667(0x11a)];return _0x4c16d0+_0x502667(0xfa)+_0x9eba35+'\x20'+_0x28c4de;}function a22_0x1928(_0x108067,_0x1241ce){_0x108067=_0x108067-0x64;const _0x2cd097=a22_0x2cd0();let _0x19281e=_0x2cd097[_0x108067];return _0x19281e;}function escapeRegex(_0x32213f){const _0x1114fc=a22_0x1928;return _0x32213f[_0x1114fc(0x117)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x381a43){const _0x36dd29=a22_0x1928,_0x5e4af4=_0x381a43[_0x36dd29(0x109)]('*')[_0x36dd29(0xbd)](escapeRegex);return new RegExp(_0x5e4af4[_0x36dd29(0x15d)]('.*'),'i');}function buildRuleToNameMapping(_0x27f45d){const _0x43532b=a22_0x1928,_0x1bacb0=new Map();if(_0x27f45d[_0x43532b(0xb0)])for(const [_0x2dcbbe,_0x43135d]of Object['entries'](_0x27f45d[_0x43532b(0xb0)])){if(_0x43135d[_0x43532b(0xf2)]){const _0x204f0d=serializeRule(_0x43135d[_0x43532b(0xf2)]),_0xff7d67=_0x1bacb0['get'](_0x204f0d);_0xff7d67?_0xff7d67[_0x43532b(0xe3)](_0x2dcbbe):_0x1bacb0[_0x43532b(0x64)](_0x204f0d,[_0x2dcbbe]);}}return _0x1bacb0;}async function resolveJourneyIdFromInput(_0x41825e,_0x4adebc,_0x3a8194){const _0x1f5c4f=a22_0x1928,_0x3181b7=await resolveJourneyTarget(_0x41825e,_0x4adebc[_0x1f5c4f(0xbc)],_0x4adebc[_0x1f5c4f(0x7c)]),_0x987d45=_0x3181b7['parentSegment'];if(!_0x987d45)throw new SDKError(ErrorCode[_0x1f5c4f(0x80)],_0x1f5c4f(0x105));const _0x5e8e74=await withSpinner(_0x1f5c4f(0x12e),()=>_0x3a8194[_0x1f5c4f(0x104)][_0x1f5c4f(0xa4)](_0x987d45),{'verbose':_0x4adebc[_0x1f5c4f(0x7c)]}),_0x5ab7af=_0x5e8e74[_0x1f5c4f(0x11d)],_0x177cea=await withSpinner(_0x1f5c4f(0x10e),()=>_0x3a8194['journey'][_0x1f5c4f(0xf9)](_0x5ab7af,_0x3181b7['journeyName']),{'verbose':_0x4adebc[_0x1f5c4f(0x7c)]});return{'journeyId':_0x177cea[_0x1f5c4f(0x11d)],'journeyName':_0x3181b7['journeyName'],'parentSegmentId':_0x5ab7af};}async function resolveJourneyTarget(_0x237ec0,_0xcb2e44,_0x111497){const _0x4564d7=a22_0x1928;if(isYamlFilePath(_0x237ec0))try{const _0x14d13e=await resolveYamlFilePath(_0x237ec0);return _0x111497&&(console['error'](_0x4564d7(0x123)+_0x237ec0),console['error'](_0x4564d7(0x99)+_0x14d13e['parentSegment']),console[_0x4564d7(0xd4)](_0x4564d7(0x9a)+_0x14d13e['segmentName']),console[_0x4564d7(0xd4)](_0x4564d7(0xf7)+(_0x14d13e[_0x4564d7(0x6f)]||_0x4564d7(0x11f)))),{'journeyName':_0x14d13e[_0x4564d7(0x158)],'parentSegment':_0x14d13e[_0x4564d7(0xbc)],'resolved':_0x14d13e};}catch(_0x4cfffd){throw new SDKError(ErrorCode[_0x4564d7(0x80)],_0x4564d7(0xc9)+_0x4cfffd['message']);}if(!_0xcb2e44)throw new SDKError(ErrorCode[_0x4564d7(0x80)],_0x4564d7(0x85));return{'journeyName':_0x237ec0,'parentSegment':_0xcb2e44};}export class JourneyListCommand extends BaseCommand{[a22_0x1027dc(0x161)]=a22_0x1027dc(0x9b);[a22_0x1027dc(0x141)]='List\x20journeys\x20in\x20current\x20context';async[a22_0x1027dc(0x130)](_0x53c32){const _0xc13886=a22_0x1027dc,{options:_0x2a3f30,args:_0x2651cf,tdx:_0x5b649c}=_0x53c32,_0x12be2c=_0x2651cf[0x0],_0xc17faa=_0x2a3f30[_0xc13886(0xbc)];if(!_0xc17faa)return console[_0xc13886(0xd4)](_0xc13886(0x78)),console['error'](_0xc13886(0xd5)),0x1;const _0x26f6ef=await withSpinner(_0xc13886(0x12e),()=>_0x5b649c[_0xc13886(0x104)]['resolveParentId'](_0xc17faa),{'verbose':_0x2a3f30[_0xc13886(0x7c)]}),_0x463270=_0x26f6ef['data'];_0x2a3f30[_0xc13886(0x7c)]&&(console[_0xc13886(0xd4)]('Parent\x20segment:\x20'+_0xc17faa+_0xc13886(0x10a)+_0x463270+')'),_0x12be2c&&console['error'](_0xc13886(0x121)+_0x12be2c));const _0xa63547=await withSpinner(_0xc13886(0x120),()=>_0x5b649c[_0xc13886(0x104)][_0xc13886(0x6a)](_0x463270),{'verbose':_0x2a3f30[_0xc13886(0x7c)]}),_0x363d9a=_0xa63547[_0xc13886(0x11d)],_0x5b693f=_0x363d9a['rootFolderId'],_0x336f99=await withSpinner(_0xc13886(0x10b),()=>_0x5b649c[_0xc13886(0x69)]['listJourneysWithFolders'](_0x463270,_0x5b693f),{'verbose':_0x2a3f30[_0xc13886(0x7c)]});let _0x1e91f3=_0x336f99[_0xc13886(0x11d)]['journeys'];const _0x59c5bb=_0x336f99[_0xc13886(0x11d)][_0xc13886(0x145)],_0x17b7ad=new Map();for(const _0xa27216 of _0x59c5bb){_0x17b7ad[_0xc13886(0x64)](_0xa27216['id'],_0xa27216[_0xc13886(0x161)]);}if(_0x12be2c){const _0x366a80=globToRegex(_0x12be2c);_0x1e91f3=_0x1e91f3[_0xc13886(0x116)](_0x102ddc=>_0x366a80[_0xc13886(0x86)](_0x102ddc[_0xc13886(0x11a)]));}console[_0xc13886(0xd4)](_0xc13886(0x108)+_0x1e91f3[_0xc13886(0x144)]+_0xc13886(0xae)+(_0x1e91f3['length']!==0x1?'s':''));const _0x461427=_0x248139=>{const _0x984d4f=_0xc13886;return getConsoleNextUrl(_0x2a3f30[_0x984d4f(0x75)],_0x984d4f(0xeb)+_0x463270+_0x984d4f(0x94)+_0x248139+_0x984d4f(0x160));};if(_0x2a3f30[_0xc13886(0x157)]===_0xc13886(0x70))await handleSDKOutput(_0x1e91f3,_0x2a3f30);else{if(_0x2a3f30[_0xc13886(0x157)]==='json'){const _0x5a04e3=_0x1e91f3[_0xc13886(0xbd)](_0x11a8e1=>({..._0x11a8e1,'url':_0x461427(_0x11a8e1['id'])}));await handleSDKOutput(_0x5a04e3,_0x2a3f30);}else{console['log']('['+_0xc17faa+']');const _0xc6ac02=new Map(),_0x53ec7=[];for(const _0x3238f8 of _0x1e91f3){if(!_0x3238f8['folderId']||_0x3238f8[_0xc13886(0x106)]===_0x5b693f)_0x53ec7[_0xc13886(0xe3)](_0x3238f8);else{const _0x3efd65=_0xc6ac02[_0xc13886(0xdd)](_0x3238f8['folderId'])||[];_0x3efd65[_0xc13886(0xe3)](_0x3238f8),_0xc6ac02[_0xc13886(0x64)](_0x3238f8[_0xc13886(0x106)],_0x3efd65);}}const _0x255b51=(_0x189bba,_0x32cc68)=>_0x189bba[_0xc13886(0x11a)]['localeCompare'](_0x32cc68[_0xc13886(0x11a)],undefined,{'sensitivity':_0xc13886(0x84)});_0x53ec7[_0xc13886(0xc6)](_0x255b51);for(const _0x4342ea of _0x53ec7){console['log'](formatJourneyItem(_0x4342ea,'',_0x461427(_0x4342ea['id'])));}const _0x5f1c69=[..._0xc6ac02[_0xc13886(0xbf)]()][_0xc13886(0xc6)]((_0x25b013,_0x3f1865)=>{const _0x5b1327=_0xc13886,_0x26fa45=_0x17b7ad[_0x5b1327(0xdd)](_0x25b013[0x0])||_0x25b013[0x0],_0x4fa615=_0x17b7ad[_0x5b1327(0xdd)](_0x3f1865[0x0])||_0x3f1865[0x0];return _0x26fa45[_0x5b1327(0x71)](_0x4fa615,undefined,{'sensitivity':_0x5b1327(0x84)});});for(const [_0x2fe966,_0x7b8490]of _0x5f1c69){const _0x5603f6=_0x17b7ad[_0xc13886(0xdd)](_0x2fe966)||_0x2fe966;console[_0xc13886(0x114)](_0xc13886(0x103)+_0x5603f6),_0x7b8490[_0xc13886(0xc6)](_0x255b51);for(const _0x43cf8f of _0x7b8490){console[_0xc13886(0x114)](formatJourneyItem(_0x43cf8f,'\x20\x20',_0x461427(_0x43cf8f['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a22_0x1027dc(0x10c);[a22_0x1027dc(0x141)]='Show\x20journey\x20details';async[a22_0x1027dc(0x130)](_0x487a39){const _0x21c81a=a22_0x1027dc,{options:_0x2cf45e,args:_0x25b397,tdx:_0xf44dc7}=_0x487a39,_0x5280fe=_0x25b397[0x0];if(!_0x5280fe)return console['error'](_0x21c81a(0x150)),console[_0x21c81a(0xd4)](_0x21c81a(0x13e)),console['error'](_0x21c81a(0x118)),console['error'](_0x21c81a(0x97)),0x1;_0x2cf45e[_0x21c81a(0x7c)]&&console[_0x21c81a(0xd4)](_0x21c81a(0x6c)+_0x5280fe);const {journeyId:_0x471df8,parentSegmentId:_0x472b38}=await resolveJourneyIdFromInput(_0x5280fe,_0x2cf45e,_0xf44dc7);if(_0x2cf45e[_0x21c81a(0x66)]){const _0x233efe=getConsoleNextUrl(_0x2cf45e[_0x21c81a(0x75)],'/app/ps/'+_0x472b38+_0x21c81a(0x94)+_0x471df8+_0x21c81a(0xce));return console['error'](a22_0x416fe1[_0x21c81a(0x13c)]('✔')+_0x21c81a(0xfd)+a22_0x416fe1['cyan'](_0x233efe)),openBrowser(_0x233efe),0x0;}const _0x43460f=await withSpinner(_0x21c81a(0x14c),()=>_0xf44dc7[_0x21c81a(0x69)][_0x21c81a(0x14b)](_0x471df8),{'verbose':_0x2cf45e[_0x21c81a(0x7c)]}),_0x39b8ac=_0x43460f[_0x21c81a(0x11d)],_0x22a7b6=_0x2cf45e[_0x21c81a(0xc4)];let _0x5d5af6;if(_0x22a7b6)try{const _0x13d0ef=await withSpinner('Getting\x20journey\x20statistics...',()=>_0xf44dc7[_0x21c81a(0x69)]['getStatistics'](_0x471df8),{'verbose':_0x2cf45e[_0x21c81a(0x7c)]});_0x5d5af6=_0x13d0ef[_0x21c81a(0x11d)];}catch{_0x2cf45e[_0x21c81a(0x7c)]&&console[_0x21c81a(0xd4)]('\x20\x20Statistics\x20not\x20available');}const _0x59017d=getConsoleNextUrl(_0x2cf45e[_0x21c81a(0x75)],'/app/ps/'+_0x472b38+_0x21c81a(0x94)+_0x471df8+_0x21c81a(0xce)),_0x2c957c={'id':_0x39b8ac['id'],'name':_0x39b8ac['attributes'][_0x21c81a(0x161)],'description':_0x39b8ac[_0x21c81a(0x164)][_0x21c81a(0x141)],'state':_0x39b8ac[_0x21c81a(0x164)][_0x21c81a(0xb2)],'paused':_0x39b8ac[_0x21c81a(0x164)]['paused'],'reentry_mode':_0x39b8ac['attributes'][_0x21c81a(0x10d)],'stages':_0x39b8ac[_0x21c81a(0x164)][_0x21c81a(0xbe)]?.[_0x21c81a(0x144)]||0x0,..._0x39b8ac[_0x21c81a(0x164)][_0x21c81a(0x153)]&&{'goal':_0x39b8ac[_0x21c81a(0x164)]['goal']['name']},..._0x5d5af6&&{'statistics':{'size':_0x5d5af6[_0x21c81a(0x13b)],'entered':_0x5d5af6[_0x21c81a(0x90)],'goal_achieved':_0x5d5af6[_0x21c81a(0x87)],'completion_rate':_0x5d5af6[_0x21c81a(0x133)],'exit_or_jump':_0x5d5af6['exitOrJumpSize'],'exit_or_jump_rate':_0x5d5af6[_0x21c81a(0xda)],'stages':_0x5d5af6[_0x21c81a(0xa6)]}},'url':_0x59017d};return await handleSingleObjectOutput(_0x2c957c,_0x2cf45e),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x1027dc(0x161)]=a22_0x1027dc(0xba);[a22_0x1027dc(0x141)]=a22_0x1027dc(0xd0);async[a22_0x1027dc(0x130)](_0x2b04c6){const _0x3cc8ee=a22_0x1027dc,{options:_0x34e2e2,args:_0x4a6767,tdx:_0x2afd3f}=_0x2b04c6,_0x5e6101=_0x4a6767[0x0];if(!requireNameOrPath(_0x5e6101))return 0x1;_0x34e2e2[_0x3cc8ee(0x7c)]&&console[_0x3cc8ee(0xd4)](_0x3cc8ee(0x6c)+_0x5e6101);const _0x5f49e7=_0x34e2e2,_0x47049d=_0x5f49e7[_0x3cc8ee(0xa2)],_0x563e39=_0x5f49e7['to'],_0x6d9c66=_0x5f49e7['includeHistory'],_0x525fe9=_0x5f49e7[_0x3cc8ee(0xc2)];_0x6d9c66&&!_0x47049d&&!_0x563e39&&console[_0x3cc8ee(0xd4)](_0x3cc8ee(0x88));const _0x145820=_0x6d9c66?withJsonFormat(_0x34e2e2):_0x34e2e2,{journeyId:_0x45d706,journeyName:_0x429f46}=await resolveJourneyIdFromInput(_0x5e6101,_0x145820,_0x2afd3f),_0x48ce8c=_0x47049d||_0x563e39?{'from':_0x47049d,'to':_0x563e39}:undefined,_0x4a58fb=await withSpinner(_0x3cc8ee(0x132),()=>Promise[_0x3cc8ee(0x156)]([_0x2afd3f[_0x3cc8ee(0x69)]['getJourney'](_0x45d706),_0x2afd3f[_0x3cc8ee(0x69)][_0x3cc8ee(0x82)](_0x45d706,_0x48ce8c)]),{'verbose':_0x145820[_0x3cc8ee(0x7c)]}),[_0x419816,_0xeda9df]=_0x4a58fb[_0x3cc8ee(0x11d)];if(!_0xeda9df||_0xeda9df[_0x3cc8ee(0x100)]===null)return console[_0x3cc8ee(0xd4)](_0x3cc8ee(0x15c)+_0x429f46),console['error'](_0x3cc8ee(0x135)),0x0;const _0x5925d1=buildStageNameMap(_0x419816),_0x5769c7=!!(_0x48ce8c&&_0xeda9df[_0x3cc8ee(0x142)]?.[_0x3cc8ee(0x144)]),_0x32fb0a={'stageNameMap':_0x5925d1,'hasPeriod':_0x5769c7,'includeHistory':!!_0x6d9c66};if(_0x525fe9&&_0xeda9df['stages']){const _0x23e853=_0xeda9df[_0x3cc8ee(0xa6)][_0x3cc8ee(0x154)](_0x62fb55=>{const _0xd32abb=_0x3cc8ee,_0x3a7321=_0x5925d1[_0xd32abb(0xdd)](_0x62fb55['id'])??'';return _0x3a7321[_0xd32abb(0x9c)]()===_0x525fe9[_0xd32abb(0x9c)]();});if(_0x23e853)return await handleSingleObjectOutput(formatStageStats(_0x23e853,_0x32fb0a),_0x145820),0x0;const _0x5153e4=_0xeda9df[_0x3cc8ee(0xa6)][_0x3cc8ee(0xbd)](_0x5dd824=>_0x5925d1[_0x3cc8ee(0xdd)](_0x5dd824['id'])??_0x5dd824['id']);return console[_0x3cc8ee(0xd4)](_0x3cc8ee(0xd9)+_0x525fe9+_0x3cc8ee(0xf1)),console[_0x3cc8ee(0xd4)](_0x3cc8ee(0x8a)+_0x5153e4['join'](',\x20')),0x1;}const _0x1a70a2=_0xeda9df[_0x3cc8ee(0xa6)]?.['map'](_0x58fd1a=>formatStageStats(_0x58fd1a,_0x32fb0a)),_0x9ac5f8=assembleJourneyStats(_0xeda9df,{'from':_0x47049d,'to':_0x563e39,'includeHistory':_0x6d9c66});return await this['renderStats'](_0x9ac5f8,_0x1a70a2??[],_0x145820),0x0;}async[a22_0x1027dc(0x12c)](_0x2132dc,_0x159dd0,_0xae9bca){const _0xdbe89b=a22_0x1027dc,_0x5ae9c2=_0xae9bca[_0xdbe89b(0x157)]==='json'||_0xae9bca[_0xdbe89b(0x157)]===_0xdbe89b(0x146)||_0xae9bca['json']||_0xae9bca[_0xdbe89b(0x146)];if(_0x5ae9c2){_0x2132dc[_0xdbe89b(0xa6)]=_0x159dd0,await handleSingleObjectOutput(_0x2132dc,_0xae9bca);return;}await handleSingleObjectOutput(_0x2132dc,_0xae9bca);for(const _0x33d9b2 of _0x159dd0){console['log'](''),console['log'](String(a22_0x416fe1[_0xdbe89b(0xd6)][_0xdbe89b(0x15e)]('['+_0x33d9b2[_0xdbe89b(0x161)]+']'))+a22_0x416fe1[_0xdbe89b(0xb4)]('\x20'+_0x33d9b2['id']));const {id:_0x16a99c,name:_0x147266,..._0x897ed1}=_0x33d9b2;await handleSingleObjectOutput(_0x897ed1,_0xae9bca);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a22_0x1027dc(0x115);[a22_0x1027dc(0x141)]=a22_0x1027dc(0x149);async[a22_0x1027dc(0x130)](_0x2707bd){const _0x5ae4a6=a22_0x1027dc,{options:_0x2d5429,args:_0x7904b5,tdx:_0x5c4304}=_0x2707bd,_0x3a0043=_0x7904b5[0x0];if(!requireNameOrPath(_0x3a0043))return 0x1;_0x2d5429[_0x5ae4a6(0x7c)]&&console[_0x5ae4a6(0xd4)](_0x5ae4a6(0x6c)+_0x3a0043);const _0x4edb53=_0x2d5429,_0x42d711=_0x4edb53['type'],_0x2d94df=_0x4edb53[_0x5ae4a6(0xa2)],_0x3efe42=_0x4edb53['to'],_0x568cbe=_0x4edb53[_0x5ae4a6(0xe9)];if(_0x42d711&&_0x42d711!=='conversion'&&_0x42d711!==_0x5ae4a6(0xd7))return console[_0x5ae4a6(0xd4)](_0x5ae4a6(0x13d)+_0x42d711+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x858b86=withJsonFormat(_0x2d5429),{journeyId:_0x4ce491,journeyName:_0x590a11}=await resolveJourneyIdFromInput(_0x3a0043,_0x858b86,_0x5c4304),_0x3bfe30={'type':_0x42d711,'from':_0x2d94df,'to':_0x3efe42,'limit':_0x568cbe},_0x58f407=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x5c4304[_0x5ae4a6(0x69)][_0x5ae4a6(0xf4)](_0x4ce491,_0x3bfe30),{'verbose':_0x858b86[_0x5ae4a6(0x7c)]}),_0x3ef314=_0x58f407[_0x5ae4a6(0x11d)],_0x3a84e6=_0x3ef314[_0x5ae4a6(0xf3)]&&(_0x3ef314['conversion']['nodes'][_0x5ae4a6(0x144)]>0x0||_0x3ef314['conversion'][_0x5ae4a6(0x128)][_0x5ae4a6(0x144)]>0x0),_0xe4a404=_0x3ef314[_0x5ae4a6(0xd7)]&&_0x3ef314[_0x5ae4a6(0xd7)][_0x5ae4a6(0x144)]>0x0;if(!_0x3a84e6&&!_0xe4a404)return console[_0x5ae4a6(0xd4)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x590a11),console[_0x5ae4a6(0xd4)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x2d94df&&_0x3efe42&&console[_0x5ae4a6(0xd4)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x3ef314,_0x858b86),0x0;}}function formatStageStats(_0x4e9e13,_0x20cb40){const _0x3b31b4=a22_0x1027dc,_0x4516e1=_0x20cb40[_0x3b31b4(0x131)]&&_0x4e9e13[_0x3b31b4(0x142)]?.['length']?aggregateStageHistory(_0x4e9e13[_0x3b31b4(0x142)]):{'size':_0x4e9e13[_0x3b31b4(0x13b)],'entered':_0x4e9e13[_0x3b31b4(0x90)],'milestone':_0x4e9e13[_0x3b31b4(0x8b)],'milestone_rate':_0x4e9e13[_0x3b31b4(0x13f)],'exit_or_jump':_0x4e9e13[_0x3b31b4(0xc5)],'exit_or_jump_rate':_0x4e9e13[_0x3b31b4(0xda)]},_0x3dad72={'id':_0x4e9e13['id'],'name':_0x20cb40[_0x3b31b4(0xa5)][_0x3b31b4(0xdd)](_0x4e9e13['id'])??_0x4e9e13['id'],..._0x4516e1};return _0x20cb40['hasPeriod']&&_0x20cb40[_0x3b31b4(0x151)]&&_0x4e9e13['history']&&(_0x3dad72['history']=_0x4e9e13[_0x3b31b4(0x142)]),_0x3dad72;}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a22_0x1027dc(0x141)]=a22_0x1027dc(0x73);async[a22_0x1027dc(0x130)](_0x11eebb){const _0x2e4c6e=a22_0x1027dc,{options:_0x2fe684,args:_0x3f5bd7,tdx:_0x11efe1}=_0x11eebb,_0x976bce=_0x3f5bd7[0x0];if(!requireNameOrPath(_0x976bce))return 0x1;_0x2fe684[_0x2e4c6e(0x7c)]&&console[_0x2e4c6e(0xd4)](_0x2e4c6e(0x6c)+_0x976bce);const {journeyId:_0x2fbd7c,journeyName:_0x26a054}=await resolveJourneyIdFromInput(_0x976bce,_0x2fe684,_0x11efe1);if(!_0x2fe684[_0x2e4c6e(0xec)]){const _0x1a7748=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x26a054+'\x22?');if(!_0x1a7748)return console[_0x2e4c6e(0xd4)]('Cancelled'),0x0;}const _0x2839e5=await withSpinner(_0x2e4c6e(0x162),()=>_0x11efe1[_0x2e4c6e(0x69)][_0x2e4c6e(0xd1)](_0x2fbd7c),{'verbose':_0x2fe684[_0x2e4c6e(0x7c)]}),_0x3e0305=_0x2839e5[_0x2e4c6e(0x11d)];return console[_0x2e4c6e(0xd4)]('✔\x20Journey\x20\x22'+_0x3e0305['attributes'][_0x2e4c6e(0x161)]+_0x2e4c6e(0xe4)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a22_0x1027dc(0x161)]=a22_0x1027dc(0xa1);[a22_0x1027dc(0x141)]='Resume\x20a\x20paused\x20journey';async['execute'](_0x4776d0){const _0x19447e=a22_0x1027dc,{options:_0x51e08a,args:_0x19ba62,tdx:_0x1491f5}=_0x4776d0,_0x58c652=_0x19ba62[0x0];if(!requireNameOrPath(_0x58c652))return 0x1;_0x51e08a['verbose']&&console['error'](_0x19447e(0x6c)+_0x58c652);const {journeyId:_0x25ac6a,journeyName:_0x1abb7b}=await resolveJourneyIdFromInput(_0x58c652,_0x51e08a,_0x1491f5);if(!_0x51e08a['yes']){const _0x9fe9c5=await confirm(_0x19447e(0x7d)+_0x1abb7b+'\x22?');if(!_0x9fe9c5)return console[_0x19447e(0xd4)](_0x19447e(0x10f)),0x0;}const _0x3083b8=await withSpinner('Resuming\x20journey...',()=>_0x1491f5[_0x19447e(0x69)][_0x19447e(0xb1)](_0x25ac6a),{'verbose':_0x51e08a[_0x19447e(0x7c)]}),_0x589213=_0x3083b8['data'];return console[_0x19447e(0xd4)]('✔\x20Journey\x20\x22'+_0x589213[_0x19447e(0x164)][_0x19447e(0x161)]+_0x19447e(0xcd)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x1027dc(0x161)]='journey:pull';[a22_0x1027dc(0x141)]=a22_0x1027dc(0x111);async[a22_0x1027dc(0x130)](_0x4dca59){const _0x5b21b9=a22_0x1027dc,{options:_0x35bd8b,args:_0xfc2e40,tdx:_0x338d1c}=_0x4dca59,_0x3c2009=_0x35bd8b,_0x2e979c=_0xfc2e40[0x0],_0x3f3793=_0x2e979c&&isYamlFilePath(_0x2e979c),_0x4ada34=await resolveTarget({'arg':_0x3f3793?_0x2e979c:undefined,'contextParent':_0x35bd8b[_0x5b21b9(0xbc)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4ada34))return _0x4ada34[_0x5b21b9(0x13a)]==='no_parent'?(console[_0x5b21b9(0xd4)](a22_0x416fe1[_0x5b21b9(0xf8)](_0x5b21b9(0xa8))),console['error']('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x5b21b9(0xd4)](_0x5b21b9(0x11c)),console['error'](_0x5b21b9(0xa3)),console[_0x5b21b9(0xd4)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a22_0x416fe1[_0x5b21b9(0x14e)]('Error:\x20'+_0x4ada34[_0x5b21b9(0x6d)]+'\x0a')),_0x4ada34['helpText']&&console[_0x5b21b9(0xd4)](a22_0x416fe1[_0x5b21b9(0xd6)](_0x4ada34[_0x5b21b9(0x159)]))),0x1;let _0x500b0b=_0x3f3793?undefined:_0x2e979c,_0x11ac90,_0x50cc01;_0x4ada34[_0x5b21b9(0xfb)]==='file'&&(_0x500b0b=_0x4ada34[_0x5b21b9(0xe6)],_0x11ac90=_0x4ada34['filePath'],_0x50cc01=_0x4ada34['folderPath']);const _0x200e65=_0x4ada34[_0x5b21b9(0xca)],_0x3766cf=_0x4ada34['targetDir'];_0x3c2009[_0x5b21b9(0x7c)]&&(console[_0x5b21b9(0xd4)]('Parent\x20segment:\x20'+_0x200e65),console[_0x5b21b9(0xd4)](_0x5b21b9(0xc0)+_0x3766cf),_0x500b0b&&console['error']('Journey\x20name:\x20'+_0x500b0b),_0x11ac90&&console[_0x5b21b9(0xd4)](_0x5b21b9(0xea)+_0x11ac90),_0x50cc01&&console[_0x5b21b9(0xd4)](_0x5b21b9(0xc3)+_0x50cc01));const _0x453020=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x338d1c[_0x5b21b9(0x104)][_0x5b21b9(0xa4)](_0x200e65),{'verbose':_0x35bd8b[_0x5b21b9(0x7c)]}),_0x233818=_0x453020[_0x5b21b9(0x11d)],{journeys:_0x45ac89,folders:_0x3865da}=await withSpinner(_0x5b21b9(0xdc),async()=>{const _0x2b7ad7=_0x5b21b9,[_0x2f2af0,_0x187dca]=await Promise[_0x2b7ad7(0x156)]([_0x338d1c[_0x2b7ad7(0x69)][_0x2b7ad7(0x8f)](_0x233818,undefined,{'includeAllVersions':!![]}),_0x338d1c[_0x2b7ad7(0x104)][_0x2b7ad7(0x12a)](_0x233818)]);return{'journeys':_0x2f2af0,'folders':_0x187dca};},{'verbose':_0x35bd8b[_0x5b21b9(0x7c)]})[_0x5b21b9(0xe7)](_0x34fd88=>_0x34fd88['data']);let _0xab44f1=_0x45ac89;const _0x4918d7=buildFolderIdToPathMap(_0x3865da);if(_0x500b0b){const _0x1db574=_0xab44f1[_0x5b21b9(0x116)](_0x25dbbd=>_0x25dbbd['journeyBundleName'][_0x5b21b9(0x9c)]()===_0x500b0b[_0x5b21b9(0x9c)]());if(_0x1db574[_0x5b21b9(0x144)]===0x0)return console[_0x5b21b9(0xd4)](_0x5b21b9(0x6b)+_0x500b0b),console[_0x5b21b9(0xd4)](_0x5b21b9(0xd2)),0x1;_0xab44f1=_0x1db574;}if(_0x50cc01!==undefined){const _0xfeec97=_0xab44f1[_0x5b21b9(0x116)](_0x106720=>{const _0x1082d8=_0x5b21b9,_0x31fd93=_0x106720[_0x1082d8(0x106)]?_0x4918d7['get'](_0x106720[_0x1082d8(0x106)])||'':'';return _0x31fd93===_0x50cc01;});if(_0xfeec97[_0x5b21b9(0x144)]===0x0&&_0xab44f1[_0x5b21b9(0x144)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x500b0b+_0x5b21b9(0x124)+(_0x50cc01||_0x5b21b9(0x67))),console[_0x5b21b9(0xd4)](_0x5b21b9(0xe5));for(const _0xe47d64 of _0xab44f1){const _0x1b1407=_0xe47d64['folderId']?_0x4918d7[_0x5b21b9(0xdd)](_0xe47d64[_0x5b21b9(0x106)])||'':'';console[_0x5b21b9(0xd4)](_0x5b21b9(0x137)+(_0x1b1407||_0x5b21b9(0x11f))+'/'+_0xe47d64[_0x5b21b9(0x11a)]);}return 0x1;}_0xab44f1=_0xfeec97;}if(_0xab44f1[_0x5b21b9(0x144)]===0x0)return console['error']('No\x20journeys\x20found'),0x0;const _0x7b800c=new Map();for(const _0x5b2cbf of _0xab44f1){const _0x5638a5=_0x5b2cbf[_0x5b21b9(0xee)];!_0x7b800c[_0x5b21b9(0x15f)](_0x5638a5)&&_0x7b800c[_0x5b21b9(0x64)](_0x5638a5,[]),_0x7b800c[_0x5b21b9(0xdd)](_0x5638a5)[_0x5b21b9(0xe3)](_0x5b2cbf);}for(const _0x179c53 of _0x7b800c[_0x5b21b9(0xc7)]()){_0x179c53[_0x5b21b9(0xc6)]((_0x4391a9,_0x5d16ca)=>(_0x4391a9[_0x5b21b9(0x102)]||0x0)-(_0x5d16ca['versionNumber']||0x0));}const _0x2a35ce=[],{idToEmailMap:_0x42814f,connectionIdToNameMap:_0x5bfd88}=await withSpinner(_0x5b21b9(0xfe),async()=>{const _0x4deccc=_0x5b21b9,[_0x17a1d6,_0x1f4b9d]=await Promise[_0x4deccc(0x156)]([_0x338d1c['user']['buildIdToEmailMap'](),_0x338d1c[_0x4deccc(0x8d)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x17a1d6,'connectionIdToNameMap':_0x1f4b9d};},{'verbose':_0x35bd8b[_0x5b21b9(0x7c)]})[_0x5b21b9(0xe7)](_0x56e694=>_0x56e694[_0x5b21b9(0x11d)]);for(const _0x462378 of _0x7b800c['values']()){const _0x496b67=_0x462378[0x0][_0x5b21b9(0x11a)],_0x5bf938=_0x462378[0x0][_0x5b21b9(0x106)],_0x3ad38e=_0x5bf938?_0x4918d7['get'](_0x5bf938)||'':'',_0x13b101=_0x3ad38e?a22_0x1cd360[_0x5b21b9(0x15d)](_0x3766cf,_0x3ad38e):_0x3766cf,_0x1da9a7=_0x11ac90||a22_0x1cd360[_0x5b21b9(0x15d)](_0x13b101,sanitizeFileName(_0x496b67)+_0x5b21b9(0x92));let _0x1342cc,_0x26c242;if(existsSync(_0x1da9a7))try{const _0x3c973a=readFileSync(_0x1da9a7,'utf-8'),_0x136977=parseYamlString(_0x3c973a);_0x26c242=_0x136977,_0x1342cc=buildRuleToNameMapping(_0x136977),_0x3c2009['verbose']&&_0x1342cc[_0x5b21b9(0x13b)]>0x0&&console[_0x5b21b9(0xd4)](_0x5b21b9(0x143)+_0x1342cc[_0x5b21b9(0x13b)]+_0x5b21b9(0x122)+_0x496b67);}catch(_0x592ce2){_0x3c2009[_0x5b21b9(0x7c)]&&console[_0x5b21b9(0xd4)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x592ce2['message']);}const _0x33169a=[],_0x3fe74c=new Set(),_0x107835=new Map(),_0x59f41c=new Map(),_0x10c73e=new Set(),_0x138447=new Map(),_0x2fcb93=new Map(),_0x32548d=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x496b67+_0x5b21b9(0x12d),async _0x2e3aed=>{const _0x222d18=_0x5b21b9;for(const _0x515c49 of _0x462378){const _0x2653fd=_0x462378[_0x222d18(0x144)]>0x1?_0x515c49[_0x222d18(0x11a)]+'\x20v'+(_0x515c49['versionNumber']||0x1):_0x515c49['journeyBundleName'];_0x2e3aed[_0x222d18(0x8c)](_0x222d18(0x138)+_0x2653fd);const _0xb35b2b=await _0x338d1c[_0x222d18(0x69)][_0x222d18(0x14b)](_0x515c49['id']),_0x4485d4=_0xb35b2b[_0x222d18(0x164)]?.[_0x222d18(0x127)],_0x4b44a4={'resolveSegment':async _0x37f983=>{const _0x15bb5f=_0x222d18;if(!_0x4485d4)return{'name':_0x37f983,'isJourneyLocal':![]};const _0x16ac65=_0x107835[_0x15bb5f(0xdd)](_0x37f983);if(_0x16ac65)return _0x16ac65;try{const _0x1417a8=await _0x338d1c[_0x15bb5f(0x104)][_0x15bb5f(0x96)](_0x4485d4,_0x37f983),_0xb5ef42=_0x1417a8[_0x15bb5f(0x107)]===SEGMENT_KIND_JOURNEY;let _0x12eb0e,_0x2830a0=_0x1417a8[_0x15bb5f(0x161)];if(_0xb5ef42&&_0x1417a8[_0x15bb5f(0xf2)]){const _0x537612=await segmentResponseToDef(_0x1417a8,{'resolveSegmentName':async _0x41913e=>{const _0x287419=_0x15bb5f,_0x11ef20=_0x107835['get'](_0x41913e);if(_0x11ef20)return _0x11ef20[_0x287419(0x161)];const _0x12f49e=await _0x4b44a4[_0x287419(0xe8)](_0x41913e);return _0x12f49e['name'];}}),_0x380f10=_0x537612[_0x15bb5f(0xf2)];_0x12eb0e={'description':_0x1417a8[_0x15bb5f(0x141)],'rule':_0x380f10};const _0xa734b8=serializeRule(_0x380f10),_0x5985ec=_0x59f41c['get'](_0xa734b8);if(_0x5985ec)_0x2830a0=_0x5985ec,_0x12eb0e=undefined,_0x3c2009['verbose']&&console[_0x15bb5f(0xd4)](_0x15bb5f(0x79)+_0x1417a8[_0x15bb5f(0x161)]+_0x15bb5f(0xa0)+_0x5985ec);else{let _0x1896a5=![];if(_0x1342cc){const _0x1f41c0=_0x1342cc[_0x15bb5f(0xdd)](_0xa734b8);if(_0x1f41c0){const _0x223f38=_0x1f41c0[_0x15bb5f(0x154)](_0x3baf9b=>!_0x3fe74c['has'](_0x3baf9b));_0x223f38&&(_0x2830a0=_0x223f38,_0x3fe74c['add'](_0x223f38),_0x59f41c[_0x15bb5f(0x64)](_0xa734b8,_0x223f38),_0x1896a5=!![],_0x3c2009['verbose']&&console[_0x15bb5f(0xd4)](_0x15bb5f(0xe1)+_0x223f38+_0x15bb5f(0x119)));}}if(!_0x1896a5){const _0xe4f32f=generateJourneyLocalName(_0x1417a8[_0x15bb5f(0x161)]);_0xe4f32f&&(_0x2830a0=_0xe4f32f);let _0x415e2c=_0x2830a0,_0x33c8f8=0x2;while(_0x3fe74c['has'](_0x415e2c)){_0x415e2c=_0x2830a0+'_'+_0x33c8f8,_0x33c8f8++;}_0x3fe74c[_0x15bb5f(0x12f)](_0x415e2c),_0x59f41c[_0x15bb5f(0x64)](_0xa734b8,_0x415e2c),_0x2830a0=_0x415e2c;}}}const _0x1cbcef={'name':_0x2830a0,'isJourneyLocal':_0xb5ef42,'definition':_0x12eb0e};return _0x107835[_0x15bb5f(0x64)](_0x37f983,_0x1cbcef),_0x1cbcef;}catch(_0x1db649){return _0x35bd8b[_0x15bb5f(0x7c)]&&console['error'](_0x15bb5f(0x129)+_0x37f983+':\x20'+_0x1db649['message']),{'name':_0x37f983,'isJourneyLocal':![]};}},'resolveActivation':async _0x906cf6=>{const _0x1ebce4=_0x222d18,_0x3c1c36=_0x138447[_0x1ebce4(0xdd)](_0x906cf6);if(_0x3c1c36)return _0x3c1c36;try{const _0x1a169b=await _0x338d1c[_0x1ebce4(0x69)][_0x1ebce4(0xac)](_0x515c49['id'],_0x906cf6),_0x240631=journeyActivationStepToYaml(_0x1a169b,_0x42814f,_0x5bfd88),_0x5be30a=JSON['stringify']({'name':_0x240631['name'],'connection':_0x240631[_0x1ebce4(0x8d)],'connector_config':_0x240631[_0x1ebce4(0x7b)]}),_0x53acc9=_0x2fcb93[_0x1ebce4(0xdd)](_0x5be30a);if(_0x53acc9){const _0x3568ad={'name':_0x53acc9,'isJourneyLocal':!![],'definition':_0x240631};return _0x138447[_0x1ebce4(0x64)](_0x906cf6,_0x3568ad),_0x3568ad;}const _0xbcf492=_0x1a169b[_0x1ebce4(0x164)][_0x1ebce4(0xb8)]['name']||_0x906cf6,_0x3525e7=sanitizeYamlKey(_0xbcf492)||'activation_'+_0x906cf6;let _0x5a7f9b=_0x3525e7,_0xa60cc8=0x2;while(_0x10c73e[_0x1ebce4(0x15f)](_0x5a7f9b)){_0x5a7f9b=_0x3525e7+'_'+_0xa60cc8,_0xa60cc8++;}_0x10c73e[_0x1ebce4(0x12f)](_0x5a7f9b),_0x2fcb93[_0x1ebce4(0x64)](_0x5be30a,_0x5a7f9b);const _0x1dc9c8={'name':_0x5a7f9b,'isJourneyLocal':!![],'definition':_0x240631};return _0x138447[_0x1ebce4(0x64)](_0x906cf6,_0x1dc9c8),_0x1dc9c8;}catch(_0xe09046){return _0x35bd8b[_0x1ebce4(0x7c)]&&console[_0x1ebce4(0xd4)](_0x1ebce4(0x14d)+_0x906cf6+':\x20'+_0xe09046[_0x1ebce4(0x6d)]),{'name':_0x906cf6,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x136e70,_0x56576d)=>{const _0x327ba1=_0x222d18;return resolveJumpTarget(_0x136e70,_0x56576d,_0x32548d,_0x118884=>_0x338d1c[_0x327ba1(0x69)][_0x327ba1(0x14b)](_0x118884));}},_0x1e069d=await journeyResponseToDef(_0xb35b2b,_0x4b44a4);_0x33169a[_0x222d18(0xe3)]({'item':_0x515c49,'yaml':_0x1e069d});}},{'verbose':_0x35bd8b[_0x5b21b9(0x7c)]});const _0x2b4335=await _0x338d1c[_0x5b21b9(0x69)][_0x5b21b9(0x134)](_0x462378[0x0][_0x5b21b9(0xee)]),_0x217bee=buildMergedJourneyDef(_0x33169a,_0x1342cc,_0x2b4335),_0x2fe45c=normalizeJourneyDef(_0x217bee,_0x26c242),_0x1adb95=toYamlString(_0x2fe45c),_0x453a5d=_0x11ac90||a22_0x1cd360['join'](_0x13b101,sanitizeFileName(_0x496b67)+_0x5b21b9(0x92));!_0x11ac90&&_0x3ad38e&&!existsSync(_0x13b101)&&mkdirSync(_0x13b101,{'recursive':!![]});const _0x380c5e=a22_0x1cd360[_0x5b21b9(0xb7)](process[_0x5b21b9(0xc8)](),_0x453a5d);if(existsSync(_0x453a5d)){const _0x3506cc=readFileSync(_0x453a5d,_0x5b21b9(0x95)),_0x324b3d=generateDiff(_0x3506cc,_0x1adb95),_0x301ec7=hasChanges(_0x324b3d);_0x2a35ce[_0x5b21b9(0xe3)]({'relativePath':_0x380c5e,'absolutePath':_0x453a5d,'content':_0x1adb95,'isNew':![],'hasChanges':_0x301ec7,'diff':_0x301ec7?formatDiffWithColors(_0x324b3d):undefined});}else _0x2a35ce['push']({'relativePath':_0x380c5e,'absolutePath':_0x453a5d,'content':_0x1adb95,'isNew':!![],'hasChanges':![]});}const _0xc08dec=_0x2a35ce[_0x5b21b9(0x116)](_0x39f5a2=>_0x39f5a2[_0x5b21b9(0xff)]),_0x26f839=_0x2a35ce['filter'](_0x57f1b3=>!_0x57f1b3[_0x5b21b9(0xff)]&&_0x57f1b3[_0x5b21b9(0x140)]),_0x2418fc=_0x2a35ce[_0x5b21b9(0x116)](_0x5f0937=>!_0x5f0937['isNew']&&!_0x5f0937['hasChanges']),_0x1d5faf=_0xab44f1[_0x5b21b9(0x144)],_0xd53171=_0x7b800c[_0x5b21b9(0x13b)],_0x1fc9fd=_0x1d5faf>_0xd53171?'\x20('+_0x1d5faf+_0x5b21b9(0x65):'';console[_0x5b21b9(0xd4)](_0x5b21b9(0x15b)),console[_0x5b21b9(0xd4)]('\x20\x20'+a22_0x416fe1[_0x5b21b9(0xd6)](_0xd53171+'\x20journeys')+a22_0x416fe1['dim'](_0x1fc9fd)),console[_0x5b21b9(0xd4)]('\x20\x20'+a22_0x416fe1[_0x5b21b9(0x13c)]('+\x20'+_0xc08dec[_0x5b21b9(0x144)]+'\x20new\x20files')),console[_0x5b21b9(0xd4)]('\x20\x20'+a22_0x416fe1[_0x5b21b9(0xf8)]('~\x20'+_0x26f839[_0x5b21b9(0x144)]+'\x20changed\x20files')),console['error']('\x20\x20'+a22_0x416fe1[_0x5b21b9(0xb4)]('=\x20'+_0x2418fc[_0x5b21b9(0x144)]+_0x5b21b9(0xa7))),console[_0x5b21b9(0xd4)]('\x20\x20Target:\x20'+a22_0x416fe1[_0x5b21b9(0xd6)](_0x3766cf)+'\x0a');if(_0x26f839[_0x5b21b9(0x144)]>0x0)for(const _0x36792d of _0x26f839){console['error'](_0x5b21b9(0xcc)+_0x36792d[_0x5b21b9(0xbb)]+'\x27:'),console['error']('─'[_0x5b21b9(0x74)](0x3c)),console[_0x5b21b9(0xd4)](_0x36792d[_0x5b21b9(0xde)]),console['error']('─'['repeat'](0x3c));}if(_0x3c2009['dryRun'])return console[_0x5b21b9(0xd4)](a22_0x416fe1['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xc08dec[_0x5b21b9(0x144)]===0x0&&_0x26f839[_0x5b21b9(0x144)]===0x0)return console[_0x5b21b9(0xd4)](a22_0x416fe1[_0x5b21b9(0x13c)](_0x5b21b9(0xfc))),saveSessionContext({'parent_segment':_0x200e65},_0x3c2009[_0x5b21b9(0xb3)]),console[_0x5b21b9(0xd4)](a22_0x416fe1[_0x5b21b9(0x13c)]('✔\x20Context\x20set:\x20'+a22_0x416fe1['dim']('parent_segment')+'\x20=\x20'+a22_0x416fe1['cyan'](_0x200e65))),0x0;if(!_0x3c2009[_0x5b21b9(0xec)]&&(_0xc08dec['length']>0x0||_0x26f839[_0x5b21b9(0x144)]>0x0)){if(!isInteractive())return console[_0x5b21b9(0xd4)](a22_0x416fe1[_0x5b21b9(0x14e)](_0x5b21b9(0xc1)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5b21b9(0xd4)](a22_0x416fe1[_0x5b21b9(0xb4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x10175d=await confirmKey(_0x5b21b9(0x152)+(_0xc08dec['length']+_0x26f839[_0x5b21b9(0x144)])+_0x5b21b9(0x91));if(!_0x10175d)return console[_0x5b21b9(0xd4)](a22_0x416fe1[_0x5b21b9(0xf8)]('Aborted.'),_0x5b21b9(0xb5)),0x1;}!existsSync(_0x3766cf)&&mkdirSync(_0x3766cf,{'recursive':!![]});const _0x236b7d=a22_0x1cd360['join'](_0x3766cf,_0x5b21b9(0xdb));writeFileSync(_0x236b7d,createTdxConfigContent(_0x200e65),'utf-8');for(const _0x2e4f57 of _0x2a35ce){(_0x2e4f57[_0x5b21b9(0xff)]||_0x2e4f57[_0x5b21b9(0x140)])&&writeFileSync(_0x2e4f57['absolutePath'],_0x2e4f57[_0x5b21b9(0x139)],'utf-8');}return console['error'](a22_0x416fe1['green']('✔\x20Pulled\x20'+(_0xc08dec['length']+_0x26f839[_0x5b21b9(0x144)])+_0x5b21b9(0x147)+_0x3766cf)),saveSessionContext({'parent_segment':_0x200e65},_0x3c2009[_0x5b21b9(0xb3)]),console[_0x5b21b9(0xd4)](a22_0x416fe1[_0x5b21b9(0x13c)](_0x5b21b9(0x110)+a22_0x416fe1[_0x5b21b9(0xb4)](_0x5b21b9(0x9d))+_0x5b21b9(0x9e)+a22_0x416fe1['cyan'](_0x200e65))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x1027dc(0x161)]=a22_0x1027dc(0x76);[a22_0x1027dc(0x141)]=a22_0x1027dc(0x98);async[a22_0x1027dc(0x130)](_0x20f36a){const _0x62cf7e=a22_0x1027dc,{options:_0x3a5259,args:_0x36968f,tdx:_0x186fe6}=_0x20f36a,_0xc30b71=_0x36968f[0x0];if(!requireNameOrPath(_0xc30b71))return 0x1;_0x3a5259['verbose']&&console[_0x62cf7e(0xd4)](_0x62cf7e(0x6c)+_0xc30b71);const {journeyId:_0x48fb5c}=await resolveJourneyIdFromInput(_0xc30b71,_0x3a5259,_0x186fe6),_0x9c4373=await withSpinner('Getting\x20column\x20mapping...',()=>_0x186fe6['journey'][_0x62cf7e(0xb6)](_0x48fb5c),{'verbose':_0x3a5259[_0x62cf7e(0x7c)]}),_0x3762ab=_0x9c4373[_0x62cf7e(0x11d)];return console[_0x62cf7e(0x114)](_0x62cf7e(0xad)+_0x3762ab[_0x62cf7e(0x163)]),console[_0x62cf7e(0x114)](_0x62cf7e(0x9f)+_0x3762ab[_0x62cf7e(0x70)]),await handleSDKOutput(_0x3762ab['columns'],_0x3a5259),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a22_0x1027dc(0x161)]=a22_0x1027dc(0x83);['description']='List\x20activations\x20for\x20a\x20journey';async[a22_0x1027dc(0x130)](_0x51210b){const _0x3a994a=a22_0x1027dc,{options:_0x497823,args:_0x42c580,tdx:_0x38d6c0}=_0x51210b,_0x267909=_0x42c580[0x0];if(!requireNameOrPath(_0x267909))return 0x1;_0x497823[_0x3a994a(0x7c)]&&console['error'](_0x3a994a(0x6c)+_0x267909);const {journeyId:_0x38547b}=await resolveJourneyIdFromInput(_0x267909,_0x497823,_0x38d6c0),_0x5dfdbf=await withSpinner(_0x3a994a(0xd3),()=>_0x38d6c0['journey'][_0x3a994a(0x7a)](_0x38547b),{'verbose':_0x497823[_0x3a994a(0x7c)]}),_0x37b090=_0x5dfdbf[_0x3a994a(0x11d)];return console[_0x3a994a(0xd4)](_0x3a994a(0x143)+_0x37b090['length']+_0x3a994a(0xf5)+(_0x37b090[_0x3a994a(0x144)]!==0x1?'s':'')),await handleSDKOutput(_0x37b090,_0x497823),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x1027dc(0x161)]='journey:push';[a22_0x1027dc(0x141)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';['segmentPushCommand']=new SegmentPushCommand();async[a22_0x1027dc(0x130)](_0x3567d5){const _0x43d8b5=a22_0x1027dc,_0x5d33e6=_0x3567d5[_0x43d8b5(0x11b)][0x0];let _0x1724f1;if(_0x5d33e6){const _0x50db09=await resolveTarget({'arg':_0x5d33e6,'contextParent':_0x3567d5['options']['parentSegment'],'cwd':process[_0x43d8b5(0xc8)]()});isSuccessfulResolution(_0x50db09)&&_0x50db09[_0x43d8b5(0xfb)]===_0x43d8b5(0xe2)&&(_0x1724f1=_0x50db09['filePath']);}const _0x1c87fb={..._0x3567d5,'options':{..._0x3567d5[_0x43d8b5(0x14f)],'journeysOnly':!![],..._0x1724f1&&{'singleFilePath':_0x1724f1}}};return this[_0x43d8b5(0x93)][_0x43d8b5(0x130)](_0x1c87fb);}}export class JourneyVersionsCommand extends BaseCommand{[a22_0x1027dc(0x161)]=a22_0x1027dc(0x155);[a22_0x1027dc(0x141)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a22_0x1027dc(0x130)](_0x213fad){const _0x4d56f5=a22_0x1027dc,{options:_0x5337e7,args:_0x50e3df,tdx:_0x3e4bd1}=_0x213fad,_0x490b96=_0x50e3df[0x0];if(!requireNameOrPath(_0x490b96))return 0x1;if(_0x5337e7['verbose'])console[_0x4d56f5(0xd4)](_0x4d56f5(0x6c)+_0x490b96);const {journeyId:_0x161158}=await resolveJourneyIdFromInput(_0x490b96,_0x5337e7,_0x3e4bd1),_0x57c510=await withSpinner(_0x4d56f5(0xe0),()=>_0x3e4bd1['journey']['listVersions'](_0x161158),{'verbose':_0x5337e7[_0x4d56f5(0x7c)]}),{bundleName:_0x5631c9,versions:_0x5d5045,latestJourneyId:_0x325338}=_0x57c510[_0x4d56f5(0x11d)];console[_0x4d56f5(0xd4)](_0x5631c9+':\x20'+_0x5d5045[_0x4d56f5(0x144)]+'\x20version'+(_0x5d5045[_0x4d56f5(0x144)]!==0x1?'s':''));const _0x119b31=_0x5d5045[_0x4d56f5(0xbd)](_0x5099a3=>({'version':_0x5099a3[_0x4d56f5(0x102)],'journey_id':_0x5099a3[_0x4d56f5(0x100)],'name':_0x5099a3[_0x4d56f5(0x161)],'state':_0x5099a3[_0x4d56f5(0xb2)],'paused':_0x5099a3['paused'],'latest':_0x5099a3[_0x4d56f5(0x100)]===_0x325338,'created_at':_0x5099a3[_0x4d56f5(0x136)]}));return await handleSDKOutput(_0x119b31,_0x5337e7),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a22_0x1027dc(0xaa);[a22_0x1027dc(0x141)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x1027dc(0x130)](_0x5447f0){const _0x30f104=a22_0x1027dc,{options:_0x2aa9ae,args:_0x1bd305,tdx:_0x4dad8d}=_0x5447f0,_0x1e9459=_0x1bd305[0x0];if(!requireNameOrPath(_0x1e9459))return 0x1;if(_0x2aa9ae[_0x30f104(0x7c)])console[_0x30f104(0xd4)]('Input:\x20'+_0x1e9459);const {journeyId:_0x29901a,journeyName:_0xfba59d}=await resolveJourneyIdFromInput(_0x1e9459,_0x2aa9ae,_0x4dad8d);if(!_0x2aa9ae['yes']){const _0x1388aa=await confirm(_0x30f104(0xf6)+_0xfba59d+'\x22?');if(!_0x1388aa)return console['error']('Cancelled'),0x0;}const _0x18583a=await withSpinner(_0x30f104(0xf0),()=>_0x4dad8d[_0x30f104(0x69)]['createVersion'](_0x29901a),{'verbose':_0x2aa9ae[_0x30f104(0x7c)]}),_0x3374fb=_0x18583a[_0x30f104(0x11d)];return console[_0x30f104(0xd4)](a22_0x416fe1[_0x30f104(0x13c)]('✔')+_0x30f104(0x89)+_0x3374fb[_0x30f104(0x164)][_0x30f104(0x102)]+_0x30f104(0x15a)+_0x3374fb[_0x30f104(0x164)][_0x30f104(0x161)]+'\x22'),console[_0x30f104(0xd4)](_0x30f104(0xb9)+_0x3374fb['id']),await handleSingleObjectOutput({'id':_0x3374fb['id'],'name':_0x3374fb[_0x30f104(0x164)]['name'],'version':_0x3374fb[_0x30f104(0x164)][_0x30f104(0x102)],'state':_0x3374fb[_0x30f104(0x164)][_0x30f104(0xb2)],'bundle_id':_0x3374fb[_0x30f104(0x164)][_0x30f104(0xee)],'created_at':_0x3374fb[_0x30f104(0x164)]['createdAt']},_0x2aa9ae),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a22_0x1027dc(0xcf);['description']=a22_0x1027dc(0x72);async['execute'](_0x19eb1b){const _0x39d67a=a22_0x1027dc,{options:_0x485832,args:_0x34ca98,tdx:_0x47b11d}=_0x19eb1b,_0x29fbf8=_0x34ca98[0x0];if(!requireNameOrPath(_0x29fbf8))return 0x1;const _0x20b402=_0x485832[_0x39d67a(0x7f)];if(!_0x20b402)return console[_0x39d67a(0xd4)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x39d67a(0xd4)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x85ade9=parseInt(_0x20b402,0xa);if(isNaN(_0x85ade9)||_0x85ade9<0x1)return console['error'](_0x39d67a(0x6e)+_0x20b402),0x1;if(_0x485832[_0x39d67a(0x7c)])console['error'](_0x39d67a(0x6c)+_0x29fbf8+',\x20version:\x20'+_0x85ade9);const {journeyId:_0x225d70,parentSegmentId:_0x3eb825}=await resolveJourneyIdFromInput(_0x29fbf8,_0x485832,_0x47b11d),_0x1153c7=await withSpinner('Resolving\x20version...',()=>_0x47b11d[_0x39d67a(0x69)][_0x39d67a(0xdf)](_0x225d70),{'verbose':_0x485832['verbose']}),{versions:_0x5c68e4,latestJourneyId:_0x4e42d4}=_0x1153c7[_0x39d67a(0x11d)],_0x451907=_0x5c68e4[_0x39d67a(0x154)](_0x3afa31=>_0x3afa31['versionNumber']===_0x85ade9);if(!_0x451907){const _0x5aed4b=_0x5c68e4[_0x39d67a(0xbd)](_0x43b95e=>'v'+_0x43b95e[_0x39d67a(0x102)])['join'](',\x20');return console[_0x39d67a(0xd4)]('Error:\x20Version\x20'+_0x85ade9+'\x20not\x20found.\x20Available:\x20'+_0x5aed4b),0x1;}const _0x4998c8=await withSpinner(_0x39d67a(0xd8)+_0x85ade9+_0x39d67a(0x125),()=>_0x47b11d[_0x39d67a(0x69)]['getJourney'](_0x451907[_0x39d67a(0x100)]),{'verbose':_0x485832[_0x39d67a(0x7c)]}),_0xb496cb=_0x4998c8[_0x39d67a(0x11d)],_0x2af740=getConsoleNextUrl(_0x485832['site'],_0x39d67a(0xeb)+_0x3eb825+_0x39d67a(0x94)+_0x451907[_0x39d67a(0x100)]+_0x39d67a(0xce));return await handleSingleObjectOutput({'id':_0xb496cb['id'],'name':_0xb496cb[_0x39d67a(0x164)][_0x39d67a(0x161)],'version':_0xb496cb[_0x39d67a(0x164)][_0x39d67a(0x102)],'description':_0xb496cb[_0x39d67a(0x164)][_0x39d67a(0x141)],'state':_0xb496cb['attributes'][_0x39d67a(0xb2)],'paused':_0xb496cb[_0x39d67a(0x164)]['paused'],'reentry_mode':_0xb496cb['attributes'][_0x39d67a(0x10d)],'stages':_0xb496cb[_0x39d67a(0x164)][_0x39d67a(0xbe)]?.[_0x39d67a(0x144)]||0x0,..._0xb496cb[_0x39d67a(0x164)][_0x39d67a(0x153)]&&{'goal':_0xb496cb['attributes'][_0x39d67a(0x153)]['name']},'latest':_0x451907[_0x39d67a(0x100)]===_0x4e42d4,'created_at':_0xb496cb[_0x39d67a(0x164)][_0x39d67a(0x136)],'updated_at':_0xb496cb[_0x39d67a(0x164)][_0x39d67a(0x101)],'url':_0x2af740},_0x485832),0x0;}}
|
|
1
|
+
const a22_0x59d1bf=a22_0x2264;(function(_0x504d6e,_0x3787f6){const _0x10a709=a22_0x2264,_0x22de14=_0x504d6e();while(!![]){try{const _0x2ae7b7=-parseInt(_0x10a709(0x17e))/0x1*(-parseInt(_0x10a709(0x123))/0x2)+-parseInt(_0x10a709(0x150))/0x3*(parseInt(_0x10a709(0x13c))/0x4)+-parseInt(_0x10a709(0x11e))/0x5*(parseInt(_0x10a709(0x16b))/0x6)+parseInt(_0x10a709(0x10b))/0x7*(-parseInt(_0x10a709(0x111))/0x8)+-parseInt(_0x10a709(0xed))/0x9*(parseInt(_0x10a709(0x10c))/0xa)+parseInt(_0x10a709(0x1cb))/0xb+parseInt(_0x10a709(0x1f1))/0xc*(parseInt(_0x10a709(0x103))/0xd);if(_0x2ae7b7===_0x3787f6)break;else _0x22de14['push'](_0x22de14['shift']());}catch(_0x4ac878){_0x22de14['push'](_0x22de14['shift']());}}}(a22_0xc3ce,0x5c87b));import a22_0x31ff39 from'chalk';import a22_0x4a789b from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';function a22_0x2264(_0x351cfb,_0x27b84d){_0x351cfb=_0x351cfb-0xe8;const _0xc3ce5b=a22_0xc3ce();let _0x226465=_0xc3ce5b[_0x351cfb];return _0x226465;}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';function a22_0xc3ce(){const _0x77062e=['12XMsMPr','getColumnMapping','getStatistics','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','base','get','filePath','segmentPushCommand','data','from','\x20changed\x20files','dim','values','Listing\x20journeys...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journey:activations','Options:','No\x20journeys\x20found','Aborted.','647837Vaeyjo','args','isNew','getParentFull','Export\x20journey(s)\x20as\x20YAML\x20files','resolveSegment','buildIdToNameMap','includeHistory','filter','yellow','journey','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','sort','resolveJourneyId','segments','Show\x20journey\x20details','\x20Created\x20v','cwd','View\x20a\x20specific\x20version\x20of\x20a\x20journey','links','find','\x20\x20Target:\x20','\x20=\x20','Input:\x20','tsv','rootFolderId','state','activation_','database','createVersion','reentryMode','journeyId','Found\x20','blue','jsonl','execute','diff','includeStats','/app/ps/','localeCompare','getSegment','completionRate','push','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','getTrafficData','List\x20activations\x20for\x20a\x20journey','helpText','Resolving\x20version...','enteredSize','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','utf-8','\x20Opening\x20','columns','parentSegment','add','\x5c$&','format','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','createdAt','Error:\x20Journey\x20\x27','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20journey\x20files\x20to\x20','getJourney','yes','Fetching\x20journeys\x20and\x20folders...','Creating\x20new\x20version...','journeyName','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)','\x20\x20Parent\x20segment:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journey:traffic','join','replace','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20version','exitOrJumpSize','errorCode','240108ebmoEH','message','Resolving\x20journey...','nodes','buildIdToEmailMap','\x20\x20Journey\x20ID:\x20','Fetching\x20parent\x20segment...','rule','/j/da','session','listJourneysWithFolders','No\x20statistics\x20available\x20for\x20journey:\x20','name','Pattern:\x20','.yml','Error:\x20','Warning:\x20Could\x20not\x20resolve\x20segment\x20','folderPath','connector_config','Database:\x20','size','archived','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x22\x20paused','✔\x20Pulled\x20','targetDir','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','draft','green','Getting\x20column\x20mapping...','goal','history','cyan','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','json','parentName','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','version','144aQUptL','resourceName','Folder\x20path:\x20','has','bold','\x20details...','45HdZjuA','listJourneysFromParentSegment','journey:version:view','updatedAt','(root)','set','error','paused','journey:push','segmentName','journeyBundleName','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','INVALID_ARGUMENT','\x0aPull\x20summary:','Error:\x20Journey\x20not\x20found:\x20','completeMilestoneRate','red','Getting\x20journey\x20traffic\x20data...','all','\x22\x20resumed','resume','absolutePath','1509443rIWOmR','split','activationParams','\x0aError:','log','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:stats','test','3955CxtasB','515390tMkWFB','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','pause','\x20\x20Folder\x20path:\x20','Resolved\x20YAML\x20file:\x20','1952pTtVJY','kind','listVersions','options','Error:\x20--version\x20option\x20is\x20required','completed','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','stringify','\x20new\x20files','length','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','root\x20folder','journey:list','1475105LZDAxu','Fetching\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Show\x20journey\x20statistics','(archived)','2DxGIix','(paused)','Cancelled','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20journeys','journeyBundleId','resolveParentId','attributes','exitOrJumpRate','repeat','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','/e/','hasPeriod','✔\x20Journey\x20\x22','journey:resume','🗺️\x20','stages','✔\x20Context\x20set:\x20','journeys','segment','journey:view','Resume\x20a\x20paused\x20journey','Available\x20stages:\x20','content','file','2793588fHbzfG','Resolving\x20parent\x20segment...','/j/da/je','Resuming\x20journey...','limit','\x20files?','no_parent','relative','conversion','(draft)','folderId','verbose','description','setPhase','parent_segment','\x20journey','entries','✔\x20Found\x20','Error:\x20Invalid\x20--type\x20\x22','\x20(draft)\x20—\x20\x22','3lrhUaH','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Warning:\x20Could\x20not\x20resolve\x20activation\x20','toLowerCase','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','table','versionNumber','type','folders','Error:\x20Invalid\x20version\x20number:\x20','Parent\x20segment:\x20','web','journeyStages','Target\x20file:\x20','site','dryRun','then','(running)','✔\x20All\x20files\x20are\x20up\x20to\x20date','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Error:\x20Stage\x20\x22','hasChanges','activation','renderStats','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Listing\x20journey\x20activations...','map'];a22_0xc3ce=function(){return _0x77062e;};return a22_0xc3ce();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x100226){const _0x22a4da=a22_0x2264;return!_0x100226&&(console[_0x22a4da(0xf3)](_0x22a4da(0x11b)),console['error'](_0x22a4da(0x16e))),!!_0x100226;}function withJsonFormat(_0x186b0b){const _0x1448de=a22_0x2264;if(!_0x186b0b[_0x1448de(0x1b6)]&&!_0x186b0b['json']&&!_0x186b0b[_0x1448de(0x1a0)]&&!_0x186b0b[_0x1448de(0x196)])return{..._0x186b0b,'format':'json','json':!![]};return _0x186b0b;}function formatJourneyState(_0x5223f3){const _0x23534b=a22_0x2264;switch(_0x5223f3){case'launched':return a22_0x31ff39[_0x23534b(0x1e7)](_0x23534b(0x161));case _0x23534b(0x1e6):return a22_0x31ff39[_0x23534b(0x176)](_0x23534b(0x145));case _0x23534b(0xf4):return a22_0x31ff39[_0x23534b(0x187)](_0x23534b(0x124));case _0x23534b(0x116):return a22_0x31ff39[_0x23534b(0x19f)]('(completed)');case _0x23534b(0x1e0):return a22_0x31ff39[_0x23534b(0x176)](_0x23534b(0x122));default:return'('+_0x5223f3+')';}}function formatJourneyItem(_0x5b16f7,_0x597995='',_0x2e6ccf){const _0x55c34b=a22_0x2264,_0x5bf21f=formatJourneyState(_0x5b16f7[_0x55c34b(0x198)]),_0x2bf553=_0x2e6ccf?hyperlink(_0x5b16f7[_0x55c34b(0xf7)],_0x2e6ccf):_0x5b16f7[_0x55c34b(0xf7)];return _0x597995+_0x55c34b(0x132)+_0x2bf553+'\x20'+_0x5bf21f;}function escapeRegex(_0x1fa219){const _0x5df069=a22_0x2264;return _0x1fa219[_0x5df069(0x1c6)](/[.*+?^${}()|[\]\\]/g,_0x5df069(0x1b5));}function globToRegex(_0xe598ba){const _0x36f82c=a22_0x2264,_0x580a9b=_0xe598ba[_0x36f82c(0x104)]('*')['map'](escapeRegex);return new RegExp(_0x580a9b['join']('.*'),'i');}function buildRuleToNameMapping(_0x206af2){const _0x202a8b=a22_0x2264,_0x5491bc=new Map();if(_0x206af2[_0x202a8b(0x18c)])for(const [_0x433af2,_0x373183]of Object[_0x202a8b(0x14c)](_0x206af2[_0x202a8b(0x18c)])){if(_0x373183[_0x202a8b(0x1d2)]){const _0x38e051=serializeRule(_0x373183['rule']),_0x49798f=_0x5491bc[_0x202a8b(0x170)](_0x38e051);_0x49798f?_0x49798f[_0x202a8b(0x1a8)](_0x433af2):_0x5491bc[_0x202a8b(0xf2)](_0x38e051,[_0x433af2]);}}return _0x5491bc;}async function resolveJourneyIdFromInput(_0x3de47f,_0x5e5023,_0x2c5fbb){const _0x4de96e=a22_0x2264,_0x487a7b=await resolveJourneyTarget(_0x3de47f,_0x5e5023[_0x4de96e(0x1b3)],_0x5e5023[_0x4de96e(0x147)]),_0x6707d6=_0x487a7b[_0x4de96e(0x1b3)];if(!_0x6707d6)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4de96e(0x120));const _0x493279=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2c5fbb['segment'][_0x4de96e(0x129)](_0x6707d6),{'verbose':_0x5e5023[_0x4de96e(0x147)]}),_0x1770d8=_0x493279[_0x4de96e(0x173)],_0x492904=await withSpinner(_0x4de96e(0x1cd),()=>_0x2c5fbb['journey'][_0x4de96e(0x18b)](_0x1770d8,_0x487a7b[_0x4de96e(0x1c0)]),{'verbose':_0x5e5023[_0x4de96e(0x147)]});return{'journeyId':_0x492904['data'],'journeyName':_0x487a7b[_0x4de96e(0x1c0)],'parentSegmentId':_0x1770d8};}async function resolveJourneyTarget(_0x10e885,_0x497b05,_0x532651){const _0xf564d4=a22_0x2264;if(isYamlFilePath(_0x10e885))try{const _0x5cb929=await resolveYamlFilePath(_0x10e885);return _0x532651&&(console[_0xf564d4(0xf3)](_0xf564d4(0x110)+_0x10e885),console['error'](_0xf564d4(0x1c2)+_0x5cb929[_0xf564d4(0x1b3)]),console[_0xf564d4(0xf3)]('\x20\x20Name:\x20'+_0x5cb929['segmentName']),console[_0xf564d4(0xf3)](_0xf564d4(0x10f)+(_0x5cb929['folderPath']||_0xf564d4(0xf1)))),{'journeyName':_0x5cb929[_0xf564d4(0xf6)],'parentSegment':_0x5cb929[_0xf564d4(0x1b3)],'resolved':_0x5cb929};}catch(_0x3b578b){throw new SDKError(ErrorCode[_0xf564d4(0xf9)],_0xf564d4(0x1b7)+_0x3b578b[_0xf564d4(0x1cc)]);}if(!_0x497b05)throw new SDKError(ErrorCode[_0xf564d4(0xf9)],_0xf564d4(0x154));return{'journeyName':_0x10e885,'parentSegment':_0x497b05};}export class JourneyListCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]=a22_0x59d1bf(0x11d);[a22_0x59d1bf(0x148)]='List\x20journeys\x20in\x20current\x20context';async[a22_0x59d1bf(0x1a1)](_0x2bf54a){const _0x1e9529=a22_0x59d1bf,{options:_0x1a9c8a,args:_0x4b3ea3,tdx:_0x470113}=_0x2bf54a,_0x1f0b12=_0x4b3ea3[0x0],_0x4d1bf6=_0x1a9c8a[_0x1e9529(0x1b3)];if(!_0x4d1bf6)return console[_0x1e9529(0xf3)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x1e9529(0xf3)](_0x1e9529(0x1e5)),0x1;const _0x3388a3=await withSpinner(_0x1e9529(0x13d),()=>_0x470113[_0x1e9529(0x136)]['resolveParentId'](_0x4d1bf6),{'verbose':_0x1a9c8a[_0x1e9529(0x147)]}),_0x30c273=_0x3388a3['data'];_0x1a9c8a[_0x1e9529(0x147)]&&(console[_0x1e9529(0xf3)](_0x1e9529(0x15a)+_0x4d1bf6+'\x20(ID:\x20'+_0x30c273+')'),_0x1f0b12&&console[_0x1e9529(0xf3)](_0x1e9529(0x1d8)+_0x1f0b12));const _0x22f882=await withSpinner(_0x1e9529(0x1d1),()=>_0x470113[_0x1e9529(0x136)][_0x1e9529(0x181)](_0x30c273),{'verbose':_0x1a9c8a[_0x1e9529(0x147)]}),_0x340afa=_0x22f882[_0x1e9529(0x173)],_0x487d6c=_0x340afa[_0x1e9529(0x197)],_0x28e3ff=await withSpinner(_0x1e9529(0x178),()=>_0x470113[_0x1e9529(0x188)][_0x1e9529(0x1d5)](_0x30c273,_0x487d6c),{'verbose':_0x1a9c8a[_0x1e9529(0x147)]});let _0x4fbe68=_0x28e3ff[_0x1e9529(0x173)][_0x1e9529(0x135)];const _0x472b90=_0x28e3ff[_0x1e9529(0x173)][_0x1e9529(0x158)],_0x4712b9=new Map();for(const _0x37110 of _0x472b90){_0x4712b9[_0x1e9529(0xf2)](_0x37110['id'],_0x37110['name']);}if(_0x1f0b12){const _0x7cd7b4=globToRegex(_0x1f0b12);_0x4fbe68=_0x4fbe68['filter'](_0xf2c7fa=>_0x7cd7b4[_0x1e9529(0x10a)](_0xf2c7fa['journeyBundleName']));}console[_0x1e9529(0xf3)](_0x1e9529(0x14d)+_0x4fbe68[_0x1e9529(0x11a)]+_0x1e9529(0x14b)+(_0x4fbe68[_0x1e9529(0x11a)]!==0x1?'s':''));const _0x471e87=_0xcd3003=>{const _0x29c266=_0x1e9529;return getConsoleNextUrl(_0x1a9c8a[_0x29c266(0x15e)],_0x29c266(0x1a4)+_0x30c273+_0x29c266(0x12e)+_0xcd3003+_0x29c266(0x1d3));};if(_0x1a9c8a[_0x1e9529(0x1b6)]===_0x1e9529(0x155))await handleSDKOutput(_0x4fbe68,_0x1a9c8a);else{if(_0x1a9c8a['format']===_0x1e9529(0x1ed)){const _0x240f0a=_0x4fbe68['map'](_0x5a868d=>({..._0x5a868d,'url':_0x471e87(_0x5a868d['id'])}));await handleSDKOutput(_0x240f0a,_0x1a9c8a);}else{console[_0x1e9529(0x107)]('['+_0x4d1bf6+']');const _0x33c35c=new Map(),_0x4ebccc=[];for(const _0x9017f4 of _0x4fbe68){if(!_0x9017f4[_0x1e9529(0x146)]||_0x9017f4[_0x1e9529(0x146)]===_0x487d6c)_0x4ebccc['push'](_0x9017f4);else{const _0x3c3c1e=_0x33c35c['get'](_0x9017f4['folderId'])||[];_0x3c3c1e['push'](_0x9017f4),_0x33c35c[_0x1e9529(0xf2)](_0x9017f4['folderId'],_0x3c3c1e);}}const _0x566cdc=(_0x5b7d75,_0x44b26c)=>_0x5b7d75[_0x1e9529(0xf7)][_0x1e9529(0x1a5)](_0x44b26c['journeyBundleName'],undefined,{'sensitivity':_0x1e9529(0x16f)});_0x4ebccc['sort'](_0x566cdc);for(const _0x4dfa6f of _0x4ebccc){console['log'](formatJourneyItem(_0x4dfa6f,'',_0x471e87(_0x4dfa6f['id'])));}const _0x2292b6=[..._0x33c35c['entries']()][_0x1e9529(0x18a)]((_0x4e995d,_0x488388)=>{const _0xf00289=_0x1e9529,_0x4938f4=_0x4712b9['get'](_0x4e995d[0x0])||_0x4e995d[0x0],_0x2b8185=_0x4712b9[_0xf00289(0x170)](_0x488388[0x0])||_0x488388[0x0];return _0x4938f4['localeCompare'](_0x2b8185,undefined,{'sensitivity':_0xf00289(0x16f)});});for(const [_0x530a1d,_0x18249e]of _0x2292b6){const _0x5d773a=_0x4712b9[_0x1e9529(0x170)](_0x530a1d)||_0x530a1d;console[_0x1e9529(0x107)]('📁\x20'+_0x5d773a),_0x18249e['sort'](_0x566cdc);for(const _0x4bb889 of _0x18249e){console[_0x1e9529(0x107)](formatJourneyItem(_0x4bb889,'\x20\x20',_0x471e87(_0x4bb889['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]=a22_0x59d1bf(0x137);[a22_0x59d1bf(0x148)]=a22_0x59d1bf(0x18d);async[a22_0x59d1bf(0x1a1)](_0x9399cc){const _0x2c3c2f=a22_0x59d1bf,{options:_0x49a953,args:_0x2a33de,tdx:_0xb1486}=_0x9399cc,_0x2c51a4=_0x2a33de[0x0];if(!_0x2c51a4)return console['error'](_0x2c3c2f(0x11b)),console[_0x2c3c2f(0xf3)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console['error'](_0x2c3c2f(0x17b)),console[_0x2c3c2f(0xf3)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x49a953[_0x2c3c2f(0x147)]&&console[_0x2c3c2f(0xf3)]('Input:\x20'+_0x2c51a4);const {journeyId:_0x430942,parentSegmentId:_0x59d347}=await resolveJourneyIdFromInput(_0x2c51a4,_0x49a953,_0xb1486);if(_0x49a953[_0x2c3c2f(0x15b)]){const _0x54be44=getConsoleNextUrl(_0x49a953[_0x2c3c2f(0x15e)],_0x2c3c2f(0x1a4)+_0x59d347+_0x2c3c2f(0x12e)+_0x430942+_0x2c3c2f(0x13e));return console[_0x2c3c2f(0xf3)](a22_0x31ff39['green']('✔')+_0x2c3c2f(0x1b1)+a22_0x31ff39['cyan'](_0x54be44)),openBrowser(_0x54be44),0x0;}const _0x1717f5=await withSpinner('Getting\x20journey\x20details...',()=>_0xb1486[_0x2c3c2f(0x188)][_0x2c3c2f(0x1bc)](_0x430942),{'verbose':_0x49a953[_0x2c3c2f(0x147)]}),_0x21eb50=_0x1717f5[_0x2c3c2f(0x173)],_0x237684=_0x49a953[_0x2c3c2f(0x1a3)];let _0x403c7f;if(_0x237684)try{const _0x4f73ca=await withSpinner('Getting\x20journey\x20statistics...',()=>_0xb1486['journey'][_0x2c3c2f(0x16d)](_0x430942),{'verbose':_0x49a953[_0x2c3c2f(0x147)]});_0x403c7f=_0x4f73ca[_0x2c3c2f(0x173)];}catch{_0x49a953[_0x2c3c2f(0x147)]&&console[_0x2c3c2f(0xf3)]('\x20\x20Statistics\x20not\x20available');}const _0x296917=getConsoleNextUrl(_0x49a953[_0x2c3c2f(0x15e)],_0x2c3c2f(0x1a4)+_0x59d347+_0x2c3c2f(0x12e)+_0x430942+_0x2c3c2f(0x13e)),_0x443005={'id':_0x21eb50['id'],'name':_0x21eb50['attributes'][_0x2c3c2f(0x1d7)],'description':_0x21eb50[_0x2c3c2f(0x12a)][_0x2c3c2f(0x148)],'state':_0x21eb50[_0x2c3c2f(0x12a)][_0x2c3c2f(0x198)],'paused':_0x21eb50[_0x2c3c2f(0x12a)][_0x2c3c2f(0xf4)],'reentry_mode':_0x21eb50[_0x2c3c2f(0x12a)][_0x2c3c2f(0x19c)],'stages':_0x21eb50[_0x2c3c2f(0x12a)][_0x2c3c2f(0x15c)]?.[_0x2c3c2f(0x11a)]||0x0,..._0x21eb50[_0x2c3c2f(0x12a)][_0x2c3c2f(0x1e9)]&&{'goal':_0x21eb50[_0x2c3c2f(0x12a)]['goal'][_0x2c3c2f(0x1d7)]},..._0x403c7f&&{'statistics':{'size':_0x403c7f['size'],'entered':_0x403c7f[_0x2c3c2f(0x1ae)],'goal_achieved':_0x403c7f['goalSize'],'completion_rate':_0x403c7f[_0x2c3c2f(0x1a7)],'exit_or_jump':_0x403c7f['exitOrJumpSize'],'exit_or_jump_rate':_0x403c7f[_0x2c3c2f(0x12b)],'stages':_0x403c7f[_0x2c3c2f(0x133)]}},'url':_0x296917};return await handleSingleObjectOutput(_0x443005,_0x49a953),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]=a22_0x59d1bf(0x109);['description']=a22_0x59d1bf(0x121);async[a22_0x59d1bf(0x1a1)](_0x45e6b7){const _0x2529e1=a22_0x59d1bf,{options:_0x381fa0,args:_0x17d4fe,tdx:_0x28a295}=_0x45e6b7,_0x4cb60c=_0x17d4fe[0x0];if(!requireNameOrPath(_0x4cb60c))return 0x1;_0x381fa0['verbose']&&console[_0x2529e1(0xf3)](_0x2529e1(0x195)+_0x4cb60c);const _0x1d89e4=_0x381fa0,_0x244465=_0x1d89e4[_0x2529e1(0x174)],_0x4353b5=_0x1d89e4['to'],_0x2285fc=_0x1d89e4[_0x2529e1(0x185)],_0x310e8b=_0x1d89e4['stage'];_0x2285fc&&!_0x244465&&!_0x4353b5&&console[_0x2529e1(0xf3)](_0x2529e1(0x1af));const _0x184672=_0x2285fc?withJsonFormat(_0x381fa0):_0x381fa0,{journeyId:_0x58fa3a,journeyName:_0x175c66}=await resolveJourneyIdFromInput(_0x4cb60c,_0x184672,_0x28a295),_0x2891ec=_0x244465||_0x4353b5?{'from':_0x244465,'to':_0x4353b5}:undefined,_0x4932f0=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x2529e1(0xff)]([_0x28a295[_0x2529e1(0x188)][_0x2529e1(0x1bc)](_0x58fa3a),_0x28a295[_0x2529e1(0x188)][_0x2529e1(0x16d)](_0x58fa3a,_0x2891ec)]),{'verbose':_0x184672[_0x2529e1(0x147)]}),[_0x4bf22b,_0x1091bd]=_0x4932f0[_0x2529e1(0x173)];if(!_0x1091bd||_0x1091bd[_0x2529e1(0x19d)]===null)return console[_0x2529e1(0xf3)](_0x2529e1(0x1d6)+_0x175c66),console[_0x2529e1(0xf3)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x132d86=buildStageNameMap(_0x4bf22b),_0x46ee68=!!(_0x2891ec&&_0x1091bd[_0x2529e1(0x1ea)]?.['length']),_0x5be9d5={'stageNameMap':_0x132d86,'hasPeriod':_0x46ee68,'includeHistory':!!_0x2285fc};if(_0x310e8b&&_0x1091bd[_0x2529e1(0x133)]){const _0x2bb8c9=_0x1091bd[_0x2529e1(0x133)][_0x2529e1(0x192)](_0x1edea1=>{const _0x56048a=_0x2529e1,_0x2a3b5b=_0x132d86[_0x56048a(0x170)](_0x1edea1['id'])??'';return _0x2a3b5b[_0x56048a(0x153)]()===_0x310e8b[_0x56048a(0x153)]();});if(_0x2bb8c9)return await handleSingleObjectOutput(formatStageStats(_0x2bb8c9,_0x5be9d5),_0x184672),0x0;const _0x14336f=_0x1091bd[_0x2529e1(0x133)][_0x2529e1(0x16a)](_0x45e1dd=>_0x132d86['get'](_0x45e1dd['id'])??_0x45e1dd['id']);return console['error'](_0x2529e1(0x164)+_0x310e8b+'\x22\x20not\x20found'),console[_0x2529e1(0xf3)](_0x2529e1(0x139)+_0x14336f['join'](',\x20')),0x1;}const _0x53a2af=_0x1091bd[_0x2529e1(0x133)]?.['map'](_0x329fec=>formatStageStats(_0x329fec,_0x5be9d5)),_0x311bc7=assembleJourneyStats(_0x1091bd,{'from':_0x244465,'to':_0x4353b5,'includeHistory':_0x2285fc});return await this[_0x2529e1(0x167)](_0x311bc7,_0x53a2af??[],_0x184672),0x0;}async[a22_0x59d1bf(0x167)](_0x3ace60,_0x24e945,_0x3f1da9){const _0x2548a9=a22_0x59d1bf,_0x24a0a8=_0x3f1da9[_0x2548a9(0x1b6)]===_0x2548a9(0x1ed)||_0x3f1da9[_0x2548a9(0x1b6)]==='jsonl'||_0x3f1da9[_0x2548a9(0x1ed)]||_0x3f1da9[_0x2548a9(0x1a0)];if(_0x24a0a8){_0x3ace60[_0x2548a9(0x133)]=_0x24e945,await handleSingleObjectOutput(_0x3ace60,_0x3f1da9);return;}await handleSingleObjectOutput(_0x3ace60,_0x3f1da9);for(const _0x4f23ff of _0x24e945){console[_0x2548a9(0x107)](''),console[_0x2548a9(0x107)](String(a22_0x31ff39[_0x2548a9(0x1eb)][_0x2548a9(0xeb)]('['+_0x4f23ff['name']+']'))+a22_0x31ff39[_0x2548a9(0x176)]('\x20'+_0x4f23ff['id']));const {id:_0x52a960,name:_0x1bff73,..._0x5ef0ce}=_0x4f23ff;await handleSingleObjectOutput(_0x5ef0ce,_0x3f1da9);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]=a22_0x59d1bf(0x1c4);[a22_0x59d1bf(0x148)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a22_0x59d1bf(0x1a1)](_0x15a849){const _0x16dd24=a22_0x59d1bf,{options:_0x1bc44d,args:_0x1b48db,tdx:_0x1f2ccf}=_0x15a849,_0x429d0a=_0x1b48db[0x0];if(!requireNameOrPath(_0x429d0a))return 0x1;_0x1bc44d['verbose']&&console['error'](_0x16dd24(0x195)+_0x429d0a);const _0x2dae19=_0x1bc44d,_0x52c46e=_0x2dae19['type'],_0x307630=_0x2dae19[_0x16dd24(0x174)],_0x11b0b0=_0x2dae19['to'],_0x77aa65=_0x2dae19[_0x16dd24(0x140)];if(_0x52c46e&&_0x52c46e!==_0x16dd24(0x144)&&_0x52c46e!==_0x16dd24(0x166))return console[_0x16dd24(0xf3)](_0x16dd24(0x14e)+_0x52c46e+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x3a202a=withJsonFormat(_0x1bc44d),{journeyId:_0x48da90,journeyName:_0x30fb8f}=await resolveJourneyIdFromInput(_0x429d0a,_0x3a202a,_0x1f2ccf),_0x108e5c={'type':_0x52c46e,'from':_0x307630,'to':_0x11b0b0,'limit':_0x77aa65},_0x42872d=await withSpinner(_0x16dd24(0xfe),()=>_0x1f2ccf[_0x16dd24(0x188)][_0x16dd24(0x1aa)](_0x48da90,_0x108e5c),{'verbose':_0x3a202a[_0x16dd24(0x147)]}),_0x389453=_0x42872d[_0x16dd24(0x173)],_0x483f70=_0x389453[_0x16dd24(0x144)]&&(_0x389453[_0x16dd24(0x144)][_0x16dd24(0x1ce)][_0x16dd24(0x11a)]>0x0||_0x389453['conversion'][_0x16dd24(0x191)]['length']>0x0),_0x351ed0=_0x389453['activation']&&_0x389453[_0x16dd24(0x166)][_0x16dd24(0x11a)]>0x0;if(!_0x483f70&&!_0x351ed0)return console[_0x16dd24(0xf3)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x30fb8f),console[_0x16dd24(0xf3)](_0x16dd24(0x151)),_0x307630&&_0x11b0b0&&console[_0x16dd24(0xf3)](_0x16dd24(0x12d)),0x0;return await handleSingleObjectOutput(_0x389453,_0x3a202a),0x0;}}function formatStageStats(_0x33d467,_0x231d2a){const _0x2e4232=a22_0x59d1bf,_0x149334=_0x231d2a[_0x2e4232(0x12f)]&&_0x33d467[_0x2e4232(0x1ea)]?.['length']?aggregateStageHistory(_0x33d467[_0x2e4232(0x1ea)]):{'size':_0x33d467[_0x2e4232(0x1df)],'entered':_0x33d467[_0x2e4232(0x1ae)],'milestone':_0x33d467['milestoneSize'],'milestone_rate':_0x33d467[_0x2e4232(0xfc)],'exit_or_jump':_0x33d467[_0x2e4232(0x1c9)],'exit_or_jump_rate':_0x33d467[_0x2e4232(0x12b)]},_0x1c5e1e={'id':_0x33d467['id'],'name':_0x231d2a['stageNameMap'][_0x2e4232(0x170)](_0x33d467['id'])??_0x33d467['id'],..._0x149334};return _0x231d2a[_0x2e4232(0x12f)]&&_0x231d2a[_0x2e4232(0x185)]&&_0x33d467[_0x2e4232(0x1ea)]&&(_0x1c5e1e['history']=_0x33d467['history']),_0x1c5e1e;}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a22_0x59d1bf(0x148)]='Pause\x20a\x20running\x20journey';async[a22_0x59d1bf(0x1a1)](_0x3f2c7b){const _0xb7d687=a22_0x59d1bf,{options:_0x1d4dc5,args:_0x3716d2,tdx:_0x4f2d52}=_0x3f2c7b,_0xa4af22=_0x3716d2[0x0];if(!requireNameOrPath(_0xa4af22))return 0x1;_0x1d4dc5[_0xb7d687(0x147)]&&console['error'](_0xb7d687(0x195)+_0xa4af22);const {journeyId:_0x185dc8,journeyName:_0x5ad283}=await resolveJourneyIdFromInput(_0xa4af22,_0x1d4dc5,_0x4f2d52);if(!_0x1d4dc5[_0xb7d687(0x1bd)]){const _0x5d00a1=await confirm(_0xb7d687(0x189)+_0x5ad283+'\x22?');if(!_0x5d00a1)return console[_0xb7d687(0xf3)](_0xb7d687(0x125)),0x0;}const _0x11a1a9=await withSpinner('Pausing\x20journey...',()=>_0x4f2d52[_0xb7d687(0x188)][_0xb7d687(0x10e)](_0x185dc8),{'verbose':_0x1d4dc5[_0xb7d687(0x147)]}),_0x522612=_0x11a1a9[_0xb7d687(0x173)];return console[_0xb7d687(0xf3)](_0xb7d687(0x130)+_0x522612[_0xb7d687(0x12a)][_0xb7d687(0x1d7)]+_0xb7d687(0x1e2)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a22_0x59d1bf(0x131);[a22_0x59d1bf(0x148)]=a22_0x59d1bf(0x138);async[a22_0x59d1bf(0x1a1)](_0x31e96c){const _0x73682d=a22_0x59d1bf,{options:_0x52b8fe,args:_0x4ccfb2,tdx:_0x5e3ebb}=_0x31e96c,_0x12449f=_0x4ccfb2[0x0];if(!requireNameOrPath(_0x12449f))return 0x1;_0x52b8fe[_0x73682d(0x147)]&&console['error'](_0x73682d(0x195)+_0x12449f);const {journeyId:_0x42c0bc,journeyName:_0x135b79}=await resolveJourneyIdFromInput(_0x12449f,_0x52b8fe,_0x5e3ebb);if(!_0x52b8fe[_0x73682d(0x1bd)]){const _0x4fc226=await confirm(_0x73682d(0x163)+_0x135b79+'\x22?');if(!_0x4fc226)return console[_0x73682d(0xf3)](_0x73682d(0x125)),0x0;}const _0x2216d7=await withSpinner(_0x73682d(0x13f),()=>_0x5e3ebb[_0x73682d(0x188)][_0x73682d(0x101)](_0x42c0bc),{'verbose':_0x52b8fe[_0x73682d(0x147)]}),_0x7247d1=_0x2216d7[_0x73682d(0x173)];return console['error']('✔\x20Journey\x20\x22'+_0x7247d1[_0x73682d(0x12a)]['name']+_0x73682d(0x100)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]='journey:pull';[a22_0x59d1bf(0x148)]=a22_0x59d1bf(0x182);async[a22_0x59d1bf(0x1a1)](_0x5bde59){const _0x3a602f=a22_0x59d1bf,{options:_0x45b1bb,args:_0x42c44d,tdx:_0x208b33}=_0x5bde59,_0xc29ee0=_0x45b1bb,_0x46f930=_0x42c44d[0x0],_0x3ac70a=_0x46f930&&isYamlFilePath(_0x46f930),_0x1a865c=await resolveTarget({'arg':_0x3ac70a?_0x46f930:undefined,'contextParent':_0x45b1bb[_0x3a602f(0x1b3)],'cwd':process[_0x3a602f(0x18f)]()});if(!isSuccessfulResolution(_0x1a865c))return _0x1a865c[_0x3a602f(0x1ca)]===_0x3a602f(0x142)?(console[_0x3a602f(0xf3)](a22_0x31ff39[_0x3a602f(0x187)](_0x3a602f(0x1a9))),console[_0x3a602f(0xf3)](_0x3a602f(0x1c1)),console['error'](_0x3a602f(0xf8)),console[_0x3a602f(0xf3)](_0x3a602f(0x10d)),console[_0x3a602f(0xf3)](_0x3a602f(0x117))):(console['error'](a22_0x31ff39[_0x3a602f(0xfd)](_0x3a602f(0x1da)+_0x1a865c[_0x3a602f(0x1cc)]+'\x0a')),_0x1a865c['helpText']&&console['error'](a22_0x31ff39['cyan'](_0x1a865c[_0x3a602f(0x1ac)]))),0x1;let _0x17042f=_0x3ac70a?undefined:_0x46f930,_0x42d37d,_0x985a68;_0x1a865c[_0x3a602f(0x157)]===_0x3a602f(0x13b)&&(_0x17042f=_0x1a865c[_0x3a602f(0xe8)],_0x42d37d=_0x1a865c[_0x3a602f(0x171)],_0x985a68=_0x1a865c[_0x3a602f(0x1dc)]);const _0x118dbe=_0x1a865c[_0x3a602f(0x1ee)],_0xf28b2a=_0x1a865c[_0x3a602f(0x1e4)];_0xc29ee0[_0x3a602f(0x147)]&&(console['error'](_0x3a602f(0x15a)+_0x118dbe),console[_0x3a602f(0xf3)]('Target\x20directory:\x20'+_0xf28b2a),_0x17042f&&console[_0x3a602f(0xf3)]('Journey\x20name:\x20'+_0x17042f),_0x42d37d&&console[_0x3a602f(0xf3)](_0x3a602f(0x15d)+_0x42d37d),_0x985a68&&console[_0x3a602f(0xf3)](_0x3a602f(0xe9)+_0x985a68));const _0x36c2da=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x208b33[_0x3a602f(0x136)][_0x3a602f(0x129)](_0x118dbe),{'verbose':_0x45b1bb[_0x3a602f(0x147)]}),_0x59bf17=_0x36c2da[_0x3a602f(0x173)],{journeys:_0x58d689,folders:_0x176189}=await withSpinner(_0x3a602f(0x1be),async()=>{const _0x137410=_0x3a602f,[_0x450ec7,_0x526b94]=await Promise[_0x137410(0xff)]([_0x208b33['journey'][_0x137410(0xee)](_0x59bf17,undefined,{'includeAllVersions':!![]}),_0x208b33[_0x137410(0x136)]['listFolders'](_0x59bf17)]);return{'journeys':_0x450ec7,'folders':_0x526b94};},{'verbose':_0x45b1bb[_0x3a602f(0x147)]})[_0x3a602f(0x160)](_0x273ac9=>_0x273ac9['data']);let _0x4d93f9=_0x58d689;const _0xdde2fe=buildFolderIdToPathMap(_0x176189);if(_0x17042f){const _0x14f8a8=_0x4d93f9['filter'](_0x32b9b1=>_0x32b9b1[_0x3a602f(0xf7)]['toLowerCase']()===_0x17042f[_0x3a602f(0x153)]());if(_0x14f8a8[_0x3a602f(0x11a)]===0x0)return console[_0x3a602f(0xf3)](_0x3a602f(0xfb)+_0x17042f),console['error'](_0x3a602f(0x1e1)),0x1;_0x4d93f9=_0x14f8a8;}if(_0x985a68!==undefined){const _0x34e4a5=_0x4d93f9[_0x3a602f(0x186)](_0x4326e7=>{const _0x58c79c=_0x3a602f,_0x46366c=_0x4326e7[_0x58c79c(0x146)]?_0xdde2fe['get'](_0x4326e7[_0x58c79c(0x146)])||'':'';return _0x46366c===_0x985a68;});if(_0x34e4a5[_0x3a602f(0x11a)]===0x0&&_0x4d93f9[_0x3a602f(0x11a)]>0x0){console['error'](_0x3a602f(0x1b9)+_0x17042f+'\x27\x20not\x20found\x20in\x20'+(_0x985a68||_0x3a602f(0x11c))),console[_0x3a602f(0xf3)](_0x3a602f(0x1ef));for(const _0x5f5d18 of _0x4d93f9){const _0x2e4fc9=_0x5f5d18[_0x3a602f(0x146)]?_0xdde2fe[_0x3a602f(0x170)](_0x5f5d18[_0x3a602f(0x146)])||'':'';console['error']('\x20\x20-\x20'+(_0x2e4fc9||'(root)')+'/'+_0x5f5d18[_0x3a602f(0xf7)]);}return 0x1;}_0x4d93f9=_0x34e4a5;}if(_0x4d93f9[_0x3a602f(0x11a)]===0x0)return console[_0x3a602f(0xf3)](_0x3a602f(0x17c)),0x0;const _0x5bc8cd=new Map();for(const _0x4caf6f of _0x4d93f9){const _0x32f604=_0x4caf6f[_0x3a602f(0x128)];!_0x5bc8cd[_0x3a602f(0xea)](_0x32f604)&&_0x5bc8cd[_0x3a602f(0xf2)](_0x32f604,[]),_0x5bc8cd[_0x3a602f(0x170)](_0x32f604)[_0x3a602f(0x1a8)](_0x4caf6f);}for(const _0x521348 of _0x5bc8cd[_0x3a602f(0x177)]()){_0x521348[_0x3a602f(0x18a)]((_0x9059d0,_0x42a146)=>(_0x9059d0[_0x3a602f(0x156)]||0x0)-(_0x42a146['versionNumber']||0x0));}const _0x562d41=[],{idToEmailMap:_0x435ab1,connectionIdToNameMap:_0xc50ec4}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x36339d=_0x3a602f,[_0x4059d7,_0x38ef5f]=await Promise['all']([_0x208b33['user'][_0x36339d(0x1cf)](),_0x208b33['connection'][_0x36339d(0x184)]()]);return{'idToEmailMap':_0x4059d7,'connectionIdToNameMap':_0x38ef5f};},{'verbose':_0x45b1bb[_0x3a602f(0x147)]})[_0x3a602f(0x160)](_0x4e6d55=>_0x4e6d55['data']);for(const _0x3dcb61 of _0x5bc8cd[_0x3a602f(0x177)]()){const _0x115847=_0x3dcb61[0x0][_0x3a602f(0xf7)],_0x166834=_0x3dcb61[0x0][_0x3a602f(0x146)],_0x49f540=_0x166834?_0xdde2fe[_0x3a602f(0x170)](_0x166834)||'':'',_0xc024ec=_0x49f540?a22_0x4a789b[_0x3a602f(0x1c5)](_0xf28b2a,_0x49f540):_0xf28b2a,_0x441fbf=_0x42d37d||a22_0x4a789b[_0x3a602f(0x1c5)](_0xc024ec,sanitizeFileName(_0x115847)+_0x3a602f(0x1d9));let _0x343bc4,_0x292b9e;if(existsSync(_0x441fbf))try{const _0x3dd2a5=readFileSync(_0x441fbf,_0x3a602f(0x1b0)),_0x487d02=parseYamlString(_0x3dd2a5);_0x292b9e=_0x487d02,_0x343bc4=buildRuleToNameMapping(_0x487d02),_0xc29ee0['verbose']&&_0x343bc4[_0x3a602f(0x1df)]>0x0&&console[_0x3a602f(0xf3)](_0x3a602f(0x19e)+_0x343bc4[_0x3a602f(0x1df)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x115847);}catch(_0x5968a8){_0xc29ee0['verbose']&&console[_0x3a602f(0xf3)](_0x3a602f(0x108)+_0x5968a8[_0x3a602f(0x1cc)]);}const _0x5f3312=[],_0x12eda1=new Set(),_0x1d6976=new Map(),_0x51d4ca=new Map(),_0x264556=new Set(),_0x25ea47=new Map(),_0x242f11=new Map(),_0x316d37=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x115847+'...',async _0x4a5103=>{const _0x2338c5=_0x3a602f;for(const _0x412a23 of _0x3dcb61){const _0xc580a3=_0x3dcb61['length']>0x1?_0x412a23['journeyBundleName']+'\x20v'+(_0x412a23[_0x2338c5(0x156)]||0x1):_0x412a23['journeyBundleName'];_0x4a5103[_0x2338c5(0x149)](_0x2338c5(0x11f)+_0xc580a3);const _0x49092b=await _0x208b33[_0x2338c5(0x188)][_0x2338c5(0x1bc)](_0x412a23['id']),_0x307f65=_0x49092b['attributes']?.['audienceId'],_0x582081={'resolveSegment':async _0x39128f=>{const _0x50973d=_0x2338c5;if(!_0x307f65)return{'name':_0x39128f,'isJourneyLocal':![]};const _0x3c1e35=_0x1d6976[_0x50973d(0x170)](_0x39128f);if(_0x3c1e35)return _0x3c1e35;try{const _0x4e803b=await _0x208b33[_0x50973d(0x136)][_0x50973d(0x1a6)](_0x307f65,_0x39128f),_0x2edb6c=_0x4e803b[_0x50973d(0x112)]===SEGMENT_KIND_JOURNEY;let _0xf1c99d,_0x27ee41=_0x4e803b[_0x50973d(0x1d7)];if(_0x2edb6c&&_0x4e803b[_0x50973d(0x1d2)]){const _0x531311=await segmentResponseToDef(_0x4e803b,{'resolveSegmentName':async _0x5504d6=>{const _0x54d475=_0x50973d,_0x5516f0=_0x1d6976[_0x54d475(0x170)](_0x5504d6);if(_0x5516f0)return _0x5516f0[_0x54d475(0x1d7)];const _0x269625=await _0x582081[_0x54d475(0x183)](_0x5504d6);return _0x269625[_0x54d475(0x1d7)];}}),_0x57020f=_0x531311[_0x50973d(0x1d2)];_0xf1c99d={'description':_0x4e803b[_0x50973d(0x148)],'rule':_0x57020f};const _0x41eb2f=serializeRule(_0x57020f),_0x69a542=_0x51d4ca['get'](_0x41eb2f);if(_0x69a542)_0x27ee41=_0x69a542,_0xf1c99d=undefined,_0xc29ee0[_0x50973d(0x147)]&&console[_0x50973d(0xf3)](_0x50973d(0x1c7)+_0x4e803b[_0x50973d(0x1d7)]+'\x20->\x20'+_0x69a542);else{let _0x1be803=![];if(_0x343bc4){const _0x4c2589=_0x343bc4[_0x50973d(0x170)](_0x41eb2f);if(_0x4c2589){const _0x46d946=_0x4c2589[_0x50973d(0x192)](_0x262624=>!_0x12eda1['has'](_0x262624));_0x46d946&&(_0x27ee41=_0x46d946,_0x12eda1[_0x50973d(0x1b4)](_0x46d946),_0x51d4ca[_0x50973d(0xf2)](_0x41eb2f,_0x46d946),_0x1be803=!![],_0xc29ee0[_0x50973d(0x147)]&&console[_0x50973d(0xf3)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x46d946+'\x20(rule\x20match)'));}}if(!_0x1be803){const _0x2ebab4=generateJourneyLocalName(_0x4e803b[_0x50973d(0x1d7)]);_0x2ebab4&&(_0x27ee41=_0x2ebab4);let _0x4e93a9=_0x27ee41,_0x284798=0x2;while(_0x12eda1[_0x50973d(0xea)](_0x4e93a9)){_0x4e93a9=_0x27ee41+'_'+_0x284798,_0x284798++;}_0x12eda1[_0x50973d(0x1b4)](_0x4e93a9),_0x51d4ca[_0x50973d(0xf2)](_0x41eb2f,_0x4e93a9),_0x27ee41=_0x4e93a9;}}}const _0xf56ab0={'name':_0x27ee41,'isJourneyLocal':_0x2edb6c,'definition':_0xf1c99d};return _0x1d6976[_0x50973d(0xf2)](_0x39128f,_0xf56ab0),_0xf56ab0;}catch(_0x3972e8){return _0x45b1bb[_0x50973d(0x147)]&&console[_0x50973d(0xf3)](_0x50973d(0x1db)+_0x39128f+':\x20'+_0x3972e8['message']),{'name':_0x39128f,'isJourneyLocal':![]};}},'resolveActivation':async _0x7637be=>{const _0x3f96e8=_0x2338c5,_0x3fd1c3=_0x25ea47[_0x3f96e8(0x170)](_0x7637be);if(_0x3fd1c3)return _0x3fd1c3;try{const _0x7012e9=await _0x208b33['journey']['getActivation'](_0x412a23['id'],_0x7637be),_0x2b96d1=journeyActivationStepToYaml(_0x7012e9,_0x435ab1,_0xc50ec4),_0x4313c7=JSON[_0x3f96e8(0x118)]({'name':_0x2b96d1[_0x3f96e8(0x1d7)],'connection':_0x2b96d1['connection'],'connector_config':_0x2b96d1[_0x3f96e8(0x1dd)]}),_0xa5a4a7=_0x242f11['get'](_0x4313c7);if(_0xa5a4a7){const _0x1be7dc={'name':_0xa5a4a7,'isJourneyLocal':!![],'definition':_0x2b96d1};return _0x25ea47[_0x3f96e8(0xf2)](_0x7637be,_0x1be7dc),_0x1be7dc;}const _0x1dfc07=_0x7012e9[_0x3f96e8(0x12a)][_0x3f96e8(0x105)][_0x3f96e8(0x1d7)]||_0x7637be,_0x3fc410=sanitizeYamlKey(_0x1dfc07)||_0x3f96e8(0x199)+_0x7637be;let _0xfe38c9=_0x3fc410,_0x4a47da=0x2;while(_0x264556[_0x3f96e8(0xea)](_0xfe38c9)){_0xfe38c9=_0x3fc410+'_'+_0x4a47da,_0x4a47da++;}_0x264556[_0x3f96e8(0x1b4)](_0xfe38c9),_0x242f11['set'](_0x4313c7,_0xfe38c9);const _0x7c0b37={'name':_0xfe38c9,'isJourneyLocal':!![],'definition':_0x2b96d1};return _0x25ea47[_0x3f96e8(0xf2)](_0x7637be,_0x7c0b37),_0x7c0b37;}catch(_0x469d5a){return _0x45b1bb[_0x3f96e8(0x147)]&&console['error'](_0x3f96e8(0x152)+_0x7637be+':\x20'+_0x469d5a[_0x3f96e8(0x1cc)]),{'name':_0x7637be,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x18b7b4,_0x46e4bb)=>{const _0x5d4420=_0x2338c5;return resolveJumpTarget(_0x18b7b4,_0x46e4bb,_0x316d37,_0x35aa4b=>_0x208b33[_0x5d4420(0x188)][_0x5d4420(0x1bc)](_0x35aa4b));}},_0x25f38d=await journeyResponseToDef(_0x49092b,_0x582081);_0x5f3312[_0x2338c5(0x1a8)]({'item':_0x412a23,'yaml':_0x25f38d});}},{'verbose':_0x45b1bb[_0x3a602f(0x147)]});const _0x2dd98a=await _0x208b33[_0x3a602f(0x188)]['getLatestJourneyId'](_0x3dcb61[0x0][_0x3a602f(0x128)]),_0x346b10=buildMergedJourneyDef(_0x5f3312,_0x343bc4,_0x2dd98a),_0x3af0c1=normalizeJourneyDef(_0x346b10,_0x292b9e),_0x5102b0=toYamlString(_0x3af0c1),_0x36a22a=_0x42d37d||a22_0x4a789b[_0x3a602f(0x1c5)](_0xc024ec,sanitizeFileName(_0x115847)+'.yml');!_0x42d37d&&_0x49f540&&!existsSync(_0xc024ec)&&mkdirSync(_0xc024ec,{'recursive':!![]});const _0x37f914=a22_0x4a789b[_0x3a602f(0x143)](process[_0x3a602f(0x18f)](),_0x36a22a);if(existsSync(_0x36a22a)){const _0x4bb8be=readFileSync(_0x36a22a,_0x3a602f(0x1b0)),_0x5e8d71=generateDiff(_0x4bb8be,_0x5102b0),_0xd4dc14=hasChanges(_0x5e8d71);_0x562d41[_0x3a602f(0x1a8)]({'relativePath':_0x37f914,'absolutePath':_0x36a22a,'content':_0x5102b0,'isNew':![],'hasChanges':_0xd4dc14,'diff':_0xd4dc14?formatDiffWithColors(_0x5e8d71):undefined});}else _0x562d41[_0x3a602f(0x1a8)]({'relativePath':_0x37f914,'absolutePath':_0x36a22a,'content':_0x5102b0,'isNew':!![],'hasChanges':![]});}const _0x5bc08b=_0x562d41[_0x3a602f(0x186)](_0x49099d=>_0x49099d[_0x3a602f(0x180)]),_0x71bf71=_0x562d41[_0x3a602f(0x186)](_0x79cc1e=>!_0x79cc1e[_0x3a602f(0x180)]&&_0x79cc1e[_0x3a602f(0x165)]),_0x4cb069=_0x562d41[_0x3a602f(0x186)](_0xb1486e=>!_0xb1486e[_0x3a602f(0x180)]&&!_0xb1486e[_0x3a602f(0x165)]),_0x2f2882=_0x4d93f9['length'],_0x544068=_0x5bc8cd['size'],_0x17788c=_0x2f2882>_0x544068?'\x20('+_0x2f2882+'\x20versions)':'';console['error'](_0x3a602f(0xfa)),console[_0x3a602f(0xf3)]('\x20\x20'+a22_0x31ff39[_0x3a602f(0x1eb)](_0x544068+_0x3a602f(0x127))+a22_0x31ff39[_0x3a602f(0x176)](_0x17788c)),console[_0x3a602f(0xf3)]('\x20\x20'+a22_0x31ff39[_0x3a602f(0x1e7)]('+\x20'+_0x5bc08b[_0x3a602f(0x11a)]+_0x3a602f(0x119))),console[_0x3a602f(0xf3)]('\x20\x20'+a22_0x31ff39[_0x3a602f(0x187)]('~\x20'+_0x71bf71[_0x3a602f(0x11a)]+_0x3a602f(0x175))),console[_0x3a602f(0xf3)]('\x20\x20'+a22_0x31ff39[_0x3a602f(0x176)]('=\x20'+_0x4cb069[_0x3a602f(0x11a)]+'\x20unchanged\x20files')),console[_0x3a602f(0xf3)](_0x3a602f(0x193)+a22_0x31ff39['cyan'](_0xf28b2a)+'\x0a');if(_0x71bf71[_0x3a602f(0x11a)]>0x0)for(const _0x20947f of _0x71bf71){console[_0x3a602f(0xf3)]('\x0aChanges\x20to\x20\x27'+_0x20947f['relativePath']+'\x27:'),console[_0x3a602f(0xf3)]('─'[_0x3a602f(0x12c)](0x3c)),console['error'](_0x20947f[_0x3a602f(0x1a2)]),console[_0x3a602f(0xf3)]('─'['repeat'](0x3c));}if(_0xc29ee0[_0x3a602f(0x15f)])return console['error'](a22_0x31ff39[_0x3a602f(0x187)](_0x3a602f(0x179))),0x0;if(_0x5bc08b[_0x3a602f(0x11a)]===0x0&&_0x71bf71[_0x3a602f(0x11a)]===0x0)return console[_0x3a602f(0xf3)](a22_0x31ff39[_0x3a602f(0x1e7)](_0x3a602f(0x162))),saveSessionContext({'parent_segment':_0x118dbe},_0xc29ee0[_0x3a602f(0x1d4)]),console[_0x3a602f(0xf3)](a22_0x31ff39[_0x3a602f(0x1e7)](_0x3a602f(0x134)+a22_0x31ff39['dim']('parent_segment')+_0x3a602f(0x194)+a22_0x31ff39[_0x3a602f(0x1eb)](_0x118dbe))),0x0;if(!_0xc29ee0[_0x3a602f(0x1bd)]&&(_0x5bc08b['length']>0x0||_0x71bf71[_0x3a602f(0x11a)]>0x0)){if(!isInteractive())return console['error'](a22_0x31ff39[_0x3a602f(0xfd)](_0x3a602f(0x106)),_0x3a602f(0x1ec)),console[_0x3a602f(0xf3)](a22_0x31ff39[_0x3a602f(0x176)](_0x3a602f(0x1c3))),0x1;const _0x453f45=await confirmKey('Write\x20'+(_0x5bc08b[_0x3a602f(0x11a)]+_0x71bf71[_0x3a602f(0x11a)])+_0x3a602f(0x141));if(!_0x453f45)return console['error'](a22_0x31ff39[_0x3a602f(0x187)](_0x3a602f(0x17d)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0xf28b2a)&&mkdirSync(_0xf28b2a,{'recursive':!![]});const _0x4173d7=a22_0x4a789b['join'](_0xf28b2a,'tdx.json');writeFileSync(_0x4173d7,createTdxConfigContent(_0x118dbe),'utf-8');for(const _0x2b8bc8 of _0x562d41){(_0x2b8bc8[_0x3a602f(0x180)]||_0x2b8bc8[_0x3a602f(0x165)])&&writeFileSync(_0x2b8bc8[_0x3a602f(0x102)],_0x2b8bc8[_0x3a602f(0x13a)],_0x3a602f(0x1b0));}return console[_0x3a602f(0xf3)](a22_0x31ff39[_0x3a602f(0x1e7)](_0x3a602f(0x1e3)+(_0x5bc08b[_0x3a602f(0x11a)]+_0x71bf71[_0x3a602f(0x11a)])+_0x3a602f(0x1bb)+_0xf28b2a)),saveSessionContext({'parent_segment':_0x118dbe},_0xc29ee0[_0x3a602f(0x1d4)]),console[_0x3a602f(0xf3)](a22_0x31ff39[_0x3a602f(0x1e7)]('✔\x20Context\x20set:\x20'+a22_0x31ff39[_0x3a602f(0x176)](_0x3a602f(0x14a))+'\x20=\x20'+a22_0x31ff39['cyan'](_0x118dbe))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]='journey:columns';[a22_0x59d1bf(0x148)]='Show\x20journey\x20table\x20column\x20mapping';async[a22_0x59d1bf(0x1a1)](_0x2f6585){const _0x4f2baa=a22_0x59d1bf,{options:_0x55e3c5,args:_0x5c4c96,tdx:_0x394075}=_0x2f6585,_0x586e1b=_0x5c4c96[0x0];if(!requireNameOrPath(_0x586e1b))return 0x1;_0x55e3c5['verbose']&&console[_0x4f2baa(0xf3)](_0x4f2baa(0x195)+_0x586e1b);const {journeyId:_0x149a60}=await resolveJourneyIdFromInput(_0x586e1b,_0x55e3c5,_0x394075),_0x3445e8=await withSpinner(_0x4f2baa(0x1e8),()=>_0x394075[_0x4f2baa(0x188)][_0x4f2baa(0x16c)](_0x149a60),{'verbose':_0x55e3c5['verbose']}),_0x30e5cb=_0x3445e8[_0x4f2baa(0x173)];return console[_0x4f2baa(0x107)](_0x4f2baa(0x1de)+_0x30e5cb[_0x4f2baa(0x19a)]),console[_0x4f2baa(0x107)]('Table:\x20'+_0x30e5cb[_0x4f2baa(0x155)]),await handleSDKOutput(_0x30e5cb[_0x4f2baa(0x1b2)],_0x55e3c5),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a22_0x59d1bf(0x17a);[a22_0x59d1bf(0x148)]=a22_0x59d1bf(0x1ab);async['execute'](_0x4b48e7){const _0x681fdb=a22_0x59d1bf,{options:_0x458b25,args:_0x6ba915,tdx:_0x3a921e}=_0x4b48e7,_0x5cbcaf=_0x6ba915[0x0];if(!requireNameOrPath(_0x5cbcaf))return 0x1;_0x458b25[_0x681fdb(0x147)]&&console[_0x681fdb(0xf3)]('Input:\x20'+_0x5cbcaf);const {journeyId:_0x13a6d5}=await resolveJourneyIdFromInput(_0x5cbcaf,_0x458b25,_0x3a921e),_0x50b850=await withSpinner(_0x681fdb(0x169),()=>_0x3a921e['journey']['listActivationsFlat'](_0x13a6d5),{'verbose':_0x458b25[_0x681fdb(0x147)]}),_0x409487=_0x50b850[_0x681fdb(0x173)];return console[_0x681fdb(0xf3)](_0x681fdb(0x19e)+_0x409487[_0x681fdb(0x11a)]+'\x20activation'+(_0x409487['length']!==0x1?'s':'')),await handleSDKOutput(_0x409487,_0x458b25),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]=a22_0x59d1bf(0xf5);[a22_0x59d1bf(0x148)]=a22_0x59d1bf(0x168);['segmentPushCommand']=new SegmentPushCommand();async[a22_0x59d1bf(0x1a1)](_0x4446d7){const _0x2de948=a22_0x59d1bf,_0x5ba57d=_0x4446d7[_0x2de948(0x17f)][0x0];let _0x5ca4bc;if(_0x5ba57d){const _0xf1e94b=await resolveTarget({'arg':_0x5ba57d,'contextParent':_0x4446d7[_0x2de948(0x114)][_0x2de948(0x1b3)],'cwd':process[_0x2de948(0x18f)]()});isSuccessfulResolution(_0xf1e94b)&&_0xf1e94b[_0x2de948(0x157)]===_0x2de948(0x13b)&&(_0x5ca4bc=_0xf1e94b[_0x2de948(0x171)]);}const _0x51093a={..._0x4446d7,'options':{..._0x4446d7[_0x2de948(0x114)],'journeysOnly':!![],..._0x5ca4bc&&{'singleFilePath':_0x5ca4bc}}};return this[_0x2de948(0x172)][_0x2de948(0x1a1)](_0x51093a);}}export class JourneyVersionsCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]='journey:versions';[a22_0x59d1bf(0x148)]='List\x20all\x20versions\x20of\x20a\x20journey';async['execute'](_0x2d0ce1){const _0x56c794=a22_0x59d1bf,{options:_0x80562a,args:_0x1c0146,tdx:_0x364cc5}=_0x2d0ce1,_0x467071=_0x1c0146[0x0];if(!requireNameOrPath(_0x467071))return 0x1;if(_0x80562a['verbose'])console[_0x56c794(0xf3)](_0x56c794(0x195)+_0x467071);const {journeyId:_0x569448}=await resolveJourneyIdFromInput(_0x467071,_0x80562a,_0x364cc5),_0x2863fd=await withSpinner('Listing\x20journey\x20versions...',()=>_0x364cc5[_0x56c794(0x188)][_0x56c794(0x113)](_0x569448),{'verbose':_0x80562a[_0x56c794(0x147)]}),{bundleName:_0x1889c6,versions:_0x34f2bc,latestJourneyId:_0x4d8af4}=_0x2863fd[_0x56c794(0x173)];console[_0x56c794(0xf3)](_0x1889c6+':\x20'+_0x34f2bc[_0x56c794(0x11a)]+_0x56c794(0x1c8)+(_0x34f2bc['length']!==0x1?'s':''));const _0x3cbff3=_0x34f2bc[_0x56c794(0x16a)](_0x5035a3=>({'version':_0x5035a3[_0x56c794(0x156)],'journey_id':_0x5035a3[_0x56c794(0x19d)],'name':_0x5035a3[_0x56c794(0x1d7)],'state':_0x5035a3[_0x56c794(0x198)],'paused':_0x5035a3[_0x56c794(0xf4)],'latest':_0x5035a3[_0x56c794(0x19d)]===_0x4d8af4,'created_at':_0x5035a3[_0x56c794(0x1b8)]}));return await handleSDKOutput(_0x3cbff3,_0x80562a),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a22_0x59d1bf(0x1d7)]='journey:version:create';['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x59d1bf(0x1a1)](_0x478aa1){const _0x6e4db8=a22_0x59d1bf,{options:_0xf4fa31,args:_0x5624a8,tdx:_0x4e2214}=_0x478aa1,_0x30d94a=_0x5624a8[0x0];if(!requireNameOrPath(_0x30d94a))return 0x1;if(_0xf4fa31[_0x6e4db8(0x147)])console[_0x6e4db8(0xf3)](_0x6e4db8(0x195)+_0x30d94a);const {journeyId:_0x45a22e,journeyName:_0x2250d5}=await resolveJourneyIdFromInput(_0x30d94a,_0xf4fa31,_0x4e2214);if(!_0xf4fa31[_0x6e4db8(0x1bd)]){const _0x49acce=await confirm(_0x6e4db8(0x1ba)+_0x2250d5+'\x22?');if(!_0x49acce)return console[_0x6e4db8(0xf3)](_0x6e4db8(0x125)),0x0;}const _0x4dd10f=await withSpinner(_0x6e4db8(0x1bf),()=>_0x4e2214[_0x6e4db8(0x188)][_0x6e4db8(0x19b)](_0x45a22e),{'verbose':_0xf4fa31['verbose']}),_0x26eeff=_0x4dd10f['data'];return console[_0x6e4db8(0xf3)](a22_0x31ff39['green']('✔')+_0x6e4db8(0x18e)+_0x26eeff[_0x6e4db8(0x12a)][_0x6e4db8(0x156)]+_0x6e4db8(0x14f)+_0x26eeff[_0x6e4db8(0x12a)][_0x6e4db8(0x1d7)]+'\x22'),console['error'](_0x6e4db8(0x1d0)+_0x26eeff['id']),await handleSingleObjectOutput({'id':_0x26eeff['id'],'name':_0x26eeff[_0x6e4db8(0x12a)]['name'],'version':_0x26eeff['attributes'][_0x6e4db8(0x156)],'state':_0x26eeff[_0x6e4db8(0x12a)][_0x6e4db8(0x198)],'bundle_id':_0x26eeff[_0x6e4db8(0x12a)][_0x6e4db8(0x128)],'created_at':_0x26eeff[_0x6e4db8(0x12a)]['createdAt']},_0xf4fa31),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a22_0x59d1bf(0xef);[a22_0x59d1bf(0x148)]=a22_0x59d1bf(0x190);async[a22_0x59d1bf(0x1a1)](_0x51d89f){const _0x29853d=a22_0x59d1bf,{options:_0x59bbdf,args:_0x2998ac,tdx:_0x47e445}=_0x51d89f,_0x1e6323=_0x2998ac[0x0];if(!requireNameOrPath(_0x1e6323))return 0x1;const _0x1c82e5=_0x59bbdf[_0x29853d(0x1f0)];if(!_0x1c82e5)return console[_0x29853d(0xf3)](_0x29853d(0x115)),console[_0x29853d(0xf3)](_0x29853d(0x126)),0x1;const _0x165f36=parseInt(_0x1c82e5,0xa);if(isNaN(_0x165f36)||_0x165f36<0x1)return console[_0x29853d(0xf3)](_0x29853d(0x159)+_0x1c82e5),0x1;if(_0x59bbdf[_0x29853d(0x147)])console[_0x29853d(0xf3)](_0x29853d(0x195)+_0x1e6323+',\x20version:\x20'+_0x165f36);const {journeyId:_0x11b8c4,parentSegmentId:_0xddf53b}=await resolveJourneyIdFromInput(_0x1e6323,_0x59bbdf,_0x47e445),_0x584909=await withSpinner(_0x29853d(0x1ad),()=>_0x47e445[_0x29853d(0x188)]['listVersions'](_0x11b8c4),{'verbose':_0x59bbdf[_0x29853d(0x147)]}),{versions:_0x2d4fc2,latestJourneyId:_0x4c6f65}=_0x584909[_0x29853d(0x173)],_0x23f87c=_0x2d4fc2['find'](_0x4210a3=>_0x4210a3['versionNumber']===_0x165f36);if(!_0x23f87c){const _0x5cd035=_0x2d4fc2['map'](_0x35d47b=>'v'+_0x35d47b[_0x29853d(0x156)])[_0x29853d(0x1c5)](',\x20');return console[_0x29853d(0xf3)]('Error:\x20Version\x20'+_0x165f36+'\x20not\x20found.\x20Available:\x20'+_0x5cd035),0x1;}const _0x36fabe=await withSpinner('Getting\x20version\x20'+_0x165f36+_0x29853d(0xec),()=>_0x47e445['journey'][_0x29853d(0x1bc)](_0x23f87c[_0x29853d(0x19d)]),{'verbose':_0x59bbdf[_0x29853d(0x147)]}),_0x36dd76=_0x36fabe[_0x29853d(0x173)],_0x2d8132=getConsoleNextUrl(_0x59bbdf[_0x29853d(0x15e)],_0x29853d(0x1a4)+_0xddf53b+_0x29853d(0x12e)+_0x23f87c[_0x29853d(0x19d)]+_0x29853d(0x13e));return await handleSingleObjectOutput({'id':_0x36dd76['id'],'name':_0x36dd76[_0x29853d(0x12a)][_0x29853d(0x1d7)],'version':_0x36dd76[_0x29853d(0x12a)][_0x29853d(0x156)],'description':_0x36dd76['attributes'][_0x29853d(0x148)],'state':_0x36dd76['attributes'][_0x29853d(0x198)],'paused':_0x36dd76[_0x29853d(0x12a)][_0x29853d(0xf4)],'reentry_mode':_0x36dd76['attributes'][_0x29853d(0x19c)],'stages':_0x36dd76[_0x29853d(0x12a)][_0x29853d(0x15c)]?.[_0x29853d(0x11a)]||0x0,..._0x36dd76['attributes'][_0x29853d(0x1e9)]&&{'goal':_0x36dd76[_0x29853d(0x12a)]['goal'][_0x29853d(0x1d7)]},'latest':_0x23f87c[_0x29853d(0x19d)]===_0x4c6f65,'created_at':_0x36dd76[_0x29853d(0x12a)][_0x29853d(0x1b8)],'updated_at':_0x36dd76[_0x29853d(0x12a)][_0x29853d(0xf0)],'url':_0x2d8132},_0x59bbdf),0x0;}}
|