@treasuredata/tdx 0.28.2 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a9_0x3cd19d=a9_0x3009;(function(_0x1341e3,_0x59caa7){const _0x26411a=a9_0x3009,_0x2b7d43=_0x1341e3();while(!![]){try{const _0x53fbcf=parseInt(_0x26411a(0x282))/0x1*(parseInt(_0x26411a(0x207))/0x2)+-parseInt(_0x26411a(0x232))/0x3+-parseInt(_0x26411a(0x24a))/0x4*(parseInt(_0x26411a(0x24e))/0x5)+parseInt(_0x26411a(0x240))/0x6+-parseInt(_0x26411a(0x234))/0x7+-parseInt(_0x26411a(0x26e))/0x8+parseInt(_0x26411a(0x242))/0x9*(parseInt(_0x26411a(0x212))/0xa);if(_0x53fbcf===_0x59caa7)break;else _0x2b7d43['push'](_0x2b7d43['shift']());}catch(_0x487a4e){_0x2b7d43['push'](_0x2b7d43['shift']());}}}(a9_0x4af2,0x7131c));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x534010 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';function a9_0x3009(_0xd6bfb9,_0x16df36){_0xd6bfb9=_0xd6bfb9-0x1f4;const _0x4af2c4=a9_0x4af2();let _0x3009e2=_0x4af2c4[_0xd6bfb9];return _0x3009e2;}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_0x3cd19d(0x258),SETTINGS_BACKUP_FILENAME=a9_0x3cd19d(0x27c);function isProcessRunning(_0x20effd){const _0x53f48d=a9_0x3cd19d;try{return process[_0x53f48d(0x1f8)](_0x20effd,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x4298a2,_0x458c4e){const _0x556eef=a9_0x3cd19d;if(!existsSync(_0x4298a2))return;try{const _0x291c9f=await readFile(_0x4298a2,_0x556eef(0x26b)),_0x30bc27=JSON[_0x556eef(0x23a)](_0x291c9f),_0x107d76=_0x30bc27['env']||{};for(const _0x417794 of['ANTHROPIC_BASE_URL',_0x556eef(0x28b),_0x556eef(0x204),_0x556eef(0x218),_0x556eef(0x1fb)]){_0x458c4e[_0x417794]!==undefined?_0x107d76[_0x417794]=_0x458c4e[_0x417794]:delete _0x107d76[_0x417794];}_0x458c4e['statusLine']!==undefined?_0x30bc27[_0x556eef(0x278)]=_0x458c4e[_0x556eef(0x278)]:delete _0x30bc27[_0x556eef(0x278)],_0x30bc27[_0x556eef(0x233)]=_0x107d76,await writeFile(_0x4298a2,JSON[_0x556eef(0x244)](_0x30bc27,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x14912f){try{await unlink(_0x14912f);}catch{}}async function recoverFromStaleBackup(_0x1b1df9,_0x3a4c56){const _0x5ca67b=a9_0x3cd19d;if(!existsSync(_0x3a4c56))return undefined;try{const _0x1c5b3b=await readFile(_0x3a4c56,_0x5ca67b(0x26b)),_0x2caed2=JSON[_0x5ca67b(0x23a)](_0x1c5b3b);if(isProcessRunning(_0x2caed2[_0x5ca67b(0x287)]))return{'liveSessionOriginals':_0x2caed2['originalSettings']};return await applyOriginalSettings(_0x1b1df9,_0x2caed2[_0x5ca67b(0x279)]),await safeUnlink(_0x3a4c56),undefined;}catch{return await safeUnlink(_0x3a4c56),undefined;}}function handleInstallationError(_0x397563,_0x555eb4,_0x4b2330,_0x22b2e8){const _0x2ac160=a9_0x3cd19d;errorContains(_0x397563,_0x2ac160(0x20f),_0x2ac160(0x21e),'already\x20configured')?(_0x4b2330[_0x2ac160(0x265)]='✓\x20'+_0x555eb4+_0x2ac160(0x24b),_0x22b2e8?.['info'](_0x555eb4+'\x20already\x20configured'),_0x397563 instanceof SDKError&&_0x397563[_0x2ac160(0x269)]&&_0x22b2e8?.['debug'](_0x2ac160(0x208)+_0x397563['cause'][_0x2ac160(0x21f)])):(_0x4b2330[_0x2ac160(0x1ff)](_0x2ac160(0x254)+_0x555eb4),_0x22b2e8?.[_0x2ac160(0x241)](_0x555eb4+_0x2ac160(0x202),_0x397563));}export function parseVersion(_0x2022c6){const _0x240726=a9_0x3cd19d,_0x2db7cb=_0x2022c6[_0x240726(0x24d)]()[_0x240726(0x229)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x2db7cb)return null;return{'major':parseInt(_0x2db7cb[0x1],0xa),'minor':parseInt(_0x2db7cb[0x2],0xa),'patch':parseInt(_0x2db7cb[0x3],0xa)};}export function compareVersions(_0xf4e60e,_0x3d25db){const _0x55a3a1=a9_0x3cd19d;if(_0xf4e60e[_0x55a3a1(0x22b)]!==_0x3d25db[_0x55a3a1(0x22b)])return _0xf4e60e[_0x55a3a1(0x22b)]-_0x3d25db[_0x55a3a1(0x22b)];if(_0xf4e60e[_0x55a3a1(0x23b)]!==_0x3d25db[_0x55a3a1(0x23b)])return _0xf4e60e['minor']-_0x3d25db[_0x55a3a1(0x23b)];return _0xf4e60e[_0x55a3a1(0x273)]-_0x3d25db[_0x55a3a1(0x273)];}async function checkClaudeVersion(_0x809d03,_0x405189){const _0x27f5b5=a9_0x3cd19d;_0x405189?.['debug'](_0x27f5b5(0x23e)+_0x809d03+')');const _0x2d8b86=await executeClaudeCommand([_0x27f5b5(0x280)],undefined,_0x405189),_0x470cb6=parseVersion(_0x2d8b86);if(!_0x470cb6){_0x405189?.['warn'](_0x27f5b5(0x250)+_0x2d8b86);return;}const _0x4a8733=_0x470cb6[_0x27f5b5(0x22b)]+'.'+_0x470cb6[_0x27f5b5(0x23b)]+'.'+_0x470cb6['patch'],_0x1aa7e5=parseVersion(_0x809d03);if(!_0x1aa7e5){_0x405189?.[_0x27f5b5(0x1ff)](_0x27f5b5(0x267)+_0x809d03);return;}if(compareVersions(_0x470cb6,_0x1aa7e5)<0x0){_0x405189?.['error']('Claude\x20Code\x20version\x20'+_0x4a8733+_0x27f5b5(0x1fe)+_0x809d03+')');throw new SDKError(ErrorCode[_0x27f5b5(0x220)],_0x27f5b5(0x21d)+_0x4a8733+_0x27f5b5(0x275)+_0x809d03+'\x20or\x20later.',undefined,{'helpText':_0x27f5b5(0x25a)});}_0x405189?.[_0x27f5b5(0x201)](_0x27f5b5(0x21d)+_0x4a8733+_0x27f5b5(0x255));}async function executeClaudeCommand(_0x52e7e3,_0x37340d,_0x12ac2f){const _0x123f1f=a9_0x3cd19d;return _0x12ac2f?.['info'](_0x123f1f(0x22c)+_0x52e7e3['join']('\x20')),new Promise((_0x839eb8,_0x33edea)=>{const _0x225403=_0x123f1f,_0x48167f=crossSpawn(_0x225403(0x27d),_0x52e7e3,{'stdio':'pipe'});let _0x40f477='',_0x30d35c='';_0x48167f['stdout']?.['on'](_0x225403(0x1fd),_0x29e298=>{const _0x59fc2d=_0x225403;_0x40f477+=_0x29e298[_0x59fc2d(0x22e)]();}),_0x48167f['stderr']?.['on'](_0x225403(0x1fd),_0x149ec1=>{const _0x1e3323=_0x225403;_0x30d35c+=_0x149ec1[_0x1e3323(0x22e)]();}),_0x48167f['on'](_0x225403(0x241),_0x1315c6=>{const _0x255133=_0x225403;_0x1315c6[_0x255133(0x25b)]===_0x255133(0x21b)?(_0x12ac2f?.[_0x255133(0x241)](_0x255133(0x239)),_0x33edea(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',_0x1315c6,{'helpText':_0x255133(0x261)}))):(_0x12ac2f?.[_0x255133(0x241)](_0x255133(0x263)+_0x1315c6[_0x255133(0x21f)]),_0x33edea(new SDKError(ErrorCode[_0x255133(0x243)],_0x255133(0x237)+_0x1315c6[_0x255133(0x21f)],_0x1315c6)));}),_0x48167f['on'](_0x225403(0x248),_0x5737d0=>{const _0x752115=_0x225403;if(_0x5737d0===0x0)_0x839eb8(_0x40f477);else _0x37340d?(_0x12ac2f?.[_0x752115(0x241)](_0x752115(0x216)+_0x5737d0+'):\x20claude\x20'+_0x52e7e3['join']('\x20')),_0x33edea(new SDKError(ErrorCode[_0x752115(0x20c)],_0x37340d,new Error(_0x30d35c)))):_0x839eb8('');});});}async function ensureMcpServer(_0x2465fb,_0x127e44,_0x5d0ec8,_0x52f5dc,_0x49cf1a){const _0xf6b692=a9_0x3cd19d;_0x52f5dc[_0xf6b692(0x265)]='Configuring\x20MCP\x20server\x20\x27'+_0x2465fb+_0xf6b692(0x235),await executeClaudeCommand([_0xf6b692(0x276),_0xf6b692(0x23f),_0x2465fb,_0x127e44,'--transport',_0x5d0ec8],_0xf6b692(0x283)+_0x2465fb+'\x27',_0x49cf1a),_0x52f5dc[_0xf6b692(0x265)]='✓\x20MCP\x20server\x20\x27'+_0x2465fb+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x30b706=process.env.TDX_TD_SKILLS_REPO;if(_0x30b706)return _0x30b706;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x4c6bcf,_0x550556){const _0x378662=a9_0x3cd19d;try{const _0x49d132=await executeClaudeCommand([_0x378662(0x226),'marketplace','list'],'Failed\x20to\x20list\x20marketplaces',_0x550556);if(!_0x49d132[_0x378662(0x24c)](_0x4c6bcf)){_0x550556?.['debug'](_0x378662(0x200)+_0x4c6bcf+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand([_0x378662(0x226),_0x378662(0x252),_0x378662(0x215),_0x4c6bcf],_0x378662(0x22f)+_0x4c6bcf+'\x27',_0x550556),_0x550556?.[_0x378662(0x281)](_0x378662(0x200)+_0x4c6bcf+_0x378662(0x230));}catch(_0x28cfb0){_0x550556?.[_0x378662(0x1ff)](_0x378662(0x22f)+_0x4c6bcf+'\x27:\x20'+_0x28cfb0);}}async function restoreDefaultTdSkillsMarketplace(_0xc1be0d){const _0x1d924c=a9_0x3cd19d;try{await removeMarketplace(_0x1d924c(0x21c),_0xc1be0d),await executeClaudeCommand([_0x1d924c(0x226),_0x1d924c(0x252),_0x1d924c(0x23f),DEFAULT_TD_SKILLS_URL],undefined,_0xc1be0d),_0xc1be0d?.['info']('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0xe69955,_0x31005d,_0x1d85ab,_0x2afe67){const _0x15a11f=a9_0x3cd19d;_0x1d85ab['text']=_0x15a11f(0x257)+_0xe69955+_0x15a11f(0x235),await executeClaudeCommand([_0x15a11f(0x226),_0x15a11f(0x252),'add',_0x31005d],_0x15a11f(0x1fa)+_0xe69955+'\x27',_0x2afe67),_0x1d85ab[_0x15a11f(0x265)]=_0x15a11f(0x219)+_0xe69955+_0x15a11f(0x259);}async function updateMarketplace(_0x5e98e5,_0x1509c,_0x747382){const _0x44f600=a9_0x3cd19d;_0x1509c['text']=_0x44f600(0x289)+_0x5e98e5+_0x44f600(0x235),await executeClaudeCommand([_0x44f600(0x226),_0x44f600(0x252),_0x44f600(0x256)],_0x44f600(0x251)+_0x5e98e5+'\x27',_0x747382),_0x1509c[_0x44f600(0x265)]='✓\x20Marketplace\x20\x27'+_0x5e98e5+_0x44f600(0x272);}async function ensurePlugin(_0x22cce6,_0x106d02,_0x1057d5,_0x3dbcd8){const _0x2af252=a9_0x3cd19d;_0x1057d5['text']='Installing\x20plugin\x20\x27'+_0x22cce6+_0x2af252(0x235),await executeClaudeCommand([_0x2af252(0x226),'install',_0x22cce6+'@'+_0x106d02],_0x2af252(0x224)+_0x22cce6+'\x27',_0x3dbcd8),_0x1057d5[_0x2af252(0x265)]='✓\x20Plugin\x20\x27'+_0x22cce6+'\x27\x20installed';}async function createClaudeSettings(_0xc7761,_0x4de795,_0x141a7c){const _0x32586b=a9_0x3cd19d,_0xb8d03b=join(process[_0x32586b(0x25e)](),'.claude'),_0x126ded=join(_0xb8d03b,_0x32586b(0x247)),_0x173c91=join(_0xb8d03b,SETTINGS_BACKUP_FILENAME);await mkdir(_0xb8d03b,{'recursive':!![]});const _0x488065=await recoverFromStaleBackup(_0x126ded,_0x173c91);let _0x4667d0;if(_0x488065)_0x4667d0=_0x488065['liveSessionOriginals'];else{let _0x4692d7={};if(existsSync(_0x126ded))try{const _0x3884ac=await readFile(_0x126ded,'utf-8');_0x4692d7=JSON[_0x32586b(0x23a)](_0x3884ac);}catch{_0x4692d7={};}const _0x27f848=_0x4692d7[_0x32586b(0x233)]||{};_0x4667d0={'ANTHROPIC_BASE_URL':_0x27f848[_0x32586b(0x214)],'ANTHROPIC_MODEL':_0x27f848['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x27f848['ANTHROPIC_AUTH_TOKEN'],'CLAUDE_CODE_USE_BEDROCK':_0x27f848['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x27f848['CLAUDE_CODE_USE_VERTEX'],'statusLine':_0x4692d7[_0x32586b(0x278)]};const _0x22e2b6={'createdAt':new Date()[_0x32586b(0x1f7)](),'pid':process[_0x32586b(0x287)],'originalSettings':_0x4667d0};await writeFile(_0x173c91,JSON['stringify'](_0x22e2b6,null,0x2)+'\x0a');}let _0x199df0={};if(existsSync(_0x126ded))try{const _0x141945=await readFile(_0x126ded,_0x32586b(0x26b));_0x199df0=JSON[_0x32586b(0x23a)](_0x141945);}catch{_0x199df0={};}const _0xbb3f39=_0x199df0[_0x32586b(0x233)]||{},_0x3ae3b1={..._0x199df0,'env':{..._0xbb3f39,'ANTHROPIC_BASE_URL':_0x32586b(0x270)+_0xc7761,..._0x4de795&&{'ANTHROPIC_MODEL':_0x4de795},'ANTHROPIC_AUTH_TOKEN':_0x32586b(0x223),'CLAUDE_CODE_USE_BEDROCK':_0x32586b(0x249),'CLAUDE_CODE_USE_VERTEX':_0x32586b(0x249)},'statusLine':{'type':_0x32586b(0x1f9),'command':_0x141a7c?_0x32586b(0x277)+_0x141a7c+_0x32586b(0x221):_0x32586b(0x217)}};return await writeFile(_0x126ded,JSON[_0x32586b(0x244)](_0x3ae3b1,null,0x2)+'\x0a'),_0x4667d0;}function a9_0x4af2(){const _0x3ff51a=['Failed\x20to\x20configure\x20MCP\x20server\x20\x27','apiKey','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','inherit','pid','log','Updating\x20marketplace\x20\x27','✓\x20Settings\x20restored:\x20.claude/settings.local.json','ANTHROPIC_MODEL','stop','name','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','toISOString','kill','command','Failed\x20to\x20configure\x20marketplace\x20\x27','CLAUDE_CODE_USE_VERTEX','unshift','data','\x20is\x20too\x20old\x20(minimum:\x20','warn','Marketplace\x20\x27','debug','\x20configuration\x20failed','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','ANTHROPIC_AUTH_TOKEN','Creating\x20.claude/settings.local.json...','td-skills\x20Plugins','2XgMefK','Command\x20output:\x20','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','getLogPath','port','INSTALLATION_FAILED','.claude','http','already\x20exists','INVALID_ARGUMENT','verbose','87280CkIWNW','red','ANTHROPIC_BASE_URL','remove','Command\x20failed\x20(exit\x20','tdx\x20claude\x20statusline','CLAUDE_CODE_USE_BEDROCK','✓\x20Marketplace\x20\x27','getCurrent','ENOENT','td-skills','Claude\x20Code\x20version\x20','already\x20installed','message','CLAUDE_CODE_UNSUPPORTED_VERSION','\x20claude\x20statusline','logLevel','tdx-managed-proxy','Failed\x20to\x20install\x20plugin\x20\x27','sql-skills','plugin','Failed\x20to\x20launch\x20Claude\x20Code:\x20','✓\x20Settings\x20configured:\x20.claude/settings.local.json','match','site','major','Executing:\x20claude\x20','close','toString','Failed\x20to\x20remove\x20marketplace\x20\x27','\x27\x20removed','context','2403849WGenQw','env','5614910iESAeb','\x27...','execute','Failed\x20to\x20spawn\x20claude\x20command:\x20','user','Claude\x20Code\x20CLI\x20not\x20found','parse','minor','llm-proxy','proxy','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','add','2353356smjQGF','error','2439uUBZHI','INTERNAL','stringify','fail','green','settings.local.json','exit','false','400044VgXYiy','\x20already\x20configured','includes','trim','30kGmJfP','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','Failed\x20to\x20update\x20marketplace\x20\x27','marketplace','description','Warning:\x20Failed\x20to\x20configure\x20','\x20meets\x20minimum\x20requirement','update','Configuring\x20marketplace\x20\x27','2.0.20','\x27\x20configured','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','code','resume','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','cwd','\x20→\x20','td-docs','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Initializing\x20proxy\x20logger...','Command\x20spawn\x20error:\x20','profile','text','passThroughServer','Invalid\x20minimum\x20version\x20format:\x20','tdx-skills','cause','init','utf-8','workflow-skills','start','1134960GNhUKZ','logger','http://127.0.0.1:','✓\x20Logging\x20to\x20','\x27\x20updated','patch','https://docs.treasuredata.com/mcp','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','mcp','tdx\x20--profile\x20','statusLine','originalSettings','Claude\x20Code\x20version\x20check\x20failed','Setup\x20failed','.tdx-settings-backup.json','claude','Checking\x20Claude\x20Code\x20version...','account_id','--version','info','51479yugvfI'];a9_0x4af2=function(){return _0x3ff51a;};return a9_0x4af2();}async function restoreClaudeSettings(_0x7b3f47){const _0x583957=a9_0x3cd19d,_0x3bd9f1=join(process['cwd'](),_0x583957(0x20d)),_0x264aa1=join(_0x3bd9f1,_0x583957(0x247)),_0x335364=join(_0x3bd9f1,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x264aa1,_0x7b3f47);try{if(existsSync(_0x335364)){const _0x7e3b46=await readFile(_0x335364,_0x583957(0x26b)),_0x5bf222=JSON[_0x583957(0x23a)](_0x7e3b46);_0x5bf222['pid']===process[_0x583957(0x287)]&&await safeUnlink(_0x335364);}}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x3cd19d(0x1f5)]='claude';[a9_0x3cd19d(0x253)]=a9_0x3cd19d(0x25d);[a9_0x3cd19d(0x266)];[a9_0x3cd19d(0x279)];[a9_0x3cd19d(0x26f)];['port'];async[a9_0x3cd19d(0x236)](_0x308307){const _0x3533b3=a9_0x3cd19d,{tdx:_0x22693f,options:_0x54cfd0,args:_0x7914cf}=_0x308307;let _0x7a19b8=![];try{const _0x289cb8=_0x54cfd0,_0x15c0c5=_0x289cb8[_0x3533b3(0x23d)]===![],_0x2cbc0d=_0x289cb8['continue']===!![],_0x17ee6f=_0x289cb8[_0x3533b3(0x25c)]===!![],_0x3e38f9=[..._0x7914cf];if(_0x2cbc0d)_0x3e38f9[_0x3533b3(0x1fc)]('-c');else _0x17ee6f&&_0x3e38f9['unshift']('-r');const _0x487546=createCommandSpinner('Initializing...',{'verbose':_0x54cfd0[_0x3533b3(0x211)]});_0x487546['start']();try{if(!_0x15c0c5){const _0x19d909=_0x54cfd0[_0x3533b3(0x264)];try{const _0x39a188=await _0x22693f[_0x3533b3(0x238)][_0x3533b3(0x21a)]();_0x39a188['account_id']&&writeCachedAccountInfo(_0x54cfd0['site'],_0x39a188[_0x3533b3(0x27f)],_0x19d909);}catch{}_0x487546[_0x3533b3(0x265)]=_0x3533b3(0x262),this[_0x3533b3(0x26f)]=new TDXLogger(_0x54cfd0[_0x3533b3(0x222)],!![]),await this[_0x3533b3(0x26f)][_0x3533b3(0x26a)]();const _0x43ac26=this[_0x3533b3(0x26f)]['getLogPath']();_0x487546[_0x3533b3(0x265)]=_0x3533b3(0x271)+_0x43ac26;const _0x36f5fa=getEndpoint(_0x54cfd0[_0x3533b3(0x22a)],_0x3533b3(0x23c));_0x487546[_0x3533b3(0x265)]=_0x3533b3(0x1f6);if(!_0x22693f[_0x3533b3(0x231)][_0x3533b3(0x284)])throw new SDKError(ErrorCode[_0x3533b3(0x210)],_0x3533b3(0x285));this[_0x3533b3(0x266)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x36f5fa,'apiKey':_0x22693f[_0x3533b3(0x231)]['apiKey'],'logger':this[_0x3533b3(0x26f)],'site':_0x54cfd0['site'],'profile':_0x19d909}),await this['passThroughServer'][_0x3533b3(0x26d)](),this[_0x3533b3(0x20b)]=this['passThroughServer'][_0x3533b3(0x20b)],_0x487546[_0x3533b3(0x265)]=_0x3533b3(0x203)+this[_0x3533b3(0x20b)]+_0x3533b3(0x25f)+_0x36f5fa,_0x487546['text']=_0x3533b3(0x205),this[_0x3533b3(0x279)]=await createClaudeSettings(this[_0x3533b3(0x20b)],undefined,_0x19d909),_0x487546['text']=_0x3533b3(0x228);}else _0x487546['text']=_0x3533b3(0x24f);try{_0x487546[_0x3533b3(0x265)]=_0x3533b3(0x27e),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x3533b3(0x26f)]),_0x487546[_0x3533b3(0x265)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x368ba2){_0x487546[_0x3533b3(0x245)](_0x3533b3(0x27a));throw _0x368ba2;}try{await ensureMcpServer(_0x3533b3(0x260),_0x3533b3(0x274),_0x3533b3(0x20e),_0x487546,this[_0x3533b3(0x26f)]);}catch(_0x36d475){handleInstallationError(_0x36d475,'TD\x20Docs\x20MCP\x20Server',_0x487546,this[_0x3533b3(0x26f)]);}try{const _0x4a5ecb=getTdSkillsRepoUrl();_0x7a19b8=_0x4a5ecb!==DEFAULT_TD_SKILLS_URL,_0x7a19b8&&await removeMarketplace(_0x3533b3(0x21c),this[_0x3533b3(0x26f)]),await ensureMarketplace('td-skills',_0x4a5ecb,_0x487546,this['logger']),await updateMarketplace('td-skills',_0x487546,this[_0x3533b3(0x26f)]),await ensurePlugin(_0x3533b3(0x225),_0x3533b3(0x21c),_0x487546,this[_0x3533b3(0x26f)]),await ensurePlugin(_0x3533b3(0x26c),_0x3533b3(0x21c),_0x487546,this[_0x3533b3(0x26f)]),await ensurePlugin(_0x3533b3(0x268),'td-skills',_0x487546,this['logger']);}catch(_0x2f9aef){handleInstallationError(_0x2f9aef,_0x3533b3(0x206),_0x487546,this[_0x3533b3(0x26f)]);}_0x487546[_0x3533b3(0x1f4)]();}catch(_0x34fbd0){_0x487546[_0x3533b3(0x245)](_0x3533b3(0x27b));throw _0x34fbd0;}const _0x17a7d4=await findExecutable(_0x3533b3(0x27d));if(!_0x17a7d4)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x384aff={...process.env};!_0x15c0c5&&(_0x384aff['ANTHROPIC_BASE_URL']=_0x3533b3(0x270)+this[_0x3533b3(0x20b)],_0x384aff[_0x3533b3(0x204)]='tdx-managed-proxy',_0x384aff[_0x3533b3(0x218)]=_0x3533b3(0x249),_0x384aff['CLAUDE_CODE_USE_VERTEX']=_0x3533b3(0x249));const _0xfcd3cc=crossSpawn(_0x17a7d4,_0x3e38f9,{'stdio':_0x3533b3(0x286),'env':_0x384aff}),_0x32f5f5=await new Promise(_0x21f193=>{const _0x15c370=_0x3533b3;_0xfcd3cc['on'](_0x15c370(0x248),_0x319393=>{_0x21f193(_0x319393||0x0);}),_0xfcd3cc['on'](_0x15c370(0x241),_0x25151f=>{const _0x41bc76=_0x15c370;console[_0x41bc76(0x241)](a9_0x534010[_0x41bc76(0x213)](_0x41bc76(0x227)+_0x25151f[_0x41bc76(0x21f)])),_0x21f193(0x1);});});_0x7a19b8&&await restoreDefaultTdSkillsMarketplace(this[_0x3533b3(0x26f)]);this['passThroughServer']&&(await this[_0x3533b3(0x266)][_0x3533b3(0x1f4)](),console[_0x3533b3(0x288)](a9_0x534010[_0x3533b3(0x246)](_0x3533b3(0x209))));if(this['logger']){await this['logger'][_0x3533b3(0x22d)]();const _0x30cb1a=this[_0x3533b3(0x26f)][_0x3533b3(0x20a)]();console[_0x3533b3(0x288)](a9_0x534010[_0x3533b3(0x246)]('✓\x20Logs\x20saved\x20to\x20'+_0x30cb1a));}return this['originalSettings']&&(await restoreClaudeSettings(this['originalSettings']),console[_0x3533b3(0x288)](a9_0x534010[_0x3533b3(0x246)](_0x3533b3(0x28a)))),_0x32f5f5;}catch(_0xae031d){_0x7a19b8&&await restoreDefaultTdSkillsMarketplace(this[_0x3533b3(0x26f)]);this[_0x3533b3(0x266)]&&await this[_0x3533b3(0x266)][_0x3533b3(0x1f4)]();this[_0x3533b3(0x26f)]&&await this[_0x3533b3(0x26f)]['close']();this[_0x3533b3(0x279)]&&await restoreClaudeSettings(this[_0x3533b3(0x279)]);throw _0xae031d;}}}
|
|
1
|
+
const a9_0x543bb9=a9_0xb97c;(function(_0x2d4012,_0x8ba31b){const _0x3b27f5=a9_0xb97c,_0xe107ca=_0x2d4012();while(!![]){try{const _0x262b1e=-parseInt(_0x3b27f5(0x1ae))/0x1+parseInt(_0x3b27f5(0x194))/0x2+parseInt(_0x3b27f5(0x16c))/0x3+parseInt(_0x3b27f5(0x1a8))/0x4+parseInt(_0x3b27f5(0x1a1))/0x5+-parseInt(_0x3b27f5(0x1df))/0x6*(parseInt(_0x3b27f5(0x1d0))/0x7)+parseInt(_0x3b27f5(0x173))/0x8*(-parseInt(_0x3b27f5(0x1ec))/0x9);if(_0x262b1e===_0x8ba31b)break;else _0xe107ca['push'](_0xe107ca['shift']());}catch(_0x4536fb){_0xe107ca['push'](_0xe107ca['shift']());}}}(a9_0x3423,0x6c59c));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x4b3907 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{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_0x543bb9(0x1a6),SETTINGS_BACKUP_FILENAME=a9_0x543bb9(0x1cf);function isProcessRunning(_0x552d90){try{return process['kill'](_0x552d90,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x42067e,_0x59e9e3){const _0x2f5443=a9_0x543bb9;if(!existsSync(_0x42067e))return;try{const _0x714c18=await readFile(_0x42067e,_0x2f5443(0x18a)),_0x338fb6=JSON[_0x2f5443(0x19b)](_0x714c18),_0x3fea0a=_0x338fb6[_0x2f5443(0x1af)]||{};for(const _0x18b79b of[_0x2f5443(0x193),_0x2f5443(0x1c1),_0x2f5443(0x19c),'CLAUDE_CODE_USE_BEDROCK',_0x2f5443(0x1c4)]){_0x59e9e3[_0x18b79b]!==undefined?_0x3fea0a[_0x18b79b]=_0x59e9e3[_0x18b79b]:delete _0x3fea0a[_0x18b79b];}_0x59e9e3[_0x2f5443(0x1c3)]!==undefined?_0x338fb6[_0x2f5443(0x1c3)]=_0x59e9e3[_0x2f5443(0x1c3)]:delete _0x338fb6['statusLine'],_0x338fb6['env']=_0x3fea0a,await writeFile(_0x42067e,JSON['stringify'](_0x338fb6,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x445794){try{await unlink(_0x445794);}catch{}}async function recoverFromStaleBackup(_0x3ce9bc,_0xe30d49){const _0xc03718=a9_0x543bb9;if(!existsSync(_0xe30d49))return undefined;try{const _0x3ea3a0=await readFile(_0xe30d49,_0xc03718(0x18a)),_0x3b95e1=JSON[_0xc03718(0x19b)](_0x3ea3a0);if(isProcessRunning(_0x3b95e1[_0xc03718(0x1dd)]))return{'liveSessionOriginals':_0x3b95e1[_0xc03718(0x1be)]};return await applyOriginalSettings(_0x3ce9bc,_0x3b95e1[_0xc03718(0x1be)]),await safeUnlink(_0xe30d49),undefined;}catch{return await safeUnlink(_0xe30d49),undefined;}}function handleInstallationError(_0x413edb,_0x456420,_0x38868e,_0x256c5f){const _0x548630=a9_0x543bb9;errorContains(_0x413edb,_0x548630(0x1f7),'already\x20installed','already\x20configured')?(_0x38868e[_0x548630(0x19e)]='✓\x20'+_0x456420+_0x548630(0x16e),_0x256c5f?.[_0x548630(0x1d8)](_0x456420+_0x548630(0x16e)),_0x413edb instanceof SDKError&&_0x413edb[_0x548630(0x1c8)]&&_0x256c5f?.[_0x548630(0x178)](_0x548630(0x1f6)+_0x413edb[_0x548630(0x1c8)][_0x548630(0x1bc)])):(_0x38868e[_0x548630(0x180)](_0x548630(0x188)+_0x456420),_0x256c5f?.[_0x548630(0x1f3)](_0x456420+_0x548630(0x1bf),_0x413edb));}export function parseVersion(_0x5532d7){const _0x10c3ef=a9_0x543bb9,_0x28f437=_0x5532d7[_0x10c3ef(0x1e2)]()[_0x10c3ef(0x1c0)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x28f437)return null;return{'major':parseInt(_0x28f437[0x1],0xa),'minor':parseInt(_0x28f437[0x2],0xa),'patch':parseInt(_0x28f437[0x3],0xa)};}function a9_0x3423(){const _0xc8ac9d=['Installing\x20plugin\x20\x27','TD\x20Docs\x20MCP\x20Server','\x27\x20removed','inherit','pid','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','258ByOyox','td-skills','Initializing...','trim','CLAUDE_CODE_NOT_FOUND','resume','context','Command\x20spawn\x20error:\x20','marketplace','stringify','green','\x20meets\x20minimum\x20requirement','major','1413GwxMRh','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','log','Checking\x20Claude\x20Code\x20version...','\x20claude\x20statusline','✓\x20Logs\x20saved\x20to\x20','close','error','account_id','Configuring\x20marketplace\x20\x27','Command\x20output:\x20','already\x20exists','Failed\x20to\x20configure\x20marketplace\x20\x27','toString','✓\x20Marketplace\x20\x27','unshift','proxy','settings.local.json','Failed\x20to\x20list\x20marketplaces','td-docs','Invalid\x20minimum\x20version\x20format:\x20','Command\x20failed\x20(exit\x20','2185347HSbtqy','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','\x20already\x20configured','Setup\x20failed','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','passThroughServer','Failed\x20to\x20update\x20marketplace\x20\x27','76168ApKkWZ','tdx-managed-proxy','\x27:\x20','Executing:\x20claude\x20','minor','debug','add','continue','Failed\x20to\x20install\x20plugin\x20\x27','Claude\x20Code\x20version\x20','.claude','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','https://docs.treasuredata.com/mcp','warn','CLAUDE_CODE_USE_BEDROCK','includes','Claude\x20Code\x20version\x20check\x20failed','apiKey','\x20→\x20','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','):\x20claude\x20','Warning:\x20Failed\x20to\x20configure\x20','--version','utf-8','false','Failed\x20to\x20launch\x20Claude\x20Code:\x20','fail','cwd','tdx-skills','execute','Initializing\x20proxy\x20logger...','exit','ANTHROPIC_BASE_URL','1055710ALFcPh','toISOString','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','✓\x20MCP\x20server\x20\x27','claude','\x27...','td-skills\x20Plugins','parse','ANTHROPIC_AUTH_TOKEN','\x20is\x20too\x20old\x20(minimum:\x20','text','getLogPath','patch','1303345bZZAIs','data','http://127.0.0.1:','https://github.com/treasure-data/td-skills','http','2.0.20','logger','1882908hCrBaE','Claude\x20Code\x20CLI\x20not\x20found','ENOENT','site','profile','remove','33834OgkFzC','env','port','INTERNAL','sql-skills','\x27\x20updated','stop','✓\x20Settings\x20restored:\x20.claude/settings.local.json','stdout','verbose','INSTALLATION_FAILED','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Configuring\x20MCP\x20server\x20\x27','plugin','message','pipe','originalSettings','\x20configuration\x20failed','match','ANTHROPIC_MODEL','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','statusLine','CLAUDE_CODE_USE_VERTEX','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','name','Restored\x20default\x20td-skills\x20marketplace','cause','start','✓\x20Logging\x20to\x20','\x27\x20configured','join','--transport','red','.tdx-settings-backup.json','2485ZaTbXn','Failed\x20to\x20remove\x20marketplace\x20\x27','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','mcp','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','getCurrent','llm-proxy','user','info'];a9_0x3423=function(){return _0xc8ac9d;};return a9_0x3423();}export function compareVersions(_0x33eac7,_0x32ba5a){const _0x511836=a9_0x543bb9;if(_0x33eac7[_0x511836(0x1eb)]!==_0x32ba5a[_0x511836(0x1eb)])return _0x33eac7[_0x511836(0x1eb)]-_0x32ba5a['major'];if(_0x33eac7[_0x511836(0x177)]!==_0x32ba5a[_0x511836(0x177)])return _0x33eac7['minor']-_0x32ba5a[_0x511836(0x177)];return _0x33eac7[_0x511836(0x1a0)]-_0x32ba5a[_0x511836(0x1a0)];}async function checkClaudeVersion(_0x5134b5,_0x517554){const _0x3023d9=a9_0x543bb9;_0x517554?.[_0x3023d9(0x178)](_0x3023d9(0x196)+_0x5134b5+')');const _0x133ae6=await executeClaudeCommand([_0x3023d9(0x189)],undefined,_0x517554),_0x5dde6e=parseVersion(_0x133ae6);if(!_0x5dde6e){_0x517554?.[_0x3023d9(0x180)](_0x3023d9(0x1c5)+_0x133ae6);return;}const _0x34d31d=_0x5dde6e[_0x3023d9(0x1eb)]+'.'+_0x5dde6e[_0x3023d9(0x177)]+'.'+_0x5dde6e['patch'],_0x57dc9a=parseVersion(_0x5134b5);if(!_0x57dc9a){_0x517554?.[_0x3023d9(0x180)](_0x3023d9(0x16a)+_0x5134b5);return;}if(compareVersions(_0x5dde6e,_0x57dc9a)<0x0){_0x517554?.[_0x3023d9(0x1f3)](_0x3023d9(0x17c)+_0x34d31d+_0x3023d9(0x19d)+_0x5134b5+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],'Claude\x20Code\x20version\x20'+_0x34d31d+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x5134b5+'\x20or\x20later.',undefined,{'helpText':_0x3023d9(0x16d)});}_0x517554?.[_0x3023d9(0x178)](_0x3023d9(0x17c)+_0x34d31d+_0x3023d9(0x1ea));}async function executeClaudeCommand(_0x2b21b0,_0x1c9af3,_0xb5a9d1){const _0x23ab62=a9_0x543bb9;return _0xb5a9d1?.[_0x23ab62(0x1d8)](_0x23ab62(0x176)+_0x2b21b0[_0x23ab62(0x1cc)]('\x20')),new Promise((_0x214302,_0x3fcdc4)=>{const _0x4495ee=_0x23ab62,_0x3b0760=crossSpawn(_0x4495ee(0x198),_0x2b21b0,{'stdio':_0x4495ee(0x1bd)});let _0x5f5a98='',_0x47f001='';_0x3b0760[_0x4495ee(0x1b6)]?.['on'](_0x4495ee(0x1a2),_0x2591b4=>{const _0x2cca1f=_0x4495ee;_0x5f5a98+=_0x2591b4[_0x2cca1f(0x1f9)]();}),_0x3b0760['stderr']?.['on'](_0x4495ee(0x1a2),_0xd4ac2a=>{const _0x55b1a3=_0x4495ee;_0x47f001+=_0xd4ac2a[_0x55b1a3(0x1f9)]();}),_0x3b0760['on'](_0x4495ee(0x1f3),_0x4f8191=>{const _0x5081f5=_0x4495ee;_0x4f8191['code']===_0x5081f5(0x1aa)?(_0xb5a9d1?.[_0x5081f5(0x1f3)](_0x5081f5(0x1a9)),_0x3fcdc4(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x5081f5(0x1a9),_0x4f8191,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0xb5a9d1?.['error'](_0x5081f5(0x1e6)+_0x4f8191['message']),_0x3fcdc4(new SDKError(ErrorCode[_0x5081f5(0x1b1)],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x4f8191[_0x5081f5(0x1bc)],_0x4f8191)));}),_0x3b0760['on'](_0x4495ee(0x192),_0x57a626=>{const _0x4687b4=_0x4495ee;if(_0x57a626===0x0)_0x214302(_0x5f5a98);else _0x1c9af3?(_0xb5a9d1?.[_0x4687b4(0x1f3)](_0x4687b4(0x16b)+_0x57a626+_0x4687b4(0x187)+_0x2b21b0[_0x4687b4(0x1cc)]('\x20')),_0x3fcdc4(new SDKError(ErrorCode[_0x4687b4(0x1b8)],_0x1c9af3,new Error(_0x47f001)))):_0x214302('');});});}async function ensureMcpServer(_0x443f80,_0x27ad6c,_0x2e42ec,_0x57511e,_0x11fe70){const _0x4f2569=a9_0x543bb9;_0x57511e['text']=_0x4f2569(0x1ba)+_0x443f80+_0x4f2569(0x199),await executeClaudeCommand([_0x4f2569(0x1d3),_0x4f2569(0x179),_0x443f80,_0x27ad6c,_0x4f2569(0x1cd),_0x2e42ec],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x443f80+'\x27',_0x11fe70),_0x57511e[_0x4f2569(0x19e)]=_0x4f2569(0x197)+_0x443f80+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL=a9_0x543bb9(0x1a4);export function getTdSkillsRepoUrl(){const _0x9c3d50=process.env.TDX_TD_SKILLS_REPO;if(_0x9c3d50)return _0x9c3d50;return DEFAULT_TD_SKILLS_URL;}function a9_0xb97c(_0x22f780,_0x7edd04){_0x22f780=_0x22f780-0x168;const _0x3423fe=a9_0x3423();let _0xb97c41=_0x3423fe[_0x22f780];return _0xb97c41;}async function removeMarketplace(_0x60d5b,_0x5d7991){const _0x4e6c8a=a9_0x543bb9;try{const _0x2300b4=await executeClaudeCommand(['plugin',_0x4e6c8a(0x1e7),'list'],_0x4e6c8a(0x168),_0x5d7991);if(!_0x2300b4[_0x4e6c8a(0x182)](_0x60d5b)){_0x5d7991?.[_0x4e6c8a(0x178)]('Marketplace\x20\x27'+_0x60d5b+_0x4e6c8a(0x1ed));return;}await executeClaudeCommand([_0x4e6c8a(0x1bb),_0x4e6c8a(0x1e7),_0x4e6c8a(0x1ad),_0x60d5b],_0x4e6c8a(0x1d1)+_0x60d5b+'\x27',_0x5d7991),_0x5d7991?.['info']('Marketplace\x20\x27'+_0x60d5b+_0x4e6c8a(0x1db));}catch(_0x9d3d92){_0x5d7991?.[_0x4e6c8a(0x180)](_0x4e6c8a(0x1d1)+_0x60d5b+_0x4e6c8a(0x175)+_0x9d3d92);}}async function restoreDefaultTdSkillsMarketplace(_0x5170aa){const _0x48848e=a9_0x543bb9;try{await removeMarketplace('td-skills',_0x5170aa),await executeClaudeCommand([_0x48848e(0x1bb),_0x48848e(0x1e7),_0x48848e(0x179),DEFAULT_TD_SKILLS_URL],undefined,_0x5170aa),_0x5170aa?.[_0x48848e(0x1d8)](_0x48848e(0x1c7));}catch{}}async function ensureMarketplace(_0x587e20,_0x3bc3e4,_0x5aa66b,_0x7caca5){const _0x9636fd=a9_0x543bb9;_0x5aa66b['text']=_0x9636fd(0x1f5)+_0x587e20+_0x9636fd(0x199),await executeClaudeCommand([_0x9636fd(0x1bb),_0x9636fd(0x1e7),_0x9636fd(0x179),_0x3bc3e4],_0x9636fd(0x1f8)+_0x587e20+'\x27',_0x7caca5),_0x5aa66b[_0x9636fd(0x19e)]=_0x9636fd(0x1fa)+_0x587e20+_0x9636fd(0x1cb);}async function updateMarketplace(_0x2cb542,_0x46daf1,_0x1b9463){const _0x4a4634=a9_0x543bb9;_0x46daf1[_0x4a4634(0x19e)]='Updating\x20marketplace\x20\x27'+_0x2cb542+_0x4a4634(0x199),await executeClaudeCommand([_0x4a4634(0x1bb),_0x4a4634(0x1e7),'update'],_0x4a4634(0x172)+_0x2cb542+'\x27',_0x1b9463),_0x46daf1[_0x4a4634(0x19e)]=_0x4a4634(0x1fa)+_0x2cb542+_0x4a4634(0x1b3);}async function ensurePlugin(_0x40eed0,_0x122868,_0x5de541,_0x344521){const _0x47d45b=a9_0x543bb9;_0x5de541[_0x47d45b(0x19e)]=_0x47d45b(0x1d9)+_0x40eed0+'\x27...',await executeClaudeCommand([_0x47d45b(0x1bb),'install',_0x40eed0+'@'+_0x122868],_0x47d45b(0x17b)+_0x40eed0+'\x27',_0x344521),_0x5de541[_0x47d45b(0x19e)]='✓\x20Plugin\x20\x27'+_0x40eed0+'\x27\x20installed';}async function createClaudeSettings(_0x23f42c,_0x5a943e,_0x3f4aa9){const _0x1c3ad1=a9_0x543bb9,_0x1bc2f5=join(process[_0x1c3ad1(0x18e)](),_0x1c3ad1(0x17d)),_0x132676=join(_0x1bc2f5,_0x1c3ad1(0x1fd)),_0x568940=join(_0x1bc2f5,SETTINGS_BACKUP_FILENAME);await mkdir(_0x1bc2f5,{'recursive':!![]});const _0x14b4f0=await recoverFromStaleBackup(_0x132676,_0x568940);let _0x55a656;if(_0x14b4f0)_0x55a656=_0x14b4f0['liveSessionOriginals'];else{let _0x9e6e4f={};if(existsSync(_0x132676))try{const _0xd7700c=await readFile(_0x132676,'utf-8');_0x9e6e4f=JSON[_0x1c3ad1(0x19b)](_0xd7700c);}catch{_0x9e6e4f={};}const _0x55a0f7=_0x9e6e4f[_0x1c3ad1(0x1af)]||{};_0x55a656={'ANTHROPIC_BASE_URL':_0x55a0f7['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x55a0f7['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x55a0f7[_0x1c3ad1(0x19c)],'CLAUDE_CODE_USE_BEDROCK':_0x55a0f7['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x55a0f7[_0x1c3ad1(0x1c4)],'statusLine':_0x9e6e4f['statusLine']};const _0x5012bb={'createdAt':new Date()[_0x1c3ad1(0x195)](),'pid':process[_0x1c3ad1(0x1dd)],'originalSettings':_0x55a656};await writeFile(_0x568940,JSON[_0x1c3ad1(0x1e8)](_0x5012bb,null,0x2)+'\x0a');}let _0x30dbb6={};if(existsSync(_0x132676))try{const _0x24e5e5=await readFile(_0x132676,'utf-8');_0x30dbb6=JSON[_0x1c3ad1(0x19b)](_0x24e5e5);}catch{_0x30dbb6={};}const _0xccf4e0=_0x30dbb6[_0x1c3ad1(0x1af)]||{},_0x26077b={..._0x30dbb6,'env':{..._0xccf4e0,'ANTHROPIC_BASE_URL':_0x1c3ad1(0x1a3)+_0x23f42c,..._0x5a943e&&{'ANTHROPIC_MODEL':_0x5a943e},'ANTHROPIC_AUTH_TOKEN':_0x1c3ad1(0x174),'CLAUDE_CODE_USE_BEDROCK':_0x1c3ad1(0x18b),'CLAUDE_CODE_USE_VERTEX':_0x1c3ad1(0x18b)},'statusLine':{'type':'command','command':_0x3f4aa9?'tdx\x20--profile\x20'+_0x3f4aa9+_0x1c3ad1(0x1f0):'tdx\x20claude\x20statusline'}};return await writeFile(_0x132676,JSON['stringify'](_0x26077b,null,0x2)+'\x0a'),_0x55a656;}async function restoreClaudeSettings(_0x943005){const _0x5d2e93=a9_0x543bb9,_0x3da738=join(process[_0x5d2e93(0x18e)](),_0x5d2e93(0x17d)),_0x3ec673=join(_0x3da738,_0x5d2e93(0x1fd)),_0x31b1cf=join(_0x3da738,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x3ec673,_0x943005);try{if(existsSync(_0x31b1cf)){const _0x6b91e5=await readFile(_0x31b1cf,_0x5d2e93(0x18a)),_0x645701=JSON[_0x5d2e93(0x19b)](_0x6b91e5);_0x645701['pid']===process[_0x5d2e93(0x1dd)]&&await safeUnlink(_0x31b1cf);}}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x543bb9(0x1c6)]='claude';['description']=a9_0x543bb9(0x170);[a9_0x543bb9(0x171)];[a9_0x543bb9(0x1be)];[a9_0x543bb9(0x1a7)];[a9_0x543bb9(0x1b0)];async[a9_0x543bb9(0x190)](_0x5880d4){const _0x392bf2=a9_0x543bb9,{tdx:_0x2c2298,options:_0x3cc5f5,args:_0x2b6e9b}=_0x5880d4;let _0x1f4ed6=![];try{const _0x405a2c=_0x3cc5f5,_0x3c6142=_0x405a2c[_0x392bf2(0x1fc)]===![],_0x65ae61=_0x405a2c[_0x392bf2(0x17a)]===!![],_0x51ff46=_0x405a2c[_0x392bf2(0x1e4)]===!![],_0x7e43d6=[..._0x2b6e9b];if(_0x65ae61)_0x7e43d6['unshift']('-c');else _0x51ff46&&_0x7e43d6[_0x392bf2(0x1fb)]('-r');const _0x1db3a3=createCommandSpinner(_0x392bf2(0x1e1),{'verbose':_0x3cc5f5[_0x392bf2(0x1b7)]});_0x1db3a3['start']();try{if(!_0x3c6142){const _0x1b955d=_0x3cc5f5[_0x392bf2(0x1ac)];try{const _0x25dc19=await _0x2c2298[_0x392bf2(0x1d7)][_0x392bf2(0x1d5)]();_0x25dc19[_0x392bf2(0x1f4)]&&writeCachedAccountInfo(_0x3cc5f5[_0x392bf2(0x1ab)],_0x25dc19[_0x392bf2(0x1f4)],_0x1b955d);}catch{}_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x191),this[_0x392bf2(0x1a7)]=new TDXLogger(_0x3cc5f5['logLevel'],!![]),await this[_0x392bf2(0x1a7)]['init']();const _0x799016=this[_0x392bf2(0x1a7)][_0x392bf2(0x19f)]();_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x1ca)+_0x799016;const _0x3e7fb3=getEndpoint(_0x3cc5f5[_0x392bf2(0x1ab)],_0x392bf2(0x1d6));_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x186);if(!_0x2c2298[_0x392bf2(0x1e5)][_0x392bf2(0x184)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x392bf2(0x1de));this['passThroughServer']=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x3e7fb3,'apiKey':_0x2c2298[_0x392bf2(0x1e5)][_0x392bf2(0x184)],'logger':this[_0x392bf2(0x1a7)],'site':_0x3cc5f5[_0x392bf2(0x1ab)],'profile':_0x1b955d}),await this[_0x392bf2(0x171)][_0x392bf2(0x1c9)](),this[_0x392bf2(0x1b0)]=this[_0x392bf2(0x171)][_0x392bf2(0x1b0)],_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x1c2)+this[_0x392bf2(0x1b0)]+_0x392bf2(0x185)+_0x3e7fb3,_0x1db3a3['text']='Creating\x20.claude/settings.local.json...',this['originalSettings']=await createClaudeSettings(this[_0x392bf2(0x1b0)],undefined,_0x1b955d),_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x1b9);}else _0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x17e);try{_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x1ef),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x1db3a3[_0x392bf2(0x19e)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x4ba35c){_0x1db3a3['fail'](_0x392bf2(0x183));throw _0x4ba35c;}try{await ensureMcpServer(_0x392bf2(0x169),_0x392bf2(0x17f),_0x392bf2(0x1a5),_0x1db3a3,this[_0x392bf2(0x1a7)]);}catch(_0x2e8fce){handleInstallationError(_0x2e8fce,_0x392bf2(0x1da),_0x1db3a3,this[_0x392bf2(0x1a7)]);}try{const _0xa946aa=getTdSkillsRepoUrl();_0x1f4ed6=_0xa946aa!==DEFAULT_TD_SKILLS_URL,_0x1f4ed6&&await removeMarketplace(_0x392bf2(0x1e0),this[_0x392bf2(0x1a7)]),await ensureMarketplace(_0x392bf2(0x1e0),_0xa946aa,_0x1db3a3,this['logger']),await updateMarketplace('td-skills',_0x1db3a3,this['logger']),await ensurePlugin(_0x392bf2(0x1b2),_0x392bf2(0x1e0),_0x1db3a3,this[_0x392bf2(0x1a7)]),await ensurePlugin('workflow-skills','td-skills',_0x1db3a3,this[_0x392bf2(0x1a7)]),await ensurePlugin(_0x392bf2(0x18f),'td-skills',_0x1db3a3,this['logger']);}catch(_0x302db6){handleInstallationError(_0x302db6,_0x392bf2(0x19a),_0x1db3a3,this[_0x392bf2(0x1a7)]);}_0x1db3a3[_0x392bf2(0x1b4)]();}catch(_0x2a7839){_0x1db3a3[_0x392bf2(0x18d)](_0x392bf2(0x16f));throw _0x2a7839;}const _0x12eea8=await findExecutable(_0x392bf2(0x198));if(!_0x12eea8)throw new SDKError(ErrorCode[_0x392bf2(0x1e3)],_0x392bf2(0x1a9),undefined,{'helpText':_0x392bf2(0x1d4)});const _0x110b65={...process.env};!_0x3c6142&&(_0x110b65[_0x392bf2(0x193)]='http://127.0.0.1:'+this[_0x392bf2(0x1b0)],_0x110b65[_0x392bf2(0x19c)]=_0x392bf2(0x174),_0x110b65[_0x392bf2(0x181)]=_0x392bf2(0x18b),_0x110b65[_0x392bf2(0x1c4)]=_0x392bf2(0x18b));const _0x24efda=crossSpawn(_0x12eea8,_0x7e43d6,{'stdio':_0x392bf2(0x1dc),'env':_0x110b65}),_0x2cfb09=await new Promise(_0x4eef7a=>{const _0x18007a=_0x392bf2;_0x24efda['on']('exit',_0x5134e1=>{_0x4eef7a(_0x5134e1||0x0);}),_0x24efda['on'](_0x18007a(0x1f3),_0x8c2f3b=>{const _0x51e6f2=_0x18007a;console['error'](a9_0x4b3907[_0x51e6f2(0x1ce)](_0x51e6f2(0x18c)+_0x8c2f3b[_0x51e6f2(0x1bc)])),_0x4eef7a(0x1);});});_0x1f4ed6&&await restoreDefaultTdSkillsMarketplace(this[_0x392bf2(0x1a7)]);this[_0x392bf2(0x171)]&&(await this[_0x392bf2(0x171)]['stop'](),console[_0x392bf2(0x1ee)](a9_0x4b3907['green'](_0x392bf2(0x1d2))));if(this[_0x392bf2(0x1a7)]){await this[_0x392bf2(0x1a7)][_0x392bf2(0x1f2)]();const _0x4a64c5=this[_0x392bf2(0x1a7)]['getLogPath']();console[_0x392bf2(0x1ee)](a9_0x4b3907[_0x392bf2(0x1e9)](_0x392bf2(0x1f1)+_0x4a64c5));}return this[_0x392bf2(0x1be)]&&(await restoreClaudeSettings(this[_0x392bf2(0x1be)]),console[_0x392bf2(0x1ee)](a9_0x4b3907[_0x392bf2(0x1e9)](_0x392bf2(0x1b5)))),_0x2cfb09;}catch(_0x3d9b83){_0x1f4ed6&&await restoreDefaultTdSkillsMarketplace(this[_0x392bf2(0x1a7)]);this[_0x392bf2(0x171)]&&await this[_0x392bf2(0x171)][_0x392bf2(0x1b4)]();this[_0x392bf2(0x1a7)]&&await this['logger'][_0x392bf2(0x1f2)]();this[_0x392bf2(0x1be)]&&await restoreClaudeSettings(this[_0x392bf2(0x1be)]);throw _0x3d9b83;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a10_0x25d638=a10_0x140a;(function(_0x2c5e4a,_0x2110d6){const _0x552178=a10_0x140a,_0xf8ef86=_0x2c5e4a();while(!![]){try{const _0x585414=-parseInt(_0x552178(0x153))/0x1+-parseInt(_0x552178(0x16f))/0x2+-parseInt(_0x552178(0x168))/0x3*(-parseInt(_0x552178(0x15d))/0x4)+-parseInt(_0x552178(0x166))/0x5*(-parseInt(_0x552178(0x179))/0x6)+-parseInt(_0x552178(0x158))/0x7+-parseInt(_0x552178(0x174))/0x8+-parseInt(_0x552178(0x161))/0x9*(-parseInt(_0x552178(0x163))/0xa);if(_0x585414===_0x2110d6)break;else _0xf8ef86['push'](_0xf8ef86['shift']());}catch(_0x1f1665){_0xf8ef86['push'](_0xf8ef86['shift']());}}}(a10_0x7ddc,0xda400));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a10_0x7ddc(){const _0xaadddd=['todayCredits','9892449gctDmz','accountId','🧠\x20','monthCredits','stdin','1456236igvDUV','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','current_usage','toFixed','189SindqJ','\x20-\x20','1654110oWjwcf','profile','execute','6202985qdnGST','💎\x20tdx\x20-\x20Claude','3ByvjiQ','statusline','log','\x20|\x20','tdx\x20','used_percentage','tdx','264310tLMHyz','context_window','💎\x20','🪙\x20credit:\x20','cache_creation_input_tokens','7378568dZbxxV','round','input_tokens','close','push','6bxavPy','\x20session\x20/\x20','sessionCredits','name','1716652dqpdRE','cache_read_input_tokens','site','join'];a10_0x7ddc=function(){return _0xaadddd;};return a10_0x7ddc();}import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0xa5965b=0x64){return new Promise(_0x54ba6c=>{const _0x543e02=a10_0x140a;let _0x3f6cb4='',_0x587d31=![];const _0xda5c8b=createInterface({'input':process[_0x543e02(0x15c)],'terminal':![]}),_0x1706db=_0x4c2e76=>{const _0x22f83e=_0x543e02;if(_0x587d31)return;_0x587d31=!![],clearTimeout(_0x57305f),_0xda5c8b[_0x22f83e(0x177)](),_0x54ba6c(_0x4c2e76);},_0x57305f=setTimeout(()=>{_0x1706db(null);},_0xa5965b);_0xda5c8b['on']('line',_0x559ea9=>{_0x3f6cb4+=_0x559ea9;}),_0xda5c8b['on'](_0x543e02(0x177),()=>{if(_0x587d31)return;try{const _0x503dc9=JSON['parse'](_0x3f6cb4);_0x1706db(_0x503dc9);}catch{_0x1706db(null);}});});}function a10_0x140a(_0x4aadfc,_0x8926a8){_0x4aadfc=_0x4aadfc-0x151;const _0x7ddce8=a10_0x7ddc();let _0x140a36=_0x7ddce8[_0x4aadfc];return _0x140a36;}function formatCredits(_0x44f82a){const _0x41a270=a10_0x140a;return _0x44f82a[_0x41a270(0x160)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x25d638(0x152)]=a10_0x25d638(0x169);['description']=a10_0x25d638(0x15e);async[a10_0x25d638(0x165)](_0x148d00){const _0x1eb18c=a10_0x25d638;try{const _0x13a616=await readStdinJson();if(!_0x13a616?.['session_id'])return console[_0x1eb18c(0x16a)](_0x1eb18c(0x167)),0x0;const _0x409c12=_0x13a616['session_id'],_0x4c8c7d=_0x13a616['model']?.['id']||'',_0xb081f5=_0x13a616[_0x1eb18c(0x164)]||_0x148d00['options']['profile'],_0x218405=await getUsageStats(_0x409c12,_0xb081f5),_0xe5be47=[],_0x577614=readCachedAccountInfo(_0xb081f5),_0xc1209f=_0x577614?_0x1eb18c(0x16c)+_0x577614[_0x1eb18c(0x155)]+':'+_0x577614[_0x1eb18c(0x159)]:_0x1eb18c(0x16e),_0x47867a=_0x4c8c7d?getModelDisplayName(_0x4c8c7d):'Claude';_0xe5be47[_0x1eb18c(0x178)](_0x1eb18c(0x171)+_0xc1209f+_0x1eb18c(0x162)+_0x47867a);const _0x37784f=formatCredits(_0x218405[_0x1eb18c(0x151)]),_0x174f04=formatCredits(_0x218405[_0x1eb18c(0x157)]),_0x1f6a1e=formatCredits(_0x218405[_0x1eb18c(0x15b)]);_0xe5be47[_0x1eb18c(0x178)](_0x1eb18c(0x172)+_0x37784f+_0x1eb18c(0x17a)+_0x174f04+'\x20today\x20/\x20'+_0x1f6a1e+'\x20month');const _0x411d7c=_0x13a616[_0x1eb18c(0x170)],_0x413e83=_0x411d7c?.[_0x1eb18c(0x15f)];if(_0x413e83&&_0x411d7c?.[_0x1eb18c(0x16d)]!=null){const _0x3a7716=_0x413e83[_0x1eb18c(0x176)]+_0x413e83[_0x1eb18c(0x173)]+_0x413e83[_0x1eb18c(0x154)],_0x448f30=formatTokenCount(_0x3a7716),_0x46fd2e=Math[_0x1eb18c(0x175)](_0x411d7c[_0x1eb18c(0x16d)]);_0xe5be47[_0x1eb18c(0x178)](_0x1eb18c(0x15a)+_0x448f30+'\x20('+_0x46fd2e+'%)');}return console['log'](_0xe5be47[_0x1eb18c(0x156)](_0x1eb18c(0x16b))),0x0;}catch{return console[_0x1eb18c(0x16a)](_0x1eb18c(0x167)),0x0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a11_0x5eda(_0x59d8d4,_0x278844){_0x59d8d4=_0x59d8d4-0xe1;const _0x4e2700=a11_0x4e27();let _0x5edaca=_0x4e2700[_0x59d8d4];return _0x5edaca;}const a11_0x13d905=a11_0x5eda;(function(_0x1b4622,_0x574760){const _0x32a252=a11_0x5eda,_0x25a9fe=_0x1b4622();while(!![]){try{const _0x3633f5=-parseInt(_0x32a252(0xfb))/0x1+-parseInt(_0x32a252(0x103))/0x2*(parseInt(_0x32a252(0x11c))/0x3)+parseInt(_0x32a252(0x100))/0x4*(parseInt(_0x32a252(0xe3))/0x5)+parseInt(_0x32a252(0x122))/0x6+parseInt(_0x32a252(0x101))/0x7+parseInt(_0x32a252(0x116))/0x8*(-parseInt(_0x32a252(0x107))/0x9)+parseInt(_0x32a252(0x106))/0xa;if(_0x3633f5===_0x574760)break;else _0x25a9fe['push'](_0x25a9fe['shift']());}catch(_0x5b5e80){_0x25a9fe['push'](_0x25a9fe['shift']());}}}(a11_0x4e27,0x411d6));import a11_0x2a2879 from'chalk';function a11_0x4e27(){const _0x1daa5c=['map','44dgFEzf','1292865hjzOGc','\x20\x20Today:\x20\x20\x20','2474vTMsAl','padEnd','lastUsedAt','8569670GyikLI','18kOqSSI','entryCount','dim','all','profile','toFixed','max','red','totalCredits','\x20credits','repeat','cyan','json','default','Source','1987528ZDHciI','2-digit','short','Usage\x20by\x20Profile','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','en-US','879PVdDSa','jsonl','Total','Profile','\x20days\x20ago','en-CA','142152HoZBrn','toLocaleDateString','source','(default)','140945gHWoVc','usage','profileCount','round','padStart','Today','credits','Month','monthCredits','today\x20','todayCredits','bold','Error:\x20','message','Last\x20Used','getTime','length','log','format','Unknown\x20error','outputStructured','yesterday','outputTable','\x20\x20Total:\x20\x20\x20','249400LXviex','numeric','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','Requests'];a11_0x4e27=function(){return _0x1daa5c;};return a11_0x4e27();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x57b4c1){const _0x702390=a11_0x5eda;return _0x57b4c1[_0x702390(0x10c)](0x2);}function formatLastUsed(_0x3237f4){const _0x5846cf=a11_0x5eda;if(!_0x3237f4)return'never';const _0x5756b3=new Date(_0x3237f4),_0x120a55=new Date(),_0x44c121=_0x5756b3[_0x5846cf(0x123)](_0x5846cf(0x121)),_0x800243=_0x120a55[_0x5846cf(0x123)](_0x5846cf(0x121));if(_0x44c121===_0x800243)return _0x5846cf(0xec)+_0x5756b3['toLocaleTimeString'](_0x5846cf(0x11b),{'hour':_0x5846cf(0x117),'minute':_0x5846cf(0x117)});const _0x4723c6=new Date(_0x44c121),_0x2ed8d3=new Date(_0x800243),_0x5b7da6=Math[_0x5846cf(0xe6)]((_0x2ed8d3[_0x5846cf(0xf2)]()-_0x4723c6[_0x5846cf(0xf2)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5b7da6===0x1)return _0x5846cf(0xf8);else return _0x5b7da6>0x1&&_0x5b7da6<0x7?_0x5b7da6+_0x5846cf(0x120):_0x5756b3[_0x5846cf(0x123)](_0x5846cf(0x11b),{'month':_0x5846cf(0x118),'day':_0x5846cf(0xfc)});}export class ClaudeUsageCommand extends BaseCommand{['name']=a11_0x13d905(0xe4);['description']='Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile';async['execute'](_0x3b1fc6){const _0x4ab365=a11_0x13d905,{options:_0x4da3ff}=_0x3b1fc6,_0x41e231=_0x4da3ff['format']==='json'||_0x4da3ff[_0x4ab365(0xf5)]===_0x4ab365(0x11d)||_0x4da3ff[_0x4ab365(0x113)];try{const [_0x445b7b,_0xc7881a,_0x4f1de8]=await Promise[_0x4ab365(0x10a)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x41e231?await this[_0x4ab365(0xf7)](_0x445b7b,_0xc7881a,_0x4f1de8,_0x4da3ff):this[_0x4ab365(0xf9)](_0x445b7b,_0xc7881a,_0x4f1de8),0x0;}catch(_0x2a40ac){const _0x553109=_0x2a40ac instanceof Error?_0x2a40ac[_0x4ab365(0xf0)]:_0x4ab365(0xf6);return console['error'](a11_0x2a2879[_0x4ab365(0x10e)](_0x4ab365(0xef)+_0x553109)),0x1;}}async[a11_0x13d905(0xf7)](_0x2abf6c,_0x5f12b5,_0x3407e9,_0x1e1f95){const _0x44923d=a11_0x13d905,_0x23d58d={'summary':{'todayCredits':_0x3407e9[_0x44923d(0xed)],'monthCredits':_0x3407e9[_0x44923d(0xeb)],'totalCredits':_0x3407e9[_0x44923d(0x10f)],'profileCount':_0x3407e9[_0x44923d(0xe5)]},'profiles':_0x2abf6c['map'](_0x27cbc7=>({'profile':_0x27cbc7[_0x44923d(0x10b)],'credits':_0x27cbc7['credits'],'requests':_0x27cbc7[_0x44923d(0x108)],'lastUsedAt':_0x27cbc7[_0x44923d(0x105)]})),'sources':_0x5f12b5[_0x44923d(0xff)](_0x133842=>({'source':_0x133842['source'],'credits':_0x133842['credits'],'todayCredits':_0x133842[_0x44923d(0xed)],'monthCredits':_0x133842['monthCredits'],'requests':_0x133842[_0x44923d(0x108)]}))};await handleSDKOutput([_0x23d58d],_0x1e1f95);}[a11_0x13d905(0xf9)](_0x15f572,_0x8264a1,_0x11cae5){const _0x49b50f=a11_0x13d905;console[_0x49b50f(0xf4)](a11_0x2a2879['bold'](_0x49b50f(0x11a))),console['log'](a11_0x2a2879[_0x49b50f(0x109)]('─'[_0x49b50f(0x111)](0x32))),console[_0x49b50f(0xf4)](_0x49b50f(0x102)+a11_0x2a2879[_0x49b50f(0x112)](formatCredits(_0x11cae5[_0x49b50f(0xed)]))+_0x49b50f(0x110)),console[_0x49b50f(0xf4)]('\x20\x20Month:\x20\x20\x20'+a11_0x2a2879[_0x49b50f(0x112)](formatCredits(_0x11cae5['monthCredits']))+_0x49b50f(0x110)),console[_0x49b50f(0xf4)](_0x49b50f(0xfa)+a11_0x2a2879[_0x49b50f(0x112)](formatCredits(_0x11cae5['totalCredits']))+_0x49b50f(0x110)),console['log']();if(_0x8264a1['length']>0x0){console[_0x49b50f(0xf4)](a11_0x2a2879[_0x49b50f(0xee)]('Usage\x20by\x20Source')),console[_0x49b50f(0xf4)](a11_0x2a2879[_0x49b50f(0x109)]('─'[_0x49b50f(0x111)](0x3c)));const _0x50529f=0xc,_0x3398bd=0xa,_0xadddd7=0xa,_0xdaaf2=0xa;console[_0x49b50f(0xf4)]('\x20\x20'+_0x49b50f(0x115)['padEnd'](_0x50529f)+'\x20\x20'+_0x49b50f(0x11e)[_0x49b50f(0xe7)](_0x3398bd)+'\x20\x20'+_0x49b50f(0xe8)[_0x49b50f(0xe7)](_0xadddd7)+'\x20\x20'+_0x49b50f(0xea)['padStart'](_0xdaaf2));for(const _0x5096ed of _0x8264a1){console[_0x49b50f(0xf4)]('\x20\x20'+_0x5096ed[_0x49b50f(0xe1)][_0x49b50f(0x104)](_0x50529f)+'\x20\x20'+a11_0x2a2879['cyan'](formatCredits(_0x5096ed['credits'])[_0x49b50f(0xe7)](_0x3398bd))+'\x20\x20'+formatCredits(_0x5096ed[_0x49b50f(0xed)])[_0x49b50f(0xe7)](_0xadddd7)+'\x20\x20'+formatCredits(_0x5096ed[_0x49b50f(0xeb)])[_0x49b50f(0xe7)](_0xdaaf2));}console['log']();}if(_0x15f572['length']===0x0){console['log'](a11_0x2a2879['dim']('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x49b50f(0xf4)](a11_0x2a2879['dim'](_0x49b50f(0xfd)));return;}console[_0x49b50f(0xf4)](a11_0x2a2879[_0x49b50f(0xee)](_0x49b50f(0x119))),console[_0x49b50f(0xf4)](a11_0x2a2879[_0x49b50f(0x109)]('─'[_0x49b50f(0x111)](0x3c)));const _0x261058=Math[_0x49b50f(0x10d)](0xc,..._0x15f572['map'](_0x486752=>_0x486752[_0x49b50f(0x10b)]==='default'?_0x49b50f(0xe2)['length']:_0x486752['profile'][_0x49b50f(0xf3)])),_0x1241a1=0xa,_0x191c41=0xa;console[_0x49b50f(0xf4)]('\x20\x20'+_0x49b50f(0x11f)[_0x49b50f(0x104)](_0x261058)+'\x20\x20'+'Credits'[_0x49b50f(0xe7)](_0x1241a1)+'\x20\x20'+_0x49b50f(0xfe)['padStart'](_0x191c41)+'\x20\x20'+_0x49b50f(0xf1));for(const _0x3bd3e1 of _0x15f572){const _0x408d08=_0x3bd3e1[_0x49b50f(0x10b)]===_0x49b50f(0x114)?_0x49b50f(0xe2):_0x3bd3e1[_0x49b50f(0x10b)],_0x3fcb46=_0x408d08[_0x49b50f(0x104)](_0x261058),_0x31674f=_0x3bd3e1[_0x49b50f(0x10b)]===_0x49b50f(0x114)?a11_0x2a2879[_0x49b50f(0x109)](_0x3fcb46):_0x3fcb46;console[_0x49b50f(0xf4)]('\x20\x20'+_0x31674f+'\x20\x20'+a11_0x2a2879[_0x49b50f(0x112)](formatCredits(_0x3bd3e1[_0x49b50f(0xe9)])[_0x49b50f(0xe7)](_0x1241a1))+'\x20\x20'+String(_0x3bd3e1[_0x49b50f(0x108)])[_0x49b50f(0xe7)](_0x191c41)+'\x20\x20'+a11_0x2a2879[_0x49b50f(0x109)](formatLastUsed(_0x3bd3e1['lastUsedAt'])));}console[_0x49b50f(0xf4)](),console['log'](a11_0x2a2879[_0x49b50f(0x109)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x49b50f(0xf4)]();}}
|
package/dist/commands/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x3da54a=a12_0x2ea1;(function(_0x57dda6,_0x568194){const _0x34d085=a12_0x2ea1,_0x3e75f3=_0x57dda6();while(!![]){try{const _0x404c99=parseInt(_0x34d085(0xa9))/0x1+-parseInt(_0x34d085(0x99))/0x2*(parseInt(_0x34d085(0xaa))/0x3)+-parseInt(_0x34d085(0xb6))/0x4*(parseInt(_0x34d085(0xaf))/0x5)+parseInt(_0x34d085(0x9f))/0x6+parseInt(_0x34d085(0xac))/0x7*(parseInt(_0x34d085(0xab))/0x8)+parseInt(_0x34d085(0xa5))/0x9*(-parseInt(_0x34d085(0x9d))/0xa)+parseInt(_0x34d085(0xa7))/0xb*(parseInt(_0x34d085(0x9b))/0xc);if(_0x404c99===_0x568194)break;else _0x3e75f3['push'](_0x3e75f3['shift']());}catch(_0x254fda){_0x3e75f3['push'](_0x3e75f3['shift']());}}}(a12_0x9564,0x554bf));function a12_0x9564(){const _0x527096=['.\x20Must\x20be\x20a\x20number.','dim','debug','limit','options','Error:\x20','\x20--profile\x20','message','isValid','validateGlobalOptions','get','red','error','5386vtIcqs','To\x20check\x20your\x20current\x20auth\x20status:','144kHOwDl','detail','15830KITnwf','yellow','1437588prwYrL','execute','cyan','status','helpText','profile','1899yyWpCD','stack','425205KgAJzn','Authentication\x20error\x20stack\x20trace:','58666nBogWD','33HKcaiR','24IXUOJv','1220639GdlvFM','name','from','10JuqzRr','\x27\x20is\x20already\x20registered','Authentication\x20failed','problemDetails','values','test','has','1144488yaldxo','command','commands','USER_ERROR'];a12_0x9564=function(){return _0x527096;};return a12_0x9564();}import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a12_0x17c15c from'chalk';function a12_0x2ea1(_0x5e3dc4,_0xbf1a6c){_0x5e3dc4=_0x5e3dc4-0x93;const _0x95640a=a12_0x9564();let _0x2ea144=_0x95640a[_0x5e3dc4];return _0x2ea144;}export function printAuthError(_0x2ba273,_0x15c166=![],_0x178581){const _0x1980c8=a12_0x2ea1,_0x326447=_0x2ba273[_0x1980c8(0xb2)]?.[_0x1980c8(0x9c)]||_0x2ba273['message'];console['error'](a12_0x17c15c['red'](_0x1980c8(0xb1))),console['error'](a12_0x17c15c['red']('Reason:\x20'+_0x326447));if(_0x15c166){const _0x8315c3=_0x178581?_0x1980c8(0xc0)+_0x178581:'';console[_0x1980c8(0x98)]('\x0a'+a12_0x17c15c['dim']('To\x20set\x20up\x20authentication:')),console[_0x1980c8(0x98)]('\x20\x20'+a12_0x17c15c[_0x1980c8(0xa1)]('tdx\x20auth\x20setup'+_0x8315c3)+'\x0a'),console[_0x1980c8(0x98)](''+a12_0x17c15c[_0x1980c8(0xbb)](_0x1980c8(0x9a))),console['error']('\x20\x20'+a12_0x17c15c[_0x1980c8(0xa1)]('tdx\x20auth'+_0x8315c3));}}export class BaseCommand{['validateGlobalOptions'](_0x35d0de){const _0x262d55=a12_0x2ea1,{options:_0x45e43a}=_0x35d0de,_0x5883e5=_0x45e43a[_0x262d55(0xbd)];if(_0x5883e5!==undefined){const _0x487286=typeof _0x5883e5==='number'?_0x5883e5:parseInt(_0x5883e5,0xa);if(isNaN(_0x487286))return'Invalid\x20limit\x20value:\x20'+_0x5883e5+_0x262d55(0xba);const _0x4ddb2f=validateLimitOption(_0x487286);if(!_0x4ddb2f[_0x262d55(0x94)])return _0x4ddb2f['error'];_0x35d0de[_0x262d55(0xbe)][_0x262d55(0xbd)]=_0x4ddb2f['value'];}return undefined;}['validate'](_0x46b3da){return undefined;}async['run'](_0x4f916a){const _0x1f3e6b=a12_0x2ea1;try{const _0x55999d=this[_0x1f3e6b(0x95)](_0x4f916a);if(_0x55999d)return console[_0x1f3e6b(0x98)](_0x1f3e6b(0xbf)+_0x55999d),0x1;const _0x453d2a=this['validate'](_0x4f916a);if(_0x453d2a){const _0x1dfbea=/^\s*(Usage|Note|Warning|Error):/i[_0x1f3e6b(0xb4)](_0x453d2a);return _0x1dfbea?console['error'](_0x453d2a):console['error']('Error:\x20'+_0x453d2a),0x1;}const _0x546851=await this[_0x1f3e6b(0xa0)](_0x4f916a);return _0x546851??0x0;}catch(_0x394610){if(_0x394610 instanceof Error){if(_0x394610 instanceof HTTPClientError&&_0x394610[_0x1f3e6b(0xa2)]===0x191){const _0x4803e2=_0x4f916a[_0x1f3e6b(0xbe)][_0x1f3e6b(0xa4)];printAuthError(_0x394610,!![],_0x4803e2);if(_0x394610[_0x1f3e6b(0xa6)]){const _0x13e85d=Logger['of'](_0x1f3e6b(0xb7));_0x13e85d[_0x1f3e6b(0xbc)](_0x1f3e6b(0xa8)),_0x13e85d['debug'](_0x394610[_0x1f3e6b(0xa6)]);}return 0x1;}console[_0x1f3e6b(0x98)](a12_0x17c15c[_0x1f3e6b(0x97)](_0x1f3e6b(0xbf)+_0x394610[_0x1f3e6b(0x93)]));_0x394610 instanceof SDKError&&_0x394610['helpText']&&console[_0x1f3e6b(0x98)](a12_0x17c15c[_0x1f3e6b(0x9e)](_0x394610[_0x1f3e6b(0xa3)]));const _0x1f9e66=_0x394610 instanceof SDKError&&_0x394610['category']===ErrorCategory[_0x1f3e6b(0xb9)];_0x394610[_0x1f3e6b(0xa6)]&&!_0x1f9e66&&console[_0x1f3e6b(0x98)]('\x0aStack\x20trace:\x0a'+_0x394610[_0x1f3e6b(0xa6)]);}else console[_0x1f3e6b(0x98)](_0x1f3e6b(0xbf)+String(_0x394610));return 0x1;}}}export class CommandRegistry{[a12_0x3da54a(0xb8)]=new Map();['register'](_0x2b7cb7){const _0x4f1177=a12_0x3da54a;if(this[_0x4f1177(0xb8)][_0x4f1177(0xb5)](_0x2b7cb7[_0x4f1177(0xad)]))throw new Error('Command\x20\x27'+_0x2b7cb7['name']+_0x4f1177(0xb0));this[_0x4f1177(0xb8)]['set'](_0x2b7cb7[_0x4f1177(0xad)],_0x2b7cb7);}[a12_0x3da54a(0x96)](_0x2e6929){const _0xc25aaa=a12_0x3da54a;return this['commands'][_0xc25aaa(0x96)](_0x2e6929);}['getAll'](){const _0x546cc5=a12_0x3da54a;return Array[_0x546cc5(0xae)](this[_0x546cc5(0xb8)][_0x546cc5(0xb3)]());}[a12_0x3da54a(0xb5)](_0x2e67f0){const _0x3a86a8=a12_0x3da54a;return this[_0x3a86a8(0xb8)][_0x3a86a8(0xb5)](_0x2e67f0);}}export const registry=new CommandRegistry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a13_0x253026=a13_0x5288;(function(_0x505bf1,_0x123d12){const _0x5cce28=a13_0x5288,_0x4be890=_0x505bf1();while(!![]){try{const _0x44aa7b=-parseInt(_0x5cce28(0xe6))/0x1+parseInt(_0x5cce28(0x125))/0x2*(parseInt(_0x5cce28(0x10b))/0x3)+parseInt(_0x5cce28(0xd0))/0x4*(-parseInt(_0x5cce28(0xec))/0x5)+parseInt(_0x5cce28(0x132))/0x6*(parseInt(_0x5cce28(0x11f))/0x7)+parseInt(_0x5cce28(0xc2))/0x8*(-parseInt(_0x5cce28(0xe3))/0x9)+parseInt(_0x5cce28(0x123))/0xa+parseInt(_0x5cce28(0xc4))/0xb*(parseInt(_0x5cce28(0x114))/0xc);if(_0x44aa7b===_0x123d12)break;else _0x4be890['push'](_0x4be890['shift']());}catch(_0x79bee8){_0x4be890['push'](_0x4be890['shift']());}}}(a13_0x4a4c,0x8b71f));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a13_0x4a4c(){const _0x1c7192=['222147rjYyMh','connection','entries','919035sSEsaR','✔\x20Found\x20schema\x20for\x20connection\x20\x27','Default:\x20','Show\x20when:\x20','Name:\x20','execute','790VnMGiq','cyan','stringify','Show\x20connection\x20details','map','\x0aAvailable\x20fields:','criteria','✔\x20Found\x20connection:\x20','yellow','record','title','hidden','legacy_settings','\x20connection','green','properties','\x0aConnector:\x20','listTypes','find','connection:schema','connection:types','length','credential','\x27\x20(type:\x20','No\x20available\x20fields\x20for\x20this\x20connector','slice','default_value','\x20connector\x20type','site','\x0aNo\x20fields\x20defined\x20in\x20schema','dim','3fIdVoM','\x0aConnection:\x20','Range:\x20','options','data','enumeration','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','maximum','name','17092740OjImSB','>=\x20','blue','value','Options:\x20','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','max','log','owner','\x20\x20\x20\x20Default:\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','2975WxMqcF','filter','Fetching\x20schema\x20for\x20\x27','\x20[record]','3853510BgIEnG','padStart','1514678PQpLbs','repeat','Fetching\x20connection\x20\x27','minimum','List\x20available\x20connector\x20types','list','\x27\x20as\x20connector\x20type','error','Resolving\x20connector\x20type\x20or\x20name:\x20','✔\x20Found\x20','<=\x20','connection:show','type','960QAoRXe','184GdUqRW','settings','11dSjgZg','bold','✔\x20Resolved\x20\x27','legacy','connection:list','\x20-\x20','Listing\x20connections...','join','Listing\x20connector\x20types...','verbose','input','description','14612pIbBnf','localeCompare','\x20\x20\x20\x20Options:\x20','findByName','hint','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','Site:\x20','\x27...','validate','Fetching\x20settings\x20for\x20\x27','push','Treating\x20\x27','connection:settings','\x20\x20\x20\x20','object','getOutputSchema','Looking\x20up\x20connection:\x20','\x0aNo\x20credential\x20settings\x20defined','table'];a13_0x4a4c=function(){return _0x1c7192;};return a13_0x4a4c();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x3f4d5e from'chalk';function a13_0x5288(_0xca1124,_0x569561){_0xca1124=_0xca1124-0xc2;const _0x4a4c82=a13_0x4a4c();let _0x5288e4=_0x4a4c82[_0xca1124];return _0x5288e4;}function normalizeSchemaForDisplay(_0x423900){const _0x1d6ab5=a13_0x5288,_0x19a846=_0x423900[_0x1d6ab5(0xfb)]||[],_0x257607=_0x19a846[_0x1d6ab5(0xfe)](_0x54c895=>_0x54c895[_0x1d6ab5(0x113)]==='legacy_settings'&&_0x54c895[_0x1d6ab5(0x131)]===_0x1d6ab5(0xf5)&&_0x54c895[_0x1d6ab5(0xfb)]);if(_0x257607?.['properties']){const _0x206cf1=_0x19a846[_0x1d6ab5(0x120)](_0x24b685=>_0x24b685[_0x1d6ab5(0x113)]!==_0x1d6ab5(0xc7)&&_0x24b685[_0x1d6ab5(0x113)]!==_0x1d6ab5(0xf8));return[..._0x206cf1,..._0x257607[_0x1d6ab5(0xfb)]];}return _0x19a846[_0x1d6ab5(0x120)](_0x4e2a0c=>_0x4e2a0c[_0x1d6ab5(0x113)]!==_0x1d6ab5(0xc7));}function printSchemaFields(_0x53c5fc,_0x42e925){const _0xc1f393=a13_0x5288,_0x3dce47='\x20\x20'[_0xc1f393(0x126)](_0x42e925+0x1),_0x47d7cf='\x20\x20'[_0xc1f393(0x126)](_0x42e925+0x2);for(const _0x46948c of _0x53c5fc){if(!_0x46948c[_0xc1f393(0x113)])continue;const _0x476458=_0x46948c[_0xc1f393(0x131)]===_0xc1f393(0xf5)&&_0x46948c['properties']&&_0x46948c['properties'][_0xc1f393(0x101)]>0x0&&_0x46948c[_0xc1f393(0x113)]!==_0xc1f393(0xf8);let _0x33fbbb=''+_0x3dce47+a13_0x3f4d5e['green'](_0x46948c['name']);_0x46948c[_0xc1f393(0xf6)]&&(_0x33fbbb+=':\x20'+_0x46948c[_0xc1f393(0xf6)]);if(_0x46948c[_0xc1f393(0xce)])_0x33fbbb+=a13_0x3f4d5e[_0xc1f393(0x10a)]('\x20['+_0x46948c['input']+']');else _0x476458&&(_0x33fbbb+=a13_0x3f4d5e['dim'](_0xc1f393(0x122)));console['log'](_0x33fbbb);_0x46948c[_0xc1f393(0xcf)]&&console['log'](''+_0x47d7cf+a13_0x3f4d5e[_0xc1f393(0x10a)](_0x46948c['description']));if(_0x46948c[_0xc1f393(0x110)]){const _0x322a0d=_0x46948c['enumeration'][_0xc1f393(0xf0)](_0x12c3bb=>typeof _0x12c3bb===_0xc1f393(0xde)&&_0xc1f393(0x117)in _0x12c3bb?_0x12c3bb['value']:_0x12c3bb)[_0xc1f393(0xcb)](',\x20');console['log'](_0x47d7cf+_0xc1f393(0x118)+a13_0x3f4d5e['yellow'](_0x322a0d));}_0x46948c[_0xc1f393(0x106)]!==undefined&&console['log'](_0x47d7cf+_0xc1f393(0xe8)+a13_0x3f4d5e['blue'](String(_0x46948c[_0xc1f393(0x106)])));if(_0x46948c['minimum']!==undefined||_0x46948c['maximum']!==undefined){const _0x36e37d=_0x46948c[_0xc1f393(0x128)]!==undefined&&_0x46948c['maximum']!==undefined?_0x46948c['minimum']+'\x20-\x20'+_0x46948c[_0xc1f393(0x112)]:_0x46948c[_0xc1f393(0x128)]!==undefined?_0xc1f393(0x115)+_0x46948c[_0xc1f393(0x128)]:_0xc1f393(0x12f)+_0x46948c[_0xc1f393(0x112)];console['log'](_0x47d7cf+_0xc1f393(0x10d)+a13_0x3f4d5e[_0xc1f393(0x116)](_0x36e37d));}if(_0x46948c[_0xc1f393(0xf2)]){const _0x36feee=Object[_0xc1f393(0xe5)](_0x46948c[_0xc1f393(0xf2)])[_0xc1f393(0xf0)](([_0x2642d9,_0x147b58])=>_0x2642d9+'='+JSON[_0xc1f393(0xee)](_0x147b58))['join'](',\x20');console[_0xc1f393(0x11b)](''+_0x47d7cf+a13_0x3f4d5e[_0xc1f393(0x10a)](_0xc1f393(0xe9)+_0x36feee));}_0x476458&&_0x46948c[_0xc1f393(0xfb)]&&printSchemaFields(_0x46948c[_0xc1f393(0xfb)],_0x42e925+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x253026(0x113)]=a13_0x253026(0xc8);[a13_0x253026(0xcf)]='List\x20all\x20result\x20output\x20connections';async['execute'](_0x14a201){const _0x2a1456=a13_0x253026,{options:_0x28f6d3,tdx:_0x43c4ea}=_0x14a201;_0x28f6d3[_0x2a1456(0xcd)]&&console[_0x2a1456(0x12c)](_0x2a1456(0xd6)+_0x28f6d3['site']);const _0x55486d=resolveLimit(_0x28f6d3['limit'],DEFAULT_LISTING_LIMIT),_0x3f636b=await withSpinner(_0x2a1456(0xca),()=>_0x43c4ea[_0x2a1456(0xe4)][_0x2a1456(0x12a)](),{'verbose':_0x28f6d3[_0x2a1456(0xcd)]}),_0x619579=_0x3f636b[_0x2a1456(0x10f)];console['error'](_0x2a1456(0x12e)+_0x619579[_0x2a1456(0x101)]+_0x2a1456(0xf9)+(_0x619579[_0x2a1456(0x101)]!==0x1?'s':''));if(isStructuredFormat(_0x28f6d3)){const _0x19ae21=_0x619579[_0x2a1456(0x105)](0x0,_0x55486d);await handleSDKOutput(_0x19ae21,{..._0x28f6d3,'limit':_0x55486d});}else{const _0x9e50e3=_0x619579[_0x2a1456(0x101)]>0x0?Math[_0x2a1456(0x11a)](..._0x619579[_0x2a1456(0xf0)](_0x419514=>_0x419514[_0x2a1456(0x131)][_0x2a1456(0x101)])):0x0,_0x4d3e8a=[];for(const _0x33b101 of _0x619579){const _0x4c6e76=a13_0x3f4d5e['cyan'](_0x33b101[_0x2a1456(0x131)][_0x2a1456(0x124)](_0x9e50e3)),_0x2a8fe5=_0x33b101[_0x2a1456(0x11c)]?.[_0x2a1456(0x113)]?_0x2a1456(0xc9)+a13_0x3f4d5e[_0x2a1456(0x10a)](_0x33b101[_0x2a1456(0x11c)][_0x2a1456(0x113)]):'';_0x4d3e8a[_0x2a1456(0xda)](_0x4c6e76+'\x20\x20'+_0x33b101[_0x2a1456(0x113)]+_0x2a8fe5);}await writeOutput(_0x4d3e8a[_0x2a1456(0xcb)]('\x0a'),_0x28f6d3['output'],_0x2a1456(0xe2));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x253026(0x113)]=a13_0x253026(0x130);[a13_0x253026(0xcf)]=a13_0x253026(0xef);[a13_0x253026(0xd8)](_0x498325){const _0x3e995c=a13_0x253026,{args:_0x350544}=_0x498325;if(!_0x350544[0x0])return _0x3e995c(0x11e);return undefined;}async[a13_0x253026(0xeb)](_0x55087c){const _0x3e89bb=a13_0x253026,{options:_0x32d0de,args:_0x1a837b,tdx:_0x3dabca}=_0x55087c,_0x4d276d=_0x1a837b[0x0];_0x32d0de[_0x3e89bb(0xcd)]&&(console[_0x3e89bb(0x12c)]('Site:\x20'+_0x32d0de[_0x3e89bb(0x108)]),console['error'](_0x3e89bb(0xe0)+_0x4d276d));const _0x55fd01=await withSpinner(_0x3e89bb(0x127)+_0x4d276d+_0x3e89bb(0xd7),()=>_0x3dabca['connection']['resolve'](_0x4d276d),{'verbose':_0x32d0de[_0x3e89bb(0xcd)]}),_0x412450=_0x55fd01[_0x3e89bb(0x10f)];return console[_0x3e89bb(0x12c)](_0x3e89bb(0xf3)+_0x412450['name']),await handleSingleObjectOutput(_0x412450,_0x32d0de),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x253026(0x113)]=a13_0x253026(0xff);[a13_0x253026(0xcf)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';[a13_0x253026(0xd8)](_0x534ccc){const {args:_0x345f44}=_0x534ccc;if(!_0x345f44[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['execute'](_0x42fd4f){const _0x514c68=a13_0x253026,{options:_0xe59ab4,args:_0x5be3fb,tdx:_0x5d5b3c}=_0x42fd4f,_0x5ae5df=_0x5be3fb[0x0];_0xe59ab4[_0x514c68(0xcd)]&&(console[_0x514c68(0x12c)](_0x514c68(0xd6)+_0xe59ab4[_0x514c68(0x108)]),console[_0x514c68(0x12c)](_0x514c68(0x12d)+_0x5ae5df));let _0x59435b=_0x5ae5df,_0xe29e44;try{const _0x16a2cf=await _0x5d5b3c['connection'][_0x514c68(0xd3)](_0x5ae5df);_0x16a2cf&&(_0x59435b=_0x16a2cf[_0x514c68(0x131)],_0xe29e44=_0x16a2cf[_0x514c68(0x113)],_0xe59ab4[_0x514c68(0xcd)]&&console[_0x514c68(0x12c)](_0x514c68(0xc6)+_0x5ae5df+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x59435b));}catch{_0xe59ab4[_0x514c68(0xcd)]&&console[_0x514c68(0x12c)](_0x514c68(0xdb)+_0x5ae5df+_0x514c68(0x12b));}const _0xfdb6ed=await withSpinner(_0x514c68(0x121)+_0x59435b+_0x514c68(0xd7),()=>_0x5d5b3c[_0x514c68(0xe4)][_0x514c68(0xdf)](_0x59435b),{'verbose':_0xe59ab4[_0x514c68(0xcd)]}),_0x25ce98=_0xfdb6ed[_0x514c68(0x10f)];_0xe29e44?console[_0x514c68(0x12c)](_0x514c68(0xe7)+_0xe29e44+_0x514c68(0x103)+_0x59435b+')'):console['error'](_0x514c68(0x111)+_0x59435b);if(isStructuredFormat(_0xe59ab4))await handleSingleObjectOutput(_0x25ce98,_0xe59ab4);else{const _0x3ca204=normalizeSchemaForDisplay(_0x25ce98);_0xe29e44?(console[_0x514c68(0x11b)](_0x514c68(0x10c)+a13_0x3f4d5e['cyan'](_0xe29e44)),console['log']('Type:\x20'+a13_0x3f4d5e[_0x514c68(0x10a)](_0x59435b))):console[_0x514c68(0x11b)](_0x514c68(0xfc)+a13_0x3f4d5e[_0x514c68(0xed)](_0x59435b)),_0x3ca204[_0x514c68(0x101)]>0x0?(console['log'](a13_0x3f4d5e[_0x514c68(0xc5)](_0x514c68(0xf1))),printSchemaFields(_0x3ca204,0x0)):console[_0x514c68(0x11b)](a13_0x3f4d5e[_0x514c68(0x10a)](_0x514c68(0x109)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x253026(0x113)]=a13_0x253026(0x100);[a13_0x253026(0xcf)]=a13_0x253026(0x129);async[a13_0x253026(0xeb)](_0x474f97){const _0x17c9bb=a13_0x253026,{options:_0x41044f,tdx:_0x4aae6c}=_0x474f97;_0x41044f[_0x17c9bb(0xcd)]&&console[_0x17c9bb(0x12c)]('Site:\x20'+_0x41044f[_0x17c9bb(0x108)]);const _0x4c0a16=await withSpinner(_0x17c9bb(0xcc),()=>_0x4aae6c['connection'][_0x17c9bb(0xfd)](),{'verbose':_0x41044f[_0x17c9bb(0xcd)]}),_0x25580f=_0x4c0a16[_0x17c9bb(0x10f)]['sort']((_0x18fece,_0x2ab712)=>_0x18fece['type'][_0x17c9bb(0xd1)](_0x2ab712[_0x17c9bb(0x131)]));console[_0x17c9bb(0x12c)](_0x17c9bb(0x12e)+_0x25580f[_0x17c9bb(0x101)]+_0x17c9bb(0x107)+(_0x25580f[_0x17c9bb(0x101)]!==0x1?'s':''));if(isStructuredFormat(_0x41044f))await handleSDKOutput(_0x25580f,_0x41044f);else{const _0x244c51=_0x25580f['length']>0x0?Math[_0x17c9bb(0x11a)](..._0x25580f[_0x17c9bb(0xf0)](_0x4ae428=>_0x4ae428[_0x17c9bb(0x131)][_0x17c9bb(0x101)])):0x0,_0x2735c9=[];for(const _0x364bc5 of _0x25580f){const _0x899abc=a13_0x3f4d5e[_0x17c9bb(0xed)](_0x364bc5[_0x17c9bb(0x131)][_0x17c9bb(0x124)](_0x244c51));_0x2735c9[_0x17c9bb(0xda)](_0x899abc+'\x20\x20'+_0x364bc5[_0x17c9bb(0x113)]);}await writeOutput(_0x2735c9['join']('\x0a'),_0x41044f['output'],_0x17c9bb(0xe2));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x253026(0x113)]=a13_0x253026(0xdc);['description']=a13_0x253026(0x119);['validate'](_0x49cb71){const {args:_0x57334a}=_0x49cb71;if(!_0x57334a[0x0])return'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.';return undefined;}async[a13_0x253026(0xeb)](_0x50bb11){const _0x192e87=a13_0x253026,{options:_0x33fb85,args:_0x967cfd,tdx:_0x3170aa}=_0x50bb11,_0x2eb7ef=_0x967cfd[0x0];_0x33fb85[_0x192e87(0xcd)]&&(console['error'](_0x192e87(0xd6)+_0x33fb85[_0x192e87(0x108)]),console[_0x192e87(0x12c)]('Fetching\x20settings\x20for\x20connector\x20type:\x20'+_0x2eb7ef));const _0x1ba2b2=await withSpinner(_0x192e87(0xd9)+_0x2eb7ef+_0x192e87(0xd7),()=>_0x3170aa['connection']['getMetadata'](_0x2eb7ef),{'verbose':_0x33fb85[_0x192e87(0xcd)]}),_0x47a24a=_0x1ba2b2[_0x192e87(0x10f)];console[_0x192e87(0x12c)](_0x192e87(0xd5)+_0x2eb7ef);if(isStructuredFormat(_0x33fb85))await handleSingleObjectOutput(_0x47a24a,_0x33fb85);else{console[_0x192e87(0x11b)](_0x192e87(0xfc)+a13_0x3f4d5e['cyan'](_0x2eb7ef)),console['log'](_0x192e87(0xea)+_0x47a24a[_0x192e87(0x113)]);const _0x5b3bd8=_0x47a24a[_0x192e87(0xc3)]||[],_0x206bff=_0x5b3bd8['filter'](_0x3a7237=>_0x3a7237[_0x192e87(0x102)]);_0x206bff[_0x192e87(0x101)]>0x0&&(console[_0x192e87(0x11b)](a13_0x3f4d5e[_0x192e87(0xc5)]('\x0aCredential\x20settings:')),printMetadataSettings(_0x206bff));let _0x1a7c28=![];try{const _0x4415b5=await _0x3170aa[_0x192e87(0xe4)]['getOutputSchema'](_0x2eb7ef),_0x1a53e3=normalizeSchemaForDisplay(_0x4415b5);_0x1a53e3[_0x192e87(0x101)]>0x0&&(console['log'](a13_0x3f4d5e[_0x192e87(0xc5)](_0x192e87(0xf1))),printSchemaFields(_0x1a53e3,0x0),_0x1a7c28=!![]);}catch{const _0x166bc7=_0x5b3bd8[_0x192e87(0x120)](_0x71e305=>!_0x71e305[_0x192e87(0x102)]);_0x166bc7['length']>0x0&&(console[_0x192e87(0x11b)](a13_0x3f4d5e['bold'](_0x192e87(0xf1))),printMetadataSettings(_0x166bc7),_0x1a7c28=!![]);}!_0x1a7c28&&_0x33fb85[_0x192e87(0xcd)]&&console[_0x192e87(0x12c)](a13_0x3f4d5e[_0x192e87(0x10a)](_0x192e87(0x104))),_0x206bff['length']===0x0&&console[_0x192e87(0x11b)](a13_0x3f4d5e[_0x192e87(0x10a)](_0x192e87(0xe1)));}return 0x0;}}function printMetadataSettings(_0x465701){const _0x2b9866=a13_0x253026;for(const _0x2a020a of _0x465701){if(!_0x2a020a['name'])continue;if(_0x2a020a[_0x2b9866(0xf7)])continue;let _0x4b420d='\x20\x20'+a13_0x3f4d5e[_0x2b9866(0xfa)](_0x2a020a[_0x2b9866(0x113)]);_0x2a020a['label']&&(_0x4b420d+=':\x20'+_0x2a020a['label']);_0x2a020a[_0x2b9866(0x131)]&&(_0x4b420d+=a13_0x3f4d5e[_0x2b9866(0x10a)]('\x20['+_0x2a020a[_0x2b9866(0x131)]+']'));console[_0x2b9866(0x11b)](_0x4b420d);_0x2a020a[_0x2b9866(0xd4)]&&console[_0x2b9866(0x11b)](_0x2b9866(0xdd)+a13_0x3f4d5e[_0x2b9866(0x10a)](_0x2a020a['hint']));if(_0x2a020a['options']){const _0x26542c=_0x2a020a[_0x2b9866(0x10e)][_0x2b9866(0xf0)](_0x450fe8=>_0x450fe8[_0x2b9866(0x117)])[_0x2b9866(0xcb)](',\x20');console[_0x2b9866(0x11b)](_0x2b9866(0xd2)+a13_0x3f4d5e[_0x2b9866(0xf4)](_0x26542c));}_0x2a020a[_0x2b9866(0x106)]!==undefined&&_0x2a020a[_0x2b9866(0x106)]!==null&&console[_0x2b9866(0x11b)](_0x2b9866(0x11d)+a13_0x3f4d5e[_0x2b9866(0x116)](String(_0x2a020a[_0x2b9866(0x106)])));if(_0x2a020a[_0x2b9866(0xf2)]){const _0x7622b5=Object[_0x2b9866(0xe5)](_0x2a020a['criteria'])[_0x2b9866(0xf0)](([_0x3f6f13,_0x2697ab])=>_0x3f6f13+'='+JSON[_0x2b9866(0xee)](_0x2697ab))[_0x2b9866(0xcb)](',\x20');console['log'](_0x2b9866(0xdd)+a13_0x3f4d5e[_0x2b9866(0x10a)]('Show\x20when:\x20'+_0x7622b5));}}}
|
|
1
|
+
const a13_0x461c8f=a13_0x164e;(function(_0x4d6309,_0x34e242){const _0xbec3ef=a13_0x164e,_0x1c819b=_0x4d6309();while(!![]){try{const _0x59b91b=parseInt(_0xbec3ef(0x200))/0x1+parseInt(_0xbec3ef(0x224))/0x2+-parseInt(_0xbec3ef(0x1fa))/0x3+-parseInt(_0xbec3ef(0x20f))/0x4+parseInt(_0xbec3ef(0x1fc))/0x5*(-parseInt(_0xbec3ef(0x22a))/0x6)+parseInt(_0xbec3ef(0x1f9))/0x7+parseInt(_0xbec3ef(0x22f))/0x8;if(_0x59b91b===_0x34e242)break;else _0x1c819b['push'](_0x1c819b['shift']());}catch(_0x334b9c){_0x1c819b['push'](_0x1c819b['shift']());}}}(a13_0x405c,0xef832));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';function a13_0x164e(_0x3f7157,_0x458cd1){_0x3f7157=_0x3f7157-0x1e8;const _0x405c53=a13_0x405c();let _0x164e69=_0x405c53[_0x3f7157];return _0x164e69;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x10c55d from'chalk';function a13_0x405c(){const _0x2deed0=['6770554uqupQT','2115366imfTDk','legacy','311735abfFyu','execute','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','push','1556260jZUXkN','connection','\x20[record]','Resolving\x20connector\x20type\x20or\x20name:\x20','validate','\x0aNo\x20fields\x20defined\x20in\x20schema','credential','owner','\x0aNo\x20credential\x20settings\x20defined','limit','Type:\x20','default_value','connection:schema','minimum','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','1803444alSaEg','error','slice','listTypes','sort','connection:show','log','length','cyan','connection:list','max','\x0aConnection:\x20','criteria','output','legacy_settings','hint','object','settings','title','\x0aAvailable\x20fields:','Listing\x20connector\x20types...','226216lwMHiu','Fetching\x20connection\x20\x27','\x0aCredential\x20settings:','enumeration','Site:\x20','record','84wQUjYJ','verbose','filter','\x27\x20(type:\x20','\x20connector\x20type','2986344IlRViT','List\x20available\x20connector\x20types','✔\x20Found\x20connection:\x20','site','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','yellow','name','Show\x20connection\x20details','entries','hidden','findByName','connection:types','repeat','options','green','✔\x20Found\x20','Show\x20when:\x20','bold','\x20-\x20','\x27...','\x27\x20as\x20connector\x20type','join','Fetching\x20settings\x20for\x20connector\x20type:\x20','dim','resolve','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','maximum','\x0aConnector:\x20','connection:settings','list','padStart','map','blue','data','properties','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','No\x20available\x20fields\x20for\x20this\x20connector','value','input','type','description','getOutputSchema','\x20\x20\x20\x20'];a13_0x405c=function(){return _0x2deed0;};return a13_0x405c();}function normalizeSchemaForDisplay(_0x5af86c){const _0xb2fe1c=a13_0x164e,_0x58653d=_0x5af86c[_0xb2fe1c(0x1f0)]||[],_0x4dd7ff=_0x58653d['find'](_0x2089d5=>_0x2089d5[_0xb2fe1c(0x235)]===_0xb2fe1c(0x21d)&&_0x2089d5[_0xb2fe1c(0x1f5)]===_0xb2fe1c(0x229)&&_0x2089d5[_0xb2fe1c(0x1f0)]);if(_0x4dd7ff?.['properties']){const _0x4fbf70=_0x58653d[_0xb2fe1c(0x22c)](_0x3e4435=>_0x3e4435[_0xb2fe1c(0x235)]!==_0xb2fe1c(0x1fb)&&_0x3e4435[_0xb2fe1c(0x235)]!==_0xb2fe1c(0x21d));return[..._0x4fbf70,..._0x4dd7ff['properties']];}return _0x58653d[_0xb2fe1c(0x22c)](_0x495d89=>_0x495d89[_0xb2fe1c(0x235)]!==_0xb2fe1c(0x1fb));}function printSchemaFields(_0x375737,_0x3fc154){const _0x11f727=a13_0x164e,_0x362eb6='\x20\x20'['repeat'](_0x3fc154+0x1),_0x2400db='\x20\x20'[_0x11f727(0x23b)](_0x3fc154+0x2);for(const _0x1ab320 of _0x375737){if(!_0x1ab320['name'])continue;const _0x4e35ad=_0x1ab320[_0x11f727(0x1f5)]===_0x11f727(0x229)&&_0x1ab320['properties']&&_0x1ab320[_0x11f727(0x1f0)][_0x11f727(0x216)]>0x0&&_0x1ab320[_0x11f727(0x235)]!==_0x11f727(0x21d);let _0x115158=''+_0x362eb6+a13_0x10c55d[_0x11f727(0x23d)](_0x1ab320[_0x11f727(0x235)]);_0x1ab320['title']&&(_0x115158+=':\x20'+_0x1ab320[_0x11f727(0x221)]);if(_0x1ab320[_0x11f727(0x1f4)])_0x115158+=a13_0x10c55d[_0x11f727(0x246)]('\x20['+_0x1ab320[_0x11f727(0x1f4)]+']');else _0x4e35ad&&(_0x115158+=a13_0x10c55d['dim'](_0x11f727(0x202)));console[_0x11f727(0x215)](_0x115158);_0x1ab320[_0x11f727(0x1f6)]&&console[_0x11f727(0x215)](''+_0x2400db+a13_0x10c55d[_0x11f727(0x246)](_0x1ab320[_0x11f727(0x1f6)]));if(_0x1ab320[_0x11f727(0x227)]){const _0x34b871=_0x1ab320['enumeration'][_0x11f727(0x1ed)](_0x382cd8=>typeof _0x382cd8===_0x11f727(0x21f)&&_0x11f727(0x1f3)in _0x382cd8?_0x382cd8[_0x11f727(0x1f3)]:_0x382cd8)[_0x11f727(0x244)](',\x20');console[_0x11f727(0x215)](_0x2400db+'Options:\x20'+a13_0x10c55d['yellow'](_0x34b871));}_0x1ab320[_0x11f727(0x20b)]!==undefined&&console[_0x11f727(0x215)](_0x2400db+'Default:\x20'+a13_0x10c55d['blue'](String(_0x1ab320[_0x11f727(0x20b)])));if(_0x1ab320['minimum']!==undefined||_0x1ab320[_0x11f727(0x1e8)]!==undefined){const _0x4385d0=_0x1ab320[_0x11f727(0x20d)]!==undefined&&_0x1ab320[_0x11f727(0x1e8)]!==undefined?_0x1ab320[_0x11f727(0x20d)]+_0x11f727(0x241)+_0x1ab320['maximum']:_0x1ab320['minimum']!==undefined?'>=\x20'+_0x1ab320[_0x11f727(0x20d)]:'<=\x20'+_0x1ab320[_0x11f727(0x1e8)];console[_0x11f727(0x215)](_0x2400db+'Range:\x20'+a13_0x10c55d[_0x11f727(0x1ee)](_0x4385d0));}if(_0x1ab320[_0x11f727(0x21b)]){const _0x33fc12=Object[_0x11f727(0x237)](_0x1ab320[_0x11f727(0x21b)])[_0x11f727(0x1ed)](([_0x2db8e8,_0x36edc7])=>_0x2db8e8+'='+JSON['stringify'](_0x36edc7))[_0x11f727(0x244)](',\x20');console[_0x11f727(0x215)](''+_0x2400db+a13_0x10c55d['dim'](_0x11f727(0x23f)+_0x33fc12));}_0x4e35ad&&_0x1ab320[_0x11f727(0x1f0)]&&printSchemaFields(_0x1ab320['properties'],_0x3fc154+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x461c8f(0x235)]=a13_0x461c8f(0x218);[a13_0x461c8f(0x1f6)]='List\x20all\x20result\x20output\x20connections';async[a13_0x461c8f(0x1fd)](_0x1ecf7c){const _0x1506e1=a13_0x461c8f,{options:_0x115b3d,tdx:_0x44c2f5}=_0x1ecf7c;_0x115b3d[_0x1506e1(0x22b)]&&console[_0x1506e1(0x210)](_0x1506e1(0x228)+_0x115b3d[_0x1506e1(0x232)]);const _0x404c96=resolveLimit(_0x115b3d[_0x1506e1(0x209)],DEFAULT_LISTING_LIMIT),_0x4dc988=await withSpinner('Listing\x20connections...',()=>_0x44c2f5['connection'][_0x1506e1(0x1eb)](),{'verbose':_0x115b3d[_0x1506e1(0x22b)]}),_0xdcc37b=_0x4dc988[_0x1506e1(0x1ef)];console[_0x1506e1(0x210)](_0x1506e1(0x23e)+_0xdcc37b[_0x1506e1(0x216)]+'\x20connection'+(_0xdcc37b[_0x1506e1(0x216)]!==0x1?'s':''));if(isStructuredFormat(_0x115b3d)){const _0x5757db=_0xdcc37b[_0x1506e1(0x211)](0x0,_0x404c96);await handleSDKOutput(_0x5757db,{..._0x115b3d,'limit':_0x404c96});}else{const _0x34169e=_0xdcc37b[_0x1506e1(0x216)]>0x0?Math[_0x1506e1(0x219)](..._0xdcc37b[_0x1506e1(0x1ed)](_0x232804=>_0x232804[_0x1506e1(0x1f5)][_0x1506e1(0x216)])):0x0,_0x1d32ed=[];for(const _0x1f0b98 of _0xdcc37b){const _0x4af971=a13_0x10c55d[_0x1506e1(0x217)](_0x1f0b98[_0x1506e1(0x1f5)]['padStart'](_0x34169e)),_0x15f025=_0x1f0b98['owner']?.[_0x1506e1(0x235)]?_0x1506e1(0x241)+a13_0x10c55d[_0x1506e1(0x246)](_0x1f0b98[_0x1506e1(0x207)][_0x1506e1(0x235)]):'';_0x1d32ed[_0x1506e1(0x1ff)](_0x4af971+'\x20\x20'+_0x1f0b98['name']+_0x15f025);}await writeOutput(_0x1d32ed[_0x1506e1(0x244)]('\x0a'),_0x115b3d[_0x1506e1(0x21c)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x461c8f(0x235)]=a13_0x461c8f(0x214);[a13_0x461c8f(0x1f6)]=a13_0x461c8f(0x236);[a13_0x461c8f(0x204)](_0x55a515){const _0x56bd5c=a13_0x461c8f,{args:_0x1bf25e}=_0x55a515;if(!_0x1bf25e[0x0])return _0x56bd5c(0x233);return undefined;}async['execute'](_0x238cab){const _0x2ca93d=a13_0x461c8f,{options:_0x4e0cc5,args:_0x448f6c,tdx:_0x3de22a}=_0x238cab,_0x26e425=_0x448f6c[0x0];_0x4e0cc5[_0x2ca93d(0x22b)]&&(console[_0x2ca93d(0x210)](_0x2ca93d(0x228)+_0x4e0cc5[_0x2ca93d(0x232)]),console[_0x2ca93d(0x210)]('Looking\x20up\x20connection:\x20'+_0x26e425));const _0x2cdf68=await withSpinner(_0x2ca93d(0x225)+_0x26e425+_0x2ca93d(0x242),()=>_0x3de22a['connection'][_0x2ca93d(0x247)](_0x26e425),{'verbose':_0x4e0cc5['verbose']}),_0x56807c=_0x2cdf68[_0x2ca93d(0x1ef)];return console[_0x2ca93d(0x210)](_0x2ca93d(0x231)+_0x56807c[_0x2ca93d(0x235)]),await handleSingleObjectOutput(_0x56807c,_0x4e0cc5),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x461c8f(0x235)]=a13_0x461c8f(0x20c);[a13_0x461c8f(0x1f6)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';[a13_0x461c8f(0x204)](_0x5c09ae){const {args:_0x2ec618}=_0x5c09ae;if(!_0x2ec618[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['execute'](_0x5b170a){const _0x30149d=a13_0x461c8f,{options:_0x118393,args:_0x4fe57a,tdx:_0x571e16}=_0x5b170a,_0x23b703=_0x4fe57a[0x0];_0x118393['verbose']&&(console[_0x30149d(0x210)](_0x30149d(0x228)+_0x118393[_0x30149d(0x232)]),console[_0x30149d(0x210)](_0x30149d(0x203)+_0x23b703));let _0x3357f3=_0x23b703,_0x39fc95;try{const _0x2f87ce=await _0x571e16['connection'][_0x30149d(0x239)](_0x23b703);_0x2f87ce&&(_0x3357f3=_0x2f87ce[_0x30149d(0x1f5)],_0x39fc95=_0x2f87ce[_0x30149d(0x235)],_0x118393[_0x30149d(0x22b)]&&console[_0x30149d(0x210)]('✔\x20Resolved\x20\x27'+_0x23b703+_0x30149d(0x20e)+_0x3357f3));}catch{_0x118393['verbose']&&console['error']('Treating\x20\x27'+_0x23b703+_0x30149d(0x243));}const _0x1c377e=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x3357f3+_0x30149d(0x242),()=>_0x571e16[_0x30149d(0x201)]['getOutputSchema'](_0x3357f3),{'verbose':_0x118393[_0x30149d(0x22b)]}),_0x323f9c=_0x1c377e['data'];_0x39fc95?console[_0x30149d(0x210)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x39fc95+_0x30149d(0x22d)+_0x3357f3+')'):console[_0x30149d(0x210)](_0x30149d(0x248)+_0x3357f3);if(isStructuredFormat(_0x118393))await handleSingleObjectOutput(_0x323f9c,_0x118393);else{const _0x43a4fd=normalizeSchemaForDisplay(_0x323f9c);_0x39fc95?(console['log'](_0x30149d(0x21a)+a13_0x10c55d[_0x30149d(0x217)](_0x39fc95)),console[_0x30149d(0x215)](_0x30149d(0x20a)+a13_0x10c55d['dim'](_0x3357f3))):console[_0x30149d(0x215)](_0x30149d(0x1e9)+a13_0x10c55d[_0x30149d(0x217)](_0x3357f3)),_0x43a4fd[_0x30149d(0x216)]>0x0?(console['log'](a13_0x10c55d[_0x30149d(0x240)](_0x30149d(0x222))),printSchemaFields(_0x43a4fd,0x0)):console[_0x30149d(0x215)](a13_0x10c55d[_0x30149d(0x246)](_0x30149d(0x205)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a13_0x461c8f(0x23a);[a13_0x461c8f(0x1f6)]=a13_0x461c8f(0x230);async['execute'](_0x2dbba9){const _0x206e8c=a13_0x461c8f,{options:_0x22c238,tdx:_0x34b039}=_0x2dbba9;_0x22c238[_0x206e8c(0x22b)]&&console[_0x206e8c(0x210)](_0x206e8c(0x228)+_0x22c238[_0x206e8c(0x232)]);const _0x310079=await withSpinner(_0x206e8c(0x223),()=>_0x34b039[_0x206e8c(0x201)][_0x206e8c(0x212)](),{'verbose':_0x22c238[_0x206e8c(0x22b)]}),_0x49f830=_0x310079[_0x206e8c(0x1ef)][_0x206e8c(0x213)]((_0x28bd24,_0x2dc75d)=>_0x28bd24['type']['localeCompare'](_0x2dc75d[_0x206e8c(0x1f5)]));console[_0x206e8c(0x210)]('✔\x20Found\x20'+_0x49f830[_0x206e8c(0x216)]+_0x206e8c(0x22e)+(_0x49f830['length']!==0x1?'s':''));if(isStructuredFormat(_0x22c238))await handleSDKOutput(_0x49f830,_0x22c238);else{const _0x46b8a3=_0x49f830[_0x206e8c(0x216)]>0x0?Math[_0x206e8c(0x219)](..._0x49f830[_0x206e8c(0x1ed)](_0x139453=>_0x139453['type'][_0x206e8c(0x216)])):0x0,_0x3e3928=[];for(const _0x5d6809 of _0x49f830){const _0x174a9e=a13_0x10c55d['cyan'](_0x5d6809[_0x206e8c(0x1f5)][_0x206e8c(0x1ec)](_0x46b8a3));_0x3e3928[_0x206e8c(0x1ff)](_0x174a9e+'\x20\x20'+_0x5d6809['name']);}await writeOutput(_0x3e3928[_0x206e8c(0x244)]('\x0a'),_0x22c238[_0x206e8c(0x21c)],'table');}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x461c8f(0x235)]=a13_0x461c8f(0x1ea);[a13_0x461c8f(0x1f6)]=a13_0x461c8f(0x1f1);['validate'](_0x83a8a6){const {args:_0x225419}=_0x83a8a6;if(!_0x225419[0x0])return'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.';return undefined;}async[a13_0x461c8f(0x1fd)](_0x17be75){const _0x17dba7=a13_0x461c8f,{options:_0x43b013,args:_0x49c67c,tdx:_0x3caad5}=_0x17be75,_0x259c7f=_0x49c67c[0x0];_0x43b013[_0x17dba7(0x22b)]&&(console[_0x17dba7(0x210)](_0x17dba7(0x228)+_0x43b013['site']),console[_0x17dba7(0x210)](_0x17dba7(0x245)+_0x259c7f));const _0x4ee97d=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x259c7f+'\x27...',()=>_0x3caad5[_0x17dba7(0x201)]['getMetadata'](_0x259c7f),{'verbose':_0x43b013['verbose']}),_0x3b0e41=_0x4ee97d[_0x17dba7(0x1ef)];console[_0x17dba7(0x210)](_0x17dba7(0x1fe)+_0x259c7f);if(isStructuredFormat(_0x43b013))await handleSingleObjectOutput(_0x3b0e41,_0x43b013);else{console[_0x17dba7(0x215)]('\x0aConnector:\x20'+a13_0x10c55d[_0x17dba7(0x217)](_0x259c7f)),console[_0x17dba7(0x215)]('Name:\x20'+_0x3b0e41[_0x17dba7(0x235)]);const _0x473df6=_0x3b0e41[_0x17dba7(0x220)]||[],_0x497387=_0x473df6[_0x17dba7(0x22c)](_0x5e4c32=>_0x5e4c32['credential']);_0x497387[_0x17dba7(0x216)]>0x0&&(console[_0x17dba7(0x215)](a13_0x10c55d['bold'](_0x17dba7(0x226))),printMetadataSettings(_0x497387));let _0x5dde8d=![];try{const _0x41b2a3=await _0x3caad5[_0x17dba7(0x201)][_0x17dba7(0x1f7)](_0x259c7f),_0x1241e6=normalizeSchemaForDisplay(_0x41b2a3);_0x1241e6[_0x17dba7(0x216)]>0x0&&(console[_0x17dba7(0x215)](a13_0x10c55d[_0x17dba7(0x240)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x1241e6,0x0),_0x5dde8d=!![]);}catch{const _0x208ea5=_0x473df6[_0x17dba7(0x22c)](_0x5ab688=>!_0x5ab688[_0x17dba7(0x206)]);_0x208ea5[_0x17dba7(0x216)]>0x0&&(console[_0x17dba7(0x215)](a13_0x10c55d[_0x17dba7(0x240)](_0x17dba7(0x222))),printMetadataSettings(_0x208ea5),_0x5dde8d=!![]);}!_0x5dde8d&&_0x43b013[_0x17dba7(0x22b)]&&console[_0x17dba7(0x210)](a13_0x10c55d[_0x17dba7(0x246)](_0x17dba7(0x1f2))),_0x497387[_0x17dba7(0x216)]===0x0&&console[_0x17dba7(0x215)](a13_0x10c55d[_0x17dba7(0x246)](_0x17dba7(0x208)));}return 0x0;}}function printMetadataSettings(_0x3238b2){const _0x4ec1ba=a13_0x461c8f;for(const _0x3dde6c of _0x3238b2){if(!_0x3dde6c['name'])continue;if(_0x3dde6c[_0x4ec1ba(0x238)])continue;let _0x2f7db5='\x20\x20'+a13_0x10c55d['green'](_0x3dde6c['name']);_0x3dde6c['label']&&(_0x2f7db5+=':\x20'+_0x3dde6c['label']);_0x3dde6c[_0x4ec1ba(0x1f5)]&&(_0x2f7db5+=a13_0x10c55d[_0x4ec1ba(0x246)]('\x20['+_0x3dde6c['type']+']'));console[_0x4ec1ba(0x215)](_0x2f7db5);_0x3dde6c[_0x4ec1ba(0x21e)]&&console['log'](_0x4ec1ba(0x1f8)+a13_0x10c55d[_0x4ec1ba(0x246)](_0x3dde6c[_0x4ec1ba(0x21e)]));if(_0x3dde6c['options']){const _0x301079=_0x3dde6c[_0x4ec1ba(0x23c)]['map'](_0x266073=>_0x266073[_0x4ec1ba(0x1f3)])[_0x4ec1ba(0x244)](',\x20');console[_0x4ec1ba(0x215)]('\x20\x20\x20\x20Options:\x20'+a13_0x10c55d[_0x4ec1ba(0x234)](_0x301079));}_0x3dde6c[_0x4ec1ba(0x20b)]!==undefined&&_0x3dde6c[_0x4ec1ba(0x20b)]!==null&&console[_0x4ec1ba(0x215)]('\x20\x20\x20\x20Default:\x20'+a13_0x10c55d[_0x4ec1ba(0x1ee)](String(_0x3dde6c[_0x4ec1ba(0x20b)])));if(_0x3dde6c['criteria']){const _0x5dc5a8=Object[_0x4ec1ba(0x237)](_0x3dde6c[_0x4ec1ba(0x21b)])['map'](([_0x295acf,_0x4f08cd])=>_0x295acf+'='+JSON['stringify'](_0x4f08cd))[_0x4ec1ba(0x244)](',\x20');console[_0x4ec1ba(0x215)](_0x4ec1ba(0x1f8)+a13_0x10c55d[_0x4ec1ba(0x246)](_0x4ec1ba(0x23f)+_0x5dc5a8));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a14_0x1acaa9=a14_0x4005;(function(_0x11bb4d,_0x24ee6d){const _0x1bf163=a14_0x4005,_0x4e3a0c=_0x11bb4d();while(!![]){try{const _0x108441=-parseInt(_0x1bf163(0xb4))/0x1*(parseInt(_0x1bf163(0xc2))/0x2)+parseInt(_0x1bf163(0xb0))/0x3+-parseInt(_0x1bf163(0xb8))/0x4+-parseInt(_0x1bf163(0xac))/0x5*(-parseInt(_0x1bf163(0xb3))/0x6)+parseInt(_0x1bf163(0xb5))/0x7+-parseInt(_0x1bf163(0xbc))/0x8+parseInt(_0x1bf163(0xbd))/0x9*(parseInt(_0x1bf163(0xb1))/0xa);if(_0x108441===_0x24ee6d)break;else _0x4e3a0c['push'](_0x4e3a0c['shift']());}catch(_0x2d13da){_0x4e3a0c['push'](_0x4e3a0c['shift']());}}}(a14_0x45fc,0x991d2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a14_0x4005(_0x414506,_0x33dd6c){_0x414506=_0x414506-0xab;const _0x45fc8a=a14_0x45fc();let _0x40055f=_0x45fc8a[_0x414506];return _0x40055f;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x1acaa9(0xba)]=a14_0x1acaa9(0xc1);['description']=a14_0x1acaa9(0xbe);async['execute'](_0x48392e){const _0x46e90d=a14_0x1acaa9,{options:_0x3dfc4b,args:_0x58f2f2,tdx:_0xef876b}=_0x48392e,_0x5e1f15=_0x58f2f2[0x0];try{_0x3dfc4b[_0x46e90d(0xae)]&&(console[_0x46e90d(0xc0)](_0x46e90d(0xbf)+_0x3dfc4b[_0x46e90d(0xb2)]),_0x5e1f15&&console[_0x46e90d(0xc0)](_0x46e90d(0xad)+_0x5e1f15));const _0x1f9d11=resolveLimit(_0x3dfc4b[_0x46e90d(0xbb)],DEFAULT_LISTING_LIMIT),_0x593bdb=await withSpinner('Listing\x20databases...',()=>_0xef876b[_0x46e90d(0xb7)][_0x46e90d(0xb9)](_0x5e1f15,_0x1f9d11),{'verbose':_0x3dfc4b['verbose']}),_0x4cd896=_0x593bdb[_0x46e90d(0xb6)];return console['error']('✔\x20Found\x20'+_0x4cd896[_0x46e90d(0xab)]+'\x20database'+(_0x4cd896[_0x46e90d(0xab)]!==0x1?'s':'')),await handleSDKOutput(_0x4cd896,{..._0x3dfc4b,'limit':_0x1f9d11}),0x0;}catch(_0x1ccb57){if(_0x1ccb57 instanceof SDKError)return console[_0x46e90d(0xc0)](_0x46e90d(0xaf)+_0x1ccb57[_0x46e90d(0xc4)]),_0x1ccb57[_0x46e90d(0xc3)]&&console['error']('\x20\x20Cause:\x20'+_0x1ccb57[_0x46e90d(0xc3)]),0x1;throw _0x1ccb57;}}}function a14_0x45fc(){const _0x1dc9b3=['error','databases','155666YgMHVU','cause','message','length','80IOgbuI','Pattern:\x20','verbose','Error:\x20','1520415nYvQbx','682940VVzQFa','site','360228TvKHFo','1XnFHLY','105700CrntJe','data','query','57692lrwOtg','listDatabases','name','limit','7197528rbtBUU','18RpCZRV','List\x20all\x20databases','Site:\x20'];a14_0x45fc=function(){return _0x1dc9b3;};return a14_0x45fc();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a15_0x10a476=a15_0x2546;(function(_0x5a4b4f,_0x27c97f){const _0x27817f=a15_0x2546,_0x37a609=_0x5a4b4f();while(!![]){try{const _0x4f76a7=parseInt(_0x27817f(0x1ab))/0x1*(-parseInt(_0x27817f(0x1a7))/0x2)+-parseInt(_0x27817f(0x1b3))/0x3*(-parseInt(_0x27817f(0x1a0))/0x4)+parseInt(_0x27817f(0x1a1))/0x5*(-parseInt(_0x27817f(0x1ae))/0x6)+parseInt(_0x27817f(0x1a4))/0x7*(-parseInt(_0x27817f(0x1a2))/0x8)+parseInt(_0x27817f(0x1a3))/0x9+-parseInt(_0x27817f(0x1b0))/0xa*(parseInt(_0x27817f(0x1aa))/0xb)+parseInt(_0x27817f(0x1a8))/0xc;if(_0x4f76a7===_0x27c97f)break;else _0x37a609['push'](_0x37a609['shift']());}catch(_0x339038){_0x37a609['push'](_0x37a609['shift']());}}}(a15_0x4d6d,0xe4be0));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a15_0x4d6d(){const _0x4c198f=['name','listEmailSenders','2227396NclctI','21329988bfeHwR','Fetching\x20email\x20senders...','9338362HXThka','1tIPtvR','List\x20email\x20senders','data','2946kOMhQy','filter','10yFplNh','verbose','description','3498816trfoFy','4JOoZJG','265fCbdmu','8OVWKcS','11563101WVGJxm','9120783uXwfhj'];a15_0x4d6d=function(){return _0x4c198f;};return a15_0x4d6d();}import{withSpinner}from'../utils/spinner.js';function a15_0x2546(_0x4dfe4d,_0xed5b13){_0x4dfe4d=_0x4dfe4d-0x1a0;const _0x4d6dc3=a15_0x4d6d();let _0x254636=_0x4d6dc3[_0x4dfe4d];return _0x254636;}import{matchGlobPattern}from'../utils/string-utils.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{[a15_0x10a476(0x1a5)]='delivery:senders';[a15_0x10a476(0x1b2)]=a15_0x10a476(0x1ac);async['execute'](_0x220495){const _0x3f4c94=a15_0x10a476,{options:_0x16a7a0,args:_0x15e42f,tdx:_0x352d3a}=_0x220495,_0x32518b=_0x15e42f[0x0],_0x59bd8f=resolveLimit(_0x16a7a0['limit'],DEFAULT_LLM_LIMIT),_0x11d43c=_0x16a7a0,_0x5cbbff=await resolveWorkspaceIdFromOptions(_0x11d43c,_0x352d3a),_0x4d3f80=await withSpinner(_0x3f4c94(0x1a9),()=>_0x352d3a['delivery'][_0x3f4c94(0x1a6)]({'workspaceId':_0x5cbbff,'limit':_0x59bd8f}),{'verbose':_0x16a7a0[_0x3f4c94(0x1b1)]});let _0x217596=_0x4d3f80['data'];return _0x32518b&&(_0x217596=_0x4d3f80[_0x3f4c94(0x1ad)][_0x3f4c94(0x1af)](_0x2d265f=>matchGlobPattern(_0x2d265f[_0x3f4c94(0x1a5)],_0x32518b))),await handleSDKOutput(_0x217596,_0x16a7a0),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0xd2413=a16_0x18e9;(function(_0x4ec92a,_0x488e56){const _0x1afd3e=a16_0x18e9,_0x3f31a2=_0x4ec92a();while(!![]){try{const _0xe087ac=parseInt(_0x1afd3e(0x1b2))/0x1*(parseInt(_0x1afd3e(0x1ab))/0x2)+-parseInt(_0x1afd3e(0x1aa))/0x3+-parseInt(_0x1afd3e(0x1ad))/0x4+parseInt(_0x1afd3e(0x1b7))/0x5+-parseInt(_0x1afd3e(0x1c0))/0x6*(-parseInt(_0x1afd3e(0x1b8))/0x7)+parseInt(_0x1afd3e(0x1b3))/0x8*(-parseInt(_0x1afd3e(0x1bc))/0x9)+parseInt(_0x1afd3e(0x1a8))/0xa;if(_0xe087ac===_0x488e56)break;else _0x3f31a2['push'](_0x3f31a2['shift']());}catch(_0x27623e){_0x3f31a2['push'](_0x3f31a2['shift']());}}}(a16_0x1225,0x5bfc9));import{BaseCommand}from'./command.js';function a16_0x18e9(_0x3b0b05,_0x5a5de1){_0x3b0b05=_0x3b0b05-0x1a0;const _0x1225db=a16_0x1225();let _0x18e99f=_0x1225db[_0x3b0b05];return _0x18e99f;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a16_0x1225(){const _0x4602ba=['3292060JqxaNm','14154VlrgqB','describe','name','describeTable','36YSaVJg','Site:\x20','site','Describe\x20table\x20schema','360UKWDrj','\x27\x20does\x20not\x20exist','args','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','query','✔\x20Found\x20','Describing\x20table\x20','length','9962230dUfDTY','Table:\x20','1343682bDfQID','99350ggMWkh','Error:\x20','2219440AkVReb','cause','\x20\x20Cause:\x20','\x20in\x20','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','4jpeunw','1190248IJlvwS','message','error','database'];a16_0x1225=function(){return _0x4602ba;};return a16_0x1225();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a16_0xd2413(0x1ba)]=a16_0xd2413(0x1b9);['description']=a16_0xd2413(0x1bf);async['execute'](_0x34218e){const _0x2fcc33=a16_0xd2413;return this[_0x2fcc33(0x1bb)](_0x34218e);}async['describeTable'](_0x1a8a83){const _0x2afafb=a16_0xd2413,{options:_0x3d510d,args:_0x7fcb01,tdx:_0x1d0b40}=_0x1a8a83;let _0x2f015c;try{_0x2f015c=parseTableReference(_0x7fcb01[0x0]);const _0x33a7c4=_0x3d510d[_0x2afafb(0x1b6)];!_0x2f015c[_0x2afafb(0x1b6)]&&_0x33a7c4&&(_0x2f015c[_0x2afafb(0x1b6)]=_0x33a7c4);const _0x1956cc=validateTableDescribeReference(_0x2f015c);if(_0x1956cc)return console['error'](_0x2afafb(0x1ac)+_0x1956cc),0x1;}catch(_0x8c66d8){return console[_0x2afafb(0x1b5)](_0x2afafb(0x1ac)+_0x8c66d8[_0x2afafb(0x1b4)]),0x1;}const _0x312b88=_0x2f015c[_0x2afafb(0x1b6)],_0x426f62=_0x2f015c['table'];try{_0x3d510d[_0x2afafb(0x1a2)]&&(console[_0x2afafb(0x1b5)](_0x2afafb(0x1bd)+_0x3d510d[_0x2afafb(0x1be)]),console[_0x2afafb(0x1b5)]('Database:\x20'+_0x312b88),console[_0x2afafb(0x1b5)](_0x2afafb(0x1a9)+_0x426f62));const _0x3dd049=await withSpinner(_0x2afafb(0x1a6)+_0x312b88+'.'+_0x426f62+'...',()=>_0x1d0b40[_0x2afafb(0x1a4)]['describeTable'](_0x312b88,_0x426f62),{'verbose':_0x3d510d[_0x2afafb(0x1a2)]}),_0x3c43a6=_0x3dd049['data'];if(_0x3c43a6[_0x2afafb(0x1a7)]===0x0)return console['error']('✖\x20Table\x20not\x20found'),console[_0x2afafb(0x1b5)]('Table\x20\x27'+_0x312b88+'.'+_0x426f62+_0x2afafb(0x1a0)),0x1;return console['error'](_0x2afafb(0x1a5)+_0x3c43a6['length']+'\x20column'+(_0x3c43a6['length']!==0x1?'s':'')+_0x2afafb(0x1b0)+_0x312b88+'.'+_0x426f62),await handleSDKOutput(_0x3c43a6,_0x3d510d),0x0;}catch(_0x80c154){if(_0x80c154 instanceof SDKError)return console[_0x2afafb(0x1b5)]('Error:\x20'+_0x80c154['message']),_0x80c154[_0x2afafb(0x1ae)]&&console[_0x2afafb(0x1b5)](_0x2afafb(0x1af)+_0x80c154[_0x2afafb(0x1ae)]),0x1;throw _0x80c154;}}['validate'](_0x550e4d){const _0x5e2851=a16_0xd2413;if(_0x550e4d[_0x5e2851(0x1a1)][_0x5e2851(0x1a7)]===0x0)return _0x5e2851(0x1b1);if(_0x550e4d['args'][_0x5e2851(0x1a7)]>0x1)return _0x5e2851(0x1a3);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x3caf63=a17_0x813f;(function(_0x57854c,_0x967375){const _0x1509cc=a17_0x813f,_0x456315=_0x57854c();while(!![]){try{const _0x5d324e=parseInt(_0x1509cc(0x105))/0x1*(parseInt(_0x1509cc(0x12b))/0x2)+parseInt(_0x1509cc(0x121))/0x3+-parseInt(_0x1509cc(0x104))/0x4*(parseInt(_0x1509cc(0xff))/0x5)+parseInt(_0x1509cc(0x116))/0x6*(-parseInt(_0x1509cc(0xfe))/0x7)+parseInt(_0x1509cc(0xfa))/0x8*(parseInt(_0x1509cc(0x11b))/0x9)+-parseInt(_0x1509cc(0x12a))/0xa*(-parseInt(_0x1509cc(0x118))/0xb)+-parseInt(_0x1509cc(0x107))/0xc*(parseInt(_0x1509cc(0x12f))/0xd);if(_0x5d324e===_0x967375)break;else _0x456315['push'](_0x456315['shift']());}catch(_0x219b22){_0x456315['push'](_0x456315['shift']());}}}(a17_0x5899,0xd8ac7));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a17_0x813f(_0x2bff35,_0x405fb7){_0x2bff35=_0x2bff35-0xfa;const _0x5899af=a17_0x5899();let _0x813f9b=_0x5899af[_0x2bff35];return _0x813f9b;}function a17_0x5899(){const _0x4c1ae9=['44WBNKEn','859MeIBaX','\x20files?','13595172EYovMB','content','Workspace\x20is\x20required.','length','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','segment','Pulling\x20campaigns\x20from\x20\x27','absolutePath','hasChanges','session','isNew','dryRun','cwd','yellow','6KaoBEm','\x0aChanges\x20to\x20\x27','447766PXbCqo','\x20unchanged\x20files','\x27...','90mcoSHU','\x20\x20Target:\x20','error','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','filter','\x20new\x20files','2256063jyrZru','execute','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','engage_workspace','repeat','files','workspace','✔\x20All\x20files\x20are\x20up\x20to\x20date','workspaceName','280UdZwXC','818kdItyQ','dim','utf-8','setPhase','13OcuJre','\x20=\x20','data','verbose','\x20changed\x20files','targetDir','yes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','engage','engage:campaign:pull','✔\x20Pulled\x20','564224JOuicw','config','diff','dirname','3406501JyolIQ','200605lFYbPC','campaigns','counts','\x20campaigns','✔\x20Context\x20set:\x20'];a17_0x5899=function(){return _0x4c1ae9;};return a17_0x5899();}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a17_0xe2e276 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a17_0x2c459b from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{['name']=a17_0x3caf63(0x138);['description']='Pull\x20campaigns\x20to\x20YAML\x20files';async[a17_0x3caf63(0x122)](_0xde3a8d){const _0x58b6c6=a17_0x3caf63,{options:_0x316831,args:_0x495f42,tdx:_0x4610ac}=_0xde3a8d,_0x35f034=_0x316831,_0xd9e5b5=await resolveWorkspaceName(_0x495f42[0x0],_0x35f034);if(!_0xd9e5b5)return console['error'](a17_0xe2e276[_0x58b6c6(0x115)](_0x58b6c6(0x109))),console[_0x58b6c6(0x11d)]('\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>'),console[_0x58b6c6(0x11d)](_0x58b6c6(0x10c)),console[_0x58b6c6(0x11d)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x51ee07=await withProgressSpinner(_0x58b6c6(0x10e)+_0xd9e5b5+_0x58b6c6(0x11a),_0x188a79=>pullCampaigns({'engage':_0x4610ac[_0x58b6c6(0x137)],'segment':_0x4610ac[_0x58b6c6(0x10d)]},_0xd9e5b5,{'campaignName':_0x35f034['name'],'campaignType':_0x35f034['type'],'progress':{'update':_0x2cd91f=>{const _0x2a232b=_0x58b6c6;_0x188a79[_0x2a232b(0x12e)](_0x2cd91f);}}}),{'verbose':_0x35f034[_0x58b6c6(0x132)]}),_0x46497a=_0x51ee07[_0x58b6c6(0x131)];if(_0x46497a[_0x58b6c6(0x101)][_0x58b6c6(0x100)]===0x0)return console[_0x58b6c6(0x11d)](a17_0xe2e276[_0x58b6c6(0x115)](_0x58b6c6(0x11e)+_0x46497a[_0x58b6c6(0x129)]+'\x27')),0x0;const _0x182c03=_0x46497a[_0x58b6c6(0x126)][_0x58b6c6(0x11f)](_0x423abb=>_0x423abb[_0x58b6c6(0x112)]),_0x5e3871=_0x46497a[_0x58b6c6(0x126)][_0x58b6c6(0x11f)](_0x14a6bf=>!_0x14a6bf[_0x58b6c6(0x112)]&&_0x14a6bf[_0x58b6c6(0x110)]),_0x328375=_0x46497a[_0x58b6c6(0x126)][_0x58b6c6(0x11f)](_0x414dad=>!_0x414dad[_0x58b6c6(0x112)]&&!_0x414dad[_0x58b6c6(0x110)]);console['error']('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x46497a[_0x58b6c6(0x129)]+'\x27:'),console[_0x58b6c6(0x11d)]('\x20\x20'+a17_0xe2e276['cyan'](_0x46497a[_0x58b6c6(0x101)][_0x58b6c6(0x100)]+_0x58b6c6(0x102))),console[_0x58b6c6(0x11d)]('\x20\x20'+a17_0xe2e276['green']('+\x20'+_0x182c03[_0x58b6c6(0x10a)]+_0x58b6c6(0x120))),console[_0x58b6c6(0x11d)]('\x20\x20'+a17_0xe2e276['yellow']('~\x20'+_0x5e3871[_0x58b6c6(0x10a)]+_0x58b6c6(0x133))),console['error']('\x20\x20'+a17_0xe2e276[_0x58b6c6(0x12c)]('=\x20'+_0x328375[_0x58b6c6(0x10a)]+_0x58b6c6(0x119))),console['error'](_0x58b6c6(0x11c)+a17_0xe2e276['cyan'](_0x46497a[_0x58b6c6(0x134)])+'\x0a');if(_0x5e3871[_0x58b6c6(0x10a)]>0x0)for(const _0x3a80f8 of _0x5e3871){console[_0x58b6c6(0x11d)](_0x58b6c6(0x117)+_0x3a80f8['relativePath']+'\x27:'),console[_0x58b6c6(0x11d)]('─'['repeat'](0x3c)),console[_0x58b6c6(0x11d)](_0x3a80f8[_0x58b6c6(0xfc)]),console[_0x58b6c6(0x11d)]('─'[_0x58b6c6(0x125)](0x3c));}if(_0x35f034[_0x58b6c6(0x113)])return console['error'](a17_0xe2e276[_0x58b6c6(0x115)](_0x58b6c6(0x123))),0x0;if(_0x182c03[_0x58b6c6(0x10a)]===0x0&&_0x5e3871[_0x58b6c6(0x10a)]===0x0)return console['error'](a17_0xe2e276[_0x58b6c6(0x10b)](_0x58b6c6(0x128))),saveSessionContext({'engage_workspace':_0x46497a[_0x58b6c6(0x129)]},_0x35f034[_0x58b6c6(0x111)]),0x0;if(!_0x35f034[_0x58b6c6(0x135)]){if(!isInteractive())return console['error'](a17_0xe2e276['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x58b6c6(0x11d)](a17_0xe2e276[_0x58b6c6(0x12c)](_0x58b6c6(0x136))),0x1;const _0x47b11e=await confirmKey('Write\x20'+(_0x182c03[_0x58b6c6(0x10a)]+_0x5e3871[_0x58b6c6(0x10a)])+_0x58b6c6(0x106));if(!_0x47b11e)return console[_0x58b6c6(0x11d)](a17_0xe2e276[_0x58b6c6(0x115)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x387d2e of _0x46497a[_0x58b6c6(0x126)]){if(_0x387d2e[_0x58b6c6(0x112)]||_0x387d2e[_0x58b6c6(0x110)]){const _0x243898=a17_0x2c459b[_0x58b6c6(0xfd)](_0x387d2e[_0x58b6c6(0x10f)]);!existsSync(_0x243898)&&mkdirSync(_0x243898,{'recursive':!![]}),writeFileSync(_0x387d2e[_0x58b6c6(0x10f)],_0x387d2e[_0x58b6c6(0x108)],_0x58b6c6(0x12d));}}return console['error'](a17_0xe2e276['green'](_0x58b6c6(0x139)+(_0x182c03[_0x58b6c6(0x10a)]+_0x5e3871['length'])+'\x20files\x20to\x20'+_0x46497a[_0x58b6c6(0x134)])),saveSessionContext({'engage_workspace':_0x46497a[_0x58b6c6(0x129)]},_0x35f034[_0x58b6c6(0x111)]),console['error'](a17_0xe2e276[_0x58b6c6(0x10b)](_0x58b6c6(0x103)+a17_0xe2e276[_0x58b6c6(0x12c)](_0x58b6c6(0x124))+_0x58b6c6(0x130)+a17_0xe2e276['cyan'](_0x46497a[_0x58b6c6(0x129)]))),0x0;}}async function resolveWorkspaceName(_0x2a8e13,_0x2042d5){const _0x204c8f=a17_0x3caf63;if(_0x2a8e13)return _0x2a8e13;if(_0x2042d5[_0x204c8f(0x127)])return _0x2042d5[_0x204c8f(0x127)];const _0x930f21=tryFindTdxConfig(process[_0x204c8f(0x114)]());if(_0x930f21?.[_0x204c8f(0xfb)]['engage_workspace'])return _0x930f21[_0x204c8f(0xfb)][_0x204c8f(0x124)];const _0x324755=loadSessionContext(_0x2042d5[_0x204c8f(0x111)]);if(_0x324755?.[_0x204c8f(0x124)])return _0x324755[_0x204c8f(0x124)];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a18_0x1eaa(){const _0x3aad11=['campaign_type','path','length','Push\x20','\x0aError:','errors','resolveWorkspaceId','error','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','action','site','dim','253003DFNNlj','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','create','yes','4748855yhuSNy','\x27...','warnings','config','message','dirname','segment','data','✔\x20Updated\x20','9651GtbruF','\x0aValidation\x20errors\x20in\x20','results','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','green','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','108MdjsYC','session','-\x20no\x20changes\x20applied','red','Aborted.','Resolving\x20references...','7740440DgZLuI','cwd','\x20campaigns?','19719981gZNWJS','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','workspace','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','Preparing\x20push\x20to\x20workspace\x20\x27','cyan','5521496QtCVbv','yellow','265363VlNDXn','Workspace\x20is\x20required.','826WQYgxX','description','relativePath','verbose','dryRun','created','name','Found\x20','updated','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','engage_workspace','\x20errors:','\x0aPush\x20summary\x20for\x20workspace\x20\x27','setPhase','engage','def','\x20\x20\x20\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','filter','update','\x20campaigns\x20to\x20update:','\x20new\x20campaigns:','resolve','1\x20campaign\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','\x20campaigns'];a18_0x1eaa=function(){return _0x3aad11;};return a18_0x1eaa();}const a18_0x471d1d=a18_0x4725;(function(_0x141c76,_0x2d2f28){const _0x36f725=a18_0x4725,_0x4685c2=_0x141c76();while(!![]){try{const _0x3e62ba=parseInt(_0x36f725(0x1cc))/0x1+-parseInt(_0x36f725(0x1f3))/0x2*(parseInt(_0x36f725(0x1d9))/0x3)+parseInt(_0x36f725(0x1e6))/0x4+parseInt(_0x36f725(0x1d0))/0x5+parseInt(_0x36f725(0x1e0))/0x6*(parseInt(_0x36f725(0x1f1))/0x7)+parseInt(_0x36f725(0x1ef))/0x8+-parseInt(_0x36f725(0x1e9))/0x9;if(_0x3e62ba===_0x2d2f28)break;else _0x4685c2['push'](_0x4685c2['shift']());}catch(_0x1da684){_0x4685c2['push'](_0x4685c2['shift']());}}}(a18_0x1eaa,0xf1def));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a18_0x4725(_0x115510,_0x13e0e2){_0x115510=_0x115510-0x1a9;const _0x1eaad9=a18_0x1eaa();let _0x47250d=_0x1eaad9[_0x115510];return _0x47250d;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a18_0x20c340 from'chalk';import a18_0x359225 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a18_0x471d1d(0x1ab)]='engage:campaign:push';[a18_0x471d1d(0x1f4)]=a18_0x471d1d(0x1c7);async[a18_0x471d1d(0x1dc)](_0x2b74a8){const _0x9eff29=a18_0x471d1d,{options:_0x4ad80b,args:_0x3e2ba8,tdx:_0xe31ca7}=_0x2b74a8,_0x56bf37=_0x4ad80b,_0x36116a=_0x3e2ba8[0x0],_0x2334f1=_0x36116a?a18_0x359225[_0x9eff29(0x1bb)](_0x36116a):undefined,_0x43210e=_0x2334f1?isYamlFile(_0x2334f1):![];let _0x2cdcce;if(_0x43210e&&_0x2334f1)_0x2cdcce=a18_0x359225[_0x9eff29(0x1d5)](_0x2334f1);else _0x2334f1?_0x2cdcce=_0x2334f1:_0x2cdcce=process[_0x9eff29(0x1e7)]();let _0x1a7aa5;const _0x25dbdd=tryFindTdxConfig(_0x2cdcce);_0x25dbdd?.[_0x9eff29(0x1d3)]['engage_workspace']&&(_0x1a7aa5=_0x25dbdd['config'][_0x9eff29(0x1af)],!_0x43210e&&(_0x2cdcce=_0x25dbdd['configDir']));_0x56bf37[_0x9eff29(0x1eb)]&&(_0x1a7aa5=_0x56bf37['workspace']);if(!_0x1a7aa5){const _0x547479=loadSessionContext(_0x56bf37[_0x9eff29(0x1e1)]);_0x547479?.['engage_workspace']&&(_0x1a7aa5=_0x547479[_0x9eff29(0x1af)]);}if(!_0x1a7aa5)return console[_0x9eff29(0x1c6)](a18_0x20c340[_0x9eff29(0x1f0)](_0x9eff29(0x1f2))),console['error'](_0x9eff29(0x1ea)),console[_0x9eff29(0x1c6)](_0x9eff29(0x1bd)),console[_0x9eff29(0x1c6)](_0x9eff29(0x1dd)),console[_0x9eff29(0x1c6)](_0x9eff29(0x1ec)),0x1;let _0x2559cb;_0x43210e&&_0x2334f1?_0x2559cb=[_0x2334f1]:_0x2559cb=discoverCampaignFiles(_0x2cdcce);if(_0x2559cb[_0x9eff29(0x1c1)]===0x0)return console[_0x9eff29(0x1c6)](a18_0x20c340[_0x9eff29(0x1f0)](_0x9eff29(0x1ae)+_0x2cdcce)),console[_0x9eff29(0x1c6)](a18_0x20c340[_0x9eff29(0x1cb)](_0x9eff29(0x1df))),0x1;const _0x346194=_0x2559cb['map'](_0x59425f=>parseCampaignFile(_0x59425f,a18_0x359225[_0x9eff29(0x1d5)](_0x59425f))),_0x2689d5=_0x346194[_0x9eff29(0x1c1)]===0x1?_0x9eff29(0x1bc)+_0x346194[0x0][_0x9eff29(0x1b4)][_0x9eff29(0x1ab)]:_0x346194[_0x9eff29(0x1c1)]+'\x20campaign\x20files';console[_0x9eff29(0x1c6)](_0x9eff29(0x1ac)+a18_0x20c340[_0x9eff29(0x1ee)](_0x2689d5));let _0x31cd99=![];for(const _0x12a622 of _0x346194){const _0x16c77c=validateCampaignDef(_0x12a622[_0x9eff29(0x1b4)]);if(!_0x16c77c['valid']){_0x31cd99=!![],console['error'](a18_0x20c340[_0x9eff29(0x1e3)](_0x9eff29(0x1da)+_0x12a622[_0x9eff29(0x1f5)]+':'));for(const _0x929c4b of _0x16c77c[_0x9eff29(0x1c4)]){console[_0x9eff29(0x1c6)]('\x20\x20'+a18_0x20c340[_0x9eff29(0x1e3)]('✗')+'\x20'+_0x929c4b['path']+':\x20'+_0x929c4b[_0x9eff29(0x1d4)]);}}for(const _0xcd0e18 of _0x16c77c[_0x9eff29(0x1d2)]){console[_0x9eff29(0x1c6)]('\x20\x20'+a18_0x20c340[_0x9eff29(0x1f0)]('⚠')+'\x20'+_0xcd0e18[_0x9eff29(0x1c0)]+':\x20'+_0xcd0e18[_0x9eff29(0x1d4)]);}}if(_0x31cd99)return console[_0x9eff29(0x1c6)](a18_0x20c340[_0x9eff29(0x1e3)](_0x9eff29(0x1cd))),0x1;const _0x28f07e=await _0xe31ca7[_0x9eff29(0x1b3)][_0x9eff29(0x1c5)](_0x1a7aa5),_0xfa1127=await withProgressSpinner(_0x9eff29(0x1ed)+_0x1a7aa5+_0x9eff29(0x1d1),_0x2d819a=>preparePush({'engage':_0xe31ca7[_0x9eff29(0x1b3)],'segment':_0xe31ca7[_0x9eff29(0x1d6)]},_0x346194,_0x28f07e,{'progress':{'update':_0x3da417=>_0x2d819a[_0x9eff29(0x1b2)](_0x3da417)}}),{'verbose':_0x56bf37[_0x9eff29(0x1f6)]}),_0x3f41fb=_0xfa1127[_0x9eff29(0x1d7)];await withProgressSpinner(_0x9eff29(0x1e5),_0x2c09e9=>resolveAndBuildInputs({'engage':_0xe31ca7['engage'],'segment':_0xe31ca7[_0x9eff29(0x1d6)]},_0x3f41fb,_0x28f07e,{'progress':{'update':_0x12b8e6=>_0x2c09e9[_0x9eff29(0x1b2)](_0x12b8e6)}}),{'verbose':_0x56bf37[_0x9eff29(0x1f6)]});const _0x88bf8f=_0x3f41fb[_0x9eff29(0x1b7)](_0x27b10b=>_0x27b10b[_0x9eff29(0x1c9)]===_0x9eff29(0x1ce)),_0x501cfb=_0x3f41fb[_0x9eff29(0x1b7)](_0x2ede03=>_0x2ede03[_0x9eff29(0x1c9)]===_0x9eff29(0x1b8));console[_0x9eff29(0x1c6)](_0x9eff29(0x1b1)+_0x1a7aa5+'\x27:');if(_0x88bf8f[_0x9eff29(0x1c1)]>0x0){console['error']('\x20\x20'+a18_0x20c340['green']('+\x20'+_0x88bf8f['length']+_0x9eff29(0x1ba)));for(const _0x38e4d4 of _0x88bf8f){console['error'](_0x9eff29(0x1b5)+a18_0x20c340['green']('+')+'\x20'+_0x38e4d4[_0x9eff29(0x1b4)][_0x9eff29(0x1ab)]+'\x20('+_0x38e4d4['def'][_0x9eff29(0x1bf)]+')');}}if(_0x501cfb[_0x9eff29(0x1c1)]>0x0){console[_0x9eff29(0x1c6)]('\x20\x20'+a18_0x20c340[_0x9eff29(0x1f0)]('~\x20'+_0x501cfb['length']+_0x9eff29(0x1b9)));for(const _0x479d85 of _0x501cfb){console[_0x9eff29(0x1c6)]('\x20\x20\x20\x20'+a18_0x20c340[_0x9eff29(0x1f0)]('~')+'\x20'+_0x479d85[_0x9eff29(0x1b4)][_0x9eff29(0x1ab)]+'\x20('+_0x479d85['def'][_0x9eff29(0x1bf)]+')');}}if(_0x88bf8f['length']===0x0&&_0x501cfb[_0x9eff29(0x1c1)]===0x0)return console[_0x9eff29(0x1c6)](a18_0x20c340[_0x9eff29(0x1de)]('✔\x20All\x20campaigns\x20are\x20up\x20to\x20date')),0x0;if(_0x56bf37[_0x9eff29(0x1a9)])return console['error'](a18_0x20c340[_0x9eff29(0x1f0)](_0x9eff29(0x1b6))),0x0;if(!_0x56bf37[_0x9eff29(0x1cf)]){if(!isInteractive())return console[_0x9eff29(0x1c6)](a18_0x20c340['red'](_0x9eff29(0x1c3)),_0x9eff29(0x1c8)),console['error'](a18_0x20c340[_0x9eff29(0x1cb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x35faec=await confirmKey(_0x9eff29(0x1c2)+(_0x88bf8f[_0x9eff29(0x1c1)]+_0x501cfb[_0x9eff29(0x1c1)])+_0x9eff29(0x1e8));if(!_0x35faec)return console['error'](a18_0x20c340[_0x9eff29(0x1f0)](_0x9eff29(0x1e4)),_0x9eff29(0x1e2)),0x1;}const _0x410783=await withProgressSpinner('Pushing\x20campaigns...',_0x284c7b=>executePush({'engage':_0xe31ca7[_0x9eff29(0x1b3)],'segment':_0xe31ca7[_0x9eff29(0x1d6)]},_0x3f41fb,{'progress':{'update':_0x1a0e5b=>_0x284c7b[_0x9eff29(0x1b2)](_0x1a0e5b)}}),{'verbose':_0x56bf37[_0x9eff29(0x1f6)]}),_0x43b945=_0x410783['data'];for(const _0x30fe4f of _0x43b945[_0x9eff29(0x1db)]){if(_0x30fe4f['campaignId']&&(_0x30fe4f[_0x9eff29(0x1c9)]===_0x9eff29(0x1aa)||_0x30fe4f[_0x9eff29(0x1c9)]===_0x9eff29(0x1ad))){const _0x2b40a1=getCampaignUrl(_0x56bf37[_0x9eff29(0x1ca)],_0x28f07e,_0x30fe4f['campaignId']),_0x2c51f6=_0x30fe4f[_0x9eff29(0x1c9)]===_0x9eff29(0x1aa)?'+':'~',_0x2f14c7=_0x30fe4f[_0x9eff29(0x1c9)]===_0x9eff29(0x1aa)?a18_0x20c340[_0x9eff29(0x1de)](_0x2c51f6):a18_0x20c340[_0x9eff29(0x1f0)](_0x2c51f6);console[_0x9eff29(0x1c6)]('\x20\x20'+_0x2f14c7+'\x20'+hyperlink(_0x30fe4f[_0x9eff29(0x1ab)],_0x2b40a1)+'\x20'+a18_0x20c340['dim'](_0x2b40a1));}}_0x43b945[_0x9eff29(0x1aa)]>0x0&&console[_0x9eff29(0x1c6)](a18_0x20c340[_0x9eff29(0x1de)]('✔\x20Created\x20'+_0x43b945['created']+_0x9eff29(0x1be)));_0x43b945['updated']>0x0&&console[_0x9eff29(0x1c6)](a18_0x20c340[_0x9eff29(0x1de)](_0x9eff29(0x1d8)+_0x43b945['updated']+_0x9eff29(0x1be)));if(_0x43b945[_0x9eff29(0x1c4)][_0x9eff29(0x1c1)]>0x0){console[_0x9eff29(0x1c6)](a18_0x20c340[_0x9eff29(0x1e3)]('✘\x20'+_0x43b945[_0x9eff29(0x1c4)][_0x9eff29(0x1c1)]+_0x9eff29(0x1b0)));for(const _0x1450aa of _0x43b945[_0x9eff29(0x1c4)]){console['error']('\x20\x20'+a18_0x20c340[_0x9eff29(0x1e3)](_0x1450aa[_0x9eff29(0x1ab)])+':\x20'+_0x1450aa[_0x9eff29(0x1c6)]);}}return saveSessionContext({'engage_workspace':_0x1a7aa5},_0x56bf37[_0x9eff29(0x1e1)]),_0x43b945['errors'][_0x9eff29(0x1c1)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a18_0x4b2d31=a18_0x2251;(function(_0x51f97a,_0x440188){const _0x453bf4=a18_0x2251,_0x17fcfa=_0x51f97a();while(!![]){try{const _0x560dba=-parseInt(_0x453bf4(0x1da))/0x1*(-parseInt(_0x453bf4(0x1c8))/0x2)+-parseInt(_0x453bf4(0x1d4))/0x3*(-parseInt(_0x453bf4(0x20b))/0x4)+-parseInt(_0x453bf4(0x1cf))/0x5+-parseInt(_0x453bf4(0x1fb))/0x6+-parseInt(_0x453bf4(0x1ec))/0x7+parseInt(_0x453bf4(0x208))/0x8+-parseInt(_0x453bf4(0x20a))/0x9;if(_0x560dba===_0x440188)break;else _0x17fcfa['push'](_0x17fcfa['shift']());}catch(_0x3bd542){_0x17fcfa['push'](_0x17fcfa['shift']());}}}(a18_0x5227,0xe039e));import{BaseCommand}from'./command.js';function a18_0x5227(){const _0x5a7745=['\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','engage_workspace','1\x20campaign\x20file:\x20','756672eAsrkw','error','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','campaign_type','\x0aError:','filter','map','resolve','updated','yellow','\x20errors:','action','config','9631352lJPsWl','def','2875527Xenijj','264540QJYlYP','✔\x20Created\x20','cyan','2IPYoOu','results','segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Workspace\x20is\x20required.','\x27...','workspace','330810YkJlfB','Push\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','engage','session','24WgVhJy','\x20new\x20campaigns:','dirname','green','setPhase','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','1479014ufswKT','Pushing\x20campaigns...','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','create','verbose','configDir','cwd','-\x20no\x20changes\x20applied','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','Resolving\x20references...','created','dim','\x0aPush\x20summary\x20for\x20workspace\x20\x27','update','warnings','Aborted.','12472642VepbAT','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','errors','red','name','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','description','message','site','\x20campaigns','\x20\x20\x20\x20','\x20campaigns\x20to\x20update:'];a18_0x5227=function(){return _0x5a7745;};return a18_0x5227();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a18_0x2251(_0x243756,_0x3b842a){_0x243756=_0x243756-0x1c8;const _0x5227f5=a18_0x5227();let _0x225192=_0x5227f5[_0x243756];return _0x225192;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a18_0x1e4c00 from'chalk';import a18_0x85e6b8 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a18_0x4b2d31(0x1f0)]='engage:campaign:push';[a18_0x4b2d31(0x1f2)]=a18_0x4b2d31(0x1ed);async[a18_0x4b2d31(0x1e2)](_0x2692b3){const _0x1face0=a18_0x4b2d31,{options:_0x226a46,args:_0x5a2e8a,tdx:_0x4f09c9}=_0x2692b3,_0x19aad4=_0x226a46,_0x14021f=_0x5a2e8a[0x0],_0x15e0ed=_0x14021f?a18_0x85e6b8[_0x1face0(0x202)](_0x14021f):undefined,_0x2067e7=_0x15e0ed?isYamlFile(_0x15e0ed):![];let _0x57f9b2;if(_0x2067e7&&_0x15e0ed)_0x57f9b2=a18_0x85e6b8[_0x1face0(0x1d6)](_0x15e0ed);else _0x15e0ed?_0x57f9b2=_0x15e0ed:_0x57f9b2=process[_0x1face0(0x1e0)]();let _0x3a2cde;const _0xec8f47=tryFindTdxConfig(_0x57f9b2);_0xec8f47?.[_0x1face0(0x207)]['engage_workspace']&&(_0x3a2cde=_0xec8f47[_0x1face0(0x207)]['engage_workspace'],!_0x2067e7&&(_0x57f9b2=_0xec8f47[_0x1face0(0x1df)]));_0x19aad4[_0x1face0(0x1ce)]&&(_0x3a2cde=_0x19aad4['workspace']);if(!_0x3a2cde){const _0x1349b8=loadSessionContext(_0x19aad4[_0x1face0(0x1d3)]);_0x1349b8?.[_0x1face0(0x1f9)]&&(_0x3a2cde=_0x1349b8[_0x1face0(0x1f9)]);}if(!_0x3a2cde)return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x204)](_0x1face0(0x1cc))),console[_0x1face0(0x1fc)](_0x1face0(0x1dc)),console[_0x1face0(0x1fc)](_0x1face0(0x1f8)),console['error'](_0x1face0(0x1d1)),console[_0x1face0(0x1fc)](_0x1face0(0x1f1)),0x1;let _0x4622f5;_0x2067e7&&_0x15e0ed?_0x4622f5=[_0x15e0ed]:_0x4622f5=discoverCampaignFiles(_0x57f9b2);if(_0x4622f5[_0x1face0(0x1e4)]===0x0)return console['error'](a18_0x1e4c00[_0x1face0(0x204)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x57f9b2)),console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1e7)]('Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.')),0x1;const _0x51336b=_0x4622f5[_0x1face0(0x201)](_0x29940e=>parseCampaignFile(_0x29940e,a18_0x85e6b8[_0x1face0(0x1d6)](_0x29940e))),_0x197c61=_0x51336b[_0x1face0(0x1e4)]===0x1?_0x1face0(0x1fa)+_0x51336b[0x0][_0x1face0(0x209)][_0x1face0(0x1f0)]:_0x51336b['length']+'\x20campaign\x20files';console[_0x1face0(0x1fc)]('Found\x20'+a18_0x1e4c00[_0x1face0(0x20d)](_0x197c61));let _0x509827=![];for(const _0x38c270 of _0x51336b){const _0x1c6e7e=validateCampaignDef(_0x38c270[_0x1face0(0x209)]);if(!_0x1c6e7e['valid']){_0x509827=!![],console[_0x1face0(0x1fc)](a18_0x1e4c00['red']('\x0aValidation\x20errors\x20in\x20'+_0x38c270['relativePath']+':'));for(const _0x14a231 of _0x1c6e7e['errors']){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00[_0x1face0(0x1ef)]('✗')+'\x20'+_0x14a231['path']+':\x20'+_0x14a231[_0x1face0(0x1f3)]);}}for(const _0xd6d766 of _0x1c6e7e[_0x1face0(0x1ea)]){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00['yellow']('⚠')+'\x20'+_0xd6d766['path']+':\x20'+_0xd6d766[_0x1face0(0x1f3)]);}}if(_0x509827)return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1ef)](_0x1face0(0x1d9))),0x1;const _0x5ccbb6=await _0x4f09c9['engage']['resolveWorkspaceId'](_0x3a2cde),_0x67f53c=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x3a2cde+_0x1face0(0x1cd),_0x404014=>preparePush({'engage':_0x4f09c9[_0x1face0(0x1d2)],'segment':_0x4f09c9['segment']},_0x51336b,_0x5ccbb6,{'progress':{'update':_0x31e7e3=>_0x404014[_0x1face0(0x1d8)](_0x31e7e3)}}),{'verbose':_0x19aad4[_0x1face0(0x1de)]}),_0x3c5d4c=_0x67f53c['data'];await withProgressSpinner(_0x1face0(0x1e5),_0x4e697c=>resolveAndBuildInputs({'engage':_0x4f09c9[_0x1face0(0x1d2)],'segment':_0x4f09c9['segment']},_0x3c5d4c,_0x5ccbb6,{'progress':{'update':_0x42f7b2=>_0x4e697c[_0x1face0(0x1d8)](_0x42f7b2)}}),{'verbose':_0x19aad4[_0x1face0(0x1de)]});const _0x369109=_0x3c5d4c[_0x1face0(0x200)](_0x27641a=>_0x27641a['action']===_0x1face0(0x1dd)),_0x16bfef=_0x3c5d4c[_0x1face0(0x200)](_0x249443=>_0x249443[_0x1face0(0x206)]===_0x1face0(0x1e9));console[_0x1face0(0x1fc)](_0x1face0(0x1e8)+_0x3a2cde+'\x27:');if(_0x369109[_0x1face0(0x1e4)]>0x0){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00[_0x1face0(0x1d7)]('+\x20'+_0x369109[_0x1face0(0x1e4)]+_0x1face0(0x1d5)));for(const _0x14a2db of _0x369109){console[_0x1face0(0x1fc)](_0x1face0(0x1f6)+a18_0x1e4c00['green']('+')+'\x20'+_0x14a2db[_0x1face0(0x209)][_0x1face0(0x1f0)]+'\x20('+_0x14a2db[_0x1face0(0x209)][_0x1face0(0x1fe)]+')');}}if(_0x16bfef['length']>0x0){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00[_0x1face0(0x204)]('~\x20'+_0x16bfef['length']+_0x1face0(0x1f7)));for(const _0x350bad of _0x16bfef){console[_0x1face0(0x1fc)](_0x1face0(0x1f6)+a18_0x1e4c00[_0x1face0(0x204)]('~')+'\x20'+_0x350bad['def'][_0x1face0(0x1f0)]+'\x20('+_0x350bad[_0x1face0(0x209)][_0x1face0(0x1fe)]+')');}}if(_0x369109[_0x1face0(0x1e4)]===0x0&&_0x16bfef['length']===0x0)return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1d7)](_0x1face0(0x1fd))),0x0;if(_0x19aad4['dryRun'])return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x204)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x19aad4['yes']){if(!isInteractive())return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1ef)](_0x1face0(0x1ff)),_0x1face0(0x1e3)),console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1e7)](_0x1face0(0x1cb))),0x1;const _0x15d5ba=await confirmKey(_0x1face0(0x1d0)+(_0x369109[_0x1face0(0x1e4)]+_0x16bfef[_0x1face0(0x1e4)])+'\x20campaigns?');if(!_0x15d5ba)return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x204)](_0x1face0(0x1eb)),_0x1face0(0x1e1)),0x1;}const _0x4c5e83=await withProgressSpinner(_0x1face0(0x1db),_0x5bcc7d=>executePush({'engage':_0x4f09c9[_0x1face0(0x1d2)],'segment':_0x4f09c9[_0x1face0(0x1ca)]},_0x3c5d4c,{'progress':{'update':_0x2b1eab=>_0x5bcc7d['setPhase'](_0x2b1eab)}}),{'verbose':_0x19aad4[_0x1face0(0x1de)]}),_0x1ee428=_0x4c5e83['data'];for(const _0x4a3191 of _0x1ee428[_0x1face0(0x1c9)]){if(_0x4a3191['campaignId']&&(_0x4a3191[_0x1face0(0x206)]===_0x1face0(0x1e6)||_0x4a3191[_0x1face0(0x206)]==='updated')){const _0x270d75=getCampaignUrl(_0x19aad4[_0x1face0(0x1f4)],_0x5ccbb6,_0x4a3191['campaignId']),_0xe6e940=_0x4a3191[_0x1face0(0x206)]===_0x1face0(0x1e6)?'+':'~',_0x2737e6=_0x4a3191['action']===_0x1face0(0x1e6)?a18_0x1e4c00[_0x1face0(0x1d7)](_0xe6e940):a18_0x1e4c00[_0x1face0(0x204)](_0xe6e940);console['error']('\x20\x20'+_0x2737e6+'\x20'+hyperlink(_0x4a3191[_0x1face0(0x1f0)],_0x270d75)+'\x20'+a18_0x1e4c00[_0x1face0(0x1e7)](_0x270d75));}}_0x1ee428[_0x1face0(0x1e6)]>0x0&&console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1d7)](_0x1face0(0x20c)+_0x1ee428[_0x1face0(0x1e6)]+_0x1face0(0x1f5)));_0x1ee428[_0x1face0(0x203)]>0x0&&console[_0x1face0(0x1fc)](a18_0x1e4c00['green']('✔\x20Updated\x20'+_0x1ee428[_0x1face0(0x203)]+'\x20campaigns'));if(_0x1ee428[_0x1face0(0x1ee)][_0x1face0(0x1e4)]>0x0){console[_0x1face0(0x1fc)](a18_0x1e4c00['red']('✘\x20'+_0x1ee428['errors'][_0x1face0(0x1e4)]+_0x1face0(0x205)));for(const _0x4c39d5 of _0x1ee428[_0x1face0(0x1ee)]){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00[_0x1face0(0x1ef)](_0x4c39d5[_0x1face0(0x1f0)])+':\x20'+_0x4c39d5[_0x1face0(0x1fc)]);}}return saveSessionContext({'engage_workspace':_0x3a2cde},_0x19aad4[_0x1face0(0x1d3)]),_0x1ee428[_0x1face0(0x1ee)]['length']>0x0?0x1:0x0;}}
|