@treasuredata/tdx 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.d.ts +20 -1
- package/dist/client/cdp-api-client.d.ts.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/cdp-api-client.js.map +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.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/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/cdp.d.ts +58 -0
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- 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.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x3023b4=a26_0x1ee6;(function(_0x1b5291,_0x2a7531){const _0x503c1b=a26_0x1ee6,_0xc03e78=_0x1b5291();while(!![]){try{const _0x3c3db0=-parseInt(_0x503c1b(0xe2))/0x1+-parseInt(_0x503c1b(0x117))/0x2*(-parseInt(_0x503c1b(0x115))/0x3)+-parseInt(_0x503c1b(0x14c))/0x4*(parseInt(_0x503c1b(0x190))/0x5)+parseInt(_0x503c1b(0x13a))/0x6*(-parseInt(_0x503c1b(0x12f))/0x7)+parseInt(_0x503c1b(0x124))/0x8*(parseInt(_0x503c1b(0x143))/0x9)+parseInt(_0x503c1b(0xd5))/0xa+-parseInt(_0x503c1b(0x100))/0xb;if(_0x3c3db0===_0x2a7531)break;else _0xc03e78['push'](_0xc03e78['shift']());}catch(_0x2f127a){_0xc03e78['push'](_0xc03e78['shift']());}}}(a26_0x5765,0x5e93b));import{writeFileSync,readFileSync,existsSync,mkdirSync}from'fs';function a26_0x5765(){const _0xeed32b=['cyan','endsWith','repeat','Usage:\x20tdx\x20ps\x20show\x20[name]\x0a','workflowSessionId','joinKey','Database:\x20','\x27\x20is\x20already\x20up\x20to\x20date','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','database','65KbgZWK','segment:parent:fields','segment:parent:pull','segment:parent:sql','.yml','Behaviors','/app/dw/parentSegments/','customerGroup','YAML\x20file:\x20','parentSegment','Listing\x20parent\x20segments...','ignore','displayBehaviorsStats','attribute','segment:parent:desc','error','yellow','segment:parent:validate','Join:','createParent','localeCompare','\x20\x20\x20\x20-\x20','stop','filter','Fetching\x20current\x20configuration\x20for\x20\x27','customersWithEvents','displayMasterInfo','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','Fetching\x20sample\x20data...','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20parent\x20segment\x20\x27','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','parent_segment','all','List\x20available\x20fields\x20for\x20segmentation','pushParentYaml','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Attribute:','win32','site','\x5c$&','Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a','Aborted.','Error:\x20--behavior\x20requires\x20a\x20name\x0a','processedRows','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x0aChanges\x20to\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Site:\x20','\x27...','displaySampleData','Updated','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','verbose','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','SQL\x20query:\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x0aNew\x20parent\x20segment\x20\x27','allValid','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','Show\x20parent\x20segment\x20details','👥\x20','Columns:','start','\x20[Job\x20ID:\x20','session','Create\x20parent\x20segment\x20\x27','unref','/attempt/','FINISHED','To\x20view\x20sample\x20data:','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Parent\x20segment:\x20','attributes','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','Resolving\x20parent\x20segment\x20\x27','\x0a✔\x20Workflow\x20started','Listing\x20fields\x20for\x20\x27','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','Fetching\x20parent\x20segment\x20\x27','resolveParentId','\x20--attribute\x20\x22','timezone','sampleData','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','jsonl','\x20rows\x20','xdg-open','length','information_schema','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','Attributes','text','6735940FXULgr','displayPreviewHints','-1d','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','addAttributes','\x20Configuration\x20is\x20valid','Rows:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','listParents','name','\x20is\x20already\x20up\x20to\x20date','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x27\x20and\x20run\x20workflow?','299905yldboF','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Query\x20completed:\x20Processed\x20','runParent','column','Validate:','\x27\x20is\x20up\x20to\x20date','double','Events:','stats','Created','execute','label','Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a','Error:\x20--database\x20and\x20--table\x20are\x20required','Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a','green','Apply\x20changes\x20to\x20\x27','Pattern:\x20','red','toLocaleString','test','\x20Opening\x20','Source:','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','displayAttributesStats','Table:\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Options:','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','10091191fxwGCl','Overwrite\x20\x27','table','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','dim','population','validateParentYaml','Session:','map','\x20tdx\x20wf\x20attempt\x20','bold','Get\x20SQL\x20query\x20for\x20parent\x20segment','pullParentYaml','jobId','audienceId','matchedCount','scheduleOption','segment:parent:create','Creating\x20parent\x20segment\x20\x27','getParentSQL','columns','2102286jnyPiO','interval','2bwXUSH','Found\x20YAML\x20file:\x20','\x0aNo\x20sample\x20data\x20available','customerPercent','Available\x20attributes:','✔\x20No\x20changes\x20-\x20\x27','toFixed','No\x20parent\x20segments\x20found','Error\x20reading\x20file:\x20','number','dirname','totalEvents','Executing\x20parent\x20segment\x20query...','24eDcEPQ','setJobId','segment:parent:push','Fetching\x20SQL\x20for\x20\x27','data','Preview:','`\x20to\x20download\x20the\x20configuration\x20first','\x20--enriched','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','scheduleType','\x0aUsage:\x20tdx\x20ps\x20preview\x20','1524397QqsEEW','Updating','Errors:','output','Join\x20on:','in\x20','yes','customerGroupFile','behaviors','apply','schemaValid','6nHMXrz','attributesFile','format','string','List\x20parent\x20segments','errors','join','segment:parent:list','Audience\x20ID:','1490202tGErfu','Validating\x20configuration...','varchar','\x20kill','behavior','use','\x27\x20with\x20ID:\x20','sort','enriched','14968mBfgEA','Behavior:','replace','workflowId','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','segment:parent:run','rowCount','segment:parent:view','schemaError','segment:parent:show','tdx\x20segment\x20parent\x20preview\x20','description','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','trim','workflowAttemptId','Analyzing\x20changes...','message','To\x20cancel:','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','log','Error:\x20File\x20not\x20found:\x20','Master\x20Table','/sessions/','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20--behavior\x20\x22','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20No\x20changes\x20-\x20','Error\x20parsing\x20YAML:\x20','displaySummary','addAttributesFile','Error:','displayPreviewResults','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','json','utf-8','Attempt:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','displayColumns','segment','addBehaviors','Error:\x20--attribute\x20requires\x20a\x20name\x0a','coveragePercent','limit','Coverage:','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','master','Error:\x20Parent\x20segment\x20name\x20is\x20required','Options\x20(one\x20required):','Master\x20+\x20Attributes','open','keys','updateParent','foreignKey','status','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20--interval\x20','Enriched:','Listing\x20parent\x20segments\x20matching\x20\x27'];a26_0x5765=function(){return _0xeed32b;};return a26_0x5765();}import{spawn}from'child_process';import a26_0x9e6273 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a26_0x1ee6(_0x5f2a69,_0x2f3f42){const _0x5765a6=a26_0x5765();return a26_0x1ee6=function(_0x1ee6a6,_0x57b90d){_0x1ee6a6=_0x1ee6a6-0x9f;let _0x17000a=_0x5765a6[_0x1ee6a6];return _0x17000a;},a26_0x1ee6(_0x5f2a69,_0x2f3f42);}import a26_0x31cdb1 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a26_0x3023b4(0x1b2);function openBrowser(_0x2e0dfa){const _0x238cc7=a26_0x3023b4,_0x538a02=process['platform'],_0x4c53eb=_0x538a02==='darwin'?_0x238cc7(0x17d):_0x538a02===_0x238cc7(0x1b8)?_0x238cc7(0xb7):_0x238cc7(0xcf);spawn(_0x4c53eb,[_0x2e0dfa],{'detached':!![],'stdio':_0x238cc7(0x19b)})[_0x238cc7(0xbb)]();}function resolveYamlFile(_0x27c1b1){const _0x2359f1=a26_0x3023b4;if(_0x27c1b1[_0x2359f1(0x187)](_0x2359f1(0x194))||_0x27c1b1['endsWith']('.yaml'))return _0x27c1b1;return a26_0x9e6273['join'](PARENT_SEGMENT_DIR,_0x27c1b1+'.yml');}function formatProgressMessage(_0x1346d9){const _0x509f2f=a26_0x3023b4,_0x4c6bb9=_0x1346d9['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4c6bb9){const [,_0x3ea969,_0x3aeee3,_0x55e887='']=_0x4c6bb9;return a26_0x31cdb1['dim'](_0x3ea969+':')+'\x20'+_0x3aeee3+a26_0x31cdb1[_0x509f2f(0x104)](_0x55e887);}return a26_0x31cdb1['dim'](_0x1346d9);}function showFileNotFoundError(_0x275db2,_0x18d005){const _0x2e26fa=a26_0x3023b4;console[_0x2e26fa(0x19f)](a26_0x31cdb1[_0x2e26fa(0xf5)](_0x2e26fa(0x160)+_0x275db2+'\x0a')),console['error'](a26_0x31cdb1[_0x2e26fa(0x186)](_0x2e26fa(0xfa)+_0x18d005+_0x2e26fa(0x12a)));}export class ParentSegmentListCommand extends BaseCommand{[a26_0x3023b4(0xde)]=a26_0x3023b4(0x141);[a26_0x3023b4(0x157)]=a26_0x3023b4(0x13e);async[a26_0x3023b4(0xed)](_0x181b21){const _0x1989b2=a26_0x3023b4,{options:_0x3fec91,args:_0xfa72ad,tdx:_0x151953}=_0x181b21,_0x404eb7=_0xfa72ad[0x0];_0x3fec91[_0x1989b2(0xad)]&&(console[_0x1989b2(0x19f)](_0x1989b2(0xa8)+_0x3fec91[_0x1989b2(0x9f)]),_0x404eb7&&console[_0x1989b2(0x19f)](_0x1989b2(0xf4)+_0x404eb7));const _0x1ce4df=await withSpinner(_0x404eb7?_0x1989b2(0x185)+_0x404eb7+'\x27...':_0x1989b2(0x19a),()=>_0x151953['segment'][_0x1989b2(0xdd)](),{'verbose':_0x3fec91[_0x1989b2(0xad)]});let _0x50a6fc=_0x1ce4df[_0x1989b2(0x128)];if(_0x404eb7){const _0x1a02d5=_0x404eb7[_0x1989b2(0x14e)](/[.+^${}()|[\]\\]/g,_0x1989b2(0xa0))[_0x1989b2(0x14e)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3cfc42=new RegExp('^'+_0x1a02d5+'$','i');_0x50a6fc=_0x50a6fc[_0x1989b2(0x1a7)](_0x4e1269=>_0x3cfc42[_0x1989b2(0xf7)](_0x4e1269[_0x1989b2(0xc1)]['name']));}_0x50a6fc[_0x1989b2(0x14a)]((_0x352888,_0x4e27cb)=>_0x352888['attributes']['name'][_0x1989b2(0x1a4)](_0x4e27cb['attributes'][_0x1989b2(0xde)])),console[_0x1989b2(0x19f)]('✔\x20Found\x20'+_0x50a6fc['length']+'\x20parent\x20segment'+(_0x50a6fc['length']!==0x1?'s':''));if(_0x3fec91[_0x1989b2(0x13c)]===_0x1989b2(0x16d)||_0x3fec91['format']===_0x1989b2(0xcd))await handleSDKOutput(_0x50a6fc,_0x3fec91);else{if(_0x50a6fc[_0x1989b2(0xd0)]===0x0)_0x404eb7?console[_0x1989b2(0x15f)](_0x1989b2(0x182)+_0x404eb7):console['log'](_0x1989b2(0x11e));else for(const _0xa564ce of _0x50a6fc){const _0x46ac14=_0xa564ce[_0x1989b2(0xc1)][_0x1989b2(0x105)]?a26_0x31cdb1[_0x1989b2(0x104)]('\x20('+formatRows(_0xa564ce[_0x1989b2(0xc1)][_0x1989b2(0x105)])+')'):'';console[_0x1989b2(0x15f)](_0x1989b2(0xb5)+_0xa564ce[_0x1989b2(0xc1)][_0x1989b2(0xde)]+_0x46ac14);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a26_0x3023b4(0xde)]=a26_0x3023b4(0x111);['description']='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a26_0x3023b4(0xed)](_0x50def7){const _0x5c65f7=a26_0x3023b4,{options:_0x4034c7,args:_0x224606,tdx:_0x3cc079}=_0x50def7;console[_0x5c65f7(0x19f)](_0x5c65f7(0x170)+_0x5c65f7(0x1af)+_0x5c65f7(0x1ab));const _0x49c823=_0x4034c7;if(_0x224606[_0x5c65f7(0xd0)]===0x0)return console['error'](_0x5c65f7(0x17a)),console['error'](_0x5c65f7(0xac)),0x1;const _0x4f0961=_0x224606[0x0];if(!_0x49c823[_0x5c65f7(0x18f)]||!_0x49c823[_0x5c65f7(0x102)])return console[_0x5c65f7(0x19f)](_0x5c65f7(0xf0)),console[_0x5c65f7(0x19f)](_0x5c65f7(0xac)),0x1;_0x49c823[_0x5c65f7(0xad)]&&(console[_0x5c65f7(0x19f)]('Site:\x20'+_0x49c823[_0x5c65f7(0x9f)]),console[_0x5c65f7(0x19f)]('Name:\x20'+_0x4f0961),console[_0x5c65f7(0x19f)](_0x5c65f7(0x18c)+_0x49c823[_0x5c65f7(0x18f)]),console[_0x5c65f7(0x19f)](_0x5c65f7(0xfc)+_0x49c823[_0x5c65f7(0x102)]));const _0x395e66=await loadJSONFromOptions(_0x49c823[_0x5c65f7(0xc1)],_0x49c823[_0x5c65f7(0x13b)]),_0x221f2b=await loadJSONFromOptions(_0x49c823[_0x5c65f7(0x137)],_0x49c823['behaviorsFile']),_0x22ecb2=await loadJSONFromOptions(_0x49c823[_0x5c65f7(0x197)],_0x49c823[_0x5c65f7(0x136)]),_0x3925e7={'name':_0x4f0961,'description':_0x49c823[_0x5c65f7(0x157)],'scheduleType':_0x49c823[_0x5c65f7(0x12d)],'scheduleOption':_0x49c823[_0x5c65f7(0x110)],'timezone':_0x49c823[_0x5c65f7(0xca)],'master':{'parentDatabaseName':_0x49c823[_0x5c65f7(0x18f)],'parentTableName':_0x49c823['table']},'attributes':_0x395e66,'behaviors':_0x221f2b,'customerGroup':_0x22ecb2},_0x110070=await withSpinner(_0x5c65f7(0x112)+_0x4f0961+_0x5c65f7(0xa9),()=>_0x3cc079[_0x5c65f7(0x172)][_0x5c65f7(0x1a3)](_0x3925e7),{'verbose':_0x4034c7[_0x5c65f7(0xad)]}),_0x330bc2=_0x110070[_0x5c65f7(0x128)];return console[_0x5c65f7(0x19f)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x330bc2[_0x5c65f7(0xde)]+_0x5c65f7(0x149)+_0x330bc2['id']),await handleSDKOutput([_0x330bc2],_0x4034c7),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a26_0x3023b4(0xde)]='segment:parent:update';[a26_0x3023b4(0x157)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a26_0x3023b4(0xed)](_0x254623){const _0x54656f=a26_0x3023b4,{options:_0x41a457,args:_0x32083f,tdx:_0x15d727}=_0x254623;console[_0x54656f(0x19f)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x54656f(0x1af)+_0x54656f(0x1ab));const _0x33a86e=_0x41a457;if(_0x32083f['length']===0x0)return console[_0x54656f(0x19f)](_0x54656f(0x17a)),console['error'](_0x54656f(0x1ac)),0x1;const _0x4432d1=_0x32083f[0x0];_0x33a86e['verbose']&&(console[_0x54656f(0x19f)](_0x54656f(0xa8)+_0x33a86e['site']),console[_0x54656f(0x19f)](_0x54656f(0xc0)+_0x4432d1));const _0x2ebac8=await withSpinner(_0x54656f(0x1a8)+_0x4432d1+'\x27...',()=>_0x15d727[_0x54656f(0x172)]['getParentFull'](_0x4432d1),{'verbose':_0x33a86e[_0x54656f(0xad)]}),_0x5cf4a0=_0x2ebac8['data'],_0x1470d3=await loadJSONFromOptions(_0x33a86e[_0x54656f(0xd9)],_0x33a86e[_0x54656f(0x169)]),_0x59b213=await loadJSONFromOptions(_0x33a86e[_0x54656f(0x173)],_0x33a86e['addBehaviorsFile']),_0x3cced8={'name':_0x5cf4a0[_0x54656f(0xde)],'description':_0x33a86e[_0x54656f(0x157)]!==undefined?_0x33a86e[_0x54656f(0x157)]:_0x5cf4a0[_0x54656f(0x157)],'scheduleType':_0x33a86e['scheduleType']!==undefined?_0x33a86e[_0x54656f(0x12d)]:_0x5cf4a0[_0x54656f(0x12d)],'scheduleOption':_0x33a86e[_0x54656f(0x110)]!==undefined?_0x33a86e[_0x54656f(0x110)]:_0x5cf4a0['scheduleOption'],'timezone':_0x33a86e[_0x54656f(0xca)]!==undefined?_0x33a86e[_0x54656f(0xca)]:_0x5cf4a0[_0x54656f(0xca)],'master':_0x5cf4a0['master'],'attributes':_0x1470d3?[..._0x5cf4a0['attributes']||[],..._0x1470d3]:_0x5cf4a0['attributes'],'behaviors':_0x59b213?[..._0x5cf4a0[_0x54656f(0x137)]||[],..._0x59b213]:_0x5cf4a0[_0x54656f(0x137)],'customerGroup':_0x5cf4a0[_0x54656f(0x197)]},_0xa603f5=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x4432d1+_0x54656f(0xa9),()=>_0x15d727[_0x54656f(0x172)][_0x54656f(0x17f)](_0x4432d1,_0x3cced8),{'verbose':_0x33a86e[_0x54656f(0xad)]}),_0x48d671=_0xa603f5['data'];return console['error']('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x48d671[_0x54656f(0xde)]+'\x27'),await handleSDKOutput([_0x48d671],_0x33a86e),0x0;}}export class ParentSegmentPullCommand extends BaseCommand{[a26_0x3023b4(0xde)]=a26_0x3023b4(0x192);[a26_0x3023b4(0x157)]=a26_0x3023b4(0xfd);async['execute'](_0x4a5ce2){const _0xd8812f=a26_0x3023b4,{options:_0x3adeef,args:_0x2bf5d9,tdx:_0x178f7e}=_0x4a5ce2,_0x35a1b7=_0x3adeef,_0x19a8ca=_0x2bf5d9[0x0]||_0x3adeef[_0xd8812f(0x199)];if(!_0x19a8ca)return console[_0xd8812f(0x19f)](a26_0x31cdb1[_0xd8812f(0xf5)](_0xd8812f(0x18e))),console[_0xd8812f(0x19f)](_0xd8812f(0x1ad)),console[_0xd8812f(0x19f)](a26_0x31cdb1[_0xd8812f(0x186)](_0xd8812f(0xd8))),0x1;if(_0x35a1b7[_0xd8812f(0x148)]&&_0x35a1b7[_0xd8812f(0x132)])return console[_0xd8812f(0x19f)](a26_0x31cdb1[_0xd8812f(0xf5)](_0xd8812f(0x1b1))),console[_0xd8812f(0x19f)](a26_0x31cdb1[_0xd8812f(0x104)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0xd8812f(0x19f)](a26_0x31cdb1[_0xd8812f(0x104)]('using\x20the\x20default\x20path:\x20parent_segment/{name}.yml\x0a')),console[_0xd8812f(0x19f)](a26_0x31cdb1[_0xd8812f(0x186)](_0xd8812f(0x1b6))),0x1;const _0x431556=_0x35a1b7[_0xd8812f(0x132)]||a26_0x9e6273[_0xd8812f(0x140)](PARENT_SEGMENT_DIR,_0x19a8ca+_0xd8812f(0x194));_0x35a1b7[_0xd8812f(0xad)]&&(console[_0xd8812f(0x19f)](_0xd8812f(0xa8)+_0x35a1b7[_0xd8812f(0x9f)]),console[_0xd8812f(0x19f)](_0xd8812f(0xc0)+_0x19a8ca),console[_0xd8812f(0x19f)]('Output\x20file:\x20'+_0x431556));const _0x5334f5=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x19a8ca+_0xd8812f(0xa9),()=>_0x178f7e['segment'][_0xd8812f(0x10c)](_0x19a8ca),{'verbose':_0x35a1b7[_0xd8812f(0xad)]}),_0x2e6caf=_0x5334f5[_0xd8812f(0x128)];if(existsSync(_0x431556)){const _0x41723f=readFileSync(_0x431556,_0xd8812f(0x16e)),_0xf76f7=generateDiff(_0x41723f,_0x2e6caf);if(!hasChanges(_0xf76f7))console[_0xd8812f(0x19f)](a26_0x31cdb1['green']('✔')+_0xd8812f(0x166)+a26_0x31cdb1[_0xd8812f(0x186)](_0x431556)+_0xd8812f(0xdf));else{console[_0xd8812f(0x19f)](_0xd8812f(0xa6)+_0x431556+'\x27:'),console[_0xd8812f(0x19f)]('─'[_0xd8812f(0x188)](0x3c)),console['error'](formatDiffWithColors(_0xf76f7)),console['error']('─'[_0xd8812f(0x188)](0x3c));if(!_0x35a1b7['yes']){const _0x535ba2=await confirmKey(_0xd8812f(0x101)+_0x431556+'\x27?');if(!_0x535ba2)return console[_0xd8812f(0x19f)](_0xd8812f(0xa2)),0x1;}writeFileSync(_0x431556,_0x2e6caf,_0xd8812f(0x16e)),console[_0xd8812f(0x19f)](a26_0x31cdb1[_0xd8812f(0xf2)]('✔')+_0xd8812f(0x163)+a26_0x31cdb1[_0xd8812f(0x186)](_0x431556));}}else{const _0x9c23d2=a26_0x9e6273[_0xd8812f(0x121)](_0x431556);!existsSync(_0x9c23d2)&&mkdirSync(_0x9c23d2,{'recursive':!![]}),writeFileSync(_0x431556,_0x2e6caf,_0xd8812f(0x16e)),console[_0xd8812f(0x19f)](a26_0x31cdb1['green']('✔')+_0xd8812f(0x163)+a26_0x31cdb1[_0xd8812f(0x186)](_0x431556));}return _0x35a1b7[_0xd8812f(0x148)]&&(saveSessionContext({'parent_segment':_0x19a8ca},_0x35a1b7[_0xd8812f(0xb9)]),console['error'](a26_0x31cdb1[_0xd8812f(0xf2)]('✔')+'\x20Context\x20set:\x20'+a26_0x31cdb1[_0xd8812f(0x104)](_0xd8812f(0x1b2))+'\x20=\x20'+a26_0x31cdb1[_0xd8812f(0x186)](_0x19a8ca))),0x0;}}export class ParentSegmentPushCommand extends BaseCommand{[a26_0x3023b4(0xde)]=a26_0x3023b4(0x126);['description']=a26_0x3023b4(0xcc);async['execute'](_0x3d874d){const _0x2e600f=a26_0x3023b4,{options:_0x5f22c9,args:_0x43e020,tdx:_0x4112f1}=_0x3d874d,_0x32003a=_0x5f22c9,_0x103396=_0x43e020[0x0]||_0x5f22c9[_0x2e600f(0x199)];if(!_0x103396)return console[_0x2e600f(0x19f)](a26_0x31cdb1[_0x2e600f(0xf5)](_0x2e600f(0x18e))),console[_0x2e600f(0x19f)](_0x2e600f(0xa1)),console[_0x2e600f(0x19f)](a26_0x31cdb1[_0x2e600f(0x186)](_0x2e600f(0xb3))),0x1;const _0x5a4b4a=resolveYamlFile(_0x103396);if(!existsSync(_0x5a4b4a))return showFileNotFoundError(_0x5a4b4a,_0x103396),0x1;_0x32003a[_0x2e600f(0xad)]&&(console['error'](_0x2e600f(0xa8)+_0x32003a['site']),console[_0x2e600f(0x19f)](_0x2e600f(0x198)+_0x5a4b4a));let _0x3f450c;try{_0x3f450c=readFileSync(_0x5a4b4a,_0x2e600f(0x16e));}catch(_0x365759){const _0x55f194=_0x365759 instanceof Error?_0x365759[_0x2e600f(0x15c)]:String(_0x365759);return console[_0x2e600f(0x19f)]('Error\x20reading\x20file:\x20'+_0x55f194),0x1;}const _0x5becb5=await withSpinner(_0x2e600f(0x15b),()=>_0x4112f1[_0x2e600f(0x172)][_0x2e600f(0x1b5)](_0x3f450c),{'verbose':_0x32003a['verbose']}),_0x549d26=_0x5becb5[_0x2e600f(0x128)],{isNew:_0x627eea,name:_0x2ace09,hasChanges:_0x1f6e12,diffFormatted:_0x432c2f}=_0x549d26;if(!_0x1f6e12)return console[_0x2e600f(0x19f)](_0x2e600f(0x11c)+_0x2ace09+_0x2e600f(0x18d)),0x0;_0x627eea?console[_0x2e600f(0x19f)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x2ace09+'\x27:'):console[_0x2e600f(0x19f)](_0x2e600f(0xb0)+_0x2ace09+'\x27:');console['error']('─'['repeat'](0x3c)),console[_0x2e600f(0x19f)](_0x432c2f),console[_0x2e600f(0x19f)]('─'[_0x2e600f(0x188)](0x3c));const _0x189f04=_0x627eea?_0x2e600f(0xba)+_0x2ace09+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2ace09+'\x27?';if(!_0x32003a[_0x2e600f(0x135)]){const _0x535148=await confirmKey(_0x189f04);if(!_0x535148)return console[_0x2e600f(0x19f)](_0x2e600f(0xa2)),0x1;}const _0x28fc51=_0x627eea?'Creating':_0x2e600f(0x130),_0x25c44b=await withSpinner(_0x28fc51+_0x2e600f(0x1b0)+_0x2ace09+_0x2e600f(0xa9),()=>_0x549d26[_0x2e600f(0x138)](),{'verbose':_0x32003a[_0x2e600f(0xad)]}),_0x22ea5b=_0x25c44b[_0x2e600f(0x128)],_0x3edb40=getConsoleNextUrl(_0x32003a['site'],_0x2e600f(0x196)+_0x22ea5b['id']),_0x48adc3=_0x627eea?_0x2e600f(0xec):_0x2e600f(0xab);return console[_0x2e600f(0x19f)]('✔\x20'+_0x48adc3+_0x2e600f(0x1b0)+_0x22ea5b['name']+'\x27'),console[_0x2e600f(0x19f)]('\x20\x20'+_0x3edb40),0x0;}}export class ParentSegmentValidateCommand extends BaseCommand{[a26_0x3023b4(0xde)]=a26_0x3023b4(0x1a1);[a26_0x3023b4(0x157)]=a26_0x3023b4(0xff);async[a26_0x3023b4(0xed)](_0x5c8968){const _0x3d29cf=a26_0x3023b4,{options:_0x190c98,args:_0x57688d,tdx:_0x269cb6}=_0x5c8968,_0x943ddc=_0x190c98,_0x2ce3e2=_0x57688d[0x0]||_0x190c98[_0x3d29cf(0x199)];if(!_0x2ce3e2)return console[_0x3d29cf(0x19f)](a26_0x31cdb1[_0x3d29cf(0xf5)](_0x3d29cf(0x18e))),console[_0x3d29cf(0x19f)]('Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a'),console['error'](_0x3d29cf(0xfe)),console['error'](_0x3d29cf(0xd2)),console[_0x3d29cf(0x19f)]('\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)'),console[_0x3d29cf(0x19f)](_0x3d29cf(0xae)),console['error'](a26_0x31cdb1[_0x3d29cf(0x186)](_0x3d29cf(0x150))),0x1;const _0x401fe6=resolveYamlFile(_0x2ce3e2);if(!existsSync(_0x401fe6))return showFileNotFoundError(_0x401fe6,_0x2ce3e2),0x1;_0x943ddc[_0x3d29cf(0xad)]&&(console['error']('Site:\x20'+_0x943ddc[_0x3d29cf(0x9f)]),console[_0x3d29cf(0x19f)]('YAML\x20file:\x20'+_0x401fe6));let _0x79226c;try{_0x79226c=readFileSync(_0x401fe6,_0x3d29cf(0x16e));}catch(_0x87c89b){const _0x4729e1=_0x87c89b instanceof Error?_0x87c89b[_0x3d29cf(0x15c)]:String(_0x87c89b);return console[_0x3d29cf(0x19f)]('Error\x20reading\x20file:\x20'+_0x4729e1),0x1;}const _0xb94fd8=createCommandSpinner(a26_0x31cdb1['dim'](_0x3d29cf(0x144)),{'verbose':_0x943ddc['verbose']});_0xb94fd8[_0x3d29cf(0xb7)]();const _0xdf436d={'onProgress':_0x2dbd8e=>{_0xb94fd8['text']=formatProgressMessage(_0x2dbd8e);}};if(_0x943ddc[_0x3d29cf(0x179)])_0xdf436d[_0x3d29cf(0x179)]=!![];if(_0x943ddc[_0x3d29cf(0x14b)])_0xdf436d[_0x3d29cf(0x14b)]=!![];_0x943ddc['attribute']&&(_0xdf436d[_0x3d29cf(0x19d)]=_0x943ddc[_0x3d29cf(0x19d)]);_0x943ddc['behavior']&&(_0xdf436d['behavior']=_0x943ddc[_0x3d29cf(0x147)]);if(_0x943ddc[_0x3d29cf(0x116)])_0xdf436d[_0x3d29cf(0x116)]=_0x943ddc[_0x3d29cf(0x116)];let _0x55714b;try{_0x55714b=await _0x269cb6[_0x3d29cf(0x172)][_0x3d29cf(0x106)](_0x79226c,_0xdf436d),_0xb94fd8[_0x3d29cf(0x1a6)]();}catch(_0x655739){_0xb94fd8[_0x3d29cf(0x1a6)]();throw _0x655739;}const _0x5a79=_0x943ddc[_0x3d29cf(0x116)]||_0x3d29cf(0xd7);return this['displayValidateResults'](_0x55714b,_0xdf436d,_0x401fe6,_0x5a79),_0x55714b[_0x3d29cf(0xb2)]?0x0:0x1;}['displayValidateResults'](_0x3a4d0b,_0xc974e5,_0xafa7a6,_0xaad3a7){const _0x3c894a=a26_0x3023b4;console[_0x3c894a(0x19f)]('\x0a'+a26_0x31cdb1[_0x3c894a(0x10a)](_0x3c894a(0xe7))+'\x20'+_0x3a4d0b[_0x3c894a(0xde)]),console['error']('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x3a4d0b);if(typeof _0xc974e5[_0x3c894a(0x19d)]===_0x3c894a(0x13d)){this[_0x3c894a(0xfb)](_0x3a4d0b),this[_0x3c894a(0x168)](_0x3a4d0b),this[_0x3c894a(0xd6)](_0xafa7a6,_0xaad3a7,'attribute',_0xc974e5[_0x3c894a(0x19d)]);return;}if(_0xc974e5['attribute']===!![]){this['displayAttributesStats'](_0x3a4d0b),this[_0x3c894a(0x168)](_0x3a4d0b),this[_0x3c894a(0xd6)](_0xafa7a6,_0xaad3a7,_0x3c894a(0xc1));return;}if(typeof _0xc974e5[_0x3c894a(0x147)]===_0x3c894a(0x13d)){this[_0x3c894a(0x19c)](_0x3a4d0b,_0xaad3a7),this['displaySummary'](_0x3a4d0b),this['displayPreviewHints'](_0xafa7a6,_0xaad3a7,_0x3c894a(0x147),_0xc974e5[_0x3c894a(0x147)]);return;}if(_0xc974e5[_0x3c894a(0x147)]===!![]){this['displayBehaviorsStats'](_0x3a4d0b,_0xaad3a7),this['displaySummary'](_0x3a4d0b),this['displayPreviewHints'](_0xafa7a6,_0xaad3a7,_0x3c894a(0x137));return;}this['displayAttributesStats'](_0x3a4d0b),this[_0x3c894a(0x19c)](_0x3a4d0b,_0xaad3a7),this[_0x3c894a(0x168)](_0x3a4d0b),this[_0x3c894a(0xd6)](_0xafa7a6,_0xaad3a7,_0x3c894a(0x1b3));}['displayPreviewHints'](_0x2c50d0,_0x1acfdf,_0x435d42,_0xc3db46){const _0x11e87c=a26_0x3023b4;console[_0x11e87c(0x19f)]('\x0a'+a26_0x31cdb1[_0x11e87c(0x104)](_0x11e87c(0xbe)));const _0x3e9cac=_0x1acfdf!==_0x11e87c(0xd7)?_0x11e87c(0x183)+_0x1acfdf:'';if(_0x435d42===_0x11e87c(0x19d)&&_0xc3db46)console[_0x11e87c(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x11e87c(0x104)](_0x11e87c(0x156)+_0x2c50d0+'\x20--attribute\x20\x22'+_0xc3db46+'\x22'+_0x3e9cac));else{if(_0x435d42==='behavior'&&_0xc3db46)console[_0x11e87c(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x11e87c(0x104)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2c50d0+'\x20--behavior\x20\x22'+_0xc3db46+'\x22'+_0x3e9cac));else(_0x435d42===_0x11e87c(0xc1)||_0x435d42===_0x11e87c(0x1b3))&&console[_0x11e87c(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x11e87c(0x104)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2c50d0+'\x20--attribute\x20\x22<name>\x22'+_0x3e9cac));}(_0x435d42==='behaviors'||_0x435d42===_0x11e87c(0x1b3))&&console[_0x11e87c(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x11e87c(0x104)](_0x11e87c(0x156)+_0x2c50d0+'\x20--behavior\x20\x22<name>\x22'+_0x3e9cac)),_0x435d42===_0x11e87c(0x1b3)&&console['error']('\x20\x20'+a26_0x31cdb1[_0x11e87c(0x104)](_0x11e87c(0x156)+_0x2c50d0+_0x11e87c(0x12b)+_0x3e9cac));}[a26_0x3023b4(0x1aa)](_0x2a69bf){const _0x317cdd=a26_0x3023b4,{master:_0x59880a}=_0x2a69bf,_0x17dbe8=_0x59880a[_0x317cdd(0x139)]?a26_0x31cdb1[_0x317cdd(0xf2)]('✔'):a26_0x31cdb1[_0x317cdd(0xf5)]('✘');console[_0x317cdd(0x19f)]('\x0a'+a26_0x31cdb1[_0x317cdd(0x104)](_0x317cdd(0x161))),console[_0x317cdd(0x19f)](_0x17dbe8+'\x20'+a26_0x31cdb1[_0x317cdd(0x10a)](_0x59880a[_0x317cdd(0x18f)]+'.'+_0x59880a['table'])),_0x59880a[_0x317cdd(0x139)]?_0x59880a[_0x317cdd(0x152)]!==undefined&&console[_0x317cdd(0x19f)]('\x20\x20'+a26_0x31cdb1['dim'](_0x317cdd(0xdb))+'\x20'+a26_0x31cdb1[_0x317cdd(0x186)](formatRows(_0x59880a['rowCount']))):console[_0x317cdd(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x317cdd(0xf5)](_0x317cdd(0x16a))+'\x20'+_0x59880a[_0x317cdd(0x154)]);}[a26_0x3023b4(0xfb)](_0x64dce2){const _0x2d78ef=a26_0x3023b4;if(_0x64dce2[_0x2d78ef(0xc1)][_0x2d78ef(0xd0)]===0x0)return;console[_0x2d78ef(0x19f)]('\x0a'+a26_0x31cdb1['dim'](_0x2d78ef(0xd3)));for(const _0x4367ff of _0x64dce2[_0x2d78ef(0xc1)]){const _0x3f37d0=_0x4367ff[_0x2d78ef(0x139)]?a26_0x31cdb1[_0x2d78ef(0xf2)]('✔'):a26_0x31cdb1[_0x2d78ef(0xf5)]('✘');let _0x341dee='';if(_0x4367ff[_0x2d78ef(0x139)]&&_0x4367ff[_0x2d78ef(0x10f)]!==undefined&&_0x4367ff[_0x2d78ef(0x175)]!==undefined){const _0xcda2fe=_0x4367ff['coveragePercent'][_0x2d78ef(0x11d)](0x1),_0x2e1f5c=_0x4367ff[_0x2d78ef(0x175)]>=0x50?a26_0x31cdb1['green']:_0x4367ff['coveragePercent']>=0x32?a26_0x31cdb1[_0x2d78ef(0x1a0)]:a26_0x31cdb1[_0x2d78ef(0xf5)];_0x341dee='\x20'+a26_0x31cdb1['dim'](_0x2d78ef(0x177))+'\x20'+_0x2e1f5c(_0xcda2fe+'%')+'\x20('+formatRows(_0x4367ff[_0x2d78ef(0x10f)])+'\x20rows)';}console[_0x2d78ef(0x19f)](_0x3f37d0+'\x20'+a26_0x31cdb1['bold'](_0x4367ff[_0x2d78ef(0xde)])+_0x341dee),console[_0x2d78ef(0x19f)]('\x20\x20'+a26_0x31cdb1['dim']('Source:')+'\x20'+a26_0x31cdb1[_0x2d78ef(0x10a)](_0x4367ff[_0x2d78ef(0x18f)]+'.'+_0x4367ff[_0x2d78ef(0x102)]));const _0x3ca91a=_0x4367ff[_0x2d78ef(0x18b)]===_0x4367ff[_0x2d78ef(0x180)]?a26_0x31cdb1[_0x2d78ef(0x104)](_0x2d78ef(0x133))+'\x20'+_0x4367ff[_0x2d78ef(0x18b)]:a26_0x31cdb1[_0x2d78ef(0x104)](_0x2d78ef(0x1a2))+'\x20'+_0x4367ff[_0x2d78ef(0x18b)]+'\x20=\x20'+_0x4367ff['foreignKey'];console['error']('\x20\x20'+_0x3ca91a),console[_0x2d78ef(0x19f)]('\x20\x20'+a26_0x31cdb1['dim']('Columns:')),this['displayColumns'](_0x4367ff[_0x2d78ef(0x114)]),!_0x4367ff[_0x2d78ef(0x139)]&&console[_0x2d78ef(0x19f)]('\x20\x20'+a26_0x31cdb1['red'](_0x2d78ef(0x16a))+'\x20'+_0x4367ff[_0x2d78ef(0x154)]);}}[a26_0x3023b4(0x19c)](_0xf50bb,_0x2be0ab){const _0x47bb08=a26_0x3023b4;if(_0xf50bb[_0x47bb08(0x137)]['length']===0x0)return;console[_0x47bb08(0x19f)]('\x0a'+a26_0x31cdb1[_0x47bb08(0x104)](_0x47bb08(0x195))+'\x20'+a26_0x31cdb1[_0x47bb08(0x104)]('('+_0x2be0ab+')'));for(const _0x3021d3 of _0xf50bb[_0x47bb08(0x137)]){const _0xb5c9ff=_0x3021d3[_0x47bb08(0x139)]?a26_0x31cdb1[_0x47bb08(0xf2)]('✔'):a26_0x31cdb1['red']('✘');let _0x59efdd='';if(_0x3021d3[_0x47bb08(0x139)]&&_0x3021d3[_0x47bb08(0x1a9)]!==undefined&&_0x3021d3[_0x47bb08(0x122)]!==undefined){const _0x4a5c5d=_0x3021d3[_0x47bb08(0x11a)]?.[_0x47bb08(0x11d)](0x1)||'?',_0x2b56be=(_0x3021d3[_0x47bb08(0x11a)]??0x0)>=0x32?a26_0x31cdb1[_0x47bb08(0xf2)]:(_0x3021d3[_0x47bb08(0x11a)]??0x0)>=0x14?a26_0x31cdb1[_0x47bb08(0x1a0)]:a26_0x31cdb1[_0x47bb08(0xf5)];_0x59efdd='\x20'+a26_0x31cdb1[_0x47bb08(0x104)]('Customers:')+'\x20'+_0x2b56be(formatRows(_0x3021d3[_0x47bb08(0x1a9)]))+'\x20('+_0x4a5c5d+'%)\x20'+a26_0x31cdb1[_0x47bb08(0x104)](_0x47bb08(0xea))+'\x20'+a26_0x31cdb1[_0x47bb08(0x186)](formatRows(_0x3021d3[_0x47bb08(0x122)]));}console[_0x47bb08(0x19f)](_0xb5c9ff+'\x20'+a26_0x31cdb1['bold'](_0x3021d3['name'])+_0x59efdd),console[_0x47bb08(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x47bb08(0x104)](_0x47bb08(0xf9))+'\x20'+a26_0x31cdb1[_0x47bb08(0x10a)](_0x3021d3[_0x47bb08(0x18f)]+'.'+_0x3021d3['table']));const _0x328c06=_0x3021d3[_0x47bb08(0x18b)]===_0x3021d3[_0x47bb08(0x180)]?a26_0x31cdb1[_0x47bb08(0x104)](_0x47bb08(0x133))+'\x20'+_0x3021d3[_0x47bb08(0x18b)]:a26_0x31cdb1[_0x47bb08(0x104)]('Join:')+'\x20'+_0x3021d3[_0x47bb08(0x18b)]+'\x20=\x20'+_0x3021d3[_0x47bb08(0x180)];console['error']('\x20\x20'+_0x328c06),console[_0x47bb08(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x47bb08(0x104)](_0x47bb08(0xb6))),this[_0x47bb08(0x171)](_0x3021d3['columns']),!_0x3021d3['schemaValid']&&console['error']('\x20\x20'+a26_0x31cdb1['red'](_0x47bb08(0x16a))+'\x20'+_0x3021d3['schemaError']);}}[a26_0x3023b4(0x171)](_0x2fe3ca){const _0x4f8125=a26_0x3023b4;for(const _0x1b5996 of _0x2fe3ca){_0x1b5996[_0x4f8125(0xee)]===_0x1b5996['column']||_0x1b5996['column']==='*'?console[_0x4f8125(0x19f)](_0x4f8125(0x1a5)+_0x1b5996[_0x4f8125(0xee)]):console[_0x4f8125(0x19f)]('\x20\x20\x20\x20-\x20'+_0x1b5996[_0x4f8125(0xee)]+'\x20'+a26_0x31cdb1[_0x4f8125(0x104)]('('+_0x1b5996[_0x4f8125(0xe6)]+')'));}}[a26_0x3023b4(0x168)](_0x385148){const _0x8433c5=a26_0x3023b4;console['error']('─'[_0x8433c5(0x188)](0x3c));if(_0x385148[_0x8433c5(0x13f)]['length']>0x0){console[_0x8433c5(0x19f)]('\x0a'+a26_0x31cdb1[_0x8433c5(0xf5)]('Errors:'));for(const _0x5924ae of _0x385148[_0x8433c5(0x13f)]){console[_0x8433c5(0x19f)]('\x20\x20'+a26_0x31cdb1['red']('•')+'\x20'+_0x5924ae);}}_0x385148[_0x8433c5(0xb2)]&&console['error']('\x0a'+a26_0x31cdb1[_0x8433c5(0xf2)]('✔')+_0x8433c5(0xda));}}export class ParentSegmentPreviewCommand extends BaseCommand{[a26_0x3023b4(0xde)]='segment:parent:preview';[a26_0x3023b4(0x157)]=a26_0x3023b4(0x16c);async[a26_0x3023b4(0xed)](_0x25c37b){const _0x25f1b8=a26_0x3023b4,{options:_0x29b8d6,args:_0x5142a5,tdx:_0x4e7861}=_0x25c37b,_0x4943d8=_0x29b8d6,_0x51800d=_0x5142a5[0x0]||_0x29b8d6[_0x25f1b8(0x199)];if(!_0x51800d)return console[_0x25f1b8(0x19f)](a26_0x31cdb1[_0x25f1b8(0xf5)](_0x25f1b8(0x18e))),console[_0x25f1b8(0x19f)](_0x25f1b8(0x103)),console[_0x25f1b8(0x19f)](_0x25f1b8(0x17b)),console['error'](_0x25f1b8(0xdc)),console[_0x25f1b8(0x19f)](_0x25f1b8(0x12c)),console[_0x25f1b8(0x19f)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error'](_0x25f1b8(0x15e)),console[_0x25f1b8(0x19f)]('\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),console['error'](a26_0x31cdb1[_0x25f1b8(0x186)](_0x25f1b8(0x150))),0x1;if(!_0x4943d8[_0x25f1b8(0x179)]&&!_0x4943d8[_0x25f1b8(0x19d)]&&!_0x4943d8['behavior']&&!_0x4943d8['enriched'])return console[_0x25f1b8(0x19f)](a26_0x31cdb1[_0x25f1b8(0xf5)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error'](_0x25f1b8(0x103)),console[_0x25f1b8(0x19f)](_0x25f1b8(0xfe)),console['error'](_0x25f1b8(0xdc)),console[_0x25f1b8(0x19f)](_0x25f1b8(0x12c)),console[_0x25f1b8(0x19f)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x25f1b8(0x19f)](_0x25f1b8(0x15e)),0x1;const _0x31f142=resolveYamlFile(_0x51800d);if(!existsSync(_0x31f142))return showFileNotFoundError(_0x31f142,_0x51800d),0x1;_0x4943d8[_0x25f1b8(0xad)]&&(console[_0x25f1b8(0x19f)](_0x25f1b8(0xa8)+_0x4943d8[_0x25f1b8(0x9f)]),console['error'](_0x25f1b8(0x198)+_0x31f142));let _0x2d0572;try{_0x2d0572=readFileSync(_0x31f142,_0x25f1b8(0x16e));}catch(_0x312c3a){const _0x322f9c=_0x312c3a instanceof Error?_0x312c3a[_0x25f1b8(0x15c)]:String(_0x312c3a);return console[_0x25f1b8(0x19f)](_0x25f1b8(0x11f)+_0x322f9c),0x1;}let _0x1e8abc;try{_0x1e8abc=parseYamlString(_0x2d0572);}catch(_0xe4f04){const _0x376e03=_0xe4f04 instanceof Error?_0xe4f04[_0x25f1b8(0x15c)]:String(_0xe4f04);return console[_0x25f1b8(0x19f)](a26_0x31cdb1[_0x25f1b8(0xf5)](_0x25f1b8(0x167)+_0x376e03)),0x1;}if(_0x4943d8[_0x25f1b8(0x19d)]===!![]||_0x4943d8[_0x25f1b8(0x19d)]===''){const _0x302c22=_0x1e8abc[_0x25f1b8(0xc1)]?.[_0x25f1b8(0x108)](_0x245694=>_0x245694[_0x25f1b8(0xde)])||[];if(_0x302c22['length']===0x0)console[_0x25f1b8(0x19f)](a26_0x31cdb1[_0x25f1b8(0xf5)](_0x25f1b8(0xbf)));else{console[_0x25f1b8(0x19f)](a26_0x31cdb1[_0x25f1b8(0xf5)](_0x25f1b8(0x174))),console[_0x25f1b8(0x19f)](_0x25f1b8(0x11b));for(const _0xed6bc6 of _0x302c22){console[_0x25f1b8(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x25f1b8(0x186)](_0xed6bc6));}console[_0x25f1b8(0x19f)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x51800d+_0x25f1b8(0xc9)+_0x302c22[0x0]+'\x22');}return 0x1;}if(_0x4943d8['behavior']===!![]||_0x4943d8[_0x25f1b8(0x147)]===''){const _0x37ad49=_0x1e8abc[_0x25f1b8(0x137)]?.[_0x25f1b8(0x108)](_0x1c5e44=>_0x1c5e44['name'])||[];if(_0x37ad49[_0x25f1b8(0xd0)]===0x0)console[_0x25f1b8(0x19f)](a26_0x31cdb1['red']('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x25f1b8(0x19f)](a26_0x31cdb1[_0x25f1b8(0xf5)](_0x25f1b8(0xa3))),console[_0x25f1b8(0x19f)]('Available\x20behaviors:');for(const _0x4a1419 of _0x37ad49){console['error']('\x20\x20'+a26_0x31cdb1['cyan'](_0x4a1419));}console['error'](_0x25f1b8(0x12e)+_0x51800d+_0x25f1b8(0x164)+_0x37ad49[0x0]+'\x22');}return 0x1;}const _0x1e2c3e=createCommandSpinner(a26_0x31cdb1['dim'](_0x25f1b8(0x1ae)),{'verbose':_0x4943d8[_0x25f1b8(0xad)]});_0x1e2c3e[_0x25f1b8(0xb7)]();const _0x56f0f9={'onProgress':_0x7939c4=>{const _0x388d73=_0x25f1b8;_0x1e2c3e[_0x388d73(0xd4)]=formatProgressMessage(_0x7939c4);}};if(_0x4943d8['master'])_0x56f0f9[_0x25f1b8(0x179)]=!![];if(_0x4943d8[_0x25f1b8(0x19d)]&&typeof _0x4943d8[_0x25f1b8(0x19d)]===_0x25f1b8(0x13d))_0x56f0f9[_0x25f1b8(0x19d)]=_0x4943d8['attribute'];if(_0x4943d8['behavior']&&typeof _0x4943d8[_0x25f1b8(0x147)]===_0x25f1b8(0x13d))_0x56f0f9[_0x25f1b8(0x147)]=_0x4943d8[_0x25f1b8(0x147)];if(_0x4943d8[_0x25f1b8(0x14b)])_0x56f0f9[_0x25f1b8(0x14b)]=!![];if(_0x4943d8[_0x25f1b8(0x116)])_0x56f0f9[_0x25f1b8(0x116)]=_0x4943d8[_0x25f1b8(0x116)];let _0x3b84c3;try{_0x3b84c3=await _0x4e7861[_0x25f1b8(0x172)]['previewParentYaml'](_0x2d0572,_0x56f0f9),_0x1e2c3e[_0x25f1b8(0x1a6)]();}catch(_0x9a1fe3){_0x1e2c3e['stop']();throw _0x9a1fe3;}return await this[_0x25f1b8(0x16b)](_0x3b84c3,{'master':_0x4943d8[_0x25f1b8(0x179)],'attribute':typeof _0x4943d8[_0x25f1b8(0x19d)]===_0x25f1b8(0x13d)?_0x4943d8[_0x25f1b8(0x19d)]:undefined,'behavior':typeof _0x4943d8[_0x25f1b8(0x147)]==='string'?_0x4943d8['behavior']:undefined,'enriched':_0x4943d8[_0x25f1b8(0x14b)]}),_0x3b84c3[_0x25f1b8(0xb2)]?0x0:0x1;}async[a26_0x3023b4(0x16b)](_0x1521b8,_0x4eba72){const _0x5ee830=a26_0x3023b4;console[_0x5ee830(0x19f)]('\x0a'+a26_0x31cdb1[_0x5ee830(0x10a)](_0x5ee830(0x129))+'\x20'+_0x1521b8[_0x5ee830(0xde)]),console[_0x5ee830(0x19f)]('═'[_0x5ee830(0x188)](0x3c));if(_0x4eba72['master']&&_0x1521b8[_0x5ee830(0xcb)]){const _0x4d701e=a26_0x31cdb1[_0x5ee830(0x104)]('Master:')+'\x20'+a26_0x31cdb1[_0x5ee830(0x10a)](_0x1521b8[_0x5ee830(0x179)][_0x5ee830(0x18f)]+'.'+_0x1521b8['master'][_0x5ee830(0x102)]);await this['displaySampleData'](_0x4d701e,_0x1521b8[_0x5ee830(0xcb)]);}else{if(_0x4eba72[_0x5ee830(0x19d)]&&_0x1521b8[_0x5ee830(0xcb)]){const _0x2032bf=a26_0x31cdb1[_0x5ee830(0x104)](_0x5ee830(0x1b7))+'\x20'+a26_0x31cdb1['bold'](_0x4eba72['attribute']);await this[_0x5ee830(0xaa)](_0x2032bf,_0x1521b8['sampleData']);}else{if(_0x4eba72[_0x5ee830(0x147)]&&_0x1521b8[_0x5ee830(0xcb)]){const _0x24f483=a26_0x31cdb1['dim'](_0x5ee830(0x14d))+'\x20'+a26_0x31cdb1[_0x5ee830(0x10a)](_0x4eba72[_0x5ee830(0x147)]);await this[_0x5ee830(0xaa)](_0x24f483,_0x1521b8['sampleData']);}else{if(_0x4eba72['enriched']&&_0x1521b8['sampleData']){const _0x204fdc=a26_0x31cdb1['dim'](_0x5ee830(0x184))+'\x20'+a26_0x31cdb1[_0x5ee830(0x10a)](_0x5ee830(0x17c));await this['displaySampleData'](_0x204fdc,_0x1521b8[_0x5ee830(0xcb)]);}else!_0x1521b8[_0x5ee830(0xcb)]&&console[_0x5ee830(0x19f)](_0x5ee830(0x119));}}}if(_0x1521b8['errors'][_0x5ee830(0xd0)]>0x0){console[_0x5ee830(0x19f)]('─'[_0x5ee830(0x188)](0x3c)),console['error']('\x0a'+a26_0x31cdb1[_0x5ee830(0xf5)](_0x5ee830(0x131)));for(const _0x502f80 of _0x1521b8[_0x5ee830(0x13f)]){console[_0x5ee830(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x5ee830(0xf5)]('•')+'\x20'+_0x502f80);}}}async[a26_0x3023b4(0xaa)](_0x919319,_0x1f44f5){const _0x28e635=a26_0x3023b4;if(_0x1f44f5['length']===0x0){console[_0x28e635(0x19f)]('\x0a'+_0x919319),console[_0x28e635(0x19f)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x28e635(0x19f)]('\x0a'+_0x919319);const _0x160d1d=Object[_0x28e635(0x17e)](_0x1f44f5[0x0])[_0x28e635(0x108)](_0x2b0a5c=>({'name':_0x2b0a5c,'type':typeof _0x1f44f5[0x0][_0x2b0a5c]===_0x28e635(0x120)?_0x28e635(0xe9):_0x28e635(0x145)})),_0x4f2e03={'queryId':'preview','columns':_0x160d1d,'data':_0x1f44f5,'stats':{'state':_0x28e635(0xbd),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1f44f5[_0x28e635(0xd0)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x3c4414=formatAsTable(_0x4f2e03,_0x1f44f5[_0x28e635(0xd0)],!![]);await writeOutput(_0x3c4414,undefined,_0x28e635(0x102));}}export class ParentSegmentRunCommand extends BaseCommand{['name']=a26_0x3023b4(0x151);['description']=a26_0x3023b4(0xa5);async['execute'](_0x335114){const _0x15c928=a26_0x3023b4,{options:_0xac9f89,args:_0x38e31f,tdx:_0x2d3d82}=_0x335114,_0xc253e=_0xac9f89,_0x24a50e=_0x38e31f[0x0]||_0xac9f89[_0x15c928(0x199)];if(!_0x24a50e)return console[_0x15c928(0x19f)](a26_0x31cdb1['red'](_0x15c928(0x18e))),console['error'](_0x15c928(0xef)),console[_0x15c928(0x19f)](a26_0x31cdb1[_0x15c928(0x186)](_0x15c928(0xd8))),0x1;const _0x1b7678=resolveYamlFile(_0x24a50e);if(existsSync(_0x1b7678)){_0xc253e['verbose']&&console[_0x15c928(0x19f)](_0x15c928(0x118)+_0x1b7678);let _0x13f4b7;try{_0x13f4b7=readFileSync(_0x1b7678,_0x15c928(0x16e));}catch(_0x4e758d){const _0x35c5e5=_0x4e758d instanceof Error?_0x4e758d['message']:String(_0x4e758d);return console['error']('Error\x20reading\x20file:\x20'+_0x35c5e5),0x1;}const _0x324303=await withSpinner(_0x15c928(0x15b),()=>_0x2d3d82[_0x15c928(0x172)][_0x15c928(0x1b5)](_0x13f4b7),{'verbose':_0xc253e[_0x15c928(0xad)]}),_0x12b546=_0x324303[_0x15c928(0x128)],{isNew:_0x3324fb,name:_0x11bcc0,hasChanges:_0x6c838,diffFormatted:_0x68f6ce}=_0x12b546;if(_0x6c838){_0x3324fb?console['error'](_0x15c928(0xb1)+_0x11bcc0+'\x27:'):console[_0x15c928(0x19f)](_0x15c928(0xb0)+_0x11bcc0+'\x27:');console[_0x15c928(0x19f)]('─'[_0x15c928(0x188)](0x3c)),console[_0x15c928(0x19f)](_0x68f6ce),console[_0x15c928(0x19f)]('─'[_0x15c928(0x188)](0x3c));const _0x1a2db1=_0x3324fb?_0x15c928(0xba)+_0x11bcc0+'\x27\x20and\x20run\x20workflow?':_0x15c928(0xf3)+_0x11bcc0+_0x15c928(0xe1);if(!_0xc253e['yes']){const _0xed803f=await confirmKey(_0x1a2db1);if(!_0xed803f)return console[_0x15c928(0x19f)]('Aborted.'),0x1;}const _0x57788d=_0x3324fb?'Creating':'Updating';await withSpinner(_0x57788d+_0x15c928(0x1b0)+_0x11bcc0+_0x15c928(0xa9),()=>_0x12b546[_0x15c928(0x138)](),{'verbose':_0xc253e['verbose']});const _0x4af26b=_0x3324fb?'Created':_0x15c928(0xab);console[_0x15c928(0x19f)]('✔\x20'+_0x4af26b+'\x20parent\x20segment\x20\x27'+_0x11bcc0+'\x27');}else console[_0x15c928(0x19f)](_0x15c928(0x11c)+_0x11bcc0+_0x15c928(0xe8));}const _0x4d53ba=await withSpinner(_0x15c928(0x165)+_0x24a50e+_0x15c928(0xa9),()=>_0x2d3d82['segment'][_0x15c928(0xe5)](_0x24a50e),{'verbose':_0xc253e[_0x15c928(0xad)]}),_0x3ca33a=_0x4d53ba[_0x15c928(0x128)],_0x5bde83=getConsoleUrl(_0xc253e[_0x15c928(0x9f)],'/app/workflows/'+_0x3ca33a[_0x15c928(0x14f)]+_0x15c928(0x162)+_0x3ca33a[_0x15c928(0x18a)]+_0x15c928(0xbc)+_0x3ca33a['workflowAttemptId']);return console['error'](_0x15c928(0xc4)),console[_0x15c928(0x19f)]('\x20\x20'+a26_0x31cdb1['dim'](_0x15c928(0x142))+'\x20'+_0x3ca33a[_0x15c928(0x10e)]),console['error']('\x20\x20'+a26_0x31cdb1[_0x15c928(0x104)]('Status:')+'\x20'+_0x3ca33a[_0x15c928(0x181)]),console[_0x15c928(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x15c928(0x104)](_0x15c928(0x107))+'\x20'+_0x3ca33a['workflowSessionId']),console[_0x15c928(0x19f)]('\x20\x20'+a26_0x31cdb1[_0x15c928(0x104)](_0x15c928(0x16f))+'\x20'+_0x3ca33a['workflowAttemptId']),console[_0x15c928(0x19f)]('\x20\x20'+_0x5bde83),console[_0x15c928(0x19f)]('\x0a'+a26_0x31cdb1[_0x15c928(0x104)](_0x15c928(0x15d))+_0x15c928(0x109)+_0x3ca33a[_0x15c928(0x15a)]+_0x15c928(0x146)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a26_0x3023b4(0xde)]=a26_0x3023b4(0x191);[a26_0x3023b4(0x157)]=a26_0x3023b4(0x1b4);async[a26_0x3023b4(0xed)](_0x340fb6){const _0x5e8913=a26_0x3023b4,{options:_0xd12587,args:_0x266976,tdx:_0x41ddc5}=_0x340fb6,_0xe975bb=_0x266976[0x0]||_0xd12587[_0x5e8913(0x199)];if(!_0xe975bb)return console[_0x5e8913(0x19f)](a26_0x31cdb1['red'](_0x5e8913(0x18e))),console[_0x5e8913(0x19f)](_0x5e8913(0x158)),console[_0x5e8913(0x19f)](a26_0x31cdb1[_0x5e8913(0x186)](_0x5e8913(0xd8))),0x1;_0xd12587[_0x5e8913(0xad)]&&(console[_0x5e8913(0x19f)](_0x5e8913(0xa8)+_0xd12587[_0x5e8913(0x9f)]),console[_0x5e8913(0x19f)](_0x5e8913(0xc0)+_0xe975bb));const _0x388ad6=await withSpinner(_0x5e8913(0xc5)+_0xe975bb+'\x27...',()=>_0x41ddc5[_0x5e8913(0x172)]['listFields'](_0xe975bb),{'verbose':_0xd12587[_0x5e8913(0xad)]}),_0x5a83a6=_0x388ad6['data'];console['error']('✔\x20Found\x20'+_0x5a83a6['length']+'\x20field'+(_0x5a83a6[_0x5e8913(0xd0)]!==0x1?'s':''));if(_0xd12587[_0x5e8913(0x16d)]||_0xd12587[_0x5e8913(0xcd)])return await handleSDKOutput(_0x5a83a6,_0xd12587),0x0;return displayFieldsHumanReadable(_0x5a83a6,_0xe975bb),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a26_0x3023b4(0xde)]=a26_0x3023b4(0x153);[a26_0x3023b4(0x157)]=a26_0x3023b4(0xb4);async[a26_0x3023b4(0xed)](_0x498115){const _0x3b254a=a26_0x3023b4,{options:_0x25da00,args:_0x1d6324,tdx:_0xed5b16}=_0x498115,_0x4062a0=_0x25da00,_0x1860f4=_0x1d6324[0x0]||_0x25da00['parentSegment'];if(!_0x1860f4)return console[_0x3b254a(0x19f)](a26_0x31cdb1[_0x3b254a(0xf5)](_0x3b254a(0x18e))),console[_0x3b254a(0x19f)](_0x3b254a(0xf1)),console[_0x3b254a(0x19f)](_0x3b254a(0xfe)),console['error'](_0x3b254a(0x178)),console[_0x3b254a(0x19f)](a26_0x31cdb1[_0x3b254a(0x186)](_0x3b254a(0x150))),0x1;_0x25da00[_0x3b254a(0xad)]&&(console[_0x3b254a(0x19f)](_0x3b254a(0xa8)+_0x25da00[_0x3b254a(0x9f)]),console[_0x3b254a(0x19f)]('Parent\x20segment:\x20'+_0x1860f4));const _0xb1b510=await withSpinner(_0x3b254a(0xc7)+_0x1860f4+_0x3b254a(0xa9),()=>_0xed5b16['segment']['getParentFull'](_0x1860f4),{'verbose':_0x25da00[_0x3b254a(0xad)]}),_0x50e900=_0xb1b510[_0x3b254a(0x128)];if(_0x4062a0['web']){const _0x3f150c=getConsoleNextUrl(_0x4062a0[_0x3b254a(0x9f)],_0x3b254a(0x196)+_0x50e900['id']);return console[_0x3b254a(0x19f)](a26_0x31cdb1['green']('✔')+_0x3b254a(0xf8)+a26_0x31cdb1[_0x3b254a(0x186)](_0x3f150c)),openBrowser(_0x3f150c),0x0;}return await handleSingleObjectOutput(_0x50e900,_0x25da00),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a26_0x3023b4(0x19e);[a26_0x3023b4(0x157)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a26_0x3023b4(0xed)](_0x426c5b){const _0x3f23c0=a26_0x3023b4,{options:_0x32062e,args:_0x2a23e3,tdx:_0x402fd6}=_0x426c5b,_0x26b273=_0x2a23e3[0x0]||_0x32062e[_0x3f23c0(0x199)];if(!_0x26b273)return console[_0x3f23c0(0x19f)](a26_0x31cdb1[_0x3f23c0(0xf5)](_0x3f23c0(0x18e))),console[_0x3f23c0(0x19f)](_0x3f23c0(0xc6)),console[_0x3f23c0(0x19f)](a26_0x31cdb1[_0x3f23c0(0x186)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x32062e[_0x3f23c0(0xad)]&&(console[_0x3f23c0(0x19f)](_0x3f23c0(0xa8)+_0x32062e[_0x3f23c0(0x9f)]),console['error'](_0x3f23c0(0xc0)+_0x26b273));const _0x38b987=await withSpinner(_0x3f23c0(0xc3)+_0x26b273+_0x3f23c0(0xa9),()=>_0x402fd6['segment'][_0x3f23c0(0xc8)](_0x26b273),{'verbose':_0x32062e[_0x3f23c0(0xad)]}),_0x4b4c99=_0x38b987[_0x3f23c0(0x128)],_0x4a213c=await withSpinner(_0x3f23c0(0x127)+_0x26b273+_0x3f23c0(0xa9),()=>_0x402fd6['segment'][_0x3f23c0(0x113)](_0x4b4c99),{'verbose':_0x32062e['verbose']}),_0x3faef9=await executeSchemaQuery(_0x4a213c[_0x3f23c0(0x128)],_0x402fd6,_0x32062e);return await handleQueryOutput(_0x3faef9,_0x32062e),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a26_0x3023b4(0x193);['description']=a26_0x3023b4(0x10b);async[a26_0x3023b4(0xed)](_0x463cbe){const _0x167af6=a26_0x3023b4,{options:_0x50d70b,args:_0x26b36a,tdx:_0x226569}=_0x463cbe,_0x53b289=_0x26b36a[0x0]||_0x50d70b[_0x167af6(0x199)];if(!_0x53b289)return console[_0x167af6(0x19f)](a26_0x31cdb1[_0x167af6(0xf5)](_0x167af6(0x18e))),console[_0x167af6(0x19f)](_0x167af6(0xc2)),console[_0x167af6(0x19f)](a26_0x31cdb1[_0x167af6(0x186)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x50d70b['verbose']&&(console['error'](_0x167af6(0xa8)+_0x50d70b[_0x167af6(0x9f)]),console[_0x167af6(0x19f)](_0x167af6(0xc0)+_0x53b289));const _0x2abcca=await withSpinner(_0x167af6(0xc3)+_0x53b289+_0x167af6(0xa9),()=>_0x226569['segment'][_0x167af6(0xc8)](_0x53b289),{'verbose':_0x50d70b[_0x167af6(0xad)]}),_0x12d390=_0x2abcca[_0x167af6(0x128)],_0x157a02=await withSpinner(_0x167af6(0x127)+_0x53b289+_0x167af6(0xa9),()=>_0x226569[_0x167af6(0x172)][_0x167af6(0x113)](_0x12d390),{'verbose':_0x50d70b[_0x167af6(0xad)]}),_0x4baca4=_0x157a02[_0x167af6(0x128)];return _0x50d70b['format']==='json'||_0x50d70b['format']===_0x167af6(0xcd)?await handleSDKOutput([{'sql':_0x4baca4}],_0x50d70b):console[_0x167af6(0x15f)](_0x4baca4),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a26_0x3023b4(0x155);[a26_0x3023b4(0x157)]=a26_0x3023b4(0xe0);async[a26_0x3023b4(0xed)](_0x3f71eb){const _0x20f6fc=a26_0x3023b4,{options:_0x50bed6,args:_0x736430,tdx:_0x1faae6}=_0x3f71eb,_0x4a0eac=_0x736430[0x0]||_0x50bed6['parentSegment'];if(!_0x4a0eac)return console[_0x20f6fc(0x19f)](a26_0x31cdb1[_0x20f6fc(0xf5)](_0x20f6fc(0x18e))),console[_0x20f6fc(0x19f)](_0x20f6fc(0x189)),console['error'](a26_0x31cdb1[_0x20f6fc(0x186)](_0x20f6fc(0xd8))),0x1;_0x50bed6[_0x20f6fc(0xad)]&&(console[_0x20f6fc(0x19f)]('Site:\x20'+_0x50bed6['site']),console[_0x20f6fc(0x19f)]('Parent\x20segment:\x20'+_0x4a0eac));const _0x501274=await withSpinner(_0x20f6fc(0xc3)+_0x4a0eac+_0x20f6fc(0xa9),()=>_0x1faae6[_0x20f6fc(0x172)]['resolveParentId'](_0x4a0eac),{'verbose':_0x50bed6['verbose']}),_0x138db6=_0x501274[_0x20f6fc(0x128)],_0x1f1b9f=await withSpinner(_0x20f6fc(0x127)+_0x4a0eac+_0x20f6fc(0xa9),()=>_0x1faae6[_0x20f6fc(0x172)][_0x20f6fc(0x113)](_0x138db6),{'verbose':_0x50bed6[_0x20f6fc(0xad)]});let _0x1eac6a=_0x1f1b9f[_0x20f6fc(0x128)];const _0xe4dcc7=resolveLimit(_0x50bed6[_0x20f6fc(0x176)],DEFAULT_DISPLAY_LIMIT),_0x6c3032=/\bLIMIT\s+\d+/i[_0x20f6fc(0xf7)](_0x1eac6a);!_0x6c3032&&(_0x1eac6a=_0x1eac6a[_0x20f6fc(0x159)]()[_0x20f6fc(0x14e)](/;+$/,''),_0x1eac6a=_0x20f6fc(0xe3)+_0x1eac6a+_0x20f6fc(0xa7)+_0xe4dcc7);_0x50bed6[_0x20f6fc(0xad)]&&console[_0x20f6fc(0x19f)](_0x20f6fc(0xaf)+_0x1eac6a);const _0x809442=await withQuerySpinner(_0x20f6fc(0x123),async _0x5db287=>{const _0x3bafc8=_0x20f6fc,_0x52e261=await _0x1faae6['query'][_0x3bafc8(0xed)](_0x1eac6a,{'catalog':'td','schema':_0x3bafc8(0xd1),'onJobId':_0x343d21=>{const _0xc42ff4=_0x3bafc8;_0x5db287[_0xc42ff4(0x125)](_0x343d21);}});return _0x52e261;},{'verbose':_0x50bed6[_0x20f6fc(0xad)]}),_0x5e0a97=_0x809442['data'],_0x6433dd=_0x5e0a97[_0x20f6fc(0x10d)]?_0x20f6fc(0xb8)+_0x5e0a97[_0x20f6fc(0x10d)]+']':'';return console[_0x20f6fc(0x19f)](_0x20f6fc(0xe4)+_0x5e0a97[_0x20f6fc(0xeb)][_0x20f6fc(0xa4)][_0x20f6fc(0xf6)]()+_0x20f6fc(0xce)+(_0x20f6fc(0x134)+formatElapsed(_0x5e0a97['stats']['elapsedTimeMillis'])+_0x6433dd)),await handleQueryOutput(_0x5e0a97,_0x50bed6),0x0;}}
|
|
1
|
+
const a26_0x3760a6=a26_0x2dd7;(function(_0xa12450,_0x3b83ee){const _0x41eec0=a26_0x2dd7,_0x3f3f14=_0xa12450();while(!![]){try{const _0xbf59f7=-parseInt(_0x41eec0(0x1c5))/0x1+-parseInt(_0x41eec0(0x1a9))/0x2+-parseInt(_0x41eec0(0x1d5))/0x3*(parseInt(_0x41eec0(0x198))/0x4)+parseInt(_0x41eec0(0x17e))/0x5*(parseInt(_0x41eec0(0x169))/0x6)+-parseInt(_0x41eec0(0x243))/0x7+-parseInt(_0x41eec0(0x1ce))/0x8*(-parseInt(_0x41eec0(0x206))/0x9)+parseInt(_0x41eec0(0x1fe))/0xa;if(_0xbf59f7===_0x3b83ee)break;else _0x3f3f14['push'](_0x3f3f14['shift']());}catch(_0x556e13){_0x3f3f14['push'](_0x3f3f14['shift']());}}}(a26_0x177b,0x2f12d));import{writeFileSync,readFileSync,existsSync,mkdirSync}from'fs';import{spawn}from'child_process';import a26_0x5a0120 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';function a26_0x177b(){const _0x35d5fd=['Overwrite\x20\x27','column','length','Master\x20Table','addBehaviors','pullParentYaml','name','\x20parent\x20segment','match','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Listing\x20parent\x20segments...','%)\x20','yellow','\x0a✔\x20Workflow\x20started','yes','tdx\x20segment\x20parent\x20preview\x20','To\x20cancel:','behavior','\x20parent\x20segment\x20\x27','information_schema','Apply\x20changes\x20to\x20\x27','darwin','matchedCount','Audience\x20ID:','verbose','Session:','/app/workflows/','toFixed','\x27\x20and\x20run\x20workflow?','7089610RQgpvz','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Available\x20behaviors:','json','Errors:','keys','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','8163bIOjQu','site','Master\x20+\x20Attributes','text','Created','displayAttributesStats','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','scheduleOption','customersWithEvents','Updating\x20parent\x20segment\x20\x27','trim','Validating\x20configuration...','output','Behavior:','schemaError','pushParentYaml','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','\x0aUsage:\x20tdx\x20ps\x20preview\x20','No\x20parent\x20segments\x20found','platform','Join\x20on:','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','.yml','\x20rows\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','customerGroup','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','addAttributes','segment:parent:list','format','test','stop','Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a','varchar','Create\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','YAML\x20file:\x20','displaySummary','label','No\x20parent\x20segments\x20match\x20pattern:\x20','cyan','Attribute:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','displayValidateResults','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a','attributes','all','dirname','filter','getParentSQL','Creating','customerPercent','Master:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','sort','localeCompare','\x20tdx\x20wf\x20attempt\x20','SELECT\x20*\x20FROM\x20(\x0a','324695jIUmmn','ignore','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Analyzing\x20changes...','web','data','displayMasterInfo','\x20\x20\x20\x20-\x20','\x20Opening\x20','resolveParentId','workflowId','Fetching\x20SQL\x20for\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','red','\x20--behavior\x20\x22<name>\x22','.yaml','segment:parent:create','Aborted.','schemaValid','Status:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','map','Attributes','population','displayPreviewResults','open','Source:','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','Behaviors','getParentFull','stats','Preview:','Executing\x20parent\x20segment\x20query...','preview','joinKey','\x20No\x20changes\x20-\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','endsWith','enriched','Events:','addBehaviorsFile','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','utf-8','segment:parent:fields','Listing\x20parent\x20segments\x20matching\x20\x27','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Listing\x20fields\x20for\x20\x27','segment:parent:desc','status','replace','processedRows','Error\x20reading\x20file:\x20','\x5c$&','Columns:','segment:parent:run','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','List\x20available\x20fields\x20for\x20segmentation','timezone','displayColumns','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Validate:','Error:\x20File\x20not\x20found:\x20','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','coveragePercent','36ArQLTI','\x20--attribute\x20\x22','error','\x20--interval\x20','Usage:\x20tdx\x20ps\x20show\x20[name]\x0a','toLocaleString','behaviorsFile','win32','validateParentYaml','\x20[Job\x20ID:\x20','execute','jobId','✔\x20Updated\x20parent\x20segment\x20\x27','👥\x20','start','Error:','jsonl','apply','parent_segment','use','string','168860ACylni','bold','/app/dw/parentSegments/','Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','unref','Attempt:','behaviors','\x0aNew\x20parent\x20segment\x20\x27','\x27\x20with\x20ID:\x20','attributesFile','green','interval','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','attribute','foreignKey','repeat','displaySampleData','query','join','workflowSessionId','Options\x20(one\x20required):','double','log','sampleData','\x27\x20is\x20already\x20up\x20to\x20date','671756CisKyh','in\x20','✔\x20No\x20changes\x20-\x20\x27','columns','segment:parent:push','\x0aChanges\x20to\x20apply\x20to\x20\x27','Fetching\x20sample\x20data...','scheduleType','database','totalEvents','List\x20parent\x20segments','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','✔\x20Created\x20parent\x20segment\x20\x27','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x27...','699480VGkJsI','\x0aChanges\x20to\x20\x27','displayPreviewHints','Resolving\x20parent\x20segment\x20\x27','parentSegment','workflowAttemptId','Creating\x20parent\x20segment\x20\x27','elapsedTimeMillis','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Options:','Database:\x20','allValid','-1d','Name:\x20','displayBehaviorsStats','Show\x20parent\x20segment\x20schema\x20(column\x20types)','description','Enriched:','customerGroupFile','To\x20view\x20sample\x20data:','segment','\x20\x20No\x20sample\x20data\x20available','segment:parent:pull','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Updated','Found\x20YAML\x20file:\x20','segment:parent:update','listFields','286994kIcQuP','message','Updating','table','`\x20to\x20download\x20the\x20configuration\x20first','\x20--behavior\x20\x22','dim','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','2648zdhsUR','master','rowCount','addAttributesFile','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Join:','/attempt/','6rQvatF','✔\x20Found\x20','errors','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x20is\x20already\x20up\x20to\x20date','\x20--enriched','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Customers:','previewParentYaml','setJobId','listParents','Pattern:\x20'];a26_0x177b=function(){return _0x35d5fd;};return a26_0x177b();}import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a26_0x1a6673 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a26_0x3760a6(0x17b);function openBrowser(_0x188cee){const _0x2f36c0=a26_0x3760a6,_0x17da86=process[_0x2f36c0(0x21a)],_0x25474b=_0x17da86===_0x2f36c0(0x1f6)?_0x2f36c0(0x25d):_0x17da86===_0x2f36c0(0x170)?'start':'xdg-open';spawn(_0x25474b,[_0x188cee],{'detached':!![],'stdio':_0x2f36c0(0x244)})[_0x2f36c0(0x183)]();}function resolveYamlFile(_0x407ab1){const _0x4383b4=a26_0x3760a6;if(_0x407ab1[_0x4383b4(0x26b)](_0x4383b4(0x21d))||_0x407ab1['endsWith'](_0x4383b4(0x253)))return _0x407ab1;return a26_0x5a0120[_0x4383b4(0x191)](PARENT_SEGMENT_DIR,_0x407ab1+_0x4383b4(0x21d));}function formatProgressMessage(_0x186ce0){const _0x33c6d1=a26_0x3760a6,_0x1bdcca=_0x186ce0[_0x33c6d1(0x1e9)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1bdcca){const [,_0x1549a0,_0xf252ed,_0x24a988='']=_0x1bdcca;return a26_0x1a6673[_0x33c6d1(0x1cb)](_0x1549a0+':')+'\x20'+_0xf252ed+a26_0x1a6673[_0x33c6d1(0x1cb)](_0x24a988);}return a26_0x1a6673['dim'](_0x186ce0);}function showFileNotFoundError(_0xa9c618,_0x364002){const _0x246e6d=a26_0x3760a6;console[_0x246e6d(0x16b)](a26_0x1a6673[_0x246e6d(0x251)](_0x246e6d(0x166)+_0xa9c618+'\x0a')),console[_0x246e6d(0x16b)](a26_0x1a6673['cyan']('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x364002+_0x246e6d(0x1c9)));}export class ParentSegmentListCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]=a26_0x3760a6(0x223);['description']=a26_0x3760a6(0x1a2);async[a26_0x3760a6(0x173)](_0x2ec4a5){const _0x5a118f=a26_0x3760a6,{options:_0x49f8a9,args:_0x1af72f,tdx:_0x9359d1}=_0x2ec4a5,_0x3b7190=_0x1af72f[0x0];_0x49f8a9[_0x5a118f(0x1f9)]&&(console[_0x5a118f(0x16b)]('Site:\x20'+_0x49f8a9[_0x5a118f(0x207)]),_0x3b7190&&console[_0x5a118f(0x16b)](_0x5a118f(0x1e0)+_0x3b7190));const _0x1abb8a=await withSpinner(_0x3b7190?_0x5a118f(0x272)+_0x3b7190+'\x27...':_0x5a118f(0x1eb),()=>_0x9359d1[_0x5a118f(0x1bd)][_0x5a118f(0x1df)](),{'verbose':_0x49f8a9['verbose']});let _0x301a4d=_0x1abb8a[_0x5a118f(0x248)];if(_0x3b7190){const _0x5a5275=_0x3b7190['replace'](/[.+^${}()|[\]\\]/g,_0x5a118f(0x27a))[_0x5a118f(0x277)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x319778=new RegExp('^'+_0x5a5275+'$','i');_0x301a4d=_0x301a4d[_0x5a118f(0x239)](_0x341d67=>_0x319778['test'](_0x341d67[_0x5a118f(0x236)]['name']));}_0x301a4d[_0x5a118f(0x23f)]((_0x3a1707,_0x2c401e)=>_0x3a1707[_0x5a118f(0x236)][_0x5a118f(0x1e7)][_0x5a118f(0x240)](_0x2c401e[_0x5a118f(0x236)][_0x5a118f(0x1e7)])),console[_0x5a118f(0x16b)](_0x5a118f(0x1d6)+_0x301a4d[_0x5a118f(0x1e3)]+_0x5a118f(0x1e8)+(_0x301a4d[_0x5a118f(0x1e3)]!==0x1?'s':''));if(_0x49f8a9[_0x5a118f(0x224)]===_0x5a118f(0x201)||_0x49f8a9[_0x5a118f(0x224)]===_0x5a118f(0x179))await handleSDKOutput(_0x301a4d,_0x49f8a9);else{if(_0x301a4d[_0x5a118f(0x1e3)]===0x0)_0x3b7190?console[_0x5a118f(0x195)](_0x5a118f(0x22e)+_0x3b7190):console[_0x5a118f(0x195)](_0x5a118f(0x219));else for(const _0x159c39 of _0x301a4d){const _0x37bf09=_0x159c39[_0x5a118f(0x236)][_0x5a118f(0x25b)]?a26_0x1a6673[_0x5a118f(0x1cb)]('\x20('+formatRows(_0x159c39['attributes'][_0x5a118f(0x25b)])+')'):'';console[_0x5a118f(0x195)](_0x5a118f(0x176)+_0x159c39[_0x5a118f(0x236)][_0x5a118f(0x1e7)]+_0x37bf09);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]=a26_0x3760a6(0x254);[a26_0x3760a6(0x1b9)]=a26_0x3760a6(0x1db);async[a26_0x3760a6(0x173)](_0xbfb628){const _0x1b6265=a26_0x3760a6,{options:_0x877d1e,args:_0x5139c1,tdx:_0x2c6b09}=_0xbfb628;console[_0x1b6265(0x16b)](_0x1b6265(0x21f)+_0x1b6265(0x258)+_0x1b6265(0x1ff));const _0x513e98=_0x877d1e;if(_0x5139c1[_0x1b6265(0x1e3)]===0x0)return console['error'](_0x1b6265(0x26a)),console[_0x1b6265(0x16b)](_0x1b6265(0x1d2)),0x1;const _0x3c1536=_0x5139c1[0x0];if(!_0x513e98['database']||!_0x513e98[_0x1b6265(0x1c8)])return console[_0x1b6265(0x16b)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console['error'](_0x1b6265(0x1d2)),0x1;_0x513e98[_0x1b6265(0x1f9)]&&(console[_0x1b6265(0x16b)](_0x1b6265(0x1a5)+_0x513e98[_0x1b6265(0x207)]),console[_0x1b6265(0x16b)](_0x1b6265(0x1b6)+_0x3c1536),console['error'](_0x1b6265(0x1b3)+_0x513e98[_0x1b6265(0x1a0)]),console['error']('Table:\x20'+_0x513e98[_0x1b6265(0x1c8)]));const _0x93a912=await loadJSONFromOptions(_0x513e98['attributes'],_0x513e98[_0x1b6265(0x188)]),_0x49185a=await loadJSONFromOptions(_0x513e98[_0x1b6265(0x185)],_0x513e98[_0x1b6265(0x16f)]),_0x1cd1b3=await loadJSONFromOptions(_0x513e98[_0x1b6265(0x220)],_0x513e98[_0x1b6265(0x1bb)]),_0x1859cb={'name':_0x3c1536,'description':_0x513e98[_0x1b6265(0x1b9)],'scheduleType':_0x513e98['scheduleType'],'scheduleOption':_0x513e98['scheduleOption'],'timezone':_0x513e98['timezone'],'master':{'parentDatabaseName':_0x513e98[_0x1b6265(0x1a0)],'parentTableName':_0x513e98[_0x1b6265(0x1c8)]},'attributes':_0x93a912,'behaviors':_0x49185a,'customerGroup':_0x1cd1b3},_0x4b2576=await withSpinner(_0x1b6265(0x1af)+_0x3c1536+'\x27...',()=>_0x2c6b09[_0x1b6265(0x1bd)]['createParent'](_0x1859cb),{'verbose':_0x877d1e['verbose']}),_0x13eb35=_0x4b2576[_0x1b6265(0x248)];return console[_0x1b6265(0x16b)](_0x1b6265(0x1a4)+_0x13eb35[_0x1b6265(0x1e7)]+_0x1b6265(0x187)+_0x13eb35['id']),await handleSDKOutput([_0x13eb35],_0x877d1e),0x0;}}function a26_0x2dd7(_0x4f9be4,_0x45eaef){const _0x177bf0=a26_0x177b();return a26_0x2dd7=function(_0x2dd757,_0xdf82d8){_0x2dd757=_0x2dd757-0x15e;let _0x17d785=_0x177bf0[_0x2dd757];return _0x17d785;},a26_0x2dd7(_0x4f9be4,_0x45eaef);}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a26_0x3760a6(0x1c3);['description']=a26_0x3760a6(0x245);async[a26_0x3760a6(0x173)](_0x3e5a60){const _0x2eb30b=a26_0x3760a6,{options:_0x145cf8,args:_0x21d1af,tdx:_0x49d05f}=_0x3e5a60;console['error'](_0x2eb30b(0x1cd)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2eb30b(0x1ff));const _0x4d4e47=_0x145cf8;if(_0x21d1af[_0x2eb30b(0x1e3)]===0x0)return console[_0x2eb30b(0x16b)](_0x2eb30b(0x26a)),console['error']('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x572f18=_0x21d1af[0x0];_0x4d4e47[_0x2eb30b(0x1f9)]&&(console['error'](_0x2eb30b(0x1a5)+_0x4d4e47[_0x2eb30b(0x207)]),console['error'](_0x2eb30b(0x22a)+_0x572f18));const _0x87bf4f=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x572f18+_0x2eb30b(0x1a8),()=>_0x49d05f[_0x2eb30b(0x1bd)][_0x2eb30b(0x262)](_0x572f18),{'verbose':_0x4d4e47[_0x2eb30b(0x1f9)]}),_0x505995=_0x87bf4f['data'],_0x504a8f=await loadJSONFromOptions(_0x4d4e47[_0x2eb30b(0x222)],_0x4d4e47[_0x2eb30b(0x1d1)]),_0x36924c=await loadJSONFromOptions(_0x4d4e47[_0x2eb30b(0x1e5)],_0x4d4e47[_0x2eb30b(0x26e)]),_0x42bc5d={'name':_0x505995[_0x2eb30b(0x1e7)],'description':_0x4d4e47[_0x2eb30b(0x1b9)]!==undefined?_0x4d4e47[_0x2eb30b(0x1b9)]:_0x505995[_0x2eb30b(0x1b9)],'scheduleType':_0x4d4e47[_0x2eb30b(0x19f)]!==undefined?_0x4d4e47[_0x2eb30b(0x19f)]:_0x505995[_0x2eb30b(0x19f)],'scheduleOption':_0x4d4e47[_0x2eb30b(0x20e)]!==undefined?_0x4d4e47[_0x2eb30b(0x20e)]:_0x505995[_0x2eb30b(0x20e)],'timezone':_0x4d4e47[_0x2eb30b(0x162)]!==undefined?_0x4d4e47[_0x2eb30b(0x162)]:_0x505995[_0x2eb30b(0x162)],'master':_0x505995['master'],'attributes':_0x504a8f?[..._0x505995['attributes']||[],..._0x504a8f]:_0x505995['attributes'],'behaviors':_0x36924c?[..._0x505995[_0x2eb30b(0x185)]||[],..._0x36924c]:_0x505995[_0x2eb30b(0x185)],'customerGroup':_0x505995[_0x2eb30b(0x220)]},_0xcd8097=await withSpinner(_0x2eb30b(0x210)+_0x572f18+_0x2eb30b(0x1a8),()=>_0x49d05f[_0x2eb30b(0x1bd)]['updateParent'](_0x572f18,_0x42bc5d),{'verbose':_0x4d4e47[_0x2eb30b(0x1f9)]}),_0x21696a=_0xcd8097['data'];return console[_0x2eb30b(0x16b)](_0x2eb30b(0x175)+_0x21696a[_0x2eb30b(0x1e7)]+'\x27'),await handleSDKOutput([_0x21696a],_0x4d4e47),0x0;}}export class ParentSegmentPullCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]=a26_0x3760a6(0x1bf);[a26_0x3760a6(0x1b9)]=a26_0x3760a6(0x1a7);async[a26_0x3760a6(0x173)](_0x4248ee){const _0x5719ab=a26_0x3760a6,{options:_0x4c2bb2,args:_0x3ccc87,tdx:_0x21a537}=_0x4248ee,_0x58eed3=_0x4c2bb2,_0x234ca2=_0x3ccc87[0x0]||_0x4c2bb2[_0x5719ab(0x1ad)];if(!_0x234ca2)return console[_0x5719ab(0x16b)](a26_0x1a6673[_0x5719ab(0x251)](_0x5719ab(0x1a6))),console[_0x5719ab(0x16b)](_0x5719ab(0x20d)),console[_0x5719ab(0x16b)](a26_0x1a6673['cyan'](_0x5719ab(0x21c))),0x1;if(_0x58eed3[_0x5719ab(0x17c)]&&_0x58eed3['output'])return console['error'](a26_0x1a6673[_0x5719ab(0x251)](_0x5719ab(0x205))),console['error'](a26_0x1a6673[_0x5719ab(0x1cb)](_0x5719ab(0x1ea))),console['error'](a26_0x1a6673[_0x5719ab(0x1cb)]('using\x20the\x20default\x20path:\x20parent_segment/{name}.yml\x0a')),console['error'](a26_0x1a6673[_0x5719ab(0x22f)](_0x5719ab(0x232))),0x1;const _0x1779b4=_0x58eed3[_0x5719ab(0x213)]||a26_0x5a0120['join'](PARENT_SEGMENT_DIR,_0x234ca2+'.yml');_0x58eed3[_0x5719ab(0x1f9)]&&(console['error'](_0x5719ab(0x1a5)+_0x58eed3[_0x5719ab(0x207)]),console[_0x5719ab(0x16b)](_0x5719ab(0x22a)+_0x234ca2),console[_0x5719ab(0x16b)]('Output\x20file:\x20'+_0x1779b4));const _0x11794d=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x234ca2+_0x5719ab(0x1a8),()=>_0x21a537['segment'][_0x5719ab(0x1e6)](_0x234ca2),{'verbose':_0x58eed3[_0x5719ab(0x1f9)]}),_0x3fd806=_0x11794d[_0x5719ab(0x248)];if(existsSync(_0x1779b4)){const _0xb3e74c=readFileSync(_0x1779b4,_0x5719ab(0x270)),_0x4a7e3f=generateDiff(_0xb3e74c,_0x3fd806);if(!hasChanges(_0x4a7e3f))console[_0x5719ab(0x16b)](a26_0x1a6673[_0x5719ab(0x189)]('✔')+_0x5719ab(0x268)+a26_0x1a6673[_0x5719ab(0x22f)](_0x1779b4)+_0x5719ab(0x1d9));else{console[_0x5719ab(0x16b)](_0x5719ab(0x1aa)+_0x1779b4+'\x27:'),console[_0x5719ab(0x16b)]('─'[_0x5719ab(0x18e)](0x3c)),console[_0x5719ab(0x16b)](formatDiffWithColors(_0x4a7e3f)),console[_0x5719ab(0x16b)]('─'['repeat'](0x3c));if(!_0x58eed3[_0x5719ab(0x1ef)]){const _0x55afc7=await confirmKey(_0x5719ab(0x1e1)+_0x1779b4+'\x27?');if(!_0x55afc7)return console[_0x5719ab(0x16b)](_0x5719ab(0x255)),0x1;}writeFileSync(_0x1779b4,_0x3fd806,_0x5719ab(0x270)),console[_0x5719ab(0x16b)](a26_0x1a6673[_0x5719ab(0x189)]('✔')+_0x5719ab(0x269)+a26_0x1a6673[_0x5719ab(0x22f)](_0x1779b4));}}else{const _0x302a82=a26_0x5a0120[_0x5719ab(0x238)](_0x1779b4);!existsSync(_0x302a82)&&mkdirSync(_0x302a82,{'recursive':!![]}),writeFileSync(_0x1779b4,_0x3fd806,_0x5719ab(0x270)),console[_0x5719ab(0x16b)](a26_0x1a6673[_0x5719ab(0x189)]('✔')+_0x5719ab(0x269)+a26_0x1a6673[_0x5719ab(0x22f)](_0x1779b4));}return _0x58eed3[_0x5719ab(0x17c)]&&(saveSessionContext({'parent_segment':_0x234ca2},_0x58eed3['session']),console[_0x5719ab(0x16b)](a26_0x1a6673[_0x5719ab(0x189)]('✔')+'\x20Context\x20set:\x20'+a26_0x1a6673['dim']('parent_segment')+'\x20=\x20'+a26_0x1a6673[_0x5719ab(0x22f)](_0x234ca2))),0x0;}}export class ParentSegmentPushCommand extends BaseCommand{['name']=a26_0x3760a6(0x19c);[a26_0x3760a6(0x1b9)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a26_0x3760a6(0x173)](_0x45b75f){const _0x175f2a=a26_0x3760a6,{options:_0x27b2a7,args:_0x3c6f76,tdx:_0x50df64}=_0x45b75f,_0x9c55eb=_0x27b2a7,_0x508482=_0x3c6f76[0x0]||_0x27b2a7[_0x175f2a(0x1ad)];if(!_0x508482)return console['error'](a26_0x1a6673['red'](_0x175f2a(0x1a6))),console[_0x175f2a(0x16b)](_0x175f2a(0x181)),console[_0x175f2a(0x16b)](a26_0x1a6673[_0x175f2a(0x22f)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first')),0x1;const _0x40f28a=resolveYamlFile(_0x508482);if(!existsSync(_0x40f28a))return showFileNotFoundError(_0x40f28a,_0x508482),0x1;_0x9c55eb[_0x175f2a(0x1f9)]&&(console[_0x175f2a(0x16b)](_0x175f2a(0x1a5)+_0x9c55eb['site']),console[_0x175f2a(0x16b)]('YAML\x20file:\x20'+_0x40f28a));let _0xafaa01;try{_0xafaa01=readFileSync(_0x40f28a,_0x175f2a(0x270));}catch(_0xf23e36){const _0x845014=_0xf23e36 instanceof Error?_0xf23e36[_0x175f2a(0x1c6)]:String(_0xf23e36);return console[_0x175f2a(0x16b)](_0x175f2a(0x279)+_0x845014),0x1;}const _0x48e185=await withSpinner('Analyzing\x20changes...',()=>_0x50df64[_0x175f2a(0x1bd)][_0x175f2a(0x216)](_0xafaa01),{'verbose':_0x9c55eb[_0x175f2a(0x1f9)]}),_0x15ab9a=_0x48e185[_0x175f2a(0x248)],{isNew:_0x3a8979,name:_0xed48ce,hasChanges:_0x247265,diffFormatted:_0x36b770}=_0x15ab9a;if(!_0x247265)return console[_0x175f2a(0x16b)](_0x175f2a(0x19a)+_0xed48ce+_0x175f2a(0x197)),0x0;_0x3a8979?console[_0x175f2a(0x16b)](_0x175f2a(0x186)+_0xed48ce+'\x27:'):console['error'](_0x175f2a(0x19d)+_0xed48ce+'\x27:');console[_0x175f2a(0x16b)]('─'['repeat'](0x3c)),console[_0x175f2a(0x16b)](_0x36b770),console[_0x175f2a(0x16b)]('─'[_0x175f2a(0x18e)](0x3c));const _0x87009b=_0x3a8979?_0x175f2a(0x229)+_0xed48ce+'\x27?':_0x175f2a(0x1f5)+_0xed48ce+'\x27?';if(!_0x9c55eb[_0x175f2a(0x1ef)]){const _0x5901e3=await confirmKey(_0x87009b);if(!_0x5901e3)return console[_0x175f2a(0x16b)](_0x175f2a(0x255)),0x1;}const _0x1dc1b3=_0x3a8979?_0x175f2a(0x23b):'Updating',_0x397e53=await withSpinner(_0x1dc1b3+'\x20parent\x20segment\x20\x27'+_0xed48ce+'\x27...',()=>_0x15ab9a[_0x175f2a(0x17a)](),{'verbose':_0x9c55eb[_0x175f2a(0x1f9)]}),_0x7e7967=_0x397e53[_0x175f2a(0x248)],_0x1d802c=getConsoleNextUrl(_0x9c55eb[_0x175f2a(0x207)],_0x175f2a(0x180)+_0x7e7967['id']),_0x2377d7=_0x3a8979?_0x175f2a(0x20a):_0x175f2a(0x1c1);return console[_0x175f2a(0x16b)]('✔\x20'+_0x2377d7+_0x175f2a(0x1f3)+_0x7e7967[_0x175f2a(0x1e7)]+'\x27'),console['error']('\x20\x20'+_0x1d802c),0x0;}}export class ParentSegmentValidateCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]='segment:parent:validate';[a26_0x3760a6(0x1b9)]=a26_0x3760a6(0x25f);async[a26_0x3760a6(0x173)](_0x44fa52){const _0x4776bc=a26_0x3760a6,{options:_0x596361,args:_0x4665d6,tdx:_0x42c33a}=_0x44fa52,_0x28544e=_0x596361,_0x1c4cc1=_0x4665d6[0x0]||_0x596361[_0x4776bc(0x1ad)];if(!_0x1c4cc1)return console[_0x4776bc(0x16b)](a26_0x1a6673[_0x4776bc(0x251)](_0x4776bc(0x1a6))),console[_0x4776bc(0x16b)]('Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a'),console[_0x4776bc(0x16b)](_0x4776bc(0x1b2)),console[_0x4776bc(0x16b)](_0x4776bc(0x217)),console[_0x4776bc(0x16b)]('\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)'),console[_0x4776bc(0x16b)](_0x4776bc(0x18b)),console[_0x4776bc(0x16b)](a26_0x1a6673[_0x4776bc(0x22f)](_0x4776bc(0x260))),0x1;const _0x1704e7=resolveYamlFile(_0x1c4cc1);if(!existsSync(_0x1704e7))return showFileNotFoundError(_0x1704e7,_0x1c4cc1),0x1;_0x28544e['verbose']&&(console['error']('Site:\x20'+_0x28544e[_0x4776bc(0x207)]),console[_0x4776bc(0x16b)](_0x4776bc(0x22b)+_0x1704e7));let _0x20b27b;try{_0x20b27b=readFileSync(_0x1704e7,_0x4776bc(0x270));}catch(_0x993cc3){const _0x2cd5af=_0x993cc3 instanceof Error?_0x993cc3[_0x4776bc(0x1c6)]:String(_0x993cc3);return console[_0x4776bc(0x16b)]('Error\x20reading\x20file:\x20'+_0x2cd5af),0x1;}const _0x48fcc6=createCommandSpinner(a26_0x1a6673['dim'](_0x4776bc(0x212)),{'verbose':_0x28544e[_0x4776bc(0x1f9)]});_0x48fcc6[_0x4776bc(0x177)]();const _0x2ae7c1={'onProgress':_0x2af4cb=>{const _0x449781=_0x4776bc;_0x48fcc6[_0x449781(0x209)]=formatProgressMessage(_0x2af4cb);}};if(_0x28544e['master'])_0x2ae7c1[_0x4776bc(0x1cf)]=!![];if(_0x28544e['enriched'])_0x2ae7c1['enriched']=!![];_0x28544e['attribute']&&(_0x2ae7c1[_0x4776bc(0x18c)]=_0x28544e[_0x4776bc(0x18c)]);_0x28544e[_0x4776bc(0x1f2)]&&(_0x2ae7c1[_0x4776bc(0x1f2)]=_0x28544e[_0x4776bc(0x1f2)]);if(_0x28544e['interval'])_0x2ae7c1[_0x4776bc(0x18a)]=_0x28544e[_0x4776bc(0x18a)];let _0x34c678;try{_0x34c678=await _0x42c33a['segment'][_0x4776bc(0x171)](_0x20b27b,_0x2ae7c1),_0x48fcc6[_0x4776bc(0x226)]();}catch(_0x496202){_0x48fcc6['stop']();throw _0x496202;}const _0x523ef8=_0x28544e[_0x4776bc(0x18a)]||_0x4776bc(0x1b5);return this[_0x4776bc(0x233)](_0x34c678,_0x2ae7c1,_0x1704e7,_0x523ef8),_0x34c678['allValid']?0x0:0x1;}[a26_0x3760a6(0x233)](_0x5b7428,_0x20b62a,_0x396fd6,_0x260afc){const _0x3777fa=a26_0x3760a6;console[_0x3777fa(0x16b)]('\x0a'+a26_0x1a6673[_0x3777fa(0x17f)](_0x3777fa(0x165))+'\x20'+_0x5b7428[_0x3777fa(0x1e7)]),console['error']('═'[_0x3777fa(0x18e)](0x3c)),this[_0x3777fa(0x249)](_0x5b7428);if(typeof _0x20b62a[_0x3777fa(0x18c)]===_0x3777fa(0x17d)){this[_0x3777fa(0x20b)](_0x5b7428),this[_0x3777fa(0x22c)](_0x5b7428),this[_0x3777fa(0x1ab)](_0x396fd6,_0x260afc,_0x3777fa(0x18c),_0x20b62a[_0x3777fa(0x18c)]);return;}if(_0x20b62a['attribute']===!![]){this[_0x3777fa(0x20b)](_0x5b7428),this[_0x3777fa(0x22c)](_0x5b7428),this['displayPreviewHints'](_0x396fd6,_0x260afc,_0x3777fa(0x236));return;}if(typeof _0x20b62a[_0x3777fa(0x1f2)]==='string'){this[_0x3777fa(0x1b7)](_0x5b7428,_0x260afc),this[_0x3777fa(0x22c)](_0x5b7428),this[_0x3777fa(0x1ab)](_0x396fd6,_0x260afc,_0x3777fa(0x1f2),_0x20b62a['behavior']);return;}if(_0x20b62a[_0x3777fa(0x1f2)]===!![]){this[_0x3777fa(0x1b7)](_0x5b7428,_0x260afc),this[_0x3777fa(0x22c)](_0x5b7428),this[_0x3777fa(0x1ab)](_0x396fd6,_0x260afc,_0x3777fa(0x185));return;}this[_0x3777fa(0x20b)](_0x5b7428),this[_0x3777fa(0x1b7)](_0x5b7428,_0x260afc),this[_0x3777fa(0x22c)](_0x5b7428),this[_0x3777fa(0x1ab)](_0x396fd6,_0x260afc,_0x3777fa(0x237));}[a26_0x3760a6(0x1ab)](_0x2ad835,_0x73424d,_0x1e17ba,_0x145c63){const _0x58bd5b=a26_0x3760a6;console[_0x58bd5b(0x16b)]('\x0a'+a26_0x1a6673[_0x58bd5b(0x1cb)](_0x58bd5b(0x1bc)));const _0x41c355=_0x73424d!==_0x58bd5b(0x1b5)?_0x58bd5b(0x16c)+_0x73424d:'';if(_0x1e17ba==='attribute'&&_0x145c63)console[_0x58bd5b(0x16b)]('\x20\x20'+a26_0x1a6673['dim'](_0x58bd5b(0x1f0)+_0x2ad835+_0x58bd5b(0x16a)+_0x145c63+'\x22'+_0x41c355));else{if(_0x1e17ba===_0x58bd5b(0x1f2)&&_0x145c63)console['error']('\x20\x20'+a26_0x1a6673[_0x58bd5b(0x1cb)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2ad835+_0x58bd5b(0x1ca)+_0x145c63+'\x22'+_0x41c355));else(_0x1e17ba===_0x58bd5b(0x236)||_0x1e17ba===_0x58bd5b(0x237))&&console[_0x58bd5b(0x16b)]('\x20\x20'+a26_0x1a6673[_0x58bd5b(0x1cb)](_0x58bd5b(0x1f0)+_0x2ad835+'\x20--attribute\x20\x22<name>\x22'+_0x41c355));}(_0x1e17ba===_0x58bd5b(0x185)||_0x1e17ba==='all')&&console[_0x58bd5b(0x16b)]('\x20\x20'+a26_0x1a6673['dim'](_0x58bd5b(0x1f0)+_0x2ad835+_0x58bd5b(0x252)+_0x41c355)),_0x1e17ba===_0x58bd5b(0x237)&&console['error']('\x20\x20'+a26_0x1a6673[_0x58bd5b(0x1cb)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2ad835+_0x58bd5b(0x1da)+_0x41c355));}['displayMasterInfo'](_0x44360c){const _0x5de74b=a26_0x3760a6,{master:_0x1f7924}=_0x44360c,_0x294fb5=_0x1f7924[_0x5de74b(0x256)]?a26_0x1a6673[_0x5de74b(0x189)]('✔'):a26_0x1a6673['red']('✘');console[_0x5de74b(0x16b)]('\x0a'+a26_0x1a6673[_0x5de74b(0x1cb)](_0x5de74b(0x1e4))),console[_0x5de74b(0x16b)](_0x294fb5+'\x20'+a26_0x1a6673[_0x5de74b(0x17f)](_0x1f7924[_0x5de74b(0x1a0)]+'.'+_0x1f7924[_0x5de74b(0x1c8)])),_0x1f7924[_0x5de74b(0x256)]?_0x1f7924[_0x5de74b(0x1d0)]!==undefined&&console[_0x5de74b(0x16b)]('\x20\x20'+a26_0x1a6673['dim']('Rows:')+'\x20'+a26_0x1a6673[_0x5de74b(0x22f)](formatRows(_0x1f7924['rowCount']))):console[_0x5de74b(0x16b)]('\x20\x20'+a26_0x1a6673['red'](_0x5de74b(0x178))+'\x20'+_0x1f7924[_0x5de74b(0x215)]);}['displayAttributesStats'](_0xa14317){const _0x420ba9=a26_0x3760a6;if(_0xa14317[_0x420ba9(0x236)]['length']===0x0)return;console[_0x420ba9(0x16b)]('\x0a'+a26_0x1a6673[_0x420ba9(0x1cb)](_0x420ba9(0x25a)));for(const _0x12178d of _0xa14317['attributes']){const _0x2924d2=_0x12178d[_0x420ba9(0x256)]?a26_0x1a6673[_0x420ba9(0x189)]('✔'):a26_0x1a6673[_0x420ba9(0x251)]('✘');let _0x3fb349='';if(_0x12178d[_0x420ba9(0x256)]&&_0x12178d[_0x420ba9(0x1f7)]!==undefined&&_0x12178d[_0x420ba9(0x168)]!==undefined){const _0x589873=_0x12178d['coveragePercent'][_0x420ba9(0x1fc)](0x1),_0x577a0a=_0x12178d[_0x420ba9(0x168)]>=0x50?a26_0x1a6673[_0x420ba9(0x189)]:_0x12178d[_0x420ba9(0x168)]>=0x32?a26_0x1a6673['yellow']:a26_0x1a6673['red'];_0x3fb349='\x20'+a26_0x1a6673[_0x420ba9(0x1cb)]('Coverage:')+'\x20'+_0x577a0a(_0x589873+'%')+'\x20('+formatRows(_0x12178d['matchedCount'])+'\x20rows)';}console['error'](_0x2924d2+'\x20'+a26_0x1a6673[_0x420ba9(0x17f)](_0x12178d[_0x420ba9(0x1e7)])+_0x3fb349),console[_0x420ba9(0x16b)]('\x20\x20'+a26_0x1a6673[_0x420ba9(0x1cb)](_0x420ba9(0x25e))+'\x20'+a26_0x1a6673[_0x420ba9(0x17f)](_0x12178d[_0x420ba9(0x1a0)]+'.'+_0x12178d['table']));const _0x3df6b9=_0x12178d[_0x420ba9(0x267)]===_0x12178d[_0x420ba9(0x18d)]?a26_0x1a6673[_0x420ba9(0x1cb)](_0x420ba9(0x21b))+'\x20'+_0x12178d['joinKey']:a26_0x1a6673[_0x420ba9(0x1cb)](_0x420ba9(0x1d3))+'\x20'+_0x12178d[_0x420ba9(0x267)]+'\x20=\x20'+_0x12178d['foreignKey'];console[_0x420ba9(0x16b)]('\x20\x20'+_0x3df6b9),console[_0x420ba9(0x16b)]('\x20\x20'+a26_0x1a6673['dim'](_0x420ba9(0x15e))),this[_0x420ba9(0x163)](_0x12178d[_0x420ba9(0x19b)]),!_0x12178d[_0x420ba9(0x256)]&&console[_0x420ba9(0x16b)]('\x20\x20'+a26_0x1a6673[_0x420ba9(0x251)](_0x420ba9(0x178))+'\x20'+_0x12178d[_0x420ba9(0x215)]);}}['displayBehaviorsStats'](_0x5bdef5,_0x235b16){const _0x5162a8=a26_0x3760a6;if(_0x5bdef5[_0x5162a8(0x185)]['length']===0x0)return;console[_0x5162a8(0x16b)]('\x0a'+a26_0x1a6673[_0x5162a8(0x1cb)](_0x5162a8(0x261))+'\x20'+a26_0x1a6673[_0x5162a8(0x1cb)]('('+_0x235b16+')'));for(const _0x46f33d of _0x5bdef5[_0x5162a8(0x185)]){const _0x26cdc2=_0x46f33d[_0x5162a8(0x256)]?a26_0x1a6673[_0x5162a8(0x189)]('✔'):a26_0x1a6673[_0x5162a8(0x251)]('✘');let _0x498e22='';if(_0x46f33d[_0x5162a8(0x256)]&&_0x46f33d['customersWithEvents']!==undefined&&_0x46f33d[_0x5162a8(0x1a1)]!==undefined){const _0x59cb08=_0x46f33d[_0x5162a8(0x23c)]?.[_0x5162a8(0x1fc)](0x1)||'?',_0x59d2b7=(_0x46f33d[_0x5162a8(0x23c)]??0x0)>=0x32?a26_0x1a6673[_0x5162a8(0x189)]:(_0x46f33d[_0x5162a8(0x23c)]??0x0)>=0x14?a26_0x1a6673[_0x5162a8(0x1ed)]:a26_0x1a6673['red'];_0x498e22='\x20'+a26_0x1a6673[_0x5162a8(0x1cb)](_0x5162a8(0x1dc))+'\x20'+_0x59d2b7(formatRows(_0x46f33d[_0x5162a8(0x20f)]))+'\x20('+_0x59cb08+_0x5162a8(0x1ec)+a26_0x1a6673[_0x5162a8(0x1cb)](_0x5162a8(0x26d))+'\x20'+a26_0x1a6673[_0x5162a8(0x22f)](formatRows(_0x46f33d[_0x5162a8(0x1a1)]));}console[_0x5162a8(0x16b)](_0x26cdc2+'\x20'+a26_0x1a6673[_0x5162a8(0x17f)](_0x46f33d[_0x5162a8(0x1e7)])+_0x498e22),console['error']('\x20\x20'+a26_0x1a6673[_0x5162a8(0x1cb)]('Source:')+'\x20'+a26_0x1a6673[_0x5162a8(0x17f)](_0x46f33d[_0x5162a8(0x1a0)]+'.'+_0x46f33d[_0x5162a8(0x1c8)]));const _0x399d58=_0x46f33d['joinKey']===_0x46f33d[_0x5162a8(0x18d)]?a26_0x1a6673[_0x5162a8(0x1cb)](_0x5162a8(0x21b))+'\x20'+_0x46f33d[_0x5162a8(0x267)]:a26_0x1a6673['dim'](_0x5162a8(0x1d3))+'\x20'+_0x46f33d[_0x5162a8(0x267)]+'\x20=\x20'+_0x46f33d['foreignKey'];console['error']('\x20\x20'+_0x399d58),console[_0x5162a8(0x16b)]('\x20\x20'+a26_0x1a6673['dim']('Columns:')),this[_0x5162a8(0x163)](_0x46f33d['columns']),!_0x46f33d[_0x5162a8(0x256)]&&console[_0x5162a8(0x16b)]('\x20\x20'+a26_0x1a6673[_0x5162a8(0x251)](_0x5162a8(0x178))+'\x20'+_0x46f33d[_0x5162a8(0x215)]);}}['displayColumns'](_0x3d0cc7){const _0xdb3f9b=a26_0x3760a6;for(const _0x11e439 of _0x3d0cc7){_0x11e439[_0xdb3f9b(0x22d)]===_0x11e439[_0xdb3f9b(0x1e2)]||_0x11e439[_0xdb3f9b(0x1e2)]==='*'?console[_0xdb3f9b(0x16b)](_0xdb3f9b(0x24a)+_0x11e439[_0xdb3f9b(0x22d)]):console[_0xdb3f9b(0x16b)]('\x20\x20\x20\x20-\x20'+_0x11e439[_0xdb3f9b(0x22d)]+'\x20'+a26_0x1a6673[_0xdb3f9b(0x1cb)]('('+_0x11e439[_0xdb3f9b(0x1e2)]+')'));}}['displaySummary'](_0x5c0fc6){const _0x8cabbf=a26_0x3760a6;console[_0x8cabbf(0x16b)]('─'[_0x8cabbf(0x18e)](0x3c));if(_0x5c0fc6[_0x8cabbf(0x1d7)][_0x8cabbf(0x1e3)]>0x0){console[_0x8cabbf(0x16b)]('\x0a'+a26_0x1a6673['red'](_0x8cabbf(0x202)));for(const _0x146d53 of _0x5c0fc6[_0x8cabbf(0x1d7)]){console['error']('\x20\x20'+a26_0x1a6673['red']('•')+'\x20'+_0x146d53);}}_0x5c0fc6[_0x8cabbf(0x1b4)]&&console[_0x8cabbf(0x16b)]('\x0a'+a26_0x1a6673[_0x8cabbf(0x189)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]='segment:parent:preview';[a26_0x3760a6(0x1b9)]=a26_0x3760a6(0x1cc);async[a26_0x3760a6(0x173)](_0x34860f){const _0x3ccc6f=a26_0x3760a6,{options:_0x1e6e0a,args:_0x490416,tdx:_0x10a8e2}=_0x34860f,_0x125d38=_0x1e6e0a,_0x47dd2e=_0x490416[0x0]||_0x1e6e0a['parentSegment'];if(!_0x47dd2e)return console[_0x3ccc6f(0x16b)](a26_0x1a6673[_0x3ccc6f(0x251)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console['error'](_0x3ccc6f(0x273)),console['error'](_0x3ccc6f(0x193)),console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x250)),console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x1d8)),console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x23e)),console['error'](_0x3ccc6f(0x1a3)),console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x18b)),console[_0x3ccc6f(0x16b)](a26_0x1a6673[_0x3ccc6f(0x22f)]('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;if(!_0x125d38[_0x3ccc6f(0x1cf)]&&!_0x125d38['attribute']&&!_0x125d38['behavior']&&!_0x125d38[_0x3ccc6f(0x26c)])return console[_0x3ccc6f(0x16b)](a26_0x1a6673[_0x3ccc6f(0x251)](_0x3ccc6f(0x164))),console['error'](_0x3ccc6f(0x273)),console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x1b2)),console[_0x3ccc6f(0x16b)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x1d8)),console[_0x3ccc6f(0x16b)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x1a3)),0x1;const _0xe92719=resolveYamlFile(_0x47dd2e);if(!existsSync(_0xe92719))return showFileNotFoundError(_0xe92719,_0x47dd2e),0x1;_0x125d38['verbose']&&(console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x1a5)+_0x125d38[_0x3ccc6f(0x207)]),console['error'](_0x3ccc6f(0x22b)+_0xe92719));let _0x435cbc;try{_0x435cbc=readFileSync(_0xe92719,_0x3ccc6f(0x270));}catch(_0x4edc74){const _0x44d24e=_0x4edc74 instanceof Error?_0x4edc74[_0x3ccc6f(0x1c6)]:String(_0x4edc74);return console['error']('Error\x20reading\x20file:\x20'+_0x44d24e),0x1;}let _0x3f2a88;try{_0x3f2a88=parseYamlString(_0x435cbc);}catch(_0x4c649e){const _0x179abc=_0x4c649e instanceof Error?_0x4c649e[_0x3ccc6f(0x1c6)]:String(_0x4c649e);return console['error'](a26_0x1a6673[_0x3ccc6f(0x251)](_0x3ccc6f(0x20c)+_0x179abc)),0x1;}if(_0x125d38[_0x3ccc6f(0x18c)]===!![]||_0x125d38[_0x3ccc6f(0x18c)]===''){const _0x337b2a=_0x3f2a88['attributes']?.['map'](_0x3488f1=>_0x3488f1[_0x3ccc6f(0x1e7)])||[];if(_0x337b2a[_0x3ccc6f(0x1e3)]===0x0)console[_0x3ccc6f(0x16b)](a26_0x1a6673['red'](_0x3ccc6f(0x221)));else{console['error'](a26_0x1a6673[_0x3ccc6f(0x251)](_0x3ccc6f(0x234))),console[_0x3ccc6f(0x16b)]('Available\x20attributes:');for(const _0xcf90d5 of _0x337b2a){console['error']('\x20\x20'+a26_0x1a6673[_0x3ccc6f(0x22f)](_0xcf90d5));}console[_0x3ccc6f(0x16b)](_0x3ccc6f(0x218)+_0x47dd2e+'\x20--attribute\x20\x22'+_0x337b2a[0x0]+'\x22');}return 0x1;}if(_0x125d38['behavior']===!![]||_0x125d38['behavior']===''){const _0x8ee578=_0x3f2a88[_0x3ccc6f(0x185)]?.[_0x3ccc6f(0x259)](_0x13871f=>_0x13871f[_0x3ccc6f(0x1e7)])||[];if(_0x8ee578[_0x3ccc6f(0x1e3)]===0x0)console[_0x3ccc6f(0x16b)](a26_0x1a6673[_0x3ccc6f(0x251)](_0x3ccc6f(0x1c0)));else{console[_0x3ccc6f(0x16b)](a26_0x1a6673[_0x3ccc6f(0x251)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x3ccc6f(0x200));for(const _0x3967c0 of _0x8ee578){console['error']('\x20\x20'+a26_0x1a6673['cyan'](_0x3967c0));}console[_0x3ccc6f(0x16b)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x47dd2e+_0x3ccc6f(0x1ca)+_0x8ee578[0x0]+'\x22');}return 0x1;}const _0x170b3a=createCommandSpinner(a26_0x1a6673[_0x3ccc6f(0x1cb)](_0x3ccc6f(0x19e)),{'verbose':_0x125d38[_0x3ccc6f(0x1f9)]});_0x170b3a[_0x3ccc6f(0x177)]();const _0x519ca8={'onProgress':_0x23440e=>{const _0x50ee94=_0x3ccc6f;_0x170b3a[_0x50ee94(0x209)]=formatProgressMessage(_0x23440e);}};if(_0x125d38[_0x3ccc6f(0x1cf)])_0x519ca8[_0x3ccc6f(0x1cf)]=!![];if(_0x125d38[_0x3ccc6f(0x18c)]&&typeof _0x125d38[_0x3ccc6f(0x18c)]===_0x3ccc6f(0x17d))_0x519ca8[_0x3ccc6f(0x18c)]=_0x125d38[_0x3ccc6f(0x18c)];if(_0x125d38[_0x3ccc6f(0x1f2)]&&typeof _0x125d38['behavior']===_0x3ccc6f(0x17d))_0x519ca8[_0x3ccc6f(0x1f2)]=_0x125d38['behavior'];if(_0x125d38[_0x3ccc6f(0x26c)])_0x519ca8['enriched']=!![];if(_0x125d38['interval'])_0x519ca8[_0x3ccc6f(0x18a)]=_0x125d38['interval'];let _0x1e60de;try{_0x1e60de=await _0x10a8e2['segment'][_0x3ccc6f(0x1dd)](_0x435cbc,_0x519ca8),_0x170b3a['stop']();}catch(_0x4b4ad1){_0x170b3a['stop']();throw _0x4b4ad1;}return await this['displayPreviewResults'](_0x1e60de,{'master':_0x125d38[_0x3ccc6f(0x1cf)],'attribute':typeof _0x125d38[_0x3ccc6f(0x18c)]===_0x3ccc6f(0x17d)?_0x125d38[_0x3ccc6f(0x18c)]:undefined,'behavior':typeof _0x125d38[_0x3ccc6f(0x1f2)]===_0x3ccc6f(0x17d)?_0x125d38[_0x3ccc6f(0x1f2)]:undefined,'enriched':_0x125d38['enriched']}),_0x1e60de[_0x3ccc6f(0x1b4)]?0x0:0x1;}async[a26_0x3760a6(0x25c)](_0xcf2e86,_0x1b0c5d){const _0x577112=a26_0x3760a6;console[_0x577112(0x16b)]('\x0a'+a26_0x1a6673['bold'](_0x577112(0x264))+'\x20'+_0xcf2e86['name']),console['error']('═'['repeat'](0x3c));if(_0x1b0c5d[_0x577112(0x1cf)]&&_0xcf2e86[_0x577112(0x196)]){const _0x547641=a26_0x1a6673[_0x577112(0x1cb)](_0x577112(0x23d))+'\x20'+a26_0x1a6673[_0x577112(0x17f)](_0xcf2e86[_0x577112(0x1cf)]['database']+'.'+_0xcf2e86[_0x577112(0x1cf)]['table']);await this['displaySampleData'](_0x547641,_0xcf2e86['sampleData']);}else{if(_0x1b0c5d[_0x577112(0x18c)]&&_0xcf2e86[_0x577112(0x196)]){const _0x26a28b=a26_0x1a6673[_0x577112(0x1cb)](_0x577112(0x230))+'\x20'+a26_0x1a6673[_0x577112(0x17f)](_0x1b0c5d[_0x577112(0x18c)]);await this['displaySampleData'](_0x26a28b,_0xcf2e86[_0x577112(0x196)]);}else{if(_0x1b0c5d[_0x577112(0x1f2)]&&_0xcf2e86[_0x577112(0x196)]){const _0x454388=a26_0x1a6673['dim'](_0x577112(0x214))+'\x20'+a26_0x1a6673[_0x577112(0x17f)](_0x1b0c5d[_0x577112(0x1f2)]);await this['displaySampleData'](_0x454388,_0xcf2e86[_0x577112(0x196)]);}else{if(_0x1b0c5d[_0x577112(0x26c)]&&_0xcf2e86['sampleData']){const _0x5165d3=a26_0x1a6673[_0x577112(0x1cb)](_0x577112(0x1ba))+'\x20'+a26_0x1a6673['bold'](_0x577112(0x208));await this[_0x577112(0x18f)](_0x5165d3,_0xcf2e86[_0x577112(0x196)]);}else!_0xcf2e86[_0x577112(0x196)]&&console['error']('\x0aNo\x20sample\x20data\x20available');}}}if(_0xcf2e86[_0x577112(0x1d7)][_0x577112(0x1e3)]>0x0){console[_0x577112(0x16b)]('─'['repeat'](0x3c)),console['error']('\x0a'+a26_0x1a6673[_0x577112(0x251)](_0x577112(0x202)));for(const _0x23fe58 of _0xcf2e86['errors']){console[_0x577112(0x16b)]('\x20\x20'+a26_0x1a6673[_0x577112(0x251)]('•')+'\x20'+_0x23fe58);}}}async['displaySampleData'](_0x350612,_0x1d2604){const _0x46cdad=a26_0x3760a6;if(_0x1d2604[_0x46cdad(0x1e3)]===0x0){console[_0x46cdad(0x16b)]('\x0a'+_0x350612),console[_0x46cdad(0x16b)](_0x46cdad(0x1be));return;}console[_0x46cdad(0x16b)]('\x0a'+_0x350612);const _0x4c3929=Object[_0x46cdad(0x203)](_0x1d2604[0x0])['map'](_0xb118e1=>({'name':_0xb118e1,'type':typeof _0x1d2604[0x0][_0xb118e1]==='number'?_0x46cdad(0x194):_0x46cdad(0x228)})),_0xa24a5c={'queryId':_0x46cdad(0x266),'columns':_0x4c3929,'data':_0x1d2604,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1d2604[_0x46cdad(0x1e3)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4fb317=formatAsTable(_0xa24a5c,_0x1d2604[_0x46cdad(0x1e3)],!![]);await writeOutput(_0x4fb317,undefined,_0x46cdad(0x1c8));}}export class ParentSegmentRunCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]=a26_0x3760a6(0x15f);[a26_0x3760a6(0x1b9)]=a26_0x3760a6(0x1b1);async[a26_0x3760a6(0x173)](_0x36f8de){const _0x243b6e=a26_0x3760a6,{options:_0x3d1e1b,args:_0x29649e,tdx:_0x4a3887}=_0x36f8de,_0x33ec90=_0x3d1e1b,_0x2ae850=_0x29649e[0x0]||_0x3d1e1b['parentSegment'];if(!_0x2ae850)return console[_0x243b6e(0x16b)](a26_0x1a6673[_0x243b6e(0x251)](_0x243b6e(0x1a6))),console[_0x243b6e(0x16b)](_0x243b6e(0x235)),console[_0x243b6e(0x16b)](a26_0x1a6673[_0x243b6e(0x22f)](_0x243b6e(0x21c))),0x1;const _0x386b49=resolveYamlFile(_0x2ae850);if(existsSync(_0x386b49)){_0x33ec90[_0x243b6e(0x1f9)]&&console['error'](_0x243b6e(0x1c2)+_0x386b49);let _0x4fb87e;try{_0x4fb87e=readFileSync(_0x386b49,_0x243b6e(0x270));}catch(_0x1e7070){const _0x4d5a3a=_0x1e7070 instanceof Error?_0x1e7070[_0x243b6e(0x1c6)]:String(_0x1e7070);return console[_0x243b6e(0x16b)](_0x243b6e(0x279)+_0x4d5a3a),0x1;}const _0x5c2155=await withSpinner(_0x243b6e(0x246),()=>_0x4a3887[_0x243b6e(0x1bd)]['pushParentYaml'](_0x4fb87e),{'verbose':_0x33ec90[_0x243b6e(0x1f9)]}),_0x59755a=_0x5c2155[_0x243b6e(0x248)],{isNew:_0x454361,name:_0xa07cf8,hasChanges:_0x4d62ff,diffFormatted:_0xa47c18}=_0x59755a;if(_0x4d62ff){_0x454361?console[_0x243b6e(0x16b)](_0x243b6e(0x186)+_0xa07cf8+'\x27:'):console[_0x243b6e(0x16b)](_0x243b6e(0x19d)+_0xa07cf8+'\x27:');console['error']('─'['repeat'](0x3c)),console[_0x243b6e(0x16b)](_0xa47c18),console[_0x243b6e(0x16b)]('─'['repeat'](0x3c));const _0x3ef29f=_0x454361?_0x243b6e(0x229)+_0xa07cf8+_0x243b6e(0x1fd):_0x243b6e(0x1f5)+_0xa07cf8+_0x243b6e(0x1fd);if(!_0x33ec90[_0x243b6e(0x1ef)]){const _0x51c84d=await confirmKey(_0x3ef29f);if(!_0x51c84d)return console[_0x243b6e(0x16b)](_0x243b6e(0x255)),0x1;}const _0x32d630=_0x454361?'Creating':_0x243b6e(0x1c7);await withSpinner(_0x32d630+_0x243b6e(0x1f3)+_0xa07cf8+'\x27...',()=>_0x59755a['apply'](),{'verbose':_0x33ec90[_0x243b6e(0x1f9)]});const _0x33e542=_0x454361?_0x243b6e(0x20a):_0x243b6e(0x1c1);console[_0x243b6e(0x16b)]('✔\x20'+_0x33e542+_0x243b6e(0x1f3)+_0xa07cf8+'\x27');}else console[_0x243b6e(0x16b)](_0x243b6e(0x19a)+_0xa07cf8+'\x27\x20is\x20up\x20to\x20date');}const _0x214e54=await withSpinner(_0x243b6e(0x182)+_0x2ae850+'\x27...',()=>_0x4a3887['segment']['runParent'](_0x2ae850),{'verbose':_0x33ec90[_0x243b6e(0x1f9)]}),_0x30c571=_0x214e54[_0x243b6e(0x248)],_0x1d6ebf=getConsoleUrl(_0x33ec90['site'],_0x243b6e(0x1fb)+_0x30c571[_0x243b6e(0x24d)]+'/sessions/'+_0x30c571[_0x243b6e(0x192)]+_0x243b6e(0x1d4)+_0x30c571[_0x243b6e(0x1ae)]);return console[_0x243b6e(0x16b)](_0x243b6e(0x1ee)),console['error']('\x20\x20'+a26_0x1a6673[_0x243b6e(0x1cb)](_0x243b6e(0x1f8))+'\x20'+_0x30c571['audienceId']),console['error']('\x20\x20'+a26_0x1a6673[_0x243b6e(0x1cb)](_0x243b6e(0x257))+'\x20'+_0x30c571[_0x243b6e(0x276)]),console[_0x243b6e(0x16b)]('\x20\x20'+a26_0x1a6673['dim'](_0x243b6e(0x1fa))+'\x20'+_0x30c571[_0x243b6e(0x192)]),console[_0x243b6e(0x16b)]('\x20\x20'+a26_0x1a6673[_0x243b6e(0x1cb)](_0x243b6e(0x184))+'\x20'+_0x30c571['workflowAttemptId']),console[_0x243b6e(0x16b)]('\x20\x20'+_0x1d6ebf),console[_0x243b6e(0x16b)]('\x0a'+a26_0x1a6673[_0x243b6e(0x1cb)](_0x243b6e(0x1f1))+_0x243b6e(0x241)+_0x30c571['workflowAttemptId']+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a26_0x3760a6(0x271);['description']=a26_0x3760a6(0x161);async[a26_0x3760a6(0x173)](_0x37ce97){const _0x3ebb8d=a26_0x3760a6,{options:_0x2d3abb,args:_0x90bc16,tdx:_0x37200f}=_0x37ce97,_0x2d3aba=_0x90bc16[0x0]||_0x2d3abb[_0x3ebb8d(0x1ad)];if(!_0x2d3aba)return console['error'](a26_0x1a6673[_0x3ebb8d(0x251)](_0x3ebb8d(0x1a6))),console[_0x3ebb8d(0x16b)](_0x3ebb8d(0x167)),console[_0x3ebb8d(0x16b)](a26_0x1a6673['cyan'](_0x3ebb8d(0x21c))),0x1;_0x2d3abb[_0x3ebb8d(0x1f9)]&&(console[_0x3ebb8d(0x16b)](_0x3ebb8d(0x1a5)+_0x2d3abb[_0x3ebb8d(0x207)]),console[_0x3ebb8d(0x16b)](_0x3ebb8d(0x22a)+_0x2d3aba));const _0x284d9a=await withSpinner(_0x3ebb8d(0x274)+_0x2d3aba+_0x3ebb8d(0x1a8),()=>_0x37200f[_0x3ebb8d(0x1bd)][_0x3ebb8d(0x1c4)](_0x2d3aba),{'verbose':_0x2d3abb[_0x3ebb8d(0x1f9)]}),_0x390acf=_0x284d9a[_0x3ebb8d(0x248)];console[_0x3ebb8d(0x16b)](_0x3ebb8d(0x1d6)+_0x390acf[_0x3ebb8d(0x1e3)]+'\x20field'+(_0x390acf[_0x3ebb8d(0x1e3)]!==0x1?'s':''));if(_0x2d3abb[_0x3ebb8d(0x201)]||_0x2d3abb[_0x3ebb8d(0x179)])return await handleSDKOutput(_0x390acf,_0x2d3abb),0x0;return displayFieldsHumanReadable(_0x390acf,_0x2d3aba),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]='segment:parent:view';['description']='Show\x20parent\x20segment\x20details';async['execute'](_0x19ec0f){const _0x4c53df=a26_0x3760a6,{options:_0x5abdec,args:_0x206949,tdx:_0x29b81e}=_0x19ec0f,_0x2b98f7=_0x5abdec,_0xb38b99=_0x206949[0x0]||_0x5abdec[_0x4c53df(0x1ad)];if(!_0xb38b99)return console[_0x4c53df(0x16b)](a26_0x1a6673['red'](_0x4c53df(0x1a6))),console[_0x4c53df(0x16b)](_0x4c53df(0x227)),console[_0x4c53df(0x16b)](_0x4c53df(0x1b2)),console[_0x4c53df(0x16b)](_0x4c53df(0x160)),console[_0x4c53df(0x16b)](a26_0x1a6673[_0x4c53df(0x22f)](_0x4c53df(0x260))),0x1;_0x5abdec[_0x4c53df(0x1f9)]&&(console[_0x4c53df(0x16b)](_0x4c53df(0x1a5)+_0x5abdec[_0x4c53df(0x207)]),console[_0x4c53df(0x16b)]('Parent\x20segment:\x20'+_0xb38b99));const _0x4b348d=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0xb38b99+_0x4c53df(0x1a8),()=>_0x29b81e[_0x4c53df(0x1bd)][_0x4c53df(0x262)](_0xb38b99),{'verbose':_0x5abdec[_0x4c53df(0x1f9)]}),_0x5a3eb8=_0x4b348d[_0x4c53df(0x248)];if(_0x2b98f7[_0x4c53df(0x247)]){const _0x23d641=getConsoleNextUrl(_0x2b98f7[_0x4c53df(0x207)],_0x4c53df(0x180)+_0x5a3eb8['id']);return console['error'](a26_0x1a6673[_0x4c53df(0x189)]('✔')+_0x4c53df(0x24b)+a26_0x1a6673['cyan'](_0x23d641)),openBrowser(_0x23d641),0x0;}return await handleSingleObjectOutput(_0x5a3eb8,_0x5abdec),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]=a26_0x3760a6(0x275);[a26_0x3760a6(0x1b9)]=a26_0x3760a6(0x1b8);async['execute'](_0x1a974c){const _0x610404=a26_0x3760a6,{options:_0x4cce5a,args:_0x480a33,tdx:_0x52efad}=_0x1a974c,_0x3177b9=_0x480a33[0x0]||_0x4cce5a[_0x610404(0x1ad)];if(!_0x3177b9)return console[_0x610404(0x16b)](a26_0x1a6673[_0x610404(0x251)](_0x610404(0x1a6))),console[_0x610404(0x16b)]('Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a'),console[_0x610404(0x16b)](a26_0x1a6673['cyan'](_0x610404(0x21c))),0x1;_0x4cce5a[_0x610404(0x1f9)]&&(console[_0x610404(0x16b)]('Site:\x20'+_0x4cce5a[_0x610404(0x207)]),console[_0x610404(0x16b)]('Parent\x20segment:\x20'+_0x3177b9));const _0x3129a3=await withSpinner(_0x610404(0x1ac)+_0x3177b9+_0x610404(0x1a8),()=>_0x52efad[_0x610404(0x1bd)][_0x610404(0x24c)](_0x3177b9),{'verbose':_0x4cce5a[_0x610404(0x1f9)]}),_0x233f74=_0x3129a3[_0x610404(0x248)],_0x6fd946=await withSpinner(_0x610404(0x24e)+_0x3177b9+_0x610404(0x1a8),()=>_0x52efad[_0x610404(0x1bd)][_0x610404(0x23a)](_0x233f74),{'verbose':_0x4cce5a[_0x610404(0x1f9)]}),_0x5c4cf3=await executeSchemaQuery(_0x6fd946['data'],_0x52efad,_0x4cce5a);return await handleQueryOutput(_0x5c4cf3,_0x4cce5a),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]='segment:parent:sql';[a26_0x3760a6(0x1b9)]=a26_0x3760a6(0x24f);async['execute'](_0x3a712e){const _0x48ec78=a26_0x3760a6,{options:_0x5e9083,args:_0x3011c7,tdx:_0x587e3e}=_0x3a712e,_0x2adedd=_0x3011c7[0x0]||_0x5e9083[_0x48ec78(0x1ad)];if(!_0x2adedd)return console[_0x48ec78(0x16b)](a26_0x1a6673['red'](_0x48ec78(0x1a6))),console['error'](_0x48ec78(0x204)),console[_0x48ec78(0x16b)](a26_0x1a6673[_0x48ec78(0x22f)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x5e9083[_0x48ec78(0x1f9)]&&(console['error']('Site:\x20'+_0x5e9083[_0x48ec78(0x207)]),console[_0x48ec78(0x16b)](_0x48ec78(0x22a)+_0x2adedd));const _0x23069f=await withSpinner(_0x48ec78(0x1ac)+_0x2adedd+_0x48ec78(0x1a8),()=>_0x587e3e[_0x48ec78(0x1bd)]['resolveParentId'](_0x2adedd),{'verbose':_0x5e9083[_0x48ec78(0x1f9)]}),_0x1da704=_0x23069f['data'],_0x30cb39=await withSpinner(_0x48ec78(0x24e)+_0x2adedd+'\x27...',()=>_0x587e3e['segment'][_0x48ec78(0x23a)](_0x1da704),{'verbose':_0x5e9083['verbose']}),_0x44a890=_0x30cb39[_0x48ec78(0x248)];return _0x5e9083[_0x48ec78(0x224)]===_0x48ec78(0x201)||_0x5e9083[_0x48ec78(0x224)]===_0x48ec78(0x179)?await handleSDKOutput([{'sql':_0x44a890}],_0x5e9083):console[_0x48ec78(0x195)](_0x44a890),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a26_0x3760a6(0x1e7)]='segment:parent:show';[a26_0x3760a6(0x1b9)]=a26_0x3760a6(0x231);async['execute'](_0x5c8041){const _0x1a642e=a26_0x3760a6,{options:_0x50a5bb,args:_0x286f8e,tdx:_0x3c4c1b}=_0x5c8041,_0x1fc4f8=_0x286f8e[0x0]||_0x50a5bb['parentSegment'];if(!_0x1fc4f8)return console[_0x1a642e(0x16b)](a26_0x1a6673[_0x1a642e(0x251)](_0x1a642e(0x1a6))),console[_0x1a642e(0x16b)](_0x1a642e(0x16d)),console['error'](a26_0x1a6673['cyan'](_0x1a642e(0x21c))),0x1;_0x50a5bb[_0x1a642e(0x1f9)]&&(console['error']('Site:\x20'+_0x50a5bb[_0x1a642e(0x207)]),console['error'](_0x1a642e(0x22a)+_0x1fc4f8));const _0x4e0934=await withSpinner(_0x1a642e(0x1ac)+_0x1fc4f8+_0x1a642e(0x1a8),()=>_0x3c4c1b['segment'][_0x1a642e(0x24c)](_0x1fc4f8),{'verbose':_0x50a5bb[_0x1a642e(0x1f9)]}),_0x4c3009=_0x4e0934[_0x1a642e(0x248)],_0x40a9ea=await withSpinner(_0x1a642e(0x24e)+_0x1fc4f8+_0x1a642e(0x1a8),()=>_0x3c4c1b[_0x1a642e(0x1bd)]['getParentSQL'](_0x4c3009),{'verbose':_0x50a5bb[_0x1a642e(0x1f9)]});let _0x16d0f6=_0x40a9ea['data'];const _0xec1cf=resolveLimit(_0x50a5bb['limit'],DEFAULT_DISPLAY_LIMIT),_0x2b1e8f=/\bLIMIT\s+\d+/i[_0x1a642e(0x225)](_0x16d0f6);!_0x2b1e8f&&(_0x16d0f6=_0x16d0f6[_0x1a642e(0x211)]()[_0x1a642e(0x277)](/;+$/,''),_0x16d0f6=_0x1a642e(0x242)+_0x16d0f6+_0x1a642e(0x26f)+_0xec1cf);_0x50a5bb[_0x1a642e(0x1f9)]&&console['error']('SQL\x20query:\x0a'+_0x16d0f6);const _0x3af427=await withQuerySpinner(_0x1a642e(0x265),async _0x417afe=>{const _0x35c5ea=_0x1a642e,_0x4ded51=await _0x3c4c1b[_0x35c5ea(0x190)][_0x35c5ea(0x173)](_0x16d0f6,{'catalog':'td','schema':_0x35c5ea(0x1f4),'onJobId':_0x1c2c93=>{const _0x444f75=_0x35c5ea;_0x417afe[_0x444f75(0x1de)](_0x1c2c93);}});return _0x4ded51;},{'verbose':_0x50a5bb['verbose']}),_0x45065b=_0x3af427[_0x1a642e(0x248)],_0x4812f3=_0x45065b[_0x1a642e(0x174)]?_0x1a642e(0x172)+_0x45065b[_0x1a642e(0x174)]+']':'';return console[_0x1a642e(0x16b)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x45065b['stats'][_0x1a642e(0x278)][_0x1a642e(0x16e)]()+_0x1a642e(0x21e)+(_0x1a642e(0x199)+formatElapsed(_0x45065b[_0x1a642e(0x263)][_0x1a642e(0x1b0)])+_0x4812f3)),await handleQueryOutput(_0x45065b,_0x50a5bb),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x5b19a7=a27_0x394f;function a27_0x394f(_0x47ae3c,_0x54ae99){const _0x293239=a27_0x2932();return a27_0x394f=function(_0x394f07,_0x4f730f){_0x394f07=_0x394f07-0x116;let _0x213d09=_0x293239[_0x394f07];return _0x213d09;},a27_0x394f(_0x47ae3c,_0x54ae99);}(function(_0x2e2ea1,_0x30b8d7){const _0x287dba=a27_0x394f,_0x91e49b=_0x2e2ea1();while(!![]){try{const _0x1ca43b=-parseInt(_0x287dba(0x11b))/0x1+parseInt(_0x287dba(0x126))/0x2+-parseInt(_0x287dba(0x11c))/0x3+parseInt(_0x287dba(0x117))/0x4*(parseInt(_0x287dba(0x11a))/0x5)+-parseInt(_0x287dba(0x11f))/0x6*(-parseInt(_0x287dba(0x11e))/0x7)+-parseInt(_0x287dba(0x125))/0x8*(-parseInt(_0x287dba(0x119))/0x9)+-parseInt(_0x287dba(0x127))/0xa;if(_0x1ca43b===_0x30b8d7)break;else _0x91e49b['push'](_0x91e49b['shift']());}catch(_0x481977){_0x91e49b['push'](_0x91e49b['shift']());}}}(a27_0x2932,0x6c1f7));function a27_0x2932(){const _0x1d40bb=['156140RzWTqh','profiles','error','config','23924fhAAdt','name','63243nPWode','560ryjRZD','691431cCnFHm','1417098hfQJaK','log','14KiuvWf','312834mAFKgE','length','message','Error:\x20','map','description','720MiUSKS','431404VAvYZi'];a27_0x2932=function(){return _0x1d40bb;};return a27_0x2932();}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{[a27_0x5b19a7(0x118)]=a27_0x5b19a7(0x128);[a27_0x5b19a7(0x124)]='List\x20all\x20available\x20profiles';async['execute'](_0x34760b){const _0x26310b=a27_0x5b19a7,{options:_0x44e161}=_0x34760b;try{const _0x12ef37=listProfiles(),_0x45106a=getActiveProfile();if(_0x12ef37[_0x26310b(0x120)]===0x0)return console[_0x26310b(0x11d)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x26310b(0x11d)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x26310b(0x11d)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x2cadef=_0x12ef37[_0x26310b(0x123)](_0x4eaa24=>{const _0x435f10=_0x26310b,_0x36831d=_0x4eaa24[_0x435f10(0x118)]===_0x45106a,_0x3e35c5=getProfileParams(_0x4eaa24[_0x435f10(0x116)]);return{'name':_0x4eaa24[_0x435f10(0x118)],'active':_0x36831d,'scope':_0x4eaa24['scope'],'description':_0x4eaa24[_0x435f10(0x116)][_0x435f10(0x124)]||'','params':_0x3e35c5};});return await handleSDKOutput(_0x2cadef,_0x44e161),0x0;}catch(_0x37fbb7){return _0x37fbb7 instanceof Error&&console[_0x26310b(0x129)](_0x26310b(0x122)+_0x37fbb7[_0x26310b(0x121)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x439d(_0x1477e4,_0x4a8393){const _0x4172a8=a28_0x4172();return a28_0x439d=function(_0x439d18,_0x2c0c83){_0x439d18=_0x439d18-0x1dd;let _0x564b8a=_0x4172a8[_0x439d18];return _0x564b8a;},a28_0x439d(_0x1477e4,_0x4a8393);}const a28_0x199609=a28_0x439d;(function(_0x4e3034,_0x186b60){const _0x48f001=a28_0x439d,_0x4e1634=_0x4e3034();while(!![]){try{const _0x47c376=-parseInt(_0x48f001(0x200))/0x1+-parseInt(_0x48f001(0x202))/0x2*(parseInt(_0x48f001(0x1ec))/0x3)+-parseInt(_0x48f001(0x203))/0x4+-parseInt(_0x48f001(0x1f0))/0x5*(parseInt(_0x48f001(0x1fc))/0x6)+parseInt(_0x48f001(0x204))/0x7+-parseInt(_0x48f001(0x201))/0x8*(parseInt(_0x48f001(0x1f5))/0x9)+-parseInt(_0x48f001(0x206))/0xa*(-parseInt(_0x48f001(0x1ef))/0xb);if(_0x47c376===_0x186b60)break;else _0x4e1634['push'](_0x4e1634['shift']());}catch(_0x33522b){_0x4e1634['push'](_0x4e1634['shift']());}}}(a28_0x4172,0x1b735));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a28_0x4172(){const _0x18fc78=['\x20-\x20','site','stats','8883YThyIQ','\x20[Job\x20ID:\x20','\x20splits','processedRows','Executing\x20query\x20[','Executing\x20statement\x20','Executing\x20query...','713886bWlzQd','information_schema','Query\x20completed:\x20Processed\x20','error','103005QAWqrX','904NXnqLp','76324kVQRhR','82408JbhOfL','1210468utbNiF','data','10WoJQkg','options','\x0aAll\x20results\x20saved\x20to\x20','in\x20','setExtra','originalMessage','Run\x20Trino\x20queries\x20(streaming)','join','description','Site:\x20','name','Error:\x20','database','Statement\x20','execute','output','...','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','message','verbose','setJobId','completedSplits','file','jobId','\x20rows\x20','length','Schema:\x20','SQL:\x20','push','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','totalSplits','15JgnfpL','args','Catalog:\x20','5328862mJSpex','5VkLvnW','validate'];a28_0x4172=function(){return _0x18fc78;};return a28_0x4172();}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a28_0x199609(0x210)]='query';[a28_0x199609(0x20e)]=a28_0x199609(0x20c);async[a28_0x199609(0x214)](_0x38a347){const _0x2fd8ec=a28_0x199609,{options:_0x33f2eb,args:_0x60d5c7,tdx:_0x2e263b}=_0x38a347,_0x1bb8f2=_0x60d5c7[0x0],_0x1cdfc5=_0x33f2eb[_0x2fd8ec(0x1e3)];let _0x219264;if(_0x1cdfc5)try{_0x219264=readSqlStatementsFromFile(_0x1cdfc5);}catch(_0xcc824b){return console[_0x2fd8ec(0x1ff)]('Error:\x20'+_0xcc824b['message']),0x1;}else try{_0x219264=splitSqlStatements(_0x1bb8f2);}catch(_0x7c7989){return console['error'](_0x2fd8ec(0x211)+_0x7c7989[_0x2fd8ec(0x1df)]),0x1;}const _0x1ae020=_0x33f2eb[_0x2fd8ec(0x212)]||_0x2fd8ec(0x1fd),_0x4722ad=_0x33f2eb['catalog'];try{const _0x2f82d9=[],_0x44420c=!!_0x33f2eb[_0x2fd8ec(0x215)];for(let _0x7b7ce2=0x0;_0x7b7ce2<_0x219264[_0x2fd8ec(0x1e6)];_0x7b7ce2++){const _0x3cefc8=_0x219264[_0x7b7ce2],_0x1614a7=_0x7b7ce2+0x1,_0x7ae8c8=_0x219264[_0x2fd8ec(0x1e6)],_0x26235a=_0x7ae8c8>0x1;_0x33f2eb['verbose']&&(console[_0x2fd8ec(0x1ff)]('\x0a'+(_0x26235a?_0x2fd8ec(0x213)+_0x1614a7+'/'+_0x7ae8c8+':':'')),console[_0x2fd8ec(0x1ff)](_0x2fd8ec(0x20f)+_0x33f2eb[_0x2fd8ec(0x1f3)]),console['error'](_0x2fd8ec(0x1ee)+(_0x4722ad||'td')),console[_0x2fd8ec(0x1ff)](_0x2fd8ec(0x1e7)+_0x1ae020),console['error'](_0x2fd8ec(0x1e8)+_0x3cefc8));const _0x1fda8b=_0x26235a?_0x2fd8ec(0x1fa)+_0x1614a7+'/'+_0x7ae8c8+_0x2fd8ec(0x1dd):_0x2fd8ec(0x1fb);try{const _0x236565=await withQuerySpinner(_0x1fda8b,async _0x443a75=>{const _0x4d8ba0=_0x2fd8ec,_0x238566=await _0x2e263b['query'][_0x4d8ba0(0x214)](_0x3cefc8,{'catalog':_0x4722ad,'schema':_0x1ae020,'onJobId':_0x1add02=>{const _0x1328d5=_0x4d8ba0;_0x443a75[_0x1328d5(0x1e1)](_0x1add02);},'onProgress':_0x59c87d=>{const _0x4d212d=_0x4d8ba0;_0x443a75['setPhase'](_0x4d212d(0x1f9)+_0x59c87d['state']+']'),_0x443a75[_0x4d212d(0x20a)](formatRows(_0x59c87d[_0x4d212d(0x1f8)])+_0x4d212d(0x1e5)+_0x59c87d[_0x4d212d(0x1e2)]+'/'+_0x59c87d[_0x4d212d(0x1eb)]+_0x4d212d(0x1f7));}});return _0x238566;},{'verbose':_0x33f2eb[_0x2fd8ec(0x1e0)]}),_0x42fdeb=_0x236565[_0x2fd8ec(0x205)],_0x53cabf=_0x42fdeb[_0x2fd8ec(0x1e4)]?_0x2fd8ec(0x1f6)+_0x42fdeb[_0x2fd8ec(0x1e4)]+']':'',_0x2317b5=_0x26235a?'Statement\x20'+_0x1614a7+'/'+_0x7ae8c8+_0x2fd8ec(0x1f2):'';console[_0x2fd8ec(0x1ff)]('✔\x20'+_0x2317b5+_0x2fd8ec(0x1fe)+formatRows(_0x42fdeb[_0x2fd8ec(0x1f4)][_0x2fd8ec(0x1f8)])+_0x2fd8ec(0x1e5)+(_0x2fd8ec(0x209)+formatElapsed(_0x42fdeb['stats']['elapsedTimeMillis'])+_0x53cabf));if(_0x26235a&&_0x44420c){const _0x5c76ff=resolveOutputOptions(_0x33f2eb),_0x2595a3=await formatQueryOutput(_0x42fdeb,_0x5c76ff);_0x2f82d9[_0x2fd8ec(0x1e9)](_0x2595a3);}else await handleQueryOutput(_0x42fdeb,_0x33f2eb);}catch(_0x5464f3){const _0x215177=_0x26235a?_0x2fd8ec(0x213)+_0x1614a7+'/'+_0x7ae8c8+':\x0a':'',_0x512c73=_0x5464f3 instanceof SDKError?_0x5464f3[_0x2fd8ec(0x20b)]:_0x5464f3[_0x2fd8ec(0x1df)];return console[_0x2fd8ec(0x1ff)](''+_0x215177+_0x512c73),0x1;}}if(_0x219264['length']>0x1&&_0x44420c&&_0x2f82d9[_0x2fd8ec(0x1e6)]>0x0){const _0x553f18=_0x2f82d9[_0x2fd8ec(0x20d)]('\x0a');writeFileSync(_0x33f2eb[_0x2fd8ec(0x215)],_0x553f18),console[_0x2fd8ec(0x1ff)](_0x2fd8ec(0x208)+_0x33f2eb[_0x2fd8ec(0x215)]);}return 0x0;}catch(_0x1027ab){throw _0x1027ab;}}[a28_0x199609(0x1f1)](_0x1df3e9){const _0x4a3d49=a28_0x199609,_0x59e572=_0x1df3e9[_0x4a3d49(0x1ed)][0x0],_0x3532a8=_0x1df3e9[_0x4a3d49(0x207)][_0x4a3d49(0x1e3)];if(!_0x59e572&&!_0x3532a8)return _0x4a3d49(0x1de);if(_0x59e572&&_0x3532a8)return _0x4a3d49(0x1ea);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x66827c=a29_0x8630;(function(_0x585f7f,_0x36235e){const _0x6a7117=a29_0x8630,_0x20e171=_0x585f7f();while(!![]){try{const _0x1edf35=parseInt(_0x6a7117(0x1d2))/0x1*(parseInt(_0x6a7117(0x1da))/0x2)+parseInt(_0x6a7117(0x22b))/0x3+-parseInt(_0x6a7117(0x22c))/0x4*(parseInt(_0x6a7117(0x23c))/0x5)+parseInt(_0x6a7117(0x21e))/0x6+parseInt(_0x6a7117(0x212))/0x7*(-parseInt(_0x6a7117(0x1c8))/0x8)+-parseInt(_0x6a7117(0x223))/0x9+parseInt(_0x6a7117(0x241))/0xa;if(_0x1edf35===_0x36235e)break;else _0x20e171['push'](_0x20e171['shift']());}catch(_0x1dbcd6){_0x20e171['push'](_0x20e171['shift']());}}}(a29_0x1e04,0x9ffa9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';export class SegmentDescribeCommand extends BaseCommand{[a29_0x66827c(0x1d0)]=a29_0x66827c(0x23f);['description']=a29_0x66827c(0x240);async[a29_0x66827c(0x1ed)](_0x29005b){const _0x4fa812=a29_0x66827c,{options:_0x2cdd2c,args:_0x3dfeea,tdx:_0x922457}=_0x29005b,_0x337199=_0x3dfeea[0x0],_0x18b9cf=!_0x337199&&!!_0x2cdd2c[_0x4fa812(0x215)],_0x1860e6=_0x337199||_0x2cdd2c['parentSegment'];if(!_0x1860e6)return console[_0x4fa812(0x203)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x4fa812(0x203)](_0x4fa812(0x21c)),console[_0x4fa812(0x203)](_0x4fa812(0x217)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x4fa812(0x203)](_0x4fa812(0x235)),console[_0x4fa812(0x203)](_0x4fa812(0x206)),console[_0x4fa812(0x203)](_0x4fa812(0x1d1)),0x1;try{const _0x1b85e3=_0x2cdd2c[_0x4fa812(0x21b)];let _0x27582d=_0x1860e6;!_0x18b9cf&&_0x1b85e3&&!_0x1860e6[_0x4fa812(0x1f5)]('/')&&(_0x27582d=_0x1b85e3+'/'+_0x1860e6,_0x2cdd2c[_0x4fa812(0x20c)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x27582d));const _0x4f915f=await withSpinner('Resolving\x20path\x20\x27'+_0x27582d+_0x4fa812(0x23a),()=>_0x922457[_0x4fa812(0x1fd)][_0x4fa812(0x1dc)](_0x27582d),{'verbose':_0x2cdd2c['verbose']}),_0x25534e=_0x4f915f['data'];_0x2cdd2c['verbose']&&(console[_0x4fa812(0x203)](_0x4fa812(0x1fe)+_0x25534e[_0x4fa812(0x1e0)]),console[_0x4fa812(0x203)](_0x4fa812(0x20e)+_0x25534e['parentId']),_0x25534e[_0x4fa812(0x20a)]&&console[_0x4fa812(0x203)](_0x4fa812(0x1e6)+_0x25534e[_0x4fa812(0x20a)]),_0x25534e['segmentId']&&console[_0x4fa812(0x203)](_0x4fa812(0x1cb)+_0x25534e['segmentId']));if(_0x25534e[_0x4fa812(0x1e0)]===_0x4fa812(0x221)){const _0x4c16be=await withSpinner(_0x4fa812(0x1fc),()=>_0x922457[_0x4fa812(0x1fd)][_0x4fa812(0x1d8)](_0x25534e['parentId']),{'verbose':_0x2cdd2c[_0x4fa812(0x20c)]});await handleSingleObjectOutput(_0x4c16be[_0x4fa812(0x245)],_0x2cdd2c);}else{if(_0x25534e['type']===_0x4fa812(0x1ec)){if(!_0x25534e['folderId'])throw new SDKError(ErrorCode[_0x4fa812(0x22e)],_0x4fa812(0x207));const _0x3ce991=await withSpinner(_0x4fa812(0x218),()=>_0x922457[_0x4fa812(0x1fd)]['getFolder'](_0x25534e[_0x4fa812(0x20a)]),{'verbose':_0x2cdd2c[_0x4fa812(0x20c)]});await handleSingleObjectOutput(_0x3ce991[_0x4fa812(0x245)],_0x2cdd2c);}else{if(_0x25534e[_0x4fa812(0x1e0)]==='segment'){if(!_0x25534e[_0x4fa812(0x1c9)])throw new SDKError(ErrorCode[_0x4fa812(0x22e)],_0x4fa812(0x244));const _0x308c5c=await withSpinner(_0x4fa812(0x20d),()=>_0x922457[_0x4fa812(0x1fd)][_0x4fa812(0x1fa)](_0x25534e['parentId'],_0x25534e[_0x4fa812(0x1c9)]),{'verbose':_0x2cdd2c[_0x4fa812(0x20c)]});await handleSingleObjectOutput(_0x308c5c[_0x4fa812(0x245)],_0x2cdd2c);}}}return 0x0;}catch(_0x5d5897){if(_0x5d5897 instanceof SDKError)return console[_0x4fa812(0x203)]('Error:\x20'+_0x5d5897['message']),_0x5d5897[_0x4fa812(0x227)]&&console[_0x4fa812(0x203)](_0x4fa812(0x1dd)+_0x5d5897[_0x4fa812(0x227)]),0x1;throw _0x5d5897;}}}export class SegmentShowCommand extends BaseCommand{[a29_0x66827c(0x1d0)]='segment:show';[a29_0x66827c(0x1fb)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a29_0x66827c(0x1ed)](_0x4d1153){const _0x14dbd3=a29_0x66827c,{options:_0x3db755,args:_0x3fbfdc,tdx:_0x1a0053}=_0x4d1153,_0xd67299=_0x3fbfdc[0x0],_0x1b1f09=!_0xd67299&&!!_0x3db755[_0x14dbd3(0x215)],_0x165502=_0xd67299||_0x3db755['parentSegment'];if(!_0x165502)return console[_0x14dbd3(0x203)](_0x14dbd3(0x202)),console[_0x14dbd3(0x203)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x14dbd3(0x203)](_0x14dbd3(0x217)),console[_0x14dbd3(0x203)](_0x14dbd3(0x1f7)),console[_0x14dbd3(0x203)](_0x14dbd3(0x1e3)),console[_0x14dbd3(0x203)](_0x14dbd3(0x1f6)),console[_0x14dbd3(0x203)](_0x14dbd3(0x1d1)),0x1;try{const _0x12c904=_0x3db755[_0x14dbd3(0x21b)];let _0x57c341=_0x165502;!_0x1b1f09&&_0x12c904&&!_0x165502[_0x14dbd3(0x1f5)]('/')&&(_0x57c341=_0x12c904+'/'+_0x165502,_0x3db755['verbose']&&console[_0x14dbd3(0x203)](_0x14dbd3(0x1cf)+_0x57c341));const _0x4692d6=await withSpinner(_0x14dbd3(0x237)+_0x57c341+_0x14dbd3(0x23a),()=>_0x1a0053['segment']['resolvePathToResource'](_0x57c341),{'verbose':_0x3db755[_0x14dbd3(0x20c)]}),_0x39c1bb=_0x4692d6[_0x14dbd3(0x245)];_0x3db755[_0x14dbd3(0x20c)]&&(console[_0x14dbd3(0x203)](_0x14dbd3(0x1fe)+_0x39c1bb[_0x14dbd3(0x1e0)]),console['error']('Parent\x20ID:\x20'+_0x39c1bb[_0x14dbd3(0x211)]));if(_0x39c1bb[_0x14dbd3(0x1e0)]===_0x14dbd3(0x1ec))return console[_0x14dbd3(0x203)](_0x14dbd3(0x1e5)),console[_0x14dbd3(0x203)](_0x14dbd3(0x233)),0x1;let _0x3f524e;if(_0x39c1bb[_0x14dbd3(0x1e0)]===_0x14dbd3(0x221)){const _0x493eed=await withSpinner(_0x14dbd3(0x1d9),()=>_0x1a0053['segment']['getParentSQL'](_0x39c1bb['parentId']),{'verbose':_0x3db755['verbose']});_0x3f524e=_0x493eed[_0x14dbd3(0x245)];}else{if(!_0x39c1bb['segmentId'])throw new SDKError(ErrorCode[_0x14dbd3(0x22e)],_0x14dbd3(0x244));const _0x317792=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1a0053[_0x14dbd3(0x1fd)]['getSegmentSQL'](_0x39c1bb['parentId'],_0x39c1bb[_0x14dbd3(0x1c9)]),{'verbose':_0x3db755['verbose']});_0x3f524e=_0x317792['data'];}const _0x2cc97f=resolveLimit(_0x3db755[_0x14dbd3(0x242)],DEFAULT_DISPLAY_LIMIT),_0x365d70=/\bLIMIT\s+\d+/i[_0x14dbd3(0x220)](_0x3f524e);!_0x365d70&&(_0x3f524e=_0x3f524e['trim']()[_0x14dbd3(0x1e4)](/;+$/,''),_0x3f524e='SELECT\x20*\x20FROM\x20(\x0a'+_0x3f524e+_0x14dbd3(0x1ce)+_0x2cc97f);_0x3db755[_0x14dbd3(0x20c)]&&console[_0x14dbd3(0x203)](_0x14dbd3(0x232)+_0x3f524e);const _0x4a9b82=await withQuerySpinner(_0x14dbd3(0x21f),async _0x46a3a9=>{const _0x50aca7=_0x14dbd3,_0x4b2386=await _0x1a0053['query'][_0x50aca7(0x1ed)](_0x3f524e,{'catalog':'td','schema':_0x50aca7(0x1d3),'onJobId':_0x594721=>{_0x46a3a9['setJobId'](_0x594721);}});return _0x4b2386;},{'verbose':_0x3db755[_0x14dbd3(0x20c)]}),_0x28f0c7=_0x4a9b82['data'],_0x370e15=_0x28f0c7[_0x14dbd3(0x1ca)]?_0x14dbd3(0x213)+_0x28f0c7['jobId']+']':'';return console[_0x14dbd3(0x203)](_0x14dbd3(0x21d)+_0x28f0c7[_0x14dbd3(0x1f9)][_0x14dbd3(0x1d5)][_0x14dbd3(0x228)]()+_0x14dbd3(0x1e1)+(_0x14dbd3(0x1e2)+formatElapsed(_0x28f0c7[_0x14dbd3(0x1f9)]['elapsedTimeMillis'])+_0x370e15)),await handleQueryOutput(_0x28f0c7,_0x3db755),0x0;}catch(_0x165b88){if(_0x165b88 instanceof SDKError)return console[_0x14dbd3(0x203)](_0x14dbd3(0x1cd)+_0x165b88[_0x14dbd3(0x1f2)]+']'),console['error']('\x0a'+_0x165b88[_0x14dbd3(0x230)]),0x1;throw _0x165b88;}}}export class SegmentFolderListCommand extends BaseCommand{[a29_0x66827c(0x1d0)]='segment:folder:list';['description']=a29_0x66827c(0x201);async[a29_0x66827c(0x1ed)](_0x249303){const _0x69d0d=a29_0x66827c,{options:_0x1c5888,args:_0x3374c0,tdx:_0x36d79e}=_0x249303;if(_0x3374c0[_0x69d0d(0x23b)]===0x0)return console[_0x69d0d(0x203)](_0x69d0d(0x209)),console[_0x69d0d(0x203)](_0x69d0d(0x247)),0x1;const _0x3cc2fb=_0x3374c0[0x0];try{_0x1c5888['verbose']&&(console[_0x69d0d(0x203)](_0x69d0d(0x22a)+_0x1c5888[_0x69d0d(0x238)]),console['error']('Parent\x20name:\x20'+_0x3cc2fb));const _0x5079e7=await withSpinner(_0x69d0d(0x239)+_0x3cc2fb+_0x69d0d(0x23a),()=>_0x36d79e[_0x69d0d(0x1fd)][_0x69d0d(0x1c6)](_0x3cc2fb),{'verbose':_0x1c5888[_0x69d0d(0x20c)]}),_0x455ac1=_0x5079e7[_0x69d0d(0x245)];_0x1c5888[_0x69d0d(0x20c)]&&console[_0x69d0d(0x203)](_0x69d0d(0x1ff)+_0x455ac1);const _0x374bbe=await withSpinner(_0x69d0d(0x1de)+_0x3cc2fb+_0x69d0d(0x23a),()=>_0x36d79e[_0x69d0d(0x1fd)][_0x69d0d(0x1c7)](_0x455ac1),{'verbose':_0x1c5888[_0x69d0d(0x20c)]}),_0x50c11c=_0x374bbe[_0x69d0d(0x245)];return console[_0x69d0d(0x203)](_0x69d0d(0x246)+_0x50c11c[_0x69d0d(0x23b)]+_0x69d0d(0x214)+(_0x50c11c[_0x69d0d(0x23b)]!==0x1?'s':'')),await handleSDKOutput(_0x50c11c,_0x1c5888),0x0;}catch(_0x3e8844){if(_0x3e8844 instanceof SDKError)return console[_0x69d0d(0x203)](_0x69d0d(0x1ef)+_0x3e8844[_0x69d0d(0x230)]),_0x3e8844['cause']&&console[_0x69d0d(0x203)](_0x69d0d(0x1dd)+_0x3e8844[_0x69d0d(0x227)]),0x1;throw _0x3e8844;}}}export class SegmentFolderShowCommand extends BaseCommand{[a29_0x66827c(0x1d0)]=a29_0x66827c(0x216);[a29_0x66827c(0x1fb)]=a29_0x66827c(0x204);async['execute'](_0x2ca836){const _0x4d980f=a29_0x66827c,{options:_0xd7e5a4,args:_0x2595e6,tdx:_0x45f8b7}=_0x2ca836;if(_0x2595e6[_0x4d980f(0x23b)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console['error'](_0x4d980f(0x1d6)),0x1;try{const {parentId:_0x35090a,childId:_0x17805f}=parseSegmentRef(_0x2595e6[0x0]);_0xd7e5a4[_0x4d980f(0x20c)]&&(console[_0x4d980f(0x203)](_0x4d980f(0x22a)+_0xd7e5a4[_0x4d980f(0x238)]),console[_0x4d980f(0x203)](_0x4d980f(0x236)+_0x35090a),_0x17805f&&console[_0x4d980f(0x203)](_0x4d980f(0x1ea)+_0x17805f));if(!_0x17805f)return console[_0x4d980f(0x203)](_0x4d980f(0x243)),0x1;const _0xc3064d=await withSpinner(_0x4d980f(0x239)+_0x35090a+_0x4d980f(0x23a),()=>_0x45f8b7[_0x4d980f(0x1fd)][_0x4d980f(0x1c6)](_0x35090a),{'verbose':_0xd7e5a4[_0x4d980f(0x20c)]}),_0x2ced15=_0xc3064d['data'];_0xd7e5a4['verbose']&&console[_0x4d980f(0x203)](_0x4d980f(0x1ff)+_0x2ced15);const _0x1fb06d=await withSpinner(_0x4d980f(0x1f3)+_0x17805f+_0x4d980f(0x23a),()=>_0x45f8b7[_0x4d980f(0x1fd)][_0x4d980f(0x225)](_0x2ced15,_0x17805f),{'verbose':_0xd7e5a4[_0x4d980f(0x20c)]}),_0x23320d=_0x1fb06d['data'];_0xd7e5a4['verbose']&&console[_0x4d980f(0x203)](_0x4d980f(0x20b)+_0x23320d);const _0x4377f0=await withSpinner(_0x4d980f(0x22f)+_0x17805f+_0x4d980f(0x23a),()=>_0x45f8b7[_0x4d980f(0x1fd)][_0x4d980f(0x231)](_0x23320d),{'verbose':_0xd7e5a4[_0x4d980f(0x20c)]});return await handleSDKOutput([_0x4377f0[_0x4d980f(0x245)]],_0xd7e5a4),0x0;}catch(_0x2890e7){if(_0x2890e7 instanceof SDKError)return console[_0x4d980f(0x203)]('Error:\x20'+_0x2890e7[_0x4d980f(0x230)]),_0x2890e7[_0x4d980f(0x227)]&&console[_0x4d980f(0x203)](_0x4d980f(0x1dd)+_0x2890e7['cause']),0x1;throw _0x2890e7;}}}export class SegmentSQLCommand extends BaseCommand{[a29_0x66827c(0x1d0)]=a29_0x66827c(0x219);['description']=a29_0x66827c(0x1d7);async[a29_0x66827c(0x1ed)](_0x127dae){const _0x2d22c=a29_0x66827c,{options:_0x10392e,args:_0x4bea69,tdx:_0x5c3c51}=_0x127dae,_0x5baed2=_0x4bea69[0x0],_0x36b74f=!_0x5baed2&&!!_0x10392e[_0x2d22c(0x215)],_0x56c999=_0x5baed2||_0x10392e[_0x2d22c(0x215)];if(!_0x56c999)return console[_0x2d22c(0x203)](_0x2d22c(0x202)),console[_0x2d22c(0x203)](_0x2d22c(0x22d)),console['error'](_0x2d22c(0x217)),console[_0x2d22c(0x203)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console['error'](_0x2d22c(0x205)),console[_0x2d22c(0x203)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x2d22c(0x203)](_0x2d22c(0x1d1)),0x1;try{const _0x346085=_0x10392e[_0x2d22c(0x21b)];let _0x5c4b63=_0x56c999;!_0x36b74f&&_0x346085&&!_0x56c999[_0x2d22c(0x1f5)]('/')&&(_0x5c4b63=_0x346085+'/'+_0x56c999,_0x10392e[_0x2d22c(0x20c)]&&console[_0x2d22c(0x203)](_0x2d22c(0x1cf)+_0x5c4b63));const _0x25b7dd=await withSpinner('Resolving\x20path\x20\x27'+_0x5c4b63+'\x27...',()=>_0x5c3c51[_0x2d22c(0x1fd)][_0x2d22c(0x1dc)](_0x5c4b63),{'verbose':_0x10392e[_0x2d22c(0x20c)]}),_0x14f899=_0x25b7dd[_0x2d22c(0x245)];_0x10392e[_0x2d22c(0x20c)]&&(console['error'](_0x2d22c(0x1fe)+_0x14f899['type']),console[_0x2d22c(0x203)](_0x2d22c(0x20e)+_0x14f899[_0x2d22c(0x211)]));if(_0x14f899[_0x2d22c(0x1e0)]===_0x2d22c(0x1ec))return console['error'](_0x2d22c(0x1f8)),console[_0x2d22c(0x203)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x271089;if(_0x14f899[_0x2d22c(0x1e0)]===_0x2d22c(0x221)){const _0xa30ee=await withSpinner(_0x2d22c(0x1d9),()=>_0x5c3c51[_0x2d22c(0x1fd)][_0x2d22c(0x234)](_0x14f899[_0x2d22c(0x211)]),{'verbose':_0x10392e[_0x2d22c(0x20c)]});_0x271089=_0xa30ee[_0x2d22c(0x245)];}else{if(!_0x14f899[_0x2d22c(0x1c9)])throw new SDKError(ErrorCode[_0x2d22c(0x22e)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xce2e70=await withSpinner(_0x2d22c(0x229),()=>_0x5c3c51[_0x2d22c(0x1fd)][_0x2d22c(0x1ee)](_0x14f899['parentId'],_0x14f899[_0x2d22c(0x1c9)]),{'verbose':_0x10392e[_0x2d22c(0x20c)]});_0x271089=_0xce2e70[_0x2d22c(0x245)];}return _0x10392e[_0x2d22c(0x200)]==='json'||_0x10392e[_0x2d22c(0x200)]===_0x2d22c(0x1df)?await handleSDKOutput([{'sql':_0x271089}],_0x10392e):console['log'](_0x271089),0x0;}catch(_0x983407){if(_0x983407 instanceof SDKError)return console[_0x2d22c(0x203)](_0x2d22c(0x1ef)+_0x983407[_0x2d22c(0x230)]),_0x983407[_0x2d22c(0x227)]&&console['error'](_0x2d22c(0x1dd)+_0x983407['cause']),0x1;throw _0x983407;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a29_0x66827c(0x1d0)]='segment:folder:create';[a29_0x66827c(0x1fb)]=a29_0x66827c(0x23d);async['execute'](_0x15524a){const _0x4ff64d=a29_0x66827c,{options:_0x203319,args:_0x497c67,tdx:_0x2705f0}=_0x15524a,_0xce0813=_0x203319;if(_0x497c67[_0x4ff64d(0x23b)]<0x2)return console[_0x4ff64d(0x203)](_0x4ff64d(0x226)),console[_0x4ff64d(0x203)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x53895b=_0x497c67[0x0],_0x54940d=_0x497c67[0x1];_0xce0813[_0x4ff64d(0x20c)]&&(console[_0x4ff64d(0x203)]('Site:\x20'+_0xce0813['site']),console[_0x4ff64d(0x203)](_0x4ff64d(0x1eb)+_0x53895b),console[_0x4ff64d(0x203)](_0x4ff64d(0x1ea)+_0x54940d));let _0x8e79e7;if(_0xce0813[_0x4ff64d(0x1e9)]){const _0x1129c1=_0xce0813[_0x4ff64d(0x1e9)],_0x54228a=await withSpinner(_0x4ff64d(0x239)+_0x53895b+'\x27...',()=>_0x2705f0[_0x4ff64d(0x1fd)][_0x4ff64d(0x1c6)](_0x53895b),{'verbose':_0xce0813[_0x4ff64d(0x20c)]}),_0x3df66d=_0x54228a['data'],_0x1b4d37=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x1129c1+_0x4ff64d(0x23a),()=>_0x2705f0['segment'][_0x4ff64d(0x225)](_0x3df66d,_0x1129c1),{'verbose':_0xce0813[_0x4ff64d(0x20c)]});_0x8e79e7=_0x1b4d37[_0x4ff64d(0x245)],_0xce0813[_0x4ff64d(0x20c)]&&console[_0x4ff64d(0x203)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x8e79e7);}const _0x2cfb25={'name':_0x54940d,'description':_0xce0813['description'],'parentFolderId':_0x8e79e7},_0x530cff=await withSpinner(_0x4ff64d(0x1cc)+_0x54940d+_0x4ff64d(0x23a),()=>_0x2705f0[_0x4ff64d(0x1fd)][_0x4ff64d(0x210)](_0x53895b,_0x2cfb25),{'verbose':_0xce0813[_0x4ff64d(0x20c)]}),_0x2fface=_0x530cff[_0x4ff64d(0x245)];return console['error'](_0x4ff64d(0x1f0)+_0x2fface[_0x4ff64d(0x1d0)]+_0x4ff64d(0x20f)+_0x2fface['id']),await handleSDKOutput([_0x2fface],_0xce0813),0x0;}}export class SegmentInfoCommand extends BaseCommand{[a29_0x66827c(0x1d0)]='segment:info';['description']=a29_0x66827c(0x240);async[a29_0x66827c(0x1ed)](_0x9ae27d){const _0x92b332=a29_0x66827c,{options:_0x5ce32e,args:_0x351cdf,tdx:_0x400079}=_0x9ae27d,_0x32701e=_0x351cdf[0x0],_0x4d2ea8=!_0x32701e&&!!_0x5ce32e[_0x92b332(0x215)],_0x27d102=_0x32701e||_0x5ce32e['parentSegment'];if(!_0x27d102)return console[_0x92b332(0x203)](_0x92b332(0x1d4)),console['error'](_0x92b332(0x1db)),console[_0x92b332(0x203)]('Examples:'),console[_0x92b332(0x203)](_0x92b332(0x222)),console[_0x92b332(0x203)]('\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x92b332(0x203)](_0x92b332(0x1f4)),console[_0x92b332(0x203)](_0x92b332(0x1d1)),0x1;try{const _0x119ca8=_0x5ce32e[_0x92b332(0x21b)];let _0x4fee9a=_0x27d102;!_0x4d2ea8&&_0x119ca8&&!_0x27d102[_0x92b332(0x1f5)]('/')&&(_0x4fee9a=_0x119ca8+'/'+_0x27d102,_0x5ce32e['verbose']&&console[_0x92b332(0x203)](_0x92b332(0x1cf)+_0x4fee9a));const _0x121e38=await withSpinner(_0x92b332(0x237)+_0x4fee9a+_0x92b332(0x23a),()=>_0x400079[_0x92b332(0x1fd)][_0x92b332(0x1dc)](_0x4fee9a),{'verbose':_0x5ce32e[_0x92b332(0x20c)]}),_0x1489ed=_0x121e38[_0x92b332(0x245)];_0x5ce32e[_0x92b332(0x20c)]&&(console[_0x92b332(0x203)](_0x92b332(0x1fe)+_0x1489ed['type']),console['error'](_0x92b332(0x20e)+_0x1489ed[_0x92b332(0x211)]),_0x1489ed[_0x92b332(0x20a)]&&console[_0x92b332(0x203)](_0x92b332(0x1e6)+_0x1489ed[_0x92b332(0x20a)]),_0x1489ed['segmentId']&&console[_0x92b332(0x203)](_0x92b332(0x1cb)+_0x1489ed[_0x92b332(0x1c9)]));if(_0x1489ed[_0x92b332(0x1e0)]===_0x92b332(0x221)){const _0x228a9b=await withSpinner(_0x92b332(0x1fc),()=>_0x400079['segment'][_0x92b332(0x1d8)](_0x1489ed[_0x92b332(0x211)]),{'verbose':_0x5ce32e[_0x92b332(0x20c)]});await handleSingleObjectOutput(_0x228a9b[_0x92b332(0x245)],_0x5ce32e);}else{if(_0x1489ed[_0x92b332(0x1e0)]===_0x92b332(0x1ec)){if(!_0x1489ed[_0x92b332(0x20a)])throw new SDKError(ErrorCode[_0x92b332(0x22e)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x20a978=await withSpinner('Fetching\x20folder\x20details...',()=>_0x400079[_0x92b332(0x1fd)][_0x92b332(0x231)](_0x1489ed[_0x92b332(0x20a)]),{'verbose':_0x5ce32e[_0x92b332(0x20c)]});await handleSingleObjectOutput(_0x20a978[_0x92b332(0x245)],_0x5ce32e);}else{if(_0x1489ed[_0x92b332(0x1e0)]===_0x92b332(0x1fd)){if(!_0x1489ed[_0x92b332(0x1c9)])throw new SDKError(ErrorCode['INTERNAL'],_0x92b332(0x244));const _0x4c9dd1=await withSpinner('Fetching\x20segment\x20details...',()=>_0x400079[_0x92b332(0x1fd)][_0x92b332(0x1fa)](_0x1489ed[_0x92b332(0x211)],_0x1489ed['segmentId']),{'verbose':_0x5ce32e[_0x92b332(0x20c)]});await handleSingleObjectOutput(_0x4c9dd1[_0x92b332(0x245)],_0x5ce32e);}}}return 0x0;}catch(_0x446a33){if(_0x446a33 instanceof SDKError)return console[_0x92b332(0x203)](_0x92b332(0x1ef)+_0x446a33[_0x92b332(0x230)]),_0x446a33[_0x92b332(0x227)]&&console[_0x92b332(0x203)]('\x20\x20Cause:\x20'+_0x446a33[_0x92b332(0x227)]),0x1;throw _0x446a33;}}}function a29_0x8630(_0xdd2318,_0x5a0284){const _0x1e04b6=a29_0x1e04();return a29_0x8630=function(_0x863023,_0x5bec3c){_0x863023=_0x863023-0x1c6;let _0x4b3a9a=_0x1e04b6[_0x863023];return _0x4b3a9a;},a29_0x8630(_0xdd2318,_0x5a0284);}function a29_0x1e04(){const _0x4ee7f9=['jobId','Segment\x20ID:\x20','Creating\x20folder\x20\x27','✖\x20Query\x20failed\x20[','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolved\x20relative\x20path\x20to:\x20','name','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','37462xQSsli','information_schema','Error:\x20Path\x20or\x20name\x20is\x20required','processedRows','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','getParent','Fetching\x20SQL\x20for\x20parent\x20segment...','2cjDMEp','Usage:\x20tdx\x20segment\x20info\x20<path>','resolvePathToResource','\x20\x20Cause:\x20','Listing\x20folders\x20for\x20parent\x20\x27','jsonl','type','\x20rows\x20','in\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','replace','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Folder\x20ID:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentFolder','Folder\x20name:\x20','Parent\x20segment:\x20','folder','execute','getSegmentSQL','Error:\x20','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience\x22','code','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20info\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','includes','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','stats','getSegment','description','Fetching\x20parent\x20segment\x20details...','segment','Resolved\x20type:\x20','Resolved\x20parent\x20ID:\x20','format','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','error','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20desc\x20<path>','Error:\x20Parent\x20segment\x20name\x20is\x20required','folderId','Resolved\x20folder\x20ID:\x20','verbose','Fetching\x20segment\x20details...','Parent\x20ID:\x20','\x27\x20with\x20ID:\x20','createFolder','parentId','25571YQuFwA','\x20[Job\x20ID:\x20','\x20folder','parentSegment','segment:folder:show','Examples:','Fetching\x20folder\x20details...','segment:sql','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segmentPath','Usage:\x20tdx\x20segment\x20describe\x20<path>','✔\x20Query\x20completed:\x20Processed\x20','1133178BCyScU','Executing\x20segment\x20query...','test','parent','\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience\x22','11742129gAoqih','segment:desc','resolveFolderId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','cause','toLocaleString','Fetching\x20SQL\x20for\x20segment...','Site:\x20','2366823PTkPvX','24GAXMak','Usage:\x20tdx\x20segment\x20sql\x20<path>','INTERNAL','Fetching\x20folder\x20\x27','message','getFolder','SQL\x20query:\x0a','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','getParentSQL','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Parent\x20name:\x20','Resolving\x20path\x20\x27','site','Resolving\x20parent\x20segment\x20\x27','\x27...','length','906385YyjDdK','Create\x20segment\x20folder\x20for\x20organization','Show\x20segment\x20schema\x20(column\x20types)','segment:describe','Show\x20segment\x20or\x20folder\x20details','21894290duRZqf','limit','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Segment\x20ID\x20missing\x20from\x20resolved\x20path','data','✔\x20Found\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','resolveParentId','listFolders','344gvwQiy','segmentId'];a29_0x1e04=function(){return _0x4ee7f9;};return a29_0x1e04();}export class SegmentDescCommand extends BaseCommand{['name']=a29_0x66827c(0x224);[a29_0x66827c(0x1fb)]=a29_0x66827c(0x23e);async[a29_0x66827c(0x1ed)](_0x49c0e1){const _0x38e82d=a29_0x66827c,{options:_0x580496,args:_0x5c8eac,tdx:_0x1b9700}=_0x49c0e1,_0x28137b=_0x5c8eac[0x0],_0x2b996f=!_0x28137b&&!!_0x580496[_0x38e82d(0x215)],_0x82db8e=_0x28137b||_0x580496['parentSegment'];if(!_0x82db8e)return console[_0x38e82d(0x203)](_0x38e82d(0x202)),console[_0x38e82d(0x203)](_0x38e82d(0x208)),console[_0x38e82d(0x203)]('Examples:'),console[_0x38e82d(0x203)](_0x38e82d(0x1f1)),console[_0x38e82d(0x203)](_0x38e82d(0x1e8)),console[_0x38e82d(0x203)]('\x20\x20tdx\x20segment\x20desc\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x38e82d(0x203)](_0x38e82d(0x1d1)),0x1;try{const _0x1a3fcf=_0x580496[_0x38e82d(0x21b)];let _0x5ec6bd=_0x82db8e;!_0x2b996f&&_0x1a3fcf&&!_0x82db8e[_0x38e82d(0x1f5)]('/')&&(_0x5ec6bd=_0x1a3fcf+'/'+_0x82db8e,_0x580496[_0x38e82d(0x20c)]&&console['error'](_0x38e82d(0x1cf)+_0x5ec6bd));const _0xdf9a37=await withSpinner(_0x38e82d(0x237)+_0x5ec6bd+'\x27...',()=>_0x1b9700[_0x38e82d(0x1fd)][_0x38e82d(0x1dc)](_0x5ec6bd),{'verbose':_0x580496['verbose']}),_0x46ae92=_0xdf9a37[_0x38e82d(0x245)];_0x580496[_0x38e82d(0x20c)]&&(console[_0x38e82d(0x203)](_0x38e82d(0x1fe)+_0x46ae92[_0x38e82d(0x1e0)]),console[_0x38e82d(0x203)](_0x38e82d(0x20e)+_0x46ae92['parentId']));if(_0x46ae92[_0x38e82d(0x1e0)]===_0x38e82d(0x1ec))return console[_0x38e82d(0x203)](_0x38e82d(0x1e7)),console[_0x38e82d(0x203)](_0x38e82d(0x21a)),0x1;let _0x11c837;if(_0x46ae92[_0x38e82d(0x1e0)]===_0x38e82d(0x221)){const _0x1532de=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x1b9700['segment'][_0x38e82d(0x234)](_0x46ae92[_0x38e82d(0x211)]),{'verbose':_0x580496[_0x38e82d(0x20c)]});_0x11c837=_0x1532de[_0x38e82d(0x245)];}else{if(!_0x46ae92[_0x38e82d(0x1c9)])throw new SDKError(ErrorCode[_0x38e82d(0x22e)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2461ab=await withSpinner(_0x38e82d(0x229),()=>_0x1b9700[_0x38e82d(0x1fd)]['getSegmentSQL'](_0x46ae92[_0x38e82d(0x211)],_0x46ae92[_0x38e82d(0x1c9)]),{'verbose':_0x580496[_0x38e82d(0x20c)]});_0x11c837=_0x2461ab[_0x38e82d(0x245)];}const _0x3c28cf=await executeSchemaQuery(_0x11c837,_0x1b9700,_0x580496);return await handleQueryOutput(_0x3c28cf,_0x580496),0x0;}catch(_0x2203e3){if(_0x2203e3 instanceof SDKError)return console[_0x38e82d(0x203)](_0x38e82d(0x1ef)+_0x2203e3[_0x38e82d(0x230)]),_0x2203e3[_0x38e82d(0x227)]&&console[_0x38e82d(0x203)](_0x38e82d(0x1dd)+_0x2203e3[_0x38e82d(0x227)]),0x1;throw _0x2203e3;}}}
|
|
1
|
+
const a29_0x8c2eb=a29_0x3552;(function(_0x38b58f,_0x1872fe){const _0x20e173=a29_0x3552,_0x4bcce0=_0x38b58f();while(!![]){try{const _0x339e44=-parseInt(_0x20e173(0x19d))/0x1+parseInt(_0x20e173(0x1ef))/0x2+parseInt(_0x20e173(0x1ea))/0x3+parseInt(_0x20e173(0x1e8))/0x4*(parseInt(_0x20e173(0x1f0))/0x5)+parseInt(_0x20e173(0x1c3))/0x6+-parseInt(_0x20e173(0x19b))/0x7*(-parseInt(_0x20e173(0x1fb))/0x8)+-parseInt(_0x20e173(0x1c6))/0x9*(-parseInt(_0x20e173(0x1db))/0xa);if(_0x339e44===_0x1872fe)break;else _0x4bcce0['push'](_0x4bcce0['shift']());}catch(_0x743e6a){_0x4bcce0['push'](_0x4bcce0['shift']());}}}(a29_0x7d64,0xaad98));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a29_0x7d64(){const _0x340c79=['segment:show','getParentSQL','stats','Fetching\x20folder\x20\x27','Fetching\x20parent\x20segment\x20details...','Resolved\x20relative\x20path\x20to:\x20','jobId','length','information_schema','Site:\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','createFolder','listFolders','Fetching\x20segment\x20details...','segment:folder:show','code','Parent\x20name:\x20','\x20[Job\x20ID:\x20','setJobId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','✔\x20Created\x20folder\x20\x27','Parent\x20segment:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','✔\x20Found\x20','site','segment','300132PnuGBk','Fetching\x20SQL\x20for\x20parent\x20segment...','✔\x20Query\x20completed:\x20Processed\x20','14778KppYnu','format','Error:\x20','toLocaleString','Resolved\x20folder\x20ID:\x20','Error:\x20Folder\x20reference\x20is\x20required','SELECT\x20*\x20FROM\x20(\x0a','getFolder','Resolving\x20parent\x20folder\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','query','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Resolved\x20parent\x20ID:\x20','\x20folder','type','segmentId','elapsedTimeMillis','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segment:desc','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','3590lnhTuK','error','Resolving\x20parent\x20segment\x20\x27','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','segment:folder:list','Parent\x20ID:\x20','name','\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience\x22','\x27...','verbose','\x20\x20Cause:\x20','Create\x20segment\x20folder\x20for\x20organization','\x20\x20tdx\x20segment\x20desc\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','4pLXQoo','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','593709XqvYgH','cause','data','INTERNAL','limit','1439210FKCLft','2443270xHRRxm','\x20\x20tdx\x20segment\x20info\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Show\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Path\x20or\x20name\x20is\x20required','jsonl','Folder\x20ID:\x20','Listing\x20folders\x20for\x20parent\x20\x27','parentId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Fetching\x20SQL\x20for\x20segment...','8MrETeB','json','Segment\x20ID:\x20','log','execute','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parent','Usage:\x20tdx\x20segment\x20desc\x20<path>','parentSegment','folder','segmentPath','test','Fetching\x20folder\x20details...','getSegmentSQL','folderId','in\x20','description','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolved\x20parent\x20folder\x20ID:\x20','segment:describe','segment:info','Resolved\x20type:\x20','segment:folder:create','parentFolder','Usage:\x20tdx\x20segment\x20info\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Creating\x20folder\x20\x27','Examples:','✖\x20Query\x20failed\x20[','message','includes','Resolving\x20folder\x20\x27','Show\x20segment\x20or\x20folder\x20details','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolvePathToResource','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','resolveFolderId','getParent','67277UZdpGj','Folder\x20name:\x20','1355473xXCMaK','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:sql','Executing\x20segment\x20query...','Resolving\x20path\x20\x27','resolveParentId','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','getSegment','Show\x20segment\x20folder\x20details'];a29_0x7d64=function(){return _0x340c79;};return a29_0x7d64();}import{executeSchemaQuery}from'../utils/fields-display.js';function a29_0x3552(_0x3d7045,_0x2f76d8){const _0x7d648b=a29_0x7d64();return a29_0x3552=function(_0x3552c3,_0x1c84c1){_0x3552c3=_0x3552c3-0x191;let _0x799539=_0x7d648b[_0x3552c3];return _0x799539;},a29_0x3552(_0x3d7045,_0x2f76d8);}export class SegmentDescribeCommand extends BaseCommand{[a29_0x8c2eb(0x1e1)]=a29_0x8c2eb(0x20e);[a29_0x8c2eb(0x20b)]=a29_0x8c2eb(0x195);async[a29_0x8c2eb(0x1ff)](_0x14aba6){const _0x580482=a29_0x8c2eb,{options:_0x3aa9cf,args:_0x27225a,tdx:_0x29cccd}=_0x14aba6,_0x3d4ce6=_0x27225a[0x0],_0x5dc303=!_0x3d4ce6&&!!_0x3aa9cf[_0x580482(0x203)],_0x46faae=_0x3d4ce6||_0x3aa9cf[_0x580482(0x203)];if(!_0x46faae)return console[_0x580482(0x1dc)](_0x580482(0x1f4)),console[_0x580482(0x1dc)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x580482(0x1dc)]('Examples:'),console[_0x580482(0x1dc)](_0x580482(0x1f9)),console[_0x580482(0x1dc)](_0x580482(0x1f3)),console[_0x580482(0x1dc)](_0x580482(0x1d8)),console[_0x580482(0x1dc)](_0x580482(0x1da)),0x1;try{const _0x256005=_0x3aa9cf[_0x580482(0x205)];let _0x48a538=_0x46faae;!_0x5dc303&&_0x256005&&!_0x46faae[_0x580482(0x193)]('/')&&(_0x48a538=_0x256005+'/'+_0x46faae,_0x3aa9cf[_0x580482(0x1e4)]&&console[_0x580482(0x1dc)](_0x580482(0x1ad)+_0x48a538));const _0x2839d4=await withSpinner(_0x580482(0x1a3)+_0x48a538+_0x580482(0x1e3),()=>_0x29cccd[_0x580482(0x1c2)]['resolvePathToResource'](_0x48a538),{'verbose':_0x3aa9cf[_0x580482(0x1e4)]}),_0x5b10a3=_0x2839d4[_0x580482(0x1ec)];_0x3aa9cf[_0x580482(0x1e4)]&&(console[_0x580482(0x1dc)](_0x580482(0x210)+_0x5b10a3[_0x580482(0x1d5)]),console[_0x580482(0x1dc)](_0x580482(0x1e0)+_0x5b10a3[_0x580482(0x1f8)]),_0x5b10a3[_0x580482(0x209)]&&console[_0x580482(0x1dc)]('Folder\x20ID:\x20'+_0x5b10a3[_0x580482(0x209)]),_0x5b10a3[_0x580482(0x1d6)]&&console['error'](_0x580482(0x1fd)+_0x5b10a3[_0x580482(0x1d6)]));if(_0x5b10a3['type']==='parent'){const _0x2da1b3=await withSpinner(_0x580482(0x1ac),()=>_0x29cccd[_0x580482(0x1c2)][_0x580482(0x19a)](_0x5b10a3[_0x580482(0x1f8)]),{'verbose':_0x3aa9cf[_0x580482(0x1e4)]});await handleSingleObjectOutput(_0x2da1b3[_0x580482(0x1ec)],_0x3aa9cf);}else{if(_0x5b10a3[_0x580482(0x1d5)]==='folder'){if(!_0x5b10a3[_0x580482(0x209)])throw new SDKError(ErrorCode['INTERNAL'],_0x580482(0x200));const _0x5a4fd5=await withSpinner('Fetching\x20folder\x20details...',()=>_0x29cccd[_0x580482(0x1c2)][_0x580482(0x1cd)](_0x5b10a3['folderId']),{'verbose':_0x3aa9cf[_0x580482(0x1e4)]});await handleSingleObjectOutput(_0x5a4fd5[_0x580482(0x1ec)],_0x3aa9cf);}else{if(_0x5b10a3[_0x580482(0x1d5)]===_0x580482(0x1c2)){if(!_0x5b10a3[_0x580482(0x1d6)])throw new SDKError(ErrorCode[_0x580482(0x1ed)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xae55b7=await withSpinner(_0x580482(0x1b5),()=>_0x29cccd[_0x580482(0x1c2)]['getSegment'](_0x5b10a3[_0x580482(0x1f8)],_0x5b10a3[_0x580482(0x1d6)]),{'verbose':_0x3aa9cf['verbose']});await handleSingleObjectOutput(_0xae55b7['data'],_0x3aa9cf);}}}return 0x0;}catch(_0x4f5ead){if(_0x4f5ead instanceof SDKError)return console[_0x580482(0x1dc)](_0x580482(0x1c8)+_0x4f5ead['message']),_0x4f5ead[_0x580482(0x1eb)]&&console[_0x580482(0x1dc)]('\x20\x20Cause:\x20'+_0x4f5ead['cause']),0x1;throw _0x4f5ead;}}}export class SegmentShowCommand extends BaseCommand{[a29_0x8c2eb(0x1e1)]=a29_0x8c2eb(0x1a8);[a29_0x8c2eb(0x20b)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a29_0x8c2eb(0x1ff)](_0x3aace6){const _0x117eb5=a29_0x8c2eb,{options:_0x458428,args:_0x4d5484,tdx:_0x721c98}=_0x3aace6,_0x2207a5=_0x4d5484[0x0],_0x590a0c=!_0x2207a5&&!!_0x458428[_0x117eb5(0x203)],_0x3b15f2=_0x2207a5||_0x458428[_0x117eb5(0x203)];if(!_0x3b15f2)return console[_0x117eb5(0x1dc)](_0x117eb5(0x1a0)),console['error']('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x117eb5(0x1dc)](_0x117eb5(0x216)),console[_0x117eb5(0x1dc)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x117eb5(0x198)),console[_0x117eb5(0x1dc)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x117eb5(0x1dc)](_0x117eb5(0x1da)),0x1;try{const _0x37f2e7=_0x458428[_0x117eb5(0x205)];let _0x3c9dc3=_0x3b15f2;!_0x590a0c&&_0x37f2e7&&!_0x3b15f2[_0x117eb5(0x193)]('/')&&(_0x3c9dc3=_0x37f2e7+'/'+_0x3b15f2,_0x458428[_0x117eb5(0x1e4)]&&console['error'](_0x117eb5(0x1ad)+_0x3c9dc3));const _0x12ebe3=await withSpinner('Resolving\x20path\x20\x27'+_0x3c9dc3+_0x117eb5(0x1e3),()=>_0x721c98[_0x117eb5(0x1c2)][_0x117eb5(0x197)](_0x3c9dc3),{'verbose':_0x458428[_0x117eb5(0x1e4)]}),_0x419fc7=_0x12ebe3[_0x117eb5(0x1ec)];_0x458428['verbose']&&(console[_0x117eb5(0x1dc)]('Resolved\x20type:\x20'+_0x419fc7[_0x117eb5(0x1d5)]),console[_0x117eb5(0x1dc)](_0x117eb5(0x1e0)+_0x419fc7[_0x117eb5(0x1f8)]));if(_0x419fc7[_0x117eb5(0x1d5)]===_0x117eb5(0x204))return console[_0x117eb5(0x1dc)](_0x117eb5(0x1cf)),console['error'](_0x117eb5(0x1de)),0x1;let _0x592e06;if(_0x419fc7[_0x117eb5(0x1d5)]===_0x117eb5(0x201)){const _0x40528b=await withSpinner(_0x117eb5(0x1c4),()=>_0x721c98[_0x117eb5(0x1c2)][_0x117eb5(0x1a9)](_0x419fc7['parentId']),{'verbose':_0x458428[_0x117eb5(0x1e4)]});_0x592e06=_0x40528b[_0x117eb5(0x1ec)];}else{if(!_0x419fc7[_0x117eb5(0x1d6)])throw new SDKError(ErrorCode['INTERNAL'],_0x117eb5(0x1bb));const _0x53c496=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x721c98[_0x117eb5(0x1c2)][_0x117eb5(0x208)](_0x419fc7[_0x117eb5(0x1f8)],_0x419fc7[_0x117eb5(0x1d6)]),{'verbose':_0x458428['verbose']});_0x592e06=_0x53c496[_0x117eb5(0x1ec)];}const _0x34c154=resolveLimit(_0x458428[_0x117eb5(0x1ee)],DEFAULT_DISPLAY_LIMIT),_0xaa103f=/\bLIMIT\s+\d+/i[_0x117eb5(0x206)](_0x592e06);!_0xaa103f&&(_0x592e06=_0x592e06['trim']()['replace'](/;+$/,''),_0x592e06=_0x117eb5(0x1cc)+_0x592e06+_0x117eb5(0x1d1)+_0x34c154);_0x458428[_0x117eb5(0x1e4)]&&console[_0x117eb5(0x1dc)]('SQL\x20query:\x0a'+_0x592e06);const _0x3e0eb4=await withQuerySpinner(_0x117eb5(0x1a2),async _0x48ebf1=>{const _0x419538=_0x117eb5,_0x51fbcd=await _0x721c98[_0x419538(0x1d0)]['execute'](_0x592e06,{'catalog':'td','schema':_0x419538(0x1b0),'onJobId':_0x1567a4=>{const _0x1ee06c=_0x419538;_0x48ebf1[_0x1ee06c(0x1ba)](_0x1567a4);}});return _0x51fbcd;},{'verbose':_0x458428[_0x117eb5(0x1e4)]}),_0x5e7a3e=_0x3e0eb4[_0x117eb5(0x1ec)],_0x63c6b9=_0x5e7a3e[_0x117eb5(0x1ae)]?_0x117eb5(0x1b9)+_0x5e7a3e[_0x117eb5(0x1ae)]+']':'';return console[_0x117eb5(0x1dc)](_0x117eb5(0x1c5)+_0x5e7a3e['stats']['processedRows'][_0x117eb5(0x1c9)]()+'\x20rows\x20'+(_0x117eb5(0x20a)+formatElapsed(_0x5e7a3e[_0x117eb5(0x1aa)][_0x117eb5(0x1d7)])+_0x63c6b9)),await handleQueryOutput(_0x5e7a3e,_0x458428),0x0;}catch(_0x5043f0){if(_0x5043f0 instanceof SDKError)return console[_0x117eb5(0x1dc)](_0x117eb5(0x191)+_0x5043f0[_0x117eb5(0x1b7)]+']'),console[_0x117eb5(0x1dc)]('\x0a'+_0x5043f0[_0x117eb5(0x192)]),0x1;throw _0x5043f0;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a29_0x8c2eb(0x1df);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a29_0x8c2eb(0x1ff)](_0x199fbc){const _0x46a1f9=a29_0x8c2eb,{options:_0x14848f,args:_0x56a599,tdx:_0x1c5e3e}=_0x199fbc;if(_0x56a599[_0x46a1f9(0x1af)]===0x0)return console[_0x46a1f9(0x1dc)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x46a1f9(0x1a5)),0x1;const _0x476b4a=_0x56a599[0x0];try{_0x14848f[_0x46a1f9(0x1e4)]&&(console[_0x46a1f9(0x1dc)](_0x46a1f9(0x1b1)+_0x14848f['site']),console[_0x46a1f9(0x1dc)](_0x46a1f9(0x1b8)+_0x476b4a));const _0x2471a9=await withSpinner(_0x46a1f9(0x1dd)+_0x476b4a+_0x46a1f9(0x1e3),()=>_0x1c5e3e[_0x46a1f9(0x1c2)]['resolveParentId'](_0x476b4a),{'verbose':_0x14848f[_0x46a1f9(0x1e4)]}),_0x13b5c3=_0x2471a9[_0x46a1f9(0x1ec)];_0x14848f[_0x46a1f9(0x1e4)]&&console[_0x46a1f9(0x1dc)]('Resolved\x20parent\x20ID:\x20'+_0x13b5c3);const _0x51aa84=await withSpinner(_0x46a1f9(0x1f7)+_0x476b4a+_0x46a1f9(0x1e3),()=>_0x1c5e3e[_0x46a1f9(0x1c2)][_0x46a1f9(0x1b4)](_0x13b5c3),{'verbose':_0x14848f[_0x46a1f9(0x1e4)]}),_0x4c8287=_0x51aa84[_0x46a1f9(0x1ec)];return console[_0x46a1f9(0x1dc)](_0x46a1f9(0x1c0)+_0x4c8287[_0x46a1f9(0x1af)]+_0x46a1f9(0x1d4)+(_0x4c8287[_0x46a1f9(0x1af)]!==0x1?'s':'')),await handleSDKOutput(_0x4c8287,_0x14848f),0x0;}catch(_0x140555){if(_0x140555 instanceof SDKError)return console['error'](_0x46a1f9(0x1c8)+_0x140555[_0x46a1f9(0x192)]),_0x140555[_0x46a1f9(0x1eb)]&&console[_0x46a1f9(0x1dc)](_0x46a1f9(0x1e5)+_0x140555[_0x46a1f9(0x1eb)]),0x1;throw _0x140555;}}}export class SegmentFolderShowCommand extends BaseCommand{[a29_0x8c2eb(0x1e1)]=a29_0x8c2eb(0x1b6);['description']=a29_0x8c2eb(0x1a7);async[a29_0x8c2eb(0x1ff)](_0x2a42b1){const _0x15faa2=a29_0x8c2eb,{options:_0x375cda,args:_0xe9c308,tdx:_0x575f1f}=_0x2a42b1;if(_0xe9c308[_0x15faa2(0x1af)]===0x0)return console[_0x15faa2(0x1dc)](_0x15faa2(0x1cb)),console['error'](_0x15faa2(0x214)),0x1;try{const {parentId:_0x21fe0d,childId:_0xeaedaf}=parseSegmentRef(_0xe9c308[0x0]);_0x375cda[_0x15faa2(0x1e4)]&&(console[_0x15faa2(0x1dc)](_0x15faa2(0x1b1)+_0x375cda[_0x15faa2(0x1c1)]),console[_0x15faa2(0x1dc)](_0x15faa2(0x1b8)+_0x21fe0d),_0xeaedaf&&console[_0x15faa2(0x1dc)](_0x15faa2(0x19c)+_0xeaedaf));if(!_0xeaedaf)return console['error'](_0x15faa2(0x1d2)),0x1;const _0x2a01c8=await withSpinner(_0x15faa2(0x1dd)+_0x21fe0d+_0x15faa2(0x1e3),()=>_0x575f1f[_0x15faa2(0x1c2)][_0x15faa2(0x1a4)](_0x21fe0d),{'verbose':_0x375cda[_0x15faa2(0x1e4)]}),_0x44dcb8=_0x2a01c8[_0x15faa2(0x1ec)];_0x375cda['verbose']&&console[_0x15faa2(0x1dc)](_0x15faa2(0x1d3)+_0x44dcb8);const _0x1150f9=await withSpinner(_0x15faa2(0x194)+_0xeaedaf+_0x15faa2(0x1e3),()=>_0x575f1f[_0x15faa2(0x1c2)][_0x15faa2(0x199)](_0x44dcb8,_0xeaedaf),{'verbose':_0x375cda[_0x15faa2(0x1e4)]}),_0x20a925=_0x1150f9['data'];_0x375cda[_0x15faa2(0x1e4)]&&console[_0x15faa2(0x1dc)](_0x15faa2(0x1ca)+_0x20a925);const _0x2bb3b5=await withSpinner(_0x15faa2(0x1ab)+_0xeaedaf+_0x15faa2(0x1e3),()=>_0x575f1f['segment']['getFolder'](_0x20a925),{'verbose':_0x375cda[_0x15faa2(0x1e4)]});return await handleSDKOutput([_0x2bb3b5[_0x15faa2(0x1ec)]],_0x375cda),0x0;}catch(_0x16216e){if(_0x16216e instanceof SDKError)return console[_0x15faa2(0x1dc)](_0x15faa2(0x1c8)+_0x16216e[_0x15faa2(0x192)]),_0x16216e[_0x15faa2(0x1eb)]&&console[_0x15faa2(0x1dc)](_0x15faa2(0x1e5)+_0x16216e[_0x15faa2(0x1eb)]),0x1;throw _0x16216e;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a29_0x8c2eb(0x1a1);[a29_0x8c2eb(0x20b)]=a29_0x8c2eb(0x1b2);async['execute'](_0x2fb9e2){const _0x3c25b9=a29_0x8c2eb,{options:_0x334d85,args:_0x29d2c6,tdx:_0x4596f6}=_0x2fb9e2,_0x1e6c67=_0x29d2c6[0x0],_0x1f34a2=!_0x1e6c67&&!!_0x334d85[_0x3c25b9(0x203)],_0x5387fe=_0x1e6c67||_0x334d85[_0x3c25b9(0x203)];if(!_0x5387fe)return console[_0x3c25b9(0x1dc)](_0x3c25b9(0x1a0)),console[_0x3c25b9(0x1dc)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x3c25b9(0x1dc)](_0x3c25b9(0x216)),console[_0x3c25b9(0x1dc)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x3c25b9(0x1dc)](_0x3c25b9(0x1e9)),console[_0x3c25b9(0x1dc)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x3c25b9(0x1da)),0x1;try{const _0x3b7c8c=_0x334d85['segmentPath'];let _0x13ea31=_0x5387fe;!_0x1f34a2&&_0x3b7c8c&&!_0x5387fe[_0x3c25b9(0x193)]('/')&&(_0x13ea31=_0x3b7c8c+'/'+_0x5387fe,_0x334d85[_0x3c25b9(0x1e4)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x13ea31));const _0x4ce5c1=await withSpinner(_0x3c25b9(0x1a3)+_0x13ea31+_0x3c25b9(0x1e3),()=>_0x4596f6[_0x3c25b9(0x1c2)][_0x3c25b9(0x197)](_0x13ea31),{'verbose':_0x334d85[_0x3c25b9(0x1e4)]}),_0x4379e7=_0x4ce5c1[_0x3c25b9(0x1ec)];_0x334d85[_0x3c25b9(0x1e4)]&&(console['error'](_0x3c25b9(0x210)+_0x4379e7[_0x3c25b9(0x1d5)]),console[_0x3c25b9(0x1dc)](_0x3c25b9(0x1e0)+_0x4379e7['parentId']));if(_0x4379e7[_0x3c25b9(0x1d5)]===_0x3c25b9(0x204))return console[_0x3c25b9(0x1dc)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x3c25b9(0x1dc)](_0x3c25b9(0x1bf)),0x1;let _0xca157f;if(_0x4379e7['type']===_0x3c25b9(0x201)){const _0x142585=await withSpinner(_0x3c25b9(0x1c4),()=>_0x4596f6[_0x3c25b9(0x1c2)][_0x3c25b9(0x1a9)](_0x4379e7[_0x3c25b9(0x1f8)]),{'verbose':_0x334d85[_0x3c25b9(0x1e4)]});_0xca157f=_0x142585[_0x3c25b9(0x1ec)];}else{if(!_0x4379e7[_0x3c25b9(0x1d6)])throw new SDKError(ErrorCode['INTERNAL'],_0x3c25b9(0x1bb));const _0x194c4d=await withSpinner(_0x3c25b9(0x1fa),()=>_0x4596f6['segment'][_0x3c25b9(0x208)](_0x4379e7['parentId'],_0x4379e7[_0x3c25b9(0x1d6)]),{'verbose':_0x334d85[_0x3c25b9(0x1e4)]});_0xca157f=_0x194c4d[_0x3c25b9(0x1ec)];}return _0x334d85[_0x3c25b9(0x1c7)]===_0x3c25b9(0x1fc)||_0x334d85[_0x3c25b9(0x1c7)]===_0x3c25b9(0x1f5)?await handleSDKOutput([{'sql':_0xca157f}],_0x334d85):console[_0x3c25b9(0x1fe)](_0xca157f),0x0;}catch(_0x30a242){if(_0x30a242 instanceof SDKError)return console[_0x3c25b9(0x1dc)](_0x3c25b9(0x1c8)+_0x30a242[_0x3c25b9(0x192)]),_0x30a242['cause']&&console[_0x3c25b9(0x1dc)](_0x3c25b9(0x1e5)+_0x30a242[_0x3c25b9(0x1eb)]),0x1;throw _0x30a242;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a29_0x8c2eb(0x211);['description']=a29_0x8c2eb(0x1e6);async[a29_0x8c2eb(0x1ff)](_0x49fc5e){const _0xf5103c=a29_0x8c2eb,{options:_0x51620c,args:_0x391811,tdx:_0xe8331}=_0x49fc5e,_0x1e1654=_0x51620c;if(_0x391811['length']<0x2)return console[_0xf5103c(0x1dc)](_0xf5103c(0x1bc)),console['error'](_0xf5103c(0x196)),0x1;const _0x4fb064=_0x391811[0x0],_0x273d95=_0x391811[0x1];_0x1e1654['verbose']&&(console[_0xf5103c(0x1dc)](_0xf5103c(0x1b1)+_0x1e1654[_0xf5103c(0x1c1)]),console[_0xf5103c(0x1dc)](_0xf5103c(0x1be)+_0x4fb064),console[_0xf5103c(0x1dc)](_0xf5103c(0x19c)+_0x273d95));let _0x448633;if(_0x1e1654[_0xf5103c(0x212)]){const _0x4a08a9=_0x1e1654[_0xf5103c(0x212)],_0x357eb5=await withSpinner(_0xf5103c(0x1dd)+_0x4fb064+'\x27...',()=>_0xe8331[_0xf5103c(0x1c2)]['resolveParentId'](_0x4fb064),{'verbose':_0x1e1654['verbose']}),_0x125010=_0x357eb5[_0xf5103c(0x1ec)],_0x124095=await withSpinner(_0xf5103c(0x1ce)+_0x4a08a9+_0xf5103c(0x1e3),()=>_0xe8331['segment'][_0xf5103c(0x199)](_0x125010,_0x4a08a9),{'verbose':_0x1e1654[_0xf5103c(0x1e4)]});_0x448633=_0x124095['data'],_0x1e1654['verbose']&&console[_0xf5103c(0x1dc)](_0xf5103c(0x20d)+_0x448633);}const _0x1ae72f={'name':_0x273d95,'description':_0x1e1654[_0xf5103c(0x20b)],'parentFolderId':_0x448633},_0x321054=await withSpinner(_0xf5103c(0x215)+_0x273d95+'\x27...',()=>_0xe8331[_0xf5103c(0x1c2)][_0xf5103c(0x1b3)](_0x4fb064,_0x1ae72f),{'verbose':_0x1e1654[_0xf5103c(0x1e4)]}),_0x544e10=_0x321054[_0xf5103c(0x1ec)];return console['error'](_0xf5103c(0x1bd)+_0x544e10[_0xf5103c(0x1e1)]+'\x27\x20with\x20ID:\x20'+_0x544e10['id']),await handleSDKOutput([_0x544e10],_0x1e1654),0x0;}}export class SegmentInfoCommand extends BaseCommand{[a29_0x8c2eb(0x1e1)]=a29_0x8c2eb(0x20f);[a29_0x8c2eb(0x20b)]=a29_0x8c2eb(0x195);async[a29_0x8c2eb(0x1ff)](_0x404f0f){const _0x59dc54=a29_0x8c2eb,{options:_0x30908c,args:_0xdf0855,tdx:_0x52b125}=_0x404f0f,_0x3d3b23=_0xdf0855[0x0],_0x318867=!_0x3d3b23&&!!_0x30908c[_0x59dc54(0x203)],_0x21cd02=_0x3d3b23||_0x30908c['parentSegment'];if(!_0x21cd02)return console['error'](_0x59dc54(0x1f4)),console['error'](_0x59dc54(0x213)),console['error'](_0x59dc54(0x216)),console[_0x59dc54(0x1dc)](_0x59dc54(0x1e2)),console[_0x59dc54(0x1dc)](_0x59dc54(0x19f)),console['error'](_0x59dc54(0x1f1)),console['error'](_0x59dc54(0x1da)),0x1;try{const _0x2e5124=_0x30908c[_0x59dc54(0x205)];let _0x4de921=_0x21cd02;!_0x318867&&_0x2e5124&&!_0x21cd02[_0x59dc54(0x193)]('/')&&(_0x4de921=_0x2e5124+'/'+_0x21cd02,_0x30908c[_0x59dc54(0x1e4)]&&console[_0x59dc54(0x1dc)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4de921));const _0x18f6f3=await withSpinner(_0x59dc54(0x1a3)+_0x4de921+'\x27...',()=>_0x52b125[_0x59dc54(0x1c2)][_0x59dc54(0x197)](_0x4de921),{'verbose':_0x30908c[_0x59dc54(0x1e4)]}),_0x23344e=_0x18f6f3[_0x59dc54(0x1ec)];_0x30908c[_0x59dc54(0x1e4)]&&(console[_0x59dc54(0x1dc)]('Resolved\x20type:\x20'+_0x23344e[_0x59dc54(0x1d5)]),console[_0x59dc54(0x1dc)](_0x59dc54(0x1e0)+_0x23344e[_0x59dc54(0x1f8)]),_0x23344e['folderId']&&console['error'](_0x59dc54(0x1f6)+_0x23344e[_0x59dc54(0x209)]),_0x23344e['segmentId']&&console[_0x59dc54(0x1dc)](_0x59dc54(0x1fd)+_0x23344e[_0x59dc54(0x1d6)]));if(_0x23344e['type']===_0x59dc54(0x201)){const _0x65e4e3=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x52b125['segment'][_0x59dc54(0x19a)](_0x23344e['parentId']),{'verbose':_0x30908c[_0x59dc54(0x1e4)]});await handleSingleObjectOutput(_0x65e4e3['data'],_0x30908c);}else{if(_0x23344e[_0x59dc54(0x1d5)]==='folder'){if(!_0x23344e['folderId'])throw new SDKError(ErrorCode[_0x59dc54(0x1ed)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x7b3edf=await withSpinner(_0x59dc54(0x207),()=>_0x52b125['segment']['getFolder'](_0x23344e[_0x59dc54(0x209)]),{'verbose':_0x30908c[_0x59dc54(0x1e4)]});await handleSingleObjectOutput(_0x7b3edf[_0x59dc54(0x1ec)],_0x30908c);}else{if(_0x23344e[_0x59dc54(0x1d5)]===_0x59dc54(0x1c2)){if(!_0x23344e['segmentId'])throw new SDKError(ErrorCode[_0x59dc54(0x1ed)],_0x59dc54(0x1bb));const _0x3109b3=await withSpinner(_0x59dc54(0x1b5),()=>_0x52b125[_0x59dc54(0x1c2)][_0x59dc54(0x1a6)](_0x23344e[_0x59dc54(0x1f8)],_0x23344e[_0x59dc54(0x1d6)]),{'verbose':_0x30908c['verbose']});await handleSingleObjectOutput(_0x3109b3[_0x59dc54(0x1ec)],_0x30908c);}}}return 0x0;}catch(_0x5a2d15){if(_0x5a2d15 instanceof SDKError)return console[_0x59dc54(0x1dc)](_0x59dc54(0x1c8)+_0x5a2d15[_0x59dc54(0x192)]),_0x5a2d15[_0x59dc54(0x1eb)]&&console[_0x59dc54(0x1dc)](_0x59dc54(0x1e5)+_0x5a2d15['cause']),0x1;throw _0x5a2d15;}}}export class SegmentDescCommand extends BaseCommand{[a29_0x8c2eb(0x1e1)]=a29_0x8c2eb(0x1d9);['description']=a29_0x8c2eb(0x1f2);async['execute'](_0x293068){const _0x4e1c3b=a29_0x8c2eb,{options:_0x1e3c3c,args:_0x35f659,tdx:_0x9950f2}=_0x293068,_0xe86a9a=_0x35f659[0x0],_0x21552e=!_0xe86a9a&&!!_0x1e3c3c['parentSegment'],_0x54c6ef=_0xe86a9a||_0x1e3c3c['parentSegment'];if(!_0x54c6ef)return console[_0x4e1c3b(0x1dc)](_0x4e1c3b(0x1a0)),console[_0x4e1c3b(0x1dc)](_0x4e1c3b(0x202)),console['error'](_0x4e1c3b(0x216)),console['error'](_0x4e1c3b(0x19e)),console[_0x4e1c3b(0x1dc)]('\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x4e1c3b(0x1dc)](_0x4e1c3b(0x1e7)),console[_0x4e1c3b(0x1dc)](_0x4e1c3b(0x1da)),0x1;try{const _0x4db077=_0x1e3c3c[_0x4e1c3b(0x205)];let _0x24fb08=_0x54c6ef;!_0x21552e&&_0x4db077&&!_0x54c6ef[_0x4e1c3b(0x193)]('/')&&(_0x24fb08=_0x4db077+'/'+_0x54c6ef,_0x1e3c3c[_0x4e1c3b(0x1e4)]&&console['error'](_0x4e1c3b(0x1ad)+_0x24fb08));const _0x1d10d2=await withSpinner(_0x4e1c3b(0x1a3)+_0x24fb08+'\x27...',()=>_0x9950f2[_0x4e1c3b(0x1c2)][_0x4e1c3b(0x197)](_0x24fb08),{'verbose':_0x1e3c3c[_0x4e1c3b(0x1e4)]}),_0x2b242c=_0x1d10d2[_0x4e1c3b(0x1ec)];_0x1e3c3c[_0x4e1c3b(0x1e4)]&&(console[_0x4e1c3b(0x1dc)](_0x4e1c3b(0x210)+_0x2b242c[_0x4e1c3b(0x1d5)]),console[_0x4e1c3b(0x1dc)]('Parent\x20ID:\x20'+_0x2b242c['parentId']));if(_0x2b242c[_0x4e1c3b(0x1d5)]===_0x4e1c3b(0x204))return console[_0x4e1c3b(0x1dc)](_0x4e1c3b(0x20c)),console['error'](_0x4e1c3b(0x1bf)),0x1;let _0x3d64a3;if(_0x2b242c[_0x4e1c3b(0x1d5)]==='parent'){const _0xb6a63f=await withSpinner(_0x4e1c3b(0x1c4),()=>_0x9950f2[_0x4e1c3b(0x1c2)]['getParentSQL'](_0x2b242c['parentId']),{'verbose':_0x1e3c3c[_0x4e1c3b(0x1e4)]});_0x3d64a3=_0xb6a63f[_0x4e1c3b(0x1ec)];}else{if(!_0x2b242c['segmentId'])throw new SDKError(ErrorCode[_0x4e1c3b(0x1ed)],_0x4e1c3b(0x1bb));const _0x3bb176=await withSpinner(_0x4e1c3b(0x1fa),()=>_0x9950f2[_0x4e1c3b(0x1c2)][_0x4e1c3b(0x208)](_0x2b242c[_0x4e1c3b(0x1f8)],_0x2b242c[_0x4e1c3b(0x1d6)]),{'verbose':_0x1e3c3c['verbose']});_0x3d64a3=_0x3bb176[_0x4e1c3b(0x1ec)];}const _0x5e7724=await executeSchemaQuery(_0x3d64a3,_0x9950f2,_0x1e3c3c);return await handleQueryOutput(_0x5e7724,_0x1e3c3c),0x0;}catch(_0x1814c8){if(_0x1814c8 instanceof SDKError)return console[_0x4e1c3b(0x1dc)](_0x4e1c3b(0x1c8)+_0x1814c8['message']),_0x1814c8[_0x4e1c3b(0x1eb)]&&console[_0x4e1c3b(0x1dc)]('\x20\x20Cause:\x20'+_0x1814c8[_0x4e1c3b(0x1eb)]),0x1;throw _0x1814c8;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x1ccf07=a30_0x48f2;(function(_0x18a5b5,_0x16f13e){const _0x2fa26d=a30_0x48f2,_0x2c43bd=_0x18a5b5();while(!![]){try{const _0x4cee39=parseInt(_0x2fa26d(0x105))/0x1*(parseInt(_0x2fa26d(0x10f))/0x2)+parseInt(_0x2fa26d(0xe9))/0x3+-parseInt(_0x2fa26d(0x110))/0x4*(-parseInt(_0x2fa26d(0xf9))/0x5)+-parseInt(_0x2fa26d(0xec))/0x6*(parseInt(_0x2fa26d(0x10e))/0x7)+-parseInt(_0x2fa26d(0xef))/0x8+-parseInt(_0x2fa26d(0x106))/0x9*(parseInt(_0x2fa26d(0xf1))/0xa)+parseInt(_0x2fa26d(0xf2))/0xb;if(_0x4cee39===_0x16f13e)break;else _0x2c43bd['push'](_0x2c43bd['shift']());}catch(_0x239172){_0x2c43bd['push'](_0x2c43bd['shift']());}}}(a30_0x17e9,0x35225));import{BaseCommand}from'./command.js';function a30_0x17e9(){const _0x48068a=['3670UJDkXF','3764563ygcjUj','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','ruleFile','createSegment','verbose','Creating\x20segment\x20\x27','parent','5RVDvgJ','includes','length','segmentPath','Resolving\x20parent\x20segment\x20\x27','resolvePathToResource','resolveParentId','site','segments','Target\x20path:\x20','Resolved\x20folder\x20ID:\x20','Examples:','44089OtRQtk','3429RtpMqy','type','description','data','invisible','segment:create','noCountPopulation','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','245KWalDD','2RRbwWB','1100856scfvlk','Site:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolving\x20folder\x20\x27','✔\x20Created\x20segment\x20\x27','resolveFolderId','Parent\x20path:\x20','segment','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','\x27...','Parent:\x20','163992InwiRp','error','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','45570PHRoKw','folder','kind','743288rtkpga','folderId'];a30_0x17e9=function(){return _0x48068a;};return a30_0x17e9();}function a30_0x48f2(_0x27137c,_0x258f32){const _0x17e94c=a30_0x17e9();return a30_0x48f2=function(_0x48f2a5,_0x50bbbf){_0x48f2a5=_0x48f2a5-0xe9;let _0x2a3c87=_0x17e94c[_0x48f2a5];return _0x2a3c87;},a30_0x48f2(_0x27137c,_0x258f32);}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{['name']=a30_0x1ccf07(0x10b);[a30_0x1ccf07(0x108)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0xf4ff6d){const _0xb3ed76=a30_0x1ccf07,{options:_0x9e2c77,args:_0x51642d,tdx:_0x19cd89}=_0xf4ff6d,_0x39c6ec=_0x9e2c77;if(_0x51642d[_0xb3ed76(0xfb)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0xb3ed76(0xea)](_0xb3ed76(0x112)),console['error'](_0xb3ed76(0x104)),console[_0xb3ed76(0xea)](_0xb3ed76(0x11a)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0xb3ed76(0x119)),0x1;const _0x19d3ab=_0x51642d[0x0],_0x2bb383=_0x9e2c77[_0xb3ed76(0xfc)];let _0xea61d1=_0x19d3ab;_0x2bb383&&!_0x19d3ab[_0xb3ed76(0xfa)]('/')&&(_0xea61d1=_0x2bb383+'/'+_0x19d3ab,_0x39c6ec['verbose']&&console[_0xb3ed76(0xea)]('Resolved\x20relative\x20path\x20to:\x20'+_0xea61d1));const _0x2c0463=parsePath(_0xea61d1);if(_0x2c0463[_0xb3ed76(0x101)]['length']<0x2)return console[_0xb3ed76(0xea)](_0xb3ed76(0xeb)),console[_0xb3ed76(0xea)](_0xb3ed76(0xf3)),0x1;const _0x37073d=_0x2c0463[_0xb3ed76(0x101)][0x0],_0x3984fa=getBaseName(_0xea61d1),_0x5bf48c=getParentPath(_0xea61d1);_0x39c6ec[_0xb3ed76(0xf6)]&&(console[_0xb3ed76(0xea)](_0xb3ed76(0x111)+_0x39c6ec[_0xb3ed76(0x100)]),console[_0xb3ed76(0xea)](_0xb3ed76(0x102)+_0xea61d1),console[_0xb3ed76(0xea)](_0xb3ed76(0x11c)+_0x37073d),console[_0xb3ed76(0xea)]('Segment\x20name:\x20'+_0x3984fa),console[_0xb3ed76(0xea)](_0xb3ed76(0x116)+_0x5bf48c));const _0x44172f=await withSpinner(_0xb3ed76(0xfd)+_0x37073d+_0xb3ed76(0x11b),()=>_0x19cd89[_0xb3ed76(0x117)][_0xb3ed76(0xff)](_0x37073d),{'verbose':_0x39c6ec[_0xb3ed76(0xf6)]}),_0x3b1da2=_0x44172f[_0xb3ed76(0x109)];let _0x5e614b;if(_0x2c0463['segments']['length']>0x2){const _0x19a4ca=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x5bf48c+_0xb3ed76(0x11b),()=>_0x19cd89[_0xb3ed76(0x117)][_0xb3ed76(0xfe)](_0x5bf48c),{'verbose':_0x39c6ec[_0xb3ed76(0xf6)]}),_0x369348=_0x19a4ca[_0xb3ed76(0x109)];if(_0x369348[_0xb3ed76(0x107)]!==_0xb3ed76(0xed)&&_0x369348[_0xb3ed76(0x107)]!==_0xb3ed76(0xf8))return console[_0xb3ed76(0xea)](_0xb3ed76(0x10d)),0x1;_0x5e614b=_0x369348[_0xb3ed76(0xf0)];}else{if(_0x39c6ec[_0xb3ed76(0xed)]){const _0x28a7a3=await withSpinner(_0xb3ed76(0x113)+_0x39c6ec[_0xb3ed76(0xed)]+_0xb3ed76(0x11b),()=>_0x19cd89[_0xb3ed76(0x117)][_0xb3ed76(0x115)](_0x3b1da2,_0x39c6ec[_0xb3ed76(0xed)]),{'verbose':_0x39c6ec[_0xb3ed76(0xf6)]});_0x5e614b=_0x28a7a3[_0xb3ed76(0x109)];}}_0x39c6ec['verbose']&&_0x5e614b&&console[_0xb3ed76(0xea)](_0xb3ed76(0x103)+_0x5e614b);const _0x34ea30=await loadJSONFromOptions(_0x39c6ec['rule'],_0x39c6ec[_0xb3ed76(0xf4)]),_0x24c482={'name':_0x3984fa,'description':_0x39c6ec[_0xb3ed76(0x108)],'rule':_0x34ea30,'kind':_0x39c6ec[_0xb3ed76(0xee)]!==undefined?parseInt(_0x39c6ec[_0xb3ed76(0xee)],0xa):undefined,'isVisible':_0x39c6ec[_0xb3ed76(0x10a)]?![]:undefined,'segmentFolderId':_0x5e614b,'countPopulation':_0x39c6ec[_0xb3ed76(0x10c)]?![]:undefined},_0x2421e1=await withSpinner(_0xb3ed76(0xf7)+_0x3984fa+_0xb3ed76(0x11b),()=>_0x19cd89[_0xb3ed76(0x117)][_0xb3ed76(0xf5)](_0x3b1da2,_0x24c482),{'verbose':_0x39c6ec[_0xb3ed76(0xf6)]}),_0x3fbc82=_0x2421e1[_0xb3ed76(0x109)];return console[_0xb3ed76(0xea)](_0xb3ed76(0x114)+_0x3fbc82['name']+_0xb3ed76(0x118)+_0x3fbc82['id']),_0xea61d1!==_0x19d3ab&&console[_0xb3ed76(0xea)]('\x20\x20\x20Path:\x20'+_0xea61d1),await handleSDKOutput([_0x3fbc82],_0x39c6ec),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a31_0x472c(_0xb11a1f,_0x1a3afb){const _0xd636fa=a31_0xd636();return a31_0x472c=function(_0x472cb2,_0x3d94b9){_0x472cb2=_0x472cb2-0x105;let _0x4b245f=_0xd636fa[_0x472cb2];return _0x4b245f;},a31_0x472c(_0xb11a1f,_0x1a3afb);}const a31_0x1e5626=a31_0x472c;(function(_0x125f52,_0xcb53af){const _0x27ed37=a31_0x472c,_0x163f3e=_0x125f52();while(!![]){try{const _0x4f21a0=-parseInt(_0x27ed37(0x109))/0x1*(-parseInt(_0x27ed37(0x122))/0x2)+-parseInt(_0x27ed37(0x10a))/0x3+parseInt(_0x27ed37(0x11f))/0x4*(-parseInt(_0x27ed37(0x106))/0x5)+-parseInt(_0x27ed37(0x121))/0x6*(parseInt(_0x27ed37(0x11e))/0x7)+parseInt(_0x27ed37(0x118))/0x8*(parseInt(_0x27ed37(0x117))/0x9)+-parseInt(_0x27ed37(0x110))/0xa*(-parseInt(_0x27ed37(0x108))/0xb)+parseInt(_0x27ed37(0x105))/0xc;if(_0x4f21a0===_0xcb53af)break;else _0x163f3e['push'](_0x163f3e['shift']());}catch(_0x412f66){_0x163f3e['push'](_0x163f3e['shift']());}}}(a31_0xd636,0x659f4));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a31_0xd636(){const _0x34196c=['segment','Site:\x20','description','execute','✔\x20Found\x20','230629glbUdI','1445744Bxfamb','List\x20available\x20fields\x20for\x20segmentation','42tChMiG','178QloKhp','error','4580520jvDGtN','5JhfJbL','length','405317pTxaIp','4678aSiadw','1217835oldjXf','json','Error:\x20Parent\x20segment\x20name\x20is\x20required','Parent\x20segment:\x20','segment:fields','Listing\x20fields\x20for\x20\x27','130maiLXw','verbose','jsonl','listFields','site','\x20field','parentSegment','1234719spHLjq','8jnhrhL'];a31_0xd636=function(){return _0x34196c;};return a31_0xd636();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a31_0x1e5626(0x10e);[a31_0x1e5626(0x11b)]=a31_0x1e5626(0x120);async[a31_0x1e5626(0x11c)](_0x312eb9){const _0x1b9fab=a31_0x1e5626,{options:_0x23ffde,args:_0x510d8a,tdx:_0x33baa2}=_0x312eb9,_0x448e63=_0x510d8a[0x0]||_0x23ffde[_0x1b9fab(0x116)];if(!_0x448e63)return console[_0x1b9fab(0x123)](_0x1b9fab(0x10c)),console[_0x1b9fab(0x123)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x1b9fab(0x123)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x23ffde[_0x1b9fab(0x111)]&&(console[_0x1b9fab(0x123)](_0x1b9fab(0x11a)+_0x23ffde[_0x1b9fab(0x114)]),console[_0x1b9fab(0x123)](_0x1b9fab(0x10d)+_0x448e63));const _0x53b433=await withSpinner(_0x1b9fab(0x10f)+_0x448e63+'\x27...',()=>_0x33baa2[_0x1b9fab(0x119)][_0x1b9fab(0x113)](_0x448e63),{'verbose':_0x23ffde[_0x1b9fab(0x111)]}),_0x219b28=_0x53b433['data'];console[_0x1b9fab(0x123)](_0x1b9fab(0x11d)+_0x219b28[_0x1b9fab(0x107)]+_0x1b9fab(0x115)+(_0x219b28['length']!==0x1?'s':''));if(_0x23ffde[_0x1b9fab(0x10b)]||_0x23ffde[_0x1b9fab(0x112)])return await handleSDKOutput(_0x219b28,_0x23ffde),0x0;return displayFieldsHumanReadable(_0x219b28,_0x448e63),0x0;}}
|