@treasuredata/tdx 0.7.0 → 0.7.2
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 +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.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/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-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-pwd-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/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.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/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.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/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.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.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.d.ts +12 -0
- package/dist/types/endpoints.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/endpoints.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.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/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x45cd8a=a29_0x59de;(function(_0x452feb,_0x49fc91){const _0x4dadac=a29_0x59de,_0x19b8eb=_0x452feb();while(!![]){try{const _0x24f347=-parseInt(_0x4dadac(0xed))/0x1+-parseInt(_0x4dadac(0x15f))/0x2+-parseInt(_0x4dadac(0x164))/0x3*(parseInt(_0x4dadac(0x14e))/0x4)+parseInt(_0x4dadac(0x134))/0x5*(parseInt(_0x4dadac(0xfd))/0x6)+parseInt(_0x4dadac(0x173))/0x7*(-parseInt(_0x4dadac(0x103))/0x8)+parseInt(_0x4dadac(0x12b))/0x9*(-parseInt(_0x4dadac(0x147))/0xa)+parseInt(_0x4dadac(0x154))/0xb*(parseInt(_0x4dadac(0xef))/0xc);if(_0x24f347===_0x49fc91)break;else _0x19b8eb['push'](_0x19b8eb['shift']());}catch(_0x13412f){_0x19b8eb['push'](_0x19b8eb['shift']());}}}(a29_0x943a,0xf0f05));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a29_0x59de(_0x5e1677,_0x52c526){const _0x943a50=a29_0x943a();return a29_0x59de=function(_0x59ded4,_0x4a31ad){_0x59ded4=_0x59ded4-0xec;let _0x17e9b7=_0x943a50[_0x59ded4];return _0x17e9b7;},a29_0x59de(_0x5e1677,_0x52c526);}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';export class SegmentDescribeCommand extends BaseCommand{[a29_0x45cd8a(0x126)]=a29_0x45cd8a(0x129);[a29_0x45cd8a(0xfc)]='Show\x20segment\x20or\x20folder\x20details';async[a29_0x45cd8a(0x12a)](_0x4ed681){const _0x328020=a29_0x45cd8a,{options:_0x1bdd6f,args:_0x124213,tdx:_0x45461c}=_0x4ed681,_0x33219e=_0x124213[0x0],_0x1a6bc3=!_0x33219e&&!!_0x1bdd6f[_0x328020(0x114)],_0x5c8d3e=_0x33219e||_0x1bdd6f[_0x328020(0x114)];if(!_0x5c8d3e)return console[_0x328020(0x16c)](_0x328020(0x14d)),console[_0x328020(0x16c)](_0x328020(0x171)),console[_0x328020(0x16c)](_0x328020(0xee)),console[_0x328020(0x16c)](_0x328020(0x132)),console[_0x328020(0x16c)](_0x328020(0x169)),console[_0x328020(0x16c)](_0x328020(0x106)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x133c2d=_0x1bdd6f[_0x328020(0x120)];let _0x12dc84=_0x5c8d3e;!_0x1a6bc3&&_0x133c2d&&!_0x5c8d3e['includes']('/')&&(_0x12dc84=_0x133c2d+'/'+_0x5c8d3e,_0x1bdd6f[_0x328020(0xf8)]&&console[_0x328020(0x16c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x12dc84));const _0x5462d0=await withSpinner('Resolving\x20path\x20\x27'+_0x12dc84+_0x328020(0x131),()=>_0x45461c[_0x328020(0x145)][_0x328020(0xfa)](_0x12dc84),{'verbose':_0x1bdd6f['verbose']}),_0x48cec5=_0x5462d0['data'];_0x1bdd6f[_0x328020(0xf8)]&&(console[_0x328020(0x16c)]('Resolved\x20type:\x20'+_0x48cec5[_0x328020(0x11c)]),console['error'](_0x328020(0x16d)+_0x48cec5[_0x328020(0x123)]),_0x48cec5[_0x328020(0x136)]&&console[_0x328020(0x16c)]('Folder\x20ID:\x20'+_0x48cec5[_0x328020(0x136)]),_0x48cec5['segmentId']&&console[_0x328020(0x16c)](_0x328020(0x140)+_0x48cec5[_0x328020(0x170)]));if(_0x48cec5[_0x328020(0x11c)]===_0x328020(0x165)){const _0x4ed237=await withSpinner(_0x328020(0x166),()=>_0x45461c[_0x328020(0x145)][_0x328020(0x13e)](_0x48cec5['parentId']),{'verbose':_0x1bdd6f[_0x328020(0xf8)]});await handleSingleObjectOutput(_0x4ed237['data'],_0x1bdd6f);}else{if(_0x48cec5[_0x328020(0x11c)]===_0x328020(0x101)){if(!_0x48cec5[_0x328020(0x136)])throw new SDKError(ErrorCode[_0x328020(0xf4)],_0x328020(0x10a));const _0x3675c4=await withSpinner(_0x328020(0x150),()=>_0x45461c[_0x328020(0x145)][_0x328020(0x111)](_0x48cec5[_0x328020(0x136)]),{'verbose':_0x1bdd6f[_0x328020(0xf8)]});await handleSingleObjectOutput(_0x3675c4[_0x328020(0x117)],_0x1bdd6f);}else{if(_0x48cec5['type']===_0x328020(0x145)){if(!_0x48cec5[_0x328020(0x170)])throw new SDKError(ErrorCode[_0x328020(0xf4)],_0x328020(0x155));const _0x3a3206=await withSpinner(_0x328020(0x128),()=>_0x45461c[_0x328020(0x145)][_0x328020(0x119)](_0x48cec5[_0x328020(0x123)],_0x48cec5[_0x328020(0x170)]),{'verbose':_0x1bdd6f['verbose']});await handleSingleObjectOutput(_0x3a3206['data'],_0x1bdd6f);}}}return 0x0;}catch(_0xff46b0){if(_0xff46b0 instanceof SDKError)return console[_0x328020(0x16c)](_0x328020(0x10c)+_0xff46b0[_0x328020(0x11a)]),_0xff46b0['cause']&&console[_0x328020(0x16c)]('\x20\x20Cause:\x20'+_0xff46b0['cause']),0x1;throw _0xff46b0;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a29_0x45cd8a(0xfc)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a29_0x45cd8a(0x12a)](_0x25b827){const _0x4cb9b1=a29_0x45cd8a,{options:_0x12d5a8,args:_0x496537,tdx:_0x130432}=_0x25b827,_0x55b055=_0x496537[0x0],_0x313179=!_0x55b055&&!!_0x12d5a8['parentSegment'],_0x2a6c7e=_0x55b055||_0x12d5a8['parentSegment'];if(!_0x2a6c7e)return console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x15d)),console[_0x4cb9b1(0x16c)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x107)),console['error'](_0x4cb9b1(0x116)),console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x12e)),0x1;try{const _0x24c9d5=_0x12d5a8[_0x4cb9b1(0x120)];let _0x297fd7=_0x2a6c7e;!_0x313179&&_0x24c9d5&&!_0x2a6c7e[_0x4cb9b1(0x130)]('/')&&(_0x297fd7=_0x24c9d5+'/'+_0x2a6c7e,_0x12d5a8[_0x4cb9b1(0xf8)]&&console[_0x4cb9b1(0x16c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x297fd7));const _0x31cf71=await withSpinner(_0x4cb9b1(0x13f)+_0x297fd7+_0x4cb9b1(0x131),()=>_0x130432['segment'][_0x4cb9b1(0xfa)](_0x297fd7),{'verbose':_0x12d5a8['verbose']}),_0x8371f0=_0x31cf71['data'];_0x12d5a8[_0x4cb9b1(0xf8)]&&(console['error'](_0x4cb9b1(0x109)+_0x8371f0[_0x4cb9b1(0x11c)]),console['error'](_0x4cb9b1(0x16d)+_0x8371f0[_0x4cb9b1(0x123)]));if(_0x8371f0[_0x4cb9b1(0x11c)]==='folder')return console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x135)),console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x104)),0x1;let _0x2baa4c;if(_0x8371f0[_0x4cb9b1(0x11c)]===_0x4cb9b1(0x165)){const _0x194273=await withSpinner(_0x4cb9b1(0x15a),()=>_0x130432[_0x4cb9b1(0x145)][_0x4cb9b1(0x143)](_0x8371f0[_0x4cb9b1(0x123)]),{'verbose':_0x12d5a8['verbose']});_0x2baa4c=_0x194273[_0x4cb9b1(0x117)];}else{if(!_0x8371f0['segmentId'])throw new SDKError(ErrorCode[_0x4cb9b1(0xf4)],_0x4cb9b1(0x155));const _0x12957a=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x130432[_0x4cb9b1(0x145)][_0x4cb9b1(0x14c)](_0x8371f0[_0x4cb9b1(0x123)],_0x8371f0['segmentId']),{'verbose':_0x12d5a8[_0x4cb9b1(0xf8)]});_0x2baa4c=_0x12957a[_0x4cb9b1(0x117)];}const _0xcc82d0=resolveLimit(_0x12d5a8[_0x4cb9b1(0x10d)],DEFAULT_DISPLAY_LIMIT),_0x17c49d=/\bLIMIT\s+\d+/i[_0x4cb9b1(0x105)](_0x2baa4c);!_0x17c49d&&(_0x2baa4c=_0x2baa4c[_0x4cb9b1(0x10f)]()[_0x4cb9b1(0x162)](/;+$/,''),_0x2baa4c=_0x4cb9b1(0x172)+_0x2baa4c+_0x4cb9b1(0x11d)+_0xcc82d0);_0x12d5a8['verbose']&&console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x14f)+_0x2baa4c);const _0x18fc3d=await withQuerySpinner(_0x4cb9b1(0x12d),async _0x48c376=>{const _0x1695ac=_0x4cb9b1,_0x241da2=await _0x130432['query'][_0x1695ac(0x12a)](_0x2baa4c,{'catalog':'td','schema':_0x1695ac(0x15c),'onJobId':_0x1e00af=>{const _0x3dcd1c=_0x1695ac;_0x48c376[_0x3dcd1c(0x11f)](_0x1e00af);}});return _0x241da2;},{'verbose':_0x12d5a8[_0x4cb9b1(0xf8)]}),_0x187a07=_0x18fc3d['data'],_0x2e3f13=_0x187a07[_0x4cb9b1(0x13a)]?_0x4cb9b1(0x133)+_0x187a07['jobId']+']':'';return console[_0x4cb9b1(0x16c)](_0x4cb9b1(0xf0)+_0x187a07[_0x4cb9b1(0x12c)][_0x4cb9b1(0x138)][_0x4cb9b1(0x100)]()+_0x4cb9b1(0x141)+('in\x20'+formatElapsed(_0x187a07[_0x4cb9b1(0x12c)][_0x4cb9b1(0x16f)])+_0x2e3f13)),await handleQueryOutput(_0x187a07,_0x12d5a8),0x0;}catch(_0x2b013b){if(_0x2b013b instanceof SDKError)return console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x149)+_0x2b013b[_0x4cb9b1(0x113)]+']'),console['error']('\x0a'+_0x2b013b[_0x4cb9b1(0x11a)]),0x1;throw _0x2b013b;}}}function a29_0x943a(){const _0x28fb9a=['\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20desc\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segment:info','\x20\x20Cause:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','information_schema','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20segment:\x20','3060170hJLmJQ','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','replace','\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience/Marketing/High\x20Value\x22','108AVvlRg','parent','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','parentFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20desc\x20<path>','error','Parent\x20ID:\x20','Show\x20segment\x20schema\x20(column\x20types)','elapsedTimeMillis','segmentId','Usage:\x20tdx\x20segment\x20describe\x20<path>','SELECT\x20*\x20FROM\x20(\x0a','240023gSsyuE','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','1839121fHxghI','Examples:','61357920qmvmAN','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folder\x20name:\x20','Create\x20segment\x20folder\x20for\x20organization','INTERNAL','Error:\x20Folder\x20reference\x20is\x20required','jsonl','resolveFolderId','verbose','\x20folder','resolvePathToResource','Show\x20segment\x20folder\x20details','description','12DbOymk','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','toLocaleString','folder','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','104FLWvWd','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','test','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20folder\x20\x27','Resolved\x20type:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20SQL\x20for\x20segment...','Error:\x20','limit','resolveParentId','trim','cause','getFolder','segment:desc','code','parentSegment','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','data','Resolved\x20parent\x20folder\x20ID:\x20','getSegment','message','Creating\x20folder\x20\x27','type','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segment:sql','setJobId','segmentPath','Site:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','parentId','Parent\x20name:\x20','Show\x20segment\x20or\x20folder\x20details','name','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20segment\x20details...','segment:describe','execute','657WbucvF','stats','Executing\x20segment\x20query...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','json','includes','\x27...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20[Job\x20ID:\x20','3051260KZlfVF','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','folderId','site','processedRows','createFolder','jobId','✔\x20Created\x20folder\x20\x27','length','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','getParent','Resolving\x20path\x20\x27','Segment\x20ID:\x20','\x20rows\x20','✔\x20Found\x20','getParentSQL','Resolved\x20relative\x20path\x20to:\x20','segment','log','200680bfVzjC','\x20\x20tdx\x20segment\x20info\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','✖\x20Query\x20failed\x20[','segment:folder:list','Resolving\x20parent\x20segment\x20\x27','getSegmentSQL','Error:\x20Path\x20or\x20name\x20is\x20required','7428CVPfVz','SQL\x20query:\x0a','Fetching\x20folder\x20details...','format','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20info\x20<path>','11XwjePV','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a29_0x943a=function(){return _0x28fb9a;};return a29_0x943a();}export class SegmentFolderListCommand extends BaseCommand{['name']=a29_0x45cd8a(0x14a);[a29_0x45cd8a(0xfc)]=a29_0x45cd8a(0x115);async['execute'](_0x82a3a7){const _0x30b3c5=a29_0x45cd8a,{options:_0x3cfdea,args:_0x37452b,tdx:_0x4696fe}=_0x82a3a7;if(_0x37452b[_0x30b3c5(0x13c)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x30b3c5(0x16c)](_0x30b3c5(0x167)),0x1;const _0xfe8f00=_0x37452b[0x0];try{_0x3cfdea['verbose']&&(console[_0x30b3c5(0x16c)](_0x30b3c5(0x121)+_0x3cfdea[_0x30b3c5(0x137)]),console[_0x30b3c5(0x16c)]('Parent\x20name:\x20'+_0xfe8f00));const _0x2201b6=await withSpinner(_0x30b3c5(0x14b)+_0xfe8f00+'\x27...',()=>_0x4696fe[_0x30b3c5(0x145)][_0x30b3c5(0x10e)](_0xfe8f00),{'verbose':_0x3cfdea[_0x30b3c5(0xf8)]}),_0x5ef391=_0x2201b6['data'];_0x3cfdea[_0x30b3c5(0xf8)]&&console[_0x30b3c5(0x16c)](_0x30b3c5(0x16a)+_0x5ef391);const _0x5dfda2=await withSpinner(_0x30b3c5(0x160)+_0xfe8f00+_0x30b3c5(0x131),()=>_0x4696fe[_0x30b3c5(0x145)]['listFolders'](_0x5ef391),{'verbose':_0x3cfdea[_0x30b3c5(0xf8)]}),_0x2c21c4=_0x5dfda2[_0x30b3c5(0x117)];return console[_0x30b3c5(0x16c)](_0x30b3c5(0x142)+_0x2c21c4['length']+_0x30b3c5(0xf9)+(_0x2c21c4['length']!==0x1?'s':'')),await handleSDKOutput(_0x2c21c4,_0x3cfdea),0x0;}catch(_0x229205){if(_0x229205 instanceof SDKError)return console[_0x30b3c5(0x16c)]('Error:\x20'+_0x229205['message']),_0x229205[_0x30b3c5(0x110)]&&console[_0x30b3c5(0x16c)]('\x20\x20Cause:\x20'+_0x229205['cause']),0x1;throw _0x229205;}}}export class SegmentFolderShowCommand extends BaseCommand{[a29_0x45cd8a(0x126)]='segment:folder:show';['description']=a29_0x45cd8a(0xfb);async[a29_0x45cd8a(0x12a)](_0x20af7e){const _0x3d6a95=a29_0x45cd8a,{options:_0x2950d3,args:_0x3ad169,tdx:_0x1443fd}=_0x20af7e;if(_0x3ad169[_0x3d6a95(0x13c)]===0x0)return console[_0x3d6a95(0x16c)](_0x3d6a95(0xf5)),console[_0x3d6a95(0x16c)](_0x3d6a95(0x102)),0x1;try{const {parentId:_0x3bed22,childId:_0x1a3d4b}=parseSegmentRef(_0x3ad169[0x0]);_0x2950d3[_0x3d6a95(0xf8)]&&(console[_0x3d6a95(0x16c)](_0x3d6a95(0x121)+_0x2950d3[_0x3d6a95(0x137)]),console[_0x3d6a95(0x16c)](_0x3d6a95(0x124)+_0x3bed22),_0x1a3d4b&&console[_0x3d6a95(0x16c)](_0x3d6a95(0xf2)+_0x1a3d4b));if(!_0x1a3d4b)return console['error'](_0x3d6a95(0x122)),0x1;const _0x3fcde2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3bed22+_0x3d6a95(0x131),()=>_0x1443fd['segment'][_0x3d6a95(0x10e)](_0x3bed22),{'verbose':_0x2950d3[_0x3d6a95(0xf8)]}),_0x6eb750=_0x3fcde2[_0x3d6a95(0x117)];_0x2950d3['verbose']&&console[_0x3d6a95(0x16c)](_0x3d6a95(0x16a)+_0x6eb750);const _0x4b2c90=await withSpinner('Resolving\x20folder\x20\x27'+_0x1a3d4b+_0x3d6a95(0x131),()=>_0x1443fd['segment']['resolveFolderId'](_0x6eb750,_0x1a3d4b),{'verbose':_0x2950d3[_0x3d6a95(0xf8)]}),_0x1122b6=_0x4b2c90[_0x3d6a95(0x117)];_0x2950d3[_0x3d6a95(0xf8)]&&console[_0x3d6a95(0x16c)](_0x3d6a95(0x152)+_0x1122b6);const _0x2bfdd1=await withSpinner(_0x3d6a95(0x108)+_0x1a3d4b+'\x27...',()=>_0x1443fd['segment']['getFolder'](_0x1122b6),{'verbose':_0x2950d3[_0x3d6a95(0xf8)]});return await handleSDKOutput([_0x2bfdd1[_0x3d6a95(0x117)]],_0x2950d3),0x0;}catch(_0x1c36a6){if(_0x1c36a6 instanceof SDKError)return console[_0x3d6a95(0x16c)](_0x3d6a95(0x10c)+_0x1c36a6[_0x3d6a95(0x11a)]),_0x1c36a6[_0x3d6a95(0x110)]&&console[_0x3d6a95(0x16c)](_0x3d6a95(0x159)+_0x1c36a6[_0x3d6a95(0x110)]),0x1;throw _0x1c36a6;}}}export class SegmentSQLCommand extends BaseCommand{[a29_0x45cd8a(0x126)]=a29_0x45cd8a(0x11e);['description']=a29_0x45cd8a(0x15b);async[a29_0x45cd8a(0x12a)](_0x5d2097){const _0x39ac96=a29_0x45cd8a,{options:_0x2dfdd9,args:_0x1e7096,tdx:_0x3ee80a}=_0x5d2097,_0x5d4a09=_0x1e7096[0x0],_0x37abe4=!_0x5d4a09&&!!_0x2dfdd9['parentSegment'],_0x371c79=_0x5d4a09||_0x2dfdd9['parentSegment'];if(!_0x371c79)return console[_0x39ac96(0x16c)](_0x39ac96(0x15d)),console[_0x39ac96(0x16c)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x39ac96(0x16c)](_0x39ac96(0xee)),console[_0x39ac96(0x16c)](_0x39ac96(0x13d)),console[_0x39ac96(0x16c)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x39ac96(0x16c)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x39ac96(0x16c)](_0x39ac96(0x12e)),0x1;try{const _0x262018=_0x2dfdd9[_0x39ac96(0x120)];let _0x43fdf0=_0x371c79;!_0x37abe4&&_0x262018&&!_0x371c79['includes']('/')&&(_0x43fdf0=_0x262018+'/'+_0x371c79,_0x2dfdd9['verbose']&&console[_0x39ac96(0x16c)](_0x39ac96(0x144)+_0x43fdf0));const _0x101847=await withSpinner(_0x39ac96(0x13f)+_0x43fdf0+_0x39ac96(0x131),()=>_0x3ee80a['segment'][_0x39ac96(0xfa)](_0x43fdf0),{'verbose':_0x2dfdd9[_0x39ac96(0xf8)]}),_0x127d65=_0x101847['data'];_0x2dfdd9[_0x39ac96(0xf8)]&&(console[_0x39ac96(0x16c)](_0x39ac96(0x109)+_0x127d65[_0x39ac96(0x11c)]),console[_0x39ac96(0x16c)]('Parent\x20ID:\x20'+_0x127d65['parentId']));if(_0x127d65[_0x39ac96(0x11c)]===_0x39ac96(0x101))return console['error'](_0x39ac96(0x161)),console[_0x39ac96(0x16c)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x571819;if(_0x127d65['type']===_0x39ac96(0x165)){const _0x17ed44=await withSpinner(_0x39ac96(0x15a),()=>_0x3ee80a[_0x39ac96(0x145)][_0x39ac96(0x143)](_0x127d65['parentId']),{'verbose':_0x2dfdd9['verbose']});_0x571819=_0x17ed44[_0x39ac96(0x117)];}else{if(!_0x127d65['segmentId'])throw new SDKError(ErrorCode[_0x39ac96(0xf4)],_0x39ac96(0x155));const _0x16d0ea=await withSpinner(_0x39ac96(0x10b),()=>_0x3ee80a['segment'][_0x39ac96(0x14c)](_0x127d65['parentId'],_0x127d65[_0x39ac96(0x170)]),{'verbose':_0x2dfdd9['verbose']});_0x571819=_0x16d0ea[_0x39ac96(0x117)];}return _0x2dfdd9[_0x39ac96(0x151)]===_0x39ac96(0x12f)||_0x2dfdd9[_0x39ac96(0x151)]===_0x39ac96(0xf6)?await handleSDKOutput([{'sql':_0x571819}],_0x2dfdd9):console[_0x39ac96(0x146)](_0x571819),0x0;}catch(_0x54400f){if(_0x54400f instanceof SDKError)return console[_0x39ac96(0x16c)]('Error:\x20'+_0x54400f[_0x39ac96(0x11a)]),_0x54400f[_0x39ac96(0x110)]&&console[_0x39ac96(0x16c)](_0x39ac96(0x159)+_0x54400f['cause']),0x1;throw _0x54400f;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a29_0x45cd8a(0x126)]='segment:folder:create';[a29_0x45cd8a(0xfc)]=a29_0x45cd8a(0xf3);async[a29_0x45cd8a(0x12a)](_0x4bef1e){const _0x1a8cab=a29_0x45cd8a,{options:_0x1d2ce3,args:_0x49d2c1,tdx:_0x7296f6}=_0x4bef1e,_0x7c5ded=_0x1d2ce3;if(_0x49d2c1[_0x1a8cab(0x13c)]<0x2)return console[_0x1a8cab(0x16c)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1a8cab(0x16c)](_0x1a8cab(0xec)),0x1;const _0x52ac0e=_0x49d2c1[0x0],_0x187c33=_0x49d2c1[0x1];_0x7c5ded['verbose']&&(console[_0x1a8cab(0x16c)](_0x1a8cab(0x121)+_0x7c5ded['site']),console['error'](_0x1a8cab(0x15e)+_0x52ac0e),console[_0x1a8cab(0x16c)](_0x1a8cab(0xf2)+_0x187c33));let _0x4f0a12;if(_0x7c5ded[_0x1a8cab(0x168)]){const _0x130b22=_0x7c5ded[_0x1a8cab(0x168)],_0x43ee75=await withSpinner(_0x1a8cab(0x14b)+_0x52ac0e+'\x27...',()=>_0x7296f6['segment'][_0x1a8cab(0x10e)](_0x52ac0e),{'verbose':_0x7c5ded[_0x1a8cab(0xf8)]}),_0x58993a=_0x43ee75[_0x1a8cab(0x117)],_0x1c5573=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x130b22+'\x27...',()=>_0x7296f6[_0x1a8cab(0x145)][_0x1a8cab(0xf7)](_0x58993a,_0x130b22),{'verbose':_0x7c5ded['verbose']});_0x4f0a12=_0x1c5573[_0x1a8cab(0x117)],_0x7c5ded[_0x1a8cab(0xf8)]&&console[_0x1a8cab(0x16c)](_0x1a8cab(0x118)+_0x4f0a12);}const _0xed5551={'name':_0x187c33,'description':_0x7c5ded[_0x1a8cab(0xfc)],'parentFolderId':_0x4f0a12},_0x48bd31=await withSpinner(_0x1a8cab(0x11b)+_0x187c33+'\x27...',()=>_0x7296f6[_0x1a8cab(0x145)][_0x1a8cab(0x139)](_0x52ac0e,_0xed5551),{'verbose':_0x7c5ded[_0x1a8cab(0xf8)]}),_0x3eca21=_0x48bd31['data'];return console['error'](_0x1a8cab(0x13b)+_0x3eca21[_0x1a8cab(0x126)]+_0x1a8cab(0xfe)+_0x3eca21['id']),await handleSDKOutput([_0x3eca21],_0x7c5ded),0x0;}}export class SegmentInfoCommand extends BaseCommand{[a29_0x45cd8a(0x126)]=a29_0x45cd8a(0x158);[a29_0x45cd8a(0xfc)]=a29_0x45cd8a(0x125);async['execute'](_0x169e5b){const _0x2f40e9=a29_0x45cd8a,{options:_0x1d2acc,args:_0x53c00b,tdx:_0x3b8378}=_0x169e5b,_0x284025=_0x53c00b[0x0],_0x68bdf3=!_0x284025&&!!_0x1d2acc[_0x2f40e9(0x114)],_0x4ed0d2=_0x284025||_0x1d2acc[_0x2f40e9(0x114)];if(!_0x4ed0d2)return console[_0x2f40e9(0x16c)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x2f40e9(0x16c)](_0x2f40e9(0x153)),console[_0x2f40e9(0x16c)](_0x2f40e9(0xee)),console[_0x2f40e9(0x16c)](_0x2f40e9(0x156)),console['error'](_0x2f40e9(0x163)),console[_0x2f40e9(0x16c)](_0x2f40e9(0x148)),console['error'](_0x2f40e9(0x12e)),0x1;try{const _0x469841=_0x1d2acc[_0x2f40e9(0x120)];let _0xdd12fe=_0x4ed0d2;!_0x68bdf3&&_0x469841&&!_0x4ed0d2[_0x2f40e9(0x130)]('/')&&(_0xdd12fe=_0x469841+'/'+_0x4ed0d2,_0x1d2acc[_0x2f40e9(0xf8)]&&console[_0x2f40e9(0x16c)](_0x2f40e9(0x144)+_0xdd12fe));const _0x36b6b7=await withSpinner(_0x2f40e9(0x13f)+_0xdd12fe+_0x2f40e9(0x131),()=>_0x3b8378['segment']['resolvePathToResource'](_0xdd12fe),{'verbose':_0x1d2acc[_0x2f40e9(0xf8)]}),_0x47d8c0=_0x36b6b7['data'];_0x1d2acc[_0x2f40e9(0xf8)]&&(console['error'](_0x2f40e9(0x109)+_0x47d8c0[_0x2f40e9(0x11c)]),console[_0x2f40e9(0x16c)]('Parent\x20ID:\x20'+_0x47d8c0[_0x2f40e9(0x123)]),_0x47d8c0[_0x2f40e9(0x136)]&&console[_0x2f40e9(0x16c)]('Folder\x20ID:\x20'+_0x47d8c0[_0x2f40e9(0x136)]),_0x47d8c0['segmentId']&&console['error'](_0x2f40e9(0x140)+_0x47d8c0['segmentId']));if(_0x47d8c0['type']===_0x2f40e9(0x165)){const _0x3d722e=await withSpinner(_0x2f40e9(0x166),()=>_0x3b8378['segment'][_0x2f40e9(0x13e)](_0x47d8c0[_0x2f40e9(0x123)]),{'verbose':_0x1d2acc[_0x2f40e9(0xf8)]});await handleSingleObjectOutput(_0x3d722e[_0x2f40e9(0x117)],_0x1d2acc);}else{if(_0x47d8c0[_0x2f40e9(0x11c)]==='folder'){if(!_0x47d8c0[_0x2f40e9(0x136)])throw new SDKError(ErrorCode[_0x2f40e9(0xf4)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x12a2e7=await withSpinner(_0x2f40e9(0x150),()=>_0x3b8378[_0x2f40e9(0x145)][_0x2f40e9(0x111)](_0x47d8c0[_0x2f40e9(0x136)]),{'verbose':_0x1d2acc['verbose']});await handleSingleObjectOutput(_0x12a2e7['data'],_0x1d2acc);}else{if(_0x47d8c0[_0x2f40e9(0x11c)]==='segment'){if(!_0x47d8c0[_0x2f40e9(0x170)])throw new SDKError(ErrorCode[_0x2f40e9(0xf4)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x491c2d=await withSpinner(_0x2f40e9(0x128),()=>_0x3b8378[_0x2f40e9(0x145)][_0x2f40e9(0x119)](_0x47d8c0[_0x2f40e9(0x123)],_0x47d8c0[_0x2f40e9(0x170)]),{'verbose':_0x1d2acc['verbose']});await handleSingleObjectOutput(_0x491c2d[_0x2f40e9(0x117)],_0x1d2acc);}}}return 0x0;}catch(_0x309735){if(_0x309735 instanceof SDKError)return console[_0x2f40e9(0x16c)](_0x2f40e9(0x10c)+_0x309735['message']),_0x309735[_0x2f40e9(0x110)]&&console['error']('\x20\x20Cause:\x20'+_0x309735[_0x2f40e9(0x110)]),0x1;throw _0x309735;}}}export class SegmentDescCommand extends BaseCommand{[a29_0x45cd8a(0x126)]=a29_0x45cd8a(0x112);['description']=a29_0x45cd8a(0x16e);async['execute'](_0x24ae8d){const _0x1340c6=a29_0x45cd8a,{options:_0xd793b8,args:_0x3e9e63,tdx:_0x37b36c}=_0x24ae8d,_0x8ae9ae=_0x3e9e63[0x0],_0x1bcdab=!_0x8ae9ae&&!!_0xd793b8[_0x1340c6(0x114)],_0x4141b7=_0x8ae9ae||_0xd793b8[_0x1340c6(0x114)];if(!_0x4141b7)return console[_0x1340c6(0x16c)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x1340c6(0x16c)](_0x1340c6(0x16b)),console[_0x1340c6(0x16c)]('Examples:'),console[_0x1340c6(0x16c)]('\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience\x22'),console[_0x1340c6(0x16c)](_0x1340c6(0xf1)),console[_0x1340c6(0x16c)](_0x1340c6(0x157)),console['error'](_0x1340c6(0x12e)),0x1;try{const _0x41d757=_0xd793b8[_0x1340c6(0x120)];let _0x2d8c09=_0x4141b7;!_0x1bcdab&&_0x41d757&&!_0x4141b7[_0x1340c6(0x130)]('/')&&(_0x2d8c09=_0x41d757+'/'+_0x4141b7,_0xd793b8['verbose']&&console[_0x1340c6(0x16c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2d8c09));const _0x2e8a00=await withSpinner(_0x1340c6(0x13f)+_0x2d8c09+_0x1340c6(0x131),()=>_0x37b36c['segment'][_0x1340c6(0xfa)](_0x2d8c09),{'verbose':_0xd793b8['verbose']}),_0x73f10f=_0x2e8a00[_0x1340c6(0x117)];_0xd793b8['verbose']&&(console['error'](_0x1340c6(0x109)+_0x73f10f[_0x1340c6(0x11c)]),console[_0x1340c6(0x16c)]('Parent\x20ID:\x20'+_0x73f10f[_0x1340c6(0x123)]));if(_0x73f10f[_0x1340c6(0x11c)]==='folder')return console['error'](_0x1340c6(0xff)),console[_0x1340c6(0x16c)](_0x1340c6(0x127)),0x1;let _0x283fea;if(_0x73f10f[_0x1340c6(0x11c)]==='parent'){const _0x49ef26=await withSpinner(_0x1340c6(0x15a),()=>_0x37b36c[_0x1340c6(0x145)]['getParentSQL'](_0x73f10f[_0x1340c6(0x123)]),{'verbose':_0xd793b8[_0x1340c6(0xf8)]});_0x283fea=_0x49ef26[_0x1340c6(0x117)];}else{if(!_0x73f10f[_0x1340c6(0x170)])throw new SDKError(ErrorCode[_0x1340c6(0xf4)],_0x1340c6(0x155));const _0x13403c=await withSpinner(_0x1340c6(0x10b),()=>_0x37b36c['segment'][_0x1340c6(0x14c)](_0x73f10f[_0x1340c6(0x123)],_0x73f10f[_0x1340c6(0x170)]),{'verbose':_0xd793b8['verbose']});_0x283fea=_0x13403c['data'];}const _0x4fa85d=await executeSchemaQuery(_0x283fea,_0x37b36c,_0xd793b8);return await handleQueryOutput(_0x4fa85d,_0xd793b8),0x0;}catch(_0x43cf84){if(_0x43cf84 instanceof SDKError)return console[_0x1340c6(0x16c)]('Error:\x20'+_0x43cf84[_0x1340c6(0x11a)]),_0x43cf84['cause']&&console[_0x1340c6(0x16c)](_0x1340c6(0x159)+_0x43cf84[_0x1340c6(0x110)]),0x1;throw _0x43cf84;}}}
|
|
1
|
+
const a29_0xb20405=a29_0x42c0;(function(_0x3c534a,_0x2fbe64){const _0x12be04=a29_0x42c0,_0x202deb=_0x3c534a();while(!![]){try{const _0x2dbcdb=parseInt(_0x12be04(0x1ce))/0x1*(parseInt(_0x12be04(0x21e))/0x2)+parseInt(_0x12be04(0x1b8))/0x3*(parseInt(_0x12be04(0x221))/0x4)+parseInt(_0x12be04(0x1b7))/0x5+-parseInt(_0x12be04(0x1bd))/0x6+-parseInt(_0x12be04(0x1fe))/0x7*(parseInt(_0x12be04(0x1d6))/0x8)+-parseInt(_0x12be04(0x20c))/0x9+parseInt(_0x12be04(0x1ba))/0xa;if(_0x2dbcdb===_0x2fbe64)break;else _0x202deb['push'](_0x202deb['shift']());}catch(_0x44e3e5){_0x202deb['push'](_0x202deb['shift']());}}}(a29_0x453d,0xe5b89));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';export class SegmentDescribeCommand extends BaseCommand{['name']=a29_0xb20405(0x1c5);[a29_0xb20405(0x1f8)]='Show\x20segment\x20or\x20folder\x20details';async[a29_0xb20405(0x1e1)](_0x529218){const _0x2387b0=a29_0xb20405,{options:_0x4168bb,args:_0x1c7e44,tdx:_0x482346}=_0x529218,_0x38c65c=_0x1c7e44[0x0],_0x26f9fb=!_0x38c65c&&!!_0x4168bb['parentSegment'],_0x149a94=_0x38c65c||_0x4168bb['parentSegment'];if(!_0x149a94)return console[_0x2387b0(0x203)](_0x2387b0(0x1a6)),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x2387b0(0x203)](_0x2387b0(0x1a5)),console[_0x2387b0(0x203)](_0x2387b0(0x1f1)),console[_0x2387b0(0x203)](_0x2387b0(0x211)),console[_0x2387b0(0x203)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x2387b0(0x203)](_0x2387b0(0x1d7)),0x1;try{const _0x3e5890=_0x4168bb['segmentPath'];let _0x5902c9=_0x149a94;!_0x26f9fb&&_0x3e5890&&!_0x149a94[_0x2387b0(0x215)]('/')&&(_0x5902c9=_0x3e5890+'/'+_0x149a94,_0x4168bb[_0x2387b0(0x1b2)]&&console['error'](_0x2387b0(0x1cd)+_0x5902c9));const _0x53feb2=await withSpinner(_0x2387b0(0x1c8)+_0x5902c9+_0x2387b0(0x213),()=>_0x482346['segment']['resolvePathToResource'](_0x5902c9),{'verbose':_0x4168bb[_0x2387b0(0x1b2)]}),_0x390373=_0x53feb2['data'];_0x4168bb[_0x2387b0(0x1b2)]&&(console[_0x2387b0(0x203)](_0x2387b0(0x205)+_0x390373[_0x2387b0(0x202)]),console['error'](_0x2387b0(0x1be)+_0x390373[_0x2387b0(0x1cc)]),_0x390373[_0x2387b0(0x20d)]&&console[_0x2387b0(0x203)](_0x2387b0(0x1c7)+_0x390373[_0x2387b0(0x20d)]),_0x390373[_0x2387b0(0x1eb)]&&console[_0x2387b0(0x203)](_0x2387b0(0x1f3)+_0x390373['segmentId']));if(_0x390373[_0x2387b0(0x202)]===_0x2387b0(0x21c)){const _0x32889f=await withSpinner(_0x2387b0(0x1dc),()=>_0x482346[_0x2387b0(0x1e9)][_0x2387b0(0x1e2)](_0x390373[_0x2387b0(0x1cc)]),{'verbose':_0x4168bb[_0x2387b0(0x1b2)]});await handleSingleObjectOutput(_0x32889f[_0x2387b0(0x206)],_0x4168bb);}else{if(_0x390373['type']===_0x2387b0(0x1b5)){if(!_0x390373['folderId'])throw new SDKError(ErrorCode[_0x2387b0(0x1c1)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x253310=await withSpinner(_0x2387b0(0x1c6),()=>_0x482346['segment'][_0x2387b0(0x1e7)](_0x390373[_0x2387b0(0x20d)]),{'verbose':_0x4168bb[_0x2387b0(0x1b2)]});await handleSingleObjectOutput(_0x253310[_0x2387b0(0x206)],_0x4168bb);}else{if(_0x390373[_0x2387b0(0x202)]===_0x2387b0(0x1e9)){if(!_0x390373[_0x2387b0(0x1eb)])throw new SDKError(ErrorCode[_0x2387b0(0x1c1)],_0x2387b0(0x1bc));const _0xb76c74=await withSpinner(_0x2387b0(0x1c2),()=>_0x482346[_0x2387b0(0x1e9)][_0x2387b0(0x1f5)](_0x390373[_0x2387b0(0x1cc)],_0x390373[_0x2387b0(0x1eb)]),{'verbose':_0x4168bb[_0x2387b0(0x1b2)]});await handleSingleObjectOutput(_0xb76c74['data'],_0x4168bb);}}}return 0x0;}catch(_0x62cc8a){if(_0x62cc8a instanceof SDKError)return console[_0x2387b0(0x203)](_0x2387b0(0x1b3)+_0x62cc8a[_0x2387b0(0x1ad)]),_0x62cc8a[_0x2387b0(0x1c0)]&&console[_0x2387b0(0x203)](_0x2387b0(0x1f6)+_0x62cc8a[_0x2387b0(0x1c0)]),0x1;throw _0x62cc8a;}}}function a29_0x42c0(_0x304fca,_0x17b0a5){const _0x453dce=a29_0x453d();return a29_0x42c0=function(_0x42c068,_0x49f32e){_0x42c068=_0x42c068-0x1a5;let _0x473de6=_0x453dce[_0x42c068];return _0x473de6;},a29_0x42c0(_0x304fca,_0x17b0a5);}export class SegmentShowCommand extends BaseCommand{['name']=a29_0xb20405(0x1aa);['description']=a29_0xb20405(0x21a);async[a29_0xb20405(0x1e1)](_0x19c5c9){const _0x14c085=a29_0xb20405,{options:_0x5e81f1,args:_0x551594,tdx:_0x6845c5}=_0x19c5c9,_0x5b63ad=_0x551594[0x0],_0xabe88c=!_0x5b63ad&&!!_0x5e81f1[_0x14c085(0x1d0)],_0x420e8f=_0x5b63ad||_0x5e81f1[_0x14c085(0x1d0)];if(!_0x420e8f)return console[_0x14c085(0x203)](_0x14c085(0x1db)),console['error'](_0x14c085(0x21f)),console[_0x14c085(0x203)]('Examples:'),console[_0x14c085(0x203)](_0x14c085(0x1e3)),console[_0x14c085(0x203)](_0x14c085(0x1e6)),console['error'](_0x14c085(0x210)),console['error'](_0x14c085(0x1d7)),0x1;try{const _0x4b85aa=_0x5e81f1[_0x14c085(0x207)];let _0x1f5e13=_0x420e8f;!_0xabe88c&&_0x4b85aa&&!_0x420e8f[_0x14c085(0x215)]('/')&&(_0x1f5e13=_0x4b85aa+'/'+_0x420e8f,_0x5e81f1['verbose']&&console[_0x14c085(0x203)](_0x14c085(0x1cd)+_0x1f5e13));const _0x2c8350=await withSpinner(_0x14c085(0x1c8)+_0x1f5e13+_0x14c085(0x213),()=>_0x6845c5['segment'][_0x14c085(0x1b0)](_0x1f5e13),{'verbose':_0x5e81f1['verbose']}),_0x2f6866=_0x2c8350[_0x14c085(0x206)];_0x5e81f1[_0x14c085(0x1b2)]&&(console[_0x14c085(0x203)](_0x14c085(0x205)+_0x2f6866[_0x14c085(0x202)]),console[_0x14c085(0x203)](_0x14c085(0x1be)+_0x2f6866[_0x14c085(0x1cc)]));if(_0x2f6866['type']===_0x14c085(0x1b5))return console['error'](_0x14c085(0x201)),console[_0x14c085(0x203)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x565c7a;if(_0x2f6866[_0x14c085(0x202)]==='parent'){const _0x2890ce=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x6845c5[_0x14c085(0x1e9)][_0x14c085(0x217)](_0x2f6866[_0x14c085(0x1cc)]),{'verbose':_0x5e81f1[_0x14c085(0x1b2)]});_0x565c7a=_0x2890ce[_0x14c085(0x206)];}else{if(!_0x2f6866['segmentId'])throw new SDKError(ErrorCode[_0x14c085(0x1c1)],_0x14c085(0x1bc));const _0x39e409=await withSpinner(_0x14c085(0x1ee),()=>_0x6845c5[_0x14c085(0x1e9)][_0x14c085(0x1e4)](_0x2f6866[_0x14c085(0x1cc)],_0x2f6866[_0x14c085(0x1eb)]),{'verbose':_0x5e81f1[_0x14c085(0x1b2)]});_0x565c7a=_0x39e409[_0x14c085(0x206)];}const _0x4ce507=resolveLimit(_0x5e81f1['limit'],DEFAULT_DISPLAY_LIMIT),_0x347f32=/\bLIMIT\s+\d+/i[_0x14c085(0x1fd)](_0x565c7a);!_0x347f32&&(_0x565c7a=_0x565c7a[_0x14c085(0x223)]()[_0x14c085(0x1c4)](/;+$/,''),_0x565c7a=_0x14c085(0x1c9)+_0x565c7a+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x4ce507);_0x5e81f1[_0x14c085(0x1b2)]&&console[_0x14c085(0x203)](_0x14c085(0x1ca)+_0x565c7a);const _0x4b554f=await withQuerySpinner(_0x14c085(0x216),async _0x225d23=>{const _0x2b9c5c=_0x14c085,_0x1717b0=await _0x6845c5[_0x2b9c5c(0x1ae)][_0x2b9c5c(0x1e1)](_0x565c7a,{'catalog':'td','schema':'information_schema','onJobId':_0x460dd6=>{_0x225d23['setJobId'](_0x460dd6);}});return _0x1717b0;},{'verbose':_0x5e81f1[_0x14c085(0x1b2)]}),_0x4f6770=_0x4b554f[_0x14c085(0x206)],_0x11d1bf=_0x4f6770[_0x14c085(0x1b1)]?_0x14c085(0x1ea)+_0x4f6770[_0x14c085(0x1b1)]+']':'';return console[_0x14c085(0x203)](_0x14c085(0x1f0)+_0x4f6770[_0x14c085(0x20f)]['processedRows'][_0x14c085(0x1d8)]()+_0x14c085(0x1f2)+(_0x14c085(0x1d5)+formatElapsed(_0x4f6770[_0x14c085(0x20f)]['elapsedTimeMillis'])+_0x11d1bf)),await handleQueryOutput(_0x4f6770,_0x5e81f1),0x0;}catch(_0x518466){if(_0x518466 instanceof SDKError)return console[_0x14c085(0x203)](_0x14c085(0x1fc)+_0x518466[_0x14c085(0x1a8)]+']'),console[_0x14c085(0x203)]('\x0a'+_0x518466[_0x14c085(0x1ad)]),0x1;throw _0x518466;}}}export class SegmentFolderListCommand extends BaseCommand{[a29_0xb20405(0x1b4)]='segment:folder:list';[a29_0xb20405(0x1f8)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a29_0xb20405(0x1e1)](_0x3606f7){const _0x288809=a29_0xb20405,{options:_0x1e8c39,args:_0x5b6fa4,tdx:_0x2e3942}=_0x3606f7;if(_0x5b6fa4[_0x288809(0x1d4)]===0x0)return console[_0x288809(0x203)](_0x288809(0x1da)),console[_0x288809(0x203)](_0x288809(0x1d2)),0x1;const _0x59884d=_0x5b6fa4[0x0];try{_0x1e8c39[_0x288809(0x1b2)]&&(console[_0x288809(0x203)](_0x288809(0x220)+_0x1e8c39[_0x288809(0x1fa)]),console[_0x288809(0x203)](_0x288809(0x1cf)+_0x59884d));const _0x3e85c3=await withSpinner(_0x288809(0x20a)+_0x59884d+'\x27...',()=>_0x2e3942[_0x288809(0x1e9)][_0x288809(0x1c3)](_0x59884d),{'verbose':_0x1e8c39[_0x288809(0x1b2)]}),_0x55e281=_0x3e85c3[_0x288809(0x206)];_0x1e8c39[_0x288809(0x1b2)]&&console[_0x288809(0x203)](_0x288809(0x1e8)+_0x55e281);const _0x40fde4=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x59884d+'\x27...',()=>_0x2e3942['segment'][_0x288809(0x1bf)](_0x55e281),{'verbose':_0x1e8c39['verbose']}),_0x2d9a25=_0x40fde4['data'];return console['error'](_0x288809(0x1d1)+_0x2d9a25[_0x288809(0x1d4)]+_0x288809(0x1a7)+(_0x2d9a25['length']!==0x1?'s':'')),await handleSDKOutput(_0x2d9a25,_0x1e8c39),0x0;}catch(_0x16bfa2){if(_0x16bfa2 instanceof SDKError)return console[_0x288809(0x203)](_0x288809(0x1b3)+_0x16bfa2['message']),_0x16bfa2[_0x288809(0x1c0)]&&console[_0x288809(0x203)](_0x288809(0x1f6)+_0x16bfa2['cause']),0x1;throw _0x16bfa2;}}}export class SegmentFolderShowCommand extends BaseCommand{[a29_0xb20405(0x1b4)]='segment:folder:show';[a29_0xb20405(0x1f8)]=a29_0xb20405(0x1dd);async[a29_0xb20405(0x1e1)](_0x52e27d){const _0x3350b1=a29_0xb20405,{options:_0x9ae15c,args:_0xda546c,tdx:_0xfff16c}=_0x52e27d;if(_0xda546c['length']===0x0)return console[_0x3350b1(0x203)](_0x3350b1(0x1e5)),console[_0x3350b1(0x203)](_0x3350b1(0x1f4)),0x1;try{const {parentId:_0x25bb07,childId:_0x406a1f}=parseSegmentRef(_0xda546c[0x0]);_0x9ae15c['verbose']&&(console[_0x3350b1(0x203)]('Site:\x20'+_0x9ae15c[_0x3350b1(0x1fa)]),console['error'](_0x3350b1(0x1cf)+_0x25bb07),_0x406a1f&&console[_0x3350b1(0x203)](_0x3350b1(0x218)+_0x406a1f));if(!_0x406a1f)return console['error'](_0x3350b1(0x1fb)),0x1;const _0x23e2d5=await withSpinner(_0x3350b1(0x20a)+_0x25bb07+_0x3350b1(0x213),()=>_0xfff16c[_0x3350b1(0x1e9)]['resolveParentId'](_0x25bb07),{'verbose':_0x9ae15c[_0x3350b1(0x1b2)]}),_0x478226=_0x23e2d5[_0x3350b1(0x206)];_0x9ae15c[_0x3350b1(0x1b2)]&&console[_0x3350b1(0x203)]('Resolved\x20parent\x20ID:\x20'+_0x478226);const _0x1979d8=await withSpinner('Resolving\x20folder\x20\x27'+_0x406a1f+'\x27...',()=>_0xfff16c[_0x3350b1(0x1e9)]['resolveFolderId'](_0x478226,_0x406a1f),{'verbose':_0x9ae15c[_0x3350b1(0x1b2)]}),_0x2db29d=_0x1979d8['data'];_0x9ae15c[_0x3350b1(0x1b2)]&&console['error'](_0x3350b1(0x1bb)+_0x2db29d);const _0x2b00b8=await withSpinner(_0x3350b1(0x1af)+_0x406a1f+_0x3350b1(0x213),()=>_0xfff16c[_0x3350b1(0x1e9)][_0x3350b1(0x1e7)](_0x2db29d),{'verbose':_0x9ae15c['verbose']});return await handleSDKOutput([_0x2b00b8[_0x3350b1(0x206)]],_0x9ae15c),0x0;}catch(_0xc916d4){if(_0xc916d4 instanceof SDKError)return console[_0x3350b1(0x203)](_0x3350b1(0x1b3)+_0xc916d4['message']),_0xc916d4[_0x3350b1(0x1c0)]&&console[_0x3350b1(0x203)]('\x20\x20Cause:\x20'+_0xc916d4[_0x3350b1(0x1c0)]),0x1;throw _0xc916d4;}}}export class SegmentSQLCommand extends BaseCommand{[a29_0xb20405(0x1b4)]=a29_0xb20405(0x1ab);[a29_0xb20405(0x1f8)]=a29_0xb20405(0x1f7);async['execute'](_0x5695cd){const _0x36de88=a29_0xb20405,{options:_0x76e67a,args:_0x4cf1a2,tdx:_0x1e430a}=_0x5695cd,_0x5059fc=_0x4cf1a2[0x0],_0x239904=!_0x5059fc&&!!_0x76e67a['parentSegment'],_0x1d34d1=_0x5059fc||_0x76e67a[_0x36de88(0x1d0)];if(!_0x1d34d1)return console[_0x36de88(0x203)](_0x36de88(0x1db)),console['error']('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console['error'](_0x36de88(0x1a5)),console[_0x36de88(0x203)](_0x36de88(0x1cb)),console[_0x36de88(0x203)](_0x36de88(0x20e)),console[_0x36de88(0x203)](_0x36de88(0x212)),console[_0x36de88(0x203)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x305bc5=_0x76e67a[_0x36de88(0x207)];let _0xf93051=_0x1d34d1;!_0x239904&&_0x305bc5&&!_0x1d34d1['includes']('/')&&(_0xf93051=_0x305bc5+'/'+_0x1d34d1,_0x76e67a[_0x36de88(0x1b2)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0xf93051));const _0x2d8cab=await withSpinner(_0x36de88(0x1c8)+_0xf93051+_0x36de88(0x213),()=>_0x1e430a[_0x36de88(0x1e9)][_0x36de88(0x1b0)](_0xf93051),{'verbose':_0x76e67a[_0x36de88(0x1b2)]}),_0x4b5692=_0x2d8cab[_0x36de88(0x206)];_0x76e67a[_0x36de88(0x1b2)]&&(console[_0x36de88(0x203)]('Resolved\x20type:\x20'+_0x4b5692[_0x36de88(0x202)]),console[_0x36de88(0x203)](_0x36de88(0x1be)+_0x4b5692[_0x36de88(0x1cc)]));if(_0x4b5692[_0x36de88(0x202)]===_0x36de88(0x1b5))return console[_0x36de88(0x203)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x36de88(0x203)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x55f7bc;if(_0x4b5692[_0x36de88(0x202)]===_0x36de88(0x21c)){const _0x291d11=await withSpinner(_0x36de88(0x1ac),()=>_0x1e430a[_0x36de88(0x1e9)]['getParentSQL'](_0x4b5692[_0x36de88(0x1cc)]),{'verbose':_0x76e67a['verbose']});_0x55f7bc=_0x291d11[_0x36de88(0x206)];}else{if(!_0x4b5692[_0x36de88(0x1eb)])throw new SDKError(ErrorCode[_0x36de88(0x1c1)],_0x36de88(0x1bc));const _0x3ba0ad=await withSpinner(_0x36de88(0x1ee),()=>_0x1e430a[_0x36de88(0x1e9)]['getSegmentSQL'](_0x4b5692['parentId'],_0x4b5692[_0x36de88(0x1eb)]),{'verbose':_0x76e67a['verbose']});_0x55f7bc=_0x3ba0ad[_0x36de88(0x206)];}return _0x76e67a['format']===_0x36de88(0x21b)||_0x76e67a[_0x36de88(0x1a9)]==='jsonl'?await handleSDKOutput([{'sql':_0x55f7bc}],_0x76e67a):console[_0x36de88(0x1ff)](_0x55f7bc),0x0;}catch(_0x344c8e){if(_0x344c8e instanceof SDKError)return console[_0x36de88(0x203)]('Error:\x20'+_0x344c8e['message']),_0x344c8e[_0x36de88(0x1c0)]&&console[_0x36de88(0x203)]('\x20\x20Cause:\x20'+_0x344c8e[_0x36de88(0x1c0)]),0x1;throw _0x344c8e;}}}function a29_0x453d(){const _0x487c75=['Show\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20segment\x20info\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience\x22','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20rows\x20','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','getSegment','\x20\x20Cause:\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','description','segment:desc','site','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','✖\x20Query\x20failed\x20[','test','25522GVkrOZ','log','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','type','error','Usage:\x20tdx\x20segment\x20info\x20<path>','Resolved\x20type:\x20','data','segmentPath','segment:info','Show\x20segment\x20or\x20folder\x20details','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience\x22','2165454sFanIU','folderId','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','stats','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x27...','Parent\x20segment:\x20','includes','Executing\x20segment\x20query...','getParentSQL','Folder\x20name:\x20','Create\x20segment\x20folder\x20for\x20organization','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','json','parent','Resolved\x20parent\x20folder\x20ID:\x20','2DIKQjE','Usage:\x20tdx\x20segment\x20show\x20<path>','Site:\x20','12AUSBmc','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','trim','Examples:','Error:\x20Path\x20or\x20name\x20is\x20required','\x20folder','code','format','segment:show','segment:sql','Fetching\x20SQL\x20for\x20parent\x20segment...','message','query','Fetching\x20folder\x20\x27','resolvePathToResource','jobId','verbose','Error:\x20','name','folder','parentFolder','3655815OCIdaL','154311cllFJi','\x27\x20with\x20ID:\x20','8702140upeufP','Resolved\x20folder\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','9117288cDTaBS','Parent\x20ID:\x20','listFolders','cause','INTERNAL','Fetching\x20segment\x20details...','resolveParentId','replace','segment:describe','Fetching\x20folder\x20details...','Folder\x20ID:\x20','Resolving\x20path\x20\x27','SELECT\x20*\x20FROM\x20(\x0a','SQL\x20query:\x0a','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','parentId','Resolved\x20relative\x20path\x20to:\x20','1743877GUrSPP','Parent\x20name:\x20','parentSegment','✔\x20Found\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','✔\x20Created\x20folder\x20\x27','length','in\x20','1752BiekjY','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','toLocaleString','resolveFolderId','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Fetching\x20parent\x20segment\x20details...','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Creating\x20folder\x20\x27','Resolving\x20parent\x20folder\x20\x27','execute','getParent','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','getSegmentSQL','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getFolder','Resolved\x20parent\x20ID:\x20','segment','\x20[Job\x20ID:\x20','segmentId'];a29_0x453d=function(){return _0x487c75;};return a29_0x453d();}export class SegmentFolderCreateCommand extends BaseCommand{[a29_0xb20405(0x1b4)]='segment:folder:create';[a29_0xb20405(0x1f8)]=a29_0xb20405(0x219);async[a29_0xb20405(0x1e1)](_0x258bfa){const _0x2b6c98=a29_0xb20405,{options:_0x1af49b,args:_0x29e9c5,tdx:_0x220be4}=_0x258bfa,_0x4cc407=_0x1af49b;if(_0x29e9c5[_0x2b6c98(0x1d4)]<0x2)return console[_0x2b6c98(0x203)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x2b6c98(0x203)](_0x2b6c98(0x222)),0x1;const _0x21b067=_0x29e9c5[0x0],_0x1952b8=_0x29e9c5[0x1];_0x4cc407[_0x2b6c98(0x1b2)]&&(console[_0x2b6c98(0x203)](_0x2b6c98(0x220)+_0x4cc407['site']),console[_0x2b6c98(0x203)](_0x2b6c98(0x214)+_0x21b067),console[_0x2b6c98(0x203)](_0x2b6c98(0x218)+_0x1952b8));let _0x323a82;if(_0x4cc407[_0x2b6c98(0x1b6)]){const _0x1fd84=_0x4cc407[_0x2b6c98(0x1b6)],_0x273695=await withSpinner(_0x2b6c98(0x20a)+_0x21b067+_0x2b6c98(0x213),()=>_0x220be4[_0x2b6c98(0x1e9)][_0x2b6c98(0x1c3)](_0x21b067),{'verbose':_0x4cc407['verbose']}),_0x2470de=_0x273695[_0x2b6c98(0x206)],_0x1db283=await withSpinner(_0x2b6c98(0x1e0)+_0x1fd84+_0x2b6c98(0x213),()=>_0x220be4[_0x2b6c98(0x1e9)][_0x2b6c98(0x1d9)](_0x2470de,_0x1fd84),{'verbose':_0x4cc407[_0x2b6c98(0x1b2)]});_0x323a82=_0x1db283[_0x2b6c98(0x206)],_0x4cc407['verbose']&&console[_0x2b6c98(0x203)](_0x2b6c98(0x21d)+_0x323a82);}const _0x1687fa={'name':_0x1952b8,'description':_0x4cc407[_0x2b6c98(0x1f8)],'parentFolderId':_0x323a82},_0xc3b318=await withSpinner(_0x2b6c98(0x1df)+_0x1952b8+'\x27...',()=>_0x220be4[_0x2b6c98(0x1e9)]['createFolder'](_0x21b067,_0x1687fa),{'verbose':_0x4cc407['verbose']}),_0x4555e1=_0xc3b318['data'];return console[_0x2b6c98(0x203)](_0x2b6c98(0x1d3)+_0x4555e1['name']+_0x2b6c98(0x1b9)+_0x4555e1['id']),await handleSDKOutput([_0x4555e1],_0x4cc407),0x0;}}export class SegmentInfoCommand extends BaseCommand{[a29_0xb20405(0x1b4)]=a29_0xb20405(0x208);[a29_0xb20405(0x1f8)]=a29_0xb20405(0x209);async[a29_0xb20405(0x1e1)](_0x187832){const _0x3963c8=a29_0xb20405,{options:_0xe3ef40,args:_0x28f9bc,tdx:_0x13cafa}=_0x187832,_0x36b31a=_0x28f9bc[0x0],_0x9585eb=!_0x36b31a&&!!_0xe3ef40[_0x3963c8(0x1d0)],_0x388c19=_0x36b31a||_0xe3ef40[_0x3963c8(0x1d0)];if(!_0x388c19)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x3963c8(0x203)](_0x3963c8(0x204)),console[_0x3963c8(0x203)](_0x3963c8(0x1a5)),console[_0x3963c8(0x203)](_0x3963c8(0x20b)),console[_0x3963c8(0x203)]('\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3963c8(0x203)](_0x3963c8(0x1ed)),console[_0x3963c8(0x203)](_0x3963c8(0x1d7)),0x1;try{const _0x31eb7c=_0xe3ef40['segmentPath'];let _0x5a8d9a=_0x388c19;!_0x9585eb&&_0x31eb7c&&!_0x388c19[_0x3963c8(0x215)]('/')&&(_0x5a8d9a=_0x31eb7c+'/'+_0x388c19,_0xe3ef40[_0x3963c8(0x1b2)]&&console[_0x3963c8(0x203)](_0x3963c8(0x1cd)+_0x5a8d9a));const _0x531d6a=await withSpinner(_0x3963c8(0x1c8)+_0x5a8d9a+_0x3963c8(0x213),()=>_0x13cafa[_0x3963c8(0x1e9)]['resolvePathToResource'](_0x5a8d9a),{'verbose':_0xe3ef40[_0x3963c8(0x1b2)]}),_0x4026ec=_0x531d6a[_0x3963c8(0x206)];_0xe3ef40[_0x3963c8(0x1b2)]&&(console[_0x3963c8(0x203)](_0x3963c8(0x205)+_0x4026ec[_0x3963c8(0x202)]),console['error'](_0x3963c8(0x1be)+_0x4026ec[_0x3963c8(0x1cc)]),_0x4026ec[_0x3963c8(0x20d)]&&console[_0x3963c8(0x203)]('Folder\x20ID:\x20'+_0x4026ec[_0x3963c8(0x20d)]),_0x4026ec['segmentId']&&console[_0x3963c8(0x203)]('Segment\x20ID:\x20'+_0x4026ec[_0x3963c8(0x1eb)]));if(_0x4026ec[_0x3963c8(0x202)]===_0x3963c8(0x21c)){const _0x523963=await withSpinner(_0x3963c8(0x1dc),()=>_0x13cafa[_0x3963c8(0x1e9)]['getParent'](_0x4026ec['parentId']),{'verbose':_0xe3ef40[_0x3963c8(0x1b2)]});await handleSingleObjectOutput(_0x523963[_0x3963c8(0x206)],_0xe3ef40);}else{if(_0x4026ec['type']===_0x3963c8(0x1b5)){if(!_0x4026ec[_0x3963c8(0x20d)])throw new SDKError(ErrorCode[_0x3963c8(0x1c1)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x39fe91=await withSpinner('Fetching\x20folder\x20details...',()=>_0x13cafa[_0x3963c8(0x1e9)]['getFolder'](_0x4026ec[_0x3963c8(0x20d)]),{'verbose':_0xe3ef40[_0x3963c8(0x1b2)]});await handleSingleObjectOutput(_0x39fe91[_0x3963c8(0x206)],_0xe3ef40);}else{if(_0x4026ec[_0x3963c8(0x202)]===_0x3963c8(0x1e9)){if(!_0x4026ec[_0x3963c8(0x1eb)])throw new SDKError(ErrorCode[_0x3963c8(0x1c1)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x7c3f00=await withSpinner(_0x3963c8(0x1c2),()=>_0x13cafa['segment']['getSegment'](_0x4026ec[_0x3963c8(0x1cc)],_0x4026ec[_0x3963c8(0x1eb)]),{'verbose':_0xe3ef40[_0x3963c8(0x1b2)]});await handleSingleObjectOutput(_0x7c3f00[_0x3963c8(0x206)],_0xe3ef40);}}}return 0x0;}catch(_0x3d42b3){if(_0x3d42b3 instanceof SDKError)return console[_0x3963c8(0x203)](_0x3963c8(0x1b3)+_0x3d42b3[_0x3963c8(0x1ad)]),_0x3d42b3[_0x3963c8(0x1c0)]&&console['error'](_0x3963c8(0x1f6)+_0x3d42b3[_0x3963c8(0x1c0)]),0x1;throw _0x3d42b3;}}}export class SegmentDescCommand extends BaseCommand{[a29_0xb20405(0x1b4)]=a29_0xb20405(0x1f9);['description']=a29_0xb20405(0x1ec);async['execute'](_0x149232){const _0x42ef36=a29_0xb20405,{options:_0x77197b,args:_0x29674d,tdx:_0x737882}=_0x149232,_0x5b279a=_0x29674d[0x0],_0x3dad9f=!_0x5b279a&&!!_0x77197b['parentSegment'],_0x23265a=_0x5b279a||_0x77197b[_0x42ef36(0x1d0)];if(!_0x23265a)return console[_0x42ef36(0x203)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x42ef36(0x203)]('Usage:\x20tdx\x20segment\x20desc\x20<path>'),console[_0x42ef36(0x203)](_0x42ef36(0x1a5)),console[_0x42ef36(0x203)](_0x42ef36(0x1ef)),console[_0x42ef36(0x203)](_0x42ef36(0x1de)),console[_0x42ef36(0x203)]('\x20\x20tdx\x20segment\x20desc\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x42ef36(0x203)](_0x42ef36(0x1d7)),0x1;try{const _0x2374a5=_0x77197b[_0x42ef36(0x207)];let _0x308d4a=_0x23265a;!_0x3dad9f&&_0x2374a5&&!_0x23265a[_0x42ef36(0x215)]('/')&&(_0x308d4a=_0x2374a5+'/'+_0x23265a,_0x77197b['verbose']&&console[_0x42ef36(0x203)](_0x42ef36(0x1cd)+_0x308d4a));const _0x4db5db=await withSpinner(_0x42ef36(0x1c8)+_0x308d4a+'\x27...',()=>_0x737882[_0x42ef36(0x1e9)][_0x42ef36(0x1b0)](_0x308d4a),{'verbose':_0x77197b[_0x42ef36(0x1b2)]}),_0x375f24=_0x4db5db[_0x42ef36(0x206)];_0x77197b[_0x42ef36(0x1b2)]&&(console[_0x42ef36(0x203)]('Resolved\x20type:\x20'+_0x375f24['type']),console['error'](_0x42ef36(0x1be)+_0x375f24[_0x42ef36(0x1cc)]));if(_0x375f24[_0x42ef36(0x202)]===_0x42ef36(0x1b5))return console[_0x42ef36(0x203)](_0x42ef36(0x200)),console[_0x42ef36(0x203)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x1d2a3f;if(_0x375f24['type']===_0x42ef36(0x21c)){const _0x59e263=await withSpinner(_0x42ef36(0x1ac),()=>_0x737882['segment'][_0x42ef36(0x217)](_0x375f24[_0x42ef36(0x1cc)]),{'verbose':_0x77197b[_0x42ef36(0x1b2)]});_0x1d2a3f=_0x59e263[_0x42ef36(0x206)];}else{if(!_0x375f24[_0x42ef36(0x1eb)])throw new SDKError(ErrorCode[_0x42ef36(0x1c1)],_0x42ef36(0x1bc));const _0x3ca10e=await withSpinner(_0x42ef36(0x1ee),()=>_0x737882[_0x42ef36(0x1e9)][_0x42ef36(0x1e4)](_0x375f24['parentId'],_0x375f24[_0x42ef36(0x1eb)]),{'verbose':_0x77197b['verbose']});_0x1d2a3f=_0x3ca10e[_0x42ef36(0x206)];}const _0x45c5ea=await executeSchemaQuery(_0x1d2a3f,_0x737882,_0x77197b);return await handleQueryOutput(_0x45c5ea,_0x77197b),0x0;}catch(_0x393e49){if(_0x393e49 instanceof SDKError)return console['error']('Error:\x20'+_0x393e49['message']),_0x393e49[_0x42ef36(0x1c0)]&&console[_0x42ef36(0x203)]('\x20\x20Cause:\x20'+_0x393e49['cause']),0x1;throw _0x393e49;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x24bf68=a30_0x1b43;(function(_0x48c02f,_0xc92558){const _0x59301b=a30_0x1b43,_0x575ce4=_0x48c02f();while(!![]){try{const _0x2a7a23=parseInt(_0x59301b(0xcb))/0x1+parseInt(_0x59301b(0xb9))/0x2+-parseInt(_0x59301b(0xbc))/0x3+-parseInt(_0x59301b(0xdd))/0x4*(parseInt(_0x59301b(0xba))/0x5)+parseInt(_0x59301b(0xb0))/0x6*(parseInt(_0x59301b(0xd5))/0x7)+parseInt(_0x59301b(0xcf))/0x8*(parseInt(_0x59301b(0xb7))/0x9)+-parseInt(_0x59301b(0xb6))/0xa;if(_0x2a7a23===_0xc92558)break;else _0x575ce4['push'](_0x575ce4['shift']());}catch(_0x2dda34){_0x575ce4['push'](_0x575ce4['shift']());}}}(a30_0x1c22,0xe9b7c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a30_0x24bf68(0xdf)]=a30_0x24bf68(0xc0);['description']=a30_0x24bf68(0xc1);async[a30_0x24bf68(0xca)](_0x4d18dd){const _0x2018a1=a30_0x24bf68,{options:_0x259833,args:_0x41bf9a,tdx:_0x2bb810}=_0x4d18dd,_0x574dc5=_0x259833;if(_0x41bf9a[_0x2018a1(0xde)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x2018a1(0xb8)](_0x2018a1(0xc5)),console[_0x2018a1(0xb8)](_0x2018a1(0xb4)),console[_0x2018a1(0xb8)](_0x2018a1(0xcc)),console[_0x2018a1(0xb8)](_0x2018a1(0xe0)),console[_0x2018a1(0xb8)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x98c146=_0x41bf9a[0x0],_0x55f6cc=_0x259833[_0x2018a1(0xc2)];let _0x1671d5=_0x98c146;_0x55f6cc&&!_0x98c146['includes']('/')&&(_0x1671d5=_0x55f6cc+'/'+_0x98c146,_0x574dc5[_0x2018a1(0xaf)]&&console[_0x2018a1(0xb8)]('Resolved\x20relative\x20path\x20to:\x20'+_0x1671d5));const _0x26d1d5=parsePath(_0x1671d5);if(_0x26d1d5[_0x2018a1(0xbb)][_0x2018a1(0xde)]<0x2)return console[_0x2018a1(0xb8)](_0x2018a1(0xd1)),console[_0x2018a1(0xb8)](_0x2018a1(0xc3)),0x1;const _0x2ab98=_0x26d1d5['segments'][0x0],_0x1ce245=getBaseName(_0x1671d5),_0xebc7d1=getParentPath(_0x1671d5);_0x574dc5[_0x2018a1(0xaf)]&&(console[_0x2018a1(0xb8)]('Site:\x20'+_0x574dc5[_0x2018a1(0xdc)]),console[_0x2018a1(0xb8)](_0x2018a1(0xb2)+_0x1671d5),console['error'](_0x2018a1(0xcd)+_0x2ab98),console[_0x2018a1(0xb8)]('Segment\x20name:\x20'+_0x1ce245),console[_0x2018a1(0xb8)](_0x2018a1(0xc8)+_0xebc7d1));const _0x40ae00=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2ab98+_0x2018a1(0xd7),()=>_0x2bb810['segment'][_0x2018a1(0xd9)](_0x2ab98),{'verbose':_0x574dc5[_0x2018a1(0xaf)]}),_0xe150a6=_0x40ae00[_0x2018a1(0xd4)];let _0x2674db;if(_0x26d1d5[_0x2018a1(0xbb)][_0x2018a1(0xde)]>0x2){const _0x1c2c9f=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0xebc7d1+_0x2018a1(0xd7),()=>_0x2bb810['segment'][_0x2018a1(0xdb)](_0xebc7d1),{'verbose':_0x574dc5[_0x2018a1(0xaf)]}),_0x4870a0=_0x1c2c9f['data'];if(_0x4870a0['type']!=='folder'&&_0x4870a0[_0x2018a1(0xb5)]!==_0x2018a1(0xc7))return console[_0x2018a1(0xb8)](_0x2018a1(0xd6)),0x1;_0x2674db=_0x4870a0[_0x2018a1(0xd3)];}else{if(_0x574dc5['folder']){const _0x43f056=await withSpinner(_0x2018a1(0xc6)+_0x574dc5['folder']+'\x27...',()=>_0x2bb810[_0x2018a1(0xce)][_0x2018a1(0xbe)](_0xe150a6,_0x574dc5[_0x2018a1(0xd2)]),{'verbose':_0x574dc5['verbose']});_0x2674db=_0x43f056[_0x2018a1(0xd4)];}}_0x574dc5['verbose']&&_0x2674db&&console['error'](_0x2018a1(0xb1)+_0x2674db);const _0x562ba8=await loadJSONFromOptions(_0x574dc5[_0x2018a1(0xc9)],_0x574dc5[_0x2018a1(0xd8)]),_0x283c85={'name':_0x1ce245,'description':_0x574dc5[_0x2018a1(0xda)],'rule':_0x562ba8,'kind':_0x574dc5[_0x2018a1(0xc4)]!==undefined?parseInt(_0x574dc5[_0x2018a1(0xc4)],0xa):undefined,'isVisible':_0x574dc5[_0x2018a1(0xe1)]?![]:undefined,'segmentFolderId':_0x2674db,'countPopulation':_0x574dc5[_0x2018a1(0xbd)]?![]:undefined},_0x10de13=await withSpinner(_0x2018a1(0xb3)+_0x1ce245+_0x2018a1(0xd7),()=>_0x2bb810['segment'][_0x2018a1(0xd0)](_0xe150a6,_0x283c85),{'verbose':_0x574dc5[_0x2018a1(0xaf)]}),_0x15d397=_0x10de13['data'];return console[_0x2018a1(0xb8)](_0x2018a1(0xbf)+_0x15d397[_0x2018a1(0xdf)]+'\x27\x20with\x20ID:\x20'+_0x15d397['id']),_0x1671d5!==_0x98c146&&console[_0x2018a1(0xb8)]('\x20\x20\x20Path:\x20'+_0x1671d5),await handleSDKOutput([_0x15d397],_0x574dc5),0x0;}}function a30_0x1b43(_0x344831,_0x39d7ad){const _0x1c22e6=a30_0x1c22();return a30_0x1b43=function(_0x1b436a,_0x187d4a){_0x1b436a=_0x1b436a-0xaf;let _0x5e073=_0x1c22e6[_0x1b436a];return _0x5e073;},a30_0x1b43(_0x344831,_0x39d7ad);}function a30_0x1c22(){const _0x27a040=['Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','kind','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolving\x20folder\x20\x27','parent','Parent\x20path:\x20','rule','execute','979059NpEVSj','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent:\x20','segment','11675176Fbnebd','createSegment','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','folder','folderId','data','1624AEHQcF','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x27...','ruleFile','resolveParentId','description','resolvePathToResource','site','581036VVYbmx','length','name','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','invisible','verbose','37662cqXhyz','Resolved\x20folder\x20ID:\x20','Target\x20path:\x20','Creating\x20segment\x20\x27','Examples:','type','15979970RMDePV','9OORJOl','error','1578240HIkxRI','50jfJHbf','segments','2027835tiBcGG','noCountPopulation','resolveFolderId','✔\x20Created\x20segment\x20\x27','segment:create','Create\x20child\x20segment\x20with\x20filtering\x20rules','segmentPath'];a30_0x1c22=function(){return _0x27a040;};return a30_0x1c22();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x59d919=a31_0x4636;(function(_0x4ac7ae,_0x1f4ac3){const _0x1c1572=a31_0x4636,_0x35ddf1=_0x4ac7ae();while(!![]){try{const _0x51045e=parseInt(_0x1c1572(0x1da))/0x1*(-parseInt(_0x1c1572(0x1cd))/0x2)+parseInt(_0x1c1572(0x1db))/0x3+-parseInt(_0x1c1572(0x1e8))/0x4*(parseInt(_0x1c1572(0x1d4))/0x5)+parseInt(_0x1c1572(0x1cc))/0x6*(parseInt(_0x1c1572(0x1d2))/0x7)+parseInt(_0x1c1572(0x1ce))/0x8+parseInt(_0x1c1572(0x1d1))/0x9*(-parseInt(_0x1c1572(0x1df))/0xa)+parseInt(_0x1c1572(0x1dd))/0xb;if(_0x51045e===_0x1f4ac3)break;else _0x35ddf1['push'](_0x35ddf1['shift']());}catch(_0x485cad){_0x35ddf1['push'](_0x35ddf1['shift']());}}}(a31_0x3288,0xa065a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a31_0x4636(_0x1da15e,_0x5bb847){const _0x32889f=a31_0x3288();return a31_0x4636=function(_0x46369b,_0xc4899d){_0x46369b=_0x46369b-0x1cc;let _0x4122ea=_0x32889f[_0x46369b];return _0x4122ea;},a31_0x4636(_0x1da15e,_0x5bb847);}import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a31_0x59d919(0x1e0)]=a31_0x59d919(0x1d7);[a31_0x59d919(0x1e4)]=a31_0x59d919(0x1d8);async[a31_0x59d919(0x1e7)](_0xfb140c){const _0x221fcb=a31_0x59d919,{options:_0x453bd3,args:_0x339de4,tdx:_0x1926bc}=_0xfb140c,_0x464612=_0x339de4[0x0]||_0x453bd3['parentSegment'];if(!_0x464612)return console['error'](_0x221fcb(0x1d5)),console[_0x221fcb(0x1de)](_0x221fcb(0x1e3)),console[_0x221fcb(0x1de)](_0x221fcb(0x1cf)),0x1;_0x453bd3[_0x221fcb(0x1e5)]&&(console['error']('Site:\x20'+_0x453bd3[_0x221fcb(0x1e9)]),console[_0x221fcb(0x1de)]('Parent\x20segment:\x20'+_0x464612));const _0x1800a2=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x464612+_0x221fcb(0x1dc),()=>_0x1926bc[_0x221fcb(0x1e1)][_0x221fcb(0x1e6)](_0x464612),{'verbose':_0x453bd3[_0x221fcb(0x1e5)]}),_0x5e5810=_0x1800a2[_0x221fcb(0x1d0)];console['error'](_0x221fcb(0x1d3)+_0x5e5810[_0x221fcb(0x1d6)]+_0x221fcb(0x1d9)+(_0x5e5810[_0x221fcb(0x1d6)]!==0x1?'s':''));if(_0x453bd3['json']||_0x453bd3[_0x221fcb(0x1e2)])return await handleSDKOutput(_0x5e5810,_0x453bd3),0x0;return displayFieldsHumanReadable(_0x5e5810,_0x464612),0x0;}}function a31_0x3288(){const _0x559b62=['execute','76swdjxe','site','6anmUWv','2jUQrxO','10354840QUxbWw','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','data','1685727pCXilu','705369JVFZWK','✔\x20Found\x20','88860XMukQV','Error:\x20Parent\x20segment\x20name\x20is\x20required','length','segment:fields','List\x20available\x20fields\x20for\x20segmentation','\x20field','537891ylWbGl','1025451CIPhrZ','\x27...','12173997meqlon','error','70lQCfcg','name','segment','jsonl','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','description','verbose','listFields'];a31_0x3288=function(){return _0x559b62;};return a31_0x3288();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x5b8fca=a32_0x3be9;(function(_0x48be97,_0x5313ca){const _0x370206=a32_0x3be9,_0x24bfbe=_0x48be97();while(!![]){try{const _0x47b37b=parseInt(_0x370206(0x16f))/0x1*(-parseInt(_0x370206(0x173))/0x2)+parseInt(_0x370206(0x17f))/0x3*(-parseInt(_0x370206(0x17a))/0x4)+-parseInt(_0x370206(0x16a))/0x5*(-parseInt(_0x370206(0x175))/0x6)+-parseInt(_0x370206(0x171))/0x7*(parseInt(_0x370206(0x16c))/0x8)+-parseInt(_0x370206(0x178))/0x9+parseInt(_0x370206(0x174))/0xa+parseInt(_0x370206(0x17d))/0xb;if(_0x47b37b===_0x5313ca)break;else _0x24bfbe['push'](_0x24bfbe['shift']());}catch(_0x143668){_0x24bfbe['push'](_0x24bfbe['shift']());}}}(a32_0xe6a1,0xce8d7));function a32_0x3be9(_0x892565,_0x42d14b){const _0xe6a167=a32_0xe6a1();return a32_0x3be9=function(_0x3be903,_0x1f259e){_0x3be903=_0x3be903-0x16a;let _0x1bd79e=_0xe6a167[_0x3be903];return _0x1bd79e;},a32_0x3be9(_0x892565,_0x42d14b);}import{BaseCommand}from'./command.js';function a32_0xe6a1(){const _0x1af30d=['2298399ZVyllH','185INsrsZ','stringify','568GfAWme','verbose','jsonl','7xrLoVs','format','128849qYrxDP','log','446534WMTaBF','16577990lpEKFQ','120342xvoZXR','description','name','7363692AZxstQ','root','4CBeieb','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','Context\x20details:','31902398hiEaZH','error'];a32_0xe6a1=function(){return _0x1af30d;};return a32_0xe6a1();}export class SegmentPwdCommand extends BaseCommand{[a32_0x5b8fca(0x177)]='segment:pwd';[a32_0x5b8fca(0x176)]='Show\x20current\x20segment/folder\x20context';async['execute'](_0x2c24e0){const _0x5d2c5f=a32_0x5b8fca,{options:_0x24ee98}=_0x2c24e0;try{const _0x13b10e=_0x24ee98['segmentPath'];if(!_0x13b10e)return _0x24ee98[_0x5d2c5f(0x170)]==='json'||_0x24ee98[_0x5d2c5f(0x170)]==='jsonl'?console['log'](JSON[_0x5d2c5f(0x16b)]({'path':'/','type':_0x5d2c5f(0x179)})):console[_0x5d2c5f(0x172)]('/'),0x0;if(_0x24ee98[_0x5d2c5f(0x170)]==='json'||_0x24ee98[_0x5d2c5f(0x170)]===_0x5d2c5f(0x16e)){const _0x33e6cb={'path':_0x13b10e};console[_0x5d2c5f(0x172)](JSON[_0x5d2c5f(0x16b)](_0x33e6cb));}else console['log'](_0x13b10e),_0x24ee98[_0x5d2c5f(0x16d)]&&(console[_0x5d2c5f(0x17e)](''),console[_0x5d2c5f(0x17e)](_0x5d2c5f(0x17c)),console[_0x5d2c5f(0x17e)]('\x20\x20Path:\x20'+_0x13b10e),console[_0x5d2c5f(0x17e)](''),console['error']('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x5d2c5f(0x17e)](_0x5d2c5f(0x17b)));return 0x0;}catch(_0x530d12){throw _0x530d12;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x4feb1b=a33_0x2ae0;(function(_0x1bb1b2,_0x7a0893){const _0x4babd4=a33_0x2ae0,_0x1f3383=_0x1bb1b2();while(!![]){try{const _0x58d0d9=-parseInt(_0x4babd4(0x12d))/0x1*(parseInt(_0x4babd4(0x113))/0x2)+parseInt(_0x4babd4(0x135))/0x3+parseInt(_0x4babd4(0x130))/0x4+-parseInt(_0x4babd4(0x138))/0x5*(-parseInt(_0x4babd4(0x124))/0x6)+parseInt(_0x4babd4(0x12b))/0x7*(parseInt(_0x4babd4(0x118))/0x8)+-parseInt(_0x4babd4(0x12a))/0x9*(-parseInt(_0x4babd4(0x137))/0xa)+parseInt(_0x4babd4(0x12f))/0xb*(-parseInt(_0x4babd4(0x121))/0xc);if(_0x58d0d9===_0x7a0893)break;else _0x1f3383['push'](_0x1f3383['shift']());}catch(_0x870eaa){_0x1f3383['push'](_0x1f3383['shift']());}}}(a33_0x2f1d,0x9194d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a33_0x2f1d(){const _0x528fca=['.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20relative\x20path\x20to:\x20','Update\x20existing\x20child\x20segment','974ltEQrp','kind','description','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20ID:\x20','1985264FDWsOS','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','rule','data','includes','\x27...','segment','resolveFolderId','execute','684PfCmye','Resolved\x20folder\x20ID:\x20','type','6OYMexU','\x20\x20\x20Path:\x20','Segment\x20ID:\x20','Error:\x20Cannot\x20update\x20','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','9vFUczV','28ORHoqq','✔\x20Updated\x20segment\x20\x27','537gALkxJ','error','536239gJmGbf','2679548kqJkbF','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Updating\x20segment\x20\x27','Resolved\x20type:\x20','Resolving\x20path\x20\x27','2268645drDZyi','resolvePathToResource','5451620XfUEVj','3363085ptthnL','name','verbose','segmentPath'];a33_0x2f1d=function(){return _0x528fca;};return a33_0x2f1d();}import{withSpinner}from'../utils/spinner.js';function a33_0x2ae0(_0x12b42e,_0x148a1f){const _0x2f1dd5=a33_0x2f1d();return a33_0x2ae0=function(_0x2ae028,_0x1b4578){_0x2ae028=_0x2ae028-0x10f;let _0x11c83b=_0x2f1dd5[_0x2ae028];return _0x11c83b;},a33_0x2ae0(_0x12b42e,_0x148a1f);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a33_0x4feb1b(0x139)]='segment:update';['description']=a33_0x4feb1b(0x112);async[a33_0x4feb1b(0x120)](_0x54718b){const _0x5fa42f=a33_0x4feb1b,{options:_0x746e03,args:_0x5cf24a,tdx:_0x196a1e}=_0x54718b,_0x5e02b7=_0x746e03;if(_0x5cf24a['length']===0x0)return console['error'](_0x5fa42f(0x116)),console['error'](_0x5fa42f(0x129)),console['error']('Examples:'),console[_0x5fa42f(0x12e)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3e2a61=_0x5cf24a[0x0],_0xba68b4=_0x746e03[_0x5fa42f(0x10f)];let _0x412c52=_0x3e2a61;_0xba68b4&&!_0x3e2a61[_0x5fa42f(0x11c)]('/')&&(_0x412c52=_0xba68b4+'/'+_0x3e2a61,_0x5e02b7[_0x5fa42f(0x13a)]&&console['error'](_0x5fa42f(0x111)+_0x412c52));const _0x200ef5=await withSpinner(_0x5fa42f(0x134)+_0x412c52+_0x5fa42f(0x11d),()=>_0x196a1e[_0x5fa42f(0x11e)][_0x5fa42f(0x136)](_0x412c52),{'verbose':_0x5e02b7[_0x5fa42f(0x13a)]}),_0x2936ad=_0x200ef5[_0x5fa42f(0x11b)];_0x5e02b7[_0x5fa42f(0x13a)]&&console[_0x5fa42f(0x12e)](_0x5fa42f(0x133)+_0x2936ad[_0x5fa42f(0x123)]);if(_0x2936ad['type']!==_0x5fa42f(0x11e))return console[_0x5fa42f(0x12e)](_0x5fa42f(0x127)+_0x2936ad['type']+_0x5fa42f(0x110)),console['error'](_0x5fa42f(0x119)),0x1;if(!_0x2936ad['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x5fa42f(0x131));const _0x2ab5af=_0x2936ad['parentId'],_0x52aa67=_0x2936ad['segmentId'];_0x5e02b7[_0x5fa42f(0x13a)]&&(console[_0x5fa42f(0x12e)](_0x5fa42f(0x117)+_0x2ab5af),console['error'](_0x5fa42f(0x126)+_0x52aa67));let _0x2cfad6;if(_0x5e02b7['folder']){const _0x5226fd=_0x5e02b7['folder'],_0x518c8f=await withSpinner(_0x5fa42f(0x128)+_0x5226fd+_0x5fa42f(0x11d),()=>_0x196a1e[_0x5fa42f(0x11e)][_0x5fa42f(0x11f)](_0x2ab5af,_0x5226fd),{'verbose':_0x5e02b7[_0x5fa42f(0x13a)]});_0x2cfad6=parseInt(_0x518c8f[_0x5fa42f(0x11b)],0xa),_0x5e02b7[_0x5fa42f(0x13a)]&&console[_0x5fa42f(0x12e)](_0x5fa42f(0x122)+_0x2cfad6);}const _0x5c54c6=await loadJSONFromOptions(_0x5e02b7[_0x5fa42f(0x11a)],_0x5e02b7['ruleFile']),_0x1a1cd5={'name':_0x5e02b7[_0x5fa42f(0x139)],'description':_0x5e02b7[_0x5fa42f(0x115)],'rule':_0x5c54c6,'kind':_0x5e02b7[_0x5fa42f(0x114)]!==undefined?parseInt(_0x5e02b7['kind'],0xa):undefined,'segmentFolderId':_0x2cfad6},_0x2324ae=await withSpinner(_0x5fa42f(0x132)+_0x2936ad['segmentName']+_0x5fa42f(0x11d),()=>_0x196a1e[_0x5fa42f(0x11e)]['updateSegmentById'](_0x2ab5af,_0x52aa67,_0x1a1cd5),{'verbose':_0x5e02b7['verbose']}),_0x536ee7=_0x2324ae[_0x5fa42f(0x11b)];return console[_0x5fa42f(0x12e)](_0x5fa42f(0x12c)+_0x536ee7[_0x5fa42f(0x139)]+'\x27'),_0x412c52!==_0x3e2a61&&console[_0x5fa42f(0x12e)](_0x5fa42f(0x125)+_0x412c52),await handleSDKOutput([_0x536ee7],_0x5e02b7),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0x1b35a9=a34_0x2f87;(function(_0x4bdce1,_0x1e5d95){const _0x314761=a34_0x2f87,_0x503846=_0x4bdce1();while(!![]){try{const _0x1cc000=-parseInt(_0x314761(0x1bd))/0x1*(-parseInt(_0x314761(0x1c4))/0x2)+-parseInt(_0x314761(0x1a3))/0x3*(-parseInt(_0x314761(0x1b8))/0x4)+parseInt(_0x314761(0x1c9))/0x5*(-parseInt(_0x314761(0x1d0))/0x6)+parseInt(_0x314761(0x1a2))/0x7*(parseInt(_0x314761(0x1b5))/0x8)+-parseInt(_0x314761(0x1c0))/0x9*(parseInt(_0x314761(0x1a4))/0xa)+-parseInt(_0x314761(0x1aa))/0xb+-parseInt(_0x314761(0x19f))/0xc;if(_0x1cc000===_0x1e5d95)break;else _0x503846['push'](_0x503846['shift']());}catch(_0x12a030){_0x503846['push'](_0x503846['shift']());}}}(a34_0x375e,0x4e5aa));function a34_0x375e(){const _0x201df3=['verbose','length','4vEqROE','Folder\x20ID:\x20','Site:\x20','Target\x20path:\x20','split','3KmXEsS','segment','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','81FissVS','Context\x20set\x20to:\x20','parentName','name','380294CxaCmB','slice','error','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','site','5jKkHSr','data','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Resolved\x20path\x20type:\x20','isAbsolute','Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','1799778EmIEPE','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','description','5018868ootRvd','Resolved\x20relative\x20path\x20to:\x20','type','3723202LhQbdi','1595499XWSyZp','232460LnDWDk','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Parent\x20ID:\x20','join','fullPath','folderId','4243866vRsYKM','segment:use','Examples:','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderPath','Use:\x20tdx\x20segment\x20use\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20\x22tdx\x20context\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','log','8lQXvWl'];a34_0x375e=function(){return _0x201df3;};return a34_0x375e();}function a34_0x2f87(_0x2d1cbc,_0x5b7201){const _0x375ea8=a34_0x375e();return a34_0x2f87=function(_0x2f8772,_0x477aca){_0x2f8772=_0x2f8772-0x19e;let _0x66d11=_0x375ea8[_0x2f8772];return _0x66d11;},a34_0x2f87(_0x2d1cbc,_0x5b7201);}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a34_0x1b35a9(0x1c3)]=a34_0x1b35a9(0x1ab);[a34_0x1b35a9(0x19e)]=a34_0x1b35a9(0x1cb);async['execute'](_0x40ab1e){const _0x42f900=a34_0x1b35a9,{options:_0x423967,args:_0x5d23b4,tdx:_0x3a5e96}=_0x40ab1e;if(_0x5d23b4[_0x42f900(0x1b7)]===0x0)return console[_0x42f900(0x1c6)]('Error:\x20Path\x20is\x20required'),console[_0x42f900(0x1c6)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x42f900(0x1c6)](_0x42f900(0x1ac)),console[_0x42f900(0x1c6)](_0x42f900(0x1b1)),console[_0x42f900(0x1c6)](_0x42f900(0x1ae)),console[_0x42f900(0x1c6)](_0x42f900(0x1b3)),console[_0x42f900(0x1c6)](_0x42f900(0x1cf)),0x1;const _0x274379=_0x5d23b4[0x0],_0x490e88=_0x423967['session'];try{if(_0x274379==='/')return saveSessionContext({'segment_path':undefined},_0x490e88),console[_0x42f900(0x1b4)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x265404=_0x423967['segmentPath'];let _0x122b31=_0x274379;const _0x5db225=parsePath(_0x274379);if(!_0x5db225[_0x42f900(0x1cd)]){if(!_0x265404)return console[_0x42f900(0x1c6)](_0x42f900(0x1d1)),console[_0x42f900(0x1c6)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'),0x1;if(_0x274379==='..'){const _0x28af05=_0x265404[_0x42f900(0x1bc)]('/')[_0x42f900(0x1c5)](0x0,-0x1)['join']('/');_0x122b31=_0x28af05||'/';}else _0x274379==='.'?_0x122b31=_0x265404:_0x122b31=_0x265404+'/'+_0x274379;_0x423967[_0x42f900(0x1b6)]&&console[_0x42f900(0x1c6)](_0x42f900(0x1a0)+_0x122b31);}if(_0x122b31==='/'||_0x122b31==='')return saveSessionContext({'segment_path':undefined},_0x490e88),console[_0x42f900(0x1b4)](_0x42f900(0x1ce)),0x0;_0x122b31=normalizePath(_0x122b31);const _0x29a0b6=parsePath(_0x122b31)['segments'];if(_0x29a0b6[_0x42f900(0x1b7)]===0x0)return saveSessionContext({'segment_path':undefined},_0x490e88),console[_0x42f900(0x1b4)](_0x42f900(0x1ce)),0x0;_0x423967[_0x42f900(0x1b6)]&&(console[_0x42f900(0x1c6)](_0x42f900(0x1ba)+_0x423967[_0x42f900(0x1c8)]),console['error'](_0x42f900(0x1bb)+_0x122b31));const _0x17cd2b=await withSpinner('Resolving\x20path\x20\x27'+_0x122b31+'\x27...',()=>_0x3a5e96[_0x42f900(0x1be)]['resolvePathToResource'](_0x122b31),{'verbose':_0x423967[_0x42f900(0x1b6)]}),_0x41cf78=_0x17cd2b[_0x42f900(0x1ca)];_0x423967[_0x42f900(0x1b6)]&&(console[_0x42f900(0x1c6)](_0x42f900(0x1cc)+_0x41cf78['type']),console[_0x42f900(0x1c6)](_0x42f900(0x1a6)+_0x41cf78['parentId']),_0x41cf78[_0x42f900(0x1a9)]&&console['error'](_0x42f900(0x1b9)+_0x41cf78[_0x42f900(0x1a9)]));if(_0x41cf78[_0x42f900(0x1a1)]===_0x42f900(0x1be))return console[_0x42f900(0x1c6)](_0x42f900(0x1a5)),console[_0x42f900(0x1c6)](_0x42f900(0x1ad)),console[_0x42f900(0x1c6)](_0x42f900(0x1b0)+_0x41cf78[_0x42f900(0x1c2)]+(_0x41cf78[_0x42f900(0x1af)]?'/'+_0x41cf78[_0x42f900(0x1af)][_0x42f900(0x1a7)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x41cf78[_0x42f900(0x1a8)],'parent_segment':_0x41cf78[_0x42f900(0x1c2)]},_0x490e88),console[_0x42f900(0x1b4)](_0x42f900(0x1c1)+_0x41cf78[_0x42f900(0x1a8)]),_0x423967['verbose']&&(console[_0x42f900(0x1c6)](_0x42f900(0x1bf)),console[_0x42f900(0x1c6)](_0x42f900(0x1c7)),console[_0x42f900(0x1c6)](_0x42f900(0x1b2))),0x0;}catch(_0x4c10e0){throw _0x4c10e0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x32993d=a35_0x7e66;(function(_0x7d2a06,_0x3f3b01){const _0xea4055=a35_0x7e66,_0x40b6d6=_0x7d2a06();while(!![]){try{const _0x373f88=-parseInt(_0xea4055(0x174))/0x1*(-parseInt(_0xea4055(0x169))/0x2)+parseInt(_0xea4055(0x183))/0x3*(-parseInt(_0xea4055(0x164))/0x4)+parseInt(_0xea4055(0x16e))/0x5*(-parseInt(_0xea4055(0x151))/0x6)+-parseInt(_0xea4055(0x176))/0x7+-parseInt(_0xea4055(0x15e))/0x8*(-parseInt(_0xea4055(0x168))/0x9)+parseInt(_0xea4055(0x171))/0xa+-parseInt(_0xea4055(0x15f))/0xb*(-parseInt(_0xea4055(0x185))/0xc);if(_0x373f88===_0x3f3b01)break;else _0x40b6d6['push'](_0x40b6d6['shift']());}catch(_0x3ad0b4){_0x40b6d6['push'](_0x40b6d6['shift']());}}}(a35_0x27c2,0x7d2b6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';function a35_0x27c2(){const _0x437eaf=['listUnified','jsonl','site','map','segmentPath','listRecursive','Resolving\x20context\x20path\x20\x27','39mHmymr','(empty)','131844pPohuG','\x27...','cause','\x20and\x20','\x20top-level\x20items','Parent\x20ID:\x20','resolvePathToResource','segment','data','parentId','listParents','Current\x20context:\x20','recursive','execute','✔\x20Built\x20tree\x20with\x20','18GKVPcD','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','attributes','log','filter','population','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','\x20matching\x20\x27','format','Building\x20hierarchy\x20tree...','Site:\x20','Error:\x20','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','1845912JHZAgq','143geOmOM','Path/pattern\x20arg:\x20','segments','includes','\x20parent\x20segment','100400mAnWKF','listParentsWithPattern','replace','No\x20parent\x20segments\x20match\x20pattern:\x20','18SqRbYR','4StYwvE','👥\x20','✔\x20Found\x20','sort','verbose','728135CCXbIq','error','folderId','9634220hXAMyB','length','dim','341639hIcFlf','Folder\x20ID:\x20','6825938RmDlAY','name','json','maxDepth','[parent\x20segments]','Listing\x20parent\x20segments...'];a35_0x27c2=function(){return _0x437eaf;};return a35_0x27c2();}function a35_0x7e66(_0xc6c4aa,_0x20197b){const _0x27c28c=a35_0x27c2();return a35_0x7e66=function(_0x7e661e,_0x4b96ff){_0x7e661e=_0x7e661e-0x14d;let _0x43806e=_0x27c28c[_0x7e661e];return _0x43806e;},a35_0x7e66(_0xc6c4aa,_0x20197b);}import a35_0x177d7d from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0x32993d(0x177)]=a35_0x32993d(0x161);['description']=a35_0x32993d(0x157);async[a35_0x32993d(0x14f)](_0x5e50ac){const _0x4f899e=a35_0x32993d,{options:_0x1b89ba,args:_0xf62aea}=_0x5e50ac,_0x58f63b=_0x1b89ba[_0x4f899e(0x14e)],_0x5a3d0e=_0xf62aea[0x0];try{const _0x12b15e=_0x1b89ba[_0x4f899e(0x180)];_0x1b89ba[_0x4f899e(0x16d)]&&(console[_0x4f899e(0x16f)](_0x4f899e(0x15b)+_0x1b89ba[_0x4f899e(0x17e)]),console[_0x4f899e(0x16f)](_0x4f899e(0x14d)+(_0x12b15e||'/')),_0x5a3d0e&&console[_0x4f899e(0x16f)](_0x4f899e(0x160)+_0x5a3d0e),_0x58f63b&&console[_0x4f899e(0x16f)]('Recursive\x20mode:\x20enabled'));if(_0x5a3d0e){const _0x5669e6=_0x5a3d0e[_0x4f899e(0x162)]('*')||_0x5a3d0e['includes']('?');if(_0x5669e6&&!_0x12b15e)return await this[_0x4f899e(0x165)](_0x5e50ac,_0x5a3d0e);else return _0x5669e6?(console[_0x4f899e(0x16f)](_0x4f899e(0x152)),console['error'](_0x4f899e(0x15d)),0x1):_0x58f63b?await this[_0x4f899e(0x181)](_0x5e50ac,_0x5a3d0e):await this[_0x4f899e(0x17c)](_0x5e50ac,_0x5a3d0e);}if(!_0x12b15e)return await this[_0x4f899e(0x18f)](_0x5e50ac);return _0x58f63b?await this[_0x4f899e(0x181)](_0x5e50ac,_0x12b15e):await this['listUnified'](_0x5e50ac,_0x12b15e);}catch(_0x54c154){if(_0x54c154 instanceof SDKError)return console['error'](_0x4f899e(0x15c)+_0x54c154['message']),_0x54c154[_0x4f899e(0x187)]&&console['error']('\x20\x20Cause:\x20'+_0x54c154['cause']),0x1;throw _0x54c154;}}async['listParentsWithPattern'](_0x1ef31d,_0x162f71){const _0x1394af=a35_0x32993d,{options:_0x7896a4,tdx:_0x176873}=_0x1ef31d,_0x545a28=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x162f71+_0x1394af(0x186),()=>_0x176873[_0x1394af(0x18c)][_0x1394af(0x18f)](),{'verbose':_0x7896a4[_0x1394af(0x16d)]}),_0x60ef03=_0x545a28[_0x1394af(0x18d)],_0x1df808=_0x162f71[_0x1394af(0x166)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1394af(0x166)](/\*/g,'.*')[_0x1394af(0x166)](/\?/g,'.'),_0x47d18e=new RegExp('^'+_0x1df808+'$','i'),_0x5a5534=_0x60ef03[_0x1394af(0x155)](_0x15d79d=>_0x47d18e['test'](_0x15d79d['attributes']['name']));console[_0x1394af(0x16f)](_0x1394af(0x16b)+_0x5a5534[_0x1394af(0x172)]+_0x1394af(0x163)+(_0x5a5534[_0x1394af(0x172)]!==0x1?'s':'')+_0x1394af(0x158)+_0x162f71+'\x27');if(_0x7896a4[_0x1394af(0x159)]===_0x1394af(0x178)||_0x7896a4[_0x1394af(0x159)]===_0x1394af(0x17d))await handleSDKOutput(_0x5a5534,_0x7896a4);else{if(_0x5a5534[_0x1394af(0x172)]===0x0)console['log'](_0x1394af(0x167)+_0x162f71);else{console[_0x1394af(0x154)]('[parent\x20segments]');for(const _0x1d2a65 of _0x5a5534){const _0x217e00=_0x1d2a65['attributes']['population']?a35_0x177d7d['dim']('\x20('+formatRows(_0x1d2a65['attributes'][_0x1394af(0x156)])+')'):'';console[_0x1394af(0x154)](_0x1394af(0x16a)+_0x1d2a65[_0x1394af(0x153)][_0x1394af(0x177)]+_0x217e00);}}}return 0x0;}async[a35_0x32993d(0x18f)](_0x106c4c){const _0x4c20a8=a35_0x32993d,{options:_0x20e4f3,tdx:_0x533952}=_0x106c4c,_0x2152c4=await withSpinner(_0x4c20a8(0x17b),()=>_0x533952[_0x4c20a8(0x18c)][_0x4c20a8(0x18f)](),{'verbose':_0x20e4f3[_0x4c20a8(0x16d)]}),_0x12cf48=_0x2152c4[_0x4c20a8(0x18d)];console[_0x4c20a8(0x16f)](_0x4c20a8(0x16b)+_0x12cf48[_0x4c20a8(0x172)]+_0x4c20a8(0x163)+(_0x12cf48[_0x4c20a8(0x172)]!==0x1?'s':''));if(_0x20e4f3[_0x4c20a8(0x159)]===_0x4c20a8(0x178)||_0x20e4f3[_0x4c20a8(0x159)]==='jsonl')await handleSDKOutput(_0x12cf48,_0x20e4f3);else{console[_0x4c20a8(0x154)](_0x4c20a8(0x17a));for(const _0x2a718f of _0x12cf48){const _0xf53ce=_0x2a718f[_0x4c20a8(0x153)][_0x4c20a8(0x156)]?a35_0x177d7d[_0x4c20a8(0x173)]('\x20('+formatRows(_0x2a718f[_0x4c20a8(0x153)]['population'])+')'):'';console[_0x4c20a8(0x154)](_0x4c20a8(0x16a)+_0x2a718f[_0x4c20a8(0x153)][_0x4c20a8(0x177)]+_0xf53ce);}}return 0x0;}async[a35_0x32993d(0x17c)](_0x71e6aa,_0x5187ec){const _0xe24ed1=a35_0x32993d,{options:_0x5e3dd8,tdx:_0x461be5}=_0x71e6aa,_0x2f120c=await withSpinner(_0xe24ed1(0x182)+_0x5187ec+_0xe24ed1(0x186),()=>_0x461be5[_0xe24ed1(0x18c)][_0xe24ed1(0x18b)](_0x5187ec),{'verbose':_0x5e3dd8[_0xe24ed1(0x16d)]}),_0x30e807=_0x2f120c['data'];_0x5e3dd8[_0xe24ed1(0x16d)]&&(console['error'](_0xe24ed1(0x18a)+_0x30e807[_0xe24ed1(0x18e)]),_0x30e807[_0xe24ed1(0x170)]&&console['error'](_0xe24ed1(0x175)+_0x30e807[_0xe24ed1(0x170)]));const _0x5717b6=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x461be5[_0xe24ed1(0x18c)][_0xe24ed1(0x17c)](_0x30e807[_0xe24ed1(0x18e)],_0x30e807['folderId']),{'verbose':_0x5e3dd8['verbose']}),{folders:_0xf839ec,segments:_0x5688de}=_0x5717b6[_0xe24ed1(0x18d)],_0x3187fe=_0xf839ec[_0xe24ed1(0x172)]+_0x5688de[_0xe24ed1(0x172)];console['error'](_0xe24ed1(0x16b)+_0xf839ec['length']+'\x20folder'+(_0xf839ec[_0xe24ed1(0x172)]!==0x1?'s':'')+_0xe24ed1(0x188)+_0x5688de[_0xe24ed1(0x172)]+'\x20segment'+(_0x5688de['length']!==0x1?'s':''));if(_0x5e3dd8[_0xe24ed1(0x159)]===_0xe24ed1(0x178)||_0x5e3dd8[_0xe24ed1(0x159)]===_0xe24ed1(0x17d)){const _0x35f2ec=[..._0xf839ec[_0xe24ed1(0x17f)](_0x2e14cc=>({..._0x2e14cc,'type':'folder'})),..._0x5688de['map'](_0x3c66ef=>({..._0x3c66ef,'type':'segment'}))][_0xe24ed1(0x16c)]((_0x539666,_0x2b6bd8)=>_0x539666['name']['localeCompare'](_0x2b6bd8['name']));await handleSDKOutput(_0x35f2ec,_0x5e3dd8);}else{if(_0x3187fe===0x0)console['log'](a35_0x177d7d[_0xe24ed1(0x173)]('[/'+_0x5187ec+']')),console[_0xe24ed1(0x154)](_0xe24ed1(0x184));else{console[_0xe24ed1(0x154)](a35_0x177d7d[_0xe24ed1(0x173)]('[/'+_0x5187ec+']'));const _0x3295fe=formatFlatList(_0xf839ec,_0x5688de,{'showMetadata':!![]});console[_0xe24ed1(0x154)](_0x3295fe);}}return 0x0;}async[a35_0x32993d(0x181)](_0x5c1511,_0x200577){const _0x533414=a35_0x32993d,{options:_0x21a26c,tdx:_0x4a7681}=_0x5c1511,_0x5e46e7=await withSpinner(_0x533414(0x182)+_0x200577+_0x533414(0x186),()=>_0x4a7681[_0x533414(0x18c)][_0x533414(0x18b)](_0x200577),{'verbose':_0x21a26c[_0x533414(0x16d)]}),_0x536ae7=_0x5e46e7[_0x533414(0x18d)];_0x21a26c[_0x533414(0x16d)]&&(console[_0x533414(0x16f)](_0x533414(0x18a)+_0x536ae7[_0x533414(0x18e)]),_0x536ae7[_0x533414(0x170)]&&console[_0x533414(0x16f)](_0x533414(0x175)+_0x536ae7[_0x533414(0x170)]));const _0x3dd628=_0x21a26c[_0x533414(0x179)]||0xa,_0x174fce=await withSpinner(_0x533414(0x15a),()=>_0x4a7681['segment']['listRecursive'](_0x536ae7['parentId'],_0x536ae7[_0x533414(0x170)],0x0,_0x3dd628),{'verbose':_0x21a26c[_0x533414(0x16d)]}),_0x5152bd=_0x174fce[_0x533414(0x18d)];console[_0x533414(0x16f)](_0x533414(0x150)+_0x5152bd[_0x533414(0x172)]+_0x533414(0x189));if(_0x21a26c[_0x533414(0x159)]===_0x533414(0x178)||_0x21a26c[_0x533414(0x159)]===_0x533414(0x17d))await handleSDKOutput(_0x5152bd,_0x21a26c);else{console[_0x533414(0x154)](a35_0x177d7d[_0x533414(0x173)]('[/'+_0x200577+']'));const _0x2fdf78=formatTree(_0x5152bd,{'showMetadata':!![]});console[_0x533414(0x154)](_0x2fdf78);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x22348f=a36_0x5eec;(function(_0x807d88,_0x55d08a){const _0x37bee6=a36_0x5eec,_0x573c9b=_0x807d88();while(!![]){try{const _0x54551e=parseInt(_0x37bee6(0xb7))/0x1*(-parseInt(_0x37bee6(0xb2))/0x2)+-parseInt(_0x37bee6(0xbd))/0x3*(-parseInt(_0x37bee6(0xaa))/0x4)+-parseInt(_0x37bee6(0xc0))/0x5+parseInt(_0x37bee6(0xa5))/0x6*(-parseInt(_0x37bee6(0x9c))/0x7)+-parseInt(_0x37bee6(0xb8))/0x8*(-parseInt(_0x37bee6(0xad))/0x9)+parseInt(_0x37bee6(0xb9))/0xa*(-parseInt(_0x37bee6(0xae))/0xb)+parseInt(_0x37bee6(0xa8))/0xc;if(_0x54551e===_0x55d08a)break;else _0x573c9b['push'](_0x573c9b['shift']());}catch(_0x742f44){_0x573c9b['push'](_0x573c9b['shift']());}}}(a36_0x1755,0xaade3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a36_0x5eec(_0x2f799c,_0xba3236){const _0x17551c=a36_0x1755();return a36_0x5eec=function(_0x5eec80,_0x4f79a1){_0x5eec80=_0x5eec80-0x9c;let _0x25ea3b=_0x17551c[_0x5eec80];return _0x25ea3b;},a36_0x5eec(_0x2f799c,_0xba3236);}export class ShowCommand extends BaseCommand{[a36_0x22348f(0x9d)]='show';[a36_0x22348f(0xb0)]='Show\x20table\x20contents';async[a36_0x22348f(0xab)](_0x4712ac){return this['showTable'](_0x4712ac);}async[a36_0x22348f(0xbb)](_0x2cf150){const _0x3618f6=a36_0x22348f,{options:_0x5f26b4,args:_0x49b477,tdx:_0x39e1b4}=_0x2cf150;let _0x1b1ddd;try{_0x1b1ddd=parseTableReference(_0x49b477[0x0]);const _0x3e2b2e=_0x5f26b4[_0x3618f6(0xaf)];!_0x1b1ddd[_0x3618f6(0xaf)]&&_0x3e2b2e&&(_0x1b1ddd[_0x3618f6(0xaf)]=_0x3e2b2e);const _0x106b66=validateTableDescribeReference(_0x1b1ddd);if(_0x106b66)return console[_0x3618f6(0xb1)]('Error:\x20'+_0x106b66),console[_0x3618f6(0xb1)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x3618f6(0xb1)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x3618f6(0xb1)](_0x3618f6(0xc2)),0x1;}catch(_0x1c10a9){return console['error']('Error:\x20'+_0x1c10a9[_0x3618f6(0xa0)]),console[_0x3618f6(0xb1)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x3618f6(0xb1)](_0x3618f6(0xba)),console[_0x3618f6(0xb1)](_0x3618f6(0xc2)),0x1;}const _0x2d029d=_0x1b1ddd[_0x3618f6(0xb6)],_0x5ed551=_0x1b1ddd[_0x3618f6(0xaf)],_0x498db2=_0x1b1ddd[_0x3618f6(0xc5)],_0x58a128=resolveLimit(_0x5f26b4[_0x3618f6(0xbc)],DEFAULT_DISPLAY_LIMIT);try{_0x5f26b4[_0x3618f6(0xbe)]&&(console['error'](_0x3618f6(0xa6)+_0x5f26b4['site']),_0x2d029d&&console['error'](_0x3618f6(0xc4)+_0x2d029d),console[_0x3618f6(0xb1)](_0x3618f6(0xc3)+_0x5ed551),console[_0x3618f6(0xb1)](_0x3618f6(0xa7)+_0x498db2),console[_0x3618f6(0xb1)](_0x3618f6(0xa4)+_0x58a128));const _0x2c77ee=_0x2d029d?_0x2d029d+'.'+_0x5ed551+'.'+_0x498db2:_0x5ed551+'.'+_0x498db2,_0x363769=await withSpinner(_0x3618f6(0xb3)+_0x2c77ee+_0x3618f6(0xa9),()=>_0x39e1b4[_0x3618f6(0xbf)]['showTable'](_0x5ed551,_0x498db2,_0x58a128,_0x2d029d),{'verbose':_0x5f26b4[_0x3618f6(0xbe)]}),_0x494754=_0x363769[_0x3618f6(0xa3)],_0x1d6428=_0x494754[_0x3618f6(0xa3)];return _0x1d6428['length']===0x0?console[_0x3618f6(0xb1)](_0x3618f6(0xa2)):console[_0x3618f6(0xb1)]('✔\x20Retrieved\x20'+_0x1d6428[_0x3618f6(0xa1)]+_0x3618f6(0x9f)+(_0x1d6428[_0x3618f6(0xa1)]!==0x1?'s':'')+_0x3618f6(0xc1)+_0x2c77ee),await handleSDKOutput(_0x1d6428,_0x5f26b4),0x0;}catch(_0xc64910){if(_0xc64910 instanceof SDKError)return console['error'](_0x3618f6(0xac)+_0xc64910[_0x3618f6(0xa0)]),_0xc64910['cause']&&console['error'](_0x3618f6(0xb4)+_0xc64910[_0x3618f6(0x9e)]),0x1;throw _0xc64910;}}[a36_0x22348f(0xb5)](_0x37fb39){const _0x55a602=a36_0x22348f;if(_0x37fb39['args'][_0x55a602(0xa1)]===0x0)return'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';if(_0x37fb39['args'][_0x55a602(0xa1)]>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;}}function a36_0x1755(){const _0x461744=['data','Limit:\x20','1692294sQFtYa','Site:\x20','Table:\x20','28027296cyjIMi','...','523652QOmoVM','execute','Error:\x20','9wXvUDz','308MiYEJj','database','description','error','656364vvEVMg','Querying\x20','\x20\x20Cause:\x20','validate','catalog','1kTVHzZ','2367416daOmYu','462250EnRgyy','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','showTable','limit','3OrIZtm','verbose','query','790210QJHilE','\x20from\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Database:\x20','Catalog:\x20','table','7GlgFUy','name','cause','\x20row','message','length','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'];a36_0x1755=function(){return _0x461744;};return a36_0x1755();}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x1b7a4e=a37_0x9d9c;(function(_0x195012,_0x298875){const _0x40dbbc=a37_0x9d9c,_0x20558b=_0x195012();while(!![]){try{const _0x1cf3b0=parseInt(_0x40dbbc(0x1b0))/0x1*(parseInt(_0x40dbbc(0x189))/0x2)+parseInt(_0x40dbbc(0x19d))/0x3+-parseInt(_0x40dbbc(0x1aa))/0x4*(-parseInt(_0x40dbbc(0x19c))/0x5)+parseInt(_0x40dbbc(0x1a3))/0x6*(parseInt(_0x40dbbc(0x19e))/0x7)+-parseInt(_0x40dbbc(0x193))/0x8+-parseInt(_0x40dbbc(0x190))/0x9*(parseInt(_0x40dbbc(0x194))/0xa)+parseInt(_0x40dbbc(0x1a0))/0xb*(parseInt(_0x40dbbc(0x18b))/0xc);if(_0x1cf3b0===_0x298875)break;else _0x20558b['push'](_0x20558b['shift']());}catch(_0x251510){_0x20558b['push'](_0x20558b['shift']());}}}(a37_0x3123,0x770d4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a37_0x9d9c(_0x165480,_0x1d4070){const _0x3123d5=a37_0x3123();return a37_0x9d9c=function(_0x9d9c91,_0x1ab92c){_0x9d9c91=_0x9d9c91-0x186;let _0x335358=_0x3123d5[_0x9d9c91];return _0x335358;},a37_0x9d9c(_0x165480,_0x1d4070);}function a37_0x3123(){const _0x1a9241=['Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','3575795AybEcC','1778550FGshyh','182hZjnkp','error','11BOfIKm','✖\x20No\x20tables\x20found','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','47682fetOtY','Database:\x20all','Table\x20pattern:\x20','table','validate','\x27\x20is\x20ambiguous.','database','4TXrfsI','.*\x22','Site:\x20','Note:\x20\x27','cause','\x20table','2184BoxLSF','\x27\x20across\x20all\x20databases.','Error:\x20','verbose','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Or\x20use\x20--in\x20flag:','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','132ZAQdwh','data','926604poNYxj','includes','message','Error:\x20Pattern\x20\x27','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','9iyfEmn','execute','query','4418552uDDWSD','6960370elFtBp','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','limit','length','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database\x20pattern:\x20'];a37_0x3123=function(){return _0x1a9241;};return a37_0x3123();}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']='tables';['description']='List\x20tables\x20in\x20a\x20database';async[a37_0x1b7a4e(0x191)](_0x38e6d4){const _0x3d24bd=a37_0x1b7a4e,{options:_0xf1f1b9,args:_0x4461f5,tdx:_0x1e42de}=_0x38e6d4;let _0x4c03a3;if(_0x4461f5['length']===0x0)_0x4c03a3={'database':undefined,'table':undefined,'original':''};else{if(_0x4461f5['length']===0x1)try{_0x4c03a3=parseTableReference(_0x4461f5[0x0]);if(_0x4c03a3[_0x3d24bd(0x1a6)]&&!_0x4c03a3[_0x3d24bd(0x1a9)]&&!_0x4c03a3['table']['includes']('*')&&!_0x4c03a3['table'][_0x3d24bd(0x18c)]('?'))return console[_0x3d24bd(0x19f)](_0x3d24bd(0x18e)+_0x4461f5[0x0]+_0x3d24bd(0x1a8)),console[_0x3d24bd(0x19f)](_0x3d24bd(0x19b)+_0x4c03a3[_0x3d24bd(0x1a6)]+'\x27?'),console['error'](_0x3d24bd(0x196)+_0x4c03a3[_0x3d24bd(0x1a6)]+_0x3d24bd(0x1ab)),console[_0x3d24bd(0x19f)](_0x3d24bd(0x195)+_0x4c03a3['table']),console['error'](_0x3d24bd(0x188)+_0x4c03a3[_0x3d24bd(0x1a6)]),console[_0x3d24bd(0x19f)](''),console[_0x3d24bd(0x19f)](_0x3d24bd(0x1ad)+_0x4461f5[0x0]+_0x3d24bd(0x186)+_0x4c03a3[_0x3d24bd(0x1a6)]+_0x3d24bd(0x1b1)),0x1;}catch(_0x5133ff){return console[_0x3d24bd(0x19f)](_0x3d24bd(0x1b2)+_0x5133ff[_0x3d24bd(0x18d)]),0x1;}else return console[_0x3d24bd(0x19f)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x3d24bd(0x19f)](_0x3d24bd(0x199)),console[_0x3d24bd(0x19f)](_0x3d24bd(0x1a2)),console[_0x3d24bd(0x19f)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x3d24bd(0x18f)),console[_0x3d24bd(0x19f)](_0x3d24bd(0x187)),console['error']('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x486756=_0xf1f1b9[_0x3d24bd(0x1a9)];!_0x4c03a3['database']&&_0x486756&&(_0x4c03a3[_0x3d24bd(0x1a9)]=_0x486756);try{const _0x565380=_0x2cd03c=>_0x2cd03c&&(_0x2cd03c['includes']('*')||_0x2cd03c[_0x3d24bd(0x18c)]('?')),_0x1e7c74=_0x565380(_0x4c03a3['database']);_0xf1f1b9[_0x3d24bd(0x1b3)]&&(console['error'](_0x3d24bd(0x1ac)+_0xf1f1b9['site']),_0x4c03a3['database']?_0x1e7c74?console[_0x3d24bd(0x19f)](_0x3d24bd(0x19a)+_0x4c03a3[_0x3d24bd(0x1a9)]):console[_0x3d24bd(0x19f)]('Database:\x20'+_0x4c03a3[_0x3d24bd(0x1a9)]):console[_0x3d24bd(0x19f)](_0x3d24bd(0x1a4)),_0x4c03a3[_0x3d24bd(0x1a6)]&&console[_0x3d24bd(0x19f)](_0x3d24bd(0x1a5)+_0x4c03a3[_0x3d24bd(0x1a6)]));const _0x283e1f=_0x4c03a3[_0x3d24bd(0x1a9)]&&!_0x1e7c74?_0x4c03a3[_0x3d24bd(0x1a9)]:undefined,_0x34ec04=_0x1e7c74?_0x4c03a3[_0x3d24bd(0x1a9)]:undefined,_0x14147d=_0x4c03a3['table'],_0x1302ab=resolveLimit(_0xf1f1b9[_0x3d24bd(0x197)],DEFAULT_LISTING_LIMIT),_0x2a7392=await withSpinner('Listing\x20tables...',()=>_0x1e42de[_0x3d24bd(0x192)]['listTables'](_0x283e1f,_0x14147d,_0x34ec04,_0x1302ab),{'verbose':_0xf1f1b9[_0x3d24bd(0x1b3)]}),_0x1d842d=_0x2a7392[_0x3d24bd(0x18a)];if(_0x1d842d[_0x3d24bd(0x198)]===0x0&&_0x4c03a3[_0x3d24bd(0x1a9)]&&!_0x1e7c74)return console[_0x3d24bd(0x19f)](_0x3d24bd(0x1a1)),console['error']('Database\x20\x27'+_0x4c03a3[_0x3d24bd(0x1a9)]+_0x3d24bd(0x1b4)),0x1;return console[_0x3d24bd(0x19f)]('✔\x20Found\x20'+_0x1d842d[_0x3d24bd(0x198)]+_0x3d24bd(0x1af)+(_0x1d842d[_0x3d24bd(0x198)]!==0x1?'s':'')),await handleSDKOutput(_0x1d842d,{..._0xf1f1b9,'limit':_0x1302ab}),0x0;}catch(_0x3511b3){if(_0x3511b3 instanceof SDKError)return console['error'](_0x3d24bd(0x1b2)+_0x3511b3[_0x3d24bd(0x18d)]),_0x3511b3['cause']&&console[_0x3d24bd(0x19f)]('\x20\x20Cause:\x20'+_0x3511b3[_0x3d24bd(0x1ae)]),0x1;throw _0x3511b3;}}[a37_0x1b7a4e(0x1a7)](_0x48c920){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x35a266=a38_0x2bd8;(function(_0x3d5952,_0x4c9bdc){const _0x21e91f=a38_0x2bd8,_0x228c62=_0x3d5952();while(!![]){try{const _0x5bf965=-parseInt(_0x21e91f(0x1be))/0x1*(-parseInt(_0x21e91f(0x1e5))/0x2)+parseInt(_0x21e91f(0x1d5))/0x3*(-parseInt(_0x21e91f(0x1bb))/0x4)+parseInt(_0x21e91f(0x1ca))/0x5+-parseInt(_0x21e91f(0x1e0))/0x6*(-parseInt(_0x21e91f(0x1d4))/0x7)+parseInt(_0x21e91f(0x1c2))/0x8+-parseInt(_0x21e91f(0x1e3))/0x9+parseInt(_0x21e91f(0x1cf))/0xa;if(_0x5bf965===_0x4c9bdc)break;else _0x228c62['push'](_0x228c62['shift']());}catch(_0x2059db){_0x228c62['push'](_0x228c62['shift']());}}}(a38_0x2b82,0xca5b2));import{BaseCommand}from'./command.js';function a38_0x2b82(){const _0x304c2b=['Session\x20database\x20set\x20to:\x20','cleared','validate','1760128GufZPA','.\x20Must\x20be\x20one\x20of:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','length','debug','database','dim','display','3882925Bividy','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','use','log','toString','3968500vTOGMp','error','green','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','name','7qSEYzR','29916AUrStQ','includes','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Set\x20session-level\x20context','session','Invalid\x20resource:\x20','(session:\x20','message','displayWithSources','profile','Session\x20context\x20','2429898oTnkvT','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','description','14304168UWyFSU','execute','206ICvthZ','Error:\x20','\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','llm_project','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','parent_segment','112DSMLkG','engage_workspace','Session\x20engage_workspace\x20set\x20to:\x20','8728TIXCZq'];a38_0x2b82=function(){return _0x304c2b;};return a38_0x2b82();}import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';function a38_0x2bd8(_0x20b7a4,_0x10e914){const _0x2b8224=a38_0x2b82();return a38_0x2bd8=function(_0x2bd8e1,_0x44982a){_0x2bd8e1=_0x2bd8e1-0x1ba;let _0xa21bc5=_0x2b8224[_0x2bd8e1];return _0xa21bc5;},a38_0x2bd8(_0x20b7a4,_0x10e914);}import a38_0x3dbf0a from'chalk';export class UseCommand extends BaseCommand{[a38_0x35a266(0x1d3)]=a38_0x35a266(0x1cc);[a38_0x35a266(0x1e2)]=a38_0x35a266(0x1d8);[a38_0x35a266(0x1c1)](_0x1f454f){const _0x1533d6=a38_0x35a266,{args:_0x1ba1e8}=_0x1f454f;if(_0x1ba1e8[_0x1533d6(0x1c5)]===0x0)return undefined;if(_0x1ba1e8['length']===0x1)return _0x1533d6(0x1e1)+_0x1533d6(0x1e7)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x1533d6(0x1cb)+_0x1533d6(0x1e9);const _0x5e36a4=_0x1ba1e8[0x0],_0x412982=[_0x1533d6(0x1c7),_0x1533d6(0x1ba),'llm_project',_0x1533d6(0x1de),_0x1533d6(0x1bc)];if(!_0x412982[_0x1533d6(0x1d6)](_0x5e36a4))return _0x1533d6(0x1da)+_0x5e36a4+_0x1533d6(0x1c3)+_0x412982['join'](',\x20');return undefined;}async[a38_0x35a266(0x1e4)](_0x1f7dd5){const _0x3ad01e=a38_0x35a266,{args:_0x12269d,options:_0x8cf204}=_0x1f7dd5,_0x365f4e=_0x8cf204[_0x3ad01e(0x1c6)],_0x3af6ad=_0x8cf204['clear'];cleanExpiredSessions();try{if(_0x3af6ad){clearSessionContext(_0x8cf204[_0x3ad01e(0x1d9)]);const _0x1e24a3=_0x8cf204[_0x3ad01e(0x1d9)]||getCurrentSessionPID()['toString']();return console[_0x3ad01e(0x1cd)](_0x3ad01e(0x1df)+a38_0x3dbf0a[_0x3ad01e(0x1d1)](_0x3ad01e(0x1c0))+'\x20'+a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1db)+_0x1e24a3+')')),0x0;}if(_0x12269d[_0x3ad01e(0x1c5)]===0x0){const _0x7431ba=new GlobalContext(_0x8cf204);return _0x365f4e?_0x7431ba[_0x3ad01e(0x1dd)]():_0x7431ba[_0x3ad01e(0x1c9)](),console[_0x3ad01e(0x1cd)](a38_0x3dbf0a[_0x3ad01e(0x1c8)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console['log'](a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1d2))),0x0;}const _0x5cfe9f=_0x12269d[0x0],_0x31b550=_0x12269d[0x1];if(_0x5cfe9f==='profile'){if(!profileExists(_0x31b550))return console['error']('Error:\x20Profile\x20\x27'+_0x31b550+'\x27\x20does\x20not\x20exist'),console[_0x3ad01e(0x1d0)](_0x3ad01e(0x1d7)),0x1;const _0x5957d9=_0x8cf204[_0x3ad01e(0x1d9)]||getCurrentSessionPID()[_0x3ad01e(0x1ce)]();return saveSessionContext({'profile':_0x31b550},_0x8cf204[_0x3ad01e(0x1d9)]),console[_0x3ad01e(0x1cd)]('Session\x20profile\x20set\x20to:\x20'+a38_0x3dbf0a['green'](_0x31b550)+'\x20'+a38_0x3dbf0a['dim'](_0x3ad01e(0x1db)+_0x5957d9+')')),console[_0x3ad01e(0x1cd)](a38_0x3dbf0a[_0x3ad01e(0x1c8)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x4f2c71={},_0x26617d=_0x8cf204['session']||getCurrentSessionPID()[_0x3ad01e(0x1ce)]();switch(_0x5cfe9f){case _0x3ad01e(0x1c7):_0x4f2c71[_0x3ad01e(0x1c7)]=_0x31b550,console[_0x3ad01e(0x1cd)](_0x3ad01e(0x1bf)+a38_0x3dbf0a['green'](_0x31b550)+'\x20'+a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1db)+_0x26617d+')'));break;case'parent_segment':_0x4f2c71[_0x3ad01e(0x1ba)]=_0x31b550,console[_0x3ad01e(0x1cd)]('Session\x20parent_segment\x20set\x20to:\x20'+a38_0x3dbf0a[_0x3ad01e(0x1d1)](_0x31b550)+'\x20'+a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1db)+_0x26617d+')'));break;case _0x3ad01e(0x1e8):_0x4f2c71['llm_project']=_0x31b550,console[_0x3ad01e(0x1cd)]('Session\x20llm_project\x20set\x20to:\x20'+a38_0x3dbf0a[_0x3ad01e(0x1d1)](_0x31b550)+'\x20'+a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1db)+_0x26617d+')'));break;case _0x3ad01e(0x1bc):_0x4f2c71[_0x3ad01e(0x1bc)]=_0x31b550,console['log'](_0x3ad01e(0x1bd)+a38_0x3dbf0a[_0x3ad01e(0x1d1)](_0x31b550)+'\x20'+a38_0x3dbf0a['dim'](_0x3ad01e(0x1db)+_0x26617d+')'));break;}return saveSessionContext(_0x4f2c71,_0x8cf204[_0x3ad01e(0x1d9)]),console[_0x3ad01e(0x1cd)](a38_0x3dbf0a[_0x3ad01e(0x1c8)](_0x3ad01e(0x1c4))),0x0;}catch(_0x43548b){return _0x43548b instanceof Error&&console[_0x3ad01e(0x1d0)](_0x3ad01e(0x1e6)+_0x43548b[_0x3ad01e(0x1dc)]),0x1;}}}
|