@treasuredata/tdx 0.26.2 → 0.26.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/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a9_0x44c313=a9_0x4c64;(function(_0x5a3506,_0x529ee7){const _0x52655a=a9_0x4c64,_0x2b90d5=_0x5a3506();while(!![]){try{const _0x5105e8=-parseInt(_0x52655a(0x16d))/0x1*(-parseInt(_0x52655a(0x14c))/0x2)+parseInt(_0x52655a(0x178))/0x3*(parseInt(_0x52655a(0x175))/0x4)+parseInt(_0x52655a(0x1a2))/0x5*(-parseInt(_0x52655a(0x191))/0x6)+-parseInt(_0x52655a(0x180))/0x7*(-parseInt(_0x52655a(0x131))/0x8)+-parseInt(_0x52655a(0x129))/0x9+parseInt(_0x52655a(0x12d))/0xa+parseInt(_0x52655a(0x17f))/0xb*(-parseInt(_0x52655a(0x15b))/0xc);if(_0x5105e8===_0x529ee7)break;else _0x2b90d5['push'](_0x2b90d5['shift']());}catch(_0x74d76a){_0x2b90d5['push'](_0x2b90d5['shift']());}}}(a9_0x1d49,0x1f72e));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';function a9_0x1d49(){const _0x2dc7f7=['info','context','\x20configuration\x20failed','env','11YqPJjF','1188803vJzXad','site','already\x20installed','execute','plugin','.claude','inherit','\x20→\x20','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','ANTHROPIC_MODEL','\x27\x20updated','INVALID_ARGUMENT','Creating\x20.claude/settings.local.json...','Initializing\x20proxy\x20logger...','apiKey','stringify','exit','62082ADqOQB','2.0.20','hostname','tdx','green','getLogPath','Updating\x20marketplace\x20\x27','CLAUDE_CODE_USE_VERTEX','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','command','Executing:\x20claude\x20','):\x20claude\x20','settings.local.json','already\x20exists','stdout','llm-proxy','Installing\x20plugin\x20\x27','95YPjFhv','patch','Failed\x20to\x20spawn\x20claude\x20command:\x20','false','Warning:\x20Failed\x20to\x20configure\x20','Failed\x20to\x20launch\x20Claude\x20Code:\x20','data','statusLine','mcp','type','marketplace','stderr','INTERNAL','includes','\x27\x20configured','ANTHROPIC_AUTH_TOKEN','Setup\x20failed','minor','add','major','✓\x20Settings\x20restored:\x20.claude/settings.local.json','http://127.0.0.1:','Command\x20failed\x20(exit\x20','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','stop','Failed\x20to\x20remove\x20marketplace\x20\x27','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','fail','debug','tdx\x20claude\x20statusline','Command\x20spawn\x20error:\x20','string','code','parse','\x27...','utf-8','\x20meets\x20minimum\x20requirement','CLAUDE_CODE_USE_BEDROCK','TD\x20Docs\x20MCP\x20Server','close','766206FjcmBh','tdx-skills','INSTALLATION_FAILED','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','1069360tJOCEG','ENOENT','passThroughServer','originalSettings','8nToOOf','Failed\x20to\x20install\x20plugin\x20\x27','log','logger','start','Invalid\x20minimum\x20version\x20format:\x20','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','cause','account_id','already\x20configured','trim','Failed\x20to\x20configure\x20marketplace\x20\x27','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','getCurrent','Finding\x20available\x20port...','http','✓\x20Logging\x20to\x20','install','match','✓\x20Plugin\x20\x27','join','Failed\x20to\x20list\x20marketplaces','description','init','proxy','tdx-managed-proxy','✓\x20Marketplace\x20\x27','24GoSXCV','verbose','td-skills','message','Claude\x20Code\x20version\x20check\x20failed','\x20is\x20too\x20old\x20(minimum:\x20','logLevel','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','warn','claude','\x20or\x20later.','cwd','✓\x20Logs\x20saved\x20to\x20','\x20already\x20configured','Claude\x20Code\x20version\x20','1932156ebdtAK','Configuring\x20MCP\x20server\x20\x27','Configuring\x20marketplace\x20\x27','\x20claude\x20statusline','port','profile','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','error','✓\x20MCP\x20server\x20\x27','CLAUDE_CODE_UNSUPPORTED_VERSION','update','name','ANTHROPIC_BASE_URL','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','127.0.0.1','Marketplace\x20\x27','pipe','Initializing...','16708aJoznY','unshift','CLAUDE_CODE_NOT_FOUND','statusline','https://github.com/treasure-data/td-skills','Failed\x20to\x20update\x20marketplace\x20\x27','\x27:\x20','text','12sgSpEY','localhost','Claude\x20Code\x20CLI\x20not\x20found','94293gnKVJb','td-docs','Command\x20output:\x20'];a9_0x1d49=function(){return _0x2dc7f7;};return a9_0x1d49();}import{join}from'node:path';import a9_0x258091 from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a9_0x44c313(0x192);function handleInstallationError(_0x44bb6f,_0x498776,_0x5239ca,_0x3071de){const _0x517448=a9_0x44c313;errorContains(_0x44bb6f,_0x517448(0x19e),_0x517448(0x182),_0x517448(0x13a))?(_0x5239ca['text']='✓\x20'+_0x498776+_0x517448(0x159),_0x3071de?.['info'](_0x498776+_0x517448(0x159)),_0x44bb6f instanceof SDKError&&_0x44bb6f[_0x517448(0x138)]&&_0x3071de?.[_0x517448(0x11d)](_0x517448(0x17a)+_0x44bb6f[_0x517448(0x138)][_0x517448(0x14f)])):(_0x5239ca[_0x517448(0x154)](_0x517448(0x105)+_0x498776),_0x3071de?.['error'](_0x498776+_0x517448(0x17d),_0x44bb6f));}export function parseVersion(_0x496d44){const _0x25fb64=a9_0x44c313,_0xa7d410=_0x496d44[_0x25fb64(0x13b)]()[_0x25fb64(0x143)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0xa7d410)return null;return{'major':parseInt(_0xa7d410[0x1],0xa),'minor':parseInt(_0xa7d410[0x2],0xa),'patch':parseInt(_0xa7d410[0x3],0xa)};}export function compareVersions(_0x50a9e1,_0x4284a9){const _0x376cfb=a9_0x44c313;if(_0x50a9e1['major']!==_0x4284a9['major'])return _0x50a9e1[_0x376cfb(0x114)]-_0x4284a9[_0x376cfb(0x114)];if(_0x50a9e1[_0x376cfb(0x112)]!==_0x4284a9[_0x376cfb(0x112)])return _0x50a9e1[_0x376cfb(0x112)]-_0x4284a9[_0x376cfb(0x112)];return _0x50a9e1[_0x376cfb(0x1a3)]-_0x4284a9['patch'];}async function checkClaudeVersion(_0x4ab931,_0x5f0c51){const _0x8b3a74=a9_0x44c313;_0x5f0c51?.[_0x8b3a74(0x11d)](_0x8b3a74(0x118)+_0x4ab931+')');const _0x5990b1=await executeClaudeCommand(['--version'],undefined,_0x5f0c51),_0x78440=parseVersion(_0x5990b1);if(!_0x78440){_0x5f0c51?.[_0x8b3a74(0x154)](_0x8b3a74(0x12c)+_0x5990b1);return;}const _0x4830f4=_0x78440[_0x8b3a74(0x114)]+'.'+_0x78440[_0x8b3a74(0x112)]+'.'+_0x78440[_0x8b3a74(0x1a3)],_0x5d36bf=parseVersion(_0x4ab931);if(!_0x5d36bf){_0x5f0c51?.['warn'](_0x8b3a74(0x136)+_0x4ab931);return;}if(compareVersions(_0x78440,_0x5d36bf)<0x0){_0x5f0c51?.[_0x8b3a74(0x162)](_0x8b3a74(0x15a)+_0x4830f4+_0x8b3a74(0x151)+_0x4ab931+')');throw new SDKError(ErrorCode[_0x8b3a74(0x164)],'Claude\x20Code\x20version\x20'+_0x4830f4+_0x8b3a74(0x188)+_0x4ab931+_0x8b3a74(0x156),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x5f0c51?.['debug'](_0x8b3a74(0x15a)+_0x4830f4+_0x8b3a74(0x125));}async function executeClaudeCommand(_0x39cbde,_0x469a41,_0x1fd6f4){const _0x592123=a9_0x44c313;return _0x1fd6f4?.[_0x592123(0x17b)](_0x592123(0x19b)+_0x39cbde[_0x592123(0x145)]('\x20')),new Promise((_0x12b9b1,_0x107468)=>{const _0x2ed0c7=_0x592123,_0x28b9e1=crossSpawn('claude',_0x39cbde,{'stdio':_0x2ed0c7(0x16b)});let _0x3d8020='',_0x2499a6='';_0x28b9e1[_0x2ed0c7(0x19f)]?.['on'](_0x2ed0c7(0x107),_0x491eea=>{_0x3d8020+=_0x491eea['toString']();}),_0x28b9e1[_0x2ed0c7(0x10c)]?.['on'](_0x2ed0c7(0x107),_0xfc3546=>{_0x2499a6+=_0xfc3546['toString']();}),_0x28b9e1['on'](_0x2ed0c7(0x162),_0x18905f=>{const _0x35847b=_0x2ed0c7;_0x18905f[_0x35847b(0x121)]===_0x35847b(0x12e)?(_0x1fd6f4?.['error'](_0x35847b(0x177)),_0x107468(new SDKError(ErrorCode[_0x35847b(0x16f)],_0x35847b(0x177),_0x18905f,{'helpText':_0x35847b(0x11b)}))):(_0x1fd6f4?.['error'](_0x35847b(0x11f)+_0x18905f[_0x35847b(0x14f)]),_0x107468(new SDKError(ErrorCode[_0x35847b(0x10d)],_0x35847b(0x1a4)+_0x18905f[_0x35847b(0x14f)],_0x18905f)));}),_0x28b9e1['on'](_0x2ed0c7(0x190),_0xc2a6e6=>{const _0x268cff=_0x2ed0c7;if(_0xc2a6e6===0x0)_0x12b9b1(_0x3d8020);else _0x469a41?(_0x1fd6f4?.[_0x268cff(0x162)](_0x268cff(0x117)+_0xc2a6e6+_0x268cff(0x19c)+_0x39cbde[_0x268cff(0x145)]('\x20')),_0x107468(new SDKError(ErrorCode[_0x268cff(0x12b)],_0x469a41,new Error(_0x2499a6)))):_0x12b9b1('');});});}async function ensureMcpServer(_0x1beedf,_0xfe6552,_0x1fa26d,_0x265fa2,_0x181cd4){const _0x2db16a=a9_0x44c313;_0x265fa2[_0x2db16a(0x174)]=_0x2db16a(0x15c)+_0x1beedf+_0x2db16a(0x123),await executeClaudeCommand([_0x2db16a(0x109),_0x2db16a(0x113),_0x1beedf,_0xfe6552,'--transport',_0x1fa26d],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x1beedf+'\x27',_0x181cd4),_0x265fa2['text']=_0x2db16a(0x163)+_0x1beedf+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL=a9_0x44c313(0x171);export function getTdSkillsRepoUrl(){const _0x4e52de=process.env.TDX_TD_SKILLS_REPO;if(_0x4e52de)return _0x4e52de;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x108ac4,_0x19f9dd){const _0x35488d=a9_0x44c313;try{const _0x568b07=await executeClaudeCommand([_0x35488d(0x184),_0x35488d(0x10b),'list'],_0x35488d(0x146),_0x19f9dd);if(!_0x568b07[_0x35488d(0x10e)](_0x108ac4)){_0x19f9dd?.[_0x35488d(0x11d)](_0x35488d(0x16a)+_0x108ac4+_0x35488d(0x13d));return;}await executeClaudeCommand([_0x35488d(0x184),_0x35488d(0x10b),'remove',_0x108ac4],_0x35488d(0x11a)+_0x108ac4+'\x27',_0x19f9dd),_0x19f9dd?.[_0x35488d(0x17b)](_0x35488d(0x16a)+_0x108ac4+'\x27\x20removed');}catch(_0x176038){_0x19f9dd?.[_0x35488d(0x154)]('Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x108ac4+_0x35488d(0x173)+_0x176038);}}async function restoreDefaultTdSkillsMarketplace(_0x249523){const _0x57b27f=a9_0x44c313;try{await removeMarketplace(_0x57b27f(0x14e),_0x249523),await executeClaudeCommand([_0x57b27f(0x184),_0x57b27f(0x10b),_0x57b27f(0x113),DEFAULT_TD_SKILLS_URL],undefined,_0x249523),_0x249523?.[_0x57b27f(0x17b)]('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x437c06,_0x245b41,_0x535dcd,_0x3ff0ee){const _0x3048cf=a9_0x44c313;_0x535dcd[_0x3048cf(0x174)]=_0x3048cf(0x15d)+_0x437c06+'\x27...',await executeClaudeCommand([_0x3048cf(0x184),_0x3048cf(0x10b),_0x3048cf(0x113),_0x245b41],_0x3048cf(0x13c)+_0x437c06+'\x27',_0x3ff0ee),_0x535dcd['text']=_0x3048cf(0x14b)+_0x437c06+_0x3048cf(0x10f);}async function updateMarketplace(_0x2e971b,_0x2c4b8c,_0x53cdfa){const _0x62b8ee=a9_0x44c313;_0x2c4b8c['text']=_0x62b8ee(0x197)+_0x2e971b+_0x62b8ee(0x123),await executeClaudeCommand([_0x62b8ee(0x184),_0x62b8ee(0x10b),_0x62b8ee(0x165)],_0x62b8ee(0x172)+_0x2e971b+'\x27',_0x53cdfa),_0x2c4b8c[_0x62b8ee(0x174)]=_0x62b8ee(0x14b)+_0x2e971b+_0x62b8ee(0x18a);}function a9_0x4c64(_0xbb86ba,_0x261b5d){_0xbb86ba=_0xbb86ba-0x104;const _0x1d495a=a9_0x1d49();let _0x4c64c7=_0x1d495a[_0xbb86ba];return _0x4c64c7;}async function ensurePlugin(_0x3fc8ae,_0x59700d,_0x207731,_0x50d584){const _0x3f5dc0=a9_0x44c313;_0x207731['text']=_0x3f5dc0(0x1a1)+_0x3fc8ae+_0x3f5dc0(0x123),await executeClaudeCommand([_0x3f5dc0(0x184),_0x3f5dc0(0x142),_0x3fc8ae+'@'+_0x59700d],_0x3f5dc0(0x132)+_0x3fc8ae+'\x27',_0x50d584),_0x207731[_0x3f5dc0(0x174)]=_0x3f5dc0(0x144)+_0x3fc8ae+'\x27\x20installed';}async function createClaudeSettings(_0x4a011a,_0x1aaddd,_0x49691e){const _0x39b932=a9_0x44c313,_0x33effe=join(process[_0x39b932(0x157)](),'.claude'),_0xe69f9c=join(_0x33effe,'settings.local.json');await mkdir(_0x33effe,{'recursive':!![]});let _0x335377={};if(existsSync(_0xe69f9c))try{const _0x5123d6=await readFile(_0xe69f9c,_0x39b932(0x124));_0x335377=JSON[_0x39b932(0x122)](_0x5123d6);}catch{_0x335377={};}const _0x3f08ee=_0x335377[_0x39b932(0x17e)]||{},_0x445114={'ANTHROPIC_BASE_URL':_0x3f08ee[_0x39b932(0x167)],'ANTHROPIC_MODEL':_0x3f08ee[_0x39b932(0x189)],'ANTHROPIC_AUTH_TOKEN':_0x3f08ee[_0x39b932(0x110)],'CLAUDE_CODE_USE_BEDROCK':_0x3f08ee[_0x39b932(0x126)],'CLAUDE_CODE_USE_VERTEX':_0x3f08ee[_0x39b932(0x198)],'statusLine':_0x335377['statusLine']},_0x31b92a={..._0x335377,'env':{..._0x3f08ee,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x4a011a,..._0x1aaddd&&{'ANTHROPIC_MODEL':_0x1aaddd},'ANTHROPIC_AUTH_TOKEN':_0x39b932(0x14a),'CLAUDE_CODE_USE_BEDROCK':_0x39b932(0x104),'CLAUDE_CODE_USE_VERTEX':_0x39b932(0x104)},'statusLine':{'type':_0x39b932(0x19a),'command':_0x49691e?'tdx\x20--profile\x20'+_0x49691e+_0x39b932(0x15e):_0x39b932(0x11e)}};return await writeFile(_0xe69f9c,JSON['stringify'](_0x31b92a,null,0x2)+'\x0a'),_0x445114;}async function restoreClaudeSettings(_0x43804d){const _0x5cb7ac=a9_0x44c313,_0x20b8fc=join(process[_0x5cb7ac(0x157)](),_0x5cb7ac(0x185)),_0x995d2d=join(_0x20b8fc,_0x5cb7ac(0x19d));if(!existsSync(_0x995d2d))return;try{const _0x4a3eaf=await readFile(_0x995d2d,'utf-8'),_0x530732=JSON[_0x5cb7ac(0x122)](_0x4a3eaf),_0x424678=_0x530732[_0x5cb7ac(0x17e)]||{},_0x4089b4=_0x424678[_0x5cb7ac(0x167)],_0x36fbe3=((()=>{const _0x495d9d=_0x5cb7ac;if(typeof _0x4089b4!=='string')return![];try{const _0x26cba3=new URL(_0x4089b4);return _0x26cba3[_0x495d9d(0x193)]===_0x495d9d(0x176)||_0x26cba3[_0x495d9d(0x193)]===_0x495d9d(0x169);}catch{return![];}})());_0x36fbe3?(delete _0x424678[_0x5cb7ac(0x167)],delete _0x424678[_0x5cb7ac(0x189)],delete _0x424678[_0x5cb7ac(0x110)],delete _0x424678[_0x5cb7ac(0x126)],delete _0x424678['CLAUDE_CODE_USE_VERTEX']):(_0x43804d[_0x5cb7ac(0x167)]!==undefined?_0x424678[_0x5cb7ac(0x167)]=_0x43804d['ANTHROPIC_BASE_URL']:delete _0x424678[_0x5cb7ac(0x167)],_0x43804d['ANTHROPIC_MODEL']!==undefined?_0x424678['ANTHROPIC_MODEL']=_0x43804d[_0x5cb7ac(0x189)]:delete _0x424678['ANTHROPIC_MODEL'],_0x43804d['ANTHROPIC_AUTH_TOKEN']!==undefined?_0x424678[_0x5cb7ac(0x110)]=_0x43804d['ANTHROPIC_AUTH_TOKEN']:delete _0x424678[_0x5cb7ac(0x110)],_0x43804d[_0x5cb7ac(0x126)]!==undefined?_0x424678['CLAUDE_CODE_USE_BEDROCK']=_0x43804d[_0x5cb7ac(0x126)]:delete _0x424678[_0x5cb7ac(0x126)],_0x43804d['CLAUDE_CODE_USE_VERTEX']!==undefined?_0x424678[_0x5cb7ac(0x198)]=_0x43804d['CLAUDE_CODE_USE_VERTEX']:delete _0x424678['CLAUDE_CODE_USE_VERTEX']);const _0x39984f=_0x530732[_0x5cb7ac(0x108)],_0x1becef=((()=>{const _0x1c7fe0=_0x5cb7ac;if(!_0x39984f||typeof _0x39984f!=='object')return![];if(_0x39984f[_0x1c7fe0(0x10a)]!==_0x1c7fe0(0x19a))return![];if(typeof _0x39984f[_0x1c7fe0(0x19a)]!==_0x1c7fe0(0x120))return![];return _0x39984f[_0x1c7fe0(0x19a)][_0x1c7fe0(0x10e)](_0x1c7fe0(0x194))&&_0x39984f['command'][_0x1c7fe0(0x10e)](_0x1c7fe0(0x170));})());if(_0x1becef)delete _0x530732[_0x5cb7ac(0x108)];else _0x43804d[_0x5cb7ac(0x108)]!==undefined?_0x530732[_0x5cb7ac(0x108)]=_0x43804d[_0x5cb7ac(0x108)]:delete _0x530732[_0x5cb7ac(0x108)];_0x530732['env']=_0x424678,await writeFile(_0x995d2d,JSON[_0x5cb7ac(0x18f)](_0x530732,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x44c313(0x166)]=a9_0x44c313(0x155);[a9_0x44c313(0x147)]=a9_0x44c313(0x137);['passThroughServer'];[a9_0x44c313(0x130)];['logger'];[a9_0x44c313(0x15f)];async[a9_0x44c313(0x183)](_0x164e27){const _0x3a5c33=a9_0x44c313,{tdx:_0x4c514b,options:_0x2b33c2,args:_0x5f5013}=_0x164e27;let _0x426ee9=![];try{const _0x504290=_0x2b33c2,_0x620938=_0x504290[_0x3a5c33(0x149)]===![],_0x2fad38=_0x504290['continue']===!![],_0x3838e1=_0x504290['resume']===!![],_0x49224e=[..._0x5f5013];if(_0x2fad38)_0x49224e[_0x3a5c33(0x16e)]('-c');else _0x3838e1&&_0x49224e[_0x3a5c33(0x16e)]('-r');const _0x5e4458=createCommandSpinner(_0x3a5c33(0x16c),{'verbose':_0x2b33c2[_0x3a5c33(0x14d)]});_0x5e4458[_0x3a5c33(0x135)]();try{if(!_0x620938){_0x5e4458[_0x3a5c33(0x174)]=_0x3a5c33(0x13f),this['port']=await findAvailablePort(0xfa0),_0x5e4458['text']='✓\x20Found\x20available\x20port:\x20'+this[_0x3a5c33(0x15f)];const _0x42c458=_0x2b33c2[_0x3a5c33(0x160)];try{const _0x3ec5d6=await _0x4c514b['user'][_0x3a5c33(0x13e)]();_0x3ec5d6[_0x3a5c33(0x139)]&&writeCachedAccountInfo(_0x2b33c2[_0x3a5c33(0x181)],_0x3ec5d6[_0x3a5c33(0x139)],_0x42c458);}catch{}_0x5e4458[_0x3a5c33(0x174)]=_0x3a5c33(0x18d),this[_0x3a5c33(0x134)]=new TDXLogger(_0x2b33c2[_0x3a5c33(0x152)],!![]),await this['logger'][_0x3a5c33(0x148)]();const _0x3a1b6c=this[_0x3a5c33(0x134)][_0x3a5c33(0x196)]();_0x5e4458['text']=_0x3a5c33(0x141)+_0x3a1b6c;const _0x540113=getEndpoint(_0x2b33c2[_0x3a5c33(0x181)],_0x3a5c33(0x1a0));_0x5e4458[_0x3a5c33(0x174)]=_0x3a5c33(0x199);if(!_0x4c514b[_0x3a5c33(0x17c)][_0x3a5c33(0x18e)])throw new SDKError(ErrorCode[_0x3a5c33(0x18b)],_0x3a5c33(0x153));this[_0x3a5c33(0x12f)]=new PassThroughProxyServer({'port':this[_0x3a5c33(0x15f)],'llmProxyUrl':_0x540113,'apiKey':_0x4c514b[_0x3a5c33(0x17c)][_0x3a5c33(0x18e)],'logger':this[_0x3a5c33(0x134)],'site':_0x2b33c2['site'],'profile':_0x42c458}),await this[_0x3a5c33(0x12f)][_0x3a5c33(0x135)](),_0x5e4458[_0x3a5c33(0x174)]=_0x3a5c33(0x168)+this['port']+_0x3a5c33(0x187)+_0x540113,_0x5e4458['text']=_0x3a5c33(0x18c),this[_0x3a5c33(0x130)]=await createClaudeSettings(this['port'],undefined,_0x42c458),_0x5e4458['text']='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0x5e4458[_0x3a5c33(0x174)]='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{_0x5e4458[_0x3a5c33(0x174)]='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x3a5c33(0x134)]),_0x5e4458[_0x3a5c33(0x174)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x2901b0){_0x5e4458[_0x3a5c33(0x11c)](_0x3a5c33(0x150));throw _0x2901b0;}try{await ensureMcpServer(_0x3a5c33(0x179),'https://docs.treasuredata.com/mcp',_0x3a5c33(0x140),_0x5e4458,this['logger']);}catch(_0x31de20){handleInstallationError(_0x31de20,_0x3a5c33(0x127),_0x5e4458,this[_0x3a5c33(0x134)]);}try{const _0x4d8128=getTdSkillsRepoUrl();_0x426ee9=_0x4d8128!==DEFAULT_TD_SKILLS_URL,_0x426ee9&&await removeMarketplace(_0x3a5c33(0x14e),this['logger']),await ensureMarketplace(_0x3a5c33(0x14e),_0x4d8128,_0x5e4458,this[_0x3a5c33(0x134)]),await updateMarketplace(_0x3a5c33(0x14e),_0x5e4458,this['logger']),await ensurePlugin('sql-skills',_0x3a5c33(0x14e),_0x5e4458,this[_0x3a5c33(0x134)]),await ensurePlugin('workflow-skills',_0x3a5c33(0x14e),_0x5e4458,this['logger']),await ensurePlugin(_0x3a5c33(0x12a),_0x3a5c33(0x14e),_0x5e4458,this['logger']);}catch(_0x586371){handleInstallationError(_0x586371,'td-skills\x20Plugins',_0x5e4458,this[_0x3a5c33(0x134)]);}_0x5e4458[_0x3a5c33(0x119)]();}catch(_0x408715){_0x5e4458['fail'](_0x3a5c33(0x111));throw _0x408715;}const _0x2e10ca=await findExecutable('claude');if(!_0x2e10ca)throw new SDKError(ErrorCode[_0x3a5c33(0x16f)],_0x3a5c33(0x177),undefined,{'helpText':_0x3a5c33(0x11b)});const _0x19b1d8={...process.env};!_0x620938&&(_0x19b1d8[_0x3a5c33(0x167)]=_0x3a5c33(0x116)+this['port'],_0x19b1d8['ANTHROPIC_AUTH_TOKEN']=_0x3a5c33(0x14a),_0x19b1d8['CLAUDE_CODE_USE_BEDROCK']=_0x3a5c33(0x104),_0x19b1d8[_0x3a5c33(0x198)]=_0x3a5c33(0x104));const _0x40aa69=crossSpawn(_0x2e10ca,_0x49224e,{'stdio':_0x3a5c33(0x186),'env':_0x19b1d8}),_0x65fa00=await new Promise(_0x22c213=>{const _0xf7d4af=_0x3a5c33;_0x40aa69['on']('exit',_0x510be4=>{_0x22c213(_0x510be4||0x0);}),_0x40aa69['on'](_0xf7d4af(0x162),_0x57ab05=>{const _0x1228c1=_0xf7d4af;console[_0x1228c1(0x162)](a9_0x258091['red'](_0x1228c1(0x106)+_0x57ab05[_0x1228c1(0x14f)])),_0x22c213(0x1);});});_0x426ee9&&await restoreDefaultTdSkillsMarketplace(this[_0x3a5c33(0x134)]);this[_0x3a5c33(0x12f)]&&(await this[_0x3a5c33(0x12f)]['stop'](),console['log'](a9_0x258091['green'](_0x3a5c33(0x161))));if(this[_0x3a5c33(0x134)]){await this['logger'][_0x3a5c33(0x128)]();const _0x49f02d=this[_0x3a5c33(0x134)][_0x3a5c33(0x196)]();console['log'](a9_0x258091['green'](_0x3a5c33(0x158)+_0x49f02d));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x3a5c33(0x130)]),console[_0x3a5c33(0x133)](a9_0x258091[_0x3a5c33(0x195)](_0x3a5c33(0x115)))),_0x65fa00;}catch(_0x26ec4b){_0x426ee9&&await restoreDefaultTdSkillsMarketplace(this[_0x3a5c33(0x134)]);this['passThroughServer']&&await this[_0x3a5c33(0x12f)][_0x3a5c33(0x119)]();this[_0x3a5c33(0x134)]&&await this[_0x3a5c33(0x134)][_0x3a5c33(0x128)]();this['originalSettings']&&await restoreClaudeSettings(this['originalSettings']);throw _0x26ec4b;}}}
|
|
1
|
+
const a9_0x27e52d=a9_0x58b9;(function(_0xc71729,_0x2793de){const _0x12669f=a9_0x58b9,_0x39537e=_0xc71729();while(!![]){try{const _0x2da9fd=parseInt(_0x12669f(0xfe))/0x1*(parseInt(_0x12669f(0xe7))/0x2)+-parseInt(_0x12669f(0x91))/0x3+-parseInt(_0x12669f(0x98))/0x4*(-parseInt(_0x12669f(0xf8))/0x5)+parseInt(_0x12669f(0xac))/0x6+parseInt(_0x12669f(0xe4))/0x7+-parseInt(_0x12669f(0xc2))/0x8+parseInt(_0x12669f(0x107))/0x9*(parseInt(_0x12669f(0xfc))/0xa);if(_0x2da9fd===_0x2793de)break;else _0x39537e['push'](_0x39537e['shift']());}catch(_0x2cb3e6){_0x39537e['push'](_0x39537e['shift']());}}}(a9_0x12ab,0x4695e));function a9_0x12ab(){const _0x4471ec=['statusLine','description','stop','originalSettings','marketplace','✓\x20Settings\x20configured:\x20.claude/settings.local.json','object','✓\x20MCP\x20server\x20\x27','hostname','Command\x20output:\x20','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','init','Invalid\x20minimum\x20version\x20format:\x20','parse','close','INVALID_ARGUMENT','already\x20exists','stringify','Command\x20spawn\x20error:\x20','error','settings.local.json','continue','1181373aDcUaB','pipe','text','tdx\x20--profile\x20','false','localhost','Claude\x20Code\x20version\x20check\x20failed','42668ecmBXx','log','Installing\x20plugin\x20\x27','✓\x20Logging\x20to\x20','type','toString','✓\x20Marketplace\x20\x27','Initializing\x20proxy\x20logger...','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','verbose','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','add','Marketplace\x20\x27','\x20already\x20configured','Restored\x20default\x20td-skills\x20marketplace','cause','Initializing...','✓\x20Settings\x20restored:\x20.claude/settings.local.json','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','INTERNAL','239058PJOLmx','message','site','list','Claude\x20Code\x20CLI\x20not\x20found','patch','name','already\x20configured','\x27\x20configured','✓\x20Found\x20available\x20port:\x20','stderr','env','✓\x20Plugin\x20\x27','getLogPath','\x27...','inherit','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','includes','tdx','ANTHROPIC_MODEL','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','tdx-managed-proxy','1095056mBSLWe','data','mcp','claude','CLAUDE_CODE_UNSUPPORTED_VERSION','sql-skills','\x20is\x20too\x20old\x20(minimum:\x20','info','Failed\x20to\x20update\x20marketplace\x20\x27','proxy','exit','Warning:\x20Failed\x20to\x20configure\x20','plugin','Claude\x20Code\x20version\x20','ANTHROPIC_AUTH_TOKEN','Failed\x20to\x20remove\x20marketplace\x20\x27','ANTHROPIC_BASE_URL','resume','\x20or\x20later.','Command\x20failed\x20(exit\x20','start','\x20→\x20','CLAUDE_CODE_USE_BEDROCK','CLAUDE_CODE_NOT_FOUND','Failed\x20to\x20spawn\x20claude\x20command:\x20','minor','logger','2.0.20','account_id','user','https://github.com/treasure-data/td-skills','debug','.claude','install','800009MqKgTw','update','Finding\x20available\x20port...','14Hmchql','\x27:\x20','major','http','tdx-skills','string','context','https://docs.treasuredata.com/mcp','green','Failed\x20to\x20configure\x20marketplace\x20\x27','✓\x20Logs\x20saved\x20to\x20','command','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','):\x20claude\x20','Failed\x20to\x20install\x20plugin\x20\x27','logLevel','\x20configuration\x20failed','190LOgWlV','✓\x20Claude\x20Code\x20version\x20OK','fail','td-docs','154310gYhexb','cwd','32779ImKyFm','remove','getCurrent','statusline','passThroughServer','Executing:\x20claude\x20','llm-proxy','utf-8','Failed\x20to\x20launch\x20Claude\x20Code:\x20','18ClHWOp','td-skills','already\x20installed','\x27\x20updated','Checking\x20Claude\x20Code\x20version...','join','Configuring\x20marketplace\x20\x27','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','CLAUDE_CODE_USE_VERTEX','Configuring\x20MCP\x20server\x20\x27','profile','unshift','http://127.0.0.1:','warn','port'];a9_0x12ab=function(){return _0x4471ec;};return a9_0x12ab();}import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x483707 from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a9_0x27e52d(0xdd);function handleInstallationError(_0x5886e8,_0x3402c1,_0x4aa7db,_0x4d4eb5){const _0x447016=a9_0x27e52d;errorContains(_0x5886e8,_0x447016(0x8b),_0x447016(0x109),_0x447016(0xb3))?(_0x4aa7db[_0x447016(0x93)]='✓\x20'+_0x3402c1+_0x447016(0xa5),_0x4d4eb5?.[_0x447016(0xc9)](_0x3402c1+_0x447016(0xa5)),_0x5886e8 instanceof SDKError&&_0x5886e8[_0x447016(0xa7)]&&_0x4d4eb5?.[_0x447016(0xe1)](_0x447016(0x84)+_0x5886e8[_0x447016(0xa7)]['message'])):(_0x4aa7db['warn'](_0x447016(0xcd)+_0x3402c1),_0x4d4eb5?.['error'](_0x3402c1+_0x447016(0xf7),_0x5886e8));}export function parseVersion(_0x5b6492){const _0x581497=_0x5b6492['trim']()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x581497)return null;return{'major':parseInt(_0x581497[0x1],0xa),'minor':parseInt(_0x581497[0x2],0xa),'patch':parseInt(_0x581497[0x3],0xa)};}export function compareVersions(_0x1cbd17,_0xe62c0b){const _0x2f1240=a9_0x27e52d;if(_0x1cbd17[_0x2f1240(0xe9)]!==_0xe62c0b[_0x2f1240(0xe9)])return _0x1cbd17[_0x2f1240(0xe9)]-_0xe62c0b[_0x2f1240(0xe9)];if(_0x1cbd17[_0x2f1240(0xdb)]!==_0xe62c0b[_0x2f1240(0xdb)])return _0x1cbd17[_0x2f1240(0xdb)]-_0xe62c0b[_0x2f1240(0xdb)];return _0x1cbd17['patch']-_0xe62c0b[_0x2f1240(0xb1)];}async function checkClaudeVersion(_0x2773f3,_0x452f9d){const _0x3f7d10=a9_0x27e52d;_0x452f9d?.[_0x3f7d10(0xe1)](_0x3f7d10(0x10e)+_0x2773f3+')');const _0x26a445=await executeClaudeCommand(['--version'],undefined,_0x452f9d),_0x55b61e=parseVersion(_0x26a445);if(!_0x55b61e){_0x452f9d?.[_0x3f7d10(0x114)]('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x26a445);return;}const _0x4fb6ed=_0x55b61e[_0x3f7d10(0xe9)]+'.'+_0x55b61e[_0x3f7d10(0xdb)]+'.'+_0x55b61e[_0x3f7d10(0xb1)],_0x3fddcb=parseVersion(_0x2773f3);if(!_0x3fddcb){_0x452f9d?.[_0x3f7d10(0x114)](_0x3f7d10(0x87)+_0x2773f3);return;}if(compareVersions(_0x55b61e,_0x3fddcb)<0x0){_0x452f9d?.['error'](_0x3f7d10(0xcf)+_0x4fb6ed+_0x3f7d10(0xc8)+_0x2773f3+')');throw new SDKError(ErrorCode[_0x3f7d10(0xc6)],'Claude\x20Code\x20version\x20'+_0x4fb6ed+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x2773f3+_0x3f7d10(0xd4),undefined,{'helpText':_0x3f7d10(0xf3)});}_0x452f9d?.[_0x3f7d10(0xe1)](_0x3f7d10(0xcf)+_0x4fb6ed+'\x20meets\x20minimum\x20requirement');}function a9_0x58b9(_0x13af75,_0x4ab9cf){_0x13af75=_0x13af75-0x81;const _0x12ab79=a9_0x12ab();let _0x58b98d=_0x12ab79[_0x13af75];return _0x58b98d;}async function executeClaudeCommand(_0xc054fa,_0x598272,_0x54a6cf){const _0x1401c4=a9_0x27e52d;return _0x54a6cf?.[_0x1401c4(0xc9)](_0x1401c4(0x103)+_0xc054fa['join']('\x20')),new Promise((_0xd7ca6b,_0x1acbe5)=>{const _0x54e614=_0x1401c4,_0x1603cc=crossSpawn('claude',_0xc054fa,{'stdio':_0x54e614(0x92)});let _0x9b7c16='',_0x39944a='';_0x1603cc['stdout']?.['on'](_0x54e614(0xc3),_0x119e18=>{const _0x161e23=_0x54e614;_0x9b7c16+=_0x119e18[_0x161e23(0x9d)]();}),_0x1603cc[_0x54e614(0xb6)]?.['on'](_0x54e614(0xc3),_0x5540fc=>{const _0x313877=_0x54e614;_0x39944a+=_0x5540fc[_0x313877(0x9d)]();}),_0x1603cc['on'](_0x54e614(0x8e),_0x3f2d29=>{const _0x3d9916=_0x54e614;_0x3f2d29['code']==='ENOENT'?(_0x54a6cf?.[_0x3d9916(0x8e)](_0x3d9916(0xb0)),_0x1acbe5(new SDKError(ErrorCode[_0x3d9916(0xd9)],_0x3d9916(0xb0),_0x3f2d29,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x54a6cf?.[_0x3d9916(0x8e)](_0x3d9916(0x8d)+_0x3f2d29[_0x3d9916(0xad)]),_0x1acbe5(new SDKError(ErrorCode[_0x3d9916(0xab)],_0x3d9916(0xda)+_0x3f2d29[_0x3d9916(0xad)],_0x3f2d29)));}),_0x1603cc['on'](_0x54e614(0xcc),_0x45ad04=>{const _0x2b67c8=_0x54e614;if(_0x45ad04===0x0)_0xd7ca6b(_0x9b7c16);else _0x598272?(_0x54a6cf?.[_0x2b67c8(0x8e)](_0x2b67c8(0xd5)+_0x45ad04+_0x2b67c8(0xf4)+_0xc054fa[_0x2b67c8(0x10c)]('\x20')),_0x1acbe5(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x598272,new Error(_0x39944a)))):_0xd7ca6b('');});});}async function ensureMcpServer(_0x742b31,_0xd50e68,_0x5c0193,_0x228401,_0x35760d){const _0x19608c=a9_0x27e52d;_0x228401[_0x19608c(0x93)]=_0x19608c(0x110)+_0x742b31+_0x19608c(0xba),await executeClaudeCommand([_0x19608c(0xc4),'add',_0x742b31,_0xd50e68,'--transport',_0x5c0193],_0x19608c(0xc0)+_0x742b31+'\x27',_0x35760d),_0x228401['text']=_0x19608c(0x82)+_0x742b31+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL=a9_0x27e52d(0xe0);export function getTdSkillsRepoUrl(){const _0x547b6c=process.env.TDX_TD_SKILLS_REPO;if(_0x547b6c)return _0x547b6c;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x9b718b,_0x484a63){const _0x4c0ee1=a9_0x27e52d;try{const _0x5d348e=await executeClaudeCommand(['plugin',_0x4c0ee1(0x11a),_0x4c0ee1(0xaf)],'Failed\x20to\x20list\x20marketplaces',_0x484a63);if(!_0x5d348e[_0x4c0ee1(0xbd)](_0x9b718b)){_0x484a63?.[_0x4c0ee1(0xe1)](_0x4c0ee1(0xa4)+_0x9b718b+_0x4c0ee1(0x85));return;}await executeClaudeCommand([_0x4c0ee1(0xce),_0x4c0ee1(0x11a),_0x4c0ee1(0xff),_0x9b718b],'Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x9b718b+'\x27',_0x484a63),_0x484a63?.[_0x4c0ee1(0xc9)](_0x4c0ee1(0xa4)+_0x9b718b+'\x27\x20removed');}catch(_0x322b05){_0x484a63?.[_0x4c0ee1(0x114)](_0x4c0ee1(0xd1)+_0x9b718b+_0x4c0ee1(0xe8)+_0x322b05);}}async function restoreDefaultTdSkillsMarketplace(_0x549a53){const _0x1bbf29=a9_0x27e52d;try{await removeMarketplace(_0x1bbf29(0x108),_0x549a53),await executeClaudeCommand([_0x1bbf29(0xce),_0x1bbf29(0x11a),'add',DEFAULT_TD_SKILLS_URL],undefined,_0x549a53),_0x549a53?.[_0x1bbf29(0xc9)](_0x1bbf29(0xa6));}catch{}}async function ensureMarketplace(_0x8dd6e2,_0x3bf248,_0x502e8a,_0xce1693){const _0x110404=a9_0x27e52d;_0x502e8a[_0x110404(0x93)]=_0x110404(0x10d)+_0x8dd6e2+_0x110404(0xba),await executeClaudeCommand([_0x110404(0xce),_0x110404(0x11a),_0x110404(0xa3),_0x3bf248],_0x110404(0xf0)+_0x8dd6e2+'\x27',_0xce1693),_0x502e8a['text']=_0x110404(0x9e)+_0x8dd6e2+_0x110404(0xb4);}async function updateMarketplace(_0x4a7cf0,_0x37484b,_0xd6a1ab){const _0x226905=a9_0x27e52d;_0x37484b[_0x226905(0x93)]='Updating\x20marketplace\x20\x27'+_0x4a7cf0+_0x226905(0xba),await executeClaudeCommand([_0x226905(0xce),_0x226905(0x11a),_0x226905(0xe5)],_0x226905(0xca)+_0x4a7cf0+'\x27',_0xd6a1ab),_0x37484b[_0x226905(0x93)]=_0x226905(0x9e)+_0x4a7cf0+_0x226905(0x10a);}async function ensurePlugin(_0x3b2728,_0x39f7e7,_0x2b0ff1,_0x3af52a){const _0x57f664=a9_0x27e52d;_0x2b0ff1['text']=_0x57f664(0x9a)+_0x3b2728+_0x57f664(0xba),await executeClaudeCommand([_0x57f664(0xce),_0x57f664(0xe3),_0x3b2728+'@'+_0x39f7e7],_0x57f664(0xf5)+_0x3b2728+'\x27',_0x3af52a),_0x2b0ff1[_0x57f664(0x93)]=_0x57f664(0xb8)+_0x3b2728+'\x27\x20installed';}async function createClaudeSettings(_0x5b24ea,_0x2275d1,_0x4c5e24){const _0x249776=a9_0x27e52d,_0x49bd87=join(process[_0x249776(0xfd)](),_0x249776(0xe2)),_0x33eae5=join(_0x49bd87,_0x249776(0x8f));await mkdir(_0x49bd87,{'recursive':!![]});let _0xa88e47={};if(existsSync(_0x33eae5))try{const _0x34bd9f=await readFile(_0x33eae5,'utf-8');_0xa88e47=JSON[_0x249776(0x88)](_0x34bd9f);}catch{_0xa88e47={};}const _0x4796a2=_0xa88e47[_0x249776(0xb7)]||{},_0xc59a28={'ANTHROPIC_BASE_URL':_0x4796a2[_0x249776(0xd2)],'ANTHROPIC_MODEL':_0x4796a2[_0x249776(0xbf)],'ANTHROPIC_AUTH_TOKEN':_0x4796a2[_0x249776(0xd0)],'CLAUDE_CODE_USE_BEDROCK':_0x4796a2[_0x249776(0xd8)],'CLAUDE_CODE_USE_VERTEX':_0x4796a2[_0x249776(0x10f)],'statusLine':_0xa88e47[_0x249776(0x116)]},_0x2a4698={..._0xa88e47,'env':{..._0x4796a2,'ANTHROPIC_BASE_URL':_0x249776(0x113)+_0x5b24ea,..._0x2275d1&&{'ANTHROPIC_MODEL':_0x2275d1},'ANTHROPIC_AUTH_TOKEN':_0x249776(0xc1),'CLAUDE_CODE_USE_BEDROCK':_0x249776(0x95),'CLAUDE_CODE_USE_VERTEX':_0x249776(0x95)},'statusLine':{'type':_0x249776(0xf2),'command':_0x4c5e24?_0x249776(0x94)+_0x4c5e24+'\x20claude\x20statusline':'tdx\x20claude\x20statusline'}};return await writeFile(_0x33eae5,JSON[_0x249776(0x8c)](_0x2a4698,null,0x2)+'\x0a'),_0xc59a28;}async function restoreClaudeSettings(_0x4df124){const _0x3c8928=a9_0x27e52d,_0x16bd33=join(process[_0x3c8928(0xfd)](),'.claude'),_0x1fc669=join(_0x16bd33,_0x3c8928(0x8f));if(!existsSync(_0x1fc669))return;try{const _0x52b8b5=await readFile(_0x1fc669,_0x3c8928(0x105)),_0x5692d1=JSON[_0x3c8928(0x88)](_0x52b8b5),_0x1dc9b1=_0x5692d1[_0x3c8928(0xb7)]||{},_0x2e3deb=_0x1dc9b1[_0x3c8928(0xd2)],_0x550076=((()=>{const _0x5cefa8=_0x3c8928;if(typeof _0x2e3deb!==_0x5cefa8(0xec))return![];try{const _0x29fa6c=new URL(_0x2e3deb);return _0x29fa6c['hostname']===_0x5cefa8(0x96)||_0x29fa6c[_0x5cefa8(0x83)]==='127.0.0.1';}catch{return![];}})());_0x550076?(delete _0x1dc9b1[_0x3c8928(0xd2)],delete _0x1dc9b1[_0x3c8928(0xbf)],delete _0x1dc9b1[_0x3c8928(0xd0)],delete _0x1dc9b1[_0x3c8928(0xd8)],delete _0x1dc9b1[_0x3c8928(0x10f)]):(_0x4df124[_0x3c8928(0xd2)]!==undefined?_0x1dc9b1[_0x3c8928(0xd2)]=_0x4df124[_0x3c8928(0xd2)]:delete _0x1dc9b1['ANTHROPIC_BASE_URL'],_0x4df124[_0x3c8928(0xbf)]!==undefined?_0x1dc9b1[_0x3c8928(0xbf)]=_0x4df124[_0x3c8928(0xbf)]:delete _0x1dc9b1[_0x3c8928(0xbf)],_0x4df124['ANTHROPIC_AUTH_TOKEN']!==undefined?_0x1dc9b1[_0x3c8928(0xd0)]=_0x4df124[_0x3c8928(0xd0)]:delete _0x1dc9b1[_0x3c8928(0xd0)],_0x4df124[_0x3c8928(0xd8)]!==undefined?_0x1dc9b1[_0x3c8928(0xd8)]=_0x4df124['CLAUDE_CODE_USE_BEDROCK']:delete _0x1dc9b1[_0x3c8928(0xd8)],_0x4df124[_0x3c8928(0x10f)]!==undefined?_0x1dc9b1[_0x3c8928(0x10f)]=_0x4df124['CLAUDE_CODE_USE_VERTEX']:delete _0x1dc9b1[_0x3c8928(0x10f)]);const _0x415cbb=_0x5692d1[_0x3c8928(0x116)],_0x12f48a=((()=>{const _0x8165b2=_0x3c8928;if(!_0x415cbb||typeof _0x415cbb!==_0x8165b2(0x81))return![];if(_0x415cbb[_0x8165b2(0x9c)]!==_0x8165b2(0xf2))return![];if(typeof _0x415cbb[_0x8165b2(0xf2)]!==_0x8165b2(0xec))return![];return _0x415cbb[_0x8165b2(0xf2)][_0x8165b2(0xbd)](_0x8165b2(0xbe))&&_0x415cbb[_0x8165b2(0xf2)][_0x8165b2(0xbd)](_0x8165b2(0x101));})());if(_0x12f48a)delete _0x5692d1[_0x3c8928(0x116)];else _0x4df124['statusLine']!==undefined?_0x5692d1[_0x3c8928(0x116)]=_0x4df124[_0x3c8928(0x116)]:delete _0x5692d1['statusLine'];_0x5692d1[_0x3c8928(0xb7)]=_0x1dc9b1,await writeFile(_0x1fc669,JSON[_0x3c8928(0x8c)](_0x5692d1,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x27e52d(0xb2)]=a9_0x27e52d(0xc5);[a9_0x27e52d(0x117)]=a9_0x27e52d(0xbc);['passThroughServer'];['originalSettings'];[a9_0x27e52d(0xdc)];[a9_0x27e52d(0x115)];async['execute'](_0x453690){const _0x15cff9=a9_0x27e52d,{tdx:_0x2affc2,options:_0x39da9b,args:_0x5d5308}=_0x453690;let _0x4a55e5=![];try{const _0x1f8f01=_0x39da9b,_0xa907f7=_0x1f8f01[_0x15cff9(0xcb)]===![],_0x27e331=_0x1f8f01[_0x15cff9(0x90)]===!![],_0x18975b=_0x1f8f01[_0x15cff9(0xd3)]===!![],_0x433d5e=[..._0x5d5308];if(_0x27e331)_0x433d5e[_0x15cff9(0x112)]('-c');else _0x18975b&&_0x433d5e[_0x15cff9(0x112)]('-r');const _0x50a015=createCommandSpinner(_0x15cff9(0xa8),{'verbose':_0x39da9b[_0x15cff9(0xa1)]});_0x50a015[_0x15cff9(0xd6)]();try{if(!_0xa907f7){_0x50a015[_0x15cff9(0x93)]=_0x15cff9(0xe6),this[_0x15cff9(0x115)]=await findAvailablePort(0xfa0),_0x50a015[_0x15cff9(0x93)]=_0x15cff9(0xb5)+this[_0x15cff9(0x115)];const _0x522232=_0x39da9b[_0x15cff9(0x111)];try{const _0x227ecf=await _0x2affc2[_0x15cff9(0xdf)][_0x15cff9(0x100)]();_0x227ecf[_0x15cff9(0xde)]&&writeCachedAccountInfo(_0x39da9b[_0x15cff9(0xae)],_0x227ecf[_0x15cff9(0xde)],_0x522232);}catch{}_0x50a015[_0x15cff9(0x93)]=_0x15cff9(0x9f),this[_0x15cff9(0xdc)]=new TDXLogger(_0x39da9b[_0x15cff9(0xf6)],!![]),await this['logger'][_0x15cff9(0x86)]();const _0x403fc0=this[_0x15cff9(0xdc)]['getLogPath']();_0x50a015['text']=_0x15cff9(0x9b)+_0x403fc0;const _0x42271a=getEndpoint(_0x39da9b[_0x15cff9(0xae)],_0x15cff9(0x104));_0x50a015[_0x15cff9(0x93)]=_0x15cff9(0xa0);if(!_0x2affc2[_0x15cff9(0xed)]['apiKey'])throw new SDKError(ErrorCode[_0x15cff9(0x8a)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x15cff9(0x102)]=new PassThroughProxyServer({'port':this[_0x15cff9(0x115)],'llmProxyUrl':_0x42271a,'apiKey':_0x2affc2[_0x15cff9(0xed)]['apiKey'],'logger':this['logger'],'site':_0x39da9b[_0x15cff9(0xae)],'profile':_0x522232}),await this[_0x15cff9(0x102)][_0x15cff9(0xd6)](),_0x50a015[_0x15cff9(0x93)]=_0x15cff9(0xaa)+this[_0x15cff9(0x115)]+_0x15cff9(0xd7)+_0x42271a,_0x50a015['text']='Creating\x20.claude/settings.local.json...',this[_0x15cff9(0x119)]=await createClaudeSettings(this['port'],undefined,_0x522232),_0x50a015['text']=_0x15cff9(0x11b);}else _0x50a015[_0x15cff9(0x93)]=_0x15cff9(0xa2);try{_0x50a015[_0x15cff9(0x93)]=_0x15cff9(0x10b),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x15cff9(0xdc)]),_0x50a015['text']=_0x15cff9(0xf9);}catch(_0x192e45){_0x50a015['fail'](_0x15cff9(0x97));throw _0x192e45;}try{await ensureMcpServer(_0x15cff9(0xfb),_0x15cff9(0xee),_0x15cff9(0xea),_0x50a015,this[_0x15cff9(0xdc)]);}catch(_0x1e4681){handleInstallationError(_0x1e4681,'TD\x20Docs\x20MCP\x20Server',_0x50a015,this['logger']);}try{const _0x40399c=getTdSkillsRepoUrl();_0x4a55e5=_0x40399c!==DEFAULT_TD_SKILLS_URL,_0x4a55e5&&await removeMarketplace(_0x15cff9(0x108),this['logger']),await ensureMarketplace(_0x15cff9(0x108),_0x40399c,_0x50a015,this['logger']),await updateMarketplace(_0x15cff9(0x108),_0x50a015,this[_0x15cff9(0xdc)]),await ensurePlugin(_0x15cff9(0xc7),_0x15cff9(0x108),_0x50a015,this['logger']),await ensurePlugin('workflow-skills',_0x15cff9(0x108),_0x50a015,this[_0x15cff9(0xdc)]),await ensurePlugin(_0x15cff9(0xeb),'td-skills',_0x50a015,this[_0x15cff9(0xdc)]);}catch(_0x4736e4){handleInstallationError(_0x4736e4,'td-skills\x20Plugins',_0x50a015,this[_0x15cff9(0xdc)]);}_0x50a015[_0x15cff9(0x118)]();}catch(_0x32b344){_0x50a015[_0x15cff9(0xfa)]('Setup\x20failed');throw _0x32b344;}const _0x10cf03=await findExecutable('claude');if(!_0x10cf03)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x15cff9(0xb0),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x2c6f1a={...process.env};!_0xa907f7&&(_0x2c6f1a[_0x15cff9(0xd2)]='http://127.0.0.1:'+this['port'],_0x2c6f1a[_0x15cff9(0xd0)]='tdx-managed-proxy',_0x2c6f1a['CLAUDE_CODE_USE_BEDROCK']=_0x15cff9(0x95),_0x2c6f1a[_0x15cff9(0x10f)]=_0x15cff9(0x95));const _0x237c5d=crossSpawn(_0x10cf03,_0x433d5e,{'stdio':_0x15cff9(0xbb),'env':_0x2c6f1a}),_0x6fea66=await new Promise(_0x25d6e3=>{const _0x4ed6d9=_0x15cff9;_0x237c5d['on'](_0x4ed6d9(0xcc),_0x1ac8ee=>{_0x25d6e3(_0x1ac8ee||0x0);}),_0x237c5d['on'](_0x4ed6d9(0x8e),_0x4377e6=>{const _0x5c3450=_0x4ed6d9;console[_0x5c3450(0x8e)](a9_0x483707['red'](_0x5c3450(0x106)+_0x4377e6[_0x5c3450(0xad)])),_0x25d6e3(0x1);});});_0x4a55e5&&await restoreDefaultTdSkillsMarketplace(this[_0x15cff9(0xdc)]);this[_0x15cff9(0x102)]&&(await this[_0x15cff9(0x102)][_0x15cff9(0x118)](),console['log'](a9_0x483707[_0x15cff9(0xef)]('✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped')));if(this['logger']){await this[_0x15cff9(0xdc)][_0x15cff9(0x89)]();const _0x3160ea=this[_0x15cff9(0xdc)][_0x15cff9(0xb9)]();console[_0x15cff9(0x99)](a9_0x483707[_0x15cff9(0xef)](_0x15cff9(0xf1)+_0x3160ea));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x15cff9(0x119)]),console['log'](a9_0x483707[_0x15cff9(0xef)](_0x15cff9(0xa9)))),_0x6fea66;}catch(_0xb5b9f5){_0x4a55e5&&await restoreDefaultTdSkillsMarketplace(this[_0x15cff9(0xdc)]);this[_0x15cff9(0x102)]&&await this[_0x15cff9(0x102)][_0x15cff9(0x118)]();this[_0x15cff9(0xdc)]&&await this[_0x15cff9(0xdc)][_0x15cff9(0x89)]();this[_0x15cff9(0x119)]&&await restoreClaudeSettings(this[_0x15cff9(0x119)]);throw _0xb5b9f5;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a10_0x5d7268=a10_0x41fe;(function(_0x82f9dd,_0x682e2d){const _0x578905=a10_0x41fe,_0x3f413a=_0x82f9dd();while(!![]){try{const _0x3e8c46=parseInt(_0x578905(0x157))/0x1+-parseInt(_0x578905(0x150))/0x2*(-parseInt(_0x578905(0x143))/0x3)+parseInt(_0x578905(0x155))/0x4+parseInt(_0x578905(0x15e))/0x5*(-parseInt(_0x578905(0x14e))/0x6)+-parseInt(_0x578905(0x153))/0x7*(-parseInt(_0x578905(0x167))/0x8)+-parseInt(_0x578905(0x142))/0x9*(-parseInt(_0x578905(0x15f))/0xa)+-parseInt(_0x578905(0x166))/0xb;if(_0x3e8c46===_0x682e2d)break;else _0x3f413a['push'](_0x3f413a['shift']());}catch(_0x2e774c){_0x3f413a['push'](_0x3f413a['shift']());}}}(a10_0x2d9f,0xda3e0));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a10_0x41fe(_0x4b11ea,_0x250b25){_0x4b11ea=_0x4b11ea-0x140;const _0x2d9fff=a10_0x2d9f();let _0x41fef5=_0x2d9fff[_0x4b11ea];return _0x41fef5;}import{readCachedAccountInfo}from'../core/config.js';function a10_0x2d9f(){const _0x54df37=['💎\x20','latestInputTokens','log','session_id','48951595CRiEPS','3648536hWHSpL','model','stdin','54KupPqh','4790424KzdxLp','🧠\x20','monthCredits','💎\x20tdx\x20-\x20Claude','tdx','todayCredits','tdx\x20','line','\x20today\x20/\x20','toFixed','statusline','9606irACKv','options','2BwZNvq','\x20session\x20/\x20','name','21ETOFLc','description','6387488ynqQDw','\x20|\x20','58994CwEimt','\x20month','\x20-\x20','site','close','push','🪙\x20credit:\x20','680NAekuE','1568210nbsdus','parse','profile'];a10_0x2d9f=function(){return _0x54df37;};return a10_0x2d9f();}import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x223aed=0x64){return new Promise(_0x32b2a6=>{const _0x13ccd9=a10_0x41fe;let _0x2edc60='',_0x5392ef=![];const _0x268c88=createInterface({'input':process[_0x13ccd9(0x141)],'terminal':![]}),_0xf1ce94=_0x55f182=>{const _0x2438d4=_0x13ccd9;if(_0x5392ef)return;_0x5392ef=!![],clearTimeout(_0x1b4976),_0x268c88[_0x2438d4(0x15b)](),_0x32b2a6(_0x55f182);},_0x1b4976=setTimeout(()=>{_0xf1ce94(null);},_0x223aed);_0x268c88['on'](_0x13ccd9(0x14a),_0x57b849=>{_0x2edc60+=_0x57b849;}),_0x268c88['on'](_0x13ccd9(0x15b),()=>{const _0x65469e=_0x13ccd9;if(_0x5392ef)return;try{const _0x3dbc7d=JSON[_0x65469e(0x160)](_0x2edc60);_0xf1ce94(_0x3dbc7d);}catch{_0xf1ce94(null);}});});}function formatCredits(_0x355a73){const _0x58c34f=a10_0x41fe;return _0x355a73[_0x58c34f(0x14c)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x5d7268(0x152)]=a10_0x5d7268(0x14d);[a10_0x5d7268(0x154)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async['execute'](_0x10b19f){const _0x2ba0fc=a10_0x5d7268;try{const _0x182354=await readStdinJson();if(!_0x182354?.[_0x2ba0fc(0x165)])return console[_0x2ba0fc(0x164)](_0x2ba0fc(0x146)),0x0;const _0x4af469=_0x182354[_0x2ba0fc(0x165)],_0xeddfd6=_0x182354[_0x2ba0fc(0x140)]?.['id']||'',_0xdc025a=_0x182354[_0x2ba0fc(0x161)]||_0x10b19f[_0x2ba0fc(0x14f)][_0x2ba0fc(0x161)],_0x3401a1=await getUsageStats(_0x4af469,_0xdc025a),_0xb8c810=[],_0x3cd316=readCachedAccountInfo(_0xdc025a),_0x2aff3b=_0x3cd316?_0x2ba0fc(0x149)+_0x3cd316[_0x2ba0fc(0x15a)]+':'+_0x3cd316['accountId']:_0x2ba0fc(0x147),_0x317d2f=_0xeddfd6?getModelDisplayName(_0xeddfd6):'Claude';_0xb8c810[_0x2ba0fc(0x15c)](_0x2ba0fc(0x162)+_0x2aff3b+_0x2ba0fc(0x159)+_0x317d2f);const _0x60669=formatCredits(_0x3401a1['sessionCredits']),_0x813ced=formatCredits(_0x3401a1[_0x2ba0fc(0x148)]),_0x728fb7=formatCredits(_0x3401a1[_0x2ba0fc(0x145)]);_0xb8c810[_0x2ba0fc(0x15c)](_0x2ba0fc(0x15d)+_0x60669+_0x2ba0fc(0x151)+_0x813ced+_0x2ba0fc(0x14b)+_0x728fb7+_0x2ba0fc(0x158));if(_0x3401a1[_0x2ba0fc(0x163)]>0x0&&_0xeddfd6){const _0x4d7375=formatTokenCount(_0x3401a1['latestInputTokens']),_0x5d577a=calculateContextPercentage(_0x3401a1[_0x2ba0fc(0x163)],_0xeddfd6);_0xb8c810['push'](_0x2ba0fc(0x144)+_0x4d7375+'\x20('+_0x5d577a+'%)');}return console[_0x2ba0fc(0x164)](_0xb8c810['join'](_0x2ba0fc(0x156))),0x0;}catch{return console['log'](_0x2ba0fc(0x146)),0x0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a11_0x3cd0ab=a11_0x2099;function a11_0x4881(){const _0x581caf=['numeric','never','5776014OBywsi','7UqWnBP','\x20\x20Month:\x20\x20\x20','format','en-CA','length','short','repeat','usage','Requests','Error:\x20','243zBctZB','getTime','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','Profile','map','description','54jAYhKj','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','Total','json','26299658EFdByQ','Last\x20Used','556785LjzKTj','red','827337obDvOH','dim','log','Month','round','outputTable','toLocaleDateString','padStart','14106wzjSlb','padEnd','monthCredits','credits','\x20credits','todayCredits','today\x20','24ZszQZv','toLocaleTimeString','yesterday','\x20\x20Today:\x20\x20\x20','1659370vcOCqC','outputStructured','entryCount','lastUsedAt','en-US','toFixed','max','execute','Unknown\x20error','cyan','default','(default)','1836576EiovmR','source','all','bold','2-digit','profile','Usage\x20by\x20Source','Source','Today','error'];a11_0x4881=function(){return _0x581caf;};return a11_0x4881();}(function(_0x254e51,_0xd5ae6e){const _0x6350f5=a11_0x2099,_0x250f10=_0x254e51();while(!![]){try{const _0x41e4a9=parseInt(_0x6350f5(0x1d5))/0x1+parseInt(_0x6350f5(0x1dd))/0x2*(parseInt(_0x6350f5(0x1c6))/0x3)+-parseInt(_0x6350f5(0x1e4))/0x4*(parseInt(_0x6350f5(0x1d3))/0x5)+parseInt(_0x6350f5(0x1bb))/0x6*(parseInt(_0x6350f5(0x1bc))/0x7)+parseInt(_0x6350f5(0x1f4))/0x8+-parseInt(_0x6350f5(0x1cd))/0x9*(-parseInt(_0x6350f5(0x1e8))/0xa)+-parseInt(_0x6350f5(0x1d1))/0xb;if(_0x41e4a9===_0xd5ae6e)break;else _0x250f10['push'](_0x250f10['shift']());}catch(_0x1a791b){_0x250f10['push'](_0x250f10['shift']());}}}(a11_0x4881,0x80c71));import a11_0x1733b6 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0xfac09f){const _0x5bad78=a11_0x2099;return _0xfac09f[_0x5bad78(0x1ed)](0x2);}function formatLastUsed(_0x5852a5){const _0x266829=a11_0x2099;if(!_0x5852a5)return _0x266829(0x1ba);const _0x480d5a=new Date(_0x5852a5),_0x191401=new Date(),_0x9f43e8=_0x480d5a[_0x266829(0x1db)](_0x266829(0x1bf)),_0x1d7cdc=_0x191401[_0x266829(0x1db)]('en-CA');if(_0x9f43e8===_0x1d7cdc)return _0x266829(0x1e3)+_0x480d5a[_0x266829(0x1e5)]('en-US',{'hour':_0x266829(0x1f8),'minute':_0x266829(0x1f8)});const _0x4e1f1a=new Date(_0x9f43e8),_0x4b7b65=new Date(_0x1d7cdc),_0x25a499=Math[_0x266829(0x1d9)]((_0x4b7b65['getTime']()-_0x4e1f1a[_0x266829(0x1c7)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x25a499===0x1)return _0x266829(0x1e6);else return _0x25a499>0x1&&_0x25a499<0x7?_0x25a499+'\x20days\x20ago':_0x480d5a[_0x266829(0x1db)](_0x266829(0x1ec),{'month':_0x266829(0x1c1),'day':_0x266829(0x1b9)});}function a11_0x2099(_0x20af57,_0x191a63){_0x20af57=_0x20af57-0x1b5;const _0x48813b=a11_0x4881();let _0x20991d=_0x48813b[_0x20af57];return _0x20991d;}export class ClaudeUsageCommand extends BaseCommand{['name']=a11_0x3cd0ab(0x1c3);[a11_0x3cd0ab(0x1cc)]=a11_0x3cd0ab(0x1ce);async[a11_0x3cd0ab(0x1ef)](_0x1c9aaf){const _0x5059b1=a11_0x3cd0ab,{options:_0x57272b}=_0x1c9aaf,_0x373f8c=_0x57272b['format']===_0x5059b1(0x1d0)||_0x57272b[_0x5059b1(0x1be)]==='jsonl'||_0x57272b[_0x5059b1(0x1d0)];try{const [_0x355126,_0xa787cf,_0x39cee0]=await Promise[_0x5059b1(0x1f6)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x373f8c?await this[_0x5059b1(0x1e9)](_0x355126,_0xa787cf,_0x39cee0,_0x57272b):this[_0x5059b1(0x1da)](_0x355126,_0xa787cf,_0x39cee0),0x0;}catch(_0x43e3e0){const _0x5a3359=_0x43e3e0 instanceof Error?_0x43e3e0['message']:_0x5059b1(0x1f0);return console[_0x5059b1(0x1b8)](a11_0x1733b6[_0x5059b1(0x1d4)](_0x5059b1(0x1c5)+_0x5a3359)),0x1;}}async['outputStructured'](_0x5eab26,_0x28a3e0,_0x1972f5,_0x3cadc2){const _0x51f619=a11_0x3cd0ab,_0x44a3a2={'summary':{'todayCredits':_0x1972f5[_0x51f619(0x1e2)],'monthCredits':_0x1972f5[_0x51f619(0x1df)],'totalCredits':_0x1972f5['totalCredits'],'profileCount':_0x1972f5['profileCount']},'profiles':_0x5eab26['map'](_0x119c8f=>({'profile':_0x119c8f['profile'],'credits':_0x119c8f[_0x51f619(0x1e0)],'requests':_0x119c8f[_0x51f619(0x1ea)],'lastUsedAt':_0x119c8f[_0x51f619(0x1eb)]})),'sources':_0x28a3e0[_0x51f619(0x1cb)](_0x429735=>({'source':_0x429735[_0x51f619(0x1f5)],'credits':_0x429735[_0x51f619(0x1e0)],'todayCredits':_0x429735[_0x51f619(0x1e2)],'monthCredits':_0x429735[_0x51f619(0x1df)],'requests':_0x429735[_0x51f619(0x1ea)]}))};await handleSDKOutput([_0x44a3a2],_0x3cadc2);}[a11_0x3cd0ab(0x1da)](_0x5b11d0,_0x1de915,_0x4ac2bc){const _0x729406=a11_0x3cd0ab;console[_0x729406(0x1d7)](a11_0x1733b6[_0x729406(0x1f7)](_0x729406(0x1c8))),console[_0x729406(0x1d7)](a11_0x1733b6['dim']('─'[_0x729406(0x1c2)](0x32))),console[_0x729406(0x1d7)](_0x729406(0x1e7)+a11_0x1733b6[_0x729406(0x1f1)](formatCredits(_0x4ac2bc[_0x729406(0x1e2)]))+'\x20credits'),console[_0x729406(0x1d7)](_0x729406(0x1bd)+a11_0x1733b6[_0x729406(0x1f1)](formatCredits(_0x4ac2bc['monthCredits']))+_0x729406(0x1e1)),console[_0x729406(0x1d7)]('\x20\x20Total:\x20\x20\x20'+a11_0x1733b6[_0x729406(0x1f1)](formatCredits(_0x4ac2bc['totalCredits']))+_0x729406(0x1e1)),console[_0x729406(0x1d7)]();if(_0x1de915[_0x729406(0x1c0)]>0x0){console[_0x729406(0x1d7)](a11_0x1733b6['bold'](_0x729406(0x1b5))),console[_0x729406(0x1d7)](a11_0x1733b6[_0x729406(0x1d6)]('─'[_0x729406(0x1c2)](0x3c)));const _0x54db7c=0xc,_0x1b5c17=0xa,_0x15b0f=0xa,_0x11082c=0xa;console[_0x729406(0x1d7)]('\x20\x20'+_0x729406(0x1b6)[_0x729406(0x1de)](_0x54db7c)+'\x20\x20'+_0x729406(0x1cf)[_0x729406(0x1dc)](_0x1b5c17)+'\x20\x20'+_0x729406(0x1b7)['padStart'](_0x15b0f)+'\x20\x20'+_0x729406(0x1d8)[_0x729406(0x1dc)](_0x11082c));for(const _0x116033 of _0x1de915){console[_0x729406(0x1d7)]('\x20\x20'+_0x116033[_0x729406(0x1f5)][_0x729406(0x1de)](_0x54db7c)+'\x20\x20'+a11_0x1733b6[_0x729406(0x1f1)](formatCredits(_0x116033['credits'])[_0x729406(0x1dc)](_0x1b5c17))+'\x20\x20'+formatCredits(_0x116033['todayCredits'])['padStart'](_0x15b0f)+'\x20\x20'+formatCredits(_0x116033['monthCredits'])[_0x729406(0x1dc)](_0x11082c));}console[_0x729406(0x1d7)]();}if(_0x5b11d0[_0x729406(0x1c0)]===0x0){console[_0x729406(0x1d7)](a11_0x1733b6[_0x729406(0x1d6)]('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x729406(0x1d7)](a11_0x1733b6[_0x729406(0x1d6)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x729406(0x1d7)](a11_0x1733b6[_0x729406(0x1f7)]('Usage\x20by\x20Profile')),console[_0x729406(0x1d7)](a11_0x1733b6[_0x729406(0x1d6)]('─'[_0x729406(0x1c2)](0x3c)));const _0x517ab8=Math[_0x729406(0x1ee)](0xc,..._0x5b11d0[_0x729406(0x1cb)](_0x4dadd6=>_0x4dadd6[_0x729406(0x1f9)]===_0x729406(0x1f2)?_0x729406(0x1f3)['length']:_0x4dadd6[_0x729406(0x1f9)]['length'])),_0x21ceb1=0xa,_0x5d2985=0xa;console[_0x729406(0x1d7)]('\x20\x20'+_0x729406(0x1ca)[_0x729406(0x1de)](_0x517ab8)+'\x20\x20'+'Credits'[_0x729406(0x1dc)](_0x21ceb1)+'\x20\x20'+_0x729406(0x1c4)[_0x729406(0x1dc)](_0x5d2985)+'\x20\x20'+_0x729406(0x1d2));for(const _0x1ba0c7 of _0x5b11d0){const _0x137369=_0x1ba0c7[_0x729406(0x1f9)]===_0x729406(0x1f2)?_0x729406(0x1f3):_0x1ba0c7[_0x729406(0x1f9)],_0x25f28e=_0x137369['padEnd'](_0x517ab8),_0x26b972=_0x1ba0c7[_0x729406(0x1f9)]===_0x729406(0x1f2)?a11_0x1733b6[_0x729406(0x1d6)](_0x25f28e):_0x25f28e;console[_0x729406(0x1d7)]('\x20\x20'+_0x26b972+'\x20\x20'+a11_0x1733b6[_0x729406(0x1f1)](formatCredits(_0x1ba0c7['credits'])[_0x729406(0x1dc)](_0x21ceb1))+'\x20\x20'+String(_0x1ba0c7[_0x729406(0x1ea)])['padStart'](_0x5d2985)+'\x20\x20'+a11_0x1733b6[_0x729406(0x1d6)](formatLastUsed(_0x1ba0c7['lastUsedAt'])));}console[_0x729406(0x1d7)](),console[_0x729406(0x1d7)](a11_0x1733b6[_0x729406(0x1d6)](_0x729406(0x1c9))),console[_0x729406(0x1d7)]();}}
|
package/dist/commands/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x395141=a12_0x1a26;(function(_0x3aba80,_0x59f7b7){const _0x133cfd=a12_0x1a26,_0x1459af=_0x3aba80();while(!![]){try{const _0x3bda71=-parseInt(_0x133cfd(0xfe))/0x1*(parseInt(_0x133cfd(0xf8))/0x2)+-parseInt(_0x133cfd(0x11a))/0x3+parseInt(_0x133cfd(0xfb))/0x4+-parseInt(_0x133cfd(0xeb))/0x5*(parseInt(_0x133cfd(0x102))/0x6)+-parseInt(_0x133cfd(0xf1))/0x7+-parseInt(_0x133cfd(0xfd))/0x8+parseInt(_0x133cfd(0x109))/0x9*(parseInt(_0x133cfd(0xee))/0xa);if(_0x3bda71===_0x59f7b7)break;else _0x1459af['push'](_0x1459af['shift']());}catch(_0x3865ff){_0x1459af['push'](_0x1459af['shift']());}}}(a12_0x19ae,0x1a090));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';function a12_0x1a26(_0x5d95d0,_0x3c0679){_0x5d95d0=_0x5d95d0-0xe9;const _0x19ae90=a12_0x19ae();let _0x1a2635=_0x19ae90[_0x5d95d0];return _0x1a2635;}import{Logger}from'../utils/logger/index.js';import a12_0x3bc1cc from'chalk';export function printAuthError(_0x342dc5,_0x1685b8=![],_0x35dd92){const _0x31165a=a12_0x1a26,_0x5e1a48=_0x342dc5[_0x31165a(0xea)]?.[_0x31165a(0x10b)]||_0x342dc5['message'];console[_0x31165a(0x10f)](a12_0x3bc1cc['red'](_0x31165a(0xf5))),console[_0x31165a(0x10f)](a12_0x3bc1cc[_0x31165a(0xf9)](_0x31165a(0xec)+_0x5e1a48));if(_0x1685b8){const _0xaca845=_0x35dd92?'\x20--profile\x20'+_0x35dd92:'';console[_0x31165a(0x10f)]('\x0a'+a12_0x3bc1cc[_0x31165a(0x107)](_0x31165a(0xf0))),console[_0x31165a(0x10f)]('\x20\x20'+a12_0x3bc1cc[_0x31165a(0x117)](_0x31165a(0x113)+_0xaca845)+'\x0a'),console['error'](''+a12_0x3bc1cc[_0x31165a(0x107)]('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x31165a(0x10f)]('\x20\x20'+a12_0x3bc1cc[_0x31165a(0x117)](_0x31165a(0xff)+_0xaca845));}}function a12_0x19ae(){const _0x5479fe=['detail','profile','yellow','Error:\x20','error','commands','Authentication\x20error\x20stack\x20trace:','category','tdx\x20auth\x20setup','validateGlobalOptions','Command\x20\x27','command','cyan','register','limit','558078cvIvGJ','has','problemDetails','5VMPPcO','Reason:\x20','from','2134390lSgwWV','helpText','To\x20set\x20up\x20authentication:','1169658XJjEOM','\x27\x20is\x20already\x20registered','USER_ERROR','number','Authentication\x20failed','name','values','206qEBNQx','red','test','668504wpGdAE','options','570728eRJWgh','72jcYZZA','tdx\x20auth','run','\x0aStack\x20trace:\x0a','332922ushUzi','validate','set','Invalid\x20limit\x20value:\x20','.\x20Must\x20be\x20a\x20number.','dim','isValid','18TLWFdl','stack'];a12_0x19ae=function(){return _0x5479fe;};return a12_0x19ae();}export class BaseCommand{[a12_0x395141(0x114)](_0x513f8e){const _0x15bef8=a12_0x395141,{options:_0x36f7eb}=_0x513f8e,_0x11ca6b=_0x36f7eb[_0x15bef8(0x119)];if(_0x11ca6b!==undefined){const _0x46f88b=typeof _0x11ca6b===_0x15bef8(0xf4)?_0x11ca6b:parseInt(_0x11ca6b,0xa);if(isNaN(_0x46f88b))return _0x15bef8(0x105)+_0x11ca6b+_0x15bef8(0x106);const _0x115840=validateLimitOption(_0x46f88b);if(!_0x115840[_0x15bef8(0x108)])return _0x115840[_0x15bef8(0x10f)];_0x513f8e['options'][_0x15bef8(0x119)]=_0x115840['value'];}return undefined;}['validate'](_0x125ae1){return undefined;}async[a12_0x395141(0x100)](_0x422e09){const _0x5cc4db=a12_0x395141;try{const _0x4dc72f=this[_0x5cc4db(0x114)](_0x422e09);if(_0x4dc72f)return console[_0x5cc4db(0x10f)](_0x5cc4db(0x10e)+_0x4dc72f),0x1;const _0x5b96ba=this[_0x5cc4db(0x103)](_0x422e09);if(_0x5b96ba){const _0x599e9b=/^\s*(Usage|Note|Warning|Error):/i[_0x5cc4db(0xfa)](_0x5b96ba);return _0x599e9b?console[_0x5cc4db(0x10f)](_0x5b96ba):console[_0x5cc4db(0x10f)](_0x5cc4db(0x10e)+_0x5b96ba),0x1;}const _0x3f0728=await this['execute'](_0x422e09);return _0x3f0728??0x0;}catch(_0x4df523){if(_0x4df523 instanceof Error){if(_0x4df523 instanceof HTTPClientError&&_0x4df523['status']===0x191){const _0x196750=_0x422e09[_0x5cc4db(0xfc)][_0x5cc4db(0x10c)];printAuthError(_0x4df523,!![],_0x196750);if(_0x4df523[_0x5cc4db(0x10a)]){const _0x2a2038=Logger['of'](_0x5cc4db(0x116));_0x2a2038['debug'](_0x5cc4db(0x111)),_0x2a2038['debug'](_0x4df523[_0x5cc4db(0x10a)]);}return 0x1;}console[_0x5cc4db(0x10f)](a12_0x3bc1cc['red'](_0x5cc4db(0x10e)+_0x4df523['message']));_0x4df523 instanceof SDKError&&_0x4df523[_0x5cc4db(0xef)]&&console[_0x5cc4db(0x10f)](a12_0x3bc1cc[_0x5cc4db(0x10d)](_0x4df523['helpText']));const _0x5d2cbf=_0x4df523 instanceof SDKError&&_0x4df523[_0x5cc4db(0x112)]===ErrorCategory[_0x5cc4db(0xf3)];_0x4df523[_0x5cc4db(0x10a)]&&!_0x5d2cbf&&console[_0x5cc4db(0x10f)](_0x5cc4db(0x101)+_0x4df523[_0x5cc4db(0x10a)]);}else console[_0x5cc4db(0x10f)](_0x5cc4db(0x10e)+String(_0x4df523));return 0x1;}}}export class CommandRegistry{[a12_0x395141(0x110)]=new Map();[a12_0x395141(0x118)](_0x51d15d){const _0x276e34=a12_0x395141;if(this['commands'][_0x276e34(0xe9)](_0x51d15d[_0x276e34(0xf6)]))throw new Error(_0x276e34(0x115)+_0x51d15d[_0x276e34(0xf6)]+_0x276e34(0xf2));this['commands'][_0x276e34(0x104)](_0x51d15d[_0x276e34(0xf6)],_0x51d15d);}['get'](_0x16291a){const _0x294f3b=a12_0x395141;return this[_0x294f3b(0x110)]['get'](_0x16291a);}['getAll'](){const _0x58ed01=a12_0x395141;return Array[_0x58ed01(0xed)](this[_0x58ed01(0x110)][_0x58ed01(0xf7)]());}[a12_0x395141(0xe9)](_0x299380){const _0x33e10c=a12_0x395141;return this[_0x33e10c(0x110)][_0x33e10c(0xe9)](_0x299380);}}export const registry=new CommandRegistry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a13_0x505ec5=a13_0x1069;(function(_0xc5fd80,_0x4e5023){const _0x412ee1=a13_0x1069,_0x5406db=_0xc5fd80();while(!![]){try{const _0x296b61=parseInt(_0x412ee1(0x1f6))/0x1*(parseInt(_0x412ee1(0x1d4))/0x2)+-parseInt(_0x412ee1(0x1e9))/0x3+-parseInt(_0x412ee1(0x1bc))/0x4+-parseInt(_0x412ee1(0x1a5))/0x5+parseInt(_0x412ee1(0x1a8))/0x6*(parseInt(_0x412ee1(0x1e4))/0x7)+parseInt(_0x412ee1(0x201))/0x8*(parseInt(_0x412ee1(0x1f1))/0x9)+parseInt(_0x412ee1(0x1be))/0xa;if(_0x296b61===_0x4e5023)break;else _0x5406db['push'](_0x5406db['shift']());}catch(_0x8de5ab){_0x5406db['push'](_0x5406db['shift']());}}}(a13_0x3a72,0x2ef4b));import{BaseCommand}from'./command.js';function a13_0x3a72(){const _0x1de50b=['connection','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','yellow','label','7xWQNNq','list','site','find','push','1003704FrAkNv','<=\x20','credential','validate','Options:\x20','input','options','Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.','4905OXFXXf','stringify','Range:\x20','verbose','Show\x20connection\x20details','4gfgmDz','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','name','record','settings','Name:\x20','\x20[record]','List\x20available\x20connector\x20types','\x0aAvailable\x20fields:','hint','criteria','1704TrZRap','\x27\x20as\x20connector\x20type','entries','✔\x20Found\x20schema\x20for\x20connection\x20\x27','findByName','Resolving\x20connector\x20type\x20or\x20name:\x20','description','Listing\x20connections...','bold','hidden','\x0aCredential\x20settings:','\x27...','✔\x20Found\x20connection:\x20','\x20\x20\x20\x20','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','Default:\x20','resolve','padStart','join','\x0aNo\x20credential\x20settings\x20defined','\x20connection','Listing\x20connector\x20types...','1858100XVukiZ','Treating\x20\x27','legacy_settings','42618EUWUlp','No\x20available\x20fields\x20for\x20this\x20connector','maximum','\x20\x20\x20\x20Default:\x20','execute','filter','✔\x20Found\x20','map','\x20\x20\x20\x20Options:\x20','getOutputSchema','properties','connection:settings','title','\x20-\x20','log','Site:\x20','\x0aConnector:\x20','List\x20all\x20result\x20output\x20connections','\x0aNo\x20fields\x20defined\x20in\x20schema','Show\x20when:\x20','839620tACOCv','enumeration','9356800CUfyqF','Type:\x20','repeat','Fetching\x20connection\x20\x27','Fetching\x20schema\x20for\x20\x27','value','limit','max','\x20connector\x20type','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','cyan','object','sort','Fetching\x20settings\x20for\x20connector\x20type:\x20','table','minimum','blue','default_value','type','legacy','dim','slice','24778MUfktb','Looking\x20up\x20connection:\x20','Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.','data','\x27\x20(type:\x20','✔\x20Resolved\x20\x27','listTypes','length','green','connection:show','error','\x27\x20as\x20connection\x20name\x20→\x20type:\x20'];a13_0x3a72=function(){return _0x1de50b;};return a13_0x3a72();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a13_0x1069(_0xc6fb18,_0x4e7977){_0xc6fb18=_0xc6fb18-0x199;const _0x3a72ca=a13_0x3a72();let _0x1069ec=_0x3a72ca[_0xc6fb18];return _0x1069ec;}import a13_0x139665 from'chalk';function normalizeSchemaForDisplay(_0x2843ac){const _0x3bfdeb=a13_0x1069,_0x484011=_0x2843ac[_0x3bfdeb(0x1b2)]||[],_0x2929f7=_0x484011[_0x3bfdeb(0x1e7)](_0x1473c4=>_0x1473c4[_0x3bfdeb(0x1f8)]===_0x3bfdeb(0x1a7)&&_0x1473c4[_0x3bfdeb(0x1d0)]===_0x3bfdeb(0x1f9)&&_0x1473c4[_0x3bfdeb(0x1b2)]);if(_0x2929f7?.[_0x3bfdeb(0x1b2)]){const _0x439995=_0x484011[_0x3bfdeb(0x1ad)](_0x1e9cf6=>_0x1e9cf6[_0x3bfdeb(0x1f8)]!==_0x3bfdeb(0x1d1)&&_0x1e9cf6[_0x3bfdeb(0x1f8)]!==_0x3bfdeb(0x1a7));return[..._0x439995,..._0x2929f7[_0x3bfdeb(0x1b2)]];}return _0x484011[_0x3bfdeb(0x1ad)](_0x5999eb=>_0x5999eb[_0x3bfdeb(0x1f8)]!==_0x3bfdeb(0x1d1));}function printSchemaFields(_0x522bb7,_0xe1e1c9){const _0x54fff4=a13_0x1069,_0x516b2c='\x20\x20'['repeat'](_0xe1e1c9+0x1),_0x167efa='\x20\x20'[_0x54fff4(0x1c0)](_0xe1e1c9+0x2);for(const _0x151608 of _0x522bb7){if(!_0x151608['name'])continue;const _0x3feac5=_0x151608['type']===_0x54fff4(0x1f9)&&_0x151608[_0x54fff4(0x1b2)]&&_0x151608[_0x54fff4(0x1b2)][_0x54fff4(0x1db)]>0x0&&_0x151608[_0x54fff4(0x1f8)]!==_0x54fff4(0x1a7);let _0x2e1bb0=''+_0x516b2c+a13_0x139665[_0x54fff4(0x1dc)](_0x151608[_0x54fff4(0x1f8)]);_0x151608[_0x54fff4(0x1b4)]&&(_0x2e1bb0+=':\x20'+_0x151608[_0x54fff4(0x1b4)]);if(_0x151608[_0x54fff4(0x1ee)])_0x2e1bb0+=a13_0x139665[_0x54fff4(0x1d2)]('\x20['+_0x151608[_0x54fff4(0x1ee)]+']');else _0x3feac5&&(_0x2e1bb0+=a13_0x139665['dim'](_0x54fff4(0x1fc)));console['log'](_0x2e1bb0);_0x151608[_0x54fff4(0x207)]&&console[_0x54fff4(0x1b6)](''+_0x167efa+a13_0x139665[_0x54fff4(0x1d2)](_0x151608[_0x54fff4(0x207)]));if(_0x151608[_0x54fff4(0x1bd)]){const _0x47c08e=_0x151608[_0x54fff4(0x1bd)][_0x54fff4(0x1af)](_0x258a23=>typeof _0x258a23===_0x54fff4(0x1c9)&&_0x54fff4(0x1c3)in _0x258a23?_0x258a23[_0x54fff4(0x1c3)]:_0x258a23)[_0x54fff4(0x1a1)](',\x20');console[_0x54fff4(0x1b6)](_0x167efa+_0x54fff4(0x1ed)+a13_0x139665[_0x54fff4(0x1e2)](_0x47c08e));}_0x151608['default_value']!==undefined&&console[_0x54fff4(0x1b6)](_0x167efa+_0x54fff4(0x19e)+a13_0x139665[_0x54fff4(0x1ce)](String(_0x151608[_0x54fff4(0x1cf)])));if(_0x151608['minimum']!==undefined||_0x151608[_0x54fff4(0x1aa)]!==undefined){const _0x16a9fa=_0x151608[_0x54fff4(0x1cd)]!==undefined&&_0x151608[_0x54fff4(0x1aa)]!==undefined?_0x151608[_0x54fff4(0x1cd)]+'\x20-\x20'+_0x151608[_0x54fff4(0x1aa)]:_0x151608[_0x54fff4(0x1cd)]!==undefined?'>=\x20'+_0x151608[_0x54fff4(0x1cd)]:_0x54fff4(0x1ea)+_0x151608[_0x54fff4(0x1aa)];console[_0x54fff4(0x1b6)](_0x167efa+_0x54fff4(0x1f3)+a13_0x139665['blue'](_0x16a9fa));}if(_0x151608[_0x54fff4(0x200)]){const _0x1c5f96=Object['entries'](_0x151608[_0x54fff4(0x200)])[_0x54fff4(0x1af)](([_0x50974d,_0x777e46])=>_0x50974d+'='+JSON[_0x54fff4(0x1f2)](_0x777e46))[_0x54fff4(0x1a1)](',\x20');console[_0x54fff4(0x1b6)](''+_0x167efa+a13_0x139665[_0x54fff4(0x1d2)](_0x54fff4(0x1bb)+_0x1c5f96));}_0x3feac5&&_0x151608[_0x54fff4(0x1b2)]&&printSchemaFields(_0x151608[_0x54fff4(0x1b2)],_0xe1e1c9+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x505ec5(0x1f8)]='connection:list';[a13_0x505ec5(0x207)]=a13_0x505ec5(0x1b9);async[a13_0x505ec5(0x1ac)](_0x27ff6d){const _0x46de9d=a13_0x505ec5,{options:_0x4603cb,tdx:_0x263f31}=_0x27ff6d;_0x4603cb['verbose']&&console[_0x46de9d(0x1de)](_0x46de9d(0x1b7)+_0x4603cb['site']);const _0x4b94c8=resolveLimit(_0x4603cb[_0x46de9d(0x1c4)],DEFAULT_LISTING_LIMIT),_0x1107f4=await withSpinner(_0x46de9d(0x208),()=>_0x263f31['connection'][_0x46de9d(0x1e5)](),{'verbose':_0x4603cb[_0x46de9d(0x1f4)]}),_0x253c7e=_0x1107f4[_0x46de9d(0x1d7)];console[_0x46de9d(0x1de)](_0x46de9d(0x1ae)+_0x253c7e[_0x46de9d(0x1db)]+_0x46de9d(0x1a3)+(_0x253c7e[_0x46de9d(0x1db)]!==0x1?'s':''));if(isStructuredFormat(_0x4603cb)){const _0x41ce62=_0x253c7e[_0x46de9d(0x1d3)](0x0,_0x4b94c8);await handleSDKOutput(_0x41ce62,{..._0x4603cb,'limit':_0x4b94c8});}else{const _0x2da466=_0x253c7e[_0x46de9d(0x1db)]>0x0?Math[_0x46de9d(0x1c5)](..._0x253c7e[_0x46de9d(0x1af)](_0x129bf6=>_0x129bf6[_0x46de9d(0x1d0)]['length'])):0x0,_0x2ef7b4=[];for(const _0x504679 of _0x253c7e){const _0x3b54a4=a13_0x139665[_0x46de9d(0x1c8)](_0x504679[_0x46de9d(0x1d0)][_0x46de9d(0x1a0)](_0x2da466)),_0x2738f8=_0x504679['owner']?.[_0x46de9d(0x1f8)]?_0x46de9d(0x1b5)+a13_0x139665[_0x46de9d(0x1d2)](_0x504679['owner'][_0x46de9d(0x1f8)]):'';_0x2ef7b4[_0x46de9d(0x1e8)](_0x3b54a4+'\x20\x20'+_0x504679['name']+_0x2738f8);}await writeOutput(_0x2ef7b4['join']('\x0a'),_0x4603cb['output'],_0x46de9d(0x1cc));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x505ec5(0x1f8)]=a13_0x505ec5(0x1dd);[a13_0x505ec5(0x207)]=a13_0x505ec5(0x1f5);['validate'](_0x4ad9c3){const _0x49219d=a13_0x505ec5,{args:_0x5bcd95}=_0x4ad9c3;if(!_0x5bcd95[0x0])return _0x49219d(0x1f7);return undefined;}async[a13_0x505ec5(0x1ac)](_0x26697f){const _0x52b7ce=a13_0x505ec5,{options:_0x468f06,args:_0x1f2dd7,tdx:_0x25b481}=_0x26697f,_0x3adc3e=_0x1f2dd7[0x0];_0x468f06[_0x52b7ce(0x1f4)]&&(console[_0x52b7ce(0x1de)](_0x52b7ce(0x1b7)+_0x468f06['site']),console[_0x52b7ce(0x1de)](_0x52b7ce(0x1d5)+_0x3adc3e));const _0x53aa95=await withSpinner(_0x52b7ce(0x1c1)+_0x3adc3e+_0x52b7ce(0x19a),()=>_0x25b481[_0x52b7ce(0x1e0)][_0x52b7ce(0x19f)](_0x3adc3e),{'verbose':_0x468f06[_0x52b7ce(0x1f4)]}),_0x1be0a1=_0x53aa95[_0x52b7ce(0x1d7)];return console['error'](_0x52b7ce(0x19b)+_0x1be0a1[_0x52b7ce(0x1f8)]),await handleSingleObjectOutput(_0x1be0a1,_0x468f06),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x505ec5(0x1f8)]='connection:schema';[a13_0x505ec5(0x207)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';['validate'](_0x46a8a6){const _0x10a397=a13_0x505ec5,{args:_0x452628}=_0x46a8a6;if(!_0x452628[0x0])return _0x10a397(0x1d6);return undefined;}async[a13_0x505ec5(0x1ac)](_0x56fa51){const _0x29e48b=a13_0x505ec5,{options:_0x1c9358,args:_0x159dab,tdx:_0x5c1826}=_0x56fa51,_0x173704=_0x159dab[0x0];_0x1c9358[_0x29e48b(0x1f4)]&&(console[_0x29e48b(0x1de)](_0x29e48b(0x1b7)+_0x1c9358[_0x29e48b(0x1e6)]),console['error'](_0x29e48b(0x206)+_0x173704));let _0xfc5802=_0x173704,_0x54c50a;try{const _0x45e020=await _0x5c1826[_0x29e48b(0x1e0)][_0x29e48b(0x205)](_0x173704);_0x45e020&&(_0xfc5802=_0x45e020[_0x29e48b(0x1d0)],_0x54c50a=_0x45e020[_0x29e48b(0x1f8)],_0x1c9358['verbose']&&console[_0x29e48b(0x1de)](_0x29e48b(0x1d9)+_0x173704+_0x29e48b(0x1df)+_0xfc5802));}catch{_0x1c9358['verbose']&&console[_0x29e48b(0x1de)](_0x29e48b(0x1a6)+_0x173704+_0x29e48b(0x202));}const _0x4bcebe=await withSpinner(_0x29e48b(0x1c2)+_0xfc5802+_0x29e48b(0x19a),()=>_0x5c1826[_0x29e48b(0x1e0)][_0x29e48b(0x1b1)](_0xfc5802),{'verbose':_0x1c9358['verbose']}),_0x180b97=_0x4bcebe['data'];_0x54c50a?console[_0x29e48b(0x1de)](_0x29e48b(0x204)+_0x54c50a+_0x29e48b(0x1d8)+_0xfc5802+')'):console[_0x29e48b(0x1de)](_0x29e48b(0x1c7)+_0xfc5802);if(isStructuredFormat(_0x1c9358))await handleSingleObjectOutput(_0x180b97,_0x1c9358);else{const _0x1984f2=normalizeSchemaForDisplay(_0x180b97);_0x54c50a?(console['log']('\x0aConnection:\x20'+a13_0x139665['cyan'](_0x54c50a)),console['log'](_0x29e48b(0x1bf)+a13_0x139665[_0x29e48b(0x1d2)](_0xfc5802))):console[_0x29e48b(0x1b6)](_0x29e48b(0x1b8)+a13_0x139665[_0x29e48b(0x1c8)](_0xfc5802)),_0x1984f2[_0x29e48b(0x1db)]>0x0?(console[_0x29e48b(0x1b6)](a13_0x139665[_0x29e48b(0x209)](_0x29e48b(0x1fe))),printSchemaFields(_0x1984f2,0x0)):console[_0x29e48b(0x1b6)](a13_0x139665[_0x29e48b(0x1d2)](_0x29e48b(0x1ba)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x505ec5(0x1f8)]='connection:types';[a13_0x505ec5(0x207)]=a13_0x505ec5(0x1fd);async['execute'](_0x3b684c){const _0x42bceb=a13_0x505ec5,{options:_0x2b832e,tdx:_0x3b640c}=_0x3b684c;_0x2b832e[_0x42bceb(0x1f4)]&&console['error'](_0x42bceb(0x1b7)+_0x2b832e[_0x42bceb(0x1e6)]);const _0x46d616=await withSpinner(_0x42bceb(0x1a4),()=>_0x3b640c['connection'][_0x42bceb(0x1da)](),{'verbose':_0x2b832e[_0x42bceb(0x1f4)]}),_0x3b8fcb=_0x46d616[_0x42bceb(0x1d7)][_0x42bceb(0x1ca)]((_0x438157,_0x524931)=>_0x438157[_0x42bceb(0x1d0)]['localeCompare'](_0x524931[_0x42bceb(0x1d0)]));console[_0x42bceb(0x1de)](_0x42bceb(0x1ae)+_0x3b8fcb[_0x42bceb(0x1db)]+_0x42bceb(0x1c6)+(_0x3b8fcb[_0x42bceb(0x1db)]!==0x1?'s':''));if(isStructuredFormat(_0x2b832e))await handleSDKOutput(_0x3b8fcb,_0x2b832e);else{const _0x405d42=_0x3b8fcb[_0x42bceb(0x1db)]>0x0?Math['max'](..._0x3b8fcb[_0x42bceb(0x1af)](_0x420342=>_0x420342[_0x42bceb(0x1d0)][_0x42bceb(0x1db)])):0x0,_0x1dc390=[];for(const _0x1e289d of _0x3b8fcb){const _0x2e7e8a=a13_0x139665[_0x42bceb(0x1c8)](_0x1e289d['type']['padStart'](_0x405d42));_0x1dc390[_0x42bceb(0x1e8)](_0x2e7e8a+'\x20\x20'+_0x1e289d[_0x42bceb(0x1f8)]);}await writeOutput(_0x1dc390[_0x42bceb(0x1a1)]('\x0a'),_0x2b832e['output'],_0x42bceb(0x1cc));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x505ec5(0x1f8)]=a13_0x505ec5(0x1b3);[a13_0x505ec5(0x207)]=a13_0x505ec5(0x1e1);[a13_0x505ec5(0x1ec)](_0x49c94a){const _0x3480ab=a13_0x505ec5,{args:_0x25f08a}=_0x49c94a;if(!_0x25f08a[0x0])return _0x3480ab(0x1f0);return undefined;}async[a13_0x505ec5(0x1ac)](_0x46ab33){const _0x6573ee=a13_0x505ec5,{options:_0x2ec6f1,args:_0x2d1d50,tdx:_0x7170c1}=_0x46ab33,_0x4c3a9c=_0x2d1d50[0x0];_0x2ec6f1['verbose']&&(console[_0x6573ee(0x1de)]('Site:\x20'+_0x2ec6f1['site']),console['error'](_0x6573ee(0x1cb)+_0x4c3a9c));const _0x182e88=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x4c3a9c+_0x6573ee(0x19a),()=>_0x7170c1['connection']['getMetadata'](_0x4c3a9c),{'verbose':_0x2ec6f1[_0x6573ee(0x1f4)]}),_0x1a38bb=_0x182e88[_0x6573ee(0x1d7)];console['error'](_0x6573ee(0x19d)+_0x4c3a9c);if(isStructuredFormat(_0x2ec6f1))await handleSingleObjectOutput(_0x1a38bb,_0x2ec6f1);else{console[_0x6573ee(0x1b6)](_0x6573ee(0x1b8)+a13_0x139665['cyan'](_0x4c3a9c)),console[_0x6573ee(0x1b6)](_0x6573ee(0x1fb)+_0x1a38bb['name']);const _0x5d3b1c=_0x1a38bb[_0x6573ee(0x1fa)]||[],_0x9eb268=_0x5d3b1c['filter'](_0x4cf16f=>_0x4cf16f[_0x6573ee(0x1eb)]);_0x9eb268[_0x6573ee(0x1db)]>0x0&&(console[_0x6573ee(0x1b6)](a13_0x139665['bold'](_0x6573ee(0x199))),printMetadataSettings(_0x9eb268));let _0x2fbe39=![];try{const _0x41cbb5=await _0x7170c1['connection'][_0x6573ee(0x1b1)](_0x4c3a9c),_0x5f24c9=normalizeSchemaForDisplay(_0x41cbb5);_0x5f24c9[_0x6573ee(0x1db)]>0x0&&(console[_0x6573ee(0x1b6)](a13_0x139665[_0x6573ee(0x209)](_0x6573ee(0x1fe))),printSchemaFields(_0x5f24c9,0x0),_0x2fbe39=!![]);}catch{const _0x14a05c=_0x5d3b1c[_0x6573ee(0x1ad)](_0x496915=>!_0x496915[_0x6573ee(0x1eb)]);_0x14a05c[_0x6573ee(0x1db)]>0x0&&(console[_0x6573ee(0x1b6)](a13_0x139665[_0x6573ee(0x209)](_0x6573ee(0x1fe))),printMetadataSettings(_0x14a05c),_0x2fbe39=!![]);}!_0x2fbe39&&_0x2ec6f1[_0x6573ee(0x1f4)]&&console[_0x6573ee(0x1de)](a13_0x139665[_0x6573ee(0x1d2)](_0x6573ee(0x1a9))),_0x9eb268[_0x6573ee(0x1db)]===0x0&&console[_0x6573ee(0x1b6)](a13_0x139665[_0x6573ee(0x1d2)](_0x6573ee(0x1a2)));}return 0x0;}}function printMetadataSettings(_0x137179){const _0x45aa74=a13_0x505ec5;for(const _0x967db3 of _0x137179){if(!_0x967db3[_0x45aa74(0x1f8)])continue;if(_0x967db3[_0x45aa74(0x20a)])continue;let _0xe3e06c='\x20\x20'+a13_0x139665['green'](_0x967db3[_0x45aa74(0x1f8)]);_0x967db3[_0x45aa74(0x1e3)]&&(_0xe3e06c+=':\x20'+_0x967db3[_0x45aa74(0x1e3)]);_0x967db3['type']&&(_0xe3e06c+=a13_0x139665['dim']('\x20['+_0x967db3[_0x45aa74(0x1d0)]+']'));console['log'](_0xe3e06c);_0x967db3[_0x45aa74(0x1ff)]&&console[_0x45aa74(0x1b6)](_0x45aa74(0x19c)+a13_0x139665[_0x45aa74(0x1d2)](_0x967db3[_0x45aa74(0x1ff)]));if(_0x967db3[_0x45aa74(0x1ef)]){const _0x129692=_0x967db3[_0x45aa74(0x1ef)][_0x45aa74(0x1af)](_0x39d260=>_0x39d260[_0x45aa74(0x1c3)])[_0x45aa74(0x1a1)](',\x20');console[_0x45aa74(0x1b6)](_0x45aa74(0x1b0)+a13_0x139665['yellow'](_0x129692));}_0x967db3[_0x45aa74(0x1cf)]!==undefined&&_0x967db3['default_value']!==null&&console['log'](_0x45aa74(0x1ab)+a13_0x139665[_0x45aa74(0x1ce)](String(_0x967db3[_0x45aa74(0x1cf)])));if(_0x967db3[_0x45aa74(0x200)]){const _0xa54fcf=Object[_0x45aa74(0x203)](_0x967db3['criteria'])[_0x45aa74(0x1af)](([_0x17a6c8,_0x367975])=>_0x17a6c8+'='+JSON['stringify'](_0x367975))[_0x45aa74(0x1a1)](',\x20');console[_0x45aa74(0x1b6)](_0x45aa74(0x19c)+a13_0x139665[_0x45aa74(0x1d2)](_0x45aa74(0x1bb)+_0xa54fcf));}}}
|
|
1
|
+
const a13_0x237a33=a13_0x3827;(function(_0x210b5b,_0x1e2d8e){const _0x514740=a13_0x3827,_0x446e7b=_0x210b5b();while(!![]){try{const _0x5540cc=parseInt(_0x514740(0x118))/0x1*(parseInt(_0x514740(0xc5))/0x2)+-parseInt(_0x514740(0xf6))/0x3+-parseInt(_0x514740(0x129))/0x4*(parseInt(_0x514740(0xf8))/0x5)+parseInt(_0x514740(0xeb))/0x6+-parseInt(_0x514740(0xed))/0x7*(parseInt(_0x514740(0x116))/0x8)+-parseInt(_0x514740(0x100))/0x9+parseInt(_0x514740(0xd4))/0xa*(parseInt(_0x514740(0xd8))/0xb);if(_0x5540cc===_0x1e2d8e)break;else _0x446e7b['push'](_0x446e7b['shift']());}catch(_0x3eb8ab){_0x446e7b['push'](_0x446e7b['shift']());}}}(a13_0x3227,0x79e16));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x430a28 from'chalk';function normalizeSchemaForDisplay(_0x193cda){const _0x17d165=a13_0x3827,_0x34ca87=_0x193cda[_0x17d165(0x122)]||[],_0x590d1b=_0x34ca87[_0x17d165(0xc8)](_0x5e1e76=>_0x5e1e76[_0x17d165(0xda)]===_0x17d165(0xc6)&&_0x5e1e76[_0x17d165(0x114)]==='record'&&_0x5e1e76['properties']);if(_0x590d1b?.[_0x17d165(0x122)]){const _0xe57edf=_0x34ca87[_0x17d165(0xd0)](_0x23874c=>_0x23874c['name']!=='legacy'&&_0x23874c[_0x17d165(0xda)]!==_0x17d165(0xc6));return[..._0xe57edf,..._0x590d1b[_0x17d165(0x122)]];}return _0x34ca87[_0x17d165(0xd0)](_0x3dbf67=>_0x3dbf67[_0x17d165(0xda)]!==_0x17d165(0xff));}function printSchemaFields(_0x132e71,_0x337480){const _0x1b6c60=a13_0x3827,_0x4ef1ee='\x20\x20'[_0x1b6c60(0xd1)](_0x337480+0x1),_0x5706f7='\x20\x20'[_0x1b6c60(0xd1)](_0x337480+0x2);for(const _0x3ded0a of _0x132e71){if(!_0x3ded0a[_0x1b6c60(0xda)])continue;const _0x182789=_0x3ded0a[_0x1b6c60(0x114)]==='record'&&_0x3ded0a[_0x1b6c60(0x122)]&&_0x3ded0a[_0x1b6c60(0x122)][_0x1b6c60(0x10c)]>0x0&&_0x3ded0a[_0x1b6c60(0xda)]!==_0x1b6c60(0xc6);let _0x13d8c5=''+_0x4ef1ee+a13_0x430a28['green'](_0x3ded0a[_0x1b6c60(0xda)]);_0x3ded0a['title']&&(_0x13d8c5+=':\x20'+_0x3ded0a[_0x1b6c60(0xc1)]);if(_0x3ded0a['input'])_0x13d8c5+=a13_0x430a28['dim']('\x20['+_0x3ded0a['input']+']');else _0x182789&&(_0x13d8c5+=a13_0x430a28[_0x1b6c60(0xd7)](_0x1b6c60(0x101)));console[_0x1b6c60(0x11e)](_0x13d8c5);_0x3ded0a['description']&&console['log'](''+_0x5706f7+a13_0x430a28[_0x1b6c60(0xd7)](_0x3ded0a['description']));if(_0x3ded0a[_0x1b6c60(0x11c)]){const _0x239052=_0x3ded0a[_0x1b6c60(0x11c)][_0x1b6c60(0x125)](_0x2455d8=>typeof _0x2455d8===_0x1b6c60(0xf1)&&_0x1b6c60(0x12c)in _0x2455d8?_0x2455d8[_0x1b6c60(0x12c)]:_0x2455d8)[_0x1b6c60(0x11f)](',\x20');console[_0x1b6c60(0x11e)](_0x5706f7+'Options:\x20'+a13_0x430a28['yellow'](_0x239052));}_0x3ded0a[_0x1b6c60(0xe0)]!==undefined&&console[_0x1b6c60(0x11e)](_0x5706f7+_0x1b6c60(0xd3)+a13_0x430a28[_0x1b6c60(0x124)](String(_0x3ded0a['default_value'])));if(_0x3ded0a['minimum']!==undefined||_0x3ded0a[_0x1b6c60(0x119)]!==undefined){const _0x6b8f0d=_0x3ded0a[_0x1b6c60(0x12e)]!==undefined&&_0x3ded0a[_0x1b6c60(0x119)]!==undefined?_0x3ded0a[_0x1b6c60(0x12e)]+_0x1b6c60(0x11a)+_0x3ded0a[_0x1b6c60(0x119)]:_0x3ded0a['minimum']!==undefined?_0x1b6c60(0xc4)+_0x3ded0a[_0x1b6c60(0x12e)]:_0x1b6c60(0x115)+_0x3ded0a[_0x1b6c60(0x119)];console[_0x1b6c60(0x11e)](_0x5706f7+_0x1b6c60(0xf3)+a13_0x430a28[_0x1b6c60(0x124)](_0x6b8f0d));}if(_0x3ded0a[_0x1b6c60(0xe6)]){const _0x5ddef5=Object[_0x1b6c60(0xfd)](_0x3ded0a[_0x1b6c60(0xe6)])[_0x1b6c60(0x125)](([_0x30fc7f,_0x1564c3])=>_0x30fc7f+'='+JSON[_0x1b6c60(0xe4)](_0x1564c3))['join'](',\x20');console[_0x1b6c60(0x11e)](''+_0x5706f7+a13_0x430a28[_0x1b6c60(0xd7)](_0x1b6c60(0xdd)+_0x5ddef5));}_0x182789&&_0x3ded0a['properties']&&printSchemaFields(_0x3ded0a[_0x1b6c60(0x122)],_0x337480+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x237a33(0xda)]=a13_0x237a33(0xde);[a13_0x237a33(0x11b)]='List\x20all\x20result\x20output\x20connections';async[a13_0x237a33(0xc7)](_0x568d70){const _0x4f84e7=a13_0x237a33,{options:_0x56e970,tdx:_0xfda536}=_0x568d70;_0x56e970['verbose']&&console['error'](_0x4f84e7(0xce)+_0x56e970[_0x4f84e7(0xcd)]);const _0x16a684=resolveLimit(_0x56e970[_0x4f84e7(0xf2)],DEFAULT_LISTING_LIMIT),_0x4c80b7=await withSpinner(_0x4f84e7(0x112),()=>_0xfda536[_0x4f84e7(0x126)][_0x4f84e7(0x103)](),{'verbose':_0x56e970[_0x4f84e7(0xe3)]}),_0x429435=_0x4c80b7[_0x4f84e7(0xf9)];console[_0x4f84e7(0xd6)](_0x4f84e7(0x109)+_0x429435['length']+_0x4f84e7(0xdc)+(_0x429435[_0x4f84e7(0x10c)]!==0x1?'s':''));if(isStructuredFormat(_0x56e970)){const _0x17d4ab=_0x429435[_0x4f84e7(0xdf)](0x0,_0x16a684);await handleSDKOutput(_0x17d4ab,{..._0x56e970,'limit':_0x16a684});}else{const _0x3b8715=_0x429435[_0x4f84e7(0x10c)]>0x0?Math['max'](..._0x429435[_0x4f84e7(0x125)](_0x13d68f=>_0x13d68f[_0x4f84e7(0x114)]['length'])):0x0,_0x1d098b=[];for(const _0x1c16c6 of _0x429435){const _0x456fb3=a13_0x430a28[_0x4f84e7(0xd5)](_0x1c16c6[_0x4f84e7(0x114)][_0x4f84e7(0xee)](_0x3b8715)),_0x54f3bd=_0x1c16c6[_0x4f84e7(0x123)]?.['name']?_0x4f84e7(0x11a)+a13_0x430a28[_0x4f84e7(0xd7)](_0x1c16c6[_0x4f84e7(0x123)][_0x4f84e7(0xda)]):'';_0x1d098b[_0x4f84e7(0x12a)](_0x456fb3+'\x20\x20'+_0x1c16c6[_0x4f84e7(0xda)]+_0x54f3bd);}await writeOutput(_0x1d098b[_0x4f84e7(0x11f)]('\x0a'),_0x56e970['output'],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']=a13_0x237a33(0xfc);['description']=a13_0x237a33(0xe7);[a13_0x237a33(0xc2)](_0x1d0042){const _0x4ebdb5=a13_0x237a33,{args:_0x58801e}=_0x1d0042;if(!_0x58801e[0x0])return _0x4ebdb5(0xea);return undefined;}async[a13_0x237a33(0xc7)](_0x2dbb0c){const _0x18b86f=a13_0x237a33,{options:_0x188fed,args:_0x27e384,tdx:_0x50472b}=_0x2dbb0c,_0x28fe37=_0x27e384[0x0];_0x188fed['verbose']&&(console[_0x18b86f(0xd6)](_0x18b86f(0xce)+_0x188fed['site']),console[_0x18b86f(0xd6)]('Looking\x20up\x20connection:\x20'+_0x28fe37));const _0x47cc87=await withSpinner(_0x18b86f(0x120)+_0x28fe37+_0x18b86f(0xf5),()=>_0x50472b[_0x18b86f(0x126)][_0x18b86f(0xe9)](_0x28fe37),{'verbose':_0x188fed[_0x18b86f(0xe3)]}),_0xed7d57=_0x47cc87[_0x18b86f(0xf9)];return console['error'](_0x18b86f(0xf0)+_0xed7d57[_0x18b86f(0xda)]),await handleSingleObjectOutput(_0xed7d57,_0x188fed),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a13_0x237a33(0xca);[a13_0x237a33(0x11b)]=a13_0x237a33(0x111);['validate'](_0x4d50c9){const {args:_0x95c160}=_0x4d50c9;if(!_0x95c160[0x0])return'Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.';return undefined;}async[a13_0x237a33(0xc7)](_0xe8a7b4){const _0x23c5d0=a13_0x237a33,{options:_0x950ebc,args:_0x4a02a4,tdx:_0x24ac35}=_0xe8a7b4,_0x56adfb=_0x4a02a4[0x0];_0x950ebc[_0x23c5d0(0xe3)]&&(console[_0x23c5d0(0xd6)](_0x23c5d0(0xce)+_0x950ebc[_0x23c5d0(0xcd)]),console[_0x23c5d0(0xd6)](_0x23c5d0(0xfa)+_0x56adfb));let _0x54ba57=_0x56adfb,_0x540eb3;try{const _0xe0a135=await _0x24ac35[_0x23c5d0(0x126)]['findByName'](_0x56adfb);_0xe0a135&&(_0x54ba57=_0xe0a135[_0x23c5d0(0x114)],_0x540eb3=_0xe0a135[_0x23c5d0(0xda)],_0x950ebc[_0x23c5d0(0xe3)]&&console[_0x23c5d0(0xd6)](_0x23c5d0(0x12b)+_0x56adfb+_0x23c5d0(0x12d)+_0x54ba57));}catch{_0x950ebc[_0x23c5d0(0xe3)]&&console['error'](_0x23c5d0(0x10e)+_0x56adfb+_0x23c5d0(0xe8));}const _0x2b001c=await withSpinner(_0x23c5d0(0xec)+_0x54ba57+_0x23c5d0(0xf5),()=>_0x24ac35[_0x23c5d0(0x126)]['getOutputSchema'](_0x54ba57),{'verbose':_0x950ebc[_0x23c5d0(0xe3)]}),_0x424675=_0x2b001c[_0x23c5d0(0xf9)];_0x540eb3?console[_0x23c5d0(0xd6)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x540eb3+_0x23c5d0(0x107)+_0x54ba57+')'):console[_0x23c5d0(0xd6)](_0x23c5d0(0xfe)+_0x54ba57);if(isStructuredFormat(_0x950ebc))await handleSingleObjectOutput(_0x424675,_0x950ebc);else{const _0x38d883=normalizeSchemaForDisplay(_0x424675);_0x540eb3?(console[_0x23c5d0(0x11e)]('\x0aConnection:\x20'+a13_0x430a28['cyan'](_0x540eb3)),console[_0x23c5d0(0x11e)](_0x23c5d0(0x11d)+a13_0x430a28['dim'](_0x54ba57))):console[_0x23c5d0(0x11e)]('\x0aConnector:\x20'+a13_0x430a28['cyan'](_0x54ba57)),_0x38d883['length']>0x0?(console[_0x23c5d0(0x11e)](a13_0x430a28['bold'](_0x23c5d0(0x127))),printSchemaFields(_0x38d883,0x0)):console[_0x23c5d0(0x11e)](a13_0x430a28[_0x23c5d0(0xd7)](_0x23c5d0(0xc9)));}return 0x0;}}function a13_0x3827(_0x47c7fa,_0x9e437e){_0x47c7fa=_0x47c7fa-0xc1;const _0x32278b=a13_0x3227();let _0x382741=_0x32278b[_0x47c7fa];return _0x382741;}export class ConnectionTypesCommand extends BaseCommand{[a13_0x237a33(0xda)]=a13_0x237a33(0x102);[a13_0x237a33(0x11b)]=a13_0x237a33(0x117);async[a13_0x237a33(0xc7)](_0x5899d5){const _0x966b12=a13_0x237a33,{options:_0x2f8c76,tdx:_0x346bfa}=_0x5899d5;_0x2f8c76[_0x966b12(0xe3)]&&console[_0x966b12(0xd6)](_0x966b12(0xce)+_0x2f8c76['site']);const _0x5c32c9=await withSpinner('Listing\x20connector\x20types...',()=>_0x346bfa[_0x966b12(0x126)][_0x966b12(0x10a)](),{'verbose':_0x2f8c76[_0x966b12(0xe3)]}),_0x9307d4=_0x5c32c9[_0x966b12(0xf9)][_0x966b12(0xcc)]((_0x5b9189,_0x1621d6)=>_0x5b9189['type'][_0x966b12(0xf4)](_0x1621d6[_0x966b12(0x114)]));console[_0x966b12(0xd6)]('✔\x20Found\x20'+_0x9307d4[_0x966b12(0x10c)]+_0x966b12(0xef)+(_0x9307d4[_0x966b12(0x10c)]!==0x1?'s':''));if(isStructuredFormat(_0x2f8c76))await handleSDKOutput(_0x9307d4,_0x2f8c76);else{const _0x52c026=_0x9307d4[_0x966b12(0x10c)]>0x0?Math[_0x966b12(0xd9)](..._0x9307d4[_0x966b12(0x125)](_0x17afc1=>_0x17afc1['type'][_0x966b12(0x10c)])):0x0,_0x4c40bb=[];for(const _0x5e2597 of _0x9307d4){const _0x5a8ce2=a13_0x430a28[_0x966b12(0xd5)](_0x5e2597[_0x966b12(0x114)]['padStart'](_0x52c026));_0x4c40bb[_0x966b12(0x12a)](_0x5a8ce2+'\x20\x20'+_0x5e2597[_0x966b12(0xda)]);}await writeOutput(_0x4c40bb[_0x966b12(0x11f)]('\x0a'),_0x2f8c76['output'],_0x966b12(0x106));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x237a33(0xda)]='connection:settings';[a13_0x237a33(0x11b)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';['validate'](_0x10b6a9){const _0x482fb0=a13_0x237a33,{args:_0x5e4f21}=_0x10b6a9;if(!_0x5e4f21[0x0])return _0x482fb0(0x104);return undefined;}async[a13_0x237a33(0xc7)](_0x51f504){const _0x2a32d3=a13_0x237a33,{options:_0x2ec78f,args:_0x1dd159,tdx:_0x163751}=_0x51f504,_0x27d763=_0x1dd159[0x0];_0x2ec78f[_0x2a32d3(0xe3)]&&(console[_0x2a32d3(0xd6)](_0x2a32d3(0xce)+_0x2ec78f[_0x2a32d3(0xcd)]),console['error'](_0x2a32d3(0xfb)+_0x27d763));const _0x1a762e=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x27d763+_0x2a32d3(0xf5),()=>_0x163751[_0x2a32d3(0x126)][_0x2a32d3(0x110)](_0x27d763),{'verbose':_0x2ec78f[_0x2a32d3(0xe3)]}),_0x4c90bc=_0x1a762e[_0x2a32d3(0xf9)];console[_0x2a32d3(0xd6)](_0x2a32d3(0xdb)+_0x27d763);if(isStructuredFormat(_0x2ec78f))await handleSingleObjectOutput(_0x4c90bc,_0x2ec78f);else{console[_0x2a32d3(0x11e)](_0x2a32d3(0x128)+a13_0x430a28['cyan'](_0x27d763)),console['log'](_0x2a32d3(0x108)+_0x4c90bc[_0x2a32d3(0xda)]);const _0x36c838=_0x4c90bc[_0x2a32d3(0xf7)]||[],_0x1b12a1=_0x36c838['filter'](_0x4c3453=>_0x4c3453[_0x2a32d3(0x105)]);_0x1b12a1[_0x2a32d3(0x10c)]>0x0&&(console['log'](a13_0x430a28[_0x2a32d3(0x10b)](_0x2a32d3(0xcb))),printMetadataSettings(_0x1b12a1));let _0x590786=![];try{const _0x112a5b=await _0x163751['connection'][_0x2a32d3(0x113)](_0x27d763),_0x1f12d5=normalizeSchemaForDisplay(_0x112a5b);_0x1f12d5['length']>0x0&&(console['log'](a13_0x430a28[_0x2a32d3(0x10b)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x1f12d5,0x0),_0x590786=!![]);}catch{const _0x5f1650=_0x36c838[_0x2a32d3(0xd0)](_0x2d978d=>!_0x2d978d['credential']);_0x5f1650['length']>0x0&&(console['log'](a13_0x430a28[_0x2a32d3(0x10b)](_0x2a32d3(0x127))),printMetadataSettings(_0x5f1650),_0x590786=!![]);}!_0x590786&&_0x2ec78f[_0x2a32d3(0xe3)]&&console[_0x2a32d3(0xd6)](a13_0x430a28[_0x2a32d3(0xd7)](_0x2a32d3(0xcf))),_0x1b12a1[_0x2a32d3(0x10c)]===0x0&&console[_0x2a32d3(0x11e)](a13_0x430a28['dim'](_0x2a32d3(0xc3)));}return 0x0;}}function a13_0x3227(){const _0x33915a=['green','getMetadata','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','Listing\x20connections...','getOutputSchema','type','<=\x20','8CwYwcu','List\x20available\x20connector\x20types','31DJLQla','maximum','\x20-\x20','description','enumeration','Type:\x20','log','join','Fetching\x20connection\x20\x27','\x20\x20\x20\x20Options:\x20','properties','owner','blue','map','connection','\x0aAvailable\x20fields:','\x0aConnector:\x20','28EAiMSk','push','✔\x20Resolved\x20\x27','value','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','minimum','title','validate','\x0aNo\x20credential\x20settings\x20defined','>=\x20','34268DAsbdT','legacy_settings','execute','find','\x0aNo\x20fields\x20defined\x20in\x20schema','connection:schema','\x0aCredential\x20settings:','sort','site','Site:\x20','No\x20available\x20fields\x20for\x20this\x20connector','filter','repeat','\x20\x20\x20\x20','Default:\x20','40DaxAnh','cyan','error','dim','3837361djhiAY','max','name','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','\x20connection','Show\x20when:\x20','connection:list','slice','default_value','options','\x20\x20\x20\x20Default:\x20','verbose','stringify','yellow','criteria','Show\x20connection\x20details','\x27\x20as\x20connector\x20type','resolve','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','3591342xzLuRL','Fetching\x20schema\x20for\x20\x27','4843447BrgOKc','padStart','\x20connector\x20type','✔\x20Found\x20connection:\x20','object','limit','Range:\x20','localeCompare','\x27...','673512wDjvQa','settings','320695rqikPF','data','Resolving\x20connector\x20type\x20or\x20name:\x20','Fetching\x20settings\x20for\x20connector\x20type:\x20','connection:show','entries','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','legacy','5944455funVNL','\x20[record]','connection:types','list','Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.','credential','table','\x27\x20(type:\x20','Name:\x20','✔\x20Found\x20','listTypes','bold','length','label','Treating\x20\x27'];a13_0x3227=function(){return _0x33915a;};return a13_0x3227();}function printMetadataSettings(_0x5de049){const _0x357e62=a13_0x237a33;for(const _0x39cd62 of _0x5de049){if(!_0x39cd62[_0x357e62(0xda)])continue;if(_0x39cd62['hidden'])continue;let _0xcee8a0='\x20\x20'+a13_0x430a28[_0x357e62(0x10f)](_0x39cd62[_0x357e62(0xda)]);_0x39cd62[_0x357e62(0x10d)]&&(_0xcee8a0+=':\x20'+_0x39cd62[_0x357e62(0x10d)]);_0x39cd62['type']&&(_0xcee8a0+=a13_0x430a28[_0x357e62(0xd7)]('\x20['+_0x39cd62[_0x357e62(0x114)]+']'));console['log'](_0xcee8a0);_0x39cd62['hint']&&console[_0x357e62(0x11e)]('\x20\x20\x20\x20'+a13_0x430a28[_0x357e62(0xd7)](_0x39cd62['hint']));if(_0x39cd62[_0x357e62(0xe1)]){const _0x5314a8=_0x39cd62[_0x357e62(0xe1)]['map'](_0x192d6d=>_0x192d6d[_0x357e62(0x12c)])[_0x357e62(0x11f)](',\x20');console['log'](_0x357e62(0x121)+a13_0x430a28[_0x357e62(0xe5)](_0x5314a8));}_0x39cd62['default_value']!==undefined&&_0x39cd62[_0x357e62(0xe0)]!==null&&console[_0x357e62(0x11e)](_0x357e62(0xe2)+a13_0x430a28[_0x357e62(0x124)](String(_0x39cd62[_0x357e62(0xe0)])));if(_0x39cd62[_0x357e62(0xe6)]){const _0x14a253=Object[_0x357e62(0xfd)](_0x39cd62['criteria'])[_0x357e62(0x125)](([_0x50cad1,_0x45f528])=>_0x50cad1+'='+JSON[_0x357e62(0xe4)](_0x45f528))['join'](',\x20');console[_0x357e62(0x11e)](_0x357e62(0xd2)+a13_0x430a28[_0x357e62(0xd7)](_0x357e62(0xdd)+_0x14a253));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x4957c0=a14_0x2088;(function(_0x51a29c,_0x553ab1){const _0xced398=a14_0x2088,_0x533d36=_0x51a29c();while(!![]){try{const _0x1db300=-parseInt(_0xced398(0xac))/0x1*(-parseInt(_0xced398(0xb0))/0x2)+parseInt(_0xced398(0xaa))/0x3+parseInt(_0xced398(0xa1))/0x4*(-parseInt(_0xced398(0xa3))/0x5)+parseInt(_0xced398(0xb5))/0x6*(-parseInt(_0xced398(0xad))/0x7)+-parseInt(_0xced398(0x9e))/0x8*(-parseInt(_0xced398(0xae))/0x9)+-parseInt(_0xced398(0xa0))/0xa*(parseInt(_0xced398(0xa4))/0xb)+parseInt(_0xced398(0x9c))/0xc;if(_0x1db300===_0x553ab1)break;else _0x533d36['push'](_0x533d36['shift']());}catch(_0x15b689){_0x533d36['push'](_0x533d36['shift']());}}}(a14_0x3173,0xb0da1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a14_0x2088(_0xeb44f9,_0x2b15a5){_0xeb44f9=_0xeb44f9-0x9a;const _0x3173e4=a14_0x3173();let _0x208899=_0x3173e4[_0xeb44f9];return _0x208899;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a14_0x3173(){const _0x3eb87f=['query','6aOsTog','listDatabases','✔\x20Found\x20','message','16222596OVXMTY','length','56024vUcmwc','execute','2524660HCAucS','228JSVXyM','\x20\x20Cause:\x20','103070zDORXQ','22xylJnH','cause','limit','verbose','name','Site:\x20','1879590KPMQtk','Error:\x20','137350apDKxV','8266657KEaUBa','1359BEjKux','databases','8JhdAeD','\x20database','site','error'];a14_0x3173=function(){return _0x3eb87f;};return a14_0x3173();}export class DatabasesCommand extends BaseCommand{[a14_0x4957c0(0xa8)]=a14_0x4957c0(0xaf);['description']='List\x20all\x20databases';async[a14_0x4957c0(0x9f)](_0x132ee2){const _0x4d8221=a14_0x4957c0,{options:_0x54e5b7,args:_0x318bdf,tdx:_0x4de4df}=_0x132ee2,_0x278cea=_0x318bdf[0x0];try{_0x54e5b7[_0x4d8221(0xa7)]&&(console[_0x4d8221(0xb3)](_0x4d8221(0xa9)+_0x54e5b7[_0x4d8221(0xb2)]),_0x278cea&&console[_0x4d8221(0xb3)]('Pattern:\x20'+_0x278cea));const _0x2fda69=resolveLimit(_0x54e5b7[_0x4d8221(0xa6)],DEFAULT_LISTING_LIMIT),_0x1c7b88=await withSpinner('Listing\x20databases...',()=>_0x4de4df[_0x4d8221(0xb4)][_0x4d8221(0xb6)](_0x278cea,_0x2fda69),{'verbose':_0x54e5b7['verbose']}),_0x31f57c=_0x1c7b88['data'];return console[_0x4d8221(0xb3)](_0x4d8221(0x9a)+_0x31f57c[_0x4d8221(0x9d)]+_0x4d8221(0xb1)+(_0x31f57c[_0x4d8221(0x9d)]!==0x1?'s':'')),await handleSDKOutput(_0x31f57c,{..._0x54e5b7,'limit':_0x2fda69}),0x0;}catch(_0x8aec48){if(_0x8aec48 instanceof SDKError)return console[_0x4d8221(0xb3)](_0x4d8221(0xab)+_0x8aec48[_0x4d8221(0x9b)]),_0x8aec48[_0x4d8221(0xa5)]&&console['error'](_0x4d8221(0xa2)+_0x8aec48[_0x4d8221(0xa5)]),0x1;throw _0x8aec48;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x56a417=a15_0x5d66;(function(_0x8debd3,_0x360963){const _0x48c4af=a15_0x5d66,_0x527498=_0x8debd3();while(!![]){try{const _0xfaabfd=-parseInt(_0x48c4af(0x14e))/0x1+parseInt(_0x48c4af(0x147))/0x2*(-parseInt(_0x48c4af(0x136))/0x3)+-parseInt(_0x48c4af(0x13f))/0x4+-parseInt(_0x48c4af(0x14f))/0x5+-parseInt(_0x48c4af(0x131))/0x6*(-parseInt(_0x48c4af(0x12e))/0x7)+-parseInt(_0x48c4af(0x145))/0x8*(parseInt(_0x48c4af(0x132))/0x9)+parseInt(_0x48c4af(0x146))/0xa;if(_0xfaabfd===_0x360963)break;else _0x527498['push'](_0x527498['shift']());}catch(_0x4f9c4d){_0x527498['push'](_0x527498['shift']());}}}(a15_0x1bd4,0x301e1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a15_0x5d66(_0x447776,_0x8c2b83){_0x447776=_0x447776-0x12e;const _0x1bd4f9=a15_0x1bd4();let _0x5d66b6=_0x1bd4f9[_0x447776];return _0x5d66b6;}function a15_0x1bd4(){const _0x415bf1=['query','5272uAXrRV','9879910GWNNbI','57864GgRTOy','\x20column','validate','database','Table:\x20','Error:\x20','\x27\x20does\x20not\x20exist','384814EFdumX','1392435NcqMlX','21xKjjXf','args','error','424308ckYbZS','765lYmykm','describeTable','name','length','3aaudYT','verbose','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','Describe\x20table\x20schema','Describing\x20table\x20','✖\x20Table\x20not\x20found','Table\x20\x27','description','Site:\x20','1019232XzuQZM','message','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','cause','Database:\x20'];a15_0x1bd4=function(){return _0x415bf1;};return a15_0x1bd4();}import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x56a417(0x134)]='describe';[a15_0x56a417(0x13d)]=a15_0x56a417(0x139);async['execute'](_0x401e18){return this['describeTable'](_0x401e18);}async['describeTable'](_0x5d0c23){const _0x436bb0=a15_0x56a417,{options:_0x4b3650,args:_0x48877c,tdx:_0x502769}=_0x5d0c23;let _0x5425fd;try{_0x5425fd=parseTableReference(_0x48877c[0x0]);const _0x29ad30=_0x4b3650[_0x436bb0(0x14a)];!_0x5425fd[_0x436bb0(0x14a)]&&_0x29ad30&&(_0x5425fd[_0x436bb0(0x14a)]=_0x29ad30);const _0x474ae2=validateTableDescribeReference(_0x5425fd);if(_0x474ae2)return console[_0x436bb0(0x130)]('Error:\x20'+_0x474ae2),0x1;}catch(_0x5e403b){return console[_0x436bb0(0x130)]('Error:\x20'+_0x5e403b[_0x436bb0(0x140)]),0x1;}const _0x1727b9=_0x5425fd[_0x436bb0(0x14a)],_0xbd97d6=_0x5425fd['table'];try{_0x4b3650[_0x436bb0(0x137)]&&(console[_0x436bb0(0x130)](_0x436bb0(0x13e)+_0x4b3650['site']),console['error'](_0x436bb0(0x143)+_0x1727b9),console['error'](_0x436bb0(0x14b)+_0xbd97d6));const _0x1fc210=await withSpinner(_0x436bb0(0x13a)+_0x1727b9+'.'+_0xbd97d6+'...',()=>_0x502769[_0x436bb0(0x144)][_0x436bb0(0x133)](_0x1727b9,_0xbd97d6),{'verbose':_0x4b3650[_0x436bb0(0x137)]}),_0x3c9efd=_0x1fc210['data'];if(_0x3c9efd[_0x436bb0(0x135)]===0x0)return console[_0x436bb0(0x130)](_0x436bb0(0x13b)),console['error'](_0x436bb0(0x13c)+_0x1727b9+'.'+_0xbd97d6+_0x436bb0(0x14d)),0x1;return console[_0x436bb0(0x130)]('✔\x20Found\x20'+_0x3c9efd[_0x436bb0(0x135)]+_0x436bb0(0x148)+(_0x3c9efd[_0x436bb0(0x135)]!==0x1?'s':'')+'\x20in\x20'+_0x1727b9+'.'+_0xbd97d6),await handleSDKOutput(_0x3c9efd,_0x4b3650),0x0;}catch(_0x4a8d98){if(_0x4a8d98 instanceof SDKError)return console[_0x436bb0(0x130)](_0x436bb0(0x14c)+_0x4a8d98['message']),_0x4a8d98[_0x436bb0(0x142)]&&console[_0x436bb0(0x130)]('\x20\x20Cause:\x20'+_0x4a8d98[_0x436bb0(0x142)]),0x1;throw _0x4a8d98;}}[a15_0x56a417(0x149)](_0x28114d){const _0x1a7ca0=a15_0x56a417;if(_0x28114d[_0x1a7ca0(0x12f)]['length']===0x0)return _0x1a7ca0(0x141);if(_0x28114d[_0x1a7ca0(0x12f)][_0x1a7ca0(0x135)]>0x1)return _0x1a7ca0(0x138);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x213fc9=a16_0x9408;(function(_0x10d224,_0x1298db){const _0x5e29fa=a16_0x9408,_0x165cdd=_0x10d224();while(!![]){try{const _0x2cfa88=-parseInt(_0x5e29fa(0xdf))/0x1*(parseInt(_0x5e29fa(0x9e))/0x2)+-parseInt(_0x5e29fa(0xa3))/0x3*(-parseInt(_0x5e29fa(0x112))/0x4)+-parseInt(_0x5e29fa(0xae))/0x5+-parseInt(_0x5e29fa(0x103))/0x6*(parseInt(_0x5e29fa(0xda))/0x7)+-parseInt(_0x5e29fa(0xc4))/0x8+-parseInt(_0x5e29fa(0xa5))/0x9+-parseInt(_0x5e29fa(0xe2))/0xa*(-parseInt(_0x5e29fa(0xaa))/0xb);if(_0x2cfa88===_0x1298db)break;else _0x165cdd['push'](_0x165cdd['shift']());}catch(_0x554409){_0x165cdd['push'](_0x165cdd['shift']());}}}(a16_0x3fcb,0x597f7));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';function a16_0x3fcb(){const _0x4d337f=['Options:\x20--name,\x20--description','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','verbose','engage:campaign:create','2977040ebDSNp','type','jsonColumns','editorType','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','segment','Create\x20an\x20email\x20template','updateWorkspace','createCampaign','html','Error:\x20--subject\x20is\x20required','keys','\x27?\x20This\x20cannot\x20be\x20undone.','Fetching\x20templates...','Delete\x20an\x20email\x20template','engage:template:show','Error:\x20Workspace\x20name\x20is\x20required','engage:workspace:show','fromEntries','session','Campaign\x20\x27','description','14TOHxRj','engage:campaign:resume','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','segmentName','entries','19148DUIRID','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','filter','21305690RTCoGT','engage:campaigns','engage:template:delete','\x27...','emailSenderId','getTemplateFull','\x27\x20deleted\x20successfully','data','Fetching\x20template\x20\x27','startAt','Fetching\x20workspace\x20\x27','Update\x20a\x20campaign','length','engage:template:update','Operation\x20cancelled','listCampaigns','Duplicating\x20campaign\x20\x27','engage:workspace:delete','resumeCampaign','MISSING_ARGUMENT','updateCampaign','Updating\x20workspace\x20\x27','Deleting\x20campaign\x20\x27','engage:workspace:create','Update\x20a\x20workspace','engage:campaign:pause','deleteTemplate','engage:template:create','Creating\x20workspace\x20\x27','\x27\x20resumed\x20successfully','engage_workspace','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Launch\x20a\x20campaign','1583178rmPvsv','execute','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Resuming\x20campaign\x20\x27','Engage\x20workspace\x20set\x20to:\x20','engage:workspace:update','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','yes','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','getWorkspaceFull','name','subject','List\x20email\x20templates','489444YtaNcr','getTemplate','engage:workspace:use','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Fetching\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Resume\x20a\x20paused\x20campaign','Duplicate\x20a\x20campaign','plaintext','Show\x20workspace\x20details','Pause\x20a\x20campaign','getCampaignFull','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Creating\x20campaign\x20\x27','engage:campaign:launch','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Fetching\x20campaigns...','resolveWorkspaceId','Delete\x20a\x20workspace','Deleting\x20template\x20\x27','List\x20workspaces','engage:campaign:delete','workspace','Create\x20a\x20workspace','40CsweFz','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Creating\x20template\x20\x27','Show\x20email\x20template\x20details','6cmLOiy','segmentId','4757094MGZsaF','status','Updating\x20campaign\x20\x27','timezone','engage:campaign:duplicate','11vGKiZd','Error:\x20--name\x20is\x20required','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','986630wKjcfz','Create\x20a\x20new\x20campaign','Fetching\x20workspaces...','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','createWorkspace','updateTemplate','Update\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','full','listTemplates','error','limit','resolvePathToResource','log','Delete\x20a\x20campaign','getWorkspace','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','deleteCampaign'];a16_0x3fcb=function(){return _0x4d337f;};return a16_0x3fcb();}import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a16_0x9408(_0x321ef9,_0x48d55b){_0x321ef9=_0x321ef9-0x9c;const _0x3fcb9c=a16_0x3fcb();let _0x940854=_0x3fcb9c[_0x321ef9];return _0x940854;}async function resolveWorkspaceIdFromOptions(_0x38f3ae,_0x110727,_0x53d8b4=![]){const _0x594410=a16_0x9408;if(_0x38f3ae[_0x594410(0x9c)])return await _0x110727[_0x594410(0x10a)]['resolveWorkspaceId'](_0x38f3ae[_0x594410(0x9c)]);const _0x138369=loadSessionContext(_0x38f3ae[_0x594410(0xd7)]);if(_0x138369?.[_0x594410(0x100)])return await _0x110727[_0x594410(0x10a)][_0x594410(0x124)](_0x138369['engage_workspace']);if(_0x53d8b4)throw new SDKError(ErrorCode[_0x594410(0xf5)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x9e5e27,_0x19acf6){const _0x2610ae=a16_0x9408;if(!_0x9e5e27['segment'])return{};const _0x47d992=_0x9e5e27[_0x2610ae(0xc9)],_0x46ceab=await _0x19acf6[_0x2610ae(0xc9)][_0x2610ae(0xba)](_0x47d992);return{'audienceId':_0x46ceab['parentId'],'audienceName':_0x46ceab['parentName'],..._0x46ceab[_0x2610ae(0xa4)]&&{'segmentId':_0x46ceab[_0x2610ae(0xa4)],'segmentName':_0x46ceab[_0x2610ae(0xdd)]}};}function buildConnectorConfig(_0x1ffd47){const _0xf6acd7=a16_0x9408,_0x2eb9d5=_0x1ffd47[_0xf6acd7(0xe6)],_0x4b3420=_0x1ffd47[_0xf6acd7(0xc6)];if(!_0x2eb9d5&&!_0x4b3420)return undefined;return{..._0x2eb9d5&&{'emailSenderId':_0x2eb9d5},..._0x4b3420&&{'jsonColumns':_0x4b3420}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0xe3);[a16_0x213fc9(0xd9)]='List\x20campaigns';async['execute'](_0x425b62){const _0x2c4993=a16_0x213fc9,{options:_0x520c4a,args:_0xf378a1,tdx:_0x3742bb}=_0x425b62,_0x589a33=_0xf378a1[0x0],_0x33fe23=resolveLimit(_0x520c4a[_0x2c4993(0xb9)],DEFAULT_LLM_LIMIT),_0xfceb94=_0x520c4a,_0x29c14e=_0xfceb94[_0x2c4993(0xc5)],_0x1f8edc=_0xfceb94[_0x2c4993(0xa6)],_0x32d385=await resolveWorkspaceIdFromOptions(_0xfceb94,_0x3742bb),_0x5364a0=await withSpinner(_0x2c4993(0x123),()=>_0x3742bb[_0x2c4993(0x10a)][_0x2c4993(0xf1)]({'type':_0x29c14e,'status':_0x1f8edc,'workspaceId':_0x32d385,'limit':_0x33fe23}),{'verbose':_0x520c4a[_0x2c4993(0xc2)]});let _0x166aae=_0x5364a0[_0x2c4993(0xe9)];return _0x589a33&&(_0x166aae=_0x5364a0[_0x2c4993(0xe9)][_0x2c4993(0xe1)](_0x1368f7=>matchGlobPattern(_0x1368f7['name'],_0x589a33))),await handleSDKOutput(_0x166aae,_0x520c4a),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x213fc9(0x10f)]='engage:campaign:show';['description']='Show\x20campaign\x20details';async[a16_0x213fc9(0x104)](_0x2f1230){const _0x2e0a6e=a16_0x213fc9,{options:_0x1a1386,args:_0x1fe8ae,tdx:_0x37f1f9}=_0x2f1230;if(_0x1fe8ae[_0x2e0a6e(0xee)]===0x0)return console[_0x2e0a6e(0xb8)](_0x2e0a6e(0x10d)),console[_0x2e0a6e(0xb8)](_0x2e0a6e(0xb5)),0x1;const _0x3dd215=_0x1fe8ae[0x0],_0x4b1ef5=_0x1a1386,_0x4a7bce=await resolveWorkspaceIdFromOptions(_0x4b1ef5,_0x37f1f9),_0x40a398=_0x4b1ef5[_0x2e0a6e(0xb6)];if(_0x40a398){const _0x28f6c6=await withSpinner(_0x2e0a6e(0x116)+_0x3dd215+'\x27...',()=>_0x37f1f9['engage'][_0x2e0a6e(0x11d)](_0x3dd215,_0x4a7bce),{'verbose':_0x1a1386[_0x2e0a6e(0xc2)]});await handleSDKOutput([_0x28f6c6],_0x1a1386);}else{const _0x274c7a=await withSpinner(_0x2e0a6e(0x116)+_0x3dd215+_0x2e0a6e(0xe5),()=>_0x37f1f9[_0x2e0a6e(0x10a)]['getCampaign'](_0x3dd215,_0x4a7bce),{'verbose':_0x1a1386[_0x2e0a6e(0xc2)]});await handleSDKOutput([_0x274c7a],_0x1a1386);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0xc3);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0xaf);async[a16_0x213fc9(0x104)](_0x4d6b4b){const _0x184c94=a16_0x213fc9,{options:_0x3c59c1,tdx:_0x5bdd5e}=_0x4d6b4b,_0x539ffa=_0x3c59c1,_0x2972e0=_0x539ffa[_0x184c94(0x10f)],_0xc2f32c=_0x539ffa[_0x184c94(0xc5)];if(!_0x2972e0)return console[_0x184c94(0xb8)](_0x184c94(0xab)),console[_0x184c94(0xb8)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0xc2f32c)return console[_0x184c94(0xb8)](_0x184c94(0xc8)),console[_0x184c94(0xb8)](_0x184c94(0x10b)),0x1;const _0xb397d9=await resolveWorkspaceIdFromOptions(_0x539ffa,_0x5bdd5e,!![]),_0x5e4138=await resolveSegmentFromOptions(_0x539ffa,_0x5bdd5e),_0x2a4e3b=buildConnectorConfig(_0x539ffa),_0x14756e={'name':_0x2972e0,'campaignType':_0xc2f32c,'workspaceId':_0xb397d9,'description':_0x539ffa[_0x184c94(0xd9)],..._0x5e4138,'connectorConfig':_0x2a4e3b,'startAt':_0x539ffa[_0x184c94(0xeb)],'timezone':_0x539ffa[_0x184c94(0xa8)]},_0x280ceb=await withSpinner(_0x184c94(0x11f)+_0x2972e0+'\x27...',()=>_0x5bdd5e[_0x184c94(0x10a)][_0x184c94(0xcc)](_0x14756e));return await handleSDKOutput([_0x280ceb[_0x184c94(0xe9)]],_0x3c59c1),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']='engage:campaign:update';['description']=a16_0x213fc9(0xed);async[a16_0x213fc9(0x104)](_0xa288a){const _0x3ff118=a16_0x213fc9,{options:_0x2229e5,args:_0x2b7f12,tdx:_0x52b70d}=_0xa288a;if(_0x2b7f12[_0x3ff118(0xee)]===0x0)return console['error'](_0x3ff118(0x10d)),console[_0x3ff118(0xb8)](_0x3ff118(0xb1)),0x1;const _0x1a9813=_0x2b7f12[0x0],_0x5d0c10=_0x2229e5,_0x2480a=await resolveWorkspaceIdFromOptions(_0x5d0c10,_0x52b70d),_0x4ce382=await resolveSegmentFromOptions(_0x5d0c10,_0x52b70d),_0x1e3b18=buildConnectorConfig(_0x5d0c10),_0x39551f={'name':_0x5d0c10['name'],'description':_0x5d0c10[_0x3ff118(0xd9)],..._0x4ce382,'connectorConfig':_0x1e3b18,'startAt':_0x5d0c10['startAt'],'timezone':_0x5d0c10[_0x3ff118(0xa8)]},_0x51beee=Object['fromEntries'](Object['entries'](_0x39551f)[_0x3ff118(0xe1)](([,_0x5ce95e])=>_0x5ce95e!==undefined));if(Object[_0x3ff118(0xcf)](_0x51beee)[_0x3ff118(0xee)]===0x0)return console[_0x3ff118(0xb8)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3ff118(0xb8)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0xa7f9c7=await withSpinner(_0x3ff118(0xa7)+_0x1a9813+_0x3ff118(0xe5),()=>_0x52b70d[_0x3ff118(0x10a)][_0x3ff118(0xf6)](_0x1a9813,_0x51beee,_0x2480a),{'verbose':_0x2229e5[_0x3ff118(0xc2)]});return await handleSDKOutput([_0xa7f9c7[_0x3ff118(0xe9)]],_0x2229e5),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a16_0x213fc9(0x128);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0xbc);async[a16_0x213fc9(0x104)](_0x5b88da){const _0xac7752=a16_0x213fc9,{options:_0x54c90d,args:_0x28475b,tdx:_0x263b4e}=_0x5b88da;if(_0x28475b['length']===0x0)return console[_0xac7752(0xb8)](_0xac7752(0x10d)),console['error'](_0xac7752(0x121)),0x1;const _0x2f0c0c=_0x28475b[0x0],_0x4f1e90=_0x54c90d,_0x595c50=await resolveWorkspaceIdFromOptions(_0x4f1e90,_0x263b4e);if(!_0x54c90d[_0xac7752(0x10c)]){const _0x152a32=await confirm(_0xac7752(0xe0)+_0x2f0c0c+_0xac7752(0xd0));if(!_0x152a32)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner(_0xac7752(0xf8)+_0x2f0c0c+'\x27...',()=>_0x263b4e[_0xac7752(0x10a)][_0xac7752(0xbf)](_0x2f0c0c,_0x595c50),{'verbose':_0x54c90d[_0xac7752(0xc2)]}),console[_0xac7752(0xbb)](_0xac7752(0xd8)+_0x2f0c0c+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0x120);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0x102);async['execute'](_0x2b0349){const _0x199744=a16_0x213fc9,{options:_0xc485fd,args:_0x3e6ce0,tdx:_0x48c976}=_0x2b0349;if(_0x3e6ce0[_0x199744(0xee)]===0x0)return console[_0x199744(0xb8)](_0x199744(0x10d)),console[_0x199744(0xb8)](_0x199744(0xc1)),0x1;const _0x5620a8=_0x3e6ce0[0x0],_0x149125=_0xc485fd,_0x5dd8b3=await resolveWorkspaceIdFromOptions(_0x149125,_0x48c976);return await withSpinner('Launching\x20campaign\x20\x27'+_0x5620a8+_0x199744(0xe5),()=>_0x48c976['engage']['launchCampaign'](_0x5620a8,_0x5dd8b3),{'verbose':_0xc485fd[_0x199744(0xc2)]}),console['log'](_0x199744(0xd8)+_0x5620a8+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0xfb);['description']=a16_0x213fc9(0x11c);async['execute'](_0x51d91b){const _0x379bae=a16_0x213fc9,{options:_0x58c7dc,args:_0x4a50f4,tdx:_0xc54fe9}=_0x51d91b;if(_0x4a50f4['length']===0x0)return console[_0x379bae(0xb8)](_0x379bae(0x10d)),console[_0x379bae(0xb8)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x4b32e9=_0x4a50f4[0x0],_0x16ae06=_0x58c7dc,_0x1c9445=await resolveWorkspaceIdFromOptions(_0x16ae06,_0xc54fe9);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x4b32e9+_0x379bae(0xe5),()=>_0xc54fe9[_0x379bae(0x10a)]['pauseCampaign'](_0x4b32e9,_0x1c9445),{'verbose':_0x58c7dc[_0x379bae(0xc2)]}),console[_0x379bae(0xbb)](_0x379bae(0xd8)+_0x4b32e9+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a16_0x213fc9(0xdb);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0x118);async['execute'](_0x5e5539){const _0x2fb0bf=a16_0x213fc9,{options:_0x383b0e,args:_0x20729c,tdx:_0x57b4a6}=_0x5e5539;if(_0x20729c[_0x2fb0bf(0xee)]===0x0)return console[_0x2fb0bf(0xb8)](_0x2fb0bf(0x10d)),console[_0x2fb0bf(0xb8)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x265dbe=_0x20729c[0x0],_0x128c01=_0x383b0e,_0x3a7136=await resolveWorkspaceIdFromOptions(_0x128c01,_0x57b4a6);return await withSpinner(_0x2fb0bf(0x106)+_0x265dbe+'\x27...',()=>_0x57b4a6[_0x2fb0bf(0x10a)][_0x2fb0bf(0xf4)](_0x265dbe,_0x3a7136),{'verbose':_0x383b0e[_0x2fb0bf(0xc2)]}),console[_0x2fb0bf(0xbb)]('Campaign\x20\x27'+_0x265dbe+_0x2fb0bf(0xff)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a16_0x213fc9(0xa9);['description']=a16_0x213fc9(0x119);async[a16_0x213fc9(0x104)](_0x272e76){const _0x1ff9a1=a16_0x213fc9,{options:_0x1c4213,args:_0x43fa70,tdx:_0x8d032f}=_0x272e76;if(_0x43fa70['length']===0x0)return console[_0x1ff9a1(0xb8)](_0x1ff9a1(0x10d)),console[_0x1ff9a1(0xb8)](_0x1ff9a1(0x9f)),0x1;const _0x266149=_0x43fa70[0x0],_0x887ece=_0x1c4213,_0x2f19f0=await resolveWorkspaceIdFromOptions(_0x887ece,_0x8d032f),_0x284bc7=await withSpinner(_0x1ff9a1(0xf2)+_0x266149+'\x27...',()=>_0x8d032f[_0x1ff9a1(0x10a)]['duplicateCampaign'](_0x266149,_0x2f19f0),{'verbose':_0x1c4213[_0x1ff9a1(0xc2)]});return await handleSDKOutput([_0x284bc7[_0x1ff9a1(0xe9)]],_0x1c4213),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x213fc9(0x10f)]='engage:templates';[a16_0x213fc9(0xd9)]=a16_0x213fc9(0x111);async['execute'](_0x43a484){const _0x3c2fb7=a16_0x213fc9,{options:_0x5b5ceb,args:_0x136feb,tdx:_0x1c364d}=_0x43a484,_0x5a1884=_0x136feb[0x0],_0xff2b37=resolveLimit(_0x5b5ceb[_0x3c2fb7(0xb9)],DEFAULT_LLM_LIMIT),_0x25ecc4=_0x5b5ceb,_0x3bc213=await resolveWorkspaceIdFromOptions(_0x25ecc4,_0x1c364d),_0x50173d=await withSpinner(_0x3c2fb7(0xd1),()=>_0x1c364d[_0x3c2fb7(0x10a)][_0x3c2fb7(0xb7)]({'workspaceId':_0x3bc213,'limit':_0xff2b37}),{'verbose':_0x5b5ceb[_0x3c2fb7(0xc2)]});let _0x300346=_0x50173d[_0x3c2fb7(0xe9)];return _0x5a1884&&(_0x300346=_0x50173d[_0x3c2fb7(0xe9)][_0x3c2fb7(0xe1)](_0x2fd45b=>matchGlobPattern(_0x2fd45b['name'],_0x5a1884))),await handleSDKOutput(_0x300346,_0x5b5ceb),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a16_0x213fc9(0xd3);['description']=a16_0x213fc9(0xa2);async[a16_0x213fc9(0x104)](_0x29dd1a){const _0x26bb11=a16_0x213fc9,{options:_0x5a5402,args:_0x3b73bf,tdx:_0x6b391f}=_0x29dd1a;if(_0x3b73bf[_0x26bb11(0xee)]===0x0)return console[_0x26bb11(0xb8)](_0x26bb11(0xac)),console[_0x26bb11(0xb8)](_0x26bb11(0x117)),0x1;const _0x3084b4=_0x3b73bf[0x0],_0xc4836e=_0x5a5402,_0x3759a1=await resolveWorkspaceIdFromOptions(_0xc4836e,_0x6b391f),_0x26f41e=_0xc4836e[_0x26bb11(0xb6)];if(_0x26f41e){const _0x27390e=await withSpinner(_0x26bb11(0xea)+_0x3084b4+_0x26bb11(0xe5),()=>_0x6b391f[_0x26bb11(0x10a)][_0x26bb11(0xe7)](_0x3084b4,_0x3759a1),{'verbose':_0x5a5402['verbose']});await handleSDKOutput([_0x27390e],_0x5a5402);}else{const _0x4aa115=await withSpinner(_0x26bb11(0xea)+_0x3084b4+_0x26bb11(0xe5),()=>_0x6b391f[_0x26bb11(0x10a)][_0x26bb11(0x113)](_0x3084b4,_0x3759a1),{'verbose':_0x5a5402[_0x26bb11(0xc2)]});await handleSDKOutput([_0x4aa115],_0x5a5402);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']=a16_0x213fc9(0xfd);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0xca);async[a16_0x213fc9(0x104)](_0x795dfe){const _0xad19bb=a16_0x213fc9,{options:_0x25def7,tdx:_0x500ecf}=_0x795dfe,_0x242987=_0x25def7,_0x20316d=_0x242987['name'],_0x22a354=_0x242987['subject'],_0x3e99cd=_0x242987[_0xad19bb(0xcd)];if(!_0x20316d)return console[_0xad19bb(0xb8)]('Error:\x20--name\x20is\x20required'),console['error'](_0xad19bb(0xbe)),0x1;if(!_0x22a354)return console[_0xad19bb(0xb8)](_0xad19bb(0xce)),0x1;if(!_0x3e99cd)return console[_0xad19bb(0xb8)]('Error:\x20--html\x20is\x20required'),0x1;const _0x29b00e=await resolveWorkspaceIdFromOptions(_0x242987,_0x500ecf,!![]),_0x39d277={'name':_0x20316d,'subjectTemplate':_0x22a354,'htmlTemplate':_0x3e99cd,'workspaceId':_0x29b00e,'plaintextTemplate':_0x242987['plaintext'],'editorType':_0x242987[_0xad19bb(0xc7)]},_0x155eb2=await withSpinner(_0xad19bb(0xa1)+_0x20316d+_0xad19bb(0xe5),()=>_0x500ecf[_0xad19bb(0x10a)]['createTemplate'](_0x39d277));return await handleSDKOutput([_0x155eb2['data']],_0x25def7),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x213fc9(0xef);['description']=a16_0x213fc9(0xb4);async[a16_0x213fc9(0x104)](_0x170261){const _0x3f99d7=a16_0x213fc9,{options:_0x52ff08,args:_0x4ebb73,tdx:_0x3a4999}=_0x170261;if(_0x4ebb73[_0x3f99d7(0xee)]===0x0)return console[_0x3f99d7(0xb8)](_0x3f99d7(0xac)),console['error'](_0x3f99d7(0x109)),0x1;const _0x2d6be2=_0x4ebb73[0x0],_0x5dfceb=_0x52ff08,_0x28a9ab=await resolveWorkspaceIdFromOptions(_0x5dfceb,_0x3a4999),_0x49f405={'name':_0x5dfceb[_0x3f99d7(0x10f)],'subjectTemplate':_0x5dfceb[_0x3f99d7(0x110)],'htmlTemplate':_0x5dfceb[_0x3f99d7(0xcd)],'plaintextTemplate':_0x5dfceb[_0x3f99d7(0x11a)]},_0x1798b2=Object[_0x3f99d7(0xd6)](Object[_0x3f99d7(0xde)](_0x49f405)['filter'](([,_0x7f346c])=>_0x7f346c!==undefined));if(Object[_0x3f99d7(0xcf)](_0x1798b2)[_0x3f99d7(0xee)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3f99d7(0xb8)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x4ed6f2=await withSpinner('Updating\x20template\x20\x27'+_0x2d6be2+'\x27...',()=>_0x3a4999['engage'][_0x3f99d7(0xb3)](_0x2d6be2,_0x1798b2,_0x28a9ab),{'verbose':_0x52ff08[_0x3f99d7(0xc2)]});return await handleSDKOutput([_0x4ed6f2[_0x3f99d7(0xe9)]],_0x52ff08),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a16_0x213fc9(0xe4);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0xd2);async[a16_0x213fc9(0x104)](_0x4aa4df){const _0x1621d2=a16_0x213fc9,{options:_0x4ea47f,args:_0x2a94cd,tdx:_0x29a0e7}=_0x4aa4df;if(_0x2a94cd['length']===0x0)return console[_0x1621d2(0xb8)](_0x1621d2(0xac)),console[_0x1621d2(0xb8)](_0x1621d2(0x115)),0x1;const _0x29d23d=_0x2a94cd[0x0],_0x4ae8a7=_0x4ea47f,_0x31ea77=await resolveWorkspaceIdFromOptions(_0x4ae8a7,_0x29a0e7);if(!_0x4ea47f[_0x1621d2(0x10c)]){const _0x4477ed=await confirm(_0x1621d2(0x122)+_0x29d23d+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x4477ed)return console[_0x1621d2(0xbb)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x1621d2(0x126)+_0x29d23d+_0x1621d2(0xe5),()=>_0x29a0e7[_0x1621d2(0x10a)][_0x1621d2(0xfc)](_0x29d23d,_0x31ea77),{'verbose':_0x4ea47f[_0x1621d2(0xc2)]}),console[_0x1621d2(0xbb)]('Template\x20\x27'+_0x29d23d+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x213fc9(0x10f)]='engage:workspaces';[a16_0x213fc9(0xd9)]=a16_0x213fc9(0x127);async[a16_0x213fc9(0x104)](_0x3d6dde){const _0x1bdab9=a16_0x213fc9,{options:_0x3dbf3b,args:_0xed3048,tdx:_0x3d019a}=_0x3d6dde,_0x7d562a=_0xed3048[0x0],_0x35d9d8=resolveLimit(_0x3dbf3b['limit'],DEFAULT_LLM_LIMIT),_0x4b26f5=await withSpinner(_0x1bdab9(0xb0),()=>_0x3d019a['engage']['listWorkspaces']({'limit':_0x35d9d8}),{'verbose':_0x3dbf3b[_0x1bdab9(0xc2)]});let _0x202762=_0x4b26f5[_0x1bdab9(0xe9)];return _0x7d562a&&(_0x202762=_0x4b26f5['data'][_0x1bdab9(0xe1)](_0x3ed9c4=>matchGlobPattern(_0x3ed9c4['name'],_0x7d562a))),await handleSDKOutput(_0x202762,_0x3dbf3b),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0xd5);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0x11b);async[a16_0x213fc9(0x104)](_0x536837){const _0x3be1df=a16_0x213fc9,{options:_0x5aa43a,args:_0x2ea28b,tdx:_0x154e10}=_0x536837;if(_0x2ea28b[_0x3be1df(0xee)]===0x0)return console[_0x3be1df(0xb8)](_0x3be1df(0x11e)),console[_0x3be1df(0xb8)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x3b745d=_0x2ea28b[0x0],_0x2d6e82=_0x5aa43a,_0x3b958c=_0x2d6e82[_0x3be1df(0xb6)];if(_0x3b958c){const _0x4466d7=await withSpinner(_0x3be1df(0xec)+_0x3b745d+_0x3be1df(0xe5),()=>_0x154e10['engage'][_0x3be1df(0x10e)](_0x3b745d),{'verbose':_0x5aa43a[_0x3be1df(0xc2)]});await handleSDKOutput([_0x4466d7],_0x5aa43a);}else{const _0x13d6ec=await withSpinner(_0x3be1df(0xec)+_0x3b745d+_0x3be1df(0xe5),()=>_0x154e10[_0x3be1df(0x10a)][_0x3be1df(0xbd)](_0x3b745d),{'verbose':_0x5aa43a[_0x3be1df(0xc2)]});await handleSDKOutput([_0x13d6ec],_0x5aa43a);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0xf9);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0x9d);async[a16_0x213fc9(0x104)](_0x42f47c){const _0x40c968=a16_0x213fc9,{options:_0x504048,tdx:_0x473cc9}=_0x42f47c,_0x1bc718=_0x504048,_0x30b083=_0x1bc718['name'];if(!_0x30b083)return console[_0x40c968(0xb8)](_0x40c968(0xab)),console[_0x40c968(0xb8)](_0x40c968(0xad)),0x1;const _0x4489c3={'name':_0x30b083,'description':_0x1bc718[_0x40c968(0xd9)]},_0x38adec=await withSpinner(_0x40c968(0xfe)+_0x30b083+_0x40c968(0xe5),()=>_0x473cc9['engage'][_0x40c968(0xb2)](_0x4489c3));return await handleSDKOutput([_0x38adec[_0x40c968(0xe9)]],_0x504048),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0x108);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0xfa);async[a16_0x213fc9(0x104)](_0x306ddb){const _0x4cf5d1=a16_0x213fc9,{options:_0x483879,args:_0x24cac5,tdx:_0x2e3166}=_0x306ddb;if(_0x24cac5['length']===0x0)return console['error'](_0x4cf5d1(0x11e)),console[_0x4cf5d1(0xb8)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x188f3d=_0x24cac5[0x0],_0x1eaf13=_0x483879,_0x51a0aa={'name':_0x1eaf13[_0x4cf5d1(0x10f)],'description':_0x1eaf13[_0x4cf5d1(0xd9)]},_0x46ed78=Object['fromEntries'](Object[_0x4cf5d1(0xde)](_0x51a0aa)['filter'](([,_0x489705])=>_0x489705!==undefined));if(Object['keys'](_0x46ed78)[_0x4cf5d1(0xee)]===0x0)return console['error'](_0x4cf5d1(0xa0)),console[_0x4cf5d1(0xb8)](_0x4cf5d1(0xc0)),0x1;const _0x40162c=await withSpinner(_0x4cf5d1(0xf7)+_0x188f3d+_0x4cf5d1(0xe5),()=>_0x2e3166[_0x4cf5d1(0x10a)][_0x4cf5d1(0xcb)](_0x188f3d,_0x46ed78),{'verbose':_0x483879[_0x4cf5d1(0xc2)]});return await handleSDKOutput([_0x40162c[_0x4cf5d1(0xe9)]],_0x483879),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0xf3);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0x125);async['execute'](_0x3e2ae9){const _0x26974c=a16_0x213fc9,{options:_0x46a07f,args:_0x4b56a2,tdx:_0x5a9bd5}=_0x3e2ae9;if(_0x4b56a2[_0x26974c(0xee)]===0x0)return console[_0x26974c(0xb8)](_0x26974c(0x11e)),console[_0x26974c(0xb8)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x37c769=_0x4b56a2[0x0];if(!_0x46a07f[_0x26974c(0x10c)]){const _0x5989af=await confirm(_0x26974c(0x105)+_0x37c769+_0x26974c(0xd0));if(!_0x5989af)return console[_0x26974c(0xbb)](_0x26974c(0xf0)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x37c769+_0x26974c(0xe5),()=>_0x5a9bd5[_0x26974c(0x10a)]['deleteWorkspace'](_0x37c769),{'verbose':_0x46a07f[_0x26974c(0xc2)]}),console[_0x26974c(0xbb)]('Workspace\x20\x27'+_0x37c769+_0x26974c(0xe8)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x213fc9(0x10f)]=a16_0x213fc9(0x114);[a16_0x213fc9(0xd9)]=a16_0x213fc9(0x101);async[a16_0x213fc9(0x104)](_0x544b77){const _0x4afdf9=a16_0x213fc9,{options:_0x5edf49,args:_0x36b64a,tdx:_0x150b73}=_0x544b77;if(_0x36b64a[_0x4afdf9(0xee)]===0x0)return console[_0x4afdf9(0xb8)](_0x4afdf9(0xd4)),console[_0x4afdf9(0xb8)]('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x492e8a=_0x36b64a[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x492e8a+_0x4afdf9(0xe5),()=>_0x150b73[_0x4afdf9(0x10a)]['resolveWorkspaceId'](_0x492e8a));const _0x29a7a7=_0x5edf49['session']||undefined;return saveSessionContext({'engage_workspace':_0x492e8a},_0x29a7a7),console[_0x4afdf9(0xbb)](_0x4afdf9(0x107)+_0x492e8a),console['log'](_0x4afdf9(0xdc)),0x0;}}
|
|
1
|
+
const a16_0x4bae31=a16_0x2123;(function(_0x4441fe,_0x435532){const _0xb8441d=a16_0x2123,_0x1f447b=_0x4441fe();while(!![]){try{const _0x1baca7=parseInt(_0xb8441d(0x1de))/0x1*(-parseInt(_0xb8441d(0x1bb))/0x2)+parseInt(_0xb8441d(0x22e))/0x3*(parseInt(_0xb8441d(0x1c1))/0x4)+parseInt(_0xb8441d(0x1d7))/0x5*(parseInt(_0xb8441d(0x220))/0x6)+-parseInt(_0xb8441d(0x230))/0x7*(parseInt(_0xb8441d(0x1ef))/0x8)+-parseInt(_0xb8441d(0x224))/0x9*(-parseInt(_0xb8441d(0x20d))/0xa)+-parseInt(_0xb8441d(0x1f2))/0xb*(parseInt(_0xb8441d(0x247))/0xc)+parseInt(_0xb8441d(0x20a))/0xd;if(_0x1baca7===_0x435532)break;else _0x1f447b['push'](_0x1f447b['shift']());}catch(_0x3ebd3f){_0x1f447b['push'](_0x1f447b['shift']());}}}(a16_0x23de,0x8bc84));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x598726,_0x5106d6,_0xab8155=![]){const _0x264609=a16_0x2123;if(_0x598726[_0x264609(0x21e)])return await _0x5106d6[_0x264609(0x22b)]['resolveWorkspaceId'](_0x598726[_0x264609(0x21e)]);const _0x238ceb=loadSessionContext(_0x598726[_0x264609(0x204)]);if(_0x238ceb?.['engage_workspace'])return await _0x5106d6[_0x264609(0x22b)]['resolveWorkspaceId'](_0x238ceb[_0x264609(0x21d)]);if(_0xab8155)throw new SDKError(ErrorCode[_0x264609(0x203)],_0x264609(0x1bd),undefined,{'helpText':_0x264609(0x23b)});return undefined;}async function resolveSegmentFromOptions(_0xf67bc7,_0xdaff6c){const _0x1c446f=a16_0x2123;if(!_0xf67bc7[_0x1c446f(0x1d5)])return{};const _0x10357c=_0xf67bc7[_0x1c446f(0x1d5)],_0x4471a=await _0xdaff6c[_0x1c446f(0x1d5)]['resolvePathToResource'](_0x10357c);return{'audienceId':_0x4471a[_0x1c446f(0x1f3)],'audienceName':_0x4471a[_0x1c446f(0x1fc)],..._0x4471a[_0x1c446f(0x242)]&&{'segmentId':_0x4471a['segmentId'],'segmentName':_0x4471a[_0x1c446f(0x210)]}};}function buildConnectorConfig(_0xe5151){const _0x13fab3=a16_0x2123,_0x30557e=_0xe5151['emailSenderId'],_0x8428f9=_0xe5151[_0x13fab3(0x249)];if(!_0x30557e&&!_0x8428f9)return undefined;return{..._0x30557e&&{'emailSenderId':_0x30557e},..._0x8428f9&&{'jsonColumns':_0x8428f9}};}export class EngageCampaignsCommand extends BaseCommand{['name']='engage:campaigns';[a16_0x4bae31(0x1f6)]='List\x20campaigns';async['execute'](_0xfe01a6){const _0x1969bf=a16_0x4bae31,{options:_0x41adcd,args:_0xea8bcc,tdx:_0x207a81}=_0xfe01a6,_0x4c0562=_0xea8bcc[0x0],_0x150f2f=resolveLimit(_0x41adcd[_0x1969bf(0x22a)],DEFAULT_LLM_LIMIT),_0x5e7f5b=_0x41adcd,_0x367f8b=_0x5e7f5b[_0x1969bf(0x1d2)],_0x55c4b0=_0x5e7f5b[_0x1969bf(0x21a)],_0x260135=await resolveWorkspaceIdFromOptions(_0x5e7f5b,_0x207a81),_0x42fde5=await withSpinner(_0x1969bf(0x222),()=>_0x207a81['engage'][_0x1969bf(0x1cf)]({'type':_0x367f8b,'status':_0x55c4b0,'workspaceId':_0x260135,'limit':_0x150f2f}),{'verbose':_0x41adcd[_0x1969bf(0x1ee)]});let _0x29501c=_0x42fde5['data'];return _0x4c0562&&(_0x29501c=_0x42fde5['data'][_0x1969bf(0x20c)](_0x43c31a=>matchGlobPattern(_0x43c31a[_0x1969bf(0x1e4)],_0x4c0562))),await handleSDKOutput(_0x29501c,_0x41adcd),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]='engage:campaign:show';['description']=a16_0x4bae31(0x21f);async[a16_0x4bae31(0x1ec)](_0x23b32b){const _0x1378a6=a16_0x4bae31,{options:_0x3d1e57,args:_0x19ca67,tdx:_0x1d1d80}=_0x23b32b;if(_0x19ca67[_0x1378a6(0x1ba)]===0x0)return console[_0x1378a6(0x1dd)](_0x1378a6(0x20e)),console[_0x1378a6(0x1dd)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x4e778c=_0x19ca67[0x0],_0xeceacd=_0x3d1e57,_0x31c16a=await resolveWorkspaceIdFromOptions(_0xeceacd,_0x1d1d80),_0x145ece=_0xeceacd[_0x1378a6(0x1e9)];if(_0x145ece){const _0x522de2=await withSpinner('Fetching\x20campaign\x20\x27'+_0x4e778c+_0x1378a6(0x24b),()=>_0x1d1d80[_0x1378a6(0x22b)][_0x1378a6(0x206)](_0x4e778c,_0x31c16a),{'verbose':_0x3d1e57[_0x1378a6(0x1ee)]});await handleSDKOutput([_0x522de2],_0x3d1e57);}else{const _0x3c2d34=await withSpinner('Fetching\x20campaign\x20\x27'+_0x4e778c+_0x1378a6(0x24b),()=>_0x1d1d80[_0x1378a6(0x22b)][_0x1378a6(0x1cc)](_0x4e778c,_0x31c16a),{'verbose':_0x3d1e57[_0x1378a6(0x1ee)]});await handleSDKOutput([_0x3c2d34],_0x3d1e57);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a16_0x4bae31(0x237);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x1b9);async[a16_0x4bae31(0x1ec)](_0x276056){const _0x22ffa6=a16_0x4bae31,{options:_0x2be7ba,tdx:_0x45cd82}=_0x276056,_0x246c25=_0x2be7ba,_0xd83735=_0x246c25[_0x22ffa6(0x1e4)],_0x31adb8=_0x246c25[_0x22ffa6(0x1d2)];if(!_0xd83735)return console[_0x22ffa6(0x1dd)](_0x22ffa6(0x1db)),console[_0x22ffa6(0x1dd)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x31adb8)return console['error'](_0x22ffa6(0x1fd)),console[_0x22ffa6(0x1dd)](_0x22ffa6(0x1d6)),0x1;const _0x3adea0=await resolveWorkspaceIdFromOptions(_0x246c25,_0x45cd82,!![]),_0x1e4f7f=await resolveSegmentFromOptions(_0x246c25,_0x45cd82),_0x47296b=buildConnectorConfig(_0x246c25),_0x509d12={'name':_0xd83735,'campaignType':_0x31adb8,'workspaceId':_0x3adea0,'description':_0x246c25[_0x22ffa6(0x1f6)],..._0x1e4f7f,'connectorConfig':_0x47296b,'startAt':_0x246c25[_0x22ffa6(0x1e1)],'timezone':_0x246c25[_0x22ffa6(0x1eb)]},_0x5adb6b=await withSpinner(_0x22ffa6(0x1c8)+_0xd83735+_0x22ffa6(0x24b),()=>_0x45cd82[_0x22ffa6(0x22b)]['createCampaign'](_0x509d12));return await handleSDKOutput([_0x5adb6b['data']],_0x2be7ba),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x23a);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x1fe);async[a16_0x4bae31(0x1ec)](_0x136a45){const _0x579ce1=a16_0x4bae31,{options:_0x42e8b5,args:_0x289d09,tdx:_0x4d341b}=_0x136a45;if(_0x289d09[_0x579ce1(0x1ba)]===0x0)return console[_0x579ce1(0x1dd)](_0x579ce1(0x20e)),console['error'](_0x579ce1(0x213)),0x1;const _0x21edc5=_0x289d09[0x0],_0x54bdc6=_0x42e8b5,_0x4e7223=await resolveWorkspaceIdFromOptions(_0x54bdc6,_0x4d341b),_0x3f01b0=await resolveSegmentFromOptions(_0x54bdc6,_0x4d341b),_0xc0af1f=buildConnectorConfig(_0x54bdc6),_0x45c726={'name':_0x54bdc6[_0x579ce1(0x1e4)],'description':_0x54bdc6[_0x579ce1(0x1f6)],..._0x3f01b0,'connectorConfig':_0xc0af1f,'startAt':_0x54bdc6[_0x579ce1(0x1e1)],'timezone':_0x54bdc6['timezone']},_0x57bf26=Object[_0x579ce1(0x24d)](Object[_0x579ce1(0x1f5)](_0x45c726)[_0x579ce1(0x20c)](([,_0x2d2dec])=>_0x2d2dec!==undefined));if(Object[_0x579ce1(0x23c)](_0x57bf26)['length']===0x0)return console[_0x579ce1(0x1dd)](_0x579ce1(0x238)),console['error'](_0x579ce1(0x20f)),0x1;const _0x54f06c=await withSpinner(_0x579ce1(0x1c3)+_0x21edc5+_0x579ce1(0x24b),()=>_0x4d341b[_0x579ce1(0x22b)][_0x579ce1(0x1bf)](_0x21edc5,_0x57bf26,_0x4e7223),{'verbose':_0x42e8b5['verbose']});return await handleSDKOutput([_0x54f06c[_0x579ce1(0x1cd)]],_0x42e8b5),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x20b);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x1d0);async['execute'](_0x30bf30){const _0x2ca3b3=a16_0x4bae31,{options:_0x4f9abc,args:_0x2701c8,tdx:_0x192367}=_0x30bf30;if(_0x2701c8['length']===0x0)return console['error'](_0x2ca3b3(0x20e)),console[_0x2ca3b3(0x1dd)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x2638b0=_0x2701c8[0x0],_0x11113c=_0x4f9abc,_0x29a538=await resolveWorkspaceIdFromOptions(_0x11113c,_0x192367);if(!_0x4f9abc['yes']){const _0x343479=await confirm(_0x2ca3b3(0x201)+_0x2638b0+_0x2ca3b3(0x1e7));if(!_0x343479)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner(_0x2ca3b3(0x1f7)+_0x2638b0+'\x27...',()=>_0x192367[_0x2ca3b3(0x22b)]['deleteCampaign'](_0x2638b0,_0x29a538),{'verbose':_0x4f9abc[_0x2ca3b3(0x1ee)]}),console[_0x2ca3b3(0x1c7)](_0x2ca3b3(0x227)+_0x2638b0+_0x2ca3b3(0x1e2)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]='engage:campaign:launch';['description']=a16_0x4bae31(0x235);async[a16_0x4bae31(0x1ec)](_0x67a20c){const _0x47c5d0=a16_0x4bae31,{options:_0x2b0566,args:_0x18fd57,tdx:_0x1075cc}=_0x67a20c;if(_0x18fd57[_0x47c5d0(0x1ba)]===0x0)return console[_0x47c5d0(0x1dd)](_0x47c5d0(0x20e)),console[_0x47c5d0(0x1dd)](_0x47c5d0(0x1d1)),0x1;const _0x2b88ba=_0x18fd57[0x0],_0xb48659=_0x2b0566,_0x3561f7=await resolveWorkspaceIdFromOptions(_0xb48659,_0x1075cc);return await withSpinner(_0x47c5d0(0x200)+_0x2b88ba+_0x47c5d0(0x24b),()=>_0x1075cc[_0x47c5d0(0x22b)]['launchCampaign'](_0x2b88ba,_0x3561f7),{'verbose':_0x2b0566[_0x47c5d0(0x1ee)]}),console[_0x47c5d0(0x1c7)](_0x47c5d0(0x227)+_0x2b88ba+_0x47c5d0(0x1dc)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a16_0x4bae31(0x1e5);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x1d4);async['execute'](_0x3d8f1d){const _0x465faf=a16_0x4bae31,{options:_0x53850b,args:_0xcd30f0,tdx:_0x165f21}=_0x3d8f1d;if(_0xcd30f0[_0x465faf(0x1ba)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x465faf(0x1dd)](_0x465faf(0x248)),0x1;const _0x212ae5=_0xcd30f0[0x0],_0x82d74a=_0x53850b,_0x50e9e3=await resolveWorkspaceIdFromOptions(_0x82d74a,_0x165f21);return await withSpinner(_0x465faf(0x1d9)+_0x212ae5+_0x465faf(0x24b),()=>_0x165f21['engage'][_0x465faf(0x1cb)](_0x212ae5,_0x50e9e3),{'verbose':_0x53850b[_0x465faf(0x1ee)]}),console['log'](_0x465faf(0x227)+_0x212ae5+_0x465faf(0x207)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x1e0);[a16_0x4bae31(0x1f6)]='Resume\x20a\x20paused\x20campaign';async[a16_0x4bae31(0x1ec)](_0x3baa43){const _0x3390d7=a16_0x4bae31,{options:_0x173e00,args:_0x5f2b77,tdx:_0x519c5e}=_0x3baa43;if(_0x5f2b77[_0x3390d7(0x1ba)]===0x0)return console[_0x3390d7(0x1dd)](_0x3390d7(0x20e)),console[_0x3390d7(0x1dd)](_0x3390d7(0x231)),0x1;const _0xa667f3=_0x5f2b77[0x0],_0x2ad190=_0x173e00,_0x2eef52=await resolveWorkspaceIdFromOptions(_0x2ad190,_0x519c5e);return await withSpinner('Resuming\x20campaign\x20\x27'+_0xa667f3+_0x3390d7(0x24b),()=>_0x519c5e['engage']['resumeCampaign'](_0xa667f3,_0x2eef52),{'verbose':_0x173e00[_0x3390d7(0x1ee)]}),console[_0x3390d7(0x1c7)](_0x3390d7(0x227)+_0xa667f3+_0x3390d7(0x1c4)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x1f0);['description']=a16_0x4bae31(0x244);async['execute'](_0x1949f2){const _0x1b9370=a16_0x4bae31,{options:_0x48410b,args:_0x4e14fe,tdx:_0x5a0e64}=_0x1949f2;if(_0x4e14fe[_0x1b9370(0x1ba)]===0x0)return console['error'](_0x1b9370(0x20e)),console[_0x1b9370(0x1dd)](_0x1b9370(0x229)),0x1;const _0x2386a1=_0x4e14fe[0x0],_0x1b1278=_0x48410b,_0x19c603=await resolveWorkspaceIdFromOptions(_0x1b1278,_0x5a0e64),_0x57bea7=await withSpinner(_0x1b9370(0x215)+_0x2386a1+_0x1b9370(0x24b),()=>_0x5a0e64[_0x1b9370(0x22b)][_0x1b9370(0x219)](_0x2386a1,_0x19c603),{'verbose':_0x48410b[_0x1b9370(0x1ee)]});return await handleSDKOutput([_0x57bea7[_0x1b9370(0x1cd)]],_0x48410b),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0x4bae31(0x1ce);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x1e3);async[a16_0x4bae31(0x1ec)](_0x2a030a){const _0x18ce15=a16_0x4bae31,{options:_0x549f05,args:_0x4822bb,tdx:_0x1a8e5c}=_0x2a030a,_0x194336=_0x4822bb[0x0],_0x481e83=resolveLimit(_0x549f05[_0x18ce15(0x22a)],DEFAULT_LLM_LIMIT),_0x13dad3=_0x549f05,_0x4da832=await resolveWorkspaceIdFromOptions(_0x13dad3,_0x1a8e5c),_0x1822a7=await withSpinner(_0x18ce15(0x1c9),()=>_0x1a8e5c[_0x18ce15(0x22b)][_0x18ce15(0x1e8)]({'workspaceId':_0x4da832,'limit':_0x481e83}),{'verbose':_0x549f05[_0x18ce15(0x1ee)]});let _0x4f32aa=_0x1822a7[_0x18ce15(0x1cd)];return _0x194336&&(_0x4f32aa=_0x1822a7[_0x18ce15(0x1cd)][_0x18ce15(0x20c)](_0x1aeea2=>matchGlobPattern(_0x1aeea2[_0x18ce15(0x1e4)],_0x194336))),await handleSDKOutput(_0x4f32aa,_0x549f05),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x1ed);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x1ff);async['execute'](_0x399473){const _0x88c042=a16_0x4bae31,{options:_0x906ee0,args:_0x462111,tdx:_0x31d774}=_0x399473;if(_0x462111[_0x88c042(0x1ba)]===0x0)return console[_0x88c042(0x1dd)](_0x88c042(0x1f9)),console[_0x88c042(0x1dd)](_0x88c042(0x1be)),0x1;const _0x5dceb7=_0x462111[0x0],_0x4286a0=_0x906ee0,_0x1aa417=await resolveWorkspaceIdFromOptions(_0x4286a0,_0x31d774),_0x388dc6=_0x4286a0[_0x88c042(0x1e9)];if(_0x388dc6){const _0x53bb12=await withSpinner(_0x88c042(0x1c0)+_0x5dceb7+_0x88c042(0x24b),()=>_0x31d774[_0x88c042(0x22b)][_0x88c042(0x243)](_0x5dceb7,_0x1aa417),{'verbose':_0x906ee0['verbose']});await handleSDKOutput([_0x53bb12],_0x906ee0);}else{const _0x5cf8bf=await withSpinner(_0x88c042(0x1c0)+_0x5dceb7+_0x88c042(0x24b),()=>_0x31d774[_0x88c042(0x22b)][_0x88c042(0x240)](_0x5dceb7,_0x1aa417),{'verbose':_0x906ee0[_0x88c042(0x1ee)]});await handleSDKOutput([_0x5cf8bf],_0x906ee0);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']=a16_0x4bae31(0x245);['description']=a16_0x4bae31(0x1f1);async[a16_0x4bae31(0x1ec)](_0x555629){const _0x3aaada=a16_0x4bae31,{options:_0x33e37b,tdx:_0x3fd3f0}=_0x555629,_0x262d1a=_0x33e37b,_0x5273fe=_0x262d1a[_0x3aaada(0x1e4)],_0x2f052b=_0x262d1a[_0x3aaada(0x214)],_0x2af303=_0x262d1a['html'];if(!_0x5273fe)return console[_0x3aaada(0x1dd)](_0x3aaada(0x1db)),console['error'](_0x3aaada(0x1da)),0x1;if(!_0x2f052b)return console[_0x3aaada(0x1dd)](_0x3aaada(0x218)),0x1;if(!_0x2af303)return console[_0x3aaada(0x1dd)]('Error:\x20--html\x20is\x20required'),0x1;const _0x1d7670=await resolveWorkspaceIdFromOptions(_0x262d1a,_0x3fd3f0,!![]),_0x543851={'name':_0x5273fe,'subjectTemplate':_0x2f052b,'htmlTemplate':_0x2af303,'workspaceId':_0x1d7670,'plaintextTemplate':_0x262d1a[_0x3aaada(0x217)],'editorType':_0x262d1a[_0x3aaada(0x21b)]},_0x1ef72b=await withSpinner(_0x3aaada(0x1e6)+_0x5273fe+_0x3aaada(0x24b),()=>_0x3fd3f0[_0x3aaada(0x22b)]['createTemplate'](_0x543851));return await handleSDKOutput([_0x1ef72b[_0x3aaada(0x1cd)]],_0x33e37b),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x4bae31(0x1c6);['description']=a16_0x4bae31(0x208);async[a16_0x4bae31(0x1ec)](_0xfac0d1){const _0x437f84=a16_0x4bae31,{options:_0x37e870,args:_0x385b62,tdx:_0x5e1cb4}=_0xfac0d1;if(_0x385b62[_0x437f84(0x1ba)]===0x0)return console[_0x437f84(0x1dd)](_0x437f84(0x1f9)),console[_0x437f84(0x1dd)](_0x437f84(0x246)),0x1;const _0x3e47d9=_0x385b62[0x0],_0x3d88a3=_0x37e870,_0x44c044=await resolveWorkspaceIdFromOptions(_0x3d88a3,_0x5e1cb4),_0x1f81db={'name':_0x3d88a3[_0x437f84(0x1e4)],'subjectTemplate':_0x3d88a3['subject'],'htmlTemplate':_0x3d88a3[_0x437f84(0x1c2)],'plaintextTemplate':_0x3d88a3[_0x437f84(0x217)]},_0xefb353=Object[_0x437f84(0x24d)](Object[_0x437f84(0x1f5)](_0x1f81db)[_0x437f84(0x20c)](([,_0xc4b8bb])=>_0xc4b8bb!==undefined));if(Object[_0x437f84(0x23c)](_0xefb353)['length']===0x0)return console[_0x437f84(0x1dd)](_0x437f84(0x238)),console[_0x437f84(0x1dd)](_0x437f84(0x1fb)),0x1;const _0x40cc78=await withSpinner(_0x437f84(0x22d)+_0x3e47d9+_0x437f84(0x24b),()=>_0x5e1cb4[_0x437f84(0x22b)][_0x437f84(0x22c)](_0x3e47d9,_0xefb353,_0x44c044),{'verbose':_0x37e870[_0x437f84(0x1ee)]});return await handleSDKOutput([_0x40cc78[_0x437f84(0x1cd)]],_0x37e870),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']='engage:template:delete';[a16_0x4bae31(0x1f6)]='Delete\x20an\x20email\x20template';async[a16_0x4bae31(0x1ec)](_0x50bc5e){const _0x39ecdd=a16_0x4bae31,{options:_0x3cde21,args:_0x49013a,tdx:_0x1c5806}=_0x50bc5e;if(_0x49013a['length']===0x0)return console[_0x39ecdd(0x1dd)](_0x39ecdd(0x1f9)),console['error']('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x520f7c=_0x49013a[0x0],_0x1e4cac=_0x3cde21,_0xdcdc63=await resolveWorkspaceIdFromOptions(_0x1e4cac,_0x1c5806);if(!_0x3cde21['yes']){const _0x2b0245=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x520f7c+_0x39ecdd(0x1e7));if(!_0x2b0245)return console[_0x39ecdd(0x1c7)](_0x39ecdd(0x1bc)),0x0;}return await withSpinner(_0x39ecdd(0x23f)+_0x520f7c+_0x39ecdd(0x24b),()=>_0x1c5806[_0x39ecdd(0x22b)][_0x39ecdd(0x1ea)](_0x520f7c,_0xdcdc63),{'verbose':_0x3cde21[_0x39ecdd(0x1ee)]}),console[_0x39ecdd(0x1c7)]('Template\x20\x27'+_0x520f7c+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']=a16_0x4bae31(0x22f);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x202);async[a16_0x4bae31(0x1ec)](_0x414199){const _0x245590=a16_0x4bae31,{options:_0x4a1192,args:_0x4564b3,tdx:_0x38c378}=_0x414199,_0x31154f=_0x4564b3[0x0],_0x5a4f7f=resolveLimit(_0x4a1192[_0x245590(0x22a)],DEFAULT_LLM_LIMIT),_0x1c3f55=await withSpinner(_0x245590(0x21c),()=>_0x38c378[_0x245590(0x22b)][_0x245590(0x24a)]({'limit':_0x5a4f7f}),{'verbose':_0x4a1192[_0x245590(0x1ee)]});let _0x3dba2d=_0x1c3f55[_0x245590(0x1cd)];return _0x31154f&&(_0x3dba2d=_0x1c3f55[_0x245590(0x1cd)][_0x245590(0x20c)](_0x3893f4=>matchGlobPattern(_0x3893f4[_0x245590(0x1e4)],_0x31154f))),await handleSDKOutput(_0x3dba2d,_0x4a1192),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x211);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x212);async['execute'](_0x3f3eda){const _0x1fe2f3=a16_0x4bae31,{options:_0x121da4,args:_0x34a159,tdx:_0x385479}=_0x3f3eda;if(_0x34a159['length']===0x0)return console[_0x1fe2f3(0x1dd)](_0x1fe2f3(0x225)),console[_0x1fe2f3(0x1dd)](_0x1fe2f3(0x241)),0x1;const _0x5519c1=_0x34a159[0x0],_0x59f59e=_0x121da4,_0x44726f=_0x59f59e[_0x1fe2f3(0x1e9)];if(_0x44726f){const _0xef3b48=await withSpinner(_0x1fe2f3(0x216)+_0x5519c1+_0x1fe2f3(0x24b),()=>_0x385479['engage']['getWorkspaceFull'](_0x5519c1),{'verbose':_0x121da4[_0x1fe2f3(0x1ee)]});await handleSDKOutput([_0xef3b48],_0x121da4);}else{const _0x54b150=await withSpinner(_0x1fe2f3(0x216)+_0x5519c1+'\x27...',()=>_0x385479[_0x1fe2f3(0x22b)][_0x1fe2f3(0x24c)](_0x5519c1),{'verbose':_0x121da4[_0x1fe2f3(0x1ee)]});await handleSDKOutput([_0x54b150],_0x121da4);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x1f4);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x1d8);async['execute'](_0x4cb867){const _0x4aa6bf=a16_0x4bae31,{options:_0x5e7c6b,tdx:_0x118859}=_0x4cb867,_0x859d33=_0x5e7c6b,_0xc8a408=_0x859d33[_0x4aa6bf(0x1e4)];if(!_0xc8a408)return console[_0x4aa6bf(0x1dd)](_0x4aa6bf(0x1db)),console[_0x4aa6bf(0x1dd)](_0x4aa6bf(0x1fa)),0x1;const _0x2710dc={'name':_0xc8a408,'description':_0x859d33[_0x4aa6bf(0x1f6)]},_0x3d2cc3=await withSpinner(_0x4aa6bf(0x23d)+_0xc8a408+_0x4aa6bf(0x24b),()=>_0x118859[_0x4aa6bf(0x22b)][_0x4aa6bf(0x239)](_0x2710dc));return await handleSDKOutput([_0x3d2cc3[_0x4aa6bf(0x1cd)]],_0x5e7c6b),0x0;}}function a16_0x2123(_0x5c27ab,_0x59f2ea){_0x5c27ab=_0x5c27ab-0x1b8;const _0x23de3f=a16_0x23de();let _0x2123dc=_0x23de3f[_0x5c27ab];return _0x2123dc;}function a16_0x23de(){const _0x3464be=['176382RXWvBG','Error:\x20Workspace\x20name\x20is\x20required','Fetching\x20campaigns...','Set\x20workspace\x20context\x20for\x20Engage\x20commands','7315821YOmsAZ','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Campaign\x20\x27','Workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','limit','engage','updateTemplate','Updating\x20template\x20\x27','581181Tslrbn','engage:workspaces','14DseoCe','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Delete\x20a\x20workspace','engage:workspace:delete','Launch\x20a\x20campaign','yes','engage:campaign:create','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','createWorkspace','engage:campaign:update','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','keys','Creating\x20workspace\x20\x27','Updating\x20workspace\x20\x27','Deleting\x20template\x20\x27','getTemplate','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','segmentId','getTemplateFull','Duplicate\x20a\x20campaign','engage:template:create','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','36sorFPQ','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','jsonColumns','listWorkspaces','\x27...','getWorkspace','fromEntries','Engage\x20workspace\x20set\x20to:\x20','Create\x20a\x20new\x20campaign','length','16WgNlkw','Operation\x20cancelled','Workspace\x20is\x20required\x20for\x20this\x20operation','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','updateCampaign','Fetching\x20template\x20\x27','12zETNPO','html','Updating\x20campaign\x20\x27','\x27\x20resumed\x20successfully','Deleting\x20workspace\x20\x27','engage:template:update','log','Creating\x20campaign\x20\x27','Fetching\x20templates...','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','pauseCampaign','getCampaign','data','engage:templates','listCampaigns','Delete\x20a\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','type','Options:\x20--name,\x20--description','Pause\x20a\x20campaign','segment','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','105SHsjGF','Create\x20a\x20workspace','Pausing\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Error:\x20--name\x20is\x20required','\x27\x20launched\x20successfully','error','137653sFnSJX','engage:workspace:update','engage:campaign:resume','startAt','\x27\x20deleted\x20successfully','List\x20email\x20templates','name','engage:campaign:pause','Creating\x20template\x20\x27','\x27?\x20This\x20cannot\x20be\x20undone.','listTemplates','full','deleteTemplate','timezone','execute','engage:template:show','verbose','2115872UbsbnF','engage:campaign:duplicate','Create\x20an\x20email\x20template','1945702ocKOKI','parentId','engage:workspace:create','entries','description','Deleting\x20campaign\x20\x27','resolveWorkspaceId','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','parentName','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Update\x20a\x20campaign','Show\x20email\x20template\x20details','Launching\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','List\x20workspaces','MISSING_ARGUMENT','session','Verifying\x20workspace\x20\x27','getCampaignFull','\x27\x20paused\x20successfully','Update\x20an\x20email\x20template','engage:workspace:use','9385987kfoUvu','engage:campaign:delete','filter','10CMNtVF','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','segmentName','engage:workspace:show','Show\x20workspace\x20details','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','subject','Duplicating\x20campaign\x20\x27','Fetching\x20workspace\x20\x27','plaintext','Error:\x20--subject\x20is\x20required','duplicateCampaign','status','editorType','Fetching\x20workspaces...','engage_workspace','workspace','Show\x20campaign\x20details'];a16_0x23de=function(){return _0x3464be;};return a16_0x23de();}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x1df);[a16_0x4bae31(0x1f6)]='Update\x20a\x20workspace';async[a16_0x4bae31(0x1ec)](_0x2766d0){const _0x289299=a16_0x4bae31,{options:_0x4cd708,args:_0x4d08bd,tdx:_0x11a020}=_0x2766d0;if(_0x4d08bd[_0x289299(0x1ba)]===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x289299(0x1dd)](_0x289299(0x226)),0x1;const _0x53c0b3=_0x4d08bd[0x0],_0x2e9665=_0x4cd708,_0x3b1af1={'name':_0x2e9665['name'],'description':_0x2e9665[_0x289299(0x1f6)]},_0x1278c2=Object[_0x289299(0x24d)](Object[_0x289299(0x1f5)](_0x3b1af1)[_0x289299(0x20c)](([,_0x166eca])=>_0x166eca!==undefined));if(Object[_0x289299(0x23c)](_0x1278c2)[_0x289299(0x1ba)]===0x0)return console['error'](_0x289299(0x238)),console[_0x289299(0x1dd)](_0x289299(0x1d3)),0x1;const _0x3fecac=await withSpinner(_0x289299(0x23e)+_0x53c0b3+'\x27...',()=>_0x11a020[_0x289299(0x22b)]['updateWorkspace'](_0x53c0b3,_0x1278c2),{'verbose':_0x4cd708['verbose']});return await handleSDKOutput([_0x3fecac[_0x289299(0x1cd)]],_0x4cd708),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x4bae31(0x1e4)]=a16_0x4bae31(0x234);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x233);async[a16_0x4bae31(0x1ec)](_0x37b4b3){const _0x5c5960=a16_0x4bae31,{options:_0x4da83f,args:_0x5ba65e,tdx:_0x4f50e0}=_0x37b4b3;if(_0x5ba65e['length']===0x0)return console[_0x5c5960(0x1dd)](_0x5c5960(0x225)),console[_0x5c5960(0x1dd)](_0x5c5960(0x1ca)),0x1;const _0x38da09=_0x5ba65e[0x0];if(!_0x4da83f[_0x5c5960(0x236)]){const _0x4af5c1=await confirm(_0x5c5960(0x232)+_0x38da09+_0x5c5960(0x1e7));if(!_0x4af5c1)return console[_0x5c5960(0x1c7)](_0x5c5960(0x1bc)),0x0;}return await withSpinner(_0x5c5960(0x1c5)+_0x38da09+'\x27...',()=>_0x4f50e0[_0x5c5960(0x22b)]['deleteWorkspace'](_0x38da09),{'verbose':_0x4da83f[_0x5c5960(0x1ee)]}),console[_0x5c5960(0x1c7)](_0x5c5960(0x228)+_0x38da09+_0x5c5960(0x1e2)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x4bae31(0x209);[a16_0x4bae31(0x1f6)]=a16_0x4bae31(0x223);async[a16_0x4bae31(0x1ec)](_0x103984){const _0xb04e6e=a16_0x4bae31,{options:_0x38ad5c,args:_0x131ecd,tdx:_0x1d33f4}=_0x103984;if(_0x131ecd[_0xb04e6e(0x1ba)]===0x0)return console[_0xb04e6e(0x1dd)](_0xb04e6e(0x221)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x3a6fa5=_0x131ecd[0x0];await withSpinner(_0xb04e6e(0x205)+_0x3a6fa5+_0xb04e6e(0x24b),()=>_0x1d33f4[_0xb04e6e(0x22b)][_0xb04e6e(0x1f8)](_0x3a6fa5));const _0x40a96d=_0x38ad5c[_0xb04e6e(0x204)]||undefined;return saveSessionContext({'engage_workspace':_0x3a6fa5},_0x40a96d),console[_0xb04e6e(0x1c7)](_0xb04e6e(0x1b8)+_0x3a6fa5),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|