@treasuredata/tdx 2026.3.49 → 2026.3.50
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-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/work-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.d.ts +6 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.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/types/workspace.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/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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 a32_0x2e6fef=a32_0x575f;(function(_0xdc4859,_0x57dc8d){const _0x2493a8=a32_0x575f,_0x1357dc=_0xdc4859();while(!![]){try{const _0x5e2910=parseInt(_0x2493a8(0x1fb))/0x1+parseInt(_0x2493a8(0x1e1))/0x2+-parseInt(_0x2493a8(0x1da))/0x3*(parseInt(_0x2493a8(0x1f0))/0x4)+-parseInt(_0x2493a8(0x1e9))/0x5*(-parseInt(_0x2493a8(0x1d7))/0x6)+parseInt(_0x2493a8(0x1df))/0x7*(-parseInt(_0x2493a8(0x1f6))/0x8)+-parseInt(_0x2493a8(0x1ce))/0x9+parseInt(_0x2493a8(0x1cd))/0xa;if(_0x5e2910===_0x57dc8d)break;else _0x1357dc['push'](_0x1357dc['shift']());}catch(_0x5ce152){_0x1357dc['push'](_0x1357dc['shift']());}}}(a32_0x1404,0x28817));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a32_0xade8ad from'chalk';export class PolicyCommand extends BaseCommand{[a32_0x2e6fef(0x1d4)]=a32_0x2e6fef(0x1eb);[a32_0x2e6fef(0x1e7)]=a32_0x2e6fef(0x1d5);async[a32_0x2e6fef(0x1ed)](_0x1a6caa){const _0x325b35=a32_0x2e6fef,{options:_0x5753f4,tdx:_0x263d01}=_0x1a6caa,_0x1ef1d9=await withSpinner(_0x325b35(0x1fe),async()=>{const _0x1091bb=_0x325b35,[_0x227e13,_0x47b503]=await Promise['all']([_0x263d01[_0x1091bb(0x1fc)][_0x1091bb(0x209)](),_0x263d01['policy']['getMyPermissions']()]);return{'userInfo':_0x227e13,'permissions':_0x47b503};},{'verbose':_0x5753f4['verbose']}),{userInfo:_0x21a01f,permissions:_0x2efc3f}=_0x1ef1d9[_0x325b35(0x1ea)];if(isStructuredFormat(_0x5753f4))return await handleSingleObjectOutput(_0x2efc3f,_0x5753f4),0x0;const _0x415221=_0x21a01f[_0x325b35(0x1ca)]?_0x325b35(0x1f5):_0x21a01f[_0x325b35(0x1e3)]?'Administrator':_0x325b35(0x1d1);console[_0x325b35(0x1d6)]('\x0a'+a32_0xade8ad['bold']('👤')+'\x20'+a32_0xade8ad[_0x325b35(0x1f9)](_0x21a01f[_0x325b35(0x1d4)])+'\x20'+a32_0xade8ad[_0x325b35(0x1d8)]('('+_0x21a01f[_0x325b35(0x1f1)]+')')+_0x325b35(0x205)+_0x415221),console[_0x325b35(0x1d6)](a32_0xade8ad[_0x325b35(0x1d8)](_0x325b35(0x200)+_0x263d01['context'][_0x325b35(0x1e0)]+':'+_0x21a01f[_0x325b35(0x202)]+',\x20user_id:'+_0x21a01f['id']));const _0x3ff39c=_0x2efc3f[_0x325b35(0x1e4)];console[_0x325b35(0x1d6)]('\x0a'+a32_0xade8ad[_0x325b35(0x1f9)](_0x325b35(0x1fa))+'\x20('+_0x3ff39c[_0x325b35(0x1d3)]+'):');if(_0x3ff39c['length']===0x0)console[_0x325b35(0x1d6)](a32_0xade8ad[_0x325b35(0x1d8)](_0x325b35(0x206)));else for(const _0x1f27a3 of _0x3ff39c){console[_0x325b35(0x1d6)]('\x20\x20•\x20'+_0x1f27a3[_0x325b35(0x1d4)]);}return printPermissionsMap(_0x2efc3f[_0x325b35(0x1ef)]),console[_0x325b35(0x1d6)](),0x0;}}function a32_0x1404(){const _0x519de8=['user','ies','Fetching\x20permissions...','validate','\x20\x20\x20','getPolicy','account_id','\x20\x20•\x20','Show\x20a\x20specific\x20policy\x20details\x20and\x20permissions\x20(admin\x20only)','\x20—\x20','\x20\x20No\x20policies\x20assigned','max','(ID:\x20','getCurrent','account_owner','Listing\x20policies...','padEnd','657230LLLZzD','267840qIIxHT','Fetching\x20policy...','verbose','Member','error','length','name','Show\x20current\x20user\x20policies\x20and\x20effective\x20permissions','log','106530fxCqVc','dim','join','4029XPbLwh','No\x20policies\x20found','listPolicies','policy\x20show','\x20assigned','2562Wvafiq','site','104038jQknMz','entries','administrator','policies','policy\x20list','\x20polic','description','\x20user','20oOWCce','data','policy','🔑\x20Effective\x20Permissions','execute','map','permissions','436zfCOme','email','\x20\x20No\x20permissions','Usage:\x20tdx\x20policy\x20show\x20<policy-name-or-id>','args','Account\x20Owner','32XAFtHj','List\x20all\x20policies\x20in\x20the\x20account\x20(admin\x20only)','✔\x20Found\x20','bold','📋\x20Assigned\x20Policies','154760hvsXaA'];a32_0x1404=function(){return _0x519de8;};return a32_0x1404();}function a32_0x575f(_0x3b289e,_0x75532a){_0x3b289e=_0x3b289e-0x1ca;const _0x140443=a32_0x1404();let _0x575f42=_0x140443[_0x3b289e];return _0x575f42;}export class PolicyListCommand extends BaseCommand{['name']=a32_0x2e6fef(0x1e5);[a32_0x2e6fef(0x1e7)]=a32_0x2e6fef(0x1f7);async['execute'](_0x2cf0ad){const _0x35bcb9=a32_0x2e6fef,{options:_0x507fd8,tdx:_0x2fa653}=_0x2cf0ad,_0x396380=await withSpinner(_0x35bcb9(0x1cb),()=>_0x2fa653[_0x35bcb9(0x1eb)][_0x35bcb9(0x1dc)](),{'verbose':_0x507fd8[_0x35bcb9(0x1d0)]}),_0x5f10fe=_0x396380[_0x35bcb9(0x1ea)];console[_0x35bcb9(0x1d2)](_0x35bcb9(0x1f8)+_0x5f10fe['length']+_0x35bcb9(0x1e6)+(_0x5f10fe[_0x35bcb9(0x1d3)]!==0x1?_0x35bcb9(0x1fd):'y'));if(isStructuredFormat(_0x507fd8))return await handleSDKOutput(_0x5f10fe,_0x507fd8),0x0;if(_0x5f10fe[_0x35bcb9(0x1d3)]===0x0)console[_0x35bcb9(0x1d6)](a32_0xade8ad[_0x35bcb9(0x1d8)](_0x35bcb9(0x1db)));else for(const _0x221de6 of _0x5f10fe){const _0x894802=_0x221de6[_0x35bcb9(0x1e7)]?a32_0xade8ad[_0x35bcb9(0x1d8)](_0x35bcb9(0x205)+_0x221de6['description']):'';console[_0x35bcb9(0x1d6)](_0x35bcb9(0x203)+_0x221de6[_0x35bcb9(0x1d4)]+_0x894802);}return 0x0;}}export class PolicyShowCommand extends BaseCommand{['name']=a32_0x2e6fef(0x1dd);['description']=a32_0x2e6fef(0x204);[a32_0x2e6fef(0x1ff)](_0x228c2c){const _0x526f3b=a32_0x2e6fef;if(_0x228c2c['args'][_0x526f3b(0x1d3)]===0x0)return _0x526f3b(0x1f3);return undefined;}async[a32_0x2e6fef(0x1ed)](_0x15d3f5){const _0x86256a=a32_0x2e6fef,{options:_0x251ebf,tdx:_0x318463}=_0x15d3f5,_0x13c1c6=_0x15d3f5[_0x86256a(0x1f4)][0x0],_0x281391=await withSpinner(_0x86256a(0x1cf),async()=>{const _0xfe7e6d=_0x86256a,_0x4a3486=await _0x318463[_0xfe7e6d(0x1eb)][_0xfe7e6d(0x201)](_0x13c1c6),[_0x399bd1,_0x25de42]=await Promise['all']([_0x318463[_0xfe7e6d(0x1eb)]['getPolicyPermissions'](_0x4a3486['id']),_0x318463['policy']['getPolicyUsers'](_0x4a3486['id'])]);return{'policy':_0x4a3486,'perms':_0x399bd1,'users':_0x25de42};},{'verbose':_0x251ebf[_0x86256a(0x1d0)]}),{policy:_0x17011e,perms:_0x31db71,users:_0x4f4e0e}=_0x281391[_0x86256a(0x1ea)];if(isStructuredFormat(_0x251ebf))return await handleSingleObjectOutput({..._0x17011e,'permissions':_0x31db71[_0x86256a(0x1ef)],'users':_0x4f4e0e},_0x251ebf),0x0;console[_0x86256a(0x1d6)]('\x0a'+a32_0xade8ad['bold']('📋')+'\x20'+a32_0xade8ad[_0x86256a(0x1f9)](_0x17011e['name'])+'\x20'+a32_0xade8ad['dim'](_0x86256a(0x208)+_0x17011e['id']+')'));_0x17011e[_0x86256a(0x1e7)]&&console['log'](_0x86256a(0x200)+a32_0xade8ad[_0x86256a(0x1d8)](_0x17011e[_0x86256a(0x1e7)]));console[_0x86256a(0x1d6)](_0x86256a(0x200)+_0x4f4e0e[_0x86256a(0x1d3)]+_0x86256a(0x1e8)+(_0x4f4e0e['length']!==0x1?'s':'')+_0x86256a(0x1de)),printPermissionsMap(_0x31db71[_0x86256a(0x1ef)]);if(_0x4f4e0e[_0x86256a(0x1d3)]>0x0){console[_0x86256a(0x1d6)]('\x0a'+a32_0xade8ad[_0x86256a(0x1f9)]('👥\x20Assigned\x20Users')+':');for(const _0x1e1b6f of _0x4f4e0e){const _0xf772d=_0x1e1b6f[_0x86256a(0x1f1)]&&_0x1e1b6f[_0x86256a(0x1f1)]!==_0x1e1b6f[_0x86256a(0x1d4)]?a32_0xade8ad[_0x86256a(0x1d8)]('\x20<'+_0x1e1b6f[_0x86256a(0x1f1)]+'>'):'';console[_0x86256a(0x1d6)](_0x86256a(0x203)+_0x1e1b6f[_0x86256a(0x1d4)]+_0xf772d);}}return console['log'](),0x0;}}function printPermissionsMap(_0x24439b){const _0x1edeaa=a32_0x2e6fef,_0x328e94=Object[_0x1edeaa(0x1e2)](_0x24439b);console[_0x1edeaa(0x1d6)]('\x0a'+a32_0xade8ad['bold'](_0x1edeaa(0x1ec))+':');if(_0x328e94['length']===0x0){console[_0x1edeaa(0x1d6)](a32_0xade8ad[_0x1edeaa(0x1d8)](_0x1edeaa(0x1f2)));return;}const _0x1e6d24=Math[_0x1edeaa(0x207)](..._0x328e94[_0x1edeaa(0x1ee)](([_0x17214b])=>_0x17214b[_0x1edeaa(0x1d3)]));for(const [_0x3acbcc,_0x903f7e]of _0x328e94){const _0xcdf78d=formatOperations(_0x903f7e);console['log']('\x20\x20'+_0x3acbcc[_0x1edeaa(0x1cc)](_0x1e6d24+0x2)+_0xcdf78d);}}function formatOperations(_0x20190a){const _0x1ba0de=a32_0x2e6fef,_0x4020a8=[...new Set(_0x20190a[_0x1ba0de(0x1ee)](_0x20faed=>_0x20faed['operation']))];return _0x4020a8[_0x1ba0de(0x1d9)](',\x20');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a33_0x55ecee=a33_0x1ad6;(function(_0x567034,_0x3dbb1b){const _0x18e28c=a33_0x1ad6,_0x51f1f9=_0x567034();while(!![]){try{const _0x33848f=parseInt(_0x18e28c(0x144))/0x1+parseInt(_0x18e28c(0x11e))/0x2+parseInt(_0x18e28c(0x130))/0x3*(-parseInt(_0x18e28c(0x152))/0x4)+parseInt(_0x18e28c(0x15a))/0x5*(parseInt(_0x18e28c(0x177))/0x6)+-parseInt(_0x18e28c(0x14f))/0x7*(-parseInt(_0x18e28c(0x13c))/0x8)+-parseInt(_0x18e28c(0x176))/0x9+parseInt(_0x18e28c(0x17c))/0xa*(-parseInt(_0x18e28c(0x153))/0xb);if(_0x33848f===_0x3dbb1b)break;else _0x51f1f9['push'](_0x51f1f9['shift']());}catch(_0x374bc8){_0x51f1f9['push'](_0x51f1f9['shift']());}}}(a33_0x55ea,0x6868a));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 a33_0x295044 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';function a33_0x1ad6(_0x5a1dd3,_0x3d2743){_0x5a1dd3=_0x5a1dd3-0x11a;const _0x55eae7=a33_0x55ea();let _0x1ad6e7=_0x55eae7[_0x5a1dd3];return _0x1ad6e7;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{runOAuthLoginFlow,promptAuthMethod}from'./auth-command.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 a33_0x2818e4 from'prompts';function a33_0x55ea(){const _0xf368c=['Removed\x20existing\x20profile\x20\x27','llm_agent','Default\x20profile\x20set\x20to:\x20','780AynHUg','Site\x20was\x20not\x20changed.','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','profile:create','yellow','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Failed\x20to\x20delete\x20profile:\x20','status','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Delete\x20a\x20profile','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','jobs','\x0aOperation\x20cancelled','\x20API\x20key\x20is\x20valid\x20(User:\x20','apiKey','✗\x20Validation\x20failed:\x20','force','Removal\x20cancelled','session','713094mZsXlt','message','tdx:\x20profile\x20delete','profile:use','Profile\x20\x27','Setup\x20cancelled','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','green','confirm','name','text','includes','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x20Profile\x20\x27','logLevel','You\x20can\x20find\x20your\x20API\x20key\x20at:','1639152HLsQRb','validate','skipExistsCheck','\x20\x20-\x20','join','Validating\x20API\x20key...','description','\x27\x20does\x20not\x20exist.','\x20\x20(no\x20profiles\x20found)','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','warn','22832QEhcOB','ERROR','Create\x20a\x20new\x20profile','split','API\x20key\x20cannot\x20be\x20empty','database','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x27\x20created','754903aQMqCu','red','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>','execute','\x20\x20tdx\x20--profile\x20','bold','site','\x27\x20requires\x20API\x20key\x20validation.','tdx:\x20profile\x20set','\x20--default\x27\x20to\x20save\x20permanently','llm_project','1897wQggDV','password','length','4dVXNQI','40326pjqPFW','profileName','Profile\x20name\x20cannot\x20be\x20empty','\x0aSaved\x20to:\x20','test','VALID_KEYS','\x27\x20does\x20not\x20exist.\x20Create\x20it?','5hiNiOW','config','log','tdx.json','Set\x20a\x20profile\x20configuration\x20value','parent_segment','profile:delete','dim','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','/app/mp/ak','Enter\x20your\x20TD\x20API\x20key:','email','default','\x0aSetup\x20cancelled','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','error','us01','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','\x27.\x0a\x0aValid\x20keys:\x20','tdx:\x20profile\x20create','getUserInfo','Operation\x20cancelled','\x27\x20deleted','all','oauth','\x0aAvailable\x20profiles:','Enter\x20profile\x20name:','(session:\x20','6575283JKklyg','634158yZdjRI','trim'];a33_0x55ea=function(){return _0xf368c;};return a33_0x55ea();}import a33_0x46e404 from'chalk';function validateProfileName(_0x4c0a3c,_0x427e0d){const _0x28eb70=a33_0x1ad6;if(!_0x4c0a3c||!_0x4c0a3c[_0x28eb70(0x178)]())return _0x28eb70(0x155);const _0xbdd663=_0x4c0a3c[_0x28eb70(0x178)]();if(!/^[a-zA-Z0-9_-]+$/[_0x28eb70(0x157)](_0xbdd663))return _0x28eb70(0x16b);if(!_0x427e0d?.[_0x28eb70(0x132)]&&profileExists(_0xbdd663))return _0x28eb70(0x122)+_0xbdd663+'\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20delete\x20'+_0xbdd663+'\x27\x20to\x20remove\x20it\x20first,\x20or\x20re-create\x20with\x20--force.';return!![];}async function deleteProfileAndCredentials(_0x531232){const _0x2e35bb=a33_0x1ad6;removeProfileFromUserConfig(_0x531232);const _0x645bb7=await isKeychainAvailable();_0x645bb7&&await Promise[_0x2e35bb(0x171)]([deleteKeychainAPIKey(_0x531232),deleteOAuthTokens(_0x531232)]);}export class ProfileCreateCommand extends BaseCommand{['name']=a33_0x55ecee(0x17f);[a33_0x55ecee(0x136)]=a33_0x55ecee(0x13e);async[a33_0x55ecee(0x147)](_0x4f89f3){const _0xae1946=a33_0x55ecee,{options:_0x506f1e,args:_0x23d9bf}=_0x4f89f3,_0x16dde8=!!_0x506f1e[_0xae1946(0x11b)];console['log'](a33_0x46e404['bold'](_0xae1946(0x16d)));let _0x36f594;if(_0x23d9bf[_0xae1946(0x151)]>0x0&&_0x23d9bf[0x0]){const _0x1b4036=_0x23d9bf[0x0]['trim']();_0x16dde8&&profileExists(_0x1b4036)&&(await deleteProfileAndCredentials(_0x1b4036),console[_0xae1946(0x15c)](_0xae1946(0x179)+_0x1b4036+'\x27'));const _0x24725e=validateProfileName(_0x1b4036);if(_0x24725e!==!![])return console[_0xae1946(0x169)](a33_0x46e404[_0xae1946(0x145)](_0x24725e)),0x1;_0x36f594=_0x1b4036;}else{const _0x1c5cd5=await a33_0x2818e4({'type':_0xae1946(0x128),'name':'profileName','message':_0xae1946(0x174),'validate':_0x2bedef=>validateProfileName(_0x2bedef,{'skipExistsCheck':_0x16dde8})});if(!_0x1c5cd5[_0xae1946(0x154)])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x36f594=_0x1c5cd5[_0xae1946(0x154)]['trim'](),_0x16dde8&&profileExists(_0x36f594)&&(await deleteProfileAndCredentials(_0x36f594),console['log'](_0xae1946(0x179)+_0x36f594+'\x27'));}const _0x230430=await a33_0x2818e4({'type':_0xae1946(0x128),'name':_0xae1946(0x136),'message':'Enter\x20description\x20(optional):'}),_0x2cf8de=_0x230430[_0xae1946(0x136)]?.[_0xae1946(0x178)]()||undefined,_0x3cd1d9=_0x506f1e[_0xae1946(0x14a)]||_0xae1946(0x16a),_0x3a49fc=await promptSiteSelection(_0x3cd1d9,_0x36f594,_0xae1946(0x123));if(!_0x3a49fc)return 0x1;const _0x355cfb=resolveSite(_0x3a49fc),_0x5cf5b5=await promptAuthMethod();if(!_0x5cf5b5)return console[_0xae1946(0x15c)](_0xae1946(0x167)),0x1;if(_0x5cf5b5===_0xae1946(0x172)){if(_0x2cf8de){const _0x394919={'site':_0x355cfb,'description':_0x2cf8de};saveProfileToUserConfig(_0x36f594,_0x394919);}const {accountName:_0x57ef3d}=_0x506f1e;return await runOAuthLoginFlow(_0x355cfb,_0x36f594,_0x506f1e[_0xae1946(0x12e)]??LogLevel[_0xae1946(0x13d)],{'accountName':_0x57ef3d}),0x0;}console[_0xae1946(0x15c)](_0xae1946(0x162)+_0x355cfb),console['log'](_0xae1946(0x12f)),console[_0xae1946(0x15c)]('\x20\x20'+getConsoleUrl(_0x355cfb,_0xae1946(0x163)));const _0x45997c=await a33_0x2818e4({'type':_0xae1946(0x150),'name':_0xae1946(0x18a),'message':_0xae1946(0x164),'validate':_0x4ef8b7=>{const _0xa25f71=_0xae1946;if(!_0x4ef8b7||!_0x4ef8b7[_0xa25f71(0x178)]())return _0xa25f71(0x140);return!![];}});if(!_0x45997c[_0xae1946(0x18a)])return console[_0xae1946(0x15c)](_0xae1946(0x167)),0x1;const _0x2fba00=_0x45997c[_0xae1946(0x18a)];console['log'](_0xae1946(0x135));try{const _0x2a5af9=TDX['create']({'site':_0x355cfb,'apiKey':_0x2fba00[_0xae1946(0x178)](),'logLevel':_0x506f1e[_0xae1946(0x12e)]??LogLevel[_0xae1946(0x13d)]}),_0x352512=await _0x2a5af9[_0xae1946(0x187)]['getUserInfo']();console['log'](a33_0x46e404[_0xae1946(0x125)]('✓')+_0xae1946(0x189)+_0x352512['email']+')');const _0x466650=await isKeychainAvailable();_0x466650?(await saveAPIKeyAsync(_0x2fba00[_0xae1946(0x178)](),_0x355cfb,_0x36f594),console['log'](a33_0x46e404[_0xae1946(0x125)]('✓')+_0xae1946(0x186)+_0x36f594+')')):(console['warn'](a33_0x46e404[_0xae1946(0x180)](_0xae1946(0x181))),console[_0xae1946(0x13b)](a33_0x46e404[_0xae1946(0x180)](_0xae1946(0x12b))));const _0x902138={'site':_0x355cfb,..._0x2cf8de&&{'description':_0x2cf8de}};return saveProfileToUserConfig(_0x36f594,_0x902138),console[_0xae1946(0x15c)](a33_0x46e404[_0xae1946(0x125)]('✓')+_0xae1946(0x12d)+_0x36f594+_0xae1946(0x143)),console[_0xae1946(0x15c)](),console[_0xae1946(0x15c)](_0xae1946(0x139)),console[_0xae1946(0x15c)]('\x20\x20tdx\x20--profile\x20'+_0x36f594+_0xae1946(0x184)),console[_0xae1946(0x15c)](_0xae1946(0x148)+_0x36f594+_0xae1946(0x142)),0x0;}catch(_0x57c243){if(_0x57c243 instanceof HTTPClientError&&_0x57c243[_0xae1946(0x183)]===0x191)return printAuthError(_0x57c243),0x1;return console[_0xae1946(0x169)](a33_0x46e404[_0xae1946(0x145)](_0xae1946(0x11a)+(_0x57c243 instanceof Error?_0x57c243[_0xae1946(0x11f)]:String(_0x57c243)))),console[_0xae1946(0x169)](_0xae1946(0x124)),0x1;}}}export class ProfileDeleteCommand extends BaseCommand{[a33_0x55ecee(0x127)]=a33_0x55ecee(0x160);['description']=a33_0x55ecee(0x185);[a33_0x55ecee(0x131)](_0xd47a97){const {args:_0x57ccf4}=_0xd47a97;if(_0x57ccf4['length']===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20delete\x20<name>';return undefined;}async['execute'](_0x36756a){const _0x176e26=a33_0x55ecee,{args:_0x3cda2e}=_0x36756a,_0x5350ad=_0x3cda2e[0x0];console[_0x176e26(0x15c)](a33_0x46e404['bold'](_0x176e26(0x120)));if(!profileExists(_0x5350ad)){console[_0x176e26(0x169)](a33_0x46e404[_0x176e26(0x145)]('Profile\x20\x27'+_0x5350ad+_0x176e26(0x137))),console[_0x176e26(0x15c)]('\x0aAvailable\x20profiles:');const _0x278bb0=listProfiles();if(_0x278bb0['length']===0x0)console[_0x176e26(0x15c)](_0x176e26(0x138));else for(const _0x23bb42 of _0x278bb0){console[_0x176e26(0x15c)](_0x176e26(0x133)+_0x23bb42[_0x176e26(0x127)]);}return 0x1;}const _0x4f7840=await a33_0x2818e4({'type':'confirm','name':_0x176e26(0x126),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x5350ad+'\x27?','initial':![]});if(!_0x4f7840[_0x176e26(0x126)])return console[_0x176e26(0x15c)](_0x176e26(0x11c)),0x0;try{await deleteProfileAndCredentials(_0x5350ad),console[_0x176e26(0x15c)](a33_0x46e404[_0x176e26(0x125)]('✓')+_0x176e26(0x12d)+_0x5350ad+_0x176e26(0x170));}catch(_0x4b1983){return console['error'](a33_0x46e404[_0x176e26(0x145)](_0x176e26(0x182)+(_0x4b1983 instanceof Error?_0x4b1983[_0x176e26(0x11f)]:String(_0x4b1983)))),0x1;}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a33_0x55ecee(0x127)]='profile:set';[a33_0x55ecee(0x136)]=a33_0x55ecee(0x15e);static ['VALID_KEYS']=[a33_0x55ecee(0x14a),a33_0x55ecee(0x141),a33_0x55ecee(0x15f),a33_0x55ecee(0x14e),a33_0x55ecee(0x17a),a33_0x55ecee(0x136)];['validate'](_0x1f949e){const _0x3d79b7=a33_0x55ecee,{args:_0x3c956e,options:_0x2f9dac}=_0x1f949e,_0x94c4c2=_0x2f9dac['profile']||getActiveProfile();if(!_0x94c4c2)return _0x3d79b7(0x146);if(_0x3c956e[_0x3d79b7(0x151)]===0x0)return _0x3d79b7(0x17e)+ProfileSetCommand[_0x3d79b7(0x158)]['join'](',\x20');const _0x4a2869=_0x3c956e[0x0];if(!_0x4a2869[_0x3d79b7(0x129)]('='))return _0x3d79b7(0x12c)+ProfileSetCommand[_0x3d79b7(0x158)][_0x3d79b7(0x134)](',\x20');const [_0x29db65]=_0x4a2869[_0x3d79b7(0x13f)]('=',0x2);if(!ProfileSetCommand['VALID_KEYS']['includes'](_0x29db65))return'Unknown\x20key\x20\x27'+_0x29db65+_0x3d79b7(0x16c)+ProfileSetCommand[_0x3d79b7(0x158)]['join'](',\x20');return undefined;}async[a33_0x55ecee(0x147)](_0x2927ac){const _0x6d421=a33_0x55ecee,{args:_0x4f6259,options:_0x1939ce}=_0x2927ac,_0x462dd0=_0x1939ce['profile']||getActiveProfile(),[_0x19a8b6,..._0x43e9ab]=_0x4f6259[0x0][_0x6d421(0x13f)]('='),_0x3efed2=_0x43e9ab[_0x6d421(0x134)]('=');console[_0x6d421(0x15c)](a33_0x46e404[_0x6d421(0x149)](_0x6d421(0x14c)));if(!profileExists(_0x462dd0)){const _0xc1fef=await a33_0x2818e4({'type':_0x6d421(0x126),'name':'create','message':_0x6d421(0x122)+_0x462dd0+_0x6d421(0x159),'initial':!![]});if(!_0xc1fef['create'])return console[_0x6d421(0x15c)](_0x6d421(0x16f)),0x1;}const _0x47f2ef=loadProfile(_0x462dd0),_0x6d5371=_0x47f2ef?.[_0x6d421(0x15b)]||{};if(_0x19a8b6===_0x6d421(0x14a)){const _0x2cf2fa=resolveSite(_0x3efed2);console[_0x6d421(0x15c)]('Changing\x20site\x20to\x20\x27'+_0x2cf2fa+_0x6d421(0x14b)),console[_0x6d421(0x15c)](_0x6d421(0x12a)),console[_0x6d421(0x15c)]('\x20\x20'+getConsoleUrl(_0x2cf2fa,_0x6d421(0x163)));const _0x29d07d=await a33_0x2818e4({'type':_0x6d421(0x150),'name':_0x6d421(0x18a),'message':_0x6d421(0x13a),'validate':_0x520000=>{const _0x4f573e=_0x6d421;if(!_0x520000||!_0x520000[_0x4f573e(0x178)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x29d07d[_0x6d421(0x18a)])return console[_0x6d421(0x15c)](_0x6d421(0x188)),0x1;console[_0x6d421(0x15c)]('Validating\x20API\x20key...');try{const _0x3f5913=TDX['create']({'site':_0x2cf2fa,'apiKey':_0x29d07d[_0x6d421(0x18a)][_0x6d421(0x178)](),'logLevel':_0x1939ce[_0x6d421(0x12e)]??LogLevel[_0x6d421(0x13d)]}),_0x4d0bc3=await _0x3f5913[_0x6d421(0x187)][_0x6d421(0x16e)]();console[_0x6d421(0x15c)](a33_0x46e404[_0x6d421(0x125)]('✓')+_0x6d421(0x189)+_0x4d0bc3[_0x6d421(0x165)]+')');const _0x2bb177=await isKeychainAvailable();_0x2bb177?(await saveAPIKeyAsync(_0x29d07d[_0x6d421(0x18a)][_0x6d421(0x178)](),_0x2cf2fa,_0x462dd0),console[_0x6d421(0x15c)](a33_0x46e404['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console[_0x6d421(0x13b)](a33_0x46e404[_0x6d421(0x180)](_0x6d421(0x181))),_0x6d5371[_0x6d421(0x14a)]=_0x2cf2fa;}catch(_0x47cf15){if(_0x47cf15 instanceof HTTPClientError&&_0x47cf15[_0x6d421(0x183)]===0x191)return printAuthError(_0x47cf15),0x1;return console[_0x6d421(0x169)](a33_0x46e404[_0x6d421(0x145)](_0x6d421(0x11a)+(_0x47cf15 instanceof Error?_0x47cf15['message']:String(_0x47cf15)))),console[_0x6d421(0x169)](_0x6d421(0x17d)),0x1;}}else _0x6d5371[_0x19a8b6]=_0x3efed2||undefined;return saveProfileToUserConfig(_0x462dd0,_0x6d5371),console[_0x6d421(0x15c)](a33_0x46e404['green']('✓')+_0x6d421(0x12d)+_0x462dd0+'\x27\x20updated:\x20'+_0x19a8b6+'='+(_0x3efed2||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a33_0x55ecee(0x121);[a33_0x55ecee(0x136)]='Set\x20session\x20profile';['validate'](_0x50e3cf){const _0xf7ecb2=a33_0x55ecee,{args:_0x43294d}=_0x50e3cf;if(_0x43294d[_0xf7ecb2(0x151)]===0x0)return _0xf7ecb2(0x168);return undefined;}async[a33_0x55ecee(0x147)](_0x12603e){const _0x55ecbd=a33_0x55ecee,{args:_0x4e5a9e,options:_0x4413be}=_0x12603e,_0x32baeb=_0x4e5a9e[0x0],_0x56ec28=_0x4413be[_0x55ecbd(0x166)];cleanExpiredSessions();if(!profileExists(_0x32baeb)){console[_0x55ecbd(0x169)](a33_0x46e404[_0x55ecbd(0x145)](_0x55ecbd(0x122)+_0x32baeb+_0x55ecbd(0x137))),console[_0x55ecbd(0x15c)](_0x55ecbd(0x173));const _0xfb088e=listProfiles();if(_0xfb088e[_0x55ecbd(0x151)]===0x0)console[_0x55ecbd(0x15c)](_0x55ecbd(0x138));else for(const _0x126db0 of _0xfb088e){console[_0x55ecbd(0x15c)](_0x55ecbd(0x133)+_0x126db0[_0x55ecbd(0x127)]);}return 0x1;}if(_0x56ec28){const _0x53ec14=a33_0x295044[_0x55ecbd(0x134)](getConfigDir(),_0x55ecbd(0x15d));return saveActiveProfileToUserConfig(_0x32baeb),console[_0x55ecbd(0x15c)](_0x55ecbd(0x17b)+a33_0x46e404[_0x55ecbd(0x125)](_0x32baeb)),console[_0x55ecbd(0x15c)](a33_0x46e404[_0x55ecbd(0x161)](_0x55ecbd(0x156)+_0x53ec14)),0x0;}const _0x2feef9=getSessionID(_0x4413be[_0x55ecbd(0x11d)]);return saveSessionContext({'profile':_0x32baeb},_0x4413be[_0x55ecbd(0x11d)]),console[_0x55ecbd(0x15c)]('Session\x20profile\x20set\x20to:\x20'+a33_0x46e404[_0x55ecbd(0x125)](_0x32baeb)+'\x20'+a33_0x46e404[_0x55ecbd(0x161)](_0x55ecbd(0x175)+_0x2feef9+')')),console[_0x55ecbd(0x15c)](a33_0x46e404[_0x55ecbd(0x161)]('\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20'+_0x32baeb+_0x55ecbd(0x14d))),0x0;}}
|
|
1
|
+
const a33_0x3ca79c=a33_0x407e;(function(_0x263fea,_0x5af226){const _0x3800a0=a33_0x407e,_0x4d487b=_0x263fea();while(!![]){try{const _0x377048=parseInt(_0x3800a0(0x1d8))/0x1*(-parseInt(_0x3800a0(0x194))/0x2)+-parseInt(_0x3800a0(0x1d2))/0x3*(-parseInt(_0x3800a0(0x1b6))/0x4)+-parseInt(_0x3800a0(0x190))/0x5*(-parseInt(_0x3800a0(0x1c2))/0x6)+-parseInt(_0x3800a0(0x1c5))/0x7+parseInt(_0x3800a0(0x1c3))/0x8*(-parseInt(_0x3800a0(0x186))/0x9)+-parseInt(_0x3800a0(0x1a3))/0xa*(parseInt(_0x3800a0(0x16d))/0xb)+-parseInt(_0x3800a0(0x16f))/0xc*(-parseInt(_0x3800a0(0x18b))/0xd);if(_0x377048===_0x5af226)break;else _0x4d487b['push'](_0x4d487b['shift']());}catch(_0x30275b){_0x4d487b['push'](_0x4d487b['shift']());}}}(a33_0x5057,0xad309));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 a33_0x5399d3 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{deleteOAuthTokens}from'../core/oauth-keychain.js';import{runOAuthLoginFlow,promptAuthMethod}from'./auth-command.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a33_0x5057(){const _0x4d31cd=['Delete\x20a\x20profile','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20(no\x20profiles\x20found)','name','7190QLSNor','trim','create','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20delete\x20<name>','11014OIDWKn','green','execute','test','Removal\x20cancelled','red','validate','confirm','profile:create','\x20\x20-\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20delete\x20','profile:use','length','yellow','90NJrcCJ','\x0aOperation\x20cancelled','dim','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>','text','\x27\x20deleted','Failed\x20to\x20delete\x20profile:\x20','includes','Create\x20a\x20new\x20profile','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','API\x20key\x20cannot\x20be\x20empty','parent_segment','\x20Profile\x20\x27','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','VALID_KEYS','password','Setup\x20cancelled','tdx.json','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','4JgUDCC','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Changing\x20site\x20to\x20\x27','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','\x27\x20does\x20not\x20exist.','apiKey','\x0aSetup\x20cancelled','message','jobs','description','Operation\x20cancelled','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','3780AMKxpA','65984SxKyjH','tdx:\x20profile\x20delete','8903482bQXDVr','profile:set','session','\x27\x20created','getUserInfo','error','split','(session:\x20','status','profile:delete','\x20API\x20key\x20saved\x20to\x20system\x20keychain','Site\x20was\x20not\x20changed.','log','400647IVSXlH','Removed\x20existing\x20profile\x20\x27','/app/mp/ak','profile','site','\x20\x20tdx\x20--profile\x20','113KJHWHI','\x27\x20requires\x20API\x20key\x20validation.','Set\x20a\x20profile\x20configuration\x20value','\x0aAvailable\x20profiles:','\x0aSaved\x20to:\x20','457336AVoelS','Validating\x20API\x20key...','132660xCDUhh','✗\x20Validation\x20failed:\x20','force','ERROR','logLevel','Session\x20profile\x20set\x20to:\x20','\x20API\x20key\x20is\x20valid\x20(User:\x20','database','Profile\x20\x27','llm_project','us01','profileName','config','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','warn','Profile\x20name\x20cannot\x20be\x20empty','email','bold','join','oauth','Enter\x20your\x20TD\x20API\x20key:','\x27.\x0a\x0aValid\x20keys:\x20','skipExistsCheck','189mUMvYV','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','(cleared)','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','2483LpZvdd'];a33_0x5057=function(){return _0x4d31cd;};return a33_0x5057();}import{LogLevel}from'../utils/tdx-logger.js';import a33_0x49fba3 from'prompts';import a33_0xe36052 from'chalk';function validateProfileName(_0x23ded0,_0x160432){const _0x382296=a33_0x407e;if(!_0x23ded0||!_0x23ded0[_0x382296(0x191)]())return _0x382296(0x17e);const _0xf2cff9=_0x23ded0[_0x382296(0x191)]();if(!/^[a-zA-Z0-9_-]+$/[_0x382296(0x197)](_0xf2cff9))return'Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore';if(!_0x160432?.[_0x382296(0x185)]&&profileExists(_0xf2cff9))return'Profile\x20\x27'+_0xf2cff9+_0x382296(0x19f)+_0xf2cff9+'\x27\x20to\x20remove\x20it\x20first,\x20or\x20re-create\x20with\x20--force.';return!![];}async function deleteProfileAndCredentials(_0x311865){removeProfileFromUserConfig(_0x311865);const _0xf24f8e=await isKeychainAvailable();_0xf24f8e&&await Promise['all']([deleteKeychainAPIKey(_0x311865),deleteOAuthTokens(_0x311865)]);}export class ProfileCreateCommand extends BaseCommand{[a33_0x3ca79c(0x18f)]=a33_0x3ca79c(0x19c);['description']=a33_0x3ca79c(0x1ab);async[a33_0x3ca79c(0x196)](_0x271664){const _0x36e484=a33_0x3ca79c,{options:_0xf931b3,args:_0x37732d}=_0x271664,_0x246ae4=!!_0xf931b3[_0x36e484(0x171)];console[_0x36e484(0x1d1)](a33_0xe36052[_0x36e484(0x180)]('tdx:\x20profile\x20create'));let _0x5c64b9;if(_0x37732d[_0x36e484(0x1a1)]>0x0&&_0x37732d[0x0]){const _0x51e4c9=_0x37732d[0x0][_0x36e484(0x191)]();_0x246ae4&&profileExists(_0x51e4c9)&&(await deleteProfileAndCredentials(_0x51e4c9),console[_0x36e484(0x1d1)](_0x36e484(0x1d3)+_0x51e4c9+'\x27'));const _0x1bb2fd=validateProfileName(_0x51e4c9);if(_0x1bb2fd!==!![])return console['error'](a33_0xe36052[_0x36e484(0x199)](_0x1bb2fd)),0x1;_0x5c64b9=_0x51e4c9;}else{const _0x2a0857=await a33_0x49fba3({'type':_0x36e484(0x1a7),'name':_0x36e484(0x17a),'message':'Enter\x20profile\x20name:','validate':_0x1ad5f3=>validateProfileName(_0x1ad5f3,{'skipExistsCheck':_0x246ae4})});if(!_0x2a0857[_0x36e484(0x17a)])return console[_0x36e484(0x1d1)]('\x0aSetup\x20cancelled'),0x1;_0x5c64b9=_0x2a0857['profileName'][_0x36e484(0x191)](),_0x246ae4&&profileExists(_0x5c64b9)&&(await deleteProfileAndCredentials(_0x5c64b9),console[_0x36e484(0x1d1)](_0x36e484(0x1d3)+_0x5c64b9+'\x27'));}const _0x40e3e5=await a33_0x49fba3({'type':_0x36e484(0x1a7),'name':'description','message':'Enter\x20description\x20(optional):'}),_0x3443ae=_0x40e3e5['description']?.[_0x36e484(0x191)]()||undefined,_0x441ce7=_0xf931b3[_0x36e484(0x1d6)]||_0x36e484(0x179),_0x4cab47=await promptSiteSelection(_0x441ce7,_0x5c64b9,_0x36e484(0x1b3));if(!_0x4cab47)return 0x1;const _0x39b057=resolveSite(_0x4cab47),_0x45622a=await promptAuthMethod();if(!_0x45622a)return console[_0x36e484(0x1d1)](_0x36e484(0x1bc)),0x1;if(_0x45622a===_0x36e484(0x182)){if(_0x3443ae){const _0x4fcc3a={'site':_0x39b057,'description':_0x3443ae};saveProfileToUserConfig(_0x5c64b9,_0x4fcc3a);}const {accountName:_0x37056c}=_0xf931b3;return await runOAuthLoginFlow(_0x39b057,_0x5c64b9,_0xf931b3[_0x36e484(0x173)]??LogLevel[_0x36e484(0x172)],{'accountName':_0x37056c}),0x0;}console['log'](_0x36e484(0x188)+_0x39b057),console[_0x36e484(0x1d1)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x36e484(0x1d1)]('\x20\x20'+getConsoleUrl(_0x39b057,_0x36e484(0x1d4)));const _0x1a0d74=await a33_0x49fba3({'type':_0x36e484(0x1b2),'name':'apiKey','message':_0x36e484(0x183),'validate':_0x9662c3=>{const _0x590a5b=_0x36e484;if(!_0x9662c3||!_0x9662c3[_0x590a5b(0x191)]())return _0x590a5b(0x1ad);return!![];}});if(!_0x1a0d74['apiKey'])return console[_0x36e484(0x1d1)](_0x36e484(0x1bc)),0x1;const _0x3a342d=_0x1a0d74[_0x36e484(0x1bb)];console[_0x36e484(0x1d1)](_0x36e484(0x16e));try{const _0x14d538=TDX[_0x36e484(0x192)]({'site':_0x39b057,'apiKey':_0x3a342d[_0x36e484(0x191)](),'logLevel':_0xf931b3['logLevel']??LogLevel[_0x36e484(0x172)]}),_0xbfdd1e=await _0x14d538['jobs'][_0x36e484(0x1c9)]();console[_0x36e484(0x1d1)](a33_0xe36052[_0x36e484(0x195)]('✓')+_0x36e484(0x175)+_0xbfdd1e[_0x36e484(0x17f)]+')');const _0x21f6bf=await isKeychainAvailable();_0x21f6bf?(await saveAPIKeyAsync(_0x3a342d[_0x36e484(0x191)](),_0x39b057,_0x5c64b9),console[_0x36e484(0x1d1)](a33_0xe36052[_0x36e484(0x195)]('✓')+_0x36e484(0x1b9)+_0x5c64b9+')')):(console[_0x36e484(0x17d)](a33_0xe36052[_0x36e484(0x1a2)](_0x36e484(0x1ac))),console[_0x36e484(0x17d)](a33_0xe36052[_0x36e484(0x1a2)](_0x36e484(0x19e))));const _0x58918a={'site':_0x39b057,..._0x3443ae&&{'description':_0x3443ae}};return saveProfileToUserConfig(_0x5c64b9,_0x58918a),console[_0x36e484(0x1d1)](a33_0xe36052[_0x36e484(0x195)]('✓')+'\x20Profile\x20\x27'+_0x5c64b9+_0x36e484(0x1c8)),console['log'](),console[_0x36e484(0x1d1)](_0x36e484(0x18a)),console[_0x36e484(0x1d1)](_0x36e484(0x1d7)+_0x5c64b9+_0x36e484(0x1b7)),console['log'](_0x36e484(0x1d7)+_0x5c64b9+_0x36e484(0x1b0)),0x0;}catch(_0x51d34c){if(_0x51d34c instanceof HTTPClientError&&_0x51d34c[_0x36e484(0x1cd)]===0x191)return printAuthError(_0x51d34c),0x1;return console['error'](a33_0xe36052['red'](_0x36e484(0x170)+(_0x51d34c instanceof Error?_0x51d34c[_0x36e484(0x1bd)]:String(_0x51d34c)))),console['error'](_0x36e484(0x17c)),0x1;}}}export class ProfileDeleteCommand extends BaseCommand{[a33_0x3ca79c(0x18f)]=a33_0x3ca79c(0x1ce);[a33_0x3ca79c(0x1bf)]=a33_0x3ca79c(0x18c);[a33_0x3ca79c(0x19a)](_0xfae954){const _0x4c6d7e=a33_0x3ca79c,{args:_0x5207a4}=_0xfae954;if(_0x5207a4[_0x4c6d7e(0x1a1)]===0x0)return _0x4c6d7e(0x193);return undefined;}async[a33_0x3ca79c(0x196)](_0x2f097b){const _0x4474f3=a33_0x3ca79c,{args:_0x434efe}=_0x2f097b,_0x14702b=_0x434efe[0x0];console[_0x4474f3(0x1d1)](a33_0xe36052[_0x4474f3(0x180)](_0x4474f3(0x1c4)));if(!profileExists(_0x14702b)){console[_0x4474f3(0x1ca)](a33_0xe36052['red']('Profile\x20\x27'+_0x14702b+_0x4474f3(0x1ba))),console[_0x4474f3(0x1d1)](_0x4474f3(0x16b));const _0x3ffbd9=listProfiles();if(_0x3ffbd9[_0x4474f3(0x1a1)]===0x0)console[_0x4474f3(0x1d1)](_0x4474f3(0x18e));else for(const _0x167170 of _0x3ffbd9){console[_0x4474f3(0x1d1)](_0x4474f3(0x19d)+_0x167170['name']);}return 0x1;}const _0x1bafa0=await a33_0x49fba3({'type':_0x4474f3(0x19b),'name':_0x4474f3(0x19b),'message':_0x4474f3(0x1c1)+_0x14702b+'\x27?','initial':![]});if(!_0x1bafa0[_0x4474f3(0x19b)])return console['log'](_0x4474f3(0x198)),0x0;try{await deleteProfileAndCredentials(_0x14702b),console[_0x4474f3(0x1d1)](a33_0xe36052[_0x4474f3(0x195)]('✓')+'\x20Profile\x20\x27'+_0x14702b+_0x4474f3(0x1a8));}catch(_0x280a34){return console[_0x4474f3(0x1ca)](a33_0xe36052['red'](_0x4474f3(0x1a9)+(_0x280a34 instanceof Error?_0x280a34[_0x4474f3(0x1bd)]:String(_0x280a34)))),0x1;}return 0x0;}}function a33_0x407e(_0x195acb,_0x37e22e){_0x195acb=_0x195acb-0x16a;const _0x505765=a33_0x5057();let _0x407e6e=_0x505765[_0x195acb];return _0x407e6e;}export class ProfileSetCommand extends BaseCommand{[a33_0x3ca79c(0x18f)]=a33_0x3ca79c(0x1c6);['description']=a33_0x3ca79c(0x16a);static ['VALID_KEYS']=['site',a33_0x3ca79c(0x176),a33_0x3ca79c(0x1ae),a33_0x3ca79c(0x178),'llm_agent',a33_0x3ca79c(0x1bf)];['validate'](_0x513462){const _0x1f4ee3=a33_0x3ca79c,{args:_0x2e2384,options:_0x416011}=_0x513462,_0x15c79a=_0x416011[_0x1f4ee3(0x1d5)]||getActiveProfile();if(!_0x15c79a)return _0x1f4ee3(0x1a6);if(_0x2e2384[_0x1f4ee3(0x1a1)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x1f4ee3(0x1b1)][_0x1f4ee3(0x181)](',\x20');const _0x5c79a3=_0x2e2384[0x0];if(!_0x5c79a3[_0x1f4ee3(0x1aa)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand['VALID_KEYS'][_0x1f4ee3(0x181)](',\x20');const [_0x3d58ec]=_0x5c79a3[_0x1f4ee3(0x1cb)]('=',0x2);if(!ProfileSetCommand[_0x1f4ee3(0x1b1)][_0x1f4ee3(0x1aa)](_0x3d58ec))return'Unknown\x20key\x20\x27'+_0x3d58ec+_0x1f4ee3(0x184)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');return undefined;}async['execute'](_0x321ea0){const _0x251bb5=a33_0x3ca79c,{args:_0x1c8227,options:_0x511ca8}=_0x321ea0,_0x55b491=_0x511ca8[_0x251bb5(0x1d5)]||getActiveProfile(),[_0x503ba5,..._0x57019f]=_0x1c8227[0x0]['split']('='),_0x155dc8=_0x57019f[_0x251bb5(0x181)]('=');console[_0x251bb5(0x1d1)](a33_0xe36052['bold']('tdx:\x20profile\x20set'));if(!profileExists(_0x55b491)){const _0x271e39=await a33_0x49fba3({'type':_0x251bb5(0x19b),'name':'create','message':_0x251bb5(0x177)+_0x55b491+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x271e39[_0x251bb5(0x192)])return console[_0x251bb5(0x1d1)](_0x251bb5(0x1c0)),0x1;}const _0x2542a6=loadProfile(_0x55b491),_0x39a661=_0x2542a6?.[_0x251bb5(0x17b)]||{};if(_0x503ba5==='site'){const _0x357c7d=resolveSite(_0x155dc8);console[_0x251bb5(0x1d1)](_0x251bb5(0x1b8)+_0x357c7d+_0x251bb5(0x1d9)),console[_0x251bb5(0x1d1)](_0x251bb5(0x18d)),console[_0x251bb5(0x1d1)]('\x20\x20'+getConsoleUrl(_0x357c7d,_0x251bb5(0x1d4)));const _0x13a35a=await a33_0x49fba3({'type':_0x251bb5(0x1b2),'name':_0x251bb5(0x1bb),'message':_0x251bb5(0x1b5),'validate':_0x384134=>{const _0x59837f=_0x251bb5;if(!_0x384134||!_0x384134[_0x59837f(0x191)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x13a35a['apiKey'])return console[_0x251bb5(0x1d1)](_0x251bb5(0x1a4)),0x1;console['log'](_0x251bb5(0x16e));try{const _0x2530b2=TDX[_0x251bb5(0x192)]({'site':_0x357c7d,'apiKey':_0x13a35a[_0x251bb5(0x1bb)][_0x251bb5(0x191)](),'logLevel':_0x511ca8[_0x251bb5(0x173)]??LogLevel[_0x251bb5(0x172)]}),_0x18e5fe=await _0x2530b2[_0x251bb5(0x1be)][_0x251bb5(0x1c9)]();console[_0x251bb5(0x1d1)](a33_0xe36052[_0x251bb5(0x195)]('✓')+_0x251bb5(0x175)+_0x18e5fe[_0x251bb5(0x17f)]+')');const _0x3118f2=await isKeychainAvailable();_0x3118f2?(await saveAPIKeyAsync(_0x13a35a[_0x251bb5(0x1bb)][_0x251bb5(0x191)](),_0x357c7d,_0x55b491),console[_0x251bb5(0x1d1)](a33_0xe36052[_0x251bb5(0x195)]('✓')+_0x251bb5(0x1cf))):console[_0x251bb5(0x17d)](a33_0xe36052[_0x251bb5(0x1a2)](_0x251bb5(0x1ac))),_0x39a661['site']=_0x357c7d;}catch(_0x2d2c72){if(_0x2d2c72 instanceof HTTPClientError&&_0x2d2c72[_0x251bb5(0x1cd)]===0x191)return printAuthError(_0x2d2c72),0x1;return console['error'](a33_0xe36052[_0x251bb5(0x199)](_0x251bb5(0x170)+(_0x2d2c72 instanceof Error?_0x2d2c72[_0x251bb5(0x1bd)]:String(_0x2d2c72)))),console[_0x251bb5(0x1ca)](_0x251bb5(0x1d0)),0x1;}}else _0x39a661[_0x503ba5]=_0x155dc8||undefined;return saveProfileToUserConfig(_0x55b491,_0x39a661),console['log'](a33_0xe36052['green']('✓')+_0x251bb5(0x1af)+_0x55b491+'\x27\x20updated:\x20'+_0x503ba5+'='+(_0x155dc8||_0x251bb5(0x189))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a33_0x3ca79c(0x18f)]=a33_0x3ca79c(0x1a0);[a33_0x3ca79c(0x1bf)]='Set\x20session\x20profile';['validate'](_0x8dcaf){const _0x1e6291=a33_0x3ca79c,{args:_0x36d5f1}=_0x8dcaf;if(_0x36d5f1[_0x1e6291(0x1a1)]===0x0)return _0x1e6291(0x187);return undefined;}async[a33_0x3ca79c(0x196)](_0x273f2c){const _0x23fcb1=a33_0x3ca79c,{args:_0x223a51,options:_0x164621}=_0x273f2c,_0x52c40d=_0x223a51[0x0],_0x33c071=_0x164621['default'];cleanExpiredSessions();if(!profileExists(_0x52c40d)){console[_0x23fcb1(0x1ca)](a33_0xe36052[_0x23fcb1(0x199)](_0x23fcb1(0x177)+_0x52c40d+_0x23fcb1(0x1ba))),console['log']('\x0aAvailable\x20profiles:');const _0x253eba=listProfiles();if(_0x253eba[_0x23fcb1(0x1a1)]===0x0)console[_0x23fcb1(0x1d1)](_0x23fcb1(0x18e));else for(const _0x14ebdb of _0x253eba){console[_0x23fcb1(0x1d1)](_0x23fcb1(0x19d)+_0x14ebdb[_0x23fcb1(0x18f)]);}return 0x1;}if(_0x33c071){const _0x548703=a33_0x5399d3[_0x23fcb1(0x181)](getConfigDir(),_0x23fcb1(0x1b4));return saveActiveProfileToUserConfig(_0x52c40d),console[_0x23fcb1(0x1d1)]('Default\x20profile\x20set\x20to:\x20'+a33_0xe36052[_0x23fcb1(0x195)](_0x52c40d)),console[_0x23fcb1(0x1d1)](a33_0xe36052['dim'](_0x23fcb1(0x16c)+_0x548703)),0x0;}const _0x3f5d62=getSessionID(_0x164621[_0x23fcb1(0x1c7)]);return saveSessionContext({'profile':_0x52c40d},_0x164621[_0x23fcb1(0x1c7)]),console[_0x23fcb1(0x1d1)](_0x23fcb1(0x174)+a33_0xe36052[_0x23fcb1(0x195)](_0x52c40d)+'\x20'+a33_0xe36052[_0x23fcb1(0x1a5)](_0x23fcb1(0x1cc)+_0x3f5d62+')')),console[_0x23fcb1(0x1d1)](a33_0xe36052['dim']('\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20'+_0x52c40d+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x5515(){const _0x346c08=['196198ZApowb','site','dim','green','profiles','error','length','log','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','12zCCZmE','492Srbhxx','message','Error:\x20','map','3234011eyShTw','5545848yfrUPY','description','4490ebkvmE','4yWThBI','1873640XpXJZd','89568iiAtiH','4480gHCaof','config','name','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','execute','855waTSiq'];a34_0x5515=function(){return _0x346c08;};return a34_0x5515();}function a34_0x20a7(_0x15530e,_0x38c403){_0x15530e=_0x15530e-0x127;const _0x551518=a34_0x5515();let _0x20a71f=_0x551518[_0x15530e];return _0x20a71f;}const a34_0x2886a5=a34_0x20a7;(function(_0x5bfb9f,_0x31e5db){const _0x57528b=a34_0x20a7,_0x434a50=_0x5bfb9f();while(!![]){try{const _0x596e08=parseInt(_0x57528b(0x13b))/0x1*(-parseInt(_0x57528b(0x129))/0x2)+parseInt(_0x57528b(0x132))/0x3*(-parseInt(_0x57528b(0x13d))/0x4)+parseInt(_0x57528b(0x13c))/0x5+parseInt(_0x57528b(0x133))/0x6*(parseInt(_0x57528b(0x13e))/0x7)+parseInt(_0x57528b(0x138))/0x8+parseInt(_0x57528b(0x128))/0x9*(parseInt(_0x57528b(0x13a))/0xa)+-parseInt(_0x57528b(0x137))/0xb;if(_0x596e08===_0x31e5db)break;else _0x434a50['push'](_0x434a50['shift']());}catch(_0x326c96){_0x434a50['push'](_0x434a50['shift']());}}}(a34_0x5515,0x5e839));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import a34_0x93b6e3 from'chalk';export class ProfilesCommand extends BaseCommand{['name']=a34_0x2886a5(0x12d);['description']='List\x20all\x20available\x20profiles';async[a34_0x2886a5(0x127)](_0x4fdb20){const _0x4e53f6=a34_0x2886a5,{options:_0xd9fc63}=_0x4fdb20;try{const _0x4f84ee=listProfiles(),_0x266519=getActiveProfile();if(_0x4f84ee[_0x4e53f6(0x12f)]===0x0)return console[_0x4e53f6(0x130)](_0x4e53f6(0x131)),console[_0x4e53f6(0x130)](_0x4e53f6(0x141)),console[_0x4e53f6(0x130)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x4390c7=_0x4f84ee[_0x4e53f6(0x136)](_0x583b46=>{const _0x3f3534=_0x4e53f6,_0x50d549=_0x583b46[_0x3f3534(0x140)]===_0x266519,_0x855bcf=getProfileParams(_0x583b46['config']);return{'name':_0x583b46['name'],'active':_0x50d549,'scope':_0x583b46['scope'],'description':_0x583b46['config']['description']||'','params':_0x855bcf};});if(isStructuredFormat(_0xd9fc63))await handleSDKOutput(_0x4390c7,_0xd9fc63);else for(const _0x5981ce of _0x4f84ee){const _0x375a2e=_0x5981ce[_0x4e53f6(0x140)]===_0x266519?a34_0x93b6e3[_0x4e53f6(0x12c)]('\x20✓'):'',_0x914f8b=_0x5981ce[_0x4e53f6(0x13f)][_0x4e53f6(0x12a)]?a34_0x93b6e3[_0x4e53f6(0x12b)]('\x20'+_0x5981ce['config'][_0x4e53f6(0x12a)]):'',_0x551c39=_0x5981ce[_0x4e53f6(0x13f)]['description']?a34_0x93b6e3[_0x4e53f6(0x12b)]('\x20\x20'+_0x5981ce[_0x4e53f6(0x13f)][_0x4e53f6(0x139)]):'';console['log']('👤\x20'+_0x5981ce[_0x4e53f6(0x140)]+_0x375a2e+_0x914f8b+_0x551c39);}return 0x0;}catch(_0x434de0){return _0x434de0 instanceof Error&&console[_0x4e53f6(0x12e)](_0x4e53f6(0x135)+_0x434de0[_0x4e53f6(0x134)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x13a7eb=a35_0x37d9;(function(_0xb24b36,_0x1aa2d9){const _0x880e12=a35_0x37d9,_0x15e4bd=_0xb24b36();while(!![]){try{const _0x5be22e=parseInt(_0x880e12(0xc2))/0x1+-parseInt(_0x880e12(0xb3))/0x2*(parseInt(_0x880e12(0xd4))/0x3)+-parseInt(_0x880e12(0xd1))/0x4*(parseInt(_0x880e12(0xe5))/0x5)+parseInt(_0x880e12(0xe1))/0x6+-parseInt(_0x880e12(0xbc))/0x7*(parseInt(_0x880e12(0xc6))/0x8)+-parseInt(_0x880e12(0xdb))/0x9*(parseInt(_0x880e12(0xc8))/0xa)+parseInt(_0x880e12(0xd2))/0xb;if(_0x5be22e===_0x1aa2d9)break;else _0x15e4bd['push'](_0x15e4bd['shift']());}catch(_0x54d47e){_0x15e4bd['push'](_0x15e4bd['shift']());}}}(a35_0x464f,0xb124a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a35_0x464f(){const _0x30f2cb=['Executing\x20query...','2132104TUAwFh','setJobId','500AnuEau','error','Catalog:\x20','totalSplits','data','push','in\x20','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','message','933004OnLPWr','10994467FhybCf','stats','3mMmnId','Site:\x20','length','Executing\x20query\x20[','Executing\x20statement\x20','Schema:\x20','query','62838NgzEYK','information_schema','database','options','setExtra','elapsedTimeMillis','6714870CcsEXy','catalog','site','\x20rows\x20','10hCPJuR','args','processedRows','\x20splits','verbose','Statement\x20','779554WMtPhn','output','file','execute','description','setPhase','SQL:\x20','No\x20SQL\x20provided','Error:\x20','7sJkaqZ','jobId','\x20-\x20','name','state','\x0aAll\x20results\x20saved\x20to\x20','78828npHeGq','\x20[Job\x20ID:\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option'];a35_0x464f=function(){return _0x30f2cb;};return a35_0x464f();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';function a35_0x37d9(_0x4edb85,_0x24ef0f){_0x4edb85=_0x4edb85-0xae;const _0x464ff9=a35_0x464f();let _0x37d927=_0x464ff9[_0x4edb85];return _0x37d927;}import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a35_0x13a7eb(0xbf)]=a35_0x13a7eb(0xda);[a35_0x13a7eb(0xb7)]='Run\x20Trino\x20queries\x20(streaming)';async[a35_0x13a7eb(0xb6)](_0x588844){const _0x49d797=a35_0x13a7eb,{options:_0x536fe8,args:_0x3a6bc9,tdx:_0x4a00b4}=_0x588844,_0x523762={..._0x536fe8,'limitStructuredFormats':!![]},_0x45e174=_0x3a6bc9[0x0],_0x28a664=_0x536fe8[_0x49d797(0xb5)];let _0x4de295;try{if(_0x28a664)_0x4de295=readSqlStatementsFromFile(_0x28a664);else{if(_0x45e174==='-')_0x4de295=await readSqlStatementsFromStdin();else{if(_0x45e174&&isSqlFilePath(_0x45e174))_0x4de295=readSqlStatementsFromFile(_0x45e174);else{if(_0x45e174)_0x4de295=splitSqlStatements(_0x45e174);else throw new Error(_0x49d797(0xba));}}}}catch(_0x17d0db){return console['error'](_0x49d797(0xbb)+_0x17d0db[_0x49d797(0xd0)]),0x1;}const _0x3e5a79=_0x536fe8[_0x49d797(0xdd)]||_0x49d797(0xdc),_0x1bc369=_0x536fe8[_0x49d797(0xe2)];try{const _0x5422d0=[],_0x5e19ee=!!_0x536fe8[_0x49d797(0xb4)];for(let _0x14992e=0x0;_0x14992e<_0x4de295['length'];_0x14992e++){const _0x52a6ac=_0x4de295[_0x14992e],_0x1f477d=_0x14992e+0x1,_0x4f2b50=_0x4de295[_0x49d797(0xd6)],_0x572eaa=_0x4f2b50>0x1;_0x536fe8[_0x49d797(0xb1)]&&(console[_0x49d797(0xc9)]('\x0a'+(_0x572eaa?_0x49d797(0xb2)+_0x1f477d+'/'+_0x4f2b50+':':'')),console[_0x49d797(0xc9)](_0x49d797(0xd5)+_0x536fe8[_0x49d797(0xe3)]),console[_0x49d797(0xc9)](_0x49d797(0xca)+(_0x1bc369||'td')),console[_0x49d797(0xc9)](_0x49d797(0xd9)+_0x3e5a79),console[_0x49d797(0xc9)](_0x49d797(0xb9)+_0x52a6ac));const _0x3a428e=_0x572eaa?_0x49d797(0xd8)+_0x1f477d+'/'+_0x4f2b50+'...':_0x49d797(0xc5);try{const _0x1fb637=await withProgressSpinner(_0x3a428e,async _0xee2427=>{const _0x39279c=_0x49d797,_0x3224d7=await _0x4a00b4[_0x39279c(0xda)][_0x39279c(0xb6)](_0x52a6ac,{'catalog':_0x1bc369,'schema':_0x3e5a79,'onJobId':_0x2c93d2=>{const _0x2be109=_0x39279c;_0xee2427[_0x2be109(0xc7)](_0x2c93d2);},'onProgress':_0x19172f=>{const _0x574101=_0x39279c;_0xee2427[_0x574101(0xb8)](_0x574101(0xd7)+_0x19172f[_0x574101(0xc0)]+']'),_0xee2427[_0x574101(0xdf)](formatRows(_0x19172f[_0x574101(0xaf)])+_0x574101(0xe4)+_0x19172f['completedSplits']+'/'+_0x19172f[_0x574101(0xcb)]+_0x574101(0xb0));}});return _0x3224d7;},{'verbose':_0x536fe8[_0x49d797(0xb1)]}),_0x225d33=_0x1fb637[_0x49d797(0xcc)],_0xdcd5bf=_0x225d33[_0x49d797(0xbd)]?_0x49d797(0xc3)+_0x225d33[_0x49d797(0xbd)]+']':'',_0x1cbaeb=_0x572eaa?_0x49d797(0xb2)+_0x1f477d+'/'+_0x4f2b50+_0x49d797(0xbe):'';console[_0x49d797(0xc9)]('✔\x20'+_0x1cbaeb+'Query\x20completed:\x20Processed\x20'+formatRows(_0x225d33[_0x49d797(0xd3)][_0x49d797(0xaf)])+_0x49d797(0xe4)+(_0x49d797(0xce)+formatElapsed(_0x225d33['stats'][_0x49d797(0xe0)])+_0xdcd5bf));if(_0x572eaa&&_0x5e19ee){const _0xdf1d36=resolveOutputOptions(_0x523762),_0x32b690=await formatQueryOutput(_0x225d33,_0xdf1d36);_0x5422d0[_0x49d797(0xcd)](_0x32b690);}else await handleQueryOutput(_0x225d33,_0x523762);}catch(_0x4fb11f){const _0x472c2b=_0x572eaa?'Statement\x20'+_0x1f477d+'/'+_0x4f2b50+':\x0a':'',_0x52809e=_0x4fb11f instanceof SDKError?_0x4fb11f['originalMessage']:_0x4fb11f['message'];return console['error'](''+_0x472c2b+_0x52809e),0x1;}}if(_0x4de295[_0x49d797(0xd6)]>0x1&&_0x5e19ee&&_0x5422d0[_0x49d797(0xd6)]>0x0){const _0x3a7cc9=_0x5422d0['join']('\x0a');writeFileSync(_0x536fe8[_0x49d797(0xb4)],_0x3a7cc9),console[_0x49d797(0xc9)](_0x49d797(0xc1)+_0x536fe8[_0x49d797(0xb4)]);}return 0x0;}catch(_0x3ef9e5){throw _0x3ef9e5;}}['validate'](_0x1d0970){const _0x522703=a35_0x13a7eb,_0x129bee=_0x1d0970[_0x522703(0xae)][0x0],_0x394d72=_0x1d0970[_0x522703(0xde)]['file'];if(!_0x129bee&&!_0x394d72)return _0x522703(0xcf);if(_0x129bee&&_0x394d72)return _0x522703(0xc4);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x63f3e9=a36_0x2cae;(function(_0x1fd474,_0x2bdc98){const _0x1d4f61=a36_0x2cae,_0x2034c3=_0x1fd474();while(!![]){try{const _0x1fd9a8=parseInt(_0x1d4f61(0xc1))/0x1+-parseInt(_0x1d4f61(0x11c))/0x2*(-parseInt(_0x1d4f61(0x103))/0x3)+parseInt(_0x1d4f61(0xc3))/0x4*(-parseInt(_0x1d4f61(0x10d))/0x5)+-parseInt(_0x1d4f61(0x101))/0x6+parseInt(_0x1d4f61(0xfb))/0x7*(parseInt(_0x1d4f61(0xf3))/0x8)+parseInt(_0x1d4f61(0xfe))/0x9*(-parseInt(_0x1d4f61(0xc8))/0xa)+-parseInt(_0x1d4f61(0x122))/0xb*(-parseInt(_0x1d4f61(0x127))/0xc);if(_0x1fd9a8===_0x2bdc98)break;else _0x2034c3['push'](_0x2034c3['shift']());}catch(_0x57883c){_0x2034c3['push'](_0x2034c3['shift']());}}}(a36_0x53d0,0xafd15));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';function a36_0x2cae(_0x4cdd94,_0x41f2ed){_0x4cdd94=_0x4cdd94-0xa0;const _0x53d027=a36_0x53d0();let _0x2caebd=_0x53d027[_0x4cdd94];return _0x2caebd;}import a36_0x57411e from'chalk';function formatRelativeTime(_0xcfd800){const _0x3193da=a36_0x2cae,_0x2dfb1c=new Date(_0xcfd800),_0x4177bd=new Date(),_0x3f0865=_0x2dfb1c[_0x3193da(0xe9)]()-_0x4177bd['getTime'](),_0x432ff0=Math[_0x3193da(0x110)](_0x3f0865)/0x3e8,_0x1c1df7=_0x3f0865<0x0;if(_0x432ff0<0x3c)return _0x1c1df7?_0x3193da(0x11b):'soon';else{if(_0x432ff0<0xe10){const _0x4971b8=Math[_0x3193da(0xd3)](_0x432ff0/0x3c);return _0x1c1df7?_0x4971b8+'m\x20ago':_0x3193da(0xb8)+_0x4971b8+'m';}else{if(_0x432ff0<0x15180){const _0x18ea81=Math[_0x3193da(0xd3)](_0x432ff0/0xe10);return _0x1c1df7?_0x18ea81+_0x3193da(0xac):_0x3193da(0xb8)+_0x18ea81+'h';}else{if(_0x432ff0<0x93a80){const _0x147a4a=Math[_0x3193da(0xd3)](_0x432ff0/0x15180);return _0x1c1df7?_0x147a4a+_0x3193da(0x121):_0x3193da(0xb8)+_0x147a4a+'d';}else return _0x2dfb1c['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a36_0x63f3e9(0xe6)]=a36_0x63f3e9(0x118);['description']=a36_0x63f3e9(0xd1);async[a36_0x63f3e9(0xc9)](_0x48953a){const _0x56e33d=a36_0x63f3e9,{options:_0x4eabbd,args:_0x264cc4,tdx:_0x590fd8}=_0x48953a,_0x2d353a=resolveLimit(_0x4eabbd['limit'],DEFAULT_DISPLAY_LIMIT),_0x74399b=_0x264cc4[0x0],_0x36dcf=_0x74399b?_0x56e33d(0xd8)+_0x74399b+_0x56e33d(0xcc):_0x56e33d(0xad),_0x2e0eed=await withSpinner(_0x36dcf,()=>_0x590fd8[_0x56e33d(0x114)][_0x56e33d(0xec)]({'limit':_0x2d353a,'scheduled':!![],'pattern':_0x74399b}),{'verbose':_0x4eabbd[_0x56e33d(0xd7)]}),_0xb17f00=_0x2e0eed[_0x56e33d(0x129)]['queries'],_0x3e5e4d=_0x2e0eed[_0x56e33d(0x129)][_0x56e33d(0xa8)][_0x56e33d(0xbb)],_0x452441=_0x74399b?_0x56e33d(0xee)+_0x74399b+'\x22':'';_0x3e5e4d?console[_0x56e33d(0xea)](_0x56e33d(0xb6)+_0xb17f00[_0x56e33d(0xdf)]+_0x56e33d(0x120)+_0x452441+_0x56e33d(0x108)):console[_0x56e33d(0xea)](_0x56e33d(0xf5)+_0xb17f00[_0x56e33d(0xdf)]+'\x20scheduled\x20quer'+(_0xb17f00['length']!==0x1?_0x56e33d(0xb3):'y')+_0x452441);if(_0x4eabbd[_0x56e33d(0x109)]===_0x56e33d(0xd4)||_0x4eabbd[_0x56e33d(0x109)]===_0x56e33d(0xa7)||_0x4eabbd['format']==='table'||_0x4eabbd['format']==='tsv'){const _0x3866c0=_0xb17f00[_0x56e33d(0x125)](_0xea595d=>({'id':_0xea595d['id'],'name':_0xea595d[_0x56e33d(0xe6)],'cron':_0xea595d[_0x56e33d(0x12b)],'database':_0xea595d[_0x56e33d(0xc4)]?.[_0x56e33d(0xe6)],'type':_0xea595d[_0x56e33d(0x128)],'timezone':_0xea595d[_0x56e33d(0x105)],'user_name':_0xea595d[_0x56e33d(0xae)]?.['name'],'updated_at':_0xea595d[_0x56e33d(0xa6)],'next_run_at':_0xea595d[_0x56e33d(0xa5)],'last_job_status':_0xea595d[_0x56e33d(0xcf)]?.[_0x56e33d(0xd5)]}));await handleSDKOutput(_0x3866c0,_0x4eabbd);}else{if(_0xb17f00[_0x56e33d(0xdf)]===0x0)console['log'](_0x56e33d(0xf0));else{const _0x104aee=_0x4eabbd[_0x56e33d(0xda)],_0x11975e=_0xb17f00[_0x56e33d(0x125)](_0x1c435b=>{const _0x188108=_0x56e33d,_0xd710b7=_0x1c435b[_0x188108(0xcf)]?.['status']?_0x1c435b['last_job'][_0x188108(0xd5)]===_0x188108(0x10e)?'✓':'✗':'-',_0x53eddd=_0x1c435b[_0x188108(0xcf)]?.[_0x188108(0xf2)]?formatRelativeTime(_0x1c435b[_0x188108(0xcf)][_0x188108(0xf2)]):_0x188108(0xdd),_0x1b8280=_0x1c435b['next_run_at']?formatRelativeTime(_0x1c435b[_0x188108(0xa5)]):'-',_0xbfca2b=_0x1c435b[_0x188108(0x12b)]||'',_0x148b0a=_0x1c435b['name']||_0x188108(0x12d),_0x54eeb3=getConsoleUrl(_0x104aee,_0x188108(0xd2)+_0x1c435b['id']);return{'statusIcon':_0xd710b7,'lastRun':_0x53eddd,'nextRun':_0x1b8280,'cron':_0xbfca2b,'name':_0x148b0a,'queryUrl':_0x54eeb3,'status':_0x1c435b[_0x188108(0xcf)]?.[_0x188108(0xd5)]};}),_0x8cecaa=Math[_0x56e33d(0xb0)](..._0x11975e[_0x56e33d(0x125)](_0x2df069=>_0x2df069['lastRun'][_0x56e33d(0xdf)])),_0xb88ee5=Math[_0x56e33d(0xb0)](..._0x11975e[_0x56e33d(0x125)](_0x4173a6=>_0x4173a6[_0x56e33d(0x10f)][_0x56e33d(0xdf)])),_0x30ed49=Math[_0x56e33d(0xb0)](..._0x11975e['map'](_0x4255f6=>_0x4255f6[_0x56e33d(0x12b)][_0x56e33d(0xdf)])),_0x3fd2ee=_0x11975e['map'](_0x33808c=>{const _0x341c62=_0x56e33d,_0x1066a1=_0x33808c[_0x341c62(0xd5)]===_0x341c62(0x10e)?a36_0x57411e[_0x341c62(0x10c)](_0x33808c[_0x341c62(0xd9)]):_0x33808c[_0x341c62(0xd5)]===_0x341c62(0xea)?a36_0x57411e['red'](_0x33808c[_0x341c62(0xd9)]):a36_0x57411e[_0x341c62(0xf1)](_0x33808c[_0x341c62(0xd9)]),_0xa02af5=_0x33808c[_0x341c62(0xa3)][_0x341c62(0x119)](_0x8cecaa),_0x51847b=_0x33808c['nextRun'][_0x341c62(0x119)](_0xb88ee5),_0x130b41=_0x33808c[_0x341c62(0x12b)]?a36_0x57411e[_0x341c62(0x126)](_0x33808c[_0x341c62(0x12b)][_0x341c62(0x119)](_0x30ed49)):'\x20'[_0x341c62(0xe0)](_0x30ed49),_0x32499f=hyperlink(_0x33808c['name'],_0x33808c[_0x341c62(0xd6)]);return _0x341c62(0xbf)+_0x1066a1+'\x20'+_0xa02af5+'\x20\x20→\x20'+_0x51847b+'\x20\x20'+_0x130b41+'\x20\x20'+_0x32499f;});await writeOutput(_0x3fd2ee[_0x56e33d(0xc2)]('\x0a'),_0x4eabbd[_0x56e33d(0xff)],_0x56e33d(0x106));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a36_0x63f3e9(0xe6)]=a36_0x63f3e9(0xc7);[a36_0x63f3e9(0xcb)]=a36_0x63f3e9(0x104);[a36_0x63f3e9(0xc6)](_0x32dec3){const _0x501826=a36_0x63f3e9,_0x53daff=_0x32dec3[_0x501826(0x124)][0x0];if(!_0x53daff)return _0x501826(0xcd);return undefined;}async[a36_0x63f3e9(0xc9)](_0x2ad53f){const _0x5c6a9a=a36_0x63f3e9,{options:_0x14b821,args:_0x4d1ef9,tdx:_0x52521a}=_0x2ad53f,_0x2085f=_0x4d1ef9[0x0],_0x48826c=await withSpinner('Getting\x20schedule\x20details...',()=>_0x52521a['schedules'][_0x5c6a9a(0x115)](_0x2085f),{'verbose':_0x14b821['verbose']}),_0x311559=_0x48826c[_0x5c6a9a(0x129)],_0x7a99bc={'name':_0x311559['name'],'cron':_0x311559[_0x5c6a9a(0x12b)],'database':_0x311559[_0x5c6a9a(0xc4)],'type':_0x311559[_0x5c6a9a(0x128)],'timezone':_0x311559[_0x5c6a9a(0x10a)],'user_name':_0x311559[_0x5c6a9a(0xe1)],'created_at':_0x311559['created_at'],'engine_version':_0x311559[_0x5c6a9a(0x10b)],'executing_user_id':_0x311559[_0x5c6a9a(0x107)],'query':_0x311559[_0x5c6a9a(0xe7)],'delay':_0x311559[_0x5c6a9a(0xa0)],'priority':_0x311559[_0x5c6a9a(0xd0)],'retry_limit':_0x311559[_0x5c6a9a(0xab)],..._0x311559[_0x5c6a9a(0x100)]&&{'result':_0x311559[_0x5c6a9a(0x100)]}};return await handleSingleObjectOutput(_0x7a99bc,_0x14b821),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a36_0x63f3e9(0xe6)]='schedule:create';[a36_0x63f3e9(0xcb)]=a36_0x63f3e9(0x111);[a36_0x63f3e9(0xc6)](_0x52619a){const _0x795b26=a36_0x63f3e9,_0x9112cd=_0x52619a['args'][0x0];if(!_0x9112cd)return _0x795b26(0xa2);const _0x4a8c9a=_0x52619a[_0x795b26(0xdb)];if(!_0x4a8c9a[_0x795b26(0xc4)])return _0x795b26(0xf4);return undefined;}async[a36_0x63f3e9(0xc9)](_0xf3ef62){const _0x1a534b=a36_0x63f3e9,{options:_0x2b9de2,args:_0x4b9b1d,tdx:_0x5f472f}=_0xf3ef62,_0x41cd3e=_0x4b9b1d[0x0],_0x1edb1f=_0x2b9de2,_0x4c5895=_0x1edb1f[_0x1a534b(0xc4)],_0x4e3ed8=_0x1edb1f[_0x1a534b(0xce)],_0x1e58c6=_0x1edb1f[_0x1a534b(0x128)]||'trino';let _0x6a7ed6;try{_0x6a7ed6=readFileSync(_0x4e3ed8,_0x1a534b(0xb9))['trim']();}catch(_0x37f31a){throw new SDKError(ErrorCode[_0x1a534b(0x11d)],'Failed\x20to\x20read\x20file:\x20'+_0x4e3ed8,_0x37f31a instanceof Error?_0x37f31a:undefined);}if(!_0x6a7ed6)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20file\x20is\x20empty');const _0x2909cc={'database':_0x4c5895,'query':_0x6a7ed6,'type':_0x1e58c6};if(_0x1edb1f[_0x1a534b(0x12b)])_0x2909cc['cron']=_0x1edb1f['cron'];if(_0x1edb1f[_0x1a534b(0x10a)])_0x2909cc[_0x1a534b(0x10a)]=_0x1edb1f[_0x1a534b(0x10a)];if(_0x1edb1f[_0x1a534b(0xa0)]!==undefined)_0x2909cc['delay']=Number(_0x1edb1f['delay']);if(_0x1edb1f[_0x1a534b(0xd0)]!==undefined)_0x2909cc[_0x1a534b(0xd0)]=Number(_0x1edb1f['priority']);if(_0x1edb1f['retryLimit']!==undefined)_0x2909cc[_0x1a534b(0xab)]=Number(_0x1edb1f[_0x1a534b(0xa4)]);if(_0x1edb1f[_0x1a534b(0xe4)])_0x2909cc['engine_version']=_0x1edb1f[_0x1a534b(0xe4)];if(_0x1edb1f[_0x1a534b(0x100)])_0x2909cc[_0x1a534b(0x100)]=_0x1edb1f['result'];if(_0x2b9de2['verbose']){console['error']('Creating\x20schedule:\x20'+_0x41cd3e),console[_0x1a534b(0xea)]('\x20\x20Database:\x20'+_0x4c5895),console[_0x1a534b(0xea)](_0x1a534b(0xe5)+_0x1e58c6);if(_0x2909cc[_0x1a534b(0x12b)])console[_0x1a534b(0xea)]('\x20\x20Cron:\x20'+_0x2909cc['cron']);if(_0x2909cc[_0x1a534b(0x10a)])console[_0x1a534b(0xea)]('\x20\x20Timezone:\x20'+_0x2909cc[_0x1a534b(0x10a)]);}const _0x580833=await withSpinner('Creating\x20schedule...',()=>_0x5f472f[_0x1a534b(0x114)]['create'](_0x41cd3e,_0x2909cc),{'verbose':_0x2b9de2[_0x1a534b(0xd7)]});return console[_0x1a534b(0xea)](_0x1a534b(0xb5)+_0x580833[_0x1a534b(0x129)][_0x1a534b(0xe6)]),await handleSingleObjectOutput(_0x580833[_0x1a534b(0x129)],_0x2b9de2),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']='schedule:update';['description']=a36_0x63f3e9(0xde);['validate'](_0x303268){const _0x25ea27=a36_0x63f3e9,_0x380261=_0x303268[_0x25ea27(0x124)][0x0];if(!_0x380261)return _0x25ea27(0xef);return undefined;}async['execute'](_0x40a1b0){const _0x4fe081=a36_0x63f3e9,{options:_0x129825,args:_0x284f2c,tdx:_0x4d80c1}=_0x40a1b0,_0x34bb49=_0x284f2c[0x0],_0x2fb7fb=_0x129825,_0x5603b4={};if(_0x2fb7fb['database'])_0x5603b4[_0x4fe081(0xc4)]=_0x2fb7fb[_0x4fe081(0xc4)];if(_0x2fb7fb[_0x4fe081(0x128)])_0x5603b4[_0x4fe081(0x128)]=_0x2fb7fb[_0x4fe081(0x128)];if(_0x2fb7fb['cron'])_0x5603b4[_0x4fe081(0x12b)]=_0x2fb7fb['cron'];if(_0x2fb7fb['timezone'])_0x5603b4[_0x4fe081(0x10a)]=_0x2fb7fb[_0x4fe081(0x10a)];if(_0x2fb7fb[_0x4fe081(0xa0)]!==undefined)_0x5603b4['delay']=Number(_0x2fb7fb[_0x4fe081(0xa0)]);if(_0x2fb7fb[_0x4fe081(0xd0)]!==undefined)_0x5603b4[_0x4fe081(0xd0)]=Number(_0x2fb7fb['priority']);if(_0x2fb7fb[_0x4fe081(0xa4)]!==undefined)_0x5603b4[_0x4fe081(0xab)]=Number(_0x2fb7fb[_0x4fe081(0xa4)]);if(_0x2fb7fb[_0x4fe081(0xe4)])_0x5603b4[_0x4fe081(0x10b)]=_0x2fb7fb[_0x4fe081(0xe4)];if(_0x2fb7fb[_0x4fe081(0x100)])_0x5603b4[_0x4fe081(0x100)]=_0x2fb7fb['result'];if(_0x2fb7fb['file'])try{_0x5603b4[_0x4fe081(0xe7)]=readFileSync(_0x2fb7fb[_0x4fe081(0xce)],'utf-8')['trim']();}catch(_0x5486d7){throw new SDKError(ErrorCode[_0x4fe081(0x11d)],_0x4fe081(0xca)+_0x2fb7fb[_0x4fe081(0xce)],_0x5486d7 instanceof Error?_0x5486d7:undefined);}if(Object[_0x4fe081(0xf7)](_0x5603b4)[_0x4fe081(0xdf)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x129825['verbose']){console['error'](_0x4fe081(0xfa)+_0x34bb49);for(const [_0x314b8a,_0x25790b]of Object[_0x4fe081(0x113)](_0x5603b4)){_0x314b8a===_0x4fe081(0xe7)?console[_0x4fe081(0xea)]('\x20\x20'+_0x314b8a+':\x20'+_0x25790b['substring'](0x0,0x32)+_0x4fe081(0xaf)):console['error']('\x20\x20'+_0x314b8a+':\x20'+_0x25790b);}}const _0x41a4fb=await withSpinner('Updating\x20schedule...',()=>_0x4d80c1['schedules'][_0x4fe081(0xa9)](_0x34bb49,_0x5603b4),{'verbose':_0x129825[_0x4fe081(0xd7)]});return console['error']('Schedule\x20updated:\x20'+_0x41a4fb[_0x4fe081(0x129)][_0x4fe081(0xe6)]),await handleSingleObjectOutput(_0x41a4fb[_0x4fe081(0x129)],_0x129825),0x0;}}function a36_0x53d0(){const _0x184016=['options','Schedule\x20run\x20submitted:\x20','never','Update\x20a\x20scheduled\x20query','length','repeat','user_name','\x20\x20Time:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','engineVersion','\x20\x20Type:\x20','name','query','created_at','getTime','error','time','listQueries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','\x20matching\x20\x22','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','No\x20scheduled\x20queries\x20found','dim','ended_at','48KVPtcs','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Found\x20','\x20\x20Num:\x20','keys','\x20job','from','Updating\x20schedule:\x20','779877WvMMSq','Getting\x20schedule\x20history...','history','6204321YHzlDo','output','result','3595452XneYEO','\x20(showing\x20','20871UJFRbB','Show\x20schedule\x20details','time_zone','list','executing_user_id','\x20(use\x20--limit\x20to\x20see\x20more)','format','timezone','engine_version','green','6656665HtVjBX','success','nextRun','abs','Create\x20a\x20scheduled\x20query','Show\x20schedule\x20execution\x20history','entries','schedules','show','schedule:history','Delete\x20a\x20scheduled\x20query','schedule:list','padEnd','Run\x20a\x20scheduled\x20query\x20immediately','just\x20now','342DmvINp','INVALID_ARGUMENT','run','schedule:delete','\x20schedules','d\x20ago','14053655aUmQIN','schedule:run','args','map','cyan','12kBYDci','type','data','job_id','cron','end_at','(unnamed)','delay','scheduled_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','lastRun','retryLimit','next_run_at','updated_at','jsonl','pagination','update','num','retry_limit','h\x20ago','Listing\x20scheduled\x20queries...','user','...','max','delete','\x20created','ies','jobs','Schedule\x20created:\x20','Showing\x20first\x20','Deleting\x20schedule...','in\x20','utf-8','start_at','has_next_page','\x20execution','\x20\x20Job\x20ID:\x20','count','📅\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','204375fXyEHN','join','4buzzua','database','yes','validate','schedule:show','10bkYVWp','execute','Failed\x20to\x20read\x20file:\x20','description','\x22...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','file','last_job','priority','List\x20scheduled\x20queries','/app/queries/editor?queryId=','round','json','status','queryUrl','verbose','Searching\x20scheduled\x20queries\x20matching\x20\x22','statusIcon','site'];a36_0x53d0=function(){return _0x184016;};return a36_0x53d0();}export class ScheduleDeleteCommand extends BaseCommand{[a36_0x63f3e9(0xe6)]=a36_0x63f3e9(0x11f);[a36_0x63f3e9(0xcb)]=a36_0x63f3e9(0x117);['validate'](_0x2c833b){const _0x121e23=_0x2c833b['args'][0x0];if(!_0x121e23)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async['execute'](_0x5ae272){const _0x1c6da7=a36_0x63f3e9,{options:_0x49d696,args:_0x57c637,tdx:_0x1dd785}=_0x5ae272,_0x2ba8b6=_0x57c637[0x0];if(!_0x49d696[_0x1c6da7(0xc5)]){const _0x892d6e=await confirm(_0x1c6da7(0xc0)+_0x2ba8b6+'\x22?');if(!_0x892d6e)return console[_0x1c6da7(0xea)]('Cancelled'),0x0;}const _0x13d3cd=await withSpinner(_0x1c6da7(0xb7),()=>_0x1dd785['schedules'][_0x1c6da7(0xb1)](_0x2ba8b6),{'verbose':_0x49d696[_0x1c6da7(0xd7)]});return console[_0x1c6da7(0xea)]('Schedule\x20deleted:\x20'+_0x13d3cd[_0x1c6da7(0x129)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a36_0x63f3e9(0xe6)]=a36_0x63f3e9(0x123);[a36_0x63f3e9(0xcb)]=a36_0x63f3e9(0x11a);[a36_0x63f3e9(0xc6)](_0x2311c4){const _0x1e43d0=a36_0x63f3e9,_0xa2b25e=_0x2311c4['args'][0x0];if(!_0xa2b25e)return _0x1e43d0(0xe3);return undefined;}async[a36_0x63f3e9(0xc9)](_0x16d581){const _0x3fa5fd=a36_0x63f3e9,{options:_0x9fb382,args:_0x449585,tdx:_0x4f8c4b}=_0x16d581,_0x469039=_0x449585[0x0],_0x2d5c40=_0x9fb382,_0x6f73eb=_0x2d5c40[_0x3fa5fd(0xeb)],_0x3c54b5=_0x2d5c40[_0x3fa5fd(0xaa)]!==undefined?Number(_0x2d5c40[_0x3fa5fd(0xaa)]):undefined;if(_0x9fb382[_0x3fa5fd(0xd7)]){console[_0x3fa5fd(0xea)]('Running\x20schedule:\x20'+_0x469039);if(_0x6f73eb)console[_0x3fa5fd(0xea)](_0x3fa5fd(0xe2)+_0x6f73eb);if(_0x3c54b5)console['error'](_0x3fa5fd(0xf6)+_0x3c54b5);}const _0x316ab0=await withSpinner('Running\x20schedule...',()=>_0x4f8c4b[_0x3fa5fd(0x114)][_0x3fa5fd(0x11e)](_0x469039,{'time':_0x6f73eb,'num':_0x3c54b5}),{'verbose':_0x9fb382['verbose']}),_0x498173=_0x316ab0[_0x3fa5fd(0x129)][_0x3fa5fd(0xb4)];console[_0x3fa5fd(0xea)](_0x3fa5fd(0xdc)+_0x498173[_0x3fa5fd(0xdf)]+_0x3fa5fd(0xf8)+(_0x498173['length']!==0x1?'s':'')+_0x3fa5fd(0xb2));for(const _0x366d70 of _0x498173){console[_0x3fa5fd(0xea)](_0x3fa5fd(0xbd)+_0x366d70[_0x3fa5fd(0x12a)]);}return await handleSDKOutput(_0x498173,_0x9fb382),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']=a36_0x63f3e9(0x116);[a36_0x63f3e9(0xcb)]=a36_0x63f3e9(0x112);[a36_0x63f3e9(0xc6)](_0x494f0b){const _0x507600=a36_0x63f3e9,_0x4293d3=_0x494f0b[_0x507600(0x124)][0x0];if(!_0x4293d3)return _0x507600(0xed);return undefined;}async[a36_0x63f3e9(0xc9)](_0x5db803){const _0x56d239=a36_0x63f3e9,{options:_0x472906,args:_0x22c834,tdx:_0x550694}=_0x5db803,_0x3c57a5=_0x22c834[0x0],_0xca0e88=_0x472906,_0x3052c4=_0xca0e88[_0x56d239(0xf9)]!==undefined?Number(_0xca0e88[_0x56d239(0xf9)]):undefined,_0x34766d=_0xca0e88['to']!==undefined?Number(_0xca0e88['to']):undefined,_0x454c01=await withSpinner(_0x56d239(0xfc),()=>_0x550694[_0x56d239(0x114)][_0x56d239(0xfd)](_0x3c57a5,{'from':_0x3052c4,'to':_0x34766d}),{'verbose':_0x472906['verbose']}),_0x93f70d=_0x454c01['data'];console[_0x56d239(0xea)]('Found\x20'+_0x93f70d[_0x56d239(0xbe)]+_0x56d239(0xbc)+(_0x93f70d[_0x56d239(0xbe)]!==0x1?'s':'')+_0x56d239(0x102)+_0x93f70d[_0x56d239(0xf9)]+'-'+_0x93f70d['to']+')');const _0xcdde9f=_0x93f70d[_0x56d239(0xfd)]['map'](_0x2f2d91=>({'job_id':_0x2f2d91['job_id'],'type':_0x2f2d91[_0x56d239(0x128)],'status':_0x2f2d91[_0x56d239(0xd5)],'scheduled_at':_0x2f2d91[_0x56d239(0xa1)],'created_at':_0x2f2d91[_0x56d239(0xe8)],'start_at':_0x2f2d91[_0x56d239(0xba)],'end_at':_0x2f2d91[_0x56d239(0x12c)]}));return await handleSDKOutput(_0xcdde9f,_0x472906),0x0;}}
|
|
1
|
+
const a36_0x448907=a36_0x3e96;(function(_0x5e6f03,_0x2fd85e){const _0x111f80=a36_0x3e96,_0x32c646=_0x5e6f03();while(!![]){try{const _0x5459e6=parseInt(_0x111f80(0x182))/0x1*(-parseInt(_0x111f80(0x18e))/0x2)+-parseInt(_0x111f80(0x1c2))/0x3*(parseInt(_0x111f80(0x180))/0x4)+parseInt(_0x111f80(0x1b5))/0x5+parseInt(_0x111f80(0x175))/0x6+parseInt(_0x111f80(0x1f9))/0x7+-parseInt(_0x111f80(0x1d6))/0x8*(parseInt(_0x111f80(0x1db))/0x9)+parseInt(_0x111f80(0x1a9))/0xa;if(_0x5459e6===_0x2fd85e)break;else _0x32c646['push'](_0x32c646['shift']());}catch(_0xc4a96a){_0x32c646['push'](_0x32c646['shift']());}}}(a36_0x57c7,0x9d2ea));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a36_0x57c7(){const _0x364c87=['Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','/app/queries/editor?queryId=','max','end_at','soon','count','Failed\x20to\x20read\x20file:\x20','Getting\x20schedule\x20details...','round','data','entries','success','in\x20','delete','scheduled_at','delay','updated_at','Listing\x20scheduled\x20queries...','dim','description','15810570jnIbKH','time','list','substring','name','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Schedule\x20created:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','schedule:run','\x20\x20Cron:\x20','\x20\x20Num:\x20','m\x20ago','1386755dNkfZV','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','retry_limit','toLocaleDateString','Cancelled','schedule:show','(unnamed)','INVALID_ARGUMENT','📅\x20','padEnd','cyan','Searching\x20scheduled\x20queries\x20matching\x20\x22','ended_at','69ednChv','history','Updating\x20schedule:\x20','\x20\x20Timezone:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','start_at','verbose','green','log','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','type','Running\x20schedule:\x20','repeat','queryUrl','engine_version','Delete\x20a\x20scheduled\x20query','last_job','next_run_at','execute','database','7426256sesTAu','has_next_page','validate','status','executing_user_id','9afEKnX','\x20created','queries','\x20execution','abs','No\x20scheduled\x20queries\x20found','\x20\x20Job\x20ID:\x20','lastRun','priority','time_zone','schedule:delete','from','Update\x20a\x20scheduled\x20query','Running\x20schedule...','just\x20now','...','red','trim','Schedule\x20run\x20submitted:\x20','engineVersion','Updating\x20schedule...','map','show','user','listQueries','user_name','\x20matching\x20\x22','result','statusIcon','jsonl','1469762QURIOO','num','nextRun','format','created_at','getTime','Found\x20','options','cron','2222412KdgLTz','Show\x20schedule\x20execution\x20history','Showing\x20first\x20','Create\x20a\x20scheduled\x20query','table','timezone','args','query','schedule:create','run','json','142860lbxyaU','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','3TMmSes','schedule:update','\x20\x20Type:\x20','jobs','tsv','Schedule\x20deleted:\x20','utf-8','limit','Getting\x20schedule\x20history...','length','join','retryLimit','30154aqaORI','\x20schedules','error','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','schedules','file','Deleting\x20schedule...'];a36_0x57c7=function(){return _0x364c87;};return a36_0x57c7();}function a36_0x3e96(_0x35d951,_0x4d9d6c){_0x35d951=_0x35d951-0x174;const _0x57c7bf=a36_0x57c7();let _0x3e966f=_0x57c7bf[_0x35d951];return _0x3e966f;}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 a36_0x248afb from'chalk';function formatRelativeTime(_0x4748f8){const _0x2e5e4f=a36_0x3e96,_0x2a7f45=new Date(_0x4748f8),_0x416805=new Date(),_0x1f27a6=_0x2a7f45[_0x2e5e4f(0x1fe)]()-_0x416805['getTime'](),_0x3cdb25=Math[_0x2e5e4f(0x1df)](_0x1f27a6)/0x3e8,_0x361a48=_0x1f27a6<0x0;if(_0x3cdb25<0x3c)return _0x361a48?_0x2e5e4f(0x1e9):_0x2e5e4f(0x199);else{if(_0x3cdb25<0xe10){const _0x54b57b=Math[_0x2e5e4f(0x19d)](_0x3cdb25/0x3c);return _0x361a48?_0x54b57b+_0x2e5e4f(0x1b4):'in\x20'+_0x54b57b+'m';}else{if(_0x3cdb25<0x15180){const _0x15d0a9=Math[_0x2e5e4f(0x19d)](_0x3cdb25/0xe10);return _0x361a48?_0x15d0a9+'h\x20ago':'in\x20'+_0x15d0a9+'h';}else{if(_0x3cdb25<0x93a80){const _0x251d30=Math[_0x2e5e4f(0x19d)](_0x3cdb25/0x15180);return _0x361a48?_0x251d30+'d\x20ago':_0x2e5e4f(0x1a1)+_0x251d30+'d';}else return _0x2a7f45[_0x2e5e4f(0x1b8)]();}}}}export class ScheduleListCommand extends BaseCommand{[a36_0x448907(0x1ad)]='schedule:list';[a36_0x448907(0x1a8)]='List\x20scheduled\x20queries';async[a36_0x448907(0x1d4)](_0x1893e2){const _0x1b0e90=a36_0x448907,{options:_0x2709c7,args:_0x12efb9,tdx:_0x1f17d2}=_0x1893e2,_0x46f5b1=resolveLimit(_0x2709c7[_0x1b0e90(0x189)],DEFAULT_DISPLAY_LIMIT),_0x5e0579=_0x12efb9[0x0],_0x2ebbc9=_0x5e0579?_0x1b0e90(0x1c0)+_0x5e0579+'\x22...':_0x1b0e90(0x1a6),_0xc191b1=await withSpinner(_0x2ebbc9,()=>_0x1f17d2[_0x1b0e90(0x192)][_0x1b0e90(0x1f3)]({'limit':_0x46f5b1,'scheduled':!![],'pattern':_0x5e0579}),{'verbose':_0x2709c7[_0x1b0e90(0x1c8)]}),_0x1ea89f=_0xc191b1['data'][_0x1b0e90(0x1dd)],_0x345520=_0xc191b1[_0x1b0e90(0x19e)]['pagination'][_0x1b0e90(0x1d7)],_0x34a3ab=_0x5e0579?_0x1b0e90(0x1f5)+_0x5e0579+'\x22':'';_0x345520?console[_0x1b0e90(0x190)](_0x1b0e90(0x177)+_0x1ea89f[_0x1b0e90(0x18b)]+_0x1b0e90(0x18f)+_0x34a3ab+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x1b0e90(0x190)](_0x1b0e90(0x1ff)+_0x1ea89f[_0x1b0e90(0x18b)]+'\x20scheduled\x20quer'+(_0x1ea89f[_0x1b0e90(0x18b)]!==0x1?'ies':'y')+_0x34a3ab);if(_0x2709c7[_0x1b0e90(0x1fc)]===_0x1b0e90(0x17f)||_0x2709c7['format']===_0x1b0e90(0x1f8)||_0x2709c7['format']===_0x1b0e90(0x179)||_0x2709c7[_0x1b0e90(0x1fc)]===_0x1b0e90(0x186)){const _0x475eda=_0x1ea89f[_0x1b0e90(0x1f0)](_0xb2d4de=>({'id':_0xb2d4de['id'],'name':_0xb2d4de[_0x1b0e90(0x1ad)],'cron':_0xb2d4de[_0x1b0e90(0x174)],'database':_0xb2d4de[_0x1b0e90(0x1d5)]?.[_0x1b0e90(0x1ad)],'type':_0xb2d4de['type'],'timezone':_0xb2d4de[_0x1b0e90(0x1e4)],'user_name':_0xb2d4de[_0x1b0e90(0x1f2)]?.[_0x1b0e90(0x1ad)],'updated_at':_0xb2d4de[_0x1b0e90(0x1a5)],'next_run_at':_0xb2d4de[_0x1b0e90(0x1d3)],'last_job_status':_0xb2d4de[_0x1b0e90(0x1d2)]?.['status']}));await handleSDKOutput(_0x475eda,_0x2709c7);}else{if(_0x1ea89f[_0x1b0e90(0x18b)]===0x0)console[_0x1b0e90(0x1ca)](_0x1b0e90(0x1e0));else{const _0x3cfd63=_0x2709c7['site'],_0x2ab94b=_0x1ea89f[_0x1b0e90(0x1f0)](_0x569415=>{const _0x1255e0=_0x1b0e90,_0x494af3=_0x569415[_0x1255e0(0x1d2)]?.[_0x1255e0(0x1d9)]?_0x569415[_0x1255e0(0x1d2)][_0x1255e0(0x1d9)]==='success'?'✓':'✗':'-',_0x126e13=_0x569415['last_job']?.[_0x1255e0(0x1c1)]?formatRelativeTime(_0x569415[_0x1255e0(0x1d2)][_0x1255e0(0x1c1)]):'never',_0x1269c6=_0x569415['next_run_at']?formatRelativeTime(_0x569415[_0x1255e0(0x1d3)]):'-',_0x366336=_0x569415[_0x1255e0(0x174)]||'',_0x4d49bc=_0x569415['name']||_0x1255e0(0x1bb),_0x510be5=getConsoleUrl(_0x3cfd63,_0x1255e0(0x196)+_0x569415['id']);return{'statusIcon':_0x494af3,'lastRun':_0x126e13,'nextRun':_0x1269c6,'cron':_0x366336,'name':_0x4d49bc,'queryUrl':_0x510be5,'status':_0x569415[_0x1255e0(0x1d2)]?.[_0x1255e0(0x1d9)]};}),_0x4f9439=Math[_0x1b0e90(0x197)](..._0x2ab94b[_0x1b0e90(0x1f0)](_0x319f80=>_0x319f80['lastRun'][_0x1b0e90(0x18b)])),_0xa6b077=Math['max'](..._0x2ab94b[_0x1b0e90(0x1f0)](_0x485037=>_0x485037[_0x1b0e90(0x1fb)]['length'])),_0xacfcc8=Math[_0x1b0e90(0x197)](..._0x2ab94b[_0x1b0e90(0x1f0)](_0x5b503=>_0x5b503[_0x1b0e90(0x174)][_0x1b0e90(0x18b)])),_0x1d2587=_0x2ab94b[_0x1b0e90(0x1f0)](_0x2bd835=>{const _0x127d88=_0x1b0e90,_0x2009c9=_0x2bd835['status']===_0x127d88(0x1a0)?a36_0x248afb[_0x127d88(0x1c9)](_0x2bd835[_0x127d88(0x1f7)]):_0x2bd835[_0x127d88(0x1d9)]==='error'?a36_0x248afb[_0x127d88(0x1eb)](_0x2bd835[_0x127d88(0x1f7)]):a36_0x248afb[_0x127d88(0x1a7)](_0x2bd835[_0x127d88(0x1f7)]),_0x585d9f=_0x2bd835[_0x127d88(0x1e2)]['padEnd'](_0x4f9439),_0x53e369=_0x2bd835[_0x127d88(0x1fb)][_0x127d88(0x1be)](_0xa6b077),_0x2575b1=_0x2bd835[_0x127d88(0x174)]?a36_0x248afb[_0x127d88(0x1bf)](_0x2bd835['cron']['padEnd'](_0xacfcc8)):'\x20'[_0x127d88(0x1ce)](_0xacfcc8),_0xcf10f3=hyperlink(_0x2bd835[_0x127d88(0x1ad)],_0x2bd835[_0x127d88(0x1cf)]);return _0x127d88(0x1bd)+_0x2009c9+'\x20'+_0x585d9f+'\x20\x20→\x20'+_0x53e369+'\x20\x20'+_0x2575b1+'\x20\x20'+_0xcf10f3;});await writeOutput(_0x1d2587[_0x1b0e90(0x18c)]('\x0a'),_0x2709c7['output'],_0x1b0e90(0x1ab));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a36_0x448907(0x1ba);[a36_0x448907(0x1a8)]='Show\x20schedule\x20details';[a36_0x448907(0x1d8)](_0x21f39d){const _0x23906a=a36_0x448907,_0x440566=_0x21f39d[_0x23906a(0x17b)][0x0];if(!_0x440566)return _0x23906a(0x1c6);return undefined;}async[a36_0x448907(0x1d4)](_0x547148){const _0xe1ec5d=a36_0x448907,{options:_0x515aff,args:_0x336f0f,tdx:_0xdea53c}=_0x547148,_0x103582=_0x336f0f[0x0],_0x149cbe=await withSpinner(_0xe1ec5d(0x19c),()=>_0xdea53c['schedules'][_0xe1ec5d(0x1f1)](_0x103582),{'verbose':_0x515aff[_0xe1ec5d(0x1c8)]}),_0xe2d237=_0x149cbe[_0xe1ec5d(0x19e)],_0x13f9e0={'name':_0xe2d237[_0xe1ec5d(0x1ad)],'cron':_0xe2d237[_0xe1ec5d(0x174)],'database':_0xe2d237[_0xe1ec5d(0x1d5)],'type':_0xe2d237[_0xe1ec5d(0x1cc)],'timezone':_0xe2d237[_0xe1ec5d(0x17a)],'user_name':_0xe2d237[_0xe1ec5d(0x1f4)],'created_at':_0xe2d237[_0xe1ec5d(0x1fd)],'engine_version':_0xe2d237[_0xe1ec5d(0x1d0)],'executing_user_id':_0xe2d237[_0xe1ec5d(0x1da)],'query':_0xe2d237[_0xe1ec5d(0x17c)],'delay':_0xe2d237[_0xe1ec5d(0x1a4)],'priority':_0xe2d237['priority'],'retry_limit':_0xe2d237['retry_limit'],..._0xe2d237[_0xe1ec5d(0x1f6)]&&{'result':_0xe2d237['result']}};return await handleSingleObjectOutput(_0x13f9e0,_0x515aff),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a36_0x448907(0x1ad)]=a36_0x448907(0x17d);[a36_0x448907(0x1a8)]=a36_0x448907(0x178);['validate'](_0x1f49f7){const _0x38c1e5=a36_0x448907,_0x22f5da=_0x1f49f7[_0x38c1e5(0x17b)][0x0];if(!_0x22f5da)return _0x38c1e5(0x1b0);const _0x17e891=_0x1f49f7[_0x38c1e5(0x200)];if(!_0x17e891[_0x38c1e5(0x1d5)])return _0x38c1e5(0x1ae);return undefined;}async[a36_0x448907(0x1d4)](_0x4b6de2){const _0x14489c=a36_0x448907,{options:_0x4f17e9,args:_0x420680,tdx:_0x3e7d97}=_0x4b6de2,_0x2e85b1=_0x420680[0x0],_0x5bdd12=_0x4f17e9,_0x4851ee=_0x5bdd12[_0x14489c(0x1d5)],_0x4ecf2b=_0x5bdd12['file'],_0x2ecd91=_0x5bdd12[_0x14489c(0x1cc)]||'trino';let _0x922d8a;try{_0x922d8a=readFileSync(_0x4ecf2b,_0x14489c(0x188))[_0x14489c(0x1ec)]();}catch(_0x3fa4e5){throw new SDKError(ErrorCode[_0x14489c(0x1bc)],'Failed\x20to\x20read\x20file:\x20'+_0x4ecf2b,_0x3fa4e5 instanceof Error?_0x3fa4e5:undefined);}if(!_0x922d8a)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20file\x20is\x20empty');const _0x14cd67={'database':_0x4851ee,'query':_0x922d8a,'type':_0x2ecd91};if(_0x5bdd12[_0x14489c(0x174)])_0x14cd67[_0x14489c(0x174)]=_0x5bdd12['cron'];if(_0x5bdd12[_0x14489c(0x17a)])_0x14cd67['timezone']=_0x5bdd12['timezone'];if(_0x5bdd12[_0x14489c(0x1a4)]!==undefined)_0x14cd67['delay']=Number(_0x5bdd12[_0x14489c(0x1a4)]);if(_0x5bdd12[_0x14489c(0x1e3)]!==undefined)_0x14cd67[_0x14489c(0x1e3)]=Number(_0x5bdd12['priority']);if(_0x5bdd12[_0x14489c(0x18d)]!==undefined)_0x14cd67[_0x14489c(0x1b7)]=Number(_0x5bdd12[_0x14489c(0x18d)]);if(_0x5bdd12[_0x14489c(0x1ee)])_0x14cd67[_0x14489c(0x1d0)]=_0x5bdd12[_0x14489c(0x1ee)];if(_0x5bdd12['result'])_0x14cd67[_0x14489c(0x1f6)]=_0x5bdd12[_0x14489c(0x1f6)];if(_0x4f17e9[_0x14489c(0x1c8)]){console[_0x14489c(0x190)]('Creating\x20schedule:\x20'+_0x2e85b1),console['error']('\x20\x20Database:\x20'+_0x4851ee),console[_0x14489c(0x190)](_0x14489c(0x184)+_0x2ecd91);if(_0x14cd67[_0x14489c(0x174)])console[_0x14489c(0x190)](_0x14489c(0x1b2)+_0x14cd67[_0x14489c(0x174)]);if(_0x14cd67['timezone'])console['error'](_0x14489c(0x1c5)+_0x14cd67[_0x14489c(0x17a)]);}const _0x52fce4=await withSpinner('Creating\x20schedule...',()=>_0x3e7d97['schedules']['create'](_0x2e85b1,_0x14cd67),{'verbose':_0x4f17e9[_0x14489c(0x1c8)]});return console[_0x14489c(0x190)](_0x14489c(0x1af)+_0x52fce4['data'][_0x14489c(0x1ad)]),await handleSingleObjectOutput(_0x52fce4[_0x14489c(0x19e)],_0x4f17e9),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a36_0x448907(0x1ad)]=a36_0x448907(0x183);[a36_0x448907(0x1a8)]=a36_0x448907(0x1e7);[a36_0x448907(0x1d8)](_0x3d482e){const _0x3f2c87=a36_0x448907,_0x2a9dcf=_0x3d482e[_0x3f2c87(0x17b)][0x0];if(!_0x2a9dcf)return _0x3f2c87(0x1b6);return undefined;}async[a36_0x448907(0x1d4)](_0x406e6f){const _0x27f8ff=a36_0x448907,{options:_0x5b7386,args:_0x4c7a0f,tdx:_0x143c6d}=_0x406e6f,_0xe423ba=_0x4c7a0f[0x0],_0x2300cb=_0x5b7386,_0x36cdf9={};if(_0x2300cb['database'])_0x36cdf9[_0x27f8ff(0x1d5)]=_0x2300cb[_0x27f8ff(0x1d5)];if(_0x2300cb['type'])_0x36cdf9[_0x27f8ff(0x1cc)]=_0x2300cb[_0x27f8ff(0x1cc)];if(_0x2300cb['cron'])_0x36cdf9[_0x27f8ff(0x174)]=_0x2300cb[_0x27f8ff(0x174)];if(_0x2300cb[_0x27f8ff(0x17a)])_0x36cdf9['timezone']=_0x2300cb[_0x27f8ff(0x17a)];if(_0x2300cb['delay']!==undefined)_0x36cdf9['delay']=Number(_0x2300cb[_0x27f8ff(0x1a4)]);if(_0x2300cb['priority']!==undefined)_0x36cdf9[_0x27f8ff(0x1e3)]=Number(_0x2300cb['priority']);if(_0x2300cb[_0x27f8ff(0x18d)]!==undefined)_0x36cdf9[_0x27f8ff(0x1b7)]=Number(_0x2300cb['retryLimit']);if(_0x2300cb['engineVersion'])_0x36cdf9[_0x27f8ff(0x1d0)]=_0x2300cb[_0x27f8ff(0x1ee)];if(_0x2300cb['result'])_0x36cdf9[_0x27f8ff(0x1f6)]=_0x2300cb['result'];if(_0x2300cb[_0x27f8ff(0x193)])try{_0x36cdf9[_0x27f8ff(0x17c)]=readFileSync(_0x2300cb[_0x27f8ff(0x193)],'utf-8')[_0x27f8ff(0x1ec)]();}catch(_0x65a920){throw new SDKError(ErrorCode[_0x27f8ff(0x1bc)],_0x27f8ff(0x19b)+_0x2300cb[_0x27f8ff(0x193)],_0x65a920 instanceof Error?_0x65a920:undefined);}if(Object['keys'](_0x36cdf9)[_0x27f8ff(0x18b)]===0x0)throw new SDKError(ErrorCode[_0x27f8ff(0x1bc)],_0x27f8ff(0x181));if(_0x5b7386[_0x27f8ff(0x1c8)]){console['error'](_0x27f8ff(0x1c4)+_0xe423ba);for(const [_0x5da440,_0x9a032c]of Object[_0x27f8ff(0x19f)](_0x36cdf9)){_0x5da440===_0x27f8ff(0x17c)?console[_0x27f8ff(0x190)]('\x20\x20'+_0x5da440+':\x20'+_0x9a032c[_0x27f8ff(0x1ac)](0x0,0x32)+_0x27f8ff(0x1ea)):console[_0x27f8ff(0x190)]('\x20\x20'+_0x5da440+':\x20'+_0x9a032c);}}const _0x364645=await withSpinner(_0x27f8ff(0x1ef),()=>_0x143c6d['schedules']['update'](_0xe423ba,_0x36cdf9),{'verbose':_0x5b7386['verbose']});return console[_0x27f8ff(0x190)]('Schedule\x20updated:\x20'+_0x364645[_0x27f8ff(0x19e)][_0x27f8ff(0x1ad)]),await handleSingleObjectOutput(_0x364645[_0x27f8ff(0x19e)],_0x5b7386),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a36_0x448907(0x1e5);['description']=a36_0x448907(0x1d1);[a36_0x448907(0x1d8)](_0x2038e9){const _0x4b7b66=a36_0x448907,_0xfef3a6=_0x2038e9[_0x4b7b66(0x17b)][0x0];if(!_0xfef3a6)return _0x4b7b66(0x191);return undefined;}async['execute'](_0x487edb){const _0x5e98c3=a36_0x448907,{options:_0x1f8403,args:_0x2a6712,tdx:_0x4a0c6c}=_0x487edb,_0x548c7d=_0x2a6712[0x0];if(!_0x1f8403['yes']){const _0xa6375b=await confirm(_0x5e98c3(0x1cb)+_0x548c7d+'\x22?');if(!_0xa6375b)return console[_0x5e98c3(0x190)](_0x5e98c3(0x1b9)),0x0;}const _0x413d47=await withSpinner(_0x5e98c3(0x194),()=>_0x4a0c6c[_0x5e98c3(0x192)][_0x5e98c3(0x1a2)](_0x548c7d),{'verbose':_0x1f8403['verbose']});return console[_0x5e98c3(0x190)](_0x5e98c3(0x187)+_0x413d47[_0x5e98c3(0x19e)][_0x5e98c3(0x1ad)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a36_0x448907(0x1ad)]=a36_0x448907(0x1b1);[a36_0x448907(0x1a8)]='Run\x20a\x20scheduled\x20query\x20immediately';['validate'](_0xe91074){const _0x298fef=_0xe91074['args'][0x0];if(!_0x298fef)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0xd14748){const _0x5eb592=a36_0x448907,{options:_0x18a958,args:_0x4aa750,tdx:_0x249f50}=_0xd14748,_0x36f319=_0x4aa750[0x0],_0xc1b882=_0x18a958,_0x2faeaf=_0xc1b882[_0x5eb592(0x1aa)],_0x19deb7=_0xc1b882[_0x5eb592(0x1fa)]!==undefined?Number(_0xc1b882[_0x5eb592(0x1fa)]):undefined;if(_0x18a958['verbose']){console[_0x5eb592(0x190)](_0x5eb592(0x1cd)+_0x36f319);if(_0x2faeaf)console['error']('\x20\x20Time:\x20'+_0x2faeaf);if(_0x19deb7)console[_0x5eb592(0x190)](_0x5eb592(0x1b3)+_0x19deb7);}const _0x2a8f8c=await withSpinner(_0x5eb592(0x1e8),()=>_0x249f50[_0x5eb592(0x192)][_0x5eb592(0x17e)](_0x36f319,{'time':_0x2faeaf,'num':_0x19deb7}),{'verbose':_0x18a958[_0x5eb592(0x1c8)]}),_0x52f4ee=_0x2a8f8c[_0x5eb592(0x19e)][_0x5eb592(0x185)];console[_0x5eb592(0x190)](_0x5eb592(0x1ed)+_0x52f4ee['length']+'\x20job'+(_0x52f4ee[_0x5eb592(0x18b)]!==0x1?'s':'')+_0x5eb592(0x1dc));for(const _0x499704 of _0x52f4ee){console[_0x5eb592(0x190)](_0x5eb592(0x1e1)+_0x499704['job_id']);}return await handleSDKOutput(_0x52f4ee,_0x18a958),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a36_0x448907(0x1ad)]='schedule:history';[a36_0x448907(0x1a8)]=a36_0x448907(0x176);['validate'](_0x469388){const _0x1dda28=a36_0x448907,_0x1b8325=_0x469388[_0x1dda28(0x17b)][0x0];if(!_0x1b8325)return _0x1dda28(0x195);return undefined;}async[a36_0x448907(0x1d4)](_0x341cb1){const _0x53bd81=a36_0x448907,{options:_0x20275a,args:_0x52fbdf,tdx:_0x5cdf32}=_0x341cb1,_0x20366c=_0x52fbdf[0x0],_0x2dbf7a=_0x20275a,_0x585451=_0x2dbf7a[_0x53bd81(0x1e6)]!==undefined?Number(_0x2dbf7a['from']):undefined,_0x2f4064=_0x2dbf7a['to']!==undefined?Number(_0x2dbf7a['to']):undefined,_0x358791=await withSpinner(_0x53bd81(0x18a),()=>_0x5cdf32['schedules'][_0x53bd81(0x1c3)](_0x20366c,{'from':_0x585451,'to':_0x2f4064}),{'verbose':_0x20275a['verbose']}),_0x456b72=_0x358791[_0x53bd81(0x19e)];console[_0x53bd81(0x190)](_0x53bd81(0x1ff)+_0x456b72[_0x53bd81(0x19a)]+_0x53bd81(0x1de)+(_0x456b72[_0x53bd81(0x19a)]!==0x1?'s':'')+'\x20(showing\x20'+_0x456b72['from']+'-'+_0x456b72['to']+')');const _0xca252a=_0x456b72['history'][_0x53bd81(0x1f0)](_0x510416=>({'job_id':_0x510416['job_id'],'type':_0x510416[_0x53bd81(0x1cc)],'status':_0x510416['status'],'scheduled_at':_0x510416[_0x53bd81(0x1a3)],'created_at':_0x510416['created_at'],'start_at':_0x510416[_0x53bd81(0x1c7)],'end_at':_0x510416[_0x53bd81(0x198)]}));return await handleSDKOutput(_0xca252a,_0x20275a),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x4ce6ba=a37_0x3b59;(function(_0x2092a7,_0x82b5f6){const _0x1b0d03=a37_0x3b59,_0x2156d7=_0x2092a7();while(!![]){try{const _0x2e2a38=parseInt(_0x1b0d03(0x192))/0x1*(parseInt(_0x1b0d03(0x181))/0x2)+parseInt(_0x1b0d03(0x16c))/0x3*(parseInt(_0x1b0d03(0x174))/0x4)+parseInt(_0x1b0d03(0x1da))/0x5*(-parseInt(_0x1b0d03(0x16e))/0x6)+parseInt(_0x1b0d03(0x18b))/0x7+parseInt(_0x1b0d03(0x190))/0x8+-parseInt(_0x1b0d03(0x1fb))/0x9+-parseInt(_0x1b0d03(0x180))/0xa*(parseInt(_0x1b0d03(0x1ba))/0xb);if(_0x2e2a38===_0x82b5f6)break;else _0x2156d7['push'](_0x2156d7['shift']());}catch(_0x400fe0){_0x2156d7['push'](_0x2156d7['shift']());}}}(a37_0x2e8d,0xce8f3));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';function a37_0x2e8d(){const _0x8ee2e9=['processedRows','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Resolved\x20type:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','Resolved\x20YAML\x20file:\x20','\x27\x20with\x20ID:\x20','trim','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Resolved\x20parent\x20folder\x20ID:\x20','/app/ps/','2228913dvxEpv','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','stats','test','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','getSQLFromServerSegment','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','cause','segment:folder:list','parentFolder','\x20[Job\x20ID:\x20','✔\x20Found\x20','log','folderPath','Segment\x20ID:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segmentId','site','getParent','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','3DSBSNQ','createFolder','6sDibga','\x27...','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','web','Fetching\x20segment\x20details...','1993972hBQNpV','cyan','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Folder\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','Options:','name','Listing\x20folders\x20for\x20parent\x20\x27','segmentPath','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Resolved:\x20','Use:\x20tdx\x20ps\x20desc','370ueqdeu','177988rvYrfR','json','Resolved\x20folder\x20ID:\x20','path','parent','segment:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','limit','Resolved\x20relative\x20path\x20to:\x20','6620341TeDnBV','✖\x20Query\x20failed\x20[','query','\x20\x20Segment\x20name:\x20','Folder\x20name:\x20','10100992zWcaJu','verbose','12EtGjYs','INVALID_ARGUMENT','format','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','jsonl','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','SEGMENT_NOT_FOUND','getSegmentSQLFromYaml','resolveParentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','data','✔\x20Created\x20folder\x20\x27','Resolving\x20folder\x20\x27','segmentName','red','getSQLFromYamlFile','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20view\x20-w','segment:folder:show','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Resolving\x20\x27','resolveFolderId','(root)','execute','length','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20folder','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20reference\x20is\x20required','Usage:','in\x20','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','resolvePathToResource','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','parentId','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','getSegmentSQL','784949cmrXIT','Show\x20segment\x20folder\x20details','Examples:','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','parentSegment','setJobId','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20sg\x20show\x20<name>','segment','information_schema','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','toLocaleString','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','✔\x20Query\x20completed:\x20Processed\x20','folderId','folder','\x20\x20Parent\x20segment:\x20','fullPath','Parent\x20segment:\x20','listFolders','Resolving\x20parent\x20folder\x20\x27','replace','\x20\x20Full\x20path:\x20','Resolved\x20parent\x20ID:\x20','Parent\x20ID:\x20','segment:view','Error:\x20','Fetching\x20SQL\x20for\x20segment...','Executing\x20segment\x20query...','204005lxPffv','description','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20Cause:\x20','url','content','Use:\x20tdx\x20ps\x20view','\x20rows\x20','Parent\x20name:\x20','getFolder','type','/e/','message','Usage:\x20tdx\x20segment\x20describe\x20<path>','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','error','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Folder\x20path:\x20','Target\x20path:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'];a37_0x2e8d=function(){return _0x8ee2e9;};return a37_0x2e8d();}import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a37_0x3b59(_0x331e0d,_0x111d6a){_0x331e0d=_0x331e0d-0x160;const _0x2e8d6a=a37_0x2e8d();let _0x3b596f=_0x2e8d6a[_0x331e0d];return _0x3b596f;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a37_0x48fa66 from'chalk';async function resolveSegmentTarget(_0x3296ff,_0x5bc478,_0x4c0f4a){const _0xbe8eed=a37_0x3b59;if(isYamlFilePath(_0x3296ff))try{const _0x3f97b7=await resolveYamlFilePath(_0x3296ff);return _0x4c0f4a&&(console[_0xbe8eed(0x1e9)](_0xbe8eed(0x1f3)+_0x3296ff),console[_0xbe8eed(0x1e9)](_0xbe8eed(0x1cd)+_0x3f97b7[_0xbe8eed(0x1c0)]),console[_0xbe8eed(0x1e9)](_0xbe8eed(0x18e)+_0x3f97b7[_0xbe8eed(0x1a1)]),console[_0xbe8eed(0x1e9)](_0xbe8eed(0x1eb)+(_0x3f97b7[_0xbe8eed(0x165)]||_0xbe8eed(0x1ab))),console[_0xbe8eed(0x1e9)](_0xbe8eed(0x1d3)+_0x3f97b7[_0xbe8eed(0x1ce)])),_0x3f97b7['fullPath'];}catch(_0x2f3a4f){throw new SDKError(ErrorCode[_0xbe8eed(0x193)],_0xbe8eed(0x1f0)+_0x2f3a4f[_0xbe8eed(0x1e6)]);}if(!_0x5bc478)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x5bc478+'/'+_0x3296ff;}export class SegmentDescribeCommand extends BaseCommand{[a37_0x4ce6ba(0x17a)]='segment:describe';['description']='Show\x20segment\x20or\x20folder\x20details';async[a37_0x4ce6ba(0x1ac)](_0x1ac1f8){const _0x2e324c=a37_0x4ce6ba,{options:_0x4462c1,args:_0x157ebb,tdx:_0xeb52c}=_0x1ac1f8,_0x5b8536=_0x157ebb[0x0],_0x1642fc=!_0x5b8536&&!!_0x4462c1['parentSegment'],_0x139302=_0x5b8536||_0x4462c1['parentSegment'];if(!_0x139302)return console[_0x2e324c(0x1e9)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x2e324c(0x1e7)),console[_0x2e324c(0x1e9)](_0x2e324c(0x1bc)),console[_0x2e324c(0x1e9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x2e324c(0x1e9)](_0x2e324c(0x1c9)),console['error'](_0x2e324c(0x171)),console[_0x2e324c(0x1e9)](_0x2e324c(0x202)),0x1;try{const _0x304212=_0x4462c1[_0x2e324c(0x17c)];let _0x144a56=_0x139302;!_0x1642fc&&_0x304212&&!_0x139302['includes']('/')&&(_0x144a56=_0x304212+'/'+_0x139302,_0x4462c1[_0x2e324c(0x191)]&&console[_0x2e324c(0x1e9)](_0x2e324c(0x18a)+_0x144a56));const _0x280aa1=await withSpinner('Resolving\x20path\x20\x27'+_0x144a56+_0x2e324c(0x16f),()=>_0xeb52c[_0x2e324c(0x1c5)][_0x2e324c(0x1b5)](_0x144a56),{'verbose':_0x4462c1[_0x2e324c(0x191)]}),_0x5b7b3f=_0x280aa1[_0x2e324c(0x19e)];_0x4462c1['verbose']&&(console['error'](_0x2e324c(0x1f1)+_0x5b7b3f[_0x2e324c(0x1e4)]),console[_0x2e324c(0x1e9)](_0x2e324c(0x1d5)+_0x5b7b3f[_0x2e324c(0x1b7)]),_0x5b7b3f[_0x2e324c(0x1cb)]&&console[_0x2e324c(0x1e9)](_0x2e324c(0x177)+_0x5b7b3f[_0x2e324c(0x1cb)]),_0x5b7b3f[_0x2e324c(0x168)]&&console[_0x2e324c(0x1e9)](_0x2e324c(0x166)+_0x5b7b3f['segmentId']));if(_0x5b7b3f[_0x2e324c(0x1e4)]==='parent'){const _0x4a09c1=await withSpinner(_0x2e324c(0x178),()=>_0xeb52c[_0x2e324c(0x1c5)][_0x2e324c(0x16a)](_0x5b7b3f[_0x2e324c(0x1b7)]),{'verbose':_0x4462c1[_0x2e324c(0x191)]});await handleSingleObjectOutput(_0x4a09c1[_0x2e324c(0x19e)],_0x4462c1);}else{if(_0x5b7b3f[_0x2e324c(0x1e4)]===_0x2e324c(0x1cc)){if(!_0x5b7b3f[_0x2e324c(0x1cb)])throw new SDKError(ErrorCode[_0x2e324c(0x1bd)],_0x2e324c(0x188));const _0x11bd08=await withSpinner('Fetching\x20folder\x20details...',()=>_0xeb52c[_0x2e324c(0x1c5)]['getFolder'](_0x5b7b3f[_0x2e324c(0x1cb)]),{'verbose':_0x4462c1[_0x2e324c(0x191)]});await handleSingleObjectOutput(_0x11bd08[_0x2e324c(0x19e)],_0x4462c1);}else{if(_0x5b7b3f[_0x2e324c(0x1e4)]===_0x2e324c(0x1c5)){if(!_0x5b7b3f[_0x2e324c(0x168)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x24c50d=await withSpinner(_0x2e324c(0x173),()=>_0xeb52c[_0x2e324c(0x1c5)]['getSegment'](_0x5b7b3f[_0x2e324c(0x1b7)],_0x5b7b3f['segmentId']),{'verbose':_0x4462c1['verbose']});await handleSingleObjectOutput(_0x24c50d[_0x2e324c(0x19e)],_0x4462c1);}}}return 0x0;}catch(_0x14d0c3){if(_0x14d0c3 instanceof SDKError)return console[_0x2e324c(0x1e9)]('Error:\x20'+_0x14d0c3[_0x2e324c(0x1e6)]),_0x14d0c3[_0x2e324c(0x205)]&&console[_0x2e324c(0x1e9)](_0x2e324c(0x1dd)+_0x14d0c3['cause']),0x1;throw _0x14d0c3;}}}export class SegmentShowCommand extends BaseCommand{[a37_0x4ce6ba(0x17a)]=a37_0x4ce6ba(0x186);[a37_0x4ce6ba(0x1db)]=a37_0x4ce6ba(0x1ed);async['execute'](_0x1b3109){const _0x45bf5c=a37_0x4ce6ba,{options:_0x488521,args:_0x4937ec,tdx:_0x1bd900}=_0x1b3109,_0x165436=_0x4937ec[0x0];if(!_0x165436)return console[_0x45bf5c(0x1e9)](_0x45bf5c(0x1a8)),console[_0x45bf5c(0x1e9)](_0x45bf5c(0x1c4)),console[_0x45bf5c(0x1e9)](_0x45bf5c(0x187)),console['error'](_0x45bf5c(0x1bc)),console[_0x45bf5c(0x1e9)](_0x45bf5c(0x1fc)),console['error'](_0x45bf5c(0x1c2)),0x1;try{const _0x4b7433=_0x488521[_0x45bf5c(0x1c0)],_0x27e1bc=await resolveSegmentTarget(_0x165436,_0x4b7433,_0x488521[_0x45bf5c(0x191)]);_0x488521['verbose']&&console[_0x45bf5c(0x1e9)](_0x45bf5c(0x1ec)+_0x27e1bc);const _0x4e0cde=await withSpinner(_0x45bf5c(0x1a9)+_0x165436+'\x27...',()=>_0x1bd900[_0x45bf5c(0x1c5)][_0x45bf5c(0x1b5)](_0x27e1bc),{'verbose':_0x488521[_0x45bf5c(0x191)]}),_0x3d984e=_0x4e0cde[_0x45bf5c(0x19e)];_0x488521[_0x45bf5c(0x191)]&&(console['error'](_0x45bf5c(0x1f1)+_0x3d984e[_0x45bf5c(0x1e4)]),console[_0x45bf5c(0x1e9)](_0x45bf5c(0x1d5)+_0x3d984e[_0x45bf5c(0x1b7)]));if(_0x3d984e[_0x45bf5c(0x1e4)]===_0x45bf5c(0x1cc))return console[_0x45bf5c(0x1e9)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x45bf5c(0x1e9)](_0x45bf5c(0x1dc)),0x1;if(_0x3d984e[_0x45bf5c(0x1e4)]===_0x45bf5c(0x185))return console[_0x45bf5c(0x1e9)](_0x45bf5c(0x1fe)),console[_0x45bf5c(0x1e9)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x3d984e['segmentId'])throw new SDKError(ErrorCode[_0x45bf5c(0x19a)],_0x45bf5c(0x1ea));const _0x42b2c4=await withSpinner(_0x45bf5c(0x1d8),()=>_0x1bd900[_0x45bf5c(0x1c5)][_0x45bf5c(0x1b9)](_0x3d984e[_0x45bf5c(0x1b7)],_0x3d984e[_0x45bf5c(0x168)]),{'verbose':_0x488521['verbose']});let _0x2ed8e4=_0x42b2c4[_0x45bf5c(0x19e)];const _0x3e9c74=resolveLimit(_0x488521[_0x45bf5c(0x189)],DEFAULT_DISPLAY_LIMIT),_0x1e873c=/\bLIMIT\s+\d+/i[_0x45bf5c(0x200)](_0x2ed8e4);!_0x1e873c&&(_0x2ed8e4=_0x2ed8e4[_0x45bf5c(0x1f5)]()[_0x45bf5c(0x1d2)](/;+$/,''),_0x2ed8e4=_0x45bf5c(0x1c3)+_0x2ed8e4+_0x45bf5c(0x167)+_0x3e9c74);_0x488521[_0x45bf5c(0x191)]&&console[_0x45bf5c(0x1e9)](_0x45bf5c(0x195)+_0x2ed8e4);const _0x3c3aae=await withProgressSpinner(_0x45bf5c(0x1d9),async _0x2033ec=>{const _0x5d1d92=_0x45bf5c,_0x2cc6c5=await _0x1bd900[_0x5d1d92(0x18d)][_0x5d1d92(0x1ac)](_0x2ed8e4,{'catalog':'td','schema':_0x5d1d92(0x1c6),'onJobId':_0x5b3633=>{const _0x57e652=_0x5d1d92;_0x2033ec[_0x57e652(0x1c1)](_0x5b3633);}});return _0x2cc6c5;},{'verbose':_0x488521[_0x45bf5c(0x191)]}),_0x3abf18=_0x3c3aae[_0x45bf5c(0x19e)],_0x117f62=_0x3abf18['jobId']?_0x45bf5c(0x162)+_0x3abf18['jobId']+']':'';return console['error'](_0x45bf5c(0x1ca)+_0x3abf18[_0x45bf5c(0x1ff)][_0x45bf5c(0x1ef)][_0x45bf5c(0x1c8)]()+_0x45bf5c(0x1e1)+(_0x45bf5c(0x1b3)+formatElapsed(_0x3abf18[_0x45bf5c(0x1ff)]['elapsedTimeMillis'])+_0x117f62)),await handleQueryOutput(_0x3abf18,_0x488521),0x0;}catch(_0xbbd1e4){if(_0xbbd1e4 instanceof SDKError)return console['error'](_0x45bf5c(0x18c)+_0xbbd1e4['code']+']'),console[_0x45bf5c(0x1e9)]('\x0a'+_0xbbd1e4['message']),0x1;throw _0xbbd1e4;}}}export class SegmentFolderListCommand extends BaseCommand{[a37_0x4ce6ba(0x17a)]=a37_0x4ce6ba(0x160);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a37_0x4ce6ba(0x1ac)](_0x5c3d59){const _0x1315a1=a37_0x4ce6ba,{options:_0x43ac40,args:_0xa6ec58,tdx:_0x511b60}=_0x5c3d59;if(_0xa6ec58[_0x1315a1(0x1ad)]===0x0)return console['error'](_0x1315a1(0x19d)),console[_0x1315a1(0x1e9)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x30b2df=_0xa6ec58[0x0];try{_0x43ac40[_0x1315a1(0x191)]&&(console[_0x1315a1(0x1e9)]('Site:\x20'+_0x43ac40[_0x1315a1(0x169)]),console[_0x1315a1(0x1e9)](_0x1315a1(0x1e2)+_0x30b2df));const _0x1ee2f6=await withSpinner(_0x1315a1(0x1fd)+_0x30b2df+_0x1315a1(0x16f),()=>_0x511b60['segment'][_0x1315a1(0x19c)](_0x30b2df),{'verbose':_0x43ac40['verbose']}),_0x515537=_0x1ee2f6['data'];_0x43ac40[_0x1315a1(0x191)]&&console[_0x1315a1(0x1e9)](_0x1315a1(0x1d4)+_0x515537);const _0x221041=await withSpinner(_0x1315a1(0x17b)+_0x30b2df+_0x1315a1(0x16f),()=>_0x511b60[_0x1315a1(0x1c5)][_0x1315a1(0x1d0)](_0x515537),{'verbose':_0x43ac40['verbose']}),_0x1e15bc=_0x221041[_0x1315a1(0x19e)];return console[_0x1315a1(0x1e9)](_0x1315a1(0x163)+_0x1e15bc[_0x1315a1(0x1ad)]+_0x1315a1(0x1af)+(_0x1e15bc[_0x1315a1(0x1ad)]!==0x1?'s':'')),await handleSDKOutput(_0x1e15bc,_0x43ac40),0x0;}catch(_0x5103b0){if(_0x5103b0 instanceof SDKError)return console['error'](_0x1315a1(0x1d7)+_0x5103b0['message']),_0x5103b0['cause']&&console[_0x1315a1(0x1e9)](_0x1315a1(0x1dd)+_0x5103b0[_0x1315a1(0x205)]),0x1;throw _0x5103b0;}}}export class SegmentFolderShowCommand extends BaseCommand{[a37_0x4ce6ba(0x17a)]=a37_0x4ce6ba(0x1a6);['description']=a37_0x4ce6ba(0x1bb);async[a37_0x4ce6ba(0x1ac)](_0x4ff054){const _0x5c9eef=a37_0x4ce6ba,{options:_0x1b6b4d,args:_0x53a01a,tdx:_0x45f491}=_0x4ff054;if(_0x53a01a[_0x5c9eef(0x1ad)]===0x0)return console[_0x5c9eef(0x1e9)](_0x5c9eef(0x1b1)),console[_0x5c9eef(0x1e9)](_0x5c9eef(0x16b)),0x1;try{const {parentId:_0x36ef72,childId:_0x1da1fb}=parseSegmentRef(_0x53a01a[0x0]);_0x1b6b4d[_0x5c9eef(0x191)]&&(console[_0x5c9eef(0x1e9)]('Site:\x20'+_0x1b6b4d[_0x5c9eef(0x169)]),console[_0x5c9eef(0x1e9)]('Parent\x20name:\x20'+_0x36ef72),_0x1da1fb&&console['error'](_0x5c9eef(0x18f)+_0x1da1fb));if(!_0x1da1fb)return console[_0x5c9eef(0x1e9)](_0x5c9eef(0x201)),0x1;const _0x2d703d=await withSpinner(_0x5c9eef(0x1fd)+_0x36ef72+'\x27...',()=>_0x45f491[_0x5c9eef(0x1c5)]['resolveParentId'](_0x36ef72),{'verbose':_0x1b6b4d[_0x5c9eef(0x191)]}),_0x19261d=_0x2d703d['data'];_0x1b6b4d[_0x5c9eef(0x191)]&&console[_0x5c9eef(0x1e9)](_0x5c9eef(0x1d4)+_0x19261d);const _0x39a76f=await withSpinner(_0x5c9eef(0x1a0)+_0x1da1fb+_0x5c9eef(0x16f),()=>_0x45f491[_0x5c9eef(0x1c5)][_0x5c9eef(0x1aa)](_0x19261d,_0x1da1fb),{'verbose':_0x1b6b4d[_0x5c9eef(0x191)]}),_0x312ade=_0x39a76f['data'];_0x1b6b4d[_0x5c9eef(0x191)]&&console['error'](_0x5c9eef(0x183)+_0x312ade);const _0x51ab2c=await withSpinner('Fetching\x20folder\x20\x27'+_0x1da1fb+'\x27...',()=>_0x45f491[_0x5c9eef(0x1c5)]['getFolder'](_0x312ade),{'verbose':_0x1b6b4d[_0x5c9eef(0x191)]});return await handleSDKOutput([_0x51ab2c['data']],_0x1b6b4d),0x0;}catch(_0x4030ef){if(_0x4030ef instanceof SDKError)return console[_0x5c9eef(0x1e9)]('Error:\x20'+_0x4030ef[_0x5c9eef(0x1e6)]),_0x4030ef[_0x5c9eef(0x205)]&&console[_0x5c9eef(0x1e9)](_0x5c9eef(0x1dd)+_0x4030ef[_0x5c9eef(0x205)]),0x1;throw _0x4030ef;}}}export class SegmentSQLCommand extends BaseCommand{[a37_0x4ce6ba(0x17a)]='segment:sql';[a37_0x4ce6ba(0x1db)]=a37_0x4ce6ba(0x1f2);async[a37_0x4ce6ba(0x1ac)](_0xa1025b){const _0x4f5c2e=a37_0x4ce6ba,{options:_0x840b4,args:_0x3fa182}=_0xa1025b,_0x5af6fb=_0x840b4,_0x12a10d=_0x5af6fb[_0x4f5c2e(0x184)],_0x583857=_0x3fa182[0x0];if(!_0x583857&&!_0x12a10d)return console[_0x4f5c2e(0x1e9)](a37_0x48fa66[_0x4f5c2e(0x1a2)](_0x4f5c2e(0x1e8))),console[_0x4f5c2e(0x1e9)](_0x4f5c2e(0x1b2)),console['error'](_0x4f5c2e(0x1b4)),console['error'](_0x4f5c2e(0x1ee)),console['error']('Examples:'),console[_0x4f5c2e(0x1e9)](_0x4f5c2e(0x1a4)),console['error']('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0x583857&&_0x12a10d)return console[_0x4f5c2e(0x1e9)](a37_0x48fa66[_0x4f5c2e(0x1a2)](_0x4f5c2e(0x1f6))),0x1;try{let _0x7a0682;if(_0x12a10d)_0x7a0682=await this[_0x4f5c2e(0x1a3)](_0x12a10d,_0xa1025b);else{if(isYamlFilePath(_0x583857))return console['error'](a37_0x48fa66['red'](_0x4f5c2e(0x199))),console[_0x4f5c2e(0x1e9)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0x583857),0x1;else _0x7a0682=await this[_0x4f5c2e(0x203)](_0x583857,_0xa1025b);}return _0x840b4[_0x4f5c2e(0x194)]===_0x4f5c2e(0x182)||_0x840b4['format']===_0x4f5c2e(0x198)?await handleSDKOutput([{'sql':_0x7a0682}],_0x840b4):console[_0x4f5c2e(0x164)](_0x7a0682),0x0;}catch(_0x6d025b){if(_0x6d025b instanceof SDKError)return console['error'](_0x4f5c2e(0x1d7)+_0x6d025b[_0x4f5c2e(0x1e6)]),_0x6d025b[_0x4f5c2e(0x205)]&&console['error'](_0x4f5c2e(0x1dd)+_0x6d025b[_0x4f5c2e(0x205)]),0x1;throw _0x6d025b;}}async[a37_0x4ce6ba(0x1a3)](_0x3e34bd,_0x33c2a2){const _0x54d8e7=a37_0x4ce6ba,{options:_0x37547c,tdx:_0x33c8e0}=_0x33c2a2;let _0x36a625;try{_0x36a625=await resolveYamlFilePath(_0x3e34bd);}catch(_0x5d356a){throw new SDKError(ErrorCode[_0x54d8e7(0x193)],_0x54d8e7(0x1f0)+_0x5d356a[_0x54d8e7(0x1e6)]);}_0x37547c[_0x54d8e7(0x191)]&&console[_0x54d8e7(0x1e9)](_0x54d8e7(0x17e)+_0x36a625['parentSegment']+'/'+_0x36a625[_0x54d8e7(0x1a1)]);const _0x526d52=await withSpinner('Fetching\x20SQL\x20from\x20rule...',()=>_0x33c8e0['segment'][_0x54d8e7(0x19b)](_0x36a625[_0x54d8e7(0x1df)],_0x36a625[_0x54d8e7(0x1c0)],_0x36a625[_0x54d8e7(0x1a1)]),{'verbose':_0x37547c['verbose']});return _0x526d52[_0x54d8e7(0x19e)];}async[a37_0x4ce6ba(0x203)](_0x1f34a2,_0x4bd7f6){const _0x14f678=a37_0x4ce6ba,{options:_0x91b53d,tdx:_0x280645}=_0x4bd7f6,_0x1abd30=_0x91b53d[_0x14f678(0x1c0)],_0x27e672=await resolveSegmentTarget(_0x1f34a2,_0x1abd30,_0x91b53d[_0x14f678(0x191)]);_0x91b53d[_0x14f678(0x191)]&&console[_0x14f678(0x1e9)](_0x14f678(0x1ec)+_0x27e672);const _0x4de214=await withSpinner(_0x14f678(0x1a9)+_0x1f34a2+_0x14f678(0x16f),()=>_0x280645['segment'][_0x14f678(0x1b5)](_0x27e672),{'verbose':_0x91b53d[_0x14f678(0x191)]}),_0x1658ec=_0x4de214[_0x14f678(0x19e)];_0x91b53d[_0x14f678(0x191)]&&(console[_0x14f678(0x1e9)](_0x14f678(0x1f1)+_0x1658ec[_0x14f678(0x1e4)]),console[_0x14f678(0x1e9)](_0x14f678(0x1d5)+_0x1658ec[_0x14f678(0x1b7)]));if(_0x1658ec[_0x14f678(0x1e4)]===_0x14f678(0x1cc))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x14f678(0x17d));if(_0x1658ec[_0x14f678(0x1e4)]===_0x14f678(0x185))throw new SDKError(ErrorCode[_0x14f678(0x193)],_0x14f678(0x1f8));if(!_0x1658ec[_0x14f678(0x168)])throw new SDKError(ErrorCode[_0x14f678(0x19a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xe72506=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x280645['segment']['getSegmentSQL'](_0x1658ec[_0x14f678(0x1b7)],_0x1658ec[_0x14f678(0x168)]),{'verbose':_0x91b53d['verbose']});return _0xe72506[_0x14f678(0x19e)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a37_0x4ce6ba(0x17a)]='segment:folder:create';[a37_0x4ce6ba(0x1db)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x747be0){const _0x1d56d6=a37_0x4ce6ba,{options:_0x4a524b,args:_0x2629d4,tdx:_0x11d397}=_0x747be0,_0x111271=_0x4a524b;if(_0x2629d4[_0x1d56d6(0x1ad)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1d56d6(0x1e9)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0xdd08c3=_0x2629d4[0x0],_0x33776f=_0x2629d4[0x1];_0x111271['verbose']&&(console[_0x1d56d6(0x1e9)]('Site:\x20'+_0x111271[_0x1d56d6(0x169)]),console['error'](_0x1d56d6(0x1cf)+_0xdd08c3),console[_0x1d56d6(0x1e9)]('Folder\x20name:\x20'+_0x33776f));let _0x4c5d83;if(_0x111271[_0x1d56d6(0x161)]){const _0xd10426=_0x111271[_0x1d56d6(0x161)],_0x38b70a=await withSpinner(_0x1d56d6(0x1fd)+_0xdd08c3+_0x1d56d6(0x16f),()=>_0x11d397[_0x1d56d6(0x1c5)][_0x1d56d6(0x19c)](_0xdd08c3),{'verbose':_0x111271[_0x1d56d6(0x191)]}),_0x18cc56=_0x38b70a[_0x1d56d6(0x19e)],_0x14a1bb=await withSpinner(_0x1d56d6(0x1d1)+_0xd10426+'\x27...',()=>_0x11d397['segment'][_0x1d56d6(0x1aa)](_0x18cc56,_0xd10426),{'verbose':_0x111271[_0x1d56d6(0x191)]});_0x4c5d83=_0x14a1bb[_0x1d56d6(0x19e)],_0x111271[_0x1d56d6(0x191)]&&console['error'](_0x1d56d6(0x1f9)+_0x4c5d83);}const _0x5b9df2={'name':_0x33776f,'description':_0x111271[_0x1d56d6(0x1db)],'parentFolderId':_0x4c5d83},_0x57d43c=await withSpinner('Creating\x20folder\x20\x27'+_0x33776f+'\x27...',()=>_0x11d397['segment'][_0x1d56d6(0x16d)](_0xdd08c3,_0x5b9df2),{'verbose':_0x111271[_0x1d56d6(0x191)]}),_0x7f4e16=_0x57d43c[_0x1d56d6(0x19e)];return console['error'](_0x1d56d6(0x19f)+_0x7f4e16[_0x1d56d6(0x17a)]+_0x1d56d6(0x1f4)+_0x7f4e16['id']),await handleSDKOutput([_0x7f4e16],_0x111271),0x0;}}export class SegmentViewCommand extends BaseCommand{[a37_0x4ce6ba(0x17a)]=a37_0x4ce6ba(0x1d6);[a37_0x4ce6ba(0x1db)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a37_0x4ce6ba(0x1ac)](_0x1b8e36){const _0x4c8e32=a37_0x4ce6ba,{options:_0x42b140,args:_0x213e9f,tdx:_0x176fe4}=_0x1b8e36,_0x109276=_0x213e9f[0x0];if(!_0x109276)return console[_0x4c8e32(0x1e9)](_0x4c8e32(0x204)),console['error'](_0x4c8e32(0x1f7)),console[_0x4c8e32(0x1e9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x4c8e32(0x1e9)](_0x4c8e32(0x179)),console[_0x4c8e32(0x1e9)](_0x4c8e32(0x1b8)),console['error'](_0x4c8e32(0x1bc)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4c8e32(0x1e9)](_0x4c8e32(0x196)),console[_0x4c8e32(0x1e9)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x4c8e32(0x1e9)](_0x4c8e32(0x1bf)),0x1;try{const _0x156587=_0x42b140[_0x4c8e32(0x1c0)],_0x1a3451=await resolveSegmentTarget(_0x109276,_0x156587,_0x42b140[_0x4c8e32(0x191)]);_0x42b140[_0x4c8e32(0x191)]&&console[_0x4c8e32(0x1e9)]('Target\x20path:\x20'+_0x1a3451);const _0x39b7ad=await withSpinner(_0x4c8e32(0x1a9)+_0x109276+_0x4c8e32(0x16f),()=>_0x176fe4['segment'][_0x4c8e32(0x1b5)](_0x1a3451),{'verbose':_0x42b140[_0x4c8e32(0x191)]}),_0x5df735=_0x39b7ad[_0x4c8e32(0x19e)];_0x42b140[_0x4c8e32(0x191)]&&(console[_0x4c8e32(0x1e9)]('Resolved\x20type:\x20'+_0x5df735['type']),console[_0x4c8e32(0x1e9)]('Parent\x20ID:\x20'+_0x5df735[_0x4c8e32(0x1b7)]),_0x5df735[_0x4c8e32(0x1cb)]&&console[_0x4c8e32(0x1e9)](_0x4c8e32(0x177)+_0x5df735['folderId']),_0x5df735['segmentId']&&console[_0x4c8e32(0x1e9)]('Segment\x20ID:\x20'+_0x5df735[_0x4c8e32(0x168)]));if(_0x42b140[_0x4c8e32(0x172)]){if(_0x5df735[_0x4c8e32(0x1e4)]===_0x4c8e32(0x1cc))return console[_0x4c8e32(0x1e9)](_0x4c8e32(0x1c7)),0x1;if(_0x5df735[_0x4c8e32(0x1e4)]==='parent')return console[_0x4c8e32(0x1e9)](_0x4c8e32(0x1a7)),console[_0x4c8e32(0x1e9)](_0x4c8e32(0x1a5)),0x1;if(!_0x5df735['segmentId'])throw new SDKError(ErrorCode[_0x4c8e32(0x19a)],_0x4c8e32(0x1ea));const _0x5db7b7=getConsoleNextUrl(_0x42b140[_0x4c8e32(0x169)],_0x4c8e32(0x1fa)+_0x5df735[_0x4c8e32(0x1b7)]+'/e/'+_0x5df735[_0x4c8e32(0x168)]);return console['error'](a37_0x48fa66['green']('✔')+'\x20Opening\x20'+a37_0x48fa66[_0x4c8e32(0x175)](_0x5db7b7)),openBrowser(_0x5db7b7),0x0;}if(_0x5df735['type']===_0x4c8e32(0x1cc)){if(!_0x5df735[_0x4c8e32(0x1cb)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x4c8e32(0x188));const _0x3fadff=await withSpinner(_0x4c8e32(0x1be),()=>_0x176fe4[_0x4c8e32(0x1c5)][_0x4c8e32(0x1e3)](_0x5df735[_0x4c8e32(0x1cb)]),{'verbose':_0x42b140[_0x4c8e32(0x191)]});await handleSingleObjectOutput(_0x3fadff[_0x4c8e32(0x19e)],_0x42b140);}else{if(_0x5df735[_0x4c8e32(0x1e4)]===_0x4c8e32(0x1c5)){if(!_0x5df735[_0x4c8e32(0x168)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4c8e32(0x1ea));const _0x5c7b1a=await withSpinner(_0x4c8e32(0x173),()=>_0x176fe4[_0x4c8e32(0x1c5)]['getSegment'](_0x5df735[_0x4c8e32(0x1b7)],_0x5df735[_0x4c8e32(0x168)]),{'verbose':_0x42b140[_0x4c8e32(0x191)]}),_0x317546=getConsoleNextUrl(_0x42b140[_0x4c8e32(0x169)],'/app/ps/'+_0x5df735['parentId']+_0x4c8e32(0x1e5)+_0x5df735[_0x4c8e32(0x168)]),_0x53f5aa=_0x5c7b1a[_0x4c8e32(0x19e)];_0x53f5aa[_0x4c8e32(0x1de)]=_0x317546,await handleSingleObjectOutput(_0x53f5aa,_0x42b140);}else return console[_0x4c8e32(0x1e9)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x4c8e32(0x1e9)](_0x4c8e32(0x1e0)),0x1;}return 0x0;}catch(_0x3aff1f){if(_0x3aff1f instanceof SDKError)return console[_0x4c8e32(0x1e9)](_0x4c8e32(0x1d7)+_0x3aff1f[_0x4c8e32(0x1e6)]),_0x3aff1f[_0x4c8e32(0x205)]&&console[_0x4c8e32(0x1e9)](_0x4c8e32(0x1dd)+_0x3aff1f[_0x4c8e32(0x205)]),0x1;throw _0x3aff1f;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a37_0x4ce6ba(0x17a)]='segment:desc';[a37_0x4ce6ba(0x1db)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x1bddeb){const _0x460b12=a37_0x4ce6ba,{options:_0x4deaa2,args:_0x990816,tdx:_0x4ac42f}=_0x1bddeb,_0x207019=_0x990816[0x0];if(!_0x207019)return console[_0x460b12(0x1e9)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x460b12(0x1e9)](_0x460b12(0x1ae)),console['error'](_0x460b12(0x197)),console[_0x460b12(0x1e9)](_0x460b12(0x1bc)),console[_0x460b12(0x1e9)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x460b12(0x1e9)](_0x460b12(0x176)),0x1;try{const _0x33ddef=_0x4deaa2[_0x460b12(0x1c0)],_0x50fbe6=await resolveSegmentTarget(_0x207019,_0x33ddef,_0x4deaa2[_0x460b12(0x191)]);_0x4deaa2[_0x460b12(0x191)]&&console['error'](_0x460b12(0x1ec)+_0x50fbe6);const _0xd6bd24=await withSpinner(_0x460b12(0x1a9)+_0x207019+_0x460b12(0x16f),()=>_0x4ac42f[_0x460b12(0x1c5)]['resolvePathToResource'](_0x50fbe6),{'verbose':_0x4deaa2['verbose']}),_0x35069e=_0xd6bd24[_0x460b12(0x19e)];_0x4deaa2[_0x460b12(0x191)]&&(console[_0x460b12(0x1e9)](_0x460b12(0x1f1)+_0x35069e[_0x460b12(0x1e4)]),console[_0x460b12(0x1e9)]('Parent\x20ID:\x20'+_0x35069e[_0x460b12(0x1b7)]));if(_0x35069e[_0x460b12(0x1e4)]===_0x460b12(0x1cc))return console['error'](_0x460b12(0x1b6)),console[_0x460b12(0x1e9)](_0x460b12(0x170)),0x1;if(_0x35069e[_0x460b12(0x1e4)]==='parent')return console[_0x460b12(0x1e9)](_0x460b12(0x1b0)),console[_0x460b12(0x1e9)](_0x460b12(0x17f)),0x1;if(!_0x35069e[_0x460b12(0x168)])throw new SDKError(ErrorCode[_0x460b12(0x19a)],_0x460b12(0x1ea));const _0x2ffbb=await withSpinner(_0x460b12(0x1d8),()=>_0x4ac42f[_0x460b12(0x1c5)][_0x460b12(0x1b9)](_0x35069e[_0x460b12(0x1b7)],_0x35069e['segmentId']),{'verbose':_0x4deaa2[_0x460b12(0x191)]}),_0x4a9fe9=_0x2ffbb[_0x460b12(0x19e)],_0x3e39ad=await executeSchemaQuery(_0x4a9fe9,_0x4ac42f,_0x4deaa2);return await handleQueryOutput(_0x3e39ad,_0x4deaa2),0x0;}catch(_0x597e46){if(_0x597e46 instanceof SDKError)return console[_0x460b12(0x1e9)]('Error:\x20'+_0x597e46[_0x460b12(0x1e6)]),_0x597e46[_0x460b12(0x205)]&&console[_0x460b12(0x1e9)](_0x460b12(0x1dd)+_0x597e46[_0x460b12(0x205)]),0x1;throw _0x597e46;}}}
|
|
1
|
+
const a37_0x21b2dc=a37_0x3e70;(function(_0x403a4a,_0x2e1e54){const _0x326db8=a37_0x3e70,_0x210127=_0x403a4a();while(!![]){try{const _0x52f280=-parseInt(_0x326db8(0x18c))/0x1*(-parseInt(_0x326db8(0x1e7))/0x2)+-parseInt(_0x326db8(0x1e2))/0x3+parseInt(_0x326db8(0x174))/0x4+parseInt(_0x326db8(0x184))/0x5+parseInt(_0x326db8(0x199))/0x6+-parseInt(_0x326db8(0x172))/0x7+-parseInt(_0x326db8(0x16a))/0x8*(parseInt(_0x326db8(0x1ce))/0x9);if(_0x52f280===_0x2e1e54)break;else _0x210127['push'](_0x210127['shift']());}catch(_0x19d2b9){_0x210127['push'](_0x210127['shift']());}}}(a37_0x153a,0xc604b));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';import a37_0x5e0d32 from'chalk';async function resolveSegmentTarget(_0x1088fd,_0x12da83,_0x4b68bf){const _0x4aa283=a37_0x3e70;if(isYamlFilePath(_0x1088fd))try{const _0x4c29fd=await resolveYamlFilePath(_0x1088fd);return _0x4b68bf&&(console[_0x4aa283(0x19a)](_0x4aa283(0x1c3)+_0x1088fd),console['error'](_0x4aa283(0x1ea)+_0x4c29fd['parentSegment']),console[_0x4aa283(0x19a)](_0x4aa283(0x15f)+_0x4c29fd['segmentName']),console['error'](_0x4aa283(0x1e6)+(_0x4c29fd[_0x4aa283(0x17d)]||_0x4aa283(0x159))),console[_0x4aa283(0x19a)](_0x4aa283(0x19f)+_0x4c29fd[_0x4aa283(0x188)])),_0x4c29fd[_0x4aa283(0x188)];}catch(_0x173915){throw new SDKError(ErrorCode[_0x4aa283(0x1fb)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x173915['message']);}if(!_0x12da83)throw new SDKError(ErrorCode[_0x4aa283(0x1fb)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x12da83+'/'+_0x1088fd;}export class SegmentDescribeCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1b3);[a37_0x21b2dc(0x185)]='Show\x20segment\x20or\x20folder\x20details';async[a37_0x21b2dc(0x176)](_0x230cb0){const _0x2ed816=a37_0x21b2dc,{options:_0x2f319a,args:_0x364e1d,tdx:_0x1a23fb}=_0x230cb0,_0x4b905e=_0x364e1d[0x0],_0x3d8f22=!_0x4b905e&&!!_0x2f319a[_0x2ed816(0x196)],_0x333504=_0x4b905e||_0x2f319a[_0x2ed816(0x196)];if(!_0x333504)return console[_0x2ed816(0x19a)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x2ed816(0x19a)](_0x2ed816(0x161)),console['error'](_0x2ed816(0x17b)),console[_0x2ed816(0x19a)](_0x2ed816(0x1c0)),console[_0x2ed816(0x19a)](_0x2ed816(0x1bb)),console[_0x2ed816(0x19a)](_0x2ed816(0x1e4)),console[_0x2ed816(0x19a)](_0x2ed816(0x1a7)),0x1;try{const _0x15e6fa=_0x2f319a[_0x2ed816(0x200)];let _0x417bc7=_0x333504;!_0x3d8f22&&_0x15e6fa&&!_0x333504[_0x2ed816(0x1b6)]('/')&&(_0x417bc7=_0x15e6fa+'/'+_0x333504,_0x2f319a['verbose']&&console[_0x2ed816(0x19a)](_0x2ed816(0x16b)+_0x417bc7));const _0x1367a2=await withSpinner(_0x2ed816(0x1f0)+_0x417bc7+_0x2ed816(0x1f5),()=>_0x1a23fb[_0x2ed816(0x1ef)][_0x2ed816(0x1eb)](_0x417bc7),{'verbose':_0x2f319a[_0x2ed816(0x1bd)]}),_0x11fdf8=_0x1367a2['data'];_0x2f319a[_0x2ed816(0x1bd)]&&(console[_0x2ed816(0x19a)](_0x2ed816(0x1d0)+_0x11fdf8['type']),console[_0x2ed816(0x19a)](_0x2ed816(0x1b2)+_0x11fdf8['parentId']),_0x11fdf8[_0x2ed816(0x15c)]&&console['error'](_0x2ed816(0x1ed)+_0x11fdf8[_0x2ed816(0x15c)]),_0x11fdf8['segmentId']&&console[_0x2ed816(0x19a)](_0x2ed816(0x1d1)+_0x11fdf8[_0x2ed816(0x183)]));if(_0x11fdf8[_0x2ed816(0x163)]==='parent'){const _0x3306cf=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x1a23fb['segment'][_0x2ed816(0x1ae)](_0x11fdf8[_0x2ed816(0x1ab)]),{'verbose':_0x2f319a['verbose']});await handleSingleObjectOutput(_0x3306cf[_0x2ed816(0x16c)],_0x2f319a);}else{if(_0x11fdf8[_0x2ed816(0x163)]===_0x2ed816(0x1c2)){if(!_0x11fdf8[_0x2ed816(0x15c)])throw new SDKError(ErrorCode[_0x2ed816(0x1ff)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5ac3ab=await withSpinner(_0x2ed816(0x17f),()=>_0x1a23fb[_0x2ed816(0x1ef)][_0x2ed816(0x1a8)](_0x11fdf8[_0x2ed816(0x15c)]),{'verbose':_0x2f319a[_0x2ed816(0x1bd)]});await handleSingleObjectOutput(_0x5ac3ab[_0x2ed816(0x16c)],_0x2f319a);}else{if(_0x11fdf8[_0x2ed816(0x163)]===_0x2ed816(0x1ef)){if(!_0x11fdf8[_0x2ed816(0x183)])throw new SDKError(ErrorCode[_0x2ed816(0x1de)],_0x2ed816(0x1fa));const _0x31d373=await withSpinner(_0x2ed816(0x16f),()=>_0x1a23fb[_0x2ed816(0x1ef)]['getSegment'](_0x11fdf8[_0x2ed816(0x1ab)],_0x11fdf8[_0x2ed816(0x183)]),{'verbose':_0x2f319a[_0x2ed816(0x1bd)]});await handleSingleObjectOutput(_0x31d373['data'],_0x2f319a);}}}return 0x0;}catch(_0x4dde9c){if(_0x4dde9c instanceof SDKError)return console[_0x2ed816(0x19a)](_0x2ed816(0x1e8)+_0x4dde9c[_0x2ed816(0x164)]),_0x4dde9c[_0x2ed816(0x168)]&&console[_0x2ed816(0x19a)](_0x2ed816(0x1ca)+_0x4dde9c[_0x2ed816(0x168)]),0x1;throw _0x4dde9c;}}}function a37_0x3e70(_0x4c4a68,_0x1fca3e){_0x4c4a68=_0x4c4a68-0x159;const _0x153a0c=a37_0x153a();let _0x3e701d=_0x153a0c[_0x4c4a68];return _0x3e701d;}export class SegmentShowCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1db);[a37_0x21b2dc(0x185)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x5b67b5){const _0x4a5763=a37_0x21b2dc,{options:_0xc15026,args:_0x3390ff,tdx:_0x51dfa6}=_0x5b67b5,_0x5d14aa=_0x3390ff[0x0];if(!_0x5d14aa)return console[_0x4a5763(0x19a)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4a5763(0x19a)](_0x4a5763(0x169)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x4a5763(0x19a)]('Examples:'),console[_0x4a5763(0x19a)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x4a5763(0x19a)](_0x4a5763(0x1fd)),0x1;try{const _0x48a993=_0xc15026[_0x4a5763(0x196)],_0x5b9b50=await resolveSegmentTarget(_0x5d14aa,_0x48a993,_0xc15026['verbose']);_0xc15026[_0x4a5763(0x1bd)]&&console[_0x4a5763(0x19a)](_0x4a5763(0x1f7)+_0x5b9b50);const _0x53111f=await withSpinner('Resolving\x20\x27'+_0x5d14aa+'\x27...',()=>_0x51dfa6[_0x4a5763(0x1ef)]['resolvePathToResource'](_0x5b9b50),{'verbose':_0xc15026['verbose']}),_0x382b1c=_0x53111f[_0x4a5763(0x16c)];_0xc15026[_0x4a5763(0x1bd)]&&(console[_0x4a5763(0x19a)](_0x4a5763(0x1d0)+_0x382b1c[_0x4a5763(0x163)]),console['error']('Parent\x20ID:\x20'+_0x382b1c[_0x4a5763(0x1ab)]));if(_0x382b1c['type']===_0x4a5763(0x1c2))return console[_0x4a5763(0x19a)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x4a5763(0x19a)](_0x4a5763(0x1f8)),0x1;if(_0x382b1c[_0x4a5763(0x163)]===_0x4a5763(0x197))return console[_0x4a5763(0x19a)](_0x4a5763(0x171)),console['error'](_0x4a5763(0x189)),0x1;if(!_0x382b1c[_0x4a5763(0x183)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4d563a=await withSpinner(_0x4a5763(0x170),()=>_0x51dfa6[_0x4a5763(0x1ef)]['getSegmentSQL'](_0x382b1c[_0x4a5763(0x1ab)],_0x382b1c[_0x4a5763(0x183)]),{'verbose':_0xc15026['verbose']});let _0x4aeb92=_0x4d563a['data'];const _0x3b3661=resolveLimit(_0xc15026[_0x4a5763(0x1d9)],DEFAULT_DISPLAY_LIMIT),_0x154655=/\bLIMIT\s+\d+/i[_0x4a5763(0x1cc)](_0x4aeb92);!_0x154655&&(_0x4aeb92=_0x4aeb92[_0x4a5763(0x19e)]()[_0x4a5763(0x182)](/;+$/,''),_0x4aeb92=_0x4a5763(0x1d4)+_0x4aeb92+_0x4a5763(0x19c)+_0x3b3661);_0xc15026[_0x4a5763(0x1bd)]&&console['error'](_0x4a5763(0x15a)+_0x4aeb92);const _0x129ca5=await withProgressSpinner(_0x4a5763(0x1e3),async _0x20b646=>{const _0x6e2d4e=_0x4a5763,_0x28727f=await _0x51dfa6[_0x6e2d4e(0x1bc)]['execute'](_0x4aeb92,{'catalog':'td','schema':_0x6e2d4e(0x162),'onJobId':_0x6cb1c7=>{const _0x364821=_0x6e2d4e;_0x20b646[_0x364821(0x1fe)](_0x6cb1c7);}});return _0x28727f;},{'verbose':_0xc15026[_0x4a5763(0x1bd)]}),_0x5a8740=_0x129ca5[_0x4a5763(0x16c)],_0x1e67bf=_0x5a8740[_0x4a5763(0x1df)]?_0x4a5763(0x1f2)+_0x5a8740['jobId']+']':'';return console[_0x4a5763(0x19a)](_0x4a5763(0x191)+_0x5a8740[_0x4a5763(0x15b)]['processedRows'][_0x4a5763(0x18f)]()+_0x4a5763(0x1e0)+(_0x4a5763(0x1c1)+formatElapsed(_0x5a8740[_0x4a5763(0x15b)][_0x4a5763(0x201)])+_0x1e67bf)),await handleQueryOutput(_0x5a8740,_0xc15026),0x0;}catch(_0x4b14ab){if(_0x4b14ab instanceof SDKError)return console['error'](_0x4a5763(0x1b0)+_0x4b14ab[_0x4a5763(0x180)]+']'),console[_0x4a5763(0x19a)]('\x0a'+_0x4b14ab[_0x4a5763(0x164)]),0x1;throw _0x4b14ab;}}}export class SegmentFolderListCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1d2);[a37_0x21b2dc(0x185)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a37_0x21b2dc(0x176)](_0x5c0398){const _0x2d5468=a37_0x21b2dc,{options:_0x450b26,args:_0x62f1b2,tdx:_0x204abc}=_0x5c0398;if(_0x62f1b2[_0x2d5468(0x1c9)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x56d8e8=_0x62f1b2[0x0];try{_0x450b26[_0x2d5468(0x1bd)]&&(console[_0x2d5468(0x19a)](_0x2d5468(0x1a2)+_0x450b26[_0x2d5468(0x192)]),console['error'](_0x2d5468(0x19d)+_0x56d8e8));const _0x51551e=await withSpinner(_0x2d5468(0x1aa)+_0x56d8e8+_0x2d5468(0x1f5),()=>_0x204abc[_0x2d5468(0x1ef)][_0x2d5468(0x186)](_0x56d8e8),{'verbose':_0x450b26[_0x2d5468(0x1bd)]}),_0x5b18ad=_0x51551e[_0x2d5468(0x16c)];_0x450b26['verbose']&&console[_0x2d5468(0x19a)](_0x2d5468(0x190)+_0x5b18ad);const _0x5d83ed=await withSpinner(_0x2d5468(0x165)+_0x56d8e8+_0x2d5468(0x1f5),()=>_0x204abc[_0x2d5468(0x1ef)][_0x2d5468(0x1c5)](_0x5b18ad),{'verbose':_0x450b26[_0x2d5468(0x1bd)]}),_0x3e63ab=_0x5d83ed['data'];return console['error'](_0x2d5468(0x16e)+_0x3e63ab[_0x2d5468(0x1c9)]+_0x2d5468(0x1b9)+(_0x3e63ab[_0x2d5468(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0x3e63ab,_0x450b26),0x0;}catch(_0x1b49fb){if(_0x1b49fb instanceof SDKError)return console[_0x2d5468(0x19a)](_0x2d5468(0x1e8)+_0x1b49fb[_0x2d5468(0x164)]),_0x1b49fb[_0x2d5468(0x168)]&&console[_0x2d5468(0x19a)]('\x20\x20Cause:\x20'+_0x1b49fb[_0x2d5468(0x168)]),0x1;throw _0x1b49fb;}}}export class SegmentFolderShowCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1f9);[a37_0x21b2dc(0x185)]=a37_0x21b2dc(0x193);async[a37_0x21b2dc(0x176)](_0x33f3e1){const _0x2add3e=a37_0x21b2dc,{options:_0x5a13fb,args:_0x257edc,tdx:_0x164438}=_0x33f3e1;if(_0x257edc['length']===0x0)return console[_0x2add3e(0x19a)](_0x2add3e(0x1f4)),console['error'](_0x2add3e(0x1cd)),0x1;try{const {parentId:_0x2657ea,childId:_0x2a21de}=parseSegmentRef(_0x257edc[0x0]);_0x5a13fb[_0x2add3e(0x1bd)]&&(console[_0x2add3e(0x19a)](_0x2add3e(0x1a2)+_0x5a13fb['site']),console[_0x2add3e(0x19a)](_0x2add3e(0x19d)+_0x2657ea),_0x2a21de&&console['error']('Folder\x20name:\x20'+_0x2a21de));if(!_0x2a21de)return console['error'](_0x2add3e(0x1c6)),0x1;const _0x121e6e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2657ea+_0x2add3e(0x1f5),()=>_0x164438[_0x2add3e(0x1ef)][_0x2add3e(0x186)](_0x2657ea),{'verbose':_0x5a13fb[_0x2add3e(0x1bd)]}),_0x440811=_0x121e6e['data'];_0x5a13fb['verbose']&&console[_0x2add3e(0x19a)](_0x2add3e(0x190)+_0x440811);const _0x163984=await withSpinner(_0x2add3e(0x179)+_0x2a21de+_0x2add3e(0x1f5),()=>_0x164438['segment'][_0x2add3e(0x1a1)](_0x440811,_0x2a21de),{'verbose':_0x5a13fb[_0x2add3e(0x1bd)]}),_0x5195f8=_0x163984[_0x2add3e(0x16c)];_0x5a13fb[_0x2add3e(0x1bd)]&&console[_0x2add3e(0x19a)]('Resolved\x20folder\x20ID:\x20'+_0x5195f8);const _0x5caae9=await withSpinner(_0x2add3e(0x1d7)+_0x2a21de+_0x2add3e(0x1f5),()=>_0x164438[_0x2add3e(0x1ef)]['getFolder'](_0x5195f8),{'verbose':_0x5a13fb[_0x2add3e(0x1bd)]});return await handleSDKOutput([_0x5caae9[_0x2add3e(0x16c)]],_0x5a13fb),0x0;}catch(_0x1533f6){if(_0x1533f6 instanceof SDKError)return console[_0x2add3e(0x19a)](_0x2add3e(0x1e8)+_0x1533f6[_0x2add3e(0x164)]),_0x1533f6[_0x2add3e(0x168)]&&console[_0x2add3e(0x19a)](_0x2add3e(0x1ca)+_0x1533f6[_0x2add3e(0x168)]),0x1;throw _0x1533f6;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a37_0x21b2dc(0x187);['description']=a37_0x21b2dc(0x1ba);async[a37_0x21b2dc(0x176)](_0x3eb250){const _0x3cfe40=a37_0x21b2dc,{options:_0x50af30,args:_0x53eb6d}=_0x3eb250,_0x530cf6=_0x50af30,_0x2f7cec=_0x530cf6['path'],_0x23917b=_0x53eb6d[0x0];if(!_0x23917b&&!_0x2f7cec)return console[_0x3cfe40(0x19a)](a37_0x5e0d32[_0x3cfe40(0x1a5)](_0x3cfe40(0x1da))),console[_0x3cfe40(0x19a)](_0x3cfe40(0x181)),console[_0x3cfe40(0x19a)](_0x3cfe40(0x167)),console['error']('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0x3cfe40(0x19a)](_0x3cfe40(0x17b)),console[_0x3cfe40(0x19a)](_0x3cfe40(0x15d)),console[_0x3cfe40(0x19a)](_0x3cfe40(0x17e)),0x1;if(_0x23917b&&_0x2f7cec)return console[_0x3cfe40(0x19a)](a37_0x5e0d32['red'](_0x3cfe40(0x160))),0x1;try{let _0x2f4ac2;if(_0x2f7cec)_0x2f4ac2=await this[_0x3cfe40(0x1fc)](_0x2f7cec,_0x3eb250);else{if(isYamlFilePath(_0x23917b))return console[_0x3cfe40(0x19a)](a37_0x5e0d32[_0x3cfe40(0x1a5)](_0x3cfe40(0x1f6))),console['error'](_0x3cfe40(0x177)+_0x23917b),0x1;else _0x2f4ac2=await this[_0x3cfe40(0x1a3)](_0x23917b,_0x3eb250);}return _0x50af30[_0x3cfe40(0x1af)]===_0x3cfe40(0x1cf)||_0x50af30[_0x3cfe40(0x1af)]==='jsonl'?await handleSDKOutput([{'sql':_0x2f4ac2}],_0x50af30):console[_0x3cfe40(0x18a)](_0x2f4ac2),0x0;}catch(_0x1661a3){if(_0x1661a3 instanceof SDKError)return console['error'](_0x3cfe40(0x1e8)+_0x1661a3[_0x3cfe40(0x164)]),_0x1661a3['cause']&&console[_0x3cfe40(0x19a)]('\x20\x20Cause:\x20'+_0x1661a3[_0x3cfe40(0x168)]),0x1;throw _0x1661a3;}}async[a37_0x21b2dc(0x1fc)](_0x48ffe1,_0x827fbe){const _0x12af37=a37_0x21b2dc,{options:_0x170931,tdx:_0x52be96}=_0x827fbe;let _0x172091;try{_0x172091=await resolveYamlFilePath(_0x48ffe1);}catch(_0x5cedd3){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12af37(0x18d)+_0x5cedd3[_0x12af37(0x164)]);}_0x170931[_0x12af37(0x1bd)]&&console[_0x12af37(0x19a)](_0x12af37(0x1cb)+_0x172091['parentSegment']+'/'+_0x172091[_0x12af37(0x1a6)]);const _0x5e70a2=await withSpinner('Fetching\x20SQL\x20from\x20rule...',()=>_0x52be96[_0x12af37(0x1ef)][_0x12af37(0x1ad)](_0x172091['content'],_0x172091[_0x12af37(0x196)],_0x172091[_0x12af37(0x1a6)]),{'verbose':_0x170931[_0x12af37(0x1bd)]});return _0x5e70a2[_0x12af37(0x16c)];}async['getSQLFromServerSegment'](_0x2a4c51,_0x56a2b9){const _0x424212=a37_0x21b2dc,{options:_0x1e48b3,tdx:_0xd3371b}=_0x56a2b9,_0x5f84a=_0x1e48b3['parentSegment'],_0x45d5cd=await resolveSegmentTarget(_0x2a4c51,_0x5f84a,_0x1e48b3[_0x424212(0x1bd)]);_0x1e48b3['verbose']&&console['error'](_0x424212(0x1f7)+_0x45d5cd);const _0x45447c=await withSpinner(_0x424212(0x16d)+_0x2a4c51+_0x424212(0x1f5),()=>_0xd3371b[_0x424212(0x1ef)][_0x424212(0x1eb)](_0x45d5cd),{'verbose':_0x1e48b3[_0x424212(0x1bd)]}),_0x525067=_0x45447c[_0x424212(0x16c)];_0x1e48b3[_0x424212(0x1bd)]&&(console[_0x424212(0x19a)](_0x424212(0x1d0)+_0x525067['type']),console[_0x424212(0x19a)](_0x424212(0x1b2)+_0x525067['parentId']));if(_0x525067[_0x424212(0x163)]===_0x424212(0x1c2))throw new SDKError(ErrorCode[_0x424212(0x1fb)],_0x424212(0x1c7));if(_0x525067[_0x424212(0x163)]===_0x424212(0x197))throw new SDKError(ErrorCode[_0x424212(0x1fb)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x525067['segmentId'])throw new SDKError(ErrorCode[_0x424212(0x1de)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x39f246=await withSpinner(_0x424212(0x170),()=>_0xd3371b[_0x424212(0x1ef)][_0x424212(0x1a4)](_0x525067[_0x424212(0x1ab)],_0x525067['segmentId']),{'verbose':_0x1e48b3[_0x424212(0x1bd)]});return _0x39f246['data'];}}export class SegmentFolderCreateCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x195);['description']=a37_0x21b2dc(0x1d6);async[a37_0x21b2dc(0x176)](_0x4ede91){const _0x348bf8=a37_0x21b2dc,{options:_0x52562a,args:_0x3db5c3,tdx:_0x45cf4e}=_0x4ede91,_0x155d5f=_0x52562a;if(_0x3db5c3[_0x348bf8(0x1c9)]<0x2)return console[_0x348bf8(0x19a)](_0x348bf8(0x17a)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x179fff=_0x3db5c3[0x0],_0xdec9b=_0x3db5c3[0x1];_0x155d5f[_0x348bf8(0x1bd)]&&(console['error'](_0x348bf8(0x1a2)+_0x155d5f['site']),console['error'](_0x348bf8(0x19b)+_0x179fff),console[_0x348bf8(0x19a)](_0x348bf8(0x175)+_0xdec9b));let _0x288a86;if(_0x155d5f['parentFolder']){const _0x30650a=_0x155d5f[_0x348bf8(0x1a0)],_0x20fb4f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x179fff+_0x348bf8(0x1f5),()=>_0x45cf4e['segment']['resolveParentId'](_0x179fff),{'verbose':_0x155d5f[_0x348bf8(0x1bd)]}),_0xb3383=_0x20fb4f[_0x348bf8(0x16c)],_0x172d8a=await withSpinner(_0x348bf8(0x1a9)+_0x30650a+_0x348bf8(0x1f5),()=>_0x45cf4e[_0x348bf8(0x1ef)]['resolveFolderId'](_0xb3383,_0x30650a),{'verbose':_0x155d5f[_0x348bf8(0x1bd)]});_0x288a86=_0x172d8a[_0x348bf8(0x16c)],_0x155d5f[_0x348bf8(0x1bd)]&&console[_0x348bf8(0x19a)](_0x348bf8(0x1dd)+_0x288a86);}const _0x2a77a0={'name':_0xdec9b,'description':_0x155d5f[_0x348bf8(0x185)],'parentFolderId':_0x288a86},_0x208748=await withSpinner(_0x348bf8(0x15e)+_0xdec9b+_0x348bf8(0x1f5),()=>_0x45cf4e[_0x348bf8(0x1ef)]['createFolder'](_0x179fff,_0x2a77a0),{'verbose':_0x155d5f[_0x348bf8(0x1bd)]}),_0x5828ea=_0x208748[_0x348bf8(0x16c)];return console[_0x348bf8(0x19a)]('✔\x20Created\x20folder\x20\x27'+_0x5828ea[_0x348bf8(0x173)]+_0x348bf8(0x1e9)+_0x5828ea['id']),await handleSDKOutput([_0x5828ea],_0x155d5f),0x0;}}export class SegmentViewCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1f1);[a37_0x21b2dc(0x185)]='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x143f77){const _0x1a1f22=a37_0x21b2dc,{options:_0xaa8aa5,args:_0xd757b3,tdx:_0x1801a5}=_0x143f77,_0x22757a=_0xd757b3[0x0];if(!_0x22757a)return console[_0x1a1f22(0x19a)](_0x1a1f22(0x17c)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1ee)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1dc)),console['error'](_0x1a1f22(0x194)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1b8)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x17b)),console[_0x1a1f22(0x19a)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1bf)),console['error'](_0x1a1f22(0x18b)),console[_0x1a1f22(0x19a)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2509e2=_0xaa8aa5[_0x1a1f22(0x196)],_0x1dda1f=await resolveSegmentTarget(_0x22757a,_0x2509e2,_0xaa8aa5[_0x1a1f22(0x1bd)]);_0xaa8aa5[_0x1a1f22(0x1bd)]&&console[_0x1a1f22(0x19a)](_0x1a1f22(0x1f7)+_0x1dda1f);const _0x15c031=await withSpinner(_0x1a1f22(0x16d)+_0x22757a+_0x1a1f22(0x1f5),()=>_0x1801a5['segment'][_0x1a1f22(0x1eb)](_0x1dda1f),{'verbose':_0xaa8aa5[_0x1a1f22(0x1bd)]}),_0x2ecb9e=_0x15c031[_0x1a1f22(0x16c)];_0xaa8aa5[_0x1a1f22(0x1bd)]&&(console['error']('Resolved\x20type:\x20'+_0x2ecb9e[_0x1a1f22(0x163)]),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1b2)+_0x2ecb9e['parentId']),_0x2ecb9e['folderId']&&console[_0x1a1f22(0x19a)](_0x1a1f22(0x1ed)+_0x2ecb9e[_0x1a1f22(0x15c)]),_0x2ecb9e[_0x1a1f22(0x183)]&&console[_0x1a1f22(0x19a)]('Segment\x20ID:\x20'+_0x2ecb9e[_0x1a1f22(0x183)]));if(_0xaa8aa5[_0x1a1f22(0x1b7)]){if(_0x2ecb9e[_0x1a1f22(0x163)]==='folder')return console['error'](_0x1a1f22(0x1c4)),0x1;if(_0x2ecb9e[_0x1a1f22(0x163)]===_0x1a1f22(0x197))return console[_0x1a1f22(0x19a)](_0x1a1f22(0x1f3)),console['error'](_0x1a1f22(0x1d5)),0x1;if(!_0x2ecb9e['segmentId'])throw new SDKError(ErrorCode[_0x1a1f22(0x1de)],_0x1a1f22(0x1fa));const _0x5ecc7c=getConsoleNextUrl(_0xaa8aa5[_0x1a1f22(0x192)],_0x1a1f22(0x1ac)+_0x2ecb9e[_0x1a1f22(0x1ab)]+_0x1a1f22(0x1d3)+_0x2ecb9e[_0x1a1f22(0x183)]);return console[_0x1a1f22(0x19a)](a37_0x5e0d32['green']('✔')+_0x1a1f22(0x18e)+a37_0x5e0d32['cyan'](_0x5ecc7c)),openBrowser(_0x5ecc7c),0x0;}if(_0x2ecb9e[_0x1a1f22(0x163)]===_0x1a1f22(0x1c2)){if(!_0x2ecb9e[_0x1a1f22(0x15c)])throw new SDKError(ErrorCode[_0x1a1f22(0x1ff)],_0x1a1f22(0x1d8));const _0xa0dac2=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1801a5['segment'][_0x1a1f22(0x1a8)](_0x2ecb9e[_0x1a1f22(0x15c)]),{'verbose':_0xaa8aa5['verbose']});await handleSingleObjectOutput(_0xa0dac2[_0x1a1f22(0x16c)],_0xaa8aa5);}else{if(_0x2ecb9e[_0x1a1f22(0x163)]===_0x1a1f22(0x1ef)){if(!_0x2ecb9e[_0x1a1f22(0x183)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1a1f22(0x1fa));const _0x407ef5=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1801a5[_0x1a1f22(0x1ef)][_0x1a1f22(0x1b1)](_0x2ecb9e[_0x1a1f22(0x1ab)],_0x2ecb9e['segmentId']),{'verbose':_0xaa8aa5[_0x1a1f22(0x1bd)]}),_0x451630=getConsoleNextUrl(_0xaa8aa5[_0x1a1f22(0x192)],_0x1a1f22(0x1ac)+_0x2ecb9e[_0x1a1f22(0x1ab)]+'/e/'+_0x2ecb9e[_0x1a1f22(0x183)]),_0x2098bb=_0x407ef5[_0x1a1f22(0x16c)];_0x2098bb[_0x1a1f22(0x178)]=_0x451630,await handleSingleObjectOutput(_0x2098bb,_0xaa8aa5);}else return console[_0x1a1f22(0x19a)](_0x1a1f22(0x198)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x166)),0x1;}return 0x0;}catch(_0xf2cb20){if(_0xf2cb20 instanceof SDKError)return console['error']('Error:\x20'+_0xf2cb20[_0x1a1f22(0x164)]),_0xf2cb20['cause']&&console[_0x1a1f22(0x19a)](_0x1a1f22(0x1ca)+_0xf2cb20['cause']),0x1;throw _0xf2cb20;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1be);['description']=a37_0x21b2dc(0x1ec);async[a37_0x21b2dc(0x176)](_0x1f773e){const _0x589686=a37_0x21b2dc,{options:_0x138f9f,args:_0x4af93d,tdx:_0x2ff124}=_0x1f773e,_0x582488=_0x4af93d[0x0];if(!_0x582488)return console['error'](_0x589686(0x1b4)),console[_0x589686(0x19a)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x589686(0x1e1)),console['error']('Examples:'),console[_0x589686(0x19a)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x589686(0x19a)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5d7aa8=_0x138f9f['parentSegment'],_0x57507a=await resolveSegmentTarget(_0x582488,_0x5d7aa8,_0x138f9f[_0x589686(0x1bd)]);_0x138f9f['verbose']&&console['error'](_0x589686(0x1f7)+_0x57507a);const _0x5b59b0=await withSpinner(_0x589686(0x16d)+_0x582488+'\x27...',()=>_0x2ff124[_0x589686(0x1ef)][_0x589686(0x1eb)](_0x57507a),{'verbose':_0x138f9f[_0x589686(0x1bd)]}),_0x4c2230=_0x5b59b0['data'];_0x138f9f[_0x589686(0x1bd)]&&(console[_0x589686(0x19a)](_0x589686(0x1d0)+_0x4c2230['type']),console[_0x589686(0x19a)]('Parent\x20ID:\x20'+_0x4c2230[_0x589686(0x1ab)]));if(_0x4c2230['type']===_0x589686(0x1c2))return console['error'](_0x589686(0x1c8)),console[_0x589686(0x19a)](_0x589686(0x1b5)),0x1;if(_0x4c2230[_0x589686(0x163)]===_0x589686(0x197))return console[_0x589686(0x19a)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x589686(0x19a)](_0x589686(0x1e5)),0x1;if(!_0x4c2230[_0x589686(0x183)])throw new SDKError(ErrorCode[_0x589686(0x1de)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1a8015=await withSpinner(_0x589686(0x170),()=>_0x2ff124[_0x589686(0x1ef)]['getSegmentSQL'](_0x4c2230['parentId'],_0x4c2230['segmentId']),{'verbose':_0x138f9f['verbose']}),_0x53e96b=_0x1a8015[_0x589686(0x16c)],_0x39bfe5=await executeSchemaQuery(_0x53e96b,_0x2ff124,_0x138f9f);return await handleQueryOutput(_0x39bfe5,_0x138f9f),0x0;}catch(_0x1a0c70){if(_0x1a0c70 instanceof SDKError)return console[_0x589686(0x19a)](_0x589686(0x1e8)+_0x1a0c70[_0x589686(0x164)]),_0x1a0c70['cause']&&console[_0x589686(0x19a)](_0x589686(0x1ca)+_0x1a0c70[_0x589686(0x168)]),0x1;throw _0x1a0c70;}}}function a37_0x153a(){const _0x214fe9=['/e/','SELECT\x20*\x20FROM\x20(\x0a','Use:\x20tdx\x20ps\x20view\x20-w','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','limit','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','segment:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Resolved\x20parent\x20folder\x20ID:\x20','SEGMENT_NOT_FOUND','jobId','\x20rows\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','2180757aSCbQP','Executing\x20segment\x20query...','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20ps\x20desc','\x20\x20Folder\x20path:\x20','12968NKdCTa','Error:\x20','\x27\x20with\x20ID:\x20','\x20\x20Parent\x20segment:\x20','resolvePathToResource','Show\x20child\x20segment\x20schema\x20(column\x20types)','Folder\x20ID:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment','Resolving\x20path\x20\x27','segment:view','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20reference\x20is\x20required','\x27...','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Target\x20path:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment:folder:show','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INVALID_ARGUMENT','getSQLFromYamlFile','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','setJobId','SEGMENT_FOLDER_NOT_FOUND','segmentPath','elapsedTimeMillis','(root)','SQL\x20query:\x0a','stats','folderId','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Creating\x20folder\x20\x27','\x20\x20Segment\x20name:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Usage:\x20tdx\x20segment\x20describe\x20<path>','information_schema','type','message','Listing\x20folders\x20for\x20parent\x20\x27','Use:\x20tdx\x20ps\x20view','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','cause','Usage:\x20tdx\x20sg\x20show\x20<name>','8lVjQXj','Resolved\x20relative\x20path\x20to:\x20','data','Resolving\x20\x27','✔\x20Found\x20','Fetching\x20segment\x20details...','Fetching\x20SQL\x20for\x20segment...','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','4058488wiZCpv','name','3507504Okzams','Folder\x20name:\x20','execute','\x20\x20tdx\x20sg\x20sql\x20--path\x20','url','Resolving\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Examples:','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','folderPath','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20folder\x20details...','code','Usage:','replace','segmentId','4508755nTGBKu','description','resolveParentId','segment:sql','fullPath','Use:\x20tdx\x20ps\x20show','log','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','226sdvSqF','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20Opening\x20','toLocaleString','Resolved\x20parent\x20ID:\x20','✔\x20Query\x20completed:\x20Processed\x20','site','Show\x20segment\x20folder\x20details','Options:','segment:folder:create','parentSegment','parent','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','8339868vPJIyv','error','Parent\x20segment:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20name:\x20','trim','\x20\x20Full\x20path:\x20','parentFolder','resolveFolderId','Site:\x20','getSQLFromServerSegment','getSegmentSQL','red','segmentName','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','getFolder','Resolving\x20parent\x20folder\x20\x27','Resolving\x20parent\x20segment\x20\x27','parentId','/app/ps/','getSegmentSQLFromYaml','getParent','format','✖\x20Query\x20failed\x20[','getSegment','Parent\x20ID:\x20','segment:describe','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','includes','web','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20folder','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','query','verbose','segment:desc','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','in\x20','folder','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','listFolders','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','length','\x20\x20Cause:\x20','Resolved:\x20','test','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','22645827tCqNMY','json','Resolved\x20type:\x20','Segment\x20ID:\x20','segment:folder:list'];a37_0x153a=function(){return _0x214fe9;};return a37_0x153a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x68a3f4=a38_0x419e;(function(_0x24566f,_0xdf87eb){const _0x43c2c5=a38_0x419e,_0xd03cc0=_0x24566f();while(!![]){try{const _0x28d8c1=-parseInt(_0x43c2c5(0x106))/0x1+-parseInt(_0x43c2c5(0xfb))/0x2*(parseInt(_0x43c2c5(0xfe))/0x3)+-parseInt(_0x43c2c5(0x119))/0x4+parseInt(_0x43c2c5(0x110))/0x5+parseInt(_0x43c2c5(0x123))/0x6+-parseInt(_0x43c2c5(0x10a))/0x7*(-parseInt(_0x43c2c5(0x115))/0x8)+parseInt(_0x43c2c5(0x121))/0x9;if(_0x28d8c1===_0xdf87eb)break;else _0xd03cc0['push'](_0xd03cc0['shift']());}catch(_0x1abdf8){_0xd03cc0['push'](_0xd03cc0['shift']());}}}(a38_0x49a9,0x8b553));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';function a38_0x419e(_0x4a6a63,_0x3aa1e0){_0x4a6a63=_0x4a6a63-0xfb;const _0x49a9e0=a38_0x49a9();let _0x419ea1=_0x49a9e0[_0x4a6a63];return _0x419ea1;}function a38_0x49a9(){const _0x36308c=['3571390eDjFmV','length','type','data','yellow','2808xTlMWa','Target\x20path:\x20','Parent\x20path:\x20','Site:\x20','3718208azIIRB','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','segment','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','ruleFile','error','14584302CodGAL','invisible','3395070WQtHhF','execute','parent','segmentPath','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','site','description','34EVKYbO','\x27...','Creating\x20segment\x20\x27','74859IKJBti','Examples:','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','Parent:\x20','verbose','name','kind','1003870ipkRyh','folder','resolveFolderId','includes','553LdbLJR','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segments','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Resolving\x20folder\x20path\x20\x27','folderId'];a38_0x49a9=function(){return _0x36308c;};return a38_0x49a9();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a38_0x252d7b from'chalk';export class SegmentCreateCommand extends BaseCommand{[a38_0x68a3f4(0x104)]='segment:create';[a38_0x68a3f4(0x129)]=a38_0x68a3f4(0x101);async[a38_0x68a3f4(0x124)](_0x20fe00){const _0x494446=a38_0x68a3f4;console[_0x494446(0x120)](a38_0x252d7b[_0x494446(0x114)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x494446(0x120)](a38_0x252d7b[_0x494446(0x114)](_0x494446(0x11b)));const {options:_0x575a63,args:_0x4e782d,tdx:_0x476732}=_0x20fe00,_0x53c736=_0x575a63;if(_0x4e782d[_0x494446(0x111)]===0x0)return console[_0x494446(0x120)](_0x494446(0x11a)),console[_0x494446(0x120)](_0x494446(0x10b)),console[_0x494446(0x120)](_0x494446(0xff)),console[_0x494446(0x120)](_0x494446(0x100)),console[_0x494446(0x120)](_0x494446(0x127)),console[_0x494446(0x120)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x32cde6=_0x4e782d[0x0],_0x403653=_0x575a63[_0x494446(0x126)];let _0x11ad5c=_0x32cde6;_0x403653&&!_0x32cde6[_0x494446(0x109)]('/')&&(_0x11ad5c=_0x403653+'/'+_0x32cde6,_0x53c736[_0x494446(0x103)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x11ad5c));const _0x2e204d=parsePath(_0x11ad5c);if(_0x2e204d[_0x494446(0x10c)][_0x494446(0x111)]<0x2)return console[_0x494446(0x120)](_0x494446(0x10d)),console[_0x494446(0x120)](_0x494446(0x11e)),0x1;const _0x5ba859=_0x2e204d[_0x494446(0x10c)][0x0],_0xfea0e4=getBaseName(_0x11ad5c),_0x5db791=getParentPath(_0x11ad5c);_0x53c736[_0x494446(0x103)]&&(console[_0x494446(0x120)](_0x494446(0x118)+_0x53c736[_0x494446(0x128)]),console[_0x494446(0x120)](_0x494446(0x116)+_0x11ad5c),console[_0x494446(0x120)](_0x494446(0x102)+_0x5ba859),console[_0x494446(0x120)]('Segment\x20name:\x20'+_0xfea0e4),console[_0x494446(0x120)](_0x494446(0x117)+_0x5db791));const _0x3669c5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5ba859+_0x494446(0xfc),()=>_0x476732[_0x494446(0x11d)]['resolveParentId'](_0x5ba859),{'verbose':_0x53c736[_0x494446(0x103)]}),_0x4d0d28=_0x3669c5[_0x494446(0x113)];let _0x8c704b;if(_0x2e204d[_0x494446(0x10c)][_0x494446(0x111)]>0x2){const _0x527c02=await withSpinner(_0x494446(0x10e)+_0x5db791+_0x494446(0xfc),()=>_0x476732[_0x494446(0x11d)]['resolvePathToResource'](_0x5db791),{'verbose':_0x53c736[_0x494446(0x103)]}),_0x233613=_0x527c02[_0x494446(0x113)];if(_0x233613['type']!==_0x494446(0x107)&&_0x233613[_0x494446(0x112)]!==_0x494446(0x125))return console[_0x494446(0x120)](_0x494446(0x11c)),0x1;_0x8c704b=_0x233613[_0x494446(0x10f)];}else{if(_0x53c736[_0x494446(0x107)]){const _0x13b3a9=await withSpinner('Resolving\x20folder\x20\x27'+_0x53c736['folder']+_0x494446(0xfc),()=>_0x476732[_0x494446(0x11d)][_0x494446(0x108)](_0x4d0d28,_0x53c736[_0x494446(0x107)]),{'verbose':_0x53c736[_0x494446(0x103)]});_0x8c704b=_0x13b3a9[_0x494446(0x113)];}}_0x53c736[_0x494446(0x103)]&&_0x8c704b&&console[_0x494446(0x120)]('Resolved\x20folder\x20ID:\x20'+_0x8c704b);const _0x2a500e=await loadJSONFromOptions(_0x53c736['rule'],_0x53c736[_0x494446(0x11f)]),_0x558cc4={'name':_0xfea0e4,'description':_0x53c736[_0x494446(0x129)],'rule':_0x2a500e,'kind':_0x53c736[_0x494446(0x105)]!==undefined?parseInt(_0x53c736[_0x494446(0x105)],0xa):undefined,'isVisible':_0x53c736[_0x494446(0x122)]?![]:undefined,'segmentFolderId':_0x8c704b,'countPopulation':_0x53c736['noCountPopulation']?![]:undefined},_0x54bba5=await withSpinner(_0x494446(0xfd)+_0xfea0e4+_0x494446(0xfc),()=>_0x476732[_0x494446(0x11d)]['createSegment'](_0x4d0d28,_0x558cc4),{'verbose':_0x53c736['verbose']}),_0x4a17ce=_0x54bba5[_0x494446(0x113)];return console[_0x494446(0x120)]('✔\x20Created\x20segment\x20\x27'+_0x4a17ce[_0x494446(0x104)]+'\x27\x20with\x20ID:\x20'+_0x4a17ce['id']),_0x11ad5c!==_0x32cde6&&console[_0x494446(0x120)]('\x20\x20\x20Path:\x20'+_0x11ad5c),await handleSDKOutput([_0x4a17ce],_0x53c736),0x0;}}
|