@treasuredata/tdx 0.26.7 → 0.27.1
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.d.ts +4 -2
- package/dist/commands/claude-statusline-command.d.ts.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-statusline-command.js.map +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/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts +52 -0
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +2 -2
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/passthrough-server.d.ts +18 -3
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +20 -2
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/proxy/sse-usage-parser.js.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +94 -2
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/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.d.ts +149 -2
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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.d.ts +0 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +2 -2
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.map +1 -1
- package/dist/sdk/segment/journey-validator.d.ts +3 -0
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/pull-workflow.js.map +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts +21 -3
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +10 -1
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +188 -16
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +3 -3
- package/dist/utils/port.d.ts +0 -18
- package/dist/utils/port.d.ts.map +0 -1
- package/dist/utils/port.js +0 -1
- package/dist/utils/port.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x2177e5=a23_0x58cc;(function(_0x4173a1,_0xc252dc){const _0xaa3515=a23_0x58cc,_0xef9bab=_0x4173a1();while(!![]){try{const _0x1c194e=parseInt(_0xaa3515(0x182))/0x1*(parseInt(_0xaa3515(0x1ef))/0x2)+parseInt(_0xaa3515(0x1b1))/0x3*(-parseInt(_0xaa3515(0x1a3))/0x4)+parseInt(_0xaa3515(0x183))/0x5*(-parseInt(_0xaa3515(0x1bd))/0x6)+parseInt(_0xaa3515(0x19c))/0x7*(-parseInt(_0xaa3515(0x187))/0x8)+parseInt(_0xaa3515(0x1d2))/0x9*(-parseInt(_0xaa3515(0x1ec))/0xa)+parseInt(_0xaa3515(0x1c1))/0xb*(parseInt(_0xaa3515(0x1dc))/0xc)+parseInt(_0xaa3515(0x192))/0xd;if(_0x1c194e===_0xc252dc)break;else _0xef9bab['push'](_0xef9bab['shift']());}catch(_0x5ca846){_0xef9bab['push'](_0xef9bab['shift']());}}}(a23_0x26e5,0x3ee33));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 a23_0x2fdafd from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}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 a23_0x3336ce from'prompts';import a23_0x2d4229 from'chalk';function validateProfileName(_0x52d703){const _0x3a8509=a23_0x58cc;if(!_0x52d703||!_0x52d703[_0x3a8509(0x1ee)]())return _0x3a8509(0x1a1);const _0x532c42=_0x52d703[_0x3a8509(0x1ee)]();if(!/^[a-zA-Z0-9_-]+$/[_0x3a8509(0x1ad)](_0x532c42))return'Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore';if(profileExists(_0x532c42))return _0x3a8509(0x1d9)+_0x532c42+'\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.';return!![];}export class ProfileCreateCommand extends BaseCommand{['name']=a23_0x2177e5(0x1a0);[a23_0x2177e5(0x1e5)]=a23_0x2177e5(0x1cd);async[a23_0x2177e5(0x1af)](_0x2b558d){const _0x3936c1=a23_0x2177e5,{options:_0x35e1d9,args:_0x304ac9}=_0x2b558d;console['log'](a23_0x2d4229[_0x3936c1(0x18c)](_0x3936c1(0x1aa)));let _0x31e123;if(_0x304ac9[_0x3936c1(0x185)]>0x0&&_0x304ac9[0x0]){const _0x4b4f6b=_0x304ac9[0x0]['trim'](),_0x5eba93=validateProfileName(_0x4b4f6b);if(_0x5eba93!==!![])return console[_0x3936c1(0x19b)](a23_0x2d4229[_0x3936c1(0x1c8)](_0x5eba93)),0x1;_0x31e123=_0x4b4f6b;}else{const _0x52d3ad=await a23_0x3336ce({'type':_0x3936c1(0x1c0),'name':_0x3936c1(0x1b0),'message':_0x3936c1(0x1eb),'validate':validateProfileName});if(!_0x52d3ad[_0x3936c1(0x1b0)])return console[_0x3936c1(0x1dd)]('\x0aSetup\x20cancelled'),0x1;_0x31e123=_0x52d3ad[_0x3936c1(0x1b0)][_0x3936c1(0x1ee)]();}const _0x330023=await a23_0x3336ce({'type':_0x3936c1(0x1c0),'name':_0x3936c1(0x1e5),'message':_0x3936c1(0x1a4)}),_0x3a1b34=_0x330023[_0x3936c1(0x1e5)]?.[_0x3936c1(0x1ee)]()||undefined,_0x4df6c3=_0x35e1d9[_0x3936c1(0x1e1)]||_0x3936c1(0x1e2),{choices:_0x1598fa,initialIndex:_0x3f5176}=buildSiteChoices(_0x4df6c3),_0x3865cf=await a23_0x3336ce({'type':_0x3936c1(0x1e4),'name':'site','message':_0x3936c1(0x190)+_0x31e123+'\x27:','choices':_0x1598fa,'initial':_0x3f5176});if(!_0x3865cf[_0x3936c1(0x1e1)])return console[_0x3936c1(0x1dd)](_0x3936c1(0x1b3)),0x1;let _0x2e6e3d;if(_0x3865cf[_0x3936c1(0x1e1)]===_0x3936c1(0x188)){const _0x28263e=await a23_0x3336ce({'type':'text','name':_0x3936c1(0x1e7),'message':_0x3936c1(0x18e),'initial':_0x3936c1(0x1e2),'validate':_0x393650=>{const _0x3ba7bf=_0x3936c1;if(!_0x393650||!_0x393650['trim']())return _0x3ba7bf(0x1d4);if(!/^[a-z0-9-]+$/['test'](_0x393650[_0x3ba7bf(0x1ee)]()))return _0x3ba7bf(0x1a8);return!![];}});if(!_0x28263e['customSite'])return console[_0x3936c1(0x1dd)](_0x3936c1(0x1b3)),0x1;_0x2e6e3d=_0x28263e[_0x3936c1(0x1e7)];}else _0x2e6e3d=_0x3865cf['site'];const _0x170ab7=resolveSite(_0x2e6e3d);console[_0x3936c1(0x1dd)](_0x3936c1(0x1ab)+_0x170ab7),console[_0x3936c1(0x1dd)](_0x3936c1(0x1b2)),console['log']('\x20\x20'+getConsoleUrl(_0x170ab7,_0x3936c1(0x1d8)));const _0x3753f3=await a23_0x3336ce({'type':_0x3936c1(0x181),'name':_0x3936c1(0x1a6),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x37df0f=>{const _0x17c9d8=_0x3936c1;if(!_0x37df0f||!_0x37df0f[_0x17c9d8(0x1ee)]())return _0x17c9d8(0x18a);return!![];}});if(!_0x3753f3['apiKey'])return console[_0x3936c1(0x1dd)](_0x3936c1(0x1b3)),0x1;const _0x4ce8b0=_0x3753f3['apiKey'];console[_0x3936c1(0x1dd)]('Validating\x20API\x20key...');try{const _0x52ea19=TDX['create']({'site':_0x170ab7,'apiKey':_0x4ce8b0[_0x3936c1(0x1ee)](),'logLevel':_0x35e1d9[_0x3936c1(0x1cb)]??LogLevel[_0x3936c1(0x1c4)]}),_0x435c56=await _0x52ea19[_0x3936c1(0x1da)][_0x3936c1(0x1bf)]();console[_0x3936c1(0x1dd)](a23_0x2d4229[_0x3936c1(0x199)]('✓')+_0x3936c1(0x1e8)+_0x435c56[_0x3936c1(0x193)]+')');const _0x235c1b=await isKeychainAvailable();_0x235c1b?(await saveAPIKeyAsync(_0x4ce8b0['trim'](),_0x170ab7,_0x31e123),console[_0x3936c1(0x1dd)](a23_0x2d4229[_0x3936c1(0x199)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x31e123+')')):(console['warn'](a23_0x2d4229[_0x3936c1(0x1c3)](_0x3936c1(0x1b6))),console[_0x3936c1(0x1d0)](a23_0x2d4229[_0x3936c1(0x1c3)](_0x3936c1(0x1c5))));const _0x9886b5={'site':_0x170ab7,..._0x3a1b34&&{'description':_0x3a1b34}};return saveProfileToUserConfig(_0x31e123,_0x9886b5),console[_0x3936c1(0x1dd)](a23_0x2d4229[_0x3936c1(0x199)]('✓')+_0x3936c1(0x1f0)+_0x31e123+'\x27\x20created'),console[_0x3936c1(0x1dd)](),console[_0x3936c1(0x1dd)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x3936c1(0x1dd)](_0x3936c1(0x1b9)+_0x31e123+_0x3936c1(0x1a7)),console['log'](_0x3936c1(0x1b9)+_0x31e123+_0x3936c1(0x186)),0x0;}catch(_0x1aa948){if(_0x1aa948 instanceof HTTPClientError&&_0x1aa948['status']===0x191)return printAuthError(_0x1aa948),0x1;return console[_0x3936c1(0x19b)](a23_0x2d4229['red'](_0x3936c1(0x1ba)+(_0x1aa948 instanceof Error?_0x1aa948[_0x3936c1(0x1d7)]:String(_0x1aa948)))),console[_0x3936c1(0x19b)]('Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.'),0x1;}}}function a23_0x58cc(_0x5161cf,_0x1aa226){_0x5161cf=_0x5161cf-0x181;const _0x26e5f4=a23_0x26e5();let _0x58ccd2=_0x26e5f4[_0x5161cf];return _0x58ccd2;}export class ProfileRemoveCommand extends BaseCommand{['name']=a23_0x2177e5(0x18b);[a23_0x2177e5(0x1e5)]='Remove\x20a\x20profile';[a23_0x2177e5(0x191)](_0x40e4c1){const _0x222d1a=a23_0x2177e5,{args:_0x1a485a}=_0x40e4c1;if(_0x1a485a[_0x222d1a(0x185)]===0x0)return _0x222d1a(0x184);return undefined;}async['execute'](_0x264d27){const _0x56b1b6=a23_0x2177e5,{args:_0x4af1b1}=_0x264d27,_0x4a5351=_0x4af1b1[0x0];console[_0x56b1b6(0x1dd)](a23_0x2d4229[_0x56b1b6(0x18c)](_0x56b1b6(0x198)));if(!profileExists(_0x4a5351)){console[_0x56b1b6(0x19b)](a23_0x2d4229[_0x56b1b6(0x1c8)](_0x56b1b6(0x1d9)+_0x4a5351+_0x56b1b6(0x1b5))),console[_0x56b1b6(0x1dd)]('\x0aAvailable\x20profiles:');const _0x23369f=listProfiles();if(_0x23369f['length']===0x0)console[_0x56b1b6(0x1dd)](_0x56b1b6(0x1e9));else for(const _0x413e43 of _0x23369f){console[_0x56b1b6(0x1dd)](_0x56b1b6(0x1d5)+_0x413e43[_0x56b1b6(0x1db)]);}return 0x1;}const _0x1df4ba=await a23_0x3336ce({'type':_0x56b1b6(0x1d6),'name':_0x56b1b6(0x1d6),'message':_0x56b1b6(0x1bb)+_0x4a5351+'\x27?','initial':![]});if(!_0x1df4ba[_0x56b1b6(0x1d6)])return console[_0x56b1b6(0x1dd)](_0x56b1b6(0x1ca)),0x0;try{removeProfileFromUserConfig(_0x4a5351),console[_0x56b1b6(0x1dd)](a23_0x2d4229[_0x56b1b6(0x199)]('✓')+_0x56b1b6(0x1f0)+_0x4a5351+_0x56b1b6(0x18d));}catch(_0x211a73){return console[_0x56b1b6(0x19b)](a23_0x2d4229['red'](_0x56b1b6(0x1ea)+(_0x211a73 instanceof Error?_0x211a73[_0x56b1b6(0x1d7)]:String(_0x211a73)))),0x1;}const _0x105457=await isKeychainAvailable();if(_0x105457){const _0x32000c=await deleteKeychainAPIKey(_0x4a5351);_0x32000c&&console[_0x56b1b6(0x1dd)](a23_0x2d4229[_0x56b1b6(0x199)]('✓')+_0x56b1b6(0x19f));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{['name']='profile:set';['description']=a23_0x2177e5(0x1e6);static ['VALID_KEYS']=[a23_0x2177e5(0x1e1),a23_0x2177e5(0x1c2),a23_0x2177e5(0x1d3),'llm_project',a23_0x2177e5(0x1b8),'description'];[a23_0x2177e5(0x191)](_0x3337f7){const _0x2aad48=a23_0x2177e5,{args:_0x25af0a,options:_0x290ac7}=_0x3337f7,_0x1e52fa=_0x290ac7[_0x2aad48(0x19d)]||getActiveProfile();if(!_0x1e52fa)return'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>';if(_0x25af0a[_0x2aad48(0x185)]===0x0)return _0x2aad48(0x1ce)+ProfileSetCommand['VALID_KEYS'][_0x2aad48(0x1df)](',\x20');const _0x904c9a=_0x25af0a[0x0];if(!_0x904c9a['includes']('='))return _0x2aad48(0x1c9)+ProfileSetCommand[_0x2aad48(0x1d1)][_0x2aad48(0x1df)](',\x20');const [_0x25ece2]=_0x904c9a[_0x2aad48(0x1e0)]('=',0x2);if(!ProfileSetCommand[_0x2aad48(0x1d1)]['includes'](_0x25ece2))return _0x2aad48(0x196)+_0x25ece2+_0x2aad48(0x1c7)+ProfileSetCommand[_0x2aad48(0x1d1)][_0x2aad48(0x1df)](',\x20');return undefined;}async[a23_0x2177e5(0x1af)](_0x3fd3b6){const _0x2722b3=a23_0x2177e5,{args:_0x25e5b3,options:_0x28d576}=_0x3fd3b6,_0x42e9e7=_0x28d576[_0x2722b3(0x19d)]||getActiveProfile(),[_0x2527ac,..._0x17fda9]=_0x25e5b3[0x0][_0x2722b3(0x1e0)]('='),_0x3abf45=_0x17fda9[_0x2722b3(0x1df)]('=');console[_0x2722b3(0x1dd)](a23_0x2d4229[_0x2722b3(0x18c)](_0x2722b3(0x1f1)));if(!profileExists(_0x42e9e7)){const _0x158594=await a23_0x3336ce({'type':'confirm','name':_0x2722b3(0x1cc),'message':_0x2722b3(0x1d9)+_0x42e9e7+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x158594[_0x2722b3(0x1cc)])return console['log']('Operation\x20cancelled'),0x1;}const _0x296c9=loadProfile(_0x42e9e7),_0x459dce=_0x296c9?.['config']||{};if(_0x2527ac===_0x2722b3(0x1e1)){const _0x150bc6=resolveSite(_0x3abf45);console['log'](_0x2722b3(0x19e)+_0x150bc6+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0x2722b3(0x1dd)](_0x2722b3(0x19a)),console[_0x2722b3(0x1dd)]('\x20\x20'+getConsoleUrl(_0x150bc6,_0x2722b3(0x1d8)));const _0x21ed8a=await a23_0x3336ce({'type':_0x2722b3(0x181),'name':'apiKey','message':_0x2722b3(0x1be),'validate':_0x4dc0b7=>{const _0x3580e7=_0x2722b3;if(!_0x4dc0b7||!_0x4dc0b7[_0x3580e7(0x1ee)]())return _0x3580e7(0x18a);return!![];}});if(!_0x21ed8a[_0x2722b3(0x1a6)])return console['log']('\x0aOperation\x20cancelled'),0x1;console['log'](_0x2722b3(0x195));try{const _0x39b2a7=TDX['create']({'site':_0x150bc6,'apiKey':_0x21ed8a['apiKey'][_0x2722b3(0x1ee)](),'logLevel':_0x28d576[_0x2722b3(0x1cb)]??LogLevel[_0x2722b3(0x1c4)]}),_0x22e951=await _0x39b2a7[_0x2722b3(0x1da)][_0x2722b3(0x1bf)]();console[_0x2722b3(0x1dd)](a23_0x2d4229[_0x2722b3(0x199)]('✓')+_0x2722b3(0x1e8)+_0x22e951['email']+')');const _0x28e879=await isKeychainAvailable();_0x28e879?(await saveAPIKeyAsync(_0x21ed8a['apiKey'][_0x2722b3(0x1ee)](),_0x150bc6,_0x42e9e7),console[_0x2722b3(0x1dd)](a23_0x2d4229[_0x2722b3(0x199)]('✓')+_0x2722b3(0x1a5))):console[_0x2722b3(0x1d0)](a23_0x2d4229[_0x2722b3(0x1c3)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x459dce[_0x2722b3(0x1e1)]=_0x150bc6;}catch(_0x46fbf8){if(_0x46fbf8 instanceof HTTPClientError&&_0x46fbf8[_0x2722b3(0x1de)]===0x191)return printAuthError(_0x46fbf8),0x1;return console[_0x2722b3(0x19b)](a23_0x2d4229[_0x2722b3(0x1c8)](_0x2722b3(0x1ba)+(_0x46fbf8 instanceof Error?_0x46fbf8['message']:String(_0x46fbf8)))),console['error'](_0x2722b3(0x1e3)),0x1;}}else _0x459dce[_0x2527ac]=_0x3abf45||undefined;return saveProfileToUserConfig(_0x42e9e7,_0x459dce),console['log'](a23_0x2d4229[_0x2722b3(0x199)]('✓')+'\x20Profile\x20\x27'+_0x42e9e7+_0x2722b3(0x1cf)+_0x2527ac+'='+(_0x3abf45||_0x2722b3(0x189))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a23_0x2177e5(0x1db)]=a23_0x2177e5(0x1ae);[a23_0x2177e5(0x1e5)]='Set\x20session\x20profile';[a23_0x2177e5(0x191)](_0x30306c){const _0x237b4f=a23_0x2177e5,{args:_0x54e512}=_0x30306c;if(_0x54e512['length']===0x0)return _0x237b4f(0x197);return undefined;}async[a23_0x2177e5(0x1af)](_0x34cacf){const _0x358575=a23_0x2177e5,{args:_0x2f99b5,options:_0x577762}=_0x34cacf,_0x394229=_0x2f99b5[0x0],_0x52f78e=_0x577762[_0x358575(0x194)];cleanExpiredSessions();if(!profileExists(_0x394229)){console[_0x358575(0x19b)](a23_0x2d4229[_0x358575(0x1c8)](_0x358575(0x1d9)+_0x394229+_0x358575(0x1b5))),console[_0x358575(0x1dd)](_0x358575(0x1ac));const _0x227912=listProfiles();if(_0x227912[_0x358575(0x185)]===0x0)console[_0x358575(0x1dd)](_0x358575(0x1e9));else for(const _0x3f48db of _0x227912){console[_0x358575(0x1dd)](_0x358575(0x1d5)+_0x3f48db[_0x358575(0x1db)]);}return 0x1;}if(_0x52f78e){const _0xfdc40e=a23_0x2fdafd[_0x358575(0x1df)](getConfigDir(),_0x358575(0x1a2));return saveActiveProfileToUserConfig(_0x394229),console[_0x358575(0x1dd)](_0x358575(0x1bc)+a23_0x2d4229[_0x358575(0x199)](_0x394229)),console[_0x358575(0x1dd)](a23_0x2d4229[_0x358575(0x1ed)](_0x358575(0x1a9)+_0xfdc40e)),0x0;}const _0x439cfc=getSessionID(_0x577762[_0x358575(0x18f)]);return saveSessionContext({'profile':_0x394229},_0x577762[_0x358575(0x18f)]),console[_0x358575(0x1dd)](_0x358575(0x1c6)+a23_0x2d4229[_0x358575(0x199)](_0x394229)+'\x20'+a23_0x2d4229[_0x358575(0x1ed)](_0x358575(0x1b4)+_0x439cfc+')')),console[_0x358575(0x1dd)](a23_0x2d4229[_0x358575(0x1ed)](_0x358575(0x1b7)+_0x394229+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}function a23_0x26e5(){const _0x2c2010=['Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Removal\x20cancelled','logLevel','create','Create\x20a\x20new\x20profile','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x27\x20updated:\x20','warn','VALID_KEYS','9aFdJkP','parent_segment','Site\x20name\x20cannot\x20be\x20empty','\x20\x20-\x20','confirm','message','/app/mp/ak','Profile\x20\x27','jobs','name','72VIjWfe','log','status','join','split','site','us01','Site\x20was\x20not\x20changed.','select','description','Set\x20a\x20profile\x20configuration\x20value','customSite','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20\x20(no\x20profiles\x20found)','Failed\x20to\x20remove\x20profile:\x20','Enter\x20profile\x20name:','4336530dlAodU','dim','trim','22qgikcb','\x20Profile\x20\x27','tdx:\x20profile\x20set','password','28169pXJEQT','82105fYlrAI','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','length','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','187448QCHVqo','other','(cleared)','API\x20key\x20cannot\x20be\x20empty','profile:remove','bold','\x27\x20removed\x20from\x20configuration','Enter\x20site\x20name:','session','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','validate','11243830hzwjGc','email','default','Validating\x20API\x20key...','Unknown\x20key\x20\x27','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','tdx:\x20profile\x20remove','green','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','error','91vDbBKf','profile','Changing\x20site\x20to\x20\x27','\x20API\x20key\x20removed\x20from\x20system\x20keychain','profile:create','Profile\x20name\x20cannot\x20be\x20empty','tdx.json','4McmJPw','Enter\x20description\x20(optional):','\x20API\x20key\x20saved\x20to\x20system\x20keychain','apiKey','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x0aSaved\x20to:\x20','tdx:\x20profile\x20create','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','\x0aAvailable\x20profiles:','test','profile:use','execute','profileName','66435MclNSb','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x0aSetup\x20cancelled','(session:\x20','\x27\x20does\x20not\x20exist.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','llm_agent','\x20\x20tdx\x20--profile\x20','✗\x20Validation\x20failed:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','Default\x20profile\x20set\x20to:\x20','66xHueTt','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','getUserInfo','text','43725DYwkpl','database','yellow','ERROR','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Session\x20profile\x20set\x20to:\x20','\x27.\x0a\x0aValid\x20keys:\x20','red'];a23_0x26e5=function(){return _0x2c2010;};return a23_0x26e5();}
|
|
1
|
+
function a23_0x4e7f(){const _0x36fc1f=['Unknown\x20key\x20\x27','2034840DcHHno','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','tdx:\x20profile\x20remove','Default\x20profile\x20set\x20to:\x20','Validating\x20API\x20key...','validate','profile:create','confirm','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','\x0aSaved\x20to:\x20','join','length','Enter\x20description\x20(optional):','/app/mp/ak','jobs','\x27\x20does\x20not\x20exist.\x20Create\x20it?','VALID_KEYS','profile:use','name','us01','2591372Tytzoq','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','database','message','green','\x20\x20(no\x20profiles\x20found)','site','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','49955420aIckES','profileName','\x27\x20does\x20not\x20exist.','config','dim','getUserInfo','27486ZndJHN','Removal\x20cancelled','6AyqbKS','\x0aAvailable\x20profiles:','apiKey','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','llm_project','red','2768VrtNkf','tdx.json','split','logLevel','default','Failed\x20to\x20remove\x20profile:\x20','trim','yellow','log','Site\x20was\x20not\x20changed.','API\x20key\x20cannot\x20be\x20empty','status','customSite','bold','(session:\x20','Remove\x20a\x20profile','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','Operation\x20cancelled','\x0aSetup\x20cancelled','\x27\x20created','profile','Profile\x20\x27','llm_agent','1qjqyyM','\x27.\x0a\x0aValid\x20keys:\x20','password','Session\x20profile\x20set\x20to:\x20','parent_segment','other','profile:set','Profile\x20name\x20cannot\x20be\x20empty','967629cUwUxz','Create\x20a\x20new\x20profile','3773568EoLKKq','\x27\x20updated:\x20','\x20\x20tdx\x20--profile\x20','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','test','create','description','\x20--default\x27\x20to\x20save\x20permanently','text','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','ERROR','email','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','profile:remove','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','You\x20can\x20find\x20your\x20API\x20key\x20at:','select','error','\x20API\x20key\x20removed\x20from\x20system\x20keychain','3607945VmFrrR','warn','\x27\x20removed\x20from\x20configuration','\x27\x20requires\x20API\x20key\x20validation.','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','\x20Profile\x20\x27','session','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','tdx:\x20profile\x20create','Enter\x20your\x20TD\x20API\x20key:','Enter\x20profile\x20name:','includes','execute','✗\x20Validation\x20failed:\x20'];a23_0x4e7f=function(){return _0x36fc1f;};return a23_0x4e7f();}const a23_0x22f566=a23_0x250d;(function(_0x66658c,_0x9ece3c){const _0x23e371=a23_0x250d,_0x5103ff=_0x66658c();while(!![]){try{const _0x425304=-parseInt(_0x23e371(0x13c))/0x1*(parseInt(_0x23e371(0x16a))/0x2)+-parseInt(_0x23e371(0x144))/0x3+-parseInt(_0x23e371(0x146))/0x4+parseInt(_0x23e371(0x159))/0x5*(-parseInt(_0x23e371(0x11e))/0x6)+-parseInt(_0x23e371(0x17e))/0x7+parseInt(_0x23e371(0x125))/0x8*(-parseInt(_0x23e371(0x11c))/0x9)+parseInt(_0x23e371(0x186))/0xa;if(_0x425304===_0x9ece3c)break;else _0x5103ff['push'](_0x5103ff['shift']());}catch(_0x4950e4){_0x5103ff['push'](_0x5103ff['shift']());}}}(a23_0x4e7f,0x89a06));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';function a23_0x250d(_0x1777c4,_0x220d40){_0x1777c4=_0x1777c4-0x118;const _0x4e7f78=a23_0x4e7f();let _0x250df2=_0x4e7f78[_0x1777c4];return _0x250df2;}import{getConfigDir}from'../core/config.js';import*as a23_0x29375f from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}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 a23_0x40b577 from'prompts';import a23_0x36263b from'chalk';function validateProfileName(_0x5c7af1){const _0x50f779=a23_0x250d;if(!_0x5c7af1||!_0x5c7af1[_0x50f779(0x12b)]())return _0x50f779(0x143);const _0x4c5b05=_0x5c7af1[_0x50f779(0x12b)]();if(!/^[a-zA-Z0-9_-]+$/[_0x50f779(0x14a)](_0x4c5b05))return _0x50f779(0x15d);if(profileExists(_0x4c5b05))return _0x50f779(0x13a)+_0x4c5b05+_0x50f779(0x154);return!![];}export class ProfileCreateCommand extends BaseCommand{['name']=a23_0x22f566(0x170);[a23_0x22f566(0x14c)]=a23_0x22f566(0x145);async[a23_0x22f566(0x167)](_0x36e968){const _0x228d30=a23_0x22f566,{options:_0x378376,args:_0x1860e7}=_0x36e968;console[_0x228d30(0x12d)](a23_0x36263b['bold'](_0x228d30(0x163)));let _0x102c36;if(_0x1860e7['length']>0x0&&_0x1860e7[0x0]){const _0x44f671=_0x1860e7[0x0][_0x228d30(0x12b)](),_0x2e49b7=validateProfileName(_0x44f671);if(_0x2e49b7!==!![])return console[_0x228d30(0x157)](a23_0x36263b[_0x228d30(0x124)](_0x2e49b7)),0x1;_0x102c36=_0x44f671;}else{const _0x5ace13=await a23_0x40b577({'type':'text','name':_0x228d30(0x187),'message':_0x228d30(0x165),'validate':validateProfileName});if(!_0x5ace13[_0x228d30(0x187)])return console['log'](_0x228d30(0x137)),0x1;_0x102c36=_0x5ace13[_0x228d30(0x187)][_0x228d30(0x12b)]();}const _0xab9423=await a23_0x40b577({'type':'text','name':_0x228d30(0x14c),'message':_0x228d30(0x176)}),_0x397745=_0xab9423['description']?.[_0x228d30(0x12b)]()||undefined,_0x16ea12=_0x378376[_0x228d30(0x184)]||_0x228d30(0x17d),{choices:_0x1a765a,initialIndex:_0x53e769}=buildSiteChoices(_0x16ea12),_0x37a10e=await a23_0x40b577({'type':_0x228d30(0x156),'name':_0x228d30(0x184),'message':_0x228d30(0x162)+_0x102c36+'\x27:','choices':_0x1a765a,'initial':_0x53e769});if(!_0x37a10e[_0x228d30(0x184)])return console[_0x228d30(0x12d)](_0x228d30(0x137)),0x1;let _0x33a7bf;if(_0x37a10e[_0x228d30(0x184)]===_0x228d30(0x141)){const _0x1dbea1=await a23_0x40b577({'type':_0x228d30(0x14e),'name':'customSite','message':'Enter\x20site\x20name:','initial':_0x228d30(0x17d),'validate':_0x130681=>{const _0x330839=_0x228d30;if(!_0x130681||!_0x130681[_0x330839(0x12b)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0x130681[_0x330839(0x12b)]()))return _0x330839(0x16b);return!![];}});if(!_0x1dbea1[_0x228d30(0x131)])return console[_0x228d30(0x12d)]('\x0aSetup\x20cancelled'),0x1;_0x33a7bf=_0x1dbea1['customSite'];}else _0x33a7bf=_0x37a10e[_0x228d30(0x184)];const _0x5e87be=resolveSite(_0x33a7bf);console[_0x228d30(0x12d)](_0x228d30(0x149)+_0x5e87be),console[_0x228d30(0x12d)](_0x228d30(0x155)),console[_0x228d30(0x12d)]('\x20\x20'+getConsoleUrl(_0x5e87be,_0x228d30(0x177)));const _0x54f600=await a23_0x40b577({'type':_0x228d30(0x13e),'name':_0x228d30(0x120),'message':_0x228d30(0x164),'validate':_0x17690d=>{const _0x39c9fb=_0x228d30;if(!_0x17690d||!_0x17690d[_0x39c9fb(0x12b)]())return _0x39c9fb(0x12f);return!![];}});if(!_0x54f600[_0x228d30(0x120)])return console['log'](_0x228d30(0x137)),0x1;const _0x5a4703=_0x54f600[_0x228d30(0x120)];console[_0x228d30(0x12d)](_0x228d30(0x16e));try{const _0x322679=TDX[_0x228d30(0x14b)]({'site':_0x5e87be,'apiKey':_0x5a4703[_0x228d30(0x12b)](),'logLevel':_0x378376[_0x228d30(0x128)]??LogLevel[_0x228d30(0x150)]}),_0x56d7e4=await _0x322679[_0x228d30(0x178)][_0x228d30(0x11b)]();console[_0x228d30(0x12d)](a23_0x36263b[_0x228d30(0x182)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x56d7e4[_0x228d30(0x151)]+')');const _0x6f3894=await isKeychainAvailable();_0x6f3894?(await saveAPIKeyAsync(_0x5a4703['trim'](),_0x5e87be,_0x102c36),console[_0x228d30(0x12d)](a23_0x36263b[_0x228d30(0x182)]('✓')+_0x228d30(0x185)+_0x102c36+')')):(console['warn'](a23_0x36263b[_0x228d30(0x12c)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x228d30(0x15a)](a23_0x36263b['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x4e0291={'site':_0x5e87be,..._0x397745&&{'description':_0x397745}};return saveProfileToUserConfig(_0x102c36,_0x4e0291),console[_0x228d30(0x12d)](a23_0x36263b['green']('✓')+_0x228d30(0x15e)+_0x102c36+_0x228d30(0x138)),console[_0x228d30(0x12d)](),console[_0x228d30(0x12d)](_0x228d30(0x122)),console[_0x228d30(0x12d)](_0x228d30(0x148)+_0x102c36+_0x228d30(0x160)),console[_0x228d30(0x12d)](_0x228d30(0x148)+_0x102c36+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2de764){if(_0x2de764 instanceof HTTPClientError&&_0x2de764[_0x228d30(0x130)]===0x191)return printAuthError(_0x2de764),0x1;return console['error'](a23_0x36263b[_0x228d30(0x124)](_0x228d30(0x168)+(_0x2de764 instanceof Error?_0x2de764[_0x228d30(0x181)]:String(_0x2de764)))),console['error'](_0x228d30(0x161)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{['name']=a23_0x22f566(0x153);['description']=a23_0x22f566(0x134);['validate'](_0x42b603){const _0x5eb0a7=a23_0x22f566,{args:_0x32acb9}=_0x42b603;if(_0x32acb9[_0x5eb0a7(0x175)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>';return undefined;}async[a23_0x22f566(0x167)](_0x17ded9){const _0x240ca3=a23_0x22f566,{args:_0x15b20a}=_0x17ded9,_0x44302c=_0x15b20a[0x0];console[_0x240ca3(0x12d)](a23_0x36263b[_0x240ca3(0x132)](_0x240ca3(0x16c)));if(!profileExists(_0x44302c)){console['error'](a23_0x36263b['red'](_0x240ca3(0x13a)+_0x44302c+'\x27\x20does\x20not\x20exist.')),console[_0x240ca3(0x12d)](_0x240ca3(0x11f));const _0x5844c6=listProfiles();if(_0x5844c6[_0x240ca3(0x175)]===0x0)console[_0x240ca3(0x12d)](_0x240ca3(0x183));else for(const _0x3e5ac5 of _0x5844c6){console[_0x240ca3(0x12d)]('\x20\x20-\x20'+_0x3e5ac5[_0x240ca3(0x17c)]);}return 0x1;}const _0x5eda82=await a23_0x40b577({'type':'confirm','name':_0x240ca3(0x171),'message':_0x240ca3(0x121)+_0x44302c+'\x27?','initial':![]});if(!_0x5eda82[_0x240ca3(0x171)])return console[_0x240ca3(0x12d)](_0x240ca3(0x11d)),0x0;try{removeProfileFromUserConfig(_0x44302c),console[_0x240ca3(0x12d)](a23_0x36263b[_0x240ca3(0x182)]('✓')+'\x20Profile\x20\x27'+_0x44302c+_0x240ca3(0x15b));}catch(_0x142bb5){return console['error'](a23_0x36263b[_0x240ca3(0x124)](_0x240ca3(0x12a)+(_0x142bb5 instanceof Error?_0x142bb5['message']:String(_0x142bb5)))),0x1;}const _0x435a7d=await isKeychainAvailable();if(_0x435a7d){const _0x7af2ba=await deleteKeychainAPIKey(_0x44302c);_0x7af2ba&&console[_0x240ca3(0x12d)](a23_0x36263b[_0x240ca3(0x182)]('✓')+_0x240ca3(0x158));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a23_0x22f566(0x17c)]=a23_0x22f566(0x142);[a23_0x22f566(0x14c)]='Set\x20a\x20profile\x20configuration\x20value';static [a23_0x22f566(0x17a)]=[a23_0x22f566(0x184),a23_0x22f566(0x180),a23_0x22f566(0x140),a23_0x22f566(0x123),a23_0x22f566(0x13b),a23_0x22f566(0x14c)];[a23_0x22f566(0x16f)](_0x1b0871){const _0x51020b=a23_0x22f566,{args:_0x1b29f0,options:_0x263fda}=_0x1b0871,_0x88f629=_0x263fda[_0x51020b(0x139)]||getActiveProfile();if(!_0x88f629)return'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>';if(_0x1b29f0[_0x51020b(0x175)]===0x0)return _0x51020b(0x14f)+ProfileSetCommand[_0x51020b(0x17a)][_0x51020b(0x174)](',\x20');const _0x3c15e9=_0x1b29f0[0x0];if(!_0x3c15e9[_0x51020b(0x166)]('='))return _0x51020b(0x17f)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');const [_0x21928f]=_0x3c15e9[_0x51020b(0x127)]('=',0x2);if(!ProfileSetCommand['VALID_KEYS'][_0x51020b(0x166)](_0x21928f))return _0x51020b(0x169)+_0x21928f+_0x51020b(0x13d)+ProfileSetCommand[_0x51020b(0x17a)][_0x51020b(0x174)](',\x20');return undefined;}async['execute'](_0x5be231){const _0x476c48=a23_0x22f566,{args:_0x4bc5da,options:_0x2a3916}=_0x5be231,_0x3fae83=_0x2a3916[_0x476c48(0x139)]||getActiveProfile(),[_0xcae45b,..._0x25c424]=_0x4bc5da[0x0][_0x476c48(0x127)]('='),_0x3393cd=_0x25c424[_0x476c48(0x174)]('=');console['log'](a23_0x36263b[_0x476c48(0x132)]('tdx:\x20profile\x20set'));if(!profileExists(_0x3fae83)){const _0x337e51=await a23_0x40b577({'type':_0x476c48(0x171),'name':'create','message':_0x476c48(0x13a)+_0x3fae83+_0x476c48(0x179),'initial':!![]});if(!_0x337e51[_0x476c48(0x14b)])return console['log'](_0x476c48(0x136)),0x1;}const _0x214499=loadProfile(_0x3fae83),_0x2a4e46=_0x214499?.[_0x476c48(0x119)]||{};if(_0xcae45b==='site'){const _0x27997c=resolveSite(_0x3393cd);console[_0x476c48(0x12d)]('Changing\x20site\x20to\x20\x27'+_0x27997c+_0x476c48(0x15c)),console[_0x476c48(0x12d)]('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x476c48(0x12d)]('\x20\x20'+getConsoleUrl(_0x27997c,_0x476c48(0x177)));const _0x4f6d72=await a23_0x40b577({'type':_0x476c48(0x13e),'name':_0x476c48(0x120),'message':_0x476c48(0x172),'validate':_0x1a3f49=>{const _0x244b50=_0x476c48;if(!_0x1a3f49||!_0x1a3f49[_0x244b50(0x12b)]())return _0x244b50(0x12f);return!![];}});if(!_0x4f6d72[_0x476c48(0x120)])return console[_0x476c48(0x12d)]('\x0aOperation\x20cancelled'),0x1;console[_0x476c48(0x12d)]('Validating\x20API\x20key...');try{const _0x546738=TDX[_0x476c48(0x14b)]({'site':_0x27997c,'apiKey':_0x4f6d72[_0x476c48(0x120)][_0x476c48(0x12b)](),'logLevel':_0x2a3916[_0x476c48(0x128)]??LogLevel[_0x476c48(0x150)]}),_0x4c4739=await _0x546738[_0x476c48(0x178)][_0x476c48(0x11b)]();console[_0x476c48(0x12d)](a23_0x36263b[_0x476c48(0x182)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x4c4739[_0x476c48(0x151)]+')');const _0x10ea23=await isKeychainAvailable();_0x10ea23?(await saveAPIKeyAsync(_0x4f6d72[_0x476c48(0x120)]['trim'](),_0x27997c,_0x3fae83),console[_0x476c48(0x12d)](a23_0x36263b[_0x476c48(0x182)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console['warn'](a23_0x36263b[_0x476c48(0x12c)](_0x476c48(0x152))),_0x2a4e46['site']=_0x27997c;}catch(_0x380f45){if(_0x380f45 instanceof HTTPClientError&&_0x380f45['status']===0x191)return printAuthError(_0x380f45),0x1;return console[_0x476c48(0x157)](a23_0x36263b[_0x476c48(0x124)](_0x476c48(0x168)+(_0x380f45 instanceof Error?_0x380f45['message']:String(_0x380f45)))),console[_0x476c48(0x157)](_0x476c48(0x12e)),0x1;}}else _0x2a4e46[_0xcae45b]=_0x3393cd||undefined;return saveProfileToUserConfig(_0x3fae83,_0x2a4e46),console['log'](a23_0x36263b[_0x476c48(0x182)]('✓')+_0x476c48(0x15e)+_0x3fae83+_0x476c48(0x147)+_0xcae45b+'='+(_0x3393cd||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a23_0x22f566(0x17b);['description']='Set\x20session\x20profile';['validate'](_0xf36bf3){const _0x4c1d66=a23_0x22f566,{args:_0x8f3c3b}=_0xf36bf3;if(_0x8f3c3b[_0x4c1d66(0x175)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async[a23_0x22f566(0x167)](_0x1fb359){const _0x2d3e6a=a23_0x22f566,{args:_0x1af297,options:_0x281e12}=_0x1fb359,_0x4ae6bf=_0x1af297[0x0],_0x129650=_0x281e12[_0x2d3e6a(0x129)];cleanExpiredSessions();if(!profileExists(_0x4ae6bf)){console['error'](a23_0x36263b[_0x2d3e6a(0x124)](_0x2d3e6a(0x13a)+_0x4ae6bf+_0x2d3e6a(0x118))),console[_0x2d3e6a(0x12d)]('\x0aAvailable\x20profiles:');const _0x69726d=listProfiles();if(_0x69726d[_0x2d3e6a(0x175)]===0x0)console[_0x2d3e6a(0x12d)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x40fe61 of _0x69726d){console['log']('\x20\x20-\x20'+_0x40fe61[_0x2d3e6a(0x17c)]);}return 0x1;}if(_0x129650){const _0x4b2ef9=a23_0x29375f[_0x2d3e6a(0x174)](getConfigDir(),_0x2d3e6a(0x126));return saveActiveProfileToUserConfig(_0x4ae6bf),console['log'](_0x2d3e6a(0x16d)+a23_0x36263b[_0x2d3e6a(0x182)](_0x4ae6bf)),console[_0x2d3e6a(0x12d)](a23_0x36263b[_0x2d3e6a(0x11a)](_0x2d3e6a(0x173)+_0x4b2ef9)),0x0;}const _0x3811af=getSessionID(_0x281e12[_0x2d3e6a(0x15f)]);return saveSessionContext({'profile':_0x4ae6bf},_0x281e12[_0x2d3e6a(0x15f)]),console[_0x2d3e6a(0x12d)](_0x2d3e6a(0x13f)+a23_0x36263b['green'](_0x4ae6bf)+'\x20'+a23_0x36263b[_0x2d3e6a(0x11a)](_0x2d3e6a(0x133)+_0x3811af+')')),console[_0x2d3e6a(0x12d)](a23_0x36263b[_0x2d3e6a(0x11a)](_0x2d3e6a(0x135)+_0x4ae6bf+_0x2d3e6a(0x14d))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x541ef4=a24_0x4f30;(function(_0x492e8d,_0x344de6){const _0x390042=a24_0x4f30,_0x1be266=_0x492e8d();while(!![]){try{const _0x5835aa=-parseInt(_0x390042(0x103))/0x1+-parseInt(_0x390042(0x104))/0x2*(parseInt(_0x390042(0x116))/0x3)+parseInt(_0x390042(0x112))/0x4*(parseInt(_0x390042(0x114))/0x5)+-parseInt(_0x390042(0x115))/0x6+-parseInt(_0x390042(0x10d))/0x7*(parseInt(_0x390042(0x10a))/0x8)+parseInt(_0x390042(0x101))/0x9*(-parseInt(_0x390042(0x113))/0xa)+parseInt(_0x390042(0x105))/0xb;if(_0x5835aa===_0x344de6)break;else _0x1be266['push'](_0x1be266['shift']());}catch(_0x320be5){_0x1be266['push'](_0x1be266['shift']());}}}(a24_0x48c3,0xe5dd2));function a24_0x4f30(_0x2b3133,_0x406e58){_0x2b3133=_0x2b3133-0x101;const _0x48c323=a24_0x48c3();let _0x4f304b=_0x48c323[_0x2b3133];return _0x4f304b;}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a24_0x48c3(){const _0x4159f0=['scope','741396LJDgVZ','383246zCAdgX','38938592WUPEFa','name','execute','length','error','1073840ktntEn','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','56XwCzNt','log','config','List\x20all\x20available\x20profiles','message','8bVFgNA','30lIxtYB','3189670BChCKW','6724608mTCKOg','9TesMCF','description','\x20\x20Global:\x20~/.config/tdx/tdx.json','1090035ZNWlbg'];a24_0x48c3=function(){return _0x4159f0;};return a24_0x48c3();}import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a24_0x541ef4(0x106)]='profiles';['description']=a24_0x541ef4(0x110);async[a24_0x541ef4(0x107)](_0x47d488){const _0x37f98d=a24_0x541ef4,{options:_0x215a30}=_0x47d488;try{const _0x43891c=listProfiles(),_0x4f2aaa=getActiveProfile();if(_0x43891c[_0x37f98d(0x108)]===0x0)return console['log'](_0x37f98d(0x10c)),console[_0x37f98d(0x10e)](_0x37f98d(0x10b)),console[_0x37f98d(0x10e)](_0x37f98d(0x118)),0x0;const _0x3a5f4d=_0x43891c['map'](_0x51057b=>{const _0x3546bb=_0x37f98d,_0x56e210=_0x51057b[_0x3546bb(0x106)]===_0x4f2aaa,_0x520754=getProfileParams(_0x51057b['config']);return{'name':_0x51057b[_0x3546bb(0x106)],'active':_0x56e210,'scope':_0x51057b[_0x3546bb(0x102)],'description':_0x51057b[_0x3546bb(0x10f)][_0x3546bb(0x117)]||'','params':_0x520754};});return await handleSDKOutput(_0x3a5f4d,_0x215a30),0x0;}catch(_0x2abfbc){return _0x2abfbc instanceof Error&&console[_0x37f98d(0x109)]('Error:\x20'+_0x2abfbc[_0x37f98d(0x111)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a25_0x1b7097=a25_0x4bcc;function a25_0x4bcc(_0x42acc8,_0x44601b){_0x42acc8=_0x42acc8-0xc3;const _0xba73ef=a25_0xba73();let _0x4bcc6b=_0xba73ef[_0x42acc8];return _0x4bcc6b;}(function(_0x429ad9,_0x592d3e){const _0x125b20=a25_0x4bcc,_0x2ca0f6=_0x429ad9();while(!![]){try{const _0xe4f826=-parseInt(_0x125b20(0xcf))/0x1+parseInt(_0x125b20(0xd2))/0x2+-parseInt(_0x125b20(0xf2))/0x3*(parseInt(_0x125b20(0xd4))/0x4)+parseInt(_0x125b20(0xc8))/0x5+parseInt(_0x125b20(0xe7))/0x6+-parseInt(_0x125b20(0xeb))/0x7+-parseInt(_0x125b20(0xc7))/0x8*(-parseInt(_0x125b20(0xca))/0x9);if(_0xe4f826===_0x592d3e)break;else _0x2ca0f6['push'](_0x2ca0f6['shift']());}catch(_0x6ddf7e){_0x2ca0f6['push'](_0x2ca0f6['shift']());}}}(a25_0xba73,0x7de95));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';function a25_0xba73(){const _0x59ccd4=['\x20splits','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','output','options','\x20[Job\x20ID:\x20','information_schema','Executing\x20query\x20[','join','description','Query\x20completed:\x20Processed\x20','elapsedTimeMillis','totalSplits','Statement\x20','4515150pzZDmg','stats','originalMessage','push','5825932LNERRR','Schema:\x20','file','site','execute','name','catalog','19377qaysLT','Error:\x20','message','setJobId','setPhase','in\x20','database','verbose','args','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','10658720oDkfRb','342330ahqmvJ','query','9VvQXFy','\x20rows\x20','processedRows','No\x20SQL\x20provided','\x20-\x20','984944Hpkzez','length','error','1870650YypyOs','Catalog:\x20','468PvsIrN','Executing\x20statement\x20','jobId','validate','Site:\x20','Executing\x20query...'];a25_0xba73=function(){return _0x59ccd4;};return a25_0xba73();}export class QueryCommand extends BaseCommand{[a25_0x1b7097(0xf0)]='query';[a25_0x1b7097(0xe2)]='Run\x20Trino\x20queries\x20(streaming)';async[a25_0x1b7097(0xef)](_0x62c7e){const _0x43952a=a25_0x1b7097,{options:_0x1ca67c,args:_0x23e521,tdx:_0x308855}=_0x62c7e,_0x41ea32=_0x23e521[0x0],_0x2827e5=_0x1ca67c[_0x43952a(0xed)];let _0x5da501;try{if(_0x2827e5)_0x5da501=readSqlStatementsFromFile(_0x2827e5);else{if(_0x41ea32==='-')_0x5da501=await readSqlStatementsFromStdin();else{if(_0x41ea32&&isSqlFilePath(_0x41ea32))_0x5da501=readSqlStatementsFromFile(_0x41ea32);else{if(_0x41ea32)_0x5da501=splitSqlStatements(_0x41ea32);else throw new Error(_0x43952a(0xcd));}}}}catch(_0x53f622){return console['error'](_0x43952a(0xf3)+_0x53f622[_0x43952a(0xf4)]),0x1;}const _0x176de3=_0x1ca67c[_0x43952a(0xc3)]||_0x43952a(0xdf),_0x1540c9=_0x1ca67c[_0x43952a(0xf1)];try{const _0x14e58d=[],_0x22c6f5=!!_0x1ca67c[_0x43952a(0xdc)];for(let _0x49690d=0x0;_0x49690d<_0x5da501[_0x43952a(0xd0)];_0x49690d++){const _0x15e37b=_0x5da501[_0x49690d],_0x42958d=_0x49690d+0x1,_0x22aaa3=_0x5da501[_0x43952a(0xd0)],_0x58e398=_0x22aaa3>0x1;_0x1ca67c[_0x43952a(0xc4)]&&(console['error']('\x0a'+(_0x58e398?_0x43952a(0xe6)+_0x42958d+'/'+_0x22aaa3+':':'')),console[_0x43952a(0xd1)](_0x43952a(0xd8)+_0x1ca67c[_0x43952a(0xee)]),console[_0x43952a(0xd1)](_0x43952a(0xd3)+(_0x1540c9||'td')),console[_0x43952a(0xd1)](_0x43952a(0xec)+_0x176de3),console['error']('SQL:\x20'+_0x15e37b));const _0x35d3f2=_0x58e398?_0x43952a(0xd5)+_0x42958d+'/'+_0x22aaa3+'...':_0x43952a(0xd9);try{const _0x1946db=await withProgressSpinner(_0x35d3f2,async _0x3fec4c=>{const _0x5f57be=_0x43952a,_0x3883a5=await _0x308855[_0x5f57be(0xc9)]['execute'](_0x15e37b,{'catalog':_0x1540c9,'schema':_0x176de3,'onJobId':_0x1d73f7=>{const _0x4f29e9=_0x5f57be;_0x3fec4c[_0x4f29e9(0xf5)](_0x1d73f7);},'onProgress':_0x593d2a=>{const _0x3c4c2c=_0x5f57be;_0x3fec4c[_0x3c4c2c(0xf6)](_0x3c4c2c(0xe0)+_0x593d2a['state']+']'),_0x3fec4c['setExtra'](formatRows(_0x593d2a['processedRows'])+_0x3c4c2c(0xcb)+_0x593d2a['completedSplits']+'/'+_0x593d2a[_0x3c4c2c(0xe5)]+_0x3c4c2c(0xda));}});return _0x3883a5;},{'verbose':_0x1ca67c[_0x43952a(0xc4)]}),_0x2536f8=_0x1946db['data'],_0x2c2bd5=_0x2536f8[_0x43952a(0xd6)]?_0x43952a(0xde)+_0x2536f8[_0x43952a(0xd6)]+']':'',_0x5bb8e0=_0x58e398?'Statement\x20'+_0x42958d+'/'+_0x22aaa3+_0x43952a(0xce):'';console[_0x43952a(0xd1)]('✔\x20'+_0x5bb8e0+_0x43952a(0xe3)+formatRows(_0x2536f8[_0x43952a(0xe8)][_0x43952a(0xcc)])+'\x20rows\x20'+(_0x43952a(0xf7)+formatElapsed(_0x2536f8['stats'][_0x43952a(0xe4)])+_0x2c2bd5));if(_0x58e398&&_0x22c6f5){const _0x4b00c3=resolveOutputOptions(_0x1ca67c),_0x4b0bd5=await formatQueryOutput(_0x2536f8,_0x4b00c3);_0x14e58d[_0x43952a(0xea)](_0x4b0bd5);}else await handleQueryOutput(_0x2536f8,_0x1ca67c);}catch(_0x26a0fe){const _0x41111e=_0x58e398?_0x43952a(0xe6)+_0x42958d+'/'+_0x22aaa3+':\x0a':'',_0x361db6=_0x26a0fe instanceof SDKError?_0x26a0fe[_0x43952a(0xe9)]:_0x26a0fe[_0x43952a(0xf4)];return console[_0x43952a(0xd1)](''+_0x41111e+_0x361db6),0x1;}}if(_0x5da501[_0x43952a(0xd0)]>0x1&&_0x22c6f5&&_0x14e58d[_0x43952a(0xd0)]>0x0){const _0x569419=_0x14e58d[_0x43952a(0xe1)]('\x0a');writeFileSync(_0x1ca67c[_0x43952a(0xdc)],_0x569419),console[_0x43952a(0xd1)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x1ca67c[_0x43952a(0xdc)]);}return 0x0;}catch(_0x44d750){throw _0x44d750;}}[a25_0x1b7097(0xd7)](_0x474158){const _0x350488=a25_0x1b7097,_0x2cebd9=_0x474158[_0x350488(0xc5)][0x0],_0x4e4512=_0x474158[_0x350488(0xdd)][_0x350488(0xed)];if(!_0x2cebd9&&!_0x4e4512)return _0x350488(0xc6);if(_0x2cebd9&&_0x4e4512)return _0x350488(0xdb);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x46c29a=a26_0x4ec7;(function(_0x333bf1,_0x31aa42){const _0x123b15=a26_0x4ec7,_0x572326=_0x333bf1();while(!![]){try{const _0x5a5e12=parseInt(_0x123b15(0x1b5))/0x1+-parseInt(_0x123b15(0x1f3))/0x2+parseInt(_0x123b15(0x1b4))/0x3+-parseInt(_0x123b15(0x1f1))/0x4*(parseInt(_0x123b15(0x1f5))/0x5)+parseInt(_0x123b15(0x1be))/0x6+-parseInt(_0x123b15(0x19d))/0x7+-parseInt(_0x123b15(0x1ba))/0x8*(-parseInt(_0x123b15(0x1ce))/0x9);if(_0x5a5e12===_0x31aa42)break;else _0x572326['push'](_0x572326['shift']());}catch(_0x32ff6e){_0x572326['push'](_0x572326['shift']());}}}(a26_0x2c80,0x8a5d9));function a26_0x4ec7(_0x1849fa,_0x2f5d72){_0x1849fa=_0x1849fa-0x189;const _0x2c8062=a26_0x2c80();let _0x4ec7e5=_0x2c8062[_0x1849fa];return _0x4ec7e5;}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 a26_0x2fc186 from'chalk';function formatRelativeTime(_0x1d6795){const _0x5e687f=a26_0x4ec7,_0x485a3d=new Date(_0x1d6795),_0x588ba1=new Date(),_0x4850a8=_0x485a3d[_0x5e687f(0x1e0)]()-_0x588ba1[_0x5e687f(0x1e0)](),_0x4a09ee=Math[_0x5e687f(0x195)](_0x4850a8)/0x3e8,_0x51a476=_0x4850a8<0x0;if(_0x4a09ee<0x3c)return _0x51a476?_0x5e687f(0x1eb):'soon';else{if(_0x4a09ee<0xe10){const _0x292ea2=Math[_0x5e687f(0x1da)](_0x4a09ee/0x3c);return _0x51a476?_0x292ea2+_0x5e687f(0x207):_0x5e687f(0x210)+_0x292ea2+'m';}else{if(_0x4a09ee<0x15180){const _0x1d9509=Math[_0x5e687f(0x1da)](_0x4a09ee/0xe10);return _0x51a476?_0x1d9509+'h\x20ago':_0x5e687f(0x210)+_0x1d9509+'h';}else{if(_0x4a09ee<0x93a80){const _0x3fa523=Math[_0x5e687f(0x1da)](_0x4a09ee/0x15180);return _0x51a476?_0x3fa523+_0x5e687f(0x1f6):_0x5e687f(0x210)+_0x3fa523+'d';}else return _0x485a3d[_0x5e687f(0x1a0)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x46c29a(0x192)]=a26_0x46c29a(0x1d4);[a26_0x46c29a(0x1fc)]='List\x20scheduled\x20queries';async[a26_0x46c29a(0x1f4)](_0x63f9d9){const _0x1aa5bf=a26_0x46c29a,{options:_0x2b070e,args:_0x35492a,tdx:_0x2f938b}=_0x63f9d9,_0x1662e7=resolveLimit(_0x2b070e[_0x1aa5bf(0x1d1)],DEFAULT_DISPLAY_LIMIT),_0x2ca3d8=_0x35492a[0x0],_0x4d843b=_0x2ca3d8?_0x1aa5bf(0x1f8)+_0x2ca3d8+_0x1aa5bf(0x1a6):_0x1aa5bf(0x1e6),_0x365ee6=await withSpinner(_0x4d843b,()=>_0x2f938b[_0x1aa5bf(0x1d9)][_0x1aa5bf(0x1b9)]({'limit':_0x1662e7,'scheduled':!![],'pattern':_0x2ca3d8}),{'verbose':_0x2b070e['verbose']}),_0x1b77b5=_0x365ee6[_0x1aa5bf(0x18e)]['queries'],_0x4416fa=_0x365ee6[_0x1aa5bf(0x18e)][_0x1aa5bf(0x1d7)][_0x1aa5bf(0x1fb)],_0x21e478=_0x2ca3d8?'\x20matching\x20\x22'+_0x2ca3d8+'\x22':'';_0x4416fa?console[_0x1aa5bf(0x204)](_0x1aa5bf(0x211)+_0x1b77b5[_0x1aa5bf(0x1ed)]+'\x20schedules'+_0x21e478+_0x1aa5bf(0x1a3)):console[_0x1aa5bf(0x204)](_0x1aa5bf(0x196)+_0x1b77b5[_0x1aa5bf(0x1ed)]+'\x20scheduled\x20quer'+(_0x1b77b5[_0x1aa5bf(0x1ed)]!==0x1?_0x1aa5bf(0x1f2):'y')+_0x21e478);if(_0x2b070e[_0x1aa5bf(0x1bf)]===_0x1aa5bf(0x189)||_0x2b070e['format']==='jsonl'||_0x2b070e[_0x1aa5bf(0x1bf)]===_0x1aa5bf(0x1a1)||_0x2b070e[_0x1aa5bf(0x1bf)]===_0x1aa5bf(0x1b2)){const _0x366ec6=_0x1b77b5[_0x1aa5bf(0x194)](_0x24fd5d=>({'id':_0x24fd5d['id'],'name':_0x24fd5d[_0x1aa5bf(0x192)],'cron':_0x24fd5d['cron'],'database':_0x24fd5d[_0x1aa5bf(0x1fd)]?.[_0x1aa5bf(0x192)],'type':_0x24fd5d[_0x1aa5bf(0x1df)],'timezone':_0x24fd5d[_0x1aa5bf(0x1bd)],'user_name':_0x24fd5d['user']?.[_0x1aa5bf(0x192)],'updated_at':_0x24fd5d[_0x1aa5bf(0x1ae)],'next_run_at':_0x24fd5d['next_run_at'],'last_job_status':_0x24fd5d['last_job']?.[_0x1aa5bf(0x209)]}));await handleSDKOutput(_0x366ec6,_0x2b070e);}else{if(_0x1b77b5[_0x1aa5bf(0x1ed)]===0x0)console[_0x1aa5bf(0x1aa)]('No\x20scheduled\x20queries\x20found');else{const _0x1571d6=_0x2b070e['site'],_0x49136a=_0x1b77b5[_0x1aa5bf(0x194)](_0x132cbc=>{const _0xb6934=_0x1aa5bf,_0x28e724=_0x132cbc['last_job']?.[_0xb6934(0x209)]?_0x132cbc[_0xb6934(0x1b6)][_0xb6934(0x209)]==='success'?'✓':'✗':'-',_0x3952c4=_0x132cbc['last_job']?.[_0xb6934(0x1d2)]?formatRelativeTime(_0x132cbc[_0xb6934(0x1b6)][_0xb6934(0x1d2)]):_0xb6934(0x1c6),_0x2407fe=_0x132cbc['next_run_at']?formatRelativeTime(_0x132cbc[_0xb6934(0x1fe)]):'-',_0x4d5efe=_0x132cbc[_0xb6934(0x1cb)]||'',_0x2e01d4=_0x132cbc['name']||_0xb6934(0x1ff),_0x50d22d=getConsoleUrl(_0x1571d6,'/app/queries/editor?queryId='+_0x132cbc['id']);return{'statusIcon':_0x28e724,'lastRun':_0x3952c4,'nextRun':_0x2407fe,'cron':_0x4d5efe,'name':_0x2e01d4,'queryUrl':_0x50d22d,'status':_0x132cbc[_0xb6934(0x1b6)]?.[_0xb6934(0x209)]};}),_0x25ba49=Math[_0x1aa5bf(0x1ef)](..._0x49136a['map'](_0x586b6d=>_0x586b6d[_0x1aa5bf(0x1c1)][_0x1aa5bf(0x1ed)])),_0xf11bbb=Math[_0x1aa5bf(0x1ef)](..._0x49136a['map'](_0x3c661a=>_0x3c661a['nextRun'][_0x1aa5bf(0x1ed)])),_0x50ddfb=Math[_0x1aa5bf(0x1ef)](..._0x49136a[_0x1aa5bf(0x194)](_0x3eb85e=>_0x3eb85e[_0x1aa5bf(0x1cb)][_0x1aa5bf(0x1ed)])),_0x19d150=_0x49136a[_0x1aa5bf(0x194)](_0x2ae609=>{const _0xfab7dc=_0x1aa5bf,_0x2297dc=_0x2ae609[_0xfab7dc(0x209)]==='success'?a26_0x2fc186[_0xfab7dc(0x1cf)](_0x2ae609['statusIcon']):_0x2ae609[_0xfab7dc(0x209)]===_0xfab7dc(0x204)?a26_0x2fc186[_0xfab7dc(0x205)](_0x2ae609[_0xfab7dc(0x213)]):a26_0x2fc186[_0xfab7dc(0x1c5)](_0x2ae609[_0xfab7dc(0x213)]),_0x5f59be=_0x2ae609[_0xfab7dc(0x1c1)][_0xfab7dc(0x1af)](_0x25ba49),_0x2b1d4b=_0x2ae609[_0xfab7dc(0x18c)][_0xfab7dc(0x1af)](_0xf11bbb),_0x29f6b1=_0x2ae609[_0xfab7dc(0x1cb)]?a26_0x2fc186[_0xfab7dc(0x200)](_0x2ae609[_0xfab7dc(0x1cb)][_0xfab7dc(0x1af)](_0x50ddfb)):'\x20'[_0xfab7dc(0x212)](_0x50ddfb),_0x4bffe8=hyperlink(_0x2ae609[_0xfab7dc(0x192)],_0x2ae609[_0xfab7dc(0x197)]);return _0xfab7dc(0x1ca)+_0x2297dc+'\x20'+_0x5f59be+_0xfab7dc(0x208)+_0x2b1d4b+'\x20\x20'+_0x29f6b1+'\x20\x20'+_0x4bffe8;});await writeOutput(_0x19d150[_0x1aa5bf(0x1d3)]('\x0a'),_0x2b070e[_0x1aa5bf(0x201)],_0x1aa5bf(0x203));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']='schedule:show';['description']=a26_0x46c29a(0x190);[a26_0x46c29a(0x1e8)](_0x2791e9){const _0x303135=a26_0x46c29a,_0x418e77=_0x2791e9[_0x303135(0x199)][0x0];if(!_0x418e77)return _0x303135(0x1f0);return undefined;}async[a26_0x46c29a(0x1f4)](_0x3b0bcd){const _0x360bcc=a26_0x46c29a,{options:_0x4fdf00,args:_0x36ab4a,tdx:_0x306b33}=_0x3b0bcd,_0xb7a47e=_0x36ab4a[0x0],_0x353f21=await withSpinner(_0x360bcc(0x18a),()=>_0x306b33[_0x360bcc(0x1d9)][_0x360bcc(0x1b0)](_0xb7a47e),{'verbose':_0x4fdf00[_0x360bcc(0x1b3)]}),_0x4ba802=_0x353f21[_0x360bcc(0x18e)],_0x1a8a2f={'name':_0x4ba802[_0x360bcc(0x192)],'cron':_0x4ba802[_0x360bcc(0x1cb)],'database':_0x4ba802[_0x360bcc(0x1fd)],'type':_0x4ba802['type'],'timezone':_0x4ba802[_0x360bcc(0x1c8)],'user_name':_0x4ba802[_0x360bcc(0x1bc)],'created_at':_0x4ba802[_0x360bcc(0x1e7)],'engine_version':_0x4ba802[_0x360bcc(0x1f9)],'executing_user_id':_0x4ba802['executing_user_id'],'query':_0x4ba802['query'],'delay':_0x4ba802[_0x360bcc(0x1dc)],'priority':_0x4ba802[_0x360bcc(0x20d)],'retry_limit':_0x4ba802[_0x360bcc(0x1dd)],..._0x4ba802[_0x360bcc(0x18f)]&&{'result':_0x4ba802[_0x360bcc(0x18f)]}};return await handleSingleObjectOutput(_0x1a8a2f,_0x4fdf00),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a26_0x46c29a(0x1c2);[a26_0x46c29a(0x1fc)]=a26_0x46c29a(0x1c9);['validate'](_0x353229){const _0x4f463b=a26_0x46c29a,_0x319845=_0x353229[_0x4f463b(0x199)][0x0];if(!_0x319845)return _0x4f463b(0x1e9);return undefined;}async[a26_0x46c29a(0x1f4)](_0x630604){const _0x454ff4=a26_0x46c29a,{options:_0x575f05,args:_0x16ac77,tdx:_0x3ffcd8}=_0x630604,_0x1103c=_0x16ac77[0x0],_0x49daad=_0x575f05,_0x143ea6=_0x49daad[_0x454ff4(0x1fd)],_0x5e6f98=_0x49daad[_0x454ff4(0x19f)],_0x454b65=_0x49daad[_0x454ff4(0x1df)]||'trino';let _0x53bac6;try{_0x53bac6=readFileSync(_0x5e6f98,_0x454ff4(0x19c))['trim']();}catch(_0x26f22){throw new SDKError(ErrorCode[_0x454ff4(0x1c7)],'Failed\x20to\x20read\x20file:\x20'+_0x5e6f98,_0x26f22 instanceof Error?_0x26f22:undefined);}if(!_0x53bac6)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x454ff4(0x214));const _0x3dd342={'database':_0x143ea6,'query':_0x53bac6,'type':_0x454b65};if(_0x49daad[_0x454ff4(0x1cb)])_0x3dd342[_0x454ff4(0x1cb)]=_0x49daad['cron'];if(_0x49daad[_0x454ff4(0x1c8)])_0x3dd342[_0x454ff4(0x1c8)]=_0x49daad[_0x454ff4(0x1c8)];if(_0x49daad[_0x454ff4(0x1dc)]!==undefined)_0x3dd342[_0x454ff4(0x1dc)]=Number(_0x49daad['delay']);if(_0x49daad[_0x454ff4(0x20d)]!==undefined)_0x3dd342[_0x454ff4(0x20d)]=Number(_0x49daad[_0x454ff4(0x20d)]);if(_0x49daad[_0x454ff4(0x1a7)]!==undefined)_0x3dd342[_0x454ff4(0x1dd)]=Number(_0x49daad['retryLimit']);if(_0x49daad['engineVersion'])_0x3dd342[_0x454ff4(0x1f9)]=_0x49daad[_0x454ff4(0x1d8)];if(_0x49daad[_0x454ff4(0x18f)])_0x3dd342[_0x454ff4(0x18f)]=_0x49daad['result'];if(_0x575f05[_0x454ff4(0x1b3)]){console[_0x454ff4(0x204)](_0x454ff4(0x1c0)+_0x1103c),console[_0x454ff4(0x204)](_0x454ff4(0x1b8)+_0x143ea6),console[_0x454ff4(0x204)](_0x454ff4(0x1c4)+_0x454b65);if(_0x3dd342[_0x454ff4(0x1cb)])console[_0x454ff4(0x204)](_0x454ff4(0x20f)+_0x3dd342[_0x454ff4(0x1cb)]);if(_0x3dd342[_0x454ff4(0x1c8)])console['error'](_0x454ff4(0x1e4)+_0x3dd342[_0x454ff4(0x1c8)]);}const _0x27db28=await withSpinner(_0x454ff4(0x19b),()=>_0x3ffcd8['schedules'][_0x454ff4(0x1ea)](_0x1103c,_0x3dd342),{'verbose':_0x575f05[_0x454ff4(0x1b3)]});return console['error']('Schedule\x20created:\x20'+_0x27db28[_0x454ff4(0x18e)][_0x454ff4(0x192)]),await handleSingleObjectOutput(_0x27db28['data'],_0x575f05),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x46c29a(0x192)]=a26_0x46c29a(0x202);[a26_0x46c29a(0x1fc)]=a26_0x46c29a(0x1ac);[a26_0x46c29a(0x1e8)](_0x52dd7f){const _0x1eb2db=a26_0x46c29a,_0x55deb4=_0x52dd7f[_0x1eb2db(0x199)][0x0];if(!_0x55deb4)return _0x1eb2db(0x1ab);return undefined;}async[a26_0x46c29a(0x1f4)](_0x2282fd){const _0x1fc4ee=a26_0x46c29a,{options:_0x330c4c,args:_0x5f2fcc,tdx:_0x30e2b0}=_0x2282fd,_0x30935e=_0x5f2fcc[0x0],_0x24335d=_0x330c4c,_0x36bf88={};if(_0x24335d[_0x1fc4ee(0x1fd)])_0x36bf88[_0x1fc4ee(0x1fd)]=_0x24335d['database'];if(_0x24335d['type'])_0x36bf88[_0x1fc4ee(0x1df)]=_0x24335d[_0x1fc4ee(0x1df)];if(_0x24335d[_0x1fc4ee(0x1cb)])_0x36bf88[_0x1fc4ee(0x1cb)]=_0x24335d[_0x1fc4ee(0x1cb)];if(_0x24335d[_0x1fc4ee(0x1c8)])_0x36bf88[_0x1fc4ee(0x1c8)]=_0x24335d[_0x1fc4ee(0x1c8)];if(_0x24335d[_0x1fc4ee(0x1dc)]!==undefined)_0x36bf88['delay']=Number(_0x24335d[_0x1fc4ee(0x1dc)]);if(_0x24335d[_0x1fc4ee(0x20d)]!==undefined)_0x36bf88['priority']=Number(_0x24335d[_0x1fc4ee(0x20d)]);if(_0x24335d['retryLimit']!==undefined)_0x36bf88['retry_limit']=Number(_0x24335d[_0x1fc4ee(0x1a7)]);if(_0x24335d[_0x1fc4ee(0x1d8)])_0x36bf88['engine_version']=_0x24335d['engineVersion'];if(_0x24335d[_0x1fc4ee(0x18f)])_0x36bf88['result']=_0x24335d[_0x1fc4ee(0x18f)];if(_0x24335d[_0x1fc4ee(0x19f)])try{_0x36bf88['query']=readFileSync(_0x24335d[_0x1fc4ee(0x19f)],_0x1fc4ee(0x19c))['trim']();}catch(_0x50b148){throw new SDKError(ErrorCode[_0x1fc4ee(0x1c7)],'Failed\x20to\x20read\x20file:\x20'+_0x24335d[_0x1fc4ee(0x19f)],_0x50b148 instanceof Error?_0x50b148:undefined);}if(Object[_0x1fc4ee(0x1e1)](_0x36bf88)['length']===0x0)throw new SDKError(ErrorCode[_0x1fc4ee(0x1c7)],_0x1fc4ee(0x20e));if(_0x330c4c['verbose']){console[_0x1fc4ee(0x204)](_0x1fc4ee(0x1a9)+_0x30935e);for(const [_0x3bd30d,_0x2e9bc8]of Object[_0x1fc4ee(0x19e)](_0x36bf88)){_0x3bd30d==='query'?console['error']('\x20\x20'+_0x3bd30d+':\x20'+_0x2e9bc8[_0x1fc4ee(0x1d5)](0x0,0x32)+'...'):console[_0x1fc4ee(0x204)]('\x20\x20'+_0x3bd30d+':\x20'+_0x2e9bc8);}}const _0x1b28db=await withSpinner(_0x1fc4ee(0x1c3),()=>_0x30e2b0[_0x1fc4ee(0x1d9)][_0x1fc4ee(0x1b1)](_0x30935e,_0x36bf88),{'verbose':_0x330c4c[_0x1fc4ee(0x1b3)]});return console[_0x1fc4ee(0x204)](_0x1fc4ee(0x1cd)+_0x1b28db['data'][_0x1fc4ee(0x192)]),await handleSingleObjectOutput(_0x1b28db['data'],_0x330c4c),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a26_0x46c29a(0x193);[a26_0x46c29a(0x1fc)]=a26_0x46c29a(0x20a);[a26_0x46c29a(0x1e8)](_0x5d5330){const _0x49ed8f=a26_0x46c29a,_0x4e608a=_0x5d5330[_0x49ed8f(0x199)][0x0];if(!_0x4e608a)return _0x49ed8f(0x198);return undefined;}async[a26_0x46c29a(0x1f4)](_0x5202c3){const _0x528239=a26_0x46c29a,{options:_0x99709,args:_0x1b2a3c,tdx:_0x2438a2}=_0x5202c3,_0x173662=_0x1b2a3c[0x0];if(!_0x99709[_0x528239(0x1a5)]){const _0x370782=await confirm(_0x528239(0x1cc)+_0x173662+'\x22?');if(!_0x370782)return console['error'](_0x528239(0x1ee)),0x0;}const _0x1a3bd4=await withSpinner(_0x528239(0x1d0),()=>_0x2438a2[_0x528239(0x1d9)]['delete'](_0x173662),{'verbose':_0x99709[_0x528239(0x1b3)]});return console[_0x528239(0x204)]('Schedule\x20deleted:\x20'+_0x1a3bd4['data'][_0x528239(0x192)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x46c29a(0x192)]='schedule:run';[a26_0x46c29a(0x1fc)]=a26_0x46c29a(0x1d6);[a26_0x46c29a(0x1e8)](_0xa1604e){const _0x49b47a=a26_0x46c29a,_0x1c367e=_0xa1604e[_0x49b47a(0x199)][0x0];if(!_0x1c367e)return _0x49b47a(0x1e3);return undefined;}async[a26_0x46c29a(0x1f4)](_0x2e9a15){const _0x466060=a26_0x46c29a,{options:_0x2ee6d4,args:_0x582029,tdx:_0x4d21e5}=_0x2e9a15,_0x15333a=_0x582029[0x0],_0x581048=_0x2ee6d4,_0x44cd7b=_0x581048[_0x466060(0x1a8)],_0x520f54=_0x581048[_0x466060(0x18b)]!==undefined?Number(_0x581048[_0x466060(0x18b)]):undefined;if(_0x2ee6d4[_0x466060(0x1b3)]){console[_0x466060(0x204)](_0x466060(0x1fa)+_0x15333a);if(_0x44cd7b)console[_0x466060(0x204)](_0x466060(0x1b7)+_0x44cd7b);if(_0x520f54)console['error'](_0x466060(0x19a)+_0x520f54);}const _0x8d7b9f=await withSpinner(_0x466060(0x1ec),()=>_0x4d21e5[_0x466060(0x1d9)][_0x466060(0x1bb)](_0x15333a,{'time':_0x44cd7b,'num':_0x520f54}),{'verbose':_0x2ee6d4[_0x466060(0x1b3)]}),_0x2c24d7=_0x8d7b9f[_0x466060(0x18e)][_0x466060(0x1e5)];console[_0x466060(0x204)](_0x466060(0x1db)+_0x2c24d7[_0x466060(0x1ed)]+_0x466060(0x18d)+(_0x2c24d7[_0x466060(0x1ed)]!==0x1?'s':'')+'\x20created');for(const _0x38d48e of _0x2c24d7){console[_0x466060(0x204)](_0x466060(0x1e2)+_0x38d48e[_0x466060(0x20c)]);}return await handleSDKOutput(_0x2c24d7,_0x2ee6d4),0x0;}}function a26_0x2c80(){const _0x4d08eb=['max','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','463668pcWacx','ies','1035384KcuZDA','execute','30sVdttV','d\x20ago','from','Searching\x20scheduled\x20queries\x20matching\x20\x22','engine_version','Running\x20schedule:\x20','has_next_page','description','database','next_run_at','(unnamed)','cyan','output','schedule:update','list','error','red','\x20(showing\x20','m\x20ago','\x20\x20→\x20','status','Delete\x20a\x20scheduled\x20query','Getting\x20schedule\x20history...','job_id','priority','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x20\x20Cron:\x20','in\x20','Showing\x20first\x20','repeat','statusIcon','Query\x20file\x20is\x20empty','json','Getting\x20schedule\x20details...','num','nextRun','\x20job','data','result','Show\x20schedule\x20details','end_at','name','schedule:delete','map','abs','Found\x20','queryUrl','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','args','\x20\x20Num:\x20','Creating\x20schedule...','utf-8','714952tYZrKm','entries','file','toLocaleDateString','table','\x20execution','\x20(use\x20--limit\x20to\x20see\x20more)','scheduled_at','yes','\x22...','retryLimit','time','Updating\x20schedule:\x20','log','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Update\x20a\x20scheduled\x20query','history','updated_at','padEnd','show','update','tsv','verbose','3187548GCCtqN','577990mmnson','last_job','\x20\x20Time:\x20','\x20\x20Database:\x20','listQueries','18808yPcVgu','run','user_name','time_zone','1435308TUHkdX','format','Creating\x20schedule:\x20','lastRun','schedule:create','Updating\x20schedule...','\x20\x20Type:\x20','dim','never','INVALID_ARGUMENT','timezone','Create\x20a\x20scheduled\x20query','📅\x20','cron','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Schedule\x20updated:\x20','9KStJdx','green','Deleting\x20schedule...','limit','ended_at','join','schedule:list','substring','Run\x20a\x20scheduled\x20query\x20immediately','pagination','engineVersion','schedules','round','Schedule\x20run\x20submitted:\x20','delay','retry_limit','count','type','getTime','keys','\x20\x20Job\x20ID:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x20\x20Timezone:\x20','jobs','Listing\x20scheduled\x20queries...','created_at','validate','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','create','just\x20now','Running\x20schedule...','length','Cancelled'];a26_0x2c80=function(){return _0x4d08eb;};return a26_0x2c80();}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x46c29a(0x192)]='schedule:history';[a26_0x46c29a(0x1fc)]='Show\x20schedule\x20execution\x20history';['validate'](_0x2b49c0){const _0x5ab87e=a26_0x46c29a,_0x142ac5=_0x2b49c0[_0x5ab87e(0x199)][0x0];if(!_0x142ac5)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x95460e){const _0x12f5e9=a26_0x46c29a,{options:_0x1e534a,args:_0x54ef34,tdx:_0x1c79e2}=_0x95460e,_0x3013e5=_0x54ef34[0x0],_0x3603db=_0x1e534a,_0x47532a=_0x3603db[_0x12f5e9(0x1f7)]!==undefined?Number(_0x3603db[_0x12f5e9(0x1f7)]):undefined,_0x29a8f2=_0x3603db['to']!==undefined?Number(_0x3603db['to']):undefined,_0x3ff981=await withSpinner(_0x12f5e9(0x20b),()=>_0x1c79e2[_0x12f5e9(0x1d9)]['history'](_0x3013e5,{'from':_0x47532a,'to':_0x29a8f2}),{'verbose':_0x1e534a[_0x12f5e9(0x1b3)]}),_0x158e03=_0x3ff981['data'];console['error'](_0x12f5e9(0x196)+_0x158e03[_0x12f5e9(0x1de)]+_0x12f5e9(0x1a2)+(_0x158e03[_0x12f5e9(0x1de)]!==0x1?'s':'')+_0x12f5e9(0x206)+_0x158e03[_0x12f5e9(0x1f7)]+'-'+_0x158e03['to']+')');const _0x17502c=_0x158e03[_0x12f5e9(0x1ad)][_0x12f5e9(0x194)](_0x5c05f3=>({'job_id':_0x5c05f3[_0x12f5e9(0x20c)],'type':_0x5c05f3[_0x12f5e9(0x1df)],'status':_0x5c05f3[_0x12f5e9(0x209)],'scheduled_at':_0x5c05f3[_0x12f5e9(0x1a4)],'created_at':_0x5c05f3['created_at'],'start_at':_0x5c05f3['start_at'],'end_at':_0x5c05f3[_0x12f5e9(0x191)]}));return await handleSDKOutput(_0x17502c,_0x1e534a),0x0;}}
|
|
1
|
+
const a26_0x1ba519=a26_0x3e92;(function(_0x47855b,_0x3e08c4){const _0x4d90ca=a26_0x3e92,_0x5351d3=_0x47855b();while(!![]){try{const _0x1ddc36=-parseInt(_0x4d90ca(0x18e))/0x1*(parseInt(_0x4d90ca(0x1c7))/0x2)+parseInt(_0x4d90ca(0x1a2))/0x3*(-parseInt(_0x4d90ca(0x1b9))/0x4)+-parseInt(_0x4d90ca(0x1a6))/0x5*(-parseInt(_0x4d90ca(0x15f))/0x6)+-parseInt(_0x4d90ca(0x1dd))/0x7+parseInt(_0x4d90ca(0x1a8))/0x8*(-parseInt(_0x4d90ca(0x16f))/0x9)+-parseInt(_0x4d90ca(0x1c0))/0xa*(-parseInt(_0x4d90ca(0x1a3))/0xb)+parseInt(_0x4d90ca(0x1b7))/0xc*(parseInt(_0x4d90ca(0x1d0))/0xd);if(_0x1ddc36===_0x3e08c4)break;else _0x5351d3['push'](_0x5351d3['shift']());}catch(_0x143e79){_0x5351d3['push'](_0x5351d3['shift']());}}}(a26_0x4bcd,0x888e6));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';function a26_0x4bcd(){const _0x223c94=['Getting\x20schedule\x20history...','cron','\x20scheduled\x20quer','engine_version','17771fpnxYp','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','query','show','statusIcon','INVALID_ARGUMENT','Schedule\x20run\x20submitted:\x20','\x20matching\x20\x22','update','\x20\x20Num:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','schedule:delete','validate','1298283RbakTG','Show\x20schedule\x20details','success','\x20execution','trim','database','repeat','Schedule\x20deleted:\x20','engineVersion','table','execute','in\x20','limit','timezone','\x20\x20Timezone:\x20','next_run_at','5390868rbqxec','(unnamed)','data','\x20\x20→\x20','Creating\x20schedule:\x20','\x20created','Delete\x20a\x20scheduled\x20query','status','...','jsonl','num','schedule:create','Running\x20schedule...','format','delete','schedule:update','9XICrju','schedule:history','round','Update\x20a\x20scheduled\x20query','count','nextRun','\x20job','yes','listQueries','m\x20ago','d\x20ago','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Found\x20','\x20\x20Database:\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','length','substring','Show\x20schedule\x20execution\x20history','schedule:run','\x20(use\x20--limit\x20to\x20see\x20more)','name','lastRun','ies','Cancelled','job_id','start_at','abs','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','queryUrl','log','executing_user_id','236059XJhBjR','run','verbose','Failed\x20to\x20read\x20file:\x20','Updating\x20schedule:\x20','Getting\x20schedule\x20details...','toLocaleDateString','map','\x20\x20Cron:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','created_at','padEnd','schedules','dim','List\x20scheduled\x20queries','max','join','soon','delay','updated_at','998619nvnEIH','9777559MdyoHe','Listing\x20scheduled\x20queries...','from','5CnWAes','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','4455992uJdZfo','jobs','retry_limit','args','priority','description','utf-8','schedule:show','list','user_name','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Deleting\x20schedule...','Updating\x20schedule...','\x20\x20Time:\x20','Schedule\x20created:\x20','732ZgkPAs','last_job','4jVdGqx','keys','create','tsv','getTime','error','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','10aWmAAg','never','retryLimit','json','type','result','user','2SCiaWC','h\x20ago','time_zone','just\x20now','file'];a26_0x4bcd=function(){return _0x223c94;};return a26_0x4bcd();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x27471a from'chalk';function formatRelativeTime(_0x228a44){const _0x2f7811=a26_0x3e92,_0x1b5c38=new Date(_0x228a44),_0x49371d=new Date(),_0x202d27=_0x1b5c38['getTime']()-_0x49371d[_0x2f7811(0x1bd)](),_0x561949=Math[_0x2f7811(0x189)](_0x202d27)/0x3e8,_0x34153d=_0x202d27<0x0;if(_0x561949<0x3c)return _0x34153d?_0x2f7811(0x1ca):_0x2f7811(0x19f);else{if(_0x561949<0xe10){const _0x4fef6a=Math[_0x2f7811(0x171)](_0x561949/0x3c);return _0x34153d?_0x4fef6a+_0x2f7811(0x178):'in\x20'+_0x4fef6a+'m';}else{if(_0x561949<0x15180){const _0x8e7214=Math[_0x2f7811(0x171)](_0x561949/0xe10);return _0x34153d?_0x8e7214+_0x2f7811(0x1c8):_0x2f7811(0x15a)+_0x8e7214+'h';}else{if(_0x561949<0x93a80){const _0x13b833=Math['round'](_0x561949/0x15180);return _0x34153d?_0x13b833+_0x2f7811(0x179):_0x2f7811(0x15a)+_0x13b833+'d';}else return _0x1b5c38[_0x2f7811(0x194)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x1ba519(0x183)]='schedule:list';[a26_0x1ba519(0x1ad)]=a26_0x1ba519(0x19c);async[a26_0x1ba519(0x159)](_0x448c71){const _0x34d02c=a26_0x1ba519,{options:_0x2637ab,args:_0x20cd61,tdx:_0x169fbd}=_0x448c71,_0x29291e=resolveLimit(_0x2637ab[_0x34d02c(0x15b)],DEFAULT_DISPLAY_LIMIT),_0x5b1631=_0x20cd61[0x0],_0x1d9171=_0x5b1631?_0x34d02c(0x17d)+_0x5b1631+'\x22...':_0x34d02c(0x1a4),_0x3c36e5=await withSpinner(_0x1d9171,()=>_0x169fbd[_0x34d02c(0x19a)][_0x34d02c(0x177)]({'limit':_0x29291e,'scheduled':!![],'pattern':_0x5b1631}),{'verbose':_0x2637ab['verbose']}),_0x3f673a=_0x3c36e5[_0x34d02c(0x161)]['queries'],_0x4b2fce=_0x3c36e5[_0x34d02c(0x161)]['pagination']['has_next_page'],_0x4f7707=_0x5b1631?_0x34d02c(0x1d7)+_0x5b1631+'\x22':'';_0x4b2fce?console[_0x34d02c(0x1be)]('Showing\x20first\x20'+_0x3f673a[_0x34d02c(0x17e)]+'\x20schedules'+_0x4f7707+_0x34d02c(0x182)):console[_0x34d02c(0x1be)](_0x34d02c(0x17b)+_0x3f673a[_0x34d02c(0x17e)]+_0x34d02c(0x1ce)+(_0x3f673a[_0x34d02c(0x17e)]!==0x1?_0x34d02c(0x185):'y')+_0x4f7707);if(_0x2637ab[_0x34d02c(0x16c)]===_0x34d02c(0x1c3)||_0x2637ab[_0x34d02c(0x16c)]===_0x34d02c(0x168)||_0x2637ab[_0x34d02c(0x16c)]===_0x34d02c(0x158)||_0x2637ab[_0x34d02c(0x16c)]===_0x34d02c(0x1bc)){const _0x366954=_0x3f673a[_0x34d02c(0x195)](_0x2c43e8=>({'id':_0x2c43e8['id'],'name':_0x2c43e8['name'],'cron':_0x2c43e8[_0x34d02c(0x1cd)],'database':_0x2c43e8[_0x34d02c(0x154)]?.[_0x34d02c(0x183)],'type':_0x2c43e8[_0x34d02c(0x1c4)],'timezone':_0x2c43e8[_0x34d02c(0x1c9)],'user_name':_0x2c43e8[_0x34d02c(0x1c6)]?.[_0x34d02c(0x183)],'updated_at':_0x2c43e8[_0x34d02c(0x1a1)],'next_run_at':_0x2c43e8[_0x34d02c(0x15e)],'last_job_status':_0x2c43e8[_0x34d02c(0x1b8)]?.[_0x34d02c(0x166)]}));await handleSDKOutput(_0x366954,_0x2637ab);}else{if(_0x3f673a[_0x34d02c(0x17e)]===0x0)console[_0x34d02c(0x18c)]('No\x20scheduled\x20queries\x20found');else{const _0x1baf58=_0x2637ab['site'],_0x51da63=_0x3f673a[_0x34d02c(0x195)](_0x491022=>{const _0x4006f1=_0x34d02c,_0x47515d=_0x491022[_0x4006f1(0x1b8)]?.[_0x4006f1(0x166)]?_0x491022[_0x4006f1(0x1b8)][_0x4006f1(0x166)]===_0x4006f1(0x1df)?'✓':'✗':'-',_0x380243=_0x491022['last_job']?.['ended_at']?formatRelativeTime(_0x491022['last_job']['ended_at']):_0x4006f1(0x1c1),_0x564bf7=_0x491022[_0x4006f1(0x15e)]?formatRelativeTime(_0x491022[_0x4006f1(0x15e)]):'-',_0x4a3cf6=_0x491022[_0x4006f1(0x1cd)]||'',_0x1146fb=_0x491022[_0x4006f1(0x183)]||_0x4006f1(0x160),_0x5102a2=getConsoleUrl(_0x1baf58,'/app/queries/editor?queryId='+_0x491022['id']);return{'statusIcon':_0x47515d,'lastRun':_0x380243,'nextRun':_0x564bf7,'cron':_0x4a3cf6,'name':_0x1146fb,'queryUrl':_0x5102a2,'status':_0x491022['last_job']?.[_0x4006f1(0x166)]};}),_0x1e769b=Math[_0x34d02c(0x19d)](..._0x51da63[_0x34d02c(0x195)](_0x59c855=>_0x59c855[_0x34d02c(0x184)][_0x34d02c(0x17e)])),_0x2ddbae=Math[_0x34d02c(0x19d)](..._0x51da63[_0x34d02c(0x195)](_0x92cf85=>_0x92cf85[_0x34d02c(0x174)]['length'])),_0x150cc3=Math['max'](..._0x51da63['map'](_0x135372=>_0x135372['cron'][_0x34d02c(0x17e)])),_0x474d3d=_0x51da63[_0x34d02c(0x195)](_0x160789=>{const _0x5b0faf=_0x34d02c,_0x37d114=_0x160789[_0x5b0faf(0x166)]===_0x5b0faf(0x1df)?a26_0x27471a['green'](_0x160789[_0x5b0faf(0x1d4)]):_0x160789['status']===_0x5b0faf(0x1be)?a26_0x27471a['red'](_0x160789['statusIcon']):a26_0x27471a[_0x5b0faf(0x19b)](_0x160789[_0x5b0faf(0x1d4)]),_0x26959c=_0x160789[_0x5b0faf(0x184)][_0x5b0faf(0x199)](_0x1e769b),_0x3c72da=_0x160789[_0x5b0faf(0x174)][_0x5b0faf(0x199)](_0x2ddbae),_0xd016e0=_0x160789[_0x5b0faf(0x1cd)]?a26_0x27471a['cyan'](_0x160789[_0x5b0faf(0x1cd)][_0x5b0faf(0x199)](_0x150cc3)):'\x20'[_0x5b0faf(0x155)](_0x150cc3),_0x1704bf=hyperlink(_0x160789[_0x5b0faf(0x183)],_0x160789[_0x5b0faf(0x18b)]);return'📅\x20'+_0x37d114+'\x20'+_0x26959c+_0x5b0faf(0x162)+_0x3c72da+'\x20\x20'+_0xd016e0+'\x20\x20'+_0x1704bf;});await writeOutput(_0x474d3d[_0x34d02c(0x19e)]('\x0a'),_0x2637ab['output'],_0x34d02c(0x1b0));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a26_0x1ba519(0x1af);[a26_0x1ba519(0x1ad)]=a26_0x1ba519(0x1de);[a26_0x1ba519(0x1dc)](_0x3db5a4){const _0x368ff7=a26_0x1ba519,_0xa36f61=_0x3db5a4['args'][0x0];if(!_0xa36f61)return _0x368ff7(0x197);return undefined;}async[a26_0x1ba519(0x159)](_0x983950){const _0xc39c20=a26_0x1ba519,{options:_0x29418b,args:_0x3d601e,tdx:_0x45b59a}=_0x983950,_0x566b20=_0x3d601e[0x0],_0x4bc15f=await withSpinner(_0xc39c20(0x193),()=>_0x45b59a[_0xc39c20(0x19a)][_0xc39c20(0x1d3)](_0x566b20),{'verbose':_0x29418b[_0xc39c20(0x190)]}),_0x46dd26=_0x4bc15f['data'],_0xc50ea0={'name':_0x46dd26['name'],'cron':_0x46dd26[_0xc39c20(0x1cd)],'database':_0x46dd26[_0xc39c20(0x154)],'type':_0x46dd26[_0xc39c20(0x1c4)],'timezone':_0x46dd26[_0xc39c20(0x15c)],'user_name':_0x46dd26[_0xc39c20(0x1b1)],'created_at':_0x46dd26[_0xc39c20(0x198)],'engine_version':_0x46dd26[_0xc39c20(0x1cf)],'executing_user_id':_0x46dd26[_0xc39c20(0x18d)],'query':_0x46dd26[_0xc39c20(0x1d2)],'delay':_0x46dd26[_0xc39c20(0x1a0)],'priority':_0x46dd26[_0xc39c20(0x1ac)],'retry_limit':_0x46dd26[_0xc39c20(0x1aa)],..._0x46dd26[_0xc39c20(0x1c5)]&&{'result':_0x46dd26[_0xc39c20(0x1c5)]}};return await handleSingleObjectOutput(_0xc50ea0,_0x29418b),0x0;}}function a26_0x3e92(_0x275d3a,_0x3b430a){_0x275d3a=_0x275d3a-0x154;const _0x4bcd1d=a26_0x4bcd();let _0x3e921b=_0x4bcd1d[_0x275d3a];return _0x3e921b;}export class ScheduleCreateCommand extends BaseCommand{[a26_0x1ba519(0x183)]=a26_0x1ba519(0x16a);['description']='Create\x20a\x20scheduled\x20query';[a26_0x1ba519(0x1dc)](_0x3d282a){const _0x2a71dc=a26_0x1ba519,_0x38e562=_0x3d282a[_0x2a71dc(0x1ab)][0x0];if(!_0x38e562)return _0x2a71dc(0x1b2);return undefined;}async[a26_0x1ba519(0x159)](_0x4a7e80){const _0x1fa9f9=a26_0x1ba519,{options:_0x35577a,args:_0x1270da,tdx:_0x148e72}=_0x4a7e80,_0x4fa878=_0x1270da[0x0],_0x2e2861=_0x35577a,_0x2a8c6b=_0x2e2861['database'],_0x36f2d0=_0x2e2861[_0x1fa9f9(0x1cb)],_0x42e75f=_0x2e2861['type']||'trino';let _0x498df0;try{_0x498df0=readFileSync(_0x36f2d0,'utf-8')[_0x1fa9f9(0x1e1)]();}catch(_0xf0cd8e){throw new SDKError(ErrorCode[_0x1fa9f9(0x1d5)],_0x1fa9f9(0x191)+_0x36f2d0,_0xf0cd8e instanceof Error?_0xf0cd8e:undefined);}if(!_0x498df0)throw new SDKError(ErrorCode[_0x1fa9f9(0x1d5)],'Query\x20file\x20is\x20empty');const _0x4be182={'database':_0x2a8c6b,'query':_0x498df0,'type':_0x42e75f};if(_0x2e2861[_0x1fa9f9(0x1cd)])_0x4be182[_0x1fa9f9(0x1cd)]=_0x2e2861['cron'];if(_0x2e2861['timezone'])_0x4be182['timezone']=_0x2e2861[_0x1fa9f9(0x15c)];if(_0x2e2861[_0x1fa9f9(0x1a0)]!==undefined)_0x4be182['delay']=Number(_0x2e2861[_0x1fa9f9(0x1a0)]);if(_0x2e2861[_0x1fa9f9(0x1ac)]!==undefined)_0x4be182[_0x1fa9f9(0x1ac)]=Number(_0x2e2861[_0x1fa9f9(0x1ac)]);if(_0x2e2861[_0x1fa9f9(0x1c2)]!==undefined)_0x4be182[_0x1fa9f9(0x1aa)]=Number(_0x2e2861['retryLimit']);if(_0x2e2861[_0x1fa9f9(0x157)])_0x4be182[_0x1fa9f9(0x1cf)]=_0x2e2861['engineVersion'];if(_0x2e2861[_0x1fa9f9(0x1c5)])_0x4be182[_0x1fa9f9(0x1c5)]=_0x2e2861[_0x1fa9f9(0x1c5)];if(_0x35577a[_0x1fa9f9(0x190)]){console[_0x1fa9f9(0x1be)](_0x1fa9f9(0x163)+_0x4fa878),console[_0x1fa9f9(0x1be)](_0x1fa9f9(0x17c)+_0x2a8c6b),console[_0x1fa9f9(0x1be)]('\x20\x20Type:\x20'+_0x42e75f);if(_0x4be182['cron'])console['error'](_0x1fa9f9(0x196)+_0x4be182[_0x1fa9f9(0x1cd)]);if(_0x4be182['timezone'])console[_0x1fa9f9(0x1be)](_0x1fa9f9(0x15d)+_0x4be182[_0x1fa9f9(0x15c)]);}const _0x2f3000=await withSpinner('Creating\x20schedule...',()=>_0x148e72[_0x1fa9f9(0x19a)][_0x1fa9f9(0x1bb)](_0x4fa878,_0x4be182),{'verbose':_0x35577a['verbose']});return console[_0x1fa9f9(0x1be)](_0x1fa9f9(0x1b6)+_0x2f3000[_0x1fa9f9(0x161)][_0x1fa9f9(0x183)]),await handleSingleObjectOutput(_0x2f3000[_0x1fa9f9(0x161)],_0x35577a),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x1ba519(0x183)]=a26_0x1ba519(0x16e);[a26_0x1ba519(0x1ad)]=a26_0x1ba519(0x172);[a26_0x1ba519(0x1dc)](_0xd073e5){const _0x884690=a26_0x1ba519,_0x35606e=_0xd073e5['args'][0x0];if(!_0x35606e)return _0x884690(0x18a);return undefined;}async[a26_0x1ba519(0x159)](_0x2f6f91){const _0x31878e=a26_0x1ba519,{options:_0x512489,args:_0x1d7007,tdx:_0x58aa19}=_0x2f6f91,_0x31432b=_0x1d7007[0x0],_0x493a6f=_0x512489,_0x46fed1={};if(_0x493a6f[_0x31878e(0x154)])_0x46fed1[_0x31878e(0x154)]=_0x493a6f[_0x31878e(0x154)];if(_0x493a6f[_0x31878e(0x1c4)])_0x46fed1[_0x31878e(0x1c4)]=_0x493a6f[_0x31878e(0x1c4)];if(_0x493a6f[_0x31878e(0x1cd)])_0x46fed1[_0x31878e(0x1cd)]=_0x493a6f[_0x31878e(0x1cd)];if(_0x493a6f['timezone'])_0x46fed1[_0x31878e(0x15c)]=_0x493a6f[_0x31878e(0x15c)];if(_0x493a6f[_0x31878e(0x1a0)]!==undefined)_0x46fed1[_0x31878e(0x1a0)]=Number(_0x493a6f[_0x31878e(0x1a0)]);if(_0x493a6f[_0x31878e(0x1ac)]!==undefined)_0x46fed1[_0x31878e(0x1ac)]=Number(_0x493a6f['priority']);if(_0x493a6f[_0x31878e(0x1c2)]!==undefined)_0x46fed1['retry_limit']=Number(_0x493a6f['retryLimit']);if(_0x493a6f[_0x31878e(0x157)])_0x46fed1[_0x31878e(0x1cf)]=_0x493a6f[_0x31878e(0x157)];if(_0x493a6f['result'])_0x46fed1[_0x31878e(0x1c5)]=_0x493a6f['result'];if(_0x493a6f[_0x31878e(0x1cb)])try{_0x46fed1[_0x31878e(0x1d2)]=readFileSync(_0x493a6f[_0x31878e(0x1cb)],_0x31878e(0x1ae))['trim']();}catch(_0x3e0e8e){throw new SDKError(ErrorCode[_0x31878e(0x1d5)],'Failed\x20to\x20read\x20file:\x20'+_0x493a6f[_0x31878e(0x1cb)],_0x3e0e8e instanceof Error?_0x3e0e8e:undefined);}if(Object[_0x31878e(0x1ba)](_0x46fed1)[_0x31878e(0x17e)]===0x0)throw new SDKError(ErrorCode[_0x31878e(0x1d5)],_0x31878e(0x17a));if(_0x512489[_0x31878e(0x190)]){console[_0x31878e(0x1be)](_0x31878e(0x192)+_0x31432b);for(const [_0x253fa6,_0xe4975a]of Object['entries'](_0x46fed1)){_0x253fa6===_0x31878e(0x1d2)?console[_0x31878e(0x1be)]('\x20\x20'+_0x253fa6+':\x20'+_0xe4975a[_0x31878e(0x17f)](0x0,0x32)+_0x31878e(0x167)):console[_0x31878e(0x1be)]('\x20\x20'+_0x253fa6+':\x20'+_0xe4975a);}}const _0x49b53a=await withSpinner(_0x31878e(0x1b4),()=>_0x58aa19[_0x31878e(0x19a)][_0x31878e(0x1d8)](_0x31432b,_0x46fed1),{'verbose':_0x512489[_0x31878e(0x190)]});return console[_0x31878e(0x1be)]('Schedule\x20updated:\x20'+_0x49b53a[_0x31878e(0x161)][_0x31878e(0x183)]),await handleSingleObjectOutput(_0x49b53a[_0x31878e(0x161)],_0x512489),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x1ba519(0x183)]=a26_0x1ba519(0x1db);[a26_0x1ba519(0x1ad)]=a26_0x1ba519(0x165);[a26_0x1ba519(0x1dc)](_0x370d8b){const _0x5f49ff=a26_0x1ba519,_0xcd434e=_0x370d8b['args'][0x0];if(!_0xcd434e)return _0x5f49ff(0x1bf);return undefined;}async[a26_0x1ba519(0x159)](_0x58fd92){const _0x147be4=a26_0x1ba519,{options:_0x49f35d,args:_0x2261a8,tdx:_0x138275}=_0x58fd92,_0x5e045d=_0x2261a8[0x0];if(!_0x49f35d[_0x147be4(0x176)]){const _0x2a6fad=await confirm(_0x147be4(0x1d1)+_0x5e045d+'\x22?');if(!_0x2a6fad)return console[_0x147be4(0x1be)](_0x147be4(0x186)),0x0;}const _0x56cc6d=await withSpinner(_0x147be4(0x1b3),()=>_0x138275[_0x147be4(0x19a)][_0x147be4(0x16d)](_0x5e045d),{'verbose':_0x49f35d[_0x147be4(0x190)]});return console[_0x147be4(0x1be)](_0x147be4(0x156)+_0x56cc6d[_0x147be4(0x161)][_0x147be4(0x183)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x1ba519(0x183)]=a26_0x1ba519(0x181);['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a26_0x1ba519(0x1dc)](_0x49b663){const _0x4e7897=a26_0x1ba519,_0x5b595e=_0x49b663['args'][0x0];if(!_0x5b595e)return _0x4e7897(0x1da);return undefined;}async[a26_0x1ba519(0x159)](_0x275379){const _0x547a7f=a26_0x1ba519,{options:_0xdfc307,args:_0xff05fd,tdx:_0x8ef687}=_0x275379,_0x172229=_0xff05fd[0x0],_0x39ca32=_0xdfc307,_0x26d2c1=_0x39ca32['time'],_0x35da8f=_0x39ca32[_0x547a7f(0x169)]!==undefined?Number(_0x39ca32[_0x547a7f(0x169)]):undefined;if(_0xdfc307[_0x547a7f(0x190)]){console[_0x547a7f(0x1be)]('Running\x20schedule:\x20'+_0x172229);if(_0x26d2c1)console[_0x547a7f(0x1be)](_0x547a7f(0x1b5)+_0x26d2c1);if(_0x35da8f)console[_0x547a7f(0x1be)](_0x547a7f(0x1d9)+_0x35da8f);}const _0x1e63e7=await withSpinner(_0x547a7f(0x16b),()=>_0x8ef687['schedules'][_0x547a7f(0x18f)](_0x172229,{'time':_0x26d2c1,'num':_0x35da8f}),{'verbose':_0xdfc307[_0x547a7f(0x190)]}),_0x2d6427=_0x1e63e7[_0x547a7f(0x161)][_0x547a7f(0x1a9)];console[_0x547a7f(0x1be)](_0x547a7f(0x1d6)+_0x2d6427[_0x547a7f(0x17e)]+_0x547a7f(0x175)+(_0x2d6427[_0x547a7f(0x17e)]!==0x1?'s':'')+_0x547a7f(0x164));for(const _0x58be0e of _0x2d6427){console[_0x547a7f(0x1be)]('\x20\x20Job\x20ID:\x20'+_0x58be0e[_0x547a7f(0x187)]);}return await handleSDKOutput(_0x2d6427,_0xdfc307),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x1ba519(0x183)]=a26_0x1ba519(0x170);[a26_0x1ba519(0x1ad)]=a26_0x1ba519(0x180);[a26_0x1ba519(0x1dc)](_0x436695){const _0x53db7d=a26_0x1ba519,_0x586892=_0x436695[_0x53db7d(0x1ab)][0x0];if(!_0x586892)return _0x53db7d(0x1a7);return undefined;}async['execute'](_0x47b417){const _0x1745ee=a26_0x1ba519,{options:_0x388e81,args:_0x2fabac,tdx:_0x5aa10d}=_0x47b417,_0x2da67b=_0x2fabac[0x0],_0x161056=_0x388e81,_0x38a24a=_0x161056[_0x1745ee(0x1a5)]!==undefined?Number(_0x161056[_0x1745ee(0x1a5)]):undefined,_0x289bcb=_0x161056['to']!==undefined?Number(_0x161056['to']):undefined,_0xf75b50=await withSpinner(_0x1745ee(0x1cc),()=>_0x5aa10d['schedules']['history'](_0x2da67b,{'from':_0x38a24a,'to':_0x289bcb}),{'verbose':_0x388e81[_0x1745ee(0x190)]}),_0x241dba=_0xf75b50['data'];console['error'](_0x1745ee(0x17b)+_0x241dba[_0x1745ee(0x173)]+_0x1745ee(0x1e0)+(_0x241dba[_0x1745ee(0x173)]!==0x1?'s':'')+'\x20(showing\x20'+_0x241dba[_0x1745ee(0x1a5)]+'-'+_0x241dba['to']+')');const _0x373a05=_0x241dba['history'][_0x1745ee(0x195)](_0x24c2ea=>({'job_id':_0x24c2ea[_0x1745ee(0x187)],'type':_0x24c2ea['type'],'status':_0x24c2ea[_0x1745ee(0x166)],'scheduled_at':_0x24c2ea['scheduled_at'],'created_at':_0x24c2ea['created_at'],'start_at':_0x24c2ea[_0x1745ee(0x188)],'end_at':_0x24c2ea['end_at']}));return await handleSDKOutput(_0x373a05,_0x388e81),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a27_0x3211(){const _0x5c5b55=['includes','Resolved\x20folder\x20ID:\x20','(root)','site','Use:\x20tdx\x20ps\x20show','parentId','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20folder\x20\x27','Resolving\x20parent\x20segment\x20\x27','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','resolvePathToResource','Resolved\x20YAML\x20file:\x20','parentFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20Opening\x20','222805vDXfUb','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Show\x20segment\x20or\x20folder\x20details','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','9072OIFuev','fullPath','message','\x20rows\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','3982116BnCXwq','segment:view','getSegment','segment:show','Use:\x20tdx\x20ps\x20sql','toLocaleString','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20[Job\x20ID:\x20','Fetching\x20folder\x20details...','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','query','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Parent\x20ID:\x20','execute','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:describe','cause','Resolved\x20relative\x20path\x20to:\x20','verbose','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','jsonl','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','log','Fetching\x20parent\x20segment\x20details...','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','url','✔\x20Query\x20completed:\x20Processed\x20','Resolving\x20parent\x20folder\x20\x27','Target\x20path:\x20','\x27\x20with\x20ID:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','replace','\x20\x20Full\x20path:\x20','error','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20type:\x20','Examples:','Fetching\x20SQL\x20for\x20segment...','Site:\x20','stats','Show\x20child\x20segment\x20schema\x20(column\x20types)','parentSegment','\x20folder','Usage:\x20tdx\x20segment\x20describe\x20<path>','setJobId','Show\x20folder\x20or\x20child\x20segment\x20details','segment:folder:list','type','Use:\x20tdx\x20ps\x20view\x20-w','Segment\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Show\x20segment\x20folder\x20details','\x27...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20','test','✔\x20Created\x20folder\x20\x27','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolved\x20parent\x20ID:\x20','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20Segment\x20name:\x20','limit','folderId','INVALID_ARGUMENT','4328SpUACl','36IAfQDd','getFolder','folderPath','Options:','SELECT\x20*\x20FROM\x20(\x0a','jobId','folder','Folder\x20ID:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','parent','\x20\x20Folder\x20path:\x20','format','Resolving\x20\x27','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','code','cyan','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segmentName','getSegmentSQL','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','✔\x20Found\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segment','segmentId','length','name','segmentPath','SEGMENT_NOT_FOUND','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','data','resolveFolderId','Folder\x20name:\x20','Parent\x20segment:\x20','\x20\x20Cause:\x20','1297422atjyja','890246RADLDl','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Resolving\x20folder\x20\x27','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','listFolders','Usage:\x20tdx\x20sg\x20show\x20<name>','segment:folder:show','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','3531360UPEffn','610686CjwjBL','\x20\x20Parent\x20segment:\x20','trim','/e/','Usage:\x20tdx\x20sg\x20sql\x20<name>'];a27_0x3211=function(){return _0x5c5b55;};return a27_0x3211();}const a27_0x1fbaef=a27_0x5ea1;(function(_0x2aa8fe,_0x4d5f56){const _0x45db06=a27_0x5ea1,_0x5be5a8=_0x2aa8fe();while(!![]){try{const _0x527a88=-parseInt(_0x45db06(0x1a3))/0x1+-parseInt(_0x45db06(0x198))/0x2+parseInt(_0x45db06(0x197))/0x3+-parseInt(_0x45db06(0x20d))/0x4*(-parseInt(_0x45db06(0x1be))/0x5)+parseInt(_0x45db06(0x1c7))/0x6+-parseInt(_0x45db06(0x1a2))/0x7+parseInt(_0x45db06(0x20c))/0x8*(parseInt(_0x45db06(0x1c2))/0x9);if(_0x527a88===_0x4d5f56)break;else _0x5be5a8['push'](_0x5be5a8['shift']());}catch(_0x3e2eb3){_0x5be5a8['push'](_0x5be5a8['shift']());}}}(a27_0x3211,0x75bc8));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x4423df from'chalk';async function resolveSegmentTarget(_0x5f1850,_0x44375d,_0x80f6dd){const _0x4145d2=a27_0x5ea1;if(isYamlFilePath(_0x5f1850))try{const _0x43d904=await resolveYamlFilePath(_0x5f1850);return _0x80f6dd&&(console['error'](_0x4145d2(0x1b6)+_0x5f1850),console[_0x4145d2(0x1ec)](_0x4145d2(0x1a4)+_0x43d904[_0x4145d2(0x1f4)]),console[_0x4145d2(0x1ec)](_0x4145d2(0x208)+_0x43d904[_0x4145d2(0x220)]),console[_0x4145d2(0x1ec)](_0x4145d2(0x219)+(_0x43d904[_0x4145d2(0x20f)]||_0x4145d2(0x1aa))),console['error'](_0x4145d2(0x1eb)+_0x43d904[_0x4145d2(0x1c3)])),_0x43d904[_0x4145d2(0x1c3)];}catch(_0x543673){throw new SDKError(ErrorCode[_0x4145d2(0x20b)],_0x4145d2(0x1cd)+_0x543673[_0x4145d2(0x1c4)]);}if(!_0x44375d)throw new SDKError(ErrorCode[_0x4145d2(0x20b)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x44375d+'/'+_0x5f1850;}export class SegmentDescribeCommand extends BaseCommand{['name']=a27_0x1fbaef(0x1da);[a27_0x1fbaef(0x1b9)]=a27_0x1fbaef(0x1c0);async[a27_0x1fbaef(0x1d7)](_0x142735){const _0x1cc78a=a27_0x1fbaef,{options:_0x2376fc,args:_0x118c74,tdx:_0x4f018d}=_0x142735,_0x54350c=_0x118c74[0x0],_0xa4e726=!_0x54350c&&!!_0x2376fc[_0x1cc78a(0x1f4)],_0x2a27fb=_0x54350c||_0x2376fc[_0x1cc78a(0x1f4)];if(!_0x2a27fb)return console['error'](_0x1cc78a(0x1e9)),console[_0x1cc78a(0x1ec)](_0x1cc78a(0x1f6)),console[_0x1cc78a(0x1ec)](_0x1cc78a(0x1ef)),console[_0x1cc78a(0x1ec)](_0x1cc78a(0x1d1)),console[_0x1cc78a(0x1ec)](_0x1cc78a(0x207)),console[_0x1cc78a(0x1ec)](_0x1cc78a(0x224)),console['error'](_0x1cc78a(0x200)),0x1;try{const _0x22a16c=_0x2376fc[_0x1cc78a(0x229)];let _0x2b39da=_0x2a27fb;!_0xa4e726&&_0x22a16c&&!_0x2a27fb[_0x1cc78a(0x1a8)]('/')&&(_0x2b39da=_0x22a16c+'/'+_0x2a27fb,_0x2376fc['verbose']&&console['error'](_0x1cc78a(0x1dc)+_0x2b39da));const _0xbf599e=await withSpinner(_0x1cc78a(0x206)+_0x2b39da+_0x1cc78a(0x1ff),()=>_0x4f018d['segment'][_0x1cc78a(0x1b5)](_0x2b39da),{'verbose':_0x2376fc[_0x1cc78a(0x1dd)]}),_0x1df4c8=_0xbf599e[_0x1cc78a(0x22c)];_0x2376fc[_0x1cc78a(0x1dd)]&&(console[_0x1cc78a(0x1ec)](_0x1cc78a(0x1ee)+_0x1df4c8['type']),console[_0x1cc78a(0x1ec)](_0x1cc78a(0x1d6)+_0x1df4c8['parentId']),_0x1df4c8[_0x1cc78a(0x20a)]&&console[_0x1cc78a(0x1ec)](_0x1cc78a(0x214)+_0x1df4c8[_0x1cc78a(0x20a)]),_0x1df4c8[_0x1cc78a(0x226)]&&console[_0x1cc78a(0x1ec)]('Segment\x20ID:\x20'+_0x1df4c8[_0x1cc78a(0x226)]));if(_0x1df4c8[_0x1cc78a(0x1fa)]===_0x1cc78a(0x218)){const _0x140e5a=await withSpinner(_0x1cc78a(0x1e2),()=>_0x4f018d[_0x1cc78a(0x225)]['getParent'](_0x1df4c8[_0x1cc78a(0x1ad)]),{'verbose':_0x2376fc[_0x1cc78a(0x1dd)]});await handleSingleObjectOutput(_0x140e5a['data'],_0x2376fc);}else{if(_0x1df4c8['type']===_0x1cc78a(0x213)){if(!_0x1df4c8[_0x1cc78a(0x20a)])throw new SDKError(ErrorCode[_0x1cc78a(0x19f)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4e4dab=await withSpinner(_0x1cc78a(0x1cf),()=>_0x4f018d[_0x1cc78a(0x225)][_0x1cc78a(0x20e)](_0x1df4c8[_0x1cc78a(0x20a)]),{'verbose':_0x2376fc[_0x1cc78a(0x1dd)]});await handleSingleObjectOutput(_0x4e4dab[_0x1cc78a(0x22c)],_0x2376fc);}else{if(_0x1df4c8[_0x1cc78a(0x1fa)]===_0x1cc78a(0x225)){if(!_0x1df4c8['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1cc78a(0x1fd));const _0x515df9=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4f018d['segment'][_0x1cc78a(0x1c9)](_0x1df4c8[_0x1cc78a(0x1ad)],_0x1df4c8[_0x1cc78a(0x226)]),{'verbose':_0x2376fc[_0x1cc78a(0x1dd)]});await handleSingleObjectOutput(_0x515df9[_0x1cc78a(0x22c)],_0x2376fc);}}}return 0x0;}catch(_0xf8c429){if(_0xf8c429 instanceof SDKError)return console[_0x1cc78a(0x1ec)](_0x1cc78a(0x201)+_0xf8c429[_0x1cc78a(0x1c4)]),_0xf8c429[_0x1cc78a(0x1db)]&&console[_0x1cc78a(0x1ec)](_0x1cc78a(0x196)+_0xf8c429['cause']),0x1;throw _0xf8c429;}}}function a27_0x5ea1(_0x5da566,_0x23dbdb){_0x5da566=_0x5da566-0x195;const _0x32117a=a27_0x3211();let _0x5ea125=_0x32117a[_0x5da566];return _0x5ea125;}export class SegmentShowCommand extends BaseCommand{['name']=a27_0x1fbaef(0x1ca);[a27_0x1fbaef(0x1b9)]=a27_0x1fbaef(0x204);async['execute'](_0xeec216){const _0x11bb34=a27_0x1fbaef,{options:_0x530231,args:_0x329de3,tdx:_0x1b7675}=_0xeec216,_0x2bebe5=_0x329de3[0x0];if(!_0x2bebe5)return console[_0x11bb34(0x1ec)](_0x11bb34(0x1c6)),console['error'](_0x11bb34(0x19d)),console['error'](_0x11bb34(0x1d9)),console['error'](_0x11bb34(0x1ef)),console['error'](_0x11bb34(0x216)),console[_0x11bb34(0x1ec)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x611f97=_0x530231[_0x11bb34(0x1f4)],_0x30a6f4=await resolveSegmentTarget(_0x2bebe5,_0x611f97,_0x530231['verbose']);_0x530231[_0x11bb34(0x1dd)]&&console[_0x11bb34(0x1ec)]('Target\x20path:\x20'+_0x30a6f4);const _0xa233d1=await withSpinner(_0x11bb34(0x21b)+_0x2bebe5+_0x11bb34(0x1ff),()=>_0x1b7675['segment']['resolvePathToResource'](_0x30a6f4),{'verbose':_0x530231[_0x11bb34(0x1dd)]}),_0x4c1035=_0xa233d1[_0x11bb34(0x22c)];_0x530231['verbose']&&(console[_0x11bb34(0x1ec)](_0x11bb34(0x1ee)+_0x4c1035[_0x11bb34(0x1fa)]),console['error'](_0x11bb34(0x1d6)+_0x4c1035[_0x11bb34(0x1ad)]));if(_0x4c1035[_0x11bb34(0x1fa)]===_0x11bb34(0x213))return console[_0x11bb34(0x1ec)](_0x11bb34(0x1a0)),console[_0x11bb34(0x1ec)](_0x11bb34(0x1b3)),0x1;if(_0x4c1035[_0x11bb34(0x1fa)]===_0x11bb34(0x218))return console['error'](_0x11bb34(0x1af)),console['error'](_0x11bb34(0x1ac)),0x1;if(!_0x4c1035[_0x11bb34(0x226)])throw new SDKError(ErrorCode[_0x11bb34(0x22a)],_0x11bb34(0x1fd));const _0x30dea4=await withSpinner(_0x11bb34(0x1f0),()=>_0x1b7675[_0x11bb34(0x225)][_0x11bb34(0x221)](_0x4c1035[_0x11bb34(0x1ad)],_0x4c1035[_0x11bb34(0x226)]),{'verbose':_0x530231[_0x11bb34(0x1dd)]});let _0x5427e0=_0x30dea4[_0x11bb34(0x22c)];const _0x20cd20=resolveLimit(_0x530231[_0x11bb34(0x209)],DEFAULT_DISPLAY_LIMIT),_0x418c17=/\bLIMIT\s+\d+/i[_0x11bb34(0x202)](_0x5427e0);!_0x418c17&&(_0x5427e0=_0x5427e0[_0x11bb34(0x1a5)]()[_0x11bb34(0x1ea)](/;+$/,''),_0x5427e0=_0x11bb34(0x211)+_0x5427e0+_0x11bb34(0x1bc)+_0x20cd20);_0x530231[_0x11bb34(0x1dd)]&&console[_0x11bb34(0x1ec)]('SQL\x20query:\x0a'+_0x5427e0);const _0x3cf8e7=await withProgressSpinner('Executing\x20segment\x20query...',async _0x38e3a4=>{const _0x2045a1=_0x11bb34,_0x1cbe32=await _0x1b7675[_0x2045a1(0x1d3)]['execute'](_0x5427e0,{'catalog':'td','schema':'information_schema','onJobId':_0x534279=>{const _0x48d7cb=_0x2045a1;_0x38e3a4[_0x48d7cb(0x1f7)](_0x534279);}});return _0x1cbe32;},{'verbose':_0x530231[_0x11bb34(0x1dd)]}),_0x150b5b=_0x3cf8e7['data'],_0x31bc4f=_0x150b5b[_0x11bb34(0x212)]?_0x11bb34(0x1ce)+_0x150b5b[_0x11bb34(0x212)]+']':'';return console[_0x11bb34(0x1ec)](_0x11bb34(0x1e5)+_0x150b5b['stats']['processedRows'][_0x11bb34(0x1cc)]()+_0x11bb34(0x1c5)+('in\x20'+formatElapsed(_0x150b5b[_0x11bb34(0x1f2)]['elapsedTimeMillis'])+_0x31bc4f)),await handleQueryOutput(_0x150b5b,_0x530231),0x0;}catch(_0x27d4b3){if(_0x27d4b3 instanceof SDKError)return console['error']('✖\x20Query\x20failed\x20['+_0x27d4b3[_0x11bb34(0x21d)]+']'),console['error']('\x0a'+_0x27d4b3['message']),0x1;throw _0x27d4b3;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x1fbaef(0x1f9);[a27_0x1fbaef(0x1b9)]=a27_0x1fbaef(0x1e3);async[a27_0x1fbaef(0x1d7)](_0x2be399){const _0x16e8ce=a27_0x1fbaef,{options:_0x5d12e1,args:_0x4a9408,tdx:_0x3d5690}=_0x2be399;if(_0x4a9408[_0x16e8ce(0x227)]===0x0)return console['error'](_0x16e8ce(0x1bb)),console[_0x16e8ce(0x1ec)](_0x16e8ce(0x21f)),0x1;const _0x3683ed=_0x4a9408[0x0];try{_0x5d12e1['verbose']&&(console[_0x16e8ce(0x1ec)](_0x16e8ce(0x1f1)+_0x5d12e1[_0x16e8ce(0x1ab)]),console[_0x16e8ce(0x1ec)]('Parent\x20name:\x20'+_0x3683ed));const _0x13c96b=await withSpinner(_0x16e8ce(0x1b2)+_0x3683ed+'\x27...',()=>_0x3d5690[_0x16e8ce(0x225)]['resolveParentId'](_0x3683ed),{'verbose':_0x5d12e1[_0x16e8ce(0x1dd)]}),_0xa9268a=_0x13c96b['data'];_0x5d12e1[_0x16e8ce(0x1dd)]&&console['error'](_0x16e8ce(0x205)+_0xa9268a);const _0x34ac8c=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x3683ed+'\x27...',()=>_0x3d5690[_0x16e8ce(0x225)][_0x16e8ce(0x19c)](_0xa9268a),{'verbose':_0x5d12e1[_0x16e8ce(0x1dd)]}),_0x381f99=_0x34ac8c[_0x16e8ce(0x22c)];return console['error'](_0x16e8ce(0x223)+_0x381f99['length']+_0x16e8ce(0x1f5)+(_0x381f99[_0x16e8ce(0x227)]!==0x1?'s':'')),await handleSDKOutput(_0x381f99,_0x5d12e1),0x0;}catch(_0x137055){if(_0x137055 instanceof SDKError)return console[_0x16e8ce(0x1ec)]('Error:\x20'+_0x137055[_0x16e8ce(0x1c4)]),_0x137055['cause']&&console[_0x16e8ce(0x1ec)](_0x16e8ce(0x196)+_0x137055[_0x16e8ce(0x1db)]),0x1;throw _0x137055;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x1fbaef(0x228)]=a27_0x1fbaef(0x19e);[a27_0x1fbaef(0x1b9)]=a27_0x1fbaef(0x1fe);async[a27_0x1fbaef(0x1d7)](_0x1d5379){const _0xe7c60=a27_0x1fbaef,{options:_0x15d7eb,args:_0x595cb1,tdx:_0xf5f241}=_0x1d5379;if(_0x595cb1['length']===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xe7c60(0x1ec)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x579773,childId:_0x7668b6}=parseSegmentRef(_0x595cb1[0x0]);_0x15d7eb[_0xe7c60(0x1dd)]&&(console['error'](_0xe7c60(0x1f1)+_0x15d7eb[_0xe7c60(0x1ab)]),console[_0xe7c60(0x1ec)]('Parent\x20name:\x20'+_0x579773),_0x7668b6&&console[_0xe7c60(0x1ec)](_0xe7c60(0x22e)+_0x7668b6));if(!_0x7668b6)return console['error'](_0xe7c60(0x1ae)),0x1;const _0x5b1ef5=await withSpinner(_0xe7c60(0x1b2)+_0x579773+_0xe7c60(0x1ff),()=>_0xf5f241[_0xe7c60(0x225)]['resolveParentId'](_0x579773),{'verbose':_0x15d7eb[_0xe7c60(0x1dd)]}),_0x51e155=_0x5b1ef5[_0xe7c60(0x22c)];_0x15d7eb[_0xe7c60(0x1dd)]&&console[_0xe7c60(0x1ec)](_0xe7c60(0x205)+_0x51e155);const _0x4cde9b=await withSpinner(_0xe7c60(0x19a)+_0x7668b6+_0xe7c60(0x1ff),()=>_0xf5f241[_0xe7c60(0x225)][_0xe7c60(0x22d)](_0x51e155,_0x7668b6),{'verbose':_0x15d7eb[_0xe7c60(0x1dd)]}),_0x267a47=_0x4cde9b['data'];_0x15d7eb[_0xe7c60(0x1dd)]&&console[_0xe7c60(0x1ec)](_0xe7c60(0x1a9)+_0x267a47);const _0x501200=await withSpinner(_0xe7c60(0x1b1)+_0x7668b6+_0xe7c60(0x1ff),()=>_0xf5f241['segment'][_0xe7c60(0x20e)](_0x267a47),{'verbose':_0x15d7eb[_0xe7c60(0x1dd)]});return await handleSDKOutput([_0x501200[_0xe7c60(0x22c)]],_0x15d7eb),0x0;}catch(_0x59df66){if(_0x59df66 instanceof SDKError)return console[_0xe7c60(0x1ec)](_0xe7c60(0x201)+_0x59df66[_0xe7c60(0x1c4)]),_0x59df66[_0xe7c60(0x1db)]&&console[_0xe7c60(0x1ec)](_0xe7c60(0x196)+_0x59df66[_0xe7c60(0x1db)]),0x1;throw _0x59df66;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';[a27_0x1fbaef(0x1b9)]=a27_0x1fbaef(0x215);async[a27_0x1fbaef(0x1d7)](_0x6a7b7){const _0x377e29=a27_0x1fbaef,{options:_0x111594,args:_0x124a07,tdx:_0x125f53}=_0x6a7b7,_0x1ff88a=_0x124a07[0x0];if(!_0x1ff88a)return console[_0x377e29(0x1ec)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x377e29(0x1ec)](_0x377e29(0x1a7)),console[_0x377e29(0x1ec)](_0x377e29(0x1ba)),console[_0x377e29(0x1ec)](_0x377e29(0x1ef)),console[_0x377e29(0x1ec)](_0x377e29(0x1d2)),console['error'](_0x377e29(0x1d5)),0x1;try{const _0x2d6409=_0x111594[_0x377e29(0x1f4)],_0x4b867b=await resolveSegmentTarget(_0x1ff88a,_0x2d6409,_0x111594[_0x377e29(0x1dd)]);_0x111594['verbose']&&console[_0x377e29(0x1ec)](_0x377e29(0x1e7)+_0x4b867b);const _0x2dea65=await withSpinner(_0x377e29(0x21b)+_0x1ff88a+_0x377e29(0x1ff),()=>_0x125f53['segment'][_0x377e29(0x1b5)](_0x4b867b),{'verbose':_0x111594['verbose']}),_0x42016b=_0x2dea65['data'];_0x111594[_0x377e29(0x1dd)]&&(console[_0x377e29(0x1ec)](_0x377e29(0x1ee)+_0x42016b[_0x377e29(0x1fa)]),console[_0x377e29(0x1ec)](_0x377e29(0x1d6)+_0x42016b[_0x377e29(0x1ad)]));if(_0x42016b[_0x377e29(0x1fa)]===_0x377e29(0x213))return console[_0x377e29(0x1ec)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x377e29(0x1ec)](_0x377e29(0x1c1)),0x1;if(_0x42016b[_0x377e29(0x1fa)]===_0x377e29(0x218))return console[_0x377e29(0x1ec)](_0x377e29(0x1d4)),console[_0x377e29(0x1ec)](_0x377e29(0x1cb)),0x1;if(!_0x42016b[_0x377e29(0x226)])throw new SDKError(ErrorCode[_0x377e29(0x22a)],_0x377e29(0x1fd));const _0x4413db=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x125f53[_0x377e29(0x225)][_0x377e29(0x221)](_0x42016b[_0x377e29(0x1ad)],_0x42016b[_0x377e29(0x226)]),{'verbose':_0x111594[_0x377e29(0x1dd)]}),_0x596a1d=_0x4413db[_0x377e29(0x22c)];return _0x111594[_0x377e29(0x21a)]==='json'||_0x111594[_0x377e29(0x21a)]===_0x377e29(0x1df)?await handleSDKOutput([{'sql':_0x596a1d}],_0x111594):console[_0x377e29(0x1e1)](_0x596a1d),0x0;}catch(_0x5a9035){if(_0x5a9035 instanceof SDKError)return console[_0x377e29(0x1ec)]('Error:\x20'+_0x5a9035[_0x377e29(0x1c4)]),_0x5a9035[_0x377e29(0x1db)]&&console[_0x377e29(0x1ec)](_0x377e29(0x196)+_0x5a9035[_0x377e29(0x1db)]),0x1;throw _0x5a9035;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x1fbaef(0x228)]='segment:folder:create';[a27_0x1fbaef(0x1b9)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x2354fa){const _0x1dfc0e=a27_0x1fbaef,{options:_0x5d8700,args:_0x4e575d,tdx:_0x27a20e}=_0x2354fa,_0x4d06e8=_0x5d8700;if(_0x4e575d[_0x1dfc0e(0x227)]<0x2)return console[_0x1dfc0e(0x1ec)](_0x1dfc0e(0x1d8)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x63d2e5=_0x4e575d[0x0],_0x20ebda=_0x4e575d[0x1];_0x4d06e8[_0x1dfc0e(0x1dd)]&&(console['error']('Site:\x20'+_0x4d06e8['site']),console[_0x1dfc0e(0x1ec)](_0x1dfc0e(0x195)+_0x63d2e5),console[_0x1dfc0e(0x1ec)](_0x1dfc0e(0x22e)+_0x20ebda));let _0x3eea24;if(_0x4d06e8['parentFolder']){const _0x2f1fe0=_0x4d06e8[_0x1dfc0e(0x1b7)],_0x1d654b=await withSpinner(_0x1dfc0e(0x1b2)+_0x63d2e5+_0x1dfc0e(0x1ff),()=>_0x27a20e['segment']['resolveParentId'](_0x63d2e5),{'verbose':_0x4d06e8['verbose']}),_0x3037a1=_0x1d654b[_0x1dfc0e(0x22c)],_0x550708=await withSpinner(_0x1dfc0e(0x1e6)+_0x2f1fe0+_0x1dfc0e(0x1ff),()=>_0x27a20e[_0x1dfc0e(0x225)][_0x1dfc0e(0x22d)](_0x3037a1,_0x2f1fe0),{'verbose':_0x4d06e8[_0x1dfc0e(0x1dd)]});_0x3eea24=_0x550708[_0x1dfc0e(0x22c)],_0x4d06e8['verbose']&&console['error'](_0x1dfc0e(0x1d0)+_0x3eea24);}const _0x574ab5={'name':_0x20ebda,'description':_0x4d06e8['description'],'parentFolderId':_0x3eea24},_0x31a971=await withSpinner('Creating\x20folder\x20\x27'+_0x20ebda+_0x1dfc0e(0x1ff),()=>_0x27a20e[_0x1dfc0e(0x225)]['createFolder'](_0x63d2e5,_0x574ab5),{'verbose':_0x4d06e8[_0x1dfc0e(0x1dd)]}),_0x4a1bec=_0x31a971[_0x1dfc0e(0x22c)];return console[_0x1dfc0e(0x1ec)](_0x1dfc0e(0x203)+_0x4a1bec[_0x1dfc0e(0x228)]+_0x1dfc0e(0x1e8)+_0x4a1bec['id']),await handleSDKOutput([_0x4a1bec],_0x4d06e8),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x1fbaef(0x228)]=a27_0x1fbaef(0x1c8);[a27_0x1fbaef(0x1b9)]=a27_0x1fbaef(0x1f8);async[a27_0x1fbaef(0x1d7)](_0x4a404c){const _0x5b7aa2=a27_0x1fbaef,{options:_0x2628bb,args:_0x1cc6e9,tdx:_0x5bcbad}=_0x4a404c,_0x1f20bb=_0x1cc6e9[0x0];if(!_0x1f20bb)return console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x1a1)),console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x199)),console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x217)),console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x210)),console[_0x5b7aa2(0x1ec)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x5b7aa2(0x1ec)]('Examples:'),console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x222)),console['error'](_0x5b7aa2(0x1e0)),console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x1de)),console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x19b)),0x1;try{const _0x1d37b6=_0x2628bb[_0x5b7aa2(0x1f4)],_0x12eebe=await resolveSegmentTarget(_0x1f20bb,_0x1d37b6,_0x2628bb[_0x5b7aa2(0x1dd)]);_0x2628bb[_0x5b7aa2(0x1dd)]&&console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x1e7)+_0x12eebe);const _0x1e6cf8=await withSpinner('Resolving\x20\x27'+_0x1f20bb+_0x5b7aa2(0x1ff),()=>_0x5bcbad[_0x5b7aa2(0x225)][_0x5b7aa2(0x1b5)](_0x12eebe),{'verbose':_0x2628bb[_0x5b7aa2(0x1dd)]}),_0x395fa8=_0x1e6cf8['data'];_0x2628bb[_0x5b7aa2(0x1dd)]&&(console['error'](_0x5b7aa2(0x1ee)+_0x395fa8[_0x5b7aa2(0x1fa)]),console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x1d6)+_0x395fa8[_0x5b7aa2(0x1ad)]),_0x395fa8[_0x5b7aa2(0x20a)]&&console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x214)+_0x395fa8['folderId']),_0x395fa8[_0x5b7aa2(0x226)]&&console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x1fc)+_0x395fa8[_0x5b7aa2(0x226)]));if(_0x2628bb['web']){if(_0x395fa8[_0x5b7aa2(0x1fa)]===_0x5b7aa2(0x213))return console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x1b4)),0x1;if(_0x395fa8[_0x5b7aa2(0x1fa)]===_0x5b7aa2(0x218))return console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x1b0)),console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x1fb)),0x1;if(!_0x395fa8[_0x5b7aa2(0x226)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5b7aa2(0x1fd));const _0xfde2b6=getConsoleNextUrl(_0x2628bb['site'],'/app/ps/'+_0x395fa8[_0x5b7aa2(0x1ad)]+_0x5b7aa2(0x1a6)+_0x395fa8[_0x5b7aa2(0x226)]);return console[_0x5b7aa2(0x1ec)](a27_0x4423df['green']('✔')+_0x5b7aa2(0x1bd)+a27_0x4423df[_0x5b7aa2(0x21e)](_0xfde2b6)),openBrowser(_0xfde2b6),0x0;}if(_0x395fa8[_0x5b7aa2(0x1fa)]===_0x5b7aa2(0x213)){if(!_0x395fa8[_0x5b7aa2(0x20a)])throw new SDKError(ErrorCode[_0x5b7aa2(0x19f)],_0x5b7aa2(0x1ed));const _0x566f69=await withSpinner(_0x5b7aa2(0x1cf),()=>_0x5bcbad['segment'][_0x5b7aa2(0x20e)](_0x395fa8[_0x5b7aa2(0x20a)]),{'verbose':_0x2628bb['verbose']});await handleSingleObjectOutput(_0x566f69[_0x5b7aa2(0x22c)],_0x2628bb);}else{if(_0x395fa8['type']===_0x5b7aa2(0x225)){if(!_0x395fa8[_0x5b7aa2(0x226)])throw new SDKError(ErrorCode[_0x5b7aa2(0x22a)],_0x5b7aa2(0x1fd));const _0x5dd937=await withSpinner('Fetching\x20segment\x20details...',()=>_0x5bcbad['segment']['getSegment'](_0x395fa8[_0x5b7aa2(0x1ad)],_0x395fa8[_0x5b7aa2(0x226)]),{'verbose':_0x2628bb[_0x5b7aa2(0x1dd)]}),_0x1b4167=getConsoleNextUrl(_0x2628bb[_0x5b7aa2(0x1ab)],'/app/ps/'+_0x395fa8['parentId']+_0x5b7aa2(0x1a6)+_0x395fa8[_0x5b7aa2(0x226)]),_0x32f4f6=_0x5dd937[_0x5b7aa2(0x22c)];_0x32f4f6[_0x5b7aa2(0x1e4)]=_0x1b4167,await handleSingleObjectOutput(_0x32f4f6,_0x2628bb);}else return console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x21c)),console[_0x5b7aa2(0x1ec)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x5f596b){if(_0x5f596b instanceof SDKError)return console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x201)+_0x5f596b['message']),_0x5f596b['cause']&&console[_0x5b7aa2(0x1ec)](_0x5b7aa2(0x196)+_0x5f596b[_0x5b7aa2(0x1db)]),0x1;throw _0x5f596b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';['description']=a27_0x1fbaef(0x1f3);async[a27_0x1fbaef(0x1d7)](_0x15e932){const _0x3c2539=a27_0x1fbaef,{options:_0xe7cd18,args:_0x278c7,tdx:_0x1bb938}=_0x15e932,_0xa96294=_0x278c7[0x0];if(!_0xa96294)return console[_0x3c2539(0x1ec)](_0x3c2539(0x1c6)),console[_0x3c2539(0x1ec)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x3c2539(0x1ec)](_0x3c2539(0x1b8)),console['error']('Examples:'),console[_0x3c2539(0x1ec)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x3c2539(0x1bf)),0x1;try{const _0x34be73=_0xe7cd18['parentSegment'],_0x3743ec=await resolveSegmentTarget(_0xa96294,_0x34be73,_0xe7cd18[_0x3c2539(0x1dd)]);_0xe7cd18[_0x3c2539(0x1dd)]&&console[_0x3c2539(0x1ec)](_0x3c2539(0x1e7)+_0x3743ec);const _0x35e311=await withSpinner(_0x3c2539(0x21b)+_0xa96294+'\x27...',()=>_0x1bb938['segment'][_0x3c2539(0x1b5)](_0x3743ec),{'verbose':_0xe7cd18['verbose']}),_0x2fb64a=_0x35e311[_0x3c2539(0x22c)];_0xe7cd18[_0x3c2539(0x1dd)]&&(console[_0x3c2539(0x1ec)]('Resolved\x20type:\x20'+_0x2fb64a[_0x3c2539(0x1fa)]),console['error'](_0x3c2539(0x1d6)+_0x2fb64a[_0x3c2539(0x1ad)]));if(_0x2fb64a[_0x3c2539(0x1fa)]===_0x3c2539(0x213))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0x3c2539(0x1c1)),0x1;if(_0x2fb64a[_0x3c2539(0x1fa)]===_0x3c2539(0x218))return console[_0x3c2539(0x1ec)](_0x3c2539(0x22b)),console[_0x3c2539(0x1ec)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x2fb64a[_0x3c2539(0x226)])throw new SDKError(ErrorCode[_0x3c2539(0x22a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x453a32=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1bb938[_0x3c2539(0x225)][_0x3c2539(0x221)](_0x2fb64a[_0x3c2539(0x1ad)],_0x2fb64a[_0x3c2539(0x226)]),{'verbose':_0xe7cd18['verbose']}),_0x2eb294=_0x453a32[_0x3c2539(0x22c)],_0x1502b7=await executeSchemaQuery(_0x2eb294,_0x1bb938,_0xe7cd18);return await handleQueryOutput(_0x1502b7,_0xe7cd18),0x0;}catch(_0x264087){if(_0x264087 instanceof SDKError)return console[_0x3c2539(0x1ec)]('Error:\x20'+_0x264087[_0x3c2539(0x1c4)]),_0x264087[_0x3c2539(0x1db)]&&console[_0x3c2539(0x1ec)](_0x3c2539(0x196)+_0x264087[_0x3c2539(0x1db)]),0x1;throw _0x264087;}}}
|
|
1
|
+
const a27_0x165cdf=a27_0x187d;(function(_0x504fd7,_0x3e2377){const _0x990129=a27_0x187d,_0x4ccf27=_0x504fd7();while(!![]){try{const _0x2c6bd0=parseInt(_0x990129(0xb4))/0x1*(parseInt(_0x990129(0xac))/0x2)+parseInt(_0x990129(0xb2))/0x3*(parseInt(_0x990129(0xd0))/0x4)+-parseInt(_0x990129(0x137))/0x5*(-parseInt(_0x990129(0x107))/0x6)+parseInt(_0x990129(0xbe))/0x7+-parseInt(_0x990129(0x134))/0x8+parseInt(_0x990129(0x13a))/0x9+-parseInt(_0x990129(0xad))/0xa*(parseInt(_0x990129(0x128))/0xb);if(_0x2c6bd0===_0x3e2377)break;else _0x4ccf27['push'](_0x4ccf27['shift']());}catch(_0x4039d5){_0x4ccf27['push'](_0x4ccf27['shift']());}}}(a27_0x18a1,0xa9c73));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x3de727 from'chalk';async function resolveSegmentTarget(_0x260a58,_0x297775,_0x5f3f5c){const _0x36befd=a27_0x187d;if(isYamlFilePath(_0x260a58))try{const _0x3426b5=await resolveYamlFilePath(_0x260a58);return _0x5f3f5c&&(console[_0x36befd(0x11c)](_0x36befd(0x127)+_0x260a58),console[_0x36befd(0x11c)](_0x36befd(0xb9)+_0x3426b5[_0x36befd(0xbc)]),console[_0x36befd(0x11c)](_0x36befd(0xb6)+_0x3426b5[_0x36befd(0x122)]),console['error'](_0x36befd(0xc1)+(_0x3426b5[_0x36befd(0x126)]||_0x36befd(0xb5))),console['error']('\x20\x20Full\x20path:\x20'+_0x3426b5[_0x36befd(0xbb)])),_0x3426b5[_0x36befd(0xbb)];}catch(_0x111bd7){throw new SDKError(ErrorCode[_0x36befd(0x10a)],_0x36befd(0x13b)+_0x111bd7[_0x36befd(0xaa)]);}if(!_0x297775)throw new SDKError(ErrorCode[_0x36befd(0x10a)],_0x36befd(0xd4));return _0x297775+'/'+_0x260a58;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x165cdf(0x110)]=a27_0x165cdf(0x124);[a27_0x165cdf(0xc6)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x165cdf(0x10f)](_0x351275){const _0x353455=a27_0x165cdf,{options:_0x2f91a9,args:_0x5e56ff,tdx:_0x390dda}=_0x351275,_0x58ddec=_0x5e56ff[0x0],_0x1818cf=!_0x58ddec&&!!_0x2f91a9[_0x353455(0xbc)],_0x7799b9=_0x58ddec||_0x2f91a9[_0x353455(0xbc)];if(!_0x7799b9)return console[_0x353455(0x11c)](_0x353455(0x109)),console[_0x353455(0x11c)](_0x353455(0x10b)),console['error'](_0x353455(0xd3)),console[_0x353455(0x11c)](_0x353455(0x12c)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x353455(0x11c)](_0x353455(0xc3)),console[_0x353455(0x11c)](_0x353455(0xcf)),0x1;try{const _0x11107a=_0x2f91a9[_0x353455(0xaf)];let _0x588c1b=_0x7799b9;!_0x1818cf&&_0x11107a&&!_0x7799b9['includes']('/')&&(_0x588c1b=_0x11107a+'/'+_0x7799b9,_0x2f91a9[_0x353455(0x11d)]&&console['error'](_0x353455(0x135)+_0x588c1b));const _0x1382d7=await withSpinner(_0x353455(0x118)+_0x588c1b+_0x353455(0x111),()=>_0x390dda[_0x353455(0xbd)][_0x353455(0x130)](_0x588c1b),{'verbose':_0x2f91a9[_0x353455(0x11d)]}),_0xa5de55=_0x1382d7[_0x353455(0x10e)];_0x2f91a9[_0x353455(0x11d)]&&(console['error'](_0x353455(0xba)+_0xa5de55[_0x353455(0xde)]),console['error']('Parent\x20ID:\x20'+_0xa5de55['parentId']),_0xa5de55[_0x353455(0xf8)]&&console['error'](_0x353455(0x114)+_0xa5de55[_0x353455(0xf8)]),_0xa5de55[_0x353455(0x125)]&&console[_0x353455(0x11c)]('Segment\x20ID:\x20'+_0xa5de55['segmentId']));if(_0xa5de55[_0x353455(0xde)]===_0x353455(0x12b)){const _0x317ddf=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x390dda['segment'][_0x353455(0x102)](_0xa5de55[_0x353455(0x101)]),{'verbose':_0x2f91a9['verbose']});await handleSingleObjectOutput(_0x317ddf[_0x353455(0x10e)],_0x2f91a9);}else{if(_0xa5de55[_0x353455(0xde)]===_0x353455(0xe8)){if(!_0xa5de55[_0x353455(0xf8)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x8eca34=await withSpinner(_0x353455(0x123),()=>_0x390dda['segment'][_0x353455(0xd6)](_0xa5de55[_0x353455(0xf8)]),{'verbose':_0x2f91a9[_0x353455(0x11d)]});await handleSingleObjectOutput(_0x8eca34[_0x353455(0x10e)],_0x2f91a9);}else{if(_0xa5de55[_0x353455(0xde)]==='segment'){if(!_0xa5de55[_0x353455(0x125)])throw new SDKError(ErrorCode[_0x353455(0xc2)],_0x353455(0xce));const _0x3763b7=await withSpinner('Fetching\x20segment\x20details...',()=>_0x390dda[_0x353455(0xbd)][_0x353455(0x12a)](_0xa5de55[_0x353455(0x101)],_0xa5de55[_0x353455(0x125)]),{'verbose':_0x2f91a9[_0x353455(0x11d)]});await handleSingleObjectOutput(_0x3763b7[_0x353455(0x10e)],_0x2f91a9);}}}return 0x0;}catch(_0x454914){if(_0x454914 instanceof SDKError)return console[_0x353455(0x11c)](_0x353455(0x138)+_0x454914[_0x353455(0xaa)]),_0x454914[_0x353455(0xf7)]&&console[_0x353455(0x11c)](_0x353455(0xfe)+_0x454914[_0x353455(0xf7)]),0x1;throw _0x454914;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x165cdf(0x110)]='segment:show';['description']=a27_0x165cdf(0xcc);async[a27_0x165cdf(0x10f)](_0x1f1f6b){const _0x2d94ff=a27_0x165cdf,{options:_0xb1b54e,args:_0x57b49d,tdx:_0x366ef3}=_0x1f1f6b,_0xa234c=_0x57b49d[0x0];if(!_0xa234c)return console[_0x2d94ff(0x11c)](_0x2d94ff(0xdd)),console[_0x2d94ff(0x11c)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x2d94ff(0x11c)](_0x2d94ff(0xd3)),console[_0x2d94ff(0x11c)](_0x2d94ff(0xc7)),console[_0x2d94ff(0x11c)](_0x2d94ff(0xfb)),0x1;try{const _0x5135c8=_0xb1b54e[_0x2d94ff(0xbc)],_0x218c54=await resolveSegmentTarget(_0xa234c,_0x5135c8,_0xb1b54e[_0x2d94ff(0x11d)]);_0xb1b54e[_0x2d94ff(0x11d)]&&console[_0x2d94ff(0x11c)](_0x2d94ff(0xdc)+_0x218c54);const _0x522b2e=await withSpinner(_0x2d94ff(0xef)+_0xa234c+_0x2d94ff(0x111),()=>_0x366ef3[_0x2d94ff(0xbd)]['resolvePathToResource'](_0x218c54),{'verbose':_0xb1b54e['verbose']}),_0x5ac8eb=_0x522b2e[_0x2d94ff(0x10e)];_0xb1b54e[_0x2d94ff(0x11d)]&&(console['error'](_0x2d94ff(0xba)+_0x5ac8eb[_0x2d94ff(0xde)]),console['error'](_0x2d94ff(0xb0)+_0x5ac8eb[_0x2d94ff(0x101)]));if(_0x5ac8eb['type']==='folder')return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x2d94ff(0x11c)](_0x2d94ff(0xbf)),0x1;if(_0x5ac8eb[_0x2d94ff(0xde)]===_0x2d94ff(0x12b))return console[_0x2d94ff(0x11c)](_0x2d94ff(0x106)),console[_0x2d94ff(0x11c)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x5ac8eb['segmentId'])throw new SDKError(ErrorCode[_0x2d94ff(0xc2)],_0x2d94ff(0xce));const _0x464976=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x366ef3['segment'][_0x2d94ff(0xf4)](_0x5ac8eb[_0x2d94ff(0x101)],_0x5ac8eb[_0x2d94ff(0x125)]),{'verbose':_0xb1b54e[_0x2d94ff(0x11d)]});let _0x13c83b=_0x464976[_0x2d94ff(0x10e)];const _0x14985b=resolveLimit(_0xb1b54e[_0x2d94ff(0x105)],DEFAULT_DISPLAY_LIMIT),_0x55ab31=/\bLIMIT\s+\d+/i['test'](_0x13c83b);!_0x55ab31&&(_0x13c83b=_0x13c83b[_0x2d94ff(0xd2)]()[_0x2d94ff(0x136)](/;+$/,''),_0x13c83b=_0x2d94ff(0x11a)+_0x13c83b+_0x2d94ff(0x132)+_0x14985b);_0xb1b54e[_0x2d94ff(0x11d)]&&console[_0x2d94ff(0x11c)]('SQL\x20query:\x0a'+_0x13c83b);const _0x5527f5=await withProgressSpinner(_0x2d94ff(0xc9),async _0x1dc91c=>{const _0x4698ab=_0x2d94ff,_0x313aeb=await _0x366ef3[_0x4698ab(0xf2)][_0x4698ab(0x10f)](_0x13c83b,{'catalog':'td','schema':_0x4698ab(0x117),'onJobId':_0x4d1f61=>{const _0xe38689=_0x4698ab;_0x1dc91c[_0xe38689(0xdf)](_0x4d1f61);}});return _0x313aeb;},{'verbose':_0xb1b54e[_0x2d94ff(0x11d)]}),_0x536136=_0x5527f5['data'],_0x1dddb5=_0x536136['jobId']?'\x20[Job\x20ID:\x20'+_0x536136[_0x2d94ff(0xa8)]+']':'';return console[_0x2d94ff(0x11c)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x536136[_0x2d94ff(0x11e)][_0x2d94ff(0xee)]['toLocaleString']()+'\x20rows\x20'+(_0x2d94ff(0x12f)+formatElapsed(_0x536136[_0x2d94ff(0x11e)]['elapsedTimeMillis'])+_0x1dddb5)),await handleQueryOutput(_0x536136,_0xb1b54e),0x0;}catch(_0x11d757){if(_0x11d757 instanceof SDKError)return console[_0x2d94ff(0x11c)]('✖\x20Query\x20failed\x20['+_0x11d757['code']+']'),console[_0x2d94ff(0x11c)]('\x0a'+_0x11d757[_0x2d94ff(0xaa)]),0x1;throw _0x11d757;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x165cdf(0x110)]='segment:folder:list';[a27_0x165cdf(0xc6)]=a27_0x165cdf(0x108);async[a27_0x165cdf(0x10f)](_0x2174ff){const _0x2bdfe5=a27_0x165cdf,{options:_0x29891d,args:_0x57f15b,tdx:_0x4c2533}=_0x2174ff;if(_0x57f15b[_0x2bdfe5(0xd9)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x2bdfe5(0x11c)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x5b773d=_0x57f15b[0x0];try{_0x29891d[_0x2bdfe5(0x11d)]&&(console['error'](_0x2bdfe5(0xa9)+_0x29891d['site']),console['error'](_0x2bdfe5(0x129)+_0x5b773d));const _0x199967=await withSpinner(_0x2bdfe5(0xd7)+_0x5b773d+_0x2bdfe5(0x111),()=>_0x4c2533[_0x2bdfe5(0xbd)]['resolveParentId'](_0x5b773d),{'verbose':_0x29891d['verbose']}),_0x34bdbf=_0x199967[_0x2bdfe5(0x10e)];_0x29891d[_0x2bdfe5(0x11d)]&&console[_0x2bdfe5(0x11c)](_0x2bdfe5(0xab)+_0x34bdbf);const _0x1ea191=await withSpinner(_0x2bdfe5(0xfc)+_0x5b773d+_0x2bdfe5(0x111),()=>_0x4c2533[_0x2bdfe5(0xbd)][_0x2bdfe5(0xf6)](_0x34bdbf),{'verbose':_0x29891d[_0x2bdfe5(0x11d)]}),_0x11a7d4=_0x1ea191[_0x2bdfe5(0x10e)];return console[_0x2bdfe5(0x11c)]('✔\x20Found\x20'+_0x11a7d4[_0x2bdfe5(0xd9)]+'\x20folder'+(_0x11a7d4[_0x2bdfe5(0xd9)]!==0x1?'s':'')),await handleSDKOutput(_0x11a7d4,_0x29891d),0x0;}catch(_0x364e95){if(_0x364e95 instanceof SDKError)return console['error'](_0x2bdfe5(0x138)+_0x364e95[_0x2bdfe5(0xaa)]),_0x364e95[_0x2bdfe5(0xf7)]&&console[_0x2bdfe5(0x11c)]('\x20\x20Cause:\x20'+_0x364e95[_0x2bdfe5(0xf7)]),0x1;throw _0x364e95;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x165cdf(0x110)]='segment:folder:show';['description']=a27_0x165cdf(0xff);async['execute'](_0x1e2b07){const _0x44b831=a27_0x165cdf,{options:_0x1d8e67,args:_0x54708f,tdx:_0x215d67}=_0x1e2b07;if(_0x54708f[_0x44b831(0xd9)]===0x0)return console['error'](_0x44b831(0xcd)),console[_0x44b831(0x11c)](_0x44b831(0xc5)),0x1;try{const {parentId:_0x379576,childId:_0x45768b}=parseSegmentRef(_0x54708f[0x0]);_0x1d8e67['verbose']&&(console[_0x44b831(0x11c)](_0x44b831(0xa9)+_0x1d8e67[_0x44b831(0xb1)]),console[_0x44b831(0x11c)](_0x44b831(0x129)+_0x379576),_0x45768b&&console[_0x44b831(0x11c)](_0x44b831(0xdb)+_0x45768b));if(!_0x45768b)return console[_0x44b831(0x11c)](_0x44b831(0xc0)),0x1;const _0x445187=await withSpinner(_0x44b831(0xd7)+_0x379576+_0x44b831(0x111),()=>_0x215d67[_0x44b831(0xbd)][_0x44b831(0x115)](_0x379576),{'verbose':_0x1d8e67[_0x44b831(0x11d)]}),_0x2790f7=_0x445187[_0x44b831(0x10e)];_0x1d8e67[_0x44b831(0x11d)]&&console[_0x44b831(0x11c)](_0x44b831(0xab)+_0x2790f7);const _0x1330a7=await withSpinner(_0x44b831(0xb7)+_0x45768b+_0x44b831(0x111),()=>_0x215d67['segment']['resolveFolderId'](_0x2790f7,_0x45768b),{'verbose':_0x1d8e67[_0x44b831(0x11d)]}),_0x11cd45=_0x1330a7[_0x44b831(0x10e)];_0x1d8e67[_0x44b831(0x11d)]&&console[_0x44b831(0x11c)](_0x44b831(0xda)+_0x11cd45);const _0x541c02=await withSpinner(_0x44b831(0x116)+_0x45768b+_0x44b831(0x111),()=>_0x215d67[_0x44b831(0xbd)][_0x44b831(0xd6)](_0x11cd45),{'verbose':_0x1d8e67[_0x44b831(0x11d)]});return await handleSDKOutput([_0x541c02[_0x44b831(0x10e)]],_0x1d8e67),0x0;}catch(_0x1bd701){if(_0x1bd701 instanceof SDKError)return console[_0x44b831(0x11c)](_0x44b831(0x138)+_0x1bd701[_0x44b831(0xaa)]),_0x1bd701[_0x44b831(0xf7)]&&console[_0x44b831(0x11c)](_0x44b831(0xfe)+_0x1bd701['cause']),0x1;throw _0x1bd701;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x165cdf(0x110)]=a27_0x165cdf(0xf1);[a27_0x165cdf(0xc6)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x165cdf(0x10f)](_0x50b96e){const _0x440aba=a27_0x165cdf,{options:_0x1051d4,args:_0x1908c6,tdx:_0x2010a7}=_0x50b96e,_0x2b09f0=_0x1908c6[0x0];if(!_0x2b09f0)return console[_0x440aba(0x11c)](_0x440aba(0xdd)),console[_0x440aba(0x11c)](_0x440aba(0xf5)),console[_0x440aba(0x11c)](_0x440aba(0xf0)),console[_0x440aba(0x11c)](_0x440aba(0xd3)),console[_0x440aba(0x11c)](_0x440aba(0xa7)),console[_0x440aba(0x11c)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2e60da=_0x1051d4[_0x440aba(0xbc)],_0x34732a=await resolveSegmentTarget(_0x2b09f0,_0x2e60da,_0x1051d4[_0x440aba(0x11d)]);_0x1051d4[_0x440aba(0x11d)]&&console[_0x440aba(0x11c)](_0x440aba(0xdc)+_0x34732a);const _0x2d503f=await withSpinner(_0x440aba(0xef)+_0x2b09f0+_0x440aba(0x111),()=>_0x2010a7[_0x440aba(0xbd)]['resolvePathToResource'](_0x34732a),{'verbose':_0x1051d4['verbose']}),_0xdf2c30=_0x2d503f[_0x440aba(0x10e)];_0x1051d4['verbose']&&(console['error'](_0x440aba(0xba)+_0xdf2c30[_0x440aba(0xde)]),console['error'](_0x440aba(0xb0)+_0xdf2c30[_0x440aba(0x101)]));if(_0xdf2c30[_0x440aba(0xde)]==='folder')return console['error'](_0x440aba(0x131)),console[_0x440aba(0x11c)](_0x440aba(0xe4)),0x1;if(_0xdf2c30['type']===_0x440aba(0x12b))return console[_0x440aba(0x11c)](_0x440aba(0xae)),console['error']('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0xdf2c30[_0x440aba(0x125)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x514483=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2010a7['segment']['getSegmentSQL'](_0xdf2c30['parentId'],_0xdf2c30[_0x440aba(0x125)]),{'verbose':_0x1051d4[_0x440aba(0x11d)]}),_0x1d75dd=_0x514483['data'];return _0x1051d4[_0x440aba(0xc8)]===_0x440aba(0xa6)||_0x1051d4[_0x440aba(0xc8)]===_0x440aba(0xea)?await handleSDKOutput([{'sql':_0x1d75dd}],_0x1051d4):console['log'](_0x1d75dd),0x0;}catch(_0x112ec2){if(_0x112ec2 instanceof SDKError)return console[_0x440aba(0x11c)](_0x440aba(0x138)+_0x112ec2[_0x440aba(0xaa)]),_0x112ec2[_0x440aba(0xf7)]&&console['error'](_0x440aba(0xfe)+_0x112ec2['cause']),0x1;throw _0x112ec2;}}}function a27_0x18a1(){const _0x12dea3=['Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','/e/','8154800wjFajy','Resolved\x20relative\x20path\x20to:\x20','replace','227725jCwnEb','Error:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','11089179BmOWnu','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','json','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','jobId','Site:\x20','message','Resolved\x20parent\x20ID:\x20','10sxTnRB','10ojunZN','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segmentPath','Parent\x20ID:\x20','site','9CFOYKr','Show\x20folder\x20or\x20child\x20segment\x20details','203317cyXZNA','(root)','\x20\x20Segment\x20name:\x20','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20Parent\x20segment:\x20','Resolved\x20type:\x20','fullPath','parentSegment','segment','1734593cjdrgT','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20Folder\x20path:\x20','SEGMENT_NOT_FOUND','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','description','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','format','Executing\x20segment\x20query...','Creating\x20folder\x20\x27','resolveFolderId','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Folder\x20reference\x20is\x20required','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','173548RVMGBj','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','trim','Examples:','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Show\x20child\x20segment\x20schema\x20(column\x20types)','getFolder','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','length','Resolved\x20folder\x20ID:\x20','Folder\x20name:\x20','Target\x20path:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','type','setJobId','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','cyan','SEGMENT_FOLDER_NOT_FOUND','segment:folder:create','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','green','Use:\x20tdx\x20ps\x20view','Fetching\x20segment\x20details...','folder','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','jsonl','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Resolved\x20parent\x20folder\x20ID:\x20','processedRows','Resolving\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segment:sql','query','/app/ps/','getSegmentSQL','Usage:\x20tdx\x20sg\x20sql\x20<name>','listFolders','cause','folderId','Resolving\x20parent\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Listing\x20folders\x20for\x20parent\x20\x27','parentFolder','\x20\x20Cause:\x20','Show\x20segment\x20folder\x20details','Use:\x20tdx\x20ps\x20desc','parentId','getParent','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','limit','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','102eycWqt','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Path\x20or\x20name\x20is\x20required','INVALID_ARGUMENT','Usage:\x20tdx\x20segment\x20describe\x20<path>','url','Segment\x20ID:\x20','data','execute','name','\x27...','createFolder','Options:','Folder\x20ID:\x20','resolveParentId','Fetching\x20folder\x20\x27','information_schema','Resolving\x20path\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Created\x20folder\x20\x27','error','verbose','stats','segment:view','Parent\x20segment:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','segmentName','Fetching\x20folder\x20details...','segment:describe','segmentId','folderPath','Resolved\x20YAML\x20file:\x20','18547980PvqcDh','Parent\x20name:\x20','getSegment','parent','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','segment:desc','\x20Opening\x20','in\x20','resolvePathToResource'];a27_0x18a1=function(){return _0x12dea3;};return a27_0x18a1();}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x165cdf(0xe3);[a27_0x165cdf(0xc6)]='Create\x20segment\x20folder\x20for\x20organization';async[a27_0x165cdf(0x10f)](_0x347a00){const _0xfdbb38=a27_0x165cdf,{options:_0x5cdc61,args:_0x25d2d1,tdx:_0x2743a7}=_0x347a00,_0x51fc37=_0x5cdc61;if(_0x25d2d1[_0xfdbb38(0xd9)]<0x2)return console[_0xfdbb38(0x11c)](_0xfdbb38(0x139)),console[_0xfdbb38(0x11c)](_0xfdbb38(0xfa)),0x1;const _0x2b632b=_0x25d2d1[0x0],_0x56435c=_0x25d2d1[0x1];_0x51fc37[_0xfdbb38(0x11d)]&&(console[_0xfdbb38(0x11c)]('Site:\x20'+_0x51fc37[_0xfdbb38(0xb1)]),console['error'](_0xfdbb38(0x120)+_0x2b632b),console['error']('Folder\x20name:\x20'+_0x56435c));let _0x172124;if(_0x51fc37[_0xfdbb38(0xfd)]){const _0x54f7a0=_0x51fc37[_0xfdbb38(0xfd)],_0x1896ab=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2b632b+_0xfdbb38(0x111),()=>_0x2743a7[_0xfdbb38(0xbd)][_0xfdbb38(0x115)](_0x2b632b),{'verbose':_0x51fc37[_0xfdbb38(0x11d)]}),_0x44eb5a=_0x1896ab['data'],_0x2d7f40=await withSpinner(_0xfdbb38(0xf9)+_0x54f7a0+_0xfdbb38(0x111),()=>_0x2743a7[_0xfdbb38(0xbd)][_0xfdbb38(0xcb)](_0x44eb5a,_0x54f7a0),{'verbose':_0x51fc37[_0xfdbb38(0x11d)]});_0x172124=_0x2d7f40[_0xfdbb38(0x10e)],_0x51fc37[_0xfdbb38(0x11d)]&&console['error'](_0xfdbb38(0xed)+_0x172124);}const _0x5bcc85={'name':_0x56435c,'description':_0x51fc37['description'],'parentFolderId':_0x172124},_0xf9ccc8=await withSpinner(_0xfdbb38(0xca)+_0x56435c+'\x27...',()=>_0x2743a7[_0xfdbb38(0xbd)][_0xfdbb38(0x112)](_0x2b632b,_0x5bcc85),{'verbose':_0x51fc37[_0xfdbb38(0x11d)]}),_0x2570b1=_0xf9ccc8[_0xfdbb38(0x10e)];return console[_0xfdbb38(0x11c)](_0xfdbb38(0x11b)+_0x2570b1[_0xfdbb38(0x110)]+_0xfdbb38(0x103)+_0x2570b1['id']),await handleSDKOutput([_0x2570b1],_0x51fc37),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x165cdf(0x110)]=a27_0x165cdf(0x11f);[a27_0x165cdf(0xc6)]=a27_0x165cdf(0xb3);async['execute'](_0x5f347e){const _0x885441=a27_0x165cdf,{options:_0xbaf7d7,args:_0x5bf706,tdx:_0x3e96fd}=_0x5f347e,_0x1bb27e=_0x5bf706[0x0];if(!_0x1bb27e)return console[_0x885441(0x11c)](_0x885441(0x121)),console[_0x885441(0x11c)](_0x885441(0xb8)),console[_0x885441(0x11c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x885441(0x11c)](_0x885441(0x113)),console['error'](_0x885441(0xe0)),console[_0x885441(0x11c)](_0x885441(0xd3)),console[_0x885441(0x11c)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x885441(0x11c)](_0x885441(0xec)),console[_0x885441(0x11c)](_0x885441(0xc4)),console['error'](_0x885441(0xd1)),0x1;try{const _0x3cb752=_0xbaf7d7[_0x885441(0xbc)],_0x15502c=await resolveSegmentTarget(_0x1bb27e,_0x3cb752,_0xbaf7d7[_0x885441(0x11d)]);_0xbaf7d7[_0x885441(0x11d)]&&console[_0x885441(0x11c)]('Target\x20path:\x20'+_0x15502c);const _0x4e8c84=await withSpinner(_0x885441(0xef)+_0x1bb27e+_0x885441(0x111),()=>_0x3e96fd[_0x885441(0xbd)][_0x885441(0x130)](_0x15502c),{'verbose':_0xbaf7d7[_0x885441(0x11d)]}),_0x4f68d2=_0x4e8c84[_0x885441(0x10e)];_0xbaf7d7[_0x885441(0x11d)]&&(console['error'](_0x885441(0xba)+_0x4f68d2[_0x885441(0xde)]),console[_0x885441(0x11c)]('Parent\x20ID:\x20'+_0x4f68d2[_0x885441(0x101)]),_0x4f68d2[_0x885441(0xf8)]&&console['error'](_0x885441(0x114)+_0x4f68d2[_0x885441(0xf8)]),_0x4f68d2['segmentId']&&console[_0x885441(0x11c)](_0x885441(0x10d)+_0x4f68d2[_0x885441(0x125)]));if(_0xbaf7d7['web']){if(_0x4f68d2[_0x885441(0xde)]===_0x885441(0xe8))return console[_0x885441(0x11c)](_0x885441(0xeb)),0x1;if(_0x4f68d2[_0x885441(0xde)]==='parent')return console['error'](_0x885441(0xd8)),console[_0x885441(0x11c)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x4f68d2[_0x885441(0x125)])throw new SDKError(ErrorCode[_0x885441(0xc2)],_0x885441(0xce));const _0x3396f4=getConsoleNextUrl(_0xbaf7d7['site'],_0x885441(0xf3)+_0x4f68d2['parentId']+_0x885441(0x133)+_0x4f68d2[_0x885441(0x125)]);return console[_0x885441(0x11c)](a27_0x3de727[_0x885441(0xe5)]('✔')+_0x885441(0x12e)+a27_0x3de727[_0x885441(0xe1)](_0x3396f4)),openBrowser(_0x3396f4),0x0;}if(_0x4f68d2['type']==='folder'){if(!_0x4f68d2[_0x885441(0xf8)])throw new SDKError(ErrorCode[_0x885441(0xe2)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5b87e1=await withSpinner(_0x885441(0x123),()=>_0x3e96fd[_0x885441(0xbd)]['getFolder'](_0x4f68d2['folderId']),{'verbose':_0xbaf7d7[_0x885441(0x11d)]});await handleSingleObjectOutput(_0x5b87e1[_0x885441(0x10e)],_0xbaf7d7);}else{if(_0x4f68d2['type']===_0x885441(0xbd)){if(!_0x4f68d2[_0x885441(0x125)])throw new SDKError(ErrorCode[_0x885441(0xc2)],_0x885441(0xce));const _0x2b6855=await withSpinner(_0x885441(0xe7),()=>_0x3e96fd[_0x885441(0xbd)][_0x885441(0x12a)](_0x4f68d2[_0x885441(0x101)],_0x4f68d2[_0x885441(0x125)]),{'verbose':_0xbaf7d7[_0x885441(0x11d)]}),_0x1cb29a=getConsoleNextUrl(_0xbaf7d7[_0x885441(0xb1)],_0x885441(0xf3)+_0x4f68d2[_0x885441(0x101)]+_0x885441(0x133)+_0x4f68d2[_0x885441(0x125)]),_0x467b56=_0x2b6855[_0x885441(0x10e)];_0x467b56[_0x885441(0x10c)]=_0x1cb29a,await handleSingleObjectOutput(_0x467b56,_0xbaf7d7);}else return console[_0x885441(0x11c)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x885441(0x11c)](_0x885441(0xe6)),0x1;}return 0x0;}catch(_0x2082d0){if(_0x2082d0 instanceof SDKError)return console[_0x885441(0x11c)](_0x885441(0x138)+_0x2082d0[_0x885441(0xaa)]),_0x2082d0['cause']&&console['error'](_0x885441(0xfe)+_0x2082d0[_0x885441(0xf7)]),0x1;throw _0x2082d0;}}}function a27_0x187d(_0x1868c0,_0x3b0220){_0x1868c0=_0x1868c0-0xa6;const _0x18a145=a27_0x18a1();let _0x187df6=_0x18a145[_0x1868c0];return _0x187df6;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a27_0x165cdf(0x12d);['description']=a27_0x165cdf(0xd5);async[a27_0x165cdf(0x10f)](_0x1b57a9){const _0x5c5f82=a27_0x165cdf,{options:_0x1ff974,args:_0x46754b,tdx:_0x2e4a1c}=_0x1b57a9,_0x495d36=_0x46754b[0x0];if(!_0x495d36)return console[_0x5c5f82(0x11c)](_0x5c5f82(0xdd)),console[_0x5c5f82(0x11c)](_0x5c5f82(0x104)),console[_0x5c5f82(0x11c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x5c5f82(0xd3)),console[_0x5c5f82(0x11c)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x5c5f82(0xe9)),0x1;try{const _0xcc3c85=_0x1ff974[_0x5c5f82(0xbc)],_0x5cb31c=await resolveSegmentTarget(_0x495d36,_0xcc3c85,_0x1ff974[_0x5c5f82(0x11d)]);_0x1ff974[_0x5c5f82(0x11d)]&&console['error']('Target\x20path:\x20'+_0x5cb31c);const _0x47e3df=await withSpinner(_0x5c5f82(0xef)+_0x495d36+_0x5c5f82(0x111),()=>_0x2e4a1c[_0x5c5f82(0xbd)][_0x5c5f82(0x130)](_0x5cb31c),{'verbose':_0x1ff974['verbose']}),_0x53e787=_0x47e3df[_0x5c5f82(0x10e)];_0x1ff974['verbose']&&(console[_0x5c5f82(0x11c)](_0x5c5f82(0xba)+_0x53e787[_0x5c5f82(0xde)]),console[_0x5c5f82(0x11c)]('Parent\x20ID:\x20'+_0x53e787[_0x5c5f82(0x101)]));if(_0x53e787[_0x5c5f82(0xde)]===_0x5c5f82(0xe8))return console[_0x5c5f82(0x11c)](_0x5c5f82(0x119)),console[_0x5c5f82(0x11c)](_0x5c5f82(0xe4)),0x1;if(_0x53e787['type']==='parent')return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5c5f82(0x11c)](_0x5c5f82(0x100)),0x1;if(!_0x53e787['segmentId'])throw new SDKError(ErrorCode[_0x5c5f82(0xc2)],_0x5c5f82(0xce));const _0x30cadd=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2e4a1c[_0x5c5f82(0xbd)][_0x5c5f82(0xf4)](_0x53e787[_0x5c5f82(0x101)],_0x53e787['segmentId']),{'verbose':_0x1ff974[_0x5c5f82(0x11d)]}),_0x1fd1a7=_0x30cadd[_0x5c5f82(0x10e)],_0x161093=await executeSchemaQuery(_0x1fd1a7,_0x2e4a1c,_0x1ff974);return await handleQueryOutput(_0x161093,_0x1ff974),0x0;}catch(_0x78ad8c){if(_0x78ad8c instanceof SDKError)return console['error']('Error:\x20'+_0x78ad8c['message']),_0x78ad8c['cause']&&console['error'](_0x5c5f82(0xfe)+_0x78ad8c[_0x5c5f82(0xf7)]),0x1;throw _0x78ad8c;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x22f023=a28_0x4574;(function(_0x380d1d,_0x2b0f82){const _0x59ca6b=a28_0x4574,_0x5af292=_0x380d1d();while(!![]){try{const _0x47621e=-parseInt(_0x59ca6b(0x1e8))/0x1+-parseInt(_0x59ca6b(0x1dc))/0x2+parseInt(_0x59ca6b(0x1e2))/0x3*(parseInt(_0x59ca6b(0x1f2))/0x4)+-parseInt(_0x59ca6b(0x1f0))/0x5+-parseInt(_0x59ca6b(0x1ee))/0x6+-parseInt(_0x59ca6b(0x1f9))/0x7*(-parseInt(_0x59ca6b(0x1de))/0x8)+parseInt(_0x59ca6b(0x1ec))/0x9;if(_0x47621e===_0x2b0f82)break;else _0x5af292['push'](_0x5af292['shift']());}catch(_0x173fde){_0x5af292['push'](_0x5af292['shift']());}}}(a28_0xb40f,0x69a2f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a28_0xb40f(){const _0x562955=['\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','createSegment','error','Segment\x20name:\x20','Resolved\x20relative\x20path\x20to:\x20','1421470EamHOl','parent','4296ZKpgXT','Resolved\x20folder\x20ID:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Create\x20child\x20segment\x20with\x20filtering\x20rules','132lHLMZZ','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','folderId','Examples:','description','resolveParentId','159921yYSDJA','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','data','10005840BBByVG','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','3879276qEeoFu','kind','1364280migpzQ','\x20\x20\x20Path:\x20','23036JOCZRk','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Parent\x20path:\x20','\x27\x20with\x20ID:\x20','Resolving\x20folder\x20path\x20\x27','Resolving\x20parent\x20segment\x20\x27','Parent:\x20','11179VVBOHo','yellow','rule','includes','resolvePathToResource','Target\x20path:\x20','execute','segmentPath','folder','✔\x20Created\x20segment\x20\x27','\x27...','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','length','Site:\x20','segment','site','name','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','type','invisible','segment:create'];a28_0xb40f=function(){return _0x562955;};return a28_0xb40f();}function a28_0x4574(_0x41dc8e,_0x123ac4){_0x41dc8e=_0x41dc8e-0x1d0;const _0xb40ff4=a28_0xb40f();let _0x457454=_0xb40ff4[_0x41dc8e];return _0x457454;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x5e6d4c from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x22f023(0x1d1)]=a28_0x22f023(0x1d5);[a28_0x22f023(0x1e6)]=a28_0x22f023(0x1e1);async[a28_0x22f023(0x1ff)](_0x5466b0){const _0x59fd8f=a28_0x22f023;console[_0x59fd8f(0x1d9)](a28_0x5e6d4c['yellow'](_0x59fd8f(0x1d2))),console['error'](a28_0x5e6d4c[_0x59fd8f(0x1fa)](_0x59fd8f(0x1d6)));const {options:_0x3e3b02,args:_0x50fc8f,tdx:_0x1601d2}=_0x5466b0,_0xdc56d0=_0x3e3b02;if(_0x50fc8f[_0x59fd8f(0x207)]===0x0)return console['error'](_0x59fd8f(0x1ea)),console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1d7)),console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1e5)),console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1e3)),console[_0x59fd8f(0x1d9)](_0x59fd8f(0x205)),console['error'](_0x59fd8f(0x1ed)),0x1;const _0x8ed9c6=_0x50fc8f[0x0],_0x339650=_0x3e3b02[_0x59fd8f(0x200)];let _0x1a49d9=_0x8ed9c6;_0x339650&&!_0x8ed9c6[_0x59fd8f(0x1fc)]('/')&&(_0x1a49d9=_0x339650+'/'+_0x8ed9c6,_0xdc56d0[_0x59fd8f(0x1e9)]&&console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1db)+_0x1a49d9));const _0x557bac=parsePath(_0x1a49d9);if(_0x557bac[_0x59fd8f(0x206)]['length']<0x2)return console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1e0)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x4ac5b6=_0x557bac[_0x59fd8f(0x206)][0x0],_0x32e0f9=getBaseName(_0x1a49d9),_0x1c3221=getParentPath(_0x1a49d9);_0xdc56d0[_0x59fd8f(0x1e9)]&&(console[_0x59fd8f(0x1d9)](_0x59fd8f(0x208)+_0xdc56d0[_0x59fd8f(0x1d0)]),console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1fe)+_0x1a49d9),console['error'](_0x59fd8f(0x1f8)+_0x4ac5b6),console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1da)+_0x32e0f9),console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1f4)+_0x1c3221));const _0x336098=await withSpinner(_0x59fd8f(0x1f7)+_0x4ac5b6+_0x59fd8f(0x203),()=>_0x1601d2[_0x59fd8f(0x209)][_0x59fd8f(0x1e7)](_0x4ac5b6),{'verbose':_0xdc56d0[_0x59fd8f(0x1e9)]}),_0xa1112c=_0x336098['data'];let _0xc6e781;if(_0x557bac['segments'][_0x59fd8f(0x207)]>0x2){const _0x317cc8=await withSpinner(_0x59fd8f(0x1f6)+_0x1c3221+_0x59fd8f(0x203),()=>_0x1601d2[_0x59fd8f(0x209)][_0x59fd8f(0x1fd)](_0x1c3221),{'verbose':_0xdc56d0[_0x59fd8f(0x1e9)]}),_0x65adc=_0x317cc8[_0x59fd8f(0x1eb)];if(_0x65adc[_0x59fd8f(0x1d3)]!==_0x59fd8f(0x201)&&_0x65adc[_0x59fd8f(0x1d3)]!==_0x59fd8f(0x1dd))return console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1f3)),0x1;_0xc6e781=_0x65adc[_0x59fd8f(0x1e4)];}else{if(_0xdc56d0[_0x59fd8f(0x201)]){const _0x5ee1a3=await withSpinner(_0x59fd8f(0x204)+_0xdc56d0[_0x59fd8f(0x201)]+'\x27...',()=>_0x1601d2[_0x59fd8f(0x209)]['resolveFolderId'](_0xa1112c,_0xdc56d0[_0x59fd8f(0x201)]),{'verbose':_0xdc56d0[_0x59fd8f(0x1e9)]});_0xc6e781=_0x5ee1a3[_0x59fd8f(0x1eb)];}}_0xdc56d0[_0x59fd8f(0x1e9)]&&_0xc6e781&&console[_0x59fd8f(0x1d9)](_0x59fd8f(0x1df)+_0xc6e781);const _0x4b057c=await loadJSONFromOptions(_0xdc56d0[_0x59fd8f(0x1fb)],_0xdc56d0['ruleFile']),_0x557910={'name':_0x32e0f9,'description':_0xdc56d0[_0x59fd8f(0x1e6)],'rule':_0x4b057c,'kind':_0xdc56d0[_0x59fd8f(0x1ef)]!==undefined?parseInt(_0xdc56d0['kind'],0xa):undefined,'isVisible':_0xdc56d0[_0x59fd8f(0x1d4)]?![]:undefined,'segmentFolderId':_0xc6e781,'countPopulation':_0xdc56d0['noCountPopulation']?![]:undefined},_0x39eebd=await withSpinner('Creating\x20segment\x20\x27'+_0x32e0f9+'\x27...',()=>_0x1601d2['segment'][_0x59fd8f(0x1d8)](_0xa1112c,_0x557910),{'verbose':_0xdc56d0[_0x59fd8f(0x1e9)]}),_0x37cd2c=_0x39eebd[_0x59fd8f(0x1eb)];return console[_0x59fd8f(0x1d9)](_0x59fd8f(0x202)+_0x37cd2c[_0x59fd8f(0x1d1)]+_0x59fd8f(0x1f5)+_0x37cd2c['id']),_0x1a49d9!==_0x8ed9c6&&console['error'](_0x59fd8f(0x1f1)+_0x1a49d9),await handleSDKOutput([_0x37cd2c],_0xdc56d0),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a29_0x2bd13d=a29_0x37fa;(function(_0x3debfb,_0x2aa6c8){const _0x483a53=a29_0x37fa,_0x1aaa54=_0x3debfb();while(!![]){try{const _0x1121dd=-parseInt(_0x483a53(0x180))/0x1*(-parseInt(_0x483a53(0x171))/0x2)+parseInt(_0x483a53(0x167))/0x3*(-parseInt(_0x483a53(0x16b))/0x4)+-parseInt(_0x483a53(0x17a))/0x5+parseInt(_0x483a53(0x16e))/0x6+-parseInt(_0x483a53(0x16d))/0x7+parseInt(_0x483a53(0x17f))/0x8*(parseInt(_0x483a53(0x16f))/0x9)+parseInt(_0x483a53(0x186))/0xa;if(_0x1121dd===_0x2aa6c8)break;else _0x1aaa54['push'](_0x1aaa54['shift']());}catch(_0x330f95){_0x1aaa54['push'](_0x1aaa54['shift']());}}}(a29_0x3ad3,0x3928a));function a29_0x3ad3(){const _0x2e8407=['error','data','Listing\x20fields\x20for\x20\x27','3303190hFphVL','json','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','17193izQToj','jsonl','Site:\x20','site','288fuewDz','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','869554cBUbfz','1793610HklhJf','18qjBGMk','List\x20available\x20fields\x20for\x20segmentation','440824hfZiaW','\x27...','Error:\x20Parent\x20segment\x20name\x20is\x20required','parentSegment','execute','verbose','listFields','segment:fields','✔\x20Found\x20','2112580ECAHbq','description','Parent\x20segment:\x20','name','length','1375304TPSgcm','1IxzJaQ','segment','\x20field'];a29_0x3ad3=function(){return _0x2e8407;};return a29_0x3ad3();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x37fa(_0xb25902,_0xd7870c){_0xb25902=_0xb25902-0x167;const _0x3ad3bc=a29_0x3ad3();let _0x37fa6c=_0x3ad3bc[_0xb25902];return _0x37fa6c;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x2bd13d(0x17d)]=a29_0x2bd13d(0x178);[a29_0x2bd13d(0x17b)]=a29_0x2bd13d(0x170);async[a29_0x2bd13d(0x175)](_0x5a5d41){const _0x35e129=a29_0x2bd13d,{options:_0x2921e9,args:_0x28b4a5,tdx:_0x41e901}=_0x5a5d41,_0x4c8b7d=_0x28b4a5[0x0]||_0x2921e9[_0x35e129(0x174)];if(!_0x4c8b7d)return console[_0x35e129(0x183)](_0x35e129(0x173)),console['error'](_0x35e129(0x16c)),console['error'](_0x35e129(0x188)),0x1;_0x2921e9[_0x35e129(0x176)]&&(console[_0x35e129(0x183)](_0x35e129(0x169)+_0x2921e9[_0x35e129(0x16a)]),console[_0x35e129(0x183)](_0x35e129(0x17c)+_0x4c8b7d));const _0x2263b6=await withSpinner(_0x35e129(0x185)+_0x4c8b7d+_0x35e129(0x172),()=>_0x41e901[_0x35e129(0x181)][_0x35e129(0x177)](_0x4c8b7d),{'verbose':_0x2921e9[_0x35e129(0x176)]}),_0x1ba28d=_0x2263b6[_0x35e129(0x184)];console[_0x35e129(0x183)](_0x35e129(0x179)+_0x1ba28d[_0x35e129(0x17e)]+_0x35e129(0x182)+(_0x1ba28d[_0x35e129(0x17e)]!==0x1?'s':''));if(_0x2921e9[_0x35e129(0x187)]||_0x2921e9[_0x35e129(0x168)])return await handleSDKOutput(_0x1ba28d,_0x2921e9),0x0;return displayFieldsHumanReadable(_0x1ba28d,_0x4c8b7d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a30_0x4102(_0x4294e5,_0x357564){_0x4294e5=_0x4294e5-0x118;const _0x3fa922=a30_0x3fa9();let _0x410235=_0x3fa922[_0x4294e5];return _0x410235;}const a30_0x13a1c6=a30_0x4102;(function(_0x10b5f4,_0x2ab411){const _0x39719a=a30_0x4102,_0x381db0=_0x10b5f4();while(!![]){try{const _0x149cb1=parseInt(_0x39719a(0x140))/0x1+-parseInt(_0x39719a(0x129))/0x2+-parseInt(_0x39719a(0x142))/0x3*(parseInt(_0x39719a(0x118))/0x4)+-parseInt(_0x39719a(0x13a))/0x5+parseInt(_0x39719a(0x160))/0x6+parseInt(_0x39719a(0x168))/0x7+parseInt(_0x39719a(0x13d))/0x8*(parseInt(_0x39719a(0x137))/0x9);if(_0x149cb1===_0x2ab411)break;else _0x381db0['push'](_0x381db0['shift']());}catch(_0x39ad6d){_0x381db0['push'](_0x381db0['shift']());}}}(a30_0x3fa9,0x2549a));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a30_0x3fa9(){const _0x4494e5=['red','yellow','diff','\x20new\x20files','execute','Parent\x20segment:\x20','dryRun','resourceName','length','content','Pulling\x20segments\x20from\x20\x27','journeyVersions','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dirname','utf-8','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','segment','site','pullSegments','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','segments','type','file','name','parent_segment','journeys','60450DjxOJT','\x20files?','\x20\x20Target:\x20','\x20\x20🗺️\x20\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','session','counts','segment:pull','1189377kPSULT','✔\x20Pulled\x20','files','312856zxLGrn','cwd','Target\x20resource:\x20','cyan','error','verbose','no_parent','Aborted.','\x20\x20🎯\x20','green','\x20versions)','isNew','\x20files\x20to\x20','activations','data','Error:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','181532kXuSGX','parentName','parentSegment','filter','Site:\x20','targetDir','Write\x20','-\x20no\x20files\x20written','✔\x20Context\x20set:\x20','\x20journeys','\x20activations','absolutePath','description','message','846MAAsNf','\x0aChanges\x20to\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','1066345EaNNPu','repeat','yes','33112QLArGm','\x27...','dim','44141OsKiHz','\x20=\x20','6UDJLac','hasChanges','helpText'];a30_0x3fa9=function(){return _0x4494e5;};return a30_0x3fa9();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x1c98ac from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x2b9707 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x13a1c6(0x15d)]=a30_0x13a1c6(0x167);[a30_0x13a1c6(0x135)]=a30_0x13a1c6(0x159);async[a30_0x13a1c6(0x149)](_0x5f39e7){const _0x3b4a44=a30_0x13a1c6,{options:_0x3b18af,args:_0x4fd944,tdx:_0x1d79ee}=_0x5f39e7,_0x201974=_0x3b18af,_0xcbad9f=await resolveTarget({'arg':_0x4fd944[0x0],'contextParent':_0x3b18af[_0x3b4a44(0x12b)],'cwd':process[_0x3b4a44(0x119)]()});if(!isSuccessfulResolution(_0xcbad9f))return _0xcbad9f['errorCode']===_0x3b4a44(0x11e)?(console['error'](a30_0x1c98ac[_0x3b4a44(0x146)](_0x3b4a44(0x128))),console['error'](_0x3b4a44(0x154)),console[_0x3b4a44(0x11c)](_0x3b4a44(0x155)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a30_0x1c98ac[_0x3b4a44(0x145)](_0x3b4a44(0x127)+_0xcbad9f[_0x3b4a44(0x136)]+'\x0a')),_0xcbad9f[_0x3b4a44(0x144)]&&console['error'](a30_0x1c98ac[_0x3b4a44(0x11b)](_0xcbad9f[_0x3b4a44(0x144)]))),0x1;const _0x117401=_0xcbad9f[_0x3b4a44(0x12a)],_0x233f17=_0xcbad9f[_0x3b4a44(0x12e)],_0x38555c=_0xcbad9f[_0x3b4a44(0x15b)]===_0x3b4a44(0x15c)?_0xcbad9f[_0x3b4a44(0x14c)]:undefined;_0x201974[_0x3b4a44(0x11d)]&&(console['error'](_0x3b4a44(0x12d)+_0x201974[_0x3b4a44(0x157)]),console[_0x3b4a44(0x11c)](_0x3b4a44(0x14a)+_0x117401),_0x38555c&&console[_0x3b4a44(0x11c)](_0x3b4a44(0x11a)+_0x38555c));const _0x1059d7=await withProgressSpinner(_0x3b4a44(0x14f)+_0x117401+_0x3b4a44(0x13e),_0x3f0c93=>_0x1d79ee[_0x3b4a44(0x156)][_0x3b4a44(0x158)](_0x117401,{'targetDir':_0x233f17,'targetResourceName':_0x38555c,'verbose':_0x201974['verbose'],'progress':{'update':_0x55eeaf=>{const _0x249fdd=_0x3b4a44;_0x3f0c93['setPhase'](_0x55eeaf),_0x201974[_0x249fdd(0x11d)]&&console['error']('\x20\x20'+_0x55eeaf);}}}),{'verbose':_0x201974[_0x3b4a44(0x11d)]}),_0x1973c5=_0x1059d7[_0x3b4a44(0x126)];if(_0x1973c5['counts'][_0x3b4a44(0x15a)]===0x0&&_0x1973c5['counts'][_0x3b4a44(0x15f)]===0x0)return console[_0x3b4a44(0x11c)](a30_0x1c98ac['yellow'](_0x3b4a44(0x164)+_0x1973c5[_0x3b4a44(0x12a)]+'\x27')),0x0;const _0x1d51a0=_0x1973c5[_0x3b4a44(0x16a)][_0x3b4a44(0x12c)](_0x2c1788=>_0x2c1788[_0x3b4a44(0x123)]),_0x4dcfd0=_0x1973c5['files']['filter'](_0x3fba82=>!_0x3fba82['isNew']&&_0x3fba82[_0x3b4a44(0x143)]),_0x3e25f6=_0x1973c5[_0x3b4a44(0x16a)]['filter'](_0x22c6a8=>!_0x22c6a8[_0x3b4a44(0x123)]&&!_0x22c6a8[_0x3b4a44(0x143)]);console[_0x3b4a44(0x11c)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1973c5[_0x3b4a44(0x12a)]+'\x27:'),console['error'](_0x3b4a44(0x120)+a30_0x1c98ac[_0x3b4a44(0x11b)](_0x1973c5[_0x3b4a44(0x166)]['segments']+'\x20segments')+'\x20with\x20'+a30_0x1c98ac[_0x3b4a44(0x11b)](_0x1973c5[_0x3b4a44(0x166)][_0x3b4a44(0x125)]+_0x3b4a44(0x133)));if(_0x1973c5[_0x3b4a44(0x166)]['journeys']>0x0){const _0x2ab873=_0x1973c5[_0x3b4a44(0x166)][_0x3b4a44(0x150)]>_0x1973c5[_0x3b4a44(0x166)][_0x3b4a44(0x15f)]?'\x20('+_0x1973c5[_0x3b4a44(0x166)][_0x3b4a44(0x150)]+_0x3b4a44(0x122):'';console[_0x3b4a44(0x11c)](_0x3b4a44(0x163)+a30_0x1c98ac[_0x3b4a44(0x11b)](_0x1973c5[_0x3b4a44(0x166)][_0x3b4a44(0x15f)]+_0x3b4a44(0x132))+a30_0x1c98ac['dim'](_0x2ab873));}console['error']('\x20\x20'+a30_0x1c98ac[_0x3b4a44(0x121)]('+\x20'+_0x1d51a0['length']+_0x3b4a44(0x148))),console['error']('\x20\x20'+a30_0x1c98ac['yellow']('~\x20'+_0x4dcfd0[_0x3b4a44(0x14d)]+'\x20changed\x20files')),console['error']('\x20\x20'+a30_0x1c98ac[_0x3b4a44(0x13f)]('=\x20'+_0x3e25f6[_0x3b4a44(0x14d)]+'\x20unchanged\x20files')),console['error'](_0x3b4a44(0x162)+a30_0x1c98ac['cyan'](_0x1973c5[_0x3b4a44(0x12e)])+'\x0a');if(_0x4dcfd0['length']>0x0)for(const _0x455cfd of _0x4dcfd0){console['error'](_0x3b4a44(0x138)+_0x455cfd['relativePath']+'\x27:'),console[_0x3b4a44(0x11c)]('─'['repeat'](0x3c)),console['error'](_0x455cfd[_0x3b4a44(0x147)]),console[_0x3b4a44(0x11c)]('─'[_0x3b4a44(0x13b)](0x3c));}if(_0x201974[_0x3b4a44(0x14b)])return console['error'](a30_0x1c98ac[_0x3b4a44(0x146)](_0x3b4a44(0x151))),0x0;if(_0x1d51a0[_0x3b4a44(0x14d)]===0x0&&_0x4dcfd0[_0x3b4a44(0x14d)]===0x0)return console[_0x3b4a44(0x11c)](a30_0x1c98ac[_0x3b4a44(0x121)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1973c5[_0x3b4a44(0x12a)]},_0x201974[_0x3b4a44(0x165)]),console[_0x3b4a44(0x11c)](a30_0x1c98ac[_0x3b4a44(0x121)]('✔\x20Context\x20set:\x20'+a30_0x1c98ac[_0x3b4a44(0x13f)](_0x3b4a44(0x15e))+_0x3b4a44(0x141)+a30_0x1c98ac[_0x3b4a44(0x11b)](_0x1973c5['parentName']))),0x0;if(!_0x201974[_0x3b4a44(0x13c)]){if(!isInteractive())return console[_0x3b4a44(0x11c)](a30_0x1c98ac[_0x3b4a44(0x145)]('\x0aError:'),_0x3b4a44(0x139)),console[_0x3b4a44(0x11c)](a30_0x1c98ac[_0x3b4a44(0x13f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4d7e7b=await confirmKey(_0x3b4a44(0x12f)+(_0x1d51a0['length']+_0x4dcfd0[_0x3b4a44(0x14d)])+_0x3b4a44(0x161));if(!_0x4d7e7b)return console['error'](a30_0x1c98ac[_0x3b4a44(0x146)](_0x3b4a44(0x11f)),_0x3b4a44(0x130)),0x1;}for(const _0x371722 of _0x1973c5['files']){if(_0x371722['isNew']||_0x371722['hasChanges']){const _0x5074b9=a30_0x2b9707[_0x3b4a44(0x152)](_0x371722[_0x3b4a44(0x134)]);!existsSync(_0x5074b9)&&mkdirSync(_0x5074b9,{'recursive':!![]}),writeFileSync(_0x371722['absolutePath'],_0x371722[_0x3b4a44(0x14e)],_0x3b4a44(0x153));}}return console[_0x3b4a44(0x11c)](a30_0x1c98ac[_0x3b4a44(0x121)](_0x3b4a44(0x169)+(_0x1d51a0[_0x3b4a44(0x14d)]+_0x4dcfd0[_0x3b4a44(0x14d)])+_0x3b4a44(0x124)+_0x1973c5['targetDir'])),saveSessionContext({'parent_segment':_0x1973c5[_0x3b4a44(0x12a)]},_0x201974['session']),console[_0x3b4a44(0x11c)](a30_0x1c98ac[_0x3b4a44(0x121)](_0x3b4a44(0x131)+a30_0x1c98ac[_0x3b4a44(0x13f)]('parent_segment')+_0x3b4a44(0x141)+a30_0x1c98ac[_0x3b4a44(0x11b)](_0x1973c5[_0x3b4a44(0x12a)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-push-command.d.ts","sourceRoot":"","sources":["../../src/commands/segment-push-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE,OAAO,EAmBL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EAKrB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EAAE,gBAAgB,EAAE,eAAe,IAAI,QAAQ,EAAE,eAAe,EAAE,CAAC;AAE/E;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,wDAAwD;IAEtE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"segment-push-command.d.ts","sourceRoot":"","sources":["../../src/commands/segment-push-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE,OAAO,EAmBL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EAKrB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EAAE,gBAAgB,EAAE,eAAe,IAAI,QAAQ,EAAE,eAAe,EAAE,CAAC;AAE/E;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,wDAAwD;IAEtE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgtBxD"}
|