@treasuredata/tdx 2026.3.16 → 2026.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x22a292=a40_0x38a3;(function(_0x2fc15e,_0x3944d1){const _0x335153=a40_0x38a3,_0x2ee1bb=_0x2fc15e();while(!![]){try{const _0x76ae5d=parseInt(_0x335153(0x194))/0x1+parseInt(_0x335153(0x176))/0x2*(-parseInt(_0x335153(0x19e))/0x3)+parseInt(_0x335153(0x17d))/0x4*(parseInt(_0x335153(0x19c))/0x5)+-parseInt(_0x335153(0x174))/0x6*(parseInt(_0x335153(0x17c))/0x7)+-parseInt(_0x335153(0x191))/0x8*(parseInt(_0x335153(0x19d))/0x9)+parseInt(_0x335153(0x18d))/0xa+parseInt(_0x335153(0x181))/0xb;if(_0x76ae5d===_0x3944d1)break;else _0x2ee1bb['push'](_0x2ee1bb['shift']());}catch(_0x535bdb){_0x2ee1bb['push'](_0x2ee1bb['shift']());}}}(a40_0x1474,0x502fd));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a40_0x38a3(_0x51dc10,_0x7f94f8){_0x51dc10=_0x51dc10-0x174;const _0x14741d=a40_0x1474();let _0x38a347=_0x14741d[_0x51dc10];return _0x38a347;}import a40_0x19b0e5 from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a40_0x22a292(0x198);[a40_0x22a292(0x195)]=a40_0x22a292(0x192);async[a40_0x22a292(0x188)](_0x1da277){const _0x4c2160=a40_0x22a292;console[_0x4c2160(0x184)](a40_0x19b0e5['yellow'](_0x4c2160(0x19a))),console[_0x4c2160(0x184)](a40_0x19b0e5['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5eec10,args:_0x3ae4e5,tdx:_0xf6f55d}=_0x1da277,_0x18584d=_0x5eec10;if(_0x3ae4e5['length']===0x0)return console[_0x4c2160(0x184)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x4c2160(0x184)](_0x4c2160(0x199)),console[_0x4c2160(0x184)]('Examples:'),console[_0x4c2160(0x184)](_0x4c2160(0x180)),console[_0x4c2160(0x184)](_0x4c2160(0x189)),0x1;const _0xd4fc59=_0x3ae4e5[0x0],_0x3f9804=_0x5eec10[_0x4c2160(0x196)];let _0x5cf4b3=_0xd4fc59;_0x3f9804&&!_0xd4fc59['includes']('/')&&(_0x5cf4b3=_0x3f9804+'/'+_0xd4fc59,_0x18584d[_0x4c2160(0x18e)]&&console[_0x4c2160(0x184)](_0x4c2160(0x183)+_0x5cf4b3));const _0x2c6caa=await withSpinner(_0x4c2160(0x179)+_0x5cf4b3+_0x4c2160(0x18c),()=>_0xf6f55d[_0x4c2160(0x182)][_0x4c2160(0x186)](_0x5cf4b3),{'verbose':_0x18584d[_0x4c2160(0x18e)]}),_0xd5fb8f=_0x2c6caa[_0x4c2160(0x177)];_0x18584d['verbose']&&console[_0x4c2160(0x184)](_0x4c2160(0x19b)+_0xd5fb8f[_0x4c2160(0x185)]);if(_0xd5fb8f[_0x4c2160(0x185)]!==_0x4c2160(0x182))return console[_0x4c2160(0x184)](_0x4c2160(0x190)+_0xd5fb8f[_0x4c2160(0x185)]+_0x4c2160(0x17a)),console[_0x4c2160(0x184)](_0x4c2160(0x187)),0x1;if(!_0xd5fb8f[_0x4c2160(0x17e)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xa89e1c=_0xd5fb8f['parentId'],_0x55c97e=_0xd5fb8f[_0x4c2160(0x17e)];_0x18584d[_0x4c2160(0x18e)]&&(console[_0x4c2160(0x184)]('Parent\x20ID:\x20'+_0xa89e1c),console[_0x4c2160(0x184)]('Segment\x20ID:\x20'+_0x55c97e));let _0x486a2e;if(_0x18584d[_0x4c2160(0x178)]){const _0x152580=_0x18584d[_0x4c2160(0x178)],_0x86f9e1=await withSpinner(_0x4c2160(0x175)+_0x152580+'\x27...',()=>_0xf6f55d[_0x4c2160(0x182)]['resolveFolderId'](_0xa89e1c,_0x152580),{'verbose':_0x18584d[_0x4c2160(0x18e)]});_0x486a2e=parseInt(_0x86f9e1[_0x4c2160(0x177)],0xa),_0x18584d[_0x4c2160(0x18e)]&&console['error'](_0x4c2160(0x193)+_0x486a2e);}const _0x36076c=await loadJSONFromOptions(_0x18584d[_0x4c2160(0x18b)],_0x18584d[_0x4c2160(0x18a)]),_0x3116c4={'name':_0x18584d[_0x4c2160(0x197)],'description':_0x18584d[_0x4c2160(0x195)],'rule':_0x36076c,'kind':_0x18584d['kind']!==undefined?parseInt(_0x18584d['kind'],0xa):undefined,'segmentFolderId':_0x486a2e},_0x20af98=await withSpinner(_0x4c2160(0x17f)+_0xd5fb8f[_0x4c2160(0x17b)]+_0x4c2160(0x18c),()=>_0xf6f55d[_0x4c2160(0x182)]['updateSegmentById'](_0xa89e1c,_0x55c97e,_0x3116c4),{'verbose':_0x18584d[_0x4c2160(0x18e)]}),_0x1a13bc=_0x20af98[_0x4c2160(0x177)];return console[_0x4c2160(0x184)]('✔\x20Updated\x20segment\x20\x27'+_0x1a13bc[_0x4c2160(0x197)]+'\x27'),_0x5cf4b3!==_0xd4fc59&&console[_0x4c2160(0x184)](_0x4c2160(0x18f)+_0x5cf4b3),await handleSDKOutput([_0x1a13bc],_0x18584d),0x0;}}function a40_0x1474(){const _0x20e5ae=['segment','Resolved\x20relative\x20path\x20to:\x20','error','type','resolvePathToResource','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','execute','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','ruleFile','rule','\x27...','1665100dDnMjk','verbose','\x20\x20\x20Path:\x20','Error:\x20Cannot\x20update\x20','4619384mrTVay','Update\x20existing\x20child\x20segment','Resolved\x20folder\x20ID:\x20','517182yUtyQw','description','segmentPath','name','segment:update','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Resolved\x20type:\x20','95gzYHwj','9LlWNEM','21TPudJQ','1182kQptJf','Resolving\x20folder\x20\x27','172552ISTdJd','data','folder','Resolving\x20path\x20\x27','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentName','19411yNRGqS','97460poNexc','segmentId','Updating\x20segment\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','10003994QGEgOT'];a40_0x1474=function(){return _0x20e5ae;};return a40_0x1474();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x57144b=a41_0xd6c7;(function(_0x38b05d,_0x3709a7){const _0x3abae3=a41_0xd6c7,_0x157221=_0x38b05d();while(!![]){try{const _0xe5ce67=parseInt(_0x3abae3(0x1bf))/0x1+parseInt(_0x3abae3(0x1bc))/0x2+-parseInt(_0x3abae3(0x1ab))/0x3*(parseInt(_0x3abae3(0x191))/0x4)+parseInt(_0x3abae3(0x1a0))/0x5+parseInt(_0x3abae3(0x19f))/0x6*(-parseInt(_0x3abae3(0x193))/0x7)+parseInt(_0x3abae3(0x1b3))/0x8+-parseInt(_0x3abae3(0x187))/0x9;if(_0xe5ce67===_0x3709a7)break;else _0x157221['push'](_0x157221['shift']());}catch(_0x43b473){_0x157221['push'](_0x157221['shift']());}}}(a41_0x56f9,0x1fce9));function a41_0x56f9(){const _0xa2140=['description','dim','verbose','parent_segment','Resolved\x20path\x20type:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','join','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','30SpPzVE','217345dezeNB','segmentPath','\x27...','Examples:','isAbsolute','green','config','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','segment:use','222111QAxwWk','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Target\x20path:\x20','Error:\x20Path\x20is\x20required\x0a','session','data','error','red','1922232FMxvYo','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','type','Resolved\x20relative\x20path\x20to:\x20','execute','slice','length','Folder\x20ID:\x20','Parent\x20ID:\x20','437142TafCif','resolvePathToResource','folderPath','39423bcEfpE','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20set\x20to:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','431505fErPKW','log','cyan','Use:\x20tdx\x20segment\x20use\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Resolving\x20path\x20\x27','name','parentName','segment','12jqmbEH','split','197967KutaqF','site','fullPath','folderId'];a41_0x56f9=function(){return _0xa2140;};return a41_0x56f9();}import{existsSync,statSync}from'fs';import a41_0x199d71 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a41_0xd6c7(_0x43ff8f,_0x380750){_0x43ff8f=_0x43ff8f-0x184;const _0x56f9ab=a41_0x56f9();let _0xd6c792=_0x56f9ab[_0x43ff8f];return _0xd6c792;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a41_0x57144b(0x18e)]=a41_0x57144b(0x1aa);[a41_0x57144b(0x197)]=a41_0x57144b(0x186);async[a41_0x57144b(0x1b7)](_0x3482aa){const _0x4578f7=a41_0x57144b,{options:_0x12c7a8,args:_0x34f3e5,tdx:_0x44cb11}=_0x3482aa;if(_0x34f3e5[_0x4578f7(0x1b9)]===0x0)return console[_0x4578f7(0x1b1)](a41_0x199d71['red'](_0x4578f7(0x1ae))),console['error'](_0x4578f7(0x1a7)),console['error'](_0x4578f7(0x1a3)),console[_0x4578f7(0x1b1)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0x4578f7(0x18c)),console[_0x4578f7(0x1b1)](_0x4578f7(0x1a9)),console[_0x4578f7(0x1b1)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x57c956=_0x34f3e5[0x0],_0x4d88ab=_0x12c7a8[_0x4578f7(0x1af)];try{if(_0x57c956==='/')return saveSessionContext({'segment_path':undefined},_0x4d88ab),console[_0x4578f7(0x188)](a41_0x199d71[_0x4578f7(0x1a5)](_0x4578f7(0x19e))),0x0;if(existsSync(_0x57c956)&&statSync(_0x57c956)['isDirectory']()){let _0x22b208;try{_0x22b208=findTdxConfig(_0x57c956);}catch{return console[_0x4578f7(0x1b1)](a41_0x199d71[_0x4578f7(0x1b2)](_0x4578f7(0x1a8)+_0x57c956)),console[_0x4578f7(0x1b1)](a41_0x199d71[_0x4578f7(0x189)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x3ac829=_0x22b208[_0x4578f7(0x1a6)][_0x4578f7(0x19a)];return saveSessionContext({'segment_path':_0x3ac829,'parent_segment':_0x3ac829},_0x4d88ab),console[_0x4578f7(0x188)](a41_0x199d71[_0x4578f7(0x1a5)](_0x4578f7(0x185)+a41_0x199d71[_0x4578f7(0x189)](_0x3ac829))),0x0;}const _0x2a93f5=_0x12c7a8[_0x4578f7(0x1a1)];let _0x5ab26c=_0x57c956;const _0xcfd1ed=parsePath(_0x57c956);if(!_0xcfd1ed[_0x4578f7(0x1a4)]){if(!_0x2a93f5)return console['error'](a41_0x199d71['red'](_0x4578f7(0x1b4))),console[_0x4578f7(0x1b1)](a41_0x199d71['cyan'](_0x4578f7(0x18b))),0x1;if(_0x57c956==='..'){const _0xc7e952=_0x2a93f5[_0x4578f7(0x192)]('/')[_0x4578f7(0x1b8)](0x0,-0x1)[_0x4578f7(0x19d)]('/');_0x5ab26c=_0xc7e952||'/';}else _0x57c956==='.'?_0x5ab26c=_0x2a93f5:_0x5ab26c=_0x2a93f5+'/'+_0x57c956;_0x12c7a8['verbose']&&console[_0x4578f7(0x1b1)](_0x4578f7(0x1b6)+_0x5ab26c);}if(_0x5ab26c==='/'||_0x5ab26c==='')return saveSessionContext({'segment_path':undefined},_0x4d88ab),console['log'](a41_0x199d71[_0x4578f7(0x1a5)](_0x4578f7(0x19e))),0x0;_0x5ab26c=normalizePath(_0x5ab26c);const _0x203939=parsePath(_0x5ab26c)['segments'];if(_0x203939[_0x4578f7(0x1b9)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4d88ab),console[_0x4578f7(0x188)](a41_0x199d71['green'](_0x4578f7(0x19e))),0x0;_0x12c7a8['verbose']&&(console[_0x4578f7(0x1b1)]('Site:\x20'+_0x12c7a8[_0x4578f7(0x194)]),console[_0x4578f7(0x1b1)](_0x4578f7(0x1ad)+_0x5ab26c));const _0x29aa31=await withSpinner(_0x4578f7(0x18d)+_0x5ab26c+_0x4578f7(0x1a2),()=>_0x44cb11[_0x4578f7(0x190)][_0x4578f7(0x1bd)](_0x5ab26c),{'verbose':_0x12c7a8[_0x4578f7(0x199)]}),_0x3cec4d=_0x29aa31[_0x4578f7(0x1b0)];_0x12c7a8[_0x4578f7(0x199)]&&(console[_0x4578f7(0x1b1)](_0x4578f7(0x19b)+_0x3cec4d[_0x4578f7(0x1b5)]),console[_0x4578f7(0x1b1)](_0x4578f7(0x1bb)+_0x3cec4d['parentId']),_0x3cec4d[_0x4578f7(0x196)]&&console[_0x4578f7(0x1b1)](_0x4578f7(0x1ba)+_0x3cec4d[_0x4578f7(0x196)]));if(_0x3cec4d['type']==='segment')return console['error'](a41_0x199d71[_0x4578f7(0x1b2)](_0x4578f7(0x184))),console[_0x4578f7(0x1b1)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x4578f7(0x1b1)](a41_0x199d71[_0x4578f7(0x189)](_0x4578f7(0x18a)+_0x3cec4d[_0x4578f7(0x18f)]+(_0x3cec4d[_0x4578f7(0x1be)]?'/'+_0x3cec4d[_0x4578f7(0x1be)][_0x4578f7(0x19d)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3cec4d[_0x4578f7(0x195)],'parent_segment':_0x3cec4d[_0x4578f7(0x18f)]},_0x4d88ab),console[_0x4578f7(0x188)](a41_0x199d71[_0x4578f7(0x1a5)](_0x4578f7(0x185)+a41_0x199d71[_0x4578f7(0x189)](_0x3cec4d[_0x4578f7(0x195)]))),_0x12c7a8[_0x4578f7(0x199)]&&(console['error'](a41_0x199d71['dim'](_0x4578f7(0x1ac))),console[_0x4578f7(0x1b1)](a41_0x199d71[_0x4578f7(0x198)](_0x4578f7(0x19c)))),0x0;}catch(_0x31d170){throw _0x31d170;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a42_0x21ce(){const _0x59b06d=['log','verbose','no_parent','targetDir','424296ttyCps','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yml','\x20error(s)','Validate\x20segment\x20and\x20journey\x20YAML\x20files','1geMaBY','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','1695331DAAeRs','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','invalidCount','errors','\x20warning(s)\x20found','cyan','message','381044bUHBHZ','description','file','segment:validate','9WikBkf','length','\x20valid','error','endsWith','type','warningCount','valid','warnings','helpText','4AuIaql','\x20warning(s)','validCount','name','.yaml','602032YkLwVG','green','cwd','338548ptiZTf','):\x20','18WjFsCN','\x20file(s)\x20valid','errorCode','563995YWSiST','536950QmYGDn','execute','dim','yellow','red','hasErrors'];a42_0x21ce=function(){return _0x59b06d;};return a42_0x21ce();}const a42_0xd32eec=a42_0x5287;(function(_0x8fc3d7,_0x13ec6c){const _0x23b2de=a42_0x5287,_0x314534=_0x8fc3d7();while(!![]){try{const _0x538486=parseInt(_0x23b2de(0x1e0))/0x1*(-parseInt(_0x23b2de(0x1e9))/0x2)+-parseInt(_0x23b2de(0x1db))/0x3+-parseInt(_0x23b2de(0x1c3))/0x4*(-parseInt(_0x23b2de(0x1d0))/0x5)+parseInt(_0x23b2de(0x1cd))/0x6*(parseInt(_0x23b2de(0x1cb))/0x7)+parseInt(_0x23b2de(0x1c8))/0x8+parseInt(_0x23b2de(0x1ed))/0x9*(-parseInt(_0x23b2de(0x1d1))/0xa)+parseInt(_0x23b2de(0x1e2))/0xb;if(_0x538486===_0x13ec6c)break;else _0x314534['push'](_0x314534['shift']());}catch(_0x53657f){_0x314534['push'](_0x314534['shift']());}}}(a42_0x21ce,0x18cf1));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a42_0x10b74e from'chalk';function a42_0x5287(_0x4a8348,_0x20cf27){_0x4a8348=_0x4a8348-0x1bb;const _0x21ced7=a42_0x21ce();let _0x528726=_0x21ced7[_0x4a8348];return _0x528726;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a42_0xd32eec(0x1c6)]=a42_0xd32eec(0x1ec);[a42_0xd32eec(0x1ea)]=a42_0xd32eec(0x1df);async[a42_0xd32eec(0x1d2)](_0x432843){const _0x1b7457=a42_0xd32eec,{options:_0x5c3bea,args:_0x2a2f33}=_0x432843,_0x1e04c=_0x5c3bea,_0x43a7e5=await resolveTarget({'arg':_0x2a2f33[0x0],'contextParent':_0x5c3bea['parentSegment'],'cwd':process[_0x1b7457(0x1ca)]()});if(!isSuccessfulResolution(_0x43a7e5))return _0x43a7e5[_0x1b7457(0x1cf)]===_0x1b7457(0x1d9)?(console[_0x1b7457(0x1bc)](a42_0x10b74e[_0x1b7457(0x1d4)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1b7457(0x1bc)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x1b7457(0x1bc)](_0x1b7457(0x1e1)),console[_0x1b7457(0x1bc)](_0x1b7457(0x1e3))):(console[_0x1b7457(0x1bc)](a42_0x10b74e['red']('Error:\x20'+_0x43a7e5[_0x1b7457(0x1e8)]+'\x0a')),_0x43a7e5[_0x1b7457(0x1c2)]&&console['error'](a42_0x10b74e[_0x1b7457(0x1e7)](_0x43a7e5[_0x1b7457(0x1c2)]))),0x1;const _0x39980a=_0x43a7e5[_0x1b7457(0x1da)],_0x8ee026=_0x43a7e5[_0x1b7457(0x1be)]===_0x1b7457(0x1eb)?_0x43a7e5['filePath']:undefined;if(!_0x8ee026&&!existsSync(_0x39980a))return console[_0x1b7457(0x1bc)](a42_0x10b74e['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x39980a+'\x0a')),0x1;let _0x3e2c7c;if(_0x8ee026){if(!_0x8ee026[_0x1b7457(0x1bd)](_0x1b7457(0x1dd))&&!_0x8ee026[_0x1b7457(0x1bd)](_0x1b7457(0x1c7)))return console[_0x1b7457(0x1bc)](a42_0x10b74e[_0x1b7457(0x1d5)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x8ee026+'\x0a')),0x1;_0x3e2c7c=[_0x8ee026];}else _0x3e2c7c=findYamlFiles(_0x39980a);if(_0x3e2c7c[_0x1b7457(0x1ee)]===0x0)return console[_0x1b7457(0x1bc)](a42_0x10b74e['red'](_0x1b7457(0x1dc)+_0x39980a+'\x0a')),0x1;const _0x32db95=validateYamlFiles(_0x3e2c7c,_0x39980a),_0x488baf=calculateSummary(_0x32db95);for(const _0x16c19d of _0x32db95){if(!isValidationResult(_0x16c19d))continue;const {relativePath:_0x18e89d,source:_0x5ca1c0,result:_0x3ebb34,fileType:_0x8894e1}=_0x16c19d,_0x2e5b47=_0x8894e1;if(_0x3ebb34['valid']&&_0x3ebb34[_0x1b7457(0x1c1)]['length']===0x0)_0x1e04c[_0x1b7457(0x1d8)]&&console['log'](a42_0x10b74e[_0x1b7457(0x1c9)]('✔\x20'+_0x18e89d)+a42_0x10b74e[_0x1b7457(0x1d3)]('\x20('+_0x2e5b47+')'));else _0x3ebb34[_0x1b7457(0x1c0)]?(console[_0x1b7457(0x1d7)](a42_0x10b74e[_0x1b7457(0x1d4)]('⚠\x20'+_0x18e89d)+a42_0x10b74e[_0x1b7457(0x1d3)]('\x20('+_0x2e5b47+_0x1b7457(0x1cc)+_0x3ebb34[_0x1b7457(0x1c1)][_0x1b7457(0x1ee)]+_0x1b7457(0x1c4))),console[_0x1b7457(0x1d7)](formatValidationResult(_0x3ebb34,_0x5ca1c0,_0x18e89d))):(console[_0x1b7457(0x1d7)](a42_0x10b74e[_0x1b7457(0x1d5)]('✖\x20'+_0x18e89d)+a42_0x10b74e[_0x1b7457(0x1d3)]('\x20('+_0x2e5b47+_0x1b7457(0x1cc)+_0x3ebb34[_0x1b7457(0x1e5)][_0x1b7457(0x1ee)]+_0x1b7457(0x1de))),console[_0x1b7457(0x1d7)](formatValidationResult(_0x3ebb34,_0x5ca1c0,_0x18e89d)));}return console[_0x1b7457(0x1d7)](''),_0x488baf[_0x1b7457(0x1d6)]?(console[_0x1b7457(0x1d7)](a42_0x10b74e[_0x1b7457(0x1d5)]('Validation\x20failed:\x20'+_0x488baf[_0x1b7457(0x1e4)]+'\x20file(s)\x20with\x20errors,\x20'+_0x488baf[_0x1b7457(0x1c5)]+_0x1b7457(0x1bb))),_0x488baf[_0x1b7457(0x1bf)]>0x0&&console[_0x1b7457(0x1d7)](a42_0x10b74e[_0x1b7457(0x1d4)](_0x488baf[_0x1b7457(0x1bf)]+_0x1b7457(0x1e6))),0x1):(console['log'](a42_0x10b74e['green']('✔\x20All\x20'+_0x488baf[_0x1b7457(0x1c5)]+_0x1b7457(0x1ce))),_0x488baf[_0x1b7457(0x1bf)]>0x0&&console[_0x1b7457(0x1d7)](a42_0x10b74e[_0x1b7457(0x1d4)](_0x488baf[_0x1b7457(0x1bf)]+_0x1b7457(0x1e6))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a43_0xe35d57=a43_0x5f58;(function(_0x4fb1f1,_0x251ce0){const _0x31a161=a43_0x5f58,_0x522493=_0x4fb1f1();while(!![]){try{const _0xad991f=-parseInt(_0x31a161(0x1e4))/0x1*(-parseInt(_0x31a161(0x1b5))/0x2)+-parseInt(_0x31a161(0x1ed))/0x3*(parseInt(_0x31a161(0x1da))/0x4)+-parseInt(_0x31a161(0x1fc))/0x5*(parseInt(_0x31a161(0x1cc))/0x6)+parseInt(_0x31a161(0x1db))/0x7+parseInt(_0x31a161(0x1b6))/0x8+-parseInt(_0x31a161(0x1f2))/0x9*(parseInt(_0x31a161(0x1d1))/0xa)+parseInt(_0x31a161(0x1b8))/0xb;if(_0xad991f===_0x251ce0)break;else _0x522493['push'](_0x522493['shift']());}catch(_0x25d56a){_0x522493['push'](_0x522493['shift']());}}}(a43_0x3af4,0x2276c));import{BaseCommand}from'./command.js';function a43_0x3af4(){const _0x1a1ad6=['Folder\x20ID:\x20','3lQRXvV','message','includes','✔\x20Built\x20tree\x20with\x20','verbose','7326btSlQs','Site:\x20','Resolving\x20parent\x20segment\x20\x27','listUnifiedWithJourneys','log','jsonl','cause','Listing\x20folders,\x20segments,\x20and\x20journeys...','journey','journeyBundleName','869435WxABdg','format','Resolving\x20path\x20\x27','/app/ps/',']\x20matching\x20\x27','resolvePathToResource','name','6yepezT','1503904vJohZx','\x20segment','1045011rfxEwk','folder','recursive','/e/','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','List\x20folders\x20and\x20child\x20segments','parentSegment','data','Parent\x20segment\x20context:\x20','listRecursive','Building\x20hierarchy\x20tree...','sort','error','\x20matching\x20\x27','parentId','\x20folder','(not\x20set)','folders','length','segment','6XBqvpZ','folderId','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','✔\x20Found\x20','\x5c$&','1850atiOLF','localeCompare','json','test','children','maxDepth','Parent\x20ID:\x20','journeys','Error:\x20','392096XwuxJK','916664RnuVwC','replace','(empty)','/j/da','site','Recursive\x20mode:\x20enabled','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','filter','listUnified','49908wZIUhu','type','dim','\x20journey',',\x20and\x20','\x27...','segments','map'];a43_0x3af4=function(){return _0x1a1ad6;};return a43_0x3af4();}function a43_0x5f58(_0x4804ae,_0x1a1c09){_0x4804ae=_0x4804ae-0x1b2;const _0x3af4a2=a43_0x3af4();let _0x5f58a3=_0x3af4a2[_0x4804ae];return _0x5f58a3;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a43_0x2ddec6 from'chalk';export class SegmentsCommand extends BaseCommand{[a43_0xe35d57(0x1b4)]=a43_0xe35d57(0x1ea);['description']=a43_0xe35d57(0x1bd);async['execute'](_0x3cbc34){const _0xb2a137=a43_0xe35d57,{options:_0x246b66,args:_0x59c3d7}=_0x3cbc34,_0x202e19=_0x246b66[_0xb2a137(0x1ba)],_0x1b93ed=_0x59c3d7[0x0];try{const _0x19e47a=_0x246b66[_0xb2a137(0x1be)];_0x246b66[_0xb2a137(0x1f1)]&&(console[_0xb2a137(0x1c4)](_0xb2a137(0x1f3)+_0x246b66[_0xb2a137(0x1df)]),console[_0xb2a137(0x1c4)](_0xb2a137(0x1c0)+(_0x19e47a||_0xb2a137(0x1c8))),_0x1b93ed&&console[_0xb2a137(0x1c4)]('Folder/pattern\x20arg:\x20'+_0x1b93ed),_0x202e19&&console['error'](_0xb2a137(0x1e0)));if(!_0x19e47a)return console[_0xb2a137(0x1c4)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0xb2a137(0x1c4)](''),console[_0xb2a137(0x1c4)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0xb2a137(0x1c4)](_0xb2a137(0x1ce)),console[_0xb2a137(0x1c4)](_0xb2a137(0x1bc)),console[_0xb2a137(0x1c4)](''),console['error'](_0xb2a137(0x1e1)),0x1;const _0x3c3521=_0x1b93ed&&(_0x1b93ed[_0xb2a137(0x1ef)]('*')||_0x1b93ed[_0xb2a137(0x1ef)]('?'));if(_0x3c3521)return await this['listWithPattern'](_0x3cbc34,_0x19e47a,_0x1b93ed);const _0x307636=_0x1b93ed?_0x19e47a+'/'+_0x1b93ed:_0x19e47a;return _0x202e19?await this[_0xb2a137(0x1c1)](_0x3cbc34,_0x307636):await this[_0xb2a137(0x1e3)](_0x3cbc34,_0x307636);}catch(_0x177b19){if(_0x177b19 instanceof SDKError)return console['error'](_0xb2a137(0x1d9)+_0x177b19[_0xb2a137(0x1ee)]),_0x177b19[_0xb2a137(0x1f8)]&&console['error']('\x20\x20Cause:\x20'+_0x177b19[_0xb2a137(0x1f8)]),0x1;throw _0x177b19;}}async['listWithPattern'](_0x56279d,_0x4d5034,_0x2968c6){const _0x528ee0=a43_0xe35d57,{options:_0x342901,tdx:_0x1201b1}=_0x56279d,_0x5d639f=await withSpinner(_0x528ee0(0x1f4)+_0x4d5034+_0x528ee0(0x1e9),()=>_0x1201b1['segment'][_0x528ee0(0x1b3)](_0x4d5034),{'verbose':_0x342901[_0x528ee0(0x1f1)]}),_0x250fb9=_0x5d639f[_0x528ee0(0x1bf)],_0x1e7676=await withSpinner(_0x528ee0(0x1f9),()=>_0x1201b1[_0x528ee0(0x1cb)][_0x528ee0(0x1f5)](_0x250fb9[_0x528ee0(0x1c6)],_0x250fb9[_0x528ee0(0x1cd)]),{'verbose':_0x342901[_0x528ee0(0x1f1)]}),{folders:_0x4b0adb,segments:_0x160322,journeys:_0x55c755}=_0x1e7676[_0x528ee0(0x1bf)],_0x4ccdfd=_0x2968c6[_0x528ee0(0x1dc)](/[.+^${}()|[\]\\]/g,_0x528ee0(0x1d0))[_0x528ee0(0x1dc)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x29c7de=new RegExp('^'+_0x4ccdfd+'$','i'),_0x542fb6=_0x4b0adb[_0x528ee0(0x1e2)](_0x2c58a7=>_0x29c7de[_0x528ee0(0x1d4)](_0x2c58a7[_0x528ee0(0x1b4)])),_0x7dfb84=_0x160322[_0x528ee0(0x1e2)](_0x3473ca=>_0x29c7de[_0x528ee0(0x1d4)](_0x3473ca[_0x528ee0(0x1b4)])),_0x48d186=_0x55c755['filter'](_0x4b65c0=>_0x29c7de[_0x528ee0(0x1d4)](_0x4b65c0[_0x528ee0(0x1fb)])),_0x2f70bf=_0x542fb6[_0x528ee0(0x1ca)]+_0x7dfb84[_0x528ee0(0x1ca)]+_0x48d186['length'];console[_0x528ee0(0x1c4)](_0x528ee0(0x1cf)+_0x542fb6[_0x528ee0(0x1ca)]+_0x528ee0(0x1c7)+(_0x542fb6['length']!==0x1?'s':'')+',\x20'+_0x7dfb84[_0x528ee0(0x1ca)]+_0x528ee0(0x1b7)+(_0x7dfb84[_0x528ee0(0x1ca)]!==0x1?'s':'')+',\x20and\x20'+_0x48d186[_0x528ee0(0x1ca)]+_0x528ee0(0x1e7)+(_0x48d186[_0x528ee0(0x1ca)]!==0x1?'s':'')+_0x528ee0(0x1c5)+_0x2968c6+'\x27');const _0x412c3b=_0x458e23=>{const _0x5e450a=_0x528ee0;return getConsoleNextUrl(_0x342901[_0x5e450a(0x1df)],_0x5e450a(0x1ff)+_0x250fb9[_0x5e450a(0x1c6)]+'/e/'+_0x458e23);},_0x48ccdb=_0x342901['format']===_0x528ee0(0x1d3)||_0x342901[_0x528ee0(0x1fd)]===_0x528ee0(0x1f7);if(_0x48ccdb){const _0x35635c=[..._0x542fb6[_0x528ee0(0x1eb)](_0x551665=>({..._0x551665,'type':_0x528ee0(0x1b9)})),..._0x7dfb84[_0x528ee0(0x1eb)](_0x2edc2e=>({..._0x2edc2e,'type':_0x528ee0(0x1cb),'url':_0x412c3b(_0x2edc2e['id'])})),..._0x48d186[_0x528ee0(0x1eb)](_0x15d93f=>({..._0x15d93f,'name':_0x15d93f['journeyBundleName'],'type':_0x528ee0(0x1fa)}))][_0x528ee0(0x1c3)]((_0x48bc4e,_0x205b36)=>_0x48bc4e['name'][_0x528ee0(0x1d2)](_0x205b36[_0x528ee0(0x1b4)]));await handleSDKOutput(_0x35635c,_0x342901);}else{if(_0x2f70bf===0x0)console[_0x528ee0(0x1f6)]('No\x20items\x20match\x20pattern:\x20'+_0x2968c6);else{console['log'](a43_0x2ddec6['dim']('['+_0x4d5034+_0x528ee0(0x1b2)+_0x2968c6+'\x27'));const _0xd9d20=formatFlatList(_0x542fb6,_0x7dfb84,{'showMetadata':!![],'getSegmentUrl':_0x412c3b},_0x48d186);console[_0x528ee0(0x1f6)](_0xd9d20);}}return 0x0;}async['listUnified'](_0x44ed11,_0x19865a){const _0x2a2b0e=a43_0xe35d57,{options:_0x3e773e,tdx:_0x2e8316}=_0x44ed11,_0x5a4413=await withSpinner(_0x2a2b0e(0x1fe)+_0x19865a+_0x2a2b0e(0x1e9),()=>_0x2e8316[_0x2a2b0e(0x1cb)]['resolvePathToResource'](_0x19865a),{'verbose':_0x3e773e[_0x2a2b0e(0x1f1)]}),_0x2e6650=_0x5a4413[_0x2a2b0e(0x1bf)];_0x3e773e[_0x2a2b0e(0x1f1)]&&(console[_0x2a2b0e(0x1c4)]('Parent\x20ID:\x20'+_0x2e6650['parentId']),_0x2e6650[_0x2a2b0e(0x1cd)]&&console[_0x2a2b0e(0x1c4)](_0x2a2b0e(0x1ec)+_0x2e6650[_0x2a2b0e(0x1cd)]));const _0x12d77b=await withSpinner(_0x2a2b0e(0x1f9),()=>_0x2e8316['segment'][_0x2a2b0e(0x1f5)](_0x2e6650[_0x2a2b0e(0x1c6)],_0x2e6650[_0x2a2b0e(0x1cd)]),{'verbose':_0x3e773e[_0x2a2b0e(0x1f1)]}),{folders:_0x28440f,segments:_0x1e19da,journeys:_0x19a05d}=_0x12d77b[_0x2a2b0e(0x1bf)],_0x4ca1fc=_0x28440f[_0x2a2b0e(0x1ca)]+_0x1e19da['length']+_0x19a05d[_0x2a2b0e(0x1ca)];console['error']('✔\x20Found\x20'+_0x28440f[_0x2a2b0e(0x1ca)]+_0x2a2b0e(0x1c7)+(_0x28440f['length']!==0x1?'s':'')+',\x20'+_0x1e19da[_0x2a2b0e(0x1ca)]+_0x2a2b0e(0x1b7)+(_0x1e19da[_0x2a2b0e(0x1ca)]!==0x1?'s':'')+_0x2a2b0e(0x1e8)+_0x19a05d[_0x2a2b0e(0x1ca)]+'\x20journey'+(_0x19a05d['length']!==0x1?'s':''));const _0x21fe12=_0x729b83=>{const _0x1b17b9=_0x2a2b0e;return getConsoleNextUrl(_0x3e773e['site'],_0x1b17b9(0x1ff)+_0x2e6650['parentId']+_0x1b17b9(0x1bb)+_0x729b83);},_0x2f4d4a=_0x3c38ca=>{const _0x537d8e=_0x2a2b0e;return getConsoleNextUrl(_0x3e773e[_0x537d8e(0x1df)],_0x537d8e(0x1ff)+_0x2e6650[_0x537d8e(0x1c6)]+_0x537d8e(0x1bb)+_0x3c38ca+_0x537d8e(0x1de));},_0x1b72dd=_0x3e773e['format']===_0x2a2b0e(0x1d3)||_0x3e773e[_0x2a2b0e(0x1fd)]===_0x2a2b0e(0x1f7);if(_0x1b72dd){const _0x1f065f=[..._0x28440f[_0x2a2b0e(0x1eb)](_0x19ad60=>({..._0x19ad60,'type':_0x2a2b0e(0x1b9)})),..._0x1e19da['map'](_0xe97bbe=>({..._0xe97bbe,'type':_0x2a2b0e(0x1cb),'url':_0x21fe12(_0xe97bbe['id'])})),..._0x19a05d[_0x2a2b0e(0x1eb)](_0x54f7be=>({..._0x54f7be,'name':_0x54f7be[_0x2a2b0e(0x1fb)],'type':_0x2a2b0e(0x1fa),'url':_0x2f4d4a(_0x54f7be['id'])}))][_0x2a2b0e(0x1c3)]((_0xe44d55,_0x58562b)=>_0xe44d55[_0x2a2b0e(0x1b4)][_0x2a2b0e(0x1d2)](_0x58562b[_0x2a2b0e(0x1b4)]));await handleSDKOutput(_0x1f065f,_0x3e773e);}else{if(_0x4ca1fc===0x0)console[_0x2a2b0e(0x1f6)](a43_0x2ddec6[_0x2a2b0e(0x1e6)]('['+_0x19865a+']')),console['log'](_0x2a2b0e(0x1dd));else{console[_0x2a2b0e(0x1f6)](a43_0x2ddec6[_0x2a2b0e(0x1e6)]('['+_0x19865a+']'));const _0x3f1595=formatFlatList(_0x28440f,_0x1e19da,{'showMetadata':!![],'getSegmentUrl':_0x21fe12,'getJourneyUrl':_0x2f4d4a},_0x19a05d);console[_0x2a2b0e(0x1f6)](_0x3f1595);}}return 0x0;}async[a43_0xe35d57(0x1c1)](_0x2cddc5,_0x3c2128){const _0x112bee=a43_0xe35d57,{options:_0x193830,tdx:_0x5de5f2}=_0x2cddc5,_0x3e64dc=await withSpinner(_0x112bee(0x1fe)+_0x3c2128+'\x27...',()=>_0x5de5f2['segment'][_0x112bee(0x1b3)](_0x3c2128),{'verbose':_0x193830[_0x112bee(0x1f1)]}),_0x3f639d=_0x3e64dc[_0x112bee(0x1bf)];_0x193830[_0x112bee(0x1f1)]&&(console['error'](_0x112bee(0x1d7)+_0x3f639d[_0x112bee(0x1c6)]),_0x3f639d[_0x112bee(0x1cd)]&&console['error'](_0x112bee(0x1ec)+_0x3f639d[_0x112bee(0x1cd)]));const _0x3c8f8a=_0x193830[_0x112bee(0x1d6)]||0xa,_0x3c6175=await withSpinner(_0x112bee(0x1c2),()=>_0x5de5f2[_0x112bee(0x1cb)][_0x112bee(0x1c1)](_0x3f639d['parentId'],_0x3f639d['folderId'],0x0,_0x3c8f8a),{'verbose':_0x193830[_0x112bee(0x1f1)]}),_0x3dfc82=_0x3c6175[_0x112bee(0x1bf)],_0x48bd6b=_0x4053ee=>{const _0x1cea24=_0x112bee;let _0x577254=0x0,_0x4aa849=0x0,_0x413c7f=0x0;for(const _0x17f6d1 of _0x4053ee){if(_0x17f6d1['type']==='folder')_0x577254++;else{if(_0x17f6d1[_0x1cea24(0x1e5)]==='segment')_0x4aa849++;else{if(_0x17f6d1[_0x1cea24(0x1e5)]==='journey')_0x413c7f++;}}if(_0x17f6d1[_0x1cea24(0x1d5)]){const _0x501730=_0x48bd6b(_0x17f6d1[_0x1cea24(0x1d5)]);_0x577254+=_0x501730[_0x1cea24(0x1c9)],_0x4aa849+=_0x501730[_0x1cea24(0x1ea)],_0x413c7f+=_0x501730[_0x1cea24(0x1d8)];}}return{'folders':_0x577254,'segments':_0x4aa849,'journeys':_0x413c7f};},_0x50476b=_0x48bd6b(_0x3dfc82);console[_0x112bee(0x1c4)](_0x112bee(0x1f0)+_0x50476b['folders']+_0x112bee(0x1c7)+(_0x50476b[_0x112bee(0x1c9)]!==0x1?'s':'')+',\x20'+_0x50476b[_0x112bee(0x1ea)]+'\x20segment'+(_0x50476b[_0x112bee(0x1ea)]!==0x1?'s':'')+',\x20and\x20'+_0x50476b[_0x112bee(0x1d8)]+_0x112bee(0x1e7)+(_0x50476b[_0x112bee(0x1d8)]!==0x1?'s':''));const _0x40ac67=_0x3ea18b=>{const _0x4be6d0=_0x112bee;return getConsoleNextUrl(_0x193830[_0x4be6d0(0x1df)],_0x4be6d0(0x1ff)+_0x3f639d[_0x4be6d0(0x1c6)]+_0x4be6d0(0x1bb)+_0x3ea18b);},_0x4a3a22=_0x2dbe45=>{const _0x2805b0=_0x112bee;return getConsoleNextUrl(_0x193830['site'],_0x2805b0(0x1ff)+_0x3f639d[_0x2805b0(0x1c6)]+'/e/'+_0x2dbe45+_0x2805b0(0x1de));};if(_0x193830[_0x112bee(0x1fd)]===_0x112bee(0x1d3)||_0x193830[_0x112bee(0x1fd)]===_0x112bee(0x1f7))await handleSDKOutput(_0x3dfc82,_0x193830);else{console[_0x112bee(0x1f6)](a43_0x2ddec6[_0x112bee(0x1e6)]('['+_0x3c2128+']'));const _0x1cbf93=formatTree(_0x3dfc82,{'showMetadata':!![],'getSegmentUrl':_0x40ac67,'getJourneyUrl':_0x4a3a22});console[_0x112bee(0x1f6)](_0x1cbf93);}return 0x0;}}
|
|
1
|
+
const a43_0x277fe=a43_0x5f48;(function(_0x3765e3,_0x3fd573){const _0x4b7240=a43_0x5f48,_0x5f59f2=_0x3765e3();while(!![]){try{const _0x32c7d5=parseInt(_0x4b7240(0x1ac))/0x1*(parseInt(_0x4b7240(0x1d5))/0x2)+-parseInt(_0x4b7240(0x1d7))/0x3*(parseInt(_0x4b7240(0x1bf))/0x4)+-parseInt(_0x4b7240(0x191))/0x5+-parseInt(_0x4b7240(0x19a))/0x6+-parseInt(_0x4b7240(0x1bc))/0x7+parseInt(_0x4b7240(0x1d8))/0x8+parseInt(_0x4b7240(0x196))/0x9;if(_0x32c7d5===_0x3fd573)break;else _0x5f59f2['push'](_0x5f59f2['shift']());}catch(_0x3f6aa9){_0x5f59f2['push'](_0x5f59f2['shift']());}}}(a43_0x3454,0xedcd1));import{BaseCommand}from'./command.js';function a43_0x3454(){const _0x3c5b17=['listRecursive','listUnified','message','cause','\x27...','Set\x20a\x20parent\x20segment\x20context\x20first:','No\x20items\x20match\x20pattern:\x20','Folder\x20ID:\x20','Folder/pattern\x20arg:\x20',']\x20matching\x20\x27','106IjkNfM','Listing\x20folders,\x20segments,\x20and\x20journeys...','114hTrGCu','13702200tFYyKq','name','listUnifiedWithJourneys','length','folders','8649015QWTdJC','test','recursive','dim','type','15443361SUyHmS','includes','Building\x20hierarchy\x20tree...','site','5289708ANmdZn','description','map','✔\x20Found\x20','/e/','\x20segment','Parent\x20ID:\x20','\x20matching\x20\x27','parentId',',\x20and\x20','sort','\x5c$&','replace','json','folderId','log','children','segment','7789AfCgRv','Parent\x20segment\x20context:\x20','format','\x20journey','error','Recursive\x20mode:\x20enabled','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','maxDepth','listWithPattern','\x20folder','journey','filter','data','journeyBundleName','verbose','/j/da','1733151CQbiaD','Resolving\x20path\x20\x27','Site:\x20','892VtFDaK','resolvePathToResource','jsonl','Resolving\x20parent\x20segment\x20\x27','List\x20folders\x20and\x20child\x20segments','folder','localeCompare','execute','journeys','/app/ps/','\x20\x20Cause:\x20','segments'];a43_0x3454=function(){return _0x3c5b17;};return a43_0x3454();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a43_0x5f48(_0x2dac22,_0x38f12c){_0x2dac22=_0x2dac22-0x18d;const _0x34549d=a43_0x3454();let _0x5f4853=_0x34549d[_0x2dac22];return _0x5f4853;}import a43_0x4c6926 from'chalk';export class SegmentsCommand extends BaseCommand{[a43_0x277fe(0x18d)]=a43_0x277fe(0x1ca);[a43_0x277fe(0x19b)]=a43_0x277fe(0x1c3);async[a43_0x277fe(0x1c6)](_0x49fa87){const _0x72deed=a43_0x277fe,{options:_0xa3ea02,args:_0x172881}=_0x49fa87,_0x5a7704=_0xa3ea02[_0x72deed(0x193)],_0x3a431b=_0x172881[0x0];try{const _0x27d9ba=_0xa3ea02['parentSegment'];_0xa3ea02[_0x72deed(0x1ba)]&&(console['error'](_0x72deed(0x1be)+_0xa3ea02['site']),console['error'](_0x72deed(0x1ad)+(_0x27d9ba||'(not\x20set)')),_0x3a431b&&console[_0x72deed(0x1b0)](_0x72deed(0x1d3)+_0x3a431b),_0x5a7704&&console[_0x72deed(0x1b0)](_0x72deed(0x1b1)));if(!_0x27d9ba)return console[_0x72deed(0x1b0)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x72deed(0x1b0)](''),console[_0x72deed(0x1b0)](_0x72deed(0x1d0)),console[_0x72deed(0x1b0)](_0x72deed(0x1b2)),console[_0x72deed(0x1b0)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x72deed(0x1b0)](''),console[_0x72deed(0x1b0)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x3fd823=_0x3a431b&&(_0x3a431b[_0x72deed(0x197)]('*')||_0x3a431b[_0x72deed(0x197)]('?'));if(_0x3fd823)return await this[_0x72deed(0x1b4)](_0x49fa87,_0x27d9ba,_0x3a431b);const _0x2f4329=_0x3a431b?_0x27d9ba+'/'+_0x3a431b:_0x27d9ba;return _0x5a7704?await this[_0x72deed(0x1cb)](_0x49fa87,_0x2f4329):await this[_0x72deed(0x1cc)](_0x49fa87,_0x2f4329);}catch(_0x2d70bf){if(_0x2d70bf instanceof SDKError)return console[_0x72deed(0x1b0)]('Error:\x20'+_0x2d70bf[_0x72deed(0x1cd)]),_0x2d70bf[_0x72deed(0x1ce)]&&console[_0x72deed(0x1b0)](_0x72deed(0x1c9)+_0x2d70bf[_0x72deed(0x1ce)]),0x1;throw _0x2d70bf;}}async[a43_0x277fe(0x1b4)](_0x213e61,_0x23dc6a,_0x5748c5){const _0x89bf1c=a43_0x277fe,{options:_0x4aac03,tdx:_0x2d5b98}=_0x213e61,_0x50ce82=await withSpinner(_0x89bf1c(0x1c2)+_0x23dc6a+_0x89bf1c(0x1cf),()=>_0x2d5b98['segment'][_0x89bf1c(0x1c0)](_0x23dc6a),{'verbose':_0x4aac03[_0x89bf1c(0x1ba)]}),_0x56e0fb=_0x50ce82['data'],_0x4dcda2=await withSpinner(_0x89bf1c(0x1d6),()=>_0x2d5b98[_0x89bf1c(0x1ab)][_0x89bf1c(0x18e)](_0x56e0fb['parentId'],_0x56e0fb['folderId']),{'verbose':_0x4aac03[_0x89bf1c(0x1ba)]}),{folders:_0x293056,segments:_0x6092b6,journeys:_0x1ffdc2}=_0x4dcda2[_0x89bf1c(0x1b8)],_0x3ac832=_0x5748c5[_0x89bf1c(0x1a6)](/[.+^${}()|[\]\\]/g,_0x89bf1c(0x1a5))[_0x89bf1c(0x1a6)](/\*/g,'.*')[_0x89bf1c(0x1a6)](/\?/g,'.'),_0x47d1b3=new RegExp('^'+_0x3ac832+'$','i'),_0x42b1c6=_0x293056[_0x89bf1c(0x1b7)](_0x16449f=>_0x47d1b3['test'](_0x16449f[_0x89bf1c(0x18d)])),_0x1ae5e9=_0x6092b6[_0x89bf1c(0x1b7)](_0x26d1ae=>_0x47d1b3[_0x89bf1c(0x192)](_0x26d1ae['name'])),_0x117b41=_0x1ffdc2[_0x89bf1c(0x1b7)](_0xa70891=>_0x47d1b3[_0x89bf1c(0x192)](_0xa70891[_0x89bf1c(0x1b9)])),_0x3f19f7=_0x42b1c6[_0x89bf1c(0x18f)]+_0x1ae5e9[_0x89bf1c(0x18f)]+_0x117b41[_0x89bf1c(0x18f)];console[_0x89bf1c(0x1b0)](_0x89bf1c(0x19d)+_0x42b1c6[_0x89bf1c(0x18f)]+_0x89bf1c(0x1b5)+(_0x42b1c6[_0x89bf1c(0x18f)]!==0x1?'s':'')+',\x20'+_0x1ae5e9['length']+_0x89bf1c(0x19f)+(_0x1ae5e9[_0x89bf1c(0x18f)]!==0x1?'s':'')+_0x89bf1c(0x1a3)+_0x117b41[_0x89bf1c(0x18f)]+_0x89bf1c(0x1af)+(_0x117b41[_0x89bf1c(0x18f)]!==0x1?'s':'')+_0x89bf1c(0x1a1)+_0x5748c5+'\x27');const _0x279e7a=_0x13c718=>{const _0x1079c6=_0x89bf1c;return getConsoleNextUrl(_0x4aac03[_0x1079c6(0x199)],_0x1079c6(0x1c8)+_0x56e0fb[_0x1079c6(0x1a2)]+_0x1079c6(0x19e)+_0x13c718);},_0x5ee65f=_0x4aac03[_0x89bf1c(0x1ae)]===_0x89bf1c(0x1a7)||_0x4aac03[_0x89bf1c(0x1ae)]===_0x89bf1c(0x1c1);if(_0x5ee65f){const _0x1153de=[..._0x42b1c6['map'](_0x2aed8a=>({..._0x2aed8a,'type':_0x89bf1c(0x1c4)})),..._0x1ae5e9[_0x89bf1c(0x19c)](_0x4c8d9f=>({..._0x4c8d9f,'type':'segment','url':_0x279e7a(_0x4c8d9f['id'])})),..._0x117b41[_0x89bf1c(0x19c)](_0x2cf1ed=>({..._0x2cf1ed,'name':_0x2cf1ed[_0x89bf1c(0x1b9)],'type':_0x89bf1c(0x1b6)}))][_0x89bf1c(0x1a4)]((_0x599de0,_0x32ebca)=>_0x599de0[_0x89bf1c(0x18d)][_0x89bf1c(0x1c5)](_0x32ebca['name']));await handleSDKOutput(_0x1153de,_0x4aac03);}else{if(_0x3f19f7===0x0)console['log'](_0x89bf1c(0x1d1)+_0x5748c5);else{console[_0x89bf1c(0x1a9)](a43_0x4c6926[_0x89bf1c(0x194)]('['+_0x23dc6a+_0x89bf1c(0x1d4)+_0x5748c5+'\x27'));const _0x29d406=formatFlatList(_0x42b1c6,_0x1ae5e9,{'showMetadata':!![],'getSegmentUrl':_0x279e7a},_0x117b41);console[_0x89bf1c(0x1a9)](_0x29d406);}}return 0x0;}async['listUnified'](_0x2c3fc8,_0x2bc9ef){const _0xe5e5b1=a43_0x277fe,{options:_0x1ce41a,tdx:_0x24bba4}=_0x2c3fc8,_0x256f04=await withSpinner(_0xe5e5b1(0x1bd)+_0x2bc9ef+_0xe5e5b1(0x1cf),()=>_0x24bba4[_0xe5e5b1(0x1ab)][_0xe5e5b1(0x1c0)](_0x2bc9ef),{'verbose':_0x1ce41a[_0xe5e5b1(0x1ba)]}),_0x393032=_0x256f04[_0xe5e5b1(0x1b8)];_0x1ce41a[_0xe5e5b1(0x1ba)]&&(console[_0xe5e5b1(0x1b0)](_0xe5e5b1(0x1a0)+_0x393032['parentId']),_0x393032[_0xe5e5b1(0x1a8)]&&console[_0xe5e5b1(0x1b0)](_0xe5e5b1(0x1d2)+_0x393032['folderId']));const _0x5c7722=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x24bba4['segment'][_0xe5e5b1(0x18e)](_0x393032[_0xe5e5b1(0x1a2)],_0x393032[_0xe5e5b1(0x1a8)]),{'verbose':_0x1ce41a[_0xe5e5b1(0x1ba)]}),{folders:_0x2dc053,segments:_0x5156dd,journeys:_0xa60dc8}=_0x5c7722[_0xe5e5b1(0x1b8)],_0x3ee896=_0x2dc053[_0xe5e5b1(0x18f)]+_0x5156dd[_0xe5e5b1(0x18f)]+_0xa60dc8[_0xe5e5b1(0x18f)];console[_0xe5e5b1(0x1b0)]('✔\x20Found\x20'+_0x2dc053[_0xe5e5b1(0x18f)]+_0xe5e5b1(0x1b5)+(_0x2dc053[_0xe5e5b1(0x18f)]!==0x1?'s':'')+',\x20'+_0x5156dd[_0xe5e5b1(0x18f)]+_0xe5e5b1(0x19f)+(_0x5156dd[_0xe5e5b1(0x18f)]!==0x1?'s':'')+_0xe5e5b1(0x1a3)+_0xa60dc8[_0xe5e5b1(0x18f)]+_0xe5e5b1(0x1af)+(_0xa60dc8[_0xe5e5b1(0x18f)]!==0x1?'s':''));const _0x907f5a=_0x1e0589=>{const _0x2d7140=_0xe5e5b1;return getConsoleNextUrl(_0x1ce41a[_0x2d7140(0x199)],'/app/ps/'+_0x393032['parentId']+_0x2d7140(0x19e)+_0x1e0589);},_0x4637b7=_0x150fe6=>{const _0x5a9d2f=_0xe5e5b1;return getConsoleNextUrl(_0x1ce41a['site'],_0x5a9d2f(0x1c8)+_0x393032[_0x5a9d2f(0x1a2)]+_0x5a9d2f(0x19e)+_0x150fe6+'/j/da');},_0x5b3ad8=_0x1ce41a[_0xe5e5b1(0x1ae)]===_0xe5e5b1(0x1a7)||_0x1ce41a[_0xe5e5b1(0x1ae)]===_0xe5e5b1(0x1c1);if(_0x5b3ad8){const _0x5d8540=[..._0x2dc053[_0xe5e5b1(0x19c)](_0x58b628=>({..._0x58b628,'type':_0xe5e5b1(0x1c4)})),..._0x5156dd[_0xe5e5b1(0x19c)](_0x8adffa=>({..._0x8adffa,'type':'segment','url':_0x907f5a(_0x8adffa['id'])})),..._0xa60dc8['map'](_0x5380e0=>({..._0x5380e0,'name':_0x5380e0[_0xe5e5b1(0x1b9)],'type':'journey','url':_0x4637b7(_0x5380e0['id'])}))][_0xe5e5b1(0x1a4)]((_0x4ede4f,_0x11eece)=>_0x4ede4f['name'][_0xe5e5b1(0x1c5)](_0x11eece[_0xe5e5b1(0x18d)]));await handleSDKOutput(_0x5d8540,_0x1ce41a);}else{if(_0x3ee896===0x0)console[_0xe5e5b1(0x1a9)](a43_0x4c6926[_0xe5e5b1(0x194)]('['+_0x2bc9ef+']')),console[_0xe5e5b1(0x1a9)]('(empty)');else{console[_0xe5e5b1(0x1a9)](a43_0x4c6926[_0xe5e5b1(0x194)]('['+_0x2bc9ef+']'));const _0x44b0d5=formatFlatList(_0x2dc053,_0x5156dd,{'showMetadata':!![],'getSegmentUrl':_0x907f5a,'getJourneyUrl':_0x4637b7},_0xa60dc8);console['log'](_0x44b0d5);}}return 0x0;}async[a43_0x277fe(0x1cb)](_0x4e4698,_0x1b93fe){const _0x191120=a43_0x277fe,{options:_0x6590fa,tdx:_0x51e08a}=_0x4e4698,_0x27c780=await withSpinner('Resolving\x20path\x20\x27'+_0x1b93fe+'\x27...',()=>_0x51e08a['segment']['resolvePathToResource'](_0x1b93fe),{'verbose':_0x6590fa[_0x191120(0x1ba)]}),_0x2dc905=_0x27c780[_0x191120(0x1b8)];_0x6590fa[_0x191120(0x1ba)]&&(console[_0x191120(0x1b0)](_0x191120(0x1a0)+_0x2dc905[_0x191120(0x1a2)]),_0x2dc905['folderId']&&console[_0x191120(0x1b0)](_0x191120(0x1d2)+_0x2dc905[_0x191120(0x1a8)]));const _0x1e16c9=_0x6590fa[_0x191120(0x1b3)]||0xa,_0x397f46=await withSpinner(_0x191120(0x198),()=>_0x51e08a[_0x191120(0x1ab)]['listRecursive'](_0x2dc905[_0x191120(0x1a2)],_0x2dc905[_0x191120(0x1a8)],0x0,_0x1e16c9),{'verbose':_0x6590fa[_0x191120(0x1ba)]}),_0x10af38=_0x397f46[_0x191120(0x1b8)],_0x2685ba=_0x1d8a4f=>{const _0x28eaca=_0x191120;let _0x134c11=0x0,_0x190c30=0x0,_0x31e1f0=0x0;for(const _0x4efd37 of _0x1d8a4f){if(_0x4efd37[_0x28eaca(0x195)]===_0x28eaca(0x1c4))_0x134c11++;else{if(_0x4efd37[_0x28eaca(0x195)]===_0x28eaca(0x1ab))_0x190c30++;else{if(_0x4efd37['type']===_0x28eaca(0x1b6))_0x31e1f0++;}}if(_0x4efd37['children']){const _0xb525bf=_0x2685ba(_0x4efd37[_0x28eaca(0x1aa)]);_0x134c11+=_0xb525bf['folders'],_0x190c30+=_0xb525bf['segments'],_0x31e1f0+=_0xb525bf[_0x28eaca(0x1c7)];}}return{'folders':_0x134c11,'segments':_0x190c30,'journeys':_0x31e1f0};},_0x1f4d72=_0x2685ba(_0x10af38);console[_0x191120(0x1b0)]('✔\x20Built\x20tree\x20with\x20'+_0x1f4d72['folders']+'\x20folder'+(_0x1f4d72[_0x191120(0x190)]!==0x1?'s':'')+',\x20'+_0x1f4d72['segments']+_0x191120(0x19f)+(_0x1f4d72[_0x191120(0x1ca)]!==0x1?'s':'')+_0x191120(0x1a3)+_0x1f4d72['journeys']+_0x191120(0x1af)+(_0x1f4d72['journeys']!==0x1?'s':''));const _0x59e530=_0x404d87=>{const _0x3eadeb=_0x191120;return getConsoleNextUrl(_0x6590fa['site'],_0x3eadeb(0x1c8)+_0x2dc905['parentId']+_0x3eadeb(0x19e)+_0x404d87);},_0x2113e6=_0x4dbffb=>{const _0x2b34cd=_0x191120;return getConsoleNextUrl(_0x6590fa[_0x2b34cd(0x199)],_0x2b34cd(0x1c8)+_0x2dc905[_0x2b34cd(0x1a2)]+_0x2b34cd(0x19e)+_0x4dbffb+_0x2b34cd(0x1bb));};if(_0x6590fa['format']===_0x191120(0x1a7)||_0x6590fa[_0x191120(0x1ae)]===_0x191120(0x1c1))await handleSDKOutput(_0x10af38,_0x6590fa);else{console['log'](a43_0x4c6926[_0x191120(0x194)]('['+_0x1b93fe+']'));const _0x5b81f1=formatTree(_0x10af38,{'showMetadata':!![],'getSegmentUrl':_0x59e530,'getJourneyUrl':_0x2113e6});console[_0x191120(0x1a9)](_0x5b81f1);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x28f596=a44_0x506b;(function(_0x46be31,_0x367404){const _0x39c58e=a44_0x506b,_0x1a851f=_0x46be31();while(!![]){try{const _0x5def2f=parseInt(_0x39c58e(0xdc))/0x1*(parseInt(_0x39c58e(0xdb))/0x2)+parseInt(_0x39c58e(0xee))/0x3*(parseInt(_0x39c58e(0xd4))/0x4)+parseInt(_0x39c58e(0xe0))/0x5*(-parseInt(_0x39c58e(0xeb))/0x6)+-parseInt(_0x39c58e(0xde))/0x7+-parseInt(_0x39c58e(0xe6))/0x8+parseInt(_0x39c58e(0xd3))/0x9+parseInt(_0x39c58e(0xf4))/0xa;if(_0x5def2f===_0x367404)break;else _0x1a851f['push'](_0x1a851f['shift']());}catch(_0x3d1842){_0x1a851f['push'](_0x1a851f['shift']());}}}(a44_0x4aba,0x1e621));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x506b(_0x303c43,_0x441a73){_0x303c43=_0x303c43-0xd2;const _0x4aba34=a44_0x4aba();let _0x506b43=_0x4aba34[_0x303c43];return _0x506b43;}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a44_0x4aba(){const _0x1c8226=['2WJYNor','11573PRByGg','Usage:\x20tdx\x20show\x20<database.table>','1165654HdxwZl','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','20OcokVA','Error:\x20','catalog','showTable','Limit:\x20','validate','1091376ekORbD','site','limit','verbose','cause','282516wvINDN','table','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','297woeoAq','Show\x20table\x20contents','Database:\x20','✔\x20Retrieved\x20','\x20row','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','2132790geLftj','Table:\x20','Site:\x20','execute','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','1956042fCcfcz','7012nCwCZn','database','args','Catalog:\x20','message','error','length'];a44_0x4aba=function(){return _0x1c8226;};return a44_0x4aba();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']='show';['description']=a44_0x28f596(0xef);async[a44_0x28f596(0xf7)](_0x292348){const _0xadd1df=a44_0x28f596;return this[_0xadd1df(0xe3)](_0x292348);}async[a44_0x28f596(0xe3)](_0x16cab8){const _0x7d9f99=a44_0x28f596,{options:_0xbb53c3,args:_0x54557e,tdx:_0x20273c}=_0x16cab8;let _0x40d205;try{_0x40d205=parseTableReference(_0x54557e[0x0]);const _0x156b2f=_0xbb53c3[_0x7d9f99(0xd5)];!_0x40d205['database']&&_0x156b2f&&(_0x40d205[_0x7d9f99(0xd5)]=_0x156b2f);const _0x23a33e=validateTableDescribeReference(_0x40d205);if(_0x23a33e)return console['error'](_0x7d9f99(0xe1)+_0x23a33e),console['error'](_0x7d9f99(0xdd)),console['error'](_0x7d9f99(0xd2)),console[_0x7d9f99(0xd9)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x1327e5){return console[_0x7d9f99(0xd9)](_0x7d9f99(0xe1)+_0x1327e5[_0x7d9f99(0xd8)]),console[_0x7d9f99(0xd9)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x7d9f99(0xd9)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x7d9f99(0xd9)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x22ca6d=_0x40d205[_0x7d9f99(0xe2)],_0x496d10=_0x40d205['database'],_0x4c1624=_0x40d205[_0x7d9f99(0xec)],_0x3a1b6b=resolveLimit(_0xbb53c3[_0x7d9f99(0xe8)],DEFAULT_DISPLAY_LIMIT);try{_0xbb53c3[_0x7d9f99(0xe9)]&&(console[_0x7d9f99(0xd9)](_0x7d9f99(0xf6)+_0xbb53c3[_0x7d9f99(0xe7)]),_0x22ca6d&&console[_0x7d9f99(0xd9)](_0x7d9f99(0xd7)+_0x22ca6d),console[_0x7d9f99(0xd9)](_0x7d9f99(0xf0)+_0x496d10),console[_0x7d9f99(0xd9)](_0x7d9f99(0xf5)+_0x4c1624),console[_0x7d9f99(0xd9)](_0x7d9f99(0xe4)+_0x3a1b6b));const _0x5b0a07=_0x22ca6d?_0x22ca6d+'.'+_0x496d10+'.'+_0x4c1624:_0x496d10+'.'+_0x4c1624,_0x209fe3=await withSpinner('Querying\x20'+_0x5b0a07+'...',()=>_0x20273c['query'][_0x7d9f99(0xe3)](_0x496d10,_0x4c1624,_0x3a1b6b,_0x22ca6d),{'verbose':_0xbb53c3[_0x7d9f99(0xe9)]}),_0x544d71=_0x209fe3['data'],_0x56d642=_0x544d71['data'];return _0x56d642['length']===0x0?console[_0x7d9f99(0xd9)](_0x7d9f99(0xed)):console[_0x7d9f99(0xd9)](_0x7d9f99(0xf1)+_0x56d642['length']+_0x7d9f99(0xf2)+(_0x56d642[_0x7d9f99(0xda)]!==0x1?'s':'')+'\x20from\x20'+_0x5b0a07),await handleSDKOutput(_0x56d642,_0xbb53c3),0x0;}catch(_0x5d0429){if(_0x5d0429 instanceof SDKError)return console[_0x7d9f99(0xd9)]('Error:\x20'+_0x5d0429['message']),_0x5d0429[_0x7d9f99(0xea)]&&console[_0x7d9f99(0xd9)]('\x20\x20Cause:\x20'+_0x5d0429['cause']),0x1;throw _0x5d0429;}}[a44_0x28f596(0xe5)](_0x4f4e9a){const _0x227fb3=a44_0x28f596;if(_0x4f4e9a['args'][_0x227fb3(0xda)]===0x0)return _0x227fb3(0xdf);if(_0x4f4e9a[_0x227fb3(0xd6)][_0x227fb3(0xda)]>0x1)return _0x227fb3(0xf3);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x577111=a45_0x3586;(function(_0x16132b,_0x246417){const _0xa2a22d=a45_0x3586,_0x305d15=_0x16132b();while(!![]){try{const _0x3ae832=parseInt(_0xa2a22d(0x1b4))/0x1*(parseInt(_0xa2a22d(0x1c4))/0x2)+-parseInt(_0xa2a22d(0x1c2))/0x3+-parseInt(_0xa2a22d(0x1b7))/0x4+-parseInt(_0xa2a22d(0x1a5))/0x5+-parseInt(_0xa2a22d(0x1a4))/0x6*(-parseInt(_0xa2a22d(0x1d2))/0x7)+parseInt(_0xa2a22d(0x1cf))/0x8*(-parseInt(_0xa2a22d(0x1bb))/0x9)+parseInt(_0xa2a22d(0x1d0))/0xa;if(_0x3ae832===_0x246417)break;else _0x305d15['push'](_0x305d15['shift']());}catch(_0x242427){_0x305d15['push'](_0x305d15['shift']());}}}(a45_0x1649,0xc7ecf));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a45_0x1649(){const _0x156c11=['description','join','status','profile','N/A','first_name','6RdTsUH','1940605uANRDF','tdx','execute','Account\x20ID:','cli','message','Credential\x20type:\x20','log','Read\x20credential\x20from\x20','✗\x20Validation\x20failed:\x20','CLI\x20flag','filter','dim','displayWithSources','Show\x20authentication\x20status\x20and\x20current\x20context','17hDEHjy','TDX_PROFILE\x20env','User:','2994028YEpywt','✓\x20Authentication\x20successful\x0a','No\x20credential\x20found','jobs','363591JWCArC','Name:','red','last_name','config','cyan','session','2638650sfBlBT','env','79898bpEVcG','\x20profile:\x20','profileSource','yellow','bold','green','getUserInfo','account_id','email','(from\x20','OAuth','16IVNumn','12958670qFtOXn','site','6586097KStMxf'];a45_0x1649=function(){return _0x156c11;};return a45_0x1649();}function a45_0x3586(_0x49e50a,_0x38e4a7){_0x49e50a=_0x49e50a-0x1a1;const _0x1649e4=a45_0x1649();let _0x3586b7=_0x1649e4[_0x49e50a];return _0x3586b7;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a45_0x35ea5c from'chalk';export class StatusCommand extends BaseCommand{['name']=a45_0x577111(0x1d5);[a45_0x577111(0x1d3)]=a45_0x577111(0x1b3);async[a45_0x577111(0x1a7)](_0x1b644c){const _0x197a03=a45_0x577111,{options:_0x352f0e,tdx:_0x5ee5f6}=_0x1b644c,_0x1a3180=_0x352f0e[_0x197a03(0x1d1)],_0x3fdf4a=new GlobalContext(_0x352f0e),_0x48be98=_0x3fdf4a[_0x197a03(0x1a1)],_0xff385a=_0x3fdf4a[_0x197a03(0x1c6)],_0x26ff53=_0xff385a===_0x197a03(0x1a9)?_0x197a03(0x1af):_0xff385a===_0x197a03(0x1c1)?_0x197a03(0x1c1):_0xff385a===_0x197a03(0x1c3)?_0x197a03(0x1b5):_0xff385a===_0x197a03(0x1bf)?_0x197a03(0x1bf):null,_0x152d9c=_0x48be98?a45_0x35ea5c['cyan'](_0x48be98):a45_0x35ea5c[_0x197a03(0x1b1)](_0x197a03(0x1a2)),_0x3c142a=_0x26ff53?'\x20'+a45_0x35ea5c['dim'](_0x197a03(0x1cd)+_0x26ff53+')'):'';console[_0x197a03(0x1ac)](a45_0x35ea5c[_0x197a03(0x1c8)](_0x197a03(0x1a6))+_0x197a03(0x1c5)+_0x152d9c+_0x3c142a+'\x20'+a45_0x35ea5c['dim']('(')+'site:\x20'+a45_0x35ea5c[_0x197a03(0x1c0)](_0x1a3180)+a45_0x35ea5c[_0x197a03(0x1b1)](')'));const _0x78b3bb=await getOAuthTokens(_0x48be98);if(_0x78b3bb)console[_0x197a03(0x1ac)](_0x197a03(0x1ab)+a45_0x35ea5c['cyan'](_0x197a03(0x1ce)));else{const _0x22e50e=await resolveAPIKeyAsync(_0x1a3180,_0x48be98);if(_0x22e50e){const {source:_0x3817a1,isDeprecated:_0x4d6f19}=_0x22e50e,_0x58f9a6=_0x197a03(0x1ad)+a45_0x35ea5c[_0x197a03(0x1c0)](_0x3817a1);console[_0x197a03(0x1ac)](_0x4d6f19?a45_0x35ea5c[_0x197a03(0x1c7)](_0x58f9a6):_0x58f9a6);}else console[_0x197a03(0x1ac)](a45_0x35ea5c['yellow'](_0x197a03(0x1b9)));}let _0x23529c=![];try{const _0xacc1fe=await _0x5ee5f6[_0x197a03(0x1ba)][_0x197a03(0x1ca)]();console[_0x197a03(0x1ac)](a45_0x35ea5c[_0x197a03(0x1c9)](_0x197a03(0x1b8))),console[_0x197a03(0x1ac)](a45_0x35ea5c[_0x197a03(0x1c8)](_0x197a03(0x1b6))+'\x20'+a45_0x35ea5c[_0x197a03(0x1c0)](_0xacc1fe[_0x197a03(0x1cc)]));if(_0xacc1fe['first_name']||_0xacc1fe[_0x197a03(0x1be)]){const _0x3b5735=[_0xacc1fe[_0x197a03(0x1a3)],_0xacc1fe[_0x197a03(0x1be)]][_0x197a03(0x1b0)](Boolean)[_0x197a03(0x1d4)]('\x20');console[_0x197a03(0x1ac)](a45_0x35ea5c[_0x197a03(0x1c8)](_0x197a03(0x1bc))+'\x20'+_0x3b5735);}_0xacc1fe[_0x197a03(0x1cb)]&&console[_0x197a03(0x1ac)](a45_0x35ea5c[_0x197a03(0x1c8)](_0x197a03(0x1a8))+'\x20'+a45_0x35ea5c[_0x197a03(0x1c7)](_0xacc1fe[_0x197a03(0x1cb)])),_0x23529c=!![];}catch(_0x5e3119){_0x5e3119 instanceof HTTPClientError&&_0x5e3119[_0x197a03(0x1d5)]===0x191?printAuthError(_0x5e3119,!![],_0x48be98):console['error'](a45_0x35ea5c[_0x197a03(0x1bd)](_0x197a03(0x1ae)+(_0x5e3119 instanceof Error?_0x5e3119[_0x197a03(0x1aa)]:String(_0x5e3119))));}return console['log'](),_0x3fdf4a[_0x197a03(0x1b2)](),_0x23529c?0x0:0x1;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x3e33ed=a46_0x5a86;(function(_0x264a90,_0x4d7e0d){const _0x4a97e1=a46_0x5a86,_0x51a9ed=_0x264a90();while(!![]){try{const _0x498f88=parseInt(_0x4a97e1(0x203))/0x1*(-parseInt(_0x4a97e1(0x201))/0x2)+-parseInt(_0x4a97e1(0x20e))/0x3+parseInt(_0x4a97e1(0x1f5))/0x4+parseInt(_0x4a97e1(0x212))/0x5+parseInt(_0x4a97e1(0x1f0))/0x6*(-parseInt(_0x4a97e1(0x20f))/0x7)+parseInt(_0x4a97e1(0x211))/0x8*(parseInt(_0x4a97e1(0x1f7))/0x9)+parseInt(_0x4a97e1(0x215))/0xa;if(_0x498f88===_0x4d7e0d)break;else _0x51a9ed['push'](_0x51a9ed['shift']());}catch(_0x34794d){_0x51a9ed['push'](_0x51a9ed['shift']());}}}(a46_0x3382,0x9a11c));function a46_0x3382(){const _0x390afd=['Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','List\x20tables\x20in\x20a\x20database','\x27\x20is\x20ambiguous.','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','message','2197422BJPLhj','7FjlWxG','name','16vpktGt','878670yzAUVb','error','✖\x20No\x20tables\x20found','1370690gtTWdf','query','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Database\x20\x27','site','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Or\x20use\x20--in\x20flag:','Error:\x20','verbose','\x20\x20Cause:\x20','3372114uSGwyB','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','📋\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','3770236LYOSha','limit','5672934vIHcsI','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Table\x20pattern:\x20','Note:\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Database\x20pattern:\x20','description','length','table','log','218XdnMHS','cause','5417zznypQ','database_name','database','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','includes','tables'];a46_0x3382=function(){return _0x390afd;};return a46_0x3382();}function a46_0x5a86(_0x4088d6,_0x3e1e63){_0x4088d6=_0x4088d6-0x1ee;const _0x3382a6=a46_0x3382();let _0x5a86d2=_0x3382a6[_0x4088d6];return _0x5a86d2;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a46_0x3e33ed(0x210)]=a46_0x3e33ed(0x208);[a46_0x3e33ed(0x1fd)]=a46_0x3e33ed(0x20a);async['execute'](_0x35433a){const _0x4509b5=a46_0x3e33ed,{options:_0x1c0966,args:_0x264aa2,tdx:_0x9ab10b}=_0x35433a;let _0x138e3b;if(_0x264aa2[_0x4509b5(0x1fe)]===0x0)_0x138e3b={'database':undefined,'table':undefined,'original':''};else{if(_0x264aa2[_0x4509b5(0x1fe)]===0x1)try{_0x138e3b=parseTableReference(_0x264aa2[0x0]);if(_0x138e3b[_0x4509b5(0x1ff)]&&!_0x138e3b[_0x4509b5(0x205)]&&!_0x138e3b[_0x4509b5(0x1ff)][_0x4509b5(0x207)]('*')&&!_0x138e3b[_0x4509b5(0x1ff)][_0x4509b5(0x207)]('?'))return console[_0x4509b5(0x213)]('Error:\x20Pattern\x20\x27'+_0x264aa2[0x0]+_0x4509b5(0x20b)),console[_0x4509b5(0x213)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x138e3b[_0x4509b5(0x1ff)]+'\x27?'),console[_0x4509b5(0x213)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x138e3b[_0x4509b5(0x1ff)]+'.*\x22'),console['error'](_0x4509b5(0x20c)+_0x138e3b[_0x4509b5(0x1ff)]),console['error'](_0x4509b5(0x1fb)+_0x138e3b['table']),console[_0x4509b5(0x213)](''),console['error'](_0x4509b5(0x1fa)+_0x264aa2[0x0]+_0x4509b5(0x21a)+_0x138e3b[_0x4509b5(0x1ff)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x42a430){return console['error']('Error:\x20'+_0x42a430['message']),0x1;}else return console[_0x4509b5(0x213)](_0x4509b5(0x209)),console[_0x4509b5(0x213)](_0x4509b5(0x1f3)),console[_0x4509b5(0x213)](_0x4509b5(0x1f4)),console['error'](_0x4509b5(0x1f1)),console['error'](_0x4509b5(0x206)),console[_0x4509b5(0x213)](_0x4509b5(0x21b)),console[_0x4509b5(0x213)](_0x4509b5(0x1f8)),0x1;}const _0x49d241=_0x1c0966[_0x4509b5(0x205)];!_0x138e3b[_0x4509b5(0x205)]&&_0x49d241&&(_0x138e3b[_0x4509b5(0x205)]=_0x49d241);try{const _0x3dfb81=_0x43767b=>_0x43767b&&(_0x43767b[_0x4509b5(0x207)]('*')||_0x43767b[_0x4509b5(0x207)]('?')),_0x2d6c9c=_0x3dfb81(_0x138e3b[_0x4509b5(0x205)]);_0x1c0966[_0x4509b5(0x1ee)]&&(console[_0x4509b5(0x213)]('Site:\x20'+_0x1c0966[_0x4509b5(0x219)]),_0x138e3b[_0x4509b5(0x205)]?_0x2d6c9c?console[_0x4509b5(0x213)](_0x4509b5(0x1fc)+_0x138e3b[_0x4509b5(0x205)]):console['error']('Database:\x20'+_0x138e3b['database']):console[_0x4509b5(0x213)]('Database:\x20all'),_0x138e3b[_0x4509b5(0x1ff)]&&console[_0x4509b5(0x213)](_0x4509b5(0x1f9)+_0x138e3b[_0x4509b5(0x1ff)]));const _0x40ebf2=_0x138e3b[_0x4509b5(0x205)]&&!_0x2d6c9c?_0x138e3b['database']:undefined,_0x7c401e=_0x2d6c9c?_0x138e3b['database']:undefined,_0x50db75=_0x138e3b['table'],_0x2a1949=resolveLimit(_0x1c0966[_0x4509b5(0x1f6)],DEFAULT_LISTING_LIMIT),_0x15c33a=await withSpinner('Listing\x20tables...',()=>_0x9ab10b[_0x4509b5(0x216)]['listTables'](_0x40ebf2,_0x50db75,_0x7c401e,_0x2a1949),{'verbose':_0x1c0966['verbose']}),_0x3235a7=_0x15c33a['data'];if(_0x3235a7[_0x4509b5(0x1fe)]===0x0&&_0x138e3b[_0x4509b5(0x205)]&&!_0x2d6c9c)return console[_0x4509b5(0x213)](_0x4509b5(0x214)),console[_0x4509b5(0x213)](_0x4509b5(0x218)+_0x138e3b[_0x4509b5(0x205)]+_0x4509b5(0x217)),0x1;console['error']('✔\x20Found\x20'+_0x3235a7[_0x4509b5(0x1fe)]+'\x20table'+(_0x3235a7[_0x4509b5(0x1fe)]!==0x1?'s':''));if(isStructuredFormat(_0x1c0966))await handleSDKOutput(_0x3235a7,{..._0x1c0966,'limit':_0x2a1949});else for(const _0x353848 of _0x3235a7){const _0x24591b=_0x353848[_0x4509b5(0x204)]?_0x353848['database_name']+'.':'';console[_0x4509b5(0x200)](_0x4509b5(0x1f2)+_0x24591b+_0x353848['table_name']);}return 0x0;}catch(_0x489d0c){if(_0x489d0c instanceof SDKError)return console[_0x4509b5(0x213)](_0x4509b5(0x21c)+_0x489d0c[_0x4509b5(0x20d)]),_0x489d0c[_0x4509b5(0x202)]&&console[_0x4509b5(0x213)](_0x4509b5(0x1ef)+_0x489d0c[_0x4509b5(0x202)]),0x1;throw _0x489d0c;}}['validate'](_0x419cbd){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x4f8715=a47_0x23ec;(function(_0x401bcb,_0xd77ab1){const _0x4da4ad=a47_0x23ec,_0x33a414=_0x401bcb();while(!![]){try{const _0x1e3bad=parseInt(_0x4da4ad(0xc3))/0x1*(parseInt(_0x4da4ad(0xc4))/0x2)+parseInt(_0x4da4ad(0xb2))/0x3+parseInt(_0x4da4ad(0xb4))/0x4*(parseInt(_0x4da4ad(0xb0))/0x5)+-parseInt(_0x4da4ad(0xce))/0x6*(parseInt(_0x4da4ad(0xad))/0x7)+parseInt(_0x4da4ad(0xd2))/0x8*(parseInt(_0x4da4ad(0xd0))/0x9)+parseInt(_0x4da4ad(0xae))/0xa+-parseInt(_0x4da4ad(0xc9))/0xb*(parseInt(_0x4da4ad(0xba))/0xc);if(_0x1e3bad===_0xd77ab1)break;else _0x33a414['push'](_0x33a414['shift']());}catch(_0x3e5626){_0x33a414['push'](_0x33a414['shift']());}}}(a47_0x4b8a,0x7d15c));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';function a47_0x23ec(_0xde1d31,_0x4503d8){_0xde1d31=_0xde1d31-0xa9;const _0x4b8ab3=a47_0x4b8a();let _0x23ec87=_0x4b8ab3[_0xde1d31];return _0x23ec87;}import{getConfigDir}from'../core/config.js';import a47_0x351809 from'chalk';import*as a47_0x55d37c from'node:path';function a47_0x4b8a(){const _0x84a747=['database','default','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','(session:\x20','1XemxVt','362430zpzBDV','agent','profile','error','llm_project','19778eJMzAM','\x0aUpdated:\x20','session','engage_workspace','llm_agent','54iImYtm','Invalid\x20resource:\x20','2803077WGiwxg','log','24CukRpJ','green','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','tdx.json','.\x20Must\x20be\x20one\x20of:\x20','site','256228fMZtdU','2451550kqAced','description','6350jymLDa','Default\x20profile\x20','2044689UXMoFh','name','132caXarh','Session\x20','join','Usage:\x20tdx\x20unset\x20<resource>\x0a','cleared','Error:\x20','8292psdweY','dim','unset','message'];a47_0x4b8a=function(){return _0x84a747;};return a47_0x4b8a();}export class UnsetCommand extends BaseCommand{[a47_0x4f8715(0xb3)]=a47_0x4f8715(0xbc);[a47_0x4f8715(0xaf)]='Clear\x20session-level\x20or\x20default\x20context\x20values';['validate'](_0x5f0a98){const _0x3cba00=a47_0x4f8715,{args:_0x1a9e5d,options:_0x4c62b0}=_0x5f0a98,_0x663464=_0x4c62b0[_0x3cba00(0xbf)];if(_0x1a9e5d['length']===0x0)return _0x3cba00(0xb7)+_0x3cba00(0xc1)+_0x3cba00(0xa9)+'\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options';const _0x15575d=_0x1a9e5d[0x0],_0x21c0e8=[_0x3cba00(0xac),_0x3cba00(0xbe),_0x3cba00(0xc0),_0x3cba00(0xc8),_0x3cba00(0xc5),_0x3cba00(0xc6),_0x3cba00(0xcc)];if(!_0x21c0e8['includes'](_0x15575d))return _0x3cba00(0xcf)+_0x15575d+_0x3cba00(0xab)+_0x21c0e8['join'](',\x20');if(_0x663464&&_0x15575d!==_0x3cba00(0xac)&&_0x15575d!==_0x3cba00(0xc6))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';return undefined;}async['execute'](_0x4b9a57){const _0x259087=a47_0x4f8715,{args:_0x157f5d,options:_0x35c854}=_0x4b9a57,_0xb29372=_0x35c854[_0x259087(0xbf)];cleanExpiredSessions();try{const _0x39ff38=_0x157f5d[0x0],_0x4767b4=a47_0x55d37c[_0x259087(0xb6)](getConfigDir(),_0x259087(0xaa));if(_0xb29372){if(_0x39ff38==='site')return clearDefaultSiteFromUserConfig(),console[_0x259087(0xd1)]('Default\x20site\x20'+a47_0x351809[_0x259087(0xd3)](_0x259087(0xb8))),console['log'](a47_0x351809[_0x259087(0xbb)](_0x259087(0xca)+_0x4767b4)),0x0;if(_0x39ff38===_0x259087(0xc6))return clearActiveProfileFromUserConfig(),console[_0x259087(0xd1)](_0x259087(0xb1)+a47_0x351809[_0x259087(0xd3)](_0x259087(0xb8))),console[_0x259087(0xd1)](a47_0x351809[_0x259087(0xbb)](_0x259087(0xca)+_0x4767b4)),0x0;}const _0x4f5d3d=getSessionID(_0x35c854[_0x259087(0xcb)]),_0x462c1c={'site':_0x259087(0xac),'database':'database','parent_segment':_0x259087(0xc0),'llm_project':_0x259087(0xc8),'agent':_0x259087(0xcd),'profile':'profile','engage_workspace':_0x259087(0xcc)},_0x566947=_0x462c1c[_0x39ff38];return _0x566947&&(clearSessionContextField(_0x566947,_0x35c854['session']),console[_0x259087(0xd1)](_0x259087(0xb5)+_0x39ff38+'\x20'+a47_0x351809['green'](_0x259087(0xb8))+'\x20'+a47_0x351809[_0x259087(0xbb)](_0x259087(0xc2)+_0x4f5d3d+')'))),0x0;}catch(_0xc8e40){return _0xc8e40 instanceof Error&&console[_0x259087(0xc7)](_0x259087(0xb9)+_0xc8e40[_0x259087(0xbd)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a48_0x185090=a48_0x2670;(function(_0x4d7474,_0x4192e3){const _0x61d0ee=a48_0x2670,_0x2d364d=_0x4d7474();while(!![]){try{const _0x380ee7=parseInt(_0x61d0ee(0xf3))/0x1+parseInt(_0x61d0ee(0xdd))/0x2+-parseInt(_0x61d0ee(0x10a))/0x3*(-parseInt(_0x61d0ee(0xf5))/0x4)+-parseInt(_0x61d0ee(0x10b))/0x5*(parseInt(_0x61d0ee(0x107))/0x6)+-parseInt(_0x61d0ee(0xe3))/0x7+-parseInt(_0x61d0ee(0xfe))/0x8+parseInt(_0x61d0ee(0x102))/0x9*(parseInt(_0x61d0ee(0xdb))/0xa);if(_0x380ee7===_0x4192e3)break;else _0x2d364d['push'](_0x2d364d['shift']());}catch(_0x13c782){_0x2d364d['push'](_0x2d364d['shift']());}}}(a48_0x15a7,0x5d457));import{gt}from'semver';import a48_0x5398f3 from'chalk';function a48_0x15a7(){const _0x38b726=['Running:','name','151141oHefwx','execute','76DRszIM','description','replace','log','message','global','Latest\x20version:','yarn','Upgrade\x20failed\x20(exit\x20code\x20','5705048GTFSrR','red','dryRun','next','9eaGkhO','Would\x20run:','Upgrade\x20is\x20not\x20available\x20for\x20development\x20versions.','Already\x20up\x20to\x20date\x20(','Current\x20version:','480yTDneq','npm','join','78801LomKff','35540qwhPxE','dim','pnpm','toLowerCase','Upgrade\x20tdx\x20to\x20the\x20latest\x20version','9577980VnyECy','Checking\x20','1211582afVjPk','error','cyan','bun','yellow','execPath','3849951CTxxxk','@treasuredata/tdx','add','upgrade','Current\x20version:\x20','Target\x20version:','includes','...','install','.bun/','Successfully\x20upgraded\x20to\x20','argv','green','inherit'];a48_0x15a7=function(){return _0x38b726;};return a48_0x15a7();}function a48_0x2670(_0x31770,_0x41f78d){_0x31770=_0x31770-0xd7;const _0x15a71f=a48_0x15a7();let _0x267088=_0x15a71f[_0x31770];return _0x267088;}import{BaseCommand}from'./command.js';import{getVersion,isDevVersion}from'../core/version.js';import{loadReleaseChannel}from'../core/config.js';import{fetchLatestVersion}from'../utils/version-check.js';import{crossSpawn}from'../utils/process.js';const PACKAGE_NAME=a48_0x185090(0xe4);export function detectPackageManager(){const _0x5b5dad=a48_0x185090,_0x351657=process[_0x5b5dad(0xe2)][_0x5b5dad(0xd9)](),_0x146488=process[_0x5b5dad(0xee)][0x1]??'';if(_0x351657[_0x5b5dad(0xe9)](_0x5b5dad(0xe0))||_0x146488['includes'](_0x5b5dad(0xec)))return _0x5b5dad(0xe0);if(_0x146488['includes']('pnpm'))return _0x5b5dad(0xd8);if(_0x146488[_0x5b5dad(0xe9)](_0x5b5dad(0xfc)))return _0x5b5dad(0xfc);return _0x5b5dad(0x108);}export function buildInstallArgs(_0x3ce3b7,_0x2bffd4){const _0x129b6c=a48_0x185090;switch(_0x3ce3b7){case'yarn':return[_0x129b6c(0xfa),'add',_0x2bffd4];case'pnpm':return[_0x129b6c(0xe5),'-g',_0x2bffd4];default:return[_0x129b6c(0xeb),'-g',_0x2bffd4];}}export class UpgradeCommand extends BaseCommand{[a48_0x185090(0xf2)]=a48_0x185090(0xe6);[a48_0x185090(0xf6)]=a48_0x185090(0xda);async[a48_0x185090(0xf4)](_0x27f631){const _0x1313c8=a48_0x185090,{options:_0x4444a6,args:_0x3efcf7}=_0x27f631,_0x558435=!!_0x4444a6[_0x1313c8(0x100)],{next:_0xcee788,method:_0x966a4}=_0x4444a6,_0x124e12=_0xcee788?'next':loadReleaseChannel(),_0x339669=_0x124e12===_0x1313c8(0x101)?'next':'latest',_0x1650db=_0x3efcf7[0x0]?String(_0x3efcf7[0x0])[_0x1313c8(0xf7)](/^v/,''):undefined,_0x2a8e3f=getVersion();if(isDevVersion())return console['error'](a48_0x5398f3[_0x1313c8(0xe1)](_0x1313c8(0x104))),console[_0x1313c8(0xde)](a48_0x5398f3[_0x1313c8(0xd7)](_0x1313c8(0xe7)+_0x2a8e3f)),0x1;let _0xa64276;if(_0x1650db)_0xa64276=_0x1650db,console[_0x1313c8(0xf8)](a48_0x5398f3[_0x1313c8(0xd7)]('Current\x20version:')+'\x20'+_0x2a8e3f),console[_0x1313c8(0xf8)](a48_0x5398f3[_0x1313c8(0xd7)](_0x1313c8(0xe8))+'\x20\x20'+a48_0x5398f3[_0x1313c8(0xef)](_0x1650db)),console[_0x1313c8(0xf8)]();else{console[_0x1313c8(0xf8)](a48_0x5398f3['dim'](_0x1313c8(0xdc)+PACKAGE_NAME+'@'+_0x339669+_0x1313c8(0xea)));try{_0xa64276=await fetchLatestVersion(_0x124e12);}catch(_0x1760cd){return console[_0x1313c8(0xde)](a48_0x5398f3['red']('Failed\x20to\x20check\x20for\x20updates:\x20'+(_0x1760cd instanceof Error?_0x1760cd[_0x1313c8(0xf9)]:String(_0x1760cd)))),0x1;}if(!gt(_0xa64276,_0x2a8e3f))return console[_0x1313c8(0xf8)](a48_0x5398f3['green'](_0x1313c8(0x105)+_0x2a8e3f+').')),0x0;console[_0x1313c8(0xf8)](a48_0x5398f3[_0x1313c8(0xd7)](_0x1313c8(0x106))+'\x20'+_0x2a8e3f),console[_0x1313c8(0xf8)](a48_0x5398f3[_0x1313c8(0xd7)](_0x1313c8(0xfb))+'\x20\x20'+a48_0x5398f3['green'](_0xa64276)),console['log']();}const _0x238993=_0x966a4??detectPackageManager(),_0x3aa3e1=_0x1650db?PACKAGE_NAME+'@'+_0x1650db:PACKAGE_NAME+'@'+_0x339669,_0x5e35bf=buildInstallArgs(_0x238993,_0x3aa3e1);if(_0x558435)return console[_0x1313c8(0xf8)](a48_0x5398f3[_0x1313c8(0xd7)](_0x1313c8(0x103))),console['log']('\x20\x20'+a48_0x5398f3[_0x1313c8(0xdf)](_0x238993+'\x20'+_0x5e35bf['join']('\x20'))),0x0;return console[_0x1313c8(0xf8)](a48_0x5398f3[_0x1313c8(0xd7)](_0x1313c8(0xf1))+'\x20'+_0x238993+'\x20'+_0x5e35bf[_0x1313c8(0x109)]('\x20')),console[_0x1313c8(0xf8)](),new Promise(_0x3907b6=>{const _0x278ca8=_0x1313c8,_0x5da791=crossSpawn(_0x238993,_0x5e35bf,{'stdio':_0x278ca8(0xf0)});_0x5da791['on']('close',_0x530c78=>{const _0x1e1cfb=_0x278ca8;console[_0x1e1cfb(0xf8)](),_0x530c78===0x0?console[_0x1e1cfb(0xf8)](a48_0x5398f3[_0x1e1cfb(0xef)](_0x1e1cfb(0xed)+_0x3aa3e1)):console[_0x1e1cfb(0xde)](a48_0x5398f3[_0x1e1cfb(0xff)](_0x1e1cfb(0xfd)+_0x530c78+').')),_0x3907b6(_0x530c78??0x1);}),_0x5da791['on'](_0x278ca8(0xde),_0x3cfd5c=>{const _0x3b4aed=_0x278ca8;console['error'](a48_0x5398f3['red']('Failed\x20to\x20run\x20'+_0x238993+':\x20'+_0x3cfd5c[_0x3b4aed(0xf9)])),_0x3907b6(0x1);});});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a49_0x598412=a49_0x324d;(function(_0x13b57d,_0x46eaef){const _0x35049d=a49_0x324d,_0x1b3dda=_0x13b57d();while(!![]){try{const _0x474819=-parseInt(_0x35049d(0xd5))/0x1*(-parseInt(_0x35049d(0xed))/0x2)+-parseInt(_0x35049d(0x111))/0x3+parseInt(_0x35049d(0x10e))/0x4+-parseInt(_0x35049d(0x10b))/0x5*(parseInt(_0x35049d(0xd9))/0x6)+-parseInt(_0x35049d(0xfa))/0x7+-parseInt(_0x35049d(0xff))/0x8+parseInt(_0x35049d(0xd4))/0x9*(parseInt(_0x35049d(0x10c))/0xa);if(_0x474819===_0x46eaef)break;else _0x1b3dda['push'](_0x1b3dda['shift']());}catch(_0x1bda23){_0x1b3dda['push'](_0x1b3dda['shift']());}}}(a49_0x3665,0x9b051));import{BaseCommand}from'./command.js';function a49_0x324d(_0x2294c4,_0x35223e){_0x2294c4=_0x2294c4-0xc6;const _0x36656e=a49_0x3665();let _0x324d83=_0x36656e[_0x2294c4];return _0x324d83;}function a49_0x3665(){const _0x1cdf91=['Error:\x20','9805000gBgxki','\x27...','log','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','database','\x27\x20to\x20save\x20permanently','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','engage_workspace','Session\x20parent_segment\x20set\x20to:\x20','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','\x0aSaved\x20to:\x20','5462965AJATnA','490LUuqMJ','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','703884xriRmU','site','(session:\x20','49014ljLkLB','displayWithSources','NOT_FOUND','parent_segment','code','Invalid\x20resource:\x20','Session\x20llm_project\x20set\x20to:\x20','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','Session\x20context\x20','llm_project','stable','\x27\x20does\x20not\x20exist','Session\x20profile\x20set\x20to:\x20','agent','session','373131CbBEWE','122Tjjcuo','default','release_channel','debug','6QpSWVU','Set\x20session-level\x20context','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','profile','llm_agent','use','dim','next','Session\x20database\x20set\x20to:\x20','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Default\x20site\x20set\x20to:\x20','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','length','Error:\x20Profile\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','tdx.json','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','.\x20Must\x20be\x20one\x20of:\x20','13474HiKtGd','display','INVALID_ARGUMENT','join','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','resolveWorkspaceId','Session\x20engage_workspace\x20set\x20to:\x20','green','includes','name','Default\x20profile\x20set\x20to:\x20','Session\x20agent\x20set\x20to:\x20','419013dWbspS','error','clear','message'];a49_0x3665=function(){return _0x1cdf91;};return a49_0x3665();}import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a49_0x35af8a from'chalk';import*as a49_0x4916f7 from'node:path';export class UseCommand extends BaseCommand{[a49_0x598412(0xf7)]=a49_0x598412(0xe0);['description']=a49_0x598412(0xda);['validate'](_0x49b126){const _0x3924d2=a49_0x598412,{args:_0x1553bf,options:_0x2796fd}=_0x49b126,_0x4ea255=_0x2796fd[_0x3924d2(0xd6)];if(_0x1553bf[_0x3924d2(0xe7)]===0x0)return undefined;if(_0x1553bf[_0x3924d2(0xe7)]===0x1)return _0x3924d2(0xe4)+_0x3924d2(0xe9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x3924d2(0xdd)+_0x3924d2(0xf2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a'+_0x3924d2(0xf1)+_0x3924d2(0xeb);const _0x31ec91=_0x1553bf[0x0],_0x32a7de=[_0x3924d2(0x10f),_0x3924d2(0x103),_0x3924d2(0xc8),_0x3924d2(0xce),_0x3924d2(0xd2),_0x3924d2(0xde),_0x3924d2(0x107),'release_channel'];if(!_0x32a7de[_0x3924d2(0xf6)](_0x31ec91))return _0x3924d2(0xca)+_0x31ec91+_0x3924d2(0xec)+_0x32a7de[_0x3924d2(0xf0)](',\x20');if(_0x4ea255&&_0x31ec91!==_0x3924d2(0x10f)&&_0x31ec91!=='profile'&&_0x31ec91!==_0x3924d2(0xd7))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';if(_0x31ec91===_0x3924d2(0xd7)&&!_0x4ea255)return _0x3924d2(0x109);if(_0x31ec91===_0x3924d2(0xd7)){const _0x6f93ac=_0x1553bf[0x1];if(_0x6f93ac!==_0x3924d2(0xcf)&&_0x6f93ac!==_0x3924d2(0xe2))return'Invalid\x20release\x20channel:\x20'+_0x6f93ac+'.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.';}return undefined;}async[a49_0x598412(0xdc)](_0x50d38b){const _0x2f1084=a49_0x598412,{args:_0x13007f,options:_0x10806c}=_0x50d38b,_0x4491f4=_0x10806c[_0x2f1084(0xd8)],_0x53bb3f=_0x10806c[_0x2f1084(0xfc)],_0x267afa=_0x10806c['default'];cleanExpiredSessions();try{if(_0x53bb3f){clearSessionContext(_0x10806c[_0x2f1084(0xd3)]);const _0x19a597=getSessionID(_0x10806c[_0x2f1084(0xd3)]);return console[_0x2f1084(0x101)](_0x2f1084(0xcd)+a49_0x35af8a['green']('cleared')+'\x20'+a49_0x35af8a['dim'](_0x2f1084(0x110)+_0x19a597+')')),0x0;}if(_0x13007f['length']===0x0){const _0x5704e6=new GlobalContext(_0x10806c);return _0x4491f4?_0x5704e6[_0x2f1084(0xc6)]():_0x5704e6[_0x2f1084(0xee)](),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0xdb))),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0xcc))),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)]('Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently')),0x0;}const _0x4fc5cb=_0x13007f[0x0],_0x1422b5=_0x13007f[0x1],_0x6159cc=a49_0x4916f7['join'](getConfigDir(),_0x2f1084(0xea));if(_0x267afa){if(_0x4fc5cb===_0x2f1084(0x10f))return saveDefaultSiteToUserConfig(_0x1422b5),console[_0x2f1084(0x101)](_0x2f1084(0xe5)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)),console['log'](a49_0x35af8a['dim'](_0x2f1084(0x10a)+_0x6159cc)),0x0;if(_0x4fc5cb===_0x2f1084(0xde)){if(!profileExists(_0x1422b5))return console[_0x2f1084(0xfb)]('Error:\x20Profile\x20\x27'+_0x1422b5+_0x2f1084(0xd0)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;return saveActiveProfileToUserConfig(_0x1422b5),console[_0x2f1084(0x101)](_0x2f1084(0xf8)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x10a)+_0x6159cc)),0x0;}if(_0x4fc5cb===_0x2f1084(0xd7))return saveReleaseChannel(_0x1422b5),console[_0x2f1084(0x101)]('Release\x20channel\x20set\x20to:\x20'+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)),console['log'](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x10a)+_0x6159cc)),_0x1422b5===_0x2f1084(0xe2)?(console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)]('\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.')),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)]('Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next'))):console['log'](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x106))),0x0;}if(_0x4fc5cb===_0x2f1084(0x10f)){const _0xab433b=getSessionID(_0x10806c['session']);return saveSessionContext({'site':_0x1422b5},_0x10806c[_0x2f1084(0xd3)]),console['log']('Session\x20site\x20set\x20to:\x20'+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xab433b+')')),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x102)+_0x1422b5+_0x2f1084(0x104))),0x0;}if(_0x4fc5cb===_0x2f1084(0xde)){if(!profileExists(_0x1422b5))return console[_0x2f1084(0xfb)](_0x2f1084(0xe8)+_0x1422b5+'\x27\x20does\x20not\x20exist'),console[_0x2f1084(0xfb)](_0x2f1084(0x10d)),0x1;const _0x239495=getSessionID(_0x10806c['session']);return saveSessionContext({'profile':_0x1422b5},_0x10806c[_0x2f1084(0xd3)]),console[_0x2f1084(0x101)](_0x2f1084(0xd1)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)]('(session:\x20'+_0x239495+')')),console['log'](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x105)+_0x1422b5+_0x2f1084(0x104))),0x0;}const _0x4ac7f2={},_0xe64c7=getSessionID(_0x10806c[_0x2f1084(0xd3)]);switch(_0x4fc5cb){case _0x2f1084(0x103):_0x4ac7f2['database']=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0xe3)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xe64c7+')'));break;case _0x2f1084(0xc8):_0x4ac7f2[_0x2f1084(0xc8)]=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0x108)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a['dim'](_0x2f1084(0x110)+_0xe64c7+')'));break;case _0x2f1084(0xce):_0x4ac7f2[_0x2f1084(0xce)]=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0xcb)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xe64c7+')'));break;case _0x2f1084(0xd2):{const {projectName:_0x2454ef,agentName:_0x1cee89}=parseAgentRef(_0x1422b5);_0x1cee89?(_0x4ac7f2[_0x2f1084(0xce)]=_0x2454ef,_0x4ac7f2[_0x2f1084(0xdf)]=_0x1cee89,console[_0x2f1084(0x101)](_0x2f1084(0xcb)+a49_0x35af8a['green'](_0x2454ef)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xe64c7+')')),console[_0x2f1084(0x101)](_0x2f1084(0xf9)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1cee89)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)]('(session:\x20'+_0xe64c7+')'))):(_0x4ac7f2[_0x2f1084(0xdf)]=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0xf9)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xe64c7+')')));break;}case _0x2f1084(0x107):{try{await withSpinner('Verifying\x20workspace\x20\x27'+_0x1422b5+_0x2f1084(0x100),()=>_0x50d38b['tdx']['engage'][_0x2f1084(0xf3)](_0x1422b5));}catch(_0x18d812){if(_0x18d812 instanceof SDKError&&(_0x18d812[_0x2f1084(0xc9)]===ErrorCode[_0x2f1084(0xc7)]||_0x18d812[_0x2f1084(0xc9)]===ErrorCode[_0x2f1084(0xef)]))return console[_0x2f1084(0xfb)](_0x2f1084(0xfe)+_0x18d812[_0x2f1084(0xfd)]),console[_0x2f1084(0xfb)](_0x2f1084(0xe6)),0x1;throw _0x18d812;}_0x4ac7f2[_0x2f1084(0x107)]=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0xf4)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)]('(session:\x20'+_0xe64c7+')'));break;}}return saveSessionContext(_0x4ac7f2,_0x10806c['session']),console['log'](a49_0x35af8a[_0x2f1084(0xe1)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x200ad4){return _0x200ad4 instanceof Error&&console[_0x2f1084(0xfb)](_0x2f1084(0xfe)+_0x200ad4[_0x2f1084(0xfd)]),0x1;}}}
|
|
1
|
+
const a49_0x487367=a49_0x14d0;(function(_0x434ecc,_0x46fbd9){const _0x56fd3d=a49_0x14d0,_0x1a6683=_0x434ecc();while(!![]){try{const _0x57db8b=parseInt(_0x56fd3d(0x143))/0x1+parseInt(_0x56fd3d(0x148))/0x2*(parseInt(_0x56fd3d(0x180))/0x3)+parseInt(_0x56fd3d(0x171))/0x4*(parseInt(_0x56fd3d(0x175))/0x5)+-parseInt(_0x56fd3d(0x174))/0x6*(-parseInt(_0x56fd3d(0x181))/0x7)+parseInt(_0x56fd3d(0x156))/0x8+parseInt(_0x56fd3d(0x17b))/0x9+-parseInt(_0x56fd3d(0x178))/0xa;if(_0x57db8b===_0x46fbd9)break;else _0x1a6683['push'](_0x1a6683['shift']());}catch(_0xedffd2){_0x1a6683['push'](_0x1a6683['shift']());}}}(a49_0x2b51,0x6f782));import{BaseCommand}from'./command.js';import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a49_0x2b51(){const _0x6a56de=['\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','code','Error:\x20','\x0aSaved\x20to:\x20','Session\x20agent\x20set\x20to:\x20','1809716wGvDBG','clear','includes','1212rSSYJW','5PqmmmE','release_channel','resolveWorkspaceId','22501790LoToza','Invalid\x20resource:\x20','Session\x20profile\x20set\x20to:\x20','2264310pbOjIn','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','llm_agent','Default\x20profile\x20set\x20to:\x20','session','24gKqisx','25669gVGILA','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Session\x20context\x20','database','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','stable','Session\x20site\x20set\x20to:\x20','use','site','Session\x20parent_segment\x20set\x20to:\x20','engage_workspace','.\x20Must\x20be\x20one\x20of:\x20','log','join','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','debug','Default\x20site\x20set\x20to:\x20','(session:\x20','298388UfPxpH','profile','parent_segment','next','Error:\x20Profile\x20\x27','78968iwpGCn','\x27\x20to\x20save\x20permanently','dim','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','Session\x20database\x20set\x20to:\x20','Release\x20channel\x20set\x20to:\x20','tdx','NOT_FOUND','tdx.json','Invalid\x20release\x20channel:\x20','Session\x20engage_workspace\x20set\x20to:\x20','cleared','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','5181952WmtBWQ','display','llm_project','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','message','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','agent','green','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','Verifying\x20workspace\x20\x27','displayWithSources','length','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Session\x20llm_project\x20set\x20to:\x20','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x27\x20does\x20not\x20exist'];a49_0x2b51=function(){return _0x6a56de;};return a49_0x2b51();}import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a49_0x14d0(_0x1c03a1,_0x1f87c3){_0x1c03a1=_0x1c03a1-0x133;const _0x2b5190=a49_0x2b51();let _0x14d00b=_0x2b5190[_0x1c03a1];return _0x14d00b;}import a49_0x4f6dec from'chalk';import*as a49_0x343fbd from'node:path';export class UseCommand extends BaseCommand{['name']=a49_0x487367(0x138);['description']='Set\x20session-level\x20context';['validate'](_0xe0e6e5){const _0x51dfb8=a49_0x487367,{args:_0x35877f,options:_0x5ebcc2}=_0xe0e6e5,_0x2fed93=_0x5ebcc2['default'];if(_0x35877f['length']===0x0)return undefined;if(_0x35877f[_0x51dfb8(0x163)]===0x1)return _0x51dfb8(0x164)+_0x51dfb8(0x167)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a'+_0x51dfb8(0x14c)+_0x51dfb8(0x15a)+_0x51dfb8(0x135)+_0x51dfb8(0x155);const _0x1151f6=_0x35877f[0x0],_0x126087=[_0x51dfb8(0x139),'database',_0x51dfb8(0x145),_0x51dfb8(0x158),'agent',_0x51dfb8(0x144),_0x51dfb8(0x13b),_0x51dfb8(0x176)];if(!_0x126087[_0x51dfb8(0x173)](_0x1151f6))return _0x51dfb8(0x179)+_0x1151f6+_0x51dfb8(0x13c)+_0x126087[_0x51dfb8(0x13e)](',\x20');if(_0x2fed93&&_0x1151f6!==_0x51dfb8(0x139)&&_0x1151f6!==_0x51dfb8(0x144)&&_0x1151f6!==_0x51dfb8(0x176))return _0x51dfb8(0x168);if(_0x1151f6===_0x51dfb8(0x176)&&!_0x2fed93)return'release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>';if(_0x1151f6===_0x51dfb8(0x176)){const _0x9a9030=_0x35877f[0x1];if(_0x9a9030!==_0x51dfb8(0x136)&&_0x9a9030!==_0x51dfb8(0x146))return _0x51dfb8(0x152)+_0x9a9030+'.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.';}return undefined;}async[a49_0x487367(0x159)](_0x3d476a){const _0x494288=a49_0x487367,{args:_0x1962ab,options:_0x3135ad}=_0x3d476a,_0x1b0cf3=_0x3135ad[_0x494288(0x140)],_0x16db3c=_0x3135ad[_0x494288(0x172)],_0x3f9e71=_0x3135ad['default'];cleanExpiredSessions();try{if(_0x16db3c){clearSessionContext(_0x3135ad[_0x494288(0x17f)]);const _0x28175c=getSessionID(_0x3135ad[_0x494288(0x17f)]);return console[_0x494288(0x13d)](_0x494288(0x133)+a49_0x4f6dec[_0x494288(0x15e)](_0x494288(0x154))+'\x20'+a49_0x4f6dec[_0x494288(0x14a)]('(session:\x20'+_0x28175c+')')),0x0;}if(_0x1962ab[_0x494288(0x163)]===0x0){const _0x17e131=new GlobalContext(_0x3135ad);return _0x1b0cf3?_0x17e131[_0x494288(0x162)]():_0x17e131[_0x494288(0x157)](),console[_0x494288(0x13d)](a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x166))),console[_0x494288(0x13d)](a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x13f))),console[_0x494288(0x13d)](a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x16c))),0x0;}const _0x4eb2ed=_0x1962ab[0x0],_0x2ec8c7=_0x1962ab[0x1],_0x56ec78=a49_0x343fbd[_0x494288(0x13e)](getConfigDir(),_0x494288(0x151));if(_0x3f9e71){if(_0x4eb2ed==='site')return saveDefaultSiteToUserConfig(_0x2ec8c7),console[_0x494288(0x13d)](_0x494288(0x141)+a49_0x4f6dec['green'](_0x2ec8c7)),console[_0x494288(0x13d)](a49_0x4f6dec[_0x494288(0x14a)]('\x0aSaved\x20to:\x20'+_0x56ec78)),0x0;if(_0x4eb2ed==='profile'){if(!profileExists(_0x2ec8c7))return console[_0x494288(0x14b)]('Error:\x20Profile\x20\x27'+_0x2ec8c7+_0x494288(0x169)),console[_0x494288(0x14b)](_0x494288(0x182)),0x1;return saveActiveProfileToUserConfig(_0x2ec8c7),console[_0x494288(0x13d)](_0x494288(0x17e)+a49_0x4f6dec['green'](_0x2ec8c7)),console[_0x494288(0x13d)](a49_0x4f6dec['dim']('\x0aSaved\x20to:\x20'+_0x56ec78)),0x0;}if(_0x4eb2ed===_0x494288(0x176))return saveReleaseChannel(_0x2ec8c7),console[_0x494288(0x13d)](_0x494288(0x14e)+a49_0x4f6dec[_0x494288(0x15e)](_0x2ec8c7)),console[_0x494288(0x13d)](a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x16f)+_0x56ec78)),_0x2ec8c7===_0x494288(0x146)?(console[_0x494288(0x13d)](a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x17c))),console['log'](a49_0x4f6dec['dim'](_0x494288(0x160)))):console[_0x494288(0x13d)](a49_0x4f6dec['dim'](_0x494288(0x16b))),0x0;}if(_0x4eb2ed===_0x494288(0x139)){const _0x4c0030=getSessionID(_0x3135ad[_0x494288(0x17f)]);return saveSessionContext({'site':_0x2ec8c7},_0x3135ad[_0x494288(0x17f)]),console[_0x494288(0x13d)](_0x494288(0x137)+a49_0x4f6dec[_0x494288(0x15e)](_0x2ec8c7)+'\x20'+a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x142)+_0x4c0030+')')),console[_0x494288(0x13d)](a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x16a)+_0x2ec8c7+'\x27\x20to\x20save\x20permanently')),0x0;}if(_0x4eb2ed===_0x494288(0x144)){if(!profileExists(_0x2ec8c7))return console['error'](_0x494288(0x147)+_0x2ec8c7+_0x494288(0x169)),console[_0x494288(0x14b)](_0x494288(0x182)),0x1;const _0xe82080=getSessionID(_0x3135ad[_0x494288(0x17f)]);return saveSessionContext({'profile':_0x2ec8c7},_0x3135ad['session']),console[_0x494288(0x13d)](_0x494288(0x17a)+a49_0x4f6dec['green'](_0x2ec8c7)+'\x20'+a49_0x4f6dec['dim'](_0x494288(0x142)+_0xe82080+')')),console[_0x494288(0x13d)](a49_0x4f6dec[_0x494288(0x14a)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20'+_0x2ec8c7+_0x494288(0x149))),0x0;}const _0x4006ca={},_0x53bbbe=getSessionID(_0x3135ad[_0x494288(0x17f)]);switch(_0x4eb2ed){case _0x494288(0x134):_0x4006ca[_0x494288(0x134)]=_0x2ec8c7,console[_0x494288(0x13d)](_0x494288(0x14d)+a49_0x4f6dec[_0x494288(0x15e)](_0x2ec8c7)+'\x20'+a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x142)+_0x53bbbe+')'));break;case'parent_segment':_0x4006ca[_0x494288(0x145)]=_0x2ec8c7,console[_0x494288(0x13d)](_0x494288(0x13a)+a49_0x4f6dec[_0x494288(0x15e)](_0x2ec8c7)+'\x20'+a49_0x4f6dec[_0x494288(0x14a)]('(session:\x20'+_0x53bbbe+')'));break;case _0x494288(0x158):_0x4006ca[_0x494288(0x158)]=_0x2ec8c7,console['log'](_0x494288(0x165)+a49_0x4f6dec['green'](_0x2ec8c7)+'\x20'+a49_0x4f6dec[_0x494288(0x14a)]('(session:\x20'+_0x53bbbe+')'));break;case _0x494288(0x15d):{const {projectName:_0x49604a,agentName:_0x48626f}=parseAgentRef(_0x2ec8c7);_0x48626f?(_0x4006ca[_0x494288(0x158)]=_0x49604a,_0x4006ca['llm_agent']=_0x48626f,console[_0x494288(0x13d)](_0x494288(0x165)+a49_0x4f6dec[_0x494288(0x15e)](_0x49604a)+'\x20'+a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x142)+_0x53bbbe+')')),console[_0x494288(0x13d)](_0x494288(0x170)+a49_0x4f6dec[_0x494288(0x15e)](_0x48626f)+'\x20'+a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x142)+_0x53bbbe+')'))):(_0x4006ca[_0x494288(0x17d)]=_0x2ec8c7,console[_0x494288(0x13d)](_0x494288(0x170)+a49_0x4f6dec[_0x494288(0x15e)](_0x2ec8c7)+'\x20'+a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x142)+_0x53bbbe+')')));break;}case _0x494288(0x13b):{try{await withSpinner(_0x494288(0x161)+_0x2ec8c7+'\x27...',()=>_0x3d476a[_0x494288(0x14f)]['engage'][_0x494288(0x177)](_0x2ec8c7));}catch(_0x37db26){if(_0x37db26 instanceof SDKError&&(_0x37db26[_0x494288(0x16d)]===ErrorCode[_0x494288(0x150)]||_0x37db26['code']===ErrorCode['INVALID_ARGUMENT']))return console[_0x494288(0x14b)]('Error:\x20'+_0x37db26[_0x494288(0x15b)]),console[_0x494288(0x14b)](_0x494288(0x15c)),0x1;throw _0x37db26;}_0x4006ca['engage_workspace']=_0x2ec8c7,console[_0x494288(0x13d)](_0x494288(0x153)+a49_0x4f6dec[_0x494288(0x15e)](_0x2ec8c7)+'\x20'+a49_0x4f6dec['dim'](_0x494288(0x142)+_0x53bbbe+')'));break;}}return saveSessionContext(_0x4006ca,_0x3135ad[_0x494288(0x17f)]),console['log'](a49_0x4f6dec[_0x494288(0x14a)](_0x494288(0x15f))),0x0;}catch(_0x16a960){return _0x16a960 instanceof Error&&console[_0x494288(0x14b)](_0x494288(0x16e)+_0x16a960[_0x494288(0x15b)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x195b2c=a50_0x38e6;(function(_0x3106c7,_0x43454e){const _0x2cee75=a50_0x38e6,_0x93e652=_0x3106c7();while(!![]){try{const _0x5537a7=-parseInt(_0x2cee75(0xdd))/0x1*(parseInt(_0x2cee75(0xf3))/0x2)+parseInt(_0x2cee75(0xf2))/0x3*(parseInt(_0x2cee75(0xf1))/0x4)+-parseInt(_0x2cee75(0xe2))/0x5+-parseInt(_0x2cee75(0xdf))/0x6*(parseInt(_0x2cee75(0xf0))/0x7)+-parseInt(_0x2cee75(0xe6))/0x8+-parseInt(_0x2cee75(0xd9))/0x9*(parseInt(_0x2cee75(0xf4))/0xa)+parseInt(_0x2cee75(0xec))/0xb*(parseInt(_0x2cee75(0xd8))/0xc);if(_0x5537a7===_0x43454e)break;else _0x93e652['push'](_0x93e652['shift']());}catch(_0x505d53){_0x93e652['push'](_0x93e652['shift']());}}}(a50_0xaeb4,0xf2fab));import{BaseCommand}from'./command.js';function a50_0xaeb4(){const _0x19fbfc=['10GVCgiG','user\x20list','message','execute','dim','Error:\x20','verbose','Fetching\x20user\x20info...','description','Show\x20current\x20user\x20information','\x20\x20Cause:\x20','data','account_owner','48HOuJlZ','12335094sEdUFn','length','administrator','user','325fBvhmB','log','11653416pfUMdb','\x20user','error','6336565XYeeBY','sort','getCurrent','✔\x20Found\x20','1979488sLsWbi','localeCompare','cause','name','email','\x20(owner)','13223463sDbnXg','yellow','List\x20all\x20users\x20in\x20the\x20account','list','7DLnCeJ','4tchMms','3113961EwMOpu','146cbWCvz'];a50_0xaeb4=function(){return _0x19fbfc;};return a50_0xaeb4();}function a50_0x38e6(_0x4f6eb8,_0x7a5319){_0x4f6eb8=_0x4f6eb8-0xd5;const _0xaeb426=a50_0xaeb4();let _0x38e637=_0xaeb426[_0x4f6eb8];return _0x38e637;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a50_0x57a996 from'chalk';export class UserCommand extends BaseCommand{['name']=a50_0x195b2c(0xdc);[a50_0x195b2c(0xfc)]=a50_0x195b2c(0xfd);async[a50_0x195b2c(0xf7)](_0x2245f3){const _0x275046=a50_0x195b2c,{options:_0x42f5d0,tdx:_0x225a06}=_0x2245f3;try{const _0x29e41a=await withSpinner(_0x275046(0xfb),()=>_0x225a06['user'][_0x275046(0xe4)](),{'verbose':_0x42f5d0[_0x275046(0xfa)]}),_0xc5ff=_0x29e41a[_0x275046(0xd6)];return await handleSingleObjectOutput(_0xc5ff,_0x42f5d0),0x0;}catch(_0x4ed20b){if(_0x4ed20b instanceof SDKError)return console[_0x275046(0xe1)](_0x275046(0xf9)+_0x4ed20b[_0x275046(0xf6)]),_0x4ed20b[_0x275046(0xe8)]&&console['error'](_0x275046(0xd5)+_0x4ed20b[_0x275046(0xe8)]),0x1;throw _0x4ed20b;}}}export class UserListCommand extends BaseCommand{['name']=a50_0x195b2c(0xf5);[a50_0x195b2c(0xfc)]=a50_0x195b2c(0xee);async['execute'](_0x3fee00){const _0x345e99=a50_0x195b2c,{options:_0x234432,tdx:_0x2652dc}=_0x3fee00;try{const _0x2ac763=await withSpinner('Listing\x20users...',()=>_0x2652dc[_0x345e99(0xdc)][_0x345e99(0xef)](),{'verbose':_0x234432[_0x345e99(0xfa)]}),_0x509b0a=_0x2ac763[_0x345e99(0xd6)];console['error'](_0x345e99(0xe5)+_0x509b0a[_0x345e99(0xda)]+_0x345e99(0xe0)+(_0x509b0a['length']!==0x1?'s':''));if(isStructuredFormat(_0x234432))await handleSDKOutput(_0x509b0a,_0x234432);else{const _0x8a25a5=[..._0x509b0a][_0x345e99(0xe3)]((_0x3b1b74,_0x4ee8af)=>String(_0x3b1b74[_0x345e99(0xe9)]??'')[_0x345e99(0xe7)](String(_0x4ee8af[_0x345e99(0xe9)]??'')));for(const _0x594b74 of _0x8a25a5){const _0x296830=_0x594b74[_0x345e99(0xd7)]?a50_0x57a996[_0x345e99(0xed)](_0x345e99(0xeb)):_0x594b74[_0x345e99(0xdb)]?a50_0x57a996[_0x345e99(0xed)]('\x20(admin)'):'',_0x24fae3=_0x594b74[_0x345e99(0xea)]&&_0x594b74['email']!==_0x594b74['name']?a50_0x57a996[_0x345e99(0xf8)]('\x20<'+_0x594b74[_0x345e99(0xea)]+'>'):'';console[_0x345e99(0xde)]('👤\x20'+(_0x594b74[_0x345e99(0xe9)]??'Unknown')+_0x24fae3+_0x296830);}}return 0x0;}catch(_0x535e21){if(_0x535e21 instanceof SDKError)return console[_0x345e99(0xe1)](_0x345e99(0xf9)+_0x535e21[_0x345e99(0xf6)]),_0x535e21['cause']&&console[_0x345e99(0xe1)]('\x20\x20Cause:\x20'+_0x535e21[_0x345e99(0xe8)]),0x1;throw _0x535e21;}}}
|