@treasuredata/tdx 2026.3.34 → 2026.3.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/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.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/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 a33_0x29d97f=a33_0x3ce1;(function(_0x2b0fe8,_0x46ee96){const _0x39c40c=a33_0x3ce1,_0x33ac4f=_0x2b0fe8();while(!![]){try{const _0x4d634d=parseInt(_0x39c40c(0x8d))/0x1+-parseInt(_0x39c40c(0x95))/0x2+-parseInt(_0x39c40c(0xc2))/0x3+-parseInt(_0x39c40c(0x90))/0x4*(parseInt(_0x39c40c(0xad))/0x5)+parseInt(_0x39c40c(0x97))/0x6*(parseInt(_0x39c40c(0xb3))/0x7)+-parseInt(_0x39c40c(0xb4))/0x8*(parseInt(_0x39c40c(0xc0))/0x9)+parseInt(_0x39c40c(0xb2))/0xa;if(_0x4d634d===_0x46ee96)break;else _0x33ac4f['push'](_0x33ac4f['shift']());}catch(_0x4b2bb8){_0x33ac4f['push'](_0x33ac4f['shift']());}}}(a33_0x2a5b,0xe49c7));function a33_0x2a5b(){const _0x1cfbd1=['account_id','dim','Show\x20a\x20specific\x20policy\x20details\x20and\x20permissions\x20(admin\x20only)','email','27603bIjBSa','\x20\x20\x20','828906lpILkT','log','length',',\x20user_id:','verbose','join','policies','\x20—\x20','bold','\x20polic','policy\x20list','Show\x20current\x20user\x20policies\x20and\x20effective\x20permissions','221014WitKYm','description','✔\x20Found\x20','24nTaJYA','getPolicyPermissions','administrator','args','No\x20policies\x20found','3060882OhmvNc','\x20\x20No\x20policies\x20assigned','11676CTlPVm','getCurrent','padEnd','data','operation','Account\x20Owner','name','policy','validate','ies','🔑\x20Effective\x20Permissions','Fetching\x20policy...','account_owner','\x20user','getPolicyUsers','📋\x20Assigned\x20Policies','Listing\x20policies...','Usage:\x20tdx\x20policy\x20show\x20<policy-name-or-id>','all','Administrator','map','\x20\x20•\x20','1325965OQTocD','policy\x20show','execute','(ID:\x20','List\x20all\x20policies\x20in\x20the\x20account\x20(admin\x20only)','43310980ZugLrg','77dZvcrH','624FzTyqM','\x20assigned','user','entries','permissions','\x20\x20No\x20permissions','max','listPolicies'];a33_0x2a5b=function(){return _0x1cfbd1;};return a33_0x2a5b();}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a33_0x342d9d from'chalk';function a33_0x3ce1(_0x2af1d6,_0x1272da){_0x2af1d6=_0x2af1d6-0x8a;const _0x2a5b7b=a33_0x2a5b();let _0x3ce1ea=_0x2a5b7b[_0x2af1d6];return _0x3ce1ea;}export class PolicyCommand extends BaseCommand{['name']=a33_0x29d97f(0x9e);[a33_0x29d97f(0x8e)]=a33_0x29d97f(0x8c);async[a33_0x29d97f(0xaf)](_0x4eae7d){const _0x47e655=a33_0x29d97f,{options:_0x51dfed,tdx:_0x50781e}=_0x4eae7d,_0x1eff62=await withSpinner('Fetching\x20permissions...',async()=>{const _0x500482=a33_0x3ce1,[_0x1104e0,_0x5af7d6]=await Promise[_0x500482(0xa9)]([_0x50781e[_0x500482(0xb6)][_0x500482(0x98)](),_0x50781e[_0x500482(0x9e)]['getMyPermissions']()]);return{'userInfo':_0x1104e0,'permissions':_0x5af7d6};},{'verbose':_0x51dfed['verbose']}),{userInfo:_0x3e0f16,permissions:_0x2ee024}=_0x1eff62['data'];if(isStructuredFormat(_0x51dfed))return await handleSingleObjectOutput(_0x2ee024,_0x51dfed),0x0;const _0x5db527=_0x3e0f16[_0x47e655(0xa3)]?_0x47e655(0x9c):_0x3e0f16[_0x47e655(0x92)]?_0x47e655(0xaa):'Member';console['log']('\x0a'+a33_0x342d9d['bold']('👤')+'\x20'+a33_0x342d9d[_0x47e655(0xca)](_0x3e0f16[_0x47e655(0x9d)])+'\x20'+a33_0x342d9d['dim']('('+_0x3e0f16[_0x47e655(0xbf)]+')')+'\x20—\x20'+_0x5db527),console[_0x47e655(0xc3)](a33_0x342d9d[_0x47e655(0xbd)]('\x20\x20\x20'+_0x50781e['context']['site']+':'+_0x3e0f16[_0x47e655(0xbc)]+_0x47e655(0xc5)+_0x3e0f16['id']));const _0x50cffa=_0x2ee024[_0x47e655(0xc8)];console[_0x47e655(0xc3)]('\x0a'+a33_0x342d9d[_0x47e655(0xca)](_0x47e655(0xa6))+'\x20('+_0x50cffa[_0x47e655(0xc4)]+'):');if(_0x50cffa['length']===0x0)console['log'](a33_0x342d9d[_0x47e655(0xbd)](_0x47e655(0x96)));else for(const _0x263bd5 of _0x50cffa){console[_0x47e655(0xc3)](_0x47e655(0xac)+_0x263bd5[_0x47e655(0x9d)]);}return printPermissionsMap(_0x2ee024[_0x47e655(0xb8)]),console[_0x47e655(0xc3)](),0x0;}}export class PolicyListCommand extends BaseCommand{['name']=a33_0x29d97f(0x8b);[a33_0x29d97f(0x8e)]=a33_0x29d97f(0xb1);async['execute'](_0x2822fb){const _0x19723c=a33_0x29d97f,{options:_0x4f282f,tdx:_0x3dc5e5}=_0x2822fb,_0x1c99a0=await withSpinner(_0x19723c(0xa7),()=>_0x3dc5e5['policy'][_0x19723c(0xbb)](),{'verbose':_0x4f282f[_0x19723c(0xc6)]}),_0x556200=_0x1c99a0[_0x19723c(0x9a)];console['error'](_0x19723c(0x8f)+_0x556200[_0x19723c(0xc4)]+_0x19723c(0x8a)+(_0x556200[_0x19723c(0xc4)]!==0x1?_0x19723c(0xa0):'y'));if(isStructuredFormat(_0x4f282f))return await handleSDKOutput(_0x556200,_0x4f282f),0x0;if(_0x556200[_0x19723c(0xc4)]===0x0)console[_0x19723c(0xc3)](a33_0x342d9d[_0x19723c(0xbd)](_0x19723c(0x94)));else for(const _0x48aae7 of _0x556200){const _0x2480a4=_0x48aae7[_0x19723c(0x8e)]?a33_0x342d9d[_0x19723c(0xbd)](_0x19723c(0xc9)+_0x48aae7[_0x19723c(0x8e)]):'';console['log'](_0x19723c(0xac)+_0x48aae7['name']+_0x2480a4);}return 0x0;}}export class PolicyShowCommand extends BaseCommand{[a33_0x29d97f(0x9d)]=a33_0x29d97f(0xae);[a33_0x29d97f(0x8e)]=a33_0x29d97f(0xbe);[a33_0x29d97f(0x9f)](_0x174361){const _0x59ee52=a33_0x29d97f;if(_0x174361[_0x59ee52(0x93)][_0x59ee52(0xc4)]===0x0)return _0x59ee52(0xa8);return undefined;}async[a33_0x29d97f(0xaf)](_0x438dfb){const _0x2ad1b3=a33_0x29d97f,{options:_0x4a8bfe,tdx:_0x374172}=_0x438dfb,_0xed6d60=_0x438dfb['args'][0x0],_0x333240=await withSpinner(_0x2ad1b3(0xa2),async()=>{const _0x5b4d99=_0x2ad1b3,_0x26c1df=await _0x374172[_0x5b4d99(0x9e)]['getPolicy'](_0xed6d60),[_0x5e02e9,_0xbfa4c0]=await Promise['all']([_0x374172[_0x5b4d99(0x9e)][_0x5b4d99(0x91)](_0x26c1df['id']),_0x374172[_0x5b4d99(0x9e)][_0x5b4d99(0xa5)](_0x26c1df['id'])]);return{'policy':_0x26c1df,'perms':_0x5e02e9,'users':_0xbfa4c0};},{'verbose':_0x4a8bfe['verbose']}),{policy:_0x39f357,perms:_0x181e3b,users:_0x25280b}=_0x333240[_0x2ad1b3(0x9a)];if(isStructuredFormat(_0x4a8bfe))return await handleSingleObjectOutput({..._0x39f357,'permissions':_0x181e3b['permissions'],'users':_0x25280b},_0x4a8bfe),0x0;console[_0x2ad1b3(0xc3)]('\x0a'+a33_0x342d9d[_0x2ad1b3(0xca)]('📋')+'\x20'+a33_0x342d9d[_0x2ad1b3(0xca)](_0x39f357[_0x2ad1b3(0x9d)])+'\x20'+a33_0x342d9d['dim'](_0x2ad1b3(0xb0)+_0x39f357['id']+')'));_0x39f357[_0x2ad1b3(0x8e)]&&console[_0x2ad1b3(0xc3)]('\x20\x20\x20'+a33_0x342d9d[_0x2ad1b3(0xbd)](_0x39f357['description']));console[_0x2ad1b3(0xc3)](_0x2ad1b3(0xc1)+_0x25280b[_0x2ad1b3(0xc4)]+_0x2ad1b3(0xa4)+(_0x25280b[_0x2ad1b3(0xc4)]!==0x1?'s':'')+_0x2ad1b3(0xb5)),printPermissionsMap(_0x181e3b['permissions']);if(_0x25280b['length']>0x0){console[_0x2ad1b3(0xc3)]('\x0a'+a33_0x342d9d[_0x2ad1b3(0xca)]('👥\x20Assigned\x20Users')+':');for(const _0x3d2322 of _0x25280b){const _0x589739=_0x3d2322['email']&&_0x3d2322['email']!==_0x3d2322[_0x2ad1b3(0x9d)]?a33_0x342d9d[_0x2ad1b3(0xbd)]('\x20<'+_0x3d2322[_0x2ad1b3(0xbf)]+'>'):'';console[_0x2ad1b3(0xc3)](_0x2ad1b3(0xac)+_0x3d2322[_0x2ad1b3(0x9d)]+_0x589739);}}return console[_0x2ad1b3(0xc3)](),0x0;}}function printPermissionsMap(_0xb3e2e8){const _0x3145b0=a33_0x29d97f,_0x2ec371=Object[_0x3145b0(0xb7)](_0xb3e2e8);console[_0x3145b0(0xc3)]('\x0a'+a33_0x342d9d['bold'](_0x3145b0(0xa1))+':');if(_0x2ec371[_0x3145b0(0xc4)]===0x0){console[_0x3145b0(0xc3)](a33_0x342d9d[_0x3145b0(0xbd)](_0x3145b0(0xb9)));return;}const _0x1d238b=Math[_0x3145b0(0xba)](..._0x2ec371[_0x3145b0(0xab)](([_0x31870f])=>_0x31870f[_0x3145b0(0xc4)]));for(const [_0x5e7c0d,_0x230ccf]of _0x2ec371){const _0x1763e0=formatOperations(_0x230ccf);console[_0x3145b0(0xc3)]('\x20\x20'+_0x5e7c0d[_0x3145b0(0x99)](_0x1d238b+0x2)+_0x1763e0);}}function formatOperations(_0x424417){const _0x25badc=a33_0x29d97f,_0x2aaa28=[...new Set(_0x424417[_0x25badc(0xab)](_0xd0550=>_0xd0550[_0x25badc(0x9b)]))];return _0x2aaa28[_0x25badc(0xc7)](',\x20');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x25ca5e=a34_0x111c;(function(_0x127381,_0x254af8){const _0x2cc415=a34_0x111c,_0x51ce84=_0x127381();while(!![]){try{const _0x39a9ea=parseInt(_0x2cc415(0x203))/0x1+-parseInt(_0x2cc415(0x23a))/0x2+-parseInt(_0x2cc415(0x240))/0x3+-parseInt(_0x2cc415(0x233))/0x4+parseInt(_0x2cc415(0x202))/0x5*(-parseInt(_0x2cc415(0x22a))/0x6)+parseInt(_0x2cc415(0x209))/0x7*(-parseInt(_0x2cc415(0x244))/0x8)+parseInt(_0x2cc415(0x21f))/0x9*(parseInt(_0x2cc415(0x24a))/0xa);if(_0x39a9ea===_0x254af8)break;else _0x51ce84['push'](_0x51ce84['shift']());}catch(_0x4221af){_0x51ce84['push'](_0x51ce84['shift']());}}}(a34_0x2a24,0xb1735));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a34_0x2a24(){const _0x40277b=['\x20--default\x27\x20to\x20save\x20permanently','Profile\x20\x27','Changing\x20site\x20to\x20\x27','name','Failed\x20to\x20remove\x20profile:\x20','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>','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x0aSaved\x20to:\x20','Choose\x20authentication\x20method:','\x27\x20does\x20not\x20exist.','validate','apikey','profile:set','apiKey','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','\x27\x20updated:\x20','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','tdx:\x20profile\x20remove','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Create\x20a\x20new\x20profile','342FvnupX','\x20\x20tdx\x20--profile\x20','Default\x20profile\x20set\x20to:\x20','red','database','✗\x20Validation\x20failed:\x20','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','Set\x20a\x20profile\x20configuration\x20value','API\x20Key','Removal\x20cancelled','password','9228sACjII','length','\x20\x20-\x20','\x0aSetup\x20cancelled','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','Enter\x20profile\x20name:','tdx.json','config','llm_agent','448544cEOZBz','llm_project','trim','site','yellow','profile:remove','text','918710nKsfYF','\x20\x20(no\x20profiles\x20found)','Session\x20profile\x20set\x20to:\x20','execute','bold','\x0aOperation\x20cancelled','3168126mLUKAB','split','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','tdx:\x20profile\x20create','820984kRSNUt','status','profile:use','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','green','dim','490030DgERnz','profileName','Profile\x20name\x20cannot\x20be\x20empty','getUserInfo','Validating\x20API\x20key...','message','session','us01','ERROR','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','parent_segment','profile','error','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','Enter\x20your\x20TD\x20API\x20key:','\x27.\x0a\x0aValid\x20keys:\x20','method','email','\x20API\x20key\x20saved\x20to\x20system\x20keychain','confirm','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','description','profile:create','includes','You\x20can\x20find\x20your\x20API\x20key\x20at:','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','/app/mp/ak','logLevel','\x27\x20does\x20not\x20exist.\x20Create\x20it?','\x27\x20requires\x20API\x20key\x20validation.','Operation\x20cancelled','create','oauth','VALID_KEYS','join','log','40tbXnsZ','1017675DgYwOK','API\x20key\x20cannot\x20be\x20empty','\x20Profile\x20\x27','(session:\x20','\x0aAvailable\x20profiles:','jobs','35ORzneL','Set\x20session\x20profile'];a34_0x2a24=function(){return _0x40277b;};return a34_0x2a24();}import*as a34_0x4e977c 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';function a34_0x111c(_0xc0eb8d,_0x4b97bf){_0xc0eb8d=_0xc0eb8d-0x1e6;const _0x2a241a=a34_0x2a24();let _0x111ce0=_0x2a241a[_0xc0eb8d];return _0x111ce0;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a34_0x432445 from'prompts';import a34_0x155518 from'chalk';function validateProfileName(_0x54156c){const _0x344fb7=a34_0x111c;if(!_0x54156c||!_0x54156c[_0x344fb7(0x235)]())return _0x344fb7(0x24c);const _0x4b52f9=_0x54156c['trim']();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x4b52f9))return _0x344fb7(0x225);if(profileExists(_0x4b52f9))return _0x344fb7(0x20c)+_0x4b52f9+'\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.';return!![];}export class ProfileCreateCommand extends BaseCommand{[a34_0x25ca5e(0x20e)]=a34_0x25ca5e(0x1f4);['description']=a34_0x25ca5e(0x21e);async[a34_0x25ca5e(0x23d)](_0x37ce81){const _0x50cbcc=a34_0x25ca5e,{options:_0x27391f,args:_0xb322dc}=_0x37ce81;console['log'](a34_0x155518['bold'](_0x50cbcc(0x243)));let _0x12da63;if(_0xb322dc[_0x50cbcc(0x22b)]>0x0&&_0xb322dc[0x0]){const _0x4ed712=_0xb322dc[0x0][_0x50cbcc(0x235)](),_0x37f31f=validateProfileName(_0x4ed712);if(_0x37f31f!==!![])return console[_0x50cbcc(0x1ea)](a34_0x155518[_0x50cbcc(0x222)](_0x37f31f)),0x1;_0x12da63=_0x4ed712;}else{const _0x504a4c=await a34_0x432445({'type':_0x50cbcc(0x239),'name':_0x50cbcc(0x24b),'message':_0x50cbcc(0x22f),'validate':validateProfileName});if(!_0x504a4c['profileName'])return console[_0x50cbcc(0x201)]('\x0aSetup\x20cancelled'),0x1;_0x12da63=_0x504a4c[_0x50cbcc(0x24b)][_0x50cbcc(0x235)]();}const _0x4e50a8=await a34_0x432445({'type':'text','name':_0x50cbcc(0x1f3),'message':'Enter\x20description\x20(optional):'}),_0x58cf2c=_0x4e50a8[_0x50cbcc(0x1f3)]?.[_0x50cbcc(0x235)]()||undefined,_0x249c5e=_0x27391f['site']||_0x50cbcc(0x251),_0x16cb84=await promptSiteSelection(_0x249c5e,_0x12da63,'Setup\x20cancelled');if(!_0x16cb84)return 0x1;const _0xb9bfd5=resolveSite(_0x16cb84);if(isOAuthSupported(_0xb9bfd5)){const _0x5b5b88=await a34_0x432445({'type':'select','name':_0x50cbcc(0x1ee),'message':_0x50cbcc(0x213),'choices':[{'title':'OAuth\x20(browser\x20login)','value':'oauth'},{'title':_0x50cbcc(0x227),'value':_0x50cbcc(0x216)}]});if(!_0x5b5b88[_0x50cbcc(0x1ee)])return console['log'](_0x50cbcc(0x22d)),0x1;if(_0x5b5b88[_0x50cbcc(0x1ee)]===_0x50cbcc(0x1fe)){if(_0x58cf2c){const _0x30788d={'site':_0xb9bfd5,'description':_0x58cf2c};saveProfileToUserConfig(_0x12da63,_0x30788d);}return await runOAuthLoginFlow(_0xb9bfd5,_0x12da63,_0x27391f[_0x50cbcc(0x1f9)]??LogLevel[_0x50cbcc(0x1e6)]),0x0;}}console[_0x50cbcc(0x201)]('\x0aSetting\x20up\x20authentication\x20for\x20site:\x20'+_0xb9bfd5),console[_0x50cbcc(0x201)](_0x50cbcc(0x1f6)),console[_0x50cbcc(0x201)]('\x20\x20'+getConsoleUrl(_0xb9bfd5,_0x50cbcc(0x1f8)));const _0x576dcf=await a34_0x432445({'type':_0x50cbcc(0x229),'name':_0x50cbcc(0x218),'message':_0x50cbcc(0x1ec),'validate':_0x428545=>{const _0x2d5fda=_0x50cbcc;if(!_0x428545||!_0x428545[_0x2d5fda(0x235)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x576dcf[_0x50cbcc(0x218)])return console[_0x50cbcc(0x201)](_0x50cbcc(0x22d)),0x1;const _0x255af8=_0x576dcf[_0x50cbcc(0x218)];console[_0x50cbcc(0x201)](_0x50cbcc(0x24e));try{const _0x8ccb71=TDX[_0x50cbcc(0x1fd)]({'site':_0xb9bfd5,'apiKey':_0x255af8['trim'](),'logLevel':_0x27391f[_0x50cbcc(0x1f9)]??LogLevel[_0x50cbcc(0x1e6)]}),_0x271319=await _0x8ccb71[_0x50cbcc(0x208)][_0x50cbcc(0x24d)]();console[_0x50cbcc(0x201)](a34_0x155518[_0x50cbcc(0x248)]('✓')+_0x50cbcc(0x211)+_0x271319[_0x50cbcc(0x1ef)]+')');const _0x2fdf0e=await isKeychainAvailable();_0x2fdf0e?(await saveAPIKeyAsync(_0x255af8['trim'](),_0xb9bfd5,_0x12da63),console[_0x50cbcc(0x201)](a34_0x155518['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x12da63+')')):(console['warn'](a34_0x155518['yellow'](_0x50cbcc(0x21d))),console['warn'](a34_0x155518[_0x50cbcc(0x237)](_0x50cbcc(0x247))));const _0x356962={'site':_0xb9bfd5,..._0x58cf2c&&{'description':_0x58cf2c}};return saveProfileToUserConfig(_0x12da63,_0x356962),console[_0x50cbcc(0x201)](a34_0x155518['green']('✓')+'\x20Profile\x20\x27'+_0x12da63+'\x27\x20created'),console['log'](),console[_0x50cbcc(0x201)](_0x50cbcc(0x1eb)),console[_0x50cbcc(0x201)](_0x50cbcc(0x220)+_0x12da63+_0x50cbcc(0x1e7)),console[_0x50cbcc(0x201)](_0x50cbcc(0x220)+_0x12da63+_0x50cbcc(0x242)),0x0;}catch(_0x30e4bf){if(_0x30e4bf instanceof HTTPClientError&&_0x30e4bf['status']===0x191)return printAuthError(_0x30e4bf),0x1;return console[_0x50cbcc(0x1ea)](a34_0x155518[_0x50cbcc(0x222)]('✗\x20Validation\x20failed:\x20'+(_0x30e4bf instanceof Error?_0x30e4bf[_0x50cbcc(0x24f)]:String(_0x30e4bf)))),console[_0x50cbcc(0x1ea)]('Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.'),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{['name']=a34_0x25ca5e(0x238);[a34_0x25ca5e(0x1f3)]='Remove\x20a\x20profile';['validate'](_0x189967){const _0x363494=a34_0x25ca5e,{args:_0x3997bc}=_0x189967;if(_0x3997bc[_0x363494(0x22b)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>';return undefined;}async['execute'](_0x1e6bad){const _0x3f5604=a34_0x25ca5e,{args:_0x420994}=_0x1e6bad,_0x2a3918=_0x420994[0x0];console[_0x3f5604(0x201)](a34_0x155518[_0x3f5604(0x23e)](_0x3f5604(0x21c)));if(!profileExists(_0x2a3918)){console['error'](a34_0x155518['red'](_0x3f5604(0x20c)+_0x2a3918+'\x27\x20does\x20not\x20exist.')),console[_0x3f5604(0x201)]('\x0aAvailable\x20profiles:');const _0x425937=listProfiles();if(_0x425937[_0x3f5604(0x22b)]===0x0)console[_0x3f5604(0x201)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x366e37 of _0x425937){console[_0x3f5604(0x201)](_0x3f5604(0x22c)+_0x366e37[_0x3f5604(0x20e)]);}return 0x1;}const _0x1648d8=await a34_0x432445({'type':_0x3f5604(0x1f1),'name':_0x3f5604(0x1f1),'message':_0x3f5604(0x1f2)+_0x2a3918+'\x27?','initial':![]});if(!_0x1648d8[_0x3f5604(0x1f1)])return console[_0x3f5604(0x201)](_0x3f5604(0x228)),0x0;try{removeProfileFromUserConfig(_0x2a3918),console[_0x3f5604(0x201)](a34_0x155518[_0x3f5604(0x248)]('✓')+_0x3f5604(0x205)+_0x2a3918+'\x27\x20removed\x20from\x20configuration');}catch(_0x2e8c41){return console[_0x3f5604(0x1ea)](a34_0x155518['red'](_0x3f5604(0x20f)+(_0x2e8c41 instanceof Error?_0x2e8c41[_0x3f5604(0x24f)]:String(_0x2e8c41)))),0x1;}const _0xb3234e=await isKeychainAvailable();if(_0xb3234e){const _0x44db26=await deleteKeychainAPIKey(_0x2a3918);_0x44db26&&console[_0x3f5604(0x201)](a34_0x155518['green']('✓')+'\x20API\x20key\x20removed\x20from\x20system\x20keychain');}return 0x0;}}export class ProfileSetCommand extends BaseCommand{['name']=a34_0x25ca5e(0x217);[a34_0x25ca5e(0x1f3)]=a34_0x25ca5e(0x226);static ['VALID_KEYS']=[a34_0x25ca5e(0x236),a34_0x25ca5e(0x223),a34_0x25ca5e(0x1e8),a34_0x25ca5e(0x234),a34_0x25ca5e(0x232),a34_0x25ca5e(0x1f3)];['validate'](_0x237ccf){const _0x55a565=a34_0x25ca5e,{args:_0x2338d7,options:_0x3ea9b2}=_0x237ccf,_0x2885aa=_0x3ea9b2['profile']||getActiveProfile();if(!_0x2885aa)return _0x55a565(0x210);if(_0x2338d7['length']===0x0)return _0x55a565(0x21b)+ProfileSetCommand['VALID_KEYS'][_0x55a565(0x200)](',\x20');const _0x5c5cf6=_0x2338d7[0x0];if(!_0x5c5cf6[_0x55a565(0x1f5)]('='))return _0x55a565(0x1f7)+ProfileSetCommand[_0x55a565(0x1ff)]['join'](',\x20');const [_0x5ecce3]=_0x5c5cf6[_0x55a565(0x241)]('=',0x2);if(!ProfileSetCommand[_0x55a565(0x1ff)][_0x55a565(0x1f5)](_0x5ecce3))return'Unknown\x20key\x20\x27'+_0x5ecce3+_0x55a565(0x1ed)+ProfileSetCommand[_0x55a565(0x1ff)][_0x55a565(0x200)](',\x20');return undefined;}async[a34_0x25ca5e(0x23d)](_0x335cc8){const _0x489f7a=a34_0x25ca5e,{args:_0x5e4722,options:_0x531d9a}=_0x335cc8,_0x221542=_0x531d9a[_0x489f7a(0x1e9)]||getActiveProfile(),[_0x321432,..._0x334529]=_0x5e4722[0x0]['split']('='),_0x24c438=_0x334529['join']('=');console[_0x489f7a(0x201)](a34_0x155518[_0x489f7a(0x23e)]('tdx:\x20profile\x20set'));if(!profileExists(_0x221542)){const _0x5373fb=await a34_0x432445({'type':'confirm','name':_0x489f7a(0x1fd),'message':_0x489f7a(0x20c)+_0x221542+_0x489f7a(0x1fa),'initial':!![]});if(!_0x5373fb['create'])return console['log'](_0x489f7a(0x1fc)),0x1;}const _0x38e7fc=loadProfile(_0x221542),_0x26643c=_0x38e7fc?.[_0x489f7a(0x231)]||{};if(_0x321432==='site'){const _0x12fb3c=resolveSite(_0x24c438);console[_0x489f7a(0x201)](_0x489f7a(0x20d)+_0x12fb3c+_0x489f7a(0x1fb)),console['log'](_0x489f7a(0x219)),console[_0x489f7a(0x201)]('\x20\x20'+getConsoleUrl(_0x12fb3c,'/app/mp/ak'));const _0x48c139=await a34_0x432445({'type':_0x489f7a(0x229),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x162f58=>{const _0x102e8f=_0x489f7a;if(!_0x162f58||!_0x162f58['trim']())return _0x102e8f(0x204);return!![];}});if(!_0x48c139[_0x489f7a(0x218)])return console[_0x489f7a(0x201)](_0x489f7a(0x23f)),0x1;console[_0x489f7a(0x201)](_0x489f7a(0x24e));try{const _0x5cdbfb=TDX[_0x489f7a(0x1fd)]({'site':_0x12fb3c,'apiKey':_0x48c139[_0x489f7a(0x218)]['trim'](),'logLevel':_0x531d9a['logLevel']??LogLevel[_0x489f7a(0x1e6)]}),_0x55071c=await _0x5cdbfb[_0x489f7a(0x208)][_0x489f7a(0x24d)]();console[_0x489f7a(0x201)](a34_0x155518[_0x489f7a(0x248)]('✓')+_0x489f7a(0x211)+_0x55071c[_0x489f7a(0x1ef)]+')');const _0x1c024b=await isKeychainAvailable();_0x1c024b?(await saveAPIKeyAsync(_0x48c139[_0x489f7a(0x218)][_0x489f7a(0x235)](),_0x12fb3c,_0x221542),console[_0x489f7a(0x201)](a34_0x155518[_0x489f7a(0x248)]('✓')+_0x489f7a(0x1f0))):console['warn'](a34_0x155518[_0x489f7a(0x237)](_0x489f7a(0x21d))),_0x26643c[_0x489f7a(0x236)]=_0x12fb3c;}catch(_0x2f4066){if(_0x2f4066 instanceof HTTPClientError&&_0x2f4066[_0x489f7a(0x245)]===0x191)return printAuthError(_0x2f4066),0x1;return console[_0x489f7a(0x1ea)](a34_0x155518[_0x489f7a(0x222)](_0x489f7a(0x224)+(_0x2f4066 instanceof Error?_0x2f4066[_0x489f7a(0x24f)]:String(_0x2f4066)))),console[_0x489f7a(0x1ea)]('Site\x20was\x20not\x20changed.'),0x1;}}else _0x26643c[_0x321432]=_0x24c438||undefined;return saveProfileToUserConfig(_0x221542,_0x26643c),console['log'](a34_0x155518[_0x489f7a(0x248)]('✓')+_0x489f7a(0x205)+_0x221542+_0x489f7a(0x21a)+_0x321432+'='+(_0x24c438||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a34_0x25ca5e(0x246);[a34_0x25ca5e(0x1f3)]=a34_0x25ca5e(0x20a);[a34_0x25ca5e(0x215)](_0x19a19e){const {args:_0x434bd9}=_0x19a19e;if(_0x434bd9['length']===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async[a34_0x25ca5e(0x23d)](_0x36321b){const _0x473d05=a34_0x25ca5e,{args:_0x1658c5,options:_0x3554a5}=_0x36321b,_0x197f14=_0x1658c5[0x0],_0x2ba90a=_0x3554a5['default'];cleanExpiredSessions();if(!profileExists(_0x197f14)){console[_0x473d05(0x1ea)](a34_0x155518[_0x473d05(0x222)]('Profile\x20\x27'+_0x197f14+_0x473d05(0x214))),console['log'](_0x473d05(0x207));const _0xc267a6=listProfiles();if(_0xc267a6[_0x473d05(0x22b)]===0x0)console['log'](_0x473d05(0x23b));else for(const _0x457220 of _0xc267a6){console['log'](_0x473d05(0x22c)+_0x457220[_0x473d05(0x20e)]);}return 0x1;}if(_0x2ba90a){const _0x3ce468=a34_0x4e977c['join'](getConfigDir(),_0x473d05(0x230));return saveActiveProfileToUserConfig(_0x197f14),console[_0x473d05(0x201)](_0x473d05(0x221)+a34_0x155518[_0x473d05(0x248)](_0x197f14)),console[_0x473d05(0x201)](a34_0x155518[_0x473d05(0x249)](_0x473d05(0x212)+_0x3ce468)),0x0;}const _0x19ea00=getSessionID(_0x3554a5[_0x473d05(0x250)]);return saveSessionContext({'profile':_0x197f14},_0x3554a5['session']),console[_0x473d05(0x201)](_0x473d05(0x23c)+a34_0x155518[_0x473d05(0x248)](_0x197f14)+'\x20'+a34_0x155518[_0x473d05(0x249)](_0x473d05(0x206)+_0x19ea00+')')),console[_0x473d05(0x201)](a34_0x155518[_0x473d05(0x249)](_0x473d05(0x22e)+_0x197f14+_0x473d05(0x20b))),0x0;}}
|
|
1
|
+
const a34_0x2ac38b=a34_0x455f;(function(_0x430467,_0x39a427){const _0x2e021c=a34_0x455f,_0x1c4750=_0x430467();while(!![]){try{const _0x1b52e3=parseInt(_0x2e021c(0x128))/0x1*(-parseInt(_0x2e021c(0x118))/0x2)+parseInt(_0x2e021c(0x129))/0x3*(parseInt(_0x2e021c(0x125))/0x4)+-parseInt(_0x2e021c(0x12d))/0x5+-parseInt(_0x2e021c(0x139))/0x6+-parseInt(_0x2e021c(0x109))/0x7*(-parseInt(_0x2e021c(0x121))/0x8)+-parseInt(_0x2e021c(0x161))/0x9+parseInt(_0x2e021c(0x162))/0xa;if(_0x1b52e3===_0x39a427)break;else _0x1c4750['push'](_0x1c4750['shift']());}catch(_0x45e183){_0x1c4750['push'](_0x1c4750['shift']());}}}(a34_0x4f32,0xf10ff));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 a34_0x283eef from'node:path';function a34_0x455f(_0x3d306c,_0x1e53bb){_0x3d306c=_0x3d306c-0x108;const _0x4f3214=a34_0x4f32();let _0x455f50=_0x4f3214[_0x3d306c];return _0x455f50;}import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a34_0x4f32(){const _0x35e484=['\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','session','15862VdVibX','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','error','Operation\x20cancelled','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Profile\x20name\x20cannot\x20be\x20empty','execute','Unknown\x20key\x20\x27','Remove\x20a\x20profile','\x20\x20tdx\x20--profile\x20','API\x20key\x20cannot\x20be\x20empty','config','password','validate','Session\x20profile\x20set\x20to:\x20','16UrnMsH','\x27.\x0a\x0aValid\x20keys:\x20','\x27\x20removed\x20from\x20configuration','tdx:\x20profile\x20remove','\x27\x20created','parent_segment','/app/mp/ak','log','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','5912gBhovE','Setup\x20cancelled','status','trim','143984szmCTT','\x0aSaved\x20to:\x20','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','13757ajhUPo','72uBfkAv','profile:use','includes','dim','1261680ZgAqzL','profile','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','\x27\x20requires\x20API\x20key\x20validation.','Failed\x20to\x20remove\x20profile:\x20','join','jobs','split','tdx:\x20profile\x20create','\x27\x20does\x20not\x20exist.\x20Create\x20it?','description','\x0aOperation\x20cancelled','11568606cWdMQT','red','profileName','profile:create','site','\x20API\x20key\x20is\x20valid\x20(User:\x20','bold','getUserInfo','\x0aSetup\x20cancelled','\x27\x20does\x20not\x20exist.','warn','database','apiKey','Enter\x20your\x20TD\x20API\x20key:','\x20\x20(no\x20profiles\x20found)','method','API\x20Key','message','ERROR','tdx.json','test','logLevel','green','\x0aAvailable\x20profiles:','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x27\x20updated:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','length','\x20\x20-\x20','profile:set','✗\x20Validation\x20failed:\x20','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','tdx:\x20profile\x20set','Site\x20was\x20not\x20changed.','llm_project','llm_agent','VALID_KEYS','name','\x20Profile\x20\x27','14595624pSJOXC','23611420Ikeglr','text','Choose\x20authentication\x20method:','confirm','select','apikey','Profile\x20\x27','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Create\x20a\x20new\x20profile','yellow','Default\x20profile\x20set\x20to:\x20','email','create','Enter\x20description\x20(optional):','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>'];a34_0x4f32=function(){return _0x35e484;};return a34_0x4f32();}import a34_0x56a30e from'prompts';import a34_0x3535c5 from'chalk';function validateProfileName(_0x2e91a4){const _0x40ea19=a34_0x455f;if(!_0x2e91a4||!_0x2e91a4['trim']())return _0x40ea19(0x10e);const _0x54804d=_0x2e91a4[_0x40ea19(0x124)]();if(!/^[a-zA-Z0-9_-]+$/[_0x40ea19(0x14d)](_0x54804d))return _0x40ea19(0x172);if(profileExists(_0x54804d))return'Profile\x20\x27'+_0x54804d+_0x40ea19(0x10d);return!![];}export class ProfileCreateCommand extends BaseCommand{[a34_0x2ac38b(0x15f)]=a34_0x2ac38b(0x13c);[a34_0x2ac38b(0x137)]=a34_0x2ac38b(0x16a);async[a34_0x2ac38b(0x10f)](_0x434306){const _0xc14fdc=a34_0x2ac38b,{options:_0x532bb7,args:_0x17d3e7}=_0x434306;console[_0xc14fdc(0x11f)](a34_0x3535c5[_0xc14fdc(0x13f)](_0xc14fdc(0x135)));let _0x4e967f;if(_0x17d3e7['length']>0x0&&_0x17d3e7[0x0]){const _0xb5ed0a=_0x17d3e7[0x0]['trim'](),_0x59c32f=validateProfileName(_0xb5ed0a);if(_0x59c32f!==!![])return console[_0xc14fdc(0x10b)](a34_0x3535c5['red'](_0x59c32f)),0x1;_0x4e967f=_0xb5ed0a;}else{const _0x1ec393=await a34_0x56a30e({'type':_0xc14fdc(0x163),'name':_0xc14fdc(0x13b),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x1ec393[_0xc14fdc(0x13b)])return console[_0xc14fdc(0x11f)](_0xc14fdc(0x141)),0x1;_0x4e967f=_0x1ec393[_0xc14fdc(0x13b)][_0xc14fdc(0x124)]();}const _0x3703c7=await a34_0x56a30e({'type':_0xc14fdc(0x163),'name':_0xc14fdc(0x137),'message':_0xc14fdc(0x16f)}),_0x4e7d6f=_0x3703c7[_0xc14fdc(0x137)]?.[_0xc14fdc(0x124)]()||undefined,_0x1e1e4d=_0x532bb7[_0xc14fdc(0x13d)]||'us01',_0x5f3d7b=await promptSiteSelection(_0x1e1e4d,_0x4e967f,_0xc14fdc(0x122));if(!_0x5f3d7b)return 0x1;const _0x3cfb44=resolveSite(_0x5f3d7b);if(isOAuthSupported(_0x3cfb44)){const _0x498100=await a34_0x56a30e({'type':_0xc14fdc(0x166),'name':'method','message':_0xc14fdc(0x164),'choices':[{'title':'OAuth\x20(browser\x20login)','value':'oauth'},{'title':_0xc14fdc(0x149),'value':_0xc14fdc(0x167)}]});if(!_0x498100[_0xc14fdc(0x148)])return console[_0xc14fdc(0x11f)](_0xc14fdc(0x141)),0x1;if(_0x498100[_0xc14fdc(0x148)]==='oauth'){if(_0x4e7d6f){const _0x343c1e={'site':_0x3cfb44,'description':_0x4e7d6f};saveProfileToUserConfig(_0x4e967f,_0x343c1e);}return await runOAuthLoginFlow(_0x3cfb44,_0x4e967f,_0x532bb7[_0xc14fdc(0x14e)]??LogLevel[_0xc14fdc(0x14b)]),0x0;}}console[_0xc14fdc(0x11f)](_0xc14fdc(0x171)+_0x3cfb44),console[_0xc14fdc(0x11f)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x3cfb44,_0xc14fdc(0x11e)));const _0x7e527c=await a34_0x56a30e({'type':_0xc14fdc(0x115),'name':_0xc14fdc(0x145),'message':_0xc14fdc(0x146),'validate':_0x1d842b=>{const _0x55f2f6=_0xc14fdc;if(!_0x1d842b||!_0x1d842b[_0x55f2f6(0x124)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x7e527c[_0xc14fdc(0x145)])return console[_0xc14fdc(0x11f)](_0xc14fdc(0x141)),0x1;const _0x33949d=_0x7e527c[_0xc14fdc(0x145)];console[_0xc14fdc(0x11f)]('Validating\x20API\x20key...');try{const _0x4cdf81=TDX['create']({'site':_0x3cfb44,'apiKey':_0x33949d[_0xc14fdc(0x124)](),'logLevel':_0x532bb7[_0xc14fdc(0x14e)]??LogLevel[_0xc14fdc(0x14b)]}),_0x27bbdf=await _0x4cdf81[_0xc14fdc(0x133)][_0xc14fdc(0x140)]();console[_0xc14fdc(0x11f)](a34_0x3535c5[_0xc14fdc(0x14f)]('✓')+_0xc14fdc(0x13e)+_0x27bbdf[_0xc14fdc(0x16d)]+')');const _0x5bbd99=await isKeychainAvailable();_0x5bbd99?(await saveAPIKeyAsync(_0x33949d[_0xc14fdc(0x124)](),_0x3cfb44,_0x4e967f),console[_0xc14fdc(0x11f)](a34_0x3535c5[_0xc14fdc(0x14f)]('✓')+_0xc14fdc(0x154)+_0x4e967f+')')):(console['warn'](a34_0x3535c5['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0xc14fdc(0x143)](a34_0x3535c5[_0xc14fdc(0x16b)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x3ae6f2={'site':_0x3cfb44,..._0x4e7d6f&&{'description':_0x4e7d6f}};return saveProfileToUserConfig(_0x4e967f,_0x3ae6f2),console['log'](a34_0x3535c5[_0xc14fdc(0x14f)]('✓')+_0xc14fdc(0x160)+_0x4e967f+_0xc14fdc(0x11c)),console['log'](),console[_0xc14fdc(0x11f)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0xc14fdc(0x11f)](_0xc14fdc(0x112)+_0x4e967f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0xc14fdc(0x11f)](_0xc14fdc(0x112)+_0x4e967f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x11f327){if(_0x11f327 instanceof HTTPClientError&&_0x11f327['status']===0x191)return printAuthError(_0x11f327),0x1;return console['error'](a34_0x3535c5['red'](_0xc14fdc(0x158)+(_0x11f327 instanceof Error?_0x11f327[_0xc14fdc(0x14a)]:String(_0x11f327)))),console['error'](_0xc14fdc(0x169)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{['name']='profile:remove';[a34_0x2ac38b(0x137)]=a34_0x2ac38b(0x111);[a34_0x2ac38b(0x116)](_0x7d445){const _0xc8bcb4=a34_0x2ac38b,{args:_0x2d066a}=_0x7d445;if(_0x2d066a[_0xc8bcb4(0x155)]===0x0)return _0xc8bcb4(0x159);return undefined;}async[a34_0x2ac38b(0x10f)](_0x8b916a){const _0x16fe37=a34_0x2ac38b,{args:_0x438849}=_0x8b916a,_0x2f622e=_0x438849[0x0];console[_0x16fe37(0x11f)](a34_0x3535c5[_0x16fe37(0x13f)](_0x16fe37(0x11b)));if(!profileExists(_0x2f622e)){console[_0x16fe37(0x10b)](a34_0x3535c5[_0x16fe37(0x13a)](_0x16fe37(0x168)+_0x2f622e+_0x16fe37(0x142))),console[_0x16fe37(0x11f)](_0x16fe37(0x150));const _0x50ff27=listProfiles();if(_0x50ff27[_0x16fe37(0x155)]===0x0)console[_0x16fe37(0x11f)](_0x16fe37(0x147));else for(const _0x10fa6e of _0x50ff27){console[_0x16fe37(0x11f)](_0x16fe37(0x156)+_0x10fa6e[_0x16fe37(0x15f)]);}return 0x1;}const _0x574dcc=await a34_0x56a30e({'type':_0x16fe37(0x165),'name':'confirm','message':_0x16fe37(0x153)+_0x2f622e+'\x27?','initial':![]});if(!_0x574dcc[_0x16fe37(0x165)])return console['log']('Removal\x20cancelled'),0x0;try{removeProfileFromUserConfig(_0x2f622e),console[_0x16fe37(0x11f)](a34_0x3535c5[_0x16fe37(0x14f)]('✓')+_0x16fe37(0x160)+_0x2f622e+_0x16fe37(0x11a));}catch(_0x1fc0ec){return console[_0x16fe37(0x10b)](a34_0x3535c5[_0x16fe37(0x13a)](_0x16fe37(0x131)+(_0x1fc0ec instanceof Error?_0x1fc0ec['message']:String(_0x1fc0ec)))),0x1;}const _0x32fd2e=await isKeychainAvailable();if(_0x32fd2e){const _0xdf89f2=await deleteKeychainAPIKey(_0x2f622e);_0xdf89f2&&console[_0x16fe37(0x11f)](a34_0x3535c5[_0x16fe37(0x14f)]('✓')+'\x20API\x20key\x20removed\x20from\x20system\x20keychain');}return 0x0;}}export class ProfileSetCommand extends BaseCommand{['name']=a34_0x2ac38b(0x157);[a34_0x2ac38b(0x137)]='Set\x20a\x20profile\x20configuration\x20value';static ['VALID_KEYS']=[a34_0x2ac38b(0x13d),a34_0x2ac38b(0x144),a34_0x2ac38b(0x11d),a34_0x2ac38b(0x15c),a34_0x2ac38b(0x15d),a34_0x2ac38b(0x137)];['validate'](_0x3aa30a){const _0x5b0da3=a34_0x2ac38b,{args:_0x258da6,options:_0x24d898}=_0x3aa30a,_0x29be71=_0x24d898[_0x5b0da3(0x12e)]||getActiveProfile();if(!_0x29be71)return _0x5b0da3(0x170);if(_0x258da6[_0x5b0da3(0x155)]===0x0)return _0x5b0da3(0x10a)+ProfileSetCommand[_0x5b0da3(0x15e)][_0x5b0da3(0x132)](',\x20');const _0x22c240=_0x258da6[0x0];if(!_0x22c240[_0x5b0da3(0x12b)]('='))return _0x5b0da3(0x151)+ProfileSetCommand[_0x5b0da3(0x15e)]['join'](',\x20');const [_0x59f2fe]=_0x22c240['split']('=',0x2);if(!ProfileSetCommand[_0x5b0da3(0x15e)][_0x5b0da3(0x12b)](_0x59f2fe))return _0x5b0da3(0x110)+_0x59f2fe+_0x5b0da3(0x119)+ProfileSetCommand[_0x5b0da3(0x15e)][_0x5b0da3(0x132)](',\x20');return undefined;}async[a34_0x2ac38b(0x10f)](_0x2ace78){const _0x2c93fd=a34_0x2ac38b,{args:_0x5615b4,options:_0x15a5e2}=_0x2ace78,_0x46c09e=_0x15a5e2[_0x2c93fd(0x12e)]||getActiveProfile(),[_0x256fba,..._0x444b8d]=_0x5615b4[0x0][_0x2c93fd(0x134)]('='),_0x1f0a07=_0x444b8d[_0x2c93fd(0x132)]('=');console[_0x2c93fd(0x11f)](a34_0x3535c5[_0x2c93fd(0x13f)](_0x2c93fd(0x15a)));if(!profileExists(_0x46c09e)){const _0x4c2903=await a34_0x56a30e({'type':_0x2c93fd(0x165),'name':_0x2c93fd(0x16e),'message':'Profile\x20\x27'+_0x46c09e+_0x2c93fd(0x136),'initial':!![]});if(!_0x4c2903[_0x2c93fd(0x16e)])return console['log'](_0x2c93fd(0x10c)),0x1;}const _0x74ca99=loadProfile(_0x46c09e),_0x1b0fe2=_0x74ca99?.[_0x2c93fd(0x114)]||{};if(_0x256fba===_0x2c93fd(0x13d)){const _0x3ad58f=resolveSite(_0x1f0a07);console[_0x2c93fd(0x11f)]('Changing\x20site\x20to\x20\x27'+_0x3ad58f+_0x2c93fd(0x130)),console[_0x2c93fd(0x11f)]('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x2c93fd(0x11f)]('\x20\x20'+getConsoleUrl(_0x3ad58f,_0x2c93fd(0x11e)));const _0x14d551=await a34_0x56a30e({'type':_0x2c93fd(0x115),'name':_0x2c93fd(0x145),'message':_0x2c93fd(0x127),'validate':_0x4db131=>{const _0x5ebf53=_0x2c93fd;if(!_0x4db131||!_0x4db131[_0x5ebf53(0x124)]())return _0x5ebf53(0x113);return!![];}});if(!_0x14d551['apiKey'])return console[_0x2c93fd(0x11f)](_0x2c93fd(0x138)),0x1;console[_0x2c93fd(0x11f)]('Validating\x20API\x20key...');try{const _0x16cab1=TDX['create']({'site':_0x3ad58f,'apiKey':_0x14d551['apiKey']['trim'](),'logLevel':_0x15a5e2[_0x2c93fd(0x14e)]??LogLevel[_0x2c93fd(0x14b)]}),_0x3cf62a=await _0x16cab1[_0x2c93fd(0x133)][_0x2c93fd(0x140)]();console[_0x2c93fd(0x11f)](a34_0x3535c5[_0x2c93fd(0x14f)]('✓')+_0x2c93fd(0x13e)+_0x3cf62a[_0x2c93fd(0x16d)]+')');const _0x5a669d=await isKeychainAvailable();_0x5a669d?(await saveAPIKeyAsync(_0x14d551[_0x2c93fd(0x145)][_0x2c93fd(0x124)](),_0x3ad58f,_0x46c09e),console['log'](a34_0x3535c5[_0x2c93fd(0x14f)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console[_0x2c93fd(0x143)](a34_0x3535c5[_0x2c93fd(0x16b)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x1b0fe2[_0x2c93fd(0x13d)]=_0x3ad58f;}catch(_0x4b26ce){if(_0x4b26ce instanceof HTTPClientError&&_0x4b26ce[_0x2c93fd(0x123)]===0x191)return printAuthError(_0x4b26ce),0x1;return console['error'](a34_0x3535c5[_0x2c93fd(0x13a)](_0x2c93fd(0x158)+(_0x4b26ce instanceof Error?_0x4b26ce[_0x2c93fd(0x14a)]:String(_0x4b26ce)))),console['error'](_0x2c93fd(0x15b)),0x1;}}else _0x1b0fe2[_0x256fba]=_0x1f0a07||undefined;return saveProfileToUserConfig(_0x46c09e,_0x1b0fe2),console[_0x2c93fd(0x11f)](a34_0x3535c5[_0x2c93fd(0x14f)]('✓')+_0x2c93fd(0x160)+_0x46c09e+_0x2c93fd(0x152)+_0x256fba+'='+(_0x1f0a07||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{[a34_0x2ac38b(0x15f)]=a34_0x2ac38b(0x12a);['description']='Set\x20session\x20profile';[a34_0x2ac38b(0x116)](_0x49bb55){const _0x1c2478=a34_0x2ac38b,{args:_0x59d7d6}=_0x49bb55;if(_0x59d7d6[_0x1c2478(0x155)]===0x0)return _0x1c2478(0x120);return undefined;}async[a34_0x2ac38b(0x10f)](_0x480d80){const _0x8ad395=a34_0x2ac38b,{args:_0x59ac44,options:_0x4758c8}=_0x480d80,_0x11a032=_0x59ac44[0x0],_0x327466=_0x4758c8['default'];cleanExpiredSessions();if(!profileExists(_0x11a032)){console[_0x8ad395(0x10b)](a34_0x3535c5[_0x8ad395(0x13a)](_0x8ad395(0x168)+_0x11a032+'\x27\x20does\x20not\x20exist.')),console[_0x8ad395(0x11f)]('\x0aAvailable\x20profiles:');const _0x3135ac=listProfiles();if(_0x3135ac[_0x8ad395(0x155)]===0x0)console[_0x8ad395(0x11f)](_0x8ad395(0x147));else for(const _0x5d32ea of _0x3135ac){console[_0x8ad395(0x11f)](_0x8ad395(0x156)+_0x5d32ea[_0x8ad395(0x15f)]);}return 0x1;}if(_0x327466){const _0x29d0fc=a34_0x283eef['join'](getConfigDir(),_0x8ad395(0x14c));return saveActiveProfileToUserConfig(_0x11a032),console[_0x8ad395(0x11f)](_0x8ad395(0x16c)+a34_0x3535c5[_0x8ad395(0x14f)](_0x11a032)),console[_0x8ad395(0x11f)](a34_0x3535c5[_0x8ad395(0x12c)](_0x8ad395(0x126)+_0x29d0fc)),0x0;}const _0x2639b7=getSessionID(_0x4758c8[_0x8ad395(0x108)]);return saveSessionContext({'profile':_0x11a032},_0x4758c8['session']),console[_0x8ad395(0x11f)](_0x8ad395(0x117)+a34_0x3535c5[_0x8ad395(0x14f)](_0x11a032)+'\x20'+a34_0x3535c5[_0x8ad395(0x12c)]('(session:\x20'+_0x2639b7+')')),console[_0x8ad395(0x11f)](a34_0x3535c5[_0x8ad395(0x12c)](_0x8ad395(0x12f)+_0x11a032+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a35_0x402504=a35_0x590a;(function(_0x85cf6d,_0x2c6240){const _0x2dcc3e=a35_0x590a,_0x55d020=_0x85cf6d();while(!![]){try{const _0x438a8b=-parseInt(_0x2dcc3e(0x88))/0x1*(parseInt(_0x2dcc3e(0x7f))/0x2)+parseInt(_0x2dcc3e(0x78))/0x3*(parseInt(_0x2dcc3e(0x7d))/0x4)+-parseInt(_0x2dcc3e(0x7b))/0x5+parseInt(_0x2dcc3e(0x8f))/0x6+-parseInt(_0x2dcc3e(0x8e))/0x7+parseInt(_0x2dcc3e(0x8d))/0x8*(-parseInt(_0x2dcc3e(0x8a))/0x9)+-parseInt(_0x2dcc3e(0x8c))/0xa*(-parseInt(_0x2dcc3e(0x80))/0xb);if(_0x438a8b===_0x2c6240)break;else _0x55d020['push'](_0x55d020['shift']());}catch(_0x233589){_0x55d020['push'](_0x55d020['shift']());}}}(a35_0x5aa8,0x6ccef));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a35_0x5aa8(){const _0x13f68f=['message','16pjWAAo','\x20\x20Global:\x20~/.config/tdx/tdx.json','282awYsqV','2398aSayXo','length','config','error','dim','List\x20all\x20available\x20profiles','site','log','2721uzRPXB','Error:\x20','51201aysjkm','map','55770UQJjye','296KIvTuK','1718486bawhab','4081392RjjpbH','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','green','scope','description','31143aWMnkm','name','👤\x20','3261055YrEjjB'];a35_0x5aa8=function(){return _0x13f68f;};return a35_0x5aa8();}import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a35_0x590a(_0x2ebcae,_0x498d9a){_0x2ebcae=_0x2ebcae-0x76;const _0x5aa8c3=a35_0x5aa8();let _0x590a2f=_0x5aa8c3[_0x2ebcae];return _0x590a2f;}import a35_0x8e6730 from'chalk';export class ProfilesCommand extends BaseCommand{['name']='profiles';[a35_0x402504(0x77)]=a35_0x402504(0x85);async['execute'](_0x10149e){const _0xf55be2=a35_0x402504,{options:_0x298087}=_0x10149e;try{const _0x10510e=listProfiles(),_0x2baa1d=getActiveProfile();if(_0x10510e[_0xf55be2(0x81)]===0x0)return console['log']('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0xf55be2(0x87)](_0xf55be2(0x90)),console[_0xf55be2(0x87)](_0xf55be2(0x7e)),0x0;const _0x46016b=_0x10510e[_0xf55be2(0x8b)](_0x37625d=>{const _0x5f14ad=_0xf55be2,_0x19f509=_0x37625d[_0x5f14ad(0x79)]===_0x2baa1d,_0x40df40=getProfileParams(_0x37625d['config']);return{'name':_0x37625d[_0x5f14ad(0x79)],'active':_0x19f509,'scope':_0x37625d[_0x5f14ad(0x76)],'description':_0x37625d[_0x5f14ad(0x82)][_0x5f14ad(0x77)]||'','params':_0x40df40};});if(isStructuredFormat(_0x298087))await handleSDKOutput(_0x46016b,_0x298087);else for(const _0x3a2821 of _0x10510e){const _0x3b9d15=_0x3a2821[_0xf55be2(0x79)]===_0x2baa1d?a35_0x8e6730[_0xf55be2(0x91)]('\x20✓'):'',_0x2ff571=_0x3a2821[_0xf55be2(0x82)][_0xf55be2(0x86)]?a35_0x8e6730[_0xf55be2(0x84)]('\x20'+_0x3a2821['config'][_0xf55be2(0x86)]):'',_0x273990=_0x3a2821[_0xf55be2(0x82)]['description']?a35_0x8e6730[_0xf55be2(0x84)]('\x20\x20'+_0x3a2821[_0xf55be2(0x82)][_0xf55be2(0x77)]):'';console['log'](_0xf55be2(0x7a)+_0x3a2821['name']+_0x3b9d15+_0x2ff571+_0x273990);}return 0x0;}catch(_0x1d87e0){return _0x1d87e0 instanceof Error&&console[_0xf55be2(0x83)](_0xf55be2(0x89)+_0x1d87e0[_0xf55be2(0x7c)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x2cf192=a36_0x2fa9;(function(_0x318084,_0x2203c9){const _0x510a08=a36_0x2fa9,_0x5a2334=_0x318084();while(!![]){try{const _0x4b50d4=-parseInt(_0x510a08(0x187))/0x1+-parseInt(_0x510a08(0x170))/0x2*(-parseInt(_0x510a08(0x179))/0x3)+parseInt(_0x510a08(0x167))/0x4*(-parseInt(_0x510a08(0x18d))/0x5)+parseInt(_0x510a08(0x190))/0x6+-parseInt(_0x510a08(0x16f))/0x7+parseInt(_0x510a08(0x186))/0x8*(parseInt(_0x510a08(0x197))/0x9)+parseInt(_0x510a08(0x188))/0xa;if(_0x4b50d4===_0x2203c9)break;else _0x5a2334['push'](_0x5a2334['shift']());}catch(_0x5bd7b4){_0x5a2334['push'](_0x5a2334['shift']());}}}(a36_0x108f,0xd1de4));import{BaseCommand}from'./command.js';function a36_0x108f(){const _0x4e9314=['description','Executing\x20statement\x20','execute','1251795EjbOrm','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','options','7766424aSSmqB','totalSplits','Error:\x20','validate','query','push','catalog','9UDapsh','\x20rows\x20','in\x20','20kUuBWT','No\x20SQL\x20provided','data','message','output','verbose','Schema:\x20','information_schema','6197499KIpWTY','1966eWlGxy','Catalog:\x20','completedSplits','processedRows','setExtra','file','\x20splits','stats','Site:\x20','2343BOtpNC','length','\x20[Job\x20ID:\x20','Executing\x20query\x20[','\x0aAll\x20results\x20saved\x20to\x20','Executing\x20query...','originalMessage','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','Run\x20Trino\x20queries\x20(streaming)','database','Query\x20completed:\x20Processed\x20','Statement\x20','error','2278472QzIIyX','1312416saAXAs','19622520KUgDTg','site'];a36_0x108f=function(){return _0x4e9314;};return a36_0x108f();}import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';function a36_0x2fa9(_0x44659f,_0x17e778){_0x44659f=_0x44659f-0x165;const _0x108f1b=a36_0x108f();let _0x2fa9fc=_0x108f1b[_0x44659f];return _0x2fa9fc;}export class QueryCommand extends BaseCommand{['name']=a36_0x2cf192(0x194);[a36_0x2cf192(0x18a)]=a36_0x2cf192(0x181);async[a36_0x2cf192(0x18c)](_0x543236){const _0x41d086=a36_0x2cf192,{options:_0x4cb100,args:_0x207ce4,tdx:_0x1364b4}=_0x543236,_0x511c35={..._0x4cb100,'limitStructuredFormats':!![]},_0x1b0678=_0x207ce4[0x0],_0x1c6b41=_0x4cb100[_0x41d086(0x175)];let _0x4bb1c3;try{if(_0x1c6b41)_0x4bb1c3=readSqlStatementsFromFile(_0x1c6b41);else{if(_0x1b0678==='-')_0x4bb1c3=await readSqlStatementsFromStdin();else{if(_0x1b0678&&isSqlFilePath(_0x1b0678))_0x4bb1c3=readSqlStatementsFromFile(_0x1b0678);else{if(_0x1b0678)_0x4bb1c3=splitSqlStatements(_0x1b0678);else throw new Error(_0x41d086(0x168));}}}}catch(_0x31a1ce){return console['error'](_0x41d086(0x192)+_0x31a1ce[_0x41d086(0x16a)]),0x1;}const _0x5ec131=_0x4cb100[_0x41d086(0x182)]||_0x41d086(0x16e),_0x39eac1=_0x4cb100[_0x41d086(0x196)];try{const _0x321b78=[],_0x53f911=!!_0x4cb100['output'];for(let _0x847968=0x0;_0x847968<_0x4bb1c3[_0x41d086(0x17a)];_0x847968++){const _0x70f719=_0x4bb1c3[_0x847968],_0x1784a9=_0x847968+0x1,_0xae187f=_0x4bb1c3[_0x41d086(0x17a)],_0x5176d2=_0xae187f>0x1;_0x4cb100['verbose']&&(console[_0x41d086(0x185)]('\x0a'+(_0x5176d2?'Statement\x20'+_0x1784a9+'/'+_0xae187f+':':'')),console[_0x41d086(0x185)](_0x41d086(0x178)+_0x4cb100[_0x41d086(0x189)]),console['error'](_0x41d086(0x171)+(_0x39eac1||'td')),console[_0x41d086(0x185)](_0x41d086(0x16d)+_0x5ec131),console[_0x41d086(0x185)]('SQL:\x20'+_0x70f719));const _0x494fd7=_0x5176d2?_0x41d086(0x18b)+_0x1784a9+'/'+_0xae187f+'...':_0x41d086(0x17e);try{const _0x486e1d=await withProgressSpinner(_0x494fd7,async _0x2700dd=>{const _0x3777d4=_0x41d086,_0x2b8558=await _0x1364b4['query'][_0x3777d4(0x18c)](_0x70f719,{'catalog':_0x39eac1,'schema':_0x5ec131,'onJobId':_0x4ecf6c=>{_0x2700dd['setJobId'](_0x4ecf6c);},'onProgress':_0x34d6bf=>{const _0x1ceb8b=_0x3777d4;_0x2700dd['setPhase'](_0x1ceb8b(0x17c)+_0x34d6bf['state']+']'),_0x2700dd[_0x1ceb8b(0x174)](formatRows(_0x34d6bf[_0x1ceb8b(0x173)])+_0x1ceb8b(0x165)+_0x34d6bf[_0x1ceb8b(0x172)]+'/'+_0x34d6bf[_0x1ceb8b(0x191)]+_0x1ceb8b(0x176));}});return _0x2b8558;},{'verbose':_0x4cb100[_0x41d086(0x16c)]}),_0x214fa7=_0x486e1d[_0x41d086(0x169)],_0x33feda=_0x214fa7['jobId']?_0x41d086(0x17b)+_0x214fa7['jobId']+']':'',_0x2e3ea2=_0x5176d2?_0x41d086(0x184)+_0x1784a9+'/'+_0xae187f+'\x20-\x20':'';console[_0x41d086(0x185)]('✔\x20'+_0x2e3ea2+_0x41d086(0x183)+formatRows(_0x214fa7['stats'][_0x41d086(0x173)])+_0x41d086(0x165)+(_0x41d086(0x166)+formatElapsed(_0x214fa7[_0x41d086(0x177)]['elapsedTimeMillis'])+_0x33feda));if(_0x5176d2&&_0x53f911){const _0x42913d=resolveOutputOptions(_0x511c35),_0x5e658a=await formatQueryOutput(_0x214fa7,_0x42913d);_0x321b78[_0x41d086(0x195)](_0x5e658a);}else await handleQueryOutput(_0x214fa7,_0x511c35);}catch(_0x21e7b0){const _0x5b60e8=_0x5176d2?_0x41d086(0x184)+_0x1784a9+'/'+_0xae187f+':\x0a':'',_0x3bff6d=_0x21e7b0 instanceof SDKError?_0x21e7b0[_0x41d086(0x17f)]:_0x21e7b0[_0x41d086(0x16a)];return console['error'](''+_0x5b60e8+_0x3bff6d),0x1;}}if(_0x4bb1c3[_0x41d086(0x17a)]>0x1&&_0x53f911&&_0x321b78['length']>0x0){const _0x752935=_0x321b78['join']('\x0a');writeFileSync(_0x4cb100[_0x41d086(0x16b)],_0x752935),console[_0x41d086(0x185)](_0x41d086(0x17d)+_0x4cb100[_0x41d086(0x16b)]);}return 0x0;}catch(_0x224f43){throw _0x224f43;}}[a36_0x2cf192(0x193)](_0x5075b4){const _0x4e15c3=a36_0x2cf192,_0x416e4f=_0x5075b4['args'][0x0],_0x546066=_0x5075b4[_0x4e15c3(0x18f)][_0x4e15c3(0x175)];if(!_0x416e4f&&!_0x546066)return _0x4e15c3(0x18e);if(_0x416e4f&&_0x546066)return _0x4e15c3(0x180);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x59be9=a37_0x4c5b;(function(_0xf750d1,_0x5321ee){const _0x2c4302=a37_0x4c5b,_0x28002f=_0xf750d1();while(!![]){try{const _0x2931b2=parseInt(_0x2c4302(0x122))/0x1+parseInt(_0x2c4302(0xdb))/0x2+parseInt(_0x2c4302(0xf6))/0x3+-parseInt(_0x2c4302(0xcb))/0x4+parseInt(_0x2c4302(0x11c))/0x5*(-parseInt(_0x2c4302(0x13d))/0x6)+parseInt(_0x2c4302(0xeb))/0x7*(-parseInt(_0x2c4302(0x12e))/0x8)+parseInt(_0x2c4302(0x120))/0x9;if(_0x2931b2===_0x5321ee)break;else _0x28002f['push'](_0x28002f['shift']());}catch(_0x29933a){_0x28002f['push'](_0x28002f['shift']());}}}(a37_0x59fd,0xf2e7e));function a37_0x59fd(){const _0xc13516=['Delete\x20a\x20scheduled\x20query','engineVersion','count','(unnamed)','timezone','num','last_job','json','pagination','statusIcon','list','utf-8','success','763jqKCKS','history','next_run_at','description','Running\x20schedule:\x20','in\x20','Schedule\x20created:\x20','type','created_at','\x20job','padEnd','430422lxTMjR','user_name','retryLimit','Running\x20schedule...','Failed\x20to\x20read\x20file:\x20','schedule:delete','output','Showing\x20first\x20','trim','📅\x20','Create\x20a\x20scheduled\x20query','\x20\x20Job\x20ID:\x20','format','red','Show\x20schedule\x20execution\x20history','Show\x20schedule\x20details','nextRun','...','keys','update','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Update\x20a\x20scheduled\x20query','tsv','jobs','\x20matching\x20\x22','has_next_page','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','updated_at','toLocaleDateString','\x20\x20Time:\x20','options','cyan','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','job_id','Searching\x20scheduled\x20queries\x20matching\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','yes','INVALID_ARGUMENT','45060MKwvnz','Schedule\x20updated:\x20','data','queries','22508064ucxQhu','error','872513JfTsjM','cron','log','max','h\x20ago','Query\x20file\x20is\x20empty','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','engine_version','Schedule\x20deleted:\x20','executing_user_id','List\x20scheduled\x20queries','schedule:create','102480HqEVVI','schedule:update','limit','abs','Cancelled','never','run','\x20\x20Database:\x20','\x20\x20Type:\x20','Updating\x20schedule:\x20','Run\x20a\x20scheduled\x20query\x20immediately','from','database','just\x20now','Getting\x20schedule\x20details...','1092dCTiVu','\x20\x20Cron:\x20','schedules','status','schedule:run','ended_at','listQueries','priority','schedule:history','lastRun','\x20(showing\x20','\x20execution','args','execute','\x20\x20Timezone:\x20','query','getTime','length','Updating\x20schedule...','delay','result','entries','ies','queryUrl','substring','Getting\x20schedule\x20history...','Found\x20','3741412FKcdKr','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','join','schedule:list','Creating\x20schedule:\x20','round','Creating\x20schedule...','create','file','map','\x20schedules','name','show','verbose','end_at','validate','2899772iXRLgW','No\x20scheduled\x20queries\x20found','Listing\x20scheduled\x20queries...'];a37_0x59fd=function(){return _0xc13516;};return a37_0x59fd();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a37_0x73c5e2 from'chalk';function formatRelativeTime(_0x1da8f6){const _0x225759=a37_0x4c5b,_0x3b4ae8=new Date(_0x1da8f6),_0x560f99=new Date(),_0x32ca3c=_0x3b4ae8[_0x225759(0xc0)]()-_0x560f99[_0x225759(0xc0)](),_0xb21c42=Math[_0x225759(0x131)](_0x32ca3c)/0x3e8,_0x313b5d=_0x32ca3c<0x0;if(_0xb21c42<0x3c)return _0x313b5d?_0x225759(0x13b):'soon';else{if(_0xb21c42<0xe10){const _0x2c492a=Math[_0x225759(0xd0)](_0xb21c42/0x3c);return _0x313b5d?_0x2c492a+'m\x20ago':'in\x20'+_0x2c492a+'m';}else{if(_0xb21c42<0x15180){const _0x16e789=Math[_0x225759(0xd0)](_0xb21c42/0xe10);return _0x313b5d?_0x16e789+_0x225759(0x126):_0x225759(0xf0)+_0x16e789+'h';}else{if(_0xb21c42<0x93a80){const _0x2c0309=Math[_0x225759(0xd0)](_0xb21c42/0x15180);return _0x313b5d?_0x2c0309+'d\x20ago':_0x225759(0xf0)+_0x2c0309+'d';}else return _0x3b4ae8[_0x225759(0x112)]();}}}}export class ScheduleListCommand extends BaseCommand{[a37_0x59be9(0xd6)]=a37_0x59be9(0xce);[a37_0x59be9(0xee)]=a37_0x59be9(0x12c);async[a37_0x59be9(0xbd)](_0x174d74){const _0x6d171f=a37_0x59be9,{options:_0x704585,args:_0x148f37,tdx:_0x1c10e4}=_0x174d74,_0x41b703=resolveLimit(_0x704585[_0x6d171f(0x130)],DEFAULT_DISPLAY_LIMIT),_0x1a7b1f=_0x148f37[0x0],_0x4b3496=_0x1a7b1f?_0x6d171f(0x118)+_0x1a7b1f+'\x22...':_0x6d171f(0xdd),_0x5762f2=await withSpinner(_0x4b3496,()=>_0x1c10e4[_0x6d171f(0x13f)][_0x6d171f(0xb6)]({'limit':_0x41b703,'scheduled':!![],'pattern':_0x1a7b1f}),{'verbose':_0x704585[_0x6d171f(0xd8)]}),_0x4e1e68=_0x5762f2[_0x6d171f(0x11e)][_0x6d171f(0x11f)],_0x191285=_0x5762f2[_0x6d171f(0x11e)][_0x6d171f(0xe6)][_0x6d171f(0x10f)],_0x56deee=_0x1a7b1f?_0x6d171f(0x10e)+_0x1a7b1f+'\x22':'';_0x191285?console['error'](_0x6d171f(0xfd)+_0x4e1e68[_0x6d171f(0xc1)]+_0x6d171f(0xd5)+_0x56deee+'\x20(use\x20--limit\x20to\x20see\x20more)'):console['error'](_0x6d171f(0xca)+_0x4e1e68[_0x6d171f(0xc1)]+'\x20scheduled\x20quer'+(_0x4e1e68[_0x6d171f(0xc1)]!==0x1?_0x6d171f(0xc6):'y')+_0x56deee);if(_0x704585[_0x6d171f(0x102)]===_0x6d171f(0xe5)||_0x704585['format']==='jsonl'||_0x704585[_0x6d171f(0x102)]==='table'||_0x704585[_0x6d171f(0x102)]===_0x6d171f(0x10c)){const _0x37e4e9=_0x4e1e68[_0x6d171f(0xd4)](_0x3e1a7d=>({'id':_0x3e1a7d['id'],'name':_0x3e1a7d[_0x6d171f(0xd6)],'cron':_0x3e1a7d['cron'],'database':_0x3e1a7d[_0x6d171f(0x13a)]?.[_0x6d171f(0xd6)],'type':_0x3e1a7d[_0x6d171f(0xf2)],'timezone':_0x3e1a7d['time_zone'],'user_name':_0x3e1a7d['user']?.['name'],'updated_at':_0x3e1a7d[_0x6d171f(0x111)],'next_run_at':_0x3e1a7d[_0x6d171f(0xed)],'last_job_status':_0x3e1a7d['last_job']?.[_0x6d171f(0x140)]}));await handleSDKOutput(_0x37e4e9,_0x704585);}else{if(_0x4e1e68[_0x6d171f(0xc1)]===0x0)console[_0x6d171f(0x124)](_0x6d171f(0xdc));else{const _0x25a08f=_0x704585['site'],_0x460a6f=_0x4e1e68[_0x6d171f(0xd4)](_0x3046b6=>{const _0x40071d=_0x6d171f,_0x400a9a=_0x3046b6[_0x40071d(0xe4)]?.[_0x40071d(0x140)]?_0x3046b6[_0x40071d(0xe4)][_0x40071d(0x140)]===_0x40071d(0xea)?'✓':'✗':'-',_0x28a0b9=_0x3046b6[_0x40071d(0xe4)]?.[_0x40071d(0xb5)]?formatRelativeTime(_0x3046b6[_0x40071d(0xe4)][_0x40071d(0xb5)]):_0x40071d(0x133),_0x5c3d7d=_0x3046b6[_0x40071d(0xed)]?formatRelativeTime(_0x3046b6[_0x40071d(0xed)]):'-',_0x513501=_0x3046b6[_0x40071d(0x123)]||'',_0x304227=_0x3046b6[_0x40071d(0xd6)]||_0x40071d(0xe1),_0x2bc202=getConsoleUrl(_0x25a08f,'/app/queries/editor?queryId='+_0x3046b6['id']);return{'statusIcon':_0x400a9a,'lastRun':_0x28a0b9,'nextRun':_0x5c3d7d,'cron':_0x513501,'name':_0x304227,'queryUrl':_0x2bc202,'status':_0x3046b6[_0x40071d(0xe4)]?.['status']};}),_0x41e09=Math[_0x6d171f(0x125)](..._0x460a6f['map'](_0x5e4cda=>_0x5e4cda[_0x6d171f(0xb9)]['length'])),_0xdb197c=Math['max'](..._0x460a6f[_0x6d171f(0xd4)](_0x5a2631=>_0x5a2631['nextRun'][_0x6d171f(0xc1)])),_0x56b992=Math[_0x6d171f(0x125)](..._0x460a6f[_0x6d171f(0xd4)](_0x2dca9a=>_0x2dca9a[_0x6d171f(0x123)][_0x6d171f(0xc1)])),_0x2cb557=_0x460a6f['map'](_0x312c91=>{const _0x587856=_0x6d171f,_0x3b76a4=_0x312c91['status']===_0x587856(0xea)?a37_0x73c5e2['green'](_0x312c91[_0x587856(0xe7)]):_0x312c91[_0x587856(0x140)]===_0x587856(0x121)?a37_0x73c5e2[_0x587856(0x103)](_0x312c91[_0x587856(0xe7)]):a37_0x73c5e2['dim'](_0x312c91[_0x587856(0xe7)]),_0xf1dea0=_0x312c91[_0x587856(0xb9)][_0x587856(0xf5)](_0x41e09),_0x5632b4=_0x312c91[_0x587856(0x106)][_0x587856(0xf5)](_0xdb197c),_0x3ee163=_0x312c91[_0x587856(0x123)]?a37_0x73c5e2[_0x587856(0x115)](_0x312c91[_0x587856(0x123)][_0x587856(0xf5)](_0x56b992)):'\x20'['repeat'](_0x56b992),_0x3f47fa=hyperlink(_0x312c91[_0x587856(0xd6)],_0x312c91[_0x587856(0xc7)]);return _0x587856(0xff)+_0x3b76a4+'\x20'+_0xf1dea0+'\x20\x20→\x20'+_0x5632b4+'\x20\x20'+_0x3ee163+'\x20\x20'+_0x3f47fa;});await writeOutput(_0x2cb557[_0x6d171f(0xcd)]('\x0a'),_0x704585[_0x6d171f(0xfc)],_0x6d171f(0xe8));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a37_0x59be9(0xd6)]='schedule:show';['description']=a37_0x59be9(0x105);[a37_0x59be9(0xda)](_0x1d32d4){const _0x4a97a8=a37_0x59be9,_0x3e3a6b=_0x1d32d4[_0x4a97a8(0xbc)][0x0];if(!_0x3e3a6b)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a37_0x59be9(0xbd)](_0x2a1ec8){const _0x3ef387=a37_0x59be9,{options:_0x349f2,args:_0x5ee5d7,tdx:_0x414ca6}=_0x2a1ec8,_0x5db78f=_0x5ee5d7[0x0],_0xefe3f8=await withSpinner(_0x3ef387(0x13c),()=>_0x414ca6['schedules'][_0x3ef387(0xd7)](_0x5db78f),{'verbose':_0x349f2[_0x3ef387(0xd8)]}),_0xb896a1=_0xefe3f8[_0x3ef387(0x11e)],_0x1aaae6={'name':_0xb896a1['name'],'cron':_0xb896a1[_0x3ef387(0x123)],'database':_0xb896a1['database'],'type':_0xb896a1[_0x3ef387(0xf2)],'timezone':_0xb896a1[_0x3ef387(0xe2)],'user_name':_0xb896a1[_0x3ef387(0xf7)],'created_at':_0xb896a1[_0x3ef387(0xf3)],'engine_version':_0xb896a1[_0x3ef387(0x129)],'executing_user_id':_0xb896a1[_0x3ef387(0x12b)],'query':_0xb896a1['query'],'delay':_0xb896a1['delay'],'priority':_0xb896a1[_0x3ef387(0xb7)],'retry_limit':_0xb896a1['retry_limit'],..._0xb896a1[_0x3ef387(0xc4)]&&{'result':_0xb896a1[_0x3ef387(0xc4)]}};return await handleSingleObjectOutput(_0x1aaae6,_0x349f2),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a37_0x59be9(0x12d);[a37_0x59be9(0xee)]=a37_0x59be9(0x100);[a37_0x59be9(0xda)](_0x5295f0){const _0x2be4d8=a37_0x59be9,_0x4a6961=_0x5295f0[_0x2be4d8(0xbc)][0x0];if(!_0x4a6961)return _0x2be4d8(0x116);const _0x576814=_0x5295f0[_0x2be4d8(0x114)];if(!_0x576814[_0x2be4d8(0x13a)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a37_0x59be9(0xbd)](_0x2d80dc){const _0x5e4006=a37_0x59be9,{options:_0x2a262e,args:_0x1ba32e,tdx:_0x9e7f33}=_0x2d80dc,_0x13b1d9=_0x1ba32e[0x0],_0x34ebac=_0x2a262e,_0x582f9f=_0x34ebac[_0x5e4006(0x13a)],_0xc38005=_0x34ebac[_0x5e4006(0xd3)],_0x3d0748=_0x34ebac[_0x5e4006(0xf2)]||'trino';let _0x1b70eb;try{_0x1b70eb=readFileSync(_0xc38005,'utf-8')[_0x5e4006(0xfe)]();}catch(_0x2b8ef0){throw new SDKError(ErrorCode[_0x5e4006(0x11b)],'Failed\x20to\x20read\x20file:\x20'+_0xc38005,_0x2b8ef0 instanceof Error?_0x2b8ef0:undefined);}if(!_0x1b70eb)throw new SDKError(ErrorCode[_0x5e4006(0x11b)],_0x5e4006(0x127));const _0x567c42={'database':_0x582f9f,'query':_0x1b70eb,'type':_0x3d0748};if(_0x34ebac['cron'])_0x567c42[_0x5e4006(0x123)]=_0x34ebac[_0x5e4006(0x123)];if(_0x34ebac[_0x5e4006(0xe2)])_0x567c42['timezone']=_0x34ebac[_0x5e4006(0xe2)];if(_0x34ebac['delay']!==undefined)_0x567c42['delay']=Number(_0x34ebac['delay']);if(_0x34ebac[_0x5e4006(0xb7)]!==undefined)_0x567c42[_0x5e4006(0xb7)]=Number(_0x34ebac[_0x5e4006(0xb7)]);if(_0x34ebac[_0x5e4006(0xf8)]!==undefined)_0x567c42['retry_limit']=Number(_0x34ebac[_0x5e4006(0xf8)]);if(_0x34ebac['engineVersion'])_0x567c42[_0x5e4006(0x129)]=_0x34ebac[_0x5e4006(0xdf)];if(_0x34ebac[_0x5e4006(0xc4)])_0x567c42[_0x5e4006(0xc4)]=_0x34ebac[_0x5e4006(0xc4)];if(_0x2a262e[_0x5e4006(0xd8)]){console[_0x5e4006(0x121)](_0x5e4006(0xcf)+_0x13b1d9),console[_0x5e4006(0x121)](_0x5e4006(0x135)+_0x582f9f),console[_0x5e4006(0x121)](_0x5e4006(0x136)+_0x3d0748);if(_0x567c42['cron'])console[_0x5e4006(0x121)](_0x5e4006(0x13e)+_0x567c42[_0x5e4006(0x123)]);if(_0x567c42[_0x5e4006(0xe2)])console['error'](_0x5e4006(0xbe)+_0x567c42['timezone']);}const _0x543e5d=await withSpinner(_0x5e4006(0xd1),()=>_0x9e7f33[_0x5e4006(0x13f)][_0x5e4006(0xd2)](_0x13b1d9,_0x567c42),{'verbose':_0x2a262e[_0x5e4006(0xd8)]});return console[_0x5e4006(0x121)](_0x5e4006(0xf1)+_0x543e5d[_0x5e4006(0x11e)]['name']),await handleSingleObjectOutput(_0x543e5d[_0x5e4006(0x11e)],_0x2a262e),0x0;}}function a37_0x4c5b(_0x1d8e29,_0x1c3f37){_0x1d8e29=_0x1d8e29-0xb5;const _0x59fd27=a37_0x59fd();let _0x4c5bd8=_0x59fd27[_0x1d8e29];return _0x4c5bd8;}export class ScheduleUpdateCommand extends BaseCommand{[a37_0x59be9(0xd6)]=a37_0x59be9(0x12f);['description']=a37_0x59be9(0x10b);[a37_0x59be9(0xda)](_0x44f5cd){const _0x20c015=a37_0x59be9,_0x4191fd=_0x44f5cd[_0x20c015(0xbc)][0x0];if(!_0x4191fd)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a37_0x59be9(0xbd)](_0x3e6144){const _0xc65178=a37_0x59be9,{options:_0x3c6966,args:_0x28a0b2,tdx:_0x36d85c}=_0x3e6144,_0x2a0672=_0x28a0b2[0x0],_0x274534=_0x3c6966,_0x27fbb8={};if(_0x274534[_0xc65178(0x13a)])_0x27fbb8[_0xc65178(0x13a)]=_0x274534['database'];if(_0x274534[_0xc65178(0xf2)])_0x27fbb8[_0xc65178(0xf2)]=_0x274534[_0xc65178(0xf2)];if(_0x274534[_0xc65178(0x123)])_0x27fbb8['cron']=_0x274534[_0xc65178(0x123)];if(_0x274534[_0xc65178(0xe2)])_0x27fbb8['timezone']=_0x274534[_0xc65178(0xe2)];if(_0x274534[_0xc65178(0xc3)]!==undefined)_0x27fbb8[_0xc65178(0xc3)]=Number(_0x274534[_0xc65178(0xc3)]);if(_0x274534[_0xc65178(0xb7)]!==undefined)_0x27fbb8[_0xc65178(0xb7)]=Number(_0x274534[_0xc65178(0xb7)]);if(_0x274534['retryLimit']!==undefined)_0x27fbb8['retry_limit']=Number(_0x274534['retryLimit']);if(_0x274534[_0xc65178(0xdf)])_0x27fbb8['engine_version']=_0x274534[_0xc65178(0xdf)];if(_0x274534[_0xc65178(0xc4)])_0x27fbb8[_0xc65178(0xc4)]=_0x274534[_0xc65178(0xc4)];if(_0x274534['file'])try{_0x27fbb8['query']=readFileSync(_0x274534[_0xc65178(0xd3)],_0xc65178(0xe9))[_0xc65178(0xfe)]();}catch(_0x3748ff){throw new SDKError(ErrorCode[_0xc65178(0x11b)],_0xc65178(0xfa)+_0x274534[_0xc65178(0xd3)],_0x3748ff instanceof Error?_0x3748ff:undefined);}if(Object[_0xc65178(0x108)](_0x27fbb8)[_0xc65178(0xc1)]===0x0)throw new SDKError(ErrorCode[_0xc65178(0x11b)],_0xc65178(0x10a));if(_0x3c6966[_0xc65178(0xd8)]){console[_0xc65178(0x121)](_0xc65178(0x137)+_0x2a0672);for(const [_0x3a2e23,_0x39483f]of Object[_0xc65178(0xc5)](_0x27fbb8)){_0x3a2e23===_0xc65178(0xbf)?console[_0xc65178(0x121)]('\x20\x20'+_0x3a2e23+':\x20'+_0x39483f[_0xc65178(0xc8)](0x0,0x32)+_0xc65178(0x107)):console['error']('\x20\x20'+_0x3a2e23+':\x20'+_0x39483f);}}const _0x415e87=await withSpinner(_0xc65178(0xc2),()=>_0x36d85c[_0xc65178(0x13f)][_0xc65178(0x109)](_0x2a0672,_0x27fbb8),{'verbose':_0x3c6966[_0xc65178(0xd8)]});return console[_0xc65178(0x121)](_0xc65178(0x11d)+_0x415e87[_0xc65178(0x11e)][_0xc65178(0xd6)]),await handleSingleObjectOutput(_0x415e87[_0xc65178(0x11e)],_0x3c6966),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a37_0x59be9(0xd6)]=a37_0x59be9(0xfb);[a37_0x59be9(0xee)]=a37_0x59be9(0xde);[a37_0x59be9(0xda)](_0x555951){const _0x59a767=a37_0x59be9,_0x2306ea=_0x555951[_0x59a767(0xbc)][0x0];if(!_0x2306ea)return _0x59a767(0x110);return undefined;}async[a37_0x59be9(0xbd)](_0x123f59){const _0x36e746=a37_0x59be9,{options:_0x130edd,args:_0x3ac6c9,tdx:_0x406982}=_0x123f59,_0x5c6bbf=_0x3ac6c9[0x0];if(!_0x130edd[_0x36e746(0x11a)]){const _0x15a167=await confirm(_0x36e746(0x119)+_0x5c6bbf+'\x22?');if(!_0x15a167)return console['error'](_0x36e746(0x132)),0x0;}const _0x1a6e2b=await withSpinner('Deleting\x20schedule...',()=>_0x406982[_0x36e746(0x13f)]['delete'](_0x5c6bbf),{'verbose':_0x130edd[_0x36e746(0xd8)]});return console['error'](_0x36e746(0x12a)+_0x1a6e2b[_0x36e746(0x11e)][_0x36e746(0xd6)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a37_0x59be9(0x141);[a37_0x59be9(0xee)]=a37_0x59be9(0x138);[a37_0x59be9(0xda)](_0x1bb820){const _0x1bec06=a37_0x59be9,_0x3c5afd=_0x1bb820[_0x1bec06(0xbc)][0x0];if(!_0x3c5afd)return _0x1bec06(0x128);return undefined;}async[a37_0x59be9(0xbd)](_0x11a9b7){const _0x470a2d=a37_0x59be9,{options:_0x28ce50,args:_0x348e63,tdx:_0x23e2cc}=_0x11a9b7,_0x569b60=_0x348e63[0x0],_0x3bf32f=_0x28ce50,_0x46e8d9=_0x3bf32f['time'],_0x4981a5=_0x3bf32f[_0x470a2d(0xe3)]!==undefined?Number(_0x3bf32f['num']):undefined;if(_0x28ce50[_0x470a2d(0xd8)]){console[_0x470a2d(0x121)](_0x470a2d(0xef)+_0x569b60);if(_0x46e8d9)console[_0x470a2d(0x121)](_0x470a2d(0x113)+_0x46e8d9);if(_0x4981a5)console['error']('\x20\x20Num:\x20'+_0x4981a5);}const _0x32749f=await withSpinner(_0x470a2d(0xf9),()=>_0x23e2cc[_0x470a2d(0x13f)][_0x470a2d(0x134)](_0x569b60,{'time':_0x46e8d9,'num':_0x4981a5}),{'verbose':_0x28ce50['verbose']}),_0x312804=_0x32749f[_0x470a2d(0x11e)][_0x470a2d(0x10d)];console[_0x470a2d(0x121)]('Schedule\x20run\x20submitted:\x20'+_0x312804[_0x470a2d(0xc1)]+_0x470a2d(0xf4)+(_0x312804[_0x470a2d(0xc1)]!==0x1?'s':'')+'\x20created');for(const _0x2f8f08 of _0x312804){console['error'](_0x470a2d(0x101)+_0x2f8f08[_0x470a2d(0x117)]);}return await handleSDKOutput(_0x312804,_0x28ce50),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a37_0x59be9(0xd6)]=a37_0x59be9(0xb8);[a37_0x59be9(0xee)]=a37_0x59be9(0x104);['validate'](_0x2159f8){const _0x594ffc=a37_0x59be9,_0x4ead77=_0x2159f8[_0x594ffc(0xbc)][0x0];if(!_0x4ead77)return _0x594ffc(0xcc);return undefined;}async[a37_0x59be9(0xbd)](_0x5b02a2){const _0x13b25b=a37_0x59be9,{options:_0x31a833,args:_0x4ce307,tdx:_0x15db58}=_0x5b02a2,_0x575648=_0x4ce307[0x0],_0x35b9db=_0x31a833,_0x35529d=_0x35b9db[_0x13b25b(0x139)]!==undefined?Number(_0x35b9db['from']):undefined,_0x2f1bd4=_0x35b9db['to']!==undefined?Number(_0x35b9db['to']):undefined,_0x4b8325=await withSpinner(_0x13b25b(0xc9),()=>_0x15db58['schedules'][_0x13b25b(0xec)](_0x575648,{'from':_0x35529d,'to':_0x2f1bd4}),{'verbose':_0x31a833['verbose']}),_0x426d5d=_0x4b8325[_0x13b25b(0x11e)];console['error']('Found\x20'+_0x426d5d[_0x13b25b(0xe0)]+_0x13b25b(0xbb)+(_0x426d5d[_0x13b25b(0xe0)]!==0x1?'s':'')+_0x13b25b(0xba)+_0x426d5d[_0x13b25b(0x139)]+'-'+_0x426d5d['to']+')');const _0x5ea2f5=_0x426d5d[_0x13b25b(0xec)][_0x13b25b(0xd4)](_0x123483=>({'job_id':_0x123483['job_id'],'type':_0x123483[_0x13b25b(0xf2)],'status':_0x123483[_0x13b25b(0x140)],'scheduled_at':_0x123483['scheduled_at'],'created_at':_0x123483[_0x13b25b(0xf3)],'start_at':_0x123483['start_at'],'end_at':_0x123483[_0x13b25b(0xd9)]}));return await handleSDKOutput(_0x5ea2f5,_0x31a833),0x0;}}
|
|
1
|
+
const a37_0xcb1009=a37_0x1001;(function(_0x5f138d,_0x2f71c1){const _0x503cd1=a37_0x1001,_0x4c6aac=_0x5f138d();while(!![]){try{const _0x29f010=-parseInt(_0x503cd1(0x143))/0x1+parseInt(_0x503cd1(0xb7))/0x2*(parseInt(_0x503cd1(0x11f))/0x3)+parseInt(_0x503cd1(0xdd))/0x4+parseInt(_0x503cd1(0xc4))/0x5*(parseInt(_0x503cd1(0xe1))/0x6)+-parseInt(_0x503cd1(0xd9))/0x7+-parseInt(_0x503cd1(0xbb))/0x8*(parseInt(_0x503cd1(0x10a))/0x9)+parseInt(_0x503cd1(0xf0))/0xa;if(_0x29f010===_0x2f71c1)break;else _0x4c6aac['push'](_0x4c6aac['shift']());}catch(_0x21aed0){_0x4c6aac['push'](_0x4c6aac['shift']());}}}(a37_0x541b,0x3cf0a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a37_0x38395d from'chalk';function formatRelativeTime(_0xa26682){const _0x111276=a37_0x1001,_0x91e161=new Date(_0xa26682),_0x36ca47=new Date(),_0x17da90=_0x91e161[_0x111276(0xc3)]()-_0x36ca47[_0x111276(0xc3)](),_0x659b4=Math['abs'](_0x17da90)/0x3e8,_0x369035=_0x17da90<0x0;if(_0x659b4<0x3c)return _0x369035?'just\x20now':_0x111276(0xdc);else{if(_0x659b4<0xe10){const _0x389883=Math['round'](_0x659b4/0x3c);return _0x369035?_0x389883+_0x111276(0xc0):'in\x20'+_0x389883+'m';}else{if(_0x659b4<0x15180){const _0x21fb52=Math[_0x111276(0xfd)](_0x659b4/0xe10);return _0x369035?_0x21fb52+_0x111276(0xde):_0x111276(0x125)+_0x21fb52+'h';}else{if(_0x659b4<0x93a80){const _0x49e04c=Math['round'](_0x659b4/0x15180);return _0x369035?_0x49e04c+_0x111276(0x124):_0x111276(0x125)+_0x49e04c+'d';}else return _0x91e161['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{['name']='schedule:list';[a37_0xcb1009(0x118)]=a37_0xcb1009(0xf7);async[a37_0xcb1009(0xe9)](_0x1dea77){const _0x4ec433=a37_0xcb1009,{options:_0x56cb87,args:_0x482c39,tdx:_0x28dbc8}=_0x1dea77,_0x5cebff=resolveLimit(_0x56cb87[_0x4ec433(0xd0)],DEFAULT_DISPLAY_LIMIT),_0x574f35=_0x482c39[0x0],_0x1f8aeb=_0x574f35?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x574f35+_0x4ec433(0x138):_0x4ec433(0x13f),_0x29edf3=await withSpinner(_0x1f8aeb,()=>_0x28dbc8['schedules'][_0x4ec433(0xe7)]({'limit':_0x5cebff,'scheduled':!![],'pattern':_0x574f35}),{'verbose':_0x56cb87[_0x4ec433(0x13e)]}),_0x530d34=_0x29edf3[_0x4ec433(0x149)][_0x4ec433(0xf6)],_0x50aef4=_0x29edf3['data'][_0x4ec433(0x105)][_0x4ec433(0xc5)],_0x1910c4=_0x574f35?_0x4ec433(0xfc)+_0x574f35+'\x22':'';_0x50aef4?console[_0x4ec433(0xff)](_0x4ec433(0x112)+_0x530d34[_0x4ec433(0x11e)]+_0x4ec433(0x10d)+_0x1910c4+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x4ec433(0xff)](_0x4ec433(0x146)+_0x530d34[_0x4ec433(0x11e)]+_0x4ec433(0x139)+(_0x530d34[_0x4ec433(0x11e)]!==0x1?_0x4ec433(0x131):'y')+_0x1910c4);if(_0x56cb87[_0x4ec433(0x134)]===_0x4ec433(0xec)||_0x56cb87[_0x4ec433(0x134)]===_0x4ec433(0xc1)||_0x56cb87[_0x4ec433(0x134)]===_0x4ec433(0x13a)||_0x56cb87[_0x4ec433(0x134)]===_0x4ec433(0xe3)){const _0x2a7fd9=_0x530d34[_0x4ec433(0xed)](_0x397707=>({'id':_0x397707['id'],'name':_0x397707[_0x4ec433(0xba)],'cron':_0x397707[_0x4ec433(0xd8)],'database':_0x397707['database']?.[_0x4ec433(0xba)],'type':_0x397707[_0x4ec433(0xbf)],'timezone':_0x397707[_0x4ec433(0xe4)],'user_name':_0x397707['user']?.[_0x4ec433(0xba)],'updated_at':_0x397707['updated_at'],'next_run_at':_0x397707[_0x4ec433(0xcd)],'last_job_status':_0x397707['last_job']?.[_0x4ec433(0xe0)]}));await handleSDKOutput(_0x2a7fd9,_0x56cb87);}else{if(_0x530d34[_0x4ec433(0x11e)]===0x0)console[_0x4ec433(0x116)](_0x4ec433(0x109));else{const _0x23c039=_0x56cb87[_0x4ec433(0xd7)],_0x43da20=_0x530d34[_0x4ec433(0xed)](_0x40f22c=>{const _0x23ff6d=_0x4ec433,_0x32edf8=_0x40f22c['last_job']?.[_0x23ff6d(0xe0)]?_0x40f22c[_0x23ff6d(0xf8)][_0x23ff6d(0xe0)]===_0x23ff6d(0xf2)?'✓':'✗':'-',_0x503b0c=_0x40f22c[_0x23ff6d(0xf8)]?.[_0x23ff6d(0x128)]?formatRelativeTime(_0x40f22c[_0x23ff6d(0xf8)][_0x23ff6d(0x128)]):_0x23ff6d(0x115),_0x56b5ba=_0x40f22c[_0x23ff6d(0xcd)]?formatRelativeTime(_0x40f22c[_0x23ff6d(0xcd)]):'-',_0x15c6a5=_0x40f22c[_0x23ff6d(0xd8)]||'',_0x4700eb=_0x40f22c[_0x23ff6d(0xba)]||'(unnamed)',_0x2c4305=getConsoleUrl(_0x23c039,_0x23ff6d(0xd4)+_0x40f22c['id']);return{'statusIcon':_0x32edf8,'lastRun':_0x503b0c,'nextRun':_0x56b5ba,'cron':_0x15c6a5,'name':_0x4700eb,'queryUrl':_0x2c4305,'status':_0x40f22c[_0x23ff6d(0xf8)]?.[_0x23ff6d(0xe0)]};}),_0x3c48d1=Math['max'](..._0x43da20[_0x4ec433(0xed)](_0x1d7733=>_0x1d7733[_0x4ec433(0xfb)][_0x4ec433(0x11e)])),_0x3b0615=Math[_0x4ec433(0x100)](..._0x43da20[_0x4ec433(0xed)](_0x11deee=>_0x11deee['nextRun'][_0x4ec433(0x11e)])),_0xef3987=Math[_0x4ec433(0x100)](..._0x43da20['map'](_0x48e28a=>_0x48e28a[_0x4ec433(0xd8)][_0x4ec433(0x11e)])),_0x4a239e=_0x43da20[_0x4ec433(0xed)](_0x49e073=>{const _0x5c7d2d=_0x4ec433,_0x135eca=_0x49e073['status']===_0x5c7d2d(0xf2)?a37_0x38395d[_0x5c7d2d(0x101)](_0x49e073[_0x5c7d2d(0xf4)]):_0x49e073[_0x5c7d2d(0xe0)]===_0x5c7d2d(0xff)?a37_0x38395d[_0x5c7d2d(0x12e)](_0x49e073[_0x5c7d2d(0xf4)]):a37_0x38395d['dim'](_0x49e073[_0x5c7d2d(0xf4)]),_0x523f76=_0x49e073[_0x5c7d2d(0xfb)]['padEnd'](_0x3c48d1),_0x31e489=_0x49e073[_0x5c7d2d(0xef)][_0x5c7d2d(0x11a)](_0x3b0615),_0x309528=_0x49e073['cron']?a37_0x38395d[_0x5c7d2d(0xe2)](_0x49e073[_0x5c7d2d(0xd8)][_0x5c7d2d(0x11a)](_0xef3987)):'\x20'[_0x5c7d2d(0x114)](_0xef3987),_0x2c19ad=hyperlink(_0x49e073[_0x5c7d2d(0xba)],_0x49e073[_0x5c7d2d(0x10c)]);return _0x5c7d2d(0xc7)+_0x135eca+'\x20'+_0x523f76+_0x5c7d2d(0xdb)+_0x31e489+'\x20\x20'+_0x309528+'\x20\x20'+_0x2c19ad;});await writeOutput(_0x4a239e[_0x4ec433(0x12f)]('\x0a'),_0x56cb87[_0x4ec433(0x137)],_0x4ec433(0xcc));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a37_0xcb1009(0xba)]='schedule:show';[a37_0xcb1009(0x118)]=a37_0xcb1009(0xb8);['validate'](_0x42f0bd){const _0x1126c9=a37_0xcb1009,_0x4bc0c9=_0x42f0bd[_0x1126c9(0xce)][0x0];if(!_0x4bc0c9)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x577c65){const _0x1fe66f=a37_0xcb1009,{options:_0x31a3b4,args:_0x5ebc4c,tdx:_0x2a7c76}=_0x577c65,_0x110842=_0x5ebc4c[0x0],_0x1e9fd4=await withSpinner(_0x1fe66f(0xc2),()=>_0x2a7c76[_0x1fe66f(0xd3)][_0x1fe66f(0x123)](_0x110842),{'verbose':_0x31a3b4['verbose']}),_0x14c269=_0x1e9fd4['data'],_0xb83830={'name':_0x14c269['name'],'cron':_0x14c269[_0x1fe66f(0xd8)],'database':_0x14c269['database'],'type':_0x14c269[_0x1fe66f(0xbf)],'timezone':_0x14c269['timezone'],'user_name':_0x14c269[_0x1fe66f(0xd6)],'created_at':_0x14c269[_0x1fe66f(0x127)],'engine_version':_0x14c269[_0x1fe66f(0x12d)],'executing_user_id':_0x14c269['executing_user_id'],'query':_0x14c269[_0x1fe66f(0x102)],'delay':_0x14c269[_0x1fe66f(0x130)],'priority':_0x14c269[_0x1fe66f(0x126)],'retry_limit':_0x14c269['retry_limit'],..._0x14c269[_0x1fe66f(0xbc)]&&{'result':_0x14c269[_0x1fe66f(0xbc)]}};return await handleSingleObjectOutput(_0xb83830,_0x31a3b4),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a37_0xcb1009(0x122);[a37_0xcb1009(0x118)]=a37_0xcb1009(0x135);[a37_0xcb1009(0xeb)](_0x3f1b02){const _0x2510d3=a37_0xcb1009,_0x2ec588=_0x3f1b02[_0x2510d3(0xce)][0x0];if(!_0x2ec588)return _0x2510d3(0xca);const _0x28839f=_0x3f1b02[_0x2510d3(0x107)];if(!_0x28839f['database'])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a37_0xcb1009(0xe9)](_0x107402){const _0x4399b4=a37_0xcb1009,{options:_0x165b4,args:_0x1033cb,tdx:_0x38c35a}=_0x107402,_0x32b205=_0x1033cb[0x0],_0x12dc43=_0x165b4,_0x410b19=_0x12dc43['database'],_0x137885=_0x12dc43[_0x4399b4(0x11b)],_0x169c48=_0x12dc43[_0x4399b4(0xbf)]||_0x4399b4(0x13c);let _0x97660e;try{_0x97660e=readFileSync(_0x137885,_0x4399b4(0x10e))[_0x4399b4(0xbe)]();}catch(_0x4b132c){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4399b4(0x121)+_0x137885,_0x4b132c instanceof Error?_0x4b132c:undefined);}if(!_0x97660e)throw new SDKError(ErrorCode[_0x4399b4(0xb9)],_0x4399b4(0xbd));const _0x483db5={'database':_0x410b19,'query':_0x97660e,'type':_0x169c48};if(_0x12dc43[_0x4399b4(0xd8)])_0x483db5[_0x4399b4(0xd8)]=_0x12dc43[_0x4399b4(0xd8)];if(_0x12dc43['timezone'])_0x483db5[_0x4399b4(0xcf)]=_0x12dc43['timezone'];if(_0x12dc43[_0x4399b4(0x130)]!==undefined)_0x483db5['delay']=Number(_0x12dc43['delay']);if(_0x12dc43[_0x4399b4(0x126)]!==undefined)_0x483db5[_0x4399b4(0x126)]=Number(_0x12dc43[_0x4399b4(0x126)]);if(_0x12dc43['retryLimit']!==undefined)_0x483db5[_0x4399b4(0x106)]=Number(_0x12dc43[_0x4399b4(0xd5)]);if(_0x12dc43[_0x4399b4(0x108)])_0x483db5['engine_version']=_0x12dc43[_0x4399b4(0x108)];if(_0x12dc43[_0x4399b4(0xbc)])_0x483db5['result']=_0x12dc43[_0x4399b4(0xbc)];if(_0x165b4['verbose']){console[_0x4399b4(0xff)](_0x4399b4(0xf3)+_0x32b205),console[_0x4399b4(0xff)]('\x20\x20Database:\x20'+_0x410b19),console[_0x4399b4(0xff)]('\x20\x20Type:\x20'+_0x169c48);if(_0x483db5[_0x4399b4(0xd8)])console['error'](_0x4399b4(0x145)+_0x483db5[_0x4399b4(0xd8)]);if(_0x483db5['timezone'])console['error'](_0x4399b4(0xfe)+_0x483db5[_0x4399b4(0xcf)]);}const _0x1347cb=await withSpinner(_0x4399b4(0xda),()=>_0x38c35a['schedules'][_0x4399b4(0xe8)](_0x32b205,_0x483db5),{'verbose':_0x165b4[_0x4399b4(0x13e)]});return console['error'](_0x4399b4(0x10f)+_0x1347cb[_0x4399b4(0x149)][_0x4399b4(0xba)]),await handleSingleObjectOutput(_0x1347cb[_0x4399b4(0x149)],_0x165b4),0x0;}}function a37_0x541b(){const _0x17ae09=['cyan','tsv','time_zone','history','delete','listQueries','create','execute','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','validate','json','map','\x20execution','nextRun','1338910TURGpq','Running\x20schedule:\x20','success','Creating\x20schedule:\x20','statusIcon','\x20job','queries','List\x20scheduled\x20queries','last_job','entries','Show\x20schedule\x20execution\x20history','lastRun','\x20matching\x20\x22','round','\x20\x20Timezone:\x20','error','max','green','query','Getting\x20schedule\x20history...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','pagination','retry_limit','options','engineVersion','No\x20scheduled\x20queries\x20found','9kEmdMa','Updating\x20schedule...','queryUrl','\x20schedules','utf-8','Schedule\x20created:\x20','update','\x20\x20Time:\x20','Showing\x20first\x20','from','repeat','never','log','\x20\x20Num:\x20','description','end_at','padEnd','file','\x20created','database','length','585NWjEnR','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Failed\x20to\x20read\x20file:\x20','schedule:create','show','d\x20ago','in\x20','priority','created_at','ended_at','Delete\x20a\x20scheduled\x20query','keys','Update\x20a\x20scheduled\x20query','Updating\x20schedule:\x20','engine_version','red','join','delay','ies','substring','num','format','Create\x20a\x20scheduled\x20query','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','output','\x22...','\x20scheduled\x20quer','table','Schedule\x20run\x20submitted:\x20','trino','...','verbose','Listing\x20scheduled\x20queries...','schedule:run','Running\x20schedule...','time','111645YbgTCC','\x20\x20Job\x20ID:\x20','\x20\x20Cron:\x20','Found\x20','job_id','scheduled_at','data','2182HRdUQv','Show\x20schedule\x20details','INVALID_ARGUMENT','name','3584200pbqWPw','result','Query\x20file\x20is\x20empty','trim','type','m\x20ago','jsonl','Getting\x20schedule\x20details...','getTime','281655BjaITq','has_next_page','\x20(showing\x20','📅\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Cancelled','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','run','list','next_run_at','args','timezone','limit','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Schedule\x20deleted:\x20','schedules','/app/queries/editor?queryId=','retryLimit','user_name','site','cron','1201774DHDQZm','Creating\x20schedule...','\x20\x20→\x20','soon','960036BhBpvt','h\x20ago','start_at','status','42NWdZRr'];a37_0x541b=function(){return _0x17ae09;};return a37_0x541b();}export class ScheduleUpdateCommand extends BaseCommand{['name']='schedule:update';[a37_0xcb1009(0x118)]=a37_0xcb1009(0x12b);[a37_0xcb1009(0xeb)](_0x49c010){const _0x25bfbd=a37_0xcb1009,_0xc9875f=_0x49c010[_0x25bfbd(0xce)][0x0];if(!_0xc9875f)return _0x25bfbd(0xea);return undefined;}async['execute'](_0x318089){const _0x598f50=a37_0xcb1009,{options:_0x4d6f8a,args:_0x4019ad,tdx:_0x1fd32c}=_0x318089,_0x23da8c=_0x4019ad[0x0],_0x646385=_0x4d6f8a,_0x200dc8={};if(_0x646385[_0x598f50(0x11d)])_0x200dc8[_0x598f50(0x11d)]=_0x646385['database'];if(_0x646385[_0x598f50(0xbf)])_0x200dc8[_0x598f50(0xbf)]=_0x646385[_0x598f50(0xbf)];if(_0x646385['cron'])_0x200dc8[_0x598f50(0xd8)]=_0x646385[_0x598f50(0xd8)];if(_0x646385[_0x598f50(0xcf)])_0x200dc8[_0x598f50(0xcf)]=_0x646385['timezone'];if(_0x646385['delay']!==undefined)_0x200dc8['delay']=Number(_0x646385[_0x598f50(0x130)]);if(_0x646385[_0x598f50(0x126)]!==undefined)_0x200dc8[_0x598f50(0x126)]=Number(_0x646385['priority']);if(_0x646385[_0x598f50(0xd5)]!==undefined)_0x200dc8[_0x598f50(0x106)]=Number(_0x646385[_0x598f50(0xd5)]);if(_0x646385[_0x598f50(0x108)])_0x200dc8[_0x598f50(0x12d)]=_0x646385[_0x598f50(0x108)];if(_0x646385[_0x598f50(0xbc)])_0x200dc8[_0x598f50(0xbc)]=_0x646385['result'];if(_0x646385['file'])try{_0x200dc8['query']=readFileSync(_0x646385['file'],'utf-8')[_0x598f50(0xbe)]();}catch(_0x5ea651){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x598f50(0x121)+_0x646385[_0x598f50(0x11b)],_0x5ea651 instanceof Error?_0x5ea651:undefined);}if(Object[_0x598f50(0x12a)](_0x200dc8)[_0x598f50(0x11e)]===0x0)throw new SDKError(ErrorCode[_0x598f50(0xb9)],_0x598f50(0xd1));if(_0x4d6f8a[_0x598f50(0x13e)]){console[_0x598f50(0xff)](_0x598f50(0x12c)+_0x23da8c);for(const [_0x209de3,_0x50b9f5]of Object[_0x598f50(0xf9)](_0x200dc8)){_0x209de3===_0x598f50(0x102)?console[_0x598f50(0xff)]('\x20\x20'+_0x209de3+':\x20'+_0x50b9f5[_0x598f50(0x132)](0x0,0x32)+_0x598f50(0x13d)):console[_0x598f50(0xff)]('\x20\x20'+_0x209de3+':\x20'+_0x50b9f5);}}const _0x8ba52c=await withSpinner(_0x598f50(0x10b),()=>_0x1fd32c['schedules'][_0x598f50(0x110)](_0x23da8c,_0x200dc8),{'verbose':_0x4d6f8a['verbose']});return console[_0x598f50(0xff)]('Schedule\x20updated:\x20'+_0x8ba52c[_0x598f50(0x149)][_0x598f50(0xba)]),await handleSingleObjectOutput(_0x8ba52c[_0x598f50(0x149)],_0x4d6f8a),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']='schedule:delete';['description']=a37_0xcb1009(0x129);[a37_0xcb1009(0xeb)](_0x232b66){const _0x197fc2=a37_0xcb1009,_0x240676=_0x232b66['args'][0x0];if(!_0x240676)return _0x197fc2(0xc8);return undefined;}async[a37_0xcb1009(0xe9)](_0x51718f){const _0x2b9af3=a37_0xcb1009,{options:_0x9a06bf,args:_0x130404,tdx:_0x3867bc}=_0x51718f,_0x15bcf5=_0x130404[0x0];if(!_0x9a06bf['yes']){const _0x24ecb6=await confirm(_0x2b9af3(0x104)+_0x15bcf5+'\x22?');if(!_0x24ecb6)return console[_0x2b9af3(0xff)](_0x2b9af3(0xc9)),0x0;}const _0x23d194=await withSpinner('Deleting\x20schedule...',()=>_0x3867bc[_0x2b9af3(0xd3)][_0x2b9af3(0xe6)](_0x15bcf5),{'verbose':_0x9a06bf[_0x2b9af3(0x13e)]});return console[_0x2b9af3(0xff)](_0x2b9af3(0xd2)+_0x23d194['data'][_0x2b9af3(0xba)]),0x0;}}function a37_0x1001(_0x5286a3,_0x3f7e93){_0x5286a3=_0x5286a3-0xb7;const _0x541ba7=a37_0x541b();let _0x10010b=_0x541ba7[_0x5286a3];return _0x10010b;}export class ScheduleRunCommand extends BaseCommand{[a37_0xcb1009(0xba)]=a37_0xcb1009(0x140);['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a37_0xcb1009(0xeb)](_0x1feb77){const _0x4e8d68=a37_0xcb1009,_0x255b05=_0x1feb77['args'][0x0];if(!_0x255b05)return _0x4e8d68(0x136);return undefined;}async[a37_0xcb1009(0xe9)](_0x4f454d){const _0x4a5974=a37_0xcb1009,{options:_0xb7ad88,args:_0x25089e,tdx:_0x132215}=_0x4f454d,_0x2b6fb7=_0x25089e[0x0],_0x49a134=_0xb7ad88,_0x5c030e=_0x49a134[_0x4a5974(0x142)],_0x3d146c=_0x49a134[_0x4a5974(0x133)]!==undefined?Number(_0x49a134['num']):undefined;if(_0xb7ad88[_0x4a5974(0x13e)]){console[_0x4a5974(0xff)](_0x4a5974(0xf1)+_0x2b6fb7);if(_0x5c030e)console[_0x4a5974(0xff)](_0x4a5974(0x111)+_0x5c030e);if(_0x3d146c)console['error'](_0x4a5974(0x117)+_0x3d146c);}const _0x2ed1ef=await withSpinner(_0x4a5974(0x141),()=>_0x132215[_0x4a5974(0xd3)][_0x4a5974(0xcb)](_0x2b6fb7,{'time':_0x5c030e,'num':_0x3d146c}),{'verbose':_0xb7ad88[_0x4a5974(0x13e)]}),_0x3d3b0c=_0x2ed1ef[_0x4a5974(0x149)]['jobs'];console[_0x4a5974(0xff)](_0x4a5974(0x13b)+_0x3d3b0c[_0x4a5974(0x11e)]+_0x4a5974(0xf5)+(_0x3d3b0c[_0x4a5974(0x11e)]!==0x1?'s':'')+_0x4a5974(0x11c));for(const _0x40ea18 of _0x3d3b0c){console[_0x4a5974(0xff)](_0x4a5974(0x144)+_0x40ea18[_0x4a5974(0x147)]);}return await handleSDKOutput(_0x3d3b0c,_0xb7ad88),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a37_0xcb1009(0xba)]='schedule:history';[a37_0xcb1009(0x118)]=a37_0xcb1009(0xfa);['validate'](_0x1f2599){const _0x2e1517=a37_0xcb1009,_0x467f07=_0x1f2599[_0x2e1517(0xce)][0x0];if(!_0x467f07)return _0x2e1517(0x120);return undefined;}async[a37_0xcb1009(0xe9)](_0x1e7825){const _0x2e843d=a37_0xcb1009,{options:_0x35d081,args:_0x3be624,tdx:_0x2a27ce}=_0x1e7825,_0x355052=_0x3be624[0x0],_0x1064af=_0x35d081,_0x213485=_0x1064af[_0x2e843d(0x113)]!==undefined?Number(_0x1064af[_0x2e843d(0x113)]):undefined,_0x471d15=_0x1064af['to']!==undefined?Number(_0x1064af['to']):undefined,_0x3ad48e=await withSpinner(_0x2e843d(0x103),()=>_0x2a27ce['schedules'][_0x2e843d(0xe5)](_0x355052,{'from':_0x213485,'to':_0x471d15}),{'verbose':_0x35d081[_0x2e843d(0x13e)]}),_0x228148=_0x3ad48e[_0x2e843d(0x149)];console['error']('Found\x20'+_0x228148['count']+_0x2e843d(0xee)+(_0x228148['count']!==0x1?'s':'')+_0x2e843d(0xc6)+_0x228148[_0x2e843d(0x113)]+'-'+_0x228148['to']+')');const _0x1ba725=_0x228148[_0x2e843d(0xe5)][_0x2e843d(0xed)](_0xaad94=>({'job_id':_0xaad94[_0x2e843d(0x147)],'type':_0xaad94[_0x2e843d(0xbf)],'status':_0xaad94[_0x2e843d(0xe0)],'scheduled_at':_0xaad94[_0x2e843d(0x148)],'created_at':_0xaad94['created_at'],'start_at':_0xaad94[_0x2e843d(0xdf)],'end_at':_0xaad94[_0x2e843d(0x119)]}));return await handleSDKOutput(_0x1ba725,_0x35d081),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a38_0x5b1f40=a38_0x93c7;(function(_0x34a1d3,_0x5b4dba){const _0x225df5=a38_0x93c7,_0x3edc0d=_0x34a1d3();while(!![]){try{const _0x47552d=parseInt(_0x225df5(0x1e3))/0x1*(parseInt(_0x225df5(0x1ab))/0x2)+-parseInt(_0x225df5(0x19d))/0x3+-parseInt(_0x225df5(0x198))/0x4+parseInt(_0x225df5(0x1f9))/0x5+parseInt(_0x225df5(0x22c))/0x6*(-parseInt(_0x225df5(0x1a6))/0x7)+-parseInt(_0x225df5(0x1ce))/0x8*(-parseInt(_0x225df5(0x220))/0x9)+parseInt(_0x225df5(0x1d7))/0xa*(parseInt(_0x225df5(0x1fe))/0xb);if(_0x47552d===_0x5b4dba)break;else _0x3edc0d['push'](_0x3edc0d['shift']());}catch(_0x2a0ed5){_0x3edc0d['push'](_0x3edc0d['shift']());}}}(a38_0x466f,0xa5019));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a38_0x93c7(_0x397554,_0xe2e984){_0x397554=_0x397554-0x193;const _0x466f93=a38_0x466f();let _0x93c718=_0x466f93[_0x397554];return _0x93c718;}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 a38_0x3a54a9 from'chalk';async function resolveSegmentTarget(_0x529a0a,_0x4da27e,_0x56ff4b){const _0x3eed38=a38_0x93c7;if(isYamlFilePath(_0x529a0a))try{const _0x96d2d7=await resolveYamlFilePath(_0x529a0a);return _0x56ff4b&&(console[_0x3eed38(0x212)]('Resolved\x20YAML\x20file:\x20'+_0x529a0a),console[_0x3eed38(0x212)](_0x3eed38(0x221)+_0x96d2d7[_0x3eed38(0x1bc)]),console[_0x3eed38(0x212)](_0x3eed38(0x1c5)+_0x96d2d7[_0x3eed38(0x219)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x96d2d7[_0x3eed38(0x1f8)]||_0x3eed38(0x1f1))),console['error'](_0x3eed38(0x1db)+_0x96d2d7[_0x3eed38(0x226)])),_0x96d2d7[_0x3eed38(0x226)];}catch(_0xa294ae){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3eed38(0x1eb)+_0xa294ae['message']);}if(!_0x4da27e)throw new SDKError(ErrorCode[_0x3eed38(0x1fc)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x4da27e+'/'+_0x529a0a;}export class SegmentDescribeCommand extends BaseCommand{[a38_0x5b1f40(0x19f)]=a38_0x5b1f40(0x1e7);['description']=a38_0x5b1f40(0x222);async[a38_0x5b1f40(0x199)](_0x4c8848){const _0x1b64b1=a38_0x5b1f40,{options:_0x93a402,args:_0x56d3fe,tdx:_0x2e1c66}=_0x4c8848,_0x59e0e3=_0x56d3fe[0x0],_0x2fc05d=!_0x59e0e3&&!!_0x93a402['parentSegment'],_0x17946a=_0x59e0e3||_0x93a402[_0x1b64b1(0x1bc)];if(!_0x17946a)return console[_0x1b64b1(0x212)](_0x1b64b1(0x216)),console[_0x1b64b1(0x212)](_0x1b64b1(0x20f)),console['error'](_0x1b64b1(0x20e)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x1b64b1(0x212)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x1b64b1(0x212)](_0x1b64b1(0x1f5)),console[_0x1b64b1(0x212)](_0x1b64b1(0x1ad)),0x1;try{const _0x5cd057=_0x93a402[_0x1b64b1(0x22a)];let _0x580730=_0x17946a;!_0x2fc05d&&_0x5cd057&&!_0x17946a[_0x1b64b1(0x1de)]('/')&&(_0x580730=_0x5cd057+'/'+_0x17946a,_0x93a402[_0x1b64b1(0x1fb)]&&console[_0x1b64b1(0x212)](_0x1b64b1(0x231)+_0x580730));const _0x8319c0=await withSpinner(_0x1b64b1(0x1c4)+_0x580730+_0x1b64b1(0x19b),()=>_0x2e1c66[_0x1b64b1(0x1ff)]['resolvePathToResource'](_0x580730),{'verbose':_0x93a402[_0x1b64b1(0x1fb)]}),_0x1cf9f5=_0x8319c0[_0x1b64b1(0x1d3)];_0x93a402[_0x1b64b1(0x1fb)]&&(console[_0x1b64b1(0x212)](_0x1b64b1(0x1dc)+_0x1cf9f5[_0x1b64b1(0x215)]),console['error']('Parent\x20ID:\x20'+_0x1cf9f5[_0x1b64b1(0x1c8)]),_0x1cf9f5[_0x1b64b1(0x227)]&&console[_0x1b64b1(0x212)](_0x1b64b1(0x20c)+_0x1cf9f5[_0x1b64b1(0x227)]),_0x1cf9f5['segmentId']&&console[_0x1b64b1(0x212)](_0x1b64b1(0x1c0)+_0x1cf9f5['segmentId']));if(_0x1cf9f5[_0x1b64b1(0x215)]==='parent'){const _0x3ce1c1=await withSpinner(_0x1b64b1(0x1d9),()=>_0x2e1c66['segment'][_0x1b64b1(0x22d)](_0x1cf9f5[_0x1b64b1(0x1c8)]),{'verbose':_0x93a402[_0x1b64b1(0x1fb)]});await handleSingleObjectOutput(_0x3ce1c1[_0x1b64b1(0x1d3)],_0x93a402);}else{if(_0x1cf9f5[_0x1b64b1(0x215)]===_0x1b64b1(0x204)){if(!_0x1cf9f5[_0x1b64b1(0x227)])throw new SDKError(ErrorCode[_0x1b64b1(0x217)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2fd2a7=await withSpinner(_0x1b64b1(0x1c2),()=>_0x2e1c66[_0x1b64b1(0x1ff)][_0x1b64b1(0x21e)](_0x1cf9f5[_0x1b64b1(0x227)]),{'verbose':_0x93a402['verbose']});await handleSingleObjectOutput(_0x2fd2a7['data'],_0x93a402);}else{if(_0x1cf9f5['type']==='segment'){if(!_0x1cf9f5[_0x1b64b1(0x1ed)])throw new SDKError(ErrorCode[_0x1b64b1(0x1af)],_0x1b64b1(0x21d));const _0x42c89b=await withSpinner(_0x1b64b1(0x1cc),()=>_0x2e1c66[_0x1b64b1(0x1ff)][_0x1b64b1(0x1b8)](_0x1cf9f5['parentId'],_0x1cf9f5[_0x1b64b1(0x1ed)]),{'verbose':_0x93a402[_0x1b64b1(0x1fb)]});await handleSingleObjectOutput(_0x42c89b['data'],_0x93a402);}}}return 0x0;}catch(_0x2a3fb5){if(_0x2a3fb5 instanceof SDKError)return console[_0x1b64b1(0x212)](_0x1b64b1(0x1a1)+_0x2a3fb5[_0x1b64b1(0x20a)]),_0x2a3fb5[_0x1b64b1(0x1d8)]&&console[_0x1b64b1(0x212)](_0x1b64b1(0x1b5)+_0x2a3fb5[_0x1b64b1(0x1d8)]),0x1;throw _0x2a3fb5;}}}export class SegmentShowCommand extends BaseCommand{[a38_0x5b1f40(0x19f)]=a38_0x5b1f40(0x1f4);[a38_0x5b1f40(0x22b)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a38_0x5b1f40(0x199)](_0x15f688){const _0x38cfb8=a38_0x5b1f40,{options:_0x11965f,args:_0x32dced,tdx:_0x126762}=_0x15f688,_0x4f6f97=_0x32dced[0x0];if(!_0x4f6f97)return console[_0x38cfb8(0x212)](_0x38cfb8(0x1e4)),console['error'](_0x38cfb8(0x238)),console[_0x38cfb8(0x212)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error']('Examples:'),console[_0x38cfb8(0x212)](_0x38cfb8(0x225)),console['error']('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x13b2d8=_0x11965f[_0x38cfb8(0x1bc)],_0x371432=await resolveSegmentTarget(_0x4f6f97,_0x13b2d8,_0x11965f[_0x38cfb8(0x1fb)]);_0x11965f[_0x38cfb8(0x1fb)]&&console[_0x38cfb8(0x212)](_0x38cfb8(0x193)+_0x371432);const _0x2b5e0b=await withSpinner(_0x38cfb8(0x206)+_0x4f6f97+_0x38cfb8(0x19b),()=>_0x126762[_0x38cfb8(0x1ff)]['resolvePathToResource'](_0x371432),{'verbose':_0x11965f[_0x38cfb8(0x1fb)]}),_0x4e8609=_0x2b5e0b[_0x38cfb8(0x1d3)];_0x11965f[_0x38cfb8(0x1fb)]&&(console[_0x38cfb8(0x212)](_0x38cfb8(0x1dc)+_0x4e8609['type']),console[_0x38cfb8(0x212)]('Parent\x20ID:\x20'+_0x4e8609['parentId']));if(_0x4e8609[_0x38cfb8(0x215)]==='folder')return console[_0x38cfb8(0x212)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x38cfb8(0x212)](_0x38cfb8(0x213)),0x1;if(_0x4e8609[_0x38cfb8(0x215)]==='parent')return console['error'](_0x38cfb8(0x233)),console[_0x38cfb8(0x212)](_0x38cfb8(0x208)),0x1;if(!_0x4e8609[_0x38cfb8(0x1ed)])throw new SDKError(ErrorCode[_0x38cfb8(0x1af)],_0x38cfb8(0x21d));const _0x2aa494=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x126762[_0x38cfb8(0x1ff)]['getSegmentSQL'](_0x4e8609['parentId'],_0x4e8609['segmentId']),{'verbose':_0x11965f['verbose']});let _0x5d744d=_0x2aa494[_0x38cfb8(0x1d3)];const _0x4c596e=resolveLimit(_0x11965f[_0x38cfb8(0x1e0)],DEFAULT_DISPLAY_LIMIT),_0x36915e=/\bLIMIT\s+\d+/i[_0x38cfb8(0x1fd)](_0x5d744d);!_0x36915e&&(_0x5d744d=_0x5d744d[_0x38cfb8(0x20b)]()[_0x38cfb8(0x197)](/;+$/,''),_0x5d744d=_0x38cfb8(0x21c)+_0x5d744d+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x4c596e);_0x11965f['verbose']&&console[_0x38cfb8(0x212)](_0x38cfb8(0x218)+_0x5d744d);const _0x5ecdb2=await withProgressSpinner(_0x38cfb8(0x205),async _0x4edc63=>{const _0x26ac33=_0x38cfb8,_0x49c6dd=await _0x126762[_0x26ac33(0x1a0)]['execute'](_0x5d744d,{'catalog':'td','schema':_0x26ac33(0x200),'onJobId':_0x40165c=>{const _0x4d19d5=_0x26ac33;_0x4edc63[_0x4d19d5(0x237)](_0x40165c);}});return _0x49c6dd;},{'verbose':_0x11965f[_0x38cfb8(0x1fb)]}),_0x5283f6=_0x5ecdb2[_0x38cfb8(0x1d3)],_0x12ae51=_0x5283f6[_0x38cfb8(0x1f7)]?_0x38cfb8(0x1ca)+_0x5283f6[_0x38cfb8(0x1f7)]+']':'';return console['error'](_0x38cfb8(0x1b7)+_0x5283f6[_0x38cfb8(0x1a2)][_0x38cfb8(0x201)]['toLocaleString']()+'\x20rows\x20'+(_0x38cfb8(0x1a4)+formatElapsed(_0x5283f6[_0x38cfb8(0x1a2)][_0x38cfb8(0x1c1)])+_0x12ae51)),await handleQueryOutput(_0x5283f6,_0x11965f),0x0;}catch(_0x3905de){if(_0x3905de instanceof SDKError)return console['error'](_0x38cfb8(0x1b1)+_0x3905de['code']+']'),console[_0x38cfb8(0x212)]('\x0a'+_0x3905de[_0x38cfb8(0x20a)]),0x1;throw _0x3905de;}}}export class SegmentFolderListCommand extends BaseCommand{[a38_0x5b1f40(0x19f)]=a38_0x5b1f40(0x1e2);[a38_0x5b1f40(0x22b)]=a38_0x5b1f40(0x1c9);async[a38_0x5b1f40(0x199)](_0x156052){const _0x3daec0=a38_0x5b1f40,{options:_0x13120f,args:_0x19ca95,tdx:_0x50d952}=_0x156052;if(_0x19ca95[_0x3daec0(0x1f0)]===0x0)return console[_0x3daec0(0x212)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x3daec0(0x1aa)),0x1;const _0x18d1ed=_0x19ca95[0x0];try{_0x13120f['verbose']&&(console[_0x3daec0(0x212)](_0x3daec0(0x1e5)+_0x13120f[_0x3daec0(0x1c3)]),console[_0x3daec0(0x212)](_0x3daec0(0x1e6)+_0x18d1ed));const _0x33b9d7=await withSpinner(_0x3daec0(0x1f6)+_0x18d1ed+_0x3daec0(0x19b),()=>_0x50d952['segment'][_0x3daec0(0x236)](_0x18d1ed),{'verbose':_0x13120f[_0x3daec0(0x1fb)]}),_0x54597b=_0x33b9d7[_0x3daec0(0x1d3)];_0x13120f['verbose']&&console['error'](_0x3daec0(0x20d)+_0x54597b);const _0x1f82ee=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x18d1ed+_0x3daec0(0x19b),()=>_0x50d952['segment'][_0x3daec0(0x1fa)](_0x54597b),{'verbose':_0x13120f[_0x3daec0(0x1fb)]}),_0x42d5e5=_0x1f82ee['data'];return console['error']('✔\x20Found\x20'+_0x42d5e5[_0x3daec0(0x1f0)]+_0x3daec0(0x229)+(_0x42d5e5[_0x3daec0(0x1f0)]!==0x1?'s':'')),await handleSDKOutput(_0x42d5e5,_0x13120f),0x0;}catch(_0x5c5a3f){if(_0x5c5a3f instanceof SDKError)return console[_0x3daec0(0x212)](_0x3daec0(0x1a1)+_0x5c5a3f[_0x3daec0(0x20a)]),_0x5c5a3f[_0x3daec0(0x1d8)]&&console[_0x3daec0(0x212)](_0x3daec0(0x1b5)+_0x5c5a3f[_0x3daec0(0x1d8)]),0x1;throw _0x5c5a3f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a38_0x5b1f40(0x19f)]=a38_0x5b1f40(0x21f);[a38_0x5b1f40(0x22b)]=a38_0x5b1f40(0x1ec);async[a38_0x5b1f40(0x199)](_0x50b348){const _0x10f044=a38_0x5b1f40,{options:_0x3553cb,args:_0x558c45,tdx:_0x393a01}=_0x50b348;if(_0x558c45[_0x10f044(0x1f0)]===0x0)return console[_0x10f044(0x212)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x10f044(0x212)](_0x10f044(0x1bf)),0x1;try{const {parentId:_0x1a27ac,childId:_0x1d2c23}=parseSegmentRef(_0x558c45[0x0]);_0x3553cb[_0x10f044(0x1fb)]&&(console['error']('Site:\x20'+_0x3553cb[_0x10f044(0x1c3)]),console[_0x10f044(0x212)](_0x10f044(0x1e6)+_0x1a27ac),_0x1d2c23&&console[_0x10f044(0x212)]('Folder\x20name:\x20'+_0x1d2c23));if(!_0x1d2c23)return console[_0x10f044(0x212)](_0x10f044(0x1ef)),0x1;const _0x4a765f=await withSpinner(_0x10f044(0x1f6)+_0x1a27ac+'\x27...',()=>_0x393a01[_0x10f044(0x1ff)][_0x10f044(0x236)](_0x1a27ac),{'verbose':_0x3553cb[_0x10f044(0x1fb)]}),_0x143d1f=_0x4a765f[_0x10f044(0x1d3)];_0x3553cb[_0x10f044(0x1fb)]&&console[_0x10f044(0x212)](_0x10f044(0x20d)+_0x143d1f);const _0x47a6e6=await withSpinner(_0x10f044(0x1d0)+_0x1d2c23+_0x10f044(0x19b),()=>_0x393a01[_0x10f044(0x1ff)]['resolveFolderId'](_0x143d1f,_0x1d2c23),{'verbose':_0x3553cb[_0x10f044(0x1fb)]}),_0x10e4a6=_0x47a6e6[_0x10f044(0x1d3)];_0x3553cb[_0x10f044(0x1fb)]&&console['error'](_0x10f044(0x1f3)+_0x10e4a6);const _0x1dc722=await withSpinner(_0x10f044(0x214)+_0x1d2c23+'\x27...',()=>_0x393a01[_0x10f044(0x1ff)][_0x10f044(0x21e)](_0x10e4a6),{'verbose':_0x3553cb[_0x10f044(0x1fb)]});return await handleSDKOutput([_0x1dc722[_0x10f044(0x1d3)]],_0x3553cb),0x0;}catch(_0x43238a){if(_0x43238a instanceof SDKError)return console['error'](_0x10f044(0x1a1)+_0x43238a[_0x10f044(0x20a)]),_0x43238a[_0x10f044(0x1d8)]&&console['error'](_0x10f044(0x1b5)+_0x43238a['cause']),0x1;throw _0x43238a;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a38_0x5b1f40(0x1e1);[a38_0x5b1f40(0x22b)]=a38_0x5b1f40(0x1b0);async['execute'](_0x20e645){const _0x56b872=a38_0x5b1f40,{options:_0xa23292,args:_0x239957}=_0x20e645,_0x55fc63=_0xa23292,_0x2b3a39=_0x55fc63['path'],_0x688ffa=_0x239957[0x0];if(!_0x688ffa&&!_0x2b3a39)return console[_0x56b872(0x212)](a38_0x3a54a9[_0x56b872(0x195)]('Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required')),console['error']('Usage:'),console[_0x56b872(0x212)](_0x56b872(0x21b)),console[_0x56b872(0x212)](_0x56b872(0x1c7)),console[_0x56b872(0x212)]('Examples:'),console['error'](_0x56b872(0x207)),console[_0x56b872(0x212)](_0x56b872(0x1f2)),0x1;if(_0x688ffa&&_0x2b3a39)return console[_0x56b872(0x212)](a38_0x3a54a9[_0x56b872(0x195)](_0x56b872(0x22e))),0x1;try{let _0x1678ab;if(_0x2b3a39)_0x1678ab=await this[_0x56b872(0x209)](_0x2b3a39,_0x20e645);else{if(isYamlFilePath(_0x688ffa))return console[_0x56b872(0x212)](a38_0x3a54a9[_0x56b872(0x195)](_0x56b872(0x1cd))),console[_0x56b872(0x212)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0x688ffa),0x1;else _0x1678ab=await this[_0x56b872(0x234)](_0x688ffa,_0x20e645);}return _0xa23292[_0x56b872(0x22f)]==='json'||_0xa23292['format']===_0x56b872(0x224)?await handleSDKOutput([{'sql':_0x1678ab}],_0xa23292):console[_0x56b872(0x1c6)](_0x1678ab),0x0;}catch(_0x245d93){if(_0x245d93 instanceof SDKError)return console[_0x56b872(0x212)](_0x56b872(0x1a1)+_0x245d93[_0x56b872(0x20a)]),_0x245d93[_0x56b872(0x1d8)]&&console[_0x56b872(0x212)]('\x20\x20Cause:\x20'+_0x245d93['cause']),0x1;throw _0x245d93;}}async[a38_0x5b1f40(0x209)](_0x5fd2a4,_0x3d2e1b){const _0x418121=a38_0x5b1f40,{options:_0x183ada,tdx:_0x5047cb}=_0x3d2e1b;let _0x4f11c1;try{_0x4f11c1=await resolveYamlFilePath(_0x5fd2a4);}catch(_0x2afd1d){throw new SDKError(ErrorCode[_0x418121(0x1fc)],_0x418121(0x1eb)+_0x2afd1d[_0x418121(0x20a)]);}_0x183ada[_0x418121(0x1fb)]&&console['error']('Resolved:\x20'+_0x4f11c1['parentSegment']+'/'+_0x4f11c1[_0x418121(0x219)]);const _0x10948b=await withSpinner(_0x418121(0x194),()=>_0x5047cb[_0x418121(0x1ff)][_0x418121(0x1d2)](_0x4f11c1['content'],_0x4f11c1[_0x418121(0x1bc)],_0x4f11c1[_0x418121(0x219)]),{'verbose':_0x183ada[_0x418121(0x1fb)]});return _0x10948b[_0x418121(0x1d3)];}async[a38_0x5b1f40(0x234)](_0xb6190d,_0x5ef36b){const _0x46e7ba=a38_0x5b1f40,{options:_0x49bdea,tdx:_0x56e2a5}=_0x5ef36b,_0x29b39c=_0x49bdea[_0x46e7ba(0x1bc)],_0x2dadb2=await resolveSegmentTarget(_0xb6190d,_0x29b39c,_0x49bdea[_0x46e7ba(0x1fb)]);_0x49bdea[_0x46e7ba(0x1fb)]&&console['error'](_0x46e7ba(0x193)+_0x2dadb2);const _0x4db644=await withSpinner(_0x46e7ba(0x206)+_0xb6190d+'\x27...',()=>_0x56e2a5[_0x46e7ba(0x1ff)][_0x46e7ba(0x1d4)](_0x2dadb2),{'verbose':_0x49bdea[_0x46e7ba(0x1fb)]}),_0x352b33=_0x4db644[_0x46e7ba(0x1d3)];_0x49bdea[_0x46e7ba(0x1fb)]&&(console[_0x46e7ba(0x212)]('Resolved\x20type:\x20'+_0x352b33[_0x46e7ba(0x215)]),console[_0x46e7ba(0x212)](_0x46e7ba(0x1ee)+_0x352b33[_0x46e7ba(0x1c8)]));if(_0x352b33[_0x46e7ba(0x215)]===_0x46e7ba(0x204))throw new SDKError(ErrorCode[_0x46e7ba(0x1fc)],_0x46e7ba(0x19a));if(_0x352b33[_0x46e7ba(0x215)]===_0x46e7ba(0x1b4))throw new SDKError(ErrorCode[_0x46e7ba(0x1fc)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x352b33[_0x46e7ba(0x1ed)])throw new SDKError(ErrorCode[_0x46e7ba(0x1af)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4f4981=await withSpinner(_0x46e7ba(0x21a),()=>_0x56e2a5[_0x46e7ba(0x1ff)][_0x46e7ba(0x1d5)](_0x352b33[_0x46e7ba(0x1c8)],_0x352b33[_0x46e7ba(0x1ed)]),{'verbose':_0x49bdea[_0x46e7ba(0x1fb)]});return _0x4f4981[_0x46e7ba(0x1d3)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a38_0x5b1f40(0x19f)]='segment:folder:create';[a38_0x5b1f40(0x22b)]='Create\x20segment\x20folder\x20for\x20organization';async[a38_0x5b1f40(0x199)](_0x2b1f68){const _0x5eee28=a38_0x5b1f40,{options:_0x225532,args:_0x5c2abe,tdx:_0x20b2a2}=_0x2b1f68,_0x2d760c=_0x225532;if(_0x5c2abe[_0x5eee28(0x1f0)]<0x2)return console[_0x5eee28(0x212)](_0x5eee28(0x1b2)),console[_0x5eee28(0x212)](_0x5eee28(0x1ea)),0x1;const _0x749f75=_0x5c2abe[0x0],_0x44084d=_0x5c2abe[0x1];_0x2d760c[_0x5eee28(0x1fb)]&&(console[_0x5eee28(0x212)](_0x5eee28(0x1e5)+_0x2d760c[_0x5eee28(0x1c3)]),console[_0x5eee28(0x212)]('Parent\x20segment:\x20'+_0x749f75),console[_0x5eee28(0x212)](_0x5eee28(0x228)+_0x44084d));let _0x1438f4;if(_0x2d760c[_0x5eee28(0x210)]){const _0x181157=_0x2d760c[_0x5eee28(0x210)],_0x4b86bc=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x749f75+'\x27...',()=>_0x20b2a2[_0x5eee28(0x1ff)][_0x5eee28(0x236)](_0x749f75),{'verbose':_0x2d760c[_0x5eee28(0x1fb)]}),_0x22c91e=_0x4b86bc[_0x5eee28(0x1d3)],_0x4bc39e=await withSpinner(_0x5eee28(0x1a7)+_0x181157+_0x5eee28(0x19b),()=>_0x20b2a2[_0x5eee28(0x1ff)]['resolveFolderId'](_0x22c91e,_0x181157),{'verbose':_0x2d760c[_0x5eee28(0x1fb)]});_0x1438f4=_0x4bc39e[_0x5eee28(0x1d3)],_0x2d760c['verbose']&&console['error'](_0x5eee28(0x202)+_0x1438f4);}const _0x4b13ff={'name':_0x44084d,'description':_0x2d760c[_0x5eee28(0x22b)],'parentFolderId':_0x1438f4},_0x50d888=await withSpinner('Creating\x20folder\x20\x27'+_0x44084d+_0x5eee28(0x19b),()=>_0x20b2a2[_0x5eee28(0x1ff)]['createFolder'](_0x749f75,_0x4b13ff),{'verbose':_0x2d760c[_0x5eee28(0x1fb)]}),_0x5d9cca=_0x50d888[_0x5eee28(0x1d3)];return console[_0x5eee28(0x212)]('✔\x20Created\x20folder\x20\x27'+_0x5d9cca[_0x5eee28(0x19f)]+_0x5eee28(0x1cf)+_0x5d9cca['id']),await handleSDKOutput([_0x5d9cca],_0x2d760c),0x0;}}export class SegmentViewCommand extends BaseCommand{[a38_0x5b1f40(0x19f)]='segment:view';[a38_0x5b1f40(0x22b)]=a38_0x5b1f40(0x1a8);async['execute'](_0x2682ae){const _0x3ccb44=a38_0x5b1f40,{options:_0x52f97a,args:_0x1b73b7,tdx:_0x29c18b}=_0x2682ae,_0x5e1f9b=_0x1b73b7[0x0];if(!_0x5e1f9b)return console[_0x3ccb44(0x212)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x3ccb44(0x223)),console[_0x3ccb44(0x212)](_0x3ccb44(0x1e9)),console['error'](_0x3ccb44(0x1cb)),console[_0x3ccb44(0x212)](_0x3ccb44(0x1b6)),console[_0x3ccb44(0x212)](_0x3ccb44(0x20e)),console[_0x3ccb44(0x212)](_0x3ccb44(0x1d6)),console[_0x3ccb44(0x212)](_0x3ccb44(0x232)),console[_0x3ccb44(0x212)](_0x3ccb44(0x1a3)),console['error'](_0x3ccb44(0x1d1)),0x1;try{const _0x5d1dae=_0x52f97a['parentSegment'],_0xa42228=await resolveSegmentTarget(_0x5e1f9b,_0x5d1dae,_0x52f97a['verbose']);_0x52f97a[_0x3ccb44(0x1fb)]&&console[_0x3ccb44(0x212)]('Target\x20path:\x20'+_0xa42228);const _0x2602c2=await withSpinner(_0x3ccb44(0x206)+_0x5e1f9b+_0x3ccb44(0x19b),()=>_0x29c18b[_0x3ccb44(0x1ff)][_0x3ccb44(0x1d4)](_0xa42228),{'verbose':_0x52f97a[_0x3ccb44(0x1fb)]}),_0x35a793=_0x2602c2['data'];_0x52f97a[_0x3ccb44(0x1fb)]&&(console['error']('Resolved\x20type:\x20'+_0x35a793[_0x3ccb44(0x215)]),console[_0x3ccb44(0x212)](_0x3ccb44(0x1ee)+_0x35a793[_0x3ccb44(0x1c8)]),_0x35a793[_0x3ccb44(0x227)]&&console[_0x3ccb44(0x212)](_0x3ccb44(0x20c)+_0x35a793[_0x3ccb44(0x227)]),_0x35a793[_0x3ccb44(0x1ed)]&&console[_0x3ccb44(0x212)](_0x3ccb44(0x1c0)+_0x35a793['segmentId']));if(_0x52f97a[_0x3ccb44(0x1ba)]){if(_0x35a793[_0x3ccb44(0x215)]==='folder')return console[_0x3ccb44(0x212)](_0x3ccb44(0x1be)),0x1;if(_0x35a793[_0x3ccb44(0x215)]===_0x3ccb44(0x1b4))return console[_0x3ccb44(0x212)](_0x3ccb44(0x1df)),console[_0x3ccb44(0x212)](_0x3ccb44(0x235)),0x1;if(!_0x35a793[_0x3ccb44(0x1ed)])throw new SDKError(ErrorCode[_0x3ccb44(0x1af)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4ae14c=getConsoleNextUrl(_0x52f97a['site'],'/app/ps/'+_0x35a793[_0x3ccb44(0x1c8)]+'/e/'+_0x35a793[_0x3ccb44(0x1ed)]);return console[_0x3ccb44(0x212)](a38_0x3a54a9[_0x3ccb44(0x1bb)]('✔')+_0x3ccb44(0x19e)+a38_0x3a54a9[_0x3ccb44(0x1a9)](_0x4ae14c)),openBrowser(_0x4ae14c),0x0;}if(_0x35a793[_0x3ccb44(0x215)]===_0x3ccb44(0x204)){if(!_0x35a793[_0x3ccb44(0x227)])throw new SDKError(ErrorCode[_0x3ccb44(0x217)],_0x3ccb44(0x1b3));const _0x15a75b=await withSpinner('Fetching\x20folder\x20details...',()=>_0x29c18b['segment'][_0x3ccb44(0x21e)](_0x35a793[_0x3ccb44(0x227)]),{'verbose':_0x52f97a[_0x3ccb44(0x1fb)]});await handleSingleObjectOutput(_0x15a75b[_0x3ccb44(0x1d3)],_0x52f97a);}else{if(_0x35a793[_0x3ccb44(0x215)]==='segment'){if(!_0x35a793[_0x3ccb44(0x1ed)])throw new SDKError(ErrorCode[_0x3ccb44(0x1af)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3a3376=await withSpinner(_0x3ccb44(0x1cc),()=>_0x29c18b[_0x3ccb44(0x1ff)][_0x3ccb44(0x1b8)](_0x35a793[_0x3ccb44(0x1c8)],_0x35a793['segmentId']),{'verbose':_0x52f97a[_0x3ccb44(0x1fb)]}),_0x26b75f=getConsoleNextUrl(_0x52f97a[_0x3ccb44(0x1c3)],_0x3ccb44(0x203)+_0x35a793[_0x3ccb44(0x1c8)]+_0x3ccb44(0x1da)+_0x35a793[_0x3ccb44(0x1ed)]),_0x5e6bb8=_0x3a3376[_0x3ccb44(0x1d3)];_0x5e6bb8[_0x3ccb44(0x196)]=_0x26b75f,await handleSingleObjectOutput(_0x5e6bb8,_0x52f97a);}else return console[_0x3ccb44(0x212)](_0x3ccb44(0x1b9)),console[_0x3ccb44(0x212)](_0x3ccb44(0x1dd)),0x1;}return 0x0;}catch(_0x24ed51){if(_0x24ed51 instanceof SDKError)return console['error'](_0x3ccb44(0x1a1)+_0x24ed51['message']),_0x24ed51[_0x3ccb44(0x1d8)]&&console[_0x3ccb44(0x212)](_0x3ccb44(0x1b5)+_0x24ed51['cause']),0x1;throw _0x24ed51;}}}export const SegmentInfoCommand=SegmentViewCommand;function a38_0x466f(){const _0x42d66c=['in\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','5606223aFNRYN','Resolving\x20parent\x20folder\x20\x27','Show\x20folder\x20or\x20child\x20segment\x20details','cyan','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','1946CIQGmP','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Use:\x20tdx\x20ps\x20desc','SEGMENT_NOT_FOUND','Get\x20SQL\x20query\x20for\x20child\x20segment','✖\x20Query\x20failed\x20[','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parent','\x20\x20Cause:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','✔\x20Query\x20completed:\x20Processed\x20','getSegment','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','web','green','parentSegment','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Segment\x20ID:\x20','elapsedTimeMillis','Fetching\x20folder\x20details...','site','Resolving\x20path\x20\x27','\x20\x20Segment\x20name:\x20','log','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','parentId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20[Job\x20ID:\x20','Options:','Fetching\x20segment\x20details...','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','344dnOyOM','\x27\x20with\x20ID:\x20','Resolving\x20folder\x20\x27','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','getSegmentSQLFromYaml','data','resolvePathToResource','getSegmentSQL','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','110RkRSWQ','cause','Fetching\x20parent\x20segment\x20details...','/e/','\x20\x20Full\x20path:\x20','Resolved\x20type:\x20','Use:\x20tdx\x20ps\x20view','includes','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','limit','segment:sql','segment:folder:list','1279DfprLb','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Site:\x20','Parent\x20name:\x20','segment:describe','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Show\x20segment\x20folder\x20details','segmentId','Parent\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','length','(root)','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Resolved\x20folder\x20ID:\x20','segment:show','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20parent\x20segment\x20\x27','jobId','folderPath','3751030FLTDMw','listFolders','verbose','INVALID_ARGUMENT','test','516582OvMsho','segment','information_schema','processedRows','Resolved\x20parent\x20folder\x20ID:\x20','/app/ps/','folder','Executing\x20segment\x20query...','Resolving\x20\x27','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20show','getSQLFromYamlFile','message','trim','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Examples:','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentFolder','segment:desc','error','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Fetching\x20folder\x20\x27','type','Error:\x20Path\x20or\x20name\x20is\x20required','SEGMENT_FOLDER_NOT_FOUND','SQL\x20query:\x0a','segmentName','Fetching\x20SQL\x20for\x20segment...','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','SELECT\x20*\x20FROM\x20(\x0a','Segment\x20ID\x20missing\x20from\x20resolved\x20path','getFolder','segment:folder:show','86472eUbiIK','\x20\x20Parent\x20segment:\x20','Show\x20segment\x20or\x20folder\x20details','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','jsonl','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','fullPath','folderId','Folder\x20name:\x20','\x20folder','segmentPath','description','6wNsOlP','getParent','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','format','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','getSQLFromServerSegment','Use:\x20tdx\x20ps\x20view\x20-w','resolveParentId','setJobId','Usage:\x20tdx\x20sg\x20show\x20<name>','Target\x20path:\x20','Fetching\x20SQL\x20from\x20rule...','red','url','replace','3637828OtCWHI','execute','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x27...','Usage:\x20tdx\x20sg\x20desc\x20<name>','1614564BioOfS','\x20Opening\x20','name','query','Error:\x20','stats','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'];a38_0x466f=function(){return _0x42d66c;};return a38_0x466f();}export class SegmentDescCommand extends BaseCommand{[a38_0x5b1f40(0x19f)]=a38_0x5b1f40(0x211);[a38_0x5b1f40(0x22b)]=a38_0x5b1f40(0x1bd);async[a38_0x5b1f40(0x199)](_0x1f3167){const _0x20bc74=a38_0x5b1f40,{options:_0x45bf45,args:_0x195274,tdx:_0x11024e}=_0x1f3167,_0x1a8eeb=_0x195274[0x0];if(!_0x1a8eeb)return console[_0x20bc74(0x212)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x20bc74(0x212)](_0x20bc74(0x19c)),console[_0x20bc74(0x212)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x20bc74(0x212)](_0x20bc74(0x20e)),console[_0x20bc74(0x212)](_0x20bc74(0x1e8)),console[_0x20bc74(0x212)](_0x20bc74(0x230)),0x1;try{const _0x1b1879=_0x45bf45['parentSegment'],_0x3f50e0=await resolveSegmentTarget(_0x1a8eeb,_0x1b1879,_0x45bf45[_0x20bc74(0x1fb)]);_0x45bf45['verbose']&&console['error'](_0x20bc74(0x193)+_0x3f50e0);const _0x324912=await withSpinner(_0x20bc74(0x206)+_0x1a8eeb+_0x20bc74(0x19b),()=>_0x11024e['segment'][_0x20bc74(0x1d4)](_0x3f50e0),{'verbose':_0x45bf45['verbose']}),_0x7fd3cd=_0x324912[_0x20bc74(0x1d3)];_0x45bf45[_0x20bc74(0x1fb)]&&(console[_0x20bc74(0x212)](_0x20bc74(0x1dc)+_0x7fd3cd['type']),console[_0x20bc74(0x212)](_0x20bc74(0x1ee)+_0x7fd3cd[_0x20bc74(0x1c8)]));if(_0x7fd3cd[_0x20bc74(0x215)]==='folder')return console[_0x20bc74(0x212)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x20bc74(0x212)](_0x20bc74(0x1ac)),0x1;if(_0x7fd3cd[_0x20bc74(0x215)]===_0x20bc74(0x1b4))return console[_0x20bc74(0x212)](_0x20bc74(0x1a5)),console[_0x20bc74(0x212)](_0x20bc74(0x1ae)),0x1;if(!_0x7fd3cd[_0x20bc74(0x1ed)])throw new SDKError(ErrorCode[_0x20bc74(0x1af)],_0x20bc74(0x21d));const _0x6806b0=await withSpinner(_0x20bc74(0x21a),()=>_0x11024e[_0x20bc74(0x1ff)][_0x20bc74(0x1d5)](_0x7fd3cd[_0x20bc74(0x1c8)],_0x7fd3cd[_0x20bc74(0x1ed)]),{'verbose':_0x45bf45['verbose']}),_0x287ff1=_0x6806b0[_0x20bc74(0x1d3)],_0x4651a8=await executeSchemaQuery(_0x287ff1,_0x11024e,_0x45bf45);return await handleQueryOutput(_0x4651a8,_0x45bf45),0x0;}catch(_0x3f16b2){if(_0x3f16b2 instanceof SDKError)return console[_0x20bc74(0x212)](_0x20bc74(0x1a1)+_0x3f16b2[_0x20bc74(0x20a)]),_0x3f16b2[_0x20bc74(0x1d8)]&&console['error'](_0x20bc74(0x1b5)+_0x3f16b2[_0x20bc74(0x1d8)]),0x1;throw _0x3f16b2;}}}
|
|
1
|
+
function a38_0x4999(_0x2b393a,_0x3c629d){_0x2b393a=_0x2b393a-0x1e8;const _0x4729cd=a38_0x4729();let _0x49991f=_0x4729cd[_0x2b393a];return _0x49991f;}const a38_0x359782=a38_0x4999;(function(_0x345128,_0x32c28a){const _0xd85f62=a38_0x4999,_0x391d5a=_0x345128();while(!![]){try{const _0x43ab61=parseInt(_0xd85f62(0x203))/0x1*(-parseInt(_0xd85f62(0x280))/0x2)+-parseInt(_0xd85f62(0x1e8))/0x3+-parseInt(_0xd85f62(0x243))/0x4*(-parseInt(_0xd85f62(0x236))/0x5)+parseInt(_0xd85f62(0x271))/0x6*(parseInt(_0xd85f62(0x208))/0x7)+parseInt(_0xd85f62(0x270))/0x8+parseInt(_0xd85f62(0x26d))/0x9+-parseInt(_0xd85f62(0x238))/0xa*(parseInt(_0xd85f62(0x228))/0xb);if(_0x43ab61===_0x32c28a)break;else _0x391d5a['push'](_0x391d5a['shift']());}catch(_0x5e299e){_0x391d5a['push'](_0x391d5a['shift']());}}}(a38_0x4729,0xb696f));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';function a38_0x4729(){const _0xf8dd46=['SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','format','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','folder','Show\x20folder\x20or\x20child\x20segment\x20details','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','getSQLFromYamlFile','processedRows','Usage:','resolveParentId','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','message','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Examples:','Resolved\x20relative\x20path\x20to:\x20','Show\x20segment\x20or\x20folder\x20details','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','segment:sql','\x20\x20Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','listFolders','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','3949WpWuWP','Folder\x20ID:\x20','site','Use:\x20tdx\x20ps\x20view','INVALID_ARGUMENT','159635PIazJH','jobId','Show\x20child\x20segment\x20schema\x20(column\x20types)','Usage:\x20tdx\x20sg\x20desc\x20<name>','SELECT\x20*\x20FROM\x20(\x0a','jsonl','Options:','Use:\x20tdx\x20ps\x20desc','/e/','parentFolder','\x20rows\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Parent\x20name:\x20','Fetching\x20segment\x20details...','Segment\x20ID:\x20','query','Error:\x20','\x27...','segment','length','toLocaleString','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Site:\x20','description','data','Resolved\x20type:\x20','trim','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segmentId','Use:\x20tdx\x20ps\x20show','Use:\x20tdx\x20ps\x20view\x20-w','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','6094NmiZna','Creating\x20folder\x20\x27','✖\x20Query\x20failed\x20[','\x20\x20Segment\x20name:\x20','SEGMENT_NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','getParent','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','code','(root)','folderId','resolvePathToResource','5MdZBMj','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','3430oKkwqI','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Parent\x20ID:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','stats','Fetching\x20folder\x20\x27','parentSegment','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','segment:folder:show','\x20\x20Cause:\x20','1085380lwEXra','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','content','Usage:\x20tdx\x20sg\x20show\x20<name>','Resolving\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','Target\x20path:\x20','Resolved:\x20','Resolving\x20\x27','\x20\x20Full\x20path:\x20','segment:folder:list','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','replace','Fetching\x20parent\x20segment\x20details...','green','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','verbose','Resolving\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20name:\x20','Resolving\x20path\x20\x27','error','Fetching\x20SQL\x20for\x20segment...','execute','name','\x20[Job\x20ID:\x20','path','elapsedTimeMillis','\x27\x20with\x20ID:\x20','getSQLFromServerSegment','url','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','folderPath','type','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','cause','parentId','segment:describe','6434316AnXuzl','\x20\x20tdx\x20sg\x20sql\x20--path\x20','getSegmentSQL','7238984AuZfLw','270dmijqH','cyan','getSegment','setJobId','Resolved\x20YAML\x20file:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:desc','Show\x20segment\x20folder\x20details','segmentName','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20describe\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','parent','✔\x20Created\x20folder\x20\x27','resolveFolderId','688cEmOIB','fullPath','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getFolder','test','/app/ps/','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','red','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','1863006lIkVVI'];a38_0x4729=function(){return _0xf8dd46;};return a38_0x4729();}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 a38_0x3a705a from'chalk';async function resolveSegmentTarget(_0x3c5aab,_0xf9a7c3,_0x5b7fc0){const _0x4b2ff9=a38_0x4999;if(isYamlFilePath(_0x3c5aab))try{const _0x55474a=await resolveYamlFilePath(_0x3c5aab);return _0x5b7fc0&&(console[_0x4b2ff9(0x25b)](_0x4b2ff9(0x275)+_0x3c5aab),console['error'](_0x4b2ff9(0x1fe)+_0x55474a[_0x4b2ff9(0x23f)]),console[_0x4b2ff9(0x25b)](_0x4b2ff9(0x22b)+_0x55474a[_0x4b2ff9(0x279)]),console[_0x4b2ff9(0x25b)]('\x20\x20Folder\x20path:\x20'+(_0x55474a[_0x4b2ff9(0x267)]||_0x4b2ff9(0x233))),console['error'](_0x4b2ff9(0x24d)+_0x55474a[_0x4b2ff9(0x281)])),_0x55474a['fullPath'];}catch(_0x25d004){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x25d004[_0x4b2ff9(0x1f6)]);}if(!_0xf9a7c3)throw new SDKError(ErrorCode[_0x4b2ff9(0x207)],_0x4b2ff9(0x244));return _0xf9a7c3+'/'+_0x3c5aab;}export class SegmentDescribeCommand extends BaseCommand{[a38_0x359782(0x25e)]=a38_0x359782(0x26c);[a38_0x359782(0x21f)]=a38_0x359782(0x1fa);async[a38_0x359782(0x25d)](_0x2a7fd8){const _0x2f2b5c=a38_0x359782,{options:_0x1ee347,args:_0x1e8a00,tdx:_0x55d51e}=_0x2a7fd8,_0x2139d9=_0x1e8a00[0x0],_0x26849a=!_0x2139d9&&!!_0x1ee347[_0x2f2b5c(0x23f)],_0x1abbbf=_0x2139d9||_0x1ee347[_0x2f2b5c(0x23f)];if(!_0x1abbbf)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x2f2b5c(0x25b)](_0x2f2b5c(0x27b)),console['error'](_0x2f2b5c(0x1f8)),console[_0x2f2b5c(0x25b)](_0x2f2b5c(0x21d)),console[_0x2f2b5c(0x25b)](_0x2f2b5c(0x284)),console['error'](_0x2f2b5c(0x282)),console[_0x2f2b5c(0x25b)](_0x2f2b5c(0x1f7)),0x1;try{const _0x34386f=_0x1ee347['segmentPath'];let _0x5e9b65=_0x1abbbf;!_0x26849a&&_0x34386f&&!_0x1abbbf['includes']('/')&&(_0x5e9b65=_0x34386f+'/'+_0x1abbbf,_0x1ee347[_0x2f2b5c(0x256)]&&console[_0x2f2b5c(0x25b)](_0x2f2b5c(0x1f9)+_0x5e9b65));const _0xa13fc4=await withSpinner(_0x2f2b5c(0x25a)+_0x5e9b65+_0x2f2b5c(0x219),()=>_0x55d51e[_0x2f2b5c(0x21a)][_0x2f2b5c(0x235)](_0x5e9b65),{'verbose':_0x1ee347['verbose']}),_0x2c8523=_0xa13fc4[_0x2f2b5c(0x220)];_0x1ee347[_0x2f2b5c(0x256)]&&(console['error'](_0x2f2b5c(0x221)+_0x2c8523[_0x2f2b5c(0x268)]),console[_0x2f2b5c(0x25b)](_0x2f2b5c(0x23a)+_0x2c8523['parentId']),_0x2c8523[_0x2f2b5c(0x234)]&&console['error'](_0x2f2b5c(0x204)+_0x2c8523[_0x2f2b5c(0x234)]),_0x2c8523[_0x2f2b5c(0x224)]&&console['error'](_0x2f2b5c(0x216)+_0x2c8523[_0x2f2b5c(0x224)]));if(_0x2c8523[_0x2f2b5c(0x268)]===_0x2f2b5c(0x27d)){const _0x309f0a=await withSpinner(_0x2f2b5c(0x252),()=>_0x55d51e[_0x2f2b5c(0x21a)][_0x2f2b5c(0x22f)](_0x2c8523[_0x2f2b5c(0x26b)]),{'verbose':_0x1ee347[_0x2f2b5c(0x256)]});await handleSingleObjectOutput(_0x309f0a[_0x2f2b5c(0x220)],_0x1ee347);}else{if(_0x2c8523[_0x2f2b5c(0x268)]==='folder'){if(!_0x2c8523['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x148c8a=await withSpinner('Fetching\x20folder\x20details...',()=>_0x55d51e[_0x2f2b5c(0x21a)][_0x2f2b5c(0x285)](_0x2c8523['folderId']),{'verbose':_0x1ee347[_0x2f2b5c(0x256)]});await handleSingleObjectOutput(_0x148c8a[_0x2f2b5c(0x220)],_0x1ee347);}else{if(_0x2c8523['type']===_0x2f2b5c(0x21a)){if(!_0x2c8523['segmentId'])throw new SDKError(ErrorCode[_0x2f2b5c(0x22c)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5f50bd=await withSpinner(_0x2f2b5c(0x215),()=>_0x55d51e[_0x2f2b5c(0x21a)]['getSegment'](_0x2c8523[_0x2f2b5c(0x26b)],_0x2c8523[_0x2f2b5c(0x224)]),{'verbose':_0x1ee347['verbose']});await handleSingleObjectOutput(_0x5f50bd[_0x2f2b5c(0x220)],_0x1ee347);}}}return 0x0;}catch(_0x5721d8){if(_0x5721d8 instanceof SDKError)return console[_0x2f2b5c(0x25b)](_0x2f2b5c(0x218)+_0x5721d8[_0x2f2b5c(0x1f6)]),_0x5721d8['cause']&&console[_0x2f2b5c(0x25b)]('\x20\x20Cause:\x20'+_0x5721d8[_0x2f2b5c(0x26a)]),0x1;throw _0x5721d8;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a38_0x359782(0x21f)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x4554e3){const _0x1d7306=a38_0x359782,{options:_0x159a0b,args:_0x20c7b4,tdx:_0x30dda0}=_0x4554e3,_0x139dad=_0x20c7b4[0x0];if(!_0x139dad)return console['error'](_0x1d7306(0x27a)),console[_0x1d7306(0x25b)](_0x1d7306(0x247)),console[_0x1d7306(0x25b)](_0x1d7306(0x22d)),console[_0x1d7306(0x25b)](_0x1d7306(0x1f8)),console[_0x1d7306(0x25b)](_0x1d7306(0x213)),console['error'](_0x1d7306(0x240)),0x1;try{const _0x31883f=_0x159a0b[_0x1d7306(0x23f)],_0x3e1177=await resolveSegmentTarget(_0x139dad,_0x31883f,_0x159a0b[_0x1d7306(0x256)]);_0x159a0b[_0x1d7306(0x256)]&&console[_0x1d7306(0x25b)](_0x1d7306(0x24a)+_0x3e1177);const _0x52eba=await withSpinner(_0x1d7306(0x24c)+_0x139dad+'\x27...',()=>_0x30dda0[_0x1d7306(0x21a)]['resolvePathToResource'](_0x3e1177),{'verbose':_0x159a0b[_0x1d7306(0x256)]}),_0x5eabd1=_0x52eba['data'];_0x159a0b['verbose']&&(console[_0x1d7306(0x25b)](_0x1d7306(0x221)+_0x5eabd1[_0x1d7306(0x268)]),console[_0x1d7306(0x25b)]('Parent\x20ID:\x20'+_0x5eabd1[_0x1d7306(0x26b)]));if(_0x5eabd1[_0x1d7306(0x268)]===_0x1d7306(0x1ed))return console[_0x1d7306(0x25b)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x1d7306(0x25b)](_0x1d7306(0x265)),0x1;if(_0x5eabd1[_0x1d7306(0x268)]===_0x1d7306(0x27d))return console['error'](_0x1d7306(0x227)),console[_0x1d7306(0x25b)](_0x1d7306(0x225)),0x1;if(!_0x5eabd1[_0x1d7306(0x224)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x580a8c=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x30dda0['segment'][_0x1d7306(0x26f)](_0x5eabd1[_0x1d7306(0x26b)],_0x5eabd1['segmentId']),{'verbose':_0x159a0b['verbose']});let _0x586ec8=_0x580a8c['data'];const _0xcd6505=resolveLimit(_0x159a0b['limit'],DEFAULT_DISPLAY_LIMIT),_0x239e47=/\bLIMIT\s+\d+/i[_0x1d7306(0x286)](_0x586ec8);!_0x239e47&&(_0x586ec8=_0x586ec8[_0x1d7306(0x222)]()[_0x1d7306(0x251)](/;+$/,''),_0x586ec8=_0x1d7306(0x20c)+_0x586ec8+_0x1d7306(0x1ec)+_0xcd6505);_0x159a0b['verbose']&&console[_0x1d7306(0x25b)](_0x1d7306(0x1e9)+_0x586ec8);const _0x81abf9=await withProgressSpinner('Executing\x20segment\x20query...',async _0x43150d=>{const _0x123321=_0x1d7306,_0x416c8c=await _0x30dda0[_0x123321(0x217)]['execute'](_0x586ec8,{'catalog':'td','schema':'information_schema','onJobId':_0x471a2e=>{const _0x5e5e8f=_0x123321;_0x43150d[_0x5e5e8f(0x274)](_0x471a2e);}});return _0x416c8c;},{'verbose':_0x159a0b[_0x1d7306(0x256)]}),_0x4fb713=_0x81abf9[_0x1d7306(0x220)],_0x5cb3fc=_0x4fb713[_0x1d7306(0x209)]?_0x1d7306(0x25f)+_0x4fb713[_0x1d7306(0x209)]+']':'';return console[_0x1d7306(0x25b)](_0x1d7306(0x283)+_0x4fb713[_0x1d7306(0x23d)][_0x1d7306(0x1f1)][_0x1d7306(0x21c)]()+_0x1d7306(0x212)+('in\x20'+formatElapsed(_0x4fb713[_0x1d7306(0x23d)][_0x1d7306(0x261)])+_0x5cb3fc)),await handleQueryOutput(_0x4fb713,_0x159a0b),0x0;}catch(_0x3eb104){if(_0x3eb104 instanceof SDKError)return console[_0x1d7306(0x25b)](_0x1d7306(0x22a)+_0x3eb104[_0x1d7306(0x232)]+']'),console[_0x1d7306(0x25b)]('\x0a'+_0x3eb104[_0x1d7306(0x1f6)]),0x1;throw _0x3eb104;}}}export class SegmentFolderListCommand extends BaseCommand{[a38_0x359782(0x25e)]=a38_0x359782(0x24e);[a38_0x359782(0x21f)]=a38_0x359782(0x28a);async[a38_0x359782(0x25d)](_0x468641){const _0x32b9cc=a38_0x359782,{options:_0xd4f89e,args:_0x10d17e,tdx:_0x55c45b}=_0x468641;if(_0x10d17e[_0x32b9cc(0x21b)]===0x0)return console[_0x32b9cc(0x25b)](_0x32b9cc(0x254)),console[_0x32b9cc(0x25b)](_0x32b9cc(0x266)),0x1;const _0x17db4c=_0x10d17e[0x0];try{_0xd4f89e[_0x32b9cc(0x256)]&&(console[_0x32b9cc(0x25b)](_0x32b9cc(0x21e)+_0xd4f89e[_0x32b9cc(0x205)]),console[_0x32b9cc(0x25b)](_0x32b9cc(0x214)+_0x17db4c));const _0x50cef6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x17db4c+_0x32b9cc(0x219),()=>_0x55c45b['segment'][_0x32b9cc(0x1f3)](_0x17db4c),{'verbose':_0xd4f89e[_0x32b9cc(0x256)]}),_0x2ddc0d=_0x50cef6[_0x32b9cc(0x220)];_0xd4f89e['verbose']&&console[_0x32b9cc(0x25b)]('Resolved\x20parent\x20ID:\x20'+_0x2ddc0d);const _0x18614c=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x17db4c+_0x32b9cc(0x219),()=>_0x55c45b[_0x32b9cc(0x21a)][_0x32b9cc(0x201)](_0x2ddc0d),{'verbose':_0xd4f89e[_0x32b9cc(0x256)]}),_0x3174b6=_0x18614c[_0x32b9cc(0x220)];return console[_0x32b9cc(0x25b)]('✔\x20Found\x20'+_0x3174b6[_0x32b9cc(0x21b)]+'\x20folder'+(_0x3174b6[_0x32b9cc(0x21b)]!==0x1?'s':'')),await handleSDKOutput(_0x3174b6,_0xd4f89e),0x0;}catch(_0x3072ef){if(_0x3072ef instanceof SDKError)return console[_0x32b9cc(0x25b)](_0x32b9cc(0x218)+_0x3072ef['message']),_0x3072ef[_0x32b9cc(0x26a)]&&console['error']('\x20\x20Cause:\x20'+_0x3072ef[_0x32b9cc(0x26a)]),0x1;throw _0x3072ef;}}}export class SegmentFolderShowCommand extends BaseCommand{[a38_0x359782(0x25e)]=a38_0x359782(0x241);[a38_0x359782(0x21f)]=a38_0x359782(0x278);async['execute'](_0x177bb5){const _0x1e19c0=a38_0x359782,{options:_0x2a7cb2,args:_0x2f8bf8,tdx:_0x544f42}=_0x177bb5;if(_0x2f8bf8['length']===0x0)return console[_0x1e19c0(0x25b)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x1e19c0(0x25b)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x277287,childId:_0x36f4ed}=parseSegmentRef(_0x2f8bf8[0x0]);_0x2a7cb2['verbose']&&(console[_0x1e19c0(0x25b)](_0x1e19c0(0x21e)+_0x2a7cb2[_0x1e19c0(0x205)]),console[_0x1e19c0(0x25b)](_0x1e19c0(0x214)+_0x277287),_0x36f4ed&&console[_0x1e19c0(0x25b)](_0x1e19c0(0x259)+_0x36f4ed));if(!_0x36f4ed)return console[_0x1e19c0(0x25b)](_0x1e19c0(0x288)),0x1;const _0x2bbc28=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x277287+'\x27...',()=>_0x544f42[_0x1e19c0(0x21a)][_0x1e19c0(0x1f3)](_0x277287),{'verbose':_0x2a7cb2[_0x1e19c0(0x256)]}),_0x50b87e=_0x2bbc28['data'];_0x2a7cb2['verbose']&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x50b87e);const _0x2fd337=await withSpinner(_0x1e19c0(0x257)+_0x36f4ed+_0x1e19c0(0x219),()=>_0x544f42[_0x1e19c0(0x21a)][_0x1e19c0(0x27f)](_0x50b87e,_0x36f4ed),{'verbose':_0x2a7cb2[_0x1e19c0(0x256)]}),_0x5a1aba=_0x2fd337[_0x1e19c0(0x220)];_0x2a7cb2[_0x1e19c0(0x256)]&&console[_0x1e19c0(0x25b)]('Resolved\x20folder\x20ID:\x20'+_0x5a1aba);const _0x2307c3=await withSpinner(_0x1e19c0(0x23e)+_0x36f4ed+_0x1e19c0(0x219),()=>_0x544f42[_0x1e19c0(0x21a)][_0x1e19c0(0x285)](_0x5a1aba),{'verbose':_0x2a7cb2[_0x1e19c0(0x256)]});return await handleSDKOutput([_0x2307c3[_0x1e19c0(0x220)]],_0x2a7cb2),0x0;}catch(_0x53d9bb){if(_0x53d9bb instanceof SDKError)return console[_0x1e19c0(0x25b)](_0x1e19c0(0x218)+_0x53d9bb[_0x1e19c0(0x1f6)]),_0x53d9bb['cause']&&console[_0x1e19c0(0x25b)](_0x1e19c0(0x242)+_0x53d9bb[_0x1e19c0(0x26a)]),0x1;throw _0x53d9bb;}}}export class SegmentSQLCommand extends BaseCommand{[a38_0x359782(0x25e)]=a38_0x359782(0x1fd);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a38_0x359782(0x25d)](_0x12da08){const _0x443524=a38_0x359782,{options:_0x160e41,args:_0x31cf17}=_0x12da08,_0x5d220e=_0x160e41,_0x1ab16b=_0x5d220e[_0x443524(0x260)],_0x536241=_0x31cf17[0x0];if(!_0x536241&&!_0x1ab16b)return console[_0x443524(0x25b)](a38_0x3a705a['red'](_0x443524(0x1ef))),console[_0x443524(0x25b)](_0x443524(0x1f2)),console[_0x443524(0x25b)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x443524(0x25b)](_0x443524(0x255)),console['error']('Examples:'),console[_0x443524(0x25b)](_0x443524(0x230)),console[_0x443524(0x25b)](_0x443524(0x23c)),0x1;if(_0x536241&&_0x1ab16b)return console['error'](a38_0x3a705a['red']('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x3f652c;if(_0x1ab16b)_0x3f652c=await this[_0x443524(0x1f0)](_0x1ab16b,_0x12da08);else{if(isYamlFilePath(_0x536241))return console[_0x443524(0x25b)](a38_0x3a705a[_0x443524(0x289)](_0x443524(0x202))),console[_0x443524(0x25b)](_0x443524(0x26e)+_0x536241),0x1;else _0x3f652c=await this[_0x443524(0x263)](_0x536241,_0x12da08);}return _0x160e41[_0x443524(0x1eb)]==='json'||_0x160e41[_0x443524(0x1eb)]===_0x443524(0x20d)?await handleSDKOutput([{'sql':_0x3f652c}],_0x160e41):console['log'](_0x3f652c),0x0;}catch(_0x1f7ba6){if(_0x1f7ba6 instanceof SDKError)return console[_0x443524(0x25b)]('Error:\x20'+_0x1f7ba6[_0x443524(0x1f6)]),_0x1f7ba6[_0x443524(0x26a)]&&console[_0x443524(0x25b)](_0x443524(0x242)+_0x1f7ba6[_0x443524(0x26a)]),0x1;throw _0x1f7ba6;}}async['getSQLFromYamlFile'](_0x4ad7b2,_0x4ce1d8){const _0x348266=a38_0x359782,{options:_0x4b70f5,tdx:_0x5ce15f}=_0x4ce1d8;let _0x4dcac8;try{_0x4dcac8=await resolveYamlFilePath(_0x4ad7b2);}catch(_0x29d002){throw new SDKError(ErrorCode[_0x348266(0x207)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x29d002['message']);}_0x4b70f5[_0x348266(0x256)]&&console[_0x348266(0x25b)](_0x348266(0x24b)+_0x4dcac8[_0x348266(0x23f)]+'/'+_0x4dcac8[_0x348266(0x279)]);const _0x319178=await withSpinner('Fetching\x20SQL\x20from\x20rule...',()=>_0x5ce15f[_0x348266(0x21a)]['getSegmentSQLFromYaml'](_0x4dcac8[_0x348266(0x246)],_0x4dcac8[_0x348266(0x23f)],_0x4dcac8[_0x348266(0x279)]),{'verbose':_0x4b70f5[_0x348266(0x256)]});return _0x319178['data'];}async[a38_0x359782(0x263)](_0x467819,_0x4ef122){const _0x1bcc14=a38_0x359782,{options:_0x5a8f9c,tdx:_0x43dcc0}=_0x4ef122,_0x150a65=_0x5a8f9c['parentSegment'],_0x4bf5d5=await resolveSegmentTarget(_0x467819,_0x150a65,_0x5a8f9c[_0x1bcc14(0x256)]);_0x5a8f9c[_0x1bcc14(0x256)]&&console[_0x1bcc14(0x25b)]('Target\x20path:\x20'+_0x4bf5d5);const _0x5c489b=await withSpinner('Resolving\x20\x27'+_0x467819+_0x1bcc14(0x219),()=>_0x43dcc0[_0x1bcc14(0x21a)][_0x1bcc14(0x235)](_0x4bf5d5),{'verbose':_0x5a8f9c[_0x1bcc14(0x256)]}),_0x26201e=_0x5c489b[_0x1bcc14(0x220)];_0x5a8f9c['verbose']&&(console[_0x1bcc14(0x25b)](_0x1bcc14(0x221)+_0x26201e[_0x1bcc14(0x268)]),console[_0x1bcc14(0x25b)](_0x1bcc14(0x23a)+_0x26201e[_0x1bcc14(0x26b)]));if(_0x26201e[_0x1bcc14(0x268)]===_0x1bcc14(0x1ed))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x26201e[_0x1bcc14(0x268)]===_0x1bcc14(0x27d))throw new SDKError(ErrorCode[_0x1bcc14(0x207)],_0x1bcc14(0x1fb));if(!_0x26201e[_0x1bcc14(0x224)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1bcc14(0x258));const _0x4eb5a5=await withSpinner(_0x1bcc14(0x25c),()=>_0x43dcc0[_0x1bcc14(0x21a)][_0x1bcc14(0x26f)](_0x26201e['parentId'],_0x26201e[_0x1bcc14(0x224)]),{'verbose':_0x5a8f9c[_0x1bcc14(0x256)]});return _0x4eb5a5[_0x1bcc14(0x220)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a38_0x359782(0x25e)]='segment:folder:create';[a38_0x359782(0x21f)]='Create\x20segment\x20folder\x20for\x20organization';async[a38_0x359782(0x25d)](_0x34f591){const _0x570947=a38_0x359782,{options:_0x118437,args:_0x4b9a16,tdx:_0x3375cf}=_0x34f591,_0xba5b13=_0x118437;if(_0x4b9a16[_0x570947(0x21b)]<0x2)return console[_0x570947(0x25b)](_0x570947(0x200)),console['error'](_0x570947(0x27c)),0x1;const _0x4a1cfb=_0x4b9a16[0x0],_0x57f10c=_0x4b9a16[0x1];_0xba5b13[_0x570947(0x256)]&&(console[_0x570947(0x25b)](_0x570947(0x21e)+_0xba5b13[_0x570947(0x205)]),console['error'](_0x570947(0x249)+_0x4a1cfb),console['error'](_0x570947(0x259)+_0x57f10c));let _0x1f4841;if(_0xba5b13[_0x570947(0x211)]){const _0x1d7e42=_0xba5b13[_0x570947(0x211)],_0x2fc784=await withSpinner(_0x570947(0x248)+_0x4a1cfb+_0x570947(0x219),()=>_0x3375cf['segment'][_0x570947(0x1f3)](_0x4a1cfb),{'verbose':_0xba5b13[_0x570947(0x256)]}),_0x2123e9=_0x2fc784[_0x570947(0x220)],_0x114087=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x1d7e42+'\x27...',()=>_0x3375cf[_0x570947(0x21a)][_0x570947(0x27f)](_0x2123e9,_0x1d7e42),{'verbose':_0xba5b13[_0x570947(0x256)]});_0x1f4841=_0x114087[_0x570947(0x220)],_0xba5b13[_0x570947(0x256)]&&console['error'](_0x570947(0x24f)+_0x1f4841);}const _0x4b1727={'name':_0x57f10c,'description':_0xba5b13[_0x570947(0x21f)],'parentFolderId':_0x1f4841},_0x5a793e=await withSpinner(_0x570947(0x229)+_0x57f10c+_0x570947(0x219),()=>_0x3375cf[_0x570947(0x21a)]['createFolder'](_0x4a1cfb,_0x4b1727),{'verbose':_0xba5b13[_0x570947(0x256)]}),_0x1734ab=_0x5a793e['data'];return console[_0x570947(0x25b)](_0x570947(0x27e)+_0x1734ab[_0x570947(0x25e)]+_0x570947(0x262)+_0x1734ab['id']),await handleSDKOutput([_0x1734ab],_0xba5b13),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';[a38_0x359782(0x21f)]=a38_0x359782(0x1ee);async[a38_0x359782(0x25d)](_0x5cafbd){const _0x4e416a=a38_0x359782,{options:_0x18e35d,args:_0x3c50cf,tdx:_0x1a467e}=_0x5cafbd,_0x23baa2=_0x3c50cf[0x0];if(!_0x23baa2)return console[_0x4e416a(0x25b)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x4e416a(0x276)),console['error'](_0x4e416a(0x1ff)),console[_0x4e416a(0x25b)](_0x4e416a(0x20e)),console[_0x4e416a(0x25b)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x4e416a(0x1f8)),console['error'](_0x4e416a(0x1fc)),console[_0x4e416a(0x25b)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x4e416a(0x25b)](_0x4e416a(0x22e)),console['error'](_0x4e416a(0x231)),0x1;try{const _0x2571cd=_0x18e35d[_0x4e416a(0x23f)],_0x4e20b7=await resolveSegmentTarget(_0x23baa2,_0x2571cd,_0x18e35d[_0x4e416a(0x256)]);_0x18e35d[_0x4e416a(0x256)]&&console[_0x4e416a(0x25b)]('Target\x20path:\x20'+_0x4e20b7);const _0xc6e158=await withSpinner('Resolving\x20\x27'+_0x23baa2+'\x27...',()=>_0x1a467e[_0x4e416a(0x21a)][_0x4e416a(0x235)](_0x4e20b7),{'verbose':_0x18e35d[_0x4e416a(0x256)]}),_0x58d199=_0xc6e158[_0x4e416a(0x220)];_0x18e35d[_0x4e416a(0x256)]&&(console[_0x4e416a(0x25b)](_0x4e416a(0x221)+_0x58d199[_0x4e416a(0x268)]),console['error'](_0x4e416a(0x23a)+_0x58d199[_0x4e416a(0x26b)]),_0x58d199[_0x4e416a(0x234)]&&console[_0x4e416a(0x25b)](_0x4e416a(0x204)+_0x58d199['folderId']),_0x58d199[_0x4e416a(0x224)]&&console[_0x4e416a(0x25b)](_0x4e416a(0x216)+_0x58d199['segmentId']));if(_0x18e35d['web']){if(_0x58d199[_0x4e416a(0x268)]===_0x4e416a(0x1ed))return console[_0x4e416a(0x25b)](_0x4e416a(0x237)),0x1;if(_0x58d199['type']===_0x4e416a(0x27d))return console[_0x4e416a(0x25b)](_0x4e416a(0x269)),console[_0x4e416a(0x25b)](_0x4e416a(0x226)),0x1;if(!_0x58d199['segmentId'])throw new SDKError(ErrorCode[_0x4e416a(0x22c)],_0x4e416a(0x258));const _0x727664=getConsoleNextUrl(_0x18e35d[_0x4e416a(0x205)],_0x4e416a(0x287)+_0x58d199['parentId']+_0x4e416a(0x210)+_0x58d199[_0x4e416a(0x224)]);return console['error'](a38_0x3a705a[_0x4e416a(0x253)]('✔')+'\x20Opening\x20'+a38_0x3a705a[_0x4e416a(0x272)](_0x727664)),openBrowser(_0x727664),0x0;}if(_0x58d199[_0x4e416a(0x268)]===_0x4e416a(0x1ed)){if(!_0x58d199[_0x4e416a(0x234)])throw new SDKError(ErrorCode[_0x4e416a(0x1f4)],_0x4e416a(0x223));const _0x4683a8=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1a467e[_0x4e416a(0x21a)]['getFolder'](_0x58d199[_0x4e416a(0x234)]),{'verbose':_0x18e35d['verbose']});await handleSingleObjectOutput(_0x4683a8[_0x4e416a(0x220)],_0x18e35d);}else{if(_0x58d199[_0x4e416a(0x268)]===_0x4e416a(0x21a)){if(!_0x58d199[_0x4e416a(0x224)])throw new SDKError(ErrorCode[_0x4e416a(0x22c)],_0x4e416a(0x258));const _0x21d26a=await withSpinner(_0x4e416a(0x215),()=>_0x1a467e['segment'][_0x4e416a(0x273)](_0x58d199['parentId'],_0x58d199['segmentId']),{'verbose':_0x18e35d[_0x4e416a(0x256)]}),_0x15d770=getConsoleNextUrl(_0x18e35d[_0x4e416a(0x205)],_0x4e416a(0x287)+_0x58d199[_0x4e416a(0x26b)]+_0x4e416a(0x210)+_0x58d199['segmentId']),_0x513ee8=_0x21d26a[_0x4e416a(0x220)];_0x513ee8[_0x4e416a(0x264)]=_0x15d770,await handleSingleObjectOutput(_0x513ee8,_0x18e35d);}else return console[_0x4e416a(0x25b)](_0x4e416a(0x245)),console[_0x4e416a(0x25b)](_0x4e416a(0x206)),0x1;}return 0x0;}catch(_0x59440d){if(_0x59440d instanceof SDKError)return console[_0x4e416a(0x25b)](_0x4e416a(0x218)+_0x59440d[_0x4e416a(0x1f6)]),_0x59440d[_0x4e416a(0x26a)]&&console[_0x4e416a(0x25b)](_0x4e416a(0x242)+_0x59440d[_0x4e416a(0x26a)]),0x1;throw _0x59440d;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a38_0x359782(0x25e)]=a38_0x359782(0x277);[a38_0x359782(0x21f)]=a38_0x359782(0x20a);async[a38_0x359782(0x25d)](_0x3923c7){const _0x2aee5e=a38_0x359782,{options:_0x44b0b9,args:_0x5b7161,tdx:_0x5acebd}=_0x3923c7,_0x38d2f5=_0x5b7161[0x0];if(!_0x38d2f5)return console[_0x2aee5e(0x25b)](_0x2aee5e(0x27a)),console[_0x2aee5e(0x25b)](_0x2aee5e(0x20b)),console[_0x2aee5e(0x25b)](_0x2aee5e(0x239)),console['error'](_0x2aee5e(0x1f8)),console[_0x2aee5e(0x25b)](_0x2aee5e(0x1ea)),console[_0x2aee5e(0x25b)](_0x2aee5e(0x250)),0x1;try{const _0x222fc8=_0x44b0b9[_0x2aee5e(0x23f)],_0x3e9822=await resolveSegmentTarget(_0x38d2f5,_0x222fc8,_0x44b0b9[_0x2aee5e(0x256)]);_0x44b0b9[_0x2aee5e(0x256)]&&console[_0x2aee5e(0x25b)]('Target\x20path:\x20'+_0x3e9822);const _0x4e7f3b=await withSpinner(_0x2aee5e(0x24c)+_0x38d2f5+'\x27...',()=>_0x5acebd[_0x2aee5e(0x21a)]['resolvePathToResource'](_0x3e9822),{'verbose':_0x44b0b9[_0x2aee5e(0x256)]}),_0x1f1987=_0x4e7f3b[_0x2aee5e(0x220)];_0x44b0b9[_0x2aee5e(0x256)]&&(console['error'](_0x2aee5e(0x221)+_0x1f1987[_0x2aee5e(0x268)]),console[_0x2aee5e(0x25b)](_0x2aee5e(0x23a)+_0x1f1987['parentId']));if(_0x1f1987[_0x2aee5e(0x268)]===_0x2aee5e(0x1ed))return console[_0x2aee5e(0x25b)](_0x2aee5e(0x1f5)),console[_0x2aee5e(0x25b)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x1f1987[_0x2aee5e(0x268)]===_0x2aee5e(0x27d))return console[_0x2aee5e(0x25b)](_0x2aee5e(0x23b)),console[_0x2aee5e(0x25b)](_0x2aee5e(0x20f)),0x1;if(!_0x1f1987[_0x2aee5e(0x224)])throw new SDKError(ErrorCode[_0x2aee5e(0x22c)],_0x2aee5e(0x258));const _0x2a1fc5=await withSpinner(_0x2aee5e(0x25c),()=>_0x5acebd['segment']['getSegmentSQL'](_0x1f1987['parentId'],_0x1f1987[_0x2aee5e(0x224)]),{'verbose':_0x44b0b9[_0x2aee5e(0x256)]}),_0x44f3d5=_0x2a1fc5['data'],_0x5dc2f6=await executeSchemaQuery(_0x44f3d5,_0x5acebd,_0x44b0b9);return await handleQueryOutput(_0x5dc2f6,_0x44b0b9),0x0;}catch(_0x4ea668){if(_0x4ea668 instanceof SDKError)return console[_0x2aee5e(0x25b)]('Error:\x20'+_0x4ea668['message']),_0x4ea668[_0x2aee5e(0x26a)]&&console['error'](_0x2aee5e(0x242)+_0x4ea668['cause']),0x1;throw _0x4ea668;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x29f973=a39_0x221b;(function(_0x3795f2,_0x4fe440){const _0x41544d=a39_0x221b,_0x56db08=_0x3795f2();while(!![]){try{const _0x1ea82d=-parseInt(_0x41544d(0xfc))/0x1+-parseInt(_0x41544d(0xf3))/0x2*(parseInt(_0x41544d(0xdc))/0x3)+parseInt(_0x41544d(0xff))/0x4+-parseInt(_0x41544d(0xef))/0x5*(parseInt(_0x41544d(0x10b))/0x6)+-parseInt(_0x41544d(0x103))/0x7+-parseInt(_0x41544d(0xec))/0x8*(parseInt(_0x41544d(0xea))/0x9)+parseInt(_0x41544d(0xf7))/0xa;if(_0x1ea82d===_0x4fe440)break;else _0x56db08['push'](_0x56db08['shift']());}catch(_0xe979b){_0x56db08['push'](_0x56db08['shift']());}}}(a39_0x3b2d,0x3c646));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a39_0x221b(_0xb59788,_0x59ab6f){_0xb59788=_0xb59788-0xd5;const _0x3b2d08=a39_0x3b2d();let _0x221b76=_0x3b2d08[_0xb59788];return _0x221b76;}import a39_0x1bf031 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a39_0x29f973(0x100)]=a39_0x29f973(0xd7);['description']=a39_0x29f973(0xf9);async[a39_0x29f973(0xfe)](_0x2ef543){const _0x28fd23=a39_0x29f973;console[_0x28fd23(0xd5)](a39_0x1bf031[_0x28fd23(0xf0)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a39_0x1bf031[_0x28fd23(0xf0)](_0x28fd23(0xed)));const {options:_0x1b67b5,args:_0x4debe2,tdx:_0x34d3b1}=_0x2ef543,_0x40066c=_0x1b67b5;if(_0x4debe2[_0x28fd23(0xda)]===0x0)return console[_0x28fd23(0xd5)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x28fd23(0xe7)),console[_0x28fd23(0xd5)](_0x28fd23(0xfa)),console[_0x28fd23(0xd5)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x28fd23(0xd5)](_0x28fd23(0xe3)),console[_0x28fd23(0xd5)](_0x28fd23(0xf6)),0x1;const _0x21234c=_0x4debe2[0x0],_0x5985c4=_0x1b67b5[_0x28fd23(0x105)];let _0x22887f=_0x21234c;_0x5985c4&&!_0x21234c['includes']('/')&&(_0x22887f=_0x5985c4+'/'+_0x21234c,_0x40066c[_0x28fd23(0xd6)]&&console['error'](_0x28fd23(0xe2)+_0x22887f));const _0x20585a=parsePath(_0x22887f);if(_0x20585a[_0x28fd23(0xfb)][_0x28fd23(0xda)]<0x2)return console[_0x28fd23(0xd5)](_0x28fd23(0xee)),console['error'](_0x28fd23(0xe0)),0x1;const _0x36e6b8=_0x20585a[_0x28fd23(0xfb)][0x0],_0x4eba68=getBaseName(_0x22887f),_0xc65197=getParentPath(_0x22887f);_0x40066c[_0x28fd23(0xd6)]&&(console[_0x28fd23(0xd5)]('Site:\x20'+_0x40066c[_0x28fd23(0xf4)]),console['error']('Target\x20path:\x20'+_0x22887f),console[_0x28fd23(0xd5)](_0x28fd23(0xdb)+_0x36e6b8),console[_0x28fd23(0xd5)](_0x28fd23(0xd8)+_0x4eba68),console[_0x28fd23(0xd5)](_0x28fd23(0xe1)+_0xc65197));const _0x59c5cb=await withSpinner(_0x28fd23(0xdd)+_0x36e6b8+_0x28fd23(0xe5),()=>_0x34d3b1[_0x28fd23(0xf5)][_0x28fd23(0x102)](_0x36e6b8),{'verbose':_0x40066c[_0x28fd23(0xd6)]}),_0x446015=_0x59c5cb[_0x28fd23(0x108)];let _0x583139;if(_0x20585a[_0x28fd23(0xfb)][_0x28fd23(0xda)]>0x2){const _0x9a5ebd=await withSpinner(_0x28fd23(0x101)+_0xc65197+_0x28fd23(0xe5),()=>_0x34d3b1[_0x28fd23(0xf5)]['resolvePathToResource'](_0xc65197),{'verbose':_0x40066c[_0x28fd23(0xd6)]}),_0x224e3b=_0x9a5ebd[_0x28fd23(0x108)];if(_0x224e3b[_0x28fd23(0xf1)]!==_0x28fd23(0xd9)&&_0x224e3b[_0x28fd23(0xf1)]!==_0x28fd23(0x106))return console[_0x28fd23(0xd5)](_0x28fd23(0x10a)),0x1;_0x583139=_0x224e3b[_0x28fd23(0x109)];}else{if(_0x40066c[_0x28fd23(0xd9)]){const _0x33414b=await withSpinner(_0x28fd23(0x104)+_0x40066c[_0x28fd23(0xd9)]+_0x28fd23(0xe5),()=>_0x34d3b1[_0x28fd23(0xf5)][_0x28fd23(0xe8)](_0x446015,_0x40066c[_0x28fd23(0xd9)]),{'verbose':_0x40066c[_0x28fd23(0xd6)]});_0x583139=_0x33414b[_0x28fd23(0x108)];}}_0x40066c[_0x28fd23(0xd6)]&&_0x583139&&console['error'](_0x28fd23(0xe4)+_0x583139);const _0x4f822a=await loadJSONFromOptions(_0x40066c[_0x28fd23(0xde)],_0x40066c[_0x28fd23(0xdf)]),_0x122507={'name':_0x4eba68,'description':_0x40066c[_0x28fd23(0x107)],'rule':_0x4f822a,'kind':_0x40066c[_0x28fd23(0xe9)]!==undefined?parseInt(_0x40066c[_0x28fd23(0xe9)],0xa):undefined,'isVisible':_0x40066c[_0x28fd23(0xeb)]?![]:undefined,'segmentFolderId':_0x583139,'countPopulation':_0x40066c[_0x28fd23(0xf2)]?![]:undefined},_0x17a8c2=await withSpinner(_0x28fd23(0xf8)+_0x4eba68+'\x27...',()=>_0x34d3b1[_0x28fd23(0xf5)]['createSegment'](_0x446015,_0x122507),{'verbose':_0x40066c[_0x28fd23(0xd6)]}),_0x55e5a9=_0x17a8c2[_0x28fd23(0x108)];return console[_0x28fd23(0xd5)](_0x28fd23(0xfd)+_0x55e5a9[_0x28fd23(0x100)]+'\x27\x20with\x20ID:\x20'+_0x55e5a9['id']),_0x22887f!==_0x21234c&&console[_0x28fd23(0xd5)](_0x28fd23(0xe6)+_0x22887f),await handleSDKOutput([_0x55e5a9],_0x40066c),0x0;}}function a39_0x3b2d(){const _0x4b057e=['3evtPtA','Resolving\x20parent\x20segment\x20\x27','rule','ruleFile','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Parent\x20path:\x20','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolved\x20folder\x20ID:\x20','\x27...','\x20\x20\x20Path:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','resolveFolderId','kind','4743rhlFkB','invisible','3880pXRFKl','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','895670aPXNGr','yellow','type','noCountPopulation','249514syARve','site','segment','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','9631760UnzyjH','Creating\x20segment\x20\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','Examples:','segments','306449xzpxDb','✔\x20Created\x20segment\x20\x27','execute','1388472dKEXun','name','Resolving\x20folder\x20path\x20\x27','resolveParentId','1378951ipeunS','Resolving\x20folder\x20\x27','segmentPath','parent','description','data','folderId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','6HJqzJU','error','verbose','segment:create','Segment\x20name:\x20','folder','length','Parent:\x20'];a39_0x3b2d=function(){return _0x4b057e;};return a39_0x3b2d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x902c3d=a40_0x40a4;(function(_0x54340e,_0x4c3e83){const _0x1d01f4=a40_0x40a4,_0x57da8f=_0x54340e();while(!![]){try{const _0x5626e4=-parseInt(_0x1d01f4(0x197))/0x1+parseInt(_0x1d01f4(0x195))/0x2+-parseInt(_0x1d01f4(0x19d))/0x3+-parseInt(_0x1d01f4(0x196))/0x4*(-parseInt(_0x1d01f4(0x194))/0x5)+-parseInt(_0x1d01f4(0x1ab))/0x6+-parseInt(_0x1d01f4(0x1aa))/0x7+parseInt(_0x1d01f4(0x19a))/0x8;if(_0x5626e4===_0x4c3e83)break;else _0x57da8f['push'](_0x57da8f['shift']());}catch(_0x2c02b6){_0x57da8f['push'](_0x57da8f['shift']());}}}(a40_0x37c5,0xb8959));import{BaseCommand}from'./command.js';function a40_0x37c5(){const _0x3e238e=['\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20field','481852RuIBzu','3398424sZaAex','listFields','parentSegment','15XXJNgM','2822792hEfKBd','508708RrUdzW','887607vPHnkO','site','segment:fields','5906216DPnjMU','name','description','756900cSoTwx','segment','verbose','\x27...','Error:\x20Parent\x20segment\x20name\x20is\x20required','length','error','jsonl','✔\x20Found\x20','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'];a40_0x37c5=function(){return _0x3e238e;};return a40_0x37c5();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a40_0x40a4(_0x5a6bdc,_0x2b7fda){_0x5a6bdc=_0x5a6bdc-0x192;const _0x37c585=a40_0x37c5();let _0x40a473=_0x37c585[_0x5a6bdc];return _0x40a473;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a40_0x902c3d(0x19b)]=a40_0x902c3d(0x199);[a40_0x902c3d(0x19c)]=a40_0x902c3d(0x1a6);async['execute'](_0x36187e){const _0xf47d33=a40_0x902c3d,{options:_0x1abeb4,args:_0x15c7d9,tdx:_0x4d98c4}=_0x36187e,_0x2206cf=_0x15c7d9[0x0]||_0x1abeb4[_0xf47d33(0x193)];if(!_0x2206cf)return console['error'](_0xf47d33(0x1a1)),console[_0xf47d33(0x1a3)](_0xf47d33(0x1a7)),console[_0xf47d33(0x1a3)](_0xf47d33(0x1a8)),0x1;_0x1abeb4[_0xf47d33(0x19f)]&&(console[_0xf47d33(0x1a3)]('Site:\x20'+_0x1abeb4[_0xf47d33(0x198)]),console[_0xf47d33(0x1a3)]('Parent\x20segment:\x20'+_0x2206cf));const _0x34406d=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x2206cf+_0xf47d33(0x1a0),()=>_0x4d98c4[_0xf47d33(0x19e)][_0xf47d33(0x192)](_0x2206cf),{'verbose':_0x1abeb4[_0xf47d33(0x19f)]}),_0x328cc5=_0x34406d['data'];console[_0xf47d33(0x1a3)](_0xf47d33(0x1a5)+_0x328cc5[_0xf47d33(0x1a2)]+_0xf47d33(0x1a9)+(_0x328cc5['length']!==0x1?'s':''));if(_0x1abeb4['json']||_0x1abeb4[_0xf47d33(0x1a4)])return await handleSDKOutput(_0x328cc5,_0x1abeb4),0x0;return displayFieldsHumanReadable(_0x328cc5,_0x2206cf),0x0;}}
|