@treasuredata/tdx 0.26.1 → 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_0x20c67e=a9_0x39c0;(function(_0x1b946f,_0xc5bd21){const _0x35800f=a9_0x39c0,_0x13270e=_0x1b946f();while(!![]){try{const _0x458596=-parseInt(_0x35800f(0x181))/0x1*(-parseInt(_0x35800f(0x124))/0x2)+-parseInt(_0x35800f(0x18a))/0x3+parseInt(_0x35800f(0x184))/0x4*(-parseInt(_0x35800f(0x13d))/0x5)+-parseInt(_0x35800f(0xff))/0x6*(-parseInt(_0x35800f(0x178))/0x7)+parseInt(_0x35800f(0x168))/0x8*(parseInt(_0x35800f(0x132))/0x9)+-parseInt(_0x35800f(0x16e))/0xa*(-parseInt(_0x35800f(0x164))/0xb)+parseInt(_0x35800f(0x159))/0xc;if(_0x458596===_0xc5bd21)break;else _0x13270e['push'](_0x13270e['shift']());}catch(_0x59cee1){_0x13270e['push'](_0x13270e['shift']());}}}(a9_0x15f6,0xc90a6));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x54a3dc 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_0x20c67e(0x179);function handleInstallationError(_0x569736,_0x5303ef,_0x2ec31d,_0x4b7181){const _0x1f400d=a9_0x20c67e;errorContains(_0x569736,_0x1f400d(0x154),_0x1f400d(0x144),_0x1f400d(0x17e))?(_0x2ec31d[_0x1f400d(0xfd)]='✓\x20'+_0x5303ef+_0x1f400d(0x122),_0x4b7181?.[_0x1f400d(0x146)](_0x5303ef+'\x20already\x20configured'),_0x569736 instanceof SDKError&&_0x569736[_0x1f400d(0x163)]&&_0x4b7181?.['debug'](_0x1f400d(0x14f)+_0x569736[_0x1f400d(0x163)][_0x1f400d(0x153)])):(_0x2ec31d[_0x1f400d(0x155)](_0x1f400d(0x141)+_0x5303ef),_0x4b7181?.[_0x1f400d(0x133)](_0x5303ef+_0x1f400d(0x192),_0x569736));}function a9_0x39c0(_0x5c87e3,_0xe0f76c){_0x5c87e3=_0x5c87e3-0xfd;const _0x15f6bb=a9_0x15f6();let _0x39c000=_0x15f6bb[_0x5c87e3];return _0x39c000;}export function parseVersion(_0x3f4819){const _0x3cf0c1=a9_0x20c67e,_0x6c019b=_0x3f4819[_0x3cf0c1(0x15c)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x6c019b)return null;return{'major':parseInt(_0x6c019b[0x1],0xa),'minor':parseInt(_0x6c019b[0x2],0xa),'patch':parseInt(_0x6c019b[0x3],0xa)};}export function compareVersions(_0x53580b,_0x32d682){const _0x33ee59=a9_0x20c67e;if(_0x53580b[_0x33ee59(0x109)]!==_0x32d682[_0x33ee59(0x109)])return _0x53580b[_0x33ee59(0x109)]-_0x32d682[_0x33ee59(0x109)];if(_0x53580b[_0x33ee59(0x158)]!==_0x32d682[_0x33ee59(0x158)])return _0x53580b[_0x33ee59(0x158)]-_0x32d682[_0x33ee59(0x158)];return _0x53580b[_0x33ee59(0x190)]-_0x32d682['patch'];}async function checkClaudeVersion(_0x26f2fb,_0x5a20b5){const _0x5cfece=a9_0x20c67e;_0x5a20b5?.[_0x5cfece(0x191)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x26f2fb+')');const _0x2181ac=await executeClaudeCommand(['--version'],undefined,_0x5a20b5),_0x31832f=parseVersion(_0x2181ac);if(!_0x31832f){_0x5a20b5?.[_0x5cfece(0x155)](_0x5cfece(0x14a)+_0x2181ac);return;}const _0x5efda3=_0x31832f[_0x5cfece(0x109)]+'.'+_0x31832f[_0x5cfece(0x158)]+'.'+_0x31832f[_0x5cfece(0x190)],_0x5135eb=parseVersion(_0x26f2fb);if(!_0x5135eb){_0x5a20b5?.[_0x5cfece(0x155)](_0x5cfece(0x10f)+_0x26f2fb);return;}if(compareVersions(_0x31832f,_0x5135eb)<0x0){_0x5a20b5?.['error'](_0x5cfece(0x10c)+_0x5efda3+_0x5cfece(0x166)+_0x26f2fb+')');throw new SDKError(ErrorCode[_0x5cfece(0x16c)],'Claude\x20Code\x20version\x20'+_0x5efda3+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x26f2fb+_0x5cfece(0x18d),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x5a20b5?.[_0x5cfece(0x191)]('Claude\x20Code\x20version\x20'+_0x5efda3+_0x5cfece(0x134));}async function executeClaudeCommand(_0x5efa39,_0x6d8319,_0x15a84b){const _0x248c7c=a9_0x20c67e;return _0x15a84b?.['info'](_0x248c7c(0x12c)+_0x5efa39['join']('\x20')),new Promise((_0x1d7be7,_0x469d1c)=>{const _0x4d4340=_0x248c7c,_0x29ae7c=crossSpawn(_0x4d4340(0x149),_0x5efa39,{'stdio':_0x4d4340(0x126)});let _0x3cb057='',_0x2a1e4a='';_0x29ae7c[_0x4d4340(0x177)]?.['on']('data',_0x403848=>{const _0x335ca4=_0x4d4340;_0x3cb057+=_0x403848[_0x335ca4(0x119)]();}),_0x29ae7c[_0x4d4340(0x142)]?.['on']('data',_0x924d05=>{_0x2a1e4a+=_0x924d05['toString']();}),_0x29ae7c['on'](_0x4d4340(0x133),_0x1b84c9=>{const _0x586975=_0x4d4340;_0x1b84c9['code']==='ENOENT'?(_0x15a84b?.[_0x586975(0x133)](_0x586975(0x17b)),_0x469d1c(new SDKError(ErrorCode[_0x586975(0x120)],_0x586975(0x17b),_0x1b84c9,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x15a84b?.['error'](_0x586975(0x11e)+_0x1b84c9[_0x586975(0x153)]),_0x469d1c(new SDKError(ErrorCode[_0x586975(0x100)],_0x586975(0x14d)+_0x1b84c9['message'],_0x1b84c9)));}),_0x29ae7c['on'](_0x4d4340(0x183),_0x278d99=>{const _0x46aebe=_0x4d4340;if(_0x278d99===0x0)_0x1d7be7(_0x3cb057);else _0x6d8319?(_0x15a84b?.[_0x46aebe(0x133)](_0x46aebe(0x12d)+_0x278d99+'):\x20claude\x20'+_0x5efa39[_0x46aebe(0x180)]('\x20')),_0x469d1c(new SDKError(ErrorCode[_0x46aebe(0x15f)],_0x6d8319,new Error(_0x2a1e4a)))):_0x1d7be7('');});});}async function ensureMcpServer(_0x4d22d6,_0x4d462f,_0x275395,_0x2daf4a,_0x4d940b){const _0x3c7004=a9_0x20c67e;_0x2daf4a[_0x3c7004(0xfd)]=_0x3c7004(0x103)+_0x4d22d6+'\x27...',await executeClaudeCommand([_0x3c7004(0x165),_0x3c7004(0x12a),_0x4d22d6,_0x4d462f,_0x3c7004(0x125),_0x275395],_0x3c7004(0x18c)+_0x4d22d6+'\x27',_0x4d940b),_0x2daf4a[_0x3c7004(0xfd)]=_0x3c7004(0x107)+_0x4d22d6+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL=a9_0x20c67e(0x102);export function getTdSkillsRepoUrl(){const _0x535560=process.env.TDX_TD_SKILLS_REPO;if(_0x535560)return _0x535560;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0xdedab2,_0x136067){const _0x51153e=a9_0x20c67e;try{const _0x439f92=await executeClaudeCommand([_0x51153e(0x105),_0x51153e(0x15d),_0x51153e(0x174)],'Failed\x20to\x20list\x20marketplaces',_0x136067);if(!_0x439f92[_0x51153e(0x18b)](_0xdedab2)){_0x136067?.['debug'](_0x51153e(0x10d)+_0xdedab2+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand(['plugin',_0x51153e(0x15d),'remove',_0xdedab2],_0x51153e(0x108)+_0xdedab2+'\x27',_0x136067),_0x136067?.['info']('Marketplace\x20\x27'+_0xdedab2+_0x51153e(0x11f));}catch(_0x3dbc78){_0x136067?.[_0x51153e(0x155)](_0x51153e(0x108)+_0xdedab2+_0x51153e(0xfe)+_0x3dbc78);}}async function restoreDefaultTdSkillsMarketplace(_0x1907b6){const _0x4eae1d=a9_0x20c67e;try{await removeMarketplace(_0x4eae1d(0x113),_0x1907b6),await executeClaudeCommand([_0x4eae1d(0x105),_0x4eae1d(0x15d),_0x4eae1d(0x12a),DEFAULT_TD_SKILLS_URL],undefined,_0x1907b6),_0x1907b6?.['info'](_0x4eae1d(0x136));}catch{}}async function ensureMarketplace(_0x530bfe,_0x209ad5,_0x37ba48,_0x518484){const _0x3abdbf=a9_0x20c67e;_0x37ba48['text']=_0x3abdbf(0x114)+_0x530bfe+_0x3abdbf(0x112),await executeClaudeCommand(['plugin',_0x3abdbf(0x15d),'add',_0x209ad5],_0x3abdbf(0x162)+_0x530bfe+'\x27',_0x518484),_0x37ba48['text']='✓\x20Marketplace\x20\x27'+_0x530bfe+_0x3abdbf(0x117);}async function updateMarketplace(_0x559e36,_0x248fd4,_0x2b8a9d){const _0x35a438=a9_0x20c67e;_0x248fd4[_0x35a438(0xfd)]='Updating\x20marketplace\x20\x27'+_0x559e36+_0x35a438(0x112),await executeClaudeCommand(['plugin',_0x35a438(0x15d),_0x35a438(0x13b)],_0x35a438(0x111)+_0x559e36+'\x27',_0x2b8a9d),_0x248fd4[_0x35a438(0xfd)]='✓\x20Marketplace\x20\x27'+_0x559e36+_0x35a438(0x185);}async function ensurePlugin(_0x3335ec,_0x5009a2,_0x45f9a1,_0x590467){const _0x19428a=a9_0x20c67e;_0x45f9a1['text']=_0x19428a(0x128)+_0x3335ec+_0x19428a(0x112),await executeClaudeCommand([_0x19428a(0x105),'install',_0x3335ec+'@'+_0x5009a2],_0x19428a(0x110)+_0x3335ec+'\x27',_0x590467),_0x45f9a1[_0x19428a(0xfd)]=_0x19428a(0x170)+_0x3335ec+_0x19428a(0x115);}function a9_0x15f6(){const _0x33cce7=['Failed\x20to\x20update\x20marketplace\x20\x27','\x27...','td-skills','Configuring\x20marketplace\x20\x27','\x27\x20installed','resume','\x27\x20configured','getCurrent','toString','description','command','TD\x20Docs\x20MCP\x20Server','tdx-managed-proxy','Command\x20spawn\x20error:\x20','\x27\x20removed','CLAUDE_CODE_NOT_FOUND','sql-skills','\x20already\x20configured','parse','14LgYMFW','--transport','pipe','INVALID_ARGUMENT','Installing\x20plugin\x20\x27','cwd','add','originalSettings','Executing:\x20claude\x20','Command\x20failed\x20(exit\x20','127.0.0.1','logger','logLevel','inherit','144819RHBNwT','error','\x20meets\x20minimum\x20requirement','http://127.0.0.1:','Restored\x20default\x20td-skills\x20marketplace','type','green','account_id','log','update','port','45SkwBlS','name','✓\x20Logging\x20to\x20','tdx\x20--profile\x20','Warning:\x20Failed\x20to\x20configure\x20','stderr','https://docs.treasuredata.com/mcp','already\x20installed','.claude','info','red','http','claude','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','ANTHROPIC_MODEL','ANTHROPIC_AUTH_TOKEN','Failed\x20to\x20spawn\x20claude\x20command:\x20','getLogPath','Command\x20output:\x20','close','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','CLAUDE_CODE_USE_VERTEX','message','already\x20exists','warn','tdx','Creating\x20.claude/settings.local.json...','minor','8387496gHpYHE','statusLine','profile','trim','marketplace','✓\x20Settings\x20restored:\x20.claude/settings.local.json','INSTALLATION_FAILED','false','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','Failed\x20to\x20configure\x20marketplace\x20\x27','cause','11ZarpgI','mcp','\x20is\x20too\x20old\x20(minimum:\x20','env','144kmfTBg','ANTHROPIC_BASE_URL','utf-8','tdx-skills','CLAUDE_CODE_UNSUPPORTED_VERSION','start','6519140loELDr','proxy','✓\x20Plugin\x20\x27','unshift','llm-proxy','execute','list','settings.local.json','Claude\x20Code\x20version\x20check\x20failed','stdout','948304gYODzc','2.0.20','workflow-skills','Claude\x20Code\x20CLI\x20not\x20found','Checking\x20Claude\x20Code\x20version...','site','already\x20configured','Finding\x20available\x20port...','join','93257AmEKZZ','td-docs','exit','400336vkkmbq','\x27\x20updated','passThroughServer','hostname','stringify','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','3332937hYTPzJ','includes','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','\x20or\x20later.','✓\x20Found\x20available\x20port:\x20','Setup\x20failed','patch','debug','\x20configuration\x20failed','CLAUDE_CODE_USE_BEDROCK','fail','text','\x27:\x20','24wIAsWC','INTERNAL','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','https://github.com/treasure-data/td-skills','Configuring\x20MCP\x20server\x20\x27','✓\x20Settings\x20configured:\x20.claude/settings.local.json','plugin','tdx\x20claude\x20statusline','✓\x20MCP\x20server\x20\x27','Failed\x20to\x20remove\x20marketplace\x20\x27','major','✓\x20Logs\x20saved\x20to\x20','string','Claude\x20Code\x20version\x20','Marketplace\x20\x27','stop','Invalid\x20minimum\x20version\x20format:\x20','Failed\x20to\x20install\x20plugin\x20\x27'];a9_0x15f6=function(){return _0x33cce7;};return a9_0x15f6();}async function createClaudeSettings(_0x5930b6,_0x421a2c,_0x43d739){const _0x46fd12=a9_0x20c67e,_0x4271ca=join(process[_0x46fd12(0x129)](),'.claude'),_0x564c9b=join(_0x4271ca,_0x46fd12(0x175));await mkdir(_0x4271ca,{'recursive':!![]});let _0x56f278={};if(existsSync(_0x564c9b))try{const _0x3ad198=await readFile(_0x564c9b,_0x46fd12(0x16a));_0x56f278=JSON[_0x46fd12(0x123)](_0x3ad198);}catch{_0x56f278={};}const _0x1063fa=_0x56f278['env']||{},_0x3098d3={'ANTHROPIC_BASE_URL':_0x1063fa['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x1063fa[_0x46fd12(0x14b)],'ANTHROPIC_AUTH_TOKEN':_0x1063fa[_0x46fd12(0x14c)],'CLAUDE_CODE_USE_BEDROCK':_0x1063fa[_0x46fd12(0x193)],'CLAUDE_CODE_USE_VERTEX':_0x1063fa[_0x46fd12(0x152)],'statusLine':_0x56f278['statusLine']},_0x39d6cb={..._0x56f278,'env':{..._0x1063fa,'ANTHROPIC_BASE_URL':_0x46fd12(0x135)+_0x5930b6,..._0x421a2c&&{'ANTHROPIC_MODEL':_0x421a2c},'ANTHROPIC_AUTH_TOKEN':_0x46fd12(0x11d),'CLAUDE_CODE_USE_BEDROCK':_0x46fd12(0x160),'CLAUDE_CODE_USE_VERTEX':_0x46fd12(0x160)},'statusLine':{'type':_0x46fd12(0x11b),'command':_0x43d739?_0x46fd12(0x140)+_0x43d739+'\x20claude\x20statusline':_0x46fd12(0x106)}};return await writeFile(_0x564c9b,JSON[_0x46fd12(0x188)](_0x39d6cb,null,0x2)+'\x0a'),_0x3098d3;}async function restoreClaudeSettings(_0x23b3e4){const _0x1f0c8d=a9_0x20c67e,_0x1c2f0e=join(process[_0x1f0c8d(0x129)](),_0x1f0c8d(0x145)),_0x16de86=join(_0x1c2f0e,_0x1f0c8d(0x175));if(!existsSync(_0x16de86))return;try{const _0x10785d=await readFile(_0x16de86,_0x1f0c8d(0x16a)),_0x12ccd6=JSON['parse'](_0x10785d),_0x2070cd=_0x12ccd6['env']||{},_0x4a856a=_0x2070cd[_0x1f0c8d(0x169)],_0xd20561=((()=>{const _0x321380=_0x1f0c8d;if(typeof _0x4a856a!==_0x321380(0x10b))return![];try{const _0x259f76=new URL(_0x4a856a);return _0x259f76[_0x321380(0x187)]==='localhost'||_0x259f76['hostname']===_0x321380(0x12e);}catch{return![];}})());_0xd20561?(delete _0x2070cd[_0x1f0c8d(0x169)],delete _0x2070cd['ANTHROPIC_MODEL'],delete _0x2070cd['ANTHROPIC_AUTH_TOKEN'],delete _0x2070cd[_0x1f0c8d(0x193)],delete _0x2070cd[_0x1f0c8d(0x152)]):(_0x23b3e4['ANTHROPIC_BASE_URL']!==undefined?_0x2070cd[_0x1f0c8d(0x169)]=_0x23b3e4[_0x1f0c8d(0x169)]:delete _0x2070cd['ANTHROPIC_BASE_URL'],_0x23b3e4[_0x1f0c8d(0x14b)]!==undefined?_0x2070cd[_0x1f0c8d(0x14b)]=_0x23b3e4[_0x1f0c8d(0x14b)]:delete _0x2070cd['ANTHROPIC_MODEL'],_0x23b3e4[_0x1f0c8d(0x14c)]!==undefined?_0x2070cd[_0x1f0c8d(0x14c)]=_0x23b3e4['ANTHROPIC_AUTH_TOKEN']:delete _0x2070cd[_0x1f0c8d(0x14c)],_0x23b3e4[_0x1f0c8d(0x193)]!==undefined?_0x2070cd[_0x1f0c8d(0x193)]=_0x23b3e4[_0x1f0c8d(0x193)]:delete _0x2070cd[_0x1f0c8d(0x193)],_0x23b3e4['CLAUDE_CODE_USE_VERTEX']!==undefined?_0x2070cd[_0x1f0c8d(0x152)]=_0x23b3e4[_0x1f0c8d(0x152)]:delete _0x2070cd['CLAUDE_CODE_USE_VERTEX']);const _0x4200ee=_0x12ccd6[_0x1f0c8d(0x15a)],_0x226dcf=((()=>{const _0x449928=_0x1f0c8d;if(!_0x4200ee||typeof _0x4200ee!=='object')return![];if(_0x4200ee[_0x449928(0x137)]!==_0x449928(0x11b))return![];if(typeof _0x4200ee[_0x449928(0x11b)]!==_0x449928(0x10b))return![];return _0x4200ee[_0x449928(0x11b)][_0x449928(0x18b)](_0x449928(0x156))&&_0x4200ee['command'][_0x449928(0x18b)]('statusline');})());if(_0x226dcf)delete _0x12ccd6['statusLine'];else _0x23b3e4[_0x1f0c8d(0x15a)]!==undefined?_0x12ccd6['statusLine']=_0x23b3e4[_0x1f0c8d(0x15a)]:delete _0x12ccd6[_0x1f0c8d(0x15a)];_0x12ccd6[_0x1f0c8d(0x167)]=_0x2070cd,await writeFile(_0x16de86,JSON[_0x1f0c8d(0x188)](_0x12ccd6,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x20c67e(0x13e)]=a9_0x20c67e(0x149);[a9_0x20c67e(0x11a)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';[a9_0x20c67e(0x186)];[a9_0x20c67e(0x12b)];[a9_0x20c67e(0x12f)];[a9_0x20c67e(0x13c)];async[a9_0x20c67e(0x173)](_0x102330){const _0x49d33f=a9_0x20c67e,{tdx:_0x40ba02,options:_0x1fb83b,args:_0x4de870}=_0x102330;let _0x2d8157=![];try{const _0x48e725=_0x1fb83b,_0x1e5d80=_0x48e725[_0x49d33f(0x16f)]===![],_0x174eac=_0x48e725['continue']===!![],_0x581742=_0x48e725[_0x49d33f(0x116)]===!![],_0x390098=[..._0x4de870];if(_0x174eac)_0x390098[_0x49d33f(0x171)]('-c');else _0x581742&&_0x390098[_0x49d33f(0x171)]('-r');const _0x89bd7d=createCommandSpinner('Initializing...',{'verbose':_0x1fb83b['verbose']});_0x89bd7d['start']();try{if(!_0x1e5d80){_0x89bd7d['text']=_0x49d33f(0x17f),this[_0x49d33f(0x13c)]=await findAvailablePort(0xfa0),_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x18e)+this[_0x49d33f(0x13c)];const _0x3d440d=_0x1fb83b[_0x49d33f(0x15b)];try{const _0x2dc3d1=await _0x40ba02['user'][_0x49d33f(0x118)]();_0x2dc3d1[_0x49d33f(0x139)]&&writeCachedAccountInfo(_0x1fb83b['site'],_0x2dc3d1['account_id'],_0x3d440d);}catch{}_0x89bd7d[_0x49d33f(0xfd)]='Initializing\x20proxy\x20logger...',this[_0x49d33f(0x12f)]=new TDXLogger(_0x1fb83b[_0x49d33f(0x130)],!![]),await this['logger']['init']();const _0x491388=this[_0x49d33f(0x12f)][_0x49d33f(0x14e)]();_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x13f)+_0x491388;const _0x40c3b5=getEndpoint(_0x1fb83b[_0x49d33f(0x17d)],_0x49d33f(0x172));_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x161);if(!_0x40ba02['context']['apiKey'])throw new SDKError(ErrorCode[_0x49d33f(0x127)],_0x49d33f(0x151));this[_0x49d33f(0x186)]=new PassThroughProxyServer({'port':this['port'],'llmProxyUrl':_0x40c3b5,'apiKey':_0x40ba02['context']['apiKey'],'logger':this[_0x49d33f(0x12f)],'site':_0x1fb83b[_0x49d33f(0x17d)],'profile':_0x3d440d}),await this[_0x49d33f(0x186)][_0x49d33f(0x16d)](),_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x101)+this['port']+'\x20→\x20'+_0x40c3b5,_0x89bd7d['text']=_0x49d33f(0x157),this[_0x49d33f(0x12b)]=await createClaudeSettings(this[_0x49d33f(0x13c)],undefined,_0x3d440d),_0x89bd7d['text']=_0x49d33f(0x104);}else _0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x189);try{_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x17c),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x49d33f(0x12f)]),_0x89bd7d[_0x49d33f(0xfd)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x32e726){_0x89bd7d[_0x49d33f(0x194)](_0x49d33f(0x176));throw _0x32e726;}try{await ensureMcpServer(_0x49d33f(0x182),_0x49d33f(0x143),_0x49d33f(0x148),_0x89bd7d,this[_0x49d33f(0x12f)]);}catch(_0x264554){handleInstallationError(_0x264554,_0x49d33f(0x11c),_0x89bd7d,this[_0x49d33f(0x12f)]);}try{const _0x81abc5=getTdSkillsRepoUrl();_0x2d8157=_0x81abc5!==DEFAULT_TD_SKILLS_URL,_0x2d8157&&await removeMarketplace(_0x49d33f(0x113),this[_0x49d33f(0x12f)]),await ensureMarketplace('td-skills',_0x81abc5,_0x89bd7d,this[_0x49d33f(0x12f)]),await updateMarketplace('td-skills',_0x89bd7d,this[_0x49d33f(0x12f)]),await ensurePlugin(_0x49d33f(0x121),_0x49d33f(0x113),_0x89bd7d,this['logger']),await ensurePlugin(_0x49d33f(0x17a),_0x49d33f(0x113),_0x89bd7d,this[_0x49d33f(0x12f)]),await ensurePlugin(_0x49d33f(0x16b),_0x49d33f(0x113),_0x89bd7d,this['logger']);}catch(_0x3cc067){handleInstallationError(_0x3cc067,'td-skills\x20Plugins',_0x89bd7d,this[_0x49d33f(0x12f)]);}_0x89bd7d[_0x49d33f(0x10e)]();}catch(_0x8ec9f2){_0x89bd7d[_0x49d33f(0x194)](_0x49d33f(0x18f));throw _0x8ec9f2;}const _0x32b372=await findExecutable(_0x49d33f(0x149));if(!_0x32b372)throw new SDKError(ErrorCode[_0x49d33f(0x120)],_0x49d33f(0x17b),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x653f97={...process.env};!_0x1e5d80&&(_0x653f97[_0x49d33f(0x169)]=_0x49d33f(0x135)+this[_0x49d33f(0x13c)],_0x653f97[_0x49d33f(0x14c)]='tdx-managed-proxy',_0x653f97[_0x49d33f(0x193)]=_0x49d33f(0x160),_0x653f97[_0x49d33f(0x152)]=_0x49d33f(0x160));const _0x12f4b2=crossSpawn(_0x32b372,_0x390098,{'stdio':_0x49d33f(0x131),'env':_0x653f97}),_0xf16bef=await new Promise(_0x508b6c=>{const _0x4ee63b=_0x49d33f;_0x12f4b2['on'](_0x4ee63b(0x183),_0x470ba4=>{_0x508b6c(_0x470ba4||0x0);}),_0x12f4b2['on'](_0x4ee63b(0x133),_0x2a177d=>{const _0x14b456=_0x4ee63b;console[_0x14b456(0x133)](a9_0x54a3dc[_0x14b456(0x147)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x2a177d[_0x14b456(0x153)])),_0x508b6c(0x1);});});_0x2d8157&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0x49d33f(0x186)][_0x49d33f(0x10e)](),console[_0x49d33f(0x13a)](a9_0x54a3dc[_0x49d33f(0x138)]('✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped')));if(this[_0x49d33f(0x12f)]){await this[_0x49d33f(0x12f)][_0x49d33f(0x150)]();const _0x681342=this[_0x49d33f(0x12f)][_0x49d33f(0x14e)]();console[_0x49d33f(0x13a)](a9_0x54a3dc[_0x49d33f(0x138)](_0x49d33f(0x10a)+_0x681342));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x49d33f(0x12b)]),console[_0x49d33f(0x13a)](a9_0x54a3dc[_0x49d33f(0x138)](_0x49d33f(0x15e)))),_0xf16bef;}catch(_0x5ca058){_0x2d8157&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&await this[_0x49d33f(0x186)][_0x49d33f(0x10e)]();this[_0x49d33f(0x12f)]&&await this['logger']['close']();this[_0x49d33f(0x12b)]&&await restoreClaudeSettings(this[_0x49d33f(0x12b)]);throw _0x5ca058;}}}
|
|
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_0x327349=a13_0x133a;(function(_0x395ae0,_0x3dab17){const _0x941dc=a13_0x133a,_0x1988d3=_0x395ae0();while(!![]){try{const _0x27995f=parseInt(_0x941dc(0x19b))/0x1+parseInt(_0x941dc(0x1c8))/0x2+-parseInt(_0x941dc(0x193))/0x3+parseInt(_0x941dc(0x1b7))/0x4*(parseInt(_0x941dc(0x198))/0x5)+parseInt(_0x941dc(0x1df))/0x6*(parseInt(_0x941dc(0x19c))/0x7)+parseInt(_0x941dc(0x197))/0x8*(-parseInt(_0x941dc(0x1bf))/0x9)+-parseInt(_0x941dc(0x1bb))/0xa;if(_0x27995f===_0x3dab17)break;else _0x1988d3['push'](_0x1988d3['shift']());}catch(_0x7bb201){_0x1988d3['push'](_0x1988d3['shift']());}}}(a13_0x3c0e,0x1d468));function a13_0x3c0e(){const _0x576f7a=['\x0aConnection:\x20','credential','find','verbose','✔\x20Resolved\x20\x27','\x0aConnector:\x20','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','\x20\x20\x20\x20Default:\x20','repeat','hidden','Fetching\x20settings\x20for\x20connector\x20type:\x20','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','Listing\x20connector\x20types...','object','findByName','join','connection:settings','criteria','Show\x20when:\x20','label','hint','entries','\x20\x20\x20\x20Options:\x20','Show\x20connection\x20details','cyan','filter','7228daNwFT','Range:\x20','\x27...','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','1576310KogYux','connection','enumeration','execute','35577FoYqyk','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.','validate','Default:\x20','blue','name','limit','type','225420ilTEuU','getOutputSchema','input','legacy','log','>=\x20','data','Treating\x20\x27','<=\x20','\x20[record]','max','\x0aNo\x20credential\x20settings\x20defined','length','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.','connection:list','site','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','yellow','\x20-\x20','record','No\x20available\x20fields\x20for\x20this\x20connector','owner','connection:types','90ECWXzo','\x27\x20as\x20connector\x20type','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','list','description','Fetching\x20schema\x20for\x20\x27','\x27\x20(type:\x20','output','\x20connection','legacy_settings','\x20\x20\x20\x20','dim','✔\x20Found\x20schema\x20for\x20connection\x20\x27','Site:\x20','Fetching\x20settings\x20for\x20\x27','minimum','error','\x20connector\x20type','push','stringify','\x0aAvailable\x20fields:','Type:\x20','slice','listTypes','title','Looking\x20up\x20connection:\x20','default_value','✔\x20Found\x20','✔\x20Found\x20connection:\x20','properties','padStart','bold','108789PIIoHz','Listing\x20connections...','Fetching\x20connection\x20\x27','value','440XaoSjC','610giEoIl','map','\x0aCredential\x20settings:','162807fMtiHt','16450BkYaDs'];a13_0x3c0e=function(){return _0x576f7a;};return a13_0x3c0e();}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_0x15753f from'chalk';function normalizeSchemaForDisplay(_0x59b417){const _0x350eaa=a13_0x133a,_0x41c34b=_0x59b417[_0x350eaa(0x1fc)]||[],_0x22878c=_0x41c34b[_0x350eaa(0x19f)](_0x4506eb=>_0x4506eb[_0x350eaa(0x1c5)]===_0x350eaa(0x1e8)&&_0x4506eb['type']===_0x350eaa(0x1db)&&_0x4506eb[_0x350eaa(0x1fc)]);if(_0x22878c?.[_0x350eaa(0x1fc)]){const _0x42b146=_0x41c34b[_0x350eaa(0x1b6)](_0x1fd229=>_0x1fd229[_0x350eaa(0x1c5)]!=='legacy'&&_0x1fd229['name']!==_0x350eaa(0x1e8));return[..._0x42b146,..._0x22878c[_0x350eaa(0x1fc)]];}return _0x41c34b['filter'](_0x540f5d=>_0x540f5d[_0x350eaa(0x1c5)]!==_0x350eaa(0x1cb));}function a13_0x133a(_0xdc52ed,_0x5de44b){_0xdc52ed=_0xdc52ed-0x192;const _0x3c0e=a13_0x3c0e();let _0x133ac0=_0x3c0e[_0xdc52ed];return _0x133ac0;}function printSchemaFields(_0x5af433,_0x3c40ee){const _0x1b96a8=a13_0x133a,_0x249d52='\x20\x20'['repeat'](_0x3c40ee+0x1),_0x3b7bdb='\x20\x20'[_0x1b96a8(0x1a5)](_0x3c40ee+0x2);for(const _0x21df57 of _0x5af433){if(!_0x21df57[_0x1b96a8(0x1c5)])continue;const _0x481a63=_0x21df57[_0x1b96a8(0x1c7)]===_0x1b96a8(0x1db)&&_0x21df57[_0x1b96a8(0x1fc)]&&_0x21df57[_0x1b96a8(0x1fc)][_0x1b96a8(0x1d4)]>0x0&&_0x21df57[_0x1b96a8(0x1c5)]!==_0x1b96a8(0x1e8);let _0x560511=''+_0x249d52+a13_0x15753f['green'](_0x21df57[_0x1b96a8(0x1c5)]);_0x21df57[_0x1b96a8(0x1f7)]&&(_0x560511+=':\x20'+_0x21df57[_0x1b96a8(0x1f7)]);if(_0x21df57['input'])_0x560511+=a13_0x15753f[_0x1b96a8(0x1ea)]('\x20['+_0x21df57[_0x1b96a8(0x1ca)]+']');else _0x481a63&&(_0x560511+=a13_0x15753f[_0x1b96a8(0x1ea)](_0x1b96a8(0x1d1)));console[_0x1b96a8(0x1cc)](_0x560511);_0x21df57['description']&&console[_0x1b96a8(0x1cc)](''+_0x3b7bdb+a13_0x15753f[_0x1b96a8(0x1ea)](_0x21df57[_0x1b96a8(0x1e3)]));if(_0x21df57[_0x1b96a8(0x1bd)]){const _0x23bd5a=_0x21df57[_0x1b96a8(0x1bd)]['map'](_0x46f807=>typeof _0x46f807===_0x1b96a8(0x1aa)&&_0x1b96a8(0x196)in _0x46f807?_0x46f807[_0x1b96a8(0x196)]:_0x46f807)['join'](',\x20');console[_0x1b96a8(0x1cc)](_0x3b7bdb+'Options:\x20'+a13_0x15753f[_0x1b96a8(0x1d9)](_0x23bd5a));}_0x21df57['default_value']!==undefined&&console['log'](_0x3b7bdb+_0x1b96a8(0x1c3)+a13_0x15753f[_0x1b96a8(0x1c4)](String(_0x21df57[_0x1b96a8(0x1f9)])));if(_0x21df57[_0x1b96a8(0x1ee)]!==undefined||_0x21df57['maximum']!==undefined){const _0x4f10c0=_0x21df57[_0x1b96a8(0x1ee)]!==undefined&&_0x21df57['maximum']!==undefined?_0x21df57[_0x1b96a8(0x1ee)]+_0x1b96a8(0x1da)+_0x21df57['maximum']:_0x21df57['minimum']!==undefined?_0x1b96a8(0x1cd)+_0x21df57[_0x1b96a8(0x1ee)]:_0x1b96a8(0x1d0)+_0x21df57['maximum'];console[_0x1b96a8(0x1cc)](_0x3b7bdb+_0x1b96a8(0x1b8)+a13_0x15753f[_0x1b96a8(0x1c4)](_0x4f10c0));}if(_0x21df57['criteria']){const _0x1dca92=Object[_0x1b96a8(0x1b2)](_0x21df57[_0x1b96a8(0x1ae)])[_0x1b96a8(0x199)](([_0x5ab36a,_0x130ad4])=>_0x5ab36a+'='+JSON[_0x1b96a8(0x1f2)](_0x130ad4))[_0x1b96a8(0x1ac)](',\x20');console['log'](''+_0x3b7bdb+a13_0x15753f['dim']('Show\x20when:\x20'+_0x1dca92));}_0x481a63&&_0x21df57[_0x1b96a8(0x1fc)]&&printSchemaFields(_0x21df57[_0x1b96a8(0x1fc)],_0x3c40ee+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x327349(0x1c5)]=a13_0x327349(0x1d6);['description']='List\x20all\x20result\x20output\x20connections';async[a13_0x327349(0x1be)](_0x381eb){const _0x59b6b7=a13_0x327349,{options:_0x5b8bcf,tdx:_0x23a230}=_0x381eb;_0x5b8bcf['verbose']&&console[_0x59b6b7(0x1ef)](_0x59b6b7(0x1ec)+_0x5b8bcf[_0x59b6b7(0x1d7)]);const _0x1afd7e=resolveLimit(_0x5b8bcf[_0x59b6b7(0x1c6)],DEFAULT_LISTING_LIMIT),_0x42dc39=await withSpinner(_0x59b6b7(0x194),()=>_0x23a230['connection'][_0x59b6b7(0x1e2)](),{'verbose':_0x5b8bcf[_0x59b6b7(0x1a0)]}),_0x28f5e5=_0x42dc39['data'];console[_0x59b6b7(0x1ef)](_0x59b6b7(0x1fa)+_0x28f5e5['length']+_0x59b6b7(0x1e7)+(_0x28f5e5[_0x59b6b7(0x1d4)]!==0x1?'s':''));if(isStructuredFormat(_0x5b8bcf)){const _0x4f17ad=_0x28f5e5[_0x59b6b7(0x1f5)](0x0,_0x1afd7e);await handleSDKOutput(_0x4f17ad,{..._0x5b8bcf,'limit':_0x1afd7e});}else{const _0x19de88=_0x28f5e5[_0x59b6b7(0x1d4)]>0x0?Math[_0x59b6b7(0x1d2)](..._0x28f5e5[_0x59b6b7(0x199)](_0x2dbfe3=>_0x2dbfe3[_0x59b6b7(0x1c7)][_0x59b6b7(0x1d4)])):0x0,_0x34de8f=[];for(const _0x4970b8 of _0x28f5e5){const _0x407c16=a13_0x15753f[_0x59b6b7(0x1b5)](_0x4970b8[_0x59b6b7(0x1c7)][_0x59b6b7(0x1fd)](_0x19de88)),_0x3082c3=_0x4970b8[_0x59b6b7(0x1dd)]?.[_0x59b6b7(0x1c5)]?_0x59b6b7(0x1da)+a13_0x15753f[_0x59b6b7(0x1ea)](_0x4970b8[_0x59b6b7(0x1dd)][_0x59b6b7(0x1c5)]):'';_0x34de8f[_0x59b6b7(0x1f1)](_0x407c16+'\x20\x20'+_0x4970b8[_0x59b6b7(0x1c5)]+_0x3082c3);}await writeOutput(_0x34de8f[_0x59b6b7(0x1ac)]('\x0a'),_0x5b8bcf[_0x59b6b7(0x1e6)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x327349(0x1c5)]='connection:show';['description']=a13_0x327349(0x1b4);[a13_0x327349(0x1c2)](_0x3123db){const _0x82ac3b=a13_0x327349,{args:_0x1643da}=_0x3123db;if(!_0x1643da[0x0])return _0x82ac3b(0x1a3);return undefined;}async[a13_0x327349(0x1be)](_0xb32138){const _0x2e87ca=a13_0x327349,{options:_0x4e790c,args:_0x3579f8,tdx:_0x224ca2}=_0xb32138,_0x212ee6=_0x3579f8[0x0];_0x4e790c[_0x2e87ca(0x1a0)]&&(console['error'](_0x2e87ca(0x1ec)+_0x4e790c[_0x2e87ca(0x1d7)]),console['error'](_0x2e87ca(0x1f8)+_0x212ee6));const _0x551a7d=await withSpinner(_0x2e87ca(0x195)+_0x212ee6+_0x2e87ca(0x1b9),()=>_0x224ca2[_0x2e87ca(0x1bc)]['resolve'](_0x212ee6),{'verbose':_0x4e790c[_0x2e87ca(0x1a0)]}),_0x37e7d6=_0x551a7d[_0x2e87ca(0x1ce)];return console[_0x2e87ca(0x1ef)](_0x2e87ca(0x1fb)+_0x37e7d6[_0x2e87ca(0x1c5)]),await handleSingleObjectOutput(_0x37e7d6,_0x4e790c),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x327349(0x1c5)]='connection:schema';['description']=a13_0x327349(0x1e1);['validate'](_0x41f3ee){const _0x5ec250=a13_0x327349,{args:_0x1bb97d}=_0x41f3ee;if(!_0x1bb97d[0x0])return _0x5ec250(0x1d5);return undefined;}async[a13_0x327349(0x1be)](_0x413ff7){const _0x51d81c=a13_0x327349,{options:_0x2827ab,args:_0x3e991f,tdx:_0x17e3b0}=_0x413ff7,_0x297f38=_0x3e991f[0x0];_0x2827ab[_0x51d81c(0x1a0)]&&(console['error'](_0x51d81c(0x1ec)+_0x2827ab['site']),console['error']('Resolving\x20connector\x20type\x20or\x20name:\x20'+_0x297f38));let _0x162a80=_0x297f38,_0x12b65c;try{const _0x42407c=await _0x17e3b0[_0x51d81c(0x1bc)][_0x51d81c(0x1ab)](_0x297f38);_0x42407c&&(_0x162a80=_0x42407c['type'],_0x12b65c=_0x42407c['name'],_0x2827ab[_0x51d81c(0x1a0)]&&console[_0x51d81c(0x1ef)](_0x51d81c(0x1a1)+_0x297f38+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x162a80));}catch{_0x2827ab['verbose']&&console[_0x51d81c(0x1ef)](_0x51d81c(0x1cf)+_0x297f38+_0x51d81c(0x1e0));}const _0xf311f7=await withSpinner(_0x51d81c(0x1e4)+_0x162a80+_0x51d81c(0x1b9),()=>_0x17e3b0['connection'][_0x51d81c(0x1c9)](_0x162a80),{'verbose':_0x2827ab['verbose']}),_0x48bb04=_0xf311f7[_0x51d81c(0x1ce)];_0x12b65c?console['error'](_0x51d81c(0x1eb)+_0x12b65c+_0x51d81c(0x1e5)+_0x162a80+')'):console[_0x51d81c(0x1ef)](_0x51d81c(0x1ba)+_0x162a80);if(isStructuredFormat(_0x2827ab))await handleSingleObjectOutput(_0x48bb04,_0x2827ab);else{const _0x12472e=normalizeSchemaForDisplay(_0x48bb04);_0x12b65c?(console[_0x51d81c(0x1cc)](_0x51d81c(0x19d)+a13_0x15753f[_0x51d81c(0x1b5)](_0x12b65c)),console[_0x51d81c(0x1cc)](_0x51d81c(0x1f4)+a13_0x15753f[_0x51d81c(0x1ea)](_0x162a80))):console[_0x51d81c(0x1cc)](_0x51d81c(0x1a2)+a13_0x15753f[_0x51d81c(0x1b5)](_0x162a80)),_0x12472e[_0x51d81c(0x1d4)]>0x0?(console[_0x51d81c(0x1cc)](a13_0x15753f[_0x51d81c(0x192)](_0x51d81c(0x1f3))),printSchemaFields(_0x12472e,0x0)):console[_0x51d81c(0x1cc)](a13_0x15753f['dim']('\x0aNo\x20fields\x20defined\x20in\x20schema'));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x327349(0x1c5)]=a13_0x327349(0x1de);[a13_0x327349(0x1e3)]='List\x20available\x20connector\x20types';async[a13_0x327349(0x1be)](_0x4b8c8d){const _0x4b693d=a13_0x327349,{options:_0x228390,tdx:_0x1a7ab1}=_0x4b8c8d;_0x228390[_0x4b693d(0x1a0)]&&console[_0x4b693d(0x1ef)](_0x4b693d(0x1ec)+_0x228390['site']);const _0x45caad=await withSpinner(_0x4b693d(0x1a9),()=>_0x1a7ab1[_0x4b693d(0x1bc)][_0x4b693d(0x1f6)](),{'verbose':_0x228390[_0x4b693d(0x1a0)]}),_0x1c1b0e=_0x45caad[_0x4b693d(0x1ce)]['sort']((_0x5571f1,_0x46780b)=>_0x5571f1[_0x4b693d(0x1c7)]['localeCompare'](_0x46780b['type']));console[_0x4b693d(0x1ef)](_0x4b693d(0x1fa)+_0x1c1b0e[_0x4b693d(0x1d4)]+_0x4b693d(0x1f0)+(_0x1c1b0e[_0x4b693d(0x1d4)]!==0x1?'s':''));if(isStructuredFormat(_0x228390))await handleSDKOutput(_0x1c1b0e,_0x228390);else{const _0xf7dd06=_0x1c1b0e[_0x4b693d(0x1d4)]>0x0?Math[_0x4b693d(0x1d2)](..._0x1c1b0e[_0x4b693d(0x199)](_0x4b0b24=>_0x4b0b24[_0x4b693d(0x1c7)][_0x4b693d(0x1d4)])):0x0,_0x54362c=[];for(const _0x1f7143 of _0x1c1b0e){const _0x541283=a13_0x15753f['cyan'](_0x1f7143['type'][_0x4b693d(0x1fd)](_0xf7dd06));_0x54362c[_0x4b693d(0x1f1)](_0x541283+'\x20\x20'+_0x1f7143[_0x4b693d(0x1c5)]);}await writeOutput(_0x54362c[_0x4b693d(0x1ac)]('\x0a'),_0x228390[_0x4b693d(0x1e6)],'table');}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x327349(0x1c5)]=a13_0x327349(0x1ad);[a13_0x327349(0x1e3)]=a13_0x327349(0x1a8);[a13_0x327349(0x1c2)](_0x18c3b5){const _0x4abd6d=a13_0x327349,{args:_0x579a6c}=_0x18c3b5;if(!_0x579a6c[0x0])return _0x4abd6d(0x1c1);return undefined;}async[a13_0x327349(0x1be)](_0x1d4312){const _0xb4590c=a13_0x327349,{options:_0x5f49d7,args:_0x5e4e44,tdx:_0x567854}=_0x1d4312,_0x3eb6dc=_0x5e4e44[0x0];_0x5f49d7[_0xb4590c(0x1a0)]&&(console[_0xb4590c(0x1ef)](_0xb4590c(0x1ec)+_0x5f49d7['site']),console[_0xb4590c(0x1ef)](_0xb4590c(0x1a7)+_0x3eb6dc));const _0x5dcf18=await withSpinner(_0xb4590c(0x1ed)+_0x3eb6dc+_0xb4590c(0x1b9),()=>_0x567854[_0xb4590c(0x1bc)]['getMetadata'](_0x3eb6dc),{'verbose':_0x5f49d7[_0xb4590c(0x1a0)]}),_0x4b0b46=_0x5dcf18['data'];console[_0xb4590c(0x1ef)](_0xb4590c(0x1d8)+_0x3eb6dc);if(isStructuredFormat(_0x5f49d7))await handleSingleObjectOutput(_0x4b0b46,_0x5f49d7);else{console['log'](_0xb4590c(0x1a2)+a13_0x15753f['cyan'](_0x3eb6dc)),console[_0xb4590c(0x1cc)]('Name:\x20'+_0x4b0b46[_0xb4590c(0x1c5)]);const _0x34b420=_0x4b0b46['settings']||[],_0xe418d6=_0x34b420[_0xb4590c(0x1b6)](_0x3d6668=>_0x3d6668['credential']);_0xe418d6[_0xb4590c(0x1d4)]>0x0&&(console[_0xb4590c(0x1cc)](a13_0x15753f[_0xb4590c(0x192)](_0xb4590c(0x19a))),printMetadataSettings(_0xe418d6));let _0x55ab0b=![];try{const _0x514db6=await _0x567854['connection'][_0xb4590c(0x1c9)](_0x3eb6dc),_0x17e1aa=normalizeSchemaForDisplay(_0x514db6);_0x17e1aa['length']>0x0&&(console[_0xb4590c(0x1cc)](a13_0x15753f[_0xb4590c(0x192)](_0xb4590c(0x1f3))),printSchemaFields(_0x17e1aa,0x0),_0x55ab0b=!![]);}catch{const _0x20b0d9=_0x34b420['filter'](_0x1495cc=>!_0x1495cc[_0xb4590c(0x19e)]);_0x20b0d9[_0xb4590c(0x1d4)]>0x0&&(console['log'](a13_0x15753f['bold'](_0xb4590c(0x1f3))),printMetadataSettings(_0x20b0d9),_0x55ab0b=!![]);}!_0x55ab0b&&_0x5f49d7[_0xb4590c(0x1a0)]&&console['error'](a13_0x15753f[_0xb4590c(0x1ea)](_0xb4590c(0x1dc))),_0xe418d6[_0xb4590c(0x1d4)]===0x0&&console['log'](a13_0x15753f[_0xb4590c(0x1ea)](_0xb4590c(0x1d3)));}return 0x0;}}function printMetadataSettings(_0x8c623){const _0x40ec7e=a13_0x327349;for(const _0x5388c0 of _0x8c623){if(!_0x5388c0[_0x40ec7e(0x1c5)])continue;if(_0x5388c0[_0x40ec7e(0x1a6)])continue;let _0x4c7fc6='\x20\x20'+a13_0x15753f['green'](_0x5388c0[_0x40ec7e(0x1c5)]);_0x5388c0[_0x40ec7e(0x1b0)]&&(_0x4c7fc6+=':\x20'+_0x5388c0[_0x40ec7e(0x1b0)]);_0x5388c0[_0x40ec7e(0x1c7)]&&(_0x4c7fc6+=a13_0x15753f[_0x40ec7e(0x1ea)]('\x20['+_0x5388c0[_0x40ec7e(0x1c7)]+']'));console['log'](_0x4c7fc6);_0x5388c0[_0x40ec7e(0x1b1)]&&console[_0x40ec7e(0x1cc)](_0x40ec7e(0x1e9)+a13_0x15753f[_0x40ec7e(0x1ea)](_0x5388c0[_0x40ec7e(0x1b1)]));if(_0x5388c0[_0x40ec7e(0x1c0)]){const _0x3f862c=_0x5388c0[_0x40ec7e(0x1c0)][_0x40ec7e(0x199)](_0x1be29e=>_0x1be29e[_0x40ec7e(0x196)])['join'](',\x20');console['log'](_0x40ec7e(0x1b3)+a13_0x15753f[_0x40ec7e(0x1d9)](_0x3f862c));}_0x5388c0[_0x40ec7e(0x1f9)]!==undefined&&_0x5388c0[_0x40ec7e(0x1f9)]!==null&&console[_0x40ec7e(0x1cc)](_0x40ec7e(0x1a4)+a13_0x15753f[_0x40ec7e(0x1c4)](String(_0x5388c0[_0x40ec7e(0x1f9)])));if(_0x5388c0[_0x40ec7e(0x1ae)]){const _0x51f27b=Object[_0x40ec7e(0x1b2)](_0x5388c0[_0x40ec7e(0x1ae)])[_0x40ec7e(0x199)](([_0x31bc53,_0xa2c1f1])=>_0x31bc53+'='+JSON[_0x40ec7e(0x1f2)](_0xa2c1f1))[_0x40ec7e(0x1ac)](',\x20');console['log'](_0x40ec7e(0x1e9)+a13_0x15753f[_0x40ec7e(0x1ea)](_0x40ec7e(0x1af)+_0x51f27b));}}}
|
|
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_0x48275b=a16_0x2981;(function(_0x4324cc,_0x347115){const _0x383e08=a16_0x2981,_0x2c442d=_0x4324cc();while(!![]){try{const _0x508940=parseInt(_0x383e08(0x138))/0x1*(parseInt(_0x383e08(0x181))/0x2)+-parseInt(_0x383e08(0x17c))/0x3*(-parseInt(_0x383e08(0x123))/0x4)+parseInt(_0x383e08(0x13e))/0x5*(-parseInt(_0x383e08(0x12c))/0x6)+parseInt(_0x383e08(0x119))/0x7*(parseInt(_0x383e08(0x12b))/0x8)+-parseInt(_0x383e08(0x128))/0x9+-parseInt(_0x383e08(0x15f))/0xa*(parseInt(_0x383e08(0x193))/0xb)+parseInt(_0x383e08(0x16f))/0xc;if(_0x508940===_0x347115)break;else _0x2c442d['push'](_0x2c442d['shift']());}catch(_0x1d8dfb){_0x2c442d['push'](_0x2c442d['shift']());}}}(a16_0x219a,0x24d89));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(_0x2bd6d2,_0x114f7c,_0x5bf1f2=![]){const _0x4bae04=a16_0x2981;if(_0x2bd6d2[_0x4bae04(0x184)])return await _0x114f7c['engage']['resolveWorkspaceId'](_0x2bd6d2['workspace']);const _0x5b304e=loadSessionContext(_0x2bd6d2[_0x4bae04(0x140)]);if(_0x5b304e?.[_0x4bae04(0x17d)])return await _0x114f7c[_0x4bae04(0x164)][_0x4bae04(0x148)](_0x5b304e['engage_workspace']);if(_0x5bf1f2)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x4bae04(0x168),undefined,{'helpText':_0x4bae04(0x167)});return undefined;}async function resolveSegmentFromOptions(_0x2b4b15,_0xdb2811){const _0x185dca=a16_0x2981;if(!_0x2b4b15[_0x185dca(0x18f)])return{};const _0x3962b7=_0x2b4b15[_0x185dca(0x18f)],_0x148507=await _0xdb2811[_0x185dca(0x18f)]['resolvePathToResource'](_0x3962b7);return{'audienceId':_0x148507['parentId'],'audienceName':_0x148507[_0x185dca(0x13a)],..._0x148507[_0x185dca(0x12f)]&&{'segmentId':_0x148507[_0x185dca(0x12f)],'segmentName':_0x148507[_0x185dca(0x127)]}};}function buildConnectorConfig(_0x38b8c6){const _0x2749bd=a16_0x2981,_0x16de2b=_0x38b8c6[_0x2749bd(0x110)],_0x4af754=_0x38b8c6[_0x2749bd(0x198)];if(!_0x16de2b&&!_0x4af754)return undefined;return{..._0x16de2b&&{'emailSenderId':_0x16de2b},..._0x4af754&&{'jsonColumns':_0x4af754}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a16_0x48275b(0x162);['description']=a16_0x48275b(0x178);async[a16_0x48275b(0x187)](_0x199e20){const _0x10888b=a16_0x48275b,{options:_0x59261e,args:_0x3f8033,tdx:_0x5be8d3}=_0x199e20,_0x3a34e3=_0x3f8033[0x0],_0x578369=resolveLimit(_0x59261e[_0x10888b(0x14a)],DEFAULT_LLM_LIMIT),_0x19cbef=_0x59261e,_0x55675c=_0x19cbef[_0x10888b(0x196)],_0x37a63b=_0x19cbef[_0x10888b(0x171)],_0x37c8e9=await resolveWorkspaceIdFromOptions(_0x19cbef,_0x5be8d3),_0x1b56d8=await withSpinner(_0x10888b(0x163),()=>_0x5be8d3[_0x10888b(0x164)][_0x10888b(0x14b)]({'type':_0x55675c,'status':_0x37a63b,'workspaceId':_0x37c8e9,'limit':_0x578369}),{'verbose':_0x59261e[_0x10888b(0x126)]});let _0x2c2bae=_0x1b56d8[_0x10888b(0x125)];return _0x3a34e3&&(_0x2c2bae=_0x1b56d8[_0x10888b(0x125)][_0x10888b(0x180)](_0x248b45=>matchGlobPattern(_0x248b45['name'],_0x3a34e3))),await handleSDKOutput(_0x2c2bae,_0x59261e),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x18a);[a16_0x48275b(0x147)]=a16_0x48275b(0x11d);async[a16_0x48275b(0x187)](_0x411608){const _0x51fa2b=a16_0x48275b,{options:_0x41eb52,args:_0x43572f,tdx:_0x230c2}=_0x411608;if(_0x43572f[_0x51fa2b(0x137)]===0x0)return console[_0x51fa2b(0x131)](_0x51fa2b(0x158)),console[_0x51fa2b(0x131)](_0x51fa2b(0x115)),0x1;const _0x513237=_0x43572f[0x0],_0x2f3a87=_0x41eb52,_0x3f3541=await resolveWorkspaceIdFromOptions(_0x2f3a87,_0x230c2),_0x23e19c=_0x2f3a87[_0x51fa2b(0x174)];if(_0x23e19c){const _0x16a984=await withSpinner(_0x51fa2b(0x159)+_0x513237+_0x51fa2b(0x135),()=>_0x230c2[_0x51fa2b(0x164)][_0x51fa2b(0x189)](_0x513237,_0x3f3541),{'verbose':_0x41eb52[_0x51fa2b(0x126)]});await handleSDKOutput([_0x16a984],_0x41eb52);}else{const _0x48e7a7=await withSpinner('Fetching\x20campaign\x20\x27'+_0x513237+_0x51fa2b(0x135),()=>_0x230c2[_0x51fa2b(0x164)]['getCampaign'](_0x513237,_0x3f3541),{'verbose':_0x41eb52[_0x51fa2b(0x126)]});await handleSDKOutput([_0x48e7a7],_0x41eb52);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x186);[a16_0x48275b(0x147)]='Create\x20a\x20new\x20campaign';async['execute'](_0x5b43ec){const _0xb047ad=a16_0x48275b,{options:_0x305205,tdx:_0x3b5834}=_0x5b43ec,_0x14ba4b=_0x305205,_0x27c313=_0x14ba4b[_0xb047ad(0x116)],_0x396553=_0x14ba4b[_0xb047ad(0x196)];if(!_0x27c313)return console[_0xb047ad(0x131)](_0xb047ad(0x134)),console[_0xb047ad(0x131)](_0xb047ad(0x18b)),0x1;if(!_0x396553)return console[_0xb047ad(0x131)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0xb047ad(0x131)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x51101d=await resolveWorkspaceIdFromOptions(_0x14ba4b,_0x3b5834,!![]),_0x2e479f=await resolveSegmentFromOptions(_0x14ba4b,_0x3b5834),_0x54dacd=buildConnectorConfig(_0x14ba4b),_0x23feb2={'name':_0x27c313,'campaignType':_0x396553,'workspaceId':_0x51101d,'description':_0x14ba4b[_0xb047ad(0x147)],..._0x2e479f,'connectorConfig':_0x54dacd,'startAt':_0x14ba4b[_0xb047ad(0x155)],'timezone':_0x14ba4b['timezone']},_0x12e135=await withSpinner(_0xb047ad(0x16e)+_0x27c313+_0xb047ad(0x135),()=>_0x3b5834['engage']['createCampaign'](_0x23feb2));return await handleSDKOutput([_0x12e135[_0xb047ad(0x125)]],_0x305205),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x48275b(0x116)]='engage:campaign:update';[a16_0x48275b(0x147)]=a16_0x48275b(0x157);async[a16_0x48275b(0x187)](_0x594e02){const _0x5298de=a16_0x48275b,{options:_0x2152d8,args:_0x1f242b,tdx:_0x1be0e6}=_0x594e02;if(_0x1f242b[_0x5298de(0x137)]===0x0)return console[_0x5298de(0x131)](_0x5298de(0x158)),console[_0x5298de(0x131)](_0x5298de(0x16a)),0x1;const _0x24b870=_0x1f242b[0x0],_0x2f255d=_0x2152d8,_0x50d8be=await resolveWorkspaceIdFromOptions(_0x2f255d,_0x1be0e6),_0x23809b=await resolveSegmentFromOptions(_0x2f255d,_0x1be0e6),_0x1aa9e2=buildConnectorConfig(_0x2f255d),_0x3c21d6={'name':_0x2f255d[_0x5298de(0x116)],'description':_0x2f255d['description'],..._0x23809b,'connectorConfig':_0x1aa9e2,'startAt':_0x2f255d[_0x5298de(0x155)],'timezone':_0x2f255d[_0x5298de(0x185)]},_0x43647c=Object['fromEntries'](Object[_0x5298de(0x114)](_0x3c21d6)[_0x5298de(0x180)](([,_0x1421a0])=>_0x1421a0!==undefined));if(Object[_0x5298de(0x18e)](_0x43647c)[_0x5298de(0x137)]===0x0)return console[_0x5298de(0x131)](_0x5298de(0x11c)),console[_0x5298de(0x131)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x17cdc1=await withSpinner(_0x5298de(0x12d)+_0x24b870+_0x5298de(0x135),()=>_0x1be0e6['engage']['updateCampaign'](_0x24b870,_0x43647c,_0x50d8be),{'verbose':_0x2152d8[_0x5298de(0x126)]});return await handleSDKOutput([_0x17cdc1[_0x5298de(0x125)]],_0x2152d8),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x48275b(0x116)]='engage:campaign:delete';[a16_0x48275b(0x147)]=a16_0x48275b(0x10e);async[a16_0x48275b(0x187)](_0x55d57c){const _0xb4988e=a16_0x48275b,{options:_0xc53b49,args:_0x5dcc63,tdx:_0x2c2554}=_0x55d57c;if(_0x5dcc63[_0xb4988e(0x137)]===0x0)return console[_0xb4988e(0x131)](_0xb4988e(0x158)),console[_0xb4988e(0x131)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x2389d5=_0x5dcc63[0x0],_0x377063=_0xc53b49,_0x5b0f86=await resolveWorkspaceIdFromOptions(_0x377063,_0x2c2554);if(!_0xc53b49[_0xb4988e(0x146)]){const _0x53a05d=await confirm(_0xb4988e(0x195)+_0x2389d5+_0xb4988e(0x191));if(!_0x53a05d)return console[_0xb4988e(0x151)](_0xb4988e(0x15d)),0x0;}return await withSpinner(_0xb4988e(0x170)+_0x2389d5+_0xb4988e(0x135),()=>_0x2c2554[_0xb4988e(0x164)][_0xb4988e(0x17f)](_0x2389d5,_0x5b0f86),{'verbose':_0xc53b49[_0xb4988e(0x126)]}),console[_0xb4988e(0x151)](_0xb4988e(0x17b)+_0x2389d5+_0xb4988e(0x14e)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x144);[a16_0x48275b(0x147)]=a16_0x48275b(0x179);async['execute'](_0x14f25b){const _0x1f7fd6=a16_0x48275b,{options:_0x233d58,args:_0x4e1cd2,tdx:_0x36a284}=_0x14f25b;if(_0x4e1cd2['length']===0x0)return console[_0x1f7fd6(0x131)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x1f0778=_0x4e1cd2[0x0],_0x450d5b=_0x233d58,_0x1f0d2c=await resolveWorkspaceIdFromOptions(_0x450d5b,_0x36a284);return await withSpinner(_0x1f7fd6(0x117)+_0x1f0778+_0x1f7fd6(0x135),()=>_0x36a284['engage']['launchCampaign'](_0x1f0778,_0x1f0d2c),{'verbose':_0x233d58['verbose']}),console[_0x1f7fd6(0x151)](_0x1f7fd6(0x17b)+_0x1f0778+_0x1f7fd6(0x188)),0x0;}}function a16_0x219a(){const _0x435102=['Fetching\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','28pqBCUn','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','data','verbose','segmentName','2403693xyhNPl','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Resume\x20a\x20paused\x20campaign','5912BxFrif','888LjzglV','Updating\x20campaign\x20\x27','plaintext','segmentId','deleteTemplate','error','getWorkspaceFull','engage:campaign:pause','Error:\x20--name\x20is\x20required','\x27...','editorType','length','487YCUcrL','Fetching\x20templates...','parentName','Update\x20an\x20email\x20template','listWorkspaces','engage:workspace:use','3135nFFHPq','Delete\x20a\x20workspace','session','Verifying\x20workspace\x20\x27','html','createTemplate','engage:campaign:launch','Duplicating\x20campaign\x20\x27','yes','description','resolveWorkspaceId','getTemplate','limit','listCampaigns','engage:campaign:resume','Template\x20\x27','\x27\x20deleted\x20successfully','Fetching\x20workspaces...','pauseCampaign','log','duplicateCampaign','Updating\x20template\x20\x27','Resuming\x20campaign\x20\x27','startAt','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Update\x20a\x20campaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Fetching\x20campaign\x20\x27','Create\x20a\x20workspace','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Operation\x20cancelled','Creating\x20workspace\x20\x27','380Ighvbz','Pause\x20a\x20campaign','\x27\x20resumed\x20successfully','engage:campaigns','Fetching\x20campaigns...','engage','engage:workspace:update','engage:templates','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Workspace\x20is\x20required\x20for\x20this\x20operation','engage:workspace:show','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Show\x20workspace\x20details','Updating\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Creating\x20campaign\x20\x27','3385152aaEMbK','Deleting\x20campaign\x20\x27','status','Duplicate\x20a\x20campaign','engage:workspace:delete','full','engage:template:update','Error:\x20Workspace\x20name\x20is\x20required','Create\x20an\x20email\x20template','List\x20campaigns','Launch\x20a\x20campaign','Error:\x20--html\x20is\x20required','Campaign\x20\x27','48801yKkpXW','engage_workspace','engage:template:create','deleteCampaign','filter','328wIYSna','List\x20workspaces','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','workspace','timezone','engage:campaign:create','execute','\x27\x20launched\x20successfully','getCampaignFull','engage:campaign:show','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','engage:campaign:duplicate','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','keys','segment','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27?\x20This\x20cannot\x20be\x20undone.','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','64966biwFOW','Deleting\x20template\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','type','List\x20email\x20templates','jsonColumns','createWorkspace','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Delete\x20an\x20email\x20template','resumeCampaign','Delete\x20a\x20campaign','listTemplates','emailSenderId','getWorkspace','Options:\x20--name,\x20--description','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','entries','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','name','Launching\x20campaign\x20\x27','Fetching\x20template\x20\x27','2457oQVKin','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','updateWorkspace','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Show\x20campaign\x20details','engage:template:delete','subject','engage:workspace:create'];a16_0x219a=function(){return _0x435102;};return a16_0x219a();}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x133);[a16_0x48275b(0x147)]=a16_0x48275b(0x160);async[a16_0x48275b(0x187)](_0x94b299){const _0x4b3c6b=a16_0x48275b,{options:_0x5580fb,args:_0x1268ee,tdx:_0x342fe0}=_0x94b299;if(_0x1268ee[_0x4b3c6b(0x137)]===0x0)return console[_0x4b3c6b(0x131)](_0x4b3c6b(0x158)),console[_0x4b3c6b(0x131)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x46af7e=_0x1268ee[0x0],_0x1bee3c=_0x5580fb,_0x41c55e=await resolveWorkspaceIdFromOptions(_0x1bee3c,_0x342fe0);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x46af7e+'\x27...',()=>_0x342fe0['engage'][_0x4b3c6b(0x150)](_0x46af7e,_0x41c55e),{'verbose':_0x5580fb[_0x4b3c6b(0x126)]}),console['log'](_0x4b3c6b(0x17b)+_0x46af7e+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a16_0x48275b(0x14c);[a16_0x48275b(0x147)]=a16_0x48275b(0x12a);async['execute'](_0x38f157){const _0xf3f5be=a16_0x48275b,{options:_0x256c69,args:_0x5ddb1f,tdx:_0x2e3f3e}=_0x38f157;if(_0x5ddb1f[_0xf3f5be(0x137)]===0x0)return console[_0xf3f5be(0x131)](_0xf3f5be(0x158)),console[_0xf3f5be(0x131)](_0xf3f5be(0x192)),0x1;const _0x4b06d6=_0x5ddb1f[0x0],_0xe27281=_0x256c69,_0xbc7f7c=await resolveWorkspaceIdFromOptions(_0xe27281,_0x2e3f3e);return await withSpinner(_0xf3f5be(0x154)+_0x4b06d6+_0xf3f5be(0x135),()=>_0x2e3f3e['engage'][_0xf3f5be(0x10d)](_0x4b06d6,_0xbc7f7c),{'verbose':_0x256c69['verbose']}),console[_0xf3f5be(0x151)](_0xf3f5be(0x17b)+_0x4b06d6+_0xf3f5be(0x161)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x18c);[a16_0x48275b(0x147)]=a16_0x48275b(0x172);async[a16_0x48275b(0x187)](_0x4827d5){const _0x5b5e2e=a16_0x48275b,{options:_0x215640,args:_0x48d7c3,tdx:_0x146d35}=_0x4827d5;if(_0x48d7c3[_0x5b5e2e(0x137)]===0x0)return console[_0x5b5e2e(0x131)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x5b5e2e(0x124)),0x1;const _0x5a56c7=_0x48d7c3[0x0],_0x56add0=_0x215640,_0x2c066f=await resolveWorkspaceIdFromOptions(_0x56add0,_0x146d35),_0x586bc3=await withSpinner(_0x5b5e2e(0x145)+_0x5a56c7+_0x5b5e2e(0x135),()=>_0x146d35[_0x5b5e2e(0x164)][_0x5b5e2e(0x152)](_0x5a56c7,_0x2c066f),{'verbose':_0x215640[_0x5b5e2e(0x126)]});return await handleSDKOutput([_0x586bc3[_0x5b5e2e(0x125)]],_0x215640),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0x48275b(0x166);[a16_0x48275b(0x147)]=a16_0x48275b(0x197);async[a16_0x48275b(0x187)](_0x3310c6){const _0x3f22f4=a16_0x48275b,{options:_0x2f8d8d,args:_0x3f089b,tdx:_0x82963b}=_0x3310c6,_0x376532=_0x3f089b[0x0],_0x447681=resolveLimit(_0x2f8d8d[_0x3f22f4(0x14a)],DEFAULT_LLM_LIMIT),_0x11a263=_0x2f8d8d,_0x13d151=await resolveWorkspaceIdFromOptions(_0x11a263,_0x82963b),_0x16b55c=await withSpinner(_0x3f22f4(0x139),()=>_0x82963b['engage'][_0x3f22f4(0x10f)]({'workspaceId':_0x13d151,'limit':_0x447681}),{'verbose':_0x2f8d8d['verbose']});let _0x1033a0=_0x16b55c[_0x3f22f4(0x125)];return _0x376532&&(_0x1033a0=_0x16b55c['data'][_0x3f22f4(0x180)](_0x5189ee=>matchGlobPattern(_0x5189ee[_0x3f22f4(0x116)],_0x376532))),await handleSDKOutput(_0x1033a0,_0x2f8d8d),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']='engage:template:show';[a16_0x48275b(0x147)]='Show\x20email\x20template\x20details';async[a16_0x48275b(0x187)](_0x5ecec6){const _0x3a4646=a16_0x48275b,{options:_0x4da69e,args:_0x4c8ef7,tdx:_0xf4cf42}=_0x5ecec6;if(_0x4c8ef7[_0x3a4646(0x137)]===0x0)return console[_0x3a4646(0x131)](_0x3a4646(0x156)),console[_0x3a4646(0x131)](_0x3a4646(0x19a)),0x1;const _0x39e046=_0x4c8ef7[0x0],_0x191d87=_0x4da69e,_0x524d2b=await resolveWorkspaceIdFromOptions(_0x191d87,_0xf4cf42),_0x38b419=_0x191d87['full'];if(_0x38b419){const _0x2f8e85=await withSpinner(_0x3a4646(0x118)+_0x39e046+'\x27...',()=>_0xf4cf42[_0x3a4646(0x164)]['getTemplateFull'](_0x39e046,_0x524d2b),{'verbose':_0x4da69e[_0x3a4646(0x126)]});await handleSDKOutput([_0x2f8e85],_0x4da69e);}else{const _0x2657e6=await withSpinner(_0x3a4646(0x118)+_0x39e046+_0x3a4646(0x135),()=>_0xf4cf42[_0x3a4646(0x164)][_0x3a4646(0x149)](_0x39e046,_0x524d2b),{'verbose':_0x4da69e['verbose']});await handleSDKOutput([_0x2657e6],_0x4da69e);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x17e);[a16_0x48275b(0x147)]=a16_0x48275b(0x177);async[a16_0x48275b(0x187)](_0x12f2f5){const _0x2a9255=a16_0x48275b,{options:_0x2a2fe5,tdx:_0x48f3f1}=_0x12f2f5,_0x34ede1=_0x2a2fe5,_0x1e0f18=_0x34ede1['name'],_0x396543=_0x34ede1[_0x2a9255(0x11f)],_0x5e9309=_0x34ede1[_0x2a9255(0x142)];if(!_0x1e0f18)return console[_0x2a9255(0x131)]('Error:\x20--name\x20is\x20required'),console[_0x2a9255(0x131)](_0x2a9255(0x113)),0x1;if(!_0x396543)return console[_0x2a9255(0x131)]('Error:\x20--subject\x20is\x20required'),0x1;if(!_0x5e9309)return console[_0x2a9255(0x131)](_0x2a9255(0x17a)),0x1;const _0x21ea6e=await resolveWorkspaceIdFromOptions(_0x34ede1,_0x48f3f1,!![]),_0x11395f={'name':_0x1e0f18,'subjectTemplate':_0x396543,'htmlTemplate':_0x5e9309,'workspaceId':_0x21ea6e,'plaintextTemplate':_0x34ede1['plaintext'],'editorType':_0x34ede1[_0x2a9255(0x136)]},_0x7c25e=await withSpinner('Creating\x20template\x20\x27'+_0x1e0f18+_0x2a9255(0x135),()=>_0x48f3f1['engage'][_0x2a9255(0x143)](_0x11395f));return await handleSDKOutput([_0x7c25e[_0x2a9255(0x125)]],_0x2a2fe5),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x175);[a16_0x48275b(0x147)]=a16_0x48275b(0x13b);async[a16_0x48275b(0x187)](_0x594189){const _0x48f3dd=a16_0x48275b,{options:_0x3d3665,args:_0x10f1e6,tdx:_0x36a009}=_0x594189;if(_0x10f1e6[_0x48f3dd(0x137)]===0x0)return console[_0x48f3dd(0x131)](_0x48f3dd(0x156)),console[_0x48f3dd(0x131)](_0x48f3dd(0x190)),0x1;const _0x43fcaa=_0x10f1e6[0x0],_0x1cf452=_0x3d3665,_0x405c64=await resolveWorkspaceIdFromOptions(_0x1cf452,_0x36a009),_0x183c7d={'name':_0x1cf452['name'],'subjectTemplate':_0x1cf452[_0x48f3dd(0x11f)],'htmlTemplate':_0x1cf452[_0x48f3dd(0x142)],'plaintextTemplate':_0x1cf452[_0x48f3dd(0x12e)]},_0x53d1ef=Object['fromEntries'](Object['entries'](_0x183c7d)['filter'](([,_0x1618f8])=>_0x1618f8!==undefined));if(Object['keys'](_0x53d1ef)[_0x48f3dd(0x137)]===0x0)return console['error'](_0x48f3dd(0x11c)),console['error'](_0x48f3dd(0x129)),0x1;const _0x124283=await withSpinner(_0x48f3dd(0x153)+_0x43fcaa+_0x48f3dd(0x135),()=>_0x36a009[_0x48f3dd(0x164)]['updateTemplate'](_0x43fcaa,_0x53d1ef,_0x405c64),{'verbose':_0x3d3665[_0x48f3dd(0x126)]});return await handleSDKOutput([_0x124283[_0x48f3dd(0x125)]],_0x3d3665),0x0;}}function a16_0x2981(_0x1ab191,_0x337db0){_0x1ab191=_0x1ab191-0x10d;const _0x219a59=a16_0x219a();let _0x298181=_0x219a59[_0x1ab191];return _0x298181;}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x11e);[a16_0x48275b(0x147)]=a16_0x48275b(0x19b);async[a16_0x48275b(0x187)](_0x1399a2){const _0x20bfae=a16_0x48275b,{options:_0x1cd276,args:_0x533201,tdx:_0x5df7a9}=_0x1399a2;if(_0x533201[_0x20bfae(0x137)]===0x0)return console[_0x20bfae(0x131)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x20bfae(0x131)](_0x20bfae(0x15c)),0x1;const _0x2457bb=_0x533201[0x0],_0x2c9c88=_0x1cd276,_0x5a78aa=await resolveWorkspaceIdFromOptions(_0x2c9c88,_0x5df7a9);if(!_0x1cd276[_0x20bfae(0x146)]){const _0x42f327=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x2457bb+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x42f327)return console[_0x20bfae(0x151)](_0x20bfae(0x15d)),0x0;}return await withSpinner(_0x20bfae(0x194)+_0x2457bb+_0x20bfae(0x135),()=>_0x5df7a9[_0x20bfae(0x164)][_0x20bfae(0x130)](_0x2457bb,_0x5a78aa),{'verbose':_0x1cd276[_0x20bfae(0x126)]}),console[_0x20bfae(0x151)](_0x20bfae(0x14d)+_0x2457bb+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']='engage:workspaces';[a16_0x48275b(0x147)]=a16_0x48275b(0x182);async['execute'](_0xff136d){const _0x26c6ee=a16_0x48275b,{options:_0x169372,args:_0x103527,tdx:_0x297f3e}=_0xff136d,_0x50ef6d=_0x103527[0x0],_0x1987a4=resolveLimit(_0x169372[_0x26c6ee(0x14a)],DEFAULT_LLM_LIMIT),_0x411a97=await withSpinner(_0x26c6ee(0x14f),()=>_0x297f3e[_0x26c6ee(0x164)][_0x26c6ee(0x13c)]({'limit':_0x1987a4}),{'verbose':_0x169372[_0x26c6ee(0x126)]});let _0x2e9286=_0x411a97[_0x26c6ee(0x125)];return _0x50ef6d&&(_0x2e9286=_0x411a97[_0x26c6ee(0x125)][_0x26c6ee(0x180)](_0xcc000f=>matchGlobPattern(_0xcc000f[_0x26c6ee(0x116)],_0x50ef6d))),await handleSDKOutput(_0x2e9286,_0x169372),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x169);[a16_0x48275b(0x147)]=a16_0x48275b(0x16b);async[a16_0x48275b(0x187)](_0x2f525c){const _0x27e96d=a16_0x48275b,{options:_0x376a27,args:_0xe723c5,tdx:_0x2d1147}=_0x2f525c;if(_0xe723c5[_0x27e96d(0x137)]===0x0)return console[_0x27e96d(0x131)](_0x27e96d(0x183)),console[_0x27e96d(0x131)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x4c13ba=_0xe723c5[0x0],_0x33a3e0=_0x376a27,_0x49180f=_0x33a3e0[_0x27e96d(0x174)];if(_0x49180f){const _0x20011c=await withSpinner(_0x27e96d(0x121)+_0x4c13ba+'\x27...',()=>_0x2d1147['engage'][_0x27e96d(0x132)](_0x4c13ba),{'verbose':_0x376a27['verbose']});await handleSDKOutput([_0x20011c],_0x376a27);}else{const _0x37478c=await withSpinner('Fetching\x20workspace\x20\x27'+_0x4c13ba+'\x27...',()=>_0x2d1147[_0x27e96d(0x164)][_0x27e96d(0x111)](_0x4c13ba),{'verbose':_0x376a27['verbose']});await handleSDKOutput([_0x37478c],_0x376a27);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x120);['description']=a16_0x48275b(0x15a);async[a16_0x48275b(0x187)](_0x23503f){const _0x8afceb=a16_0x48275b,{options:_0x452436,tdx:_0x4a5368}=_0x23503f,_0x1777df=_0x452436,_0x598dd6=_0x1777df['name'];if(!_0x598dd6)return console[_0x8afceb(0x131)]('Error:\x20--name\x20is\x20required'),console[_0x8afceb(0x131)](_0x8afceb(0x122)),0x1;const _0x55d817={'name':_0x598dd6,'description':_0x1777df[_0x8afceb(0x147)]},_0x30673d=await withSpinner(_0x8afceb(0x15e)+_0x598dd6+_0x8afceb(0x135),()=>_0x4a5368[_0x8afceb(0x164)][_0x8afceb(0x199)](_0x55d817));return await handleSDKOutput([_0x30673d[_0x8afceb(0x125)]],_0x452436),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x165);[a16_0x48275b(0x147)]='Update\x20a\x20workspace';async['execute'](_0x4d6ce9){const _0x568b8b=a16_0x48275b,{options:_0x158a55,args:_0x1ef5eb,tdx:_0x9585e8}=_0x4d6ce9;if(_0x1ef5eb[_0x568b8b(0x137)]===0x0)return console['error'](_0x568b8b(0x183)),console[_0x568b8b(0x131)](_0x568b8b(0x16d)),0x1;const _0x1b875b=_0x1ef5eb[0x0],_0x2110d6=_0x158a55,_0x1dab11={'name':_0x2110d6[_0x568b8b(0x116)],'description':_0x2110d6[_0x568b8b(0x147)]},_0x18b945=Object['fromEntries'](Object['entries'](_0x1dab11)['filter'](([,_0xae1264])=>_0xae1264!==undefined));if(Object['keys'](_0x18b945)['length']===0x0)return console['error'](_0x568b8b(0x11c)),console[_0x568b8b(0x131)](_0x568b8b(0x112)),0x1;const _0x16ef75=await withSpinner(_0x568b8b(0x16c)+_0x1b875b+_0x568b8b(0x135),()=>_0x9585e8['engage'][_0x568b8b(0x11b)](_0x1b875b,_0x18b945),{'verbose':_0x158a55['verbose']});return await handleSDKOutput([_0x16ef75[_0x568b8b(0x125)]],_0x158a55),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x173);[a16_0x48275b(0x147)]=a16_0x48275b(0x13f);async[a16_0x48275b(0x187)](_0x16a2ab){const _0x498cd9=a16_0x48275b,{options:_0x3ae714,args:_0x1176eb,tdx:_0x396272}=_0x16a2ab;if(_0x1176eb[_0x498cd9(0x137)]===0x0)return console[_0x498cd9(0x131)](_0x498cd9(0x183)),console[_0x498cd9(0x131)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x30d12b=_0x1176eb[0x0];if(!_0x3ae714[_0x498cd9(0x146)]){const _0x4bb7a4=await confirm(_0x498cd9(0x11a)+_0x30d12b+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x4bb7a4)return console['log'](_0x498cd9(0x15d)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x30d12b+_0x498cd9(0x135),()=>_0x396272[_0x498cd9(0x164)]['deleteWorkspace'](_0x30d12b),{'verbose':_0x3ae714[_0x498cd9(0x126)]}),console[_0x498cd9(0x151)]('Workspace\x20\x27'+_0x30d12b+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x48275b(0x13d);[a16_0x48275b(0x147)]=a16_0x48275b(0x15b);async['execute'](_0x4f5d69){const _0x14677d=a16_0x48275b,{options:_0x5f91a9,args:_0x2ea0d5,tdx:_0xbf7ef8}=_0x4f5d69;if(_0x2ea0d5['length']===0x0)return console['error'](_0x14677d(0x176)),console[_0x14677d(0x131)](_0x14677d(0x18d)),0x1;const _0x1a5cfe=_0x2ea0d5[0x0];await withSpinner(_0x14677d(0x141)+_0x1a5cfe+_0x14677d(0x135),()=>_0xbf7ef8[_0x14677d(0x164)]['resolveWorkspaceId'](_0x1a5cfe));const _0x5c4c85=_0x5f91a9[_0x14677d(0x140)]||undefined;return saveSessionContext({'engage_workspace':_0x1a5cfe},_0x5c4c85),console[_0x14677d(0x151)]('Engage\x20workspace\x20set\x20to:\x20'+_0x1a5cfe),console[_0x14677d(0x151)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),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;}}
|