@treasuredata/tdx 0.28.2 → 0.28.3
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/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/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/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/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/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/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x53047d=a36_0x583a;(function(_0xe5bf12,_0x18f09d){const _0x1f0887=a36_0x583a,_0x2c4123=_0xe5bf12();while(!![]){try{const _0x506fd7=-parseInt(_0x1f0887(0xc8))/0x1+-parseInt(_0x1f0887(0xc4))/0x2*(parseInt(_0x1f0887(0xc5))/0x3)+-parseInt(_0x1f0887(0xcb))/0x4+-parseInt(_0x1f0887(0xe1))/0x5+-parseInt(_0x1f0887(0xba))/0x6+parseInt(_0x1f0887(0xd9))/0x7*(parseInt(_0x1f0887(0xcd))/0x8)+parseInt(_0x1f0887(0xdd))/0x9*(parseInt(_0x1f0887(0xd6))/0xa);if(_0x506fd7===_0x18f09d)break;else _0x2c4123['push'](_0x2c4123['shift']());}catch(_0xa26227){_0x2c4123['push'](_0x2c4123['shift']());}}}(a36_0x1818,0x8fdd0));function a36_0x583a(_0x5b68b2,_0x2a5ebe){_0x5b68b2=_0x5b68b2-0xb7;const _0x18188b=a36_0x1818();let _0x583a91=_0x18188b[_0x5b68b2];return _0x583a91;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a36_0x1818(){const _0x417ef1=['Examples:','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','error','400hnVuNX','\x27...','Updating\x20segment\x20\x27','77ojePXt','INTERNAL','execute','✔\x20Updated\x20segment\x20\x27','793278VMCSVF','yellow','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','3610960CkYxzx','Resolved\x20folder\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20update\x20','resolveFolderId','3730758dLJady','includes','segmentPath','folder','description','type','data','kind','segment','segmentName','1979918ZfhCjC','3ErcaPP','verbose','name','905503coChIZ','\x20\x20\x20Path:\x20','Update\x20existing\x20child\x20segment','1950904ONiGsJ','segmentId','575096uTWgBw','updateSegmentById','parentId','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'];a36_0x1818=function(){return _0x417ef1;};return a36_0x1818();}import{SDKError,ErrorCode}from'../sdk/index.js';import a36_0x96df15 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a36_0x53047d(0xc7)]='segment:update';[a36_0x53047d(0xbe)]=a36_0x53047d(0xca);async[a36_0x53047d(0xdb)](_0x2d639b){const _0x23e1cd=a36_0x53047d;console[_0x23e1cd(0xd5)](a36_0x96df15[_0x23e1cd(0xde)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x23e1cd(0xd5)](a36_0x96df15[_0x23e1cd(0xde)](_0x23e1cd(0xdf)));const {options:_0x1593e6,args:_0x135173,tdx:_0x3165ff}=_0x2d639b,_0x1e6a70=_0x1593e6;if(_0x135173['length']===0x0)return console[_0x23e1cd(0xd5)](_0x23e1cd(0xb7)),console[_0x23e1cd(0xd5)](_0x23e1cd(0xd2)),console[_0x23e1cd(0xd5)](_0x23e1cd(0xd3)),console[_0x23e1cd(0xd5)](_0x23e1cd(0xd4)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x10b334=_0x135173[0x0],_0x7ba835=_0x1593e6[_0x23e1cd(0xbc)];let _0x48328d=_0x10b334;_0x7ba835&&!_0x10b334[_0x23e1cd(0xbb)]('/')&&(_0x48328d=_0x7ba835+'/'+_0x10b334,_0x1e6a70[_0x23e1cd(0xc6)]&&console['error'](_0x23e1cd(0xd0)+_0x48328d));const _0x1cc6fa=await withSpinner('Resolving\x20path\x20\x27'+_0x48328d+_0x23e1cd(0xd7),()=>_0x3165ff[_0x23e1cd(0xc2)]['resolvePathToResource'](_0x48328d),{'verbose':_0x1e6a70['verbose']}),_0x3fff35=_0x1cc6fa[_0x23e1cd(0xc0)];_0x1e6a70[_0x23e1cd(0xc6)]&&console['error']('Resolved\x20type:\x20'+_0x3fff35[_0x23e1cd(0xbf)]);if(_0x3fff35['type']!=='segment')return console[_0x23e1cd(0xd5)](_0x23e1cd(0xb8)+_0x3fff35['type']+_0x23e1cd(0xe0)),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3fff35['segmentId'])throw new SDKError(ErrorCode[_0x23e1cd(0xda)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2eb830=_0x3fff35[_0x23e1cd(0xcf)],_0x2a2649=_0x3fff35[_0x23e1cd(0xcc)];_0x1e6a70['verbose']&&(console[_0x23e1cd(0xd5)]('Parent\x20ID:\x20'+_0x2eb830),console[_0x23e1cd(0xd5)]('Segment\x20ID:\x20'+_0x2a2649));let _0x4b1b5f;if(_0x1e6a70[_0x23e1cd(0xbd)]){const _0x911e4=_0x1e6a70['folder'],_0x35ba7c=await withSpinner(_0x23e1cd(0xd1)+_0x911e4+_0x23e1cd(0xd7),()=>_0x3165ff[_0x23e1cd(0xc2)][_0x23e1cd(0xb9)](_0x2eb830,_0x911e4),{'verbose':_0x1e6a70[_0x23e1cd(0xc6)]});_0x4b1b5f=parseInt(_0x35ba7c[_0x23e1cd(0xc0)],0xa),_0x1e6a70[_0x23e1cd(0xc6)]&&console[_0x23e1cd(0xd5)](_0x23e1cd(0xe2)+_0x4b1b5f);}const _0x528eb7=await loadJSONFromOptions(_0x1e6a70['rule'],_0x1e6a70['ruleFile']),_0x10e97e={'name':_0x1e6a70[_0x23e1cd(0xc7)],'description':_0x1e6a70[_0x23e1cd(0xbe)],'rule':_0x528eb7,'kind':_0x1e6a70[_0x23e1cd(0xc1)]!==undefined?parseInt(_0x1e6a70['kind'],0xa):undefined,'segmentFolderId':_0x4b1b5f},_0x1a386e=await withSpinner(_0x23e1cd(0xd8)+_0x3fff35[_0x23e1cd(0xc3)]+_0x23e1cd(0xd7),()=>_0x3165ff[_0x23e1cd(0xc2)][_0x23e1cd(0xce)](_0x2eb830,_0x2a2649,_0x10e97e),{'verbose':_0x1e6a70[_0x23e1cd(0xc6)]}),_0x1029a4=_0x1a386e['data'];return console[_0x23e1cd(0xd5)](_0x23e1cd(0xdc)+_0x1029a4[_0x23e1cd(0xc7)]+'\x27'),_0x48328d!==_0x10b334&&console[_0x23e1cd(0xd5)](_0x23e1cd(0xc9)+_0x48328d),await handleSDKOutput([_0x1029a4],_0x1e6a70),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x1f3307=a37_0x1a41;(function(_0x2e902c,_0x4d287e){const _0x145744=a37_0x1a41,_0x1a5b0c=_0x2e902c();while(!![]){try{const _0x14d773=parseInt(_0x145744(0x13d))/0x1*(parseInt(_0x145744(0x171))/0x2)+-parseInt(_0x145744(0x168))/0x3+-parseInt(_0x145744(0x163))/0x4+parseInt(_0x145744(0x174))/0x5+-parseInt(_0x145744(0x145))/0x6*(parseInt(_0x145744(0x152))/0x7)+-parseInt(_0x145744(0x14f))/0x8*(parseInt(_0x145744(0x162))/0x9)+parseInt(_0x145744(0x148))/0xa;if(_0x14d773===_0x4d287e)break;else _0x1a5b0c['push'](_0x1a5b0c['shift']());}catch(_0x17ce6f){_0x1a5b0c['push'](_0x1a5b0c['shift']());}}}(a37_0x4433,0xf0e61));import{existsSync,statSync}from'fs';import a37_0x1bfb17 from'chalk';import{BaseCommand}from'./command.js';function a37_0x4433(){const _0x38dd26=['data','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','site','length','description','60322MGTXAN','red','log','4224125SdkQib','\x27...','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','resolvePathToResource','29BSKMjI','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segmentPath','error','cyan','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Resolving\x20path\x20\x27','verbose','600630uRkcVb','Site:\x20','isDirectory','27662380UXrCUM','folderPath','Examples:','segment','parentName','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Resolved\x20path\x20type:\x20','4554840lJrjvW','join','green','112vporjI','parent_segment','slice','execute','dim','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','split','isAbsolute','folderId','segments','✔\x20Context\x20set\x20to:\x20','segment:use','Parent\x20ID:\x20','type','Folder\x20ID:\x20','fullPath','9gumfYY','717364tvJlfV','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','session','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Use:\x20tdx\x20segment\x20use\x20','3445905QuXXQj','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','name'];a37_0x4433=function(){return _0x38dd26;};return a37_0x4433();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a37_0x1a41(_0x23922f,_0x132a89){_0x23922f=_0x23922f-0x13d;const _0x4433d0=a37_0x4433();let _0x1a4148=_0x4433d0[_0x23922f];return _0x1a4148;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a37_0x1f3307(0x16b)]=a37_0x1f3307(0x15d);[a37_0x1f3307(0x170)]=a37_0x1f3307(0x164);async[a37_0x1f3307(0x155)](_0x179d83){const _0x266648=a37_0x1f3307,{options:_0x568099,args:_0x1b5ef7,tdx:_0x3de53f}=_0x179d83;if(_0x1b5ef7[_0x266648(0x16f)]===0x0)return console[_0x266648(0x140)](a37_0x1bfb17[_0x266648(0x172)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x266648(0x140)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x266648(0x140)](_0x266648(0x14a)),console['error'](_0x266648(0x14d)),console[_0x266648(0x140)](_0x266648(0x142)),console[_0x266648(0x140)](_0x266648(0x177)),console[_0x266648(0x140)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x180d5e=_0x1b5ef7[0x0],_0x641e63=_0x568099[_0x266648(0x165)];try{if(_0x180d5e==='/')return saveSessionContext({'segment_path':undefined},_0x641e63),console['log'](a37_0x1bfb17[_0x266648(0x151)](_0x266648(0x166))),0x0;if(existsSync(_0x180d5e)&&statSync(_0x180d5e)[_0x266648(0x147)]()){let _0x472ea1;try{_0x472ea1=findTdxConfig(_0x180d5e);}catch{return console['error'](a37_0x1bfb17[_0x266648(0x172)](_0x266648(0x13e)+_0x180d5e)),console[_0x266648(0x140)](a37_0x1bfb17['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x45e316=_0x472ea1['config'][_0x266648(0x153)];return saveSessionContext({'segment_path':_0x45e316,'parent_segment':_0x45e316},_0x641e63),console[_0x266648(0x173)](a37_0x1bfb17[_0x266648(0x151)](_0x266648(0x15c)+a37_0x1bfb17[_0x266648(0x141)](_0x45e316))),0x0;}const _0x26901e=_0x568099[_0x266648(0x13f)];let _0x1a068d=_0x180d5e;const _0x271e01=parsePath(_0x180d5e);if(!_0x271e01[_0x266648(0x159)]){if(!_0x26901e)return console[_0x266648(0x140)](a37_0x1bfb17['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x266648(0x140)](a37_0x1bfb17[_0x266648(0x141)](_0x266648(0x16d))),0x1;if(_0x180d5e==='..'){const _0x173ea6=_0x26901e[_0x266648(0x158)]('/')[_0x266648(0x154)](0x0,-0x1)[_0x266648(0x150)]('/');_0x1a068d=_0x173ea6||'/';}else _0x180d5e==='.'?_0x1a068d=_0x26901e:_0x1a068d=_0x26901e+'/'+_0x180d5e;_0x568099['verbose']&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x1a068d);}if(_0x1a068d==='/'||_0x1a068d==='')return saveSessionContext({'segment_path':undefined},_0x641e63),console['log'](a37_0x1bfb17['green'](_0x266648(0x166))),0x0;_0x1a068d=normalizePath(_0x1a068d);const _0x482105=parsePath(_0x1a068d)[_0x266648(0x15b)];if(_0x482105[_0x266648(0x16f)]===0x0)return saveSessionContext({'segment_path':undefined},_0x641e63),console[_0x266648(0x173)](a37_0x1bfb17[_0x266648(0x151)](_0x266648(0x166))),0x0;_0x568099[_0x266648(0x144)]&&(console[_0x266648(0x140)](_0x266648(0x146)+_0x568099[_0x266648(0x16e)]),console[_0x266648(0x140)]('Target\x20path:\x20'+_0x1a068d));const _0x74aaf7=await withSpinner(_0x266648(0x143)+_0x1a068d+_0x266648(0x175),()=>_0x3de53f[_0x266648(0x14b)][_0x266648(0x178)](_0x1a068d),{'verbose':_0x568099[_0x266648(0x144)]}),_0x457ff0=_0x74aaf7[_0x266648(0x16c)];_0x568099[_0x266648(0x144)]&&(console[_0x266648(0x140)](_0x266648(0x14e)+_0x457ff0[_0x266648(0x15f)]),console[_0x266648(0x140)](_0x266648(0x15e)+_0x457ff0['parentId']),_0x457ff0[_0x266648(0x15a)]&&console[_0x266648(0x140)](_0x266648(0x160)+_0x457ff0[_0x266648(0x15a)]));if(_0x457ff0[_0x266648(0x15f)]===_0x266648(0x14b))return console[_0x266648(0x140)](a37_0x1bfb17[_0x266648(0x172)](_0x266648(0x169))),console['error'](_0x266648(0x16a)),console['error'](a37_0x1bfb17[_0x266648(0x141)](_0x266648(0x167)+_0x457ff0[_0x266648(0x14c)]+(_0x457ff0[_0x266648(0x149)]?'/'+_0x457ff0[_0x266648(0x149)][_0x266648(0x150)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x457ff0[_0x266648(0x161)],'parent_segment':_0x457ff0['parentName']},_0x641e63),console['log'](a37_0x1bfb17[_0x266648(0x151)](_0x266648(0x15c)+a37_0x1bfb17[_0x266648(0x141)](_0x457ff0[_0x266648(0x161)]))),_0x568099['verbose']&&(console['error'](a37_0x1bfb17[_0x266648(0x156)](_0x266648(0x157))),console[_0x266648(0x140)](a37_0x1bfb17[_0x266648(0x156)](_0x266648(0x176)))),0x0;}catch(_0x37b4c4){throw _0x37b4c4;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x1d5bf4=a38_0x30f4;(function(_0x4d8c68,_0x165a98){const _0x2de0d7=a38_0x30f4,_0x4915be=_0x4d8c68();while(!![]){try{const _0x434c47=-parseInt(_0x2de0d7(0x124))/0x1+-parseInt(_0x2de0d7(0x143))/0x2*(-parseInt(_0x2de0d7(0x11c))/0x3)+-parseInt(_0x2de0d7(0x12f))/0x4+parseInt(_0x2de0d7(0x137))/0x5+parseInt(_0x2de0d7(0x11d))/0x6*(parseInt(_0x2de0d7(0x118))/0x7)+parseInt(_0x2de0d7(0x13b))/0x8+parseInt(_0x2de0d7(0x126))/0x9;if(_0x434c47===_0x165a98)break;else _0x4915be['push'](_0x4915be['shift']());}catch(_0x82e95){_0x4915be['push'](_0x4915be['shift']());}}}(a38_0x1ccc,0x18aca));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 a38_0x37a4cf from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a38_0x30f4(_0x5756cd,_0x3ccaa4){_0x5756cd=_0x5756cd-0x116;const _0x1ccce9=a38_0x1ccc();let _0x30f454=_0x1ccce9[_0x5756cd];return _0x30f454;}export class SegmentValidateCommand extends BaseCommand{[a38_0x1d5bf4(0x12d)]='segment:validate';[a38_0x1d5bf4(0x141)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x51b460){const _0x40baa7=a38_0x1d5bf4,{options:_0x256cba,args:_0x18161e}=_0x51b460,_0x2f4f06=_0x256cba,_0x3c24c1=await resolveTarget({'arg':_0x18161e[0x0],'contextParent':_0x256cba[_0x40baa7(0x134)],'cwd':process[_0x40baa7(0x13a)]()});if(!isSuccessfulResolution(_0x3c24c1))return _0x3c24c1[_0x40baa7(0x131)]===_0x40baa7(0x11f)?(console[_0x40baa7(0x119)](a38_0x37a4cf[_0x40baa7(0x146)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x40baa7(0x145)),console['error'](_0x40baa7(0x13d)),console[_0x40baa7(0x119)](_0x40baa7(0x120))):(console[_0x40baa7(0x119)](a38_0x37a4cf[_0x40baa7(0x128)](_0x40baa7(0x12c)+_0x3c24c1[_0x40baa7(0x140)]+'\x0a')),_0x3c24c1[_0x40baa7(0x11e)]&&console[_0x40baa7(0x119)](a38_0x37a4cf[_0x40baa7(0x142)](_0x3c24c1[_0x40baa7(0x11e)]))),0x1;const _0x3e7b47=_0x3c24c1[_0x40baa7(0x135)],_0x104bf7=_0x3c24c1[_0x40baa7(0x132)]==='file'?_0x3c24c1[_0x40baa7(0x12b)]:undefined;if(!_0x104bf7&&!existsSync(_0x3e7b47))return console[_0x40baa7(0x119)](a38_0x37a4cf[_0x40baa7(0x128)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3e7b47+'\x0a')),0x1;let _0x129d73;if(_0x104bf7){if(!_0x104bf7['endsWith'](_0x40baa7(0x136))&&!_0x104bf7[_0x40baa7(0x125)]('.yaml'))return console['error'](a38_0x37a4cf['red'](_0x40baa7(0x13e)+_0x104bf7+'\x0a')),0x1;_0x129d73=[_0x104bf7];}else _0x129d73=findYamlFiles(_0x3e7b47);if(_0x129d73[_0x40baa7(0x147)]===0x0)return console[_0x40baa7(0x119)](a38_0x37a4cf['red'](_0x40baa7(0x129)+_0x3e7b47+'\x0a')),0x1;const _0x5ab35e=validateYamlFiles(_0x129d73,_0x3e7b47),_0x55eba5=calculateSummary(_0x5ab35e);for(const _0x34be63 of _0x5ab35e){if(!isValidationResult(_0x34be63))continue;const {relativePath:_0x39bf51,source:_0x27abf9,result:_0x4f4ff8,fileType:_0x3dd912}=_0x34be63,_0x6188fd=_0x3dd912;if(_0x4f4ff8['valid']&&_0x4f4ff8[_0x40baa7(0x130)][_0x40baa7(0x147)]===0x0)_0x2f4f06[_0x40baa7(0x122)]&&console['log'](a38_0x37a4cf[_0x40baa7(0x127)]('✔\x20'+_0x39bf51)+a38_0x37a4cf[_0x40baa7(0x12e)]('\x20('+_0x6188fd+')'));else _0x4f4ff8[_0x40baa7(0x138)]?(console['log'](a38_0x37a4cf[_0x40baa7(0x146)]('⚠\x20'+_0x39bf51)+a38_0x37a4cf[_0x40baa7(0x12e)]('\x20('+_0x6188fd+'):\x20'+_0x4f4ff8[_0x40baa7(0x130)]['length']+_0x40baa7(0x13f))),console['log'](formatValidationResult(_0x4f4ff8,_0x27abf9,_0x39bf51))):(console[_0x40baa7(0x133)](a38_0x37a4cf['red']('✖\x20'+_0x39bf51)+a38_0x37a4cf[_0x40baa7(0x12e)]('\x20('+_0x6188fd+_0x40baa7(0x11a)+_0x4f4ff8[_0x40baa7(0x121)][_0x40baa7(0x147)]+_0x40baa7(0x13c))),console[_0x40baa7(0x133)](formatValidationResult(_0x4f4ff8,_0x27abf9,_0x39bf51)));}return console[_0x40baa7(0x133)](''),_0x55eba5[_0x40baa7(0x12a)]?(console[_0x40baa7(0x133)](a38_0x37a4cf[_0x40baa7(0x128)]('Validation\x20failed:\x20'+_0x55eba5['invalidCount']+'\x20file(s)\x20with\x20errors,\x20'+_0x55eba5[_0x40baa7(0x139)]+_0x40baa7(0x123))),_0x55eba5[_0x40baa7(0x116)]>0x0&&console[_0x40baa7(0x133)](a38_0x37a4cf[_0x40baa7(0x146)](_0x55eba5[_0x40baa7(0x116)]+'\x20warning(s)\x20found')),0x1):(console[_0x40baa7(0x133)](a38_0x37a4cf[_0x40baa7(0x127)](_0x40baa7(0x144)+_0x55eba5[_0x40baa7(0x139)]+_0x40baa7(0x11b))),_0x55eba5[_0x40baa7(0x116)]>0x0&&console[_0x40baa7(0x133)](a38_0x37a4cf[_0x40baa7(0x146)](_0x55eba5[_0x40baa7(0x116)]+_0x40baa7(0x117))),0x0);}}function a38_0x1ccc(){const _0x56dc0b=['64166fuqlfj','✔\x20All\x20','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','yellow','length','warningCount','\x20warning(s)\x20found','79009wYVAod','error','):\x20','\x20file(s)\x20valid','15ffnouR','48DIUqht','helpText','no_parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','errors','verbose','\x20valid','185468nKnftn','endsWith','323469cmwRJT','green','red','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','hasErrors','filePath','Error:\x20','name','dim','255904bNtcny','warnings','errorCode','type','log','parentSegment','targetDir','.yml','112090XUZvtH','valid','validCount','cwd','331520kGPhFh','\x20error(s)','\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','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20warning(s)','message','description','cyan'];a38_0x1ccc=function(){return _0x56dc0b;};return a38_0x1ccc();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x5b33b1=a39_0x46d4;function a39_0x46d4(_0x5002ff,_0x55e69d){_0x5002ff=_0x5002ff-0x12b;const _0xa953c8=a39_0xa953();let _0x46d4d5=_0xa953c8[_0x5002ff];return _0x46d4d5;}(function(_0x23b622,_0x2338e9){const _0x43fb84=a39_0x46d4,_0x5be167=_0x23b622();while(!![]){try{const _0x138fb3=-parseInt(_0x43fb84(0x164))/0x1*(-parseInt(_0x43fb84(0x158))/0x2)+-parseInt(_0x43fb84(0x130))/0x3*(-parseInt(_0x43fb84(0x12e))/0x4)+parseInt(_0x43fb84(0x171))/0x5*(-parseInt(_0x43fb84(0x14f))/0x6)+-parseInt(_0x43fb84(0x153))/0x7+-parseInt(_0x43fb84(0x154))/0x8+parseInt(_0x43fb84(0x16e))/0x9+-parseInt(_0x43fb84(0x14d))/0xa*(-parseInt(_0x43fb84(0x15e))/0xb);if(_0x138fb3===_0x2338e9)break;else _0x5be167['push'](_0x5be167['shift']());}catch(_0x2670f4){_0x5be167['push'](_0x5be167['shift']());}}}(a39_0xa953,0x9c500));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a39_0xa953(){const _0x1d576b=['replace','listRecursive','name','Folder/pattern\x20arg:\x20','\x5c$&','length','✔\x20Built\x20tree\x20with\x20','journeyBundleName','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','message','Resolving\x20path\x20\x27','verbose','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Site:\x20','parentId','resolvePathToResource','(empty)','recursive','dim','/j/da','/e/','test','jsonl','data','parentSegment','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','24727330aCLHcI','type','6UEGvCF',']\x20matching\x20\x27','\x20\x20Cause:\x20','log','6884269qTRKBV','5001936beVNbG','✔\x20Found\x20','No\x20items\x20match\x20pattern:\x20','\x20matching\x20\x27','2BKKjFm','journey','\x20journey','\x20folder','Building\x20hierarchy\x20tree...','Error:\x20No\x20parent\x20segment\x20context\x20set.','11KEbjwE','Error:\x20','error','/app/ps/','map','Parent\x20segment\x20context:\x20','151252tdXcEi','localeCompare','listUnified','\x27...','site','sort','json','folderId','\x20segment','Set\x20a\x20parent\x20segment\x20context\x20first:','1691964HMtqCI','journeys','cause','3042315eeglLD','Listing\x20folders,\x20segments,\x20and\x20journeys...','segments','folders','listWithPattern','List\x20folders\x20and\x20child\x20segments','Resolving\x20parent\x20segment\x20\x27','children','segment','filter','folder','format','181788OWmjhk','Parent\x20ID:\x20','3dhJFAT','Recursive\x20mode:\x20enabled',',\x20and\x20'];a39_0xa953=function(){return _0x1d576b;};return a39_0xa953();}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 a39_0x159aa7 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a39_0x5b33b1(0x173);['description']=a39_0x5b33b1(0x176);async['execute'](_0xc7ae90){const _0x3a11c5=a39_0x5b33b1,{options:_0x2b91b1,args:_0x149d65}=_0xc7ae90,_0x1c13a1=_0x2b91b1[_0x3a11c5(0x144)],_0x475874=_0x149d65[0x0];try{const _0x122cff=_0x2b91b1[_0x3a11c5(0x14b)];_0x2b91b1[_0x3a11c5(0x13e)]&&(console[_0x3a11c5(0x160)](_0x3a11c5(0x140)+_0x2b91b1[_0x3a11c5(0x168)]),console['error'](_0x3a11c5(0x163)+(_0x122cff||'(not\x20set)')),_0x475874&&console[_0x3a11c5(0x160)](_0x3a11c5(0x136)+_0x475874),_0x1c13a1&&console[_0x3a11c5(0x160)](_0x3a11c5(0x131)));if(!_0x122cff)return console[_0x3a11c5(0x160)](_0x3a11c5(0x15d)),console['error'](''),console[_0x3a11c5(0x160)](_0x3a11c5(0x16d)),console[_0x3a11c5(0x160)](_0x3a11c5(0x13b)),console[_0x3a11c5(0x160)](_0x3a11c5(0x13f)),console['error'](''),console[_0x3a11c5(0x160)](_0x3a11c5(0x14c)),0x1;const _0x2c0c27=_0x475874&&(_0x475874['includes']('*')||_0x475874['includes']('?'));if(_0x2c0c27)return await this['listWithPattern'](_0xc7ae90,_0x122cff,_0x475874);const _0x4346c0=_0x475874?_0x122cff+'/'+_0x475874:_0x122cff;return _0x1c13a1?await this[_0x3a11c5(0x134)](_0xc7ae90,_0x4346c0):await this[_0x3a11c5(0x166)](_0xc7ae90,_0x4346c0);}catch(_0x682c4f){if(_0x682c4f instanceof SDKError)return console['error'](_0x3a11c5(0x15f)+_0x682c4f[_0x3a11c5(0x13c)]),_0x682c4f[_0x3a11c5(0x170)]&&console[_0x3a11c5(0x160)](_0x3a11c5(0x151)+_0x682c4f[_0x3a11c5(0x170)]),0x1;throw _0x682c4f;}}async[a39_0x5b33b1(0x175)](_0x4a8388,_0x547165,_0x262669){const _0xc95752=a39_0x5b33b1,{options:_0x4da334,tdx:_0x39f633}=_0x4a8388,_0x4d72cc=await withSpinner(_0xc95752(0x177)+_0x547165+_0xc95752(0x167),()=>_0x39f633[_0xc95752(0x179)][_0xc95752(0x142)](_0x547165),{'verbose':_0x4da334[_0xc95752(0x13e)]}),_0x32f327=_0x4d72cc['data'],_0x4e1d0e=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x39f633['segment']['listUnifiedWithJourneys'](_0x32f327[_0xc95752(0x141)],_0x32f327[_0xc95752(0x16b)]),{'verbose':_0x4da334[_0xc95752(0x13e)]}),{folders:_0x3fe161,segments:_0x3672c8,journeys:_0x1a5b5b}=_0x4e1d0e['data'],_0x50a6ed=_0x262669[_0xc95752(0x133)](/[.+^${}()|[\]\\]/g,_0xc95752(0x137))[_0xc95752(0x133)](/\*/g,'.*')[_0xc95752(0x133)](/\?/g,'.'),_0x30f87f=new RegExp('^'+_0x50a6ed+'$','i'),_0x4f31d4=_0x3fe161[_0xc95752(0x12b)](_0x24aff7=>_0x30f87f[_0xc95752(0x148)](_0x24aff7[_0xc95752(0x135)])),_0x4a1906=_0x3672c8[_0xc95752(0x12b)](_0x4234b5=>_0x30f87f[_0xc95752(0x148)](_0x4234b5[_0xc95752(0x135)])),_0x2912a0=_0x1a5b5b[_0xc95752(0x12b)](_0x30e033=>_0x30f87f['test'](_0x30e033[_0xc95752(0x13a)])),_0x33cde8=_0x4f31d4[_0xc95752(0x138)]+_0x4a1906[_0xc95752(0x138)]+_0x2912a0[_0xc95752(0x138)];console[_0xc95752(0x160)](_0xc95752(0x155)+_0x4f31d4['length']+_0xc95752(0x15b)+(_0x4f31d4[_0xc95752(0x138)]!==0x1?'s':'')+',\x20'+_0x4a1906[_0xc95752(0x138)]+_0xc95752(0x16c)+(_0x4a1906[_0xc95752(0x138)]!==0x1?'s':'')+',\x20and\x20'+_0x2912a0['length']+_0xc95752(0x15a)+(_0x2912a0[_0xc95752(0x138)]!==0x1?'s':'')+_0xc95752(0x157)+_0x262669+'\x27');const _0x239445=_0x553471=>{const _0x38ddcb=_0xc95752;return getConsoleNextUrl(_0x4da334[_0x38ddcb(0x168)],_0x38ddcb(0x161)+_0x32f327['parentId']+_0x38ddcb(0x147)+_0x553471);},_0x447b79=_0x4da334[_0xc95752(0x12d)]===_0xc95752(0x16a)||_0x4da334['format']===_0xc95752(0x149);if(_0x447b79){const _0x1469e6=[..._0x4f31d4[_0xc95752(0x162)](_0x24204a=>({..._0x24204a,'type':_0xc95752(0x12c)})),..._0x4a1906[_0xc95752(0x162)](_0x32be1f=>({..._0x32be1f,'type':'segment','url':_0x239445(_0x32be1f['id'])})),..._0x2912a0[_0xc95752(0x162)](_0x6751f2=>({..._0x6751f2,'name':_0x6751f2[_0xc95752(0x13a)],'type':_0xc95752(0x159)}))][_0xc95752(0x169)]((_0x295b70,_0x379507)=>_0x295b70['name']['localeCompare'](_0x379507[_0xc95752(0x135)]));await handleSDKOutput(_0x1469e6,_0x4da334);}else{if(_0x33cde8===0x0)console[_0xc95752(0x152)](_0xc95752(0x156)+_0x262669);else{console[_0xc95752(0x152)](a39_0x159aa7[_0xc95752(0x145)]('['+_0x547165+_0xc95752(0x150)+_0x262669+'\x27'));const _0x72f31=formatFlatList(_0x4f31d4,_0x4a1906,{'showMetadata':!![],'getSegmentUrl':_0x239445},_0x2912a0);console[_0xc95752(0x152)](_0x72f31);}}return 0x0;}async['listUnified'](_0x3afb00,_0x2b746f){const _0x16de15=a39_0x5b33b1,{options:_0x3cb141,tdx:_0xf5f9fe}=_0x3afb00,_0x3c0af8=await withSpinner(_0x16de15(0x13d)+_0x2b746f+_0x16de15(0x167),()=>_0xf5f9fe[_0x16de15(0x179)]['resolvePathToResource'](_0x2b746f),{'verbose':_0x3cb141['verbose']}),_0x226262=_0x3c0af8['data'];_0x3cb141[_0x16de15(0x13e)]&&(console[_0x16de15(0x160)](_0x16de15(0x12f)+_0x226262[_0x16de15(0x141)]),_0x226262[_0x16de15(0x16b)]&&console[_0x16de15(0x160)]('Folder\x20ID:\x20'+_0x226262[_0x16de15(0x16b)]));const _0x2ef7d5=await withSpinner(_0x16de15(0x172),()=>_0xf5f9fe[_0x16de15(0x179)]['listUnifiedWithJourneys'](_0x226262['parentId'],_0x226262[_0x16de15(0x16b)]),{'verbose':_0x3cb141[_0x16de15(0x13e)]}),{folders:_0x2ed58a,segments:_0x5ba9ef,journeys:_0xdf90d6}=_0x2ef7d5[_0x16de15(0x14a)],_0x142e9e=_0x2ed58a[_0x16de15(0x138)]+_0x5ba9ef['length']+_0xdf90d6[_0x16de15(0x138)];console[_0x16de15(0x160)](_0x16de15(0x155)+_0x2ed58a[_0x16de15(0x138)]+_0x16de15(0x15b)+(_0x2ed58a[_0x16de15(0x138)]!==0x1?'s':'')+',\x20'+_0x5ba9ef[_0x16de15(0x138)]+'\x20segment'+(_0x5ba9ef[_0x16de15(0x138)]!==0x1?'s':'')+',\x20and\x20'+_0xdf90d6[_0x16de15(0x138)]+_0x16de15(0x15a)+(_0xdf90d6['length']!==0x1?'s':''));const _0x58ab2a=_0x365ecb=>{const _0x4e522e=_0x16de15;return getConsoleNextUrl(_0x3cb141[_0x4e522e(0x168)],'/app/ps/'+_0x226262[_0x4e522e(0x141)]+_0x4e522e(0x147)+_0x365ecb);},_0x14e3f9=_0x5f531b=>{const _0xeb8ec9=_0x16de15;return getConsoleNextUrl(_0x3cb141['site'],_0xeb8ec9(0x161)+_0x226262[_0xeb8ec9(0x141)]+_0xeb8ec9(0x147)+_0x5f531b+'/j/da');},_0x3df366=_0x3cb141[_0x16de15(0x12d)]===_0x16de15(0x16a)||_0x3cb141[_0x16de15(0x12d)]===_0x16de15(0x149);if(_0x3df366){const _0x1a6fe9=[..._0x2ed58a[_0x16de15(0x162)](_0x3d1e90=>({..._0x3d1e90,'type':_0x16de15(0x12c)})),..._0x5ba9ef['map'](_0x3412e3=>({..._0x3412e3,'type':_0x16de15(0x179),'url':_0x58ab2a(_0x3412e3['id'])})),..._0xdf90d6[_0x16de15(0x162)](_0xfd4038=>({..._0xfd4038,'name':_0xfd4038['journeyBundleName'],'type':_0x16de15(0x159),'url':_0x14e3f9(_0xfd4038['id'])}))][_0x16de15(0x169)]((_0x6de6cd,_0x93c124)=>_0x6de6cd[_0x16de15(0x135)][_0x16de15(0x165)](_0x93c124[_0x16de15(0x135)]));await handleSDKOutput(_0x1a6fe9,_0x3cb141);}else{if(_0x142e9e===0x0)console[_0x16de15(0x152)](a39_0x159aa7['dim']('['+_0x2b746f+']')),console[_0x16de15(0x152)](_0x16de15(0x143));else{console[_0x16de15(0x152)](a39_0x159aa7['dim']('['+_0x2b746f+']'));const _0x351dd3=formatFlatList(_0x2ed58a,_0x5ba9ef,{'showMetadata':!![],'getSegmentUrl':_0x58ab2a,'getJourneyUrl':_0x14e3f9},_0xdf90d6);console[_0x16de15(0x152)](_0x351dd3);}}return 0x0;}async[a39_0x5b33b1(0x134)](_0x569439,_0x10bde4){const _0x2c8d9c=a39_0x5b33b1,{options:_0x56dbcc,tdx:_0x37ddb2}=_0x569439,_0x4f7979=await withSpinner(_0x2c8d9c(0x13d)+_0x10bde4+_0x2c8d9c(0x167),()=>_0x37ddb2[_0x2c8d9c(0x179)]['resolvePathToResource'](_0x10bde4),{'verbose':_0x56dbcc[_0x2c8d9c(0x13e)]}),_0xd8da10=_0x4f7979['data'];_0x56dbcc['verbose']&&(console['error'](_0x2c8d9c(0x12f)+_0xd8da10[_0x2c8d9c(0x141)]),_0xd8da10['folderId']&&console[_0x2c8d9c(0x160)]('Folder\x20ID:\x20'+_0xd8da10[_0x2c8d9c(0x16b)]));const _0x1dfdb8=_0x56dbcc['maxDepth']||0xa,_0x13c87c=await withSpinner(_0x2c8d9c(0x15c),()=>_0x37ddb2[_0x2c8d9c(0x179)]['listRecursive'](_0xd8da10[_0x2c8d9c(0x141)],_0xd8da10[_0x2c8d9c(0x16b)],0x0,_0x1dfdb8),{'verbose':_0x56dbcc[_0x2c8d9c(0x13e)]}),_0x2329b4=_0x13c87c['data'],_0x20cd0b=_0x13dcf9=>{const _0x1ec125=_0x2c8d9c;let _0x5c12bd=0x0,_0x48a317=0x0,_0x51d6c6=0x0;for(const _0x542bcf of _0x13dcf9){if(_0x542bcf['type']==='folder')_0x5c12bd++;else{if(_0x542bcf[_0x1ec125(0x14e)]===_0x1ec125(0x179))_0x48a317++;else{if(_0x542bcf['type']==='journey')_0x51d6c6++;}}if(_0x542bcf[_0x1ec125(0x178)]){const _0x344d58=_0x20cd0b(_0x542bcf['children']);_0x5c12bd+=_0x344d58[_0x1ec125(0x174)],_0x48a317+=_0x344d58['segments'],_0x51d6c6+=_0x344d58[_0x1ec125(0x16f)];}}return{'folders':_0x5c12bd,'segments':_0x48a317,'journeys':_0x51d6c6};},_0x5b08ad=_0x20cd0b(_0x2329b4);console['error'](_0x2c8d9c(0x139)+_0x5b08ad[_0x2c8d9c(0x174)]+'\x20folder'+(_0x5b08ad[_0x2c8d9c(0x174)]!==0x1?'s':'')+',\x20'+_0x5b08ad['segments']+'\x20segment'+(_0x5b08ad['segments']!==0x1?'s':'')+_0x2c8d9c(0x132)+_0x5b08ad[_0x2c8d9c(0x16f)]+_0x2c8d9c(0x15a)+(_0x5b08ad[_0x2c8d9c(0x16f)]!==0x1?'s':''));const _0xa1cf68=_0x35ee3e=>{const _0x288094=_0x2c8d9c;return getConsoleNextUrl(_0x56dbcc[_0x288094(0x168)],'/app/ps/'+_0xd8da10[_0x288094(0x141)]+_0x288094(0x147)+_0x35ee3e);},_0x1fafba=_0x425f80=>{const _0x20dc32=_0x2c8d9c;return getConsoleNextUrl(_0x56dbcc['site'],'/app/ps/'+_0xd8da10['parentId']+_0x20dc32(0x147)+_0x425f80+_0x20dc32(0x146));};if(_0x56dbcc['format']===_0x2c8d9c(0x16a)||_0x56dbcc[_0x2c8d9c(0x12d)]===_0x2c8d9c(0x149))await handleSDKOutput(_0x2329b4,_0x56dbcc);else{console[_0x2c8d9c(0x152)](a39_0x159aa7[_0x2c8d9c(0x145)]('['+_0x10bde4+']'));const _0x353023=formatTree(_0x2329b4,{'showMetadata':!![],'getSegmentUrl':_0xa1cf68,'getJourneyUrl':_0x1fafba});console[_0x2c8d9c(0x152)](_0x353023);}return 0x0;}}
|
|
1
|
+
const a39_0x5ce2b6=a39_0x4ef1;(function(_0x1de532,_0x3dd023){const _0x4d7cf1=a39_0x4ef1,_0x103e4c=_0x1de532();while(!![]){try{const _0x40f305=-parseInt(_0x4d7cf1(0x76))/0x1*(parseInt(_0x4d7cf1(0xa8))/0x2)+parseInt(_0x4d7cf1(0x7a))/0x3+-parseInt(_0x4d7cf1(0x91))/0x4*(-parseInt(_0x4d7cf1(0xb3))/0x5)+parseInt(_0x4d7cf1(0x89))/0x6+-parseInt(_0x4d7cf1(0x9e))/0x7*(parseInt(_0x4d7cf1(0x74))/0x8)+-parseInt(_0x4d7cf1(0x71))/0x9+parseInt(_0x4d7cf1(0xa4))/0xa;if(_0x40f305===_0x3dd023)break;else _0x103e4c['push'](_0x103e4c['shift']());}catch(_0x471481){_0x103e4c['push'](_0x103e4c['shift']());}}}(a39_0xeba8,0x79c67));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 a39_0xeba8(){const _0x1a0717=['68kOJZnV','verbose','test','listUnifiedWithJourneys','children','maxDepth','Listing\x20folders,\x20segments,\x20and\x20journeys...','listUnified','No\x20items\x20match\x20pattern:\x20','message','segments','List\x20folders\x20and\x20child\x20segments','replace','5078031LLvFSk','Parent\x20segment\x20context:\x20','folderId',',\x20and\x20','Folder\x20ID:\x20','\x20segment','11000280GLGfcv','parentId','journeyBundleName','filter','502GuggJt','Error:\x20','/j/da','Site:\x20','log','type','jsonl','data','description','\x27...','dim','132980ynUYNZ','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Building\x20hierarchy\x20tree...','Resolving\x20path\x20\x27','execute',']\x20matching\x20\x27','(empty)','Recursive\x20mode:\x20enabled','/e/','site','✔\x20Found\x20','4272543pNnLni','journeys','resolvePathToResource','8UtPCDM','(not\x20set)','2942NRYQEM','Parent\x20ID:\x20','/app/ps/','includes','1538556ObJEHP','\x20matching\x20\x27','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20journey','\x20folder','length','error','Error:\x20No\x20parent\x20segment\x20context\x20set.','Set\x20a\x20parent\x20segment\x20context\x20first:','localeCompare','journey','json','segment','format','listRecursive','2234286vrkNcO','folders','map','listWithPattern','Resolving\x20parent\x20segment\x20\x27','recursive','name','Folder/pattern\x20arg:\x20'];a39_0xeba8=function(){return _0x1a0717;};return a39_0xeba8();}function a39_0x4ef1(_0x34cf23,_0x445d19){_0x34cf23=_0x34cf23-0x6f;const _0xeba86d=a39_0xeba8();let _0x4ef1dc=_0xeba86d[_0x34cf23];return _0x4ef1dc;}import a39_0x550de9 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a39_0x5ce2b6(0x9b);[a39_0x5ce2b6(0xb0)]=a39_0x5ce2b6(0x9c);async[a39_0x5ce2b6(0xb7)](_0xf43918){const _0x501ee5=a39_0x5ce2b6,{options:_0xb9a5,args:_0x371a89}=_0xf43918,_0x3b2cae=_0xb9a5[_0x501ee5(0x8e)],_0x1cc80c=_0x371a89[0x0];try{const _0x3cb21d=_0xb9a5['parentSegment'];_0xb9a5['verbose']&&(console[_0x501ee5(0x80)](_0x501ee5(0xab)+_0xb9a5[_0x501ee5(0x6f)]),console[_0x501ee5(0x80)](_0x501ee5(0x9f)+(_0x3cb21d||_0x501ee5(0x75))),_0x1cc80c&&console[_0x501ee5(0x80)](_0x501ee5(0x90)+_0x1cc80c),_0x3b2cae&&console[_0x501ee5(0x80)](_0x501ee5(0xba)));if(!_0x3cb21d)return console[_0x501ee5(0x80)](_0x501ee5(0x81)),console[_0x501ee5(0x80)](''),console[_0x501ee5(0x80)](_0x501ee5(0x82)),console[_0x501ee5(0x80)](_0x501ee5(0xb4)),console[_0x501ee5(0x80)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x501ee5(0x80)](''),console[_0x501ee5(0x80)](_0x501ee5(0x7c)),0x1;const _0x424419=_0x1cc80c&&(_0x1cc80c[_0x501ee5(0x79)]('*')||_0x1cc80c[_0x501ee5(0x79)]('?'));if(_0x424419)return await this[_0x501ee5(0x8c)](_0xf43918,_0x3cb21d,_0x1cc80c);const _0x4f66a5=_0x1cc80c?_0x3cb21d+'/'+_0x1cc80c:_0x3cb21d;return _0x3b2cae?await this[_0x501ee5(0x88)](_0xf43918,_0x4f66a5):await this['listUnified'](_0xf43918,_0x4f66a5);}catch(_0x13744c){if(_0x13744c instanceof SDKError)return console['error'](_0x501ee5(0xa9)+_0x13744c[_0x501ee5(0x9a)]),_0x13744c['cause']&&console[_0x501ee5(0x80)]('\x20\x20Cause:\x20'+_0x13744c['cause']),0x1;throw _0x13744c;}}async[a39_0x5ce2b6(0x8c)](_0x11c860,_0x1e4cce,_0x861890){const _0x483afe=a39_0x5ce2b6,{options:_0xd2c7d2,tdx:_0x1f3559}=_0x11c860,_0x5964c0=await withSpinner(_0x483afe(0x8d)+_0x1e4cce+_0x483afe(0xb1),()=>_0x1f3559['segment'][_0x483afe(0x73)](_0x1e4cce),{'verbose':_0xd2c7d2[_0x483afe(0x92)]}),_0x28a63b=_0x5964c0[_0x483afe(0xaf)],_0x48d8b2=await withSpinner(_0x483afe(0x97),()=>_0x1f3559['segment'][_0x483afe(0x94)](_0x28a63b[_0x483afe(0xa5)],_0x28a63b[_0x483afe(0xa0)]),{'verbose':_0xd2c7d2[_0x483afe(0x92)]}),{folders:_0x33f760,segments:_0x2ce15e,journeys:_0x1b386c}=_0x48d8b2[_0x483afe(0xaf)],_0x12f597=_0x861890[_0x483afe(0x9d)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x13b21d=new RegExp('^'+_0x12f597+'$','i'),_0x54135b=_0x33f760['filter'](_0x5ab5b5=>_0x13b21d[_0x483afe(0x93)](_0x5ab5b5[_0x483afe(0x8f)])),_0x2b6447=_0x2ce15e['filter'](_0x1cfe9e=>_0x13b21d['test'](_0x1cfe9e[_0x483afe(0x8f)])),_0x1aaeee=_0x1b386c[_0x483afe(0xa7)](_0x2a6288=>_0x13b21d[_0x483afe(0x93)](_0x2a6288[_0x483afe(0xa6)])),_0x2af11a=_0x54135b['length']+_0x2b6447[_0x483afe(0x7f)]+_0x1aaeee[_0x483afe(0x7f)];console['error'](_0x483afe(0x70)+_0x54135b[_0x483afe(0x7f)]+'\x20folder'+(_0x54135b[_0x483afe(0x7f)]!==0x1?'s':'')+',\x20'+_0x2b6447[_0x483afe(0x7f)]+'\x20segment'+(_0x2b6447['length']!==0x1?'s':'')+_0x483afe(0xa1)+_0x1aaeee[_0x483afe(0x7f)]+_0x483afe(0x7d)+(_0x1aaeee[_0x483afe(0x7f)]!==0x1?'s':'')+_0x483afe(0x7b)+_0x861890+'\x27');const _0x4f4333=_0x3d12ab=>{const _0xb155a1=_0x483afe;return getConsoleNextUrl(_0xd2c7d2[_0xb155a1(0x6f)],'/app/ps/'+_0x28a63b['parentId']+_0xb155a1(0xbb)+_0x3d12ab);},_0x3794c0=_0xd2c7d2[_0x483afe(0x87)]===_0x483afe(0x85)||_0xd2c7d2[_0x483afe(0x87)]==='jsonl';if(_0x3794c0){const _0x55c755=[..._0x54135b['map'](_0x4f10b3=>({..._0x4f10b3,'type':'folder'})),..._0x2b6447[_0x483afe(0x8b)](_0x168431=>({..._0x168431,'type':_0x483afe(0x86),'url':_0x4f4333(_0x168431['id'])})),..._0x1aaeee[_0x483afe(0x8b)](_0x470600=>({..._0x470600,'name':_0x470600[_0x483afe(0xa6)],'type':_0x483afe(0x84)}))]['sort']((_0x1f583b,_0x475672)=>_0x1f583b[_0x483afe(0x8f)][_0x483afe(0x83)](_0x475672[_0x483afe(0x8f)]));await handleSDKOutput(_0x55c755,_0xd2c7d2);}else{if(_0x2af11a===0x0)console[_0x483afe(0xac)](_0x483afe(0x99)+_0x861890);else{console[_0x483afe(0xac)](a39_0x550de9[_0x483afe(0xb2)]('['+_0x1e4cce+_0x483afe(0xb8)+_0x861890+'\x27'));const _0x26322e=formatFlatList(_0x54135b,_0x2b6447,{'showMetadata':!![],'getSegmentUrl':_0x4f4333},_0x1aaeee);console[_0x483afe(0xac)](_0x26322e);}}return 0x0;}async[a39_0x5ce2b6(0x98)](_0x1ea7ea,_0x4b569a){const _0x13f1df=a39_0x5ce2b6,{options:_0x24079e,tdx:_0x1cd724}=_0x1ea7ea,_0x4d7f22=await withSpinner(_0x13f1df(0xb6)+_0x4b569a+'\x27...',()=>_0x1cd724[_0x13f1df(0x86)][_0x13f1df(0x73)](_0x4b569a),{'verbose':_0x24079e['verbose']}),_0x2e5ff3=_0x4d7f22['data'];_0x24079e[_0x13f1df(0x92)]&&(console[_0x13f1df(0x80)](_0x13f1df(0x77)+_0x2e5ff3[_0x13f1df(0xa5)]),_0x2e5ff3[_0x13f1df(0xa0)]&&console[_0x13f1df(0x80)](_0x13f1df(0xa2)+_0x2e5ff3[_0x13f1df(0xa0)]));const _0x229b68=await withSpinner(_0x13f1df(0x97),()=>_0x1cd724[_0x13f1df(0x86)][_0x13f1df(0x94)](_0x2e5ff3[_0x13f1df(0xa5)],_0x2e5ff3[_0x13f1df(0xa0)]),{'verbose':_0x24079e['verbose']}),{folders:_0x249bf3,segments:_0x2e7806,journeys:_0x3dfdce}=_0x229b68[_0x13f1df(0xaf)],_0x4abcdf=_0x249bf3[_0x13f1df(0x7f)]+_0x2e7806[_0x13f1df(0x7f)]+_0x3dfdce[_0x13f1df(0x7f)];console[_0x13f1df(0x80)](_0x13f1df(0x70)+_0x249bf3['length']+_0x13f1df(0x7e)+(_0x249bf3[_0x13f1df(0x7f)]!==0x1?'s':'')+',\x20'+_0x2e7806['length']+_0x13f1df(0xa3)+(_0x2e7806[_0x13f1df(0x7f)]!==0x1?'s':'')+_0x13f1df(0xa1)+_0x3dfdce['length']+_0x13f1df(0x7d)+(_0x3dfdce[_0x13f1df(0x7f)]!==0x1?'s':''));const _0x1ec44a=_0x2d8d07=>{const _0xc77b54=_0x13f1df;return getConsoleNextUrl(_0x24079e[_0xc77b54(0x6f)],'/app/ps/'+_0x2e5ff3[_0xc77b54(0xa5)]+_0xc77b54(0xbb)+_0x2d8d07);},_0x470f2b=_0x77c3d9=>{const _0x1ea540=_0x13f1df;return getConsoleNextUrl(_0x24079e[_0x1ea540(0x6f)],_0x1ea540(0x78)+_0x2e5ff3['parentId']+'/e/'+_0x77c3d9+_0x1ea540(0xaa));},_0x59581d=_0x24079e[_0x13f1df(0x87)]===_0x13f1df(0x85)||_0x24079e[_0x13f1df(0x87)]===_0x13f1df(0xae);if(_0x59581d){const _0xbf7793=[..._0x249bf3[_0x13f1df(0x8b)](_0x10dfcc=>({..._0x10dfcc,'type':'folder'})),..._0x2e7806['map'](_0x47c835=>({..._0x47c835,'type':'segment','url':_0x1ec44a(_0x47c835['id'])})),..._0x3dfdce[_0x13f1df(0x8b)](_0x581808=>({..._0x581808,'name':_0x581808['journeyBundleName'],'type':_0x13f1df(0x84),'url':_0x470f2b(_0x581808['id'])}))]['sort']((_0x592f32,_0x31915f)=>_0x592f32['name'][_0x13f1df(0x83)](_0x31915f[_0x13f1df(0x8f)]));await handleSDKOutput(_0xbf7793,_0x24079e);}else{if(_0x4abcdf===0x0)console[_0x13f1df(0xac)](a39_0x550de9['dim']('['+_0x4b569a+']')),console[_0x13f1df(0xac)](_0x13f1df(0xb9));else{console[_0x13f1df(0xac)](a39_0x550de9['dim']('['+_0x4b569a+']'));const _0x4f2d1e=formatFlatList(_0x249bf3,_0x2e7806,{'showMetadata':!![],'getSegmentUrl':_0x1ec44a,'getJourneyUrl':_0x470f2b},_0x3dfdce);console['log'](_0x4f2d1e);}}return 0x0;}async[a39_0x5ce2b6(0x88)](_0x3f7b81,_0x389927){const _0x48d09d=a39_0x5ce2b6,{options:_0x4c17eb,tdx:_0x43d2c9}=_0x3f7b81,_0x45ef70=await withSpinner(_0x48d09d(0xb6)+_0x389927+'\x27...',()=>_0x43d2c9['segment'][_0x48d09d(0x73)](_0x389927),{'verbose':_0x4c17eb[_0x48d09d(0x92)]}),_0x13b7a4=_0x45ef70['data'];_0x4c17eb[_0x48d09d(0x92)]&&(console['error']('Parent\x20ID:\x20'+_0x13b7a4[_0x48d09d(0xa5)]),_0x13b7a4['folderId']&&console['error']('Folder\x20ID:\x20'+_0x13b7a4[_0x48d09d(0xa0)]));const _0x95047f=_0x4c17eb[_0x48d09d(0x96)]||0xa,_0x5d856a=await withSpinner(_0x48d09d(0xb5),()=>_0x43d2c9[_0x48d09d(0x86)]['listRecursive'](_0x13b7a4['parentId'],_0x13b7a4[_0x48d09d(0xa0)],0x0,_0x95047f),{'verbose':_0x4c17eb[_0x48d09d(0x92)]}),_0x19cf36=_0x5d856a[_0x48d09d(0xaf)],_0x1b1ace=_0x3f5f15=>{const _0x109094=_0x48d09d;let _0x1aa77d=0x0,_0x2176fd=0x0,_0x34732e=0x0;for(const _0x4cf7dd of _0x3f5f15){if(_0x4cf7dd[_0x109094(0xad)]==='folder')_0x1aa77d++;else{if(_0x4cf7dd[_0x109094(0xad)]==='segment')_0x2176fd++;else{if(_0x4cf7dd[_0x109094(0xad)]===_0x109094(0x84))_0x34732e++;}}if(_0x4cf7dd[_0x109094(0x95)]){const _0x33ae9f=_0x1b1ace(_0x4cf7dd['children']);_0x1aa77d+=_0x33ae9f[_0x109094(0x8a)],_0x2176fd+=_0x33ae9f[_0x109094(0x9b)],_0x34732e+=_0x33ae9f['journeys'];}}return{'folders':_0x1aa77d,'segments':_0x2176fd,'journeys':_0x34732e};},_0x416ec8=_0x1b1ace(_0x19cf36);console[_0x48d09d(0x80)]('✔\x20Built\x20tree\x20with\x20'+_0x416ec8['folders']+_0x48d09d(0x7e)+(_0x416ec8['folders']!==0x1?'s':'')+',\x20'+_0x416ec8[_0x48d09d(0x9b)]+_0x48d09d(0xa3)+(_0x416ec8[_0x48d09d(0x9b)]!==0x1?'s':'')+_0x48d09d(0xa1)+_0x416ec8[_0x48d09d(0x72)]+_0x48d09d(0x7d)+(_0x416ec8[_0x48d09d(0x72)]!==0x1?'s':''));const _0x5cbbf5=_0x584d13=>{const _0x4c51dc=_0x48d09d;return getConsoleNextUrl(_0x4c17eb['site'],_0x4c51dc(0x78)+_0x13b7a4[_0x4c51dc(0xa5)]+'/e/'+_0x584d13);},_0x4711be=_0x457ad9=>{const _0x413440=_0x48d09d;return getConsoleNextUrl(_0x4c17eb[_0x413440(0x6f)],_0x413440(0x78)+_0x13b7a4[_0x413440(0xa5)]+'/e/'+_0x457ad9+_0x413440(0xaa));};if(_0x4c17eb[_0x48d09d(0x87)]===_0x48d09d(0x85)||_0x4c17eb['format']===_0x48d09d(0xae))await handleSDKOutput(_0x19cf36,_0x4c17eb);else{console['log'](a39_0x550de9[_0x48d09d(0xb2)]('['+_0x389927+']'));const _0x2d6e67=formatTree(_0x19cf36,{'showMetadata':!![],'getSegmentUrl':_0x5cbbf5,'getJourneyUrl':_0x4711be});console[_0x48d09d(0xac)](_0x2d6e67);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x24b28e=a40_0x14c7;function a40_0xf8bb(){const _0x21702c=['table','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','database','message','error','674325SFAVdT','showTable','3ACVMVg','name','show','15680kUghgv','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','1115NyZFBu','8992539MpfhbV','length','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','✔\x20Retrieved\x20','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','site','args','372826AvSZNb','Database:\x20','49Snlzgt','verbose','Show\x20table\x20contents','Site:\x20','catalog','23620900lhFIzn','validate','description','12885368TIzPjT','Catalog:\x20','limit','Error:\x20','Usage:\x20tdx\x20show\x20<database.table>','475098PdpYfQ','Querying\x20','Table:\x20','cause'];a40_0xf8bb=function(){return _0x21702c;};return a40_0xf8bb();}(function(_0x25d99d,_0x394a7c){const _0x5ebd45=a40_0x14c7,_0xcba4e6=_0x25d99d();while(!![]){try{const _0x16bd72=parseInt(_0x5ebd45(0x1a6))/0x1+parseInt(_0x5ebd45(0x1b5))/0x2*(-parseInt(_0x5ebd45(0x1a8))/0x3)+parseInt(_0x5ebd45(0x1ab))/0x4*(-parseInt(_0x5ebd45(0x1ad))/0x5)+-parseInt(_0x5ebd45(0x19d))/0x6*(parseInt(_0x5ebd45(0x1b7))/0x7)+-parseInt(_0x5ebd45(0x198))/0x8+parseInt(_0x5ebd45(0x1ae))/0x9+parseInt(_0x5ebd45(0x195))/0xa;if(_0x16bd72===_0x394a7c)break;else _0xcba4e6['push'](_0xcba4e6['shift']());}catch(_0x13f8c1){_0xcba4e6['push'](_0xcba4e6['shift']());}}}(a40_0xf8bb,0xc5c4d));import{BaseCommand}from'./command.js';function a40_0x14c7(_0xf9a12a,_0x2123ef){_0xf9a12a=_0xf9a12a-0x195;const _0xf8bbe5=a40_0xf8bb();let _0x14c7b5=_0xf8bbe5[_0xf9a12a];return _0x14c7b5;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a40_0x24b28e(0x1a9)]=a40_0x24b28e(0x1aa);[a40_0x24b28e(0x197)]=a40_0x24b28e(0x1b9);async['execute'](_0x4b5b72){const _0x10e5b8=a40_0x24b28e;return this[_0x10e5b8(0x1a7)](_0x4b5b72);}async[a40_0x24b28e(0x1a7)](_0xbd58bb){const _0x1a693c=a40_0x24b28e,{options:_0x536fb7,args:_0x3ed8a5,tdx:_0x469263}=_0xbd58bb;let _0x2a1c1d;try{_0x2a1c1d=parseTableReference(_0x3ed8a5[0x0]);const _0x32cbee=_0x536fb7[_0x1a693c(0x1a3)];!_0x2a1c1d[_0x1a693c(0x1a3)]&&_0x32cbee&&(_0x2a1c1d[_0x1a693c(0x1a3)]=_0x32cbee);const _0x571a29=validateTableDescribeReference(_0x2a1c1d);if(_0x571a29)return console[_0x1a693c(0x1a5)](_0x1a693c(0x19b)+_0x571a29),console[_0x1a693c(0x1a5)](_0x1a693c(0x19c)),console[_0x1a693c(0x1a5)](_0x1a693c(0x1b0)),console[_0x1a693c(0x1a5)](_0x1a693c(0x1a2)),0x1;}catch(_0xad3fbb){return console[_0x1a693c(0x1a5)](_0x1a693c(0x19b)+_0xad3fbb[_0x1a693c(0x1a4)]),console[_0x1a693c(0x1a5)](_0x1a693c(0x19c)),console[_0x1a693c(0x1a5)](_0x1a693c(0x1b0)),console[_0x1a693c(0x1a5)](_0x1a693c(0x1a2)),0x1;}const _0x58a737=_0x2a1c1d[_0x1a693c(0x1bb)],_0x25c106=_0x2a1c1d[_0x1a693c(0x1a3)],_0x1fd751=_0x2a1c1d[_0x1a693c(0x1a1)],_0x25405a=resolveLimit(_0x536fb7[_0x1a693c(0x19a)],DEFAULT_DISPLAY_LIMIT);try{_0x536fb7[_0x1a693c(0x1b8)]&&(console[_0x1a693c(0x1a5)](_0x1a693c(0x1ba)+_0x536fb7[_0x1a693c(0x1b3)]),_0x58a737&&console['error'](_0x1a693c(0x199)+_0x58a737),console[_0x1a693c(0x1a5)](_0x1a693c(0x1b6)+_0x25c106),console[_0x1a693c(0x1a5)](_0x1a693c(0x19f)+_0x1fd751),console['error']('Limit:\x20'+_0x25405a));const _0x4e1e6d=_0x58a737?_0x58a737+'.'+_0x25c106+'.'+_0x1fd751:_0x25c106+'.'+_0x1fd751,_0x3f1d9b=await withSpinner(_0x1a693c(0x19e)+_0x4e1e6d+'...',()=>_0x469263['query'][_0x1a693c(0x1a7)](_0x25c106,_0x1fd751,_0x25405a,_0x58a737),{'verbose':_0x536fb7[_0x1a693c(0x1b8)]}),_0x1498e5=_0x3f1d9b['data'],_0xd3d44e=_0x1498e5['data'];return _0xd3d44e[_0x1a693c(0x1af)]===0x0?console[_0x1a693c(0x1a5)](_0x1a693c(0x1ac)):console[_0x1a693c(0x1a5)](_0x1a693c(0x1b1)+_0xd3d44e['length']+'\x20row'+(_0xd3d44e[_0x1a693c(0x1af)]!==0x1?'s':'')+'\x20from\x20'+_0x4e1e6d),await handleSDKOutput(_0xd3d44e,_0x536fb7),0x0;}catch(_0x6d1e52){if(_0x6d1e52 instanceof SDKError)return console[_0x1a693c(0x1a5)](_0x1a693c(0x19b)+_0x6d1e52[_0x1a693c(0x1a4)]),_0x6d1e52[_0x1a693c(0x1a0)]&&console[_0x1a693c(0x1a5)]('\x20\x20Cause:\x20'+_0x6d1e52[_0x1a693c(0x1a0)]),0x1;throw _0x6d1e52;}}[a40_0x24b28e(0x196)](_0x44f131){const _0x423dc4=a40_0x24b28e;if(_0x44f131[_0x423dc4(0x1b4)][_0x423dc4(0x1af)]===0x0)return _0x423dc4(0x1b2);if(_0x44f131[_0x423dc4(0x1b4)]['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 a41_0x5dcb20=a41_0x348a;function a41_0x348a(_0x49e359,_0x23804c){_0x49e359=_0x49e359-0x14f;const _0x5d445e=a41_0x5d44();let _0x348aa6=_0x5d445e[_0x49e359];return _0x348aa6;}(function(_0x76168d,_0x26a4ca){const _0x58dd4a=a41_0x348a,_0x89d3c8=_0x76168d();while(!![]){try{const _0x2bc811=parseInt(_0x58dd4a(0x16b))/0x1*(parseInt(_0x58dd4a(0x166))/0x2)+parseInt(_0x58dd4a(0x177))/0x3*(-parseInt(_0x58dd4a(0x155))/0x4)+parseInt(_0x58dd4a(0x17b))/0x5+-parseInt(_0x58dd4a(0x160))/0x6*(parseInt(_0x58dd4a(0x16e))/0x7)+parseInt(_0x58dd4a(0x179))/0x8+parseInt(_0x58dd4a(0x158))/0x9*(parseInt(_0x58dd4a(0x16c))/0xa)+parseInt(_0x58dd4a(0x152))/0xb*(-parseInt(_0x58dd4a(0x15a))/0xc);if(_0x2bc811===_0x26a4ca)break;else _0x89d3c8['push'](_0x89d3c8['shift']());}catch(_0x2b6cee){_0x89d3c8['push'](_0x89d3c8['shift']());}}}(a41_0x5d44,0x42830));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a41_0x5d44(){const _0x561630=['260MGXpjq','Account\x20ID:','12068QaTTfW','email','red','✓\x20Authentication\x20successful\x0a','config','TDX_PROFILE\x20env','(from\x20','name','displayWithSources','3912PbCWJU','cyan','3272000OzKElX','\x20profile:\x20','1332320ARGZjF','account_id','yellow','bold','session','1950113nTnEab','Read\x20credential\x20from\x20','profileSource','504HFKGCJ','last_name','No\x20credential\x20found','101259KSbtpI','green','48XyymBV','message','profile','description','site:\x20','env','444OpMzke','error','dim','✗\x20Validation\x20failed:\x20','site','Name:','101818TmZFGH','N/A','log','cli','filter','6XVVxCF'];a41_0x5d44=function(){return _0x561630;};return a41_0x5d44();}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a41_0x1ef26b from'chalk';export class StatusCommand extends BaseCommand{[a41_0x5dcb20(0x175)]='status';[a41_0x5dcb20(0x15d)]='Show\x20authentication\x20status\x20and\x20current\x20context';async['execute'](_0x2affde){const _0x5e9f87=a41_0x5dcb20,{options:_0x527135,tdx:_0x3e8a2d}=_0x2affde,_0x4e95f5=_0x527135[_0x5e9f87(0x164)],_0x19cc1e=new GlobalContext(_0x527135),_0x1eb301=_0x19cc1e[_0x5e9f87(0x15c)],_0x262db2=_0x19cc1e[_0x5e9f87(0x154)],_0x1181de=_0x262db2===_0x5e9f87(0x169)?'CLI\x20flag':_0x262db2==='session'?_0x5e9f87(0x151):_0x262db2===_0x5e9f87(0x15f)?_0x5e9f87(0x173):_0x262db2===_0x5e9f87(0x172)?_0x5e9f87(0x172):null,_0x412ee5=_0x1eb301?a41_0x1ef26b['cyan'](_0x1eb301):a41_0x1ef26b[_0x5e9f87(0x162)](_0x5e9f87(0x167)),_0x444c67=_0x1181de?'\x20'+a41_0x1ef26b[_0x5e9f87(0x162)](_0x5e9f87(0x174)+_0x1181de+')'):'';console['log'](a41_0x1ef26b[_0x5e9f87(0x150)]('tdx')+_0x5e9f87(0x17a)+_0x412ee5+_0x444c67+'\x20'+a41_0x1ef26b[_0x5e9f87(0x162)]('(')+_0x5e9f87(0x15e)+a41_0x1ef26b[_0x5e9f87(0x178)](_0x4e95f5)+a41_0x1ef26b[_0x5e9f87(0x162)](')'));const _0x50701e=await resolveAPIKeyAsync(_0x4e95f5,_0x1eb301);if(_0x50701e){const {source:_0x458d4d,isDeprecated:_0x5045ba}=_0x50701e,_0x11d87f=_0x5e9f87(0x153)+a41_0x1ef26b[_0x5e9f87(0x178)](_0x458d4d);console[_0x5e9f87(0x168)](_0x5045ba?a41_0x1ef26b[_0x5e9f87(0x14f)](_0x11d87f):_0x11d87f);}else console[_0x5e9f87(0x168)](a41_0x1ef26b[_0x5e9f87(0x14f)](_0x5e9f87(0x157)));let _0x2038f7=![];try{const _0x409d91=await _0x3e8a2d['jobs']['getUserInfo']();console['log'](a41_0x1ef26b[_0x5e9f87(0x159)](_0x5e9f87(0x171))),console[_0x5e9f87(0x168)](a41_0x1ef26b[_0x5e9f87(0x150)]('User:')+'\x20'+a41_0x1ef26b[_0x5e9f87(0x178)](_0x409d91[_0x5e9f87(0x16f)]));if(_0x409d91['first_name']||_0x409d91['last_name']){const _0x7f8f82=[_0x409d91['first_name'],_0x409d91[_0x5e9f87(0x156)]][_0x5e9f87(0x16a)](Boolean)['join']('\x20');console[_0x5e9f87(0x168)](a41_0x1ef26b[_0x5e9f87(0x150)](_0x5e9f87(0x165))+'\x20'+_0x7f8f82);}_0x409d91[_0x5e9f87(0x17c)]&&console[_0x5e9f87(0x168)](a41_0x1ef26b[_0x5e9f87(0x150)](_0x5e9f87(0x16d))+'\x20'+a41_0x1ef26b[_0x5e9f87(0x14f)](_0x409d91[_0x5e9f87(0x17c)])),_0x2038f7=!![];}catch(_0x50b7bb){_0x50b7bb instanceof HTTPClientError&&_0x50b7bb['status']===0x191?printAuthError(_0x50b7bb,!![],_0x1eb301):console[_0x5e9f87(0x161)](a41_0x1ef26b[_0x5e9f87(0x170)](_0x5e9f87(0x163)+(_0x50b7bb instanceof Error?_0x50b7bb[_0x5e9f87(0x15b)]:String(_0x50b7bb))));}return console['log'](),_0x19cc1e[_0x5e9f87(0x176)](),_0x2038f7?0x0:0x1;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x2b2dcd=a42_0x166d;(function(_0x15d77d,_0x4ed865){const _0x87751a=a42_0x166d,_0x4373b9=_0x15d77d();while(!![]){try{const _0x3e6816=-parseInt(_0x87751a(0x124))/0x1*(-parseInt(_0x87751a(0x13e))/0x2)+parseInt(_0x87751a(0x136))/0x3*(-parseInt(_0x87751a(0x122))/0x4)+-parseInt(_0x87751a(0x11a))/0x5*(-parseInt(_0x87751a(0x118))/0x6)+parseInt(_0x87751a(0x13f))/0x7*(parseInt(_0x87751a(0x137))/0x8)+-parseInt(_0x87751a(0x138))/0x9*(-parseInt(_0x87751a(0x11f))/0xa)+-parseInt(_0x87751a(0x13b))/0xb+-parseInt(_0x87751a(0x143))/0xc*(-parseInt(_0x87751a(0x140))/0xd);if(_0x3e6816===_0x4ed865)break;else _0x4373b9['push'](_0x4373b9['shift']());}catch(_0x4d4b0c){_0x4373b9['push'](_0x4373b9['shift']());}}}(a42_0x27a4,0x56832));import{BaseCommand}from'./command.js';function a42_0x27a4(){const _0x2f29b5=['data','\x27\x20across\x20all\x20databases.','12uwYqWY','Note:\x20\x27','verbose','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Listing\x20tables...','12tSxNmp','Table\x20pattern:\x20','218615zJSMbw','Database\x20pattern:\x20','message','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','description','64210YzMzxK','cause','Error:\x20Pattern\x20\x27','267788mggNAR','name','29vQXeTo','Or\x20use\x20--in\x20flag:','length','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x27\x20is\x20ambiguous.','listTables','Error:\x20','site','tables','includes','database','error','Database:\x20','Database\x20\x27','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','✖\x20No\x20tables\x20found','✔\x20Found\x20','table','15pfjzLA','200VWPwxG','54Oslvmh','query','\x20\x20Cause:\x20','3963311lgXyuN','Database:\x20all','\x20\x20Use:\x20tdx\x20tables\x20\x22','22006obQBaH','110047wlVIAv','2746978lxAJgz'];a42_0x27a4=function(){return _0x2f29b5;};return a42_0x27a4();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a42_0x166d(_0x214d0e,_0x3f0ca4){_0x214d0e=_0x214d0e-0x118;const _0x27a412=a42_0x27a4();let _0x166d8d=_0x27a412[_0x214d0e];return _0x166d8d;}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{[a42_0x2b2dcd(0x123)]=a42_0x2b2dcd(0x12c);[a42_0x2b2dcd(0x11e)]='List\x20tables\x20in\x20a\x20database';async['execute'](_0x41fd7b){const _0x1e938c=a42_0x2b2dcd,{options:_0x8d695,args:_0x1d2ee6,tdx:_0x5d2d50}=_0x41fd7b;let _0x5f376c;if(_0x1d2ee6['length']===0x0)_0x5f376c={'database':undefined,'table':undefined,'original':''};else{if(_0x1d2ee6[_0x1e938c(0x126)]===0x1)try{_0x5f376c=parseTableReference(_0x1d2ee6[0x0]);if(_0x5f376c[_0x1e938c(0x135)]&&!_0x5f376c[_0x1e938c(0x12e)]&&!_0x5f376c[_0x1e938c(0x135)]['includes']('*')&&!_0x5f376c['table'][_0x1e938c(0x12d)]('?'))return console['error'](_0x1e938c(0x121)+_0x1d2ee6[0x0]+_0x1e938c(0x128)),console[_0x1e938c(0x12f)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x5f376c[_0x1e938c(0x135)]+'\x27?'),console['error'](_0x1e938c(0x13d)+_0x5f376c[_0x1e938c(0x135)]+'.*\x22'),console[_0x1e938c(0x12f)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x5f376c[_0x1e938c(0x135)]),console['error'](_0x1e938c(0x127)+_0x5f376c[_0x1e938c(0x135)]),console[_0x1e938c(0x12f)](''),console[_0x1e938c(0x12f)](_0x1e938c(0x144)+_0x1d2ee6[0x0]+_0x1e938c(0x11d)+_0x5f376c[_0x1e938c(0x135)]+_0x1e938c(0x142)),0x1;}catch(_0x1573c9){return console[_0x1e938c(0x12f)](_0x1e938c(0x12a)+_0x1573c9[_0x1e938c(0x11c)]),0x1;}else return console[_0x1e938c(0x12f)](_0x1e938c(0x132)),console[_0x1e938c(0x12f)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x1e938c(0x12f)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x1e938c(0x12f)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x1e938c(0x12f)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x1e938c(0x12f)](_0x1e938c(0x125)),console[_0x1e938c(0x12f)](_0x1e938c(0x146)),0x1;}const _0x43a264=_0x8d695[_0x1e938c(0x12e)];!_0x5f376c[_0x1e938c(0x12e)]&&_0x43a264&&(_0x5f376c[_0x1e938c(0x12e)]=_0x43a264);try{const _0x37d23f=_0x5e2dca=>_0x5e2dca&&(_0x5e2dca[_0x1e938c(0x12d)]('*')||_0x5e2dca[_0x1e938c(0x12d)]('?')),_0x4b8ebb=_0x37d23f(_0x5f376c[_0x1e938c(0x12e)]);_0x8d695[_0x1e938c(0x145)]&&(console[_0x1e938c(0x12f)]('Site:\x20'+_0x8d695[_0x1e938c(0x12b)]),_0x5f376c['database']?_0x4b8ebb?console[_0x1e938c(0x12f)](_0x1e938c(0x11b)+_0x5f376c[_0x1e938c(0x12e)]):console[_0x1e938c(0x12f)](_0x1e938c(0x130)+_0x5f376c[_0x1e938c(0x12e)]):console[_0x1e938c(0x12f)](_0x1e938c(0x13c)),_0x5f376c[_0x1e938c(0x135)]&&console[_0x1e938c(0x12f)](_0x1e938c(0x119)+_0x5f376c[_0x1e938c(0x135)]));const _0x46c331=_0x5f376c[_0x1e938c(0x12e)]&&!_0x4b8ebb?_0x5f376c[_0x1e938c(0x12e)]:undefined,_0x2d41f6=_0x4b8ebb?_0x5f376c[_0x1e938c(0x12e)]:undefined,_0x58dbfb=_0x5f376c[_0x1e938c(0x135)],_0x34726e=resolveLimit(_0x8d695['limit'],DEFAULT_LISTING_LIMIT),_0x9730e5=await withSpinner(_0x1e938c(0x147),()=>_0x5d2d50[_0x1e938c(0x139)][_0x1e938c(0x129)](_0x46c331,_0x58dbfb,_0x2d41f6,_0x34726e),{'verbose':_0x8d695['verbose']}),_0x1344da=_0x9730e5[_0x1e938c(0x141)];if(_0x1344da[_0x1e938c(0x126)]===0x0&&_0x5f376c['database']&&!_0x4b8ebb)return console[_0x1e938c(0x12f)](_0x1e938c(0x133)),console[_0x1e938c(0x12f)](_0x1e938c(0x131)+_0x5f376c['database']+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console['error'](_0x1e938c(0x134)+_0x1344da[_0x1e938c(0x126)]+'\x20table'+(_0x1344da[_0x1e938c(0x126)]!==0x1?'s':'')),await handleSDKOutput(_0x1344da,{..._0x8d695,'limit':_0x34726e}),0x0;}catch(_0x25f505){if(_0x25f505 instanceof SDKError)return console['error']('Error:\x20'+_0x25f505['message']),_0x25f505['cause']&&console['error'](_0x1e938c(0x13a)+_0x25f505[_0x1e938c(0x120)]),0x1;throw _0x25f505;}}['validate'](_0x38eff0){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x5de2dc=a43_0x4f01;(function(_0x3b334d,_0x3de0cb){const _0x23529d=a43_0x4f01,_0x32aada=_0x3b334d();while(!![]){try{const _0x72a70=-parseInt(_0x23529d(0xf0))/0x1*(parseInt(_0x23529d(0xf5))/0x2)+parseInt(_0x23529d(0xe5))/0x3*(parseInt(_0x23529d(0xea))/0x4)+-parseInt(_0x23529d(0xf8))/0x5+parseInt(_0x23529d(0xe9))/0x6+parseInt(_0x23529d(0xe2))/0x7+parseInt(_0x23529d(0xe8))/0x8*(parseInt(_0x23529d(0xdf))/0x9)+-parseInt(_0x23529d(0xdc))/0xa;if(_0x72a70===_0x3de0cb)break;else _0x32aada['push'](_0x32aada['shift']());}catch(_0x25d4ab){_0x32aada['push'](_0x32aada['shift']());}}}(a43_0x4176,0xa2e98));function a43_0x4f01(_0x285684,_0x58c53f){_0x285684=_0x285684-0xdb;const _0x4176d1=a43_0x4176();let _0x4f01c0=_0x4176d1[_0x285684];return _0x4f01c0;}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';function a43_0x4176(){const _0x90498a=['54kLlwiU','message','default','7184247HTVzkd','session','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','819471WMZTLL','llm_project','site','1444096rirjYn','4770012aDHFJF','16FRUgaP','execute','dim','Default\x20profile\x20','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','green','98wARWws','engage_workspace','includes','validate','profile','11078RCnUYM','Session\x20','join','759135ZrYphg','unset','(session:\x20','Error:\x20','cleared','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','\x0aUpdated:\x20','Clear\x20session-level\x20or\x20default\x20context\x20values','parent_segment','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','26350860EByqHP','error','database'];a43_0x4176=function(){return _0x90498a;};return a43_0x4176();}import a43_0x2e317d from'chalk';import*as a43_0x49fe30 from'node:path';export class UnsetCommand extends BaseCommand{['name']=a43_0x5de2dc(0xf9);['description']=a43_0x5de2dc(0x100);[a43_0x5de2dc(0xf3)](_0x5eab32){const _0x4fa035=a43_0x5de2dc,{args:_0x47da61,options:_0x1aaf3c}=_0x5eab32,_0xfc8d5f=_0x1aaf3c['default'];if(_0x47da61['length']===0x0)return'Usage:\x20tdx\x20unset\x20<resource>\x0a'+_0x4fa035(0xfe)+_0x4fa035(0xdb)+_0x4fa035(0xee);const _0x498f8b=_0x47da61[0x0],_0x185326=['site','database',_0x4fa035(0x101),'llm_project','agent',_0x4fa035(0xf4),_0x4fa035(0xf1)];if(!_0x185326[_0x4fa035(0xf2)](_0x498f8b))return'Invalid\x20resource:\x20'+_0x498f8b+'.\x20Must\x20be\x20one\x20of:\x20'+_0x185326[_0x4fa035(0xf7)](',\x20');if(_0xfc8d5f&&_0x498f8b!=='site'&&_0x498f8b!=='profile')return _0x4fa035(0xe4);return undefined;}async[a43_0x5de2dc(0xeb)](_0x59ffcb){const _0x1c89b3=a43_0x5de2dc,{args:_0x20f405,options:_0x10fc44}=_0x59ffcb,_0x369cbf=_0x10fc44[_0x1c89b3(0xe1)];cleanExpiredSessions();try{const _0x27da9e=_0x20f405[0x0],_0x35a338=a43_0x49fe30[_0x1c89b3(0xf7)](getConfigDir(),'tdx.json');if(_0x369cbf){if(_0x27da9e===_0x1c89b3(0xe7))return clearDefaultSiteFromUserConfig(),console[_0x1c89b3(0xfd)]('Default\x20site\x20'+a43_0x2e317d[_0x1c89b3(0xef)](_0x1c89b3(0xfc))),console[_0x1c89b3(0xfd)](a43_0x2e317d[_0x1c89b3(0xec)](_0x1c89b3(0xff)+_0x35a338)),0x0;if(_0x27da9e===_0x1c89b3(0xf4))return clearActiveProfileFromUserConfig(),console['log'](_0x1c89b3(0xed)+a43_0x2e317d[_0x1c89b3(0xef)](_0x1c89b3(0xfc))),console[_0x1c89b3(0xfd)](a43_0x2e317d[_0x1c89b3(0xec)](_0x1c89b3(0xff)+_0x35a338)),0x0;}const _0x5db07f=getSessionID(_0x10fc44['session']),_0x27725c={'site':_0x1c89b3(0xe7),'database':_0x1c89b3(0xde),'parent_segment':_0x1c89b3(0x101),'llm_project':_0x1c89b3(0xe6),'agent':'llm_agent','profile':_0x1c89b3(0xf4),'engage_workspace':_0x1c89b3(0xf1)},_0x411ac8=_0x27725c[_0x27da9e];return _0x411ac8&&(clearSessionContextField(_0x411ac8,_0x10fc44[_0x1c89b3(0xe3)]),console[_0x1c89b3(0xfd)](_0x1c89b3(0xf6)+_0x27da9e+'\x20'+a43_0x2e317d[_0x1c89b3(0xef)](_0x1c89b3(0xfc))+'\x20'+a43_0x2e317d['dim'](_0x1c89b3(0xfa)+_0x5db07f+')'))),0x0;}catch(_0x230adf){return _0x230adf instanceof Error&&console[_0x1c89b3(0xdd)](_0x1c89b3(0xfb)+_0x230adf[_0x1c89b3(0xe0)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a44_0x13f190=a44_0x4a3d;(function(_0x509ba1,_0x10baf3){const _0x158c03=a44_0x4a3d,_0x30b2dc=_0x509ba1();while(!![]){try{const _0x3b9a47=-parseInt(_0x158c03(0x138))/0x1*(parseInt(_0x158c03(0x15f))/0x2)+-parseInt(_0x158c03(0x17e))/0x3*(parseInt(_0x158c03(0x139))/0x4)+parseInt(_0x158c03(0x130))/0x5*(-parseInt(_0x158c03(0x14b))/0x6)+parseInt(_0x158c03(0x148))/0x7*(-parseInt(_0x158c03(0x176))/0x8)+parseInt(_0x158c03(0x173))/0x9+-parseInt(_0x158c03(0x164))/0xa+parseInt(_0x158c03(0x170))/0xb*(parseInt(_0x158c03(0x15c))/0xc);if(_0x3b9a47===_0x10baf3)break;else _0x30b2dc['push'](_0x30b2dc['shift']());}catch(_0x41372b){_0x30b2dc['push'](_0x30b2dc['shift']());}}}(a44_0x34d7,0x5aeed));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';function a44_0x4a3d(_0x18c1c0,_0x4c98f4){_0x18c1c0=_0x18c1c0-0x12e;const _0x34d7e9=a44_0x34d7();let _0x4a3d39=_0x34d7e9[_0x18c1c0];return _0x4a3d39;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a44_0x1580fb from'chalk';function a44_0x34d7(){const _0x1851ed=['\x0aSaved\x20to:\x20','tdx.json','agent','log','12VFvdlm','tdx','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','16246whLLLD','profile','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','Session\x20context\x20','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','2106810flQYCf','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','name','Set\x20session-level\x20context','Error:\x20Profile\x20\x27','engage_workspace','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','debug','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','engage','Default\x20profile\x20set\x20to:\x20','21480107VZOtqi','release_channel','dim','2160288khMIrq','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','\x27...','7784FYDWhH','llm_project','Error:\x20','Session\x20parent_segment\x20set\x20to:\x20','Release\x20channel\x20set\x20to:\x20','site','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','clear','3dlNDkN','.\x20Must\x20be\x20one\x20of:\x20','green','database','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','145NacCjD','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','join','Default\x20site\x20set\x20to:\x20','Session\x20profile\x20set\x20to:\x20','NOT_FOUND','displayWithSources','validate','37BMLaCr','2493688BNCpko','next','\x27\x20does\x20not\x20exist','Session\x20agent\x20set\x20to:\x20','Verifying\x20workspace\x20\x27','Invalid\x20release\x20channel:\x20','includes','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','Session\x20database\x20set\x20to:\x20','session','(session:\x20','description','llm_agent','error','371EBOXML','code','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','131190aROPbL','\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','length','stable','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','parent_segment','Session\x20site\x20set\x20to:\x20','INVALID_ARGUMENT','\x27\x20to\x20save\x20permanently','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','Session\x20engage_workspace\x20set\x20to:\x20','execute'];a44_0x34d7=function(){return _0x1851ed;};return a44_0x34d7();}import*as a44_0x1c40ea from'node:path';export class UseCommand extends BaseCommand{[a44_0x13f190(0x166)]='use';[a44_0x13f190(0x145)]=a44_0x13f190(0x167);[a44_0x13f190(0x137)](_0x75427f){const _0x2d56df=a44_0x13f190,{args:_0x31fae3,options:_0x51f410}=_0x75427f,_0x2f63c8=_0x51f410['default'];if(_0x31fae3[_0x2d56df(0x14d)]===0x0)return undefined;if(_0x31fae3[_0x2d56df(0x14d)]===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x2d56df(0x14c)+_0x2d56df(0x165)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a'+_0x2d56df(0x14a)+_0x2d56df(0x141)+_0x2d56df(0x16d)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x30a191=_0x31fae3[0x0],_0xc3e1b3=['site',_0x2d56df(0x181),'parent_segment',_0x2d56df(0x177),_0x2d56df(0x15a),_0x2d56df(0x160),_0x2d56df(0x169),_0x2d56df(0x171)];if(!_0xc3e1b3[_0x2d56df(0x13f)](_0x30a191))return'Invalid\x20resource:\x20'+_0x30a191+_0x2d56df(0x17f)+_0xc3e1b3['join'](',\x20');if(_0x2f63c8&&_0x30a191!==_0x2d56df(0x17b)&&_0x30a191!==_0x2d56df(0x160)&&_0x30a191!==_0x2d56df(0x171))return _0x2d56df(0x17c);if(_0x30a191===_0x2d56df(0x171)&&!_0x2f63c8)return _0x2d56df(0x174);if(_0x30a191===_0x2d56df(0x171)){const _0x75e158=_0x31fae3[0x1];if(_0x75e158!==_0x2d56df(0x14e)&&_0x75e158!==_0x2d56df(0x13a))return _0x2d56df(0x13e)+_0x75e158+_0x2d56df(0x150);}return undefined;}async[a44_0x13f190(0x157)](_0x580337){const _0x1c3a42=a44_0x13f190,{args:_0x4483ec,options:_0x30ccee}=_0x580337,_0x515e71=_0x30ccee[_0x1c3a42(0x16c)],_0x23d20d=_0x30ccee[_0x1c3a42(0x17d)],_0x1e674a=_0x30ccee['default'];cleanExpiredSessions();try{if(_0x23d20d){clearSessionContext(_0x30ccee[_0x1c3a42(0x143)]);const _0x1e5348=getSessionID(_0x30ccee['session']);return console[_0x1c3a42(0x15b)](_0x1c3a42(0x162)+a44_0x1580fb['green']('cleared')+'\x20'+a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x144)+_0x1e5348+')')),0x0;}if(_0x4483ec[_0x1c3a42(0x14d)]===0x0){const _0x34e311=new GlobalContext(_0x30ccee);return _0x515e71?_0x34e311[_0x1c3a42(0x136)]():_0x34e311['display'](),console[_0x1c3a42(0x15b)](a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x15e))),console[_0x1c3a42(0x15b)](a44_0x1580fb['dim']('Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel')),console[_0x1c3a42(0x15b)](a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x16b))),0x0;}const _0x30673c=_0x4483ec[0x0],_0x5160a9=_0x4483ec[0x1],_0x5e125e=a44_0x1c40ea[_0x1c3a42(0x132)](getConfigDir(),_0x1c3a42(0x159));if(_0x1e674a){if(_0x30673c===_0x1c3a42(0x17b))return saveDefaultSiteToUserConfig(_0x5160a9),console[_0x1c3a42(0x15b)](_0x1c3a42(0x133)+a44_0x1580fb[_0x1c3a42(0x180)](_0x5160a9)),console['log'](a44_0x1580fb['dim'](_0x1c3a42(0x158)+_0x5e125e)),0x0;if(_0x30673c===_0x1c3a42(0x160)){if(!profileExists(_0x5160a9))return console[_0x1c3a42(0x147)](_0x1c3a42(0x168)+_0x5160a9+'\x27\x20does\x20not\x20exist'),console['error'](_0x1c3a42(0x163)),0x1;return saveActiveProfileToUserConfig(_0x5160a9),console[_0x1c3a42(0x15b)](_0x1c3a42(0x16f)+a44_0x1580fb[_0x1c3a42(0x180)](_0x5160a9)),console['log'](a44_0x1580fb[_0x1c3a42(0x172)]('\x0aSaved\x20to:\x20'+_0x5e125e)),0x0;}if(_0x30673c===_0x1c3a42(0x171))return saveReleaseChannel(_0x5160a9),console[_0x1c3a42(0x15b)](_0x1c3a42(0x17a)+a44_0x1580fb[_0x1c3a42(0x180)](_0x5160a9)),console[_0x1c3a42(0x15b)](a44_0x1580fb['dim']('\x0aSaved\x20to:\x20'+_0x5e125e)),_0x5160a9===_0x1c3a42(0x13a)?(console[_0x1c3a42(0x15b)](a44_0x1580fb['dim'](_0x1c3a42(0x12f))),console[_0x1c3a42(0x15b)](a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x161)))):console[_0x1c3a42(0x15b)](a44_0x1580fb['dim'](_0x1c3a42(0x131))),0x0;}if(_0x30673c==='site'){const _0x380a73=getSessionID(_0x30ccee[_0x1c3a42(0x143)]);return saveSessionContext({'site':_0x5160a9},_0x30ccee['session']),console['log'](_0x1c3a42(0x152)+a44_0x1580fb[_0x1c3a42(0x180)](_0x5160a9)+'\x20'+a44_0x1580fb['dim'](_0x1c3a42(0x144)+_0x380a73+')')),console['log'](a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x16a)+_0x5160a9+_0x1c3a42(0x154))),0x0;}if(_0x30673c===_0x1c3a42(0x160)){if(!profileExists(_0x5160a9))return console['error'](_0x1c3a42(0x168)+_0x5160a9+_0x1c3a42(0x13b)),console[_0x1c3a42(0x147)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x6d6d0c=getSessionID(_0x30ccee['session']);return saveSessionContext({'profile':_0x5160a9},_0x30ccee[_0x1c3a42(0x143)]),console[_0x1c3a42(0x15b)](_0x1c3a42(0x134)+a44_0x1580fb['green'](_0x5160a9)+'\x20'+a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x144)+_0x6d6d0c+')')),console['log'](a44_0x1580fb['dim'](_0x1c3a42(0x14f)+_0x5160a9+_0x1c3a42(0x154))),0x0;}const _0x532e04={},_0x59d113=getSessionID(_0x30ccee[_0x1c3a42(0x143)]);switch(_0x30673c){case _0x1c3a42(0x181):_0x532e04[_0x1c3a42(0x181)]=_0x5160a9,console[_0x1c3a42(0x15b)](_0x1c3a42(0x142)+a44_0x1580fb[_0x1c3a42(0x180)](_0x5160a9)+'\x20'+a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x144)+_0x59d113+')'));break;case _0x1c3a42(0x151):_0x532e04[_0x1c3a42(0x151)]=_0x5160a9,console[_0x1c3a42(0x15b)](_0x1c3a42(0x179)+a44_0x1580fb[_0x1c3a42(0x180)](_0x5160a9)+'\x20'+a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x144)+_0x59d113+')'));break;case'llm_project':_0x532e04[_0x1c3a42(0x177)]=_0x5160a9,console[_0x1c3a42(0x15b)]('Session\x20llm_project\x20set\x20to:\x20'+a44_0x1580fb[_0x1c3a42(0x180)](_0x5160a9)+'\x20'+a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x144)+_0x59d113+')'));break;case _0x1c3a42(0x15a):{const {projectName:_0x35a673,agentName:_0x3e794b}=parseAgentRef(_0x5160a9);_0x3e794b?(_0x532e04[_0x1c3a42(0x177)]=_0x35a673,_0x532e04['llm_agent']=_0x3e794b,console[_0x1c3a42(0x15b)]('Session\x20llm_project\x20set\x20to:\x20'+a44_0x1580fb['green'](_0x35a673)+'\x20'+a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x144)+_0x59d113+')')),console[_0x1c3a42(0x15b)](_0x1c3a42(0x13c)+a44_0x1580fb[_0x1c3a42(0x180)](_0x3e794b)+'\x20'+a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x144)+_0x59d113+')'))):(_0x532e04[_0x1c3a42(0x146)]=_0x5160a9,console['log'](_0x1c3a42(0x13c)+a44_0x1580fb['green'](_0x5160a9)+'\x20'+a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x144)+_0x59d113+')')));break;}case _0x1c3a42(0x169):{try{await withSpinner(_0x1c3a42(0x13d)+_0x5160a9+_0x1c3a42(0x175),()=>_0x580337[_0x1c3a42(0x15d)][_0x1c3a42(0x16e)]['resolveWorkspaceId'](_0x5160a9));}catch(_0xc4317f){if(_0xc4317f instanceof SDKError&&(_0xc4317f[_0x1c3a42(0x149)]===ErrorCode[_0x1c3a42(0x135)]||_0xc4317f['code']===ErrorCode[_0x1c3a42(0x153)]))return console[_0x1c3a42(0x147)](_0x1c3a42(0x178)+_0xc4317f[_0x1c3a42(0x140)]),console[_0x1c3a42(0x147)](_0x1c3a42(0x155)),0x1;throw _0xc4317f;}_0x532e04[_0x1c3a42(0x169)]=_0x5160a9,console['log'](_0x1c3a42(0x156)+a44_0x1580fb[_0x1c3a42(0x180)](_0x5160a9)+'\x20'+a44_0x1580fb['dim'](_0x1c3a42(0x144)+_0x59d113+')'));break;}}return saveSessionContext(_0x532e04,_0x30ccee[_0x1c3a42(0x143)]),console[_0x1c3a42(0x15b)](a44_0x1580fb[_0x1c3a42(0x172)](_0x1c3a42(0x12e))),0x0;}catch(_0x11976e){return _0x11976e instanceof Error&&console[_0x1c3a42(0x147)]('Error:\x20'+_0x11976e[_0x1c3a42(0x140)]),0x1;}}}
|
|
1
|
+
const a44_0x309475=a44_0xc061;(function(_0x90eb8e,_0x9f9a11){const _0x10d405=a44_0xc061,_0x15535c=_0x90eb8e();while(!![]){try{const _0x1c43f6=-parseInt(_0x10d405(0x131))/0x1*(parseInt(_0x10d405(0x124))/0x2)+-parseInt(_0x10d405(0x160))/0x3+parseInt(_0x10d405(0x155))/0x4+-parseInt(_0x10d405(0x145))/0x5+parseInt(_0x10d405(0x14d))/0x6*(parseInt(_0x10d405(0x15c))/0x7)+-parseInt(_0x10d405(0x122))/0x8*(-parseInt(_0x10d405(0x13e))/0x9)+parseInt(_0x10d405(0x14b))/0xa;if(_0x1c43f6===_0x9f9a11)break;else _0x15535c['push'](_0x15535c['shift']());}catch(_0x280e90){_0x15535c['push'](_0x15535c['shift']());}}}(a44_0x3dbb,0x99ad5));function a44_0xc061(_0x12c14b,_0x4f446b){_0x12c14b=_0x12c14b-0x11e;const _0x3dbbdb=a44_0x3dbb();let _0xc06128=_0x3dbbdb[_0x12c14b];return _0xc06128;}function a44_0x3dbb(){const _0x539c42=['default','release_channel','message','(session:\x20','includes','Session\x20llm_project\x20set\x20to:\x20','\x27\x20to\x20save\x20permanently','displayWithSources','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','tdx','parent_segment','16wjmaNb','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','18zTgibA','Session\x20context\x20','Session\x20parent_segment\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','length','NOT_FOUND','next','validate','display','Error:\x20','debug','53731VbXVuf','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','log','\x0aSaved\x20to:\x20','code','use','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','name','\x27\x20does\x20not\x20exist','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','Set\x20session-level\x20context','stable','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','4254147gfVjSu','green','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','Error:\x20Profile\x20\x27','Verifying\x20workspace\x20\x27','join','engage','2695445FXPnnk','\x27...','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','engage_workspace','session','4072070qDTpOP','Session\x20database\x20set\x20to:\x20','72zTYnPv','tdx.json','Session\x20agent\x20set\x20to:\x20','INVALID_ARGUMENT','dim','llm_project','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Session\x20site\x20set\x20to:\x20','870476uBuBzp','Invalid\x20resource:\x20','profile','site','database','Default\x20site\x20set\x20to:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','626059nCrtGf','description','llm_agent','agent','2973921gGNKqn','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','clear','Invalid\x20release\x20channel:\x20','error','Release\x20channel\x20set\x20to:\x20','Default\x20profile\x20set\x20to:\x20','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently'];a44_0x3dbb=function(){return _0x539c42;};return a44_0x3dbb();}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';import a44_0x9be528 from'chalk';import*as a44_0x118633 from'node:path';export class UseCommand extends BaseCommand{[a44_0x309475(0x138)]=a44_0x309475(0x136);[a44_0x309475(0x15d)]=a44_0x309475(0x13b);[a44_0x309475(0x12d)](_0x9f1f9){const _0x39b563=a44_0x309475,{args:_0x19a917,options:_0x504f29}=_0x9f1f9,_0x2e3e8d=_0x504f29[_0x39b563(0x169)];if(_0x19a917['length']===0x0)return undefined;if(_0x19a917['length']===0x1)return _0x39b563(0x129)+'\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'+_0x39b563(0x128)+_0x39b563(0x11f)+_0x39b563(0x137)+_0x39b563(0x13a)+_0x39b563(0x161)+_0x39b563(0x153);const _0x3c8205=_0x19a917[0x0],_0xa98c3e=[_0x39b563(0x158),_0x39b563(0x159),_0x39b563(0x121),_0x39b563(0x152),_0x39b563(0x15f),_0x39b563(0x157),_0x39b563(0x149),'release_channel'];if(!_0xa98c3e[_0x39b563(0x16d)](_0x3c8205))return _0x39b563(0x156)+_0x3c8205+'.\x20Must\x20be\x20one\x20of:\x20'+_0xa98c3e[_0x39b563(0x143)](',\x20');if(_0x2e3e8d&&_0x3c8205!=='site'&&_0x3c8205!==_0x39b563(0x157)&&_0x3c8205!==_0x39b563(0x16a))return _0x39b563(0x15b);if(_0x3c8205===_0x39b563(0x16a)&&!_0x2e3e8d)return'release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>';if(_0x3c8205===_0x39b563(0x16a)){const _0x4584f2=_0x19a917[0x1];if(_0x4584f2!==_0x39b563(0x13c)&&_0x4584f2!==_0x39b563(0x12c))return _0x39b563(0x164)+_0x4584f2+_0x39b563(0x148);}return undefined;}async['execute'](_0x10ca0e){const _0x54dbf5=a44_0x309475,{args:_0x25d0db,options:_0xbfadb}=_0x10ca0e,_0x518f23=_0xbfadb[_0x54dbf5(0x130)],_0x31cf89=_0xbfadb[_0x54dbf5(0x163)],_0xa029dd=_0xbfadb['default'];cleanExpiredSessions();try{if(_0x31cf89){clearSessionContext(_0xbfadb[_0x54dbf5(0x14a)]);const _0x268841=getSessionID(_0xbfadb['session']);return console[_0x54dbf5(0x133)](_0x54dbf5(0x125)+a44_0x9be528[_0x54dbf5(0x13f)]('cleared')+'\x20'+a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x16c)+_0x268841+')')),0x0;}if(_0x25d0db[_0x54dbf5(0x12a)]===0x0){const _0x274172=new GlobalContext(_0xbfadb);return _0x518f23?_0x274172[_0x54dbf5(0x11e)]():_0x274172[_0x54dbf5(0x12e)](),console['log'](a44_0x9be528['dim']('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console['log'](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x123))),console['log'](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x168))),0x0;}const _0x44f259=_0x25d0db[0x0],_0x22592c=_0x25d0db[0x1],_0x31588a=a44_0x118633[_0x54dbf5(0x143)](getConfigDir(),_0x54dbf5(0x14e));if(_0xa029dd){if(_0x44f259===_0x54dbf5(0x158))return saveDefaultSiteToUserConfig(_0x22592c),console[_0x54dbf5(0x133)](_0x54dbf5(0x15a)+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)),console[_0x54dbf5(0x133)](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x134)+_0x31588a)),0x0;if(_0x44f259===_0x54dbf5(0x157)){if(!profileExists(_0x22592c))return console[_0x54dbf5(0x165)](_0x54dbf5(0x141)+_0x22592c+'\x27\x20does\x20not\x20exist'),console[_0x54dbf5(0x165)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;return saveActiveProfileToUserConfig(_0x22592c),console[_0x54dbf5(0x133)](_0x54dbf5(0x167)+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)),console[_0x54dbf5(0x133)](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x134)+_0x31588a)),0x0;}if(_0x44f259==='release_channel')return saveReleaseChannel(_0x22592c),console[_0x54dbf5(0x133)](_0x54dbf5(0x166)+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)),console['log'](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x134)+_0x31588a)),_0x22592c===_0x54dbf5(0x12c)?(console[_0x54dbf5(0x133)](a44_0x9be528[_0x54dbf5(0x151)]('\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.')),console[_0x54dbf5(0x133)](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x132)))):console[_0x54dbf5(0x133)](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x13d))),0x0;}if(_0x44f259==='site'){const _0x32645b=getSessionID(_0xbfadb[_0x54dbf5(0x14a)]);return saveSessionContext({'site':_0x22592c},_0xbfadb[_0x54dbf5(0x14a)]),console[_0x54dbf5(0x133)](_0x54dbf5(0x154)+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)+'\x20'+a44_0x9be528[_0x54dbf5(0x151)]('(session:\x20'+_0x32645b+')')),console[_0x54dbf5(0x133)](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x140)+_0x22592c+'\x27\x20to\x20save\x20permanently')),0x0;}if(_0x44f259==='profile'){if(!profileExists(_0x22592c))return console[_0x54dbf5(0x165)](_0x54dbf5(0x141)+_0x22592c+_0x54dbf5(0x139)),console[_0x54dbf5(0x165)](_0x54dbf5(0x162)),0x1;const _0x4aa1b4=getSessionID(_0xbfadb[_0x54dbf5(0x14a)]);return saveSessionContext({'profile':_0x22592c},_0xbfadb['session']),console['log']('Session\x20profile\x20set\x20to:\x20'+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)+'\x20'+a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x16c)+_0x4aa1b4+')')),console[_0x54dbf5(0x133)](a44_0x9be528['dim'](_0x54dbf5(0x147)+_0x22592c+_0x54dbf5(0x16f))),0x0;}const _0x434697={},_0x5ace92=getSessionID(_0xbfadb[_0x54dbf5(0x14a)]);switch(_0x44f259){case _0x54dbf5(0x159):_0x434697[_0x54dbf5(0x159)]=_0x22592c,console[_0x54dbf5(0x133)](_0x54dbf5(0x14c)+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)+'\x20'+a44_0x9be528['dim'](_0x54dbf5(0x16c)+_0x5ace92+')'));break;case'parent_segment':_0x434697[_0x54dbf5(0x121)]=_0x22592c,console['log'](_0x54dbf5(0x126)+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)+'\x20'+a44_0x9be528['dim'](_0x54dbf5(0x16c)+_0x5ace92+')'));break;case _0x54dbf5(0x152):_0x434697['llm_project']=_0x22592c,console[_0x54dbf5(0x133)](_0x54dbf5(0x16e)+a44_0x9be528['green'](_0x22592c)+'\x20'+a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x16c)+_0x5ace92+')'));break;case _0x54dbf5(0x15f):{const {projectName:_0x3de856,agentName:_0x4919f6}=parseAgentRef(_0x22592c);_0x4919f6?(_0x434697[_0x54dbf5(0x152)]=_0x3de856,_0x434697[_0x54dbf5(0x15e)]=_0x4919f6,console[_0x54dbf5(0x133)](_0x54dbf5(0x16e)+a44_0x9be528[_0x54dbf5(0x13f)](_0x3de856)+'\x20'+a44_0x9be528['dim'](_0x54dbf5(0x16c)+_0x5ace92+')')),console['log'](_0x54dbf5(0x14f)+a44_0x9be528['green'](_0x4919f6)+'\x20'+a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x16c)+_0x5ace92+')'))):(_0x434697['llm_agent']=_0x22592c,console[_0x54dbf5(0x133)](_0x54dbf5(0x14f)+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)+'\x20'+a44_0x9be528['dim']('(session:\x20'+_0x5ace92+')')));break;}case _0x54dbf5(0x149):{try{await withSpinner(_0x54dbf5(0x142)+_0x22592c+_0x54dbf5(0x146),()=>_0x10ca0e[_0x54dbf5(0x120)][_0x54dbf5(0x144)]['resolveWorkspaceId'](_0x22592c));}catch(_0x3a4d91){if(_0x3a4d91 instanceof SDKError&&(_0x3a4d91['code']===ErrorCode[_0x54dbf5(0x12b)]||_0x3a4d91[_0x54dbf5(0x135)]===ErrorCode[_0x54dbf5(0x150)]))return console['error'](_0x54dbf5(0x12f)+_0x3a4d91[_0x54dbf5(0x16b)]),console[_0x54dbf5(0x165)]('\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces'),0x1;throw _0x3a4d91;}_0x434697[_0x54dbf5(0x149)]=_0x22592c,console[_0x54dbf5(0x133)]('Session\x20engage_workspace\x20set\x20to:\x20'+a44_0x9be528[_0x54dbf5(0x13f)](_0x22592c)+'\x20'+a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x16c)+_0x5ace92+')'));break;}}return saveSessionContext(_0x434697,_0xbfadb[_0x54dbf5(0x14a)]),console[_0x54dbf5(0x133)](a44_0x9be528[_0x54dbf5(0x151)](_0x54dbf5(0x127))),0x0;}catch(_0x561efd){return _0x561efd instanceof Error&&console[_0x54dbf5(0x165)](_0x54dbf5(0x12f)+_0x561efd[_0x54dbf5(0x16b)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x3e458a=a45_0x2fdb;(function(_0x3c0991,_0x4fe358){const _0x3324f2=a45_0x2fdb,_0x32264d=_0x3c0991();while(!![]){try{const _0x1570ca=-parseInt(_0x3324f2(0x1d0))/0x1+-parseInt(_0x3324f2(0x1cc))/0x2*(parseInt(_0x3324f2(0x1d5))/0x3)+-parseInt(_0x3324f2(0x1de))/0x4+-parseInt(_0x3324f2(0x1cd))/0x5+parseInt(_0x3324f2(0x1d1))/0x6*(parseInt(_0x3324f2(0x1cb))/0x7)+-parseInt(_0x3324f2(0x1d8))/0x8*(-parseInt(_0x3324f2(0x1d2))/0x9)+parseInt(_0x3324f2(0x1d3))/0xa;if(_0x1570ca===_0x4fe358)break;else _0x32264d['push'](_0x32264d['shift']());}catch(_0x54c86d){_0x32264d['push'](_0x32264d['shift']());}}}(a45_0x266e,0xf4174));import{BaseCommand}from'./command.js';function a45_0x266e(){const _0x2b2c5d=['49070350zNsnVO','user\x20list','5618139bufWLC','verbose','✔\x20Found\x20','90384aOJXwM','error','data','Fetching\x20user\x20info...','List\x20all\x20users\x20in\x20the\x20account','length','1992604uUKsIx','\x20\x20Cause:\x20','user','name','description','list','cause','Listing\x20users...','Error:\x20','getCurrent','\x20user','4792319niOHPa','2JHrZuq','9377130KqnkDV','execute','Show\x20current\x20user\x20information','1312633yokzJY','12pDqMrU','225fkSLgy'];a45_0x266e=function(){return _0x2b2c5d;};return a45_0x266e();}import{SDKError}from'../sdk/index.js';function a45_0x2fdb(_0x488d42,_0xd0201f){_0x488d42=_0x488d42-0x1c3;const _0x266e7e=a45_0x266e();let _0x2fdb47=_0x266e7e[_0x488d42];return _0x2fdb47;}import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{['name']=a45_0x3e458a(0x1e0);[a45_0x3e458a(0x1c4)]=a45_0x3e458a(0x1cf);async[a45_0x3e458a(0x1ce)](_0x2c7f95){const _0x3d68f9=a45_0x3e458a,{options:_0x20cbde,tdx:_0x52c2a1}=_0x2c7f95;try{const _0x53e41a=await withSpinner(_0x3d68f9(0x1db),()=>_0x52c2a1[_0x3d68f9(0x1e0)][_0x3d68f9(0x1c9)](),{'verbose':_0x20cbde[_0x3d68f9(0x1d6)]}),_0x5d7f26=_0x53e41a[_0x3d68f9(0x1da)];return await handleSingleObjectOutput(_0x5d7f26,_0x20cbde),0x0;}catch(_0xbd697d){if(_0xbd697d instanceof SDKError)return console['error'](_0x3d68f9(0x1c8)+_0xbd697d['message']),_0xbd697d[_0x3d68f9(0x1c6)]&&console[_0x3d68f9(0x1d9)](_0x3d68f9(0x1df)+_0xbd697d['cause']),0x1;throw _0xbd697d;}}}export class UserListCommand extends BaseCommand{[a45_0x3e458a(0x1c3)]=a45_0x3e458a(0x1d4);[a45_0x3e458a(0x1c4)]=a45_0x3e458a(0x1dc);async['execute'](_0xe9dcbd){const _0x32b54c=a45_0x3e458a,{options:_0x4aeb4a,tdx:_0xa1959f}=_0xe9dcbd;try{const _0x24a6c9=await withSpinner(_0x32b54c(0x1c7),()=>_0xa1959f[_0x32b54c(0x1e0)][_0x32b54c(0x1c5)](),{'verbose':_0x4aeb4a[_0x32b54c(0x1d6)]}),_0x1a7db2=_0x24a6c9['data'];return console[_0x32b54c(0x1d9)](_0x32b54c(0x1d7)+_0x1a7db2[_0x32b54c(0x1dd)]+_0x32b54c(0x1ca)+(_0x1a7db2[_0x32b54c(0x1dd)]!==0x1?'s':'')),await handleSDKOutput(_0x1a7db2,_0x4aeb4a),0x0;}catch(_0x431cde){if(_0x431cde instanceof SDKError)return console[_0x32b54c(0x1d9)](_0x32b54c(0x1c8)+_0x431cde['message']),_0x431cde[_0x32b54c(0x1c6)]&&console[_0x32b54c(0x1d9)](_0x32b54c(0x1df)+_0x431cde[_0x32b54c(0x1c6)]),0x1;throw _0x431cde;}}}
|