@treasuredata/tdx 2026.3.16 → 2026.3.18
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_0x46391e=a40_0x57d8;(function(_0x3896f2,_0x38d97e){const _0x212010=a40_0x57d8,_0x5f928d=_0x3896f2();while(!![]){try{const _0x572664=parseInt(_0x212010(0x1d6))/0x1*(-parseInt(_0x212010(0x1dd))/0x2)+parseInt(_0x212010(0x1e1))/0x3*(parseInt(_0x212010(0x1da))/0x4)+parseInt(_0x212010(0x1db))/0x5*(-parseInt(_0x212010(0x1dc))/0x6)+parseInt(_0x212010(0x1c1))/0x7+-parseInt(_0x212010(0x1c9))/0x8*(-parseInt(_0x212010(0x1c7))/0x9)+parseInt(_0x212010(0x1ca))/0xa+parseInt(_0x212010(0x1ea))/0xb;if(_0x572664===_0x38d97e)break;else _0x5f928d['push'](_0x5f928d['shift']());}catch(_0x8c7ab4){_0x5f928d['push'](_0x5f928d['shift']());}}}(a40_0x59c8,0xe6b2e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a40_0x59c8(){const _0xb0944e=['⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','resolveFolderId','segmentPath','Parent\x20ID:\x20','type','Resolving\x20folder\x20\x27','segmentName','kind','error','239762kWxkzm','data','name','Updating\x20segment\x20\x27','116MwTyFT','116780EaJepM','84uoEKtz','14LcOfSB','\x20\x20\x20Path:\x20','verbose','includes','89253YfFvvQ','Error:\x20Cannot\x20update\x20','description','resolvePathToResource','segment','\x27...','Update\x20existing\x20child\x20segment','execute','ruleFile','6628039GXGesV','updateSegmentById','INTERNAL','Resolved\x20folder\x20ID:\x20','Examples:','932183AjkfSB','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segment:update','segmentId','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20path\x20\x27','7810002FKrCxQ','yellow','8AtrOaU','4839850OoCJao','folder','parentId'];a40_0x59c8=function(){return _0xb0944e;};return a40_0x59c8();}import{withSpinner}from'../utils/spinner.js';function a40_0x57d8(_0x4f3082,_0x50124c){_0x4f3082=_0x4f3082-0x1be;const _0x59c870=a40_0x59c8();let _0x57d82b=_0x59c870[_0x4f3082];return _0x57d82b;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a40_0x37fef1 from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a40_0x46391e(0x1c3);[a40_0x46391e(0x1e3)]=a40_0x46391e(0x1e7);async[a40_0x46391e(0x1e8)](_0x45ab68){const _0x5865b5=a40_0x46391e;console[_0x5865b5(0x1d5)](a40_0x37fef1['yellow'](_0x5865b5(0x1cd))),console[_0x5865b5(0x1d5)](a40_0x37fef1[_0x5865b5(0x1c8)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0xcb662e,args:_0x2cd09b,tdx:_0x5f433f}=_0x45ab68,_0x3a8e2d=_0xcb662e;if(_0x2cd09b['length']===0x0)return console[_0x5865b5(0x1d5)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x5865b5(0x1d5)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console['error'](_0x5865b5(0x1c0)),console[_0x5865b5(0x1d5)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x4e6eda=_0x2cd09b[0x0],_0x4a98c4=_0xcb662e[_0x5865b5(0x1cf)];let _0x7e5582=_0x4e6eda;_0x4a98c4&&!_0x4e6eda[_0x5865b5(0x1e0)]('/')&&(_0x7e5582=_0x4a98c4+'/'+_0x4e6eda,_0x3a8e2d['verbose']&&console[_0x5865b5(0x1d5)](_0x5865b5(0x1c5)+_0x7e5582));const _0x43ebe0=await withSpinner(_0x5865b5(0x1c6)+_0x7e5582+_0x5865b5(0x1e6),()=>_0x5f433f[_0x5865b5(0x1e5)][_0x5865b5(0x1e4)](_0x7e5582),{'verbose':_0x3a8e2d[_0x5865b5(0x1df)]}),_0x3c4792=_0x43ebe0[_0x5865b5(0x1d7)];_0x3a8e2d[_0x5865b5(0x1df)]&&console['error']('Resolved\x20type:\x20'+_0x3c4792[_0x5865b5(0x1d1)]);if(_0x3c4792[_0x5865b5(0x1d1)]!==_0x5865b5(0x1e5))return console['error'](_0x5865b5(0x1e2)+_0x3c4792[_0x5865b5(0x1d1)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x5865b5(0x1d5)](_0x5865b5(0x1c2)),0x1;if(!_0x3c4792[_0x5865b5(0x1c4)])throw new SDKError(ErrorCode[_0x5865b5(0x1be)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1a77b9=_0x3c4792[_0x5865b5(0x1cc)],_0x27a88e=_0x3c4792[_0x5865b5(0x1c4)];_0x3a8e2d[_0x5865b5(0x1df)]&&(console['error'](_0x5865b5(0x1d0)+_0x1a77b9),console[_0x5865b5(0x1d5)]('Segment\x20ID:\x20'+_0x27a88e));let _0x21d14f;if(_0x3a8e2d['folder']){const _0x266c99=_0x3a8e2d[_0x5865b5(0x1cb)],_0x33a595=await withSpinner(_0x5865b5(0x1d2)+_0x266c99+_0x5865b5(0x1e6),()=>_0x5f433f['segment'][_0x5865b5(0x1ce)](_0x1a77b9,_0x266c99),{'verbose':_0x3a8e2d[_0x5865b5(0x1df)]});_0x21d14f=parseInt(_0x33a595[_0x5865b5(0x1d7)],0xa),_0x3a8e2d['verbose']&&console['error'](_0x5865b5(0x1bf)+_0x21d14f);}const _0x4bf2f5=await loadJSONFromOptions(_0x3a8e2d['rule'],_0x3a8e2d[_0x5865b5(0x1e9)]),_0x406052={'name':_0x3a8e2d[_0x5865b5(0x1d8)],'description':_0x3a8e2d[_0x5865b5(0x1e3)],'rule':_0x4bf2f5,'kind':_0x3a8e2d[_0x5865b5(0x1d4)]!==undefined?parseInt(_0x3a8e2d[_0x5865b5(0x1d4)],0xa):undefined,'segmentFolderId':_0x21d14f},_0x1e8812=await withSpinner(_0x5865b5(0x1d9)+_0x3c4792[_0x5865b5(0x1d3)]+'\x27...',()=>_0x5f433f[_0x5865b5(0x1e5)][_0x5865b5(0x1eb)](_0x1a77b9,_0x27a88e,_0x406052),{'verbose':_0x3a8e2d[_0x5865b5(0x1df)]}),_0xd6a5d8=_0x1e8812['data'];return console['error']('✔\x20Updated\x20segment\x20\x27'+_0xd6a5d8[_0x5865b5(0x1d8)]+'\x27'),_0x7e5582!==_0x4e6eda&&console['error'](_0x5865b5(0x1de)+_0x7e5582),await handleSDKOutput([_0xd6a5d8],_0x3a8e2d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a41_0xb6de(){const _0x3076e9=['94104UsxCzX','✔\x20Context\x20set\x20to:\x20','Site:\x20','332858TkoUze','verbose','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','2162993wTZxvy','config','20mSMsON','data','Parent\x20ID:\x20','Resolved\x20path\x20type:\x20','join','2bpDJHr','length','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','site','description','2638000iekobU','1021640EQlNWX','isDirectory','green','parentName','parent_segment','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','segment','log','split','folderId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','error','execute','6fmJETy','parentId','cyan','Error:\x20Path\x20is\x20required\x0a','2172RrdsRo','Target\x20path:\x20','19671vDuXpX','segmentPath','52bzzNHb','dim','isAbsolute','24772LMkqfF','Examples:','segment:use','resolvePathToResource','fullPath','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Resolving\x20path\x20\x27','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','type','red','session'];a41_0xb6de=function(){return _0x3076e9;};return a41_0xb6de();}const a41_0x4dd162=a41_0x4d4e;(function(_0x4219a3,_0x418647){const _0x351bf0=a41_0x4d4e,_0x71142c=_0x4219a3();while(!![]){try{const _0x344ac8=parseInt(_0x351bf0(0x144))/0x1*(-parseInt(_0x351bf0(0x14e))/0x2)+-parseInt(_0x351bf0(0x12c))/0x3*(-parseInt(_0x351bf0(0x12e))/0x4)+-parseInt(_0x351bf0(0x154))/0x5*(-parseInt(_0x351bf0(0x126))/0x6)+parseInt(_0x351bf0(0x147))/0x7+parseInt(_0x351bf0(0x153))/0x8+parseInt(_0x351bf0(0x141))/0x9*(parseInt(_0x351bf0(0x149))/0xa)+parseInt(_0x351bf0(0x131))/0xb*(-parseInt(_0x351bf0(0x12a))/0xc);if(_0x344ac8===_0x418647)break;else _0x71142c['push'](_0x71142c['shift']());}catch(_0x3fef8a){_0x71142c['push'](_0x71142c['shift']());}}}(a41_0xb6de,0x32f78));import{existsSync,statSync}from'fs';import a41_0xa9f61d from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a41_0x4d4e(_0x41e05d,_0x46c3b5){_0x41e05d=_0x41e05d-0x122;const _0xb6de0c=a41_0xb6de();let _0x4d4e8c=_0xb6de0c[_0x41e05d];return _0x4d4e8c;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a41_0x4dd162(0x133);[a41_0x4dd162(0x152)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a41_0x4dd162(0x125)](_0x5bd1ad){const _0x325807=a41_0x4dd162,{options:_0x44d347,args:_0x103eae,tdx:_0x4bd9eb}=_0x5bd1ad;if(_0x103eae[_0x325807(0x14f)]===0x0)return console[_0x325807(0x124)](a41_0xa9f61d[_0x325807(0x13f)](_0x325807(0x129))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x325807(0x124)](_0x325807(0x132)),console[_0x325807(0x124)](_0x325807(0x123)),console[_0x325807(0x124)](_0x325807(0x13c)),console[_0x325807(0x124)](_0x325807(0x13d)),console[_0x325807(0x124)](_0x325807(0x136)),0x1;const _0x2c2976=_0x103eae[0x0],_0x2f46e9=_0x44d347[_0x325807(0x140)];try{if(_0x2c2976==='/')return saveSessionContext({'segment_path':undefined},_0x2f46e9),console[_0x325807(0x15b)](a41_0xa9f61d[_0x325807(0x156)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x2c2976)&&statSync(_0x2c2976)[_0x325807(0x155)]()){let _0x1eff8c;try{_0x1eff8c=findTdxConfig(_0x2c2976);}catch{return console[_0x325807(0x124)](a41_0xa9f61d[_0x325807(0x13f)](_0x325807(0x13b)+_0x2c2976)),console[_0x325807(0x124)](a41_0xa9f61d[_0x325807(0x128)](_0x325807(0x138))),0x1;}const _0x400fd2=_0x1eff8c[_0x325807(0x148)][_0x325807(0x158)];return saveSessionContext({'segment_path':_0x400fd2,'parent_segment':_0x400fd2},_0x2f46e9),console[_0x325807(0x15b)](a41_0xa9f61d['green'](_0x325807(0x142)+a41_0xa9f61d['cyan'](_0x400fd2))),0x0;}const _0x5cbefc=_0x44d347[_0x325807(0x12d)];let _0x3eea5e=_0x2c2976;const _0x5c9af0=parsePath(_0x2c2976);if(!_0x5c9af0[_0x325807(0x130)]){if(!_0x5cbefc)return console['error'](a41_0xa9f61d[_0x325807(0x13f)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x325807(0x124)](a41_0xa9f61d[_0x325807(0x128)](_0x325807(0x146))),0x1;if(_0x2c2976==='..'){const _0x57c37c=_0x5cbefc[_0x325807(0x15c)]('/')['slice'](0x0,-0x1)[_0x325807(0x14d)]('/');_0x3eea5e=_0x57c37c||'/';}else _0x2c2976==='.'?_0x3eea5e=_0x5cbefc:_0x3eea5e=_0x5cbefc+'/'+_0x2c2976;_0x44d347['verbose']&&console[_0x325807(0x124)]('Resolved\x20relative\x20path\x20to:\x20'+_0x3eea5e);}if(_0x3eea5e==='/'||_0x3eea5e==='')return saveSessionContext({'segment_path':undefined},_0x2f46e9),console['log'](a41_0xa9f61d['green'](_0x325807(0x139))),0x0;_0x3eea5e=normalizePath(_0x3eea5e);const _0xbfbe8a=parsePath(_0x3eea5e)['segments'];if(_0xbfbe8a[_0x325807(0x14f)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2f46e9),console[_0x325807(0x15b)](a41_0xa9f61d[_0x325807(0x156)](_0x325807(0x139))),0x0;_0x44d347[_0x325807(0x145)]&&(console[_0x325807(0x124)](_0x325807(0x143)+_0x44d347[_0x325807(0x151)]),console[_0x325807(0x124)](_0x325807(0x12b)+_0x3eea5e));const _0x155dc1=await withSpinner(_0x325807(0x137)+_0x3eea5e+'\x27...',()=>_0x4bd9eb[_0x325807(0x15a)][_0x325807(0x134)](_0x3eea5e),{'verbose':_0x44d347[_0x325807(0x145)]}),_0x339a29=_0x155dc1[_0x325807(0x14a)];_0x44d347['verbose']&&(console[_0x325807(0x124)](_0x325807(0x14c)+_0x339a29['type']),console[_0x325807(0x124)](_0x325807(0x14b)+_0x339a29[_0x325807(0x127)]),_0x339a29[_0x325807(0x122)]&&console[_0x325807(0x124)]('Folder\x20ID:\x20'+_0x339a29[_0x325807(0x122)]));if(_0x339a29[_0x325807(0x13e)]===_0x325807(0x15a))return console[_0x325807(0x124)](a41_0xa9f61d[_0x325807(0x13f)](_0x325807(0x159))),console[_0x325807(0x124)](_0x325807(0x13a)),console['error'](a41_0xa9f61d[_0x325807(0x128)]('Use:\x20tdx\x20segment\x20use\x20'+_0x339a29[_0x325807(0x157)]+(_0x339a29['folderPath']?'/'+_0x339a29['folderPath'][_0x325807(0x14d)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x339a29[_0x325807(0x135)],'parent_segment':_0x339a29[_0x325807(0x157)]},_0x2f46e9),console[_0x325807(0x15b)](a41_0xa9f61d[_0x325807(0x156)]('✔\x20Context\x20set\x20to:\x20'+a41_0xa9f61d[_0x325807(0x128)](_0x339a29[_0x325807(0x135)]))),_0x44d347[_0x325807(0x145)]&&(console[_0x325807(0x124)](a41_0xa9f61d[_0x325807(0x12f)](_0x325807(0x150))),console[_0x325807(0x124)](a41_0xa9f61d['dim']('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x13d243){throw _0x13d243;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x822003=a42_0x2bec;(function(_0x3d933d,_0x1556b6){const _0x547d9e=a42_0x2bec,_0x364ae1=_0x3d933d();while(!![]){try{const _0x13dd30=-parseInt(_0x547d9e(0x1c0))/0x1*(-parseInt(_0x547d9e(0x192))/0x2)+parseInt(_0x547d9e(0x194))/0x3+-parseInt(_0x547d9e(0x18e))/0x4+parseInt(_0x547d9e(0x1af))/0x5*(parseInt(_0x547d9e(0x1ae))/0x6)+parseInt(_0x547d9e(0x1a7))/0x7*(-parseInt(_0x547d9e(0x1a4))/0x8)+-parseInt(_0x547d9e(0x19d))/0x9+parseInt(_0x547d9e(0x1bb))/0xa*(-parseInt(_0x547d9e(0x1b2))/0xb);if(_0x13dd30===_0x1556b6)break;else _0x364ae1['push'](_0x364ae1['shift']());}catch(_0x1ed8dc){_0x364ae1['push'](_0x364ae1['shift']());}}}(a42_0x3168,0xc4a75));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_0x4622f8 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a42_0x2bec(_0x34a65e,_0x493763){_0x34a65e=_0x34a65e-0x18b;const _0x31683e=a42_0x3168();let _0x2beca6=_0x31683e[_0x34a65e];return _0x2beca6;}function a42_0x3168(){const _0x5a8fcc=['281968GCkkQR','\x20file(s)\x20with\x20errors,\x20','2777964sburAO','invalidCount','.yaml','warningCount','type','hasErrors','segment:validate','parentSegment','execute','9854019QvINhz','log','\x20warning(s)','name','Validate\x20segment\x20and\x20journey\x20YAML\x20files','dim','validCount','8WhMiPY','errorCode','file','1124921jTnMYt','filePath','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','warnings','message','verbose','✔\x20All\x20','2316naypAW','19115rtvdOf','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','187EcTcza','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','yellow','\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','valid','description','endsWith','Error:\x20Directory\x20not\x20found:\x20','no_parent','789290HgHcvt','helpText','Validation\x20failed:\x20','length','targetDir','10KAEYKd','\x20error(s)','):\x20','\x20warning(s)\x20found','\x20valid','error','1634504ruyrDT','.yml','errors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a42_0x3168=function(){return _0x5a8fcc;};return a42_0x3168();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a42_0x822003(0x1a0)]=a42_0x822003(0x19a);[a42_0x822003(0x1b7)]=a42_0x822003(0x1a1);async[a42_0x822003(0x19c)](_0x274330){const _0x232ef8=a42_0x822003,{options:_0x498853,args:_0xe6fc46}=_0x274330,_0x2157a1=_0x498853,_0x38ee6c=await resolveTarget({'arg':_0xe6fc46[0x0],'contextParent':_0x498853[_0x232ef8(0x19b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x38ee6c))return _0x38ee6c[_0x232ef8(0x1a5)]===_0x232ef8(0x1ba)?(console[_0x232ef8(0x18d)](a42_0x4622f8[_0x232ef8(0x1b4)](_0x232ef8(0x1b1))),console[_0x232ef8(0x18d)](_0x232ef8(0x1b3)),console[_0x232ef8(0x18d)](_0x232ef8(0x1b5)),console[_0x232ef8(0x18d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a42_0x4622f8['red']('Error:\x20'+_0x38ee6c[_0x232ef8(0x1ab)]+'\x0a')),_0x38ee6c[_0x232ef8(0x1bc)]&&console[_0x232ef8(0x18d)](a42_0x4622f8['cyan'](_0x38ee6c[_0x232ef8(0x1bc)]))),0x1;const _0x4c3683=_0x38ee6c[_0x232ef8(0x1bf)],_0x2b95bc=_0x38ee6c[_0x232ef8(0x198)]===_0x232ef8(0x1a6)?_0x38ee6c[_0x232ef8(0x1a8)]:undefined;if(!_0x2b95bc&&!existsSync(_0x4c3683))return console[_0x232ef8(0x18d)](a42_0x4622f8['red'](_0x232ef8(0x1b9)+_0x4c3683+'\x0a')),0x1;let _0x5b3107;if(_0x2b95bc){if(!_0x2b95bc[_0x232ef8(0x1b8)](_0x232ef8(0x18f))&&!_0x2b95bc[_0x232ef8(0x1b8)](_0x232ef8(0x196)))return console[_0x232ef8(0x18d)](a42_0x4622f8['red'](_0x232ef8(0x1a9)+_0x2b95bc+'\x0a')),0x1;_0x5b3107=[_0x2b95bc];}else _0x5b3107=findYamlFiles(_0x4c3683);if(_0x5b3107[_0x232ef8(0x1be)]===0x0)return console['error'](a42_0x4622f8['red'](_0x232ef8(0x191)+_0x4c3683+'\x0a')),0x1;const _0x1b4963=validateYamlFiles(_0x5b3107,_0x4c3683),_0x5291f6=calculateSummary(_0x1b4963);for(const _0x2d29b7 of _0x1b4963){if(!isValidationResult(_0x2d29b7))continue;const {relativePath:_0xf36fa8,source:_0x48fb7a,result:_0x2d510c,fileType:_0x1a422e}=_0x2d29b7,_0x24a939=_0x1a422e;if(_0x2d510c[_0x232ef8(0x1b6)]&&_0x2d510c['warnings'][_0x232ef8(0x1be)]===0x0)_0x2157a1[_0x232ef8(0x1ac)]&&console[_0x232ef8(0x19e)](a42_0x4622f8[_0x232ef8(0x1b0)]('✔\x20'+_0xf36fa8)+a42_0x4622f8['dim']('\x20('+_0x24a939+')'));else _0x2d510c[_0x232ef8(0x1b6)]?(console[_0x232ef8(0x19e)](a42_0x4622f8[_0x232ef8(0x1b4)]('⚠\x20'+_0xf36fa8)+a42_0x4622f8[_0x232ef8(0x1a2)]('\x20('+_0x24a939+_0x232ef8(0x1c2)+_0x2d510c[_0x232ef8(0x1aa)][_0x232ef8(0x1be)]+_0x232ef8(0x19f))),console[_0x232ef8(0x19e)](formatValidationResult(_0x2d510c,_0x48fb7a,_0xf36fa8))):(console['log'](a42_0x4622f8['red']('✖\x20'+_0xf36fa8)+a42_0x4622f8[_0x232ef8(0x1a2)]('\x20('+_0x24a939+_0x232ef8(0x1c2)+_0x2d510c[_0x232ef8(0x190)]['length']+_0x232ef8(0x1c1))),console['log'](formatValidationResult(_0x2d510c,_0x48fb7a,_0xf36fa8)));}return console[_0x232ef8(0x19e)](''),_0x5291f6[_0x232ef8(0x199)]?(console[_0x232ef8(0x19e)](a42_0x4622f8['red'](_0x232ef8(0x1bd)+_0x5291f6[_0x232ef8(0x195)]+_0x232ef8(0x193)+_0x5291f6[_0x232ef8(0x1a3)]+_0x232ef8(0x18c))),_0x5291f6[_0x232ef8(0x197)]>0x0&&console[_0x232ef8(0x19e)](a42_0x4622f8['yellow'](_0x5291f6[_0x232ef8(0x197)]+_0x232ef8(0x18b))),0x1):(console[_0x232ef8(0x19e)](a42_0x4622f8[_0x232ef8(0x1b0)](_0x232ef8(0x1ad)+_0x5291f6['validCount']+'\x20file(s)\x20valid')),_0x5291f6[_0x232ef8(0x197)]>0x0&&console[_0x232ef8(0x19e)](a42_0x4622f8[_0x232ef8(0x1b4)](_0x5291f6[_0x232ef8(0x197)]+_0x232ef8(0x18b))),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_0x226df7=a43_0x1078;(function(_0x1a30bf,_0x2b78ff){const _0xcd7bf1=a43_0x1078,_0x53ac49=_0x1a30bf();while(!![]){try{const _0x5a19be=parseInt(_0xcd7bf1(0x19e))/0x1+parseInt(_0xcd7bf1(0x1b4))/0x2*(-parseInt(_0xcd7bf1(0x1a0))/0x3)+-parseInt(_0xcd7bf1(0x19c))/0x4+-parseInt(_0xcd7bf1(0x17f))/0x5+-parseInt(_0xcd7bf1(0x193))/0x6+-parseInt(_0xcd7bf1(0x1a3))/0x7+parseInt(_0xcd7bf1(0x189))/0x8;if(_0x5a19be===_0x2b78ff)break;else _0x53ac49['push'](_0x53ac49['shift']());}catch(_0x217213){_0x53ac49['push'](_0x53ac49['shift']());}}}(a43_0x5dec,0xca82c));import{BaseCommand}from'./command.js';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_0x5dec(){const _0x469e45=['\x20\x20Cause:\x20','journey','recursive','segment','/e/','cause','execute','test','4868375kJDWDz','listUnifiedWithJourneys','map','Site:\x20','Folder\x20ID:\x20','\x20journey','Recursive\x20mode:\x20enabled','includes','log','Building\x20hierarchy\x20tree...','18833760SQdcJA','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','jsonl','\x27...','/j/da','segments','type','Parent\x20ID:\x20','\x20folder',',\x20and\x20','1691520GdDfiN','\x20matching\x20\x27','(empty)','site','json','error','✔\x20Found\x20','listRecursive','message','1425288VHEGXX','(not\x20set)','1239378LbGWJG','parentId','3JkkmOR','replace','Error:\x20No\x20parent\x20segment\x20context\x20set.','4724678jYaSKi','length','journeyBundleName','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','listWithPattern','listUnified','parentSegment','data','folder','No\x20items\x20match\x20pattern:\x20','\x20segment','Listing\x20folders,\x20segments,\x20and\x20journeys...','Set\x20a\x20parent\x20segment\x20context\x20first:','description','sort','verbose','954486VkLNvL','Resolving\x20path\x20\x27','✔\x20Built\x20tree\x20with\x20','name','resolvePathToResource','dim','journeys','format','Folder/pattern\x20arg:\x20','Resolving\x20parent\x20segment\x20\x27','children','localeCompare','/app/ps/','folders','folderId','filter'];a43_0x5dec=function(){return _0x469e45;};return a43_0x5dec();}function a43_0x1078(_0x2e9cbd,_0x40c9db){_0x2e9cbd=_0x2e9cbd-0x178;const _0x5dec52=a43_0x5dec();let _0x1078ad=_0x5dec52[_0x2e9cbd];return _0x1078ad;}import a43_0x5597db from'chalk';export class SegmentsCommand extends BaseCommand{[a43_0x226df7(0x1b7)]=a43_0x226df7(0x18e);[a43_0x226df7(0x1b1)]='List\x20folders\x20and\x20child\x20segments';async[a43_0x226df7(0x17d)](_0x2889ed){const _0x59b49e=a43_0x226df7,{options:_0x4cd3d5,args:_0x551453}=_0x2889ed,_0x245bb7=_0x4cd3d5[_0x59b49e(0x179)],_0x5dc4b4=_0x551453[0x0];try{const _0x344ad7=_0x4cd3d5[_0x59b49e(0x1aa)];_0x4cd3d5[_0x59b49e(0x1b3)]&&(console[_0x59b49e(0x198)](_0x59b49e(0x182)+_0x4cd3d5['site']),console[_0x59b49e(0x198)]('Parent\x20segment\x20context:\x20'+(_0x344ad7||_0x59b49e(0x19d))),_0x5dc4b4&&console[_0x59b49e(0x198)](_0x59b49e(0x1bc)+_0x5dc4b4),_0x245bb7&&console[_0x59b49e(0x198)](_0x59b49e(0x185)));if(!_0x344ad7)return console['error'](_0x59b49e(0x1a2)),console[_0x59b49e(0x198)](''),console['error'](_0x59b49e(0x1b0)),console['error'](_0x59b49e(0x18a)),console[_0x59b49e(0x198)](_0x59b49e(0x1a7)),console[_0x59b49e(0x198)](''),console[_0x59b49e(0x198)](_0x59b49e(0x1a6)),0x1;const _0x5b992d=_0x5dc4b4&&(_0x5dc4b4[_0x59b49e(0x186)]('*')||_0x5dc4b4[_0x59b49e(0x186)]('?'));if(_0x5b992d)return await this[_0x59b49e(0x1a8)](_0x2889ed,_0x344ad7,_0x5dc4b4);const _0x14b139=_0x5dc4b4?_0x344ad7+'/'+_0x5dc4b4:_0x344ad7;return _0x245bb7?await this[_0x59b49e(0x19a)](_0x2889ed,_0x14b139):await this[_0x59b49e(0x1a9)](_0x2889ed,_0x14b139);}catch(_0x2ece5c){if(_0x2ece5c instanceof SDKError)return console[_0x59b49e(0x198)]('Error:\x20'+_0x2ece5c[_0x59b49e(0x19b)]),_0x2ece5c[_0x59b49e(0x17c)]&&console[_0x59b49e(0x198)](_0x59b49e(0x1c4)+_0x2ece5c[_0x59b49e(0x17c)]),0x1;throw _0x2ece5c;}}async[a43_0x226df7(0x1a8)](_0x162428,_0x4c49dd,_0x7700cc){const _0x3fa696=a43_0x226df7,{options:_0xa1f381,tdx:_0x4f9e80}=_0x162428,_0x1dffed=await withSpinner(_0x3fa696(0x1bd)+_0x4c49dd+'\x27...',()=>_0x4f9e80[_0x3fa696(0x17a)][_0x3fa696(0x1b8)](_0x4c49dd),{'verbose':_0xa1f381[_0x3fa696(0x1b3)]}),_0x177135=_0x1dffed[_0x3fa696(0x1ab)],_0x42b39c=await withSpinner(_0x3fa696(0x1af),()=>_0x4f9e80[_0x3fa696(0x17a)]['listUnifiedWithJourneys'](_0x177135[_0x3fa696(0x19f)],_0x177135[_0x3fa696(0x1c2)]),{'verbose':_0xa1f381[_0x3fa696(0x1b3)]}),{folders:_0x4f219f,segments:_0x476f29,journeys:_0x4b7705}=_0x42b39c['data'],_0x32fdec=_0x7700cc[_0x3fa696(0x1a1)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x3fa696(0x1a1)](/\*/g,'.*')[_0x3fa696(0x1a1)](/\?/g,'.'),_0x51d4d5=new RegExp('^'+_0x32fdec+'$','i'),_0x26f418=_0x4f219f[_0x3fa696(0x1c3)](_0x2f2488=>_0x51d4d5[_0x3fa696(0x17e)](_0x2f2488[_0x3fa696(0x1b7)])),_0x36d864=_0x476f29[_0x3fa696(0x1c3)](_0x1296a9=>_0x51d4d5[_0x3fa696(0x17e)](_0x1296a9[_0x3fa696(0x1b7)])),_0xe3e8=_0x4b7705['filter'](_0x1333d8=>_0x51d4d5[_0x3fa696(0x17e)](_0x1333d8[_0x3fa696(0x1a5)])),_0x37d834=_0x26f418[_0x3fa696(0x1a4)]+_0x36d864[_0x3fa696(0x1a4)]+_0xe3e8[_0x3fa696(0x1a4)];console[_0x3fa696(0x198)](_0x3fa696(0x199)+_0x26f418[_0x3fa696(0x1a4)]+_0x3fa696(0x191)+(_0x26f418[_0x3fa696(0x1a4)]!==0x1?'s':'')+',\x20'+_0x36d864[_0x3fa696(0x1a4)]+'\x20segment'+(_0x36d864[_0x3fa696(0x1a4)]!==0x1?'s':'')+_0x3fa696(0x192)+_0xe3e8[_0x3fa696(0x1a4)]+_0x3fa696(0x184)+(_0xe3e8[_0x3fa696(0x1a4)]!==0x1?'s':'')+_0x3fa696(0x194)+_0x7700cc+'\x27');const _0x2d169b=_0x13c1f1=>{const _0x11a972=_0x3fa696;return getConsoleNextUrl(_0xa1f381['site'],_0x11a972(0x1c0)+_0x177135[_0x11a972(0x19f)]+_0x11a972(0x17b)+_0x13c1f1);},_0x233c2c=_0xa1f381[_0x3fa696(0x1bb)]===_0x3fa696(0x197)||_0xa1f381[_0x3fa696(0x1bb)]==='jsonl';if(_0x233c2c){const _0x103f5d=[..._0x26f418[_0x3fa696(0x181)](_0x2f2b8e=>({..._0x2f2b8e,'type':_0x3fa696(0x1ac)})),..._0x36d864[_0x3fa696(0x181)](_0x40060b=>({..._0x40060b,'type':_0x3fa696(0x17a),'url':_0x2d169b(_0x40060b['id'])})),..._0xe3e8[_0x3fa696(0x181)](_0xa09399=>({..._0xa09399,'name':_0xa09399[_0x3fa696(0x1a5)],'type':_0x3fa696(0x178)}))][_0x3fa696(0x1b2)]((_0x5ca633,_0x64c158)=>_0x5ca633[_0x3fa696(0x1b7)][_0x3fa696(0x1bf)](_0x64c158[_0x3fa696(0x1b7)]));await handleSDKOutput(_0x103f5d,_0xa1f381);}else{if(_0x37d834===0x0)console[_0x3fa696(0x187)](_0x3fa696(0x1ad)+_0x7700cc);else{console[_0x3fa696(0x187)](a43_0x5597db[_0x3fa696(0x1b9)]('['+_0x4c49dd+']\x20matching\x20\x27'+_0x7700cc+'\x27'));const _0xfcb461=formatFlatList(_0x26f418,_0x36d864,{'showMetadata':!![],'getSegmentUrl':_0x2d169b},_0xe3e8);console[_0x3fa696(0x187)](_0xfcb461);}}return 0x0;}async[a43_0x226df7(0x1a9)](_0x3f8268,_0x374bf7){const _0x487155=a43_0x226df7,{options:_0x3e411a,tdx:_0x905d4}=_0x3f8268,_0x3f4804=await withSpinner('Resolving\x20path\x20\x27'+_0x374bf7+_0x487155(0x18c),()=>_0x905d4[_0x487155(0x17a)][_0x487155(0x1b8)](_0x374bf7),{'verbose':_0x3e411a['verbose']}),_0x398fa9=_0x3f4804[_0x487155(0x1ab)];_0x3e411a[_0x487155(0x1b3)]&&(console['error'](_0x487155(0x190)+_0x398fa9[_0x487155(0x19f)]),_0x398fa9['folderId']&&console[_0x487155(0x198)](_0x487155(0x183)+_0x398fa9[_0x487155(0x1c2)]));const _0x3a432b=await withSpinner(_0x487155(0x1af),()=>_0x905d4[_0x487155(0x17a)][_0x487155(0x180)](_0x398fa9[_0x487155(0x19f)],_0x398fa9['folderId']),{'verbose':_0x3e411a['verbose']}),{folders:_0x1bdabe,segments:_0x1caa14,journeys:_0x459391}=_0x3a432b[_0x487155(0x1ab)],_0x456905=_0x1bdabe[_0x487155(0x1a4)]+_0x1caa14[_0x487155(0x1a4)]+_0x459391['length'];console[_0x487155(0x198)](_0x487155(0x199)+_0x1bdabe[_0x487155(0x1a4)]+_0x487155(0x191)+(_0x1bdabe[_0x487155(0x1a4)]!==0x1?'s':'')+',\x20'+_0x1caa14[_0x487155(0x1a4)]+_0x487155(0x1ae)+(_0x1caa14[_0x487155(0x1a4)]!==0x1?'s':'')+_0x487155(0x192)+_0x459391['length']+_0x487155(0x184)+(_0x459391[_0x487155(0x1a4)]!==0x1?'s':''));const _0x486b5c=_0x2ce1c0=>{const _0x15e8f2=_0x487155;return getConsoleNextUrl(_0x3e411a[_0x15e8f2(0x196)],_0x15e8f2(0x1c0)+_0x398fa9['parentId']+_0x15e8f2(0x17b)+_0x2ce1c0);},_0x112253=_0x179242=>{const _0x513bfc=_0x487155;return getConsoleNextUrl(_0x3e411a[_0x513bfc(0x196)],'/app/ps/'+_0x398fa9[_0x513bfc(0x19f)]+_0x513bfc(0x17b)+_0x179242+_0x513bfc(0x18d));},_0x522ed3=_0x3e411a[_0x487155(0x1bb)]===_0x487155(0x197)||_0x3e411a[_0x487155(0x1bb)]===_0x487155(0x18b);if(_0x522ed3){const _0x255736=[..._0x1bdabe['map'](_0x16e2f7=>({..._0x16e2f7,'type':'folder'})),..._0x1caa14[_0x487155(0x181)](_0x207199=>({..._0x207199,'type':_0x487155(0x17a),'url':_0x486b5c(_0x207199['id'])})),..._0x459391[_0x487155(0x181)](_0x4a5c34=>({..._0x4a5c34,'name':_0x4a5c34['journeyBundleName'],'type':'journey','url':_0x112253(_0x4a5c34['id'])}))]['sort']((_0x1ac1e1,_0x1ca54e)=>_0x1ac1e1['name'][_0x487155(0x1bf)](_0x1ca54e[_0x487155(0x1b7)]));await handleSDKOutput(_0x255736,_0x3e411a);}else{if(_0x456905===0x0)console['log'](a43_0x5597db[_0x487155(0x1b9)]('['+_0x374bf7+']')),console[_0x487155(0x187)](_0x487155(0x195));else{console[_0x487155(0x187)](a43_0x5597db[_0x487155(0x1b9)]('['+_0x374bf7+']'));const _0x5f5734=formatFlatList(_0x1bdabe,_0x1caa14,{'showMetadata':!![],'getSegmentUrl':_0x486b5c,'getJourneyUrl':_0x112253},_0x459391);console[_0x487155(0x187)](_0x5f5734);}}return 0x0;}async[a43_0x226df7(0x19a)](_0x2a1399,_0x5d4b54){const _0x502791=a43_0x226df7,{options:_0x3dceb8,tdx:_0x117a0f}=_0x2a1399,_0x2b4060=await withSpinner(_0x502791(0x1b5)+_0x5d4b54+_0x502791(0x18c),()=>_0x117a0f[_0x502791(0x17a)][_0x502791(0x1b8)](_0x5d4b54),{'verbose':_0x3dceb8[_0x502791(0x1b3)]}),_0x24be31=_0x2b4060[_0x502791(0x1ab)];_0x3dceb8[_0x502791(0x1b3)]&&(console['error']('Parent\x20ID:\x20'+_0x24be31['parentId']),_0x24be31['folderId']&&console[_0x502791(0x198)](_0x502791(0x183)+_0x24be31[_0x502791(0x1c2)]));const _0x4a438c=_0x3dceb8['maxDepth']||0xa,_0x4dcfab=await withSpinner(_0x502791(0x188),()=>_0x117a0f['segment'][_0x502791(0x19a)](_0x24be31['parentId'],_0x24be31[_0x502791(0x1c2)],0x0,_0x4a438c),{'verbose':_0x3dceb8['verbose']}),_0x16bf37=_0x4dcfab[_0x502791(0x1ab)],_0x30faa9=_0x18ed83=>{const _0x324d97=_0x502791;let _0x38c577=0x0,_0x1e2f33=0x0,_0x43adff=0x0;for(const _0x49979a of _0x18ed83){if(_0x49979a[_0x324d97(0x18f)]===_0x324d97(0x1ac))_0x38c577++;else{if(_0x49979a['type']==='segment')_0x1e2f33++;else{if(_0x49979a[_0x324d97(0x18f)]===_0x324d97(0x178))_0x43adff++;}}if(_0x49979a[_0x324d97(0x1be)]){const _0x51e376=_0x30faa9(_0x49979a[_0x324d97(0x1be)]);_0x38c577+=_0x51e376[_0x324d97(0x1c1)],_0x1e2f33+=_0x51e376[_0x324d97(0x18e)],_0x43adff+=_0x51e376[_0x324d97(0x1ba)];}}return{'folders':_0x38c577,'segments':_0x1e2f33,'journeys':_0x43adff};},_0x5864fa=_0x30faa9(_0x16bf37);console[_0x502791(0x198)](_0x502791(0x1b6)+_0x5864fa[_0x502791(0x1c1)]+_0x502791(0x191)+(_0x5864fa[_0x502791(0x1c1)]!==0x1?'s':'')+',\x20'+_0x5864fa[_0x502791(0x18e)]+_0x502791(0x1ae)+(_0x5864fa['segments']!==0x1?'s':'')+_0x502791(0x192)+_0x5864fa[_0x502791(0x1ba)]+_0x502791(0x184)+(_0x5864fa['journeys']!==0x1?'s':''));const _0x8d688c=_0x4779a9=>{const _0x5336da=_0x502791;return getConsoleNextUrl(_0x3dceb8[_0x5336da(0x196)],_0x5336da(0x1c0)+_0x24be31[_0x5336da(0x19f)]+'/e/'+_0x4779a9);},_0x47be64=_0x18d655=>{const _0x3507b0=_0x502791;return getConsoleNextUrl(_0x3dceb8[_0x3507b0(0x196)],_0x3507b0(0x1c0)+_0x24be31[_0x3507b0(0x19f)]+_0x3507b0(0x17b)+_0x18d655+'/j/da');};if(_0x3dceb8['format']===_0x502791(0x197)||_0x3dceb8['format']===_0x502791(0x18b))await handleSDKOutput(_0x16bf37,_0x3dceb8);else{console['log'](a43_0x5597db[_0x502791(0x1b9)]('['+_0x5d4b54+']'));const _0x261560=formatTree(_0x16bf37,{'showMetadata':!![],'getSegmentUrl':_0x8d688c,'getJourneyUrl':_0x47be64});console[_0x502791(0x187)](_0x261560);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a44_0x567f(_0xb4a3de,_0x12cd9d){_0xb4a3de=_0xb4a3de-0x9b;const _0x5c852f=a44_0x5c85();let _0x567f24=_0x5c852f[_0xb4a3de];return _0x567f24;}const a44_0x49cca7=a44_0x567f;(function(_0x45d89f,_0x4f69e5){const _0x43aa89=a44_0x567f,_0x1888ce=_0x45d89f();while(!![]){try{const _0x2ca51e=parseInt(_0x43aa89(0xc0))/0x1*(parseInt(_0x43aa89(0xa4))/0x2)+parseInt(_0x43aa89(0xc2))/0x3+parseInt(_0x43aa89(0x9d))/0x4*(parseInt(_0x43aa89(0xbc))/0x5)+parseInt(_0x43aa89(0xb7))/0x6*(-parseInt(_0x43aa89(0xb4))/0x7)+parseInt(_0x43aa89(0xb5))/0x8*(-parseInt(_0x43aa89(0xb9))/0x9)+parseInt(_0x43aa89(0xbd))/0xa*(-parseInt(_0x43aa89(0xbb))/0xb)+parseInt(_0x43aa89(0xaa))/0xc;if(_0x2ca51e===_0x4f69e5)break;else _0x1888ce['push'](_0x1888ce['shift']());}catch(_0x43aadb){_0x1888ce['push'](_0x1888ce['shift']());}}}(a44_0x5c85,0x860bd));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a44_0x5c85(){const _0x560eee=['40gcBCZJ','10mmapzl','Usage:\x20tdx\x20show\x20<database.table>','data','360181gAxDAx','execute','269463tiCBjx','args','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','Limit:\x20','\x20row','Error:\x20','64788ENnIMM','description','limit','database','verbose','catalog','\x20\x20Cause:\x20','2tXtWcs','showTable','Table:\x20','validate','length','\x20from\x20','14158020uwIlcj','✔\x20Retrieved\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Site:\x20','Querying\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','error','cause','Database:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','4095pBbESr','16rbZAfA','name','4302IsdiYA','query','1778418pkpMlj','Show\x20table\x20contents','4352821sAuTpz'];a44_0x5c85=function(){return _0x560eee;};return a44_0x5c85();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a44_0x49cca7(0xb6)]='show';[a44_0x49cca7(0x9e)]=a44_0x49cca7(0xba);async[a44_0x49cca7(0xc1)](_0x3f64ec){const _0x301dac=a44_0x49cca7;return this[_0x301dac(0xa5)](_0x3f64ec);}async[a44_0x49cca7(0xa5)](_0x793f6c){const _0x275331=a44_0x49cca7,{options:_0x23cd22,args:_0xfd59d5,tdx:_0x1d44c3}=_0x793f6c;let _0xcbfc95;try{_0xcbfc95=parseTableReference(_0xfd59d5[0x0]);const _0x4ddc8c=_0x23cd22['database'];!_0xcbfc95[_0x275331(0xa0)]&&_0x4ddc8c&&(_0xcbfc95[_0x275331(0xa0)]=_0x4ddc8c);const _0x581386=validateTableDescribeReference(_0xcbfc95);if(_0x581386)return console[_0x275331(0xb0)]('Error:\x20'+_0x581386),console[_0x275331(0xb0)](_0x275331(0xbe)),console[_0x275331(0xb0)](_0x275331(0xac)),console[_0x275331(0xb0)](_0x275331(0xaf)),0x1;}catch(_0x3977c7){return console[_0x275331(0xb0)](_0x275331(0x9c)+_0x3977c7['message']),console[_0x275331(0xb0)](_0x275331(0xbe)),console[_0x275331(0xb0)](_0x275331(0xac)),console[_0x275331(0xb0)](_0x275331(0xaf)),0x1;}const _0x3d4a4b=_0xcbfc95[_0x275331(0xa2)],_0x5e86db=_0xcbfc95['database'],_0x4a3d7a=_0xcbfc95['table'],_0x1d3dc2=resolveLimit(_0x23cd22[_0x275331(0x9f)],DEFAULT_DISPLAY_LIMIT);try{_0x23cd22[_0x275331(0xa1)]&&(console[_0x275331(0xb0)](_0x275331(0xad)+_0x23cd22['site']),_0x3d4a4b&&console['error']('Catalog:\x20'+_0x3d4a4b),console['error'](_0x275331(0xb2)+_0x5e86db),console['error'](_0x275331(0xa6)+_0x4a3d7a),console[_0x275331(0xb0)](_0x275331(0xc5)+_0x1d3dc2));const _0x197e1d=_0x3d4a4b?_0x3d4a4b+'.'+_0x5e86db+'.'+_0x4a3d7a:_0x5e86db+'.'+_0x4a3d7a,_0x760f1f=await withSpinner(_0x275331(0xae)+_0x197e1d+'...',()=>_0x1d44c3[_0x275331(0xb8)]['showTable'](_0x5e86db,_0x4a3d7a,_0x1d3dc2,_0x3d4a4b),{'verbose':_0x23cd22[_0x275331(0xa1)]}),_0x42a950=_0x760f1f['data'],_0x148686=_0x42a950[_0x275331(0xbf)];return _0x148686[_0x275331(0xa8)]===0x0?console[_0x275331(0xb0)](_0x275331(0xb3)):console[_0x275331(0xb0)](_0x275331(0xab)+_0x148686[_0x275331(0xa8)]+_0x275331(0x9b)+(_0x148686[_0x275331(0xa8)]!==0x1?'s':'')+_0x275331(0xa9)+_0x197e1d),await handleSDKOutput(_0x148686,_0x23cd22),0x0;}catch(_0x202366){if(_0x202366 instanceof SDKError)return console['error'](_0x275331(0x9c)+_0x202366['message']),_0x202366['cause']&&console[_0x275331(0xb0)](_0x275331(0xa3)+_0x202366[_0x275331(0xb1)]),0x1;throw _0x202366;}}[a44_0x49cca7(0xa7)](_0x4927b0){const _0x424526=a44_0x49cca7;if(_0x4927b0[_0x424526(0xc3)][_0x424526(0xa8)]===0x0)return _0x424526(0xc4);if(_0x4927b0['args']['length']>0x1)return'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';return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x1ef6a3=a45_0x4566;(function(_0x2918db,_0x251915){const _0xe0bf02=a45_0x4566,_0x54c2fe=_0x2918db();while(!![]){try{const _0x15a163=parseInt(_0xe0bf02(0xe4))/0x1*(-parseInt(_0xe0bf02(0xc4))/0x2)+parseInt(_0xe0bf02(0xdc))/0x3*(-parseInt(_0xe0bf02(0xc1))/0x4)+parseInt(_0xe0bf02(0xdf))/0x5+parseInt(_0xe0bf02(0xe9))/0x6*(-parseInt(_0xe0bf02(0xc3))/0x7)+-parseInt(_0xe0bf02(0xd5))/0x8+parseInt(_0xe0bf02(0xcb))/0x9*(parseInt(_0xe0bf02(0xd3))/0xa)+parseInt(_0xe0bf02(0xbc))/0xb*(parseInt(_0xe0bf02(0xc9))/0xc);if(_0x15a163===_0x251915)break;else _0x54c2fe['push'](_0x54c2fe['shift']());}catch(_0x87a252){_0x54c2fe['push'](_0x54c2fe['shift']());}}}(a45_0x2782,0x9fa17));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a45_0x4566(_0x3c7973,_0x53a61f){_0x3c7973=_0x3c7973-0xbc;const _0x278209=a45_0x2782();let _0x4566a9=_0x278209[_0x3c7973];return _0x4566a9;}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a45_0x2782(){const _0x290255=['account_id','Read\x20credential\x20from\x20','red','6PWmgnk','status','message','484SZOhiT','(from\x20','Account\x20ID:','User:','dim','3918404mqXzvP','config','708253ZSCnpC','2AYBevv','getUserInfo','Name:','log','TDX_PROFILE\x20env','91944EPzkGF','first_name','11259AARwth','env','error','green','yellow','✓\x20Authentication\x20successful\x0a','session','N/A','8390sVMFSc','jobs','734240pIKxmg','Credential\x20type:\x20','bold','displayWithSources','last_name','tdx','OAuth','3LZfVOx','CLI\x20flag','cyan','3839100mQkOWu','profile','No\x20credential\x20found','Show\x20authentication\x20status\x20and\x20current\x20context','profileSource','328130jPhZcq','filter'];a45_0x2782=function(){return _0x290255;};return a45_0x2782();}import{GlobalContext}from'../core/global-context.js';import a45_0x44ca7b from'chalk';export class StatusCommand extends BaseCommand{['name']='status';['description']=a45_0x1ef6a3(0xe2);async['execute'](_0x187775){const _0x3ba775=a45_0x1ef6a3,{options:_0x55fd54,tdx:_0x41c81e}=_0x187775,_0x4ac1a0=_0x55fd54['site'],_0x4b0682=new GlobalContext(_0x55fd54),_0x36838a=_0x4b0682[_0x3ba775(0xe0)],_0x3308b8=_0x4b0682[_0x3ba775(0xe3)],_0xc41b27=_0x3308b8==='cli'?_0x3ba775(0xdd):_0x3308b8===_0x3ba775(0xd1)?_0x3ba775(0xd1):_0x3308b8===_0x3ba775(0xcc)?_0x3ba775(0xc8):_0x3308b8==='config'?_0x3ba775(0xc2):null,_0x143da9=_0x36838a?a45_0x44ca7b[_0x3ba775(0xde)](_0x36838a):a45_0x44ca7b[_0x3ba775(0xc0)](_0x3ba775(0xd2)),_0x5a98ca=_0xc41b27?'\x20'+a45_0x44ca7b[_0x3ba775(0xc0)](_0x3ba775(0xbd)+_0xc41b27+')'):'';console[_0x3ba775(0xc7)](a45_0x44ca7b[_0x3ba775(0xd7)](_0x3ba775(0xda))+'\x20profile:\x20'+_0x143da9+_0x5a98ca+'\x20'+a45_0x44ca7b[_0x3ba775(0xc0)]('(')+'site:\x20'+a45_0x44ca7b['cyan'](_0x4ac1a0)+a45_0x44ca7b[_0x3ba775(0xc0)](')'));const _0x35e4cb=await getOAuthTokens(_0x36838a);if(_0x35e4cb)console['log'](_0x3ba775(0xd6)+a45_0x44ca7b[_0x3ba775(0xde)](_0x3ba775(0xdb)));else{const _0x13cbed=await resolveAPIKeyAsync(_0x4ac1a0,_0x36838a);if(_0x13cbed){const {source:_0x103157,isDeprecated:_0x352da3}=_0x13cbed,_0xd8be51=_0x3ba775(0xe7)+a45_0x44ca7b[_0x3ba775(0xde)](_0x103157);console[_0x3ba775(0xc7)](_0x352da3?a45_0x44ca7b[_0x3ba775(0xcf)](_0xd8be51):_0xd8be51);}else console[_0x3ba775(0xc7)](a45_0x44ca7b['yellow'](_0x3ba775(0xe1)));}let _0x1a1fd5=![];try{const _0x155335=await _0x41c81e[_0x3ba775(0xd4)][_0x3ba775(0xc5)]();console[_0x3ba775(0xc7)](a45_0x44ca7b[_0x3ba775(0xce)](_0x3ba775(0xd0))),console['log'](a45_0x44ca7b['bold'](_0x3ba775(0xbf))+'\x20'+a45_0x44ca7b[_0x3ba775(0xde)](_0x155335['email']));if(_0x155335['first_name']||_0x155335['last_name']){const _0x4930d4=[_0x155335[_0x3ba775(0xca)],_0x155335[_0x3ba775(0xd9)]][_0x3ba775(0xe5)](Boolean)['join']('\x20');console[_0x3ba775(0xc7)](a45_0x44ca7b['bold'](_0x3ba775(0xc6))+'\x20'+_0x4930d4);}_0x155335['account_id']&&console[_0x3ba775(0xc7)](a45_0x44ca7b[_0x3ba775(0xd7)](_0x3ba775(0xbe))+'\x20'+a45_0x44ca7b[_0x3ba775(0xcf)](_0x155335[_0x3ba775(0xe6)])),_0x1a1fd5=!![];}catch(_0x40c30f){_0x40c30f instanceof HTTPClientError&&_0x40c30f[_0x3ba775(0xea)]===0x191?printAuthError(_0x40c30f,!![],_0x36838a):console[_0x3ba775(0xcd)](a45_0x44ca7b[_0x3ba775(0xe8)]('✗\x20Validation\x20failed:\x20'+(_0x40c30f instanceof Error?_0x40c30f[_0x3ba775(0xeb)]:String(_0x40c30f))));}return console['log'](),_0x4b0682[_0x3ba775(0xd8)](),_0x1a1fd5?0x0:0x1;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x38f4ca=a46_0x12c3;(function(_0x25e768,_0x3b6880){const _0x663222=a46_0x12c3,_0x222a90=_0x25e768();while(!![]){try{const _0x572d76=-parseInt(_0x663222(0x1b7))/0x1+parseInt(_0x663222(0x1da))/0x2+parseInt(_0x663222(0x1e1))/0x3+parseInt(_0x663222(0x1d1))/0x4*(parseInt(_0x663222(0x1e4))/0x5)+-parseInt(_0x663222(0x1bd))/0x6+-parseInt(_0x663222(0x1b9))/0x7+-parseInt(_0x663222(0x1d6))/0x8;if(_0x572d76===_0x3b6880)break;else _0x222a90['push'](_0x222a90['shift']());}catch(_0x112c22){_0x222a90['push'](_0x222a90['shift']());}}}(a46_0x5389,0x9ec35));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x5389(){const _0x4f5687=['length','✔\x20Found\x20','.*\x22','listTables','Error:\x20Pattern\x20\x27','3414339EkVvbh','📋\x20','Database\x20pattern:\x20','5ACcwCd','cause','\x27\x20across\x20all\x20databases.','Error:\x20','message','error','\x20\x20Use:\x20tdx\x20tables\x20\x22','name','database','80249rSxcOV','Site:\x20','5144895penTDy','List\x20tables\x20in\x20a\x20database','execute','\x20\x20Cause:\x20','3519942cdRFcc','log','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','Database:\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','site','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','✖\x20No\x20tables\x20found','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','includes','query','validate','table_name','4489552bcDbDM','Database:\x20all','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','limit','\x20table','2757856ZoHVup','table','description','data','272830rxOJGF','database_name'];a46_0x5389=function(){return _0x4f5687;};return a46_0x5389();}import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a46_0x12c3(_0x1d6450,_0x4698dd){_0x1d6450=_0x1d6450-0x1b7;const _0x538991=a46_0x5389();let _0x12c348=_0x538991[_0x1d6450];return _0x12c348;}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_0x38f4ca(0x1eb)]='tables';[a46_0x38f4ca(0x1d8)]=a46_0x38f4ca(0x1ba);async[a46_0x38f4ca(0x1bb)](_0x5915e7){const _0x22ec64=a46_0x38f4ca,{options:_0x2fb9e2,args:_0x16d3d5,tdx:_0x3bbd14}=_0x5915e7;let _0x53fb46;if(_0x16d3d5[_0x22ec64(0x1dc)]===0x0)_0x53fb46={'database':undefined,'table':undefined,'original':''};else{if(_0x16d3d5[_0x22ec64(0x1dc)]===0x1)try{_0x53fb46=parseTableReference(_0x16d3d5[0x0]);if(_0x53fb46[_0x22ec64(0x1d7)]&&!_0x53fb46[_0x22ec64(0x1ec)]&&!_0x53fb46[_0x22ec64(0x1d7)][_0x22ec64(0x1cd)]('*')&&!_0x53fb46[_0x22ec64(0x1d7)][_0x22ec64(0x1cd)]('?'))return console['error'](_0x22ec64(0x1e0)+_0x16d3d5[0x0]+_0x22ec64(0x1c3)),console[_0x22ec64(0x1e9)](_0x22ec64(0x1c5)+_0x53fb46[_0x22ec64(0x1d7)]+'\x27?'),console[_0x22ec64(0x1e9)](_0x22ec64(0x1ea)+_0x53fb46[_0x22ec64(0x1d7)]+_0x22ec64(0x1de)),console[_0x22ec64(0x1e9)](_0x22ec64(0x1c0)+_0x53fb46[_0x22ec64(0x1d7)]),console[_0x22ec64(0x1e9)](_0x22ec64(0x1cc)+_0x53fb46['table']),console[_0x22ec64(0x1e9)](''),console[_0x22ec64(0x1e9)]('Note:\x20\x27'+_0x16d3d5[0x0]+_0x22ec64(0x1c1)+_0x53fb46[_0x22ec64(0x1d7)]+_0x22ec64(0x1e6)),0x1;}catch(_0x2844c5){return console['error'](_0x22ec64(0x1e7)+_0x2844c5['message']),0x1;}else return console[_0x22ec64(0x1e9)](_0x22ec64(0x1c9)),console[_0x22ec64(0x1e9)](_0x22ec64(0x1c7)),console[_0x22ec64(0x1e9)](_0x22ec64(0x1c4)),console[_0x22ec64(0x1e9)](_0x22ec64(0x1c2)),console[_0x22ec64(0x1e9)](_0x22ec64(0x1ca)),console[_0x22ec64(0x1e9)]('Or\x20use\x20--in\x20flag:'),console[_0x22ec64(0x1e9)](_0x22ec64(0x1d3)),0x1;}const _0x899c37=_0x2fb9e2[_0x22ec64(0x1ec)];!_0x53fb46['database']&&_0x899c37&&(_0x53fb46[_0x22ec64(0x1ec)]=_0x899c37);try{const _0x418b44=_0x2f2a10=>_0x2f2a10&&(_0x2f2a10[_0x22ec64(0x1cd)]('*')||_0x2f2a10[_0x22ec64(0x1cd)]('?')),_0x50efe0=_0x418b44(_0x53fb46['database']);_0x2fb9e2['verbose']&&(console[_0x22ec64(0x1e9)](_0x22ec64(0x1b8)+_0x2fb9e2[_0x22ec64(0x1c8)]),_0x53fb46[_0x22ec64(0x1ec)]?_0x50efe0?console[_0x22ec64(0x1e9)](_0x22ec64(0x1e3)+_0x53fb46[_0x22ec64(0x1ec)]):console[_0x22ec64(0x1e9)](_0x22ec64(0x1c6)+_0x53fb46[_0x22ec64(0x1ec)]):console[_0x22ec64(0x1e9)](_0x22ec64(0x1d2)),_0x53fb46[_0x22ec64(0x1d7)]&&console[_0x22ec64(0x1e9)]('Table\x20pattern:\x20'+_0x53fb46[_0x22ec64(0x1d7)]));const _0x2df46b=_0x53fb46['database']&&!_0x50efe0?_0x53fb46['database']:undefined,_0xb261c2=_0x50efe0?_0x53fb46[_0x22ec64(0x1ec)]:undefined,_0x1430f4=_0x53fb46[_0x22ec64(0x1d7)],_0x4a7fcf=resolveLimit(_0x2fb9e2[_0x22ec64(0x1d4)],DEFAULT_LISTING_LIMIT),_0x40b6e7=await withSpinner('Listing\x20tables...',()=>_0x3bbd14[_0x22ec64(0x1ce)][_0x22ec64(0x1df)](_0x2df46b,_0x1430f4,_0xb261c2,_0x4a7fcf),{'verbose':_0x2fb9e2['verbose']}),_0x2cd1bd=_0x40b6e7[_0x22ec64(0x1d9)];if(_0x2cd1bd[_0x22ec64(0x1dc)]===0x0&&_0x53fb46[_0x22ec64(0x1ec)]&&!_0x50efe0)return console['error'](_0x22ec64(0x1cb)),console[_0x22ec64(0x1e9)]('Database\x20\x27'+_0x53fb46[_0x22ec64(0x1ec)]+_0x22ec64(0x1bf)),0x1;console['error'](_0x22ec64(0x1dd)+_0x2cd1bd[_0x22ec64(0x1dc)]+_0x22ec64(0x1d5)+(_0x2cd1bd[_0x22ec64(0x1dc)]!==0x1?'s':''));if(isStructuredFormat(_0x2fb9e2))await handleSDKOutput(_0x2cd1bd,{..._0x2fb9e2,'limit':_0x4a7fcf});else for(const _0x528230 of _0x2cd1bd){const _0xd45b37=_0x528230[_0x22ec64(0x1db)]?_0x528230[_0x22ec64(0x1db)]+'.':'';console[_0x22ec64(0x1be)](_0x22ec64(0x1e2)+_0xd45b37+_0x528230[_0x22ec64(0x1d0)]);}return 0x0;}catch(_0x1f6c4b){if(_0x1f6c4b instanceof SDKError)return console[_0x22ec64(0x1e9)]('Error:\x20'+_0x1f6c4b[_0x22ec64(0x1e8)]),_0x1f6c4b[_0x22ec64(0x1e5)]&&console['error'](_0x22ec64(0x1bc)+_0x1f6c4b[_0x22ec64(0x1e5)]),0x1;throw _0x1f6c4b;}}[a46_0x38f4ca(0x1cf)](_0x2266c6){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a47_0x19aa(_0x24ef21,_0x5b9b52){_0x24ef21=_0x24ef21-0xc9;const _0xa9b608=a47_0xa9b6();let _0x19aac6=_0xa9b608[_0x24ef21];return _0x19aac6;}function a47_0xa9b6(){const _0x45d750=['10585776FNGopK','description','llm_agent','length','dim','session','tdx.json','323348sPgbZG','parent_segment','\x0aUpdated:\x20','(session:\x20','agent','includes','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','name','validate','error','Error:\x20','profile','site','Clear\x20session-level\x20or\x20default\x20context\x20values','default','log','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','6JsuYbm','engage_workspace','green','Usage:\x20tdx\x20unset\x20<resource>\x0a','1474073SVqmcF','2904425OMSzZb','cleared','21366207igprLH','4RVvrpq','68457zDBmJb','message','Invalid\x20resource:\x20','execute','Session\x20','llm_project','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','database','unset','Default\x20site\x20','6877843kAhqab','join'];a47_0xa9b6=function(){return _0x45d750;};return a47_0xa9b6();}const a47_0x57a456=a47_0x19aa;(function(_0x2a9292,_0x227b86){const _0x57fb1d=a47_0x19aa,_0x53a689=_0x2a9292();while(!![]){try{const _0x1d98ce=-parseInt(_0x57fb1d(0xec))/0x1+parseInt(_0x57fb1d(0xd7))/0x2+-parseInt(_0x57fb1d(0xf1))/0x3*(-parseInt(_0x57fb1d(0xf0))/0x4)+-parseInt(_0x57fb1d(0xed))/0x5+-parseInt(_0x57fb1d(0xe8))/0x6*(parseInt(_0x57fb1d(0xce))/0x7)+parseInt(_0x57fb1d(0xd0))/0x8+parseInt(_0x57fb1d(0xef))/0x9;if(_0x1d98ce===_0x227b86)break;else _0x53a689['push'](_0x53a689['shift']());}catch(_0x47cd16){_0x53a689['push'](_0x53a689['shift']());}}}(a47_0xa9b6,0xce1c7));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a47_0x47268b from'chalk';import*as a47_0x2d06cb from'node:path';export class UnsetCommand extends BaseCommand{[a47_0x57a456(0xde)]=a47_0x57a456(0xcc);[a47_0x57a456(0xd1)]=a47_0x57a456(0xe4);[a47_0x57a456(0xdf)](_0x3c35b5){const _0x5450cc=a47_0x57a456,{args:_0x4c0719,options:_0x26abe1}=_0x3c35b5,_0x529002=_0x26abe1[_0x5450cc(0xe5)];if(_0x4c0719[_0x5450cc(0xd3)]===0x0)return _0x5450cc(0xeb)+_0x5450cc(0xca)+_0x5450cc(0xdd)+'\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options';const _0xc2ca18=_0x4c0719[0x0],_0x50fd1b=[_0x5450cc(0xe3),_0x5450cc(0xcb),_0x5450cc(0xd8),_0x5450cc(0xc9),_0x5450cc(0xdb),_0x5450cc(0xe2),'engage_workspace'];if(!_0x50fd1b[_0x5450cc(0xdc)](_0xc2ca18))return _0x5450cc(0xf3)+_0xc2ca18+'.\x20Must\x20be\x20one\x20of:\x20'+_0x50fd1b[_0x5450cc(0xcf)](',\x20');if(_0x529002&&_0xc2ca18!=='site'&&_0xc2ca18!==_0x5450cc(0xe2))return _0x5450cc(0xe7);return undefined;}async[a47_0x57a456(0xf4)](_0x5d50ee){const _0x7a60de=a47_0x57a456,{args:_0x57d8d2,options:_0x50d547}=_0x5d50ee,_0x5b0f70=_0x50d547[_0x7a60de(0xe5)];cleanExpiredSessions();try{const _0x3e143e=_0x57d8d2[0x0],_0xc5928b=a47_0x2d06cb[_0x7a60de(0xcf)](getConfigDir(),_0x7a60de(0xd6));if(_0x5b0f70){if(_0x3e143e===_0x7a60de(0xe3))return clearDefaultSiteFromUserConfig(),console['log'](_0x7a60de(0xcd)+a47_0x47268b['green'](_0x7a60de(0xee))),console[_0x7a60de(0xe6)](a47_0x47268b[_0x7a60de(0xd4)](_0x7a60de(0xd9)+_0xc5928b)),0x0;if(_0x3e143e==='profile')return clearActiveProfileFromUserConfig(),console['log']('Default\x20profile\x20'+a47_0x47268b[_0x7a60de(0xea)]('cleared')),console['log'](a47_0x47268b[_0x7a60de(0xd4)](_0x7a60de(0xd9)+_0xc5928b)),0x0;}const _0x2f3f71=getSessionID(_0x50d547[_0x7a60de(0xd5)]),_0x1d9f09={'site':_0x7a60de(0xe3),'database':_0x7a60de(0xcb),'parent_segment':'parent_segment','llm_project':_0x7a60de(0xc9),'agent':_0x7a60de(0xd2),'profile':_0x7a60de(0xe2),'engage_workspace':_0x7a60de(0xe9)},_0x9f236=_0x1d9f09[_0x3e143e];return _0x9f236&&(clearSessionContextField(_0x9f236,_0x50d547[_0x7a60de(0xd5)]),console[_0x7a60de(0xe6)](_0x7a60de(0xf5)+_0x3e143e+'\x20'+a47_0x47268b['green'](_0x7a60de(0xee))+'\x20'+a47_0x47268b[_0x7a60de(0xd4)](_0x7a60de(0xda)+_0x2f3f71+')'))),0x0;}catch(_0x2c7e6b){return _0x2c7e6b instanceof Error&&console[_0x7a60de(0xe0)](_0x7a60de(0xe1)+_0x2c7e6b[_0x7a60de(0xf2)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a48_0x1a213d=a48_0x3265;(function(_0x37236b,_0x5dac06){const _0x44a75c=a48_0x3265,_0x2aae79=_0x37236b();while(!![]){try{const _0x4c3a67=-parseInt(_0x44a75c(0x1c5))/0x1*(parseInt(_0x44a75c(0x19b))/0x2)+-parseInt(_0x44a75c(0x19e))/0x3+-parseInt(_0x44a75c(0x1a5))/0x4*(parseInt(_0x44a75c(0x1af))/0x5)+parseInt(_0x44a75c(0x1ca))/0x6+-parseInt(_0x44a75c(0x1a2))/0x7*(parseInt(_0x44a75c(0x19a))/0x8)+-parseInt(_0x44a75c(0x1b6))/0x9*(-parseInt(_0x44a75c(0x1a4))/0xa)+parseInt(_0x44a75c(0x1c6))/0xb;if(_0x4c3a67===_0x5dac06)break;else _0x2aae79['push'](_0x2aae79['shift']());}catch(_0x106f81){_0x2aae79['push'](_0x2aae79['shift']());}}}(a48_0x199a,0x4ed46));import{gt}from'semver';import a48_0x58941b from'chalk';function a48_0x199a(){const _0xb2d44=['log','pnpm','error','red','4833297RKxFhI','Upgrade\x20tdx\x20to\x20the\x20latest\x20version','Target\x20version:','latest','Current\x20version:','Current\x20version:\x20','@treasuredata/tdx','global','Running:','...','Checking\x20','Failed\x20to\x20run\x20','replace','Would\x20run:','install','2OwcSyi','7965309PumbEl','green','Already\x20up\x20to\x20date\x20(','Upgrade\x20is\x20not\x20available\x20for\x20development\x20versions.','2367996mbgZEC','add','bun','51752ntYplh','602884YQnsIY','execute','upgrade','991176MQmwsB','includes','message','yarn','273vXkAcy','dim','10XCCDMp','117892oLfkMO','cyan','Failed\x20to\x20check\x20for\x20updates:\x20','Upgrade\x20failed\x20(exit\x20code\x20','next','close','join','Successfully\x20upgraded\x20to\x20','npm','inherit','25PQhgHn','toLowerCase','argv'];a48_0x199a=function(){return _0xb2d44;};return a48_0x199a();}import{BaseCommand}from'./command.js';import{getVersion,isDevVersion}from'../core/version.js';import{loadReleaseChannel}from'../core/config.js';function a48_0x3265(_0x83c32c,_0x4ca72e){_0x83c32c=_0x83c32c-0x19a;const _0x199a4d=a48_0x199a();let _0x3265ac=_0x199a4d[_0x83c32c];return _0x3265ac;}import{fetchLatestVersion}from'../utils/version-check.js';import{crossSpawn}from'../utils/process.js';const PACKAGE_NAME=a48_0x1a213d(0x1bc);export function detectPackageManager(){const _0xb730d7=a48_0x1a213d,_0x42a5f7=process['execPath'][_0xb730d7(0x1b0)](),_0x7d74e1=process[_0xb730d7(0x1b1)][0x1]??'';if(_0x42a5f7[_0xb730d7(0x19f)](_0xb730d7(0x1cc))||_0x7d74e1[_0xb730d7(0x19f)]('.bun/'))return'bun';if(_0x7d74e1['includes']('pnpm'))return _0xb730d7(0x1b3);if(_0x7d74e1[_0xb730d7(0x19f)](_0xb730d7(0x1a1)))return _0xb730d7(0x1a1);return _0xb730d7(0x1ad);}export function buildInstallArgs(_0x127fee,_0x5edef1){const _0x15bc5d=a48_0x1a213d;switch(_0x127fee){case _0x15bc5d(0x1a1):return[_0x15bc5d(0x1bd),'add',_0x5edef1];case _0x15bc5d(0x1b3):return[_0x15bc5d(0x1cb),'-g',_0x5edef1];default:return[_0x15bc5d(0x1c4),'-g',_0x5edef1];}}export class UpgradeCommand extends BaseCommand{['name']=a48_0x1a213d(0x19d);['description']=a48_0x1a213d(0x1b7);async[a48_0x1a213d(0x19c)](_0x30e17f){const _0x105ba0=a48_0x1a213d,{options:_0x302d68,args:_0x4b30ed}=_0x30e17f,_0x2424a3=!!_0x302d68['dryRun'],{next:_0x2423c4,method:_0x3e1705}=_0x302d68,_0x4c0195=_0x2423c4?_0x105ba0(0x1a9):loadReleaseChannel(),_0x2376dc=_0x4c0195===_0x105ba0(0x1a9)?_0x105ba0(0x1a9):_0x105ba0(0x1b9),_0x2f3261=_0x4b30ed[0x0]?String(_0x4b30ed[0x0])[_0x105ba0(0x1c2)](/^v/,''):undefined,_0x1bff4a=getVersion();if(isDevVersion())return console[_0x105ba0(0x1b4)](a48_0x58941b['yellow'](_0x105ba0(0x1c9))),console[_0x105ba0(0x1b4)](a48_0x58941b[_0x105ba0(0x1a3)](_0x105ba0(0x1bb)+_0x1bff4a)),0x1;let _0x5d9b81;if(_0x2f3261)_0x5d9b81=_0x2f3261,console[_0x105ba0(0x1b2)](a48_0x58941b['dim'](_0x105ba0(0x1ba))+'\x20'+_0x1bff4a),console['log'](a48_0x58941b[_0x105ba0(0x1a3)](_0x105ba0(0x1b8))+'\x20\x20'+a48_0x58941b[_0x105ba0(0x1c7)](_0x2f3261)),console[_0x105ba0(0x1b2)]();else{console['log'](a48_0x58941b['dim'](_0x105ba0(0x1c0)+PACKAGE_NAME+'@'+_0x2376dc+_0x105ba0(0x1bf)));try{_0x5d9b81=await fetchLatestVersion(_0x4c0195);}catch(_0x33287d){return console[_0x105ba0(0x1b4)](a48_0x58941b[_0x105ba0(0x1b5)](_0x105ba0(0x1a7)+(_0x33287d instanceof Error?_0x33287d[_0x105ba0(0x1a0)]:String(_0x33287d)))),0x1;}if(!gt(_0x5d9b81,_0x1bff4a))return console[_0x105ba0(0x1b2)](a48_0x58941b[_0x105ba0(0x1c7)](_0x105ba0(0x1c8)+_0x1bff4a+').')),0x0;console[_0x105ba0(0x1b2)](a48_0x58941b[_0x105ba0(0x1a3)](_0x105ba0(0x1ba))+'\x20'+_0x1bff4a),console[_0x105ba0(0x1b2)](a48_0x58941b[_0x105ba0(0x1a3)]('Latest\x20version:')+'\x20\x20'+a48_0x58941b[_0x105ba0(0x1c7)](_0x5d9b81)),console['log']();}const _0x5e15ca=_0x3e1705??detectPackageManager(),_0x2eed9c=_0x2f3261?PACKAGE_NAME+'@'+_0x2f3261:PACKAGE_NAME+'@'+_0x2376dc,_0x3e559b=buildInstallArgs(_0x5e15ca,_0x2eed9c);if(_0x2424a3)return console['log'](a48_0x58941b[_0x105ba0(0x1a3)](_0x105ba0(0x1c3))),console[_0x105ba0(0x1b2)]('\x20\x20'+a48_0x58941b[_0x105ba0(0x1a6)](_0x5e15ca+'\x20'+_0x3e559b[_0x105ba0(0x1ab)]('\x20'))),0x0;return console[_0x105ba0(0x1b2)](a48_0x58941b[_0x105ba0(0x1a3)](_0x105ba0(0x1be))+'\x20'+_0x5e15ca+'\x20'+_0x3e559b[_0x105ba0(0x1ab)]('\x20')),console[_0x105ba0(0x1b2)](),new Promise(_0x22135a=>{const _0x551309=_0x105ba0,_0x18e398=crossSpawn(_0x5e15ca,_0x3e559b,{'stdio':_0x551309(0x1ae)});_0x18e398['on'](_0x551309(0x1aa),_0x189650=>{const _0x55e59f=_0x551309;console[_0x55e59f(0x1b2)](),_0x189650===0x0?console[_0x55e59f(0x1b2)](a48_0x58941b[_0x55e59f(0x1c7)](_0x55e59f(0x1ac)+_0x2eed9c)):console[_0x55e59f(0x1b4)](a48_0x58941b['red'](_0x55e59f(0x1a8)+_0x189650+').')),_0x22135a(_0x189650??0x1);}),_0x18e398['on'](_0x551309(0x1b4),_0x1cb2b9=>{const _0x1bb933=_0x551309;console['error'](a48_0x58941b[_0x1bb933(0x1b5)](_0x1bb933(0x1c1)+_0x5e15ca+':\x20'+_0x1cb2b9[_0x1bb933(0x1a0)])),_0x22135a(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
|
+
function a49_0x512d(){const _0x3529c2=['llm_project','44hnOhAA','1941961zsXhEO','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','2241560xlOSUw','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','NOT_FOUND','Session\x20site\x20set\x20to:\x20','engage','tdx.json','1320RFimvm','225JZqWlN','Default\x20site\x20set\x20to:\x20','resolveWorkspaceId','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Error:\x20Profile\x20\x27','error','log','next','message','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','length','description','clear','dim','cleared','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','(session:\x20','3861276lnoZgQ','4460HdBsYf','site','\x27\x20does\x20not\x20exist','parent_segment','displayWithSources','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','agent','Verifying\x20workspace\x20\x27','session','Session\x20database\x20set\x20to:\x20','llm_agent','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','Session\x20engage_workspace\x20set\x20to:\x20','profile','green','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','Invalid\x20resource:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','Session\x20parent_segment\x20set\x20to:\x20','release_channel','Session\x20context\x20','\x0aSaved\x20to:\x20','3573Frohvn','includes','\x27\x20to\x20save\x20permanently','\x27...','execute','display','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','code','engage_workspace','database','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','use','3xwhpCi','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','224758QeEUzJ','7728vnoAiA','default','Release\x20channel\x20set\x20to:\x20','Error:\x20','Session\x20llm_project\x20set\x20to:\x20','join','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Session\x20agent\x20set\x20to:\x20','534DWBsuE','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.'];a49_0x512d=function(){return _0x3529c2;};return a49_0x512d();}const a49_0x3f7595=a49_0xe50a;(function(_0x447652,_0x44a7a4){const _0x46ef1e=a49_0xe50a,_0x402399=_0x447652();while(!![]){try{const _0x45e0b2=-parseInt(_0x46ef1e(0xbb))/0x1*(parseInt(_0x46ef1e(0xbd))/0x2)+parseInt(_0x46ef1e(0xc6))/0x3*(parseInt(_0x46ef1e(0x95))/0x4)+parseInt(_0x46ef1e(0xd3))/0x5*(-parseInt(_0x46ef1e(0xd2))/0x6)+-parseInt(_0x46ef1e(0xca))/0x7+-parseInt(_0x46ef1e(0xbe))/0x8*(parseInt(_0x46ef1e(0xac))/0x9)+-parseInt(_0x46ef1e(0xcc))/0xa+-parseInt(_0x46ef1e(0xc9))/0xb*(-parseInt(_0x46ef1e(0xe4))/0xc);if(_0x45e0b2===_0x44a7a4)break;else _0x402399['push'](_0x402399['shift']());}catch(_0x250dd7){_0x402399['push'](_0x402399['shift']());}}}(a49_0x512d,0x3de04));import{BaseCommand}from'./command.js';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';function a49_0xe50a(_0x250640,_0x7a5735){_0x250640=_0x250640-0x95;const _0x512d83=a49_0x512d();let _0xe50aa2=_0x512d83[_0x250640];return _0xe50aa2;}import a49_0x3b3441 from'chalk';import*as a49_0x4622ac from'node:path';export class UseCommand extends BaseCommand{['name']=a49_0x3f7595(0xba);[a49_0x3f7595(0xde)]='Set\x20session-level\x20context';['validate'](_0x2e794d){const _0x504419=a49_0x3f7595,{args:_0x149896,options:_0x33759e}=_0x2e794d,_0x2a5c6d=_0x33759e[_0x504419(0xbf)];if(_0x149896[_0x504419(0xdd)]===0x0)return undefined;if(_0x149896[_0x504419(0xdd)]===0x1)return _0x504419(0xc4)+_0x504419(0xb4)+_0x504419(0xb3)+_0x504419(0xbc)+_0x504419(0xcd)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a'+_0x504419(0xdc)+_0x504419(0xd6);const _0x340592=_0x149896[0x0],_0x412bde=[_0x504419(0x96),'database','parent_segment','llm_project',_0x504419(0x9b),_0x504419(0xa3),_0x504419(0xb7),_0x504419(0xa9)];if(!_0x412bde[_0x504419(0xad)](_0x340592))return _0x504419(0xa6)+_0x340592+'.\x20Must\x20be\x20one\x20of:\x20'+_0x412bde[_0x504419(0xc3)](',\x20');if(_0x2a5c6d&&_0x340592!==_0x504419(0x96)&&_0x340592!==_0x504419(0xa3)&&_0x340592!==_0x504419(0xa9))return _0x504419(0xa7);if(_0x340592===_0x504419(0xa9)&&!_0x2a5c6d)return'release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>';if(_0x340592===_0x504419(0xa9)){const _0x1fd1f0=_0x149896[0x1];if(_0x1fd1f0!=='stable'&&_0x1fd1f0!=='next')return'Invalid\x20release\x20channel:\x20'+_0x1fd1f0+_0x504419(0xcb);}return undefined;}async[a49_0x3f7595(0xb0)](_0x137f4c){const _0x34ffe5=a49_0x3f7595,{args:_0x351c22,options:_0x14ad2d}=_0x137f4c,_0x11bcdf=_0x14ad2d['debug'],_0x24a9c3=_0x14ad2d[_0x34ffe5(0xdf)],_0x238c81=_0x14ad2d[_0x34ffe5(0xbf)];cleanExpiredSessions();try{if(_0x24a9c3){clearSessionContext(_0x14ad2d[_0x34ffe5(0x9d)]);const _0xa399d6=getSessionID(_0x14ad2d[_0x34ffe5(0x9d)]);return console[_0x34ffe5(0xd9)](_0x34ffe5(0xaa)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x34ffe5(0xe1))+'\x20'+a49_0x3b3441['dim'](_0x34ffe5(0xe3)+_0xa399d6+')')),0x0;}if(_0x351c22[_0x34ffe5(0xdd)]===0x0){const _0x987f0=new GlobalContext(_0x14ad2d);return _0x11bcdf?_0x987f0[_0x34ffe5(0x99)]():_0x987f0[_0x34ffe5(0xb1)](),console[_0x34ffe5(0xd9)](a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xa5))),console[_0x34ffe5(0xd9)](a49_0x3b3441['dim']('Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel')),console[_0x34ffe5(0xd9)](a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xa1))),0x0;}const _0x6ee0e6=_0x351c22[0x0],_0x11f138=_0x351c22[0x1],_0x165c18=a49_0x4622ac[_0x34ffe5(0xc3)](getConfigDir(),_0x34ffe5(0xd1));if(_0x238c81){if(_0x6ee0e6==='site')return saveDefaultSiteToUserConfig(_0x11f138),console['log'](_0x34ffe5(0xd4)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)),console['log'](a49_0x3b3441['dim'](_0x34ffe5(0xab)+_0x165c18)),0x0;if(_0x6ee0e6==='profile'){if(!profileExists(_0x11f138))return console['error']('Error:\x20Profile\x20\x27'+_0x11f138+_0x34ffe5(0x97)),console[_0x34ffe5(0xd8)](_0x34ffe5(0xb5)),0x1;return saveActiveProfileToUserConfig(_0x11f138),console[_0x34ffe5(0xd9)]('Default\x20profile\x20set\x20to:\x20'+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)),console[_0x34ffe5(0xd9)](a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xab)+_0x165c18)),0x0;}if(_0x6ee0e6===_0x34ffe5(0xa9))return saveReleaseChannel(_0x11f138),console[_0x34ffe5(0xd9)](_0x34ffe5(0xc0)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)),console[_0x34ffe5(0xd9)](a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xab)+_0x165c18)),_0x11f138===_0x34ffe5(0xda)?(console[_0x34ffe5(0xd9)](a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xb9))),console['log'](a49_0x3b3441['dim'](_0x34ffe5(0xe2)))):console[_0x34ffe5(0xd9)](a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xc7))),0x0;}if(_0x6ee0e6===_0x34ffe5(0x96)){const _0x4db299=getSessionID(_0x14ad2d[_0x34ffe5(0x9d)]);return saveSessionContext({'site':_0x11f138},_0x14ad2d['session']),console[_0x34ffe5(0xd9)](_0x34ffe5(0xcf)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)+'\x20'+a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xe3)+_0x4db299+')')),console['log'](a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xa0)+_0x11f138+_0x34ffe5(0xae))),0x0;}if(_0x6ee0e6===_0x34ffe5(0xa3)){if(!profileExists(_0x11f138))return console['error'](_0x34ffe5(0xd7)+_0x11f138+_0x34ffe5(0x97)),console[_0x34ffe5(0xd8)](_0x34ffe5(0xb5)),0x1;const _0x99f71e=getSessionID(_0x14ad2d[_0x34ffe5(0x9d)]);return saveSessionContext({'profile':_0x11f138},_0x14ad2d[_0x34ffe5(0x9d)]),console[_0x34ffe5(0xd9)]('Session\x20profile\x20set\x20to:\x20'+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)+'\x20'+a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xe3)+_0x99f71e+')')),console[_0x34ffe5(0xd9)](a49_0x3b3441[_0x34ffe5(0xe0)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20'+_0x11f138+_0x34ffe5(0xae))),0x0;}const _0x3a0c5f={},_0x5b552d=getSessionID(_0x14ad2d[_0x34ffe5(0x9d)]);switch(_0x6ee0e6){case _0x34ffe5(0xb8):_0x3a0c5f[_0x34ffe5(0xb8)]=_0x11f138,console[_0x34ffe5(0xd9)](_0x34ffe5(0x9e)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)+'\x20'+a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xe3)+_0x5b552d+')'));break;case _0x34ffe5(0x98):_0x3a0c5f[_0x34ffe5(0x98)]=_0x11f138,console[_0x34ffe5(0xd9)](_0x34ffe5(0xa8)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)+'\x20'+a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xe3)+_0x5b552d+')'));break;case _0x34ffe5(0xc8):_0x3a0c5f[_0x34ffe5(0xc8)]=_0x11f138,console[_0x34ffe5(0xd9)](_0x34ffe5(0xc2)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)+'\x20'+a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xe3)+_0x5b552d+')'));break;case _0x34ffe5(0x9b):{const {projectName:_0x28d94c,agentName:_0x1b3e44}=parseAgentRef(_0x11f138);_0x1b3e44?(_0x3a0c5f[_0x34ffe5(0xc8)]=_0x28d94c,_0x3a0c5f[_0x34ffe5(0x9f)]=_0x1b3e44,console[_0x34ffe5(0xd9)](_0x34ffe5(0xc2)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x28d94c)+'\x20'+a49_0x3b3441['dim'](_0x34ffe5(0xe3)+_0x5b552d+')')),console[_0x34ffe5(0xd9)](_0x34ffe5(0xc5)+a49_0x3b3441['green'](_0x1b3e44)+'\x20'+a49_0x3b3441['dim'](_0x34ffe5(0xe3)+_0x5b552d+')'))):(_0x3a0c5f['llm_agent']=_0x11f138,console['log'](_0x34ffe5(0xc5)+a49_0x3b3441['green'](_0x11f138)+'\x20'+a49_0x3b3441[_0x34ffe5(0xe0)]('(session:\x20'+_0x5b552d+')')));break;}case _0x34ffe5(0xb7):{try{await withSpinner(_0x34ffe5(0x9c)+_0x11f138+_0x34ffe5(0xaf),()=>_0x137f4c['tdx'][_0x34ffe5(0xd0)][_0x34ffe5(0xd5)](_0x11f138));}catch(_0x1ca478){if(_0x1ca478 instanceof SDKError&&(_0x1ca478[_0x34ffe5(0xb6)]===ErrorCode[_0x34ffe5(0xce)]||_0x1ca478[_0x34ffe5(0xb6)]===ErrorCode['INVALID_ARGUMENT']))return console[_0x34ffe5(0xd8)](_0x34ffe5(0xc1)+_0x1ca478[_0x34ffe5(0xdb)]),console[_0x34ffe5(0xd8)](_0x34ffe5(0xb2)),0x1;throw _0x1ca478;}_0x3a0c5f[_0x34ffe5(0xb7)]=_0x11f138,console[_0x34ffe5(0xd9)](_0x34ffe5(0xa2)+a49_0x3b3441[_0x34ffe5(0xa4)](_0x11f138)+'\x20'+a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0xe3)+_0x5b552d+')'));break;}}return saveSessionContext(_0x3a0c5f,_0x14ad2d[_0x34ffe5(0x9d)]),console[_0x34ffe5(0xd9)](a49_0x3b3441[_0x34ffe5(0xe0)](_0x34ffe5(0x9a))),0x0;}catch(_0x14db58){return _0x14db58 instanceof Error&&console[_0x34ffe5(0xd8)](_0x34ffe5(0xc1)+_0x14db58['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x5337df=a50_0x10c0;function a50_0x10c0(_0x4f3414,_0x453b2e){_0x4f3414=_0x4f3414-0x13e;const _0x1898c4=a50_0x1898();let _0x10c05d=_0x1898c4[_0x4f3414];return _0x10c05d;}(function(_0x618361,_0x228eae){const _0x2f4130=a50_0x10c0,_0x52dc54=_0x618361();while(!![]){try{const _0x504a78=-parseInt(_0x2f4130(0x159))/0x1+-parseInt(_0x2f4130(0x149))/0x2+parseInt(_0x2f4130(0x14e))/0x3+parseInt(_0x2f4130(0x143))/0x4*(parseInt(_0x2f4130(0x142))/0x5)+parseInt(_0x2f4130(0x144))/0x6+parseInt(_0x2f4130(0x15d))/0x7+-parseInt(_0x2f4130(0x147))/0x8;if(_0x504a78===_0x228eae)break;else _0x52dc54['push'](_0x52dc54['shift']());}catch(_0x842b5b){_0x52dc54['push'](_0x52dc54['shift']());}}}(a50_0x1898,0xd34fe));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a50_0x52cfc9 from'chalk';export class UserCommand extends BaseCommand{[a50_0x5337df(0x15b)]='user';[a50_0x5337df(0x14b)]=a50_0x5337df(0x158);async[a50_0x5337df(0x141)](_0x46367d){const _0xf49985=a50_0x5337df,{options:_0x4b4ab1,tdx:_0x2960c8}=_0x46367d;try{const _0x11511c=await withSpinner(_0xf49985(0x160),()=>_0x2960c8['user'][_0xf49985(0x145)](),{'verbose':_0x4b4ab1[_0xf49985(0x14f)]}),_0x456a39=_0x11511c['data'];return await handleSingleObjectOutput(_0x456a39,_0x4b4ab1),0x0;}catch(_0x2a6cf3){if(_0x2a6cf3 instanceof SDKError)return console['error'](_0xf49985(0x14d)+_0x2a6cf3[_0xf49985(0x155)]),_0x2a6cf3[_0xf49985(0x15c)]&&console[_0xf49985(0x162)](_0xf49985(0x15a)+_0x2a6cf3[_0xf49985(0x15c)]),0x1;throw _0x2a6cf3;}}}function a50_0x1898(){const _0x1e04f5=['length','Show\x20current\x20user\x20information','788267TTMunx','\x20\x20Cause:\x20','name','cause','10631635wtSXUF','data','👤\x20','Fetching\x20user\x20info...','List\x20all\x20users\x20in\x20the\x20account','error','yellow','account_owner','localeCompare','execute','1315WWrdgv','24436tGBlqE','4210860jiflrq','getCurrent','\x20user','11188592bPAorq','email','1625442dIGrFm','✔\x20Found\x20','description','user','Error:\x20','113442tdgOiu','verbose','\x20(admin)','list','dim','user\x20list','Listing\x20users...','message','administrator'];a50_0x1898=function(){return _0x1e04f5;};return a50_0x1898();}export class UserListCommand extends BaseCommand{[a50_0x5337df(0x15b)]=a50_0x5337df(0x153);[a50_0x5337df(0x14b)]=a50_0x5337df(0x161);async[a50_0x5337df(0x141)](_0x27b57){const _0x1dcf49=a50_0x5337df,{options:_0x17b35e,tdx:_0x261b4d}=_0x27b57;try{const _0x666905=await withSpinner(_0x1dcf49(0x154),()=>_0x261b4d[_0x1dcf49(0x14c)][_0x1dcf49(0x151)](),{'verbose':_0x17b35e[_0x1dcf49(0x14f)]}),_0x310fc6=_0x666905[_0x1dcf49(0x15e)];console[_0x1dcf49(0x162)](_0x1dcf49(0x14a)+_0x310fc6['length']+_0x1dcf49(0x146)+(_0x310fc6[_0x1dcf49(0x157)]!==0x1?'s':''));if(isStructuredFormat(_0x17b35e))await handleSDKOutput(_0x310fc6,_0x17b35e);else{const _0xbdf883=[..._0x310fc6]['sort']((_0x8eb8ab,_0x27cd12)=>String(_0x8eb8ab[_0x1dcf49(0x15b)]??'')[_0x1dcf49(0x140)](String(_0x27cd12[_0x1dcf49(0x15b)]??'')));for(const _0x23a5e0 of _0xbdf883){const _0xa5b137=_0x23a5e0[_0x1dcf49(0x13f)]?a50_0x52cfc9[_0x1dcf49(0x13e)]('\x20(owner)'):_0x23a5e0[_0x1dcf49(0x156)]?a50_0x52cfc9['yellow'](_0x1dcf49(0x150)):'',_0x333e6c=_0x23a5e0[_0x1dcf49(0x148)]&&_0x23a5e0[_0x1dcf49(0x148)]!==_0x23a5e0[_0x1dcf49(0x15b)]?a50_0x52cfc9[_0x1dcf49(0x152)]('\x20<'+_0x23a5e0['email']+'>'):'';console['log'](_0x1dcf49(0x15f)+(_0x23a5e0[_0x1dcf49(0x15b)]??'Unknown')+_0x333e6c+_0xa5b137);}}return 0x0;}catch(_0x19352c){if(_0x19352c instanceof SDKError)return console[_0x1dcf49(0x162)](_0x1dcf49(0x14d)+_0x19352c['message']),_0x19352c['cause']&&console['error'](_0x1dcf49(0x15a)+_0x19352c[_0x1dcf49(0x15c)]),0x1;throw _0x19352c;}}}
|