@treasuredata/tdx 0.9.6 → 0.9.7
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 +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-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/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-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/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.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/config.js +1 -1
- package/dist/core/connection-cache.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/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +17 -11
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.d.ts +30 -0
- package/dist/utils/journey-utils.d.ts.map +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/journey-utils.js.map +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.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-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x3c8080=a17_0x2391;(function(_0x29656a,_0xdff6d5){const _0x44cb1e=a17_0x2391,_0x122ba5=_0x29656a();while(!![]){try{const _0xb226cf=parseInt(_0x44cb1e(0x1d7))/0x1+-parseInt(_0x44cb1e(0x1ce))/0x2+parseInt(_0x44cb1e(0x1d3))/0x3*(parseInt(_0x44cb1e(0x1c6))/0x4)+parseInt(_0x44cb1e(0x1cb))/0x5*(-parseInt(_0x44cb1e(0x1d2))/0x6)+-parseInt(_0x44cb1e(0x1cf))/0x7+parseInt(_0x44cb1e(0x1d1))/0x8+-parseInt(_0x44cb1e(0x1dd))/0x9*(parseInt(_0x44cb1e(0x1d9))/0xa);if(_0xb226cf===_0xdff6d5)break;else _0x122ba5['push'](_0x122ba5['shift']());}catch(_0x413f12){_0x122ba5['push'](_0x122ba5['shift']());}}}(a17_0x6b06,0x54a26));function a17_0x6b06(){const _0x53083b=['162cYRMGi','444552cbowyv','log','latestInputTokens','💎\x20','574930ngIDdH','description','921980evVkwW','profile','todayCredits','model','9ylzFhJ','Claude','tdx','stdin','monthCredits','toFixed','name','🧠\x20','\x20|\x20','session_id','\x20month','parse','site','\x20-\x20','line','💎\x20tdx\x20-\x20Claude','4qviexw','options','🪙\x20credit:\x20','accountId','push','128150xAqlAt','tdx\x20','statusline','33594CmUcYu','742042oAgwTY','close','4244472PMakWz'];a17_0x6b06=function(){return _0x53083b;};return a17_0x6b06();}function a17_0x2391(_0x113289,_0x2fbfd9){_0x113289=_0x113289-0x1c4;const _0x6b065f=a17_0x6b06();let _0x239110=_0x6b065f[_0x113289];return _0x239110;}import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';async function readStdinJson(_0x3f40b3=0x64){return new Promise(_0x11e1a0=>{const _0x1933be=a17_0x2391;let _0x5e445e='',_0x4c0e8c=![];const _0x478f59=createInterface({'input':process[_0x1933be(0x1e0)],'terminal':![]}),_0x24a8fd=_0x10addd=>{const _0xf50d6e=_0x1933be;if(_0x4c0e8c)return;_0x4c0e8c=!![],clearTimeout(_0x47ffea),_0x478f59[_0xf50d6e(0x1d0)](),_0x11e1a0(_0x10addd);},_0x47ffea=setTimeout(()=>{_0x24a8fd(null);},_0x3f40b3);_0x478f59['on'](_0x1933be(0x1c4),_0x3958e4=>{_0x5e445e+=_0x3958e4;}),_0x478f59['on']('close',()=>{const _0x53e195=_0x1933be;if(_0x4c0e8c)return;try{const _0x29e6ea=JSON[_0x53e195(0x1e8)](_0x5e445e);_0x24a8fd(_0x29e6ea);}catch{_0x24a8fd(null);}});});}function formatCredits(_0x53feee){const _0x46716c=a17_0x2391;return _0x53feee[_0x46716c(0x1e2)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a17_0x3c8080(0x1e3)]=a17_0x3c8080(0x1cd);[a17_0x3c8080(0x1d8)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async['execute'](_0x242b68){const _0x49072f=a17_0x3c8080;try{const _0x5e68cf=await readStdinJson();if(!_0x5e68cf?.['session_id'])return console[_0x49072f(0x1d4)](_0x49072f(0x1c5)),0x0;const _0x1296b5=_0x5e68cf[_0x49072f(0x1e6)],_0x324aa0=_0x5e68cf[_0x49072f(0x1dc)]?.['id']||'',_0x3c92b9=_0x5e68cf['profile']||_0x242b68[_0x49072f(0x1c7)][_0x49072f(0x1da)],_0x3db973=await getUsageStats(_0x1296b5,_0x3c92b9),_0x30c54d=[],_0x5403=readCachedAccountInfo(_0x3c92b9),_0x46edf6=_0x5403?_0x49072f(0x1cc)+_0x5403[_0x49072f(0x1e9)]+':'+_0x5403[_0x49072f(0x1c9)]:_0x49072f(0x1df),_0x1e0197=_0x324aa0?getModelDisplayName(_0x324aa0):_0x49072f(0x1de);_0x30c54d[_0x49072f(0x1ca)](_0x49072f(0x1d6)+_0x46edf6+_0x49072f(0x1ea)+_0x1e0197);const _0x2e0b20=formatCredits(_0x3db973['sessionCredits']),_0xb8b614=formatCredits(_0x3db973[_0x49072f(0x1db)]),_0x500c7d=formatCredits(_0x3db973[_0x49072f(0x1e1)]);_0x30c54d[_0x49072f(0x1ca)](_0x49072f(0x1c8)+_0x2e0b20+'\x20session\x20/\x20'+_0xb8b614+'\x20today\x20/\x20'+_0x500c7d+_0x49072f(0x1e7));if(_0x3db973[_0x49072f(0x1d5)]>0x0&&_0x324aa0){const _0x1047b8=formatTokenCount(_0x3db973['latestInputTokens']),_0x40d8b5=calculateContextPercentage(_0x3db973[_0x49072f(0x1d5)],_0x324aa0);_0x30c54d[_0x49072f(0x1ca)](_0x49072f(0x1e4)+_0x1047b8+'\x20('+_0x40d8b5+'%)');}return console[_0x49072f(0x1d4)](_0x30c54d['join'](_0x49072f(0x1e5))),0x0;}catch{return console['log'](_0x49072f(0x1c5)),0x0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a18_0x4896c6=a18_0x6351;function a18_0x2a7f(){const _0x117aa6=['repeat','toFixed','padStart','dim','42tYNQYp','totalCredits','lastUsedAt','name','(default)','5481252mkTVmE','\x20credits','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','today\x20','padEnd','usage','2230qPAvLX','jsonl','length','round','\x20days\x20ago','outputTable','\x20\x20Total:\x20\x20\x20','8804257cSLVoe','76OZjURx','578192gLqWrB','entryCount','toLocaleDateString','Profile','error','bold','Last\x20Used','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','credits','\x20\x20Today:\x20\x20\x20','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','log','Unknown\x20error','max','format','en-CA','execute','27549ewQjbN','171015gSsSzk','8uPkAuV','default','red','cyan','43696quWoLD','en-US','profile','84SwPIWo','json','toLocaleTimeString','266155PkzpeI','2-digit','map','getTime','message','monthCredits','\x20\x20Month:\x20\x20\x20','description','yesterday','todayCredits','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','outputStructured'];a18_0x2a7f=function(){return _0x117aa6;};return a18_0x2a7f();}(function(_0x1c5d2d,_0x39f6a9){const _0x3da8b6=a18_0x6351,_0x94b88d=_0x1c5d2d();while(!![]){try{const _0x1c6d4f=-parseInt(_0x3da8b6(0x136))/0x1*(-parseInt(_0x3da8b6(0x13a))/0x2)+parseInt(_0x3da8b6(0x135))/0x3*(parseInt(_0x3da8b6(0x163))/0x4)+-parseInt(_0x3da8b6(0x140))/0x5*(-parseInt(_0x3da8b6(0x13d))/0x6)+-parseInt(_0x3da8b6(0x150))/0x7*(parseInt(_0x3da8b6(0x164))/0x8)+parseInt(_0x3da8b6(0x134))/0x9*(parseInt(_0x3da8b6(0x15b))/0xa)+-parseInt(_0x3da8b6(0x162))/0xb+-parseInt(_0x3da8b6(0x155))/0xc;if(_0x1c6d4f===_0x39f6a9)break;else _0x94b88d['push'](_0x94b88d['shift']());}catch(_0x524526){_0x94b88d['push'](_0x94b88d['shift']());}}}(a18_0x2a7f,0xf2e62));function a18_0x6351(_0x191829,_0x264641){_0x191829=_0x191829-0x130;const _0x2a7f76=a18_0x2a7f();let _0x635147=_0x2a7f76[_0x191829];return _0x635147;}import a18_0x50dd9b from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x34c24b){const _0x542544=a18_0x6351;return _0x34c24b[_0x542544(0x14d)](0x2);}function formatLastUsed(_0x2efbec){const _0x3cd0dc=a18_0x6351;if(!_0x2efbec)return'never';const _0x2cd17e=new Date(_0x2efbec),_0x351e83=new Date(),_0x40c2a9=_0x2cd17e['toLocaleDateString'](_0x3cd0dc(0x132)),_0x223966=_0x351e83[_0x3cd0dc(0x166)](_0x3cd0dc(0x132));if(_0x40c2a9===_0x223966)return _0x3cd0dc(0x158)+_0x2cd17e[_0x3cd0dc(0x13f)]('en-US',{'hour':'2-digit','minute':_0x3cd0dc(0x141)});const _0x3ede3f=new Date(_0x40c2a9),_0x3ab2eb=new Date(_0x223966),_0x27e0a5=Math[_0x3cd0dc(0x15e)]((_0x3ab2eb['getTime']()-_0x3ede3f[_0x3cd0dc(0x143)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x27e0a5===0x1)return _0x3cd0dc(0x148);else return _0x27e0a5>0x1&&_0x27e0a5<0x7?_0x27e0a5+_0x3cd0dc(0x15f):_0x2cd17e[_0x3cd0dc(0x166)](_0x3cd0dc(0x13b),{'month':'short','day':'numeric'});}export class ClaudeUsageCommand extends BaseCommand{[a18_0x4896c6(0x153)]=a18_0x4896c6(0x15a);[a18_0x4896c6(0x147)]=a18_0x4896c6(0x157);async[a18_0x4896c6(0x133)](_0x44c7eb){const _0x574c54=a18_0x4896c6,{options:_0x11c37a}=_0x44c7eb,_0x4b1dbf=_0x11c37a[_0x574c54(0x131)]===_0x574c54(0x13e)||_0x11c37a['format']===_0x574c54(0x15c)||_0x11c37a['json'];try{const [_0x4c4a1d,_0x1c7b16]=await Promise['all']([getAllProfileStats(),getUsageSummary()]);return _0x4b1dbf?await this[_0x574c54(0x14b)](_0x4c4a1d,_0x1c7b16,_0x11c37a):this[_0x574c54(0x160)](_0x4c4a1d,_0x1c7b16),0x0;}catch(_0x430347){const _0x3e5539=_0x430347 instanceof Error?_0x430347[_0x574c54(0x144)]:_0x574c54(0x170);return console[_0x574c54(0x168)](a18_0x50dd9b[_0x574c54(0x138)]('Error:\x20'+_0x3e5539)),0x1;}}async[a18_0x4896c6(0x14b)](_0x426926,_0x1922e2,_0x4b363e){const _0x271d16=a18_0x4896c6,_0x3f1296={'summary':{'todayCredits':_0x1922e2['todayCredits'],'monthCredits':_0x1922e2[_0x271d16(0x145)],'totalCredits':_0x1922e2[_0x271d16(0x151)],'profileCount':_0x1922e2['profileCount']},'profiles':_0x426926['map'](_0x2d31a3=>({'profile':_0x2d31a3[_0x271d16(0x13c)],'credits':_0x2d31a3[_0x271d16(0x16c)],'requests':_0x2d31a3[_0x271d16(0x165)],'lastUsedAt':_0x2d31a3[_0x271d16(0x152)]}))};await handleSDKOutput([_0x3f1296],_0x4b363e);}['outputTable'](_0x461ff5,_0x3e0367){const _0x52a89d=a18_0x4896c6;console['log'](a18_0x50dd9b[_0x52a89d(0x169)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0x52a89d(0x16f)](a18_0x50dd9b[_0x52a89d(0x14f)]('─'[_0x52a89d(0x14c)](0x32))),console[_0x52a89d(0x16f)](_0x52a89d(0x16d)+a18_0x50dd9b[_0x52a89d(0x139)](formatCredits(_0x3e0367[_0x52a89d(0x149)]))+'\x20credits'),console[_0x52a89d(0x16f)](_0x52a89d(0x146)+a18_0x50dd9b['cyan'](formatCredits(_0x3e0367[_0x52a89d(0x145)]))+_0x52a89d(0x156)),console[_0x52a89d(0x16f)](_0x52a89d(0x161)+a18_0x50dd9b[_0x52a89d(0x139)](formatCredits(_0x3e0367[_0x52a89d(0x151)]))+_0x52a89d(0x156)),console[_0x52a89d(0x16f)]();if(_0x461ff5['length']===0x0){console['log'](a18_0x50dd9b[_0x52a89d(0x14f)](_0x52a89d(0x14a))),console['log'](a18_0x50dd9b[_0x52a89d(0x14f)](_0x52a89d(0x16e)));return;}console[_0x52a89d(0x16f)](a18_0x50dd9b[_0x52a89d(0x169)]('Usage\x20by\x20Profile')),console[_0x52a89d(0x16f)](a18_0x50dd9b['dim']('─'[_0x52a89d(0x14c)](0x3c)));const _0x441308=Math[_0x52a89d(0x130)](0xc,..._0x461ff5[_0x52a89d(0x142)](_0x2cc4a3=>_0x2cc4a3[_0x52a89d(0x13c)]===_0x52a89d(0x137)?_0x52a89d(0x154)[_0x52a89d(0x15d)]:_0x2cc4a3['profile']['length'])),_0x56c631=0xa,_0xac29f3=0xa;console[_0x52a89d(0x16f)]('\x20\x20'+_0x52a89d(0x167)['padEnd'](_0x441308)+'\x20\x20'+'Credits'[_0x52a89d(0x14e)](_0x56c631)+'\x20\x20'+'Requests'[_0x52a89d(0x14e)](_0xac29f3)+'\x20\x20'+_0x52a89d(0x16a));for(const _0x16c9a2 of _0x461ff5){const _0x1d9a76=_0x16c9a2[_0x52a89d(0x13c)]==='default'?_0x52a89d(0x154):_0x16c9a2[_0x52a89d(0x13c)],_0x4c007d=_0x1d9a76[_0x52a89d(0x159)](_0x441308),_0x43e567=_0x16c9a2[_0x52a89d(0x13c)]===_0x52a89d(0x137)?a18_0x50dd9b['dim'](_0x4c007d):_0x4c007d;console[_0x52a89d(0x16f)]('\x20\x20'+_0x43e567+'\x20\x20'+a18_0x50dd9b[_0x52a89d(0x139)](formatCredits(_0x16c9a2['credits'])[_0x52a89d(0x14e)](_0x56c631))+'\x20\x20'+String(_0x16c9a2[_0x52a89d(0x165)])[_0x52a89d(0x14e)](_0xac29f3)+'\x20\x20'+a18_0x50dd9b[_0x52a89d(0x14f)](formatLastUsed(_0x16c9a2[_0x52a89d(0x152)])));}console['log'](),console['log'](a18_0x50dd9b['dim'](_0x52a89d(0x16b))),console[_0x52a89d(0x16f)]();}}
|
package/dist/commands/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a19_0x2b037d=a19_0xd84d;(function(_0x564c99,_0x455eec){const _0x3aa067=a19_0xd84d,_0x3c8d97=_0x564c99();while(!![]){try{const _0x4ca7bc=-parseInt(_0x3aa067(0x149))/0x1+parseInt(_0x3aa067(0x144))/0x2*(-parseInt(_0x3aa067(0x164))/0x3)+parseInt(_0x3aa067(0x163))/0x4*(parseInt(_0x3aa067(0x171))/0x5)+parseInt(_0x3aa067(0x15c))/0x6*(parseInt(_0x3aa067(0x148))/0x7)+parseInt(_0x3aa067(0x147))/0x8+-parseInt(_0x3aa067(0x169))/0x9+-parseInt(_0x3aa067(0x141))/0xa*(parseInt(_0x3aa067(0x15f))/0xb);if(_0x4ca7bc===_0x455eec)break;else _0x3c8d97['push'](_0x3c8d97['shift']());}catch(_0x57bbb9){_0x3c8d97['push'](_0x3c8d97['shift']());}}}(a19_0x2650,0x9a65b));import{validateLimitOption}from'../utils/option-validation.js';function a19_0x2650(){const _0x47dbfb=['status','test','red','set','register','isValid','validate','message','number','get','error','has','Authentication\x20error\x20stack\x20trace:','from','Reason:\x20','\x20\x20tdx\x20auth\x20setup','run','2535762nxXskd','validateGlobalOptions','\x20\x20tdx\x20auth','5351753ROqzvm','commands','Invalid\x20limit\x20value:\x20','getAll','80292uAiDWD','3XzwjJC','Error:\x20','Authentication\x20failed','name','\x20--profile\x20','630522yWsulX','debug','stack','\x27\x20is\x20already\x20registered','helpText','To\x20check\x20your\x20current\x20auth\x20status:','limit','.\x20Must\x20be\x20a\x20number.','175qfOZJi','\x0aTo\x20set\x20up\x20authentication:','10llsxjA','tdx','value','660482kmOPtP','logger','detail','7014920rOzztt','7roXaqA','482814FFlRZX','execute'];a19_0x2650=function(){return _0x47dbfb;};return a19_0x2650();}function a19_0xd84d(_0xf8feb9,_0x18fde7){_0xf8feb9=_0xf8feb9-0x141;const _0x2650e9=a19_0x2650();let _0xd84d11=_0x2650e9[_0xf8feb9];return _0xd84d11;}import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a19_0x4006e9 from'chalk';export function printAuthError(_0x16bbd3,_0x17dab4=![],_0x25c8f4){const _0x433bab=a19_0xd84d,_0x4af4e5=_0x16bbd3['problemDetails']?.[_0x433bab(0x146)]||_0x16bbd3[_0x433bab(0x152)];console[_0x433bab(0x155)](a19_0x4006e9['red'](_0x433bab(0x166))),console[_0x433bab(0x155)](a19_0x4006e9[_0x433bab(0x14d)](_0x433bab(0x159)+_0x4af4e5));if(_0x17dab4){const _0x4e87b9=_0x25c8f4?_0x433bab(0x168)+_0x25c8f4:'';console[_0x433bab(0x155)](_0x433bab(0x172)),console[_0x433bab(0x155)](_0x433bab(0x15a)+_0x4e87b9+'\x0a'),console[_0x433bab(0x155)](_0x433bab(0x16e)),console[_0x433bab(0x155)](_0x433bab(0x15e)+_0x4e87b9);}}export class BaseCommand{[a19_0x2b037d(0x15d)](_0xfaaad2){const _0x4ba2cc=a19_0x2b037d,{options:_0x550668}=_0xfaaad2,_0x4a89e2=_0x550668[_0x4ba2cc(0x16f)];if(_0x4a89e2!==undefined){const _0xdfce8c=typeof _0x4a89e2===_0x4ba2cc(0x153)?_0x4a89e2:parseInt(_0x4a89e2,0xa);if(isNaN(_0xdfce8c))return _0x4ba2cc(0x161)+_0x4a89e2+_0x4ba2cc(0x170);const _0x3b54d7=validateLimitOption(_0xdfce8c);if(!_0x3b54d7[_0x4ba2cc(0x150)])return _0x3b54d7[_0x4ba2cc(0x155)];_0xfaaad2['options']['limit']=_0x3b54d7[_0x4ba2cc(0x143)];}return undefined;}['validate'](_0xa158f0){return undefined;}async[a19_0x2b037d(0x15b)](_0x3e5669){const _0x3d27cd=a19_0x2b037d;try{const _0x171bae=this['validateGlobalOptions'](_0x3e5669);if(_0x171bae)return console[_0x3d27cd(0x155)]('Error:\x20'+_0x171bae),0x1;const _0x51974c=this[_0x3d27cd(0x151)](_0x3e5669);if(_0x51974c){const _0x32bfd4=/^\s*(Usage|Note|Warning|Error):/i[_0x3d27cd(0x14c)](_0x51974c);return _0x32bfd4?console[_0x3d27cd(0x155)](_0x51974c):console[_0x3d27cd(0x155)](_0x3d27cd(0x165)+_0x51974c),0x1;}const _0x4d633f=await this[_0x3d27cd(0x14a)](_0x3e5669);return _0x4d633f??0x0;}catch(_0x547e8e){if(_0x547e8e instanceof Error){if(_0x547e8e instanceof HTTPClientError&&_0x547e8e[_0x3d27cd(0x14b)]===0x191){const _0x2eaec2=_0x3e5669['options']['profile'];return printAuthError(_0x547e8e,!![],_0x2eaec2),_0x547e8e['stack']&&_0x3e5669['tdx']&&(_0x3e5669[_0x3d27cd(0x142)]['logger'][_0x3d27cd(0x16a)](_0x3d27cd(0x157)),_0x3e5669[_0x3d27cd(0x142)][_0x3d27cd(0x145)]['debug'](_0x547e8e[_0x3d27cd(0x16b)])),0x1;}console['error'](a19_0x4006e9['red']('Error:\x20'+_0x547e8e['message']));_0x547e8e instanceof SDKError&&_0x547e8e[_0x3d27cd(0x16d)]&&console['error'](a19_0x4006e9['yellow'](_0x547e8e[_0x3d27cd(0x16d)]));const _0x112eee=_0x547e8e instanceof SDKError&&_0x547e8e['category']===ErrorCategory['USER_ERROR'];_0x547e8e['stack']&&!_0x112eee&&console[_0x3d27cd(0x155)]('\x0aStack\x20trace:\x0a'+_0x547e8e['stack']);}else console['error'](_0x3d27cd(0x165)+String(_0x547e8e));return 0x1;}}}export class CommandRegistry{[a19_0x2b037d(0x160)]=new Map();[a19_0x2b037d(0x14f)](_0x4f11c8){const _0x3e80ab=a19_0x2b037d;if(this[_0x3e80ab(0x160)][_0x3e80ab(0x156)](_0x4f11c8['name']))throw new Error('Command\x20\x27'+_0x4f11c8[_0x3e80ab(0x167)]+_0x3e80ab(0x16c));this['commands'][_0x3e80ab(0x14e)](_0x4f11c8[_0x3e80ab(0x167)],_0x4f11c8);}['get'](_0x9e740c){const _0x41b29a=a19_0x2b037d;return this['commands'][_0x41b29a(0x154)](_0x9e740c);}[a19_0x2b037d(0x162)](){const _0x1fc68b=a19_0x2b037d;return Array[_0x1fc68b(0x158)](this[_0x1fc68b(0x160)]['values']());}[a19_0x2b037d(0x156)](_0x181d64){const _0x4a9dd2=a19_0x2b037d;return this[_0x4a9dd2(0x160)][_0x4a9dd2(0x156)](_0x181d64);}}export const registry=new CommandRegistry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x5e6fd0=a20_0x1e0d;(function(_0x1240ea,_0x18764d){const _0x5b775b=a20_0x1e0d,_0x91232b=_0x1240ea();while(!![]){try{const _0x4ee2ce=parseInt(_0x5b775b(0xdc))/0x1+-parseInt(_0x5b775b(0x115))/0x2*(-parseInt(_0x5b775b(0xe5))/0x3)+-parseInt(_0x5b775b(0xd3))/0x4+-parseInt(_0x5b775b(0xb0))/0x5+-parseInt(_0x5b775b(0x111))/0x6+parseInt(_0x5b775b(0x100))/0x7*(-parseInt(_0x5b775b(0xae))/0x8)+parseInt(_0x5b775b(0x104))/0x9;if(_0x4ee2ce===_0x18764d)break;else _0x91232b['push'](_0x91232b['shift']());}catch(_0xeb9b28){_0x91232b['push'](_0x91232b['shift']());}}}(a20_0x5367,0x94e3c));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import a20_0x4d7dbf from'chalk';function normalizeSchemaForDisplay(_0x1e8cae){const _0x423a59=a20_0x1e0d,_0x327c26=_0x1e8cae[_0x423a59(0xe6)]||[],_0x2fda83=_0x327c26[_0x423a59(0xfd)](_0x229a12=>_0x229a12[_0x423a59(0x114)]==='legacy_settings'&&_0x229a12[_0x423a59(0xc5)]===_0x423a59(0xb2)&&_0x229a12[_0x423a59(0xe6)]);if(_0x2fda83?.[_0x423a59(0xe6)]){const _0x15e173=_0x327c26[_0x423a59(0xef)](_0x482a82=>_0x482a82[_0x423a59(0x114)]!=='legacy'&&_0x482a82[_0x423a59(0x114)]!==_0x423a59(0xf3));return[..._0x15e173,..._0x2fda83[_0x423a59(0xe6)]];}return _0x327c26[_0x423a59(0xef)](_0x3bc761=>_0x3bc761[_0x423a59(0x114)]!==_0x423a59(0xf4));}function a20_0x1e0d(_0x4efad0,_0x5cdf3a){_0x4efad0=_0x4efad0-0xac;const _0x536787=a20_0x5367();let _0x1e0d7e=_0x536787[_0x4efad0];return _0x1e0d7e;}function printSchemaFields(_0x1b2c37,_0x439962){const _0xb5f2c6=a20_0x1e0d,_0x135195='\x20\x20'[_0xb5f2c6(0x10d)](_0x439962+0x1),_0x515d97='\x20\x20'[_0xb5f2c6(0x10d)](_0x439962+0x2);for(const _0x537770 of _0x1b2c37){if(!_0x537770[_0xb5f2c6(0x114)])continue;const _0x537ce8=_0x537770[_0xb5f2c6(0xc5)]===_0xb5f2c6(0xb2)&&_0x537770['properties']&&_0x537770[_0xb5f2c6(0xe6)][_0xb5f2c6(0xb1)]>0x0&&_0x537770[_0xb5f2c6(0x114)]!==_0xb5f2c6(0xf3);let _0x5e27fb=''+_0x135195+a20_0x4d7dbf[_0xb5f2c6(0xd6)](_0x537770[_0xb5f2c6(0x114)]);_0x537770['title']&&(_0x5e27fb+=':\x20'+_0x537770[_0xb5f2c6(0x117)]);if(_0x537770[_0xb5f2c6(0xd9)])_0x5e27fb+=a20_0x4d7dbf[_0xb5f2c6(0xba)]('\x20['+_0x537770['input']+']');else _0x537ce8&&(_0x5e27fb+=a20_0x4d7dbf[_0xb5f2c6(0xba)](_0xb5f2c6(0xbd)));console['log'](_0x5e27fb);_0x537770[_0xb5f2c6(0xc3)]&&console[_0xb5f2c6(0xb6)](''+_0x515d97+a20_0x4d7dbf['dim'](_0x537770[_0xb5f2c6(0xc3)]));if(_0x537770[_0xb5f2c6(0xf5)]){const _0x2b419a=_0x537770['enumeration']['map'](_0x26c2ff=>typeof _0x26c2ff==='object'&&_0xb5f2c6(0xc1)in _0x26c2ff?_0x26c2ff['value']:_0x26c2ff)[_0xb5f2c6(0x108)](',\x20');console[_0xb5f2c6(0xb6)](_0x515d97+'Options:\x20'+a20_0x4d7dbf[_0xb5f2c6(0x106)](_0x2b419a));}_0x537770[_0xb5f2c6(0xb4)]!==undefined&&console[_0xb5f2c6(0xb6)](_0x515d97+'Default:\x20'+a20_0x4d7dbf[_0xb5f2c6(0xb5)](String(_0x537770['default_value'])));if(_0x537770['minimum']!==undefined||_0x537770[_0xb5f2c6(0xfb)]!==undefined){const _0x5bb11c=_0x537770['minimum']!==undefined&&_0x537770['maximum']!==undefined?_0x537770[_0xb5f2c6(0xf6)]+'\x20-\x20'+_0x537770['maximum']:_0x537770['minimum']!==undefined?_0xb5f2c6(0xcf)+_0x537770[_0xb5f2c6(0xf6)]:_0xb5f2c6(0xe1)+_0x537770[_0xb5f2c6(0xfb)];console[_0xb5f2c6(0xb6)](_0x515d97+_0xb5f2c6(0x113)+a20_0x4d7dbf[_0xb5f2c6(0xb5)](_0x5bb11c));}if(_0x537770[_0xb5f2c6(0xc0)]){const _0x211c30=Object['entries'](_0x537770[_0xb5f2c6(0xc0)])['map'](([_0x2b4d5a,_0x11152e])=>_0x2b4d5a+'='+JSON[_0xb5f2c6(0xac)](_0x11152e))[_0xb5f2c6(0x108)](',\x20');console[_0xb5f2c6(0xb6)](''+_0x515d97+a20_0x4d7dbf['dim'](_0xb5f2c6(0xe7)+_0x211c30));}_0x537ce8&&_0x537770[_0xb5f2c6(0xe6)]&&printSchemaFields(_0x537770[_0xb5f2c6(0xe6)],_0x439962+0x1);}}export class ConnectionListCommand extends BaseCommand{[a20_0x5e6fd0(0x114)]=a20_0x5e6fd0(0x109);[a20_0x5e6fd0(0xc3)]=a20_0x5e6fd0(0xda);async[a20_0x5e6fd0(0xc2)](_0x5776d0){const _0x336471=a20_0x5e6fd0,{options:_0x30c9a0,tdx:_0x455d3a}=_0x5776d0;_0x30c9a0[_0x336471(0xb8)]&&console['error'](_0x336471(0xe8)+_0x30c9a0[_0x336471(0xd1)]);const _0x49c659=resolveLimit(_0x30c9a0[_0x336471(0x10b)],DEFAULT_LISTING_LIMIT),_0x152e49=await withSpinner(_0x336471(0x10f),()=>_0x455d3a[_0x336471(0xff)][_0x336471(0x112)](),{'verbose':_0x30c9a0[_0x336471(0xb8)]}),_0x307fa6=_0x152e49[_0x336471(0x10e)];console[_0x336471(0xea)](_0x336471(0xfe)+_0x307fa6[_0x336471(0xb1)]+'\x20connection'+(_0x307fa6[_0x336471(0xb1)]!==0x1?'s':''));if(isStructuredFormat(_0x30c9a0)){const _0x48ca9d=_0x307fa6[_0x336471(0x10c)](0x0,_0x49c659);await handleSDKOutput(_0x48ca9d,{..._0x30c9a0,'limit':_0x49c659});}else{const _0x5c93b4=_0x307fa6[_0x336471(0xb1)]>0x0?Math['max'](..._0x307fa6[_0x336471(0xaf)](_0x4deeba=>_0x4deeba[_0x336471(0xc5)]['length'])):0x0,_0x82ce14=[];for(const _0x207d96 of _0x307fa6){const _0x3214c7=a20_0x4d7dbf[_0x336471(0xf1)](_0x207d96[_0x336471(0xc5)][_0x336471(0xd8)](_0x5c93b4)),_0x43cf61=_0x207d96[_0x336471(0xbe)]?.[_0x336471(0x114)]?_0x336471(0xca)+a20_0x4d7dbf[_0x336471(0xba)](_0x207d96[_0x336471(0xbe)]['name']):'';_0x82ce14[_0x336471(0xbc)](_0x3214c7+'\x20\x20'+_0x207d96['name']+_0x43cf61);}await writeOutput(_0x82ce14[_0x336471(0x108)]('\x0a'),_0x30c9a0[_0x336471(0xcc)],_0x336471(0xb7));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']=a20_0x5e6fd0(0xe0);['description']=a20_0x5e6fd0(0xfa);[a20_0x5e6fd0(0xee)](_0x5f1ebc){const {args:_0x3cb24b}=_0x5f1ebc;if(!_0x3cb24b[0x0])return'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';return undefined;}async[a20_0x5e6fd0(0xc2)](_0x46c5eb){const _0xcb56d0=a20_0x5e6fd0,{options:_0x5ec1e7,args:_0x33986e,tdx:_0x1b0e70}=_0x46c5eb,_0x3404f9=_0x33986e[0x0];_0x5ec1e7['verbose']&&(console[_0xcb56d0(0xea)](_0xcb56d0(0xe8)+_0x5ec1e7['site']),console[_0xcb56d0(0xea)](_0xcb56d0(0xf7)+_0x3404f9));const _0x5e7ee4=await withSpinner(_0xcb56d0(0x110)+_0x3404f9+_0xcb56d0(0xd4),()=>_0x1b0e70['connection'][_0xcb56d0(0xc7)](_0x3404f9),{'verbose':_0x5ec1e7[_0xcb56d0(0xb8)]}),_0x3e6104=_0x5e7ee4[_0xcb56d0(0x10e)];return console[_0xcb56d0(0xea)](_0xcb56d0(0xbb)+_0x3e6104[_0xcb56d0(0x114)]),await handleSingleObjectOutput(_0x3e6104,_0x5ec1e7),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a20_0x5e6fd0(0x114)]=a20_0x5e6fd0(0xde);[a20_0x5e6fd0(0xc3)]=a20_0x5e6fd0(0xcd);['validate'](_0x279a38){const _0x5af055=a20_0x5e6fd0,{args:_0x1e31a0}=_0x279a38;if(!_0x1e31a0[0x0])return _0x5af055(0xbf);return undefined;}async[a20_0x5e6fd0(0xc2)](_0x57c052){const _0x3ae466=a20_0x5e6fd0,{options:_0x2edfdd,args:_0x2ab359,tdx:_0x2ce5ff}=_0x57c052,_0x4dbeeb=_0x2ab359[0x0];_0x2edfdd[_0x3ae466(0xb8)]&&(console[_0x3ae466(0xea)](_0x3ae466(0xe8)+_0x2edfdd[_0x3ae466(0xd1)]),console[_0x3ae466(0xea)]('Resolving\x20connector\x20type\x20or\x20name:\x20'+_0x4dbeeb));let _0x2d6fed=_0x4dbeeb,_0x5b8280;try{const _0x376492=await _0x2ce5ff['connection'][_0x3ae466(0xed)](_0x4dbeeb);_0x376492&&(_0x2d6fed=_0x376492[_0x3ae466(0xc5)],_0x5b8280=_0x376492[_0x3ae466(0x114)],_0x2edfdd[_0x3ae466(0xb8)]&&console[_0x3ae466(0xea)](_0x3ae466(0xe2)+_0x4dbeeb+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x2d6fed));}catch{_0x2edfdd['verbose']&&console['error']('Treating\x20\x27'+_0x4dbeeb+'\x27\x20as\x20connector\x20type');}const _0x2c224e=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x2d6fed+_0x3ae466(0xd4),()=>_0x2ce5ff[_0x3ae466(0xff)][_0x3ae466(0x103)](_0x2d6fed),{'verbose':_0x2edfdd[_0x3ae466(0xb8)]}),_0x2cab66=_0x2c224e[_0x3ae466(0x10e)];_0x5b8280?console['error'](_0x3ae466(0xf2)+_0x5b8280+_0x3ae466(0xdf)+_0x2d6fed+')'):console[_0x3ae466(0xea)]('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x2d6fed);if(isStructuredFormat(_0x2edfdd))await handleSingleObjectOutput(_0x2cab66,_0x2edfdd);else{const _0x55eb8d=normalizeSchemaForDisplay(_0x2cab66);_0x5b8280?(console['log'](_0x3ae466(0xf0)+a20_0x4d7dbf[_0x3ae466(0xf1)](_0x5b8280)),console[_0x3ae466(0xb6)](_0x3ae466(0xe3)+a20_0x4d7dbf[_0x3ae466(0xba)](_0x2d6fed))):console['log'](_0x3ae466(0xb9)+a20_0x4d7dbf[_0x3ae466(0xf1)](_0x2d6fed)),_0x55eb8d[_0x3ae466(0xb1)]>0x0?(console[_0x3ae466(0xb6)](a20_0x4d7dbf[_0x3ae466(0xd0)](_0x3ae466(0xc8))),printSchemaFields(_0x55eb8d,0x0)):console[_0x3ae466(0xb6)](a20_0x4d7dbf[_0x3ae466(0xba)](_0x3ae466(0xc6)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a20_0x5e6fd0(0x114)]='connection:types';[a20_0x5e6fd0(0xc3)]='List\x20available\x20connector\x20types';async[a20_0x5e6fd0(0xc2)](_0x57ce08){const _0xaccee=a20_0x5e6fd0,{options:_0x3c9be5,tdx:_0x5c2b50}=_0x57ce08;_0x3c9be5[_0xaccee(0xb8)]&&console[_0xaccee(0xea)](_0xaccee(0xe8)+_0x3c9be5[_0xaccee(0xd1)]);const _0x91dad3=await withSpinner(_0xaccee(0xad),()=>_0x5c2b50[_0xaccee(0xff)]['listTypes'](),{'verbose':_0x3c9be5[_0xaccee(0xb8)]}),_0x2de767=_0x91dad3['data'][_0xaccee(0xfc)]((_0x12eb24,_0x3a6961)=>_0x12eb24['type'][_0xaccee(0xdb)](_0x3a6961[_0xaccee(0xc5)]));console['error'](_0xaccee(0xfe)+_0x2de767[_0xaccee(0xb1)]+_0xaccee(0xd2)+(_0x2de767['length']!==0x1?'s':''));if(isStructuredFormat(_0x3c9be5))await handleSDKOutput(_0x2de767,_0x3c9be5);else{const _0x1d22e0=_0x2de767[_0xaccee(0xb1)]>0x0?Math[_0xaccee(0x102)](..._0x2de767[_0xaccee(0xaf)](_0x2ea5c4=>_0x2ea5c4[_0xaccee(0xc5)][_0xaccee(0xb1)])):0x0,_0x1e352f=[];for(const _0x326860 of _0x2de767){const _0x4a659f=a20_0x4d7dbf[_0xaccee(0xf1)](_0x326860[_0xaccee(0xc5)][_0xaccee(0xd8)](_0x1d22e0));_0x1e352f[_0xaccee(0xbc)](_0x4a659f+'\x20\x20'+_0x326860['name']);}await writeOutput(_0x1e352f['join']('\x0a'),_0x3c9be5[_0xaccee(0xcc)],_0xaccee(0xb7));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{['name']=a20_0x5e6fd0(0xe4);[a20_0x5e6fd0(0xc3)]=a20_0x5e6fd0(0xb3);['validate'](_0x3f7194){const _0x3cfdc9=a20_0x5e6fd0,{args:_0x1c7f35}=_0x3f7194;if(!_0x1c7f35[0x0])return _0x3cfdc9(0x10a);return undefined;}async[a20_0x5e6fd0(0xc2)](_0x2de89f){const _0x3fcb78=a20_0x5e6fd0,{options:_0x6dea6,args:_0x2ad2bc,tdx:_0x5695f8}=_0x2de89f,_0x1ef465=_0x2ad2bc[0x0];_0x6dea6[_0x3fcb78(0xb8)]&&(console['error'](_0x3fcb78(0xe8)+_0x6dea6[_0x3fcb78(0xd1)]),console[_0x3fcb78(0xea)](_0x3fcb78(0xcb)+_0x1ef465));const _0x389123=await withSpinner(_0x3fcb78(0x107)+_0x1ef465+_0x3fcb78(0xd4),()=>_0x5695f8[_0x3fcb78(0xff)]['getMetadata'](_0x1ef465),{'verbose':_0x6dea6[_0x3fcb78(0xb8)]}),_0xe7cf18=_0x389123[_0x3fcb78(0x10e)];console[_0x3fcb78(0xea)](_0x3fcb78(0x105)+_0x1ef465);if(isStructuredFormat(_0x6dea6))await handleSingleObjectOutput(_0xe7cf18,_0x6dea6);else{console[_0x3fcb78(0xb6)](_0x3fcb78(0xb9)+a20_0x4d7dbf[_0x3fcb78(0xf1)](_0x1ef465)),console[_0x3fcb78(0xb6)](_0x3fcb78(0xc9)+_0xe7cf18[_0x3fcb78(0x114)]);const _0xf9c858=_0xe7cf18[_0x3fcb78(0x101)]||[],_0x530395=_0xf9c858[_0x3fcb78(0xef)](_0x4e548f=>_0x4e548f[_0x3fcb78(0xc4)]);_0x530395[_0x3fcb78(0xb1)]>0x0&&(console['log'](a20_0x4d7dbf[_0x3fcb78(0xd0)](_0x3fcb78(0xd7))),printMetadataSettings(_0x530395));let _0x329d7e=![];try{const _0x3fb76e=await _0x5695f8[_0x3fcb78(0xff)][_0x3fcb78(0x103)](_0x1ef465),_0x36d3c8=normalizeSchemaForDisplay(_0x3fb76e);_0x36d3c8['length']>0x0&&(console[_0x3fcb78(0xb6)](a20_0x4d7dbf[_0x3fcb78(0xd0)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x36d3c8,0x0),_0x329d7e=!![]);}catch{const _0x2060c2=_0xf9c858[_0x3fcb78(0xef)](_0x55d21c=>!_0x55d21c['credential']);_0x2060c2[_0x3fcb78(0xb1)]>0x0&&(console[_0x3fcb78(0xb6)](a20_0x4d7dbf[_0x3fcb78(0xd0)](_0x3fcb78(0xc8))),printMetadataSettings(_0x2060c2),_0x329d7e=!![]);}!_0x329d7e&&_0x6dea6['verbose']&&console[_0x3fcb78(0xea)](a20_0x4d7dbf[_0x3fcb78(0xba)](_0x3fcb78(0x116))),_0x530395[_0x3fcb78(0xb1)]===0x0&&console[_0x3fcb78(0xb6)](a20_0x4d7dbf['dim']('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function printMetadataSettings(_0xf27318){const _0x40a936=a20_0x5e6fd0;for(const _0x32ea88 of _0xf27318){if(!_0x32ea88[_0x40a936(0x114)])continue;if(_0x32ea88[_0x40a936(0xec)])continue;let _0x41b78e='\x20\x20'+a20_0x4d7dbf[_0x40a936(0xd6)](_0x32ea88['name']);_0x32ea88[_0x40a936(0xce)]&&(_0x41b78e+=':\x20'+_0x32ea88[_0x40a936(0xce)]);_0x32ea88[_0x40a936(0xc5)]&&(_0x41b78e+=a20_0x4d7dbf[_0x40a936(0xba)]('\x20['+_0x32ea88[_0x40a936(0xc5)]+']'));console['log'](_0x41b78e);_0x32ea88[_0x40a936(0xf9)]&&console[_0x40a936(0xb6)](_0x40a936(0xdd)+a20_0x4d7dbf[_0x40a936(0xba)](_0x32ea88[_0x40a936(0xf9)]));if(_0x32ea88[_0x40a936(0xe9)]){const _0x6938ac=_0x32ea88['options'][_0x40a936(0xaf)](_0x3d70a5=>_0x3d70a5[_0x40a936(0xc1)])[_0x40a936(0x108)](',\x20');console[_0x40a936(0xb6)](_0x40a936(0xf8)+a20_0x4d7dbf['yellow'](_0x6938ac));}_0x32ea88[_0x40a936(0xb4)]!==undefined&&_0x32ea88[_0x40a936(0xb4)]!==null&&console['log'](_0x40a936(0xd5)+a20_0x4d7dbf[_0x40a936(0xb5)](String(_0x32ea88[_0x40a936(0xb4)])));if(_0x32ea88[_0x40a936(0xc0)]){const _0x18dd1c=Object[_0x40a936(0xeb)](_0x32ea88[_0x40a936(0xc0)])[_0x40a936(0xaf)](([_0x3f4da4,_0x35a63b])=>_0x3f4da4+'='+JSON[_0x40a936(0xac)](_0x35a63b))[_0x40a936(0x108)](',\x20');console[_0x40a936(0xb6)](_0x40a936(0xdd)+a20_0x4d7dbf[_0x40a936(0xba)](_0x40a936(0xe7)+_0x18dd1c));}}}function a20_0x5367(){const _0x9a7df4=['Type:\x20','connection:settings','789wAMfPN','properties','Show\x20when:\x20','Site:\x20','options','error','entries','hidden','findByName','validate','filter','\x0aConnection:\x20','cyan','✔\x20Found\x20schema\x20for\x20connection\x20\x27','legacy_settings','legacy','enumeration','minimum','Looking\x20up\x20connection:\x20','\x20\x20\x20\x20Options:\x20','hint','Show\x20connection\x20details','maximum','sort','find','✔\x20Found\x20','connection','7779191lRPZkh','settings','max','getOutputSchema','29983275dRuKsi','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','yellow','Fetching\x20settings\x20for\x20\x27','join','connection:list','Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.','limit','slice','repeat','data','Listing\x20connections...','Fetching\x20connection\x20\x27','3397434VbkrlD','list','Range:\x20','name','398QYaart','No\x20available\x20fields\x20for\x20this\x20connector','title','stringify','Listing\x20connector\x20types...','8xyNlvs','map','4848360zFGgwt','length','record','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','default_value','blue','log','table','verbose','\x0aConnector:\x20','dim','✔\x20Found\x20connection:\x20','push','\x20[record]','owner','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.','criteria','value','execute','description','credential','type','\x0aNo\x20fields\x20defined\x20in\x20schema','resolve','\x0aAvailable\x20fields:','Name:\x20','\x20-\x20','Fetching\x20settings\x20for\x20connector\x20type:\x20','output','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','label','>=\x20','bold','site','\x20connector\x20type','2071556tGhSUo','\x27...','\x20\x20\x20\x20Default:\x20','green','\x0aCredential\x20settings:','padStart','input','List\x20all\x20result\x20output\x20connections','localeCompare','391153SncPva','\x20\x20\x20\x20','connection:schema','\x27\x20(type:\x20','connection:show','<=\x20','✔\x20Resolved\x20\x27'];a20_0x5367=function(){return _0x9a7df4;};return a20_0x5367();}
|
|
1
|
+
const a20_0x9fd3e8=a20_0x27f3;(function(_0x32041c,_0x374793){const _0x35c427=a20_0x27f3,_0x5c7d52=_0x32041c();while(!![]){try{const _0x24dad5=parseInt(_0x35c427(0x164))/0x1*(parseInt(_0x35c427(0x166))/0x2)+-parseInt(_0x35c427(0x133))/0x3+-parseInt(_0x35c427(0x125))/0x4*(-parseInt(_0x35c427(0x129))/0x5)+parseInt(_0x35c427(0x121))/0x6*(-parseInt(_0x35c427(0x15f))/0x7)+-parseInt(_0x35c427(0x169))/0x8+-parseInt(_0x35c427(0x111))/0x9*(parseInt(_0x35c427(0x119))/0xa)+parseInt(_0x35c427(0x117))/0xb;if(_0x24dad5===_0x374793)break;else _0x5c7d52['push'](_0x5c7d52['shift']());}catch(_0x439774){_0x5c7d52['push'](_0x5c7d52['shift']());}}}(a20_0x4d3b,0xdc57b));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import a20_0x359c93 from'chalk';function normalizeSchemaForDisplay(_0x5e972c){const _0x515770=a20_0x27f3,_0xc2ae61=_0x5e972c[_0x515770(0x15b)]||[],_0x50197a=_0xc2ae61[_0x515770(0x12e)](_0x4ffe00=>_0x4ffe00[_0x515770(0x132)]===_0x515770(0x137)&&_0x4ffe00[_0x515770(0x168)]===_0x515770(0x12b)&&_0x4ffe00[_0x515770(0x15b)]);if(_0x50197a?.['properties']){const _0x1e7210=_0xc2ae61['filter'](_0x27dd84=>_0x27dd84[_0x515770(0x132)]!==_0x515770(0x105)&&_0x27dd84['name']!==_0x515770(0x137));return[..._0x1e7210,..._0x50197a[_0x515770(0x15b)]];}return _0xc2ae61[_0x515770(0x10d)](_0x5dfca6=>_0x5dfca6['name']!==_0x515770(0x105));}function printSchemaFields(_0x312ed2,_0x2a021c){const _0x24b20b=a20_0x27f3,_0x3a820e='\x20\x20'[_0x24b20b(0x131)](_0x2a021c+0x1),_0x5dffcf='\x20\x20'[_0x24b20b(0x131)](_0x2a021c+0x2);for(const _0xb75705 of _0x312ed2){if(!_0xb75705[_0x24b20b(0x132)])continue;const _0x416f91=_0xb75705['type']===_0x24b20b(0x12b)&&_0xb75705[_0x24b20b(0x15b)]&&_0xb75705['properties']['length']>0x0&&_0xb75705[_0x24b20b(0x132)]!==_0x24b20b(0x137);let _0x23f5bb=''+_0x3a820e+a20_0x359c93[_0x24b20b(0x143)](_0xb75705[_0x24b20b(0x132)]);_0xb75705['title']&&(_0x23f5bb+=':\x20'+_0xb75705[_0x24b20b(0x130)]);if(_0xb75705[_0x24b20b(0x161)])_0x23f5bb+=a20_0x359c93[_0x24b20b(0x11b)]('\x20['+_0xb75705[_0x24b20b(0x161)]+']');else _0x416f91&&(_0x23f5bb+=a20_0x359c93[_0x24b20b(0x11b)](_0x24b20b(0x12a)));console[_0x24b20b(0x162)](_0x23f5bb);_0xb75705[_0x24b20b(0x12c)]&&console[_0x24b20b(0x162)](''+_0x5dffcf+a20_0x359c93[_0x24b20b(0x11b)](_0xb75705[_0x24b20b(0x12c)]));if(_0xb75705[_0x24b20b(0x16d)]){const _0xac53b5=_0xb75705[_0x24b20b(0x16d)][_0x24b20b(0x138)](_0xc18376=>typeof _0xc18376===_0x24b20b(0x13d)&&_0x24b20b(0x100)in _0xc18376?_0xc18376['value']:_0xc18376)['join'](',\x20');console['log'](_0x5dffcf+_0x24b20b(0x115)+a20_0x359c93[_0x24b20b(0x10a)](_0xac53b5));}_0xb75705[_0x24b20b(0x14d)]!==undefined&&console['log'](_0x5dffcf+_0x24b20b(0x156)+a20_0x359c93[_0x24b20b(0x165)](String(_0xb75705[_0x24b20b(0x14d)])));if(_0xb75705[_0x24b20b(0x112)]!==undefined||_0xb75705[_0x24b20b(0x151)]!==undefined){const _0x4aa390=_0xb75705['minimum']!==undefined&&_0xb75705[_0x24b20b(0x151)]!==undefined?_0xb75705[_0x24b20b(0x112)]+_0x24b20b(0x10b)+_0xb75705['maximum']:_0xb75705[_0x24b20b(0x112)]!==undefined?_0x24b20b(0x127)+_0xb75705['minimum']:_0x24b20b(0x106)+_0xb75705[_0x24b20b(0x151)];console['log'](_0x5dffcf+_0x24b20b(0x118)+a20_0x359c93['blue'](_0x4aa390));}if(_0xb75705['criteria']){const _0x4fbe5c=Object[_0x24b20b(0x109)](_0xb75705['criteria'])[_0x24b20b(0x138)](([_0x225d5d,_0xb4c249])=>_0x225d5d+'='+JSON['stringify'](_0xb4c249))[_0x24b20b(0x14c)](',\x20');console['log'](''+_0x5dffcf+a20_0x359c93[_0x24b20b(0x11b)]('Show\x20when:\x20'+_0x4fbe5c));}_0x416f91&&_0xb75705['properties']&&printSchemaFields(_0xb75705[_0x24b20b(0x15b)],_0x2a021c+0x1);}}export class ConnectionListCommand extends BaseCommand{[a20_0x9fd3e8(0x132)]=a20_0x9fd3e8(0x139);[a20_0x9fd3e8(0x12c)]=a20_0x9fd3e8(0x150);async[a20_0x9fd3e8(0x163)](_0x273d62){const _0x35dabb=a20_0x9fd3e8,{options:_0x2b96e5,tdx:_0x59e70c}=_0x273d62;_0x2b96e5[_0x35dabb(0x104)]&&console[_0x35dabb(0x140)]('Site:\x20'+_0x2b96e5[_0x35dabb(0x11a)]);const _0x4d0b6c=resolveLimit(_0x2b96e5[_0x35dabb(0x154)],DEFAULT_LISTING_LIMIT),_0x4e5174=await withSpinner('Listing\x20connections...',()=>_0x59e70c[_0x35dabb(0x147)]['list'](),{'verbose':_0x2b96e5[_0x35dabb(0x104)]}),_0x344238=_0x4e5174[_0x35dabb(0x14e)];console['error']('✔\x20Found\x20'+_0x344238['length']+'\x20connection'+(_0x344238[_0x35dabb(0x141)]!==0x1?'s':''));if(isStructuredFormat(_0x2b96e5)){const _0x2d24f6=_0x344238[_0x35dabb(0x160)](0x0,_0x4d0b6c);await handleSDKOutput(_0x2d24f6,{..._0x2b96e5,'limit':_0x4d0b6c});}else{const _0x17cd4e=_0x344238['length']>0x0?Math[_0x35dabb(0x153)](..._0x344238['map'](_0x13d400=>_0x13d400[_0x35dabb(0x168)]['length'])):0x0,_0x2093ca=[];for(const _0x2324dc of _0x344238){const _0x5109ce=a20_0x359c93[_0x35dabb(0x13e)](_0x2324dc['type']['padStart'](_0x17cd4e)),_0xa36f3d=_0x2324dc[_0x35dabb(0x10c)]?.['name']?_0x35dabb(0x10b)+a20_0x359c93[_0x35dabb(0x11b)](_0x2324dc['owner']['name']):'';_0x2093ca[_0x35dabb(0x152)](_0x5109ce+'\x20\x20'+_0x2324dc[_0x35dabb(0x132)]+_0xa36f3d);}await writeOutput(_0x2093ca[_0x35dabb(0x14c)]('\x0a'),_0x2b96e5['output'],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a20_0x9fd3e8(0x132)]=a20_0x9fd3e8(0x113);[a20_0x9fd3e8(0x12c)]=a20_0x9fd3e8(0x157);['validate'](_0x15d7f4){const _0x1e4d78=a20_0x9fd3e8,{args:_0x166715}=_0x15d7f4;if(!_0x166715[0x0])return _0x1e4d78(0x158);return undefined;}async[a20_0x9fd3e8(0x163)](_0x4882b4){const _0x56af5c=a20_0x9fd3e8,{options:_0xdb3ad7,args:_0xcfd092,tdx:_0x4b74ab}=_0x4882b4,_0x84cf87=_0xcfd092[0x0];_0xdb3ad7[_0x56af5c(0x104)]&&(console[_0x56af5c(0x140)](_0x56af5c(0x167)+_0xdb3ad7['site']),console[_0x56af5c(0x140)]('Looking\x20up\x20connection:\x20'+_0x84cf87));const _0x5b3787=await withSpinner('Fetching\x20connection\x20\x27'+_0x84cf87+_0x56af5c(0x145),()=>_0x4b74ab[_0x56af5c(0x147)]['resolve'](_0x84cf87),{'verbose':_0xdb3ad7[_0x56af5c(0x104)]}),_0x3b4aeb=_0x5b3787['data'];return console[_0x56af5c(0x140)](_0x56af5c(0x108)+_0x3b4aeb[_0x56af5c(0x132)]),await handleSingleObjectOutput(_0x3b4aeb,_0xdb3ad7),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a20_0x9fd3e8(0x132)]=a20_0x9fd3e8(0x14a);['description']=a20_0x9fd3e8(0x144);['validate'](_0x58abdb){const _0x28e96e=a20_0x9fd3e8,{args:_0xd525c6}=_0x58abdb;if(!_0xd525c6[0x0])return _0x28e96e(0x14b);return undefined;}async[a20_0x9fd3e8(0x163)](_0x1ed333){const _0x412ca9=a20_0x9fd3e8,{options:_0x462bb9,args:_0xf28325,tdx:_0x1869b9}=_0x1ed333,_0x1eb955=_0xf28325[0x0];_0x462bb9['verbose']&&(console[_0x412ca9(0x140)](_0x412ca9(0x167)+_0x462bb9[_0x412ca9(0x11a)]),console['error'](_0x412ca9(0x11c)+_0x1eb955));let _0x490782=_0x1eb955,_0x5c8d16;try{const _0x3f2637=await _0x1869b9[_0x412ca9(0x147)][_0x412ca9(0x13f)](_0x1eb955);_0x3f2637&&(_0x490782=_0x3f2637[_0x412ca9(0x168)],_0x5c8d16=_0x3f2637[_0x412ca9(0x132)],_0x462bb9['verbose']&&console[_0x412ca9(0x140)](_0x412ca9(0x11e)+_0x1eb955+_0x412ca9(0x122)+_0x490782));}catch{_0x462bb9['verbose']&&console[_0x412ca9(0x140)](_0x412ca9(0x15e)+_0x1eb955+'\x27\x20as\x20connector\x20type');}const _0x16c54e=await withSpinner(_0x412ca9(0x123)+_0x490782+_0x412ca9(0x145),()=>_0x1869b9[_0x412ca9(0x147)][_0x412ca9(0x107)](_0x490782),{'verbose':_0x462bb9[_0x412ca9(0x104)]}),_0x15da99=_0x16c54e[_0x412ca9(0x14e)];_0x5c8d16?console[_0x412ca9(0x140)](_0x412ca9(0x16c)+_0x5c8d16+_0x412ca9(0x135)+_0x490782+')'):console[_0x412ca9(0x140)](_0x412ca9(0x146)+_0x490782);if(isStructuredFormat(_0x462bb9))await handleSingleObjectOutput(_0x15da99,_0x462bb9);else{const _0x385f26=normalizeSchemaForDisplay(_0x15da99);_0x5c8d16?(console[_0x412ca9(0x162)](_0x412ca9(0x12f)+a20_0x359c93[_0x412ca9(0x13e)](_0x5c8d16)),console[_0x412ca9(0x162)]('Type:\x20'+a20_0x359c93[_0x412ca9(0x11b)](_0x490782))):console[_0x412ca9(0x162)]('\x0aConnector:\x20'+a20_0x359c93['cyan'](_0x490782)),_0x385f26[_0x412ca9(0x141)]>0x0?(console[_0x412ca9(0x162)](a20_0x359c93[_0x412ca9(0x13a)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x385f26,0x0)):console[_0x412ca9(0x162)](a20_0x359c93['dim'](_0x412ca9(0x10e)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a20_0x9fd3e8(0x132)]='connection:types';[a20_0x9fd3e8(0x12c)]=a20_0x9fd3e8(0x142);async[a20_0x9fd3e8(0x163)](_0x32498f){const _0x1a61ed=a20_0x9fd3e8,{options:_0x1a096f,tdx:_0x31f8cb}=_0x32498f;_0x1a096f[_0x1a61ed(0x104)]&&console[_0x1a61ed(0x140)](_0x1a61ed(0x167)+_0x1a096f['site']);const _0x2d7753=await withSpinner('Listing\x20connector\x20types...',()=>_0x31f8cb[_0x1a61ed(0x147)][_0x1a61ed(0x15d)](),{'verbose':_0x1a096f[_0x1a61ed(0x104)]}),_0x232f1c=_0x2d7753['data'][_0x1a61ed(0x116)]((_0x387fd8,_0x2c1370)=>_0x387fd8[_0x1a61ed(0x168)]['localeCompare'](_0x2c1370[_0x1a61ed(0x168)]));console[_0x1a61ed(0x140)](_0x1a61ed(0x110)+_0x232f1c[_0x1a61ed(0x141)]+_0x1a61ed(0x16e)+(_0x232f1c[_0x1a61ed(0x141)]!==0x1?'s':''));if(isStructuredFormat(_0x1a096f))await handleSDKOutput(_0x232f1c,_0x1a096f);else{const _0x158304=_0x232f1c[_0x1a61ed(0x141)]>0x0?Math[_0x1a61ed(0x153)](..._0x232f1c['map'](_0x92e1cb=>_0x92e1cb[_0x1a61ed(0x168)][_0x1a61ed(0x141)])):0x0,_0x37647d=[];for(const _0xcf694 of _0x232f1c){const _0x31ee07=a20_0x359c93[_0x1a61ed(0x13e)](_0xcf694[_0x1a61ed(0x168)][_0x1a61ed(0x103)](_0x158304));_0x37647d[_0x1a61ed(0x152)](_0x31ee07+'\x20\x20'+_0xcf694[_0x1a61ed(0x132)]);}await writeOutput(_0x37647d['join']('\x0a'),_0x1a096f[_0x1a61ed(0x15c)],_0x1a61ed(0x124));}return 0x0;}}function a20_0x4d3b(){const _0xd6ec97=['\x0aNo\x20credential\x20settings\x20defined','List\x20all\x20result\x20output\x20connections','maximum','push','max','limit','getMetadata','Default:\x20','Show\x20connection\x20details','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','\x20\x20\x20\x20','hint','properties','output','listTypes','Treating\x20\x27','42MeTKMK','slice','input','log','execute','1057885wBbpFI','blue','2wlXGWe','Site:\x20','type','14087856dqzuqZ','Fetching\x20settings\x20for\x20\x27','stringify','✔\x20Found\x20schema\x20for\x20connection\x20\x27','enumeration','\x20connector\x20type','Fetching\x20settings\x20for\x20connector\x20type:\x20','value','label','credential','padStart','verbose','legacy','<=\x20','getOutputSchema','✔\x20Found\x20connection:\x20','entries','yellow','\x20-\x20','owner','filter','\x0aNo\x20fields\x20defined\x20in\x20schema','\x20\x20\x20\x20Default:\x20','✔\x20Found\x20','987759nSgHno','minimum','connection:show','Show\x20when:\x20','Options:\x20','sort','36026881jrCiJO','Range:\x20','60FAARZg','site','dim','Resolving\x20connector\x20type\x20or\x20name:\x20','\x0aCredential\x20settings:','✔\x20Resolved\x20\x27','\x0aAvailable\x20fields:','hidden','605562omippN','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','Fetching\x20schema\x20for\x20\x27','table','4128xnTlhB','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.','>=\x20','Name:\x20','6685QgRcNp','\x20[record]','record','description','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','find','\x0aConnection:\x20','title','repeat','name','5355801MCjnXO','No\x20available\x20fields\x20for\x20this\x20connector','\x27\x20(type:\x20','connection:settings','legacy_settings','map','connection:list','bold','criteria','\x20\x20\x20\x20Options:\x20','object','cyan','findByName','error','length','List\x20available\x20connector\x20types','green','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','\x27...','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','connection','options','\x0aConnector:\x20','connection:schema','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.','join','default_value','data'];a20_0x4d3b=function(){return _0xd6ec97;};return a20_0x4d3b();}export class ConnectionSettingsCommand extends BaseCommand{['name']=a20_0x9fd3e8(0x136);[a20_0x9fd3e8(0x12c)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';['validate'](_0x28e5ef){const _0x55828d=a20_0x9fd3e8,{args:_0x3df89e}=_0x28e5ef;if(!_0x3df89e[0x0])return _0x55828d(0x126);return undefined;}async['execute'](_0x9d6485){const _0x2ae91b=a20_0x9fd3e8,{options:_0x5a54d9,args:_0x3ef57c,tdx:_0x3e99c4}=_0x9d6485,_0x51befa=_0x3ef57c[0x0];_0x5a54d9[_0x2ae91b(0x104)]&&(console['error']('Site:\x20'+_0x5a54d9[_0x2ae91b(0x11a)]),console[_0x2ae91b(0x140)](_0x2ae91b(0xff)+_0x51befa));const _0xd2bdef=await withSpinner(_0x2ae91b(0x16a)+_0x51befa+_0x2ae91b(0x145),()=>_0x3e99c4['connection'][_0x2ae91b(0x155)](_0x51befa),{'verbose':_0x5a54d9[_0x2ae91b(0x104)]}),_0x1df38e=_0xd2bdef['data'];console[_0x2ae91b(0x140)](_0x2ae91b(0x12d)+_0x51befa);if(isStructuredFormat(_0x5a54d9))await handleSingleObjectOutput(_0x1df38e,_0x5a54d9);else{console['log'](_0x2ae91b(0x149)+a20_0x359c93['cyan'](_0x51befa)),console['log'](_0x2ae91b(0x128)+_0x1df38e['name']);const _0x363b08=_0x1df38e['settings']||[],_0x159c0c=_0x363b08[_0x2ae91b(0x10d)](_0xc41eff=>_0xc41eff[_0x2ae91b(0x102)]);_0x159c0c[_0x2ae91b(0x141)]>0x0&&(console['log'](a20_0x359c93[_0x2ae91b(0x13a)](_0x2ae91b(0x11d))),printMetadataSettings(_0x159c0c));let _0x9105e1=![];try{const _0x26c781=await _0x3e99c4[_0x2ae91b(0x147)][_0x2ae91b(0x107)](_0x51befa),_0x4563be=normalizeSchemaForDisplay(_0x26c781);_0x4563be['length']>0x0&&(console[_0x2ae91b(0x162)](a20_0x359c93['bold']('\x0aAvailable\x20fields:')),printSchemaFields(_0x4563be,0x0),_0x9105e1=!![]);}catch{const _0x2c3ba2=_0x363b08[_0x2ae91b(0x10d)](_0x2e14d8=>!_0x2e14d8[_0x2ae91b(0x102)]);_0x2c3ba2['length']>0x0&&(console[_0x2ae91b(0x162)](a20_0x359c93[_0x2ae91b(0x13a)](_0x2ae91b(0x11f))),printMetadataSettings(_0x2c3ba2),_0x9105e1=!![]);}!_0x9105e1&&_0x5a54d9[_0x2ae91b(0x104)]&&console[_0x2ae91b(0x140)](a20_0x359c93[_0x2ae91b(0x11b)](_0x2ae91b(0x134))),_0x159c0c[_0x2ae91b(0x141)]===0x0&&console[_0x2ae91b(0x162)](a20_0x359c93['dim'](_0x2ae91b(0x14f)));}return 0x0;}}function a20_0x27f3(_0x3c71d5,_0xf823f9){_0x3c71d5=_0x3c71d5-0xff;const _0x4d3b59=a20_0x4d3b();let _0x27f386=_0x4d3b59[_0x3c71d5];return _0x27f386;}function printMetadataSettings(_0x116d34){const _0x22c886=a20_0x9fd3e8;for(const _0x5caf0a of _0x116d34){if(!_0x5caf0a[_0x22c886(0x132)])continue;if(_0x5caf0a[_0x22c886(0x120)])continue;let _0x12f31b='\x20\x20'+a20_0x359c93[_0x22c886(0x143)](_0x5caf0a[_0x22c886(0x132)]);_0x5caf0a['label']&&(_0x12f31b+=':\x20'+_0x5caf0a[_0x22c886(0x101)]);_0x5caf0a[_0x22c886(0x168)]&&(_0x12f31b+=a20_0x359c93[_0x22c886(0x11b)]('\x20['+_0x5caf0a[_0x22c886(0x168)]+']'));console[_0x22c886(0x162)](_0x12f31b);_0x5caf0a['hint']&&console[_0x22c886(0x162)](_0x22c886(0x159)+a20_0x359c93[_0x22c886(0x11b)](_0x5caf0a[_0x22c886(0x15a)]));if(_0x5caf0a['options']){const _0x5ad90c=_0x5caf0a[_0x22c886(0x148)][_0x22c886(0x138)](_0xf0838c=>_0xf0838c[_0x22c886(0x100)])[_0x22c886(0x14c)](',\x20');console['log'](_0x22c886(0x13c)+a20_0x359c93[_0x22c886(0x10a)](_0x5ad90c));}_0x5caf0a[_0x22c886(0x14d)]!==undefined&&_0x5caf0a['default_value']!==null&&console[_0x22c886(0x162)](_0x22c886(0x10f)+a20_0x359c93[_0x22c886(0x165)](String(_0x5caf0a['default_value'])));if(_0x5caf0a[_0x22c886(0x13b)]){const _0x3e058d=Object[_0x22c886(0x109)](_0x5caf0a['criteria'])['map'](([_0x4ed5f5,_0x23fda0])=>_0x4ed5f5+'='+JSON[_0x22c886(0x16b)](_0x23fda0))[_0x22c886(0x14c)](',\x20');console['log'](_0x22c886(0x159)+a20_0x359c93['dim'](_0x22c886(0x114)+_0x3e058d));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0xd4da75=a21_0x3899;(function(_0x5a3857,_0x537ebc){const _0x187161=a21_0x3899,_0x1fe763=_0x5a3857();while(!![]){try{const _0x5a6e81=parseInt(_0x187161(0x1de))/0x1+-parseInt(_0x187161(0x1d3))/0x2*(-parseInt(_0x187161(0x1cd))/0x3)+-parseInt(_0x187161(0x1e1))/0x4+-parseInt(_0x187161(0x1cc))/0x5*(parseInt(_0x187161(0x1ce))/0x6)+-parseInt(_0x187161(0x1e0))/0x7+parseInt(_0x187161(0x1da))/0x8+-parseInt(_0x187161(0x1d9))/0x9*(-parseInt(_0x187161(0x1d0))/0xa);if(_0x5a6e81===_0x537ebc)break;else _0x1fe763['push'](_0x1fe763['shift']());}catch(_0x5ec8a2){_0x1fe763['push'](_0x1fe763['shift']());}}}(a21_0x2dc2,0x95236));import{BaseCommand}from'./command.js';function a21_0x2dc2(){const _0x46cd19=['display','description','execute','debug','warn','18wocUFH','4314024suaIDs','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a','session','message','925609GSzkRC','Error:\x20','7259406MMSRef','3997680AtDKmP','displayWithSources','error','5IsEdsP','15KhSTxn','5829834xBrHGu','clear','10204950wiIdzk','Session\x20context\x20cleared\x20(session:\x20','yellow','45254VlinTE'];a21_0x2dc2=function(){return _0x46cd19;};return a21_0x2dc2();}import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';function a21_0x3899(_0x55fe39,_0x93d2de){_0x55fe39=_0x55fe39-0x1cb;const _0x2dc2fd=a21_0x2dc2();let _0x38994a=_0x2dc2fd[_0x55fe39];return _0x38994a;}import a21_0xcf861b from'chalk';export class ContextCommand extends BaseCommand{['name']='context';[a21_0xd4da75(0x1d5)]='Show\x20current\x20resolved\x20context';async[a21_0xd4da75(0x1d6)](_0x5dc0ed){const _0x424280=a21_0xd4da75,{options:_0x2a18b1}=_0x5dc0ed,_0x2d4df5=_0x2a18b1[_0x424280(0x1d7)],_0x21956e=_0x2a18b1[_0x424280(0x1cf)];console['warn'](a21_0xcf861b['yellow']('Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.')),console[_0x424280(0x1d8)](a21_0xcf861b[_0x424280(0x1d2)]('\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context')),console['warn'](a21_0xcf861b[_0x424280(0x1d2)](_0x424280(0x1db))),cleanExpiredSessions();try{if(_0x21956e){clearSessionContext(_0x2a18b1[_0x424280(0x1dc)]);const _0x13efa8=_0x2a18b1[_0x424280(0x1dc)]||getCurrentSessionPID()['toString']();return console['log'](_0x424280(0x1d1)+_0x13efa8+')'),0x0;}const _0x2aed17=new GlobalContext(_0x2a18b1);return _0x2d4df5?_0x2aed17[_0x424280(0x1e2)]():_0x2aed17[_0x424280(0x1d4)](),0x0;}catch(_0x56116e){return _0x56116e instanceof Error&&console[_0x424280(0x1cb)](_0x424280(0x1df)+_0x56116e[_0x424280(0x1dd)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x430399=a22_0x3f0a;(function(_0x40ee69,_0x214c5a){const _0x350604=a22_0x3f0a,_0x3f5945=_0x40ee69();while(!![]){try{const _0x968b94=parseInt(_0x350604(0x125))/0x1+-parseInt(_0x350604(0x11f))/0x2*(parseInt(_0x350604(0x115))/0x3)+-parseInt(_0x350604(0x124))/0x4*(parseInt(_0x350604(0x126))/0x5)+parseInt(_0x350604(0x10e))/0x6+parseInt(_0x350604(0x109))/0x7*(-parseInt(_0x350604(0x10d))/0x8)+-parseInt(_0x350604(0x114))/0x9*(-parseInt(_0x350604(0x120))/0xa)+parseInt(_0x350604(0x10c))/0xb;if(_0x968b94===_0x214c5a)break;else _0x3f5945['push'](_0x3f5945['shift']());}catch(_0x20ba7f){_0x3f5945['push'](_0x3f5945['shift']());}}}(a22_0x32ae,0x7974d));function a22_0x3f0a(_0x233ea1,_0xdac8bc){_0x233ea1=_0x233ea1-0x108;const _0x32aecb=a22_0x32ae();let _0x3f0a80=_0x32aecb[_0x233ea1];return _0x3f0a80;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a22_0x32ae(){const _0x5debe0=['site','2PhtPZm','10sobJcQ','name','query','\x20database','178916rLMttP','801931axDytV','60hkEwfn','✔\x20Found\x20','Listing\x20databases...','4375bAEUaq','error','limit','13238698JXAnez','12272gMHvMq','412446RhYBdT','execute','Pattern:\x20','data','Error:\x20','List\x20all\x20databases','3768696ycaTlo','1499853oiOjFw','\x20\x20Cause:\x20','length','Site:\x20','message','listDatabases','databases','verbose','cause'];a22_0x32ae=function(){return _0x5debe0;};return a22_0x32ae();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a22_0x430399(0x121)]=a22_0x430399(0x11b);['description']=a22_0x430399(0x113);async[a22_0x430399(0x10f)](_0x12d0ca){const _0x426c80=a22_0x430399,{options:_0x4a976f,args:_0x1e3bc7,tdx:_0xc74aef}=_0x12d0ca,_0x5e084b=_0x1e3bc7[0x0];try{_0x4a976f[_0x426c80(0x11c)]&&(console['error'](_0x426c80(0x118)+_0x4a976f[_0x426c80(0x11e)]),_0x5e084b&&console[_0x426c80(0x10a)](_0x426c80(0x110)+_0x5e084b));const _0x3a8539=resolveLimit(_0x4a976f[_0x426c80(0x10b)],DEFAULT_LISTING_LIMIT),_0x5242c7=await withSpinner(_0x426c80(0x108),()=>_0xc74aef[_0x426c80(0x122)][_0x426c80(0x11a)](_0x5e084b,_0x3a8539),{'verbose':_0x4a976f[_0x426c80(0x11c)]}),_0x52460f=_0x5242c7[_0x426c80(0x111)];return console[_0x426c80(0x10a)](_0x426c80(0x127)+_0x52460f['length']+_0x426c80(0x123)+(_0x52460f[_0x426c80(0x117)]!==0x1?'s':'')),await handleSDKOutput(_0x52460f,{..._0x4a976f,'limit':_0x3a8539}),0x0;}catch(_0xae9de5){if(_0xae9de5 instanceof SDKError)return console['error'](_0x426c80(0x112)+_0xae9de5[_0x426c80(0x119)]),_0xae9de5[_0x426c80(0x11d)]&&console['error'](_0x426c80(0x116)+_0xae9de5[_0x426c80(0x11d)]),0x1;throw _0xae9de5;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0x54b93d=a23_0x3918;(function(_0x27137c,_0x509649){const _0xa40d89=a23_0x3918,_0x41bef1=_0x27137c();while(!![]){try{const _0xd1389b=parseInt(_0xa40d89(0x65))/0x1+parseInt(_0xa40d89(0x82))/0x2+-parseInt(_0xa40d89(0x7c))/0x3+parseInt(_0xa40d89(0x7e))/0x4*(parseInt(_0xa40d89(0x7d))/0x5)+parseInt(_0xa40d89(0x84))/0x6+-parseInt(_0xa40d89(0x67))/0x7*(-parseInt(_0xa40d89(0x6b))/0x8)+-parseInt(_0xa40d89(0x7a))/0x9*(parseInt(_0xa40d89(0x75))/0xa);if(_0xd1389b===_0x509649)break;else _0x41bef1['push'](_0x41bef1['shift']());}catch(_0xfb099c){_0x41bef1['push'](_0x41bef1['shift']());}}}(a23_0x27a6,0x79873));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a23_0x27a6(){const _0x47e3f8=['10RCsaqZ','database','describeTable','Describe\x20table\x20schema','execute','15993153scBaQd','Error:\x20','2329251TxAbMw','279895GVrVEq','20AxkYmt','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','name','query','577734oDPVdY','\x20column','5715048bYtzSS','table','\x27\x20does\x20not\x20exist','Table\x20\x27','describe','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','538178KLUkOX','\x20\x20Cause:\x20','6942355StgZAz','Database:\x20','args','\x20in\x20','8dXvPQX','error','Describing\x20table\x20','site','...','length','Site:\x20','data','description','verbose'];a23_0x27a6=function(){return _0x47e3f8;};return a23_0x27a6();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a23_0x3918(_0x4ffdb0,_0x1deb1f){_0x4ffdb0=_0x4ffdb0-0x65;const _0x27a61d=a23_0x27a6();let _0x391856=_0x27a61d[_0x4ffdb0];return _0x391856;}export class DescribeCommand extends BaseCommand{[a23_0x54b93d(0x80)]=a23_0x54b93d(0x88);[a23_0x54b93d(0x73)]=a23_0x54b93d(0x78);async[a23_0x54b93d(0x79)](_0x21c9ce){const _0x44e788=a23_0x54b93d;return this[_0x44e788(0x77)](_0x21c9ce);}async[a23_0x54b93d(0x77)](_0x14f281){const _0x1c5bda=a23_0x54b93d,{options:_0x2b4f1b,args:_0xe10fc0,tdx:_0x426dd9}=_0x14f281;let _0x5d6e4c;try{_0x5d6e4c=parseTableReference(_0xe10fc0[0x0]);const _0xe842e7=_0x2b4f1b['database'];!_0x5d6e4c[_0x1c5bda(0x76)]&&_0xe842e7&&(_0x5d6e4c[_0x1c5bda(0x76)]=_0xe842e7);const _0x28769d=validateTableDescribeReference(_0x5d6e4c);if(_0x28769d)return console[_0x1c5bda(0x6c)](_0x1c5bda(0x7b)+_0x28769d),0x1;}catch(_0x15e5c4){return console['error'](_0x1c5bda(0x7b)+_0x15e5c4['message']),0x1;}const _0x3157ac=_0x5d6e4c[_0x1c5bda(0x76)],_0x44f1d4=_0x5d6e4c[_0x1c5bda(0x85)];try{_0x2b4f1b[_0x1c5bda(0x74)]&&(console[_0x1c5bda(0x6c)](_0x1c5bda(0x71)+_0x2b4f1b[_0x1c5bda(0x6e)]),console[_0x1c5bda(0x6c)](_0x1c5bda(0x68)+_0x3157ac),console[_0x1c5bda(0x6c)]('Table:\x20'+_0x44f1d4));const _0x2dd87d=await withSpinner(_0x1c5bda(0x6d)+_0x3157ac+'.'+_0x44f1d4+_0x1c5bda(0x6f),()=>_0x426dd9[_0x1c5bda(0x81)][_0x1c5bda(0x77)](_0x3157ac,_0x44f1d4),{'verbose':_0x2b4f1b[_0x1c5bda(0x74)]}),_0x4bbf9a=_0x2dd87d[_0x1c5bda(0x72)];if(_0x4bbf9a[_0x1c5bda(0x70)]===0x0)return console[_0x1c5bda(0x6c)]('✖\x20Table\x20not\x20found'),console[_0x1c5bda(0x6c)](_0x1c5bda(0x87)+_0x3157ac+'.'+_0x44f1d4+_0x1c5bda(0x86)),0x1;return console[_0x1c5bda(0x6c)]('✔\x20Found\x20'+_0x4bbf9a[_0x1c5bda(0x70)]+_0x1c5bda(0x83)+(_0x4bbf9a[_0x1c5bda(0x70)]!==0x1?'s':'')+_0x1c5bda(0x6a)+_0x3157ac+'.'+_0x44f1d4),await handleSDKOutput(_0x4bbf9a,_0x2b4f1b),0x0;}catch(_0x15eb2d){if(_0x15eb2d instanceof SDKError)return console[_0x1c5bda(0x6c)]('Error:\x20'+_0x15eb2d['message']),_0x15eb2d['cause']&&console[_0x1c5bda(0x6c)](_0x1c5bda(0x66)+_0x15eb2d['cause']),0x1;throw _0x15eb2d;}}['validate'](_0x2e3d24){const _0x33bb49=a23_0x54b93d;if(_0x2e3d24[_0x33bb49(0x69)]['length']===0x0)return _0x33bb49(0x7f);if(_0x2e3d24['args'][_0x33bb49(0x70)]>0x1)return _0x33bb49(0x89);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x3481df=a24_0x114c;(function(_0x150954,_0x2f746b){const _0x39052e=a24_0x114c,_0x3cb7ac=_0x150954();while(!![]){try{const _0x358784=-parseInt(_0x39052e(0x20d))/0x1+-parseInt(_0x39052e(0x1d7))/0x2*(parseInt(_0x39052e(0x1bb))/0x3)+parseInt(_0x39052e(0x216))/0x4*(parseInt(_0x39052e(0x215))/0x5)+-parseInt(_0x39052e(0x1f1))/0x6*(parseInt(_0x39052e(0x21e))/0x7)+-parseInt(_0x39052e(0x1d9))/0x8*(-parseInt(_0x39052e(0x1df))/0x9)+-parseInt(_0x39052e(0x202))/0xa*(-parseInt(_0x39052e(0x192))/0xb)+parseInt(_0x39052e(0x20a))/0xc;if(_0x358784===_0x2f746b)break;else _0x3cb7ac['push'](_0x3cb7ac['shift']());}catch(_0x2c1c94){_0x3cb7ac['push'](_0x3cb7ac['shift']());}}}(a24_0x5267,0xc3155));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';function a24_0x5267(){const _0x43bf61=['Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','215170GlpRMC','subject','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','emailSenderId','engage:campaign:resume','resolvePathToResource','updateCampaign','Create\x20an\x20email\x20template','35331504JiRuQK','Show\x20workspace\x20details','updateTemplate','1581973sEepRh','startAt','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','session','engage:template:update','engage:workspace:use','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaigns','15aZnXCv','1243604GctzgQ','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','engage:workspace:create','Duplicate\x20a\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','engage:template:show','MISSING_ARGUMENT','plaintext','77qgCBaW','Delete\x20a\x20workspace','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','listWorkspaces','\x27...','engage:workspaces','55LkiGGx','entries','Error:\x20--name\x20is\x20required','engage:workspace:update','resumeCampaign','duplicateCampaign','engage:workspace:show','Error:\x20--html\x20is\x20required','Engage\x20workspace\x20set\x20to:\x20','engage_workspace','Error:\x20Workspace\x20name\x20is\x20required','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Fetching\x20campaigns...','filter','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Pausing\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','\x27\x20deleted\x20successfully','Show\x20email\x20template\x20details','Updating\x20campaign\x20\x27','Template\x20\x27','createCampaign','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','getWorkspace','Launch\x20a\x20campaign','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Delete\x20an\x20email\x20template','html','Fetching\x20template\x20\x27','fromEntries','engage:template:delete','Creating\x20workspace\x20\x27','yes','Launching\x20campaign\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:campaign:update','engage:template:create','resolveWorkspaceId','limit','357fJcapF','type','engage:campaign:duplicate','timezone','listTemplates','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Resuming\x20campaign\x20\x27','Deleting\x20template\x20\x27','Show\x20campaign\x20details','editorType','parentName','engage:campaign:create','List\x20workspaces','Update\x20a\x20campaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Campaign\x20\x27','full','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Workspace\x20is\x20required\x20for\x20this\x20operation','deleteTemplate','createWorkspace','description','Fetching\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','getTemplate','Creating\x20template\x20\x27','name','Create\x20a\x20new\x20campaign','20406fxqMvg','Fetching\x20workspaces...','405736GtfUba','Duplicating\x20campaign\x20\x27','verbose','updateWorkspace','\x27?\x20This\x20cannot\x20be\x20undone.','deleteWorkspace','198jfFVey','keys','status','engage:campaign:delete','engage:workspace:delete','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','length','deleteCampaign','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','\x27\x20resumed\x20successfully','Updating\x20workspace\x20\x27','listCampaigns','engage:templates','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Fetching\x20templates...','segmentId','execute','error','820998gjzFjK','Options:\x20--name,\x20--description','segmentName','getCampaign','engage','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','jsonColumns','Updating\x20template\x20\x27','Fetching\x20workspace\x20\x27','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','parentId','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','log','data','Operation\x20cancelled','Deleting\x20campaign\x20\x27'];a24_0x5267=function(){return _0x43bf61;};return a24_0x5267();}import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x32597c,_0x38da37,_0x3e5d29=![]){const _0x2246c1=a24_0x114c;if(_0x32597c['workspace'])return await _0x38da37['engage'][_0x2246c1(0x1b9)](_0x32597c['workspace']);const _0x55cda6=loadSessionContext(_0x32597c['session']);if(_0x55cda6?.[_0x2246c1(0x19b)])return await _0x38da37['engage'][_0x2246c1(0x1b9)](_0x55cda6[_0x2246c1(0x19b)]);if(_0x3e5d29)throw new SDKError(ErrorCode[_0x2246c1(0x21c)],_0x2246c1(0x1cd),undefined,{'helpText':_0x2246c1(0x217)});return undefined;}async function resolveSegmentFromOptions(_0xea13d9,_0x2e12e0){const _0x348c1a=a24_0x114c;if(!_0xea13d9['segment'])return{};const _0x587e12=_0xea13d9['segment'],_0x6eaf2=await _0x2e12e0['segment'][_0x348c1a(0x207)](_0x587e12);return{'audienceId':_0x6eaf2[_0x348c1a(0x1fb)],'audienceName':_0x6eaf2[_0x348c1a(0x1c5)],..._0x6eaf2['segmentId']&&{'segmentId':_0x6eaf2[_0x348c1a(0x1ee)],'segmentName':_0x6eaf2[_0x348c1a(0x1f3)]}};}function buildConnectorConfig(_0x529190){const _0x41c6a3=a24_0x114c,_0x2df141=_0x529190[_0x41c6a3(0x205)],_0x479529=_0x529190[_0x41c6a3(0x1f7)];if(!_0x2df141&&!_0x479529)return undefined;return{..._0x2df141&&{'emailSenderId':_0x2df141},..._0x479529&&{'jsonColumns':_0x479529}};}export class EngageCampaignsCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x214);['description']='List\x20campaigns';async[a24_0x3481df(0x1ef)](_0x938644){const _0xfa2d92=a24_0x3481df,{options:_0x14cefe,args:_0x4d8963,tdx:_0x3fdd11}=_0x938644,_0x314ea1=_0x4d8963[0x0],_0x395ba4=resolveLimit(_0x14cefe[_0xfa2d92(0x1ba)],DEFAULT_LLM_LIMIT),_0x11c789=_0x14cefe,_0x51ff8d=_0x11c789[_0xfa2d92(0x1bc)],_0x3ade46=_0x11c789[_0xfa2d92(0x1e1)],_0x50af3e=await resolveWorkspaceIdFromOptions(_0x11c789,_0x3fdd11),_0x524d98=await withSpinner(_0xfa2d92(0x19e),()=>_0x3fdd11[_0xfa2d92(0x1f5)][_0xfa2d92(0x1ea)]({'type':_0x51ff8d,'status':_0x3ade46,'workspaceId':_0x50af3e,'limit':_0x395ba4}),{'verbose':_0x14cefe['verbose']});let _0x3cb548=_0x524d98[_0xfa2d92(0x1fe)];return _0x314ea1&&(_0x3cb548=_0x524d98[_0xfa2d92(0x1fe)][_0xfa2d92(0x19f)](_0x1c5f35=>matchGlobPattern(_0x1c5f35[_0xfa2d92(0x1d5)],_0x314ea1))),await handleSDKOutput(_0x3cb548,_0x14cefe),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a24_0x3481df(0x1d5)]='engage:campaign:show';[a24_0x3481df(0x1d0)]=a24_0x3481df(0x1c3);async['execute'](_0x5e9e34){const _0x2d719e=a24_0x3481df,{options:_0x4c0624,args:_0x102948,tdx:_0x4abbc6}=_0x5e9e34;if(_0x102948[_0x2d719e(0x1e5)]===0x0)return console[_0x2d719e(0x1f0)](_0x2d719e(0x1b6)),console[_0x2d719e(0x1f0)](_0x2d719e(0x1ec)),0x1;const _0x4dd9f8=_0x102948[0x0],_0x8e9ac3=_0x4c0624,_0x494907=await resolveWorkspaceIdFromOptions(_0x8e9ac3,_0x4abbc6),_0x362836=_0x8e9ac3[_0x2d719e(0x1cb)];if(_0x362836){const _0x2b6d0d=await withSpinner(_0x2d719e(0x1d1)+_0x4dd9f8+_0x2d719e(0x190),()=>_0x4abbc6[_0x2d719e(0x1f5)]['getCampaignFull'](_0x4dd9f8,_0x494907),{'verbose':_0x4c0624[_0x2d719e(0x1db)]});await handleSDKOutput([_0x2b6d0d],_0x4c0624);}else{const _0x23819b=await withSpinner(_0x2d719e(0x1d1)+_0x4dd9f8+'\x27...',()=>_0x4abbc6['engage'][_0x2d719e(0x1f4)](_0x4dd9f8,_0x494907),{'verbose':_0x4c0624['verbose']});await handleSDKOutput([_0x23819b],_0x4c0624);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x1c6);[a24_0x3481df(0x1d0)]=a24_0x3481df(0x1d6);async[a24_0x3481df(0x1ef)](_0x2c779d){const _0x172191=a24_0x3481df,{options:_0x48995c,tdx:_0x4348f6}=_0x2c779d,_0x41c516=_0x48995c,_0x3beccc=_0x41c516[_0x172191(0x1d5)],_0x42c40b=_0x41c516[_0x172191(0x1bc)];if(!_0x3beccc)return console[_0x172191(0x1f0)](_0x172191(0x194)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x42c40b)return console[_0x172191(0x1f0)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x172191(0x1f0)](_0x172191(0x1a0)),0x1;const _0x416c20=await resolveWorkspaceIdFromOptions(_0x41c516,_0x4348f6,!![]),_0x16935b=await resolveSegmentFromOptions(_0x41c516,_0x4348f6),_0x22798e=buildConnectorConfig(_0x41c516),_0x5bcdc3={'name':_0x3beccc,'campaignType':_0x42c40b,'workspaceId':_0x416c20,'description':_0x41c516[_0x172191(0x1d0)],..._0x16935b,'connectorConfig':_0x22798e,'startAt':_0x41c516[_0x172191(0x20e)],'timezone':_0x41c516[_0x172191(0x1be)]},_0x50a8d6=await withSpinner('Creating\x20campaign\x20\x27'+_0x3beccc+_0x172191(0x190),()=>_0x4348f6['engage'][_0x172191(0x1a8)](_0x5bcdc3));return await handleSDKOutput([_0x50a8d6[_0x172191(0x1fe)]],_0x48995c),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x1b7);[a24_0x3481df(0x1d0)]=a24_0x3481df(0x1c8);async['execute'](_0x817f96){const _0x3f7c89=a24_0x3481df,{options:_0x4d70ad,args:_0x61b29b,tdx:_0xbf3378}=_0x817f96;if(_0x61b29b['length']===0x0)return console[_0x3f7c89(0x1f0)](_0x3f7c89(0x1b6)),console[_0x3f7c89(0x1f0)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x1a7172=_0x61b29b[0x0],_0x26695c=_0x4d70ad,_0x470a0d=await resolveWorkspaceIdFromOptions(_0x26695c,_0xbf3378),_0x2ee502=await resolveSegmentFromOptions(_0x26695c,_0xbf3378),_0x35cfea=buildConnectorConfig(_0x26695c),_0xf2de54={'name':_0x26695c[_0x3f7c89(0x1d5)],'description':_0x26695c['description'],..._0x2ee502,'connectorConfig':_0x35cfea,'startAt':_0x26695c[_0x3f7c89(0x20e)],'timezone':_0x26695c[_0x3f7c89(0x1be)]},_0x9333e0=Object[_0x3f7c89(0x1b1)](Object[_0x3f7c89(0x193)](_0xf2de54)[_0x3f7c89(0x19f)](([,_0x482657])=>_0x482657!==undefined));if(Object[_0x3f7c89(0x1e0)](_0x9333e0)[_0x3f7c89(0x1e5)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3f7c89(0x1f0)](_0x3f7c89(0x18e)),0x1;const _0x1edb96=await withSpinner(_0x3f7c89(0x1a6)+_0x1a7172+'\x27...',()=>_0xbf3378[_0x3f7c89(0x1f5)][_0x3f7c89(0x208)](_0x1a7172,_0x9333e0,_0x470a0d),{'verbose':_0x4d70ad[_0x3f7c89(0x1db)]});return await handleSDKOutput([_0x1edb96[_0x3f7c89(0x1fe)]],_0x4d70ad),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a24_0x3481df(0x1e2);[a24_0x3481df(0x1d0)]='Delete\x20a\x20campaign';async[a24_0x3481df(0x1ef)](_0x384b13){const _0x3e5e5a=a24_0x3481df,{options:_0x2c89ab,args:_0x1f7488,tdx:_0x24ac6c}=_0x384b13;if(_0x1f7488[_0x3e5e5a(0x1e5)]===0x0)return console[_0x3e5e5a(0x1f0)](_0x3e5e5a(0x1b6)),console[_0x3e5e5a(0x1f0)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x3c9831=_0x1f7488[0x0],_0x26c5b1=_0x2c89ab,_0x52916f=await resolveWorkspaceIdFromOptions(_0x26c5b1,_0x24ac6c);if(!_0x2c89ab['yes']){const _0x4e6ee0=await confirm(_0x3e5e5a(0x1a2)+_0x3c9831+_0x3e5e5a(0x1dd));if(!_0x4e6ee0)return console['log'](_0x3e5e5a(0x1ff)),0x0;}return await withSpinner(_0x3e5e5a(0x200)+_0x3c9831+_0x3e5e5a(0x190),()=>_0x24ac6c['engage'][_0x3e5e5a(0x1e6)](_0x3c9831,_0x52916f),{'verbose':_0x2c89ab[_0x3e5e5a(0x1db)]}),console[_0x3e5e5a(0x1fd)]('Campaign\x20\x27'+_0x3c9831+_0x3e5e5a(0x1a4)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a24_0x3481df(0x1d5)]='engage:campaign:launch';['description']=a24_0x3481df(0x1ab);async['execute'](_0x3f9303){const _0x5ab031=a24_0x3481df,{options:_0x2dcc77,args:_0xe4ccf7,tdx:_0x3dc271}=_0x3f9303;if(_0xe4ccf7['length']===0x0)return console[_0x5ab031(0x1f0)](_0x5ab031(0x1b6)),console[_0x5ab031(0x1f0)](_0x5ab031(0x1a9)),0x1;const _0x88d5a3=_0xe4ccf7[0x0],_0x1080be=_0x2dcc77,_0x3b135c=await resolveWorkspaceIdFromOptions(_0x1080be,_0x3dc271);return await withSpinner(_0x5ab031(0x1b5)+_0x88d5a3+'\x27...',()=>_0x3dc271[_0x5ab031(0x1f5)]['launchCampaign'](_0x88d5a3,_0x3b135c),{'verbose':_0x2dcc77[_0x5ab031(0x1db)]}),console[_0x5ab031(0x1fd)](_0x5ab031(0x1ca)+_0x88d5a3+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a24_0x3481df(0x1d5)]='engage:campaign:pause';['description']='Pause\x20a\x20campaign';async[a24_0x3481df(0x1ef)](_0x52f46e){const _0x11404b=a24_0x3481df,{options:_0x458ac7,args:_0x9b3a08,tdx:_0x1b5088}=_0x52f46e;if(_0x9b3a08['length']===0x0)return console[_0x11404b(0x1f0)](_0x11404b(0x1b6)),console[_0x11404b(0x1f0)](_0x11404b(0x1ad)),0x1;const _0x2ec224=_0x9b3a08[0x0],_0x3e45ee=_0x458ac7,_0x2261fd=await resolveWorkspaceIdFromOptions(_0x3e45ee,_0x1b5088);return await withSpinner(_0x11404b(0x1a1)+_0x2ec224+_0x11404b(0x190),()=>_0x1b5088['engage']['pauseCampaign'](_0x2ec224,_0x2261fd),{'verbose':_0x458ac7[_0x11404b(0x1db)]}),console[_0x11404b(0x1fd)](_0x11404b(0x1ca)+_0x2ec224+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x206);[a24_0x3481df(0x1d0)]='Resume\x20a\x20paused\x20campaign';async[a24_0x3481df(0x1ef)](_0x2fb1cb){const _0x5375a5=a24_0x3481df,{options:_0x2af2af,args:_0x734527,tdx:_0x8224ba}=_0x2fb1cb;if(_0x734527[_0x5375a5(0x1e5)]===0x0)return console[_0x5375a5(0x1f0)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x5375a5(0x1f0)](_0x5375a5(0x204)),0x1;const _0x4181bc=_0x734527[0x0],_0x33982a=_0x2af2af,_0x5cd5b0=await resolveWorkspaceIdFromOptions(_0x33982a,_0x8224ba);return await withSpinner(_0x5375a5(0x1c1)+_0x4181bc+_0x5375a5(0x190),()=>_0x8224ba['engage'][_0x5375a5(0x196)](_0x4181bc,_0x5cd5b0),{'verbose':_0x2af2af[_0x5375a5(0x1db)]}),console[_0x5375a5(0x1fd)]('Campaign\x20\x27'+_0x4181bc+_0x5375a5(0x1e8)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a24_0x3481df(0x1bd);[a24_0x3481df(0x1d0)]=a24_0x3481df(0x219);async[a24_0x3481df(0x1ef)](_0x38ff2f){const _0x2647e5=a24_0x3481df,{options:_0x278237,args:_0x549b4d,tdx:_0x589ba0}=_0x38ff2f;if(_0x549b4d[_0x2647e5(0x1e5)]===0x0)return console[_0x2647e5(0x1f0)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2647e5(0x1f0)](_0x2647e5(0x1fc)),0x1;const _0x7efdb2=_0x549b4d[0x0],_0x23b266=_0x278237,_0x2e33c0=await resolveWorkspaceIdFromOptions(_0x23b266,_0x589ba0),_0x4ad883=await withSpinner(_0x2647e5(0x1da)+_0x7efdb2+_0x2647e5(0x190),()=>_0x589ba0['engage'][_0x2647e5(0x197)](_0x7efdb2,_0x2e33c0),{'verbose':_0x278237['verbose']});return await handleSDKOutput([_0x4ad883[_0x2647e5(0x1fe)]],_0x278237),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x1eb);[a24_0x3481df(0x1d0)]='List\x20email\x20templates';async['execute'](_0x2f46a3){const _0x49d563=a24_0x3481df,{options:_0x2fc88f,args:_0x576e39,tdx:_0x140282}=_0x2f46a3,_0x126e03=_0x576e39[0x0],_0x3892da=resolveLimit(_0x2fc88f[_0x49d563(0x1ba)],DEFAULT_LLM_LIMIT),_0x15c9ba=_0x2fc88f,_0x2069a2=await resolveWorkspaceIdFromOptions(_0x15c9ba,_0x140282),_0x14de7b=await withSpinner(_0x49d563(0x1ed),()=>_0x140282[_0x49d563(0x1f5)][_0x49d563(0x1bf)]({'workspaceId':_0x2069a2,'limit':_0x3892da}),{'verbose':_0x2fc88f[_0x49d563(0x1db)]});let _0x26eee8=_0x14de7b['data'];return _0x126e03&&(_0x26eee8=_0x14de7b[_0x49d563(0x1fe)][_0x49d563(0x19f)](_0x50f72d=>matchGlobPattern(_0x50f72d[_0x49d563(0x1d5)],_0x126e03))),await handleSDKOutput(_0x26eee8,_0x2fc88f),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a24_0x3481df(0x21b);[a24_0x3481df(0x1d0)]=a24_0x3481df(0x1a5);async[a24_0x3481df(0x1ef)](_0x183a50){const _0x5c1d08=a24_0x3481df,{options:_0x25ec40,args:_0x19ac4a,tdx:_0x17489b}=_0x183a50;if(_0x19ac4a[_0x5c1d08(0x1e5)]===0x0)return console[_0x5c1d08(0x1f0)](_0x5c1d08(0x1fa)),console[_0x5c1d08(0x1f0)](_0x5c1d08(0x1a3)),0x1;const _0x3e8850=_0x19ac4a[0x0],_0x22c33a=_0x25ec40,_0x1a5e74=await resolveWorkspaceIdFromOptions(_0x22c33a,_0x17489b),_0x24c704=_0x22c33a[_0x5c1d08(0x1cb)];if(_0x24c704){const _0x508eab=await withSpinner('Fetching\x20template\x20\x27'+_0x3e8850+'\x27...',()=>_0x17489b[_0x5c1d08(0x1f5)]['getTemplateFull'](_0x3e8850,_0x1a5e74),{'verbose':_0x25ec40['verbose']});await handleSDKOutput([_0x508eab],_0x25ec40);}else{const _0x5af8ff=await withSpinner(_0x5c1d08(0x1b0)+_0x3e8850+'\x27...',()=>_0x17489b[_0x5c1d08(0x1f5)][_0x5c1d08(0x1d3)](_0x3e8850,_0x1a5e74),{'verbose':_0x25ec40[_0x5c1d08(0x1db)]});await handleSDKOutput([_0x5af8ff],_0x25ec40);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']=a24_0x3481df(0x1b8);[a24_0x3481df(0x1d0)]=a24_0x3481df(0x209);async[a24_0x3481df(0x1ef)](_0xfff6ea){const _0x55d442=a24_0x3481df,{options:_0x35ade8,tdx:_0x586d5c}=_0xfff6ea,_0x1b6fce=_0x35ade8,_0xe21409=_0x1b6fce[_0x55d442(0x1d5)],_0x41bac3=_0x1b6fce[_0x55d442(0x203)],_0x3c8170=_0x1b6fce[_0x55d442(0x1af)];if(!_0xe21409)return console['error'](_0x55d442(0x194)),console[_0x55d442(0x1f0)](_0x55d442(0x1f6)),0x1;if(!_0x41bac3)return console['error']('Error:\x20--subject\x20is\x20required'),0x1;if(!_0x3c8170)return console[_0x55d442(0x1f0)](_0x55d442(0x199)),0x1;const _0x58493a=await resolveWorkspaceIdFromOptions(_0x1b6fce,_0x586d5c,!![]),_0x123104={'name':_0xe21409,'subjectTemplate':_0x41bac3,'htmlTemplate':_0x3c8170,'workspaceId':_0x58493a,'plaintextTemplate':_0x1b6fce[_0x55d442(0x21d)],'editorType':_0x1b6fce[_0x55d442(0x1c4)]},_0x2aedc9=await withSpinner(_0x55d442(0x1d4)+_0xe21409+_0x55d442(0x190),()=>_0x586d5c[_0x55d442(0x1f5)]['createTemplate'](_0x123104));return await handleSDKOutput([_0x2aedc9[_0x55d442(0x1fe)]],_0x35ade8),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x211);['description']='Update\x20an\x20email\x20template';async[a24_0x3481df(0x1ef)](_0x372e6e){const _0x4e3c50=a24_0x3481df,{options:_0x176324,args:_0x3705b3,tdx:_0x1b62c2}=_0x372e6e;if(_0x3705b3[_0x4e3c50(0x1e5)]===0x0)return console[_0x4e3c50(0x1f0)](_0x4e3c50(0x1fa)),console[_0x4e3c50(0x1f0)](_0x4e3c50(0x213)),0x1;const _0x1f4311=_0x3705b3[0x0],_0x504f22=_0x176324,_0x4d3925=await resolveWorkspaceIdFromOptions(_0x504f22,_0x1b62c2),_0x1fd41b={'name':_0x504f22[_0x4e3c50(0x1d5)],'subjectTemplate':_0x504f22[_0x4e3c50(0x203)],'htmlTemplate':_0x504f22[_0x4e3c50(0x1af)],'plaintextTemplate':_0x504f22[_0x4e3c50(0x21d)]},_0x3b2b52=Object['fromEntries'](Object[_0x4e3c50(0x193)](_0x1fd41b)[_0x4e3c50(0x19f)](([,_0x3482a7])=>_0x3482a7!==undefined));if(Object[_0x4e3c50(0x1e0)](_0x3b2b52)[_0x4e3c50(0x1e5)]===0x0)return console[_0x4e3c50(0x1f0)](_0x4e3c50(0x1c9)),console[_0x4e3c50(0x1f0)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x6e2ec5=await withSpinner(_0x4e3c50(0x1f8)+_0x1f4311+_0x4e3c50(0x190),()=>_0x1b62c2['engage'][_0x4e3c50(0x20c)](_0x1f4311,_0x3b2b52,_0x4d3925),{'verbose':_0x176324[_0x4e3c50(0x1db)]});return await handleSDKOutput([_0x6e2ec5['data']],_0x176324),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a24_0x3481df(0x1b2);[a24_0x3481df(0x1d0)]=a24_0x3481df(0x1ae);async[a24_0x3481df(0x1ef)](_0x438589){const _0x3d56db=a24_0x3481df,{options:_0x37eb74,args:_0x41d3e3,tdx:_0x3e1ac0}=_0x438589;if(_0x41d3e3['length']===0x0)return console[_0x3d56db(0x1f0)](_0x3d56db(0x1fa)),console[_0x3d56db(0x1f0)](_0x3d56db(0x1e4)),0x1;const _0x34f556=_0x41d3e3[0x0],_0x2ed721=_0x37eb74,_0x2d16bb=await resolveWorkspaceIdFromOptions(_0x2ed721,_0x3e1ac0);if(!_0x37eb74[_0x3d56db(0x1b4)]){const _0x28fd98=await confirm(_0x3d56db(0x1e7)+_0x34f556+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x28fd98)return console[_0x3d56db(0x1fd)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x3d56db(0x1c2)+_0x34f556+_0x3d56db(0x190),()=>_0x3e1ac0[_0x3d56db(0x1f5)][_0x3d56db(0x1ce)](_0x34f556,_0x2d16bb),{'verbose':_0x37eb74[_0x3d56db(0x1db)]}),console[_0x3d56db(0x1fd)](_0x3d56db(0x1a7)+_0x34f556+_0x3d56db(0x1a4)),0x0;}}function a24_0x114c(_0x2b1be8,_0x33c4a5){_0x2b1be8=_0x2b1be8-0x18d;const _0x5267ac=a24_0x5267();let _0x114cab=_0x5267ac[_0x2b1be8];return _0x114cab;}export class EngageWorkspacesCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x191);['description']=a24_0x3481df(0x1c7);async['execute'](_0x1022ea){const _0x4163dd=a24_0x3481df,{options:_0x29d93e,args:_0x24d3cf,tdx:_0x2b9326}=_0x1022ea,_0x5ef83d=_0x24d3cf[0x0],_0x16b505=resolveLimit(_0x29d93e['limit'],DEFAULT_LLM_LIMIT),_0x316c38=await withSpinner(_0x4163dd(0x1d8),()=>_0x2b9326['engage'][_0x4163dd(0x18f)]({'limit':_0x16b505}),{'verbose':_0x29d93e[_0x4163dd(0x1db)]});let _0x2da4fa=_0x316c38[_0x4163dd(0x1fe)];return _0x5ef83d&&(_0x2da4fa=_0x316c38[_0x4163dd(0x1fe)]['filter'](_0x3cef6d=>matchGlobPattern(_0x3cef6d[_0x4163dd(0x1d5)],_0x5ef83d))),await handleSDKOutput(_0x2da4fa,_0x29d93e),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x198);[a24_0x3481df(0x1d0)]=a24_0x3481df(0x20b);async[a24_0x3481df(0x1ef)](_0x16fa3d){const _0x3f7f8c=a24_0x3481df,{options:_0x35cbfc,args:_0x41faad,tdx:_0x5af486}=_0x16fa3d;if(_0x41faad[_0x3f7f8c(0x1e5)]===0x0)return console[_0x3f7f8c(0x1f0)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x3f7f8c(0x1f0)](_0x3f7f8c(0x21a)),0x1;const _0x4e1710=_0x41faad[0x0],_0x404cf3=_0x35cbfc,_0x1aeb49=_0x404cf3[_0x3f7f8c(0x1cb)];if(_0x1aeb49){const _0x428bf1=await withSpinner(_0x3f7f8c(0x1f9)+_0x4e1710+_0x3f7f8c(0x190),()=>_0x5af486[_0x3f7f8c(0x1f5)]['getWorkspaceFull'](_0x4e1710),{'verbose':_0x35cbfc[_0x3f7f8c(0x1db)]});await handleSDKOutput([_0x428bf1],_0x35cbfc);}else{const _0x176538=await withSpinner('Fetching\x20workspace\x20\x27'+_0x4e1710+_0x3f7f8c(0x190),()=>_0x5af486['engage'][_0x3f7f8c(0x1aa)](_0x4e1710),{'verbose':_0x35cbfc[_0x3f7f8c(0x1db)]});await handleSDKOutput([_0x176538],_0x35cbfc);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a24_0x3481df(0x218);[a24_0x3481df(0x1d0)]='Create\x20a\x20workspace';async[a24_0x3481df(0x1ef)](_0x23718f){const _0x4460fb=a24_0x3481df,{options:_0x5b9363,tdx:_0x46e78e}=_0x23718f,_0x55b87b=_0x5b9363,_0x50961e=_0x55b87b[_0x4460fb(0x1d5)];if(!_0x50961e)return console[_0x4460fb(0x1f0)]('Error:\x20--name\x20is\x20required'),console[_0x4460fb(0x1f0)](_0x4460fb(0x20f)),0x1;const _0xcb9dbd={'name':_0x50961e,'description':_0x55b87b[_0x4460fb(0x1d0)]},_0x4b0559=await withSpinner(_0x4460fb(0x1b3)+_0x50961e+_0x4460fb(0x190),()=>_0x46e78e[_0x4460fb(0x1f5)][_0x4460fb(0x1cf)](_0xcb9dbd));return await handleSDKOutput([_0x4b0559[_0x4460fb(0x1fe)]],_0x5b9363),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x195);[a24_0x3481df(0x1d0)]='Update\x20a\x20workspace';async[a24_0x3481df(0x1ef)](_0x279f43){const _0x34d1b8=a24_0x3481df,{options:_0xa11d71,args:_0x25968c,tdx:_0x4876d5}=_0x279f43;if(_0x25968c[_0x34d1b8(0x1e5)]===0x0)return console[_0x34d1b8(0x1f0)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x34d1b8(0x1f0)](_0x34d1b8(0x1cc)),0x1;const _0x54775d=_0x25968c[0x0],_0x4e85b3=_0xa11d71,_0x3b88d8={'name':_0x4e85b3[_0x34d1b8(0x1d5)],'description':_0x4e85b3[_0x34d1b8(0x1d0)]},_0x5314a8=Object[_0x34d1b8(0x1b1)](Object[_0x34d1b8(0x193)](_0x3b88d8)[_0x34d1b8(0x19f)](([,_0x3756e9])=>_0x3756e9!==undefined));if(Object[_0x34d1b8(0x1e0)](_0x5314a8)[_0x34d1b8(0x1e5)]===0x0)return console[_0x34d1b8(0x1f0)](_0x34d1b8(0x1c9)),console[_0x34d1b8(0x1f0)](_0x34d1b8(0x1f2)),0x1;const _0x246197=await withSpinner(_0x34d1b8(0x1e9)+_0x54775d+_0x34d1b8(0x190),()=>_0x4876d5[_0x34d1b8(0x1f5)][_0x34d1b8(0x1dc)](_0x54775d,_0x5314a8),{'verbose':_0xa11d71[_0x34d1b8(0x1db)]});return await handleSDKOutput([_0x246197[_0x34d1b8(0x1fe)]],_0xa11d71),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a24_0x3481df(0x1d5)]=a24_0x3481df(0x1e3);[a24_0x3481df(0x1d0)]=a24_0x3481df(0x18d);async[a24_0x3481df(0x1ef)](_0x472aad){const _0x3c5ad6=a24_0x3481df,{options:_0x3f2824,args:_0x403bed,tdx:_0xef0ff7}=_0x472aad;if(_0x403bed[_0x3c5ad6(0x1e5)]===0x0)return console['error'](_0x3c5ad6(0x1c0)),console[_0x3c5ad6(0x1f0)](_0x3c5ad6(0x201)),0x1;const _0x13357a=_0x403bed[0x0];if(!_0x3f2824[_0x3c5ad6(0x1b4)]){const _0x2ddf99=await confirm(_0x3c5ad6(0x1ac)+_0x13357a+_0x3c5ad6(0x1dd));if(!_0x2ddf99)return console[_0x3c5ad6(0x1fd)](_0x3c5ad6(0x1ff)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x13357a+_0x3c5ad6(0x190),()=>_0xef0ff7[_0x3c5ad6(0x1f5)][_0x3c5ad6(0x1de)](_0x13357a),{'verbose':_0x3f2824['verbose']}),console[_0x3c5ad6(0x1fd)]('Workspace\x20\x27'+_0x13357a+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a24_0x3481df(0x212);[a24_0x3481df(0x1d0)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a24_0x3481df(0x1ef)](_0x37db6c){const _0x314041=a24_0x3481df,{options:_0x5e524f,args:_0x275224,tdx:_0xc8693}=_0x37db6c;if(_0x275224[_0x314041(0x1e5)]===0x0)return console[_0x314041(0x1f0)](_0x314041(0x19c)),console[_0x314041(0x1f0)](_0x314041(0x1d2)),0x1;const _0x741946=_0x275224[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x741946+'\x27...',()=>_0xc8693['engage'][_0x314041(0x1b9)](_0x741946));const _0xc98fb0=_0x5e524f[_0x314041(0x210)]||undefined;return saveSessionContext({'engage_workspace':_0x741946},_0xc98fb0),console[_0x314041(0x1fd)](_0x314041(0x19a)+_0x741946),console[_0x314041(0x1fd)](_0x314041(0x19d)),0x0;}}
|
|
1
|
+
const a24_0x2b7b80=a24_0x39b2;(function(_0x4c7c82,_0x539753){const _0x48d8db=a24_0x39b2,_0x16b4b6=_0x4c7c82();while(!![]){try{const _0x5a6f91=-parseInt(_0x48d8db(0x1dd))/0x1*(-parseInt(_0x48d8db(0x1d4))/0x2)+parseInt(_0x48d8db(0x219))/0x3*(-parseInt(_0x48d8db(0x235))/0x4)+parseInt(_0x48d8db(0x1bc))/0x5*(parseInt(_0x48d8db(0x20b))/0x6)+parseInt(_0x48d8db(0x215))/0x7+-parseInt(_0x48d8db(0x218))/0x8+-parseInt(_0x48d8db(0x21a))/0x9+parseInt(_0x48d8db(0x1d0))/0xa;if(_0x5a6f91===_0x539753)break;else _0x16b4b6['push'](_0x16b4b6['shift']());}catch(_0x3cc6ca){_0x16b4b6['push'](_0x16b4b6['shift']());}}}(a24_0x2f2f,0x42edb));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x35ed7a,_0x84cb90,_0x44b254=![]){const _0x2641ef=a24_0x39b2;if(_0x35ed7a[_0x2641ef(0x1fd)])return await _0x84cb90[_0x2641ef(0x1e5)][_0x2641ef(0x1d9)](_0x35ed7a[_0x2641ef(0x1fd)]);const _0x56ebd3=loadSessionContext(_0x35ed7a['session']);if(_0x56ebd3?.[_0x2641ef(0x238)])return await _0x84cb90[_0x2641ef(0x1e5)][_0x2641ef(0x1d9)](_0x56ebd3[_0x2641ef(0x238)]);if(_0x44b254)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2641ef(0x21e),undefined,{'helpText':_0x2641ef(0x228)});return undefined;}async function resolveSegmentFromOptions(_0x50f9fe,_0x35777c){const _0x363c38=a24_0x39b2;if(!_0x50f9fe[_0x363c38(0x1f7)])return{};const _0x315b9c=_0x50f9fe['segment'],_0x494977=await _0x35777c[_0x363c38(0x1f7)]['resolvePathToResource'](_0x315b9c);return{'audienceId':_0x494977[_0x363c38(0x1e8)],'audienceName':_0x494977[_0x363c38(0x1da)],..._0x494977['segmentId']&&{'segmentId':_0x494977['segmentId'],'segmentName':_0x494977[_0x363c38(0x1db)]}};}function buildConnectorConfig(_0x587aa1){const _0x23c1c2=_0x587aa1['emailSenderId'],_0x54ce52=_0x587aa1['jsonColumns'];if(!_0x23c1c2&&!_0x54ce52)return undefined;return{..._0x23c1c2&&{'emailSenderId':_0x23c1c2},..._0x54ce52&&{'jsonColumns':_0x54ce52}};}export class EngageCampaignsCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]='engage:campaigns';[a24_0x2b7b80(0x1e9)]='List\x20campaigns';async[a24_0x2b7b80(0x21b)](_0x452016){const _0x4e2e58=a24_0x2b7b80,{options:_0x4c1997,args:_0x4a3dc6,tdx:_0x44a2a6}=_0x452016,_0x442a6c=_0x4a3dc6[0x0],_0x184378=resolveLimit(_0x4c1997[_0x4e2e58(0x1f2)],DEFAULT_LLM_LIMIT),_0x35ebb7=_0x4c1997,_0x57f1f6=_0x35ebb7['type'],_0x8da21a=_0x35ebb7[_0x4e2e58(0x227)],_0x8a26c7=await resolveWorkspaceIdFromOptions(_0x35ebb7,_0x44a2a6),_0xef49b=await withSpinner(_0x4e2e58(0x1f6),()=>_0x44a2a6['engage']['listCampaigns']({'type':_0x57f1f6,'status':_0x8da21a,'workspaceId':_0x8a26c7,'limit':_0x184378}),{'verbose':_0x4c1997[_0x4e2e58(0x233)]});let _0x14f551=_0xef49b[_0x4e2e58(0x225)];return _0x442a6c&&(_0x14f551=_0xef49b['data'][_0x4e2e58(0x1b7)](_0x105286=>matchGlobPattern(_0x105286[_0x4e2e58(0x20a)],_0x442a6c))),await handleSDKOutput(_0x14f551,_0x4c1997),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']=a24_0x2b7b80(0x1ed);[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x207);async['execute'](_0x567cf2){const _0x39c4e3=a24_0x2b7b80,{options:_0x3d9552,args:_0x44df95,tdx:_0x4add59}=_0x567cf2;if(_0x44df95[_0x39c4e3(0x1c2)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x39c4e3(0x1d3)](_0x39c4e3(0x1c3)),0x1;const _0x140d88=_0x44df95[0x0],_0x595bc0=_0x3d9552,_0x4d0f04=await resolveWorkspaceIdFromOptions(_0x595bc0,_0x4add59),_0x433728=_0x595bc0[_0x39c4e3(0x1cc)];if(_0x433728){const _0x4a46ce=await withSpinner(_0x39c4e3(0x1cf)+_0x140d88+_0x39c4e3(0x213),()=>_0x4add59['engage']['getCampaignFull'](_0x140d88,_0x4d0f04),{'verbose':_0x3d9552[_0x39c4e3(0x233)]});await handleSDKOutput([_0x4a46ce],_0x3d9552);}else{const _0x33650f=await withSpinner(_0x39c4e3(0x1cf)+_0x140d88+_0x39c4e3(0x213),()=>_0x4add59[_0x39c4e3(0x1e5)]['getCampaign'](_0x140d88,_0x4d0f04),{'verbose':_0x3d9552['verbose']});await handleSDKOutput([_0x33650f],_0x3d9552);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]='engage:campaign:create';[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x1ea);async[a24_0x2b7b80(0x21b)](_0x3fcf3d){const _0x2c5037=a24_0x2b7b80,{options:_0xf4e76e,tdx:_0x3bcc51}=_0x3fcf3d,_0xf2beeb=_0xf4e76e,_0x46395d=_0xf2beeb['name'],_0x51e200=_0xf2beeb['type'];if(!_0x46395d)return console[_0x2c5037(0x1d3)]('Error:\x20--name\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x51e200)return console['error'](_0x2c5037(0x1e4)),console[_0x2c5037(0x1d3)](_0x2c5037(0x1f0)),0x1;const _0x397956=await resolveWorkspaceIdFromOptions(_0xf2beeb,_0x3bcc51,!![]),_0x31bf48=await resolveSegmentFromOptions(_0xf2beeb,_0x3bcc51),_0x248591=buildConnectorConfig(_0xf2beeb),_0x27d2a8={'name':_0x46395d,'campaignType':_0x51e200,'workspaceId':_0x397956,'description':_0xf2beeb[_0x2c5037(0x1e9)],..._0x31bf48,'connectorConfig':_0x248591,'startAt':_0xf2beeb['startAt'],'timezone':_0xf2beeb['timezone']},_0x3d1f12=await withSpinner(_0x2c5037(0x1d2)+_0x46395d+'\x27...',()=>_0x3bcc51[_0x2c5037(0x1e5)][_0x2c5037(0x1fc)](_0x27d2a8));return await handleSDKOutput([_0x3d1f12['data']],_0xf4e76e),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]='engage:campaign:update';[a24_0x2b7b80(0x1e9)]='Update\x20a\x20campaign';async[a24_0x2b7b80(0x21b)](_0x51b50b){const _0x7f5a4=a24_0x2b7b80,{options:_0x120ce8,args:_0x5dd5be,tdx:_0x36dad2}=_0x51b50b;if(_0x5dd5be[_0x7f5a4(0x1c2)]===0x0)return console[_0x7f5a4(0x1d3)](_0x7f5a4(0x1b4)),console[_0x7f5a4(0x1d3)](_0x7f5a4(0x22f)),0x1;const _0x14d83b=_0x5dd5be[0x0],_0x5a071c=_0x120ce8,_0x5332c3=await resolveWorkspaceIdFromOptions(_0x5a071c,_0x36dad2),_0x4b0257=await resolveSegmentFromOptions(_0x5a071c,_0x36dad2),_0x133380=buildConnectorConfig(_0x5a071c),_0x266502={'name':_0x5a071c[_0x7f5a4(0x20a)],'description':_0x5a071c[_0x7f5a4(0x1e9)],..._0x4b0257,'connectorConfig':_0x133380,'startAt':_0x5a071c[_0x7f5a4(0x216)],'timezone':_0x5a071c[_0x7f5a4(0x220)]},_0x2be9ac=Object['fromEntries'](Object['entries'](_0x266502)[_0x7f5a4(0x1b7)](([,_0x4473e3])=>_0x4473e3!==undefined));if(Object[_0x7f5a4(0x1b6)](_0x2be9ac)['length']===0x0)return console[_0x7f5a4(0x1d3)](_0x7f5a4(0x1c4)),console[_0x7f5a4(0x1d3)](_0x7f5a4(0x1c9)),0x1;const _0x13f83a=await withSpinner(_0x7f5a4(0x1ca)+_0x14d83b+_0x7f5a4(0x213),()=>_0x36dad2[_0x7f5a4(0x1e5)][_0x7f5a4(0x1e0)](_0x14d83b,_0x2be9ac,_0x5332c3),{'verbose':_0x120ce8[_0x7f5a4(0x233)]});return await handleSDKOutput([_0x13f83a[_0x7f5a4(0x225)]],_0x120ce8),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x20f);[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x1d1);async[a24_0x2b7b80(0x21b)](_0x5a912e){const _0x219dcc=a24_0x2b7b80,{options:_0x13b787,args:_0x196685,tdx:_0x4db7bc}=_0x5a912e;if(_0x196685[_0x219dcc(0x1c2)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x219dcc(0x1d3)](_0x219dcc(0x206)),0x1;const _0x2f33f2=_0x196685[0x0],_0x362b3a=_0x13b787,_0x444214=await resolveWorkspaceIdFromOptions(_0x362b3a,_0x4db7bc);if(!_0x13b787[_0x219dcc(0x22a)]){const _0x2b5ff3=await confirm(_0x219dcc(0x1c6)+_0x2f33f2+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x2b5ff3)return console['log'](_0x219dcc(0x1ba)),0x0;}return await withSpinner(_0x219dcc(0x202)+_0x2f33f2+_0x219dcc(0x213),()=>_0x4db7bc['engage'][_0x219dcc(0x1b5)](_0x2f33f2,_0x444214),{'verbose':_0x13b787['verbose']}),console[_0x219dcc(0x203)]('Campaign\x20\x27'+_0x2f33f2+_0x219dcc(0x208)),0x0;}}function a24_0x2f2f(){const _0xb33ebd=['Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','4278288esWLYm','173133BTduKI','2142882MdEbYi','execute','Campaign\x20\x27','getWorkspace','Workspace\x20is\x20required\x20for\x20this\x20operation','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','timezone','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','entries','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','updateTemplate','data','engage:template:delete','status','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Duplicate\x20a\x20campaign','yes','pauseCampaign','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Fetching\x20template\x20\x27','Delete\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Error:\x20--subject\x20is\x20required','getTemplateFull','verbose','engage:workspace:create','24WfliSa','Duplicating\x20campaign\x20\x27','Update\x20an\x20email\x20template','engage_workspace','Fetching\x20workspace\x20\x27','Resuming\x20campaign\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','deleteCampaign','keys','filter','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','List\x20email\x20templates','Operation\x20cancelled','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','34355cyqTTr','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','engage:workspace:show','duplicateCampaign','Workspace\x20\x27','length','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','engage:campaign:pause','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','launchCampaign','getWorkspaceFull','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Updating\x20campaign\x20\x27','\x27\x20launched\x20successfully','full','Launch\x20a\x20campaign','Updating\x20workspace\x20\x27','Fetching\x20campaign\x20\x27','5891040iJWdby','Delete\x20a\x20campaign','Creating\x20campaign\x20\x27','error','8196miLFtR','Create\x20an\x20email\x20template','engage:templates','engage:campaign:resume','Set\x20workspace\x20context\x20for\x20Engage\x20commands','resolveWorkspaceId','parentName','segmentName','editorType','85InXtXm','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','createWorkspace','updateCampaign','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27?\x20This\x20cannot\x20be\x20undone.','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage','plaintext','Error:\x20--name\x20is\x20required','parentId','description','Create\x20a\x20new\x20campaign','getTemplate','Engage\x20workspace\x20set\x20to:\x20','engage:campaign:show','Creating\x20template\x20\x27','html','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','subject','limit','Show\x20workspace\x20details','Updating\x20template\x20\x27','Show\x20email\x20template\x20details','Fetching\x20campaigns...','segment','Creating\x20workspace\x20\x27','fromEntries','engage:workspaces','Deleting\x20workspace\x20\x27','createCampaign','workspace','listWorkspaces','Options:\x20--name,\x20--description','Pause\x20a\x20campaign','Update\x20a\x20workspace','Deleting\x20campaign\x20\x27','log','engage:template:show','Template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Show\x20campaign\x20details','\x27\x20deleted\x20successfully','deleteTemplate','name','204myZVjo','deleteWorkspace','engage:workspace:delete','Error:\x20--html\x20is\x20required','engage:campaign:delete','engage:workspace:update','Delete\x20a\x20workspace','Fetching\x20templates...','\x27...','Fetching\x20workspaces...','1555687BQrCgq','startAt'];a24_0x2f2f=function(){return _0xb33ebd;};return a24_0x2f2f();}export class EngageCampaignLaunchCommand extends BaseCommand{['name']='engage:campaign:launch';['description']=a24_0x2b7b80(0x1cd);async[a24_0x2b7b80(0x21b)](_0x5261de){const _0x22ea67=a24_0x2b7b80,{options:_0x3bab56,args:_0x5922ce,tdx:_0x58f626}=_0x5261de;if(_0x5922ce[_0x22ea67(0x1c2)]===0x0)return console[_0x22ea67(0x1d3)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x22ea67(0x1d3)](_0x22ea67(0x1bd)),0x1;const _0x17a507=_0x5922ce[0x0],_0x164bb8=_0x3bab56,_0x19c883=await resolveWorkspaceIdFromOptions(_0x164bb8,_0x58f626);return await withSpinner('Launching\x20campaign\x20\x27'+_0x17a507+_0x22ea67(0x213),()=>_0x58f626['engage'][_0x22ea67(0x1c7)](_0x17a507,_0x19c883),{'verbose':_0x3bab56[_0x22ea67(0x233)]}),console[_0x22ea67(0x203)](_0x22ea67(0x21c)+_0x17a507+_0x22ea67(0x1cb)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x1c5);[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x200);async[a24_0x2b7b80(0x21b)](_0x2a9a10){const _0x279ae2=a24_0x2b7b80,{options:_0x21ab8f,args:_0x359c04,tdx:_0x5d5e73}=_0x2a9a10;if(_0x359c04[_0x279ae2(0x1c2)]===0x0)return console['error'](_0x279ae2(0x1b4)),console[_0x279ae2(0x1d3)](_0x279ae2(0x22c)),0x1;const _0x336eee=_0x359c04[0x0],_0x2fcbc8=_0x21ab8f,_0x459b07=await resolveWorkspaceIdFromOptions(_0x2fcbc8,_0x5d5e73);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x336eee+_0x279ae2(0x213),()=>_0x5d5e73[_0x279ae2(0x1e5)][_0x279ae2(0x22b)](_0x336eee,_0x459b07),{'verbose':_0x21ab8f[_0x279ae2(0x233)]}),console[_0x279ae2(0x203)]('Campaign\x20\x27'+_0x336eee+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a24_0x2b7b80(0x1d7);[a24_0x2b7b80(0x1e9)]='Resume\x20a\x20paused\x20campaign';async['execute'](_0x9c3685){const _0x50ea75=a24_0x2b7b80,{options:_0x29185c,args:_0x5f2aa0,tdx:_0x42448e}=_0x9c3685;if(_0x5f2aa0[_0x50ea75(0x1c2)]===0x0)return console['error'](_0x50ea75(0x1b4)),console[_0x50ea75(0x1d3)](_0x50ea75(0x230)),0x1;const _0xcd0bbd=_0x5f2aa0[0x0],_0x44405f=_0x29185c,_0xbcd436=await resolveWorkspaceIdFromOptions(_0x44405f,_0x42448e);return await withSpinner(_0x50ea75(0x23a)+_0xcd0bbd+_0x50ea75(0x213),()=>_0x42448e['engage']['resumeCampaign'](_0xcd0bbd,_0xbcd436),{'verbose':_0x29185c[_0x50ea75(0x233)]}),console[_0x50ea75(0x203)]('Campaign\x20\x27'+_0xcd0bbd+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']='engage:campaign:duplicate';[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x229);async[a24_0x2b7b80(0x21b)](_0x11de75){const _0x4db833=a24_0x2b7b80,{options:_0x1ab100,args:_0x1398b8,tdx:_0x4a9483}=_0x11de75;if(_0x1398b8[_0x4db833(0x1c2)]===0x0)return console[_0x4db833(0x1d3)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x4db833(0x217)),0x1;const _0x58b736=_0x1398b8[0x0],_0x20fb0b=_0x1ab100,_0x10ba50=await resolveWorkspaceIdFromOptions(_0x20fb0b,_0x4a9483),_0x59e80e=await withSpinner(_0x4db833(0x236)+_0x58b736+_0x4db833(0x213),()=>_0x4a9483['engage'][_0x4db833(0x1c0)](_0x58b736,_0x10ba50),{'verbose':_0x1ab100['verbose']});return await handleSDKOutput([_0x59e80e[_0x4db833(0x225)]],_0x1ab100),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x1d6);[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x1b9);async['execute'](_0xeeec4f){const _0x4922b9=a24_0x2b7b80,{options:_0x576bda,args:_0x11086e,tdx:_0xf75af4}=_0xeeec4f,_0x12eefc=_0x11086e[0x0],_0x42aabe=resolveLimit(_0x576bda[_0x4922b9(0x1f2)],DEFAULT_LLM_LIMIT),_0x3b9155=_0x576bda,_0x190b0d=await resolveWorkspaceIdFromOptions(_0x3b9155,_0xf75af4),_0x2d5572=await withSpinner(_0x4922b9(0x212),()=>_0xf75af4[_0x4922b9(0x1e5)]['listTemplates']({'workspaceId':_0x190b0d,'limit':_0x42aabe}),{'verbose':_0x576bda['verbose']});let _0x2ccd0a=_0x2d5572['data'];return _0x12eefc&&(_0x2ccd0a=_0x2d5572['data'][_0x4922b9(0x1b7)](_0x1144dc=>matchGlobPattern(_0x1144dc[_0x4922b9(0x20a)],_0x12eefc))),await handleSDKOutput(_0x2ccd0a,_0x576bda),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x204);[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x1f5);async[a24_0x2b7b80(0x21b)](_0x29f557){const _0x1ff365=a24_0x2b7b80,{options:_0x17ddc9,args:_0xe96e86,tdx:_0x47fdc6}=_0x29f557;if(_0xe96e86[_0x1ff365(0x1c2)]===0x0)return console[_0x1ff365(0x1d3)](_0x1ff365(0x1bb)),console[_0x1ff365(0x1d3)](_0x1ff365(0x223)),0x1;const _0x597402=_0xe96e86[0x0],_0x3fde69=_0x17ddc9,_0x4b3b59=await resolveWorkspaceIdFromOptions(_0x3fde69,_0x47fdc6),_0x2a6c8a=_0x3fde69['full'];if(_0x2a6c8a){const _0x28b6fe=await withSpinner(_0x1ff365(0x22d)+_0x597402+_0x1ff365(0x213),()=>_0x47fdc6[_0x1ff365(0x1e5)][_0x1ff365(0x232)](_0x597402,_0x4b3b59),{'verbose':_0x17ddc9[_0x1ff365(0x233)]});await handleSDKOutput([_0x28b6fe],_0x17ddc9);}else{const _0x5b67e8=await withSpinner('Fetching\x20template\x20\x27'+_0x597402+_0x1ff365(0x213),()=>_0x47fdc6[_0x1ff365(0x1e5)][_0x1ff365(0x1eb)](_0x597402,_0x4b3b59),{'verbose':_0x17ddc9[_0x1ff365(0x233)]});await handleSDKOutput([_0x5b67e8],_0x17ddc9);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]='engage:template:create';['description']=a24_0x2b7b80(0x1d5);async[a24_0x2b7b80(0x21b)](_0x2ca09c){const _0x27e456=a24_0x2b7b80,{options:_0x553657,tdx:_0x549839}=_0x2ca09c,_0x2c9d57=_0x553657,_0x67aedf=_0x2c9d57['name'],_0xe63a32=_0x2c9d57[_0x27e456(0x1f1)],_0x26b32d=_0x2c9d57[_0x27e456(0x1ef)];if(!_0x67aedf)return console[_0x27e456(0x1d3)](_0x27e456(0x1e7)),console[_0x27e456(0x1d3)](_0x27e456(0x1be)),0x1;if(!_0xe63a32)return console[_0x27e456(0x1d3)](_0x27e456(0x231)),0x1;if(!_0x26b32d)return console[_0x27e456(0x1d3)](_0x27e456(0x20e)),0x1;const _0x190b80=await resolveWorkspaceIdFromOptions(_0x2c9d57,_0x549839,!![]),_0x2b42b2={'name':_0x67aedf,'subjectTemplate':_0xe63a32,'htmlTemplate':_0x26b32d,'workspaceId':_0x190b80,'plaintextTemplate':_0x2c9d57[_0x27e456(0x1e6)],'editorType':_0x2c9d57[_0x27e456(0x1dc)]},_0x54bba8=await withSpinner(_0x27e456(0x1ee)+_0x67aedf+_0x27e456(0x213),()=>_0x549839['engage']['createTemplate'](_0x2b42b2));return await handleSDKOutput([_0x54bba8[_0x27e456(0x225)]],_0x553657),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]='engage:template:update';[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x237);async[a24_0x2b7b80(0x21b)](_0x5e14ce){const _0x3218d8=a24_0x2b7b80,{options:_0x2378ca,args:_0x5d29ae,tdx:_0xf0853d}=_0x5e14ce;if(_0x5d29ae[_0x3218d8(0x1c2)]===0x0)return console[_0x3218d8(0x1d3)](_0x3218d8(0x1bb)),console['error']('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x30c659=_0x5d29ae[0x0],_0x31a80b=_0x2378ca,_0x47ae4d=await resolveWorkspaceIdFromOptions(_0x31a80b,_0xf0853d),_0x4fb153={'name':_0x31a80b['name'],'subjectTemplate':_0x31a80b['subject'],'htmlTemplate':_0x31a80b['html'],'plaintextTemplate':_0x31a80b[_0x3218d8(0x1e6)]},_0x3f7cf6=Object['fromEntries'](Object[_0x3218d8(0x222)](_0x4fb153)['filter'](([,_0x4abe72])=>_0x4abe72!==undefined));if(Object[_0x3218d8(0x1b6)](_0x3f7cf6)[_0x3218d8(0x1c2)]===0x0)return console[_0x3218d8(0x1d3)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3218d8(0x1d3)](_0x3218d8(0x21f)),0x1;const _0x54b497=await withSpinner(_0x3218d8(0x1f4)+_0x30c659+_0x3218d8(0x213),()=>_0xf0853d[_0x3218d8(0x1e5)][_0x3218d8(0x224)](_0x30c659,_0x3f7cf6,_0x47ae4d),{'verbose':_0x2378ca[_0x3218d8(0x233)]});return await handleSDKOutput([_0x54b497[_0x3218d8(0x225)]],_0x2378ca),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x226);['description']=a24_0x2b7b80(0x22e);async[a24_0x2b7b80(0x21b)](_0x1ca019){const _0x4870a1=a24_0x2b7b80,{options:_0x21142b,args:_0xb7a390,tdx:_0x3ece69}=_0x1ca019;if(_0xb7a390[_0x4870a1(0x1c2)]===0x0)return console[_0x4870a1(0x1d3)](_0x4870a1(0x1bb)),console['error']('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x2da37b=_0xb7a390[0x0],_0x58a8d3=_0x21142b,_0x2121cc=await resolveWorkspaceIdFromOptions(_0x58a8d3,_0x3ece69);if(!_0x21142b[_0x4870a1(0x22a)]){const _0x98d7de=await confirm(_0x4870a1(0x1de)+_0x2da37b+_0x4870a1(0x1e2));if(!_0x98d7de)return console[_0x4870a1(0x203)](_0x4870a1(0x1ba)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x2da37b+_0x4870a1(0x213),()=>_0x3ece69['engage'][_0x4870a1(0x209)](_0x2da37b,_0x2121cc),{'verbose':_0x21142b[_0x4870a1(0x233)]}),console[_0x4870a1(0x203)](_0x4870a1(0x205)+_0x2da37b+'\x27\x20deleted\x20successfully'),0x0;}}function a24_0x39b2(_0xfe442b,_0x75c716){_0xfe442b=_0xfe442b-0x1b4;const _0x2f2f46=a24_0x2f2f();let _0x39b2bc=_0x2f2f46[_0xfe442b];return _0x39b2bc;}export class EngageWorkspacesCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x1fa);[a24_0x2b7b80(0x1e9)]='List\x20workspaces';async['execute'](_0x4ab0b5){const _0x427b25=a24_0x2b7b80,{options:_0x890247,args:_0x1d61cd,tdx:_0x123db8}=_0x4ab0b5,_0x2ddf1f=_0x1d61cd[0x0],_0xf9317b=resolveLimit(_0x890247[_0x427b25(0x1f2)],DEFAULT_LLM_LIMIT),_0x25d022=await withSpinner(_0x427b25(0x214),()=>_0x123db8[_0x427b25(0x1e5)][_0x427b25(0x1fe)]({'limit':_0xf9317b}),{'verbose':_0x890247[_0x427b25(0x233)]});let _0x500640=_0x25d022['data'];return _0x2ddf1f&&(_0x500640=_0x25d022[_0x427b25(0x225)][_0x427b25(0x1b7)](_0x3ff414=>matchGlobPattern(_0x3ff414[_0x427b25(0x20a)],_0x2ddf1f))),await handleSDKOutput(_0x500640,_0x890247),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x1bf);[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x1f3);async[a24_0x2b7b80(0x21b)](_0x5422dc){const _0x370e0b=a24_0x2b7b80,{options:_0xa2575,args:_0x312554,tdx:_0x2dfbb0}=_0x5422dc;if(_0x312554['length']===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x370e0b(0x1d3)](_0x370e0b(0x1e3)),0x1;const _0x46ca6d=_0x312554[0x0],_0x1f03ba=_0xa2575,_0x5c4a7a=_0x1f03ba[_0x370e0b(0x1cc)];if(_0x5c4a7a){const _0x3d8086=await withSpinner(_0x370e0b(0x239)+_0x46ca6d+_0x370e0b(0x213),()=>_0x2dfbb0[_0x370e0b(0x1e5)][_0x370e0b(0x1c8)](_0x46ca6d),{'verbose':_0xa2575[_0x370e0b(0x233)]});await handleSDKOutput([_0x3d8086],_0xa2575);}else{const _0x1d829c=await withSpinner(_0x370e0b(0x239)+_0x46ca6d+_0x370e0b(0x213),()=>_0x2dfbb0[_0x370e0b(0x1e5)][_0x370e0b(0x21d)](_0x46ca6d),{'verbose':_0xa2575[_0x370e0b(0x233)]});await handleSDKOutput([_0x1d829c],_0xa2575);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x234);[a24_0x2b7b80(0x1e9)]='Create\x20a\x20workspace';async[a24_0x2b7b80(0x21b)](_0x3f9984){const _0x2c2325=a24_0x2b7b80,{options:_0x387778,tdx:_0xb2abb8}=_0x3f9984,_0x5e629c=_0x387778,_0x34adfc=_0x5e629c[_0x2c2325(0x20a)];if(!_0x34adfc)return console['error'](_0x2c2325(0x1e7)),console[_0x2c2325(0x1d3)](_0x2c2325(0x221)),0x1;const _0x7526df={'name':_0x34adfc,'description':_0x5e629c[_0x2c2325(0x1e9)]},_0x14967b=await withSpinner(_0x2c2325(0x1f8)+_0x34adfc+_0x2c2325(0x213),()=>_0xb2abb8['engage'][_0x2c2325(0x1df)](_0x7526df));return await handleSDKOutput([_0x14967b['data']],_0x387778),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x210);[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x201);async['execute'](_0x4e8745){const _0x3f6c25=a24_0x2b7b80,{options:_0x18d039,args:_0x2b282d,tdx:_0x12a8e3}=_0x4e8745;if(_0x2b282d[_0x3f6c25(0x1c2)]===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x3f6c25(0x1d3)](_0x3f6c25(0x1e1)),0x1;const _0x4cbeb2=_0x2b282d[0x0],_0x210ee5=_0x18d039,_0x169ba9={'name':_0x210ee5[_0x3f6c25(0x20a)],'description':_0x210ee5[_0x3f6c25(0x1e9)]},_0x40cdce=Object[_0x3f6c25(0x1f9)](Object['entries'](_0x169ba9)[_0x3f6c25(0x1b7)](([,_0x57f444])=>_0x57f444!==undefined));if(Object[_0x3f6c25(0x1b6)](_0x40cdce)[_0x3f6c25(0x1c2)]===0x0)return console[_0x3f6c25(0x1d3)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3f6c25(0x1d3)](_0x3f6c25(0x1ff)),0x1;const _0x5f21bb=await withSpinner(_0x3f6c25(0x1ce)+_0x4cbeb2+'\x27...',()=>_0x12a8e3[_0x3f6c25(0x1e5)]['updateWorkspace'](_0x4cbeb2,_0x40cdce),{'verbose':_0x18d039[_0x3f6c25(0x233)]});return await handleSDKOutput([_0x5f21bb['data']],_0x18d039),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]=a24_0x2b7b80(0x20d);[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x211);async[a24_0x2b7b80(0x21b)](_0x23e908){const _0xf60d8b=a24_0x2b7b80,{options:_0x5525a5,args:_0x2c8c2b,tdx:_0x2ce61f}=_0x23e908;if(_0x2c8c2b[_0xf60d8b(0x1c2)]===0x0)return console[_0xf60d8b(0x1d3)](_0xf60d8b(0x1b8)),console[_0xf60d8b(0x1d3)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x5a8772=_0x2c8c2b[0x0];if(!_0x5525a5[_0xf60d8b(0x22a)]){const _0x1d8dcd=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x5a8772+_0xf60d8b(0x1e2));if(!_0x1d8dcd)return console['log'](_0xf60d8b(0x1ba)),0x0;}return await withSpinner(_0xf60d8b(0x1fb)+_0x5a8772+_0xf60d8b(0x213),()=>_0x2ce61f['engage'][_0xf60d8b(0x20c)](_0x5a8772),{'verbose':_0x5525a5[_0xf60d8b(0x233)]}),console[_0xf60d8b(0x203)](_0xf60d8b(0x1c1)+_0x5a8772+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a24_0x2b7b80(0x20a)]='engage:workspace:use';[a24_0x2b7b80(0x1e9)]=a24_0x2b7b80(0x1d8);async[a24_0x2b7b80(0x21b)](_0x37da25){const _0x9218bf=a24_0x2b7b80,{options:_0x58033a,args:_0x12f219,tdx:_0x2d6d4a}=_0x37da25;if(_0x12f219['length']===0x0)return console[_0x9218bf(0x1d3)]('Error:\x20Workspace\x20name\x20is\x20required'),console[_0x9218bf(0x1d3)]('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x4e4708=_0x12f219[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x4e4708+_0x9218bf(0x213),()=>_0x2d6d4a[_0x9218bf(0x1e5)][_0x9218bf(0x1d9)](_0x4e4708));const _0x14c74f=_0x58033a['session']||undefined;return saveSessionContext({'engage_workspace':_0x4e4708},_0x14c74f),console[_0x9218bf(0x203)](_0x9218bf(0x1ec)+_0x4e4708),console[_0x9218bf(0x203)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x28a739=a25_0xad55;(function(_0x4acb59,_0x1cb1d9){const _0x18f694=a25_0xad55,_0x517925=_0x4acb59();while(!![]){try{const _0x466e7f=-parseInt(_0x18f694(0x189))/0x1*(-parseInt(_0x18f694(0x188))/0x2)+-parseInt(_0x18f694(0x1bd))/0x3+-parseInt(_0x18f694(0x1b3))/0x4+-parseInt(_0x18f694(0x1b2))/0x5*(parseInt(_0x18f694(0x17e))/0x6)+-parseInt(_0x18f694(0x17b))/0x7+-parseInt(_0x18f694(0x177))/0x8*(-parseInt(_0x18f694(0x1c0))/0x9)+parseInt(_0x18f694(0x174))/0xa;if(_0x466e7f===_0x1cb1d9)break;else _0x517925['push'](_0x517925['shift']());}catch(_0x4363be){_0x517925['push'](_0x517925['shift']());}}}(a25_0x2381,0x3082f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a25_0x28a739(0x1b5)]=a25_0x28a739(0x1b1);[a25_0x28a739(0x1c4)]=a25_0x28a739(0x1a6);async['execute'](_0x25c46c){const _0x3b6cf3=a25_0x28a739,{options:_0x38620e,tdx:_0x2f03f3}=_0x25c46c;try{const _0x474e8f=resolveLimit(_0x38620e['limit'],DEFAULT_DISPLAY_LIMIT),_0x1d98b0=_0x38620e['status'];_0x38620e[_0x3b6cf3(0x1a5)]&&(console[_0x3b6cf3(0x19c)]('Limit:\x20'+_0x474e8f+_0x3b6cf3(0x1b0)),_0x1d98b0&&console['error'](_0x3b6cf3(0x1af)+_0x1d98b0));const _0x38c276=await withSpinner(_0x3b6cf3(0x1a1),()=>_0x2f03f3[_0x3b6cf3(0x1b1)][_0x3b6cf3(0x19d)]({'from':0x0,'to':_0x474e8f-0x1,'status':_0x1d98b0}),{'verbose':_0x38620e[_0x3b6cf3(0x1a5)]}),_0x490fb5=_0x38c276[_0x3b6cf3(0x175)];console[_0x3b6cf3(0x19c)](_0x3b6cf3(0x173)+_0x490fb5[_0x3b6cf3(0x186)]+_0x3b6cf3(0x1c2)+(_0x490fb5['length']!==0x1?'s':''));const _0x33353f=_0x490fb5[_0x3b6cf3(0x1b6)](_0x63b658=>{const _0x1b7df5=_0x3b6cf3;let _0x1577d4;if(_0x63b658[_0x1b7df5(0x19b)]&&_0x63b658['end_at']){const _0x3b125c=new Date(_0x63b658[_0x1b7df5(0x19b)])[_0x1b7df5(0x1b4)](),_0xe43163=new Date(_0x63b658[_0x1b7df5(0x1a4)])['getTime']();_0x1577d4=Math[_0x1b7df5(0x1a0)]((_0xe43163-_0x3b125c)/0x3e8);}return{'job_id':_0x63b658[_0x1b7df5(0x178)],'type':_0x63b658[_0x1b7df5(0x1bf)],'status':_0x63b658[_0x1b7df5(0x1ac)],'user_name':_0x63b658[_0x1b7df5(0x182)],'duration_sec':_0x1577d4,'created_at':_0x63b658[_0x1b7df5(0x180)],'started_at':_0x63b658[_0x1b7df5(0x19b)],'end_at':_0x63b658['end_at']};});return await handleSDKOutput(_0x33353f,_0x38620e),0x0;}catch(_0x576358){if(_0x576358 instanceof SDKError)return console[_0x3b6cf3(0x19c)]('Error:\x20'+_0x576358[_0x3b6cf3(0x1a8)]),_0x576358['cause']&&console[_0x3b6cf3(0x19c)](_0x3b6cf3(0x1c1)+_0x576358[_0x3b6cf3(0x184)]),0x1;throw _0x576358;}}}function a25_0xad55(_0x56f687,_0x46855a){_0x56f687=_0x56f687-0x172;const _0x238165=a25_0x2381();let _0xad55c6=_0x238165[_0x56f687];return _0xad55c6;}function a25_0x2381(){const _0x256c85=['status','job:submit','...','Status\x20filter:\x20','\x20jobs','jobs','624905JgldGl','76804jXLxZG','getTime','name','map','hive','substring','Get\x20job\x20results','debug','Error:\x20Query\x20is\x20required','Error:\x20','955293pyJWcL','✔\x20Retrieved\x20','type','162JKCYXV','\x20\x20Cause:\x20','\x20job','Submit\x20a\x20job','description','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','✔\x20Found\x20','6420570SdCKNN','data','Getting\x20job\x20results...','79336NAXGJM','job_id','job:result','Submitting\x20job...','1115135IBHvkY','\x20\x20Job\x20ID:\x20','url','6qLAKiq','job:show','created_at','database','user_name','job:kill','cause','priority','length','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','4aqvkCf','29cpdmbw','execute','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','kill','jobType','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Getting\x20job\x20details...','Job\x20type:\x20','trino','\x27\x20to\x20verify\x20the\x20job\x20status','result','query','Usage:\x20job\x20kill\x20<job-id>','information_schema','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Kill\x20a\x20job','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Database:\x20','start_at','error','list','file','Cancelled','round','Listing\x20jobs...','Usage:\x20job\x20result\x20<job-id>','✔\x20Job\x20submitted','end_at','verbose','List\x20jobs','Submitting\x20kill\x20request...','message','Error:\x20Job\x20ID\x20is\x20required','Show\x20job\x20details','submit'];a25_0x2381=function(){return _0x256c85;};return a25_0x2381();}export class JobShowCommand extends BaseCommand{[a25_0x28a739(0x1b5)]=a25_0x28a739(0x17f);[a25_0x28a739(0x1c4)]=a25_0x28a739(0x1aa);async[a25_0x28a739(0x18a)](_0x5a8ac5){const _0x2ad5ce=a25_0x28a739,{options:_0x35b7db,args:_0x3365eb,tdx:_0x28668f}=_0x5a8ac5,_0x24b64c=_0x3365eb[0x0];if(!_0x24b64c)return console[_0x2ad5ce(0x19c)](_0x2ad5ce(0x1a9)),console[_0x2ad5ce(0x19c)]('Usage:\x20job\x20show\x20<job-id>'),0x1;try{const _0x27da9b=await withSpinner(_0x2ad5ce(0x18f),()=>_0x28668f[_0x2ad5ce(0x1b1)]['show'](_0x24b64c),{'verbose':_0x35b7db[_0x2ad5ce(0x1a5)]}),_0x4db6c7=_0x27da9b[_0x2ad5ce(0x175)];let _0x266483;if(_0x4db6c7[_0x2ad5ce(0x19b)]&&_0x4db6c7['end_at']){const _0x5d46cf=new Date(_0x4db6c7[_0x2ad5ce(0x19b)])[_0x2ad5ce(0x1b4)](),_0x5dc535=new Date(_0x4db6c7[_0x2ad5ce(0x1a4)])['getTime']();_0x266483=Math[_0x2ad5ce(0x1a0)]((_0x5dc535-_0x5d46cf)/0x3e8);}const _0xbade34={'job_id':_0x4db6c7[_0x2ad5ce(0x178)],'type':_0x4db6c7[_0x2ad5ce(0x1bf)],'status':_0x4db6c7['status'],..._0x4db6c7[_0x2ad5ce(0x182)]&&{'user_name':_0x4db6c7[_0x2ad5ce(0x182)]},..._0x266483!==undefined&&{'duration_sec':_0x266483},..._0x4db6c7['created_at']&&{'created_at':_0x4db6c7[_0x2ad5ce(0x180)]},..._0x4db6c7[_0x2ad5ce(0x19b)]&&{'started_at':_0x4db6c7[_0x2ad5ce(0x19b)]},..._0x4db6c7[_0x2ad5ce(0x1a4)]&&{'end_at':_0x4db6c7[_0x2ad5ce(0x1a4)]},..._0x4db6c7[_0x2ad5ce(0x181)]&&{'database':_0x4db6c7['database']},..._0x4db6c7['priority']!==undefined&&{'priority':_0x4db6c7[_0x2ad5ce(0x185)]},..._0x4db6c7[_0x2ad5ce(0x17d)]&&{'url':_0x4db6c7[_0x2ad5ce(0x17d)]},..._0x4db6c7[_0x2ad5ce(0x194)]&&{'query':_0x4db6c7[_0x2ad5ce(0x194)]},..._0x4db6c7[_0x2ad5ce(0x1ba)]&&{'debug':_0x4db6c7[_0x2ad5ce(0x1ba)]}};return await handleSingleObjectOutput(_0xbade34,_0x35b7db),0x0;}catch(_0x35e28e){if(_0x35e28e instanceof SDKError)return console[_0x2ad5ce(0x19c)](_0x2ad5ce(0x1bc)+_0x35e28e[_0x2ad5ce(0x1a8)]),_0x35e28e['cause']&&console[_0x2ad5ce(0x19c)](_0x2ad5ce(0x1c1)+_0x35e28e[_0x2ad5ce(0x184)]),0x1;throw _0x35e28e;}}}export class JobKillCommand extends BaseCommand{['name']=a25_0x28a739(0x183);[a25_0x28a739(0x1c4)]=a25_0x28a739(0x198);async[a25_0x28a739(0x18a)](_0x48d821){const _0x4ce840=a25_0x28a739,{options:_0x4f0e07,args:_0x52efcc,tdx:_0x89fb0b}=_0x48d821,_0x5233b3=_0x52efcc[0x0];if(!_0x5233b3)return console[_0x4ce840(0x19c)](_0x4ce840(0x1a9)),console[_0x4ce840(0x19c)](_0x4ce840(0x195)),0x1;try{if(!_0x4f0e07['yes']){const _0x212b5a=await confirm(_0x4ce840(0x18e)+_0x5233b3+'?');if(!_0x212b5a)return console[_0x4ce840(0x19c)](_0x4ce840(0x19f)),0x0;}return await withSpinner(_0x4ce840(0x1a7),()=>_0x89fb0b[_0x4ce840(0x1b1)][_0x4ce840(0x18c)](_0x5233b3),{'verbose':_0x4f0e07[_0x4ce840(0x1a5)]}),console[_0x4ce840(0x19c)](_0x4ce840(0x187)+_0x5233b3),console['error'](_0x4ce840(0x199)+_0x5233b3+_0x4ce840(0x192)),0x0;}catch(_0x449b27){if(_0x449b27 instanceof SDKError)return console[_0x4ce840(0x19c)](_0x4ce840(0x1bc)+_0x449b27['message']),_0x449b27[_0x4ce840(0x184)]&&console[_0x4ce840(0x19c)](_0x4ce840(0x1c1)+_0x449b27[_0x4ce840(0x184)]),0x1;throw _0x449b27;}}}export class JobSubmitCommand extends BaseCommand{[a25_0x28a739(0x1b5)]=a25_0x28a739(0x1ad);['description']=a25_0x28a739(0x1c3);async[a25_0x28a739(0x18a)](_0x2c268a){const _0x58338d=a25_0x28a739,{options:_0x487df7,args:_0xee5031,tdx:_0x3859af}=_0x2c268a;try{const _0x5ceab6=_0x487df7[_0x58338d(0x18d)]||'trino',_0x92afd6=_0x487df7[_0x58338d(0x19e)],_0x178b9e=_0x487df7[_0x58338d(0x181)]||_0x58338d(0x196);if(_0x5ceab6!==_0x58338d(0x191)&&_0x5ceab6!==_0x58338d(0x1b7))return console['error'](_0x58338d(0x18b)),0x1;let _0xf6647;if(_0x92afd6){if(_0xee5031[0x0])return console['error'](_0x58338d(0x172)),0x1;const _0x57bd34=readSqlStatementsFromFile(_0x92afd6);if(_0x57bd34[_0x58338d(0x186)]===0x0)return console[_0x58338d(0x19c)]('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x57bd34['length']>0x1)return console[_0x58338d(0x19c)](_0x58338d(0x197)),0x1;_0xf6647=_0x57bd34[0x0];}else{if(!_0xee5031[0x0])return console[_0x58338d(0x19c)](_0x58338d(0x1bb)),console[_0x58338d(0x19c)]('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0xf6647=_0xee5031[0x0];}_0x487df7[_0x58338d(0x1a5)]&&(console['error'](_0x58338d(0x190)+_0x5ceab6),console[_0x58338d(0x19c)](_0x58338d(0x19a)+_0x178b9e),console['error']('Query:\x20'+_0xf6647[_0x58338d(0x1b8)](0x0,0x64)+(_0xf6647['length']>0x64?_0x58338d(0x1ae):'')));const _0x2a9bf9=await withSpinner(_0x58338d(0x17a),()=>_0x3859af[_0x58338d(0x1b1)][_0x58338d(0x1ab)](_0x178b9e,_0xf6647,_0x5ceab6),{'verbose':_0x487df7[_0x58338d(0x1a5)]}),_0x1fa2d5=_0x2a9bf9[_0x58338d(0x175)];return console[_0x58338d(0x19c)](_0x58338d(0x1a3)),console[_0x58338d(0x19c)](_0x58338d(0x17c)+_0x1fa2d5[_0x58338d(0x178)]),await handleSDKOutput([_0x1fa2d5],_0x487df7),0x0;}catch(_0x31912f){if(_0x31912f instanceof SDKError)return console['error'](_0x58338d(0x1bc)+_0x31912f[_0x58338d(0x1a8)]),_0x31912f[_0x58338d(0x184)]&&console[_0x58338d(0x19c)]('\x20\x20Cause:\x20'+_0x31912f[_0x58338d(0x184)]),0x1;throw _0x31912f;}}}export class JobResultCommand extends BaseCommand{['name']=a25_0x28a739(0x179);[a25_0x28a739(0x1c4)]=a25_0x28a739(0x1b9);async['execute'](_0x514393){const _0x53d1c0=a25_0x28a739,{options:_0x4537fa,args:_0x4266ac,tdx:_0xf2114a}=_0x514393,_0x5407ff=_0x4266ac[0x0];if(!_0x5407ff)return console['error'](_0x53d1c0(0x1a9)),console[_0x53d1c0(0x19c)](_0x53d1c0(0x1a2)),0x1;try{const _0x224abc=await withSpinner(_0x53d1c0(0x176),()=>_0xf2114a['jobs'][_0x53d1c0(0x193)](_0x5407ff),{'verbose':_0x4537fa[_0x53d1c0(0x1a5)]}),_0x2492c4=_0x224abc[_0x53d1c0(0x175)];return console[_0x53d1c0(0x19c)](_0x53d1c0(0x1be)+_0x2492c4[_0x53d1c0(0x186)]+'\x20row'+(_0x2492c4['length']!==0x1?'s':'')),await handleSDKOutput(_0x2492c4,_0x4537fa),0x0;}catch(_0x434d3c){if(_0x434d3c instanceof SDKError)return console[_0x53d1c0(0x19c)](_0x53d1c0(0x1bc)+_0x434d3c[_0x53d1c0(0x1a8)]),_0x434d3c['cause']&&console['error'](_0x53d1c0(0x1c1)+_0x434d3c[_0x53d1c0(0x184)]),0x1;throw _0x434d3c;}}}
|
|
1
|
+
const a25_0x1155dc=a25_0x59f5;(function(_0x14a538,_0x2df1e0){const _0x5a2ba8=a25_0x59f5,_0x34de61=_0x14a538();while(!![]){try{const _0x56b657=parseInt(_0x5a2ba8(0xce))/0x1*(-parseInt(_0x5a2ba8(0xbf))/0x2)+-parseInt(_0x5a2ba8(0xa2))/0x3+parseInt(_0x5a2ba8(0xc9))/0x4+-parseInt(_0x5a2ba8(0x99))/0x5*(parseInt(_0x5a2ba8(0xb2))/0x6)+parseInt(_0x5a2ba8(0xbd))/0x7*(-parseInt(_0x5a2ba8(0xcc))/0x8)+-parseInt(_0x5a2ba8(0xdf))/0x9+parseInt(_0x5a2ba8(0xd5))/0xa;if(_0x56b657===_0x2df1e0)break;else _0x34de61['push'](_0x34de61['shift']());}catch(_0x54e700){_0x34de61['push'](_0x34de61['shift']());}}}(a25_0x2435,0x9b562));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a25_0x1155dc(0xa0)]='jobs';[a25_0x1155dc(0xa1)]=a25_0x1155dc(0xdd);async['execute'](_0x27e967){const _0x2fd747=a25_0x1155dc,{options:_0x4fd60f,tdx:_0x365ab0}=_0x27e967;try{const _0x51ecbf=resolveLimit(_0x4fd60f['limit'],DEFAULT_DISPLAY_LIMIT),_0x5cd8c9=_0x4fd60f['status'];_0x4fd60f[_0x2fd747(0xc8)]&&(console[_0x2fd747(0xcb)](_0x2fd747(0xc3)+_0x51ecbf+_0x2fd747(0xd1)),_0x5cd8c9&&console['error'](_0x2fd747(0xd4)+_0x5cd8c9));const _0x5c5b2f=await withSpinner('Listing\x20jobs...',()=>_0x365ab0[_0x2fd747(0xac)][_0x2fd747(0xbc)]({'from':0x0,'to':_0x51ecbf-0x1,'status':_0x5cd8c9}),{'verbose':_0x4fd60f[_0x2fd747(0xc8)]}),_0x3f0301=_0x5c5b2f[_0x2fd747(0xb0)];console[_0x2fd747(0xcb)](_0x2fd747(0x97)+_0x3f0301[_0x2fd747(0xc7)]+_0x2fd747(0xb8)+(_0x3f0301[_0x2fd747(0xc7)]!==0x1?'s':''));const _0x306e80=_0x3f0301[_0x2fd747(0xa5)](_0x58ea41=>{const _0x35262e=_0x2fd747;let _0x18ea1d;if(_0x58ea41[_0x35262e(0xbe)]&&_0x58ea41['end_at']){const _0x5bac7b=new Date(_0x58ea41['start_at'])[_0x35262e(0x9e)](),_0x16153a=new Date(_0x58ea41[_0x35262e(0x93)])['getTime']();_0x18ea1d=Math[_0x35262e(0xc2)]((_0x16153a-_0x5bac7b)/0x3e8);}return{'job_id':_0x58ea41[_0x35262e(0x98)],'type':_0x58ea41['type'],'status':_0x58ea41[_0x35262e(0xb9)],'user_name':_0x58ea41['user_name'],'duration_sec':_0x18ea1d,'created_at':_0x58ea41[_0x35262e(0xb5)],'started_at':_0x58ea41[_0x35262e(0xbe)],'end_at':_0x58ea41[_0x35262e(0x93)]};});return await handleSDKOutput(_0x306e80,_0x4fd60f),0x0;}catch(_0x1e9458){if(_0x1e9458 instanceof SDKError)return console[_0x2fd747(0xcb)]('Error:\x20'+_0x1e9458[_0x2fd747(0xb3)]),_0x1e9458[_0x2fd747(0xc6)]&&console[_0x2fd747(0xcb)](_0x2fd747(0x9b)+_0x1e9458['cause']),0x1;throw _0x1e9458;}}}export class JobShowCommand extends BaseCommand{[a25_0x1155dc(0xa0)]=a25_0x1155dc(0xcf);[a25_0x1155dc(0xa1)]='Show\x20job\x20details';async['execute'](_0x260247){const _0x295e7e=a25_0x1155dc,{options:_0x4850ae,args:_0x39d460,tdx:_0x446894}=_0x260247,_0x508a24=_0x39d460[0x0];if(!_0x508a24)return console[_0x295e7e(0xcb)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x295e7e(0xcb)](_0x295e7e(0xa7)),0x1;try{const _0x557ea6=await withSpinner('Getting\x20job\x20details...',()=>_0x446894[_0x295e7e(0xac)][_0x295e7e(0xc1)](_0x508a24),{'verbose':_0x4850ae['verbose']}),_0x310707=_0x557ea6[_0x295e7e(0xb0)];let _0x16fa08;if(_0x310707[_0x295e7e(0xbe)]&&_0x310707[_0x295e7e(0x93)]){const _0x560939=new Date(_0x310707[_0x295e7e(0xbe)])['getTime'](),_0x513459=new Date(_0x310707['end_at'])[_0x295e7e(0x9e)]();_0x16fa08=Math[_0x295e7e(0xc2)]((_0x513459-_0x560939)/0x3e8);}const _0x1e1778={'job_id':_0x310707['job_id'],'type':_0x310707[_0x295e7e(0x96)],'status':_0x310707[_0x295e7e(0xb9)],..._0x310707[_0x295e7e(0xaa)]&&{'user_name':_0x310707['user_name']},..._0x16fa08!==undefined&&{'duration_sec':_0x16fa08},..._0x310707[_0x295e7e(0xb5)]&&{'created_at':_0x310707['created_at']},..._0x310707[_0x295e7e(0xbe)]&&{'started_at':_0x310707[_0x295e7e(0xbe)]},..._0x310707['end_at']&&{'end_at':_0x310707[_0x295e7e(0x93)]},..._0x310707[_0x295e7e(0x9d)]&&{'database':_0x310707[_0x295e7e(0x9d)]},..._0x310707[_0x295e7e(0x92)]!==undefined&&{'priority':_0x310707[_0x295e7e(0x92)]},..._0x310707[_0x295e7e(0xca)]&&{'url':_0x310707[_0x295e7e(0xca)]},..._0x310707[_0x295e7e(0xbb)]&&{'query':_0x310707['query']},..._0x310707[_0x295e7e(0xa4)]&&{'debug':_0x310707[_0x295e7e(0xa4)]}};return await handleSingleObjectOutput(_0x1e1778,_0x4850ae),0x0;}catch(_0x5e3512){if(_0x5e3512 instanceof SDKError)return console[_0x295e7e(0xcb)]('Error:\x20'+_0x5e3512['message']),_0x5e3512['cause']&&console[_0x295e7e(0xcb)]('\x20\x20Cause:\x20'+_0x5e3512[_0x295e7e(0xc6)]),0x1;throw _0x5e3512;}}}export class JobKillCommand extends BaseCommand{[a25_0x1155dc(0xa0)]='job:kill';[a25_0x1155dc(0xa1)]=a25_0x1155dc(0xd7);async[a25_0x1155dc(0x9a)](_0x5832e0){const _0x36f7a5=a25_0x1155dc,{options:_0x38a92a,args:_0x3b2433,tdx:_0x1b6c30}=_0x5832e0,_0x3deca4=_0x3b2433[0x0];if(!_0x3deca4)return console[_0x36f7a5(0xcb)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x36f7a5(0xcb)](_0x36f7a5(0xb7)),0x1;try{if(!_0x38a92a[_0x36f7a5(0xc5)]){const _0x3d3830=await confirm(_0x36f7a5(0xae)+_0x3deca4+'?');if(!_0x3d3830)return console[_0x36f7a5(0xcb)](_0x36f7a5(0xd6)),0x0;}return await withSpinner(_0x36f7a5(0xcd),()=>_0x1b6c30[_0x36f7a5(0xac)]['kill'](_0x3deca4),{'verbose':_0x38a92a[_0x36f7a5(0xc8)]}),console[_0x36f7a5(0xcb)](_0x36f7a5(0xc0)+_0x3deca4),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x3deca4+_0x36f7a5(0xc4)),0x0;}catch(_0x2eb5ba){if(_0x2eb5ba instanceof SDKError)return console['error'](_0x36f7a5(0xdc)+_0x2eb5ba[_0x36f7a5(0xb3)]),_0x2eb5ba['cause']&&console[_0x36f7a5(0xcb)](_0x36f7a5(0x9b)+_0x2eb5ba[_0x36f7a5(0xc6)]),0x1;throw _0x2eb5ba;}}}export class JobSubmitCommand extends BaseCommand{['name']=a25_0x1155dc(0xaf);['description']='Submit\x20a\x20job';async[a25_0x1155dc(0x9a)](_0x5b8c30){const _0x2bb7c5=a25_0x1155dc,{options:_0xa547dc,args:_0x1c7c44,tdx:_0x57bed0}=_0x5b8c30;try{const _0x1e7037=_0xa547dc[_0x2bb7c5(0x9f)]||_0x2bb7c5(0xa8),_0x5075c6=_0xa547dc[_0x2bb7c5(0xb1)],_0x3d36a5=_0xa547dc['database']||_0x2bb7c5(0xde);if(_0x1e7037!==_0x2bb7c5(0xa8)&&_0x1e7037!==_0x2bb7c5(0xd9))return console[_0x2bb7c5(0xcb)](_0x2bb7c5(0xd3)),0x1;let _0x5e4e4e;if(_0x5075c6){if(_0x1c7c44[0x0])return console[_0x2bb7c5(0xcb)](_0x2bb7c5(0xd8)),0x1;const _0x7a2ae8=readSqlStatementsFromFile(_0x5075c6);if(_0x7a2ae8[_0x2bb7c5(0xc7)]===0x0)return console[_0x2bb7c5(0xcb)](_0x2bb7c5(0xab)),0x1;if(_0x7a2ae8[_0x2bb7c5(0xc7)]>0x1)return console[_0x2bb7c5(0xcb)](_0x2bb7c5(0xdb)),0x1;_0x5e4e4e=_0x7a2ae8[0x0];}else{if(!_0x1c7c44[0x0])return console[_0x2bb7c5(0xcb)](_0x2bb7c5(0xb4)),console[_0x2bb7c5(0xcb)](_0x2bb7c5(0xb6)),0x1;_0x5e4e4e=_0x1c7c44[0x0];}_0xa547dc['verbose']&&(console[_0x2bb7c5(0xcb)](_0x2bb7c5(0xba)+_0x1e7037),console[_0x2bb7c5(0xcb)]('Database:\x20'+_0x3d36a5),console[_0x2bb7c5(0xcb)](_0x2bb7c5(0x94)+_0x5e4e4e[_0x2bb7c5(0xa9)](0x0,0x64)+(_0x5e4e4e[_0x2bb7c5(0xc7)]>0x64?_0x2bb7c5(0xa3):'')));const _0x1ec98d=await withSpinner('Submitting\x20job...',()=>_0x57bed0[_0x2bb7c5(0xac)][_0x2bb7c5(0xd2)](_0x3d36a5,_0x5e4e4e,_0x1e7037),{'verbose':_0xa547dc[_0x2bb7c5(0xc8)]}),_0x29d240=_0x1ec98d[_0x2bb7c5(0xb0)];return console['error']('✔\x20Job\x20submitted'),console['error']('\x20\x20Job\x20ID:\x20'+_0x29d240[_0x2bb7c5(0x98)]),await handleSDKOutput([_0x29d240],_0xa547dc),0x0;}catch(_0x477a9f){if(_0x477a9f instanceof SDKError)return console[_0x2bb7c5(0xcb)](_0x2bb7c5(0xdc)+_0x477a9f[_0x2bb7c5(0xb3)]),_0x477a9f[_0x2bb7c5(0xc6)]&&console[_0x2bb7c5(0xcb)](_0x2bb7c5(0x9b)+_0x477a9f['cause']),0x1;throw _0x477a9f;}}}function a25_0x2435(){const _0x5ef90d=['start_at','36Sdckvz','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','show','round','Limit:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','yes','cause','length','verbose','3390408WuvlDh','url','error','64312fhzuiQ','Submitting\x20kill\x20request...','31358VgnCZN','job:show','Getting\x20job\x20results...','\x20jobs','submit','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Status\x20filter:\x20','34142250LzuUiP','Cancelled','Kill\x20a\x20job','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','hive','Usage:\x20job\x20result\x20<job-id>','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Error:\x20','List\x20jobs','information_schema','2983149rglAxN','priority','end_at','Query:\x20','\x20row','type','✔\x20Found\x20','job_id','904415EKBeRN','execute','\x20\x20Cause:\x20','result','database','getTime','jobType','name','description','2461122lPUIXy','...','debug','map','✔\x20Retrieved\x20','Usage:\x20job\x20show\x20<job-id>','trino','substring','user_name','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','jobs','Get\x20job\x20results','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job:submit','data','file','30lkCatF','message','Error:\x20Query\x20is\x20required','created_at','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Usage:\x20job\x20kill\x20<job-id>','\x20job','status','Job\x20type:\x20','query','list','875zrQBEW'];a25_0x2435=function(){return _0x5ef90d;};return a25_0x2435();}function a25_0x59f5(_0x4497e5,_0x5d2fff){_0x4497e5=_0x4497e5-0x92;const _0x243588=a25_0x2435();let _0x59f5a3=_0x243588[_0x4497e5];return _0x59f5a3;}export class JobResultCommand extends BaseCommand{[a25_0x1155dc(0xa0)]='job:result';['description']=a25_0x1155dc(0xad);async[a25_0x1155dc(0x9a)](_0x140794){const _0xd59a10=a25_0x1155dc,{options:_0x9d0934,args:_0x2c6009,tdx:_0x162aac}=_0x140794,_0x4ccc7c=_0x2c6009[0x0];if(!_0x4ccc7c)return console[_0xd59a10(0xcb)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0xd59a10(0xcb)](_0xd59a10(0xda)),0x1;try{const _0x58d227=await withSpinner(_0xd59a10(0xd0),()=>_0x162aac['jobs'][_0xd59a10(0x9c)](_0x4ccc7c),{'verbose':_0x9d0934[_0xd59a10(0xc8)]}),_0x295d5e=_0x58d227[_0xd59a10(0xb0)];return console['error'](_0xd59a10(0xa6)+_0x295d5e[_0xd59a10(0xc7)]+_0xd59a10(0x95)+(_0x295d5e[_0xd59a10(0xc7)]!==0x1?'s':'')),await handleSDKOutput(_0x295d5e,_0x9d0934),0x0;}catch(_0x1c3840){if(_0x1c3840 instanceof SDKError)return console['error']('Error:\x20'+_0x1c3840['message']),_0x1c3840[_0xd59a10(0xc6)]&&console[_0xd59a10(0xcb)](_0xd59a10(0x9b)+_0x1c3840[_0xd59a10(0xc6)]),0x1;throw _0x1c3840;}}}
|