@treasuredata/tdx 0.1.18 → 0.1.20
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/README.md +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.d.ts +2 -2
- package/dist/client/llm-client.d.ts.map +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-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/chat-command.js +1 -1
- package/dist/commands/chat-command.js.map +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/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/job-command.js +1 -1
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/llm-proxy.d.ts.map +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/llm-proxy.js.map +1 -1
- package/dist/commands/parent-segment-command.js +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/global-context.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.d.ts +3 -3
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +1 -1
- package/dist/proxy/server.d.ts +5 -3
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.d.ts +3 -1
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.d.ts +14 -0
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +41 -21
- package/dist/types/index.d.ts.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.d.ts +4 -0
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/colors.js.map +1 -1
- package/dist/utils/command-output.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/model-aliases.d.ts +15 -0
- package/dist/utils/model-aliases.d.ts.map +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-aliases.js.map +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.d.ts +2 -2
- package/dist/utils/sse-parser.d.ts.map +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/sse-parser.js.map +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.d.ts +28 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +1 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a19_0x2ee633=a19_0xb70d;(function(_0x166297,_0xc967ac){const _0x3e84f0=a19_0xb70d,_0x1e9061=_0x166297();while(!![]){try{const _0x28122e=parseInt(_0x3e84f0(0x1c8))/0x1*(parseInt(_0x3e84f0(0x1dd))/0x2)+-parseInt(_0x3e84f0(0x1d7))/0x3+parseInt(_0x3e84f0(0x1d6))/0x4+parseInt(_0x3e84f0(0x1ca))/0x5+parseInt(_0x3e84f0(0x1d9))/0x6+parseInt(_0x3e84f0(0x1f0))/0x7*(-parseInt(_0x3e84f0(0x1d3))/0x8)+-parseInt(_0x3e84f0(0x1c5))/0x9*(parseInt(_0x3e84f0(0x1f5))/0xa);if(_0x28122e===_0xc967ac)break;else _0x1e9061['push'](_0x1e9061['shift']());}catch(_0x1b3dc2){_0x1e9061['push'](_0x1e9061['shift']());}}}(a19_0x1def,0xd83fc));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';export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x2ee633(0x1d1)]=a19_0x2ee633(0x1e8);[a19_0x2ee633(0x1dc)]=a19_0x2ee633(0x1d5);async[a19_0x2ee633(0x1f6)](_0x1eca9c){const _0x4fd46f=a19_0x2ee633,{options:_0x248b7b,args:_0x23bd73,tdx:_0x4810c6}=_0x1eca9c,_0x308d78=_0x248b7b;if(_0x23bd73[_0x4fd46f(0x1f7)]===0x0)return console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1db)),console[_0x4fd46f(0x1d8)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x15c0b6=_0x23bd73[0x0];if(!_0x308d78[_0x4fd46f(0x1cb)]||!_0x308d78[_0x4fd46f(0x1f2)])return console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1ef)),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1f4)),0x1;_0x308d78[_0x4fd46f(0x1ec)]&&(console['error'](_0x4fd46f(0x1de)+_0x308d78[_0x4fd46f(0x1e9)]),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1e0)+_0x15c0b6),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1c9)+_0x308d78['database']),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1cd)+_0x308d78[_0x4fd46f(0x1f2)]));const _0x3d5d92=await loadJSONFromOptions(_0x308d78[_0x4fd46f(0x1d0)],_0x308d78[_0x4fd46f(0x1d4)]),_0x32234e=await loadJSONFromOptions(_0x308d78[_0x4fd46f(0x1e4)],_0x308d78[_0x4fd46f(0x1f8)]),_0x46d1f6=await loadJSONFromOptions(_0x308d78['customerGroup'],_0x308d78[_0x4fd46f(0x1c4)]),_0x2c3845={'name':_0x15c0b6,'description':_0x308d78['description'],'scheduleType':_0x308d78['scheduleType'],'scheduleOption':_0x308d78[_0x4fd46f(0x1df)],'timezone':_0x308d78['timezone'],'master':{'parentDatabaseName':_0x308d78[_0x4fd46f(0x1cb)],'parentTableName':_0x308d78[_0x4fd46f(0x1f2)]},'attributes':_0x3d5d92,'behaviors':_0x32234e,'customerGroup':_0x46d1f6},_0x1238fe=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x15c0b6+'\x27...',()=>_0x4810c6[_0x4fd46f(0x1c7)][_0x4fd46f(0x1eb)](_0x2c3845),{'verbose':_0x248b7b[_0x4fd46f(0x1ec)]}),_0x2e547a=_0x1238fe[_0x4fd46f(0x1ea)];return console[_0x4fd46f(0x1d8)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x2e547a[_0x4fd46f(0x1d1)]+'\x27\x20with\x20ID:\x20'+_0x2e547a['id']),await handleSDKOutput([_0x2e547a],_0x248b7b),0x0;}}function a19_0xb70d(_0x4adcd1,_0x585ca6){const _0x1def07=a19_0x1def();return a19_0xb70d=function(_0xb70d83,_0x48a756){_0xb70d83=_0xb70d83-0x1c3;let _0x564b33=_0x1def07[_0xb70d83];return _0x564b33;},a19_0xb70d(_0x4adcd1,_0x585ca6);}function a19_0x1def(){const _0x50f40d=['Updating\x20parent\x20segment\x20\x27','table','getParentFull','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','20TWFToy','execute','length','behaviorsFile','addAttributes','customerGroupFile','6176664LCoPSz','Fetching\x20current\x20configuration\x20for\x20\x27','segment','63839iHBFRU','Database:\x20','5544020MEkkJl','database','addBehaviors','Table:\x20','addBehaviorsFile','Update\x20existing\x20parent\x20segment\x20(audience)','attributes','name','\x27...','40QjFygC','attributesFile','Create\x20new\x20parent\x20segment\x20(audience)','5946044rBgWQU','830262MqRjio','error','2057802zqQlvc','updateParent','Error:\x20Parent\x20segment\x20name\x20is\x20required','description','10WWihgl','Site:\x20','scheduleOption','Name:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment:parent:update','✔\x20Updated\x20parent\x20segment\x20\x27','behaviors','scheduleType','timezone','Parent\x20segment:\x20','segment:parent:create','site','data','createParent','verbose','customerGroup','master','Error:\x20--database\x20and\x20--table\x20are\x20required','1011325UTLHQM'];a19_0x1def=function(){return _0x50f40d;};return a19_0x1def();}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a19_0x2ee633(0x1e2);[a19_0x2ee633(0x1dc)]=a19_0x2ee633(0x1cf);async[a19_0x2ee633(0x1f6)](_0x1190a2){const _0x291a76=a19_0x2ee633,{options:_0x13ac30,args:_0x255cd2,tdx:_0x249815}=_0x1190a2,_0x327174=_0x13ac30;if(_0x255cd2[_0x291a76(0x1f7)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x291a76(0x1d8)](_0x291a76(0x1e1)),0x1;const _0x54e971=_0x255cd2[0x0];_0x327174['verbose']&&(console[_0x291a76(0x1d8)]('Site:\x20'+_0x327174[_0x291a76(0x1e9)]),console[_0x291a76(0x1d8)](_0x291a76(0x1e7)+_0x54e971));const _0x75a7b7=await withSpinner(_0x291a76(0x1c6)+_0x54e971+_0x291a76(0x1d2),()=>_0x249815[_0x291a76(0x1c7)][_0x291a76(0x1f3)](_0x54e971),{'verbose':_0x327174[_0x291a76(0x1ec)]}),_0x23a50b=_0x75a7b7[_0x291a76(0x1ea)],_0x31ac85=await loadJSONFromOptions(_0x327174[_0x291a76(0x1c3)],_0x327174['addAttributesFile']),_0x3addd7=await loadJSONFromOptions(_0x327174[_0x291a76(0x1cc)],_0x327174[_0x291a76(0x1ce)]),_0x4de4bf={'name':_0x23a50b[_0x291a76(0x1d1)],'description':_0x327174['description']!==undefined?_0x327174['description']:_0x23a50b['description'],'scheduleType':_0x327174[_0x291a76(0x1e5)]!==undefined?_0x327174[_0x291a76(0x1e5)]:_0x23a50b[_0x291a76(0x1e5)],'scheduleOption':_0x327174[_0x291a76(0x1df)]!==undefined?_0x327174[_0x291a76(0x1df)]:_0x23a50b[_0x291a76(0x1df)],'timezone':_0x327174['timezone']!==undefined?_0x327174[_0x291a76(0x1e6)]:_0x23a50b[_0x291a76(0x1e6)],'master':_0x23a50b[_0x291a76(0x1ee)],'attributes':_0x31ac85?[..._0x23a50b[_0x291a76(0x1d0)]||[],..._0x31ac85]:_0x23a50b[_0x291a76(0x1d0)],'behaviors':_0x3addd7?[..._0x23a50b['behaviors']||[],..._0x3addd7]:_0x23a50b['behaviors'],'customerGroup':_0x23a50b[_0x291a76(0x1ed)]},_0x2022b4=await withSpinner(_0x291a76(0x1f1)+_0x54e971+_0x291a76(0x1d2),()=>_0x249815[_0x291a76(0x1c7)][_0x291a76(0x1da)](_0x54e971,_0x4de4bf),{'verbose':_0x327174[_0x291a76(0x1ec)]}),_0x4bf4c8=_0x2022b4[_0x291a76(0x1ea)];return console[_0x291a76(0x1d8)](_0x291a76(0x1e3)+_0x4bf4c8[_0x291a76(0x1d1)]+'\x27'),await handleSDKOutput([_0x4bf4c8],_0x327174),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a20_0x5138(){const _0x49101=['name','map','profiles','370404ornisS','1623096xsQzsb','37130kBsgWl','execute','message','2ettzOE','\x20\x20Global:\x20~/.config/tdx/tdx.json','Error:\x20','361134UNWgqJ','16fTSpmh','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','21WxqtsY','List\x20all\x20available\x20profiles','log','141882KsHWwr','description','143oEYqTH','6497088wUanLQ','config','13064oBxDjV','390KxEvIl','scope'];a20_0x5138=function(){return _0x49101;};return a20_0x5138();}function a20_0x5ded(_0x5ebc5d,_0x10cbb6){const _0x5138b8=a20_0x5138();return a20_0x5ded=function(_0x5ded5b,_0x5a621d){_0x5ded5b=_0x5ded5b-0x15d;let _0x8b0895=_0x5138b8[_0x5ded5b];return _0x8b0895;},a20_0x5ded(_0x5ebc5d,_0x10cbb6);}const a20_0x35216a=a20_0x5ded;(function(_0x3738c7,_0x6adde2){const _0x299ec7=a20_0x5ded,_0x41f9b5=_0x3738c7();while(!![]){try{const _0x3498e2=parseInt(_0x299ec7(0x16b))/0x1+parseInt(_0x299ec7(0x170))/0x2*(-parseInt(_0x299ec7(0x173))/0x3)+-parseInt(_0x299ec7(0x165))/0x4*(parseInt(_0x299ec7(0x166))/0x5)+-parseInt(_0x299ec7(0x160))/0x6*(-parseInt(_0x299ec7(0x15d))/0x7)+parseInt(_0x299ec7(0x174))/0x8*(-parseInt(_0x299ec7(0x16c))/0x9)+parseInt(_0x299ec7(0x16d))/0xa*(-parseInt(_0x299ec7(0x162))/0xb)+parseInt(_0x299ec7(0x163))/0xc;if(_0x3498e2===_0x6adde2)break;else _0x41f9b5['push'](_0x41f9b5['shift']());}catch(_0xbca8ad){_0x41f9b5['push'](_0x41f9b5['shift']());}}}(a20_0x5138,0x3081e));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x35216a(0x168)]=a20_0x35216a(0x16a);[a20_0x35216a(0x161)]=a20_0x35216a(0x15e);async[a20_0x35216a(0x16e)](_0x2aea34){const _0x56faad=a20_0x35216a,{options:_0x57eb4b}=_0x2aea34;try{const _0x5c77c7=listProfiles(),_0x9fdba8=getActiveProfile();if(_0x5c77c7['length']===0x0)return console[_0x56faad(0x15f)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x56faad(0x15f)](_0x56faad(0x175)),console[_0x56faad(0x15f)](_0x56faad(0x171)),0x0;const _0x13c0b5=_0x5c77c7[_0x56faad(0x169)](_0x5b717e=>{const _0x4e3302=_0x56faad,_0x486766=_0x5b717e['name']===_0x9fdba8,_0x592e6a=getProfileParams(_0x5b717e[_0x4e3302(0x164)]);return{'name':_0x5b717e[_0x4e3302(0x168)],'active':_0x486766,'scope':_0x5b717e[_0x4e3302(0x167)],'description':_0x5b717e['config']['description']||'','params':_0x592e6a};});return await handleSDKOutput(_0x13c0b5,_0x57eb4b),0x0;}catch(_0x43d6e1){return _0x43d6e1 instanceof Error&&console['error'](_0x56faad(0x172)+_0x43d6e1[_0x56faad(0x16f)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a21_0x1f0b26=a21_0x55ca;(function(_0x138479,_0x3bf6df){const _0x48b2f4=a21_0x55ca,_0x140627=_0x138479();while(!![]){try{const _0x1b2efd=-parseInt(_0x48b2f4(0x16b))/0x1*(parseInt(_0x48b2f4(0x189))/0x2)+parseInt(_0x48b2f4(0x165))/0x3*(-parseInt(_0x48b2f4(0x187))/0x4)+-parseInt(_0x48b2f4(0x15c))/0x5+-parseInt(_0x48b2f4(0x166))/0x6+-parseInt(_0x48b2f4(0x17c))/0x7*(-parseInt(_0x48b2f4(0x161))/0x8)+parseInt(_0x48b2f4(0x18a))/0x9*(parseInt(_0x48b2f4(0x169))/0xa)+parseInt(_0x48b2f4(0x185))/0xb;if(_0x1b2efd===_0x3bf6df)break;else _0x140627['push'](_0x140627['shift']());}catch(_0x2c5202){_0x140627['push'](_0x140627['shift']());}}}(a21_0x30f1,0x88c5e));import{BaseCommand}from'./command.js';function a21_0x55ca(_0x3554fe,_0x54374f){const _0x30f106=a21_0x30f1();return a21_0x55ca=function(_0x55caa8,_0x418221){_0x55caa8=_0x55caa8-0x15a;let _0x387b19=_0x30f106[_0x55caa8];return _0x387b19;},a21_0x55ca(_0x3554fe,_0x54374f);}function a21_0x30f1(){const _0x29aa8d=['message','validate','Executing\x20query...','Schema:\x20','data','1092539hMXoIF','Site:\x20','stats','Executing\x20statement\x20','../utils/command-output.js','\x20rows\x20','file','Error:\x20','error','26745092cwaZuR','processedRows','6504AdbQpq','information_schema','2178872vLyhVI','18pjlCSK','Query\x20completed:\x20Processed\x20','join','name','args','2632990iKaWYp','description','verbose','in\x20','output','8kerqhw','Catalog:\x20','\x0aAll\x20results\x20saved\x20to\x20','elapsedTimeMillis','1707uCbDoR','2356806WeACyz','length','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','4534010kgrNXp','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','1KfGhOu','database','Statement\x20','push','originalMessage','jobId','setJobId','state','Executing\x20query\x20[','query','execute','setPhase'];a21_0x30f1=function(){return _0x29aa8d;};return a21_0x30f1();}import{SDKError}from'../sdk/index.js';import{handleQueryOutput}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a21_0x1f0b26(0x15a)]=a21_0x1f0b26(0x174);[a21_0x1f0b26(0x15d)]='Run\x20Trino\x20queries\x20(streaming)';async[a21_0x1f0b26(0x175)](_0x230f4e){const _0x554839=a21_0x1f0b26,{options:_0x3ed46d,args:_0x19e677,tdx:_0x266473}=_0x230f4e,_0x622efd=_0x19e677[0x0],_0x7625b7=_0x3ed46d[_0x554839(0x182)];let _0x10e01f;if(_0x7625b7)try{_0x10e01f=readSqlStatementsFromFile(_0x7625b7);}catch(_0x2c5bf2){return console['error'](_0x554839(0x183)+_0x2c5bf2[_0x554839(0x177)]),0x1;}else try{_0x10e01f=splitSqlStatements(_0x622efd);}catch(_0x4c5c14){return console[_0x554839(0x184)](_0x554839(0x183)+_0x4c5c14[_0x554839(0x177)]),0x1;}const _0x56c361=_0x3ed46d[_0x554839(0x16c)]||_0x554839(0x188),_0x14d5ae=_0x3ed46d['catalog'];try{const _0x4f6d23=[],_0x285397=!!_0x3ed46d[_0x554839(0x160)];for(let _0x4bf437=0x0;_0x4bf437<_0x10e01f[_0x554839(0x167)];_0x4bf437++){const _0x145a74=_0x10e01f[_0x4bf437],_0x353ea9=_0x4bf437+0x1,_0x23e53c=_0x10e01f[_0x554839(0x167)],_0x3f4be1=_0x23e53c>0x1;_0x3ed46d['verbose']&&(console[_0x554839(0x184)]('\x0a'+(_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+':':'')),console[_0x554839(0x184)](_0x554839(0x17d)+_0x3ed46d['site']),console[_0x554839(0x184)](_0x554839(0x162)+(_0x14d5ae||'td')),console[_0x554839(0x184)](_0x554839(0x17a)+_0x56c361),console[_0x554839(0x184)]('SQL:\x20'+_0x145a74));const _0x769f0d=_0x3f4be1?_0x554839(0x17f)+_0x353ea9+'/'+_0x23e53c+'...':_0x554839(0x179);try{const _0x318c55=await withQuerySpinner(_0x769f0d,async _0x362089=>{const _0x1d89b9=_0x554839,_0x563827=await _0x266473[_0x1d89b9(0x174)](_0x145a74,{'catalog':_0x14d5ae,'schema':_0x56c361,'onJobId':_0x1b4272=>{const _0x1efbeb=_0x1d89b9;_0x362089[_0x1efbeb(0x171)](_0x1b4272);},'onProgress':_0x55977a=>{const _0x6b52c7=_0x1d89b9;_0x362089[_0x6b52c7(0x176)](_0x6b52c7(0x173)+_0x55977a[_0x6b52c7(0x172)]+']'),_0x362089['setExtra'](formatRows(_0x55977a[_0x6b52c7(0x186)])+_0x6b52c7(0x181)+_0x55977a['completedSplits']+'/'+_0x55977a['totalSplits']+'\x20splits');}});return _0x563827;},{'verbose':_0x3ed46d[_0x554839(0x15e)]}),_0x1d7bb4=_0x318c55[_0x554839(0x17b)],_0x2c73c2=_0x1d7bb4[_0x554839(0x170)]?'\x20[Job\x20ID:\x20'+_0x1d7bb4[_0x554839(0x170)]+']':'',_0x4832fe=_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+'\x20-\x20':'';console['error']('✔\x20'+_0x4832fe+_0x554839(0x18b)+formatRows(_0x1d7bb4[_0x554839(0x17e)][_0x554839(0x186)])+_0x554839(0x181)+(_0x554839(0x15f)+formatElapsed(_0x1d7bb4[_0x554839(0x17e)][_0x554839(0x164)])+_0x2c73c2));if(_0x3f4be1&&_0x285397){const {formatQueryOutput:_0x280909,resolveOutputOptions:_0x555af5}=await import(_0x554839(0x180)),_0x4db11d=_0x555af5(_0x3ed46d),_0x4c1cca=await _0x280909(_0x1d7bb4,_0x4db11d);_0x4f6d23[_0x554839(0x16e)](_0x4c1cca);}else await handleQueryOutput(_0x1d7bb4,_0x3ed46d);}catch(_0x4f7e9d){const _0x42a12d=_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+':\x0a':'',_0x2c6bd6=_0x4f7e9d instanceof SDKError?_0x4f7e9d[_0x554839(0x16f)]:_0x4f7e9d[_0x554839(0x177)];return console['error'](''+_0x42a12d+_0x2c6bd6),0x1;}}if(_0x10e01f[_0x554839(0x167)]>0x1&&_0x285397&&_0x4f6d23[_0x554839(0x167)]>0x0){const _0xd0507b=_0x4f6d23[_0x554839(0x18c)]('\x0a');writeFileSync(_0x3ed46d[_0x554839(0x160)],_0xd0507b),console[_0x554839(0x184)](_0x554839(0x163)+_0x3ed46d['output']);}return 0x0;}catch(_0x4f590e){throw _0x4f590e;}}[a21_0x1f0b26(0x178)](_0x459c80){const _0x5e47b1=a21_0x1f0b26,_0x1072d7=_0x459c80[_0x5e47b1(0x15b)][0x0],_0x265786=_0x459c80['options'][_0x5e47b1(0x182)];if(!_0x1072d7&&!_0x265786)return _0x5e47b1(0x16a);if(_0x1072d7&&_0x265786)return _0x5e47b1(0x168);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x14b7e1=a22_0x25ac;(function(_0x3cfa12,_0x47cd52){const _0xd2da4f=a22_0x25ac,_0x1ac2a1=_0x3cfa12();while(!![]){try{const _0xb453e6=parseInt(_0xd2da4f(0x1f4))/0x1*(-parseInt(_0xd2da4f(0x1c9))/0x2)+parseInt(_0xd2da4f(0x1da))/0x3*(parseInt(_0xd2da4f(0x1a1))/0x4)+parseInt(_0xd2da4f(0x18d))/0x5+-parseInt(_0xd2da4f(0x19d))/0x6+-parseInt(_0xd2da4f(0x1ba))/0x7*(-parseInt(_0xd2da4f(0x1e0))/0x8)+parseInt(_0xd2da4f(0x183))/0x9+parseInt(_0xd2da4f(0x1ab))/0xa*(parseInt(_0xd2da4f(0x1b3))/0xb);if(_0xb453e6===_0x47cd52)break;else _0x1ac2a1['push'](_0x1ac2a1['shift']());}catch(_0x59d00e){_0x1ac2a1['push'](_0x1ac2a1['shift']());}}}(a22_0x4f69,0x4bd78));function a22_0x4f69(){const _0x85d79=['Examples:','Resolved\x20parent\x20folder\x20ID:\x20','verbose','Folder\x20name:\x20','Creating\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Parent\x20ID:\x20','1347756mQcmNd','in\x20','\x20rows\x20','elapsedTimeMillis','32TWeTMs','segment:sql','✔\x20Found\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Parent\x20segment:\x20','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','information_schema','Usage:\x20tdx\x20segment\x20show\x20<path>','22160omiylI','✖\x20Query\x20failed\x20[','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolvePathToResource','Site:\x20','folderId','3388RlcohA','site','segment:describe','data','Fetching\x20SQL\x20for\x20parent\x20segment...','parentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','7XrpJOp','setJobId','length','Resolving\x20path\x20\x27','trim','Error:\x20','segmentId','Resolving\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20folder\x20details...','INTERNAL','resolveFolderId','jsonl','query','getParent','2QIrYjU','segment','format','stats','Resolved\x20parent\x20ID:\x20','listFolders','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','resolveParentId','message','getParentSQL','Resolved\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Path\x20or\x20name\x20is\x20required','createFolder','70539hOJOKD','getSegment','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Query\x20completed:\x20Processed\x20','parentFolder','description','541088otePME','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','jobId','folder','Folder\x20ID:\x20','Show\x20segment\x20folder\x20details','SQL\x20query:\x0a','segment:folder:show','Executing\x20segment\x20query...','parent','segment:show','processedRows','test','\x27...','cause','Resolving\x20parent\x20folder\x20\x27','Fetching\x20segment\x20details...','Fetching\x20parent\x20segment\x20details...','segmentPath','getSegmentSQL','590422absqOd','Segment\x20ID:\x20','125334cZEZsD','execute','getFolder','Resolved\x20type:\x20','name','Usage:\x20tdx\x20segment\x20describe\x20<path>','Parent\x20name:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Resolved\x20relative\x20path\x20to:\x20','867510eImwBF','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','type','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20parent\x20segment\x20\x27','error','Show\x20segment\x20or\x20folder\x20details','includes','\x20\x20Cause:\x20'];a22_0x4f69=function(){return _0x85d79;};return a22_0x4f69();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x25ac(_0x37e3c3,_0x44864c){const _0x4f69f1=a22_0x4f69();return a22_0x25ac=function(_0x25acc8,_0x11b0c4){_0x25acc8=_0x25acc8-0x183;let _0x4cb02a=_0x4f69f1[_0x25acc8];return _0x4cb02a;},a22_0x25ac(_0x37e3c3,_0x44864c);}import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1b5);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x193);async[a22_0x14b7e1(0x184)](_0x4a6a5b){const _0x3bbebd=a22_0x14b7e1,{options:_0x58fd3a,args:_0xd9ca7c,tdx:_0x46e972}=_0x4a6a5b;if(_0xd9ca7c[_0x3bbebd(0x1bc)]===0x0)return console[_0x3bbebd(0x192)](_0x3bbebd(0x1d8)),console[_0x3bbebd(0x192)](_0x3bbebd(0x188)),console[_0x3bbebd(0x192)](_0x3bbebd(0x196)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x3bbebd(0x192)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3bbebd(0x192)](_0x3bbebd(0x1ae)),0x1;try{const _0x260c47=_0xd9ca7c[0x0],_0x1485b0=_0x58fd3a[_0x3bbebd(0x1f2)];let _0x256c14=_0x260c47;_0x1485b0&&!_0x260c47[_0x3bbebd(0x194)]('/')&&(_0x256c14=_0x1485b0+'/'+_0x260c47,_0x58fd3a['verbose']&&console[_0x3bbebd(0x192)](_0x3bbebd(0x18c)+_0x256c14));const _0x28581d=await withSpinner(_0x3bbebd(0x1bd)+_0x256c14+_0x3bbebd(0x1ed),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1b0)](_0x256c14),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]}),_0x328f7c=_0x28581d[_0x3bbebd(0x1b6)];_0x58fd3a[_0x3bbebd(0x198)]&&(console['error'](_0x3bbebd(0x186)+_0x328f7c[_0x3bbebd(0x18f)]),console[_0x3bbebd(0x192)](_0x3bbebd(0x19c)+_0x328f7c['parentId']),_0x328f7c[_0x3bbebd(0x1b2)]&&console['error'](_0x3bbebd(0x1e4)+_0x328f7c[_0x3bbebd(0x1b2)]),_0x328f7c['segmentId']&&console[_0x3bbebd(0x192)](_0x3bbebd(0x1f5)+_0x328f7c['segmentId']));if(_0x328f7c['type']===_0x3bbebd(0x1e9)){const _0x544792=await withSpinner(_0x3bbebd(0x1f1),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1c8)](_0x328f7c[_0x3bbebd(0x1b8)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x544792[_0x3bbebd(0x1b6)]],_0x58fd3a);}else{if(_0x328f7c['type']===_0x3bbebd(0x1e3)){if(!_0x328f7c[_0x3bbebd(0x1b2)])throw new SDKError(ErrorCode[_0x3bbebd(0x1c4)],_0x3bbebd(0x1c2));const _0x2b0e9e=await withSpinner(_0x3bbebd(0x1c3),()=>_0x46e972['segment'][_0x3bbebd(0x185)](_0x328f7c[_0x3bbebd(0x1b2)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x2b0e9e['data']],_0x58fd3a);}else{if(_0x328f7c['type']==='segment'){if(!_0x328f7c[_0x3bbebd(0x1c0)])throw new SDKError(ErrorCode[_0x3bbebd(0x1c4)],_0x3bbebd(0x18a));const _0x1886e5=await withSpinner(_0x3bbebd(0x1f0),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1db)](_0x328f7c['parentId'],_0x328f7c[_0x3bbebd(0x1c0)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x1886e5[_0x3bbebd(0x1b6)]],_0x58fd3a);}}}return 0x0;}catch(_0x51a417){if(_0x51a417 instanceof SDKError)return console[_0x3bbebd(0x192)](_0x3bbebd(0x1bf)+_0x51a417[_0x3bbebd(0x1d3)]),_0x51a417[_0x3bbebd(0x1ee)]&&console['error'](_0x3bbebd(0x195)+_0x51a417['cause']),0x1;throw _0x51a417;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1ea);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1a5);async['execute'](_0x504d46){const _0x3b15df=a22_0x14b7e1,{options:_0x518090,args:_0x1dfe93,tdx:_0x2ee8df}=_0x504d46;if(_0x1dfe93['length']===0x0)return console['error'](_0x3b15df(0x1cf)),console[_0x3b15df(0x192)](_0x3b15df(0x1aa)),console['error'](_0x3b15df(0x196)),console[_0x3b15df(0x192)](_0x3b15df(0x1d1)),console[_0x3b15df(0x192)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3b15df(0x192)](_0x3b15df(0x1a4)),0x1;try{const _0x4f0c46=_0x1dfe93[0x0],_0x46e3f0=_0x518090['segmentPath'];let _0x1d6361=_0x4f0c46;_0x46e3f0&&!_0x4f0c46[_0x3b15df(0x194)]('/')&&(_0x1d6361=_0x46e3f0+'/'+_0x4f0c46,_0x518090[_0x3b15df(0x198)]&&console[_0x3b15df(0x192)]('Resolved\x20relative\x20path\x20to:\x20'+_0x1d6361));const _0x512bef=await withSpinner(_0x3b15df(0x1bd)+_0x1d6361+_0x3b15df(0x1ed),()=>_0x2ee8df['segment'][_0x3b15df(0x1b0)](_0x1d6361),{'verbose':_0x518090[_0x3b15df(0x198)]}),_0x33835c=_0x512bef[_0x3b15df(0x1b6)];_0x518090[_0x3b15df(0x198)]&&(console[_0x3b15df(0x192)](_0x3b15df(0x186)+_0x33835c[_0x3b15df(0x18f)]),console[_0x3b15df(0x192)]('Parent\x20ID:\x20'+_0x33835c[_0x3b15df(0x1b8)]));if(_0x33835c['type']===_0x3b15df(0x1e3))return console[_0x3b15df(0x192)](_0x3b15df(0x1e1)),console[_0x3b15df(0x192)](_0x3b15df(0x1a8)),0x1;let _0x1a1381;if(_0x33835c[_0x3b15df(0x18f)]==='parent'){const _0x1b7edd=await withSpinner(_0x3b15df(0x1b7),()=>_0x2ee8df[_0x3b15df(0x1ca)][_0x3b15df(0x1d4)](_0x33835c[_0x3b15df(0x1b8)]),{'verbose':_0x518090[_0x3b15df(0x198)]});_0x1a1381=_0x1b7edd['data'];}else{if(!_0x33835c[_0x3b15df(0x1c0)])throw new SDKError(ErrorCode[_0x3b15df(0x1c4)],_0x3b15df(0x18a));const _0x58920a=await withSpinner(_0x3b15df(0x1d6),()=>_0x2ee8df[_0x3b15df(0x1ca)]['getSegmentSQL'](_0x33835c[_0x3b15df(0x1b8)],_0x33835c[_0x3b15df(0x1c0)]),{'verbose':_0x518090[_0x3b15df(0x198)]});_0x1a1381=_0x58920a[_0x3b15df(0x1b6)];}const _0x474261=_0x518090['limit'],_0x1cbbfc=/\bLIMIT\s+\d+/i[_0x3b15df(0x1ec)](_0x1a1381);!_0x1cbbfc&&(_0x1a1381=_0x1a1381[_0x3b15df(0x1be)]()['replace'](/;+$/,''),_0x1a1381=_0x3b15df(0x1dc)+_0x1a1381+_0x3b15df(0x190)+_0x474261);_0x518090[_0x3b15df(0x198)]&&console['error'](_0x3b15df(0x1e6)+_0x1a1381);const _0x202444=await withQuerySpinner(_0x3b15df(0x1e8),async _0x3a7a22=>{const _0x4ff6f2=_0x3b15df,_0x4e763e=await _0x2ee8df[_0x4ff6f2(0x1c7)](_0x1a1381,{'catalog':'td','schema':_0x4ff6f2(0x1a9),'onJobId':_0x34b6bf=>{const _0x498a74=_0x4ff6f2;_0x3a7a22[_0x498a74(0x1bb)](_0x34b6bf);}});return _0x4e763e;},{'verbose':_0x518090[_0x3b15df(0x198)]}),_0x1d07c9=_0x202444[_0x3b15df(0x1b6)],_0x3bfba6=_0x1d07c9[_0x3b15df(0x1e2)]?'\x20[Job\x20ID:\x20'+_0x1d07c9['jobId']+']':'';return console[_0x3b15df(0x192)](_0x3b15df(0x1dd)+_0x1d07c9['stats'][_0x3b15df(0x1eb)]['toLocaleString']()+_0x3b15df(0x19f)+(_0x3b15df(0x19e)+formatElapsed(_0x1d07c9[_0x3b15df(0x1cc)][_0x3b15df(0x1a0)])+_0x3bfba6)),await handleQueryOutput(_0x1d07c9,_0x518090),0x0;}catch(_0x4cb028){if(_0x4cb028 instanceof SDKError)return console['error'](_0x3b15df(0x1ac)+_0x4cb028['code']+']'),console[_0x3b15df(0x192)]('\x0a'+_0x4cb028[_0x3b15df(0x1d3)]),0x1;throw _0x4cb028;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1d0);async['execute'](_0x38cdaf){const _0x2efa88=a22_0x14b7e1,{options:_0x12da7e,args:_0x904d31,tdx:_0x15b9c6}=_0x38cdaf;if(_0x904d31[_0x2efa88(0x1bc)]===0x0)return console[_0x2efa88(0x192)](_0x2efa88(0x1b9)),console[_0x2efa88(0x192)](_0x2efa88(0x19b)),0x1;const _0x27e3a6=_0x904d31[0x0];try{_0x12da7e[_0x2efa88(0x198)]&&(console[_0x2efa88(0x192)](_0x2efa88(0x1b1)+_0x12da7e[_0x2efa88(0x1b4)]),console[_0x2efa88(0x192)](_0x2efa88(0x189)+_0x27e3a6));const _0x2d4c8c=await withSpinner(_0x2efa88(0x191)+_0x27e3a6+_0x2efa88(0x1ed),()=>_0x15b9c6[_0x2efa88(0x1ca)]['resolveParentId'](_0x27e3a6),{'verbose':_0x12da7e['verbose']}),_0x1edba7=_0x2d4c8c[_0x2efa88(0x1b6)];_0x12da7e[_0x2efa88(0x198)]&&console[_0x2efa88(0x192)](_0x2efa88(0x1cd)+_0x1edba7);const _0xea6e08=await withSpinner(_0x2efa88(0x1d7)+_0x27e3a6+_0x2efa88(0x1ed),()=>_0x15b9c6[_0x2efa88(0x1ca)][_0x2efa88(0x1ce)](_0x1edba7),{'verbose':_0x12da7e[_0x2efa88(0x198)]}),_0x3e162e=_0xea6e08[_0x2efa88(0x1b6)];return console[_0x2efa88(0x192)](_0x2efa88(0x1a3)+_0x3e162e['length']+'\x20folder'+(_0x3e162e['length']!==0x1?'s':'')),await handleSDKOutput(_0x3e162e,_0x12da7e),0x0;}catch(_0x34f15d){if(_0x34f15d instanceof SDKError)return console[_0x2efa88(0x192)](_0x2efa88(0x1bf)+_0x34f15d[_0x2efa88(0x1d3)]),_0x34f15d[_0x2efa88(0x1ee)]&&console[_0x2efa88(0x192)](_0x2efa88(0x195)+_0x34f15d[_0x2efa88(0x1ee)]),0x1;throw _0x34f15d;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a22_0x14b7e1(0x1e7);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1e5);async['execute'](_0x33e7a4){const _0x123cb9=a22_0x14b7e1,{options:_0x276c76,args:_0x33ecd2,tdx:_0x5199ae}=_0x33e7a4;if(_0x33ecd2[_0x123cb9(0x1bc)]===0x0)return console[_0x123cb9(0x192)](_0x123cb9(0x1a7)),console[_0x123cb9(0x192)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x4369e6,childId:_0x4feaa9}=parseSegmentRef(_0x33ecd2[0x0]);_0x276c76['verbose']&&(console[_0x123cb9(0x192)](_0x123cb9(0x1b1)+_0x276c76[_0x123cb9(0x1b4)]),console[_0x123cb9(0x192)](_0x123cb9(0x189)+_0x4369e6),_0x4feaa9&&console['error']('Folder\x20name:\x20'+_0x4feaa9));if(!_0x4feaa9)return console[_0x123cb9(0x192)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x1b25d4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4369e6+_0x123cb9(0x1ed),()=>_0x5199ae[_0x123cb9(0x1ca)][_0x123cb9(0x1d2)](_0x4369e6),{'verbose':_0x276c76['verbose']}),_0x55c5dc=_0x1b25d4['data'];_0x276c76[_0x123cb9(0x198)]&&console[_0x123cb9(0x192)](_0x123cb9(0x1cd)+_0x55c5dc);const _0x39cb58=await withSpinner(_0x123cb9(0x1c1)+_0x4feaa9+'\x27...',()=>_0x5199ae[_0x123cb9(0x1ca)][_0x123cb9(0x1c5)](_0x55c5dc,_0x4feaa9),{'verbose':_0x276c76[_0x123cb9(0x198)]}),_0x25ffaa=_0x39cb58[_0x123cb9(0x1b6)];_0x276c76[_0x123cb9(0x198)]&&console[_0x123cb9(0x192)](_0x123cb9(0x1d5)+_0x25ffaa);const _0x2c14a9=await withSpinner('Fetching\x20folder\x20\x27'+_0x4feaa9+'\x27...',()=>_0x5199ae[_0x123cb9(0x1ca)]['getFolder'](_0x25ffaa),{'verbose':_0x276c76[_0x123cb9(0x198)]});return await handleSDKOutput([_0x2c14a9[_0x123cb9(0x1b6)]],_0x276c76),0x0;}catch(_0x279d2f){if(_0x279d2f instanceof SDKError)return console['error']('Error:\x20'+_0x279d2f['message']),_0x279d2f['cause']&&console[_0x123cb9(0x192)]('\x20\x20Cause:\x20'+_0x279d2f[_0x123cb9(0x1ee)]),0x1;throw _0x279d2f;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1a2);[a22_0x14b7e1(0x1df)]='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async['execute'](_0x23a57a){const _0x4d68e8=a22_0x14b7e1,{options:_0x4334c1,args:_0x31e420,tdx:_0x3ed2c1}=_0x23a57a;if(_0x31e420[_0x4d68e8(0x1bc)]===0x0)return console[_0x4d68e8(0x192)](_0x4d68e8(0x1cf)),console[_0x4d68e8(0x192)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x4d68e8(0x192)]('Examples:'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x3cb893=_0x31e420[0x0],_0x45b301=_0x4334c1[_0x4d68e8(0x1f2)];let _0x35e528=_0x3cb893;_0x45b301&&!_0x3cb893[_0x4d68e8(0x194)]('/')&&(_0x35e528=_0x45b301+'/'+_0x3cb893,_0x4334c1[_0x4d68e8(0x198)]&&console[_0x4d68e8(0x192)](_0x4d68e8(0x18c)+_0x35e528));const _0x107bf9=await withSpinner('Resolving\x20path\x20\x27'+_0x35e528+'\x27...',()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1b0)](_0x35e528),{'verbose':_0x4334c1[_0x4d68e8(0x198)]}),_0x212abe=_0x107bf9[_0x4d68e8(0x1b6)];_0x4334c1['verbose']&&(console[_0x4d68e8(0x192)]('Resolved\x20type:\x20'+_0x212abe[_0x4d68e8(0x18f)]),console[_0x4d68e8(0x192)](_0x4d68e8(0x19c)+_0x212abe[_0x4d68e8(0x1b8)]));if(_0x212abe[_0x4d68e8(0x18f)]===_0x4d68e8(0x1e3))return console[_0x4d68e8(0x192)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x4d68e8(0x192)](_0x4d68e8(0x18e)),0x1;let _0x4a29c8;if(_0x212abe['type']===_0x4d68e8(0x1e9)){const _0x1b8bb6=await withSpinner(_0x4d68e8(0x1b7),()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1d4)](_0x212abe[_0x4d68e8(0x1b8)]),{'verbose':_0x4334c1[_0x4d68e8(0x198)]});_0x4a29c8=_0x1b8bb6[_0x4d68e8(0x1b6)];}else{if(!_0x212abe[_0x4d68e8(0x1c0)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x58aee9=await withSpinner(_0x4d68e8(0x1d6),()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1f3)](_0x212abe['parentId'],_0x212abe[_0x4d68e8(0x1c0)]),{'verbose':_0x4334c1[_0x4d68e8(0x198)]});_0x4a29c8=_0x58aee9[_0x4d68e8(0x1b6)];}return _0x4334c1[_0x4d68e8(0x1cb)]==='json'||_0x4334c1['format']===_0x4d68e8(0x1c6)?await handleSDKOutput([{'sql':_0x4a29c8}],_0x4334c1):console['log'](_0x4a29c8),0x0;}catch(_0x43a378){if(_0x43a378 instanceof SDKError)return console['error']('Error:\x20'+_0x43a378[_0x4d68e8(0x1d3)]),_0x43a378['cause']&&console[_0x4d68e8(0x192)](_0x4d68e8(0x195)+_0x43a378['cause']),0x1;throw _0x43a378;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x14b7e1(0x187)]='segment:folder:create';[a22_0x14b7e1(0x1df)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x4159c2){const _0x5e0b57=a22_0x14b7e1,{options:_0x3889fe,args:_0x400ef1,tdx:_0x3e378f}=_0x4159c2,_0x50ec8a=_0x3889fe;if(_0x400ef1['length']<0x2)return console[_0x5e0b57(0x192)](_0x5e0b57(0x18b)),console[_0x5e0b57(0x192)](_0x5e0b57(0x1af)),0x1;const _0x519321=_0x400ef1[0x0],_0x3530a4=_0x400ef1[0x1];_0x50ec8a[_0x5e0b57(0x198)]&&(console[_0x5e0b57(0x192)]('Site:\x20'+_0x50ec8a[_0x5e0b57(0x1b4)]),console[_0x5e0b57(0x192)](_0x5e0b57(0x1a6)+_0x519321),console[_0x5e0b57(0x192)](_0x5e0b57(0x199)+_0x3530a4));let _0x15355f;if(_0x50ec8a[_0x5e0b57(0x1de)]){const _0x325b3d=_0x50ec8a[_0x5e0b57(0x1de)],_0x1784b6=await withSpinner(_0x5e0b57(0x191)+_0x519321+_0x5e0b57(0x1ed),()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1d2)](_0x519321),{'verbose':_0x50ec8a[_0x5e0b57(0x198)]}),_0x20e870=_0x1784b6[_0x5e0b57(0x1b6)],_0x495e1a=await withSpinner(_0x5e0b57(0x1ef)+_0x325b3d+'\x27...',()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1c5)](_0x20e870,_0x325b3d),{'verbose':_0x50ec8a['verbose']});_0x15355f=_0x495e1a['data'],_0x50ec8a[_0x5e0b57(0x198)]&&console[_0x5e0b57(0x192)](_0x5e0b57(0x197)+_0x15355f);}const _0x3a194a={'name':_0x3530a4,'description':_0x50ec8a[_0x5e0b57(0x1df)],'parentFolderId':_0x15355f},_0x1ee4c2=await withSpinner(_0x5e0b57(0x19a)+_0x3530a4+_0x5e0b57(0x1ed),()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1d9)](_0x519321,_0x3a194a),{'verbose':_0x50ec8a[_0x5e0b57(0x198)]}),_0x438e24=_0x1ee4c2[_0x5e0b57(0x1b6)];return console[_0x5e0b57(0x192)](_0x5e0b57(0x1ad)+_0x438e24[_0x5e0b57(0x187)]+'\x27\x20with\x20ID:\x20'+_0x438e24['id']),await handleSDKOutput([_0x438e24],_0x50ec8a),0x0;}}
|
|
1
|
+
const a22_0x411ca8=a22_0x1ec7;(function(_0x19e4e8,_0x578ec7){const _0x38e101=a22_0x1ec7,_0x39e8da=_0x19e4e8();while(!![]){try{const _0xb63161=parseInt(_0x38e101(0x101))/0x1*(-parseInt(_0x38e101(0xf1))/0x2)+parseInt(_0x38e101(0x102))/0x3*(-parseInt(_0x38e101(0xe3))/0x4)+parseInt(_0x38e101(0x10c))/0x5+parseInt(_0x38e101(0x13d))/0x6*(-parseInt(_0x38e101(0xda))/0x7)+parseInt(_0x38e101(0x13a))/0x8*(-parseInt(_0x38e101(0x11c))/0x9)+parseInt(_0x38e101(0x11b))/0xa+-parseInt(_0x38e101(0x140))/0xb*(-parseInt(_0x38e101(0xd7))/0xc);if(_0xb63161===_0x578ec7)break;else _0x39e8da['push'](_0x39e8da['shift']());}catch(_0x400e8a){_0x39e8da['push'](_0x39e8da['shift']());}}}(a22_0x5afa,0x526e3));function a22_0x1ec7(_0x513435,_0x406c85){const _0x5afab9=a22_0x5afa();return a22_0x1ec7=function(_0x1ec707,_0x2d0bd3){_0x1ec707=_0x1ec707-0xcb;let _0x45b81f=_0x5afab9[_0x1ec707];return _0x45b81f;},a22_0x1ec7(_0x513435,_0x406c85);}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0x117);['description']=a22_0x411ca8(0x103);async['execute'](_0x34b88c){const _0x1300e0=a22_0x411ca8,{options:_0x5c96a2,args:_0x531d71,tdx:_0x4885ff}=_0x34b88c;if(_0x531d71[_0x1300e0(0x11d)]===0x0)return console[_0x1300e0(0x128)](_0x1300e0(0xd9)),console[_0x1300e0(0x128)](_0x1300e0(0x108)),console[_0x1300e0(0x128)](_0x1300e0(0x12d)),console[_0x1300e0(0x128)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x1300e0(0x128)](_0x1300e0(0x12a)),console[_0x1300e0(0x128)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x20ce92=_0x531d71[0x0],_0x105069=_0x5c96a2['segmentPath'];let _0x320ef5=_0x20ce92;_0x105069&&!_0x20ce92[_0x1300e0(0x123)]('/')&&(_0x320ef5=_0x105069+'/'+_0x20ce92,_0x5c96a2['verbose']&&console[_0x1300e0(0x128)](_0x1300e0(0xd1)+_0x320ef5));const _0x586431=await withSpinner(_0x1300e0(0x125)+_0x320ef5+'\x27...',()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x130)](_0x320ef5),{'verbose':_0x5c96a2[_0x1300e0(0x104)]}),_0x18fe18=_0x586431[_0x1300e0(0xdb)];_0x5c96a2[_0x1300e0(0x104)]&&(console[_0x1300e0(0x128)](_0x1300e0(0x112)+_0x18fe18['type']),console['error'](_0x1300e0(0x12c)+_0x18fe18[_0x1300e0(0x107)]),_0x18fe18[_0x1300e0(0x122)]&&console[_0x1300e0(0x128)](_0x1300e0(0x106)+_0x18fe18[_0x1300e0(0x122)]),_0x18fe18[_0x1300e0(0xe9)]&&console[_0x1300e0(0x128)](_0x1300e0(0xd0)+_0x18fe18[_0x1300e0(0xe9)]));if(_0x18fe18[_0x1300e0(0x109)]==='parent'){const _0x5471ad=await withSpinner(_0x1300e0(0xe1),()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x136)](_0x18fe18[_0x1300e0(0x107)]),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x5471ad[_0x1300e0(0xdb)]],_0x5c96a2);}else{if(_0x18fe18[_0x1300e0(0x109)]===_0x1300e0(0xdc)){if(!_0x18fe18[_0x1300e0(0x122)])throw new SDKError(ErrorCode[_0x1300e0(0xf0)],_0x1300e0(0x10d));const _0x52a65d=await withSpinner(_0x1300e0(0xfb),()=>_0x4885ff[_0x1300e0(0x134)]['getFolder'](_0x18fe18['folderId']),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x52a65d[_0x1300e0(0xdb)]],_0x5c96a2);}else{if(_0x18fe18['type']===_0x1300e0(0x134)){if(!_0x18fe18[_0x1300e0(0xe9)])throw new SDKError(ErrorCode['INTERNAL'],_0x1300e0(0x133));const _0x238f99=await withSpinner(_0x1300e0(0xd8),()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x12e)](_0x18fe18[_0x1300e0(0x107)],_0x18fe18['segmentId']),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x238f99[_0x1300e0(0xdb)]],_0x5c96a2);}}}return 0x0;}catch(_0x36afa6){if(_0x36afa6 instanceof SDKError)return console[_0x1300e0(0x128)](_0x1300e0(0xd5)+_0x36afa6[_0x1300e0(0xdf)]),_0x36afa6[_0x1300e0(0xd4)]&&console[_0x1300e0(0x128)](_0x1300e0(0x11f)+_0x36afa6[_0x1300e0(0xd4)]),0x1;throw _0x36afa6;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xef);[a22_0x411ca8(0xe2)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a22_0x411ca8(0x10a)](_0x3db8d8){const _0x51c945=a22_0x411ca8,{options:_0x3106f0,args:_0xd718a0,tdx:_0x22dea4}=_0x3db8d8;if(_0xd718a0[_0x51c945(0x11d)]===0x0)return console[_0x51c945(0x128)](_0x51c945(0xdd)),console['error'](_0x51c945(0xd6)),console['error'](_0x51c945(0x12d)),console[_0x51c945(0x128)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x51c945(0x128)](_0x51c945(0x120)),console[_0x51c945(0x128)](_0x51c945(0xf4)),0x1;try{const _0x362308=_0xd718a0[0x0],_0x5e7775=_0x3106f0[_0x51c945(0x126)];let _0x55b32d=_0x362308;_0x5e7775&&!_0x362308[_0x51c945(0x123)]('/')&&(_0x55b32d=_0x5e7775+'/'+_0x362308,_0x3106f0[_0x51c945(0x104)]&&console[_0x51c945(0x128)]('Resolved\x20relative\x20path\x20to:\x20'+_0x55b32d));const _0x567e56=await withSpinner('Resolving\x20path\x20\x27'+_0x55b32d+'\x27...',()=>_0x22dea4[_0x51c945(0x134)][_0x51c945(0x130)](_0x55b32d),{'verbose':_0x3106f0['verbose']}),_0x268791=_0x567e56[_0x51c945(0xdb)];_0x3106f0[_0x51c945(0x104)]&&(console[_0x51c945(0x128)]('Resolved\x20type:\x20'+_0x268791[_0x51c945(0x109)]),console[_0x51c945(0x128)](_0x51c945(0x12c)+_0x268791[_0x51c945(0x107)]));if(_0x268791[_0x51c945(0x109)]===_0x51c945(0xdc))return console[_0x51c945(0x128)](_0x51c945(0x13c)),console[_0x51c945(0x128)](_0x51c945(0x10b)),0x1;let _0x287b62;if(_0x268791['type']==='parent'){const _0x56c668=await withSpinner(_0x51c945(0x13e),()=>_0x22dea4[_0x51c945(0x134)]['getParentSQL'](_0x268791[_0x51c945(0x107)]),{'verbose':_0x3106f0[_0x51c945(0x104)]});_0x287b62=_0x56c668[_0x51c945(0xdb)];}else{if(!_0x268791[_0x51c945(0xe9)])throw new SDKError(ErrorCode[_0x51c945(0xf0)],_0x51c945(0x133));const _0x527d5d=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x22dea4[_0x51c945(0x134)][_0x51c945(0xfa)](_0x268791['parentId'],_0x268791[_0x51c945(0xe9)]),{'verbose':_0x3106f0[_0x51c945(0x104)]});_0x287b62=_0x527d5d['data'];}const _0x5ef0dd=_0x3106f0[_0x51c945(0x10f)],_0x3f702c=/\bLIMIT\s+\d+/i['test'](_0x287b62);!_0x3f702c&&(_0x287b62=_0x287b62['trim']()[_0x51c945(0xe4)](/;+$/,''),_0x287b62=_0x51c945(0xe7)+_0x287b62+_0x51c945(0x12b)+_0x5ef0dd);_0x3106f0[_0x51c945(0x104)]&&console[_0x51c945(0x128)](_0x51c945(0x124)+_0x287b62);const _0x3ea9c6=await withQuerySpinner('Executing\x20segment\x20query...',async _0x3b9757=>{const _0xfa0afd=_0x51c945,_0x18eb30=await _0x22dea4[_0xfa0afd(0x139)](_0x287b62,{'catalog':'td','schema':_0xfa0afd(0x127),'onJobId':_0x58a643=>{_0x3b9757['setJobId'](_0x58a643);}});return _0x18eb30;},{'verbose':_0x3106f0['verbose']}),_0x451602=_0x3ea9c6[_0x51c945(0xdb)],_0x31adcf=_0x451602[_0x51c945(0x135)]?_0x51c945(0x11e)+_0x451602['jobId']+']':'';return console[_0x51c945(0x128)](_0x51c945(0xea)+_0x451602[_0x51c945(0x138)][_0x51c945(0xfd)][_0x51c945(0xcb)]()+_0x51c945(0x12f)+(_0x51c945(0xf5)+formatElapsed(_0x451602[_0x51c945(0x138)][_0x51c945(0xd2)])+_0x31adcf)),await handleQueryOutput(_0x451602,_0x3106f0),0x0;}catch(_0x3940a2){if(_0x3940a2 instanceof SDKError)return console['error']('✖\x20Query\x20failed\x20['+_0x3940a2[_0x51c945(0x10e)]+']'),console['error']('\x0a'+_0x3940a2[_0x51c945(0xdf)]),0x1;throw _0x3940a2;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0x115);[a22_0x411ca8(0xe2)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a22_0x411ca8(0x10a)](_0x1ef747){const _0x3ca105=a22_0x411ca8,{options:_0x26c031,args:_0x55fcdb,tdx:_0xdf2c1f}=_0x1ef747;if(_0x55fcdb[_0x3ca105(0x11d)]===0x0)return console[_0x3ca105(0x128)](_0x3ca105(0xed)),console[_0x3ca105(0x128)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x2476be=_0x55fcdb[0x0];try{_0x26c031[_0x3ca105(0x104)]&&(console[_0x3ca105(0x128)](_0x3ca105(0xcc)+_0x26c031[_0x3ca105(0xfc)]),console[_0x3ca105(0x128)](_0x3ca105(0xde)+_0x2476be));const _0x4e1227=await withSpinner(_0x3ca105(0xf8)+_0x2476be+_0x3ca105(0x118),()=>_0xdf2c1f[_0x3ca105(0x134)][_0x3ca105(0xf9)](_0x2476be),{'verbose':_0x26c031[_0x3ca105(0x104)]}),_0x27db7e=_0x4e1227[_0x3ca105(0xdb)];_0x26c031[_0x3ca105(0x104)]&&console[_0x3ca105(0x128)](_0x3ca105(0x119)+_0x27db7e);const _0x43baa6=await withSpinner(_0x3ca105(0xce)+_0x2476be+_0x3ca105(0x118),()=>_0xdf2c1f[_0x3ca105(0x134)]['listFolders'](_0x27db7e),{'verbose':_0x26c031['verbose']}),_0x1a8999=_0x43baa6['data'];return console[_0x3ca105(0x128)](_0x3ca105(0x11a)+_0x1a8999[_0x3ca105(0x11d)]+'\x20folder'+(_0x1a8999[_0x3ca105(0x11d)]!==0x1?'s':'')),await handleSDKOutput(_0x1a8999,_0x26c031),0x0;}catch(_0x5f5203){if(_0x5f5203 instanceof SDKError)return console[_0x3ca105(0x128)](_0x3ca105(0xd5)+_0x5f5203['message']),_0x5f5203[_0x3ca105(0xd4)]&&console[_0x3ca105(0x128)](_0x3ca105(0x11f)+_0x5f5203[_0x3ca105(0xd4)]),0x1;throw _0x5f5203;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xcf);[a22_0x411ca8(0xe2)]=a22_0x411ca8(0x100);async[a22_0x411ca8(0x10a)](_0x553bbe){const _0x46e8fd=a22_0x411ca8,{options:_0x47ae89,args:_0x92ac80,tdx:_0x2da2f5}=_0x553bbe;if(_0x92ac80[_0x46e8fd(0x11d)]===0x0)return console['error'](_0x46e8fd(0x110)),console[_0x46e8fd(0x128)](_0x46e8fd(0x129)),0x1;try{const {parentId:_0x52b42,childId:_0x554fbe}=parseSegmentRef(_0x92ac80[0x0]);_0x47ae89[_0x46e8fd(0x104)]&&(console[_0x46e8fd(0x128)]('Site:\x20'+_0x47ae89[_0x46e8fd(0xfc)]),console['error'](_0x46e8fd(0xde)+_0x52b42),_0x554fbe&&console[_0x46e8fd(0x128)](_0x46e8fd(0xee)+_0x554fbe));if(!_0x554fbe)return console[_0x46e8fd(0x128)](_0x46e8fd(0x114)),0x1;const _0x144ad6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x52b42+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)][_0x46e8fd(0xf9)](_0x52b42),{'verbose':_0x47ae89[_0x46e8fd(0x104)]}),_0x47038a=_0x144ad6[_0x46e8fd(0xdb)];_0x47ae89[_0x46e8fd(0x104)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0x119)+_0x47038a);const _0x2d6f58=await withSpinner(_0x46e8fd(0xec)+_0x554fbe+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)]['resolveFolderId'](_0x47038a,_0x554fbe),{'verbose':_0x47ae89[_0x46e8fd(0x104)]}),_0x5a9a8b=_0x2d6f58[_0x46e8fd(0xdb)];_0x47ae89[_0x46e8fd(0x104)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0xff)+_0x5a9a8b);const _0x3b241d=await withSpinner(_0x46e8fd(0x105)+_0x554fbe+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)][_0x46e8fd(0xd3)](_0x5a9a8b),{'verbose':_0x47ae89[_0x46e8fd(0x104)]});return await handleSDKOutput([_0x3b241d[_0x46e8fd(0xdb)]],_0x47ae89),0x0;}catch(_0x4025fe){if(_0x4025fe instanceof SDKError)return console[_0x46e8fd(0x128)](_0x46e8fd(0xd5)+_0x4025fe['message']),_0x4025fe[_0x46e8fd(0xd4)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0x11f)+_0x4025fe[_0x46e8fd(0xd4)]),0x1;throw _0x4025fe;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xe8);['description']=a22_0x411ca8(0xeb);async['execute'](_0x2e22d9){const _0x199f05=a22_0x411ca8,{options:_0x3641c4,args:_0x342d8c,tdx:_0x250fc7}=_0x2e22d9;if(_0x342d8c[_0x199f05(0x11d)]===0x0)return console[_0x199f05(0x128)](_0x199f05(0xdd)),console['error'](_0x199f05(0x113)),console[_0x199f05(0x128)]('Examples:'),console[_0x199f05(0x128)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console['error'](_0x199f05(0xfe)),console[_0x199f05(0x128)](_0x199f05(0x13b)),0x1;try{const _0x14718e=_0x342d8c[0x0],_0x3fa4ff=_0x3641c4[_0x199f05(0x126)];let _0x2c7662=_0x14718e;_0x3fa4ff&&!_0x14718e['includes']('/')&&(_0x2c7662=_0x3fa4ff+'/'+_0x14718e,_0x3641c4[_0x199f05(0x104)]&&console[_0x199f05(0x128)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2c7662));const _0xd12287=await withSpinner(_0x199f05(0x125)+_0x2c7662+_0x199f05(0x118),()=>_0x250fc7[_0x199f05(0x134)][_0x199f05(0x130)](_0x2c7662),{'verbose':_0x3641c4[_0x199f05(0x104)]}),_0x22ac60=_0xd12287['data'];_0x3641c4[_0x199f05(0x104)]&&(console[_0x199f05(0x128)]('Resolved\x20type:\x20'+_0x22ac60[_0x199f05(0x109)]),console['error']('Parent\x20ID:\x20'+_0x22ac60[_0x199f05(0x107)]));if(_0x22ac60[_0x199f05(0x109)]===_0x199f05(0xdc))return console[_0x199f05(0x128)](_0x199f05(0x137)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x494771;if(_0x22ac60[_0x199f05(0x109)]===_0x199f05(0x131)){const _0x4e0a81=await withSpinner(_0x199f05(0x13e),()=>_0x250fc7[_0x199f05(0x134)][_0x199f05(0x121)](_0x22ac60['parentId']),{'verbose':_0x3641c4[_0x199f05(0x104)]});_0x494771=_0x4e0a81[_0x199f05(0xdb)];}else{if(!_0x22ac60[_0x199f05(0xe9)])throw new SDKError(ErrorCode['INTERNAL'],_0x199f05(0x133));const _0x10de6c=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x250fc7['segment'][_0x199f05(0xfa)](_0x22ac60[_0x199f05(0x107)],_0x22ac60[_0x199f05(0xe9)]),{'verbose':_0x3641c4[_0x199f05(0x104)]});_0x494771=_0x10de6c[_0x199f05(0xdb)];}return _0x3641c4[_0x199f05(0xf3)]===_0x199f05(0xe0)||_0x3641c4[_0x199f05(0xf3)]===_0x199f05(0xcd)?await handleSDKOutput([{'sql':_0x494771}],_0x3641c4):console[_0x199f05(0xf6)](_0x494771),0x0;}catch(_0x17fd0a){if(_0x17fd0a instanceof SDKError)return console[_0x199f05(0x128)](_0x199f05(0xd5)+_0x17fd0a['message']),_0x17fd0a[_0x199f05(0xd4)]&&console[_0x199f05(0x128)]('\x20\x20Cause:\x20'+_0x17fd0a[_0x199f05(0xd4)]),0x1;throw _0x17fd0a;}}}function a22_0x5afa(){const _0x38e764=['segment','jobId','getParent','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','stats','query','31568XAkbwS','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','14172hawegY','Fetching\x20SQL\x20for\x20parent\x20segment...','Parent\x20segment:\x20','451ehxArv','toLocaleString','Site:\x20','jsonl','Listing\x20folders\x20for\x20parent\x20\x27','segment:folder:show','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','elapsedTimeMillis','getFolder','cause','Error:\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','265884qwFhdS','Fetching\x20segment\x20details...','Error:\x20Path\x20or\x20name\x20is\x20required','287GDXIAw','data','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20name:\x20','message','json','Fetching\x20parent\x20segment\x20details...','description','48wThrXN','replace','Resolved\x20parent\x20folder\x20ID:\x20','✔\x20Created\x20folder\x20\x27','SELECT\x20*\x20FROM\x20(\x0a','segment:sql','segmentId','✔\x20Query\x20completed:\x20Processed\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Resolving\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','Folder\x20name:\x20','segment:show','INTERNAL','554liDeML','name','format','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','in\x20','log','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','resolveParentId','getSegmentSQL','Fetching\x20folder\x20details...','site','processedRows','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20folder\x20ID:\x20','Show\x20segment\x20folder\x20details','787PLEqQj','51855ArcxBU','Show\x20segment\x20or\x20folder\x20details','verbose','Fetching\x20folder\x20\x27','Folder\x20ID:\x20','parentId','Usage:\x20tdx\x20segment\x20describe\x20<path>','type','execute','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','2561565qYrhLS','Folder\x20ID\x20missing\x20from\x20resolved\x20path','code','limit','Error:\x20Folder\x20reference\x20is\x20required','createFolder','Resolved\x20type:\x20','Usage:\x20tdx\x20segment\x20sql\x20<path>','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segment:describe','\x27...','Resolved\x20parent\x20ID:\x20','✔\x20Found\x20','823440ppIFhI','1467dTYxfR','length','\x20[Job\x20ID:\x20','\x20\x20Cause:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getParentSQL','folderId','includes','SQL\x20query:\x0a','Resolving\x20path\x20\x27','segmentPath','information_schema','error','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20ID:\x20','Examples:','getSegment','\x20rows\x20','resolvePathToResource','parent','parentFolder','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a22_0x5afa=function(){return _0x38e764;};return a22_0x5afa();}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a22_0x411ca8(0xe2)]='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x411ca8(0x10a)](_0x3a3521){const _0x633a0f=a22_0x411ca8,{options:_0x2044dc,args:_0xa244e8,tdx:_0xf7f0db}=_0x3a3521,_0x179098=_0x2044dc;if(_0xa244e8[_0x633a0f(0x11d)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x633a0f(0x116)),0x1;const _0x359e19=_0xa244e8[0x0],_0x2cd29c=_0xa244e8[0x1];_0x179098['verbose']&&(console['error']('Site:\x20'+_0x179098[_0x633a0f(0xfc)]),console['error'](_0x633a0f(0x13f)+_0x359e19),console[_0x633a0f(0x128)](_0x633a0f(0xee)+_0x2cd29c));let _0x575990;if(_0x179098[_0x633a0f(0x132)]){const _0x353d0d=_0x179098[_0x633a0f(0x132)],_0x19933e=await withSpinner(_0x633a0f(0xf8)+_0x359e19+_0x633a0f(0x118),()=>_0xf7f0db['segment'][_0x633a0f(0xf9)](_0x359e19),{'verbose':_0x179098[_0x633a0f(0x104)]}),_0x35d470=_0x19933e[_0x633a0f(0xdb)],_0x5af6b0=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x353d0d+_0x633a0f(0x118),()=>_0xf7f0db[_0x633a0f(0x134)]['resolveFolderId'](_0x35d470,_0x353d0d),{'verbose':_0x179098['verbose']});_0x575990=_0x5af6b0[_0x633a0f(0xdb)],_0x179098[_0x633a0f(0x104)]&&console[_0x633a0f(0x128)](_0x633a0f(0xe5)+_0x575990);}const _0x1aa519={'name':_0x2cd29c,'description':_0x179098[_0x633a0f(0xe2)],'parentFolderId':_0x575990},_0x577424=await withSpinner('Creating\x20folder\x20\x27'+_0x2cd29c+_0x633a0f(0x118),()=>_0xf7f0db[_0x633a0f(0x134)][_0x633a0f(0x111)](_0x359e19,_0x1aa519),{'verbose':_0x179098[_0x633a0f(0x104)]}),_0x2c6a38=_0x577424[_0x633a0f(0xdb)];return console['error'](_0x633a0f(0xe6)+_0x2c6a38[_0x633a0f(0xf2)]+_0x633a0f(0xf7)+_0x2c6a38['id']),await handleSDKOutput([_0x2c6a38],_0x179098),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x43a657=a23_0x26df;(function(_0x5d4cfc,_0x2c6eee){const _0x569e75=a23_0x26df,_0x2daac2=_0x5d4cfc();while(!![]){try{const _0x2042a5=-parseInt(_0x569e75(0x117))/0x1+-parseInt(_0x569e75(0xf1))/0x2*(-parseInt(_0x569e75(0x104))/0x3)+parseInt(_0x569e75(0x112))/0x4+-parseInt(_0x569e75(0xf9))/0x5+parseInt(_0x569e75(0xf4))/0x6+parseInt(_0x569e75(0x101))/0x7*(-parseInt(_0x569e75(0x109))/0x8)+-parseInt(_0x569e75(0x111))/0x9*(-parseInt(_0x569e75(0x114))/0xa);if(_0x2042a5===_0x2c6eee)break;else _0x2daac2['push'](_0x2daac2['shift']());}catch(_0x32b074){_0x2daac2['push'](_0x2daac2['shift']());}}}(a23_0x44e5,0xcc20c));import{BaseCommand}from'./command.js';function a23_0x26df(_0x305635,_0x47a499){const _0x44e5b4=a23_0x44e5();return a23_0x26df=function(_0x26df72,_0x5c9c57){_0x26df72=_0x26df72-0xea;let _0x54941a=_0x44e5b4[_0x26df72];return _0x54941a;},a23_0x26df(_0x305635,_0x47a499);}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{[a23_0x43a657(0xef)]=a23_0x43a657(0xf6);[a23_0x43a657(0xeb)]=a23_0x43a657(0xfa);async[a23_0x43a657(0xf0)](_0x14fc89){const _0x173704=a23_0x43a657,{options:_0x110b4c,args:_0x1979b5,tdx:_0x56d797}=_0x14fc89,_0x2dc352=_0x110b4c;if(_0x1979b5[_0x173704(0x110)]===0x0)return console[_0x173704(0xea)](_0x173704(0x102)),console[_0x173704(0xea)](_0x173704(0x116)),console[_0x173704(0xea)](_0x173704(0x113)),console[_0x173704(0xea)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x173704(0xea)](_0x173704(0xf7)),console[_0x173704(0xea)](_0x173704(0xed)),0x1;const _0x5e81dd=_0x1979b5[0x0],_0x99540a=_0x110b4c['segmentPath'];let _0x136bf6=_0x5e81dd;_0x99540a&&!_0x5e81dd[_0x173704(0x10c)]('/')&&(_0x136bf6=_0x99540a+'/'+_0x5e81dd,_0x2dc352[_0x173704(0x115)]&&console[_0x173704(0xea)]('Resolved\x20relative\x20path\x20to:\x20'+_0x136bf6));const _0x30ae8f=parsePath(_0x136bf6);if(_0x30ae8f[_0x173704(0xf8)][_0x173704(0x110)]<0x2)return console[_0x173704(0xea)](_0x173704(0xec)),console['error'](_0x173704(0x10d)),0x1;const _0x10125b=_0x30ae8f[_0x173704(0xf8)][0x0],_0x550b4a=getBaseName(_0x136bf6),_0x3a31d=getParentPath(_0x136bf6);_0x2dc352['verbose']&&(console['error']('Site:\x20'+_0x2dc352[_0x173704(0xee)]),console['error'](_0x173704(0x106)+_0x136bf6),console[_0x173704(0xea)](_0x173704(0x10a)+_0x10125b),console[_0x173704(0xea)]('Segment\x20name:\x20'+_0x550b4a),console[_0x173704(0xea)]('Parent\x20path:\x20'+_0x3a31d));const _0x3be583=await withSpinner(_0x173704(0x118)+_0x10125b+'\x27...',()=>_0x56d797['segment']['resolveParentId'](_0x10125b),{'verbose':_0x2dc352['verbose']}),_0x28ca06=_0x3be583['data'];let _0x33b74e;if(_0x30ae8f['segments'][_0x173704(0x110)]>0x2){const _0x5ceb47=await withSpinner(_0x173704(0xf2)+_0x3a31d+'\x27...',()=>_0x56d797[_0x173704(0xfc)][_0x173704(0x100)](_0x3a31d),{'verbose':_0x2dc352[_0x173704(0x115)]}),_0x5699a8=_0x5ceb47[_0x173704(0x108)];if(_0x5699a8['type']!==_0x173704(0xfe)&&_0x5699a8[_0x173704(0x10f)]!==_0x173704(0xfd))return console[_0x173704(0xea)](_0x173704(0x10b)),0x1;_0x33b74e=_0x5699a8['folderId'];}else{if(_0x2dc352[_0x173704(0xfe)]){const _0xbab09e=await withSpinner('Resolving\x20folder\x20\x27'+_0x2dc352[_0x173704(0xfe)]+'\x27...',()=>_0x56d797[_0x173704(0xfc)][_0x173704(0x107)](_0x28ca06,_0x2dc352[_0x173704(0xfe)]),{'verbose':_0x2dc352[_0x173704(0x115)]});_0x33b74e=_0xbab09e['data'];}}_0x2dc352['verbose']&&_0x33b74e&&console[_0x173704(0xea)]('Resolved\x20folder\x20ID:\x20'+_0x33b74e);const _0x2e4b61=await loadJSONFromOptions(_0x2dc352[_0x173704(0x10e)],_0x2dc352[_0x173704(0xf5)]),_0x35e800={'name':_0x550b4a,'description':_0x2dc352[_0x173704(0xeb)],'rule':_0x2e4b61,'kind':_0x2dc352['kind']!==undefined?parseInt(_0x2dc352[_0x173704(0x103)],0xa):undefined,'isVisible':_0x2dc352[_0x173704(0xff)]?![]:undefined,'segmentFolderId':_0x33b74e,'countPopulation':_0x2dc352['noCountPopulation']?![]:undefined},_0x345e04=await withSpinner('Creating\x20segment\x20\x27'+_0x550b4a+_0x173704(0xf3),()=>_0x56d797[_0x173704(0xfc)][_0x173704(0xfb)](_0x28ca06,_0x35e800),{'verbose':_0x2dc352[_0x173704(0x115)]}),_0x1996d1=_0x345e04[_0x173704(0x108)];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x1996d1['name']+'\x27\x20with\x20ID:\x20'+_0x1996d1['id']),_0x136bf6!==_0x5e81dd&&console[_0x173704(0xea)](_0x173704(0x105)+_0x136bf6),await handleSDKOutput([_0x1996d1],_0x2dc352),0x0;}}function a23_0x44e5(){const _0x4270fc=['site','name','execute','45566TbcdaV','Resolving\x20folder\x20path\x20\x27','\x27...','6302190chDMeo','ruleFile','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','2779090RLYLNc','Create\x20child\x20segment\x20with\x20filtering\x20rules','createSegment','segment','parent','folder','invisible','resolvePathToResource','11003629LVnZGp','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','kind','147ARgwck','\x20\x20\x20Path:\x20','Target\x20path:\x20','resolveFolderId','data','8fhdhdu','Parent:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','includes','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','rule','type','length','2302821wyJZIc','3233312ePaLBp','Examples:','20EATFks','verbose','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','522925XTBIIl','Resolving\x20parent\x20segment\x20\x27','error','description','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'];a23_0x44e5=function(){return _0x4270fc;};return a23_0x44e5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a24_0x58fb(){const _0x295bb2=['3453461wVhTwX','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2vVZcGj','\x20field','data','length','7gNceaK','segment','\x27...','verbose','List\x20available\x20fields\x20for\x20segmentation','execute','3285032npUMEx','351011YyPtPV','626890NXbFjx','segment:fields','Site:\x20','description','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','178284cVDHZN','1907840RWagjD','9TjDrde','listFields','name','39VuhBXy','Listing\x20fields\x20for\x20\x27','1248054GczSBq','✔\x20Found\x20'];a24_0x58fb=function(){return _0x295bb2;};return a24_0x58fb();}function a24_0x1edb(_0x39a57f,_0x42fb57){const _0x58fbe1=a24_0x58fb();return a24_0x1edb=function(_0x1edb0b,_0x3e5a48){_0x1edb0b=_0x1edb0b-0x1e1;let _0x123366=_0x58fbe1[_0x1edb0b];return _0x123366;},a24_0x1edb(_0x39a57f,_0x42fb57);}const a24_0x3084f3=a24_0x1edb;(function(_0x214e8b,_0x37405e){const _0x32d0c1=a24_0x1edb,_0x37c93d=_0x214e8b();while(!![]){try{const _0x2e8e19=parseInt(_0x32d0c1(0x1f1))/0x1*(-parseInt(_0x32d0c1(0x1e6))/0x2)+parseInt(_0x32d0c1(0x1fd))/0x3*(-parseInt(_0x32d0c1(0x1f8))/0x4)+parseInt(_0x32d0c1(0x1f2))/0x5+parseInt(_0x32d0c1(0x1e2))/0x6*(parseInt(_0x32d0c1(0x1ea))/0x7)+-parseInt(_0x32d0c1(0x1f0))/0x8*(-parseInt(_0x32d0c1(0x1fa))/0x9)+parseInt(_0x32d0c1(0x1f9))/0xa+parseInt(_0x32d0c1(0x1e4))/0xb;if(_0x2e8e19===_0x37405e)break;else _0x37c93d['push'](_0x37c93d['shift']());}catch(_0x2feb34){_0x37c93d['push'](_0x37c93d['shift']());}}}(a24_0x58fb,0x4db6d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x3084f3(0x1fc)]=a24_0x3084f3(0x1f3);[a24_0x3084f3(0x1f5)]=a24_0x3084f3(0x1ee);async[a24_0x3084f3(0x1ef)](_0x595363){const _0x341730=a24_0x3084f3,{options:_0x345524,args:_0x530d95,tdx:_0x34e76e}=_0x595363;if(_0x530d95[_0x341730(0x1e9)]===0x0)return console[_0x341730(0x1f7)](_0x341730(0x1f6)),console[_0x341730(0x1f7)](_0x341730(0x1e5)),0x1;const _0x322d4d=_0x530d95[0x0];_0x345524[_0x341730(0x1ed)]&&(console['error'](_0x341730(0x1f4)+_0x345524['site']),console[_0x341730(0x1f7)]('Parent\x20segment:\x20'+_0x322d4d));const _0x4ac02e=await withSpinner(_0x341730(0x1e1)+_0x322d4d+_0x341730(0x1ec),()=>_0x34e76e[_0x341730(0x1eb)][_0x341730(0x1fb)](_0x322d4d),{'verbose':_0x345524[_0x341730(0x1ed)]}),_0x39e6c0=_0x4ac02e[_0x341730(0x1e8)];return console[_0x341730(0x1f7)](_0x341730(0x1e3)+_0x39e6c0[_0x341730(0x1e9)]+_0x341730(0x1e7)+(_0x39e6c0[_0x341730(0x1e9)]!==0x1?'s':'')),await handleSDKOutput(_0x39e6c0,_0x345524),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x55da45=a25_0xc014;function a25_0xc014(_0x3940af,_0x4b01c1){const _0x2e97bc=a25_0x2e97();return a25_0xc014=function(_0xc01454,_0x5cfe1f){_0xc01454=_0xc01454-0x1db;let _0x53a551=_0x2e97bc[_0xc01454];return _0x53a551;},a25_0xc014(_0x3940af,_0x4b01c1);}(function(_0x50c5ff,_0x54bda0){const _0x54935d=a25_0xc014,_0x193ba0=_0x50c5ff();while(!![]){try{const _0x2560e4=-parseInt(_0x54935d(0x1ec))/0x1*(parseInt(_0x54935d(0x1e4))/0x2)+parseInt(_0x54935d(0x1f1))/0x3*(parseInt(_0x54935d(0x1f0))/0x4)+-parseInt(_0x54935d(0x1e8))/0x5*(-parseInt(_0x54935d(0x1de))/0x6)+-parseInt(_0x54935d(0x1dc))/0x7+parseInt(_0x54935d(0x1df))/0x8*(-parseInt(_0x54935d(0x1e0))/0x9)+parseInt(_0x54935d(0x1eb))/0xa*(-parseInt(_0x54935d(0x1e6))/0xb)+-parseInt(_0x54935d(0x1ea))/0xc*(-parseInt(_0x54935d(0x1e9))/0xd);if(_0x2560e4===_0x54bda0)break;else _0x193ba0['push'](_0x193ba0['shift']());}catch(_0x1a0a3e){_0x193ba0['push'](_0x193ba0['shift']());}}}(a25_0x2e97,0x5f823));import{BaseCommand}from'./command.js';function a25_0x2e97(){const _0x1bdb44=['log','stringify','json','1766pQooIi','\x20\x20Path:\x20','22627MUkHwZ','Context\x20details:','15pILJjs','26fvxtEk','5097684ZTFHzN','420WdeHfN','687qAXcjL','format','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','error','2466388eYPLNn','3MnRtUV','jsonl','root','1907850XhOcFq','segment:pwd','1295634CdqUtT','288NvRxgU','189315jEAjFw'];a25_0x2e97=function(){return _0x1bdb44;};return a25_0x2e97();}export class SegmentPwdCommand extends BaseCommand{['name']=a25_0x55da45(0x1dd);['description']='Show\x20current\x20segment/folder\x20context';async['execute'](_0x1e29e5){const _0x3f2a6f=a25_0x55da45,{options:_0x1be658}=_0x1e29e5;try{const _0x5cf156=_0x1be658['segmentPath'];if(!_0x5cf156)return _0x1be658['format']===_0x3f2a6f(0x1e3)||_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1f2)?console[_0x3f2a6f(0x1e1)](JSON['stringify']({'path':'/','type':_0x3f2a6f(0x1db)})):console[_0x3f2a6f(0x1e1)]('/'),0x0;if(_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1e3)||_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1f2)){const _0xb9accf={'path':_0x5cf156};console[_0x3f2a6f(0x1e1)](JSON[_0x3f2a6f(0x1e2)](_0xb9accf));}else console[_0x3f2a6f(0x1e1)](_0x5cf156),_0x1be658['verbose']&&(console[_0x3f2a6f(0x1ef)](''),console[_0x3f2a6f(0x1ef)](_0x3f2a6f(0x1e7)),console[_0x3f2a6f(0x1ef)](_0x3f2a6f(0x1e5)+_0x5cf156),console['error'](''),console['error'](_0x3f2a6f(0x1ee)),console[_0x3f2a6f(0x1ef)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x25d969){throw _0x25d969;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a26_0x1431(){const _0x304dfa=['Parent\x20ID:\x20','name','kind','Segment\x20ID\x20missing\x20from\x20resolved\x20path','parentId','\x20\x20\x20Path:\x20','segment','data','9002076fzMvzf','2690733UlTkMz','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','1288301ThAurQ','segmentPath','verbose','segment:update','\x27...','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','type','1353088XlIAma','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','2mgPbwf','277700bZhITJ','5ijCHEg','Resolved\x20relative\x20path\x20to:\x20','error','Update\x20existing\x20child\x20segment','Examples:','Segment\x20ID:\x20','65942cGjNul','Resolved\x20type:\x20','includes','4870592vwHbQJ','8orSJXX','✔\x20Updated\x20segment\x20\x27','INTERNAL','180XsBhMR'];a26_0x1431=function(){return _0x304dfa;};return a26_0x1431();}const a26_0x3f7489=a26_0x29c0;function a26_0x29c0(_0x599c94,_0x262f54){const _0x14312e=a26_0x1431();return a26_0x29c0=function(_0x29c0c1,_0x3bcc69){_0x29c0c1=_0x29c0c1-0x11e;let _0x5af9ef=_0x14312e[_0x29c0c1];return _0x5af9ef;},a26_0x29c0(_0x599c94,_0x262f54);}(function(_0x2668b4,_0x1a4a9f){const _0x16691b=a26_0x29c0,_0x46b035=_0x2668b4();while(!![]){try{const _0x5bafc5=parseInt(_0x16691b(0x120))/0x1+-parseInt(_0x16691b(0x13e))/0x2*(-parseInt(_0x16691b(0x131))/0x3)+-parseInt(_0x16691b(0x123))/0x4*(parseInt(_0x16691b(0x140))/0x5)+parseInt(_0x16691b(0x130))/0x6+parseInt(_0x16691b(0x134))/0x7*(parseInt(_0x16691b(0x124))/0x8)+parseInt(_0x16691b(0x127))/0x9*(-parseInt(_0x16691b(0x13f))/0xa)+-parseInt(_0x16691b(0x13c))/0xb;if(_0x5bafc5===_0x1a4a9f)break;else _0x46b035['push'](_0x46b035['shift']());}catch(_0x28d44f){_0x46b035['push'](_0x46b035['shift']());}}}(a26_0x1431,0xb7652));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{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x3f7489(0x129)]=a26_0x3f7489(0x137);['description']=a26_0x3f7489(0x143);async['execute'](_0x1c296a){const _0x5ead8c=a26_0x3f7489,{options:_0x1ef7c4,args:_0x24e026,tdx:_0xc98ddd}=_0x1c296a,_0x34fa81=_0x1ef7c4;if(_0x24e026['length']===0x0)return console[_0x5ead8c(0x142)](_0x5ead8c(0x133)),console[_0x5ead8c(0x142)](_0x5ead8c(0x13d)),console[_0x5ead8c(0x142)](_0x5ead8c(0x11e)),console[_0x5ead8c(0x142)](_0x5ead8c(0x139)),console[_0x5ead8c(0x142)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1d1331=_0x24e026[0x0],_0xef423a=_0x1ef7c4[_0x5ead8c(0x135)];let _0x560257=_0x1d1331;_0xef423a&&!_0x1d1331[_0x5ead8c(0x122)]('/')&&(_0x560257=_0xef423a+'/'+_0x1d1331,_0x34fa81[_0x5ead8c(0x136)]&&console['error'](_0x5ead8c(0x141)+_0x560257));const _0x3c09d0=await withSpinner('Resolving\x20path\x20\x27'+_0x560257+_0x5ead8c(0x138),()=>_0xc98ddd[_0x5ead8c(0x12e)]['resolvePathToResource'](_0x560257),{'verbose':_0x34fa81['verbose']}),_0x41216e=_0x3c09d0[_0x5ead8c(0x12f)];_0x34fa81[_0x5ead8c(0x136)]&&console[_0x5ead8c(0x142)](_0x5ead8c(0x121)+_0x41216e['type']);if(_0x41216e['type']!=='segment')return console['error']('Error:\x20Cannot\x20update\x20'+_0x41216e[_0x5ead8c(0x13b)]+_0x5ead8c(0x13a)),console[_0x5ead8c(0x142)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x41216e['segmentId'])throw new SDKError(ErrorCode[_0x5ead8c(0x126)],_0x5ead8c(0x12b));const _0xae20e3=_0x41216e[_0x5ead8c(0x12c)],_0x217529=_0x41216e['segmentId'];_0x34fa81[_0x5ead8c(0x136)]&&(console[_0x5ead8c(0x142)](_0x5ead8c(0x128)+_0xae20e3),console[_0x5ead8c(0x142)](_0x5ead8c(0x11f)+_0x217529));let _0x20eec1;if(_0x34fa81['folder']){const _0x35d1ea=_0x34fa81[_0x5ead8c(0x132)],_0x39964a=await withSpinner('Resolving\x20folder\x20\x27'+_0x35d1ea+_0x5ead8c(0x138),()=>_0xc98ddd[_0x5ead8c(0x12e)]['resolveFolderId'](_0xae20e3,_0x35d1ea),{'verbose':_0x34fa81['verbose']});_0x20eec1=parseInt(_0x39964a['data'],0xa),_0x34fa81[_0x5ead8c(0x136)]&&console[_0x5ead8c(0x142)]('Resolved\x20folder\x20ID:\x20'+_0x20eec1);}const _0x343c27=await loadJSONFromOptions(_0x34fa81['rule'],_0x34fa81['ruleFile']),_0x58bee9={'name':_0x34fa81['name'],'description':_0x34fa81['description'],'rule':_0x343c27,'kind':_0x34fa81[_0x5ead8c(0x12a)]!==undefined?parseInt(_0x34fa81['kind'],0xa):undefined,'segmentFolderId':_0x20eec1},_0x8c33a2=await withSpinner('Updating\x20segment\x20\x27'+_0x41216e['segmentName']+'\x27...',()=>_0xc98ddd[_0x5ead8c(0x12e)]['updateSegmentById'](_0xae20e3,_0x217529,_0x58bee9),{'verbose':_0x34fa81['verbose']}),_0x123a0a=_0x8c33a2['data'];return console[_0x5ead8c(0x142)](_0x5ead8c(0x125)+_0x123a0a['name']+'\x27'),_0x560257!==_0x1d1331&&console[_0x5ead8c(0x142)](_0x5ead8c(0x12d)+_0x560257),await handleSDKOutput([_0x123a0a],_0x34fa81),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0xa9f964=a27_0x1e3c;(function(_0x407e2d,_0x453b2e){const _0x234114=a27_0x1e3c,_0x4c1c86=_0x407e2d();while(!![]){try{const _0x23ee26=parseInt(_0x234114(0xbf))/0x1+-parseInt(_0x234114(0xe1))/0x2*(parseInt(_0x234114(0xc3))/0x3)+parseInt(_0x234114(0xb4))/0x4+-parseInt(_0x234114(0xda))/0x5*(parseInt(_0x234114(0xe6))/0x6)+-parseInt(_0x234114(0xb7))/0x7*(parseInt(_0x234114(0xe4))/0x8)+parseInt(_0x234114(0xe8))/0x9*(-parseInt(_0x234114(0xbc))/0xa)+-parseInt(_0x234114(0xe7))/0xb*(-parseInt(_0x234114(0xc4))/0xc);if(_0x23ee26===_0x453b2e)break;else _0x4c1c86['push'](_0x4c1c86['shift']());}catch(_0x3d151b){_0x4c1c86['push'](_0x4c1c86['shift']());}}}(a27_0x10c2,0x66f35));function a27_0x10c2(){const _0x2677fa=['Use:\x20tdx\x20segment\x20use\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','description','name','split','segment','resolvePathToResource','Examples:','slice','Folder\x20ID:\x20','error','Error:\x20Path\x20is\x20required','292425tqPyji','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','type','Context\x20cleared.\x20Back\x20to\x20root.','parentId','folderId','isAbsolute','2wPlrgg','Parent\x20ID:\x20','session','5741224gzxlpy','Target\x20path:\x20','48bBjYCU','4562932XwyWgn','2978253dZoejv','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','2868512qCuXyH','folderPath','segments','7ClnLQk','segmentPath','data','Context\x20set\x20to:\x20','verbose','10VgUWFT','Resolving\x20path\x20\x27','Resolved\x20path\x20type:\x20','300392TFIEtp','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','length','segment:use','971463gmTSaI','36iZTkKL','execute','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','site','join','Site:\x20','log','fullPath'];a27_0x10c2=function(){return _0x2677fa;};return a27_0x10c2();}import{BaseCommand}from'./command.js';function a27_0x1e3c(_0x3acff6,_0x2c81f6){const _0x10c23e=a27_0x10c2();return a27_0x1e3c=function(_0x1e3c07,_0x54dcb8){_0x1e3c07=_0x1e3c07-0xb3;let _0x807984=_0x10c23e[_0x1e3c07];return _0x807984;},a27_0x1e3c(_0x3acff6,_0x2c81f6);}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{[a27_0xa9f964(0xd1)]=a27_0xa9f964(0xc2);[a27_0xa9f964(0xd0)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a27_0xa9f964(0xc5)](_0x4378c7){const _0xedca74=a27_0xa9f964,{options:_0x4f7472,args:_0x343bb5,tdx:_0x22c34a}=_0x4378c7;if(_0x343bb5[_0xedca74(0xc1)]===0x0)return console[_0xedca74(0xd8)](_0xedca74(0xd9)),console['error'](_0xedca74(0xcd)),console[_0xedca74(0xd8)](_0xedca74(0xd5)),console[_0xedca74(0xd8)](_0xedca74(0xce)),console[_0xedca74(0xd8)](_0xedca74(0xb3)),console['error'](_0xedca74(0xdb)),console[_0xedca74(0xd8)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x353338=_0x343bb5[0x0],_0x45dce4=_0x4f7472[_0xedca74(0xe3)];try{if(_0x353338==='/')return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xdd)),0x0;const _0x55b01c=_0x4f7472[_0xedca74(0xb8)];let _0xd6f10f=_0x353338;const _0x5eafcc=parsePath(_0x353338);if(!_0x5eafcc[_0xedca74(0xe0)]){if(!_0x55b01c)return console[_0xedca74(0xd8)](_0xedca74(0xc0)),console[_0xedca74(0xd8)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'),0x1;if(_0x353338==='..'){const _0x2d1175=_0x55b01c[_0xedca74(0xd2)]('/')[_0xedca74(0xd6)](0x0,-0x1)[_0xedca74(0xc8)]('/');_0xd6f10f=_0x2d1175||'/';}else _0x353338==='.'?_0xd6f10f=_0x55b01c:_0xd6f10f=_0x55b01c+'/'+_0x353338;_0x4f7472[_0xedca74(0xbb)]&&console[_0xedca74(0xd8)](_0xedca74(0xea)+_0xd6f10f);}if(_0xd6f10f==='/'||_0xd6f10f==='')return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xdd)),0x0;_0xd6f10f=normalizePath(_0xd6f10f);const _0x5c3fb1=parsePath(_0xd6f10f)[_0xedca74(0xb6)];if(_0x5c3fb1['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x4f7472['verbose']&&(console[_0xedca74(0xd8)](_0xedca74(0xc9)+_0x4f7472[_0xedca74(0xc7)]),console[_0xedca74(0xd8)](_0xedca74(0xe5)+_0xd6f10f));const _0xd21dc5=await withSpinner(_0xedca74(0xbd)+_0xd6f10f+'\x27...',()=>_0x22c34a[_0xedca74(0xd3)][_0xedca74(0xd4)](_0xd6f10f),{'verbose':_0x4f7472['verbose']}),_0x5c1ab2=_0xd21dc5[_0xedca74(0xb9)];_0x4f7472['verbose']&&(console['error'](_0xedca74(0xbe)+_0x5c1ab2[_0xedca74(0xdc)]),console[_0xedca74(0xd8)](_0xedca74(0xe2)+_0x5c1ab2[_0xedca74(0xde)]),_0x5c1ab2[_0xedca74(0xdf)]&&console[_0xedca74(0xd8)](_0xedca74(0xd7)+_0x5c1ab2[_0xedca74(0xdf)]));if(_0x5c1ab2['type']===_0xedca74(0xd3))return console[_0xedca74(0xd8)](_0xedca74(0xcf)),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0xedca74(0xd8)](_0xedca74(0xcc)+_0x5c1ab2['parentName']+(_0x5c1ab2[_0xedca74(0xb5)]?'/'+_0x5c1ab2[_0xedca74(0xb5)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x5c1ab2[_0xedca74(0xcb)],'parent_segment':_0x5c1ab2['parentName']},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xba)+_0x5c1ab2[_0xedca74(0xcb)]),_0x4f7472['verbose']&&(console[_0xedca74(0xd8)](_0xedca74(0xc6)),console[_0xedca74(0xd8)]('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0xedca74(0xd8)](_0xedca74(0xe9))),0x0;}catch(_0x141dd8){throw _0x141dd8;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x1d8708=a28_0x8d64;function a28_0x8d64(_0x247444,_0x2bbc76){const _0x15861f=a28_0x1586();return a28_0x8d64=function(_0x8d64fd,_0x5108aa){_0x8d64fd=_0x8d64fd-0x1d4;let _0x5665db=_0x15861f[_0x8d64fd];return _0x5665db;},a28_0x8d64(_0x247444,_0x2bbc76);}(function(_0x5622e1,_0x34c727){const _0x1a5fd0=a28_0x8d64,_0x30a0da=_0x5622e1();while(!![]){try{const _0xbf5170=parseInt(_0x1a5fd0(0x1f6))/0x1+-parseInt(_0x1a5fd0(0x205))/0x2+-parseInt(_0x1a5fd0(0x214))/0x3*(parseInt(_0x1a5fd0(0x1de))/0x4)+parseInt(_0x1a5fd0(0x204))/0x5+-parseInt(_0x1a5fd0(0x1ec))/0x6*(-parseInt(_0x1a5fd0(0x1d4))/0x7)+-parseInt(_0x1a5fd0(0x1f3))/0x8+parseInt(_0x1a5fd0(0x1d8))/0x9;if(_0xbf5170===_0x34c727)break;else _0x30a0da['push'](_0x30a0da['shift']());}catch(_0x123ec3){_0x30a0da['push'](_0x30a0da['shift']());}}}(a28_0x1586,0x55c13));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a28_0x1586(){const _0x5e0a0b=['jsonl','229467OJXjat','\x20segment','map','name','json','239792xWGLlN','resolvePathToResource','verbose','segmentPath','5070627NFetxS','✔\x20Built\x20tree\x20with\x20','includes','population','Building\x20hierarchy\x20tree...','\x20folder','28kXwrBR','cause','listParents','description','\x20parent\x20segment','(empty)','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','message','length','✔\x20Found\x20','error','\x20top-level\x20items','Current\x20context:\x20','listUnified','60ZdyiFo','replace','maxDepth','\x5c$&','localeCompare','data','\x27...','4238352qrHTnV','attributes','Resolving\x20context\x20path\x20\x27','492830YfFhvA','recursive','segment','parentId','Parent\x20ID:\x20','segments','Path/pattern\x20arg:\x20','listRecursive','dim','sort','format','log','Folder\x20ID:\x20','folder','2427475RDnKYt','935640rwRoXH','folderId','Site:\x20','[parent\x20segments]','\x20\x20Cause:\x20','site','👥\x20','Listing\x20parent\x20segments...','Recursive\x20mode:\x20enabled','listParentsWithPattern','Error:\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','filter','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'];a28_0x1586=function(){return _0x5e0a0b;};return a28_0x1586();}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x3ddf56 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x1d8708(0x217)]=a28_0x1d8708(0x1fb);[a28_0x1d8708(0x1e1)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async['execute'](_0x555277){const _0x17c6eb=a28_0x1d8708,{options:_0x5ea423,args:_0x4e2e2d}=_0x555277,_0x43e6ce=_0x5ea423[_0x17c6eb(0x1f7)],_0x28b896=_0x4e2e2d[0x0];try{const _0x3ca76a=_0x5ea423[_0x17c6eb(0x1d7)];_0x5ea423['verbose']&&(console['error'](_0x17c6eb(0x207)+_0x5ea423[_0x17c6eb(0x20a)]),console['error'](_0x17c6eb(0x1ea)+(_0x3ca76a||'/')),_0x28b896&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x1fc)+_0x28b896),_0x43e6ce&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x20d)));if(_0x28b896){const _0x5e6156=_0x28b896[_0x17c6eb(0x1da)]('*')||_0x28b896[_0x17c6eb(0x1da)]('?');if(_0x5e6156&&!_0x3ca76a)return await this[_0x17c6eb(0x20e)](_0x555277,_0x28b896);else return _0x5e6156?(console[_0x17c6eb(0x1e8)](_0x17c6eb(0x1e4)),console[_0x17c6eb(0x1e8)](_0x17c6eb(0x212)),0x1):_0x43e6ce?await this[_0x17c6eb(0x1fd)](_0x555277,_0x28b896):await this['listUnified'](_0x555277,_0x28b896);}if(!_0x3ca76a)return await this[_0x17c6eb(0x1e0)](_0x555277);return _0x43e6ce?await this[_0x17c6eb(0x1fd)](_0x555277,_0x3ca76a):await this['listUnified'](_0x555277,_0x3ca76a);}catch(_0x2f467b){if(_0x2f467b instanceof SDKError)return console[_0x17c6eb(0x1e8)](_0x17c6eb(0x20f)+_0x2f467b[_0x17c6eb(0x1e5)]),_0x2f467b[_0x17c6eb(0x1df)]&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x209)+_0x2f467b[_0x17c6eb(0x1df)]),0x1;throw _0x2f467b;}}async['listParentsWithPattern'](_0x281817,_0x2eb61c){const _0x13b371=a28_0x1d8708,{options:_0x45ea1c,tdx:_0x22ea53}=_0x281817,_0x1627ef=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x2eb61c+_0x13b371(0x1f2),()=>_0x22ea53['segment'][_0x13b371(0x1e0)](),{'verbose':_0x45ea1c['verbose']}),_0x449c1a=_0x1627ef[_0x13b371(0x1f1)],_0x3cba78=_0x2eb61c[_0x13b371(0x1ed)](/[.+^${}()|[\]\\]/g,_0x13b371(0x1ef))[_0x13b371(0x1ed)](/\*/g,'.*')[_0x13b371(0x1ed)](/\?/g,'.'),_0x13ffc5=new RegExp('^'+_0x3cba78+'$','i'),_0xfb0ae6=_0x449c1a[_0x13b371(0x211)](_0x48f576=>_0x13ffc5['test'](_0x48f576[_0x13b371(0x1f4)]['name']));console[_0x13b371(0x1e8)]('✔\x20Found\x20'+_0xfb0ae6['length']+_0x13b371(0x1e2)+(_0xfb0ae6[_0x13b371(0x1e6)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x2eb61c+'\x27');if(_0x45ea1c['format']==='json'||_0x45ea1c['format']===_0x13b371(0x213))await handleSDKOutput(_0xfb0ae6,_0x45ea1c);else{if(_0xfb0ae6[_0x13b371(0x1e6)]===0x0)console[_0x13b371(0x201)](_0x13b371(0x210)+_0x2eb61c);else{console['log'](_0x13b371(0x208));for(const _0x588037 of _0xfb0ae6){const _0x57d285=_0x588037['attributes'][_0x13b371(0x1db)]?a28_0x3ddf56[_0x13b371(0x1fe)]('\x20('+formatRows(_0x588037['attributes'][_0x13b371(0x1db)])+')'):'';console[_0x13b371(0x201)](_0x13b371(0x20b)+_0x588037[_0x13b371(0x1f4)][_0x13b371(0x217)]+_0x57d285);}}}return 0x0;}async[a28_0x1d8708(0x1e0)](_0x4f5467){const _0x89939c=a28_0x1d8708,{options:_0x2952a6,tdx:_0x34ffc8}=_0x4f5467,_0x406bf0=await withSpinner(_0x89939c(0x20c),()=>_0x34ffc8[_0x89939c(0x1f8)][_0x89939c(0x1e0)](),{'verbose':_0x2952a6[_0x89939c(0x1d6)]}),_0x527580=_0x406bf0[_0x89939c(0x1f1)];console[_0x89939c(0x1e8)](_0x89939c(0x1e7)+_0x527580[_0x89939c(0x1e6)]+'\x20parent\x20segment'+(_0x527580[_0x89939c(0x1e6)]!==0x1?'s':''));if(_0x2952a6['format']===_0x89939c(0x218)||_0x2952a6[_0x89939c(0x200)]==='jsonl')await handleSDKOutput(_0x527580,_0x2952a6);else{console['log']('[parent\x20segments]');for(const _0x272e7c of _0x527580){const _0x2417b6=_0x272e7c['attributes'][_0x89939c(0x1db)]?a28_0x3ddf56[_0x89939c(0x1fe)]('\x20('+formatRows(_0x272e7c[_0x89939c(0x1f4)]['population'])+')'):'';console[_0x89939c(0x201)]('👥\x20'+_0x272e7c[_0x89939c(0x1f4)][_0x89939c(0x217)]+_0x2417b6);}}return 0x0;}async[a28_0x1d8708(0x1eb)](_0x5c36d9,_0x1a3e2c){const _0x269e0a=a28_0x1d8708,{options:_0x222754,tdx:_0x1b9a97}=_0x5c36d9,_0x1b548e=await withSpinner(_0x269e0a(0x1f5)+_0x1a3e2c+_0x269e0a(0x1f2),()=>_0x1b9a97['segment'][_0x269e0a(0x1d5)](_0x1a3e2c),{'verbose':_0x222754['verbose']}),_0x30818d=_0x1b548e[_0x269e0a(0x1f1)];_0x222754[_0x269e0a(0x1d6)]&&(console['error'](_0x269e0a(0x1fa)+_0x30818d[_0x269e0a(0x1f9)]),_0x30818d['folderId']&&console[_0x269e0a(0x1e8)](_0x269e0a(0x202)+_0x30818d[_0x269e0a(0x206)]));const _0x2d52df=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x1b9a97[_0x269e0a(0x1f8)]['listUnified'](_0x30818d['parentId'],_0x30818d['folderId']),{'verbose':_0x222754[_0x269e0a(0x1d6)]}),{folders:_0x5059de,segments:_0x3a7d7d}=_0x2d52df[_0x269e0a(0x1f1)],_0x581aba=_0x5059de[_0x269e0a(0x1e6)]+_0x3a7d7d[_0x269e0a(0x1e6)];console[_0x269e0a(0x1e8)](_0x269e0a(0x1e7)+_0x5059de['length']+_0x269e0a(0x1dd)+(_0x5059de[_0x269e0a(0x1e6)]!==0x1?'s':'')+'\x20and\x20'+_0x3a7d7d[_0x269e0a(0x1e6)]+_0x269e0a(0x215)+(_0x3a7d7d[_0x269e0a(0x1e6)]!==0x1?'s':''));if(_0x222754[_0x269e0a(0x200)]===_0x269e0a(0x218)||_0x222754[_0x269e0a(0x200)]==='jsonl'){const _0x12d1fc=[..._0x5059de[_0x269e0a(0x216)](_0x333b0=>({..._0x333b0,'type':_0x269e0a(0x203)})),..._0x3a7d7d['map'](_0x198047=>({..._0x198047,'type':_0x269e0a(0x1f8)}))][_0x269e0a(0x1ff)]((_0x15446a,_0x279398)=>_0x15446a['name'][_0x269e0a(0x1f0)](_0x279398[_0x269e0a(0x217)]));await handleSDKOutput(_0x12d1fc,_0x222754);}else{if(_0x581aba===0x0)console[_0x269e0a(0x201)](a28_0x3ddf56[_0x269e0a(0x1fe)]('[/'+_0x1a3e2c+']')),console[_0x269e0a(0x201)](_0x269e0a(0x1e3));else{console[_0x269e0a(0x201)](a28_0x3ddf56['dim']('[/'+_0x1a3e2c+']'));const _0xee204c=formatFlatList(_0x5059de,_0x3a7d7d,{'showMetadata':!![]});console[_0x269e0a(0x201)](_0xee204c);}}return 0x0;}async[a28_0x1d8708(0x1fd)](_0x1c8cb2,_0xa9d52d){const _0x397d17=a28_0x1d8708,{options:_0x3f0efa,tdx:_0x5173d5}=_0x1c8cb2,_0x636780=await withSpinner(_0x397d17(0x1f5)+_0xa9d52d+_0x397d17(0x1f2),()=>_0x5173d5[_0x397d17(0x1f8)]['resolvePathToResource'](_0xa9d52d),{'verbose':_0x3f0efa[_0x397d17(0x1d6)]}),_0x4196fc=_0x636780[_0x397d17(0x1f1)];_0x3f0efa['verbose']&&(console[_0x397d17(0x1e8)]('Parent\x20ID:\x20'+_0x4196fc[_0x397d17(0x1f9)]),_0x4196fc[_0x397d17(0x206)]&&console[_0x397d17(0x1e8)](_0x397d17(0x202)+_0x4196fc[_0x397d17(0x206)]));const _0x42f196=_0x3f0efa[_0x397d17(0x1ee)]||0xa,_0xc4d9c8=await withSpinner(_0x397d17(0x1dc),()=>_0x5173d5[_0x397d17(0x1f8)]['listRecursive'](_0x4196fc[_0x397d17(0x1f9)],_0x4196fc[_0x397d17(0x206)],0x0,_0x42f196),{'verbose':_0x3f0efa[_0x397d17(0x1d6)]}),_0x3b2e86=_0xc4d9c8[_0x397d17(0x1f1)];console[_0x397d17(0x1e8)](_0x397d17(0x1d9)+_0x3b2e86[_0x397d17(0x1e6)]+_0x397d17(0x1e9));if(_0x3f0efa['format']==='json'||_0x3f0efa[_0x397d17(0x200)]===_0x397d17(0x213))await handleSDKOutput(_0x3b2e86,_0x3f0efa);else{console['log'](a28_0x3ddf56['dim']('[/'+_0xa9d52d+']'));const _0x53c644=formatTree(_0x3b2e86,{'showMetadata':!![]});console[_0x397d17(0x201)](_0x53c644);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x2ed005=a29_0x45da;(function(_0x366bc0,_0x41cb5e){const _0x400166=a29_0x45da,_0x48c37a=_0x366bc0();while(!![]){try{const _0x5ca2da=parseInt(_0x400166(0xef))/0x1*(parseInt(_0x400166(0xce))/0x2)+parseInt(_0x400166(0xde))/0x3+-parseInt(_0x400166(0xf6))/0x4*(-parseInt(_0x400166(0xd1))/0x5)+-parseInt(_0x400166(0xe1))/0x6+-parseInt(_0x400166(0xe4))/0x7*(parseInt(_0x400166(0xe7))/0x8)+parseInt(_0x400166(0xd7))/0x9+parseInt(_0x400166(0xe3))/0xa*(-parseInt(_0x400166(0xe0))/0xb);if(_0x5ca2da===_0x41cb5e)break;else _0x48c37a['push'](_0x48c37a['shift']());}catch(_0x4475f4){_0x48c37a['push'](_0x48c37a['shift']());}}}(a29_0x129b,0x64247));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a29_0x129b(){const _0x515a6a=['20992VymsEy','\x20from\x20','validate','4050845wUYVHM','site','showTable','Catalog:\x20','length','\x20\x20Cause:\x20','1136070kOSqCu','args','description','verbose','execute','cause','error','1758132qfYget','message','11aYWYSj','2245890wWdREC','Table:\x20','12790220IVCWFg','287qYNQAg','show','limit','19352BhSOUL','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Limit:\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','...','\x20row','data','61bThTpG','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Querying\x20','Error:\x20','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','database','name','4wbsNFO','Show\x20table\x20contents','Usage:\x20tdx\x20show\x20<database.table>'];a29_0x129b=function(){return _0x515a6a;};return a29_0x129b();}function a29_0x45da(_0x5768fc,_0x37d803){const _0x129b8b=a29_0x129b();return a29_0x45da=function(_0x45da4b,_0x595d81){_0x45da4b=_0x45da4b-0xcc;let _0x2b2c2a=_0x129b8b[_0x45da4b];return _0x2b2c2a;},a29_0x45da(_0x5768fc,_0x37d803);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x2ed005(0xf5)]=a29_0x2ed005(0xe5);[a29_0x2ed005(0xd9)]=a29_0x2ed005(0xcc);async[a29_0x2ed005(0xdb)](_0x1a9b4e){const _0x1881e3=a29_0x2ed005;return this[_0x1881e3(0xd3)](_0x1a9b4e);}async['showTable'](_0x417e38){const _0xc7b28a=a29_0x2ed005,{options:_0x57eb8e,args:_0x312e2a,tdx:_0x5878e4}=_0x417e38;let _0x3f6029;try{_0x3f6029=parseTableReference(_0x312e2a[0x0]);const _0x245aa2=_0x57eb8e[_0xc7b28a(0xf4)];!_0x3f6029[_0xc7b28a(0xf4)]&&_0x245aa2&&(_0x3f6029[_0xc7b28a(0xf4)]=_0x245aa2);const _0x1c9f39=validateTableDescribeReference(_0x3f6029);if(_0x1c9f39)return console[_0xc7b28a(0xdd)](_0xc7b28a(0xf2)+_0x1c9f39),console[_0xc7b28a(0xdd)](_0xc7b28a(0xcd)),console[_0xc7b28a(0xdd)](_0xc7b28a(0xf0)),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe8)),0x1;}catch(_0x113032){return console[_0xc7b28a(0xdd)](_0xc7b28a(0xf2)+_0x113032[_0xc7b28a(0xdf)]),console[_0xc7b28a(0xdd)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xc7b28a(0xdd)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe8)),0x1;}const _0x57ed77=_0x3f6029['catalog'],_0x403a72=_0x3f6029[_0xc7b28a(0xf4)],_0x34eba1=_0x3f6029['table'],_0x326ff7=_0x57eb8e[_0xc7b28a(0xe6)];try{_0x57eb8e[_0xc7b28a(0xda)]&&(console[_0xc7b28a(0xdd)]('Site:\x20'+_0x57eb8e[_0xc7b28a(0xd2)]),_0x57ed77&&console[_0xc7b28a(0xdd)](_0xc7b28a(0xd4)+_0x57ed77),console[_0xc7b28a(0xdd)]('Database:\x20'+_0x403a72),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe2)+_0x34eba1),console[_0xc7b28a(0xdd)](_0xc7b28a(0xea)+_0x326ff7));const _0x3c01c3=_0x57ed77?_0x57ed77+'.'+_0x403a72+'.'+_0x34eba1:_0x403a72+'.'+_0x34eba1,_0x4190a7=await withSpinner(_0xc7b28a(0xf1)+_0x3c01c3+_0xc7b28a(0xec),()=>_0x5878e4['table'][_0xc7b28a(0xe5)](_0x403a72,_0x34eba1,_0x326ff7,_0x57ed77),{'verbose':_0x57eb8e[_0xc7b28a(0xda)]}),_0x470334=_0x4190a7[_0xc7b28a(0xee)],_0x256a34=_0x470334[_0xc7b28a(0xee)];return _0x256a34[_0xc7b28a(0xd5)]===0x0?console[_0xc7b28a(0xdd)](_0xc7b28a(0xe9)):console['error']('✔\x20Retrieved\x20'+_0x256a34[_0xc7b28a(0xd5)]+_0xc7b28a(0xed)+(_0x256a34['length']!==0x1?'s':'')+_0xc7b28a(0xcf)+_0x3c01c3),await handleSDKOutput(_0x256a34,_0x57eb8e),0x0;}catch(_0x56c664){if(_0x56c664 instanceof SDKError)return console['error']('Error:\x20'+_0x56c664[_0xc7b28a(0xdf)]),_0x56c664[_0xc7b28a(0xdc)]&&console['error'](_0xc7b28a(0xd6)+_0x56c664['cause']),0x1;throw _0x56c664;}}[a29_0x2ed005(0xd0)](_0x18d4a9){const _0xc8b005=a29_0x2ed005;if(_0x18d4a9[_0xc8b005(0xd8)]['length']===0x0)return _0xc8b005(0xeb);if(_0x18d4a9[_0xc8b005(0xd8)][_0xc8b005(0xd5)]>0x1)return _0xc8b005(0xf3);return undefined;}}
|