@treasuredata/tdx 0.26.7 → 0.27.0
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.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 +9 -0
- 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.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 +8 -0
- 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 +23 -15
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/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
|
+
const a23_0x32e8cc=a23_0x37fd;(function(_0x46b0af,_0x5f4260){const _0x47d4fc=a23_0x37fd,_0x3340ef=_0x46b0af();while(!![]){try{const _0x17adb1=-parseInt(_0x47d4fc(0x1d8))/0x1*(-parseInt(_0x47d4fc(0x217))/0x2)+-parseInt(_0x47d4fc(0x1ee))/0x3*(-parseInt(_0x47d4fc(0x216))/0x4)+parseInt(_0x47d4fc(0x202))/0x5+parseInt(_0x47d4fc(0x1f0))/0x6*(parseInt(_0x47d4fc(0x1ea))/0x7)+-parseInt(_0x47d4fc(0x220))/0x8+parseInt(_0x47d4fc(0x20c))/0x9*(parseInt(_0x47d4fc(0x212))/0xa)+-parseInt(_0x47d4fc(0x1fa))/0xb;if(_0x17adb1===_0x5f4260)break;else _0x3340ef['push'](_0x3340ef['shift']());}catch(_0x4ac631){_0x3340ef['push'](_0x3340ef['shift']());}}}(a23_0x176e,0xee14f));function a23_0x37fd(_0x2c3e42,_0x1182d3){_0x2c3e42=_0x2c3e42-0x1d0;const _0x176e4d=a23_0x176e();let _0x37fdec=_0x176e4d[_0x2c3e42];return _0x37fdec;}function a23_0x176e(){const _0x468f56=['test','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>','apiKey','Default\x20profile\x20set\x20to:\x20','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','Site\x20was\x20not\x20changed.','542833sjOoAs','Enter\x20profile\x20name:','\x20\x20-\x20','\x0aSetup\x20cancelled','parent_segment','green','profile','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','\x27\x20does\x20not\x20exist.','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','warn','bold','tdx.json','\x27\x20created','text','tdx:\x20profile\x20create','llm_project','site','7ytYjVO','trim','Validating\x20API\x20key...','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','321zRpOoU','profileName','243642axSNKH','Site\x20name\x20cannot\x20be\x20empty','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','execute','length','join','create','log','logLevel','profile:remove','6108146YckYjv','other','API\x20key\x20cannot\x20be\x20empty','/app/mp/ak','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Operation\x20cancelled','ERROR','tdx:\x20profile\x20set','3042820WQYLuH','Profile\x20name\x20cannot\x20be\x20empty','yellow','Create\x20a\x20new\x20profile','includes','confirm','Failed\x20to\x20remove\x20profile:\x20','Enter\x20description\x20(optional):','dim','red','29637RGlVWM','\x27\x20removed\x20from\x20configuration','Remove\x20a\x20profile','status','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','2110uQAXEs','message','split','\x20\x20(no\x20profiles\x20found)','13076JvQcaD','2aCZfmH','select','error','validate','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','\x20Profile\x20\x27','Unknown\x20key\x20\x27','\x20\x20tdx\x20--profile\x20','session','5649128uXGFKJ','Enter\x20your\x20TD\x20API\x20key:','\x20API\x20key\x20saved\x20to\x20system\x20keychain','tdx:\x20profile\x20remove','\x0aSaved\x20to:\x20','customSite','profile:use','name','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','description','us01','\x20API\x20key\x20removed\x20from\x20system\x20keychain','\x27\x20updated:\x20','\x27.\x0a\x0aValid\x20keys:\x20','jobs','VALID_KEYS','Set\x20a\x20profile\x20configuration\x20value','\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','Set\x20session\x20profile','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','profile:create','email','(session:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','Removal\x20cancelled','Profile\x20\x27','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','\x0aAvailable\x20profiles:','\x0aOperation\x20cancelled','profile:set'];a23_0x176e=function(){return _0x468f56;};return a23_0x176e();}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_0x8b599a 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_0x3e24e3 from'prompts';import a23_0x2ef82c from'chalk';function validateProfileName(_0xbda014){const _0x5bc42d=a23_0x37fd;if(!_0xbda014||!_0xbda014['trim']())return _0x5bc42d(0x203);const _0x12e552=_0xbda014[_0x5bc42d(0x1eb)]();if(!/^[a-zA-Z0-9_-]+$/[_0x5bc42d(0x1d1)](_0x12e552))return _0x5bc42d(0x1e1);if(profileExists(_0x12e552))return _0x5bc42d(0x23c)+_0x12e552+_0x5bc42d(0x228);return!![];}export class ProfileCreateCommand extends BaseCommand{[a23_0x32e8cc(0x227)]=a23_0x32e8cc(0x237);[a23_0x32e8cc(0x22a)]=a23_0x32e8cc(0x205);async[a23_0x32e8cc(0x1f3)](_0x1d0cd0){const _0x50ced3=a23_0x32e8cc,{options:_0x4306fb,args:_0x4f807a}=_0x1d0cd0;console[_0x50ced3(0x1f7)](a23_0x2ef82c['bold'](_0x50ced3(0x1e7)));let _0x47b681;if(_0x4f807a[_0x50ced3(0x1f4)]>0x0&&_0x4f807a[0x0]){const _0x26475a=_0x4f807a[0x0]['trim'](),_0x5a38f2=validateProfileName(_0x26475a);if(_0x5a38f2!==!![])return console[_0x50ced3(0x219)](a23_0x2ef82c[_0x50ced3(0x20b)](_0x5a38f2)),0x1;_0x47b681=_0x26475a;}else{const _0x2f2dd9=await a23_0x3e24e3({'type':_0x50ced3(0x1e6),'name':'profileName','message':_0x50ced3(0x1d9),'validate':validateProfileName});if(!_0x2f2dd9[_0x50ced3(0x1ef)])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x47b681=_0x2f2dd9[_0x50ced3(0x1ef)][_0x50ced3(0x1eb)]();}const _0x49ef47=await a23_0x3e24e3({'type':'text','name':_0x50ced3(0x22a),'message':_0x50ced3(0x209)}),_0x3f438d=_0x49ef47[_0x50ced3(0x22a)]?.[_0x50ced3(0x1eb)]()||undefined,_0x3defe3=_0x4306fb['site']||'us01',{choices:_0x5658dc,initialIndex:_0x2baeea}=buildSiteChoices(_0x3defe3),_0x859044=await a23_0x3e24e3({'type':_0x50ced3(0x218),'name':_0x50ced3(0x1e9),'message':_0x50ced3(0x21b)+_0x47b681+'\x27:','choices':_0x5658dc,'initial':_0x2baeea});if(!_0x859044[_0x50ced3(0x1e9)])return console[_0x50ced3(0x1f7)]('\x0aSetup\x20cancelled'),0x1;let _0x2dd436;if(_0x859044[_0x50ced3(0x1e9)]===_0x50ced3(0x1fb)){const _0x1475d9=await a23_0x3e24e3({'type':_0x50ced3(0x1e6),'name':_0x50ced3(0x225),'message':'Enter\x20site\x20name:','initial':_0x50ced3(0x22b),'validate':_0x575f88=>{const _0x56213e=_0x50ced3;if(!_0x575f88||!_0x575f88[_0x56213e(0x1eb)]())return _0x56213e(0x1f1);if(!/^[a-z0-9-]+$/[_0x56213e(0x1d1)](_0x575f88['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x1475d9[_0x50ced3(0x225)])return console[_0x50ced3(0x1f7)](_0x50ced3(0x1db)),0x1;_0x2dd436=_0x1475d9[_0x50ced3(0x225)];}else _0x2dd436=_0x859044[_0x50ced3(0x1e9)];const _0x3c4096=resolveSite(_0x2dd436);console[_0x50ced3(0x1f7)](_0x50ced3(0x210)+_0x3c4096),console[_0x50ced3(0x1f7)](_0x50ced3(0x23a)),console[_0x50ced3(0x1f7)]('\x20\x20'+getConsoleUrl(_0x3c4096,_0x50ced3(0x1fd)));const _0x3a04ca=await a23_0x3e24e3({'type':'password','name':_0x50ced3(0x1d3),'message':_0x50ced3(0x221),'validate':_0x36cc8d=>{const _0x23071e=_0x50ced3;if(!_0x36cc8d||!_0x36cc8d[_0x23071e(0x1eb)]())return _0x23071e(0x1fc);return!![];}});if(!_0x3a04ca[_0x50ced3(0x1d3)])return console[_0x50ced3(0x1f7)](_0x50ced3(0x1db)),0x1;const _0x5c62d9=_0x3a04ca['apiKey'];console[_0x50ced3(0x1f7)](_0x50ced3(0x1ec));try{const _0x53b3e2=TDX['create']({'site':_0x3c4096,'apiKey':_0x5c62d9['trim'](),'logLevel':_0x4306fb[_0x50ced3(0x1f8)]??LogLevel[_0x50ced3(0x200)]}),_0x5c8c17=await _0x53b3e2[_0x50ced3(0x22f)]['getUserInfo']();console[_0x50ced3(0x1f7)](a23_0x2ef82c[_0x50ced3(0x1dd)]('✓')+_0x50ced3(0x232)+_0x5c8c17[_0x50ced3(0x238)]+')');const _0x18a574=await isKeychainAvailable();_0x18a574?(await saveAPIKeyAsync(_0x5c62d9[_0x50ced3(0x1eb)](),_0x3c4096,_0x47b681),console[_0x50ced3(0x1f7)](a23_0x2ef82c[_0x50ced3(0x1dd)]('✓')+_0x50ced3(0x236)+_0x47b681+')')):(console[_0x50ced3(0x1e2)](a23_0x2ef82c[_0x50ced3(0x204)](_0x50ced3(0x211))),console['warn'](a23_0x2ef82c['yellow'](_0x50ced3(0x1fe))));const _0x4eaa17={'site':_0x3c4096,..._0x3f438d&&{'description':_0x3f438d}};return saveProfileToUserConfig(_0x47b681,_0x4eaa17),console[_0x50ced3(0x1f7)](a23_0x2ef82c[_0x50ced3(0x1dd)]('✓')+_0x50ced3(0x21c)+_0x47b681+_0x50ced3(0x1e5)),console[_0x50ced3(0x1f7)](),console[_0x50ced3(0x1f7)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x50ced3(0x1f7)](_0x50ced3(0x21e)+_0x47b681+_0x50ced3(0x1ed)),console[_0x50ced3(0x1f7)](_0x50ced3(0x21e)+_0x47b681+_0x50ced3(0x1f2)),0x0;}catch(_0x205167){if(_0x205167 instanceof HTTPClientError&&_0x205167[_0x50ced3(0x20f)]===0x191)return printAuthError(_0x205167),0x1;return console['error'](a23_0x2ef82c['red'](_0x50ced3(0x233)+(_0x205167 instanceof Error?_0x205167[_0x50ced3(0x213)]:String(_0x205167)))),console[_0x50ced3(0x219)]('Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.'),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a23_0x32e8cc(0x227)]=a23_0x32e8cc(0x1f9);[a23_0x32e8cc(0x22a)]=a23_0x32e8cc(0x20e);[a23_0x32e8cc(0x21a)](_0x4aeaa8){const _0x2de739=a23_0x32e8cc,{args:_0x305c41}=_0x4aeaa8;if(_0x305c41[_0x2de739(0x1f4)]===0x0)return _0x2de739(0x1d5);return undefined;}async[a23_0x32e8cc(0x1f3)](_0x417063){const _0x51fa65=a23_0x32e8cc,{args:_0x56cfa8}=_0x417063,_0x438a3c=_0x56cfa8[0x0];console[_0x51fa65(0x1f7)](a23_0x2ef82c[_0x51fa65(0x1e3)](_0x51fa65(0x223)));if(!profileExists(_0x438a3c)){console[_0x51fa65(0x219)](a23_0x2ef82c[_0x51fa65(0x20b)]('Profile\x20\x27'+_0x438a3c+_0x51fa65(0x1e0))),console['log'](_0x51fa65(0x23e));const _0x1cd676=listProfiles();if(_0x1cd676[_0x51fa65(0x1f4)]===0x0)console['log'](_0x51fa65(0x215));else for(const _0x45d5d2 of _0x1cd676){console[_0x51fa65(0x1f7)](_0x51fa65(0x1da)+_0x45d5d2[_0x51fa65(0x227)]);}return 0x1;}const _0x27c311=await a23_0x3e24e3({'type':_0x51fa65(0x207),'name':_0x51fa65(0x207),'message':_0x51fa65(0x235)+_0x438a3c+'\x27?','initial':![]});if(!_0x27c311[_0x51fa65(0x207)])return console['log'](_0x51fa65(0x23b)),0x0;try{removeProfileFromUserConfig(_0x438a3c),console[_0x51fa65(0x1f7)](a23_0x2ef82c[_0x51fa65(0x1dd)]('✓')+_0x51fa65(0x21c)+_0x438a3c+_0x51fa65(0x20d));}catch(_0x56c5ee){return console[_0x51fa65(0x219)](a23_0x2ef82c[_0x51fa65(0x20b)](_0x51fa65(0x208)+(_0x56c5ee instanceof Error?_0x56c5ee[_0x51fa65(0x213)]:String(_0x56c5ee)))),0x1;}const _0x132949=await isKeychainAvailable();if(_0x132949){const _0x27ca8e=await deleteKeychainAPIKey(_0x438a3c);_0x27ca8e&&console[_0x51fa65(0x1f7)](a23_0x2ef82c['green']('✓')+_0x51fa65(0x22c));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{['name']=a23_0x32e8cc(0x1d0);[a23_0x32e8cc(0x22a)]=a23_0x32e8cc(0x231);static [a23_0x32e8cc(0x230)]=[a23_0x32e8cc(0x1e9),'database',a23_0x32e8cc(0x1dc),a23_0x32e8cc(0x1e8),'llm_agent',a23_0x32e8cc(0x22a)];[a23_0x32e8cc(0x21a)](_0x9c1b59){const _0x331f4e=a23_0x32e8cc,{args:_0x317209,options:_0x195f20}=_0x9c1b59,_0x28e287=_0x195f20[_0x331f4e(0x1de)]||getActiveProfile();if(!_0x28e287)return _0x331f4e(0x1d2);if(_0x317209[_0x331f4e(0x1f4)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x331f4e(0x230)][_0x331f4e(0x1f5)](',\x20');const _0x520534=_0x317209[0x0];if(!_0x520534[_0x331f4e(0x206)]('='))return _0x331f4e(0x229)+ProfileSetCommand['VALID_KEYS'][_0x331f4e(0x1f5)](',\x20');const [_0x278743]=_0x520534[_0x331f4e(0x214)]('=',0x2);if(!ProfileSetCommand[_0x331f4e(0x230)][_0x331f4e(0x206)](_0x278743))return _0x331f4e(0x21d)+_0x278743+_0x331f4e(0x22e)+ProfileSetCommand['VALID_KEYS'][_0x331f4e(0x1f5)](',\x20');return undefined;}async['execute'](_0x2d503b){const _0xa0bab8=a23_0x32e8cc,{args:_0x1889c5,options:_0x30e36d}=_0x2d503b,_0xb490b6=_0x30e36d[_0xa0bab8(0x1de)]||getActiveProfile(),[_0x1dde7d,..._0x1fb6ed]=_0x1889c5[0x0]['split']('='),_0x220d35=_0x1fb6ed['join']('=');console[_0xa0bab8(0x1f7)](a23_0x2ef82c[_0xa0bab8(0x1e3)](_0xa0bab8(0x201)));if(!profileExists(_0xb490b6)){const _0x5b2cde=await a23_0x3e24e3({'type':'confirm','name':_0xa0bab8(0x1f6),'message':_0xa0bab8(0x23c)+_0xb490b6+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x5b2cde[_0xa0bab8(0x1f6)])return console[_0xa0bab8(0x1f7)](_0xa0bab8(0x1ff)),0x1;}const _0xd40550=loadProfile(_0xb490b6),_0xb13010=_0xd40550?.['config']||{};if(_0x1dde7d==='site'){const _0x56674c=resolveSite(_0x220d35);console[_0xa0bab8(0x1f7)]('Changing\x20site\x20to\x20\x27'+_0x56674c+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0xa0bab8(0x1f7)]('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0xa0bab8(0x1f7)]('\x20\x20'+getConsoleUrl(_0x56674c,_0xa0bab8(0x1fd)));const _0x20578a=await a23_0x3e24e3({'type':'password','name':_0xa0bab8(0x1d3),'message':_0xa0bab8(0x1d6),'validate':_0x1b2a68=>{const _0x141a40=_0xa0bab8;if(!_0x1b2a68||!_0x1b2a68[_0x141a40(0x1eb)]())return _0x141a40(0x1fc);return!![];}});if(!_0x20578a[_0xa0bab8(0x1d3)])return console[_0xa0bab8(0x1f7)](_0xa0bab8(0x23f)),0x1;console['log'](_0xa0bab8(0x1ec));try{const _0x5710e6=TDX[_0xa0bab8(0x1f6)]({'site':_0x56674c,'apiKey':_0x20578a[_0xa0bab8(0x1d3)][_0xa0bab8(0x1eb)](),'logLevel':_0x30e36d[_0xa0bab8(0x1f8)]??LogLevel[_0xa0bab8(0x200)]}),_0x1bcdcc=await _0x5710e6[_0xa0bab8(0x22f)]['getUserInfo']();console[_0xa0bab8(0x1f7)](a23_0x2ef82c[_0xa0bab8(0x1dd)]('✓')+_0xa0bab8(0x232)+_0x1bcdcc['email']+')');const _0x4b243f=await isKeychainAvailable();_0x4b243f?(await saveAPIKeyAsync(_0x20578a[_0xa0bab8(0x1d3)]['trim'](),_0x56674c,_0xb490b6),console[_0xa0bab8(0x1f7)](a23_0x2ef82c['green']('✓')+_0xa0bab8(0x222))):console[_0xa0bab8(0x1e2)](a23_0x2ef82c[_0xa0bab8(0x204)](_0xa0bab8(0x211))),_0xb13010[_0xa0bab8(0x1e9)]=_0x56674c;}catch(_0x4ef75b){if(_0x4ef75b instanceof HTTPClientError&&_0x4ef75b['status']===0x191)return printAuthError(_0x4ef75b),0x1;return console[_0xa0bab8(0x219)](a23_0x2ef82c['red'](_0xa0bab8(0x233)+(_0x4ef75b instanceof Error?_0x4ef75b[_0xa0bab8(0x213)]:String(_0x4ef75b)))),console['error'](_0xa0bab8(0x1d7)),0x1;}}else _0xb13010[_0x1dde7d]=_0x220d35||undefined;return saveProfileToUserConfig(_0xb490b6,_0xb13010),console[_0xa0bab8(0x1f7)](a23_0x2ef82c[_0xa0bab8(0x1dd)]('✓')+'\x20Profile\x20\x27'+_0xb490b6+_0xa0bab8(0x22d)+_0x1dde7d+'='+(_0x220d35||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a23_0x32e8cc(0x226);['description']=a23_0x32e8cc(0x234);[a23_0x32e8cc(0x21a)](_0xedaa3a){const _0x77f1e4=a23_0x32e8cc,{args:_0x388bfe}=_0xedaa3a;if(_0x388bfe['length']===0x0)return _0x77f1e4(0x23d);return undefined;}async[a23_0x32e8cc(0x1f3)](_0x38c140){const _0x487829=a23_0x32e8cc,{args:_0x26cfa4,options:_0x14fded}=_0x38c140,_0x1cd3f0=_0x26cfa4[0x0],_0x120fb7=_0x14fded['default'];cleanExpiredSessions();if(!profileExists(_0x1cd3f0)){console['error'](a23_0x2ef82c['red'](_0x487829(0x23c)+_0x1cd3f0+_0x487829(0x1e0))),console['log'](_0x487829(0x23e));const _0x59c21a=listProfiles();if(_0x59c21a[_0x487829(0x1f4)]===0x0)console[_0x487829(0x1f7)](_0x487829(0x215));else for(const _0x5c8b6d of _0x59c21a){console[_0x487829(0x1f7)](_0x487829(0x1da)+_0x5c8b6d['name']);}return 0x1;}if(_0x120fb7){const _0x13672f=a23_0x8b599a[_0x487829(0x1f5)](getConfigDir(),_0x487829(0x1e4));return saveActiveProfileToUserConfig(_0x1cd3f0),console['log'](_0x487829(0x1d4)+a23_0x2ef82c[_0x487829(0x1dd)](_0x1cd3f0)),console[_0x487829(0x1f7)](a23_0x2ef82c[_0x487829(0x20a)](_0x487829(0x224)+_0x13672f)),0x0;}const _0x135ab6=getSessionID(_0x14fded[_0x487829(0x21f)]);return saveSessionContext({'profile':_0x1cd3f0},_0x14fded[_0x487829(0x21f)]),console[_0x487829(0x1f7)]('Session\x20profile\x20set\x20to:\x20'+a23_0x2ef82c[_0x487829(0x1dd)](_0x1cd3f0)+'\x20'+a23_0x2ef82c[_0x487829(0x20a)](_0x487829(0x239)+_0x135ab6+')')),console[_0x487829(0x1f7)](a23_0x2ef82c['dim'](_0x487829(0x1df)+_0x1cd3f0+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x30efcb=a24_0x5349;(function(_0x48b4ce,_0x256d1b){const _0x86e97=a24_0x5349,_0x1574ce=_0x48b4ce();while(!![]){try{const _0x25e9b5=-parseInt(_0x86e97(0x7e))/0x1+-parseInt(_0x86e97(0x8b))/0x2*(parseInt(_0x86e97(0x84))/0x3)+-parseInt(_0x86e97(0x88))/0x4+parseInt(_0x86e97(0x89))/0x5+parseInt(_0x86e97(0x7d))/0x6+parseInt(_0x86e97(0x83))/0x7*(-parseInt(_0x86e97(0x80))/0x8)+parseInt(_0x86e97(0x86))/0x9;if(_0x25e9b5===_0x256d1b)break;else _0x1574ce['push'](_0x1574ce['shift']());}catch(_0x5530e0){_0x1574ce['push'](_0x1574ce['shift']());}}}(a24_0x403a,0xad943));import{BaseCommand}from'./command.js';function a24_0x403a(){const _0x533234=['name','2776636fqkOQq','583130dxmbQQ','config','50772PIMLsR','log','length','map','Error:\x20','\x20\x20Global:\x20~/.config/tdx/tdx.json','profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','scope','description','error','151410ypJLUp','807400AJjgyf','message','24BRhuET','List\x20all\x20available\x20profiles','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','772429ehFPHY','3jPkwNH','execute','21843936MsOBhF'];a24_0x403a=function(){return _0x533234;};return a24_0x403a();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a24_0x5349(_0xca4b3b,_0x1ebeb9){_0xca4b3b=_0xca4b3b-0x7c;const _0x403a6a=a24_0x403a();let _0x53490a=_0x403a6a[_0xca4b3b];return _0x53490a;}import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a24_0x30efcb(0x87)]=a24_0x30efcb(0x91);[a24_0x30efcb(0x94)]=a24_0x30efcb(0x81);async[a24_0x30efcb(0x85)](_0x57f1ac){const _0x5bebcf=a24_0x30efcb,{options:_0x1d4776}=_0x57f1ac;try{const _0x1b97ff=listProfiles(),_0x52fea3=getActiveProfile();if(_0x1b97ff[_0x5bebcf(0x8d)]===0x0)return console[_0x5bebcf(0x8c)](_0x5bebcf(0x92)),console[_0x5bebcf(0x8c)](_0x5bebcf(0x82)),console['log'](_0x5bebcf(0x90)),0x0;const _0x4cd111=_0x1b97ff[_0x5bebcf(0x8e)](_0x430770=>{const _0x54e463=_0x5bebcf,_0x2fac88=_0x430770[_0x54e463(0x87)]===_0x52fea3,_0x31ae07=getProfileParams(_0x430770[_0x54e463(0x8a)]);return{'name':_0x430770['name'],'active':_0x2fac88,'scope':_0x430770[_0x54e463(0x93)],'description':_0x430770[_0x54e463(0x8a)][_0x54e463(0x94)]||'','params':_0x31ae07};});return await handleSDKOutput(_0x4cd111,_0x1d4776),0x0;}catch(_0xb5a5ab){return _0xb5a5ab instanceof Error&&console[_0x5bebcf(0x7c)](_0x5bebcf(0x8f)+_0xb5a5ab[_0x5bebcf(0x7f)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a25_0x10d81a=a25_0x17d1;function a25_0x5814(){const _0x2fe8ac=['information_schema','\x20splits','file','43071wGqiTH','Site:\x20','setPhase','query','7053080JYTgWF','jobId','3fsHIJc','originalMessage','data','\x20rows\x20','processedRows','40022vjpuhZ','output','totalSplits','4985013bnjOhv','\x20-\x20','setExtra','Executing\x20query...','SQL:\x20','args','error','459MceFWv','\x20[Job\x20ID:\x20','...','\x0aAll\x20results\x20saved\x20to\x20','database','description','setJobId','29pTjrUN','Schema:\x20','execute','catalog','validate','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','Run\x20Trino\x20queries\x20(streaming)','Statement\x20','828OdmXUK','message','Catalog:\x20','Executing\x20query\x20[','verbose','length','state','3039148prdbCp','stats','name','completedSplits','944715LXzdMK','188488IhWYFD'];a25_0x5814=function(){return _0x2fe8ac;};return a25_0x5814();}(function(_0x5f54f4,_0xdb9072){const _0x5008d5=a25_0x17d1,_0x4d3281=_0x5f54f4();while(!![]){try{const _0xe7057a=parseInt(_0x5008d5(0x145))/0x1*(-parseInt(_0x5008d5(0x168))/0x2)+parseInt(_0x5008d5(0x163))/0x3*(-parseInt(_0x5008d5(0x154))/0x4)+parseInt(_0x5008d5(0x158))/0x5+parseInt(_0x5008d5(0x14d))/0x6*(parseInt(_0x5008d5(0x15d))/0x7)+-parseInt(_0x5008d5(0x159))/0x8*(-parseInt(_0x5008d5(0x172))/0x9)+-parseInt(_0x5008d5(0x161))/0xa+parseInt(_0x5008d5(0x16b))/0xb;if(_0xe7057a===_0xdb9072)break;else _0x4d3281['push'](_0x4d3281['shift']());}catch(_0x1ca9db){_0x4d3281['push'](_0x4d3281['shift']());}}}(a25_0x5814,0x9e10d));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_0x17d1(_0x115f0d,_0xc8456b){_0x115f0d=_0x115f0d-0x143;const _0x5814aa=a25_0x5814();let _0x17d161=_0x5814aa[_0x115f0d];return _0x17d161;}export class QueryCommand extends BaseCommand{[a25_0x10d81a(0x156)]=a25_0x10d81a(0x160);[a25_0x10d81a(0x143)]=a25_0x10d81a(0x14b);async[a25_0x10d81a(0x147)](_0x426917){const _0x116fe7=a25_0x10d81a,{options:_0x1a49cb,args:_0x2123ea,tdx:_0x390db2}=_0x426917,_0x11caed=_0x2123ea[0x0],_0x1a0cee=_0x1a49cb[_0x116fe7(0x15c)];let _0x4844c5;try{if(_0x1a0cee)_0x4844c5=readSqlStatementsFromFile(_0x1a0cee);else{if(_0x11caed==='-')_0x4844c5=await readSqlStatementsFromStdin();else{if(_0x11caed&&isSqlFilePath(_0x11caed))_0x4844c5=readSqlStatementsFromFile(_0x11caed);else{if(_0x11caed)_0x4844c5=splitSqlStatements(_0x11caed);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x569ecd){return console[_0x116fe7(0x171)]('Error:\x20'+_0x569ecd[_0x116fe7(0x14e)]),0x1;}const _0x48a9f5=_0x1a49cb[_0x116fe7(0x176)]||_0x116fe7(0x15a),_0x43849a=_0x1a49cb[_0x116fe7(0x148)];try{const _0x465297=[],_0x342524=!!_0x1a49cb[_0x116fe7(0x169)];for(let _0x59df43=0x0;_0x59df43<_0x4844c5[_0x116fe7(0x152)];_0x59df43++){const _0x54a994=_0x4844c5[_0x59df43],_0x15e0f2=_0x59df43+0x1,_0x468dd9=_0x4844c5[_0x116fe7(0x152)],_0x5408a9=_0x468dd9>0x1;_0x1a49cb[_0x116fe7(0x151)]&&(console[_0x116fe7(0x171)]('\x0a'+(_0x5408a9?_0x116fe7(0x14c)+_0x15e0f2+'/'+_0x468dd9+':':'')),console[_0x116fe7(0x171)](_0x116fe7(0x15e)+_0x1a49cb['site']),console[_0x116fe7(0x171)](_0x116fe7(0x14f)+(_0x43849a||'td')),console[_0x116fe7(0x171)](_0x116fe7(0x146)+_0x48a9f5),console[_0x116fe7(0x171)](_0x116fe7(0x16f)+_0x54a994));const _0x5e1130=_0x5408a9?'Executing\x20statement\x20'+_0x15e0f2+'/'+_0x468dd9+_0x116fe7(0x174):_0x116fe7(0x16e);try{const _0x2d593b=await withProgressSpinner(_0x5e1130,async _0x3068ea=>{const _0x290b2e=_0x116fe7,_0x46a2ef=await _0x390db2[_0x290b2e(0x160)][_0x290b2e(0x147)](_0x54a994,{'catalog':_0x43849a,'schema':_0x48a9f5,'onJobId':_0x84ee32=>{const _0xecd557=_0x290b2e;_0x3068ea[_0xecd557(0x144)](_0x84ee32);},'onProgress':_0x43aa46=>{const _0x558d25=_0x290b2e;_0x3068ea[_0x558d25(0x15f)](_0x558d25(0x150)+_0x43aa46[_0x558d25(0x153)]+']'),_0x3068ea[_0x558d25(0x16d)](formatRows(_0x43aa46[_0x558d25(0x167)])+'\x20rows\x20'+_0x43aa46[_0x558d25(0x157)]+'/'+_0x43aa46[_0x558d25(0x16a)]+_0x558d25(0x15b));}});return _0x46a2ef;},{'verbose':_0x1a49cb[_0x116fe7(0x151)]}),_0x56dfb9=_0x2d593b[_0x116fe7(0x165)],_0x2eda6c=_0x56dfb9[_0x116fe7(0x162)]?_0x116fe7(0x173)+_0x56dfb9[_0x116fe7(0x162)]+']':'',_0x3c9aa2=_0x5408a9?_0x116fe7(0x14c)+_0x15e0f2+'/'+_0x468dd9+_0x116fe7(0x16c):'';console[_0x116fe7(0x171)]('✔\x20'+_0x3c9aa2+'Query\x20completed:\x20Processed\x20'+formatRows(_0x56dfb9[_0x116fe7(0x155)][_0x116fe7(0x167)])+_0x116fe7(0x166)+('in\x20'+formatElapsed(_0x56dfb9[_0x116fe7(0x155)]['elapsedTimeMillis'])+_0x2eda6c));if(_0x5408a9&&_0x342524){const _0x598a09=resolveOutputOptions(_0x1a49cb),_0x220402=await formatQueryOutput(_0x56dfb9,_0x598a09);_0x465297['push'](_0x220402);}else await handleQueryOutput(_0x56dfb9,_0x1a49cb);}catch(_0x34750c){const _0x15a0cf=_0x5408a9?_0x116fe7(0x14c)+_0x15e0f2+'/'+_0x468dd9+':\x0a':'',_0x278c5b=_0x34750c instanceof SDKError?_0x34750c[_0x116fe7(0x164)]:_0x34750c['message'];return console[_0x116fe7(0x171)](''+_0x15a0cf+_0x278c5b),0x1;}}if(_0x4844c5['length']>0x1&&_0x342524&&_0x465297[_0x116fe7(0x152)]>0x0){const _0xfad294=_0x465297['join']('\x0a');writeFileSync(_0x1a49cb['output'],_0xfad294),console[_0x116fe7(0x171)](_0x116fe7(0x175)+_0x1a49cb[_0x116fe7(0x169)]);}return 0x0;}catch(_0x4fa7a8){throw _0x4fa7a8;}}[a25_0x10d81a(0x149)](_0x4c8481){const _0x205f87=a25_0x10d81a,_0x1b6ff7=_0x4c8481[_0x205f87(0x170)][0x0],_0x1e03f0=_0x4c8481['options']['file'];if(!_0x1b6ff7&&!_0x1e03f0)return _0x205f87(0x14a);if(_0x1b6ff7&&_0x1e03f0)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';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_0x3a7757=a26_0x34cc;(function(_0x22a3be,_0x5d2fe7){const _0x36d284=a26_0x34cc,_0x3fe171=_0x22a3be();while(!![]){try{const _0x572eb6=-parseInt(_0x36d284(0x221))/0x1+-parseInt(_0x36d284(0x1fe))/0x2*(-parseInt(_0x36d284(0x1ea))/0x3)+-parseInt(_0x36d284(0x1eb))/0x4*(parseInt(_0x36d284(0x1da))/0x5)+-parseInt(_0x36d284(0x1f5))/0x6*(parseInt(_0x36d284(0x21d))/0x7)+parseInt(_0x36d284(0x202))/0x8+parseInt(_0x36d284(0x1c6))/0x9*(parseInt(_0x36d284(0x238))/0xa)+parseInt(_0x36d284(0x1d5))/0xb;if(_0x572eb6===_0x5d2fe7)break;else _0x3fe171['push'](_0x3fe171['shift']());}catch(_0x23a81c){_0x3fe171['push'](_0x3fe171['shift']());}}}(a26_0x5301,0xbdaf1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a26_0x34cc(_0x424630,_0xb95b36){_0x424630=_0x424630-0x1c4;const _0x5301d4=a26_0x5301();let _0x34cc11=_0x5301d4[_0x424630];return _0x34cc11;}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_0x5a15d5 from'chalk';function formatRelativeTime(_0x288cba){const _0x32d879=a26_0x34cc,_0x54316d=new Date(_0x288cba),_0x22de07=new Date(),_0x23d827=_0x54316d[_0x32d879(0x1ed)]()-_0x22de07[_0x32d879(0x1ed)](),_0x4487eb=Math['abs'](_0x23d827)/0x3e8,_0x322ad7=_0x23d827<0x0;if(_0x4487eb<0x3c)return _0x322ad7?_0x32d879(0x1df):_0x32d879(0x23b);else{if(_0x4487eb<0xe10){const _0x466e5e=Math[_0x32d879(0x1f4)](_0x4487eb/0x3c);return _0x322ad7?_0x466e5e+_0x32d879(0x1f6):_0x32d879(0x1d1)+_0x466e5e+'m';}else{if(_0x4487eb<0x15180){const _0x2ef68d=Math['round'](_0x4487eb/0xe10);return _0x322ad7?_0x2ef68d+_0x32d879(0x204):_0x32d879(0x1d1)+_0x2ef68d+'h';}else{if(_0x4487eb<0x93a80){const _0x23bf63=Math[_0x32d879(0x1f4)](_0x4487eb/0x15180);return _0x322ad7?_0x23bf63+'d\x20ago':_0x32d879(0x1d1)+_0x23bf63+'d';}else return _0x54316d[_0x32d879(0x1e1)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x3a7757(0x235)]=a26_0x3a7757(0x1c8);[a26_0x3a7757(0x246)]=a26_0x3a7757(0x215);async[a26_0x3a7757(0x23a)](_0x2891d3){const _0x3818e5=a26_0x3a7757,{options:_0x52299b,args:_0x175eb4,tdx:_0x28d9ca}=_0x2891d3,_0x27f114=resolveLimit(_0x52299b[_0x3818e5(0x1c5)],DEFAULT_DISPLAY_LIMIT),_0x242ae1=_0x175eb4[0x0],_0x154c16=_0x242ae1?_0x3818e5(0x1e7)+_0x242ae1+_0x3818e5(0x20c):'Listing\x20scheduled\x20queries...',_0x220555=await withSpinner(_0x154c16,()=>_0x28d9ca[_0x3818e5(0x1d3)][_0x3818e5(0x1e8)]({'limit':_0x27f114,'scheduled':!![],'pattern':_0x242ae1}),{'verbose':_0x52299b[_0x3818e5(0x1dc)]}),_0x3f9703=_0x220555[_0x3818e5(0x1f9)][_0x3818e5(0x242)],_0x2d0602=_0x220555[_0x3818e5(0x1f9)][_0x3818e5(0x218)][_0x3818e5(0x230)],_0x5077e8=_0x242ae1?_0x3818e5(0x1ee)+_0x242ae1+'\x22':'';_0x2d0602?console[_0x3818e5(0x1f8)](_0x3818e5(0x1ef)+_0x3f9703[_0x3818e5(0x22a)]+_0x3818e5(0x1d9)+_0x5077e8+'\x20(use\x20--limit\x20to\x20see\x20more)'):console['error'](_0x3818e5(0x21b)+_0x3f9703[_0x3818e5(0x22a)]+'\x20scheduled\x20quer'+(_0x3f9703[_0x3818e5(0x22a)]!==0x1?_0x3818e5(0x200):'y')+_0x5077e8);if(_0x52299b[_0x3818e5(0x1dd)]===_0x3818e5(0x237)||_0x52299b[_0x3818e5(0x1dd)]===_0x3818e5(0x207)||_0x52299b[_0x3818e5(0x1dd)]===_0x3818e5(0x1d6)||_0x52299b[_0x3818e5(0x1dd)]===_0x3818e5(0x217)){const _0x31e992=_0x3f9703[_0x3818e5(0x21f)](_0x4a9651=>({'id':_0x4a9651['id'],'name':_0x4a9651[_0x3818e5(0x235)],'cron':_0x4a9651[_0x3818e5(0x241)],'database':_0x4a9651[_0x3818e5(0x228)]?.['name'],'type':_0x4a9651[_0x3818e5(0x208)],'timezone':_0x4a9651[_0x3818e5(0x1d0)],'user_name':_0x4a9651['user']?.[_0x3818e5(0x235)],'updated_at':_0x4a9651['updated_at'],'next_run_at':_0x4a9651[_0x3818e5(0x20d)],'last_job_status':_0x4a9651[_0x3818e5(0x24e)]?.[_0x3818e5(0x225)]}));await handleSDKOutput(_0x31e992,_0x52299b);}else{if(_0x3f9703['length']===0x0)console[_0x3818e5(0x24a)](_0x3818e5(0x1cd));else{const _0x124ed0=_0x52299b['site'],_0x30b633=_0x3f9703[_0x3818e5(0x21f)](_0x30d147=>{const _0x52c481=_0x3818e5,_0x1c2de5=_0x30d147[_0x52c481(0x24e)]?.[_0x52c481(0x225)]?_0x30d147['last_job'][_0x52c481(0x225)]===_0x52c481(0x245)?'✓':'✗':'-',_0x333a6b=_0x30d147['last_job']?.['ended_at']?formatRelativeTime(_0x30d147[_0x52c481(0x24e)][_0x52c481(0x1d8)]):_0x52c481(0x1cf),_0x48a4c0=_0x30d147[_0x52c481(0x20d)]?formatRelativeTime(_0x30d147[_0x52c481(0x20d)]):'-',_0x385e2f=_0x30d147[_0x52c481(0x241)]||'',_0x23587e=_0x30d147['name']||'(unnamed)',_0x26c6dc=getConsoleUrl(_0x124ed0,_0x52c481(0x251)+_0x30d147['id']);return{'statusIcon':_0x1c2de5,'lastRun':_0x333a6b,'nextRun':_0x48a4c0,'cron':_0x385e2f,'name':_0x23587e,'queryUrl':_0x26c6dc,'status':_0x30d147['last_job']?.[_0x52c481(0x225)]};}),_0x1823a5=Math[_0x3818e5(0x24c)](..._0x30b633[_0x3818e5(0x21f)](_0xfb5021=>_0xfb5021[_0x3818e5(0x201)][_0x3818e5(0x22a)])),_0x3fec4b=Math[_0x3818e5(0x24c)](..._0x30b633[_0x3818e5(0x21f)](_0x128136=>_0x128136[_0x3818e5(0x1fb)][_0x3818e5(0x22a)])),_0x34dfaa=Math[_0x3818e5(0x24c)](..._0x30b633[_0x3818e5(0x21f)](_0x57dae6=>_0x57dae6[_0x3818e5(0x241)][_0x3818e5(0x22a)])),_0x5c4eeb=_0x30b633[_0x3818e5(0x21f)](_0x22f444=>{const _0x3294eb=_0x3818e5,_0x32bb26=_0x22f444[_0x3294eb(0x225)]===_0x3294eb(0x245)?a26_0x5a15d5['green'](_0x22f444[_0x3294eb(0x1f2)]):_0x22f444[_0x3294eb(0x225)]===_0x3294eb(0x1f8)?a26_0x5a15d5['red'](_0x22f444['statusIcon']):a26_0x5a15d5[_0x3294eb(0x22b)](_0x22f444[_0x3294eb(0x1f2)]),_0x3ec7c9=_0x22f444[_0x3294eb(0x201)]['padEnd'](_0x1823a5),_0x4f1279=_0x22f444[_0x3294eb(0x1fb)][_0x3294eb(0x1db)](_0x3fec4b),_0x385548=_0x22f444[_0x3294eb(0x241)]?a26_0x5a15d5['cyan'](_0x22f444[_0x3294eb(0x241)][_0x3294eb(0x1db)](_0x34dfaa)):'\x20'[_0x3294eb(0x1e3)](_0x34dfaa),_0x3134f1=hyperlink(_0x22f444[_0x3294eb(0x235)],_0x22f444[_0x3294eb(0x249)]);return _0x3294eb(0x1e0)+_0x32bb26+'\x20'+_0x3ec7c9+_0x3294eb(0x1cc)+_0x4f1279+'\x20\x20'+_0x385548+'\x20\x20'+_0x3134f1;});await writeOutput(_0x5c4eeb[_0x3818e5(0x229)]('\x0a'),_0x52299b[_0x3818e5(0x1fa)],_0x3818e5(0x20b));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a26_0x3a7757(0x1f3);[a26_0x3a7757(0x246)]=a26_0x3a7757(0x1ec);[a26_0x3a7757(0x220)](_0x2d2d79){const _0x4da871=_0x2d2d79['args'][0x0];if(!_0x4da871)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a26_0x3a7757(0x23a)](_0x1255b5){const _0x346d21=a26_0x3a7757,{options:_0x1db922,args:_0x2cd01c,tdx:_0xf39af0}=_0x1255b5,_0x4f1fca=_0x2cd01c[0x0],_0x33e3cc=await withSpinner('Getting\x20schedule\x20details...',()=>_0xf39af0[_0x346d21(0x1d3)][_0x346d21(0x233)](_0x4f1fca),{'verbose':_0x1db922['verbose']}),_0x598ca0=_0x33e3cc[_0x346d21(0x1f9)],_0x3db95f={'name':_0x598ca0['name'],'cron':_0x598ca0[_0x346d21(0x241)],'database':_0x598ca0['database'],'type':_0x598ca0[_0x346d21(0x208)],'timezone':_0x598ca0[_0x346d21(0x1ce)],'user_name':_0x598ca0[_0x346d21(0x239)],'created_at':_0x598ca0[_0x346d21(0x244)],'engine_version':_0x598ca0['engine_version'],'executing_user_id':_0x598ca0[_0x346d21(0x21c)],'query':_0x598ca0[_0x346d21(0x1f0)],'delay':_0x598ca0['delay'],'priority':_0x598ca0['priority'],'retry_limit':_0x598ca0[_0x346d21(0x1cb)],..._0x598ca0['result']&&{'result':_0x598ca0[_0x346d21(0x243)]}};return await handleSingleObjectOutput(_0x3db95f,_0x1db922),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x3a7757(0x235)]=a26_0x3a7757(0x214);[a26_0x3a7757(0x246)]=a26_0x3a7757(0x22d);['validate'](_0xcb979d){const _0x1bc335=_0xcb979d['args'][0x0];if(!_0x1bc335)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a26_0x3a7757(0x23a)](_0x10a4bd){const _0x528c9f=a26_0x3a7757,{options:_0x4fe2cd,args:_0x32b62b,tdx:_0x2ed701}=_0x10a4bd,_0x257901=_0x32b62b[0x0],_0x5bd18d=_0x4fe2cd,_0x26e7e5=_0x5bd18d[_0x528c9f(0x228)],_0x4c8406=_0x5bd18d['file'],_0x51e1fc=_0x5bd18d[_0x528c9f(0x208)]||'trino';let _0x16cab3;try{_0x16cab3=readFileSync(_0x4c8406,_0x528c9f(0x210))[_0x528c9f(0x22c)]();}catch(_0x46d551){throw new SDKError(ErrorCode[_0x528c9f(0x21a)],_0x528c9f(0x1c7)+_0x4c8406,_0x46d551 instanceof Error?_0x46d551:undefined);}if(!_0x16cab3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x528c9f(0x23c));const _0x137c11={'database':_0x26e7e5,'query':_0x16cab3,'type':_0x51e1fc};if(_0x5bd18d[_0x528c9f(0x241)])_0x137c11[_0x528c9f(0x241)]=_0x5bd18d[_0x528c9f(0x241)];if(_0x5bd18d[_0x528c9f(0x1ce)])_0x137c11['timezone']=_0x5bd18d['timezone'];if(_0x5bd18d[_0x528c9f(0x248)]!==undefined)_0x137c11[_0x528c9f(0x248)]=Number(_0x5bd18d[_0x528c9f(0x248)]);if(_0x5bd18d[_0x528c9f(0x224)]!==undefined)_0x137c11[_0x528c9f(0x224)]=Number(_0x5bd18d[_0x528c9f(0x224)]);if(_0x5bd18d[_0x528c9f(0x232)]!==undefined)_0x137c11[_0x528c9f(0x1cb)]=Number(_0x5bd18d[_0x528c9f(0x232)]);if(_0x5bd18d[_0x528c9f(0x226)])_0x137c11[_0x528c9f(0x24d)]=_0x5bd18d[_0x528c9f(0x226)];if(_0x5bd18d[_0x528c9f(0x243)])_0x137c11['result']=_0x5bd18d['result'];if(_0x4fe2cd['verbose']){console[_0x528c9f(0x1f8)](_0x528c9f(0x20f)+_0x257901),console[_0x528c9f(0x1f8)](_0x528c9f(0x1e2)+_0x26e7e5),console[_0x528c9f(0x1f8)]('\x20\x20Type:\x20'+_0x51e1fc);if(_0x137c11['cron'])console[_0x528c9f(0x1f8)](_0x528c9f(0x223)+_0x137c11['cron']);if(_0x137c11['timezone'])console[_0x528c9f(0x1f8)](_0x528c9f(0x236)+_0x137c11[_0x528c9f(0x1ce)]);}const _0x3c57c4=await withSpinner(_0x528c9f(0x20e),()=>_0x2ed701[_0x528c9f(0x1d3)][_0x528c9f(0x1fc)](_0x257901,_0x137c11),{'verbose':_0x4fe2cd[_0x528c9f(0x1dc)]});return console['error'](_0x528c9f(0x227)+_0x3c57c4['data'][_0x528c9f(0x235)]),await handleSingleObjectOutput(_0x3c57c4[_0x528c9f(0x1f9)],_0x4fe2cd),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x3a7757(0x235)]=a26_0x3a7757(0x203);[a26_0x3a7757(0x246)]=a26_0x3a7757(0x219);[a26_0x3a7757(0x220)](_0x2a2e8a){const _0x3dd317=_0x2a2e8a['args'][0x0];if(!_0x3dd317)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async['execute'](_0x282f7d){const _0x1f7c15=a26_0x3a7757,{options:_0x325797,args:_0x36a712,tdx:_0x4a5435}=_0x282f7d,_0x1c5061=_0x36a712[0x0],_0x151816=_0x325797,_0x684b5a={};if(_0x151816[_0x1f7c15(0x228)])_0x684b5a['database']=_0x151816[_0x1f7c15(0x228)];if(_0x151816[_0x1f7c15(0x208)])_0x684b5a[_0x1f7c15(0x208)]=_0x151816[_0x1f7c15(0x208)];if(_0x151816['cron'])_0x684b5a[_0x1f7c15(0x241)]=_0x151816['cron'];if(_0x151816[_0x1f7c15(0x1ce)])_0x684b5a['timezone']=_0x151816[_0x1f7c15(0x1ce)];if(_0x151816[_0x1f7c15(0x248)]!==undefined)_0x684b5a[_0x1f7c15(0x248)]=Number(_0x151816[_0x1f7c15(0x248)]);if(_0x151816[_0x1f7c15(0x224)]!==undefined)_0x684b5a['priority']=Number(_0x151816[_0x1f7c15(0x224)]);if(_0x151816[_0x1f7c15(0x232)]!==undefined)_0x684b5a[_0x1f7c15(0x1cb)]=Number(_0x151816[_0x1f7c15(0x232)]);if(_0x151816['engineVersion'])_0x684b5a['engine_version']=_0x151816[_0x1f7c15(0x226)];if(_0x151816[_0x1f7c15(0x243)])_0x684b5a[_0x1f7c15(0x243)]=_0x151816['result'];if(_0x151816[_0x1f7c15(0x1f1)])try{_0x684b5a['query']=readFileSync(_0x151816['file'],'utf-8')['trim']();}catch(_0x19abe9){throw new SDKError(ErrorCode[_0x1f7c15(0x21a)],_0x1f7c15(0x1c7)+_0x151816[_0x1f7c15(0x1f1)],_0x19abe9 instanceof Error?_0x19abe9:undefined);}if(Object['keys'](_0x684b5a)['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1f7c15(0x1e6));if(_0x325797[_0x1f7c15(0x1dc)]){console['error'](_0x1f7c15(0x231)+_0x1c5061);for(const [_0x3be6b5,_0x1f14b4]of Object[_0x1f7c15(0x1ff)](_0x684b5a)){_0x3be6b5===_0x1f7c15(0x1f0)?console[_0x1f7c15(0x1f8)]('\x20\x20'+_0x3be6b5+':\x20'+_0x1f14b4[_0x1f7c15(0x21e)](0x0,0x32)+'...'):console[_0x1f7c15(0x1f8)]('\x20\x20'+_0x3be6b5+':\x20'+_0x1f14b4);}}const _0x26ede1=await withSpinner(_0x1f7c15(0x209),()=>_0x4a5435[_0x1f7c15(0x1d3)][_0x1f7c15(0x1c9)](_0x1c5061,_0x684b5a),{'verbose':_0x325797[_0x1f7c15(0x1dc)]});return console[_0x1f7c15(0x1f8)](_0x1f7c15(0x252)+_0x26ede1[_0x1f7c15(0x1f9)]['name']),await handleSingleObjectOutput(_0x26ede1['data'],_0x325797),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x3a7757(0x235)]='schedule:delete';[a26_0x3a7757(0x246)]=a26_0x3a7757(0x22e);['validate'](_0x4ad990){const _0x3470bb=a26_0x3a7757,_0x17b24f=_0x4ad990[_0x3470bb(0x1de)][0x0];if(!_0x17b24f)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async['execute'](_0x519d9e){const _0x1dd8f6=a26_0x3a7757,{options:_0x247096,args:_0x29f060,tdx:_0xd80b41}=_0x519d9e,_0x14c764=_0x29f060[0x0];if(!_0x247096[_0x1dd8f6(0x1c4)]){const _0x397e29=await confirm(_0x1dd8f6(0x1fd)+_0x14c764+'\x22?');if(!_0x397e29)return console[_0x1dd8f6(0x1f8)](_0x1dd8f6(0x1d4)),0x0;}const _0x194fd9=await withSpinner(_0x1dd8f6(0x250),()=>_0xd80b41[_0x1dd8f6(0x1d3)][_0x1dd8f6(0x253)](_0x14c764),{'verbose':_0x247096[_0x1dd8f6(0x1dc)]});return console['error']('Schedule\x20deleted:\x20'+_0x194fd9[_0x1dd8f6(0x1f9)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x3a7757(0x235)]=a26_0x3a7757(0x234);[a26_0x3a7757(0x246)]=a26_0x3a7757(0x240);[a26_0x3a7757(0x220)](_0x477487){const _0x25516f=a26_0x3a7757,_0x5a012a=_0x477487[_0x25516f(0x1de)][0x0];if(!_0x5a012a)return _0x25516f(0x1e4);return undefined;}async[a26_0x3a7757(0x23a)](_0x446018){const _0x5d8e22=a26_0x3a7757,{options:_0x33355d,args:_0x1892f3,tdx:_0x4ccf78}=_0x446018,_0x5b6efa=_0x1892f3[0x0],_0x2de628=_0x33355d,_0x202999=_0x2de628[_0x5d8e22(0x213)],_0x29e411=_0x2de628[_0x5d8e22(0x24f)]!==undefined?Number(_0x2de628[_0x5d8e22(0x24f)]):undefined;if(_0x33355d[_0x5d8e22(0x1dc)]){console[_0x5d8e22(0x1f8)](_0x5d8e22(0x23d)+_0x5b6efa);if(_0x202999)console['error']('\x20\x20Time:\x20'+_0x202999);if(_0x29e411)console[_0x5d8e22(0x1f8)](_0x5d8e22(0x205)+_0x29e411);}const _0x1220ac=await withSpinner(_0x5d8e22(0x1ca),()=>_0x4ccf78[_0x5d8e22(0x1d3)][_0x5d8e22(0x1f7)](_0x5b6efa,{'time':_0x202999,'num':_0x29e411}),{'verbose':_0x33355d[_0x5d8e22(0x1dc)]}),_0x257d72=_0x1220ac['data'][_0x5d8e22(0x1e9)];console[_0x5d8e22(0x1f8)]('Schedule\x20run\x20submitted:\x20'+_0x257d72[_0x5d8e22(0x22a)]+'\x20job'+(_0x257d72[_0x5d8e22(0x22a)]!==0x1?'s':'')+_0x5d8e22(0x20a));for(const _0x41ac47 of _0x257d72){console[_0x5d8e22(0x1f8)](_0x5d8e22(0x216)+_0x41ac47['job_id']);}return await handleSDKOutput(_0x257d72,_0x33355d),0x0;}}function a26_0x5301(){const _0x3ccc2b=['list','\x22...','next_run_at','Creating\x20schedule...','Creating\x20schedule:\x20','utf-8','schedule:history','Getting\x20schedule\x20history...','time','schedule:create','List\x20scheduled\x20queries','\x20\x20Job\x20ID:\x20','tsv','pagination','Update\x20a\x20scheduled\x20query','INVALID_ARGUMENT','Found\x20','executing_user_id','7aEvDVg','substring','map','validate','717850hCVBjv','job_id','\x20\x20Cron:\x20','priority','status','engineVersion','Schedule\x20created:\x20','database','join','length','dim','trim','Create\x20a\x20scheduled\x20query','Delete\x20a\x20scheduled\x20query','count','has_next_page','Updating\x20schedule:\x20','retryLimit','show','schedule:run','name','\x20\x20Timezone:\x20','json','10BDqibb','user_name','execute','soon','Query\x20file\x20is\x20empty','Running\x20schedule:\x20','scheduled_at','\x20execution','Run\x20a\x20scheduled\x20query\x20immediately','cron','queries','result','created_at','success','description','history','delay','queryUrl','log','Show\x20schedule\x20execution\x20history','max','engine_version','last_job','num','Deleting\x20schedule...','/app/queries/editor?queryId=','Schedule\x20updated:\x20','delete','yes','limit','8690607ywrPfh','Failed\x20to\x20read\x20file:\x20','schedule:list','update','Running\x20schedule...','retry_limit','\x20\x20→\x20','No\x20scheduled\x20queries\x20found','timezone','never','time_zone','in\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','schedules','Cancelled','25067834ErYtXC','table','start_at','ended_at','\x20schedules','1702535wQQJln','padEnd','verbose','format','args','just\x20now','📅\x20','toLocaleDateString','\x20\x20Database:\x20','repeat','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','end_at','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Searching\x20scheduled\x20queries\x20matching\x20\x22','listQueries','jobs','21fCNbvU','16lTvQbz','Show\x20schedule\x20details','getTime','\x20matching\x20\x22','Showing\x20first\x20','query','file','statusIcon','schedule:show','round','5652642hbdcRb','m\x20ago','run','error','data','output','nextRun','create','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','123406zUGrpm','entries','ies','lastRun','979936uRylrd','schedule:update','h\x20ago','\x20\x20Num:\x20','from','jsonl','type','Updating\x20schedule...','\x20created'];a26_0x5301=function(){return _0x3ccc2b;};return a26_0x5301();}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x3a7757(0x235)]=a26_0x3a7757(0x211);['description']=a26_0x3a7757(0x24b);[a26_0x3a7757(0x220)](_0x13ac5d){const _0x6ffc8c=a26_0x3a7757,_0x1f3a2b=_0x13ac5d[_0x6ffc8c(0x1de)][0x0];if(!_0x1f3a2b)return _0x6ffc8c(0x1d2);return undefined;}async['execute'](_0x4d3fdf){const _0x13e400=a26_0x3a7757,{options:_0xbbf4a9,args:_0x3a50ed,tdx:_0xb7154d}=_0x4d3fdf,_0x4f2141=_0x3a50ed[0x0],_0xa9a0a0=_0xbbf4a9,_0x46d654=_0xa9a0a0[_0x13e400(0x206)]!==undefined?Number(_0xa9a0a0['from']):undefined,_0x589fb4=_0xa9a0a0['to']!==undefined?Number(_0xa9a0a0['to']):undefined,_0x58378b=await withSpinner(_0x13e400(0x212),()=>_0xb7154d[_0x13e400(0x1d3)]['history'](_0x4f2141,{'from':_0x46d654,'to':_0x589fb4}),{'verbose':_0xbbf4a9[_0x13e400(0x1dc)]}),_0x5d635d=_0x58378b[_0x13e400(0x1f9)];console['error'](_0x13e400(0x21b)+_0x5d635d[_0x13e400(0x22f)]+_0x13e400(0x23f)+(_0x5d635d[_0x13e400(0x22f)]!==0x1?'s':'')+'\x20(showing\x20'+_0x5d635d['from']+'-'+_0x5d635d['to']+')');const _0x3ba81d=_0x5d635d[_0x13e400(0x247)][_0x13e400(0x21f)](_0x54df2c=>({'job_id':_0x54df2c[_0x13e400(0x222)],'type':_0x54df2c[_0x13e400(0x208)],'status':_0x54df2c[_0x13e400(0x225)],'scheduled_at':_0x54df2c[_0x13e400(0x23e)],'created_at':_0x54df2c[_0x13e400(0x244)],'start_at':_0x54df2c[_0x13e400(0x1d7)],'end_at':_0x54df2c[_0x13e400(0x1e5)]}));return await handleSDKOutput(_0x3ba81d,_0xbbf4a9),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_0x3e59f1=a27_0x2d22;(function(_0x300e68,_0x26efb6){const _0x1cdbb8=a27_0x2d22,_0x1e840d=_0x300e68();while(!![]){try{const _0x112267=-parseInt(_0x1cdbb8(0x14e))/0x1*(parseInt(_0x1cdbb8(0x122))/0x2)+-parseInt(_0x1cdbb8(0x157))/0x3+parseInt(_0x1cdbb8(0x195))/0x4*(parseInt(_0x1cdbb8(0x104))/0x5)+-parseInt(_0x1cdbb8(0x114))/0x6+parseInt(_0x1cdbb8(0x179))/0x7+parseInt(_0x1cdbb8(0x10b))/0x8+parseInt(_0x1cdbb8(0x14a))/0x9;if(_0x112267===_0x26efb6)break;else _0x1e840d['push'](_0x1e840d['shift']());}catch(_0x26e318){_0x1e840d['push'](_0x1e840d['shift']());}}}(a27_0x1014,0x58f00));function a27_0x2d22(_0x4b4890,_0x4cf041){_0x4b4890=_0x4b4890-0xff;const _0x101410=a27_0x1014();let _0x2d2269=_0x101410[_0x4b4890];return _0x2d2269;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a27_0x1014(){const _0x4e403c=['in\x20','trim','replace','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','green','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Parent\x20ID:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','segment:folder:show','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Creating\x20folder\x20\x27','Fetching\x20segment\x20details...','3636189AHmijy','folderId','test','Resolving\x20parent\x20segment\x20\x27','76lEgAQJ','segmentId','Error:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','✔\x20Created\x20folder\x20\x27','limit','execute','Folder\x20ID\x20missing\x20from\x20resolved\x20path','getSegment','702423SZhFAX','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','fullPath','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','site','Options:','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Get\x20SQL\x20query\x20for\x20child\x20segment','Examples:','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolved\x20parent\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','cause','segment','description','Show\x20segment\x20folder\x20details','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Folder\x20name:\x20','Use:\x20tdx\x20ps\x20view\x20-w','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20folder','\x20\x20Folder\x20path:\x20','SEGMENT_NOT_FOUND','Usage:\x20tdx\x20sg\x20show\x20<name>','cyan','SELECT\x20*\x20FROM\x20(\x0a','verbose','3323019ZsWTXi','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Folder\x20ID:\x20','type','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','getFolder','segment:desc','getSegmentSQL','createFolder','resolvePathToResource','Resolved\x20YAML\x20file:\x20','log','Fetching\x20folder\x20\x27','(root)','Resolved\x20relative\x20path\x20to:\x20','segment:describe','stats','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','message','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Show\x20child\x20segment\x20schema\x20(column\x20types)','segment:folder:create','elapsedTimeMillis','error','toLocaleString','506272cFClGq','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','code','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','resolveParentId','listFolders','resolveFolderId','json','segment:folder:list','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20sql','Fetching\x20folder\x20details...','5SJGYmq','parent','Resolving\x20\x27','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','/app/ps/','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','1085472tLglSZ','Parent\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','INVALID_ARGUMENT','✖\x20Query\x20failed\x20[','url','SQL\x20query:\x0a','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','processedRows','1514358tyzySZ','Resolved\x20type:\x20','setJobId','\x27\x20with\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','/e/','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Resolving\x20path\x20\x27','jsonl','Segment\x20ID:\x20','\x20rows\x20','\x27...','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','segment:sql','7636NPZnUJ','Use:\x20tdx\x20ps\x20show','\x20\x20Cause:\x20','✔\x20Found\x20','Site:\x20','length','folder','Use:\x20tdx\x20ps\x20desc','name','parentSegment','Show\x20segment\x20or\x20folder\x20details','SEGMENT_FOLDER_NOT_FOUND','segmentPath','Show\x20folder\x20or\x20child\x20segment\x20details','format','parentId','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Target\x20path:\x20','\x20[Job\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','jobId','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolved\x20parent\x20folder\x20ID:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','parentFolder'];a27_0x1014=function(){return _0x4e403c;};return a27_0x1014();}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_0x383d22 from'chalk';async function resolveSegmentTarget(_0x1628c2,_0x4fd0e5,_0x385d50){const _0x273dc9=a27_0x2d22;if(isYamlFilePath(_0x1628c2))try{const _0x48fd36=await resolveYamlFilePath(_0x1628c2);return _0x385d50&&(console['error'](_0x273dc9(0x185)+_0x1628c2),console[_0x273dc9(0x193)]('\x20\x20Parent\x20segment:\x20'+_0x48fd36[_0x273dc9(0x12b)]),console[_0x273dc9(0x193)]('\x20\x20Segment\x20name:\x20'+_0x48fd36['segmentName']),console[_0x273dc9(0x193)](_0x273dc9(0x173)+(_0x48fd36['folderPath']||_0x273dc9(0x188))),console[_0x273dc9(0x193)]('\x20\x20Full\x20path:\x20'+_0x48fd36[_0x273dc9(0x15b)])),_0x48fd36[_0x273dc9(0x15b)];}catch(_0x425ff4){throw new SDKError(ErrorCode[_0x273dc9(0x10e)],_0x273dc9(0x196)+_0x425ff4['message']);}if(!_0x4fd0e5)throw new SDKError(ErrorCode[_0x273dc9(0x10e)],_0x273dc9(0x151));return _0x4fd0e5+'/'+_0x1628c2;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x3e59f1(0x12a)]=a27_0x3e59f1(0x18a);[a27_0x3e59f1(0x16a)]=a27_0x3e59f1(0x12c);async[a27_0x3e59f1(0x154)](_0x4b9fa1){const _0x32cd3c=a27_0x3e59f1,{options:_0x13a551,args:_0x54f8b6,tdx:_0x4d8df5}=_0x4b9fa1,_0x5d3515=_0x54f8b6[0x0],_0x258b94=!_0x5d3515&&!!_0x13a551['parentSegment'],_0x43e704=_0x5d3515||_0x13a551[_0x32cd3c(0x12b)];if(!_0x43e704)return console[_0x32cd3c(0x193)](_0x32cd3c(0x145)),console['error'](_0x32cd3c(0x13a)),console[_0x32cd3c(0x193)](_0x32cd3c(0x163)),console[_0x32cd3c(0x193)](_0x32cd3c(0x16d)),console[_0x32cd3c(0x193)](_0x32cd3c(0x143)),console['error'](_0x32cd3c(0x18c)),console[_0x32cd3c(0x193)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x99c347=_0x13a551[_0x32cd3c(0x12e)];let _0x3f907a=_0x43e704;!_0x258b94&&_0x99c347&&!_0x43e704['includes']('/')&&(_0x3f907a=_0x99c347+'/'+_0x43e704,_0x13a551[_0x32cd3c(0x178)]&&console[_0x32cd3c(0x193)](_0x32cd3c(0x189)+_0x3f907a));const _0x2164d8=await withSpinner(_0x32cd3c(0x11b)+_0x3f907a+_0x32cd3c(0x11f),()=>_0x4d8df5[_0x32cd3c(0x169)][_0x32cd3c(0x184)](_0x3f907a),{'verbose':_0x13a551['verbose']}),_0x422571=_0x2164d8[_0x32cd3c(0x160)];_0x13a551[_0x32cd3c(0x178)]&&(console['error']('Resolved\x20type:\x20'+_0x422571['type']),console[_0x32cd3c(0x193)](_0x32cd3c(0x144)+_0x422571['parentId']),_0x422571['folderId']&&console['error'](_0x32cd3c(0x17d)+_0x422571[_0x32cd3c(0x14b)]),_0x422571[_0x32cd3c(0x14f)]&&console[_0x32cd3c(0x193)](_0x32cd3c(0x11d)+_0x422571[_0x32cd3c(0x14f)]));if(_0x422571[_0x32cd3c(0x17e)]==='parent'){const _0x551881=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x4d8df5[_0x32cd3c(0x169)]['getParent'](_0x422571[_0x32cd3c(0x131)]),{'verbose':_0x13a551[_0x32cd3c(0x178)]});await handleSingleObjectOutput(_0x551881[_0x32cd3c(0x160)],_0x13a551);}else{if(_0x422571[_0x32cd3c(0x17e)]===_0x32cd3c(0x128)){if(!_0x422571['folderId'])throw new SDKError(ErrorCode[_0x32cd3c(0x12d)],_0x32cd3c(0x155));const _0x15c35e=await withSpinner(_0x32cd3c(0x103),()=>_0x4d8df5['segment'][_0x32cd3c(0x180)](_0x422571['folderId']),{'verbose':_0x13a551[_0x32cd3c(0x178)]});await handleSingleObjectOutput(_0x15c35e[_0x32cd3c(0x160)],_0x13a551);}else{if(_0x422571[_0x32cd3c(0x17e)]==='segment'){if(!_0x422571[_0x32cd3c(0x14f)])throw new SDKError(ErrorCode[_0x32cd3c(0x174)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x325ab5=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4d8df5[_0x32cd3c(0x169)]['getSegment'](_0x422571[_0x32cd3c(0x131)],_0x422571[_0x32cd3c(0x14f)]),{'verbose':_0x13a551['verbose']});await handleSingleObjectOutput(_0x325ab5[_0x32cd3c(0x160)],_0x13a551);}}}return 0x0;}catch(_0x404408){if(_0x404408 instanceof SDKError)return console[_0x32cd3c(0x193)](_0x32cd3c(0x150)+_0x404408['message']),_0x404408[_0x32cd3c(0x168)]&&console[_0x32cd3c(0x193)](_0x32cd3c(0x124)+_0x404408[_0x32cd3c(0x168)]),0x1;throw _0x404408;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';['description']=a27_0x3e59f1(0x15d);async[a27_0x3e59f1(0x154)](_0x4a920d){const _0x29bcd1=a27_0x3e59f1,{options:_0x3a0785,args:_0x515309,tdx:_0x40bfca}=_0x4a920d,_0x410707=_0x515309[0x0];if(!_0x410707)return console[_0x29bcd1(0x193)](_0x29bcd1(0x118)),console['error'](_0x29bcd1(0x175)),console['error'](_0x29bcd1(0x137)),console[_0x29bcd1(0x193)]('Examples:'),console[_0x29bcd1(0x193)](_0x29bcd1(0x158)),console[_0x29bcd1(0x193)](_0x29bcd1(0x101)),0x1;try{const _0x24abc3=_0x3a0785['parentSegment'],_0x3e30ee=await resolveSegmentTarget(_0x410707,_0x24abc3,_0x3a0785[_0x29bcd1(0x178)]);_0x3a0785['verbose']&&console[_0x29bcd1(0x193)](_0x29bcd1(0x133)+_0x3e30ee);const _0x1b67c1=await withSpinner(_0x29bcd1(0x106)+_0x410707+_0x29bcd1(0x11f),()=>_0x40bfca[_0x29bcd1(0x169)][_0x29bcd1(0x184)](_0x3e30ee),{'verbose':_0x3a0785[_0x29bcd1(0x178)]}),_0x2ee229=_0x1b67c1[_0x29bcd1(0x160)];_0x3a0785[_0x29bcd1(0x178)]&&(console[_0x29bcd1(0x193)](_0x29bcd1(0x115)+_0x2ee229[_0x29bcd1(0x17e)]),console[_0x29bcd1(0x193)]('Parent\x20ID:\x20'+_0x2ee229['parentId']));if(_0x2ee229[_0x29bcd1(0x17e)]===_0x29bcd1(0x128))return console[_0x29bcd1(0x193)](_0x29bcd1(0x164)),console[_0x29bcd1(0x193)](_0x29bcd1(0x17a)),0x1;if(_0x2ee229['type']===_0x29bcd1(0x105))return console[_0x29bcd1(0x193)](_0x29bcd1(0x171)),console['error'](_0x29bcd1(0x123)),0x1;if(!_0x2ee229[_0x29bcd1(0x14f)])throw new SDKError(ErrorCode[_0x29bcd1(0x174)],_0x29bcd1(0x135));const _0x554458=await withSpinner(_0x29bcd1(0x10d),()=>_0x40bfca[_0x29bcd1(0x169)][_0x29bcd1(0x182)](_0x2ee229['parentId'],_0x2ee229[_0x29bcd1(0x14f)]),{'verbose':_0x3a0785[_0x29bcd1(0x178)]});let _0x3ca29e=_0x554458[_0x29bcd1(0x160)];const _0x55b32a=resolveLimit(_0x3a0785[_0x29bcd1(0x153)],DEFAULT_DISPLAY_LIMIT),_0xc0309e=/\bLIMIT\s+\d+/i[_0x29bcd1(0x14c)](_0x3ca29e);!_0xc0309e&&(_0x3ca29e=_0x3ca29e[_0x29bcd1(0x13f)]()[_0x29bcd1(0x140)](/;+$/,''),_0x3ca29e=_0x29bcd1(0x177)+_0x3ca29e+_0x29bcd1(0x18d)+_0x55b32a);_0x3a0785[_0x29bcd1(0x178)]&&console[_0x29bcd1(0x193)](_0x29bcd1(0x111)+_0x3ca29e);const _0x2f2343=await withProgressSpinner('Executing\x20segment\x20query...',async _0x59b916=>{const _0x4f1318=_0x29bcd1,_0x393ab0=await _0x40bfca['query'][_0x4f1318(0x154)](_0x3ca29e,{'catalog':'td','schema':'information_schema','onJobId':_0x48337b=>{const _0x5bb038=_0x4f1318;_0x59b916[_0x5bb038(0x116)](_0x48337b);}});return _0x393ab0;},{'verbose':_0x3a0785[_0x29bcd1(0x178)]}),_0x584960=_0x2f2343[_0x29bcd1(0x160)],_0x5f4ff1=_0x584960[_0x29bcd1(0x138)]?_0x29bcd1(0x134)+_0x584960['jobId']+']':'';return console[_0x29bcd1(0x193)](_0x29bcd1(0x159)+_0x584960[_0x29bcd1(0x18b)][_0x29bcd1(0x113)][_0x29bcd1(0x194)]()+_0x29bcd1(0x11e)+(_0x29bcd1(0x13e)+formatElapsed(_0x584960['stats'][_0x29bcd1(0x192)])+_0x5f4ff1)),await handleQueryOutput(_0x584960,_0x3a0785),0x0;}catch(_0x1723f9){if(_0x1723f9 instanceof SDKError)return console[_0x29bcd1(0x193)](_0x29bcd1(0x10f)+_0x1723f9[_0x29bcd1(0x197)]+']'),console[_0x29bcd1(0x193)]('\x0a'+_0x1723f9[_0x29bcd1(0x18e)]),0x1;throw _0x1723f9;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x3e59f1(0x12a)]=a27_0x3e59f1(0x100);[a27_0x3e59f1(0x16a)]=a27_0x3e59f1(0x112);async[a27_0x3e59f1(0x154)](_0x1d2ba9){const _0x58ec12=a27_0x3e59f1,{options:_0xc93fe7,args:_0x38588e,tdx:_0x30837e}=_0x1d2ba9;if(_0x38588e[_0x58ec12(0x127)]===0x0)return console[_0x58ec12(0x193)](_0x58ec12(0x198)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x39573a=_0x38588e[0x0];try{_0xc93fe7[_0x58ec12(0x178)]&&(console[_0x58ec12(0x193)](_0x58ec12(0x126)+_0xc93fe7[_0x58ec12(0x15e)]),console[_0x58ec12(0x193)]('Parent\x20name:\x20'+_0x39573a));const _0x5a523d=await withSpinner(_0x58ec12(0x14d)+_0x39573a+'\x27...',()=>_0x30837e[_0x58ec12(0x169)][_0x58ec12(0x19a)](_0x39573a),{'verbose':_0xc93fe7['verbose']}),_0x438661=_0x5a523d[_0x58ec12(0x160)];_0xc93fe7[_0x58ec12(0x178)]&&console[_0x58ec12(0x193)](_0x58ec12(0x165)+_0x438661);const _0x3501d3=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x39573a+_0x58ec12(0x11f),()=>_0x30837e[_0x58ec12(0x169)][_0x58ec12(0x19b)](_0x438661),{'verbose':_0xc93fe7[_0x58ec12(0x178)]}),_0x3d6c78=_0x3501d3[_0x58ec12(0x160)];return console[_0x58ec12(0x193)](_0x58ec12(0x125)+_0x3d6c78['length']+_0x58ec12(0x172)+(_0x3d6c78[_0x58ec12(0x127)]!==0x1?'s':'')),await handleSDKOutput(_0x3d6c78,_0xc93fe7),0x0;}catch(_0x5c847d){if(_0x5c847d instanceof SDKError)return console[_0x58ec12(0x193)](_0x58ec12(0x150)+_0x5c847d[_0x58ec12(0x18e)]),_0x5c847d[_0x58ec12(0x168)]&&console[_0x58ec12(0x193)](_0x58ec12(0x124)+_0x5c847d[_0x58ec12(0x168)]),0x1;throw _0x5c847d;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x3e59f1(0x12a)]=a27_0x3e59f1(0x146);['description']=a27_0x3e59f1(0x16b);async[a27_0x3e59f1(0x154)](_0x5e26bf){const _0x12e374=a27_0x3e59f1,{options:_0x2c3958,args:_0x5aa21e,tdx:_0x1d5415}=_0x5e26bf;if(_0x5aa21e[_0x12e374(0x127)]===0x0)return console[_0x12e374(0x193)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x12e374(0x193)](_0x12e374(0x136)),0x1;try{const {parentId:_0x4025ce,childId:_0x648d77}=parseSegmentRef(_0x5aa21e[0x0]);_0x2c3958[_0x12e374(0x178)]&&(console[_0x12e374(0x193)](_0x12e374(0x126)+_0x2c3958[_0x12e374(0x15e)]),console[_0x12e374(0x193)](_0x12e374(0x10c)+_0x4025ce),_0x648d77&&console[_0x12e374(0x193)](_0x12e374(0x16e)+_0x648d77));if(!_0x648d77)return console[_0x12e374(0x193)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x16e6fd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4025ce+_0x12e374(0x11f),()=>_0x1d5415[_0x12e374(0x169)][_0x12e374(0x19a)](_0x4025ce),{'verbose':_0x2c3958[_0x12e374(0x178)]}),_0x5536fd=_0x16e6fd[_0x12e374(0x160)];_0x2c3958[_0x12e374(0x178)]&&console[_0x12e374(0x193)](_0x12e374(0x165)+_0x5536fd);const _0x2f7bd2=await withSpinner(_0x12e374(0x109)+_0x648d77+_0x12e374(0x11f),()=>_0x1d5415[_0x12e374(0x169)][_0x12e374(0x19c)](_0x5536fd,_0x648d77),{'verbose':_0x2c3958[_0x12e374(0x178)]}),_0x3e148c=_0x2f7bd2[_0x12e374(0x160)];_0x2c3958[_0x12e374(0x178)]&&console[_0x12e374(0x193)](_0x12e374(0x17b)+_0x3e148c);const _0x1fda59=await withSpinner(_0x12e374(0x187)+_0x648d77+_0x12e374(0x11f),()=>_0x1d5415[_0x12e374(0x169)][_0x12e374(0x180)](_0x3e148c),{'verbose':_0x2c3958[_0x12e374(0x178)]});return await handleSDKOutput([_0x1fda59[_0x12e374(0x160)]],_0x2c3958),0x0;}catch(_0x76f236){if(_0x76f236 instanceof SDKError)return console[_0x12e374(0x193)](_0x12e374(0x150)+_0x76f236['message']),_0x76f236['cause']&&console[_0x12e374(0x193)](_0x12e374(0x124)+_0x76f236[_0x12e374(0x168)]),0x1;throw _0x76f236;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x3e59f1(0x121);[a27_0x3e59f1(0x16a)]=a27_0x3e59f1(0x162);async[a27_0x3e59f1(0x154)](_0x5a6c44){const _0x14a539=a27_0x3e59f1,{options:_0x4eb7f5,args:_0x35e9b9,tdx:_0x5648f6}=_0x5a6c44,_0x15e36d=_0x35e9b9[0x0];if(!_0x15e36d)return console[_0x14a539(0x193)](_0x14a539(0x118)),console[_0x14a539(0x193)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x14a539(0x199)),console[_0x14a539(0x193)]('Examples:'),console[_0x14a539(0x193)](_0x14a539(0x107)),console[_0x14a539(0x193)](_0x14a539(0x120)),0x1;try{const _0x1bc161=_0x4eb7f5['parentSegment'],_0x3e3994=await resolveSegmentTarget(_0x15e36d,_0x1bc161,_0x4eb7f5[_0x14a539(0x178)]);_0x4eb7f5[_0x14a539(0x178)]&&console['error'](_0x14a539(0x133)+_0x3e3994);const _0x4ace65=await withSpinner(_0x14a539(0x106)+_0x15e36d+_0x14a539(0x11f),()=>_0x5648f6[_0x14a539(0x169)]['resolvePathToResource'](_0x3e3994),{'verbose':_0x4eb7f5['verbose']}),_0x5efc34=_0x4ace65[_0x14a539(0x160)];_0x4eb7f5[_0x14a539(0x178)]&&(console['error'](_0x14a539(0x115)+_0x5efc34[_0x14a539(0x17e)]),console[_0x14a539(0x193)]('Parent\x20ID:\x20'+_0x5efc34['parentId']));if(_0x5efc34[_0x14a539(0x17e)]===_0x14a539(0x128))return console['error'](_0x14a539(0x17f)),console[_0x14a539(0x193)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x5efc34[_0x14a539(0x17e)]===_0x14a539(0x105))return console[_0x14a539(0x193)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x14a539(0x193)](_0x14a539(0x102)),0x1;if(!_0x5efc34[_0x14a539(0x14f)])throw new SDKError(ErrorCode[_0x14a539(0x174)],_0x14a539(0x135));const _0x41c4d4=await withSpinner(_0x14a539(0x10d),()=>_0x5648f6[_0x14a539(0x169)][_0x14a539(0x182)](_0x5efc34[_0x14a539(0x131)],_0x5efc34[_0x14a539(0x14f)]),{'verbose':_0x4eb7f5[_0x14a539(0x178)]}),_0x319a5f=_0x41c4d4[_0x14a539(0x160)];return _0x4eb7f5['format']===_0x14a539(0xff)||_0x4eb7f5[_0x14a539(0x130)]===_0x14a539(0x11c)?await handleSDKOutput([{'sql':_0x319a5f}],_0x4eb7f5):console[_0x14a539(0x186)](_0x319a5f),0x0;}catch(_0x38064c){if(_0x38064c instanceof SDKError)return console[_0x14a539(0x193)](_0x14a539(0x150)+_0x38064c[_0x14a539(0x18e)]),_0x38064c['cause']&&console[_0x14a539(0x193)]('\x20\x20Cause:\x20'+_0x38064c[_0x14a539(0x168)]),0x1;throw _0x38064c;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x3e59f1(0x191);['description']=a27_0x3e59f1(0x170);async[a27_0x3e59f1(0x154)](_0x28bb95){const _0x4cfe4=a27_0x3e59f1,{options:_0x37dbfd,args:_0x145d92,tdx:_0x3c36a5}=_0x28bb95,_0x4be53e=_0x37dbfd;if(_0x145d92[_0x4cfe4(0x127)]<0x2)return console[_0x4cfe4(0x193)](_0x4cfe4(0x15c)),console[_0x4cfe4(0x193)](_0x4cfe4(0x10a)),0x1;const _0x411a03=_0x145d92[0x0],_0x7e8926=_0x145d92[0x1];_0x4be53e[_0x4cfe4(0x178)]&&(console['error'](_0x4cfe4(0x126)+_0x4be53e[_0x4cfe4(0x15e)]),console[_0x4cfe4(0x193)](_0x4cfe4(0x139)+_0x411a03),console[_0x4cfe4(0x193)](_0x4cfe4(0x16e)+_0x7e8926));let _0x57c314;if(_0x4be53e[_0x4cfe4(0x13d)]){const _0x1b1e57=_0x4be53e['parentFolder'],_0xeba2eb=await withSpinner(_0x4cfe4(0x14d)+_0x411a03+_0x4cfe4(0x11f),()=>_0x3c36a5['segment'][_0x4cfe4(0x19a)](_0x411a03),{'verbose':_0x4be53e[_0x4cfe4(0x178)]}),_0x25ebc9=_0xeba2eb[_0x4cfe4(0x160)],_0x157581=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x1b1e57+_0x4cfe4(0x11f),()=>_0x3c36a5[_0x4cfe4(0x169)]['resolveFolderId'](_0x25ebc9,_0x1b1e57),{'verbose':_0x4be53e[_0x4cfe4(0x178)]});_0x57c314=_0x157581['data'],_0x4be53e[_0x4cfe4(0x178)]&&console[_0x4cfe4(0x193)](_0x4cfe4(0x13b)+_0x57c314);}const _0x3c63e6={'name':_0x7e8926,'description':_0x4be53e[_0x4cfe4(0x16a)],'parentFolderId':_0x57c314},_0x5953b2=await withSpinner(_0x4cfe4(0x148)+_0x7e8926+'\x27...',()=>_0x3c36a5[_0x4cfe4(0x169)][_0x4cfe4(0x183)](_0x411a03,_0x3c63e6),{'verbose':_0x4be53e[_0x4cfe4(0x178)]}),_0x7a23e4=_0x5953b2[_0x4cfe4(0x160)];return console[_0x4cfe4(0x193)](_0x4cfe4(0x152)+_0x7a23e4['name']+_0x4cfe4(0x117)+_0x7a23e4['id']),await handleSDKOutput([_0x7a23e4],_0x4be53e),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x3e59f1(0x12a)]='segment:view';[a27_0x3e59f1(0x16a)]=a27_0x3e59f1(0x12f);async[a27_0x3e59f1(0x154)](_0x4da69f){const _0x8a6ecb=a27_0x3e59f1,{options:_0x35caff,args:_0x3ba531,tdx:_0x509bce}=_0x4da69f,_0x266381=_0x3ba531[0x0];if(!_0x266381)return console[_0x8a6ecb(0x193)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x8a6ecb(0x193)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x8a6ecb(0x193)](_0x8a6ecb(0x167)),console[_0x8a6ecb(0x193)](_0x8a6ecb(0x15f)),console[_0x8a6ecb(0x193)](_0x8a6ecb(0x11a)),console[_0x8a6ecb(0x193)]('Examples:'),console[_0x8a6ecb(0x193)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x8a6ecb(0x193)](_0x8a6ecb(0x166)),console[_0x8a6ecb(0x193)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x8a6ecb(0x193)](_0x8a6ecb(0x132)),0x1;try{const _0xe73683=_0x35caff[_0x8a6ecb(0x12b)],_0xc68022=await resolveSegmentTarget(_0x266381,_0xe73683,_0x35caff[_0x8a6ecb(0x178)]);_0x35caff[_0x8a6ecb(0x178)]&&console[_0x8a6ecb(0x193)]('Target\x20path:\x20'+_0xc68022);const _0x12de55=await withSpinner(_0x8a6ecb(0x106)+_0x266381+_0x8a6ecb(0x11f),()=>_0x509bce['segment']['resolvePathToResource'](_0xc68022),{'verbose':_0x35caff['verbose']}),_0x3fedc8=_0x12de55[_0x8a6ecb(0x160)];_0x35caff[_0x8a6ecb(0x178)]&&(console[_0x8a6ecb(0x193)](_0x8a6ecb(0x115)+_0x3fedc8[_0x8a6ecb(0x17e)]),console['error'](_0x8a6ecb(0x144)+_0x3fedc8['parentId']),_0x3fedc8[_0x8a6ecb(0x14b)]&&console[_0x8a6ecb(0x193)](_0x8a6ecb(0x17d)+_0x3fedc8[_0x8a6ecb(0x14b)]),_0x3fedc8[_0x8a6ecb(0x14f)]&&console[_0x8a6ecb(0x193)](_0x8a6ecb(0x11d)+_0x3fedc8['segmentId']));if(_0x35caff['web']){if(_0x3fedc8[_0x8a6ecb(0x17e)]===_0x8a6ecb(0x128))return console[_0x8a6ecb(0x193)](_0x8a6ecb(0x147)),0x1;if(_0x3fedc8[_0x8a6ecb(0x17e)]==='parent')return console['error'](_0x8a6ecb(0x17c)),console[_0x8a6ecb(0x193)](_0x8a6ecb(0x16f)),0x1;if(!_0x3fedc8[_0x8a6ecb(0x14f)])throw new SDKError(ErrorCode[_0x8a6ecb(0x174)],_0x8a6ecb(0x135));const _0x50f572=getConsoleNextUrl(_0x35caff[_0x8a6ecb(0x15e)],_0x8a6ecb(0x108)+_0x3fedc8[_0x8a6ecb(0x131)]+'/e/'+_0x3fedc8['segmentId']);return console[_0x8a6ecb(0x193)](a27_0x383d22[_0x8a6ecb(0x142)]('✔')+'\x20Opening\x20'+a27_0x383d22[_0x8a6ecb(0x176)](_0x50f572)),openBrowser(_0x50f572),0x0;}if(_0x3fedc8[_0x8a6ecb(0x17e)]===_0x8a6ecb(0x128)){if(!_0x3fedc8['folderId'])throw new SDKError(ErrorCode[_0x8a6ecb(0x12d)],_0x8a6ecb(0x155));const _0x57a8fe=await withSpinner(_0x8a6ecb(0x103),()=>_0x509bce[_0x8a6ecb(0x169)][_0x8a6ecb(0x180)](_0x3fedc8[_0x8a6ecb(0x14b)]),{'verbose':_0x35caff[_0x8a6ecb(0x178)]});await handleSingleObjectOutput(_0x57a8fe[_0x8a6ecb(0x160)],_0x35caff);}else{if(_0x3fedc8[_0x8a6ecb(0x17e)]===_0x8a6ecb(0x169)){if(!_0x3fedc8['segmentId'])throw new SDKError(ErrorCode[_0x8a6ecb(0x174)],_0x8a6ecb(0x135));const _0x4f47f4=await withSpinner(_0x8a6ecb(0x149),()=>_0x509bce['segment'][_0x8a6ecb(0x156)](_0x3fedc8[_0x8a6ecb(0x131)],_0x3fedc8['segmentId']),{'verbose':_0x35caff[_0x8a6ecb(0x178)]}),_0xd43af1=getConsoleNextUrl(_0x35caff['site'],_0x8a6ecb(0x108)+_0x3fedc8['parentId']+_0x8a6ecb(0x119)+_0x3fedc8[_0x8a6ecb(0x14f)]),_0x4a1f00=_0x4f47f4[_0x8a6ecb(0x160)];_0x4a1f00[_0x8a6ecb(0x110)]=_0xd43af1,await handleSingleObjectOutput(_0x4a1f00,_0x35caff);}else return console[_0x8a6ecb(0x193)](_0x8a6ecb(0x141)),console[_0x8a6ecb(0x193)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x238d88){if(_0x238d88 instanceof SDKError)return console[_0x8a6ecb(0x193)](_0x8a6ecb(0x150)+_0x238d88[_0x8a6ecb(0x18e)]),_0x238d88[_0x8a6ecb(0x168)]&&console[_0x8a6ecb(0x193)]('\x20\x20Cause:\x20'+_0x238d88[_0x8a6ecb(0x168)]),0x1;throw _0x238d88;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x3e59f1(0x12a)]=a27_0x3e59f1(0x181);['description']=a27_0x3e59f1(0x190);async[a27_0x3e59f1(0x154)](_0x4daba9){const _0x4b2278=a27_0x3e59f1,{options:_0x22c7c3,args:_0x3e4fe5,tdx:_0x358edf}=_0x4daba9,_0x5427a5=_0x3e4fe5[0x0];if(!_0x5427a5)return console['error'](_0x4b2278(0x118)),console[_0x4b2278(0x193)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x4b2278(0x193)](_0x4b2278(0x161)),console[_0x4b2278(0x193)](_0x4b2278(0x163)),console[_0x4b2278(0x193)](_0x4b2278(0x15a)),console[_0x4b2278(0x193)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x26a158=_0x22c7c3[_0x4b2278(0x12b)],_0x381107=await resolveSegmentTarget(_0x5427a5,_0x26a158,_0x22c7c3[_0x4b2278(0x178)]);_0x22c7c3[_0x4b2278(0x178)]&&console[_0x4b2278(0x193)](_0x4b2278(0x133)+_0x381107);const _0x23bd80=await withSpinner('Resolving\x20\x27'+_0x5427a5+_0x4b2278(0x11f),()=>_0x358edf[_0x4b2278(0x169)][_0x4b2278(0x184)](_0x381107),{'verbose':_0x22c7c3[_0x4b2278(0x178)]}),_0x35b246=_0x23bd80['data'];_0x22c7c3[_0x4b2278(0x178)]&&(console[_0x4b2278(0x193)](_0x4b2278(0x115)+_0x35b246[_0x4b2278(0x17e)]),console['error'](_0x4b2278(0x144)+_0x35b246['parentId']));if(_0x35b246[_0x4b2278(0x17e)]===_0x4b2278(0x128))return console[_0x4b2278(0x193)](_0x4b2278(0x18f)),console[_0x4b2278(0x193)](_0x4b2278(0x13c)),0x1;if(_0x35b246['type']===_0x4b2278(0x105))return console[_0x4b2278(0x193)](_0x4b2278(0x16c)),console[_0x4b2278(0x193)](_0x4b2278(0x129)),0x1;if(!_0x35b246[_0x4b2278(0x14f)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4b2278(0x135));const _0x3ab88e=await withSpinner(_0x4b2278(0x10d),()=>_0x358edf[_0x4b2278(0x169)]['getSegmentSQL'](_0x35b246[_0x4b2278(0x131)],_0x35b246[_0x4b2278(0x14f)]),{'verbose':_0x22c7c3[_0x4b2278(0x178)]}),_0xa49840=_0x3ab88e['data'],_0x50ed60=await executeSchemaQuery(_0xa49840,_0x358edf,_0x22c7c3);return await handleQueryOutput(_0x50ed60,_0x22c7c3),0x0;}catch(_0x390478){if(_0x390478 instanceof SDKError)return console[_0x4b2278(0x193)](_0x4b2278(0x150)+_0x390478['message']),_0x390478['cause']&&console[_0x4b2278(0x193)]('\x20\x20Cause:\x20'+_0x390478['cause']),0x1;throw _0x390478;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x156185=a28_0x356f;(function(_0x154adf,_0x40e3fa){const _0x2ceebf=a28_0x356f,_0x417d39=_0x154adf();while(!![]){try{const _0x118a44=-parseInt(_0x2ceebf(0x122))/0x1*(-parseInt(_0x2ceebf(0x126))/0x2)+parseInt(_0x2ceebf(0x132))/0x3*(parseInt(_0x2ceebf(0x142))/0x4)+-parseInt(_0x2ceebf(0x117))/0x5*(parseInt(_0x2ceebf(0x11a))/0x6)+parseInt(_0x2ceebf(0x139))/0x7+parseInt(_0x2ceebf(0x140))/0x8*(-parseInt(_0x2ceebf(0x148))/0x9)+parseInt(_0x2ceebf(0x116))/0xa+parseInt(_0x2ceebf(0x11c))/0xb*(-parseInt(_0x2ceebf(0x11e))/0xc);if(_0x118a44===_0x40e3fa)break;else _0x417d39['push'](_0x417d39['shift']());}catch(_0x3f2a43){_0x417d39['push'](_0x417d39['shift']());}}}(a28_0x2121,0x1a8a4));import{BaseCommand}from'./command.js';function a28_0x2121(){const _0x54effa=['execute','resolveParentId','425518gRfELL','Target\x20path:\x20','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','parent','Resolving\x20folder\x20path\x20\x27','segment','verbose','yellow','\x27...','Parent\x20path:\x20','11589UCHzZY','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','error','folder','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','resolvePathToResource','Site:\x20','682822OkeVWx','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','type','segment:create','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segments','length','136GmZSQx','ruleFile','20GEewst','data','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','description','createSegment','name','46854VNDJfp','invisible','segmentPath','folderId','Examples:','site','includes','1764020KunXDQ','40xMvGsp','Segment\x20name:\x20','resolveFolderId','142338LXMkeU','✔\x20Created\x20segment\x20\x27','14388UcaffU','Resolved\x20relative\x20path\x20to:\x20','1092nFyfWh','Creating\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','noCountPopulation','1noLQux','\x27\x20with\x20ID:\x20'];a28_0x2121=function(){return _0x54effa;};return a28_0x2121();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x57c57b from'chalk';function a28_0x356f(_0x5aed2f,_0x256242){_0x5aed2f=_0x5aed2f-0x116;const _0x2121a6=a28_0x2121();let _0x356fc0=_0x2121a6[_0x5aed2f];return _0x356fc0;}export class SegmentCreateCommand extends BaseCommand{[a28_0x156185(0x147)]=a28_0x156185(0x13c);[a28_0x156185(0x145)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a28_0x156185(0x124)](_0x28d402){const _0x365c20=a28_0x156185;console[_0x365c20(0x134)](a28_0x57c57b[_0x365c20(0x12f)](_0x365c20(0x12a))),console['error'](a28_0x57c57b[_0x365c20(0x12f)](_0x365c20(0x133)));const {options:_0x5bf7e5,args:_0x130448,tdx:_0x1d81c8}=_0x28d402,_0x18e9d8=_0x5bf7e5;if(_0x130448[_0x365c20(0x13f)]===0x0)return console[_0x365c20(0x134)](_0x365c20(0x120)),console[_0x365c20(0x134)](_0x365c20(0x13a)),console[_0x365c20(0x134)](_0x365c20(0x14c)),console[_0x365c20(0x134)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x365c20(0x134)](_0x365c20(0x144)),console[_0x365c20(0x134)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x4e1f2b=_0x130448[0x0],_0x4d9b38=_0x5bf7e5[_0x365c20(0x14a)];let _0x411d32=_0x4e1f2b;_0x4d9b38&&!_0x4e1f2b[_0x365c20(0x14e)]('/')&&(_0x411d32=_0x4d9b38+'/'+_0x4e1f2b,_0x18e9d8[_0x365c20(0x12e)]&&console[_0x365c20(0x134)](_0x365c20(0x11d)+_0x411d32));const _0x52f3a8=parsePath(_0x411d32);if(_0x52f3a8[_0x365c20(0x13e)][_0x365c20(0x13f)]<0x2)return console[_0x365c20(0x134)](_0x365c20(0x13d)),console[_0x365c20(0x134)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x2fda76=_0x52f3a8[_0x365c20(0x13e)][0x0],_0xdb26ca=getBaseName(_0x411d32),_0x246cac=getParentPath(_0x411d32);_0x18e9d8[_0x365c20(0x12e)]&&(console[_0x365c20(0x134)](_0x365c20(0x138)+_0x18e9d8[_0x365c20(0x14d)]),console['error'](_0x365c20(0x127)+_0x411d32),console[_0x365c20(0x134)]('Parent:\x20'+_0x2fda76),console['error'](_0x365c20(0x118)+_0xdb26ca),console['error'](_0x365c20(0x131)+_0x246cac));const _0x89d677=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2fda76+_0x365c20(0x130),()=>_0x1d81c8[_0x365c20(0x12d)][_0x365c20(0x125)](_0x2fda76),{'verbose':_0x18e9d8[_0x365c20(0x12e)]}),_0x3f75b4=_0x89d677[_0x365c20(0x143)];let _0x5007bf;if(_0x52f3a8['segments'][_0x365c20(0x13f)]>0x2){const _0x186630=await withSpinner(_0x365c20(0x12c)+_0x246cac+'\x27...',()=>_0x1d81c8[_0x365c20(0x12d)][_0x365c20(0x137)](_0x246cac),{'verbose':_0x18e9d8[_0x365c20(0x12e)]}),_0x507c8e=_0x186630[_0x365c20(0x143)];if(_0x507c8e[_0x365c20(0x13b)]!=='folder'&&_0x507c8e[_0x365c20(0x13b)]!==_0x365c20(0x12b))return console[_0x365c20(0x134)](_0x365c20(0x136)),0x1;_0x5007bf=_0x507c8e[_0x365c20(0x14b)];}else{if(_0x18e9d8[_0x365c20(0x135)]){const _0x674e37=await withSpinner(_0x365c20(0x129)+_0x18e9d8[_0x365c20(0x135)]+_0x365c20(0x130),()=>_0x1d81c8[_0x365c20(0x12d)][_0x365c20(0x119)](_0x3f75b4,_0x18e9d8[_0x365c20(0x135)]),{'verbose':_0x18e9d8[_0x365c20(0x12e)]});_0x5007bf=_0x674e37['data'];}}_0x18e9d8[_0x365c20(0x12e)]&&_0x5007bf&&console[_0x365c20(0x134)]('Resolved\x20folder\x20ID:\x20'+_0x5007bf);const _0x5e65e5=await loadJSONFromOptions(_0x18e9d8['rule'],_0x18e9d8[_0x365c20(0x141)]),_0x4bfa5c={'name':_0xdb26ca,'description':_0x18e9d8['description'],'rule':_0x5e65e5,'kind':_0x18e9d8['kind']!==undefined?parseInt(_0x18e9d8['kind'],0xa):undefined,'isVisible':_0x18e9d8[_0x365c20(0x149)]?![]:undefined,'segmentFolderId':_0x5007bf,'countPopulation':_0x18e9d8[_0x365c20(0x121)]?![]:undefined},_0x2ebc0b=await withSpinner(_0x365c20(0x11f)+_0xdb26ca+_0x365c20(0x130),()=>_0x1d81c8[_0x365c20(0x12d)][_0x365c20(0x146)](_0x3f75b4,_0x4bfa5c),{'verbose':_0x18e9d8[_0x365c20(0x12e)]}),_0x3ceffb=_0x2ebc0b[_0x365c20(0x143)];return console['error'](_0x365c20(0x11b)+_0x3ceffb[_0x365c20(0x147)]+_0x365c20(0x123)+_0x3ceffb['id']),_0x411d32!==_0x4e1f2b&&console[_0x365c20(0x134)](_0x365c20(0x128)+_0x411d32),await handleSDKOutput([_0x3ceffb],_0x18e9d8),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a29_0x43a6c2=a29_0x544d;function a29_0x1a2d(){const _0x2f84af=['length','140354SyXrVc','1930817IZZmPi','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','33144LgjJWw','jsonl','segment:fields','Error:\x20Parent\x20segment\x20name\x20is\x20required','Parent\x20segment:\x20','listFields','4860yCYaJY','data','477992XnuoPO','error','16zJKsiE','List\x20available\x20fields\x20for\x20segmentation','verbose','execute','Site:\x20','site','segment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','12258sUNRqF','Listing\x20fields\x20for\x20\x27','8ayDJtx','\x20field','✔\x20Found\x20','\x27...','2675040oiBpoX','19318398BEMyNV','6jlFCah','json'];a29_0x1a2d=function(){return _0x2f84af;};return a29_0x1a2d();}(function(_0x6eae10,_0x42ecd1){const _0xb790ec=a29_0x544d,_0x47dfda=_0x6eae10();while(!![]){try{const _0x1894f3=parseInt(_0xb790ec(0x1ad))/0x1*(parseInt(_0xb790ec(0x1ba))/0x2)+-parseInt(_0xb790ec(0x1aa))/0x3*(parseInt(_0xb790ec(0x1b8))/0x4)+parseInt(_0xb790ec(0x1a8))/0x5+parseInt(_0xb790ec(0x1b0))/0x6+parseInt(_0xb790ec(0x1ae))/0x7*(parseInt(_0xb790ec(0x1a4))/0x8)+parseInt(_0xb790ec(0x1c2))/0x9*(parseInt(_0xb790ec(0x1b6))/0xa)+-parseInt(_0xb790ec(0x1a9))/0xb;if(_0x1894f3===_0x42ecd1)break;else _0x47dfda['push'](_0x47dfda['shift']());}catch(_0x41698a){_0x47dfda['push'](_0x47dfda['shift']());}}}(a29_0x1a2d,0x93ed9));function a29_0x544d(_0x3de6df,_0x3c920d){_0x3de6df=_0x3de6df-0x1a3;const _0x1a2d26=a29_0x1a2d();let _0x544d27=_0x1a2d26[_0x3de6df];return _0x544d27;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x43a6c2(0x1b2);['description']=a29_0x43a6c2(0x1bb);async[a29_0x43a6c2(0x1bd)](_0x197997){const _0x2e9d25=a29_0x43a6c2,{options:_0x4508c0,args:_0x79cf20,tdx:_0x2b70fd}=_0x197997,_0x4c7024=_0x79cf20[0x0]||_0x4508c0['parentSegment'];if(!_0x4c7024)return console['error'](_0x2e9d25(0x1b3)),console[_0x2e9d25(0x1b9)](_0x2e9d25(0x1c1)),console[_0x2e9d25(0x1b9)](_0x2e9d25(0x1af)),0x1;_0x4508c0[_0x2e9d25(0x1bc)]&&(console[_0x2e9d25(0x1b9)](_0x2e9d25(0x1be)+_0x4508c0[_0x2e9d25(0x1bf)]),console[_0x2e9d25(0x1b9)](_0x2e9d25(0x1b4)+_0x4c7024));const _0x319693=await withSpinner(_0x2e9d25(0x1a3)+_0x4c7024+_0x2e9d25(0x1a7),()=>_0x2b70fd[_0x2e9d25(0x1c0)][_0x2e9d25(0x1b5)](_0x4c7024),{'verbose':_0x4508c0[_0x2e9d25(0x1bc)]}),_0x200539=_0x319693[_0x2e9d25(0x1b7)];console[_0x2e9d25(0x1b9)](_0x2e9d25(0x1a6)+_0x200539[_0x2e9d25(0x1ac)]+_0x2e9d25(0x1a5)+(_0x200539['length']!==0x1?'s':''));if(_0x4508c0[_0x2e9d25(0x1ab)]||_0x4508c0[_0x2e9d25(0x1b1)])return await handleSDKOutput(_0x200539,_0x4508c0),0x0;return displayFieldsHumanReadable(_0x200539,_0x4c7024),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x2b9b50=a30_0x3b3c;(function(_0x3fed9a,_0x28b6f2){const _0x49af0d=a30_0x3b3c,_0x223e0f=_0x3fed9a();while(!![]){try{const _0x46a2c3=parseInt(_0x49af0d(0x16d))/0x1+parseInt(_0x49af0d(0x16b))/0x2+parseInt(_0x49af0d(0x190))/0x3+-parseInt(_0x49af0d(0x19c))/0x4+-parseInt(_0x49af0d(0x16a))/0x5*(-parseInt(_0x49af0d(0x160))/0x6)+parseInt(_0x49af0d(0x158))/0x7+parseInt(_0x49af0d(0x172))/0x8*(-parseInt(_0x49af0d(0x185))/0x9);if(_0x46a2c3===_0x28b6f2)break;else _0x223e0f['push'](_0x223e0f['shift']());}catch(_0x316ace){_0x223e0f['push'](_0x223e0f['shift']());}}}(a30_0x42ef,0x43e6f));import{BaseCommand}from'./command.js';function a30_0x42ef(){const _0x28b384=['✔\x20Pulled\x20','diff','1433052KynvNw','targetDir','no_parent','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journeys','counts','\x20\x20🗺️\x20\x20','green','error','cyan','journeyVersions','\x20\x20🎯\x20','1977696JawzqZ','session','\x20=\x20','\x20new\x20files','isNew','yes','parent_segment','\x20activations','segments','\x27...','3817947CuCdcE','\x0aPull\x20summary\x20for\x20\x27','helpText','\x20unchanged\x20files','yellow','parentName','segment:pull','parentSegment','3594clnGQC','files','resourceName','description','\x20files?','repeat','Write\x20','pullSegments','dirname','✔\x20Context\x20set:\x20','705IxZCRQ','24054PWmTEs','data','234519RJHfWw','message','Target\x20resource:\x20','Error:\x20','\x20versions)','140984LCoXrv','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','site','dim','Pulling\x20segments\x20from\x20\x27','length','file','activations','\x20with\x20','\x20segments','Parent\x20segment:\x20','hasChanges','Aborted.','Site:\x20','segment','-\x20no\x20files\x20written','filter','red','name','297WmzZCJ','utf-8','content','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','type','verbose','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Target:\x20','errorCode'];a30_0x42ef=function(){return _0x28b384;};return a30_0x42ef();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x487063 from'chalk';function a30_0x3b3c(_0x13e2a2,_0x3f7e8f){_0x13e2a2=_0x13e2a2-0x157;const _0x42ef5e=a30_0x42ef();let _0x3b3c03=_0x42ef5e[_0x13e2a2];return _0x3b3c03;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x241edd 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_0x2b9b50(0x184)]=a30_0x2b9b50(0x15e);[a30_0x2b9b50(0x163)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x53b055){const _0x3f25ea=a30_0x2b9b50,{options:_0x57c7ec,args:_0x34fc9a,tdx:_0x5e4664}=_0x53b055,_0x33d506=_0x57c7ec,_0x3af184=await resolveTarget({'arg':_0x34fc9a[0x0],'contextParent':_0x57c7ec[_0x3f25ea(0x15f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3af184))return _0x3af184[_0x3f25ea(0x18d)]===_0x3f25ea(0x192)?(console[_0x3f25ea(0x198)](a30_0x487063[_0x3f25ea(0x15c)](_0x3f25ea(0x18b))),console['error']('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)'),console[_0x3f25ea(0x198)](_0x3f25ea(0x173)),console['error'](_0x3f25ea(0x188))):(console[_0x3f25ea(0x198)](a30_0x487063['red'](_0x3f25ea(0x170)+_0x3af184[_0x3f25ea(0x16e)]+'\x0a')),_0x3af184[_0x3f25ea(0x15a)]&&console['error'](a30_0x487063['cyan'](_0x3af184[_0x3f25ea(0x15a)]))),0x1;const _0x591828=_0x3af184[_0x3f25ea(0x15d)],_0x18dfce=_0x3af184['targetDir'],_0x2b18ee=_0x3af184[_0x3f25ea(0x189)]===_0x3f25ea(0x178)?_0x3af184[_0x3f25ea(0x162)]:undefined;_0x33d506[_0x3f25ea(0x18a)]&&(console[_0x3f25ea(0x198)](_0x3f25ea(0x17f)+_0x33d506[_0x3f25ea(0x174)]),console['error'](_0x3f25ea(0x17c)+_0x591828),_0x2b18ee&&console['error'](_0x3f25ea(0x16f)+_0x2b18ee));const _0x514428=await withProgressSpinner(_0x3f25ea(0x176)+_0x591828+_0x3f25ea(0x157),_0x1ea696=>_0x5e4664[_0x3f25ea(0x180)][_0x3f25ea(0x167)](_0x591828,{'targetDir':_0x18dfce,'targetResourceName':_0x2b18ee,'verbose':_0x33d506[_0x3f25ea(0x18a)],'progress':{'update':_0x2ff7a8=>{const _0x328f94=_0x3f25ea;_0x1ea696['setPhase'](_0x2ff7a8),_0x33d506[_0x328f94(0x18a)]&&console[_0x328f94(0x198)]('\x20\x20'+_0x2ff7a8);}}}),{'verbose':_0x33d506['verbose']}),_0x2da87d=_0x514428[_0x3f25ea(0x16c)];if(_0x2da87d[_0x3f25ea(0x195)][_0x3f25ea(0x1a4)]===0x0&&_0x2da87d['counts'][_0x3f25ea(0x194)]===0x0)return console[_0x3f25ea(0x198)](a30_0x487063[_0x3f25ea(0x15c)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x2da87d[_0x3f25ea(0x15d)]+'\x27')),0x0;const _0x333393=_0x2da87d[_0x3f25ea(0x161)]['filter'](_0x72349a=>_0x72349a[_0x3f25ea(0x1a0)]),_0x167d83=_0x2da87d[_0x3f25ea(0x161)][_0x3f25ea(0x182)](_0x5dfb15=>!_0x5dfb15[_0x3f25ea(0x1a0)]&&_0x5dfb15[_0x3f25ea(0x17d)]),_0x1686a6=_0x2da87d[_0x3f25ea(0x161)][_0x3f25ea(0x182)](_0x18efb0=>!_0x18efb0[_0x3f25ea(0x1a0)]&&!_0x18efb0[_0x3f25ea(0x17d)]);console[_0x3f25ea(0x198)](_0x3f25ea(0x159)+_0x2da87d[_0x3f25ea(0x15d)]+'\x27:'),console['error'](_0x3f25ea(0x19b)+a30_0x487063[_0x3f25ea(0x199)](_0x2da87d[_0x3f25ea(0x195)][_0x3f25ea(0x1a4)]+_0x3f25ea(0x17b))+_0x3f25ea(0x17a)+a30_0x487063['cyan'](_0x2da87d['counts'][_0x3f25ea(0x179)]+_0x3f25ea(0x1a3)));if(_0x2da87d[_0x3f25ea(0x195)]['journeys']>0x0){const _0x10c880=_0x2da87d[_0x3f25ea(0x195)][_0x3f25ea(0x19a)]>_0x2da87d[_0x3f25ea(0x195)][_0x3f25ea(0x194)]?'\x20('+_0x2da87d['counts'][_0x3f25ea(0x19a)]+_0x3f25ea(0x171):'';console[_0x3f25ea(0x198)](_0x3f25ea(0x196)+a30_0x487063[_0x3f25ea(0x199)](_0x2da87d[_0x3f25ea(0x195)][_0x3f25ea(0x194)]+'\x20journeys')+a30_0x487063[_0x3f25ea(0x175)](_0x10c880));}console[_0x3f25ea(0x198)]('\x20\x20'+a30_0x487063[_0x3f25ea(0x197)]('+\x20'+_0x333393[_0x3f25ea(0x177)]+_0x3f25ea(0x19f))),console[_0x3f25ea(0x198)]('\x20\x20'+a30_0x487063['yellow']('~\x20'+_0x167d83[_0x3f25ea(0x177)]+'\x20changed\x20files')),console[_0x3f25ea(0x198)]('\x20\x20'+a30_0x487063[_0x3f25ea(0x175)]('=\x20'+_0x1686a6[_0x3f25ea(0x177)]+_0x3f25ea(0x15b))),console[_0x3f25ea(0x198)](_0x3f25ea(0x18c)+a30_0x487063[_0x3f25ea(0x199)](_0x2da87d[_0x3f25ea(0x191)])+'\x0a');if(_0x167d83[_0x3f25ea(0x177)]>0x0)for(const _0x589f2e of _0x167d83){console[_0x3f25ea(0x198)]('\x0aChanges\x20to\x20\x27'+_0x589f2e['relativePath']+'\x27:'),console[_0x3f25ea(0x198)]('─'[_0x3f25ea(0x165)](0x3c)),console[_0x3f25ea(0x198)](_0x589f2e[_0x3f25ea(0x18f)]),console[_0x3f25ea(0x198)]('─'['repeat'](0x3c));}if(_0x33d506['dryRun'])return console[_0x3f25ea(0x198)](a30_0x487063[_0x3f25ea(0x15c)](_0x3f25ea(0x193))),0x0;if(_0x333393[_0x3f25ea(0x177)]===0x0&&_0x167d83['length']===0x0)return console[_0x3f25ea(0x198)](a30_0x487063[_0x3f25ea(0x197)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2da87d['parentName']},_0x33d506[_0x3f25ea(0x19d)]),console[_0x3f25ea(0x198)](a30_0x487063[_0x3f25ea(0x197)]('✔\x20Context\x20set:\x20'+a30_0x487063[_0x3f25ea(0x175)](_0x3f25ea(0x1a2))+_0x3f25ea(0x19e)+a30_0x487063[_0x3f25ea(0x199)](_0x2da87d['parentName']))),0x0;if(!_0x33d506[_0x3f25ea(0x1a1)]){if(!isInteractive())return console[_0x3f25ea(0x198)](a30_0x487063[_0x3f25ea(0x183)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3f25ea(0x198)](a30_0x487063[_0x3f25ea(0x175)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x380cb9=await confirmKey(_0x3f25ea(0x166)+(_0x333393[_0x3f25ea(0x177)]+_0x167d83[_0x3f25ea(0x177)])+_0x3f25ea(0x164));if(!_0x380cb9)return console[_0x3f25ea(0x198)](a30_0x487063[_0x3f25ea(0x15c)](_0x3f25ea(0x17e)),_0x3f25ea(0x181)),0x1;}for(const _0x36864c of _0x2da87d[_0x3f25ea(0x161)]){if(_0x36864c[_0x3f25ea(0x1a0)]||_0x36864c['hasChanges']){const _0x4b01c5=a30_0x241edd[_0x3f25ea(0x168)](_0x36864c['absolutePath']);!existsSync(_0x4b01c5)&&mkdirSync(_0x4b01c5,{'recursive':!![]}),writeFileSync(_0x36864c['absolutePath'],_0x36864c[_0x3f25ea(0x187)],_0x3f25ea(0x186));}}return console['error'](a30_0x487063['green'](_0x3f25ea(0x18e)+(_0x333393[_0x3f25ea(0x177)]+_0x167d83['length'])+'\x20files\x20to\x20'+_0x2da87d[_0x3f25ea(0x191)])),saveSessionContext({'parent_segment':_0x2da87d[_0x3f25ea(0x15d)]},_0x33d506['session']),console[_0x3f25ea(0x198)](a30_0x487063['green'](_0x3f25ea(0x169)+a30_0x487063['dim']('parent_segment')+_0x3f25ea(0x19e)+a30_0x487063['cyan'](_0x2da87d[_0x3f25ea(0x15d)]))),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"}
|