@treasuredata/tdx 2026.3.28 → 2026.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x385fc0=a31_0x240b;function a31_0x23ca(){const _0x34150e=['entries','length','56656GQjtbX','📋\x20Assigned\x20Policies','all','List\x20all\x20policies\x20in\x20the\x20account\x20(admin\x20only)','validate','Fetching\x20permissions...','verbose','listPolicies','2133341rrBSos','dim','getMyPermissions','padEnd','Show\x20a\x20specific\x20policy\x20details\x20and\x20permissions\x20(admin\x20only)','map','getCurrent','ies','context','666yAvCBD','policy\x20list','policy','email','Listing\x20policies...','Show\x20current\x20user\x20policies\x20and\x20effective\x20permissions','policy\x20show',',\x20user_id:','43bjkebc','12FasQyr','👥\x20Assigned\x20Users','account_owner','\x20\x20No\x20policies\x20assigned','execute','\x20polic','\x20assigned','\x20user','1295625GgYmAS','permissions','log','✔\x20Found\x20','(ID:\x20','8822RLqwQv','2052488lwhGxn','\x20\x20\x20','administrator','\x20—\x20','No\x20policies\x20found','join','Account\x20Owner','Fetching\x20policy...','user','8426mKIFZm','description','bold','2425080MxOpMT','args','Administrator','\x20\x20•\x20','account_id','name','data','25390CWibDt','policies'];a31_0x23ca=function(){return _0x34150e;};return a31_0x23ca();}(function(_0x5db778,_0x576f27){const _0x453fde=a31_0x240b,_0x2e2ef7=_0x5db778();while(!![]){try{const _0x413cb0=-parseInt(_0x453fde(0xef))/0x1*(-parseInt(_0x453fde(0xfd))/0x2)+parseInt(_0x453fde(0xcb))/0x3+parseInt(_0x453fde(0xbf))/0x4+-parseInt(_0x453fde(0xf8))/0x5+parseInt(_0x453fde(0xf0))/0x6*(parseInt(_0x453fde(0xde))/0x7)+-parseInt(_0x453fde(0xd6))/0x8*(-parseInt(_0x453fde(0xe7))/0x9)+parseInt(_0x453fde(0xd2))/0xa*(-parseInt(_0x453fde(0xc8))/0xb);if(_0x413cb0===_0x576f27)break;else _0x2e2ef7['push'](_0x2e2ef7['shift']());}catch(_0x426e94){_0x2e2ef7['push'](_0x2e2ef7['shift']());}}}(a31_0x23ca,0x6b9ae));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a31_0x3631b7 from'chalk';export class PolicyCommand extends BaseCommand{[a31_0x385fc0(0xd0)]='policy';[a31_0x385fc0(0xc9)]=a31_0x385fc0(0xec);async[a31_0x385fc0(0xf4)](_0x2c7845){const _0xcd272c=a31_0x385fc0,{options:_0xe47e0f,tdx:_0x5644c8}=_0x2c7845,_0x9507c2=await withSpinner(_0xcd272c(0xdb),async()=>{const _0x7a88c6=_0xcd272c,[_0x4bd0c8,_0x48c20c]=await Promise[_0x7a88c6(0xd8)]([_0x5644c8[_0x7a88c6(0xc7)][_0x7a88c6(0xe4)](),_0x5644c8[_0x7a88c6(0xe9)][_0x7a88c6(0xe0)]()]);return{'userInfo':_0x4bd0c8,'permissions':_0x48c20c};},{'verbose':_0xe47e0f[_0xcd272c(0xdc)]}),{userInfo:_0x2c3ca2,permissions:_0x1648c1}=_0x9507c2[_0xcd272c(0xd1)];if(isStructuredFormat(_0xe47e0f))return await handleSingleObjectOutput(_0x1648c1,_0xe47e0f),0x0;const _0x2f5508=_0x2c3ca2[_0xcd272c(0xf2)]?_0xcd272c(0xc5):_0x2c3ca2[_0xcd272c(0xc1)]?_0xcd272c(0xcd):'Member';console['log']('\x0a'+a31_0x3631b7[_0xcd272c(0xca)]('👤')+'\x20'+a31_0x3631b7[_0xcd272c(0xca)](_0x2c3ca2['name'])+'\x20'+a31_0x3631b7[_0xcd272c(0xdf)]('('+_0x2c3ca2[_0xcd272c(0xea)]+')')+_0xcd272c(0xc2)+_0x2f5508),console[_0xcd272c(0xfa)](a31_0x3631b7[_0xcd272c(0xdf)](_0xcd272c(0xc0)+_0x5644c8[_0xcd272c(0xe6)]['site']+':'+_0x2c3ca2[_0xcd272c(0xcf)]+_0xcd272c(0xee)+_0x2c3ca2['id']));const _0x5299e9=_0x1648c1[_0xcd272c(0xd3)];console[_0xcd272c(0xfa)]('\x0a'+a31_0x3631b7[_0xcd272c(0xca)](_0xcd272c(0xd7))+'\x20('+_0x5299e9[_0xcd272c(0xd5)]+'):');if(_0x5299e9[_0xcd272c(0xd5)]===0x0)console['log'](a31_0x3631b7[_0xcd272c(0xdf)](_0xcd272c(0xf3)));else for(const _0x26c2b0 of _0x5299e9){console[_0xcd272c(0xfa)]('\x20\x20•\x20'+_0x26c2b0[_0xcd272c(0xd0)]);}return printPermissionsMap(_0x1648c1[_0xcd272c(0xf9)]),console[_0xcd272c(0xfa)](),0x0;}}export class PolicyListCommand extends BaseCommand{[a31_0x385fc0(0xd0)]=a31_0x385fc0(0xe8);[a31_0x385fc0(0xc9)]=a31_0x385fc0(0xd9);async['execute'](_0x5e6859){const _0x52883c=a31_0x385fc0,{options:_0xdd122b,tdx:_0x159bbe}=_0x5e6859,_0x217491=await withSpinner(_0x52883c(0xeb),()=>_0x159bbe[_0x52883c(0xe9)][_0x52883c(0xdd)](),{'verbose':_0xdd122b[_0x52883c(0xdc)]}),_0x17738c=_0x217491[_0x52883c(0xd1)];console['error'](_0x52883c(0xfb)+_0x17738c[_0x52883c(0xd5)]+_0x52883c(0xf5)+(_0x17738c[_0x52883c(0xd5)]!==0x1?_0x52883c(0xe5):'y'));if(isStructuredFormat(_0xdd122b))return await handleSDKOutput(_0x17738c,_0xdd122b),0x0;if(_0x17738c['length']===0x0)console[_0x52883c(0xfa)](a31_0x3631b7[_0x52883c(0xdf)](_0x52883c(0xc3)));else for(const _0x3e3b04 of _0x17738c){const _0x7f2093=_0x3e3b04[_0x52883c(0xc9)]?a31_0x3631b7['dim'](_0x52883c(0xc2)+_0x3e3b04[_0x52883c(0xc9)]):'';console[_0x52883c(0xfa)](_0x52883c(0xce)+_0x3e3b04[_0x52883c(0xd0)]+_0x7f2093);}return 0x0;}}function a31_0x240b(_0x39ed01,_0x48abde){_0x39ed01=_0x39ed01-0xbf;const _0x23ca2b=a31_0x23ca();let _0x240b6c=_0x23ca2b[_0x39ed01];return _0x240b6c;}export class PolicyShowCommand extends BaseCommand{[a31_0x385fc0(0xd0)]=a31_0x385fc0(0xed);[a31_0x385fc0(0xc9)]=a31_0x385fc0(0xe2);[a31_0x385fc0(0xda)](_0x134e45){const _0xf3738e=a31_0x385fc0;if(_0x134e45[_0xf3738e(0xcc)][_0xf3738e(0xd5)]===0x0)return'Usage:\x20tdx\x20policy\x20show\x20<policy-name-or-id>';return undefined;}async[a31_0x385fc0(0xf4)](_0xcecd42){const _0x3f5f73=a31_0x385fc0,{options:_0x3c3055,tdx:_0x48e07b}=_0xcecd42,_0x2f2851=_0xcecd42[_0x3f5f73(0xcc)][0x0],_0x1abd74=await withSpinner(_0x3f5f73(0xc6),async()=>{const _0x2780ba=_0x3f5f73,_0x55176f=await _0x48e07b[_0x2780ba(0xe9)]['getPolicy'](_0x2f2851),[_0x5946fb,_0x3edde8]=await Promise[_0x2780ba(0xd8)]([_0x48e07b[_0x2780ba(0xe9)]['getPolicyPermissions'](_0x55176f['id']),_0x48e07b[_0x2780ba(0xe9)]['getPolicyUsers'](_0x55176f['id'])]);return{'policy':_0x55176f,'perms':_0x5946fb,'users':_0x3edde8};},{'verbose':_0x3c3055['verbose']}),{policy:_0x4a7f85,perms:_0x19d428,users:_0x20bc7b}=_0x1abd74[_0x3f5f73(0xd1)];if(isStructuredFormat(_0x3c3055))return await handleSingleObjectOutput({..._0x4a7f85,'permissions':_0x19d428['permissions'],'users':_0x20bc7b},_0x3c3055),0x0;console['log']('\x0a'+a31_0x3631b7['bold']('📋')+'\x20'+a31_0x3631b7['bold'](_0x4a7f85[_0x3f5f73(0xd0)])+'\x20'+a31_0x3631b7['dim'](_0x3f5f73(0xfc)+_0x4a7f85['id']+')'));_0x4a7f85[_0x3f5f73(0xc9)]&&console[_0x3f5f73(0xfa)](_0x3f5f73(0xc0)+a31_0x3631b7[_0x3f5f73(0xdf)](_0x4a7f85['description']));console[_0x3f5f73(0xfa)](_0x3f5f73(0xc0)+_0x20bc7b[_0x3f5f73(0xd5)]+_0x3f5f73(0xf7)+(_0x20bc7b[_0x3f5f73(0xd5)]!==0x1?'s':'')+_0x3f5f73(0xf6)),printPermissionsMap(_0x19d428[_0x3f5f73(0xf9)]);if(_0x20bc7b[_0x3f5f73(0xd5)]>0x0){console[_0x3f5f73(0xfa)]('\x0a'+a31_0x3631b7[_0x3f5f73(0xca)](_0x3f5f73(0xf1))+':');for(const _0x7dccef of _0x20bc7b){const _0x2fffab=_0x7dccef[_0x3f5f73(0xea)]&&_0x7dccef[_0x3f5f73(0xea)]!==_0x7dccef[_0x3f5f73(0xd0)]?a31_0x3631b7['dim']('\x20<'+_0x7dccef[_0x3f5f73(0xea)]+'>'):'';console['log'](_0x3f5f73(0xce)+_0x7dccef[_0x3f5f73(0xd0)]+_0x2fffab);}}return console[_0x3f5f73(0xfa)](),0x0;}}function printPermissionsMap(_0x3ccc13){const _0x49acdf=a31_0x385fc0,_0x2bc9ab=Object[_0x49acdf(0xd4)](_0x3ccc13);console[_0x49acdf(0xfa)]('\x0a'+a31_0x3631b7['bold']('🔑\x20Effective\x20Permissions')+':');if(_0x2bc9ab[_0x49acdf(0xd5)]===0x0){console[_0x49acdf(0xfa)](a31_0x3631b7[_0x49acdf(0xdf)]('\x20\x20No\x20permissions'));return;}const _0x3182d8=Math['max'](..._0x2bc9ab[_0x49acdf(0xe3)](([_0x14982a])=>_0x14982a['length']));for(const [_0x3defea,_0x403a45]of _0x2bc9ab){const _0x261acb=formatOperations(_0x403a45);console[_0x49acdf(0xfa)]('\x20\x20'+_0x3defea[_0x49acdf(0xe1)](_0x3182d8+0x2)+_0x261acb);}}function formatOperations(_0x4dd0be){const _0x2d1b5c=a31_0x385fc0,_0x57dce8=[...new Set(_0x4dd0be[_0x2d1b5c(0xe3)](_0x5567dd=>_0x5567dd['operation']))];return _0x57dce8[_0x2d1b5c(0xc4)](',\x20');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x3ad395=a32_0x3479;(function(_0xd6601,_0x2798eb){const _0x40e9b3=a32_0x3479,_0x29d0f7=_0xd6601();while(!![]){try{const _0x19d22f=parseInt(_0x40e9b3(0xd0))/0x1*(parseInt(_0x40e9b3(0xc6))/0x2)+parseInt(_0x40e9b3(0xd9))/0x3*(-parseInt(_0x40e9b3(0xa3))/0x4)+parseInt(_0x40e9b3(0xe9))/0x5+-parseInt(_0x40e9b3(0xac))/0x6*(-parseInt(_0x40e9b3(0xf9))/0x7)+-parseInt(_0x40e9b3(0xff))/0x8*(-parseInt(_0x40e9b3(0x9a))/0x9)+parseInt(_0x40e9b3(0xe5))/0xa*(parseInt(_0x40e9b3(0xa8))/0xb)+-parseInt(_0x40e9b3(0xcc))/0xc*(parseInt(_0x40e9b3(0xdb))/0xd);if(_0x19d22f===_0x2798eb)break;else _0x29d0f7['push'](_0x29d0f7['shift']());}catch(_0x5036ac){_0x29d0f7['push'](_0x29d0f7['shift']());}}}(a32_0x3cbe,0x6cec2));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a32_0x1c84a from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a32_0x2a8710 from'prompts';import a32_0x2595c6 from'chalk';function validateProfileName(_0x3bec2b){const _0x16aeb2=a32_0x3479;if(!_0x3bec2b||!_0x3bec2b[_0x16aeb2(0xa5)]())return'Profile\x20name\x20cannot\x20be\x20empty';const _0x2cb222=_0x3bec2b[_0x16aeb2(0xa5)]();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x2cb222))return _0x16aeb2(0xc8);if(profileExists(_0x2cb222))return _0x16aeb2(0xd8)+_0x2cb222+_0x16aeb2(0xc9);return!![];}export class ProfileCreateCommand extends BaseCommand{[a32_0x3ad395(0xe7)]='profile:create';[a32_0x3ad395(0xe2)]=a32_0x3ad395(0xee);async[a32_0x3ad395(0xb2)](_0x496a4a){const _0x3dfaba=a32_0x3ad395,{options:_0x24beef,args:_0x504d02}=_0x496a4a;console[_0x3dfaba(0xb9)](a32_0x2595c6[_0x3dfaba(0xd4)]('tdx:\x20profile\x20create'));let _0x4ed360;if(_0x504d02[_0x3dfaba(0xbf)]>0x0&&_0x504d02[0x0]){const _0x5c68b9=_0x504d02[0x0][_0x3dfaba(0xa5)](),_0x52cbfb=validateProfileName(_0x5c68b9);if(_0x52cbfb!==!![])return console[_0x3dfaba(0xd7)](a32_0x2595c6[_0x3dfaba(0xb8)](_0x52cbfb)),0x1;_0x4ed360=_0x5c68b9;}else{const _0x22f089=await a32_0x2a8710({'type':_0x3dfaba(0xc3),'name':_0x3dfaba(0xf3),'message':_0x3dfaba(0xf1),'validate':validateProfileName});if(!_0x22f089[_0x3dfaba(0xf3)])return console[_0x3dfaba(0xb9)](_0x3dfaba(0xa7)),0x1;_0x4ed360=_0x22f089['profileName'][_0x3dfaba(0xa5)]();}const _0x2f1660=await a32_0x2a8710({'type':_0x3dfaba(0xc3),'name':_0x3dfaba(0xe2),'message':'Enter\x20description\x20(optional):'}),_0x4a6999=_0x2f1660[_0x3dfaba(0xe2)]?.[_0x3dfaba(0xa5)]()||undefined,_0x1d349c=_0x24beef[_0x3dfaba(0xba)]||_0x3dfaba(0xde),_0x5a8e3a=await promptSiteSelection(_0x1d349c,_0x4ed360,_0x3dfaba(0xc4));if(!_0x5a8e3a)return 0x1;const _0x19c1c5=resolveSite(_0x5a8e3a);if(isOAuthSupported(_0x19c1c5)){const _0x3baee6=await a32_0x2a8710({'type':_0x3dfaba(0xfe),'name':_0x3dfaba(0xdf),'message':'Choose\x20authentication\x20method:','choices':[{'title':'OAuth\x20(browser\x20login)','value':_0x3dfaba(0xda)},{'title':_0x3dfaba(0xf8),'value':'apikey'}]});if(!_0x3baee6[_0x3dfaba(0xdf)])return console[_0x3dfaba(0xb9)](_0x3dfaba(0xa7)),0x1;if(_0x3baee6[_0x3dfaba(0xdf)]==='oauth'){if(_0x4a6999){const _0x3e5f9a={'site':_0x19c1c5,'description':_0x4a6999};saveProfileToUserConfig(_0x4ed360,_0x3e5f9a);}return await runOAuthLoginFlow(_0x19c1c5,_0x4ed360,_0x24beef['logLevel']??LogLevel[_0x3dfaba(0x9f)]),0x0;}}console[_0x3dfaba(0xb9)](_0x3dfaba(0xad)+_0x19c1c5),console[_0x3dfaba(0xb9)](_0x3dfaba(0xc2)),console['log']('\x20\x20'+getConsoleUrl(_0x19c1c5,_0x3dfaba(0xb3)));const _0x5d396a=await a32_0x2a8710({'type':'password','name':_0x3dfaba(0xd2),'message':_0x3dfaba(0x9e),'validate':_0x49429a=>{const _0x53a409=_0x3dfaba;if(!_0x49429a||!_0x49429a[_0x53a409(0xa5)]())return _0x53a409(0xa2);return!![];}});if(!_0x5d396a[_0x3dfaba(0xd2)])return console[_0x3dfaba(0xb9)]('\x0aSetup\x20cancelled'),0x1;const _0xe26810=_0x5d396a['apiKey'];console['log']('Validating\x20API\x20key...');try{const _0x5f5b3b=TDX[_0x3dfaba(0xc0)]({'site':_0x19c1c5,'apiKey':_0xe26810[_0x3dfaba(0xa5)](),'logLevel':_0x24beef['logLevel']??LogLevel[_0x3dfaba(0x9f)]}),_0x4e3526=await _0x5f5b3b['jobs'][_0x3dfaba(0xef)]();console[_0x3dfaba(0xb9)](a32_0x2595c6[_0x3dfaba(0xe6)]('✓')+_0x3dfaba(0xe0)+_0x4e3526[_0x3dfaba(0xfb)]+')');const _0x558ee6=await isKeychainAvailable();_0x558ee6?(await saveAPIKeyAsync(_0xe26810['trim'](),_0x19c1c5,_0x4ed360),console[_0x3dfaba(0xb9)](a32_0x2595c6[_0x3dfaba(0xe6)]('✓')+_0x3dfaba(0xfa)+_0x4ed360+')')):(console['warn'](a32_0x2595c6[_0x3dfaba(0x100)](_0x3dfaba(0xbd))),console['warn'](a32_0x2595c6[_0x3dfaba(0x100)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x1d67bc={'site':_0x19c1c5,..._0x4a6999&&{'description':_0x4a6999}};return saveProfileToUserConfig(_0x4ed360,_0x1d67bc),console[_0x3dfaba(0xb9)](a32_0x2595c6[_0x3dfaba(0xe6)]('✓')+_0x3dfaba(0xf4)+_0x4ed360+_0x3dfaba(0xa9)),console[_0x3dfaba(0xb9)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x3dfaba(0xb9)](_0x3dfaba(0xd6)+_0x4ed360+_0x3dfaba(0xd5)),console['log'](_0x3dfaba(0xd6)+_0x4ed360+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x9f867e){if(_0x9f867e instanceof HTTPClientError&&_0x9f867e[_0x3dfaba(0xae)]===0x191)return printAuthError(_0x9f867e),0x1;return console[_0x3dfaba(0xd7)](a32_0x2595c6[_0x3dfaba(0xb8)](_0x3dfaba(0xb5)+(_0x9f867e instanceof Error?_0x9f867e[_0x3dfaba(0xd3)]:String(_0x9f867e)))),console['error'](_0x3dfaba(0xb0)),0x1;}}}function a32_0x3479(_0x2d3845,_0x24791c){_0x2d3845=_0x2d3845-0x95;const _0x3cbe32=a32_0x3cbe();let _0x347948=_0x3cbe32[_0x2d3845];return _0x347948;}export class ProfileRemoveCommand extends BaseCommand{[a32_0x3ad395(0xe7)]='profile:remove';[a32_0x3ad395(0xe2)]=a32_0x3ad395(0x98);[a32_0x3ad395(0xfc)](_0x3db3bf){const _0x4f03af=a32_0x3ad395,{args:_0x63f48e}=_0x3db3bf;if(_0x63f48e[_0x4f03af(0xbf)]===0x0)return _0x4f03af(0xdc);return undefined;}async[a32_0x3ad395(0xb2)](_0x3ceef5){const _0x4e1cfc=a32_0x3ad395,{args:_0x4b6624}=_0x3ceef5,_0x1ab4af=_0x4b6624[0x0];console[_0x4e1cfc(0xb9)](a32_0x2595c6[_0x4e1cfc(0xd4)]('tdx:\x20profile\x20remove'));if(!profileExists(_0x1ab4af)){console['error'](a32_0x2595c6[_0x4e1cfc(0xb8)](_0x4e1cfc(0xd8)+_0x1ab4af+_0x4e1cfc(0xa1))),console['log'](_0x4e1cfc(0xa4));const _0x26d626=listProfiles();if(_0x26d626[_0x4e1cfc(0xbf)]===0x0)console['log'](_0x4e1cfc(0x9c));else for(const _0xac109c of _0x26d626){console[_0x4e1cfc(0xb9)](_0x4e1cfc(0xab)+_0xac109c[_0x4e1cfc(0xe7)]);}return 0x1;}const _0x509c0e=await a32_0x2a8710({'type':'confirm','name':_0x4e1cfc(0xe3),'message':_0x4e1cfc(0xed)+_0x1ab4af+'\x27?','initial':![]});if(!_0x509c0e[_0x4e1cfc(0xe3)])return console[_0x4e1cfc(0xb9)](_0x4e1cfc(0xf2)),0x0;try{removeProfileFromUserConfig(_0x1ab4af),console[_0x4e1cfc(0xb9)](a32_0x2595c6[_0x4e1cfc(0xe6)]('✓')+_0x4e1cfc(0xf4)+_0x1ab4af+'\x27\x20removed\x20from\x20configuration');}catch(_0x2268b8){return console['error'](a32_0x2595c6[_0x4e1cfc(0xb8)](_0x4e1cfc(0xce)+(_0x2268b8 instanceof Error?_0x2268b8[_0x4e1cfc(0xd3)]:String(_0x2268b8)))),0x1;}const _0x36c410=await isKeychainAvailable();if(_0x36c410){const _0x4b8b89=await deleteKeychainAPIKey(_0x1ab4af);_0x4b8b89&&console[_0x4e1cfc(0xb9)](a32_0x2595c6['green']('✓')+_0x4e1cfc(0xf7));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{['name']='profile:set';[a32_0x3ad395(0xe2)]=a32_0x3ad395(0xaf);static [a32_0x3ad395(0xaa)]=[a32_0x3ad395(0xba),a32_0x3ad395(0xa0),'parent_segment',a32_0x3ad395(0x95),'llm_agent',a32_0x3ad395(0xe2)];[a32_0x3ad395(0xfc)](_0x2f542e){const _0x130afe=a32_0x3ad395,{args:_0x1d480f,options:_0x221ce8}=_0x2f542e,_0x226d4e=_0x221ce8[_0x130afe(0xe1)]||getActiveProfile();if(!_0x226d4e)return _0x130afe(0xca);if(_0x1d480f[_0x130afe(0xbf)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x130afe(0xaa)][_0x130afe(0x99)](',\x20');const _0x5a7825=_0x1d480f[0x0];if(!_0x5a7825[_0x130afe(0xea)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x130afe(0xaa)][_0x130afe(0x99)](',\x20');const [_0x194de4]=_0x5a7825[_0x130afe(0xc7)]('=',0x2);if(!ProfileSetCommand[_0x130afe(0xaa)]['includes'](_0x194de4))return _0x130afe(0xf6)+_0x194de4+'\x27.\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x130afe(0xaa)]['join'](',\x20');return undefined;}async['execute'](_0x1d8692){const _0x135148=a32_0x3ad395,{args:_0x2f6ac2,options:_0x2e9a0f}=_0x1d8692,_0x6e53ac=_0x2e9a0f[_0x135148(0xe1)]||getActiveProfile(),[_0x522e5e,..._0x2bb91f]=_0x2f6ac2[0x0][_0x135148(0xc7)]('='),_0x46cc51=_0x2bb91f[_0x135148(0x99)]('=');console[_0x135148(0xb9)](a32_0x2595c6[_0x135148(0xd4)](_0x135148(0xc1)));if(!profileExists(_0x6e53ac)){const _0x5481cc=await a32_0x2a8710({'type':'confirm','name':'create','message':_0x135148(0xd8)+_0x6e53ac+_0x135148(0x9b),'initial':!![]});if(!_0x5481cc[_0x135148(0xc0)])return console[_0x135148(0xb9)](_0x135148(0xb7)),0x1;}const _0x495291=loadProfile(_0x6e53ac),_0x57f86d=_0x495291?.[_0x135148(0xb6)]||{};if(_0x522e5e===_0x135148(0xba)){const _0x4c5c70=resolveSite(_0x46cc51);console[_0x135148(0xb9)](_0x135148(0xbb)+_0x4c5c70+_0x135148(0x96)),console['log'](_0x135148(0xcb)),console[_0x135148(0xb9)]('\x20\x20'+getConsoleUrl(_0x4c5c70,'/app/mp/ak'));const _0xed5d04=await a32_0x2a8710({'type':'password','name':_0x135148(0xd2),'message':_0x135148(0xdd),'validate':_0x2d9075=>{const _0x27f1ff=_0x135148;if(!_0x2d9075||!_0x2d9075[_0x27f1ff(0xa5)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0xed5d04[_0x135148(0xd2)])return console[_0x135148(0xb9)](_0x135148(0x102)),0x1;console[_0x135148(0xb9)](_0x135148(0xcf));try{const _0x2f6e30=TDX['create']({'site':_0x4c5c70,'apiKey':_0xed5d04[_0x135148(0xd2)][_0x135148(0xa5)](),'logLevel':_0x2e9a0f[_0x135148(0x9d)]??LogLevel[_0x135148(0x9f)]}),_0x5415d4=await _0x2f6e30[_0x135148(0xa6)][_0x135148(0xef)]();console[_0x135148(0xb9)](a32_0x2595c6['green']('✓')+_0x135148(0xe0)+_0x5415d4[_0x135148(0xfb)]+')');const _0x4df652=await isKeychainAvailable();_0x4df652?(await saveAPIKeyAsync(_0xed5d04['apiKey'][_0x135148(0xa5)](),_0x4c5c70,_0x6e53ac),console['log'](a32_0x2595c6[_0x135148(0xe6)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console[_0x135148(0xcd)](a32_0x2595c6[_0x135148(0x100)](_0x135148(0xbd))),_0x57f86d[_0x135148(0xba)]=_0x4c5c70;}catch(_0x66ec58){if(_0x66ec58 instanceof HTTPClientError&&_0x66ec58[_0x135148(0xae)]===0x191)return printAuthError(_0x66ec58),0x1;return console[_0x135148(0xd7)](a32_0x2595c6[_0x135148(0xb8)]('✗\x20Validation\x20failed:\x20'+(_0x66ec58 instanceof Error?_0x66ec58[_0x135148(0xd3)]:String(_0x66ec58)))),console[_0x135148(0xd7)](_0x135148(0x97)),0x1;}}else _0x57f86d[_0x522e5e]=_0x46cc51||undefined;return saveProfileToUserConfig(_0x6e53ac,_0x57f86d),console[_0x135148(0xb9)](a32_0x2595c6['green']('✓')+_0x135148(0xf4)+_0x6e53ac+_0x135148(0xc5)+_0x522e5e+'='+(_0x46cc51||_0x135148(0xf0))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a32_0x3ad395(0xe7)]='profile:use';[a32_0x3ad395(0xe2)]=a32_0x3ad395(0xb1);[a32_0x3ad395(0xfc)](_0x144fa9){const _0x496e96=a32_0x3ad395,{args:_0x303292}=_0x144fa9;if(_0x303292[_0x496e96(0xbf)]===0x0)return _0x496e96(0xe8);return undefined;}async[a32_0x3ad395(0xb2)](_0x4ab9a7){const _0x4e69ae=a32_0x3ad395,{args:_0x1a3afa,options:_0x2227b8}=_0x4ab9a7,_0x5f069a=_0x1a3afa[0x0],_0x1b96d8=_0x2227b8[_0x4e69ae(0xeb)];cleanExpiredSessions();if(!profileExists(_0x5f069a)){console['error'](a32_0x2595c6[_0x4e69ae(0xb8)](_0x4e69ae(0xd8)+_0x5f069a+_0x4e69ae(0xa1))),console[_0x4e69ae(0xb9)](_0x4e69ae(0xa4));const _0xa19184=listProfiles();if(_0xa19184[_0x4e69ae(0xbf)]===0x0)console[_0x4e69ae(0xb9)](_0x4e69ae(0x9c));else for(const _0x31a743 of _0xa19184){console['log'](_0x4e69ae(0xab)+_0x31a743[_0x4e69ae(0xe7)]);}return 0x1;}if(_0x1b96d8){const _0x65ee9a=a32_0x1c84a['join'](getConfigDir(),_0x4e69ae(0xd1));return saveActiveProfileToUserConfig(_0x5f069a),console[_0x4e69ae(0xb9)](_0x4e69ae(0xfd)+a32_0x2595c6[_0x4e69ae(0xe6)](_0x5f069a)),console[_0x4e69ae(0xb9)](a32_0x2595c6[_0x4e69ae(0xbe)](_0x4e69ae(0xec)+_0x65ee9a)),0x0;}const _0xbf271=getSessionID(_0x2227b8[_0x4e69ae(0xbc)]);return saveSessionContext({'profile':_0x5f069a},_0x2227b8[_0x4e69ae(0xbc)]),console[_0x4e69ae(0xb9)](_0x4e69ae(0xb4)+a32_0x2595c6[_0x4e69ae(0xe6)](_0x5f069a)+'\x20'+a32_0x2595c6[_0x4e69ae(0xbe)](_0x4e69ae(0x101)+_0xbf271+')')),console[_0x4e69ae(0xb9)](a32_0x2595c6[_0x4e69ae(0xbe)](_0x4e69ae(0xe4)+_0x5f069a+_0x4e69ae(0xf5))),0x0;}}function a32_0x3cbe(){const _0xfa0f52=['split','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','804RxbfQn','warn','Failed\x20to\x20remove\x20profile:\x20','Validating\x20API\x20key...','89ziKpfq','tdx.json','apiKey','message','bold','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx\x20--profile\x20','error','Profile\x20\x27','87fQDYbF','oauth','249964oLNsIK','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','us01','method','\x20API\x20key\x20is\x20valid\x20(User:\x20','profile','description','confirm','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','10wIJPSo','green','name','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','2182755qECOAT','includes','default','\x0aSaved\x20to:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','Create\x20a\x20new\x20profile','getUserInfo','(cleared)','Enter\x20profile\x20name:','Removal\x20cancelled','profileName','\x20Profile\x20\x27','\x20--default\x27\x20to\x20save\x20permanently','Unknown\x20key\x20\x27','\x20API\x20key\x20removed\x20from\x20system\x20keychain','API\x20Key','1562974SxrKOB','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','email','validate','Default\x20profile\x20set\x20to:\x20','select','2832dLuqLe','yellow','(session:\x20','\x0aOperation\x20cancelled','llm_project','\x27\x20requires\x20API\x20key\x20validation.','Site\x20was\x20not\x20changed.','Remove\x20a\x20profile','join','13959CDwZlS','\x27\x20does\x20not\x20exist.\x20Create\x20it?','\x20\x20(no\x20profiles\x20found)','logLevel','Enter\x20your\x20TD\x20API\x20key:','ERROR','database','\x27\x20does\x20not\x20exist.','API\x20key\x20cannot\x20be\x20empty','52196hDYYxd','\x0aAvailable\x20profiles:','trim','jobs','\x0aSetup\x20cancelled','5718361RyfMNj','\x27\x20created','VALID_KEYS','\x20\x20-\x20','12toydjw','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','status','Set\x20a\x20profile\x20configuration\x20value','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Set\x20session\x20profile','execute','/app/mp/ak','Session\x20profile\x20set\x20to:\x20','✗\x20Validation\x20failed:\x20','config','Operation\x20cancelled','red','log','site','Changing\x20site\x20to\x20\x27','session','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','dim','length','create','tdx:\x20profile\x20set','You\x20can\x20find\x20your\x20API\x20key\x20at:','text','Setup\x20cancelled','\x27\x20updated:\x20','3614WMHiZG'];a32_0x3cbe=function(){return _0xfa0f52;};return a32_0x3cbe();}
|
|
1
|
+
const a32_0x3a5b04=a32_0x1136;(function(_0x48ac81,_0xa3ebbe){const _0x154c64=a32_0x1136,_0x421efb=_0x48ac81();while(!![]){try{const _0x4079e6=parseInt(_0x154c64(0x105))/0x1+-parseInt(_0x154c64(0x137))/0x2*(-parseInt(_0x154c64(0xe6))/0x3)+-parseInt(_0x154c64(0x115))/0x4+-parseInt(_0x154c64(0xfc))/0x5*(parseInt(_0x154c64(0x144))/0x6)+-parseInt(_0x154c64(0x130))/0x7*(parseInt(_0x154c64(0x11c))/0x8)+-parseInt(_0x154c64(0x145))/0x9+-parseInt(_0x154c64(0xea))/0xa*(-parseInt(_0x154c64(0x11f))/0xb);if(_0x4079e6===_0xa3ebbe)break;else _0x421efb['push'](_0x421efb['shift']());}catch(_0x4d9dcb){_0x421efb['push'](_0x421efb['shift']());}}}(a32_0x3951,0xc099c));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a32_0x2e86ee from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';function a32_0x3951(){const _0x5a665b=['\x20--default\x27\x20to\x20save\x20permanently','tdx:\x20profile\x20set','(cleared)','validate','profile:set','Operation\x20cancelled','5982rfqrac','13030074OLfwtQ','\x20API\x20key\x20is\x20valid\x20(User:\x20','select','logLevel','warn','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','trim','create','Default\x20profile\x20set\x20to:\x20','VALID_KEYS','ERROR','4107351EnLIec','Failed\x20to\x20remove\x20profile:\x20','profile:use','\x20\x20-\x20','16997030uJiprj','Enter\x20description\x20(optional):','profileName','us01','description','email','profile:create','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','text','database','\x20API\x20key\x20removed\x20from\x20system\x20keychain','✗\x20Validation\x20failed:\x20','API\x20Key','Set\x20a\x20profile\x20configuration\x20value','status','Validating\x20API\x20key...','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','yellow','35vZJYwI','bold','tdx:\x20profile\x20create','\x0aOperation\x20cancelled','message','split','error','Site\x20was\x20not\x20changed.','includes','284080JzgZYU','config','password','method','Profile\x20\x27','default','log','green','/app/mp/ak','length','name','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','site','dim','tdx.json','\x20\x20tdx\x20--profile\x20','6039652odLAgR','Removal\x20cancelled','\x27\x20updated:\x20','execute','Setup\x20cancelled','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x20Profile\x20\x27','8ydGeJa','Session\x20profile\x20set\x20to:\x20','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','22kbWrpx','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x27\x20does\x20not\x20exist.','llm_project','join','\x27\x20does\x20not\x20exist.\x20Create\x20it?','confirm','session','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','Remove\x20a\x20profile','\x0aSetup\x20cancelled','API\x20key\x20cannot\x20be\x20empty','jobs','profile:remove','Profile\x20name\x20cannot\x20be\x20empty','\x27.\x0a\x0aValid\x20keys:\x20','tdx:\x20profile\x20remove','9093231AuWGGq','profile','Create\x20a\x20new\x20profile','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','apiKey','\x0aAvailable\x20profiles:','2lfgLXJ','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','red','getUserInfo','Set\x20session\x20profile','\x20\x20(no\x20profiles\x20found)','oauth'];a32_0x3951=function(){return _0x5a665b;};return a32_0x3951();}import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a32_0x1136(_0x5657cb,_0x7ec4fd){_0x5657cb=_0x5657cb-0xde;const _0x39514d=a32_0x3951();let _0x11366c=_0x39514d[_0x5657cb];return _0x11366c;}import{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a32_0x2a86f2 from'prompts';import a32_0x42377d from'chalk';function validateProfileName(_0x5c3c47){const _0xa65023=a32_0x1136;if(!_0x5c3c47||!_0x5c3c47[_0xa65023(0xe1)]())return _0xa65023(0x12d);const _0x3e58da=_0x5c3c47[_0xa65023(0xe1)]();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x3e58da))return _0xa65023(0xe0);if(profileExists(_0x3e58da))return _0xa65023(0x109)+_0x3e58da+_0xa65023(0xde);return!![];}export class ProfileCreateCommand extends BaseCommand{[a32_0x3a5b04(0x10f)]=a32_0x3a5b04(0xf0);['description']=a32_0x3a5b04(0x132);async[a32_0x3a5b04(0x118)](_0x3306f0){const _0x118929=a32_0x3a5b04,{options:_0x206572,args:_0x4074cb}=_0x3306f0;console[_0x118929(0x10b)](a32_0x42377d[_0x118929(0xfd)](_0x118929(0xfe)));let _0x5464ea;if(_0x4074cb[_0x118929(0x10e)]>0x0&&_0x4074cb[0x0]){const _0x5bd895=_0x4074cb[0x0]['trim'](),_0x17ddbf=validateProfileName(_0x5bd895);if(_0x17ddbf!==!![])return console[_0x118929(0x102)](a32_0x42377d[_0x118929(0x139)](_0x17ddbf)),0x1;_0x5464ea=_0x5bd895;}else{const _0x599394=await a32_0x2a86f2({'type':_0x118929(0xf2),'name':_0x118929(0xec),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x599394[_0x118929(0xec)])return console['log'](_0x118929(0x129)),0x1;_0x5464ea=_0x599394[_0x118929(0xec)][_0x118929(0xe1)]();}const _0x35324f=await a32_0x2a86f2({'type':_0x118929(0xf2),'name':_0x118929(0xee),'message':_0x118929(0xeb)}),_0x50d145=_0x35324f['description']?.['trim']()||undefined,_0x34f548=_0x206572[_0x118929(0x111)]||_0x118929(0xed),_0x323397=await promptSiteSelection(_0x34f548,_0x5464ea,_0x118929(0x119));if(!_0x323397)return 0x1;const _0x42901e=resolveSite(_0x323397);if(isOAuthSupported(_0x42901e)){const _0x3cfb27=await a32_0x2a86f2({'type':_0x118929(0x147),'name':_0x118929(0x108),'message':'Choose\x20authentication\x20method:','choices':[{'title':'OAuth\x20(browser\x20login)','value':'oauth'},{'title':_0x118929(0xf6),'value':'apikey'}]});if(!_0x3cfb27['method'])return console['log']('\x0aSetup\x20cancelled'),0x1;if(_0x3cfb27[_0x118929(0x108)]===_0x118929(0x13d)){if(_0x50d145){const _0x19bb38={'site':_0x42901e,'description':_0x50d145};saveProfileToUserConfig(_0x5464ea,_0x19bb38);}return await runOAuthLoginFlow(_0x42901e,_0x5464ea,_0x206572[_0x118929(0x148)]??LogLevel[_0x118929(0xe5)]),0x0;}}console['log'](_0x118929(0x138)+_0x42901e),console[_0x118929(0x10b)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x118929(0x10b)]('\x20\x20'+getConsoleUrl(_0x42901e,_0x118929(0x10d)));const _0x2e5f6d=await a32_0x2a86f2({'type':_0x118929(0x107),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x373aec=>{const _0x5446c7=_0x118929;if(!_0x373aec||!_0x373aec[_0x5446c7(0xe1)]())return _0x5446c7(0x12a);return!![];}});if(!_0x2e5f6d[_0x118929(0x135)])return console[_0x118929(0x10b)](_0x118929(0x129)),0x1;const _0x306df2=_0x2e5f6d[_0x118929(0x135)];console['log'](_0x118929(0xf9));try{const _0x5e4c36=TDX['create']({'site':_0x42901e,'apiKey':_0x306df2[_0x118929(0xe1)](),'logLevel':_0x206572[_0x118929(0x148)]??LogLevel[_0x118929(0xe5)]}),_0x5dad21=await _0x5e4c36[_0x118929(0x12b)]['getUserInfo']();console[_0x118929(0x10b)](a32_0x42377d[_0x118929(0x10c)]('✓')+_0x118929(0x146)+_0x5dad21['email']+')');const _0x4baea9=await isKeychainAvailable();_0x4baea9?(await saveAPIKeyAsync(_0x306df2[_0x118929(0xe1)](),_0x42901e,_0x5464ea),console['log'](a32_0x42377d['green']('✓')+_0x118929(0xf1)+_0x5464ea+')')):(console['warn'](a32_0x42377d['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a32_0x42377d[_0x118929(0xfb)](_0x118929(0x134))));const _0x3a2f13={'site':_0x42901e,..._0x50d145&&{'description':_0x50d145}};return saveProfileToUserConfig(_0x5464ea,_0x3a2f13),console[_0x118929(0x10b)](a32_0x42377d[_0x118929(0x10c)]('✓')+_0x118929(0x11b)+_0x5464ea+'\x27\x20created'),console[_0x118929(0x10b)](),console[_0x118929(0x10b)](_0x118929(0x11e)),console[_0x118929(0x10b)](_0x118929(0x114)+_0x5464ea+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x118929(0x10b)](_0x118929(0x114)+_0x5464ea+_0x118929(0xfa)),0x0;}catch(_0x3f2c78){if(_0x3f2c78 instanceof HTTPClientError&&_0x3f2c78[_0x118929(0xf8)]===0x191)return printAuthError(_0x3f2c78),0x1;return console[_0x118929(0x102)](a32_0x42377d[_0x118929(0x139)](_0x118929(0xf5)+(_0x3f2c78 instanceof Error?_0x3f2c78[_0x118929(0x100)]:String(_0x3f2c78)))),console[_0x118929(0x102)](_0x118929(0xdf)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a32_0x3a5b04(0x10f)]=a32_0x3a5b04(0x12c);['description']=a32_0x3a5b04(0x128);['validate'](_0x1fccfb){const _0xf6e202=a32_0x3a5b04,{args:_0x138ade}=_0x1fccfb;if(_0x138ade[_0xf6e202(0x10e)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>';return undefined;}async['execute'](_0x5d19ac){const _0xe87861=a32_0x3a5b04,{args:_0x4bd8d5}=_0x5d19ac,_0xa6ee8e=_0x4bd8d5[0x0];console[_0xe87861(0x10b)](a32_0x42377d[_0xe87861(0xfd)](_0xe87861(0x12f)));if(!profileExists(_0xa6ee8e)){console[_0xe87861(0x102)](a32_0x42377d[_0xe87861(0x139)](_0xe87861(0x109)+_0xa6ee8e+_0xe87861(0x121))),console[_0xe87861(0x10b)](_0xe87861(0x136));const _0x480996=listProfiles();if(_0x480996[_0xe87861(0x10e)]===0x0)console['log'](_0xe87861(0x13c));else for(const _0x5b6677 of _0x480996){console[_0xe87861(0x10b)](_0xe87861(0xe9)+_0x5b6677[_0xe87861(0x10f)]);}return 0x1;}const _0x1e1024=await a32_0x2a86f2({'type':_0xe87861(0x125),'name':_0xe87861(0x125),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0xa6ee8e+'\x27?','initial':![]});if(!_0x1e1024[_0xe87861(0x125)])return console['log'](_0xe87861(0x116)),0x0;try{removeProfileFromUserConfig(_0xa6ee8e),console[_0xe87861(0x10b)](a32_0x42377d[_0xe87861(0x10c)]('✓')+'\x20Profile\x20\x27'+_0xa6ee8e+'\x27\x20removed\x20from\x20configuration');}catch(_0x48fe8d){return console[_0xe87861(0x102)](a32_0x42377d[_0xe87861(0x139)](_0xe87861(0xe7)+(_0x48fe8d instanceof Error?_0x48fe8d[_0xe87861(0x100)]:String(_0x48fe8d)))),0x1;}const _0x58fbe0=await isKeychainAvailable();if(_0x58fbe0){const _0x1967bc=await deleteKeychainAPIKey(_0xa6ee8e);_0x1967bc&&console[_0xe87861(0x10b)](a32_0x42377d[_0xe87861(0x10c)]('✓')+_0xe87861(0xf4));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a32_0x3a5b04(0x10f)]=a32_0x3a5b04(0x142);[a32_0x3a5b04(0xee)]=a32_0x3a5b04(0xf7);static ['VALID_KEYS']=[a32_0x3a5b04(0x111),a32_0x3a5b04(0xf3),'parent_segment',a32_0x3a5b04(0x122),'llm_agent','description'];[a32_0x3a5b04(0x141)](_0x17d0d7){const _0x40a8ea=a32_0x3a5b04,{args:_0x3aae7f,options:_0x1eeb60}=_0x17d0d7,_0x289cfe=_0x1eeb60[_0x40a8ea(0x131)]||getActiveProfile();if(!_0x289cfe)return _0x40a8ea(0x127);if(_0x3aae7f['length']===0x0)return _0x40a8ea(0x11a)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');const _0x5975db=_0x3aae7f[0x0];if(!_0x5975db[_0x40a8ea(0x104)]('='))return _0x40a8ea(0x120)+ProfileSetCommand[_0x40a8ea(0xe4)][_0x40a8ea(0x123)](',\x20');const [_0x5a88c8]=_0x5975db[_0x40a8ea(0x101)]('=',0x2);if(!ProfileSetCommand[_0x40a8ea(0xe4)]['includes'](_0x5a88c8))return'Unknown\x20key\x20\x27'+_0x5a88c8+_0x40a8ea(0x12e)+ProfileSetCommand[_0x40a8ea(0xe4)]['join'](',\x20');return undefined;}async['execute'](_0x2a1e42){const _0x3f5948=a32_0x3a5b04,{args:_0x3e9bc8,options:_0x1257dc}=_0x2a1e42,_0x4489ea=_0x1257dc[_0x3f5948(0x131)]||getActiveProfile(),[_0x4166e6,..._0x6191f9]=_0x3e9bc8[0x0][_0x3f5948(0x101)]('='),_0x30b3d2=_0x6191f9[_0x3f5948(0x123)]('=');console[_0x3f5948(0x10b)](a32_0x42377d[_0x3f5948(0xfd)](_0x3f5948(0x13f)));if(!profileExists(_0x4489ea)){const _0xded1f5=await a32_0x2a86f2({'type':_0x3f5948(0x125),'name':'create','message':_0x3f5948(0x109)+_0x4489ea+_0x3f5948(0x124),'initial':!![]});if(!_0xded1f5['create'])return console['log'](_0x3f5948(0x143)),0x1;}const _0xbad227=loadProfile(_0x4489ea),_0x45791e=_0xbad227?.[_0x3f5948(0x106)]||{};if(_0x4166e6===_0x3f5948(0x111)){const _0x23d102=resolveSite(_0x30b3d2);console[_0x3f5948(0x10b)]('Changing\x20site\x20to\x20\x27'+_0x23d102+'\x27\x20requires\x20API\x20key\x20validation.'),console['log']('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x3f5948(0x10b)]('\x20\x20'+getConsoleUrl(_0x23d102,_0x3f5948(0x10d)));const _0x44816b=await a32_0x2a86f2({'type':'password','name':_0x3f5948(0x135),'message':_0x3f5948(0x133),'validate':_0x226658=>{const _0x19c839=_0x3f5948;if(!_0x226658||!_0x226658[_0x19c839(0xe1)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x44816b[_0x3f5948(0x135)])return console[_0x3f5948(0x10b)](_0x3f5948(0xff)),0x1;console[_0x3f5948(0x10b)]('Validating\x20API\x20key...');try{const _0x422db7=TDX[_0x3f5948(0xe2)]({'site':_0x23d102,'apiKey':_0x44816b[_0x3f5948(0x135)][_0x3f5948(0xe1)](),'logLevel':_0x1257dc[_0x3f5948(0x148)]??LogLevel[_0x3f5948(0xe5)]}),_0x5c0eb5=await _0x422db7[_0x3f5948(0x12b)][_0x3f5948(0x13a)]();console['log'](a32_0x42377d[_0x3f5948(0x10c)]('✓')+_0x3f5948(0x146)+_0x5c0eb5[_0x3f5948(0xef)]+')');const _0x12cf7e=await isKeychainAvailable();_0x12cf7e?(await saveAPIKeyAsync(_0x44816b[_0x3f5948(0x135)][_0x3f5948(0xe1)](),_0x23d102,_0x4489ea),console[_0x3f5948(0x10b)](a32_0x42377d[_0x3f5948(0x10c)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console[_0x3f5948(0x149)](a32_0x42377d[_0x3f5948(0xfb)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x45791e[_0x3f5948(0x111)]=_0x23d102;}catch(_0x5a5173){if(_0x5a5173 instanceof HTTPClientError&&_0x5a5173['status']===0x191)return printAuthError(_0x5a5173),0x1;return console[_0x3f5948(0x102)](a32_0x42377d['red'](_0x3f5948(0xf5)+(_0x5a5173 instanceof Error?_0x5a5173[_0x3f5948(0x100)]:String(_0x5a5173)))),console[_0x3f5948(0x102)](_0x3f5948(0x103)),0x1;}}else _0x45791e[_0x4166e6]=_0x30b3d2||undefined;return saveProfileToUserConfig(_0x4489ea,_0x45791e),console['log'](a32_0x42377d[_0x3f5948(0x10c)]('✓')+_0x3f5948(0x11b)+_0x4489ea+_0x3f5948(0x117)+_0x4166e6+'='+(_0x30b3d2||_0x3f5948(0x140))),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a32_0x3a5b04(0xe8);[a32_0x3a5b04(0xee)]=a32_0x3a5b04(0x13b);[a32_0x3a5b04(0x141)](_0x1b92ac){const _0x4ee5eb=a32_0x3a5b04,{args:_0x4f67ae}=_0x1b92ac;if(_0x4f67ae['length']===0x0)return _0x4ee5eb(0x110);return undefined;}async[a32_0x3a5b04(0x118)](_0x4ee757){const _0x28e8aa=a32_0x3a5b04,{args:_0xa4162b,options:_0x10e734}=_0x4ee757,_0x4531e7=_0xa4162b[0x0],_0x12b5fb=_0x10e734[_0x28e8aa(0x10a)];cleanExpiredSessions();if(!profileExists(_0x4531e7)){console['error'](a32_0x42377d[_0x28e8aa(0x139)](_0x28e8aa(0x109)+_0x4531e7+_0x28e8aa(0x121))),console[_0x28e8aa(0x10b)](_0x28e8aa(0x136));const _0x32077a=listProfiles();if(_0x32077a[_0x28e8aa(0x10e)]===0x0)console[_0x28e8aa(0x10b)](_0x28e8aa(0x13c));else for(const _0x5165a3 of _0x32077a){console[_0x28e8aa(0x10b)](_0x28e8aa(0xe9)+_0x5165a3[_0x28e8aa(0x10f)]);}return 0x1;}if(_0x12b5fb){const _0x291f15=a32_0x2e86ee[_0x28e8aa(0x123)](getConfigDir(),_0x28e8aa(0x113));return saveActiveProfileToUserConfig(_0x4531e7),console[_0x28e8aa(0x10b)](_0x28e8aa(0xe3)+a32_0x42377d['green'](_0x4531e7)),console[_0x28e8aa(0x10b)](a32_0x42377d[_0x28e8aa(0x112)]('\x0aSaved\x20to:\x20'+_0x291f15)),0x0;}const _0x3b7520=getSessionID(_0x10e734[_0x28e8aa(0x126)]);return saveSessionContext({'profile':_0x4531e7},_0x10e734['session']),console[_0x28e8aa(0x10b)](_0x28e8aa(0x11d)+a32_0x42377d[_0x28e8aa(0x10c)](_0x4531e7)+'\x20'+a32_0x42377d[_0x28e8aa(0x112)]('(session:\x20'+_0x3b7520+')')),console[_0x28e8aa(0x10b)](a32_0x42377d['dim']('\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20'+_0x4531e7+_0x28e8aa(0x13e))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x131949=a33_0x34f1;(function(_0x527cd2,_0x18c11c){const _0x103a49=a33_0x34f1,_0x3a71ed=_0x527cd2();while(!![]){try{const _0xbc5f14=parseInt(_0x103a49(0xd6))/0x1+parseInt(_0x103a49(0xca))/0x2*(-parseInt(_0x103a49(0xd2))/0x3)+-parseInt(_0x103a49(0xcc))/0x4*(parseInt(_0x103a49(0xd1))/0x5)+parseInt(_0x103a49(0xc8))/0x6+parseInt(_0x103a49(0xd3))/0x7+parseInt(_0x103a49(0xd5))/0x8+parseInt(_0x103a49(0xde))/0x9*(parseInt(_0x103a49(0xd7))/0xa);if(_0xbc5f14===_0x18c11c)break;else _0x3a71ed['push'](_0x3a71ed['shift']());}catch(_0x48fd25){_0x3a71ed['push'](_0x3a71ed['shift']());}}}(a33_0x1e7a,0x3c7d1));import{BaseCommand}from'./command.js';function a33_0x1e7a(){const _0x19ea7d=['dim','134258IzRHop','profiles','4IxCucr','length','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','execute','log','2319120tYlmgb','3NasqOF','1317477gndyPL','description','1146824JJxZGQ','68222LmYhnO','5590tVoGqy','name','message','map','config','site','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2502NrVdAY','error','green','1341156tpIvva'];a33_0x1e7a=function(){return _0x19ea7d;};return a33_0x1e7a();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import a33_0x4cf863 from'chalk';function a33_0x34f1(_0x39c170,_0x28eeb9){_0x39c170=_0x39c170-0xc8;const _0x1e7a73=a33_0x1e7a();let _0x34f131=_0x1e7a73[_0x39c170];return _0x34f131;}export class ProfilesCommand extends BaseCommand{[a33_0x131949(0xd8)]=a33_0x131949(0xcb);[a33_0x131949(0xd4)]='List\x20all\x20available\x20profiles';async[a33_0x131949(0xcf)](_0x5c5c26){const _0x4f55a7=a33_0x131949,{options:_0x5d1793}=_0x5c5c26;try{const _0x1197dd=listProfiles(),_0x222590=getActiveProfile();if(_0x1197dd[_0x4f55a7(0xcd)]===0x0)return console[_0x4f55a7(0xd0)](_0x4f55a7(0xce)),console[_0x4f55a7(0xd0)](_0x4f55a7(0xdd)),console['log']('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x2b6150=_0x1197dd[_0x4f55a7(0xda)](_0x419a7f=>{const _0x5e14bc=_0x4f55a7,_0x373060=_0x419a7f[_0x5e14bc(0xd8)]===_0x222590,_0x4044b9=getProfileParams(_0x419a7f['config']);return{'name':_0x419a7f[_0x5e14bc(0xd8)],'active':_0x373060,'scope':_0x419a7f['scope'],'description':_0x419a7f['config'][_0x5e14bc(0xd4)]||'','params':_0x4044b9};});if(isStructuredFormat(_0x5d1793))await handleSDKOutput(_0x2b6150,_0x5d1793);else for(const _0x251e30 of _0x1197dd){const _0x16638e=_0x251e30[_0x4f55a7(0xd8)]===_0x222590?a33_0x4cf863[_0x4f55a7(0xe0)]('\x20✓'):'',_0x35d1eb=_0x251e30[_0x4f55a7(0xdb)][_0x4f55a7(0xdc)]?a33_0x4cf863[_0x4f55a7(0xc9)]('\x20'+_0x251e30['config'][_0x4f55a7(0xdc)]):'',_0xa1c0a1=_0x251e30[_0x4f55a7(0xdb)]['description']?a33_0x4cf863[_0x4f55a7(0xc9)]('\x20\x20'+_0x251e30[_0x4f55a7(0xdb)]['description']):'';console[_0x4f55a7(0xd0)]('👤\x20'+_0x251e30[_0x4f55a7(0xd8)]+_0x16638e+_0x35d1eb+_0xa1c0a1);}return 0x0;}catch(_0xee61c1){return _0xee61c1 instanceof Error&&console[_0x4f55a7(0xdf)]('Error:\x20'+_0xee61c1[_0x4f55a7(0xd9)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0xbbf892=a34_0x5e45;(function(_0x49ce1b,_0x484359){const _0x498608=a34_0x5e45,_0x277535=_0x49ce1b();while(!![]){try{const _0x93c8ac=-parseInt(_0x498608(0x1d1))/0x1+parseInt(_0x498608(0x1e4))/0x2*(-parseInt(_0x498608(0x1cb))/0x3)+parseInt(_0x498608(0x1de))/0x4+parseInt(_0x498608(0x1d3))/0x5+-parseInt(_0x498608(0x1bf))/0x6*(parseInt(_0x498608(0x1bc))/0x7)+parseInt(_0x498608(0x1d0))/0x8+parseInt(_0x498608(0x1c8))/0x9;if(_0x93c8ac===_0x484359)break;else _0x277535['push'](_0x277535['shift']());}catch(_0x5ccbb5){_0x277535['push'](_0x277535['shift']());}}}(a34_0x3386,0xe99e4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';function a34_0x5e45(_0x1e0c7b,_0x48c103){_0x1e0c7b=_0x1e0c7b-0x1b7;const _0x33862a=a34_0x3386();let _0x5e456f=_0x33862a[_0x1e0c7b];return _0x5e456f;}import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';function a34_0x3386(){const _0x304ae7=['Executing\x20query\x20[','join','4156692Ilshed','stats','validate','elapsedTimeMillis','description','4078816OmLrAU','545013TWYoaU','SQL:\x20','4860560HzLoHR','options','\x0aAll\x20results\x20saved\x20to\x20','error','jobId','Schema:\x20','Catalog:\x20','Error:\x20','verbose','message','query','4613860hoCZbW','Site:\x20','length','Statement\x20','\x20splits','push','2yqZUAh','execute','Executing\x20query...','\x20rows\x20','processedRows','\x20-\x20','information_schema','Executing\x20statement\x20','database','data','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','7FzyoTo','site','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','9519372qUaSxy','setPhase','setJobId','originalMessage','output','completedSplits','Query\x20completed:\x20Processed\x20','No\x20SQL\x20provided','file','16547490TkKfjJ'];a34_0x3386=function(){return _0x304ae7;};return a34_0x3386();}import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{['name']='query';[a34_0xbbf892(0x1cf)]='Run\x20Trino\x20queries\x20(streaming)';async[a34_0xbbf892(0x1e5)](_0x261a5c){const _0x1bae73=a34_0xbbf892,{options:_0x3a3cfe,args:_0x1b29fa,tdx:_0x18fa97}=_0x261a5c,_0x19bf40={..._0x3a3cfe,'limitStructuredFormats':!![]},_0x55dc88=_0x1b29fa[0x0],_0x47adf7=_0x3a3cfe['file'];let _0x2e5983;try{if(_0x47adf7)_0x2e5983=readSqlStatementsFromFile(_0x47adf7);else{if(_0x55dc88==='-')_0x2e5983=await readSqlStatementsFromStdin();else{if(_0x55dc88&&isSqlFilePath(_0x55dc88))_0x2e5983=readSqlStatementsFromFile(_0x55dc88);else{if(_0x55dc88)_0x2e5983=splitSqlStatements(_0x55dc88);else throw new Error(_0x1bae73(0x1c6));}}}}catch(_0x5d1fde){return console[_0x1bae73(0x1d6)](_0x1bae73(0x1da)+_0x5d1fde['message']),0x1;}const _0x11108b=_0x3a3cfe[_0x1bae73(0x1b9)]||_0x1bae73(0x1b7),_0x51fab7=_0x3a3cfe['catalog'];try{const _0x147e2e=[],_0x139d0b=!!_0x3a3cfe[_0x1bae73(0x1c3)];for(let _0x243e60=0x0;_0x243e60<_0x2e5983[_0x1bae73(0x1e0)];_0x243e60++){const _0x57af05=_0x2e5983[_0x243e60],_0x4a8f48=_0x243e60+0x1,_0x47a6de=_0x2e5983[_0x1bae73(0x1e0)],_0x53b79d=_0x47a6de>0x1;_0x3a3cfe[_0x1bae73(0x1db)]&&(console[_0x1bae73(0x1d6)]('\x0a'+(_0x53b79d?_0x1bae73(0x1e1)+_0x4a8f48+'/'+_0x47a6de+':':'')),console['error'](_0x1bae73(0x1df)+_0x3a3cfe[_0x1bae73(0x1bd)]),console['error'](_0x1bae73(0x1d9)+(_0x51fab7||'td')),console[_0x1bae73(0x1d6)](_0x1bae73(0x1d8)+_0x11108b),console[_0x1bae73(0x1d6)](_0x1bae73(0x1d2)+_0x57af05));const _0xe1a400=_0x53b79d?_0x1bae73(0x1b8)+_0x4a8f48+'/'+_0x47a6de+'...':_0x1bae73(0x1e6);try{const _0x195206=await withProgressSpinner(_0xe1a400,async _0x1b9520=>{const _0x11e486=_0x1bae73,_0x464bdd=await _0x18fa97[_0x11e486(0x1dd)][_0x11e486(0x1e5)](_0x57af05,{'catalog':_0x51fab7,'schema':_0x11108b,'onJobId':_0xec2ab2=>{const _0x3ad9e8=_0x11e486;_0x1b9520[_0x3ad9e8(0x1c1)](_0xec2ab2);},'onProgress':_0x17769b=>{const _0x10c139=_0x11e486;_0x1b9520[_0x10c139(0x1c0)](_0x10c139(0x1c9)+_0x17769b['state']+']'),_0x1b9520['setExtra'](formatRows(_0x17769b[_0x10c139(0x1e8)])+'\x20rows\x20'+_0x17769b[_0x10c139(0x1c4)]+'/'+_0x17769b['totalSplits']+_0x10c139(0x1e2));}});return _0x464bdd;},{'verbose':_0x3a3cfe[_0x1bae73(0x1db)]}),_0x310538=_0x195206[_0x1bae73(0x1ba)],_0x2f763b=_0x310538[_0x1bae73(0x1d7)]?'\x20[Job\x20ID:\x20'+_0x310538[_0x1bae73(0x1d7)]+']':'',_0x476f8d=_0x53b79d?'Statement\x20'+_0x4a8f48+'/'+_0x47a6de+_0x1bae73(0x1e9):'';console['error']('✔\x20'+_0x476f8d+_0x1bae73(0x1c5)+formatRows(_0x310538[_0x1bae73(0x1cc)]['processedRows'])+_0x1bae73(0x1e7)+('in\x20'+formatElapsed(_0x310538[_0x1bae73(0x1cc)][_0x1bae73(0x1ce)])+_0x2f763b));if(_0x53b79d&&_0x139d0b){const _0x3751d8=resolveOutputOptions(_0x19bf40),_0x1e4696=await formatQueryOutput(_0x310538,_0x3751d8);_0x147e2e[_0x1bae73(0x1e3)](_0x1e4696);}else await handleQueryOutput(_0x310538,_0x19bf40);}catch(_0x279581){const _0x59252e=_0x53b79d?_0x1bae73(0x1e1)+_0x4a8f48+'/'+_0x47a6de+':\x0a':'',_0x271691=_0x279581 instanceof SDKError?_0x279581[_0x1bae73(0x1c2)]:_0x279581[_0x1bae73(0x1dc)];return console['error'](''+_0x59252e+_0x271691),0x1;}}if(_0x2e5983['length']>0x1&&_0x139d0b&&_0x147e2e[_0x1bae73(0x1e0)]>0x0){const _0x449970=_0x147e2e[_0x1bae73(0x1ca)]('\x0a');writeFileSync(_0x3a3cfe['output'],_0x449970),console[_0x1bae73(0x1d6)](_0x1bae73(0x1d5)+_0x3a3cfe[_0x1bae73(0x1c3)]);}return 0x0;}catch(_0x5d99b3){throw _0x5d99b3;}}[a34_0xbbf892(0x1cd)](_0x541f5d){const _0x58b6f5=a34_0xbbf892,_0x2db871=_0x541f5d['args'][0x0],_0x566d09=_0x541f5d[_0x58b6f5(0x1d4)][_0x58b6f5(0x1c7)];if(!_0x2db871&&!_0x566d09)return _0x58b6f5(0x1be);if(_0x2db871&&_0x566d09)return _0x58b6f5(0x1bb);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x42a9e2=a35_0x53ea;(function(_0x363a0f,_0x2f692d){const _0x587a29=a35_0x53ea,_0x585be2=_0x363a0f();while(!![]){try{const _0x222df8=parseInt(_0x587a29(0x1e2))/0x1*(parseInt(_0x587a29(0x18d))/0x2)+parseInt(_0x587a29(0x206))/0x3+-parseInt(_0x587a29(0x1bf))/0x4+-parseInt(_0x587a29(0x1f6))/0x5+parseInt(_0x587a29(0x1f2))/0x6*(-parseInt(_0x587a29(0x1cb))/0x7)+-parseInt(_0x587a29(0x1cc))/0x8+-parseInt(_0x587a29(0x1ec))/0x9*(-parseInt(_0x587a29(0x1be))/0xa);if(_0x222df8===_0x2f692d)break;else _0x585be2['push'](_0x585be2['shift']());}catch(_0x54e5e1){_0x585be2['push'](_0x585be2['shift']());}}}(a35_0x1a6e,0xd01f7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a35_0x1a6e(){const _0x4e1c73=['\x20matching\x20\x22','show','lastRun','last_job','\x22...','\x20(use\x20--limit\x20to\x20see\x20more)','success','delay','length','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','\x20execution','Searching\x20scheduled\x20queries\x20matching\x20\x22','schedule:history','never','error','user_name','schedule:run','join','Listing\x20scheduled\x20queries...','schedules','No\x20scheduled\x20queries\x20found','nextRun','pagination','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','count','schedule:update','created_at','listQueries','ended_at','queryUrl','padEnd','jobs','Update\x20a\x20scheduled\x20query','engineVersion','List\x20scheduled\x20queries','10OTcotn','2602312CdKxQu','status','keys','args','delete','data','time_zone','Running\x20schedule...','verbose','Schedule\x20updated:\x20','query','getTime','7MdvMuq','246504xrBflr','\x20\x20Num:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','log','Failed\x20to\x20read\x20file:\x20','retry_limit','entries','retryLimit','file','\x20job','repeat','\x20\x20Type:\x20','dim','(unnamed)','name','yes','Creating\x20schedule:\x20','h\x20ago','trino','Show\x20schedule\x20details','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Schedule\x20run\x20submitted:\x20','164899LPlQsQ','job_id','start_at','list','queries','Cancelled','from','substring','user','next_run_at','21041181aAwPFg','\x20scheduled\x20quer','m\x20ago','time','format','\x20\x20Cron:\x20','6448626tPObIr','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','result','timezone','1061540nHwPbD','Delete\x20a\x20scheduled\x20query','INVALID_ARGUMENT','cron','history','tsv','type','Updating\x20schedule...','site','round','d\x20ago','scheduled_at','Creating\x20schedule...','trim','schedule:list','create','954399InSPXv','Found\x20','updated_at','Updating\x20schedule:\x20','num','in\x20','abs','jsonl','\x20\x20Timezone:\x20','Run\x20a\x20scheduled\x20query\x20immediately','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','...','utf-8','table','/app/queries/editor?queryId=','map','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','\x20\x20Time:\x20','statusIcon','Schedule\x20deleted:\x20','schedule:show','executing_user_id','\x20created','database','cyan','validate','Getting\x20schedule\x20details...','2plcUMv','Create\x20a\x20scheduled\x20query','end_at','description','has_next_page','Showing\x20first\x20','priority','engine_version','📅\x20','just\x20now','execute','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','max','Deleting\x20schedule...'];a35_0x1a6e=function(){return _0x4e1c73;};return a35_0x1a6e();}import{hyperlink}from'../sdk/util/formatters.js';import a35_0x168a99 from'chalk';function a35_0x53ea(_0x6f2dd5,_0x3c2346){_0x6f2dd5=_0x6f2dd5-0x17a;const _0x1a6e5d=a35_0x1a6e();let _0x53ea56=_0x1a6e5d[_0x6f2dd5];return _0x53ea56;}function formatRelativeTime(_0x8b3818){const _0x3a6065=a35_0x53ea,_0x424b80=new Date(_0x8b3818),_0x5b5558=new Date(),_0x3c6fbf=_0x424b80['getTime']()-_0x5b5558[_0x3a6065(0x1ca)](),_0x61487f=Math[_0x3a6065(0x20c)](_0x3c6fbf)/0x3e8,_0x5909b3=_0x3c6fbf<0x0;if(_0x61487f<0x3c)return _0x5909b3?_0x3a6065(0x196):'soon';else{if(_0x61487f<0xe10){const _0x31645f=Math[_0x3a6065(0x1ff)](_0x61487f/0x3c);return _0x5909b3?_0x31645f+_0x3a6065(0x1ee):'in\x20'+_0x31645f+'m';}else{if(_0x61487f<0x15180){const _0x3ae283=Math[_0x3a6065(0x1ff)](_0x61487f/0xe10);return _0x5909b3?_0x3ae283+_0x3a6065(0x1dd):'in\x20'+_0x3ae283+'h';}else{if(_0x61487f<0x93a80){const _0x28483e=Math[_0x3a6065(0x1ff)](_0x61487f/0x15180);return _0x5909b3?_0x28483e+_0x3a6065(0x200):_0x3a6065(0x20b)+_0x28483e+'d';}else return _0x424b80['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x204);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1bd);async[a35_0x42a9e2(0x197)](_0x580191){const _0x219cb3=a35_0x42a9e2,{options:_0x371666,args:_0x3c600c,tdx:_0x34f2a2}=_0x580191,_0x389f51=resolveLimit(_0x371666['limit'],DEFAULT_DISPLAY_LIMIT),_0xa7e1d=_0x3c600c[0x0],_0x4a15c6=_0xa7e1d?_0x219cb3(0x1a6)+_0xa7e1d+_0x219cb3(0x19f):_0x219cb3(0x1ad),_0x1b2f31=await withSpinner(_0x4a15c6,()=>_0x34f2a2['schedules'][_0x219cb3(0x1b6)]({'limit':_0x389f51,'scheduled':!![],'pattern':_0xa7e1d}),{'verbose':_0x371666[_0x219cb3(0x1c7)]}),_0x2100c2=_0x1b2f31['data'][_0x219cb3(0x1e6)],_0x573b5a=_0x1b2f31['data'][_0x219cb3(0x1b1)][_0x219cb3(0x191)],_0x3f7d62=_0xa7e1d?_0x219cb3(0x19b)+_0xa7e1d+'\x22':'';_0x573b5a?console[_0x219cb3(0x1a9)](_0x219cb3(0x192)+_0x2100c2[_0x219cb3(0x1a3)]+'\x20schedules'+_0x3f7d62+_0x219cb3(0x1a0)):console['error']('Found\x20'+_0x2100c2[_0x219cb3(0x1a3)]+_0x219cb3(0x1ed)+(_0x2100c2['length']!==0x1?'ies':'y')+_0x3f7d62);if(_0x371666[_0x219cb3(0x1f0)]==='json'||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x20d)||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x17f)||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x1fb)){const _0x2abab0=_0x2100c2[_0x219cb3(0x181)](_0x30f1e6=>({'id':_0x30f1e6['id'],'name':_0x30f1e6['name'],'cron':_0x30f1e6[_0x219cb3(0x1f9)],'database':_0x30f1e6['database']?.[_0x219cb3(0x1da)],'type':_0x30f1e6[_0x219cb3(0x1fc)],'timezone':_0x30f1e6[_0x219cb3(0x1c5)],'user_name':_0x30f1e6[_0x219cb3(0x1ea)]?.[_0x219cb3(0x1da)],'updated_at':_0x30f1e6[_0x219cb3(0x208)],'next_run_at':_0x30f1e6[_0x219cb3(0x1eb)],'last_job_status':_0x30f1e6[_0x219cb3(0x19e)]?.['status']}));await handleSDKOutput(_0x2abab0,_0x371666);}else{if(_0x2100c2['length']===0x0)console[_0x219cb3(0x1cf)](_0x219cb3(0x1af));else{const _0x5a55ce=_0x371666[_0x219cb3(0x1fe)],_0x4c83f8=_0x2100c2[_0x219cb3(0x181)](_0x4353e9=>{const _0x772057=_0x219cb3,_0x71da2b=_0x4353e9['last_job']?.[_0x772057(0x1c0)]?_0x4353e9[_0x772057(0x19e)][_0x772057(0x1c0)]==='success'?'✓':'✗':'-',_0x109983=_0x4353e9['last_job']?.[_0x772057(0x1b7)]?formatRelativeTime(_0x4353e9['last_job']['ended_at']):_0x772057(0x1a8),_0x1c79db=_0x4353e9[_0x772057(0x1eb)]?formatRelativeTime(_0x4353e9[_0x772057(0x1eb)]):'-',_0x2b28c3=_0x4353e9[_0x772057(0x1f9)]||'',_0x2c3a0d=_0x4353e9[_0x772057(0x1da)]||_0x772057(0x1d9),_0x360231=getConsoleUrl(_0x5a55ce,_0x772057(0x180)+_0x4353e9['id']);return{'statusIcon':_0x71da2b,'lastRun':_0x109983,'nextRun':_0x1c79db,'cron':_0x2b28c3,'name':_0x2c3a0d,'queryUrl':_0x360231,'status':_0x4353e9['last_job']?.[_0x772057(0x1c0)]};}),_0x35b07b=Math[_0x219cb3(0x199)](..._0x4c83f8[_0x219cb3(0x181)](_0x37c5a2=>_0x37c5a2[_0x219cb3(0x19d)][_0x219cb3(0x1a3)])),_0x11960e=Math['max'](..._0x4c83f8['map'](_0x52e05f=>_0x52e05f[_0x219cb3(0x1b0)][_0x219cb3(0x1a3)])),_0x5d4c25=Math[_0x219cb3(0x199)](..._0x4c83f8[_0x219cb3(0x181)](_0x3a5b68=>_0x3a5b68[_0x219cb3(0x1f9)][_0x219cb3(0x1a3)])),_0x43d585=_0x4c83f8[_0x219cb3(0x181)](_0x5afe15=>{const _0xa9f241=_0x219cb3,_0x5c876e=_0x5afe15['status']===_0xa9f241(0x1a1)?a35_0x168a99['green'](_0x5afe15['statusIcon']):_0x5afe15['status']===_0xa9f241(0x1a9)?a35_0x168a99['red'](_0x5afe15[_0xa9f241(0x184)]):a35_0x168a99[_0xa9f241(0x1d8)](_0x5afe15[_0xa9f241(0x184)]),_0x36ff1d=_0x5afe15[_0xa9f241(0x19d)][_0xa9f241(0x1b9)](_0x35b07b),_0x2f300b=_0x5afe15[_0xa9f241(0x1b0)][_0xa9f241(0x1b9)](_0x11960e),_0x333ad6=_0x5afe15[_0xa9f241(0x1f9)]?a35_0x168a99[_0xa9f241(0x18a)](_0x5afe15[_0xa9f241(0x1f9)][_0xa9f241(0x1b9)](_0x5d4c25)):'\x20'[_0xa9f241(0x1d6)](_0x5d4c25),_0x4821a7=hyperlink(_0x5afe15[_0xa9f241(0x1da)],_0x5afe15[_0xa9f241(0x1b8)]);return _0xa9f241(0x195)+_0x5c876e+'\x20'+_0x36ff1d+'\x20\x20→\x20'+_0x2f300b+'\x20\x20'+_0x333ad6+'\x20\x20'+_0x4821a7;});await writeOutput(_0x43d585[_0x219cb3(0x1ac)]('\x0a'),_0x371666['output'],_0x219cb3(0x1e5));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x186);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1df);[a35_0x42a9e2(0x18b)](_0x51cf73){const _0x584023=a35_0x42a9e2,_0x1978fb=_0x51cf73[_0x584023(0x1c2)][0x0];if(!_0x1978fb)return _0x584023(0x1b2);return undefined;}async[a35_0x42a9e2(0x197)](_0x24ba04){const _0x3f2d57=a35_0x42a9e2,{options:_0x5ab8fb,args:_0xfbe77e,tdx:_0x28e1f6}=_0x24ba04,_0x1bef0d=_0xfbe77e[0x0],_0x58e008=await withSpinner(_0x3f2d57(0x18c),()=>_0x28e1f6[_0x3f2d57(0x1ae)][_0x3f2d57(0x19c)](_0x1bef0d),{'verbose':_0x5ab8fb[_0x3f2d57(0x1c7)]}),_0x2f63d2=_0x58e008[_0x3f2d57(0x1c4)],_0x2f735e={'name':_0x2f63d2[_0x3f2d57(0x1da)],'cron':_0x2f63d2['cron'],'database':_0x2f63d2[_0x3f2d57(0x189)],'type':_0x2f63d2[_0x3f2d57(0x1fc)],'timezone':_0x2f63d2[_0x3f2d57(0x1f5)],'user_name':_0x2f63d2[_0x3f2d57(0x1aa)],'created_at':_0x2f63d2[_0x3f2d57(0x1b5)],'engine_version':_0x2f63d2[_0x3f2d57(0x194)],'executing_user_id':_0x2f63d2[_0x3f2d57(0x187)],'query':_0x2f63d2[_0x3f2d57(0x1c9)],'delay':_0x2f63d2[_0x3f2d57(0x1a2)],'priority':_0x2f63d2[_0x3f2d57(0x193)],'retry_limit':_0x2f63d2[_0x3f2d57(0x1d1)],..._0x2f63d2[_0x3f2d57(0x1f4)]&&{'result':_0x2f63d2['result']}};return await handleSingleObjectOutput(_0x2f735e,_0x5ab8fb),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]='schedule:create';[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x18e);[a35_0x42a9e2(0x18b)](_0x153d1f){const _0x39127c=a35_0x42a9e2,_0x10e4bb=_0x153d1f[_0x39127c(0x1c2)][0x0];if(!_0x10e4bb)return _0x39127c(0x182);const _0x1d99b2=_0x153d1f['options'];if(!_0x1d99b2[_0x39127c(0x189)])return _0x39127c(0x1e0);return undefined;}async[a35_0x42a9e2(0x197)](_0x55b6f5){const _0x31c463=a35_0x42a9e2,{options:_0x393296,args:_0x44b3b3,tdx:_0x206d4f}=_0x55b6f5,_0xc521b9=_0x44b3b3[0x0],_0x43dcb6=_0x393296,_0x58873d=_0x43dcb6['database'],_0xc596a7=_0x43dcb6[_0x31c463(0x1d4)],_0x2c56cd=_0x43dcb6['type']||_0x31c463(0x1de);let _0x174d57;try{_0x174d57=readFileSync(_0xc596a7,_0x31c463(0x17e))[_0x31c463(0x203)]();}catch(_0x77ff2d){throw new SDKError(ErrorCode[_0x31c463(0x1f8)],_0x31c463(0x1d0)+_0xc596a7,_0x77ff2d instanceof Error?_0x77ff2d:undefined);}if(!_0x174d57)throw new SDKError(ErrorCode[_0x31c463(0x1f8)],'Query\x20file\x20is\x20empty');const _0x4cb0ef={'database':_0x58873d,'query':_0x174d57,'type':_0x2c56cd};if(_0x43dcb6['cron'])_0x4cb0ef[_0x31c463(0x1f9)]=_0x43dcb6['cron'];if(_0x43dcb6[_0x31c463(0x1f5)])_0x4cb0ef[_0x31c463(0x1f5)]=_0x43dcb6[_0x31c463(0x1f5)];if(_0x43dcb6[_0x31c463(0x1a2)]!==undefined)_0x4cb0ef[_0x31c463(0x1a2)]=Number(_0x43dcb6[_0x31c463(0x1a2)]);if(_0x43dcb6[_0x31c463(0x193)]!==undefined)_0x4cb0ef[_0x31c463(0x193)]=Number(_0x43dcb6[_0x31c463(0x193)]);if(_0x43dcb6[_0x31c463(0x1d3)]!==undefined)_0x4cb0ef[_0x31c463(0x1d1)]=Number(_0x43dcb6['retryLimit']);if(_0x43dcb6[_0x31c463(0x1bc)])_0x4cb0ef[_0x31c463(0x194)]=_0x43dcb6[_0x31c463(0x1bc)];if(_0x43dcb6[_0x31c463(0x1f4)])_0x4cb0ef['result']=_0x43dcb6[_0x31c463(0x1f4)];if(_0x393296[_0x31c463(0x1c7)]){console[_0x31c463(0x1a9)](_0x31c463(0x1dc)+_0xc521b9),console[_0x31c463(0x1a9)]('\x20\x20Database:\x20'+_0x58873d),console[_0x31c463(0x1a9)](_0x31c463(0x1d7)+_0x2c56cd);if(_0x4cb0ef[_0x31c463(0x1f9)])console[_0x31c463(0x1a9)](_0x31c463(0x1f1)+_0x4cb0ef[_0x31c463(0x1f9)]);if(_0x4cb0ef['timezone'])console[_0x31c463(0x1a9)](_0x31c463(0x17a)+_0x4cb0ef[_0x31c463(0x1f5)]);}const _0x23b7f8=await withSpinner(_0x31c463(0x202),()=>_0x206d4f[_0x31c463(0x1ae)][_0x31c463(0x205)](_0xc521b9,_0x4cb0ef),{'verbose':_0x393296[_0x31c463(0x1c7)]});return console[_0x31c463(0x1a9)]('Schedule\x20created:\x20'+_0x23b7f8[_0x31c463(0x1c4)]['name']),await handleSingleObjectOutput(_0x23b7f8[_0x31c463(0x1c4)],_0x393296),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a35_0x42a9e2(0x1b4);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1bb);[a35_0x42a9e2(0x18b)](_0x5cec79){const _0x1f617f=a35_0x42a9e2,_0x4c844b=_0x5cec79[_0x1f617f(0x1c2)][0x0];if(!_0x4c844b)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a35_0x42a9e2(0x197)](_0x1a06c7){const _0x31efc3=a35_0x42a9e2,{options:_0x145cba,args:_0x328137,tdx:_0x1933e9}=_0x1a06c7,_0xbfc238=_0x328137[0x0],_0x4e0966=_0x145cba,_0x8156dd={};if(_0x4e0966[_0x31efc3(0x189)])_0x8156dd['database']=_0x4e0966['database'];if(_0x4e0966[_0x31efc3(0x1fc)])_0x8156dd[_0x31efc3(0x1fc)]=_0x4e0966[_0x31efc3(0x1fc)];if(_0x4e0966[_0x31efc3(0x1f9)])_0x8156dd[_0x31efc3(0x1f9)]=_0x4e0966[_0x31efc3(0x1f9)];if(_0x4e0966[_0x31efc3(0x1f5)])_0x8156dd[_0x31efc3(0x1f5)]=_0x4e0966[_0x31efc3(0x1f5)];if(_0x4e0966['delay']!==undefined)_0x8156dd[_0x31efc3(0x1a2)]=Number(_0x4e0966['delay']);if(_0x4e0966[_0x31efc3(0x193)]!==undefined)_0x8156dd['priority']=Number(_0x4e0966[_0x31efc3(0x193)]);if(_0x4e0966['retryLimit']!==undefined)_0x8156dd['retry_limit']=Number(_0x4e0966[_0x31efc3(0x1d3)]);if(_0x4e0966[_0x31efc3(0x1bc)])_0x8156dd[_0x31efc3(0x194)]=_0x4e0966[_0x31efc3(0x1bc)];if(_0x4e0966[_0x31efc3(0x1f4)])_0x8156dd['result']=_0x4e0966['result'];if(_0x4e0966[_0x31efc3(0x1d4)])try{_0x8156dd[_0x31efc3(0x1c9)]=readFileSync(_0x4e0966[_0x31efc3(0x1d4)],'utf-8')[_0x31efc3(0x203)]();}catch(_0x5e5ff4){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x4e0966['file'],_0x5e5ff4 instanceof Error?_0x5e5ff4:undefined);}if(Object[_0x31efc3(0x1c1)](_0x8156dd)['length']===0x0)throw new SDKError(ErrorCode[_0x31efc3(0x1f8)],_0x31efc3(0x198));if(_0x145cba[_0x31efc3(0x1c7)]){console[_0x31efc3(0x1a9)](_0x31efc3(0x209)+_0xbfc238);for(const [_0x4a1a2b,_0x575976]of Object[_0x31efc3(0x1d2)](_0x8156dd)){_0x4a1a2b===_0x31efc3(0x1c9)?console[_0x31efc3(0x1a9)]('\x20\x20'+_0x4a1a2b+':\x20'+_0x575976[_0x31efc3(0x1e9)](0x0,0x32)+_0x31efc3(0x17d)):console[_0x31efc3(0x1a9)]('\x20\x20'+_0x4a1a2b+':\x20'+_0x575976);}}const _0x370ffb=await withSpinner(_0x31efc3(0x1fd),()=>_0x1933e9[_0x31efc3(0x1ae)]['update'](_0xbfc238,_0x8156dd),{'verbose':_0x145cba[_0x31efc3(0x1c7)]});return console[_0x31efc3(0x1a9)](_0x31efc3(0x1c8)+_0x370ffb['data']['name']),await handleSingleObjectOutput(_0x370ffb[_0x31efc3(0x1c4)],_0x145cba),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']='schedule:delete';['description']=a35_0x42a9e2(0x1f7);['validate'](_0x2e8bb5){const _0x512f9d=a35_0x42a9e2,_0x457007=_0x2e8bb5[_0x512f9d(0x1c2)][0x0];if(!_0x457007)return _0x512f9d(0x1a4);return undefined;}async[a35_0x42a9e2(0x197)](_0x2cb90f){const _0x2cb4c0=a35_0x42a9e2,{options:_0x21af3c,args:_0x2d016e,tdx:_0x39cfc2}=_0x2cb90f,_0x1eb8f1=_0x2d016e[0x0];if(!_0x21af3c[_0x2cb4c0(0x1db)]){const _0x650fc2=await confirm(_0x2cb4c0(0x1ce)+_0x1eb8f1+'\x22?');if(!_0x650fc2)return console[_0x2cb4c0(0x1a9)](_0x2cb4c0(0x1e7)),0x0;}const _0x22c0e4=await withSpinner(_0x2cb4c0(0x19a),()=>_0x39cfc2[_0x2cb4c0(0x1ae)][_0x2cb4c0(0x1c3)](_0x1eb8f1),{'verbose':_0x21af3c[_0x2cb4c0(0x1c7)]});return console[_0x2cb4c0(0x1a9)](_0x2cb4c0(0x185)+_0x22c0e4[_0x2cb4c0(0x1c4)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x1ab);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x17b);[a35_0x42a9e2(0x18b)](_0x4e544c){const _0x4cc60f=a35_0x42a9e2,_0x221665=_0x4e544c[_0x4cc60f(0x1c2)][0x0];if(!_0x221665)return _0x4cc60f(0x1f3);return undefined;}async[a35_0x42a9e2(0x197)](_0x3e540e){const _0x3d9e54=a35_0x42a9e2,{options:_0x163bbf,args:_0x256275,tdx:_0x5cc04b}=_0x3e540e,_0x4a5936=_0x256275[0x0],_0x286477=_0x163bbf,_0x301ebf=_0x286477[_0x3d9e54(0x1ef)],_0x33a459=_0x286477[_0x3d9e54(0x20a)]!==undefined?Number(_0x286477[_0x3d9e54(0x20a)]):undefined;if(_0x163bbf[_0x3d9e54(0x1c7)]){console[_0x3d9e54(0x1a9)]('Running\x20schedule:\x20'+_0x4a5936);if(_0x301ebf)console[_0x3d9e54(0x1a9)](_0x3d9e54(0x183)+_0x301ebf);if(_0x33a459)console['error'](_0x3d9e54(0x1cd)+_0x33a459);}const _0x410b28=await withSpinner(_0x3d9e54(0x1c6),()=>_0x5cc04b[_0x3d9e54(0x1ae)]['run'](_0x4a5936,{'time':_0x301ebf,'num':_0x33a459}),{'verbose':_0x163bbf[_0x3d9e54(0x1c7)]}),_0x5dbb54=_0x410b28[_0x3d9e54(0x1c4)][_0x3d9e54(0x1ba)];console[_0x3d9e54(0x1a9)](_0x3d9e54(0x1e1)+_0x5dbb54[_0x3d9e54(0x1a3)]+_0x3d9e54(0x1d5)+(_0x5dbb54['length']!==0x1?'s':'')+_0x3d9e54(0x188));for(const _0x326d97 of _0x5dbb54){console[_0x3d9e54(0x1a9)]('\x20\x20Job\x20ID:\x20'+_0x326d97[_0x3d9e54(0x1e3)]);}return await handleSDKOutput(_0x5dbb54,_0x163bbf),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']=a35_0x42a9e2(0x1a7);[a35_0x42a9e2(0x190)]='Show\x20schedule\x20execution\x20history';[a35_0x42a9e2(0x18b)](_0x2de377){const _0x4d8628=a35_0x42a9e2,_0x277fab=_0x2de377[_0x4d8628(0x1c2)][0x0];if(!_0x277fab)return _0x4d8628(0x17c);return undefined;}async[a35_0x42a9e2(0x197)](_0x548329){const _0x42281f=a35_0x42a9e2,{options:_0x20ddca,args:_0x5b15d4,tdx:_0x4757c2}=_0x548329,_0x1496ad=_0x5b15d4[0x0],_0x228584=_0x20ddca,_0x19384f=_0x228584['from']!==undefined?Number(_0x228584['from']):undefined,_0x195064=_0x228584['to']!==undefined?Number(_0x228584['to']):undefined,_0x532856=await withSpinner('Getting\x20schedule\x20history...',()=>_0x4757c2['schedules']['history'](_0x1496ad,{'from':_0x19384f,'to':_0x195064}),{'verbose':_0x20ddca[_0x42281f(0x1c7)]}),_0x36895d=_0x532856['data'];console[_0x42281f(0x1a9)](_0x42281f(0x207)+_0x36895d[_0x42281f(0x1b3)]+_0x42281f(0x1a5)+(_0x36895d['count']!==0x1?'s':'')+'\x20(showing\x20'+_0x36895d[_0x42281f(0x1e8)]+'-'+_0x36895d['to']+')');const _0x2a0320=_0x36895d[_0x42281f(0x1fa)][_0x42281f(0x181)](_0x5b122f=>({'job_id':_0x5b122f[_0x42281f(0x1e3)],'type':_0x5b122f[_0x42281f(0x1fc)],'status':_0x5b122f[_0x42281f(0x1c0)],'scheduled_at':_0x5b122f[_0x42281f(0x201)],'created_at':_0x5b122f[_0x42281f(0x1b5)],'start_at':_0x5b122f[_0x42281f(0x1e4)],'end_at':_0x5b122f[_0x42281f(0x18f)]}));return await handleSDKOutput(_0x2a0320,_0x20ddca),0x0;}}
|
|
1
|
+
const a35_0x5bf13f=a35_0x45f2;(function(_0x27176d,_0x156daf){const _0x33bbff=a35_0x45f2,_0x41ad1b=_0x27176d();while(!![]){try{const _0x3a1bf7=-parseInt(_0x33bbff(0x224))/0x1+parseInt(_0x33bbff(0x1f3))/0x2+-parseInt(_0x33bbff(0x228))/0x3*(parseInt(_0x33bbff(0x255))/0x4)+-parseInt(_0x33bbff(0x1e8))/0x5*(-parseInt(_0x33bbff(0x233))/0x6)+parseInt(_0x33bbff(0x261))/0x7*(-parseInt(_0x33bbff(0x1f5))/0x8)+-parseInt(_0x33bbff(0x211))/0x9*(parseInt(_0x33bbff(0x263))/0xa)+parseInt(_0x33bbff(0x202))/0xb;if(_0x3a1bf7===_0x156daf)break;else _0x41ad1b['push'](_0x41ad1b['shift']());}catch(_0x5a728c){_0x41ad1b['push'](_0x41ad1b['shift']());}}}(a35_0xbecc,0x83142));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a35_0x1993fd from'chalk';function formatRelativeTime(_0x55a866){const _0x18e48e=a35_0x45f2,_0x55db42=new Date(_0x55a866),_0x471729=new Date(),_0x2c4b2b=_0x55db42[_0x18e48e(0x1fc)]()-_0x471729['getTime'](),_0x22602d=Math[_0x18e48e(0x26b)](_0x2c4b2b)/0x3e8,_0x3ab293=_0x2c4b2b<0x0;if(_0x22602d<0x3c)return _0x3ab293?_0x18e48e(0x269):_0x18e48e(0x266);else{if(_0x22602d<0xe10){const _0x5083bd=Math[_0x18e48e(0x23e)](_0x22602d/0x3c);return _0x3ab293?_0x5083bd+'m\x20ago':_0x18e48e(0x25b)+_0x5083bd+'m';}else{if(_0x22602d<0x15180){const _0x30ad51=Math['round'](_0x22602d/0xe10);return _0x3ab293?_0x30ad51+_0x18e48e(0x26e):_0x18e48e(0x25b)+_0x30ad51+'h';}else{if(_0x22602d<0x93a80){const _0x216a6c=Math[_0x18e48e(0x23e)](_0x22602d/0x15180);return _0x3ab293?_0x216a6c+_0x18e48e(0x22a):_0x18e48e(0x25b)+_0x216a6c+'d';}else return _0x55db42['toLocaleDateString']();}}}}function a35_0x45f2(_0x131141,_0x9bc890){_0x131141=_0x131141-0x1e0;const _0xbecc19=a35_0xbecc();let _0x45f267=_0xbecc19[_0x131141];return _0x45f267;}export class ScheduleListCommand extends BaseCommand{[a35_0x5bf13f(0x209)]=a35_0x5bf13f(0x204);[a35_0x5bf13f(0x248)]=a35_0x5bf13f(0x1f2);async['execute'](_0x1770b4){const _0x2c6b2d=a35_0x5bf13f,{options:_0x1f54b6,args:_0x7782d3,tdx:_0x293531}=_0x1770b4,_0x4b61d7=resolveLimit(_0x1f54b6[_0x2c6b2d(0x267)],DEFAULT_DISPLAY_LIMIT),_0xfbcfe=_0x7782d3[0x0],_0x1e342d=_0xfbcfe?_0x2c6b2d(0x1e3)+_0xfbcfe+_0x2c6b2d(0x236):_0x2c6b2d(0x244),_0x147c75=await withSpinner(_0x1e342d,()=>_0x293531[_0x2c6b2d(0x260)]['listQueries']({'limit':_0x4b61d7,'scheduled':!![],'pattern':_0xfbcfe}),{'verbose':_0x1f54b6[_0x2c6b2d(0x246)]}),_0x173024=_0x147c75[_0x2c6b2d(0x229)][_0x2c6b2d(0x215)],_0x3a6d5d=_0x147c75[_0x2c6b2d(0x229)][_0x2c6b2d(0x24c)]['has_next_page'],_0x36f9c5=_0xfbcfe?_0x2c6b2d(0x25c)+_0xfbcfe+'\x22':'';_0x3a6d5d?console['error'](_0x2c6b2d(0x24b)+_0x173024['length']+_0x2c6b2d(0x207)+_0x36f9c5+_0x2c6b2d(0x1e5)):console[_0x2c6b2d(0x1ea)](_0x2c6b2d(0x221)+_0x173024[_0x2c6b2d(0x22f)]+'\x20scheduled\x20quer'+(_0x173024['length']!==0x1?'ies':'y')+_0x36f9c5);if(_0x1f54b6[_0x2c6b2d(0x1e4)]===_0x2c6b2d(0x1fe)||_0x1f54b6[_0x2c6b2d(0x1e4)]===_0x2c6b2d(0x1ef)||_0x1f54b6[_0x2c6b2d(0x1e4)]===_0x2c6b2d(0x241)||_0x1f54b6[_0x2c6b2d(0x1e4)]==='tsv'){const _0x126074=_0x173024['map'](_0x33bb2a=>({'id':_0x33bb2a['id'],'name':_0x33bb2a[_0x2c6b2d(0x209)],'cron':_0x33bb2a[_0x2c6b2d(0x1ee)],'database':_0x33bb2a[_0x2c6b2d(0x251)]?.[_0x2c6b2d(0x209)],'type':_0x33bb2a[_0x2c6b2d(0x272)],'timezone':_0x33bb2a[_0x2c6b2d(0x25e)],'user_name':_0x33bb2a[_0x2c6b2d(0x245)]?.['name'],'updated_at':_0x33bb2a[_0x2c6b2d(0x20a)],'next_run_at':_0x33bb2a[_0x2c6b2d(0x214)],'last_job_status':_0x33bb2a[_0x2c6b2d(0x24f)]?.[_0x2c6b2d(0x250)]}));await handleSDKOutput(_0x126074,_0x1f54b6);}else{if(_0x173024[_0x2c6b2d(0x22f)]===0x0)console[_0x2c6b2d(0x23d)](_0x2c6b2d(0x1f4));else{const _0x4c6c4c=_0x1f54b6[_0x2c6b2d(0x21b)],_0x4df152=_0x173024[_0x2c6b2d(0x262)](_0x14e49a=>{const _0x150956=_0x2c6b2d,_0x56bdd4=_0x14e49a[_0x150956(0x24f)]?.[_0x150956(0x250)]?_0x14e49a[_0x150956(0x24f)]['status']==='success'?'✓':'✗':'-',_0x5ccef1=_0x14e49a[_0x150956(0x24f)]?.[_0x150956(0x1e9)]?formatRelativeTime(_0x14e49a[_0x150956(0x24f)][_0x150956(0x1e9)]):_0x150956(0x21e),_0x4b7d60=_0x14e49a[_0x150956(0x214)]?formatRelativeTime(_0x14e49a[_0x150956(0x214)]):'-',_0x4efc96=_0x14e49a['cron']||'',_0x232363=_0x14e49a[_0x150956(0x209)]||'(unnamed)',_0x2dc265=getConsoleUrl(_0x4c6c4c,_0x150956(0x1f7)+_0x14e49a['id']);return{'statusIcon':_0x56bdd4,'lastRun':_0x5ccef1,'nextRun':_0x4b7d60,'cron':_0x4efc96,'name':_0x232363,'queryUrl':_0x2dc265,'status':_0x14e49a[_0x150956(0x24f)]?.['status']};}),_0xd6d037=Math[_0x2c6b2d(0x259)](..._0x4df152['map'](_0x283474=>_0x283474[_0x2c6b2d(0x200)][_0x2c6b2d(0x22f)])),_0x5dc239=Math[_0x2c6b2d(0x259)](..._0x4df152[_0x2c6b2d(0x262)](_0x14c60a=>_0x14c60a[_0x2c6b2d(0x25d)][_0x2c6b2d(0x22f)])),_0x33098d=Math[_0x2c6b2d(0x259)](..._0x4df152['map'](_0x30886d=>_0x30886d['cron']['length'])),_0x482bed=_0x4df152[_0x2c6b2d(0x262)](_0xa91452=>{const _0x20f051=_0x2c6b2d,_0x10058f=_0xa91452[_0x20f051(0x250)]===_0x20f051(0x1ff)?a35_0x1993fd[_0x20f051(0x230)](_0xa91452[_0x20f051(0x265)]):_0xa91452[_0x20f051(0x250)]==='error'?a35_0x1993fd[_0x20f051(0x223)](_0xa91452[_0x20f051(0x265)]):a35_0x1993fd['dim'](_0xa91452[_0x20f051(0x265)]),_0x27a499=_0xa91452[_0x20f051(0x200)]['padEnd'](_0xd6d037),_0x21754c=_0xa91452[_0x20f051(0x25d)][_0x20f051(0x1e7)](_0x5dc239),_0x212f78=_0xa91452['cron']?a35_0x1993fd[_0x20f051(0x253)](_0xa91452['cron']['padEnd'](_0x33098d)):'\x20'[_0x20f051(0x22e)](_0x33098d),_0x3e4fd7=hyperlink(_0xa91452[_0x20f051(0x209)],_0xa91452[_0x20f051(0x26d)]);return _0x20f051(0x22d)+_0x10058f+'\x20'+_0x27a499+_0x20f051(0x226)+_0x21754c+'\x20\x20'+_0x212f78+'\x20\x20'+_0x3e4fd7;});await writeOutput(_0x482bed[_0x2c6b2d(0x216)]('\x0a'),_0x1f54b6[_0x2c6b2d(0x264)],_0x2c6b2d(0x25f));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a35_0x5bf13f(0x209)]=a35_0x5bf13f(0x258);['description']=a35_0x5bf13f(0x238);['validate'](_0x549a17){const _0x483e29=a35_0x5bf13f,_0x2a4a41=_0x549a17[_0x483e29(0x240)][0x0];if(!_0x2a4a41)return _0x483e29(0x26a);return undefined;}async['execute'](_0x783cc){const _0x3c09fc=a35_0x5bf13f,{options:_0x24b9e2,args:_0x422b57,tdx:_0x157cc3}=_0x783cc,_0x5b0de5=_0x422b57[0x0],_0x4cedc1=await withSpinner(_0x3c09fc(0x20f),()=>_0x157cc3[_0x3c09fc(0x260)][_0x3c09fc(0x270)](_0x5b0de5),{'verbose':_0x24b9e2[_0x3c09fc(0x246)]}),_0x422bf3=_0x4cedc1[_0x3c09fc(0x229)],_0x531067={'name':_0x422bf3[_0x3c09fc(0x209)],'cron':_0x422bf3[_0x3c09fc(0x1ee)],'database':_0x422bf3[_0x3c09fc(0x251)],'type':_0x422bf3[_0x3c09fc(0x272)],'timezone':_0x422bf3['timezone'],'user_name':_0x422bf3[_0x3c09fc(0x1e2)],'created_at':_0x422bf3[_0x3c09fc(0x26f)],'engine_version':_0x422bf3['engine_version'],'executing_user_id':_0x422bf3[_0x3c09fc(0x218)],'query':_0x422bf3['query'],'delay':_0x422bf3[_0x3c09fc(0x237)],'priority':_0x422bf3[_0x3c09fc(0x25a)],'retry_limit':_0x422bf3['retry_limit'],..._0x422bf3[_0x3c09fc(0x235)]&&{'result':_0x422bf3['result']}};return await handleSingleObjectOutput(_0x531067,_0x24b9e2),0x0;}}function a35_0xbecc(){const _0x350c1e=['Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','schedule:show','max','priority','in\x20','\x20matching\x20\x22','nextRun','time_zone','list','schedules','899647QpcfwJ','map','1480wHDYKV','output','statusIcon','soon','limit','Running\x20schedule...','just\x20now','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','abs','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','queryUrl','h\x20ago','created_at','show','keys','type','Run\x20a\x20scheduled\x20query\x20immediately','utf-8','user_name','Searching\x20scheduled\x20queries\x20matching\x20\x22','format','\x20(use\x20--limit\x20to\x20see\x20more)','trino','padEnd','145dJqloz','ended_at','error','query','Schedule\x20deleted:\x20','...','cron','jsonl','num','file','List\x20scheduled\x20queries','1237062SfLRAl','No\x20scheduled\x20queries\x20found','32vepXRp','Schedule\x20run\x20submitted:\x20','/app/queries/editor?queryId=','\x20\x20Num:\x20','\x20\x20Type:\x20','run','\x20created','getTime','trim','json','success','lastRun','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','24521915aNhjib','retryLimit','schedule:list','entries','Schedule\x20updated:\x20','\x20schedules','delete','name','updated_at','Delete\x20a\x20scheduled\x20query','create','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Getting\x20schedule\x20history...','Getting\x20schedule\x20details...','retry_limit','60102MmNlce','yes','timezone','next_run_at','queries','join','Create\x20a\x20scheduled\x20query','executing_user_id','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','engineVersion','site','Cancelled','validate','never','time','\x20\x20Time:\x20','Found\x20','end_at','red','182567mWPHdU','schedule:run','\x20\x20→\x20','count','3NCtGvJ','data','d\x20ago','Updating\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','📅\x20','repeat','length','green','Running\x20schedule:\x20','job_id','57324rXqiTf','history','result','\x22...','delay','Show\x20schedule\x20details','\x20job','\x20\x20Timezone:\x20','from','Schedule\x20created:\x20','log','round','INVALID_ARGUMENT','args','table','jobs','Failed\x20to\x20read\x20file:\x20','Listing\x20scheduled\x20queries...','user','verbose','Updating\x20schedule...','description','Creating\x20schedule...','options','Showing\x20first\x20','pagination','execute','Query\x20file\x20is\x20empty','last_job','status','database','engine_version','cyan','schedule:update','3611876YQrBAZ','\x20execution'];a35_0xbecc=function(){return _0x350c1e;};return a35_0xbecc();}export class ScheduleCreateCommand extends BaseCommand{[a35_0x5bf13f(0x209)]='schedule:create';[a35_0x5bf13f(0x248)]=a35_0x5bf13f(0x217);[a35_0x5bf13f(0x21d)](_0x5141c8){const _0x33d64a=a35_0x5bf13f,_0x5f5731=_0x5141c8[_0x33d64a(0x240)][0x0];if(!_0x5f5731)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x4c5077=_0x5141c8[_0x33d64a(0x24a)];if(!_0x4c5077['database'])return _0x33d64a(0x201);return undefined;}async[a35_0x5bf13f(0x24d)](_0x3be46b){const _0xcb662=a35_0x5bf13f,{options:_0x292d0f,args:_0x316b0a,tdx:_0x3430a6}=_0x3be46b,_0x554b5b=_0x316b0a[0x0],_0x356692=_0x292d0f,_0xcbc8e1=_0x356692['database'],_0x4dcce1=_0x356692[_0xcb662(0x1f1)],_0x378a1d=_0x356692[_0xcb662(0x272)]||_0xcb662(0x1e6);let _0x315c4a;try{_0x315c4a=readFileSync(_0x4dcce1,_0xcb662(0x1e1))[_0xcb662(0x1fd)]();}catch(_0x46d790){throw new SDKError(ErrorCode[_0xcb662(0x23f)],'Failed\x20to\x20read\x20file:\x20'+_0x4dcce1,_0x46d790 instanceof Error?_0x46d790:undefined);}if(!_0x315c4a)throw new SDKError(ErrorCode[_0xcb662(0x23f)],_0xcb662(0x24e));const _0x15b9e4={'database':_0xcbc8e1,'query':_0x315c4a,'type':_0x378a1d};if(_0x356692[_0xcb662(0x1ee)])_0x15b9e4[_0xcb662(0x1ee)]=_0x356692[_0xcb662(0x1ee)];if(_0x356692[_0xcb662(0x213)])_0x15b9e4['timezone']=_0x356692[_0xcb662(0x213)];if(_0x356692[_0xcb662(0x237)]!==undefined)_0x15b9e4[_0xcb662(0x237)]=Number(_0x356692[_0xcb662(0x237)]);if(_0x356692[_0xcb662(0x25a)]!==undefined)_0x15b9e4[_0xcb662(0x25a)]=Number(_0x356692[_0xcb662(0x25a)]);if(_0x356692[_0xcb662(0x203)]!==undefined)_0x15b9e4['retry_limit']=Number(_0x356692[_0xcb662(0x203)]);if(_0x356692[_0xcb662(0x21a)])_0x15b9e4[_0xcb662(0x252)]=_0x356692[_0xcb662(0x21a)];if(_0x356692[_0xcb662(0x235)])_0x15b9e4[_0xcb662(0x235)]=_0x356692['result'];if(_0x292d0f[_0xcb662(0x246)]){console[_0xcb662(0x1ea)]('Creating\x20schedule:\x20'+_0x554b5b),console[_0xcb662(0x1ea)]('\x20\x20Database:\x20'+_0xcbc8e1),console[_0xcb662(0x1ea)](_0xcb662(0x1f9)+_0x378a1d);if(_0x15b9e4['cron'])console['error']('\x20\x20Cron:\x20'+_0x15b9e4['cron']);if(_0x15b9e4[_0xcb662(0x213)])console[_0xcb662(0x1ea)](_0xcb662(0x23a)+_0x15b9e4[_0xcb662(0x213)]);}const _0x25c280=await withSpinner(_0xcb662(0x249),()=>_0x3430a6['schedules'][_0xcb662(0x20c)](_0x554b5b,_0x15b9e4),{'verbose':_0x292d0f['verbose']});return console[_0xcb662(0x1ea)](_0xcb662(0x23c)+_0x25c280[_0xcb662(0x229)][_0xcb662(0x209)]),await handleSingleObjectOutput(_0x25c280[_0xcb662(0x229)],_0x292d0f),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a35_0x5bf13f(0x254);[a35_0x5bf13f(0x248)]='Update\x20a\x20scheduled\x20query';['validate'](_0x353cdb){const _0xc5a29b=a35_0x5bf13f,_0x9a8867=_0x353cdb['args'][0x0];if(!_0x9a8867)return _0xc5a29b(0x22c);return undefined;}async[a35_0x5bf13f(0x24d)](_0x4978b8){const _0xc1656=a35_0x5bf13f,{options:_0x460f17,args:_0x39cc21,tdx:_0x56db17}=_0x4978b8,_0x6eb457=_0x39cc21[0x0],_0x4453de=_0x460f17,_0x587187={};if(_0x4453de[_0xc1656(0x251)])_0x587187[_0xc1656(0x251)]=_0x4453de[_0xc1656(0x251)];if(_0x4453de[_0xc1656(0x272)])_0x587187[_0xc1656(0x272)]=_0x4453de[_0xc1656(0x272)];if(_0x4453de[_0xc1656(0x1ee)])_0x587187['cron']=_0x4453de[_0xc1656(0x1ee)];if(_0x4453de[_0xc1656(0x213)])_0x587187[_0xc1656(0x213)]=_0x4453de[_0xc1656(0x213)];if(_0x4453de[_0xc1656(0x237)]!==undefined)_0x587187[_0xc1656(0x237)]=Number(_0x4453de[_0xc1656(0x237)]);if(_0x4453de[_0xc1656(0x25a)]!==undefined)_0x587187[_0xc1656(0x25a)]=Number(_0x4453de['priority']);if(_0x4453de[_0xc1656(0x203)]!==undefined)_0x587187[_0xc1656(0x210)]=Number(_0x4453de[_0xc1656(0x203)]);if(_0x4453de[_0xc1656(0x21a)])_0x587187[_0xc1656(0x252)]=_0x4453de[_0xc1656(0x21a)];if(_0x4453de['result'])_0x587187[_0xc1656(0x235)]=_0x4453de[_0xc1656(0x235)];if(_0x4453de['file'])try{_0x587187[_0xc1656(0x1eb)]=readFileSync(_0x4453de[_0xc1656(0x1f1)],_0xc1656(0x1e1))[_0xc1656(0x1fd)]();}catch(_0x4fe145){throw new SDKError(ErrorCode[_0xc1656(0x23f)],_0xc1656(0x243)+_0x4453de[_0xc1656(0x1f1)],_0x4fe145 instanceof Error?_0x4fe145:undefined);}if(Object[_0xc1656(0x271)](_0x587187)['length']===0x0)throw new SDKError(ErrorCode[_0xc1656(0x23f)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x460f17['verbose']){console['error'](_0xc1656(0x22b)+_0x6eb457);for(const [_0x475c89,_0x1e5f49]of Object[_0xc1656(0x205)](_0x587187)){_0x475c89===_0xc1656(0x1eb)?console[_0xc1656(0x1ea)]('\x20\x20'+_0x475c89+':\x20'+_0x1e5f49['substring'](0x0,0x32)+_0xc1656(0x1ed)):console[_0xc1656(0x1ea)]('\x20\x20'+_0x475c89+':\x20'+_0x1e5f49);}}const _0x218bc7=await withSpinner(_0xc1656(0x247),()=>_0x56db17[_0xc1656(0x260)]['update'](_0x6eb457,_0x587187),{'verbose':_0x460f17['verbose']});return console[_0xc1656(0x1ea)](_0xc1656(0x206)+_0x218bc7[_0xc1656(0x229)]['name']),await handleSingleObjectOutput(_0x218bc7[_0xc1656(0x229)],_0x460f17),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']='schedule:delete';[a35_0x5bf13f(0x248)]=a35_0x5bf13f(0x20b);[a35_0x5bf13f(0x21d)](_0x37921e){const _0x412831=a35_0x5bf13f,_0x4135df=_0x37921e[_0x412831(0x240)][0x0];if(!_0x4135df)return _0x412831(0x257);return undefined;}async[a35_0x5bf13f(0x24d)](_0x283160){const _0x67ecee=a35_0x5bf13f,{options:_0x5b906a,args:_0x2cf32f,tdx:_0x445903}=_0x283160,_0x4d48f4=_0x2cf32f[0x0];if(!_0x5b906a[_0x67ecee(0x212)]){const _0x55011b=await confirm(_0x67ecee(0x26c)+_0x4d48f4+'\x22?');if(!_0x55011b)return console[_0x67ecee(0x1ea)](_0x67ecee(0x21c)),0x0;}const _0x21f420=await withSpinner('Deleting\x20schedule...',()=>_0x445903[_0x67ecee(0x260)][_0x67ecee(0x208)](_0x4d48f4),{'verbose':_0x5b906a[_0x67ecee(0x246)]});return console[_0x67ecee(0x1ea)](_0x67ecee(0x1ec)+_0x21f420[_0x67ecee(0x229)][_0x67ecee(0x209)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a35_0x5bf13f(0x209)]=a35_0x5bf13f(0x225);['description']=a35_0x5bf13f(0x1e0);['validate'](_0x34e6ae){const _0x1e5eff=a35_0x5bf13f,_0x17d58b=_0x34e6ae[_0x1e5eff(0x240)][0x0];if(!_0x17d58b)return _0x1e5eff(0x219);return undefined;}async['execute'](_0x20652f){const _0x37ba6b=a35_0x5bf13f,{options:_0x1c789f,args:_0x40ec0d,tdx:_0x2a0b69}=_0x20652f,_0x101118=_0x40ec0d[0x0],_0x3f0d5d=_0x1c789f,_0x584aac=_0x3f0d5d[_0x37ba6b(0x21f)],_0x49f892=_0x3f0d5d['num']!==undefined?Number(_0x3f0d5d[_0x37ba6b(0x1f0)]):undefined;if(_0x1c789f[_0x37ba6b(0x246)]){console[_0x37ba6b(0x1ea)](_0x37ba6b(0x231)+_0x101118);if(_0x584aac)console[_0x37ba6b(0x1ea)](_0x37ba6b(0x220)+_0x584aac);if(_0x49f892)console[_0x37ba6b(0x1ea)](_0x37ba6b(0x1f8)+_0x49f892);}const _0x51dc25=await withSpinner(_0x37ba6b(0x268),()=>_0x2a0b69['schedules'][_0x37ba6b(0x1fa)](_0x101118,{'time':_0x584aac,'num':_0x49f892}),{'verbose':_0x1c789f[_0x37ba6b(0x246)]}),_0x5aa337=_0x51dc25[_0x37ba6b(0x229)][_0x37ba6b(0x242)];console[_0x37ba6b(0x1ea)](_0x37ba6b(0x1f6)+_0x5aa337['length']+_0x37ba6b(0x239)+(_0x5aa337[_0x37ba6b(0x22f)]!==0x1?'s':'')+_0x37ba6b(0x1fb));for(const _0x546aec of _0x5aa337){console['error']('\x20\x20Job\x20ID:\x20'+_0x546aec[_0x37ba6b(0x232)]);}return await handleSDKOutput(_0x5aa337,_0x1c789f),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a35_0x5bf13f(0x248)]='Show\x20schedule\x20execution\x20history';[a35_0x5bf13f(0x21d)](_0x59690c){const _0x2dac30=a35_0x5bf13f,_0x818527=_0x59690c[_0x2dac30(0x240)][0x0];if(!_0x818527)return _0x2dac30(0x20d);return undefined;}async['execute'](_0x46aba8){const _0x2ed816=a35_0x5bf13f,{options:_0xff40c3,args:_0x3924ba,tdx:_0x2ebb94}=_0x46aba8,_0x553ea8=_0x3924ba[0x0],_0xbe4188=_0xff40c3,_0x222d1c=_0xbe4188[_0x2ed816(0x23b)]!==undefined?Number(_0xbe4188[_0x2ed816(0x23b)]):undefined,_0xb48be1=_0xbe4188['to']!==undefined?Number(_0xbe4188['to']):undefined,_0x451a39=await withSpinner(_0x2ed816(0x20e),()=>_0x2ebb94[_0x2ed816(0x260)][_0x2ed816(0x234)](_0x553ea8,{'from':_0x222d1c,'to':_0xb48be1}),{'verbose':_0xff40c3['verbose']}),_0x31196d=_0x451a39[_0x2ed816(0x229)];console[_0x2ed816(0x1ea)](_0x2ed816(0x221)+_0x31196d[_0x2ed816(0x227)]+_0x2ed816(0x256)+(_0x31196d[_0x2ed816(0x227)]!==0x1?'s':'')+'\x20(showing\x20'+_0x31196d[_0x2ed816(0x23b)]+'-'+_0x31196d['to']+')');const _0x884773=_0x31196d[_0x2ed816(0x234)][_0x2ed816(0x262)](_0x154ce0=>({'job_id':_0x154ce0[_0x2ed816(0x232)],'type':_0x154ce0[_0x2ed816(0x272)],'status':_0x154ce0['status'],'scheduled_at':_0x154ce0['scheduled_at'],'created_at':_0x154ce0[_0x2ed816(0x26f)],'start_at':_0x154ce0['start_at'],'end_at':_0x154ce0[_0x2ed816(0x222)]}));return await handleSDKOutput(_0x884773,_0xff40c3),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x2a13a5=a36_0x4310;(function(_0x5cc326,_0x1fe04b){const _0x2fde9c=a36_0x4310,_0x490bc7=_0x5cc326();while(!![]){try{const _0x345d22=-parseInt(_0x2fde9c(0x1df))/0x1+parseInt(_0x2fde9c(0x1b8))/0x2*(parseInt(_0x2fde9c(0x1cc))/0x3)+-parseInt(_0x2fde9c(0x1bb))/0x4*(parseInt(_0x2fde9c(0x1e3))/0x5)+-parseInt(_0x2fde9c(0x205))/0x6*(-parseInt(_0x2fde9c(0x1fd))/0x7)+parseInt(_0x2fde9c(0x230))/0x8+parseInt(_0x2fde9c(0x23a))/0x9*(-parseInt(_0x2fde9c(0x255))/0xa)+-parseInt(_0x2fde9c(0x1b0))/0xb*(-parseInt(_0x2fde9c(0x20f))/0xc);if(_0x345d22===_0x1fe04b)break;else _0x490bc7['push'](_0x490bc7['shift']());}catch(_0x54290b){_0x490bc7['push'](_0x490bc7['shift']());}}}(a36_0xcee7,0x450aa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a36_0xcee7(){const _0x205487=['url','getSegment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Creating\x20folder\x20\x27','cause','Create\x20segment\x20folder\x20for\x20organization','segment:sql','segmentId','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','setJobId','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20segment:\x20','folderId','Site:\x20','SEGMENT_FOLDER_NOT_FOUND','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Get\x20SQL\x20query\x20for\x20child\x20segment','INVALID_ARGUMENT','resolveParentId','142856wkSEOR','green','Error:\x20Path\x20or\x20name\x20is\x20required','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20Folder\x20path:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','parentFolder','66pvgujF','Resolving\x20path\x20\x27','Executing\x20segment\x20query...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20SQL\x20from\x20rule...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','listFolders','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','parentId','log','1126392RRsoCW','resolveFolderId','\x27...','getSegmentSQL','Use:\x20tdx\x20ps\x20desc','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','folder','Segment\x20ID\x20missing\x20from\x20resolved\x20path','jsonl','parentSegment','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','information_schema','json','Use:\x20tdx\x20ps\x20view\x20-w','SEGMENT_NOT_FOUND','resolvePathToResource','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','execute','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','query','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Target\x20path:\x20','description','getSQLFromYamlFile','Parent\x20ID:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segment:desc','fullPath','type','in\x20','3325936vjpFBm','jobId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Show\x20folder\x20or\x20child\x20segment\x20details','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20folder\x20\x27','Resolved\x20type:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','5013wyEAzq','/e/','\x20Opening\x20','/app/ps/','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20view','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','format','segment:folder:show','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','✖\x20Query\x20failed\x20[','path','Error:\x20','Resolved\x20YAML\x20file:\x20','folderPath','parent','Show\x20segment\x20or\x20folder\x20details','test','\x20[Job\x20ID:\x20','Resolving\x20\x27','Folder\x20name:\x20','2390YkYVLR','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Examples:','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','red','replace','11kuOJQN','message','segmentName','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','stats','Folder\x20ID\x20missing\x20from\x20resolved\x20path','getSegmentSQLFromYaml','218ByIUaL','(root)','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','228nuzycj','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20for\x20segment...','getSQLFromServerSegment','Listing\x20folders\x20for\x20parent\x20\x27','getParent','createFolder','Parent\x20name:\x20','limit','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolved\x20parent\x20ID:\x20','segment','Resolved\x20folder\x20ID:\x20','Folder\x20ID:\x20','Fetching\x20folder\x20details...','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','9129phLClA','processedRows','elapsedTimeMillis','Options:','Error:\x20Folder\x20reference\x20is\x20required','web','\x20\x20Parent\x20segment:\x20','segmentPath','error','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20ps\x20show','length','segment:show','\x20folder','site','data','SQL\x20query:\x0a','208401LXuxiO','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20sg\x20desc\x20<name>','name','38725OJQWPD','✔\x20Query\x20completed:\x20Processed\x20','getFolder','Usage:','code'];a36_0xcee7=function(){return _0x205487;};return a36_0xcee7();}import a36_0x234e0a from'chalk';async function resolveSegmentTarget(_0x31e382,_0x259f6d,_0xf4afb6){const _0x102cbe=a36_0x4310;if(isYamlFilePath(_0x31e382))try{const _0x49b478=await resolveYamlFilePath(_0x31e382);return _0xf4afb6&&(console[_0x102cbe(0x1d4)](_0x102cbe(0x24d)+_0x31e382),console[_0x102cbe(0x1d4)](_0x102cbe(0x1d2)+_0x49b478[_0x102cbe(0x218)]),console[_0x102cbe(0x1d4)]('\x20\x20Segment\x20name:\x20'+_0x49b478[_0x102cbe(0x1b2)]),console['error'](_0x102cbe(0x202)+(_0x49b478[_0x102cbe(0x24e)]||_0x102cbe(0x1b9))),console[_0x102cbe(0x1d4)]('\x20\x20Full\x20path:\x20'+_0x49b478[_0x102cbe(0x22d)])),_0x49b478['fullPath'];}catch(_0x2278bc){throw new SDKError(ErrorCode[_0x102cbe(0x1fb)],_0x102cbe(0x21f)+_0x2278bc[_0x102cbe(0x1b1)]);}if(!_0x259f6d)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x102cbe(0x236));return _0x259f6d+'/'+_0x31e382;}function a36_0x4310(_0x536513,_0x56d715){_0x536513=_0x536513-0x1a7;const _0xcee7ad=a36_0xcee7();let _0x4310b5=_0xcee7ad[_0x536513];return _0x4310b5;}export class SegmentDescribeCommand extends BaseCommand{['name']='segment:describe';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x250);async[a36_0x2a13a5(0x220)](_0x335595){const _0x11151a=a36_0x2a13a5,{options:_0x11442d,args:_0x2288f2,tdx:_0x5713b6}=_0x335595,_0x1fbb22=_0x2288f2[0x0],_0x3a74d9=!_0x1fbb22&&!!_0x11442d['parentSegment'],_0x5dbe10=_0x1fbb22||_0x11442d[_0x11151a(0x218)];if(!_0x5dbe10)return console[_0x11151a(0x1d4)](_0x11151a(0x1ff)),console[_0x11151a(0x1d4)](_0x11151a(0x1aa)),console['error'](_0x11151a(0x1a9)),console[_0x11151a(0x1d4)](_0x11151a(0x1ab)),console['error'](_0x11151a(0x208)),console[_0x11151a(0x1d4)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x11151a(0x1d4)](_0x11151a(0x1a7)),0x1;try{const _0x5df1cc=_0x11442d[_0x11151a(0x1d3)];let _0x447a94=_0x5dbe10;!_0x3a74d9&&_0x5df1cc&&!_0x5dbe10['includes']('/')&&(_0x447a94=_0x5df1cc+'/'+_0x5dbe10,_0x11442d[_0x11151a(0x1cb)]&&console[_0x11151a(0x1d4)](_0x11151a(0x1f8)+_0x447a94));const _0x90df0f=await withSpinner(_0x11151a(0x206)+_0x447a94+'\x27...',()=>_0x5713b6['segment'][_0x11151a(0x21e)](_0x447a94),{'verbose':_0x11442d[_0x11151a(0x1cb)]}),_0x9fcad4=_0x90df0f[_0x11151a(0x1dd)];_0x11442d[_0x11151a(0x1cb)]&&(console['error']('Resolved\x20type:\x20'+_0x9fcad4['type']),console['error'](_0x11151a(0x228)+_0x9fcad4[_0x11151a(0x20d)]),_0x9fcad4[_0x11151a(0x1f5)]&&console[_0x11151a(0x1d4)](_0x11151a(0x1c8)+_0x9fcad4[_0x11151a(0x1f5)]),_0x9fcad4[_0x11151a(0x1f0)]&&console[_0x11151a(0x1d4)]('Segment\x20ID:\x20'+_0x9fcad4[_0x11151a(0x1f0)]));if(_0x9fcad4['type']==='parent'){const _0x4d3b5b=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x5713b6['segment'][_0x11151a(0x1c0)](_0x9fcad4[_0x11151a(0x20d)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x4d3b5b[_0x11151a(0x1dd)],_0x11442d);}else{if(_0x9fcad4[_0x11151a(0x22e)]===_0x11151a(0x215)){if(!_0x9fcad4[_0x11151a(0x1f5)])throw new SDKError(ErrorCode[_0x11151a(0x1f7)],_0x11151a(0x1b6));const _0x157dea=await withSpinner(_0x11151a(0x1c9),()=>_0x5713b6[_0x11151a(0x1c6)][_0x11151a(0x1e5)](_0x9fcad4[_0x11151a(0x1f5)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x157dea[_0x11151a(0x1dd)],_0x11442d);}else{if(_0x9fcad4['type']===_0x11151a(0x1c6)){if(!_0x9fcad4[_0x11151a(0x1f0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x11151a(0x216));const _0x27de04=await withSpinner(_0x11151a(0x242),()=>_0x5713b6['segment'][_0x11151a(0x1e9)](_0x9fcad4[_0x11151a(0x20d)],_0x9fcad4[_0x11151a(0x1f0)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x27de04[_0x11151a(0x1dd)],_0x11442d);}}}return 0x0;}catch(_0x5847f5){if(_0x5847f5 instanceof SDKError)return console[_0x11151a(0x1d4)]('Error:\x20'+_0x5847f5[_0x11151a(0x1b1)]),_0x5847f5[_0x11151a(0x1ed)]&&console['error'](_0x11151a(0x22a)+_0x5847f5[_0x11151a(0x1ed)]),0x1;throw _0x5847f5;}}}export class SegmentShowCommand extends BaseCommand{['name']=a36_0x2a13a5(0x1da);[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1b3);async[a36_0x2a13a5(0x220)](_0x265dbe){const _0x1f62de=a36_0x2a13a5,{options:_0x544f29,args:_0x38540d,tdx:_0x114974}=_0x265dbe,_0x539a45=_0x38540d[0x0];if(!_0x539a45)return console[_0x1f62de(0x1d4)](_0x1f62de(0x1ac)),console[_0x1f62de(0x1d4)](_0x1f62de(0x203)),console[_0x1f62de(0x1d4)](_0x1f62de(0x246)),console[_0x1f62de(0x1d4)](_0x1f62de(0x1a9)),console['error'](_0x1f62de(0x1ad)),console[_0x1f62de(0x1d4)](_0x1f62de(0x224)),0x1;try{const _0x4cb7e0=_0x544f29['parentSegment'],_0x4c6163=await resolveSegmentTarget(_0x539a45,_0x4cb7e0,_0x544f29['verbose']);_0x544f29[_0x1f62de(0x1cb)]&&console[_0x1f62de(0x1d4)](_0x1f62de(0x225)+_0x4c6163);const _0x57fac2=await withSpinner('Resolving\x20\x27'+_0x539a45+_0x1f62de(0x211),()=>_0x114974['segment'][_0x1f62de(0x21e)](_0x4c6163),{'verbose':_0x544f29[_0x1f62de(0x1cb)]}),_0x32f0a0=_0x57fac2[_0x1f62de(0x1dd)];_0x544f29[_0x1f62de(0x1cb)]&&(console[_0x1f62de(0x1d4)](_0x1f62de(0x238)+_0x32f0a0['type']),console[_0x1f62de(0x1d4)](_0x1f62de(0x228)+_0x32f0a0[_0x1f62de(0x20d)]));if(_0x32f0a0['type']==='folder')return console[_0x1f62de(0x1d4)](_0x1f62de(0x245)),console[_0x1f62de(0x1d4)](_0x1f62de(0x1eb)),0x1;if(_0x32f0a0[_0x1f62de(0x22e)]===_0x1f62de(0x24f))return console[_0x1f62de(0x1d4)](_0x1f62de(0x1ea)),console['error'](_0x1f62de(0x1d8)),0x1;if(!_0x32f0a0[_0x1f62de(0x1f0)])throw new SDKError(ErrorCode[_0x1f62de(0x21d)],_0x1f62de(0x216));const _0x10296e=await withSpinner(_0x1f62de(0x1bd),()=>_0x114974[_0x1f62de(0x1c6)]['getSegmentSQL'](_0x32f0a0[_0x1f62de(0x20d)],_0x32f0a0[_0x1f62de(0x1f0)]),{'verbose':_0x544f29[_0x1f62de(0x1cb)]});let _0x14c116=_0x10296e['data'];const _0x5980c2=resolveLimit(_0x544f29[_0x1f62de(0x1c3)],DEFAULT_DISPLAY_LIMIT),_0x591df5=/\bLIMIT\s+\d+/i[_0x1f62de(0x251)](_0x14c116);!_0x591df5&&(_0x14c116=_0x14c116['trim']()[_0x1f62de(0x1af)](/;+$/,''),_0x14c116=_0x1f62de(0x1e0)+_0x14c116+_0x1f62de(0x1a8)+_0x5980c2);_0x544f29[_0x1f62de(0x1cb)]&&console[_0x1f62de(0x1d4)](_0x1f62de(0x1de)+_0x14c116);const _0x2f2c36=await withProgressSpinner(_0x1f62de(0x207),async _0x5e8c98=>{const _0x479d20=_0x1f62de,_0x4f78cd=await _0x114974[_0x479d20(0x222)][_0x479d20(0x220)](_0x14c116,{'catalog':'td','schema':_0x479d20(0x21a),'onJobId':_0x43d3bb=>{const _0x17c01b=_0x479d20;_0x5e8c98[_0x17c01b(0x1f2)](_0x43d3bb);}});return _0x4f78cd;},{'verbose':_0x544f29[_0x1f62de(0x1cb)]}),_0x133f14=_0x2f2c36[_0x1f62de(0x1dd)],_0x557f97=_0x133f14[_0x1f62de(0x231)]?_0x1f62de(0x252)+_0x133f14[_0x1f62de(0x231)]+']':'';return console[_0x1f62de(0x1d4)](_0x1f62de(0x1e4)+_0x133f14[_0x1f62de(0x1b5)][_0x1f62de(0x1cd)]['toLocaleString']()+'\x20rows\x20'+(_0x1f62de(0x22f)+formatElapsed(_0x133f14['stats'][_0x1f62de(0x1ce)])+_0x557f97)),await handleQueryOutput(_0x133f14,_0x544f29),0x0;}catch(_0x388594){if(_0x388594 instanceof SDKError)return console[_0x1f62de(0x1d4)](_0x1f62de(0x24a)+_0x388594[_0x1f62de(0x1e7)]+']'),console[_0x1f62de(0x1d4)]('\x0a'+_0x388594[_0x1f62de(0x1b1)]),0x1;throw _0x388594;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a36_0x2a13a5(0x226)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a36_0x2a13a5(0x220)](_0x2bb614){const _0x39667a=a36_0x2a13a5,{options:_0x38f6db,args:_0x2a666f,tdx:_0x2a235c}=_0x2bb614;if(_0x2a666f[_0x39667a(0x1d9)]===0x0)return console[_0x39667a(0x1d4)](_0x39667a(0x1ca)),console['error'](_0x39667a(0x221)),0x1;const _0x372c4b=_0x2a666f[0x0];try{_0x38f6db[_0x39667a(0x1cb)]&&(console[_0x39667a(0x1d4)](_0x39667a(0x1f6)+_0x38f6db[_0x39667a(0x1dc)]),console[_0x39667a(0x1d4)](_0x39667a(0x1c2)+_0x372c4b));const _0x1aeeeb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x372c4b+_0x39667a(0x211),()=>_0x2a235c['segment'][_0x39667a(0x1fc)](_0x372c4b),{'verbose':_0x38f6db[_0x39667a(0x1cb)]}),_0x5c5ea8=_0x1aeeeb[_0x39667a(0x1dd)];_0x38f6db[_0x39667a(0x1cb)]&&console[_0x39667a(0x1d4)](_0x39667a(0x1c5)+_0x5c5ea8);const _0xa2a001=await withSpinner(_0x39667a(0x1bf)+_0x372c4b+_0x39667a(0x211),()=>_0x2a235c[_0x39667a(0x1c6)][_0x39667a(0x20b)](_0x5c5ea8),{'verbose':_0x38f6db[_0x39667a(0x1cb)]}),_0x393347=_0xa2a001[_0x39667a(0x1dd)];return console[_0x39667a(0x1d4)]('✔\x20Found\x20'+_0x393347[_0x39667a(0x1d9)]+_0x39667a(0x1db)+(_0x393347[_0x39667a(0x1d9)]!==0x1?'s':'')),await handleSDKOutput(_0x393347,_0x38f6db),0x0;}catch(_0x39803f){if(_0x39803f instanceof SDKError)return console[_0x39667a(0x1d4)](_0x39667a(0x24c)+_0x39803f[_0x39667a(0x1b1)]),_0x39803f[_0x39667a(0x1ed)]&&console[_0x39667a(0x1d4)](_0x39667a(0x22a)+_0x39803f[_0x39667a(0x1ed)]),0x1;throw _0x39803f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a36_0x2a13a5(0x1e2)]=a36_0x2a13a5(0x248);[a36_0x2a13a5(0x226)]='Show\x20segment\x20folder\x20details';async[a36_0x2a13a5(0x220)](_0x34ae0d){const _0x508bcf=a36_0x2a13a5,{options:_0x9884f3,args:_0x52e413,tdx:_0x4fd324}=_0x34ae0d;if(_0x52e413[_0x508bcf(0x1d9)]===0x0)return console[_0x508bcf(0x1d4)](_0x508bcf(0x1d0)),console['error'](_0x508bcf(0x234)),0x1;try{const {parentId:_0x10f0a4,childId:_0x126e2a}=parseSegmentRef(_0x52e413[0x0]);_0x9884f3[_0x508bcf(0x1cb)]&&(console[_0x508bcf(0x1d4)](_0x508bcf(0x1f6)+_0x9884f3['site']),console[_0x508bcf(0x1d4)](_0x508bcf(0x1c2)+_0x10f0a4),_0x126e2a&&console[_0x508bcf(0x1d4)](_0x508bcf(0x254)+_0x126e2a));if(!_0x126e2a)return console[_0x508bcf(0x1d4)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x37a8c0=await withSpinner(_0x508bcf(0x244)+_0x10f0a4+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x1fc)](_0x10f0a4),{'verbose':_0x9884f3[_0x508bcf(0x1cb)]}),_0x201974=_0x37a8c0[_0x508bcf(0x1dd)];_0x9884f3['verbose']&&console[_0x508bcf(0x1d4)](_0x508bcf(0x1c5)+_0x201974);const _0x48c09d=await withSpinner(_0x508bcf(0x237)+_0x126e2a+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x210)](_0x201974,_0x126e2a),{'verbose':_0x9884f3['verbose']}),_0x382f9a=_0x48c09d[_0x508bcf(0x1dd)];_0x9884f3[_0x508bcf(0x1cb)]&&console[_0x508bcf(0x1d4)](_0x508bcf(0x1c7)+_0x382f9a);const _0x525818=await withSpinner('Fetching\x20folder\x20\x27'+_0x126e2a+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x1e5)](_0x382f9a),{'verbose':_0x9884f3[_0x508bcf(0x1cb)]});return await handleSDKOutput([_0x525818[_0x508bcf(0x1dd)]],_0x9884f3),0x0;}catch(_0x8de2a7){if(_0x8de2a7 instanceof SDKError)return console[_0x508bcf(0x1d4)]('Error:\x20'+_0x8de2a7[_0x508bcf(0x1b1)]),_0x8de2a7[_0x508bcf(0x1ed)]&&console[_0x508bcf(0x1d4)](_0x508bcf(0x22a)+_0x8de2a7[_0x508bcf(0x1ed)]),0x1;throw _0x8de2a7;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a36_0x2a13a5(0x1ef);[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1fa);async['execute'](_0x109ca7){const _0x1a175d=a36_0x2a13a5,{options:_0x3b3f6,args:_0x37a6ae}=_0x109ca7,_0x3a06c5=_0x3b3f6,_0x18755b=_0x3a06c5[_0x1a175d(0x24b)],_0x29b792=_0x37a6ae[0x0];if(!_0x29b792&&!_0x18755b)return console[_0x1a175d(0x1d4)](a36_0x234e0a[_0x1a175d(0x1ae)](_0x1a175d(0x20c))),console[_0x1a175d(0x1d4)](_0x1a175d(0x1e6)),console[_0x1a175d(0x1d4)](_0x1a175d(0x1f3)),console[_0x1a175d(0x1d4)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console['error']('Examples:'),console['error'](_0x1a175d(0x22b)),console[_0x1a175d(0x1d4)](_0x1a175d(0x1bc)),0x1;if(_0x29b792&&_0x18755b)return console[_0x1a175d(0x1d4)](a36_0x234e0a['red'](_0x1a175d(0x229))),0x1;try{let _0x5eaf9;if(_0x18755b)_0x5eaf9=await this[_0x1a175d(0x227)](_0x18755b,_0x109ca7);else{if(isYamlFilePath(_0x29b792))return console[_0x1a175d(0x1d4)](a36_0x234e0a['red'](_0x1a175d(0x239))),console[_0x1a175d(0x1d4)](_0x1a175d(0x1c4)+_0x29b792),0x1;else _0x5eaf9=await this[_0x1a175d(0x1be)](_0x29b792,_0x109ca7);}return _0x3b3f6[_0x1a175d(0x247)]===_0x1a175d(0x21b)||_0x3b3f6['format']===_0x1a175d(0x217)?await handleSDKOutput([{'sql':_0x5eaf9}],_0x3b3f6):console[_0x1a175d(0x20e)](_0x5eaf9),0x0;}catch(_0x10e502){if(_0x10e502 instanceof SDKError)return console[_0x1a175d(0x1d4)](_0x1a175d(0x24c)+_0x10e502['message']),_0x10e502[_0x1a175d(0x1ed)]&&console[_0x1a175d(0x1d4)]('\x20\x20Cause:\x20'+_0x10e502[_0x1a175d(0x1ed)]),0x1;throw _0x10e502;}}async[a36_0x2a13a5(0x227)](_0xfa6f34,_0x5209a1){const _0x1edb5c=a36_0x2a13a5,{options:_0x304975,tdx:_0x1ed468}=_0x5209a1;let _0x5b2398;try{_0x5b2398=await resolveYamlFilePath(_0xfa6f34);}catch(_0x3a9f83){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1edb5c(0x21f)+_0x3a9f83[_0x1edb5c(0x1b1)]);}_0x304975['verbose']&&console[_0x1edb5c(0x1d4)]('Resolved:\x20'+_0x5b2398[_0x1edb5c(0x218)]+'/'+_0x5b2398['segmentName']);const _0x533bb3=await withSpinner(_0x1edb5c(0x209),()=>_0x1ed468[_0x1edb5c(0x1c6)][_0x1edb5c(0x1b7)](_0x5b2398['content'],_0x5b2398[_0x1edb5c(0x218)],_0x5b2398[_0x1edb5c(0x1b2)]),{'verbose':_0x304975[_0x1edb5c(0x1cb)]});return _0x533bb3[_0x1edb5c(0x1dd)];}async[a36_0x2a13a5(0x1be)](_0x5eaceb,_0x36ff44){const _0x6f43f6=a36_0x2a13a5,{options:_0x159934,tdx:_0x14c6b9}=_0x36ff44,_0x37b80e=_0x159934[_0x6f43f6(0x218)],_0x22b4b3=await resolveSegmentTarget(_0x5eaceb,_0x37b80e,_0x159934['verbose']);_0x159934['verbose']&&console[_0x6f43f6(0x1d4)]('Target\x20path:\x20'+_0x22b4b3);const _0x9b4a98=await withSpinner(_0x6f43f6(0x253)+_0x5eaceb+_0x6f43f6(0x211),()=>_0x14c6b9[_0x6f43f6(0x1c6)][_0x6f43f6(0x21e)](_0x22b4b3),{'verbose':_0x159934[_0x6f43f6(0x1cb)]}),_0x16d460=_0x9b4a98['data'];_0x159934[_0x6f43f6(0x1cb)]&&(console[_0x6f43f6(0x1d4)](_0x6f43f6(0x238)+_0x16d460['type']),console[_0x6f43f6(0x1d4)](_0x6f43f6(0x228)+_0x16d460[_0x6f43f6(0x20d)]));if(_0x16d460[_0x6f43f6(0x22e)]==='folder')throw new SDKError(ErrorCode[_0x6f43f6(0x1fb)],_0x6f43f6(0x1ba));if(_0x16d460[_0x6f43f6(0x22e)]===_0x6f43f6(0x24f))throw new SDKError(ErrorCode[_0x6f43f6(0x1fb)],_0x6f43f6(0x249));if(!_0x16d460['segmentId'])throw new SDKError(ErrorCode[_0x6f43f6(0x21d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2be914=await withSpinner(_0x6f43f6(0x1bd),()=>_0x14c6b9[_0x6f43f6(0x1c6)]['getSegmentSQL'](_0x16d460['parentId'],_0x16d460[_0x6f43f6(0x1f0)]),{'verbose':_0x159934['verbose']});return _0x2be914[_0x6f43f6(0x1dd)];}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1ee);async[a36_0x2a13a5(0x220)](_0x2e27a6){const _0x240df1=a36_0x2a13a5,{options:_0x294fee,args:_0x3fd184,tdx:_0x40911f}=_0x2e27a6,_0x11eb45=_0x294fee;if(_0x3fd184['length']<0x2)return console[_0x240df1(0x1d4)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x240df1(0x1d6)),0x1;const _0x35798f=_0x3fd184[0x0],_0x5ce0cd=_0x3fd184[0x1];_0x11eb45[_0x240df1(0x1cb)]&&(console[_0x240df1(0x1d4)](_0x240df1(0x1f6)+_0x11eb45['site']),console[_0x240df1(0x1d4)](_0x240df1(0x1f4)+_0x35798f),console['error'](_0x240df1(0x254)+_0x5ce0cd));let _0x355283;if(_0x11eb45[_0x240df1(0x204)]){const _0xde6c3=_0x11eb45['parentFolder'],_0x105e6f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x35798f+'\x27...',()=>_0x40911f['segment'][_0x240df1(0x1fc)](_0x35798f),{'verbose':_0x11eb45['verbose']}),_0x3935ac=_0x105e6f[_0x240df1(0x1dd)],_0x1bd0ac=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0xde6c3+_0x240df1(0x211),()=>_0x40911f[_0x240df1(0x1c6)]['resolveFolderId'](_0x3935ac,_0xde6c3),{'verbose':_0x11eb45[_0x240df1(0x1cb)]});_0x355283=_0x1bd0ac['data'],_0x11eb45[_0x240df1(0x1cb)]&&console[_0x240df1(0x1d4)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x355283);}const _0x4b5fac={'name':_0x5ce0cd,'description':_0x11eb45[_0x240df1(0x226)],'parentFolderId':_0x355283},_0x153ae5=await withSpinner(_0x240df1(0x1ec)+_0x5ce0cd+_0x240df1(0x211),()=>_0x40911f['segment'][_0x240df1(0x1c1)](_0x35798f,_0x4b5fac),{'verbose':_0x11eb45[_0x240df1(0x1cb)]}),_0x38b7fb=_0x153ae5['data'];return console[_0x240df1(0x1d4)]('✔\x20Created\x20folder\x20\x27'+_0x38b7fb[_0x240df1(0x1e2)]+_0x240df1(0x200)+_0x38b7fb['id']),await handleSDKOutput([_0x38b7fb],_0x11eb45),0x0;}}export class SegmentViewCommand extends BaseCommand{[a36_0x2a13a5(0x1e2)]='segment:view';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x235);async[a36_0x2a13a5(0x220)](_0x12b69e){const _0x2e8ca3=a36_0x2a13a5,{options:_0x4c87b6,args:_0x1406a1,tdx:_0x1fcb54}=_0x12b69e,_0x3d6a9c=_0x1406a1[0x0];if(!_0x3d6a9c)return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x232)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1f9)),console[_0x2e8ca3(0x1d4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1cf)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1b4)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1a9)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x233)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x20a)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x23e)),console['error'](_0x2e8ca3(0x1f1)),0x1;try{const _0x42dcf6=_0x4c87b6[_0x2e8ca3(0x218)],_0x350a82=await resolveSegmentTarget(_0x3d6a9c,_0x42dcf6,_0x4c87b6[_0x2e8ca3(0x1cb)]);_0x4c87b6[_0x2e8ca3(0x1cb)]&&console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x225)+_0x350a82);const _0x498f55=await withSpinner(_0x2e8ca3(0x253)+_0x3d6a9c+_0x2e8ca3(0x211),()=>_0x1fcb54[_0x2e8ca3(0x1c6)][_0x2e8ca3(0x21e)](_0x350a82),{'verbose':_0x4c87b6[_0x2e8ca3(0x1cb)]}),_0x49aaf6=_0x498f55['data'];_0x4c87b6[_0x2e8ca3(0x1cb)]&&(console[_0x2e8ca3(0x1d4)]('Resolved\x20type:\x20'+_0x49aaf6[_0x2e8ca3(0x22e)]),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x228)+_0x49aaf6[_0x2e8ca3(0x20d)]),_0x49aaf6[_0x2e8ca3(0x1f5)]&&console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1c8)+_0x49aaf6['folderId']),_0x49aaf6[_0x2e8ca3(0x1f0)]&&console[_0x2e8ca3(0x1d4)]('Segment\x20ID:\x20'+_0x49aaf6['segmentId']));if(_0x4c87b6[_0x2e8ca3(0x1d1)]){if(_0x49aaf6[_0x2e8ca3(0x22e)]==='folder')return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1d7)),0x1;if(_0x49aaf6['type']===_0x2e8ca3(0x24f))return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1d5)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x21c)),0x1;if(!_0x49aaf6[_0x2e8ca3(0x1f0)])throw new SDKError(ErrorCode[_0x2e8ca3(0x21d)],_0x2e8ca3(0x216));const _0x1aa478=getConsoleNextUrl(_0x4c87b6[_0x2e8ca3(0x1dc)],_0x2e8ca3(0x23d)+_0x49aaf6[_0x2e8ca3(0x20d)]+_0x2e8ca3(0x23b)+_0x49aaf6[_0x2e8ca3(0x1f0)]);return console[_0x2e8ca3(0x1d4)](a36_0x234e0a[_0x2e8ca3(0x1fe)]('✔')+_0x2e8ca3(0x23c)+a36_0x234e0a['cyan'](_0x1aa478)),openBrowser(_0x1aa478),0x0;}if(_0x49aaf6[_0x2e8ca3(0x22e)]==='folder'){if(!_0x49aaf6[_0x2e8ca3(0x1f5)])throw new SDKError(ErrorCode[_0x2e8ca3(0x1f7)],_0x2e8ca3(0x1b6));const _0xa56a9e=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1fcb54['segment'][_0x2e8ca3(0x1e5)](_0x49aaf6[_0x2e8ca3(0x1f5)]),{'verbose':_0x4c87b6[_0x2e8ca3(0x1cb)]});await handleSingleObjectOutput(_0xa56a9e[_0x2e8ca3(0x1dd)],_0x4c87b6);}else{if(_0x49aaf6[_0x2e8ca3(0x22e)]===_0x2e8ca3(0x1c6)){if(!_0x49aaf6[_0x2e8ca3(0x1f0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2e8ca3(0x216));const _0x55aa2c=await withSpinner(_0x2e8ca3(0x242),()=>_0x1fcb54[_0x2e8ca3(0x1c6)][_0x2e8ca3(0x1e9)](_0x49aaf6[_0x2e8ca3(0x20d)],_0x49aaf6[_0x2e8ca3(0x1f0)]),{'verbose':_0x4c87b6['verbose']}),_0x3eefee=getConsoleNextUrl(_0x4c87b6['site'],_0x2e8ca3(0x23d)+_0x49aaf6[_0x2e8ca3(0x20d)]+_0x2e8ca3(0x23b)+_0x49aaf6[_0x2e8ca3(0x1f0)]),_0x5973e6=_0x55aa2c[_0x2e8ca3(0x1dd)];_0x5973e6[_0x2e8ca3(0x1e8)]=_0x3eefee,await handleSingleObjectOutput(_0x5973e6,_0x4c87b6);}else return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x201)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x241)),0x1;}return 0x0;}catch(_0x455005){if(_0x455005 instanceof SDKError)return console[_0x2e8ca3(0x1d4)]('Error:\x20'+_0x455005['message']),_0x455005[_0x2e8ca3(0x1ed)]&&console[_0x2e8ca3(0x1d4)]('\x20\x20Cause:\x20'+_0x455005['cause']),0x1;throw _0x455005;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a36_0x2a13a5(0x22c);[a36_0x2a13a5(0x226)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a36_0x2a13a5(0x220)](_0x5005a7){const _0x329867=a36_0x2a13a5,{options:_0x306103,args:_0x5391b9,tdx:_0x5bab0c}=_0x5005a7,_0x3aff3d=_0x5391b9[0x0];if(!_0x3aff3d)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x329867(0x1d4)](_0x329867(0x1e1)),console[_0x329867(0x1d4)](_0x329867(0x240)),console[_0x329867(0x1d4)](_0x329867(0x1a9)),console[_0x329867(0x1d4)](_0x329867(0x214)),console[_0x329867(0x1d4)](_0x329867(0x243)),0x1;try{const _0x29ebb0=_0x306103['parentSegment'],_0x2103d4=await resolveSegmentTarget(_0x3aff3d,_0x29ebb0,_0x306103[_0x329867(0x1cb)]);_0x306103[_0x329867(0x1cb)]&&console[_0x329867(0x1d4)](_0x329867(0x225)+_0x2103d4);const _0x4007d=await withSpinner(_0x329867(0x253)+_0x3aff3d+_0x329867(0x211),()=>_0x5bab0c[_0x329867(0x1c6)][_0x329867(0x21e)](_0x2103d4),{'verbose':_0x306103['verbose']}),_0x1ed104=_0x4007d[_0x329867(0x1dd)];_0x306103[_0x329867(0x1cb)]&&(console[_0x329867(0x1d4)](_0x329867(0x238)+_0x1ed104[_0x329867(0x22e)]),console[_0x329867(0x1d4)](_0x329867(0x228)+_0x1ed104[_0x329867(0x20d)]));if(_0x1ed104['type']===_0x329867(0x215))return console[_0x329867(0x1d4)](_0x329867(0x223)),console[_0x329867(0x1d4)](_0x329867(0x23f)),0x1;if(_0x1ed104[_0x329867(0x22e)]===_0x329867(0x24f))return console['error'](_0x329867(0x219)),console[_0x329867(0x1d4)](_0x329867(0x213)),0x1;if(!_0x1ed104[_0x329867(0x1f0)])throw new SDKError(ErrorCode[_0x329867(0x21d)],_0x329867(0x216));const _0x39528a=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5bab0c[_0x329867(0x1c6)][_0x329867(0x212)](_0x1ed104[_0x329867(0x20d)],_0x1ed104[_0x329867(0x1f0)]),{'verbose':_0x306103[_0x329867(0x1cb)]}),_0x502217=_0x39528a[_0x329867(0x1dd)],_0x550b10=await executeSchemaQuery(_0x502217,_0x5bab0c,_0x306103);return await handleQueryOutput(_0x550b10,_0x306103),0x0;}catch(_0x3157b7){if(_0x3157b7 instanceof SDKError)return console['error']('Error:\x20'+_0x3157b7[_0x329867(0x1b1)]),_0x3157b7['cause']&&console[_0x329867(0x1d4)]('\x20\x20Cause:\x20'+_0x3157b7[_0x329867(0x1ed)]),0x1;throw _0x3157b7;}}}
|
|
1
|
+
const a36_0x18f4a0=a36_0x2864;(function(_0x1001b1,_0x2bb37e){const _0x2c003d=a36_0x2864,_0x138ee5=_0x1001b1();while(!![]){try{const _0x4eb33c=parseInt(_0x2c003d(0x14a))/0x1*(-parseInt(_0x2c003d(0x118))/0x2)+parseInt(_0x2c003d(0xe2))/0x3+parseInt(_0x2c003d(0x119))/0x4+parseInt(_0x2c003d(0xb7))/0x5*(parseInt(_0x2c003d(0x100))/0x6)+-parseInt(_0x2c003d(0xe4))/0x7*(parseInt(_0x2c003d(0x145))/0x8)+-parseInt(_0x2c003d(0x126))/0x9+parseInt(_0x2c003d(0xc5))/0xa;if(_0x4eb33c===_0x2bb37e)break;else _0x138ee5['push'](_0x138ee5['shift']());}catch(_0x35bdd3){_0x138ee5['push'](_0x138ee5['shift']());}}}(a36_0x5a7e,0xdb587));function a36_0x2864(_0x33b044,_0x4a122c){_0x33b044=_0x33b044-0xaf;const _0x5a7e26=a36_0x5a7e();let _0x2864fc=_0x5a7e26[_0x33b044];return _0x2864fc;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a36_0x5a7e(){const _0x65104f=['2113140gbMvFf','✔\x20Created\x20folder\x20\x27','Resolved:\x20','parentFolder','Fetching\x20SQL\x20for\x20segment...','Folder\x20name:\x20','Resolving\x20folder\x20\x27','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','getFolder','14314113nUyDmE','SEGMENT_NOT_FOUND','Fetching\x20folder\x20details...','type','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Creating\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','trim','verbose','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Use:\x20tdx\x20ps\x20view','segmentName','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Parent\x20segment:\x20','\x20Opening\x20','folder','\x20folder','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20','\x20\x20Segment\x20name:\x20','listFolders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20parent\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20Cause:\x20','segment:view','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Folder\x20path:\x20','1256OoYCyG','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','/app/ps/','segment','Parent\x20ID:\x20','45NGyGMk','SEGMENT_FOLDER_NOT_FOUND','segment:describe','cause','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','information_schema','Target\x20path:\x20','\x27...','5ulHCAI','toLocaleString','processedRows','segment:sql','stats','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Error:\x20Folder\x20reference\x20is\x20required','createFolder','Usage:','Show\x20child\x20segment\x20schema\x20(column\x20types)','data','log','fullPath','Parent\x20name:\x20','28476800kVBJEU','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','length','Use:\x20tdx\x20ps\x20desc','getSegment','Folder\x20ID:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','getSQLFromYamlFile','Error:\x20Path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','resolvePathToResource','includes','Segment\x20ID:\x20','parent','Resolving\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','elapsedTimeMillis','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20parent\x20segment\x20details...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','folderId','SELECT\x20*\x20FROM\x20(\x0a','Show\x20folder\x20or\x20child\x20segment\x20details','site','Site:\x20','segment:folder:show','red','Resolving\x20parent\x20segment\x20\x27','3236436bZnekT','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','33418XeZwQd','name','in\x20','/e/','folderPath','content','cyan','segment:show','getSegmentSQL','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Parent\x20segment:\x20','parentId','green','Fetching\x20segment\x20details...','query','Use:\x20tdx\x20ps\x20show','(root)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','setJobId','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','error','format','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','json','replace','segment:folder:create','2667522svvsWC','resolveFolderId','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','message','Resolved\x20type:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','execute','\x20\x20tdx\x20sg\x20sql\x20--path\x20','✖\x20Query\x20failed\x20[','Fetching\x20SQL\x20from\x20rule...','Create\x20segment\x20folder\x20for\x20organization','parentSegment','resolveParentId','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','getSQLFromServerSegment','description','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','SQL\x20query:\x0a','getSegmentSQLFromYaml','jobId','Examples:','73820boSkTJ'];a36_0x5a7e=function(){return _0x65104f;};return a36_0x5a7e();}import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a36_0x132e25 from'chalk';async function resolveSegmentTarget(_0x436a48,_0x3c1073,_0x2509cb){const _0x54eebf=a36_0x2864;if(isYamlFilePath(_0x436a48))try{const _0x52172b=await resolveYamlFilePath(_0x436a48);return _0x2509cb&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x436a48),console[_0x54eebf(0xf9)](_0x54eebf(0x135)+_0x52172b['parentSegment']),console[_0x54eebf(0xf9)](_0x54eebf(0x13b)+_0x52172b[_0x54eebf(0x133)]),console['error'](_0x54eebf(0x144)+(_0x52172b[_0x54eebf(0xe8)]||_0x54eebf(0xf4))),console[_0x54eebf(0xf9)]('\x20\x20Full\x20path:\x20'+_0x52172b[_0x54eebf(0xc3)])),_0x52172b[_0x54eebf(0xc3)];}catch(_0x270b76){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x270b76['message']);}if(!_0x3c1073)throw new SDKError(ErrorCode[_0x54eebf(0x122)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x3c1073+'/'+_0x436a48;}export class SegmentDescribeCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xb0);['description']='Show\x20segment\x20or\x20folder\x20details';async[a36_0x18f4a0(0x109)](_0x39e71e){const _0x11e119=a36_0x18f4a0,{options:_0x4401ca,args:_0x2cad44,tdx:_0x3f06c3}=_0x39e71e,_0x43a865=_0x2cad44[0x0],_0x16a07f=!_0x43a865&&!!_0x4401ca[_0x11e119(0x10e)],_0x121b3c=_0x43a865||_0x4401ca[_0x11e119(0x10e)];if(!_0x121b3c)return console[_0x11e119(0xf9)](_0x11e119(0xcd)),console['error'](_0x11e119(0x121)),console[_0x11e119(0xf9)](_0x11e119(0x117)),console[_0x11e119(0xf9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x11e119(0xf9)](_0x11e119(0x106)),console[_0x11e119(0xf9)](_0x11e119(0x146)),console[_0x11e119(0xf9)](_0x11e119(0xd9)),0x1;try{const _0x207ee4=_0x4401ca['segmentPath'];let _0x408d03=_0x121b3c;!_0x16a07f&&_0x207ee4&&!_0x121b3c[_0x11e119(0xd1)]('/')&&(_0x408d03=_0x207ee4+'/'+_0x121b3c,_0x4401ca[_0x11e119(0x130)]&&console[_0x11e119(0xf9)](_0x11e119(0x12d)+_0x408d03));const _0x486cad=await withSpinner('Resolving\x20path\x20\x27'+_0x408d03+_0x11e119(0xb6),()=>_0x3f06c3[_0x11e119(0x148)][_0x11e119(0xd0)](_0x408d03),{'verbose':_0x4401ca[_0x11e119(0x130)]}),_0x13c9c5=_0x486cad[_0x11e119(0xc1)];_0x4401ca[_0x11e119(0x130)]&&(console['error'](_0x11e119(0x104)+_0x13c9c5[_0x11e119(0x129)]),console[_0x11e119(0xf9)](_0x11e119(0x149)+_0x13c9c5[_0x11e119(0xef)]),_0x13c9c5[_0x11e119(0xda)]&&console[_0x11e119(0xf9)](_0x11e119(0xca)+_0x13c9c5[_0x11e119(0xda)]),_0x13c9c5[_0x11e119(0x107)]&&console[_0x11e119(0xf9)](_0x11e119(0xd2)+_0x13c9c5[_0x11e119(0x107)]));if(_0x13c9c5[_0x11e119(0x129)]==='parent'){const _0x12251f=await withSpinner(_0x11e119(0xd8),()=>_0x3f06c3['segment']['getParent'](_0x13c9c5['parentId']),{'verbose':_0x4401ca[_0x11e119(0x130)]});await handleSingleObjectOutput(_0x12251f[_0x11e119(0xc1)],_0x4401ca);}else{if(_0x13c9c5[_0x11e119(0x129)]===_0x11e119(0x137)){if(!_0x13c9c5['folderId'])throw new SDKError(ErrorCode[_0x11e119(0xaf)],_0x11e119(0x12c));const _0x21c757=await withSpinner(_0x11e119(0x128),()=>_0x3f06c3[_0x11e119(0x148)][_0x11e119(0x125)](_0x13c9c5[_0x11e119(0xda)]),{'verbose':_0x4401ca[_0x11e119(0x130)]});await handleSingleObjectOutput(_0x21c757['data'],_0x4401ca);}else{if(_0x13c9c5[_0x11e119(0x129)]===_0x11e119(0x148)){if(!_0x13c9c5['segmentId'])throw new SDKError(ErrorCode[_0x11e119(0x127)],_0x11e119(0x134));const _0x219c0a=await withSpinner(_0x11e119(0xf1),()=>_0x3f06c3[_0x11e119(0x148)][_0x11e119(0xc9)](_0x13c9c5[_0x11e119(0xef)],_0x13c9c5[_0x11e119(0x107)]),{'verbose':_0x4401ca[_0x11e119(0x130)]});await handleSingleObjectOutput(_0x219c0a[_0x11e119(0xc1)],_0x4401ca);}}}return 0x0;}catch(_0x75f77f){if(_0x75f77f instanceof SDKError)return console[_0x11e119(0xf9)](_0x11e119(0x13a)+_0x75f77f[_0x11e119(0x103)]),_0x75f77f[_0x11e119(0xb1)]&&console['error'](_0x11e119(0x141)+_0x75f77f[_0x11e119(0xb1)]),0x1;throw _0x75f77f;}}}export class SegmentShowCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xeb);[a36_0x18f4a0(0x112)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a36_0x18f4a0(0x109)](_0x30bb7b){const _0x35e415=a36_0x18f4a0,{options:_0xf15988,args:_0x27a779,tdx:_0x1cd92c}=_0x30bb7b,_0x143ab9=_0x27a779[0x0];if(!_0x143ab9)return console[_0x35e415(0xf9)](_0x35e415(0x12a)),console[_0x35e415(0xf9)](_0x35e415(0x105)),console[_0x35e415(0xf9)](_0x35e415(0x13d)),console['error']('Examples:'),console[_0x35e415(0xf9)](_0x35e415(0xe3)),console[_0x35e415(0xf9)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x523189=_0xf15988[_0x35e415(0x10e)],_0x356282=await resolveSegmentTarget(_0x143ab9,_0x523189,_0xf15988['verbose']);_0xf15988[_0x35e415(0x130)]&&console[_0x35e415(0xf9)](_0x35e415(0xb5)+_0x356282);const _0x2582c1=await withSpinner(_0x35e415(0xd4)+_0x143ab9+_0x35e415(0xb6),()=>_0x1cd92c[_0x35e415(0x148)][_0x35e415(0xd0)](_0x356282),{'verbose':_0xf15988[_0x35e415(0x130)]}),_0x421e54=_0x2582c1['data'];_0xf15988[_0x35e415(0x130)]&&(console[_0x35e415(0xf9)](_0x35e415(0x104)+_0x421e54[_0x35e415(0x129)]),console[_0x35e415(0xf9)]('Parent\x20ID:\x20'+_0x421e54[_0x35e415(0xef)]));if(_0x421e54[_0x35e415(0x129)]===_0x35e415(0x137))return console['error'](_0x35e415(0xd5)),console[_0x35e415(0xf9)](_0x35e415(0x13e)),0x1;if(_0x421e54[_0x35e415(0x129)]==='parent')return console[_0x35e415(0xf9)](_0x35e415(0xb3)),console['error'](_0x35e415(0xf3)),0x1;if(!_0x421e54['segmentId'])throw new SDKError(ErrorCode[_0x35e415(0x127)],_0x35e415(0x134));const _0x3c5fa9=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1cd92c[_0x35e415(0x148)][_0x35e415(0xec)](_0x421e54[_0x35e415(0xef)],_0x421e54[_0x35e415(0x107)]),{'verbose':_0xf15988[_0x35e415(0x130)]});let _0x431702=_0x3c5fa9['data'];const _0x5ac853=resolveLimit(_0xf15988['limit'],DEFAULT_DISPLAY_LIMIT),_0x376164=/\bLIMIT\s+\d+/i['test'](_0x431702);!_0x376164&&(_0x431702=_0x431702[_0x35e415(0x12f)]()[_0x35e415(0xfe)](/;+$/,''),_0x431702=_0x35e415(0xdb)+_0x431702+_0x35e415(0xcb)+_0x5ac853);_0xf15988[_0x35e415(0x130)]&&console[_0x35e415(0xf9)](_0x35e415(0x114)+_0x431702);const _0x2fd34f=await withProgressSpinner('Executing\x20segment\x20query...',async _0x1367f2=>{const _0x5acae3=_0x35e415,_0x16986b=await _0x1cd92c[_0x5acae3(0xf2)]['execute'](_0x431702,{'catalog':'td','schema':_0x5acae3(0xb4),'onJobId':_0x46d8d1=>{const _0x221159=_0x5acae3;_0x1367f2[_0x221159(0xf7)](_0x46d8d1);}});return _0x16986b;},{'verbose':_0xf15988[_0x35e415(0x130)]}),_0x427275=_0x2fd34f[_0x35e415(0xc1)],_0x29725b=_0x427275[_0x35e415(0x116)]?_0x35e415(0x120)+_0x427275[_0x35e415(0x116)]+']':'';return console[_0x35e415(0xf9)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x427275[_0x35e415(0xbb)][_0x35e415(0xb9)][_0x35e415(0xb8)]()+'\x20rows\x20'+(_0x35e415(0xe6)+formatElapsed(_0x427275[_0x35e415(0xbb)][_0x35e415(0xd6)])+_0x29725b)),await handleQueryOutput(_0x427275,_0xf15988),0x0;}catch(_0x1a846b){if(_0x1a846b instanceof SDKError)return console['error'](_0x35e415(0x10b)+_0x1a846b['code']+']'),console['error']('\x0a'+_0x1a846b[_0x35e415(0x103)]),0x1;throw _0x1a846b;}}}export class SegmentFolderListCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]='segment:folder:list';[a36_0x18f4a0(0x112)]=a36_0x18f4a0(0xce);async[a36_0x18f4a0(0x109)](_0x231b01){const _0x37dba8=a36_0x18f4a0,{options:_0x5d86b2,args:_0x24d903,tdx:_0x7d02db}=_0x231b01;if(_0x24d903[_0x37dba8(0xc7)]===0x0)return console[_0x37dba8(0xf9)](_0x37dba8(0x143)),console[_0x37dba8(0xf9)](_0x37dba8(0x113)),0x1;const _0x2a745c=_0x24d903[0x0];try{_0x5d86b2['verbose']&&(console['error'](_0x37dba8(0xde)+_0x5d86b2['site']),console['error']('Parent\x20name:\x20'+_0x2a745c));const _0x12c297=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2a745c+_0x37dba8(0xb6),()=>_0x7d02db[_0x37dba8(0x148)][_0x37dba8(0x10f)](_0x2a745c),{'verbose':_0x5d86b2[_0x37dba8(0x130)]}),_0x3d9cba=_0x12c297['data'];_0x5d86b2[_0x37dba8(0x130)]&&console[_0x37dba8(0xf9)]('Resolved\x20parent\x20ID:\x20'+_0x3d9cba);const _0x29a77b=await withSpinner(_0x37dba8(0xb2)+_0x2a745c+_0x37dba8(0xb6),()=>_0x7d02db[_0x37dba8(0x148)][_0x37dba8(0x13c)](_0x3d9cba),{'verbose':_0x5d86b2[_0x37dba8(0x130)]}),_0x10fbd3=_0x29a77b[_0x37dba8(0xc1)];return console['error']('✔\x20Found\x20'+_0x10fbd3[_0x37dba8(0xc7)]+_0x37dba8(0x138)+(_0x10fbd3[_0x37dba8(0xc7)]!==0x1?'s':'')),await handleSDKOutput(_0x10fbd3,_0x5d86b2),0x0;}catch(_0x4551b5){if(_0x4551b5 instanceof SDKError)return console[_0x37dba8(0xf9)](_0x37dba8(0x13a)+_0x4551b5[_0x37dba8(0x103)]),_0x4551b5[_0x37dba8(0xb1)]&&console[_0x37dba8(0xf9)](_0x37dba8(0x141)+_0x4551b5[_0x37dba8(0xb1)]),0x1;throw _0x4551b5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xdf);[a36_0x18f4a0(0x112)]='Show\x20segment\x20folder\x20details';async[a36_0x18f4a0(0x109)](_0x5edaed){const _0x501f8b=a36_0x18f4a0,{options:_0x48255a,args:_0x4ff787,tdx:_0x8844d}=_0x5edaed;if(_0x4ff787['length']===0x0)return console['error'](_0x501f8b(0xbd)),console['error'](_0x501f8b(0x140)),0x1;try{const {parentId:_0x2e5535,childId:_0x20c966}=parseSegmentRef(_0x4ff787[0x0]);_0x48255a[_0x501f8b(0x130)]&&(console['error'](_0x501f8b(0xde)+_0x48255a['site']),console[_0x501f8b(0xf9)](_0x501f8b(0xc4)+_0x2e5535),_0x20c966&&console[_0x501f8b(0xf9)](_0x501f8b(0x11e)+_0x20c966));if(!_0x20c966)return console[_0x501f8b(0xf9)](_0x501f8b(0xcf)),0x1;const _0x8e55f6=await withSpinner(_0x501f8b(0xe1)+_0x2e5535+'\x27...',()=>_0x8844d[_0x501f8b(0x148)][_0x501f8b(0x10f)](_0x2e5535),{'verbose':_0x48255a['verbose']}),_0x4f2b91=_0x8e55f6[_0x501f8b(0xc1)];_0x48255a[_0x501f8b(0x130)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x4f2b91);const _0x104434=await withSpinner(_0x501f8b(0x11f)+_0x20c966+'\x27...',()=>_0x8844d['segment'][_0x501f8b(0x101)](_0x4f2b91,_0x20c966),{'verbose':_0x48255a['verbose']}),_0x34dd4d=_0x104434[_0x501f8b(0xc1)];_0x48255a[_0x501f8b(0x130)]&&console[_0x501f8b(0xf9)]('Resolved\x20folder\x20ID:\x20'+_0x34dd4d);const _0x4d3b50=await withSpinner('Fetching\x20folder\x20\x27'+_0x20c966+_0x501f8b(0xb6),()=>_0x8844d[_0x501f8b(0x148)][_0x501f8b(0x125)](_0x34dd4d),{'verbose':_0x48255a[_0x501f8b(0x130)]});return await handleSDKOutput([_0x4d3b50['data']],_0x48255a),0x0;}catch(_0x3dd390){if(_0x3dd390 instanceof SDKError)return console[_0x501f8b(0xf9)](_0x501f8b(0x13a)+_0x3dd390[_0x501f8b(0x103)]),_0x3dd390['cause']&&console['error'](_0x501f8b(0x141)+_0x3dd390[_0x501f8b(0xb1)]),0x1;throw _0x3dd390;}}}export class SegmentSQLCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xba);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x2ff0af){const _0x18194c=a36_0x18f4a0,{options:_0x3c4a4d,args:_0x310e26}=_0x2ff0af,_0x289100=_0x3c4a4d,_0x9e5750=_0x289100['path'],_0x48b214=_0x310e26[0x0];if(!_0x48b214&&!_0x9e5750)return console['error'](a36_0x132e25['red']('Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required')),console[_0x18194c(0xf9)](_0x18194c(0xbf)),console[_0x18194c(0xf9)](_0x18194c(0xfc)),console[_0x18194c(0xf9)](_0x18194c(0x110)),console[_0x18194c(0xf9)]('Examples:'),console[_0x18194c(0xf9)](_0x18194c(0xf8)),console['error'](_0x18194c(0xbc)),0x1;if(_0x48b214&&_0x9e5750)return console[_0x18194c(0xf9)](a36_0x132e25[_0x18194c(0xe0)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x1a3cc9;if(_0x9e5750)_0x1a3cc9=await this[_0x18194c(0xcc)](_0x9e5750,_0x2ff0af);else{if(isYamlFilePath(_0x48b214))return console[_0x18194c(0xf9)](a36_0x132e25[_0x18194c(0xe0)](_0x18194c(0x131))),console[_0x18194c(0xf9)](_0x18194c(0x10a)+_0x48b214),0x1;else _0x1a3cc9=await this['getSQLFromServerSegment'](_0x48b214,_0x2ff0af);}return _0x3c4a4d[_0x18194c(0xfa)]===_0x18194c(0xfd)||_0x3c4a4d['format']==='jsonl'?await handleSDKOutput([{'sql':_0x1a3cc9}],_0x3c4a4d):console[_0x18194c(0xc2)](_0x1a3cc9),0x0;}catch(_0x3767a0){if(_0x3767a0 instanceof SDKError)return console[_0x18194c(0xf9)](_0x18194c(0x13a)+_0x3767a0[_0x18194c(0x103)]),_0x3767a0[_0x18194c(0xb1)]&&console['error']('\x20\x20Cause:\x20'+_0x3767a0[_0x18194c(0xb1)]),0x1;throw _0x3767a0;}}async[a36_0x18f4a0(0xcc)](_0xbfa5e7,_0x5893de){const _0x592ab4=a36_0x18f4a0,{options:_0x122b1a,tdx:_0x23056a}=_0x5893de;let _0x4e9b44;try{_0x4e9b44=await resolveYamlFilePath(_0xbfa5e7);}catch(_0xa58db2){throw new SDKError(ErrorCode[_0x592ab4(0x122)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xa58db2[_0x592ab4(0x103)]);}_0x122b1a[_0x592ab4(0x130)]&&console[_0x592ab4(0xf9)](_0x592ab4(0x11b)+_0x4e9b44[_0x592ab4(0x10e)]+'/'+_0x4e9b44['segmentName']);const _0x1ececc=await withSpinner(_0x592ab4(0x10c),()=>_0x23056a[_0x592ab4(0x148)][_0x592ab4(0x115)](_0x4e9b44[_0x592ab4(0xe9)],_0x4e9b44['parentSegment'],_0x4e9b44[_0x592ab4(0x133)]),{'verbose':_0x122b1a[_0x592ab4(0x130)]});return _0x1ececc[_0x592ab4(0xc1)];}async[a36_0x18f4a0(0x111)](_0x341c41,_0x1b88f5){const _0xd3c273=a36_0x18f4a0,{options:_0x407c3e,tdx:_0x33de31}=_0x1b88f5,_0x3daf87=_0x407c3e[_0xd3c273(0x10e)],_0x2170a9=await resolveSegmentTarget(_0x341c41,_0x3daf87,_0x407c3e['verbose']);_0x407c3e[_0xd3c273(0x130)]&&console[_0xd3c273(0xf9)](_0xd3c273(0xb5)+_0x2170a9);const _0x2f2540=await withSpinner(_0xd3c273(0xd4)+_0x341c41+_0xd3c273(0xb6),()=>_0x33de31[_0xd3c273(0x148)][_0xd3c273(0xd0)](_0x2170a9),{'verbose':_0x407c3e[_0xd3c273(0x130)]}),_0x4e9114=_0x2f2540[_0xd3c273(0xc1)];_0x407c3e[_0xd3c273(0x130)]&&(console['error'](_0xd3c273(0x104)+_0x4e9114[_0xd3c273(0x129)]),console[_0xd3c273(0xf9)](_0xd3c273(0x149)+_0x4e9114[_0xd3c273(0xef)]));if(_0x4e9114[_0xd3c273(0x129)]===_0xd3c273(0x137))throw new SDKError(ErrorCode[_0xd3c273(0x122)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x4e9114[_0xd3c273(0x129)]===_0xd3c273(0xd3))throw new SDKError(ErrorCode[_0xd3c273(0x122)],_0xd3c273(0x12e));if(!_0x4e9114[_0xd3c273(0x107)])throw new SDKError(ErrorCode[_0xd3c273(0x127)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3db9e9=await withSpinner(_0xd3c273(0x11d),()=>_0x33de31[_0xd3c273(0x148)][_0xd3c273(0xec)](_0x4e9114[_0xd3c273(0xef)],_0x4e9114[_0xd3c273(0x107)]),{'verbose':_0x407c3e['verbose']});return _0x3db9e9[_0xd3c273(0xc1)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xff);[a36_0x18f4a0(0x112)]=a36_0x18f4a0(0x10d);async[a36_0x18f4a0(0x109)](_0x229291){const _0x1c167a=a36_0x18f4a0,{options:_0x292551,args:_0x284ab1,tdx:_0x21024a}=_0x229291,_0x482ba6=_0x292551;if(_0x284ab1[_0x1c167a(0xc7)]<0x2)return console[_0x1c167a(0xf9)](_0x1c167a(0xd7)),console['error'](_0x1c167a(0x108)),0x1;const _0x822cf4=_0x284ab1[0x0],_0x4d1f29=_0x284ab1[0x1];_0x482ba6[_0x1c167a(0x130)]&&(console[_0x1c167a(0xf9)]('Site:\x20'+_0x482ba6['site']),console[_0x1c167a(0xf9)](_0x1c167a(0xee)+_0x822cf4),console['error'](_0x1c167a(0x11e)+_0x4d1f29));let _0x1b8076;if(_0x482ba6[_0x1c167a(0x11c)]){const _0x202807=_0x482ba6[_0x1c167a(0x11c)],_0x37f24a=await withSpinner(_0x1c167a(0xe1)+_0x822cf4+_0x1c167a(0xb6),()=>_0x21024a['segment'][_0x1c167a(0x10f)](_0x822cf4),{'verbose':_0x482ba6[_0x1c167a(0x130)]}),_0x25398a=_0x37f24a[_0x1c167a(0xc1)],_0x5c7b51=await withSpinner(_0x1c167a(0x13f)+_0x202807+_0x1c167a(0xb6),()=>_0x21024a['segment'][_0x1c167a(0x101)](_0x25398a,_0x202807),{'verbose':_0x482ba6[_0x1c167a(0x130)]});_0x1b8076=_0x5c7b51[_0x1c167a(0xc1)],_0x482ba6[_0x1c167a(0x130)]&&console[_0x1c167a(0xf9)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x1b8076);}const _0x5d22b5={'name':_0x4d1f29,'description':_0x482ba6[_0x1c167a(0x112)],'parentFolderId':_0x1b8076},_0xac5f6d=await withSpinner(_0x1c167a(0x12b)+_0x4d1f29+'\x27...',()=>_0x21024a[_0x1c167a(0x148)][_0x1c167a(0xbe)](_0x822cf4,_0x5d22b5),{'verbose':_0x482ba6[_0x1c167a(0x130)]}),_0x5eaa62=_0xac5f6d['data'];return console['error'](_0x1c167a(0x11a)+_0x5eaa62['name']+'\x27\x20with\x20ID:\x20'+_0x5eaa62['id']),await handleSDKOutput([_0x5eaa62],_0x482ba6),0x0;}}export class SegmentViewCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0x142);[a36_0x18f4a0(0x112)]=a36_0x18f4a0(0xdc);async[a36_0x18f4a0(0x109)](_0x32eb3b){const _0x23674a=a36_0x18f4a0,{options:_0x3af976,args:_0x33773a,tdx:_0x5f11fb}=_0x32eb3b,_0x153c5c=_0x33773a[0x0];if(!_0x153c5c)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x23674a(0xf9)](_0x23674a(0x124)),console['error'](_0x23674a(0xf5)),console[_0x23674a(0xf9)]('Options:'),console[_0x23674a(0xf9)](_0x23674a(0x139)),console[_0x23674a(0xf9)](_0x23674a(0x117)),console[_0x23674a(0xf9)](_0x23674a(0xc6)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x23674a(0xf9)](_0x23674a(0xed)),console[_0x23674a(0xf9)](_0x23674a(0x123)),0x1;try{const _0x1f044c=_0x3af976[_0x23674a(0x10e)],_0x37aa8e=await resolveSegmentTarget(_0x153c5c,_0x1f044c,_0x3af976[_0x23674a(0x130)]);_0x3af976[_0x23674a(0x130)]&&console[_0x23674a(0xf9)]('Target\x20path:\x20'+_0x37aa8e);const _0x2c32e5=await withSpinner(_0x23674a(0xd4)+_0x153c5c+_0x23674a(0xb6),()=>_0x5f11fb[_0x23674a(0x148)][_0x23674a(0xd0)](_0x37aa8e),{'verbose':_0x3af976[_0x23674a(0x130)]}),_0x5dfb6e=_0x2c32e5[_0x23674a(0xc1)];_0x3af976[_0x23674a(0x130)]&&(console[_0x23674a(0xf9)](_0x23674a(0x104)+_0x5dfb6e['type']),console[_0x23674a(0xf9)](_0x23674a(0x149)+_0x5dfb6e[_0x23674a(0xef)]),_0x5dfb6e['folderId']&&console[_0x23674a(0xf9)](_0x23674a(0xca)+_0x5dfb6e[_0x23674a(0xda)]),_0x5dfb6e[_0x23674a(0x107)]&&console[_0x23674a(0xf9)]('Segment\x20ID:\x20'+_0x5dfb6e[_0x23674a(0x107)]));if(_0x3af976['web']){if(_0x5dfb6e[_0x23674a(0x129)]===_0x23674a(0x137))return console[_0x23674a(0xf9)](_0x23674a(0xfb)),0x1;if(_0x5dfb6e['type']===_0x23674a(0xd3))return console[_0x23674a(0xf9)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x23674a(0xf9)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x5dfb6e['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x23674a(0x134));const _0x45c0c8=getConsoleNextUrl(_0x3af976[_0x23674a(0xdd)],_0x23674a(0x147)+_0x5dfb6e[_0x23674a(0xef)]+'/e/'+_0x5dfb6e['segmentId']);return console[_0x23674a(0xf9)](a36_0x132e25[_0x23674a(0xf0)]('✔')+_0x23674a(0x136)+a36_0x132e25[_0x23674a(0xea)](_0x45c0c8)),openBrowser(_0x45c0c8),0x0;}if(_0x5dfb6e[_0x23674a(0x129)]===_0x23674a(0x137)){if(!_0x5dfb6e[_0x23674a(0xda)])throw new SDKError(ErrorCode[_0x23674a(0xaf)],_0x23674a(0x12c));const _0x1308d2=await withSpinner(_0x23674a(0x128),()=>_0x5f11fb[_0x23674a(0x148)][_0x23674a(0x125)](_0x5dfb6e[_0x23674a(0xda)]),{'verbose':_0x3af976[_0x23674a(0x130)]});await handleSingleObjectOutput(_0x1308d2[_0x23674a(0xc1)],_0x3af976);}else{if(_0x5dfb6e[_0x23674a(0x129)]===_0x23674a(0x148)){if(!_0x5dfb6e['segmentId'])throw new SDKError(ErrorCode[_0x23674a(0x127)],_0x23674a(0x134));const _0x4ecac9=await withSpinner(_0x23674a(0xf1),()=>_0x5f11fb[_0x23674a(0x148)][_0x23674a(0xc9)](_0x5dfb6e[_0x23674a(0xef)],_0x5dfb6e['segmentId']),{'verbose':_0x3af976['verbose']}),_0x19c60d=getConsoleNextUrl(_0x3af976[_0x23674a(0xdd)],_0x23674a(0x147)+_0x5dfb6e[_0x23674a(0xef)]+_0x23674a(0xe7)+_0x5dfb6e[_0x23674a(0x107)]),_0x417284=_0x4ecac9[_0x23674a(0xc1)];_0x417284['url']=_0x19c60d,await handleSingleObjectOutput(_0x417284,_0x3af976);}else return console[_0x23674a(0xf9)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x23674a(0xf9)](_0x23674a(0x132)),0x1;}return 0x0;}catch(_0x22fe86){if(_0x22fe86 instanceof SDKError)return console['error'](_0x23674a(0x13a)+_0x22fe86[_0x23674a(0x103)]),_0x22fe86[_0x23674a(0xb1)]&&console[_0x23674a(0xf9)](_0x23674a(0x141)+_0x22fe86[_0x23674a(0xb1)]),0x1;throw _0x22fe86;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a36_0x18f4a0(0x112)]=a36_0x18f4a0(0xc0);async[a36_0x18f4a0(0x109)](_0x4a78d7){const _0x1bee4a=a36_0x18f4a0,{options:_0x25daaa,args:_0x39b5ab,tdx:_0x25697a}=_0x4a78d7,_0x21e966=_0x39b5ab[0x0];if(!_0x21e966)return console['error'](_0x1bee4a(0x12a)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x1bee4a(0xf9)](_0x1bee4a(0xf6)),console[_0x1bee4a(0xf9)](_0x1bee4a(0x117)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x1bee4a(0xf9)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3e354b=_0x25daaa[_0x1bee4a(0x10e)],_0x582ad6=await resolveSegmentTarget(_0x21e966,_0x3e354b,_0x25daaa[_0x1bee4a(0x130)]);_0x25daaa[_0x1bee4a(0x130)]&&console['error'](_0x1bee4a(0xb5)+_0x582ad6);const _0x18b7a2=await withSpinner(_0x1bee4a(0xd4)+_0x21e966+_0x1bee4a(0xb6),()=>_0x25697a['segment'][_0x1bee4a(0xd0)](_0x582ad6),{'verbose':_0x25daaa[_0x1bee4a(0x130)]}),_0x303c03=_0x18b7a2['data'];_0x25daaa['verbose']&&(console[_0x1bee4a(0xf9)](_0x1bee4a(0x104)+_0x303c03['type']),console[_0x1bee4a(0xf9)](_0x1bee4a(0x149)+_0x303c03[_0x1bee4a(0xef)]));if(_0x303c03[_0x1bee4a(0x129)]===_0x1bee4a(0x137))return console[_0x1bee4a(0xf9)](_0x1bee4a(0x102)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x303c03[_0x1bee4a(0x129)]==='parent')return console[_0x1bee4a(0xf9)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x1bee4a(0xc8)),0x1;if(!_0x303c03[_0x1bee4a(0x107)])throw new SDKError(ErrorCode[_0x1bee4a(0x127)],_0x1bee4a(0x134));const _0x4c4600=await withSpinner(_0x1bee4a(0x11d),()=>_0x25697a[_0x1bee4a(0x148)][_0x1bee4a(0xec)](_0x303c03['parentId'],_0x303c03['segmentId']),{'verbose':_0x25daaa[_0x1bee4a(0x130)]}),_0x1ee504=_0x4c4600['data'],_0x284007=await executeSchemaQuery(_0x1ee504,_0x25697a,_0x25daaa);return await handleQueryOutput(_0x284007,_0x25daaa),0x0;}catch(_0x4144c1){if(_0x4144c1 instanceof SDKError)return console['error'](_0x1bee4a(0x13a)+_0x4144c1[_0x1bee4a(0x103)]),_0x4144c1['cause']&&console[_0x1bee4a(0xf9)](_0x1bee4a(0x141)+_0x4144c1[_0x1bee4a(0xb1)]),0x1;throw _0x4144c1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x5bad05=a37_0x3f6a;(function(_0x2fac67,_0x312f1b){const _0x4da66e=a37_0x3f6a,_0x1e1811=_0x2fac67();while(!![]){try{const _0x3bcd53=-parseInt(_0x4da66e(0x219))/0x1*(-parseInt(_0x4da66e(0x215))/0x2)+parseInt(_0x4da66e(0x207))/0x3+-parseInt(_0x4da66e(0x21b))/0x4*(-parseInt(_0x4da66e(0x206))/0x5)+-parseInt(_0x4da66e(0x201))/0x6+parseInt(_0x4da66e(0x225))/0x7*(-parseInt(_0x4da66e(0x216))/0x8)+-parseInt(_0x4da66e(0x218))/0x9*(-parseInt(_0x4da66e(0x21d))/0xa)+parseInt(_0x4da66e(0x1f8))/0xb;if(_0x3bcd53===_0x312f1b)break;else _0x1e1811['push'](_0x1e1811['shift']());}catch(_0x150868){_0x1e1811['push'](_0x1e1811['shift']());}}}(a37_0x3f2f,0x7fa47));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a37_0x5ddb42 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a37_0x5bad05(0x20b)]=a37_0x5bad05(0x21c);[a37_0x5bad05(0x1fd)]=a37_0x5bad05(0x21a);async[a37_0x5bad05(0x20c)](_0x118d49){const _0x4656db=a37_0x5bad05;console[_0x4656db(0x223)](a37_0x5ddb42[_0x4656db(0x20d)](_0x4656db(0x208))),console[_0x4656db(0x223)](a37_0x5ddb42['yellow'](_0x4656db(0x205)));const {options:_0x3befaa,args:_0x2e3d92,tdx:_0x90d0fc}=_0x118d49,_0x2f56ca=_0x3befaa;if(_0x2e3d92['length']===0x0)return console[_0x4656db(0x223)](_0x4656db(0x1f3)),console[_0x4656db(0x223)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x4656db(0x223)](_0x4656db(0x20f)),console[_0x4656db(0x223)](_0x4656db(0x20a)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x4656db(0x223)](_0x4656db(0x217)),0x1;const _0x36f98a=_0x2e3d92[0x0],_0x33c05e=_0x3befaa[_0x4656db(0x202)];let _0x412874=_0x36f98a;_0x33c05e&&!_0x36f98a[_0x4656db(0x1fb)]('/')&&(_0x412874=_0x33c05e+'/'+_0x36f98a,_0x2f56ca['verbose']&&console[_0x4656db(0x223)](_0x4656db(0x1f7)+_0x412874));const _0x567710=parsePath(_0x412874);if(_0x567710[_0x4656db(0x220)][_0x4656db(0x204)]<0x2)return console[_0x4656db(0x223)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0x4656db(0x200)),0x1;const _0x526b65=_0x567710[_0x4656db(0x220)][0x0],_0x391d3b=getBaseName(_0x412874),_0xadb161=getParentPath(_0x412874);_0x2f56ca[_0x4656db(0x222)]&&(console[_0x4656db(0x223)](_0x4656db(0x224)+_0x2f56ca[_0x4656db(0x1f4)]),console[_0x4656db(0x223)](_0x4656db(0x203)+_0x412874),console[_0x4656db(0x223)](_0x4656db(0x1fc)+_0x526b65),console[_0x4656db(0x223)](_0x4656db(0x21f)+_0x391d3b),console['error'](_0x4656db(0x21e)+_0xadb161));const _0x344f03=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x526b65+_0x4656db(0x1fe),()=>_0x90d0fc[_0x4656db(0x212)]['resolveParentId'](_0x526b65),{'verbose':_0x2f56ca['verbose']}),_0x3618ea=_0x344f03[_0x4656db(0x210)];let _0x175b51;if(_0x567710[_0x4656db(0x220)][_0x4656db(0x204)]>0x2){const _0x1aae73=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0xadb161+_0x4656db(0x1fe),()=>_0x90d0fc[_0x4656db(0x212)][_0x4656db(0x214)](_0xadb161),{'verbose':_0x2f56ca['verbose']}),_0x1de332=_0x1aae73['data'];if(_0x1de332['type']!==_0x4656db(0x1f6)&&_0x1de332['type']!=='parent')return console['error'](_0x4656db(0x226)),0x1;_0x175b51=_0x1de332[_0x4656db(0x213)];}else{if(_0x2f56ca[_0x4656db(0x1f6)]){const _0x58bf3c=await withSpinner('Resolving\x20folder\x20\x27'+_0x2f56ca[_0x4656db(0x1f6)]+'\x27...',()=>_0x90d0fc[_0x4656db(0x212)][_0x4656db(0x1f9)](_0x3618ea,_0x2f56ca[_0x4656db(0x1f6)]),{'verbose':_0x2f56ca[_0x4656db(0x222)]});_0x175b51=_0x58bf3c[_0x4656db(0x210)];}}_0x2f56ca[_0x4656db(0x222)]&&_0x175b51&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x175b51);const _0x150afc=await loadJSONFromOptions(_0x2f56ca[_0x4656db(0x1f5)],_0x2f56ca[_0x4656db(0x221)]),_0x2d328f={'name':_0x391d3b,'description':_0x2f56ca['description'],'rule':_0x150afc,'kind':_0x2f56ca[_0x4656db(0x20e)]!==undefined?parseInt(_0x2f56ca[_0x4656db(0x20e)],0xa):undefined,'isVisible':_0x2f56ca[_0x4656db(0x209)]?![]:undefined,'segmentFolderId':_0x175b51,'countPopulation':_0x2f56ca[_0x4656db(0x1ff)]?![]:undefined},_0x144550=await withSpinner(_0x4656db(0x211)+_0x391d3b+'\x27...',()=>_0x90d0fc['segment']['createSegment'](_0x3618ea,_0x2d328f),{'verbose':_0x2f56ca[_0x4656db(0x222)]}),_0x3be258=_0x144550['data'];return console[_0x4656db(0x223)]('✔\x20Created\x20segment\x20\x27'+_0x3be258[_0x4656db(0x20b)]+_0x4656db(0x1fa)+_0x3be258['id']),_0x412874!==_0x36f98a&&console['error']('\x20\x20\x20Path:\x20'+_0x412874),await handleSDKOutput([_0x3be258],_0x2f56ca),0x0;}}function a37_0x3f6a(_0x46caba,_0x48185b){_0x46caba=_0x46caba-0x1f3;const _0x3f2fa2=a37_0x3f2f();let _0x3f6aba=_0x3f2fa2[_0x46caba];return _0x3f6aba;}function a37_0x3f2f(){const _0x31d2cd=['Creating\x20segment\x20\x27','segment','folderId','resolvePathToResource','388GqmPGg','56koYMoK','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','56187ZKInzR','697pGElBe','Create\x20child\x20segment\x20with\x20filtering\x20rules','20OQjfDu','segment:create','350xzQLgX','Parent\x20path:\x20','Segment\x20name:\x20','segments','ruleFile','verbose','error','Site:\x20','1033375gnUcLc','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','site','rule','folder','Resolved\x20relative\x20path\x20to:\x20','8815730MCXypw','resolveFolderId','\x27\x20with\x20ID:\x20','includes','Parent:\x20','description','\x27...','noCountPopulation','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','2857788lXYRBz','segmentPath','Target\x20path:\x20','length','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','851795IswbbM','76644ttTqzz','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','invisible','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','name','execute','yellow','kind','Examples:','data'];a37_0x3f2f=function(){return _0x31d2cd;};return a37_0x3f2f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x23aac3=a38_0x832f;(function(_0x3dd15a,_0x203778){const _0x9ed784=a38_0x832f,_0x44c010=_0x3dd15a();while(!![]){try{const _0x458896=parseInt(_0x9ed784(0x1b7))/0x1+parseInt(_0x9ed784(0x1a5))/0x2*(-parseInt(_0x9ed784(0x1af))/0x3)+parseInt(_0x9ed784(0x1b9))/0x4*(-parseInt(_0x9ed784(0x1a3))/0x5)+parseInt(_0x9ed784(0x1ba))/0x6+-parseInt(_0x9ed784(0x1b8))/0x7*(-parseInt(_0x9ed784(0x1a4))/0x8)+-parseInt(_0x9ed784(0x1bb))/0x9+parseInt(_0x9ed784(0x1b3))/0xa*(parseInt(_0x9ed784(0x1ad))/0xb);if(_0x458896===_0x203778)break;else _0x44c010['push'](_0x44c010['shift']());}catch(_0x58a856){_0x44c010['push'](_0x44c010['shift']());}}}(a38_0x1398,0xc4c2b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a38_0x1398(){const _0x149365=['547712wLMCrT','json','3JqLohO','verbose','error','List\x20available\x20fields\x20for\x20segmentation','320HksdxS','Error:\x20Parent\x20segment\x20name\x20is\x20required','site','length','426090AxWsQD','1119916BwqBQQ','4crLLqZ','4191108BgHNYN','9463464MjFLAy','description','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentSegment','jsonl','segment','5336795AATBwv','80dLhnFR','2786092RntRDr','Parent\x20segment:\x20','\x27...','execute','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','name','data','Listing\x20fields\x20for\x20\x27'];a38_0x1398=function(){return _0x149365;};return a38_0x1398();}function a38_0x832f(_0x5ca459,_0xe8ee2b){_0x5ca459=_0x5ca459-0x19f;const _0x1398f0=a38_0x1398();let _0x832feb=_0x1398f0[_0x5ca459];return _0x832feb;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a38_0x23aac3(0x1aa)]='segment:fields';[a38_0x23aac3(0x1bc)]=a38_0x23aac3(0x1b2);async[a38_0x23aac3(0x1a8)](_0x10fe73){const _0xc0fcae=a38_0x23aac3,{options:_0x1d7873,args:_0x2c52b,tdx:_0x22230b}=_0x10fe73,_0x5c90fb=_0x2c52b[0x0]||_0x1d7873[_0xc0fcae(0x1a0)];if(!_0x5c90fb)return console[_0xc0fcae(0x1b1)](_0xc0fcae(0x1b4)),console[_0xc0fcae(0x1b1)](_0xc0fcae(0x1a9)),console['error'](_0xc0fcae(0x19f)),0x1;_0x1d7873[_0xc0fcae(0x1b0)]&&(console[_0xc0fcae(0x1b1)]('Site:\x20'+_0x1d7873[_0xc0fcae(0x1b5)]),console[_0xc0fcae(0x1b1)](_0xc0fcae(0x1a6)+_0x5c90fb));const _0x27ff44=await withSpinner(_0xc0fcae(0x1ac)+_0x5c90fb+_0xc0fcae(0x1a7),()=>_0x22230b[_0xc0fcae(0x1a2)]['listFields'](_0x5c90fb),{'verbose':_0x1d7873['verbose']}),_0x40e626=_0x27ff44[_0xc0fcae(0x1ab)];console[_0xc0fcae(0x1b1)]('✔\x20Found\x20'+_0x40e626[_0xc0fcae(0x1b6)]+'\x20field'+(_0x40e626[_0xc0fcae(0x1b6)]!==0x1?'s':''));if(_0x1d7873[_0xc0fcae(0x1ae)]||_0x1d7873[_0xc0fcae(0x1a1)])return await handleSDKOutput(_0x40e626,_0x1d7873),0x0;return displayFieldsHumanReadable(_0x40e626,_0x5c90fb),0x0;}}
|