@treasuredata/tdx 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.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.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x26812b=a26_0x558e;(function(_0xe825cb,_0x5988ba){const _0x3a7498=a26_0x558e,_0x4f0cc0=_0xe825cb();while(!![]){try{const _0x162306=-parseInt(_0x3a7498(0x117))/0x1+-parseInt(_0x3a7498(0x166))/0x2+-parseInt(_0x3a7498(0x105))/0x3*(-parseInt(_0x3a7498(0xe8))/0x4)+parseInt(_0x3a7498(0xf2))/0x5+parseInt(_0x3a7498(0xf6))/0x6*(-parseInt(_0x3a7498(0x13e))/0x7)+-parseInt(_0x3a7498(0x96))/0x8*(-parseInt(_0x3a7498(0x104))/0x9)+-parseInt(_0x3a7498(0x94))/0xa;if(_0x162306===_0x5988ba)break;else _0x4f0cc0['push'](_0x4f0cc0['shift']());}catch(_0x3fba6d){_0x4f0cc0['push'](_0x4f0cc0['shift']());}}}(a26_0x4e65,0x6510f));import{writeFileSync,readFileSync,existsSync,mkdirSync}from'fs';import a26_0x5de569 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}from'../types/endpoints.js';function a26_0x558e(_0x2041c9,_0x1f5f3b){const _0x4e65be=a26_0x4e65();return a26_0x558e=function(_0x558ef0,_0xec9e63){_0x558ef0=_0x558ef0-0x87;let _0x262167=_0x4e65be[_0x558ef0];return _0x262167;},a26_0x558e(_0x2041c9,_0x1f5f3b);}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_0x4bc9a1 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a26_0x26812b(0xfb);function resolveYamlFile(_0x49348c){const _0x49821c=a26_0x26812b;if(_0x49348c[_0x49821c(0x108)]('.yml')||_0x49348c['endsWith']('.yaml'))return _0x49348c;return a26_0x5de569[_0x49821c(0xb0)](PARENT_SEGMENT_DIR,_0x49348c+_0x49821c(0xac));}function formatProgressMessage(_0x32059a){const _0x30a809=a26_0x26812b,_0x25cd2a=_0x32059a[_0x30a809(0x102)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x25cd2a){const [,_0x1fc751,_0x1f2401,_0x2605ff='']=_0x25cd2a;return a26_0x4bc9a1['dim'](_0x1fc751+':')+'\x20'+_0x1f2401+a26_0x4bc9a1[_0x30a809(0xbf)](_0x2605ff);}return a26_0x4bc9a1['dim'](_0x32059a);}export class ParentSegmentListCommand extends BaseCommand{[a26_0x26812b(0x134)]=a26_0x26812b(0xd6);[a26_0x26812b(0x131)]='List\x20parent\x20segments';async[a26_0x26812b(0xb1)](_0x407a0f){const _0x4de5bf=a26_0x26812b,{options:_0x88bcbf,args:_0x2dd2ec,tdx:_0x4b07bb}=_0x407a0f,_0x32a5c8=_0x2dd2ec[0x0];_0x88bcbf[_0x4de5bf(0x103)]&&(console[_0x4de5bf(0x148)](_0x4de5bf(0x141)+_0x88bcbf[_0x4de5bf(0x15f)]),_0x32a5c8&&console[_0x4de5bf(0x148)](_0x4de5bf(0xc7)+_0x32a5c8));const _0x28e58d=await withSpinner(_0x32a5c8?_0x4de5bf(0xe1)+_0x32a5c8+_0x4de5bf(0xff):_0x4de5bf(0xbd),()=>_0x4b07bb[_0x4de5bf(0x181)][_0x4de5bf(0x135)](),{'verbose':_0x88bcbf['verbose']});let _0x8e59fe=_0x28e58d['data'];if(_0x32a5c8){const _0x34bc40=_0x32a5c8['replace'](/[.+^${}()|[\]\\]/g,_0x4de5bf(0x89))[_0x4de5bf(0xd4)](/\*/g,'.*')[_0x4de5bf(0xd4)](/\?/g,'.'),_0x1f808b=new RegExp('^'+_0x34bc40+'$','i');_0x8e59fe=_0x8e59fe[_0x4de5bf(0x149)](_0x25f103=>_0x1f808b['test'](_0x25f103[_0x4de5bf(0xba)][_0x4de5bf(0x134)]));}_0x8e59fe['sort']((_0x48a1d2,_0x3f989f)=>_0x48a1d2[_0x4de5bf(0xba)][_0x4de5bf(0x134)]['localeCompare'](_0x3f989f[_0x4de5bf(0xba)][_0x4de5bf(0x134)])),console[_0x4de5bf(0x148)](_0x4de5bf(0x109)+_0x8e59fe[_0x4de5bf(0x173)]+'\x20parent\x20segment'+(_0x8e59fe['length']!==0x1?'s':''));if(_0x88bcbf[_0x4de5bf(0x164)]==='json'||_0x88bcbf[_0x4de5bf(0x164)]===_0x4de5bf(0x121))await handleSDKOutput(_0x8e59fe,_0x88bcbf);else{if(_0x8e59fe[_0x4de5bf(0x173)]===0x0)_0x32a5c8?console[_0x4de5bf(0x97)](_0x4de5bf(0x186)+_0x32a5c8):console['log']('No\x20parent\x20segments\x20found');else for(const _0x54fbde of _0x8e59fe){const _0x9d820f=_0x54fbde[_0x4de5bf(0xba)][_0x4de5bf(0xc5)]?a26_0x4bc9a1[_0x4de5bf(0xbf)]('\x20('+formatRows(_0x54fbde['attributes'][_0x4de5bf(0xc5)])+')'):'';console[_0x4de5bf(0x97)](_0x4de5bf(0x163)+_0x54fbde[_0x4de5bf(0xba)][_0x4de5bf(0x134)]+_0x9d820f);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a26_0x26812b(0xcc);[a26_0x26812b(0x131)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a26_0x26812b(0xb1)](_0x2065b8){const _0x2d2a63=a26_0x26812b,{options:_0x531153,args:_0x52d69a,tdx:_0x5126c9}=_0x2065b8;console[_0x2d2a63(0x148)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x2d2a63(0x171)+_0x2d2a63(0x159));const _0x2b4d1f=_0x531153;if(_0x52d69a['length']===0x0)return console[_0x2d2a63(0x148)](_0x2d2a63(0x11c)),console[_0x2d2a63(0x148)](_0x2d2a63(0x10c)),0x1;const _0x553775=_0x52d69a[0x0];if(!_0x2b4d1f[_0x2d2a63(0xe9)]||!_0x2b4d1f[_0x2d2a63(0xb6)])return console[_0x2d2a63(0x148)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x2d2a63(0x148)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x2b4d1f[_0x2d2a63(0x103)]&&(console[_0x2d2a63(0x148)]('Site:\x20'+_0x2b4d1f[_0x2d2a63(0x15f)]),console[_0x2d2a63(0x148)](_0x2d2a63(0xdc)+_0x553775),console[_0x2d2a63(0x148)]('Database:\x20'+_0x2b4d1f['database']),console['error'](_0x2d2a63(0x172)+_0x2b4d1f['table']));const _0x313392=await loadJSONFromOptions(_0x2b4d1f['attributes'],_0x2b4d1f[_0x2d2a63(0x126)]),_0xa57cd5=await loadJSONFromOptions(_0x2b4d1f['behaviors'],_0x2b4d1f[_0x2d2a63(0xe5)]),_0x11357c=await loadJSONFromOptions(_0x2b4d1f[_0x2d2a63(0xbb)],_0x2b4d1f[_0x2d2a63(0xb9)]),_0x59f07b={'name':_0x553775,'description':_0x2b4d1f[_0x2d2a63(0x131)],'scheduleType':_0x2b4d1f[_0x2d2a63(0x162)],'scheduleOption':_0x2b4d1f[_0x2d2a63(0xfa)],'timezone':_0x2b4d1f[_0x2d2a63(0x16b)],'master':{'parentDatabaseName':_0x2b4d1f['database'],'parentTableName':_0x2b4d1f[_0x2d2a63(0xb6)]},'attributes':_0x313392,'behaviors':_0xa57cd5,'customerGroup':_0x11357c},_0x193704=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x553775+_0x2d2a63(0xff),()=>_0x5126c9[_0x2d2a63(0x181)][_0x2d2a63(0xfe)](_0x59f07b),{'verbose':_0x531153[_0x2d2a63(0x103)]}),_0x4b57cf=_0x193704[_0x2d2a63(0x177)];return console[_0x2d2a63(0x148)](_0x2d2a63(0x132)+_0x4b57cf[_0x2d2a63(0x134)]+_0x2d2a63(0x12b)+_0x4b57cf['id']),await handleSDKOutput([_0x4b57cf],_0x531153),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';[a26_0x26812b(0x131)]=a26_0x26812b(0x174);async[a26_0x26812b(0xb1)](_0x517ce8){const _0x316d1c=a26_0x26812b,{options:_0x1b7166,args:_0x27e086,tdx:_0x57854f}=_0x517ce8;console[_0x316d1c(0x148)](_0x316d1c(0x158)+_0x316d1c(0x171)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x2dda69=_0x1b7166;if(_0x27e086[_0x316d1c(0x173)]===0x0)return console[_0x316d1c(0x148)](_0x316d1c(0x11c)),console[_0x316d1c(0x148)](_0x316d1c(0x124)),0x1;const _0x13f597=_0x27e086[0x0];_0x2dda69[_0x316d1c(0x103)]&&(console[_0x316d1c(0x148)]('Site:\x20'+_0x2dda69[_0x316d1c(0x15f)]),console[_0x316d1c(0x148)]('Parent\x20segment:\x20'+_0x13f597));const _0x396b67=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x13f597+_0x316d1c(0xff),()=>_0x57854f[_0x316d1c(0x181)]['getParentFull'](_0x13f597),{'verbose':_0x2dda69[_0x316d1c(0x103)]}),_0x1f3f56=_0x396b67['data'],_0x2eee44=await loadJSONFromOptions(_0x2dda69['addAttributes'],_0x2dda69[_0x316d1c(0x120)]),_0x32b660=await loadJSONFromOptions(_0x2dda69[_0x316d1c(0xa4)],_0x2dda69[_0x316d1c(0xe6)]),_0x28e5ee={'name':_0x1f3f56['name'],'description':_0x2dda69[_0x316d1c(0x131)]!==undefined?_0x2dda69[_0x316d1c(0x131)]:_0x1f3f56[_0x316d1c(0x131)],'scheduleType':_0x2dda69['scheduleType']!==undefined?_0x2dda69[_0x316d1c(0x162)]:_0x1f3f56[_0x316d1c(0x162)],'scheduleOption':_0x2dda69[_0x316d1c(0xfa)]!==undefined?_0x2dda69['scheduleOption']:_0x1f3f56[_0x316d1c(0xfa)],'timezone':_0x2dda69[_0x316d1c(0x16b)]!==undefined?_0x2dda69['timezone']:_0x1f3f56[_0x316d1c(0x16b)],'master':_0x1f3f56[_0x316d1c(0xa5)],'attributes':_0x2eee44?[..._0x1f3f56[_0x316d1c(0xba)]||[],..._0x2eee44]:_0x1f3f56[_0x316d1c(0xba)],'behaviors':_0x32b660?[..._0x1f3f56['behaviors']||[],..._0x32b660]:_0x1f3f56[_0x316d1c(0x13c)],'customerGroup':_0x1f3f56['customerGroup']},_0x3bb9d1=await withSpinner(_0x316d1c(0x92)+_0x13f597+'\x27...',()=>_0x57854f[_0x316d1c(0x181)][_0x316d1c(0x119)](_0x13f597,_0x28e5ee),{'verbose':_0x2dda69[_0x316d1c(0x103)]}),_0x1b1759=_0x3bb9d1[_0x316d1c(0x177)];return console[_0x316d1c(0x148)](_0x316d1c(0x9a)+_0x1b1759[_0x316d1c(0x134)]+'\x27'),await handleSDKOutput([_0x1b1759],_0x2dda69),0x0;}}export class ParentSegmentPullCommand extends BaseCommand{[a26_0x26812b(0x134)]=a26_0x26812b(0x12c);['description']=a26_0x26812b(0x143);async[a26_0x26812b(0xb1)](_0x2bc678){const _0x102ebe=a26_0x26812b,{options:_0x33f7f5,args:_0xe8f4df,tdx:_0x1033b6}=_0x2bc678,_0x242eb5=_0x33f7f5,_0x3c43c0=_0xe8f4df[0x0]||_0x33f7f5[_0x102ebe(0xc3)];if(!_0x3c43c0)return console[_0x102ebe(0x148)](a26_0x4bc9a1[_0x102ebe(0x150)](_0x102ebe(0xf5))),console[_0x102ebe(0x148)](_0x102ebe(0x12e)),console[_0x102ebe(0x148)](a26_0x4bc9a1[_0x102ebe(0x9b)](_0x102ebe(0x11b))),0x1;const _0x328729=_0x242eb5[_0x102ebe(0x13a)]||a26_0x5de569[_0x102ebe(0xb0)](PARENT_SEGMENT_DIR,_0x3c43c0+_0x102ebe(0xac));_0x242eb5['verbose']&&(console[_0x102ebe(0x148)](_0x102ebe(0x141)+_0x242eb5[_0x102ebe(0x15f)]),console[_0x102ebe(0x148)](_0x102ebe(0x153)+_0x3c43c0),console[_0x102ebe(0x148)](_0x102ebe(0xec)+_0x328729));const _0x279487=await withSpinner(_0x102ebe(0x168)+_0x3c43c0+'\x27...',()=>_0x1033b6[_0x102ebe(0x181)][_0x102ebe(0xb3)](_0x3c43c0),{'verbose':_0x242eb5[_0x102ebe(0x103)]}),_0x3ffbe2=_0x279487[_0x102ebe(0x177)];if(existsSync(_0x328729)){const _0x4aa3f9=readFileSync(_0x328729,'utf-8'),_0x570bc8=generateDiff(_0x4aa3f9,_0x3ffbe2);if(!hasChanges(_0x570bc8))return console[_0x102ebe(0x148)](_0x102ebe(0x154)+_0x328729+_0x102ebe(0x136)),0x0;console['error']('\x0aChanges\x20to\x20\x27'+_0x328729+'\x27:'),console['error']('─'[_0x102ebe(0x17f)](0x3c)),console[_0x102ebe(0x148)](formatDiffWithColors(_0x570bc8)),console['error']('─'[_0x102ebe(0x17f)](0x3c));if(!_0x242eb5['yes']){const _0x191184=await confirmKey(_0x102ebe(0x17c)+_0x328729+'\x27?');if(!_0x191184)return console[_0x102ebe(0x148)](_0x102ebe(0xaf)),0x1;}}const _0x132e1f=a26_0x5de569['dirname'](_0x328729);return!existsSync(_0x132e1f)&&mkdirSync(_0x132e1f,{'recursive':!![]}),writeFileSync(_0x328729,_0x3ffbe2,'utf-8'),console[_0x102ebe(0x148)](_0x102ebe(0x107)+_0x328729+'\x27'),_0x242eb5[_0x102ebe(0xa6)]&&(saveSessionContext({'parent_segment':_0x3c43c0},_0x242eb5['session']),console[_0x102ebe(0x148)](_0x102ebe(0x122)+_0x3c43c0)),0x0;}}export class ParentSegmentPushCommand extends BaseCommand{['name']=a26_0x26812b(0xc8);['description']='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a26_0x26812b(0xb1)](_0x3eceb9){const _0x5356a3=a26_0x26812b,{options:_0x1aa978,args:_0x2a38d5,tdx:_0x1f1dc8}=_0x3eceb9,_0x3e1a6d=_0x1aa978,_0x3c1e2b=_0x2a38d5[0x0]||_0x1aa978['parentSegment'];if(!_0x3c1e2b)return console[_0x5356a3(0x148)](a26_0x4bc9a1[_0x5356a3(0x150)](_0x5356a3(0xf5))),console[_0x5356a3(0x148)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console[_0x5356a3(0x148)](a26_0x4bc9a1[_0x5356a3(0x9b)](_0x5356a3(0xf7))),0x1;const _0x3cb5ba=resolveYamlFile(_0x3c1e2b);if(!existsSync(_0x3cb5ba))return console[_0x5356a3(0x148)](_0x5356a3(0xa2)+_0x3cb5ba),0x1;_0x3e1a6d[_0x5356a3(0x103)]&&(console['error'](_0x5356a3(0x141)+_0x3e1a6d['site']),console['error'](_0x5356a3(0x15b)+_0x3cb5ba));let _0x20d7ba;try{_0x20d7ba=readFileSync(_0x3cb5ba,_0x5356a3(0xcb));}catch(_0x217a3c){const _0x5dc29b=_0x217a3c instanceof Error?_0x217a3c['message']:String(_0x217a3c);return console[_0x5356a3(0x148)](_0x5356a3(0x175)+_0x5dc29b),0x1;}const _0x1c696c=await withSpinner(_0x5356a3(0x9f),()=>_0x1f1dc8[_0x5356a3(0x181)]['pushParentYaml'](_0x20d7ba),{'verbose':_0x3e1a6d[_0x5356a3(0x103)]}),_0x12df31=_0x1c696c[_0x5356a3(0x177)],{isNew:_0x61801a,name:_0x2bda72,hasChanges:_0x553dce,diffFormatted:_0x5e08ed}=_0x12df31;if(!_0x553dce)return console[_0x5356a3(0x148)](_0x5356a3(0x154)+_0x2bda72+_0x5356a3(0x136)),0x0;_0x61801a?console[_0x5356a3(0x148)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x2bda72+'\x27:'):console[_0x5356a3(0x148)](_0x5356a3(0xea)+_0x2bda72+'\x27:');console[_0x5356a3(0x148)]('─'[_0x5356a3(0x17f)](0x3c)),console[_0x5356a3(0x148)](_0x5e08ed),console[_0x5356a3(0x148)]('─'['repeat'](0x3c));const _0x10e131=_0x61801a?_0x5356a3(0xf3)+_0x2bda72+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2bda72+'\x27?';if(!_0x3e1a6d[_0x5356a3(0x15c)]){const _0xaaee0e=await confirmKey(_0x10e131);if(!_0xaaee0e)return console[_0x5356a3(0x148)](_0x5356a3(0xaf)),0x1;}const _0x2f48fa=_0x61801a?_0x5356a3(0xab):_0x5356a3(0x160),_0x221b54=await withSpinner(_0x2f48fa+_0x5356a3(0x114)+_0x2bda72+'\x27...',()=>_0x12df31['apply'](),{'verbose':_0x3e1a6d[_0x5356a3(0x103)]}),_0x48a385=_0x221b54[_0x5356a3(0x177)],_0xa378f3=getConsoleUrl(_0x3e1a6d[_0x5356a3(0x15f)],'/app/dw/parentSegments/'+_0x48a385['id']),_0xad963c=_0x61801a?_0x5356a3(0xf8):_0x5356a3(0xdf);return console[_0x5356a3(0x148)]('✔\x20'+_0xad963c+_0x5356a3(0x114)+_0x48a385[_0x5356a3(0x134)]+'\x27'),console['error']('\x20\x20'+_0xa378f3),0x0;}}export class ParentSegmentValidateCommand extends BaseCommand{[a26_0x26812b(0x134)]=a26_0x26812b(0x142);[a26_0x26812b(0x131)]=a26_0x26812b(0x176);async[a26_0x26812b(0xb1)](_0x1ebd01){const _0x2ced35=a26_0x26812b,{options:_0x3185f5,args:_0x311df6,tdx:_0x4d7426}=_0x1ebd01,_0x35f8d5=_0x3185f5;if(_0x311df6[_0x2ced35(0x173)]===0x0)return console[_0x2ced35(0x148)](a26_0x4bc9a1[_0x2ced35(0x150)](_0x2ced35(0xf5))),console[_0x2ced35(0x148)](_0x2ced35(0xf9)),console[_0x2ced35(0x148)](_0x2ced35(0x179)),console[_0x2ced35(0x148)]('\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)'),console[_0x2ced35(0x148)](_0x2ced35(0xd5)),console[_0x2ced35(0x148)](_0x2ced35(0x8d)),0x1;const _0x595cef=resolveYamlFile(_0x311df6[0x0]);if(!existsSync(_0x595cef))return console[_0x2ced35(0x148)](_0x2ced35(0xa2)+_0x595cef),0x1;_0x35f8d5[_0x2ced35(0x103)]&&(console['error'](_0x2ced35(0x141)+_0x35f8d5['site']),console['error'](_0x2ced35(0x15b)+_0x595cef));let _0x255a0b;try{_0x255a0b=readFileSync(_0x595cef,_0x2ced35(0xcb));}catch(_0x3f48aa){const _0x2ac034=_0x3f48aa instanceof Error?_0x3f48aa['message']:String(_0x3f48aa);return console[_0x2ced35(0x148)](_0x2ced35(0x175)+_0x2ac034),0x1;}const _0x262b3a=createCommandSpinner(a26_0x4bc9a1['dim']('Validating\x20configuration...'),{'verbose':_0x35f8d5[_0x2ced35(0x103)]});_0x262b3a['start']();const _0x4361cd={'onProgress':_0x4b73d5=>{const _0x57110d=_0x2ced35;_0x262b3a[_0x57110d(0xb4)]=formatProgressMessage(_0x4b73d5);}};if(_0x35f8d5[_0x2ced35(0xa5)])_0x4361cd[_0x2ced35(0xa5)]=!![];if(_0x35f8d5[_0x2ced35(0x152)])_0x4361cd[_0x2ced35(0x152)]=!![];_0x35f8d5[_0x2ced35(0x113)]&&(_0x4361cd['attribute']=_0x35f8d5[_0x2ced35(0x113)]);_0x35f8d5[_0x2ced35(0x165)]&&(_0x4361cd[_0x2ced35(0x165)]=_0x35f8d5[_0x2ced35(0x165)]);if(_0x35f8d5['interval'])_0x4361cd[_0x2ced35(0x12a)]=_0x35f8d5[_0x2ced35(0x12a)];let _0x51e3dd;try{_0x51e3dd=await _0x4d7426['segment']['validateParentYaml'](_0x255a0b,_0x4361cd),_0x262b3a[_0x2ced35(0x189)]();}catch(_0x5986dc){_0x262b3a[_0x2ced35(0x189)]();throw _0x5986dc;}const _0x2b21fb=_0x35f8d5[_0x2ced35(0x12a)]||'-1d';return this[_0x2ced35(0x16c)](_0x51e3dd,_0x4361cd,_0x595cef,_0x2b21fb),_0x51e3dd[_0x2ced35(0xc4)]?0x0:0x1;}[a26_0x26812b(0x16c)](_0x4bf471,_0x81a70,_0x419da4,_0x5bdbfa){const _0x5b3a36=a26_0x26812b;console[_0x5b3a36(0x148)]('\x0a'+a26_0x4bc9a1[_0x5b3a36(0x99)]('Validate:')+'\x20'+_0x4bf471[_0x5b3a36(0x134)]),console['error']('═'[_0x5b3a36(0x17f)](0x3c)),this[_0x5b3a36(0x118)](_0x4bf471);if(typeof _0x81a70[_0x5b3a36(0x113)]==='string'){this[_0x5b3a36(0x14a)](_0x4bf471),this[_0x5b3a36(0x8c)](_0x4bf471),this[_0x5b3a36(0x11d)](_0x419da4,_0x5bdbfa,_0x5b3a36(0x113),_0x81a70[_0x5b3a36(0x113)]);return;}if(_0x81a70[_0x5b3a36(0x113)]===!![]){this['displayAttributesStats'](_0x4bf471),this['displaySummary'](_0x4bf471),this[_0x5b3a36(0x11d)](_0x419da4,_0x5bdbfa,_0x5b3a36(0xba));return;}if(typeof _0x81a70['behavior']===_0x5b3a36(0x156)){this[_0x5b3a36(0x145)](_0x4bf471,_0x5bdbfa),this[_0x5b3a36(0x8c)](_0x4bf471),this[_0x5b3a36(0x11d)](_0x419da4,_0x5bdbfa,_0x5b3a36(0x165),_0x81a70[_0x5b3a36(0x165)]);return;}if(_0x81a70[_0x5b3a36(0x165)]===!![]){this[_0x5b3a36(0x145)](_0x4bf471,_0x5bdbfa),this['displaySummary'](_0x4bf471),this[_0x5b3a36(0x11d)](_0x419da4,_0x5bdbfa,_0x5b3a36(0x13c));return;}this['displayAttributesStats'](_0x4bf471),this[_0x5b3a36(0x145)](_0x4bf471,_0x5bdbfa),this[_0x5b3a36(0x8c)](_0x4bf471),this['displayPreviewHints'](_0x419da4,_0x5bdbfa,_0x5b3a36(0x90));}[a26_0x26812b(0x11d)](_0x26f9f3,_0x41bf3b,_0x215e8c,_0x56af2c){const _0x5dbe75=a26_0x26812b;console[_0x5dbe75(0x148)]('\x0a'+a26_0x4bc9a1[_0x5dbe75(0xbf)]('To\x20view\x20sample\x20data:'));const _0x50ea3e=_0x41bf3b!==_0x5dbe75(0x115)?_0x5dbe75(0xef)+_0x41bf3b:'';if(_0x215e8c===_0x5dbe75(0x113)&&_0x56af2c)console[_0x5dbe75(0x148)]('\x20\x20'+a26_0x4bc9a1['dim'](_0x5dbe75(0x169)+_0x26f9f3+_0x5dbe75(0x112)+_0x56af2c+'\x22'+_0x50ea3e));else{if(_0x215e8c===_0x5dbe75(0x165)&&_0x56af2c)console[_0x5dbe75(0x148)]('\x20\x20'+a26_0x4bc9a1['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x26f9f3+_0x5dbe75(0xf0)+_0x56af2c+'\x22'+_0x50ea3e));else(_0x215e8c===_0x5dbe75(0xba)||_0x215e8c==='all')&&console[_0x5dbe75(0x148)]('\x20\x20'+a26_0x4bc9a1[_0x5dbe75(0xbf)]('tdx\x20segment\x20parent\x20preview\x20'+_0x26f9f3+_0x5dbe75(0xd1)+_0x50ea3e));}(_0x215e8c===_0x5dbe75(0x13c)||_0x215e8c===_0x5dbe75(0x90))&&console[_0x5dbe75(0x148)]('\x20\x20'+a26_0x4bc9a1[_0x5dbe75(0xbf)](_0x5dbe75(0x169)+_0x26f9f3+_0x5dbe75(0x147)+_0x50ea3e)),_0x215e8c===_0x5dbe75(0x90)&&console['error']('\x20\x20'+a26_0x4bc9a1[_0x5dbe75(0xbf)](_0x5dbe75(0x169)+_0x26f9f3+_0x5dbe75(0x88)+_0x50ea3e));}[a26_0x26812b(0x118)](_0x5be3fa){const _0x2f2a60=a26_0x26812b,{master:_0x513ee2}=_0x5be3fa,_0x32fec1=_0x513ee2[_0x2f2a60(0xc2)]?a26_0x4bc9a1[_0x2f2a60(0x12d)]('✔'):a26_0x4bc9a1[_0x2f2a60(0x150)]('✘');console[_0x2f2a60(0x148)]('\x0a'+a26_0x4bc9a1['dim'](_0x2f2a60(0xcd))),console[_0x2f2a60(0x148)](_0x32fec1+'\x20'+a26_0x4bc9a1[_0x2f2a60(0x99)](_0x513ee2[_0x2f2a60(0xe9)]+'.'+_0x513ee2[_0x2f2a60(0xb6)])),_0x513ee2[_0x2f2a60(0xc2)]?_0x513ee2[_0x2f2a60(0xf1)]!==undefined&&console['error']('\x20\x20'+a26_0x4bc9a1[_0x2f2a60(0xbf)](_0x2f2a60(0xe3))+'\x20'+a26_0x4bc9a1['cyan'](formatRows(_0x513ee2[_0x2f2a60(0xf1)]))):console['error']('\x20\x20'+a26_0x4bc9a1[_0x2f2a60(0x150)]('Error:')+'\x20'+_0x513ee2[_0x2f2a60(0x184)]);}['displayAttributesStats'](_0x57cefb){const _0x36fd69=a26_0x26812b;if(_0x57cefb[_0x36fd69(0xba)]['length']===0x0)return;console['error']('\x0a'+a26_0x4bc9a1[_0x36fd69(0xbf)](_0x36fd69(0x93)));for(const _0x5863cd of _0x57cefb['attributes']){const _0x39f37c=_0x5863cd[_0x36fd69(0xc2)]?a26_0x4bc9a1[_0x36fd69(0x12d)]('✔'):a26_0x4bc9a1[_0x36fd69(0x150)]('✘');let _0x2b339d='';if(_0x5863cd[_0x36fd69(0xc2)]&&_0x5863cd[_0x36fd69(0x138)]!==undefined&&_0x5863cd[_0x36fd69(0x129)]!==undefined){const _0x402cda=_0x5863cd[_0x36fd69(0x129)]['toFixed'](0x1),_0x163b86=_0x5863cd[_0x36fd69(0x129)]>=0x50?a26_0x4bc9a1[_0x36fd69(0x12d)]:_0x5863cd[_0x36fd69(0x129)]>=0x32?a26_0x4bc9a1[_0x36fd69(0xed)]:a26_0x4bc9a1['red'];_0x2b339d='\x20'+a26_0x4bc9a1[_0x36fd69(0xbf)](_0x36fd69(0x10d))+'\x20'+_0x163b86(_0x402cda+'%')+'\x20('+formatRows(_0x5863cd['matchedCount'])+'\x20rows)';}console[_0x36fd69(0x148)](_0x39f37c+'\x20'+a26_0x4bc9a1[_0x36fd69(0x99)](_0x5863cd['name'])+_0x2b339d),console[_0x36fd69(0x148)]('\x20\x20'+a26_0x4bc9a1[_0x36fd69(0xbf)](_0x36fd69(0xbc))+'\x20'+a26_0x4bc9a1[_0x36fd69(0x99)](_0x5863cd[_0x36fd69(0xe9)]+'.'+_0x5863cd['table']));const _0x1003b2=_0x5863cd['joinKey']===_0x5863cd[_0x36fd69(0x185)]?a26_0x4bc9a1[_0x36fd69(0xbf)]('Join\x20on:')+'\x20'+_0x5863cd[_0x36fd69(0x133)]:a26_0x4bc9a1[_0x36fd69(0xbf)](_0x36fd69(0x8f))+'\x20'+_0x5863cd[_0x36fd69(0x133)]+_0x36fd69(0x101)+_0x5863cd[_0x36fd69(0x185)];console['error']('\x20\x20'+_0x1003b2),console[_0x36fd69(0x148)]('\x20\x20'+a26_0x4bc9a1['dim'](_0x36fd69(0xaa))),this[_0x36fd69(0x11e)](_0x5863cd['columns']),!_0x5863cd[_0x36fd69(0xc2)]&&console['error']('\x20\x20'+a26_0x4bc9a1[_0x36fd69(0x150)](_0x36fd69(0x161))+'\x20'+_0x5863cd[_0x36fd69(0x184)]);}}[a26_0x26812b(0x145)](_0x5653c5,_0x58c758){const _0x1c38d5=a26_0x26812b;if(_0x5653c5[_0x1c38d5(0x13c)][_0x1c38d5(0x173)]===0x0)return;console['error']('\x0a'+a26_0x4bc9a1[_0x1c38d5(0xbf)](_0x1c38d5(0xa9))+'\x20'+a26_0x4bc9a1['dim']('('+_0x58c758+')'));for(const _0x1b67f1 of _0x5653c5[_0x1c38d5(0x13c)]){const _0xef7931=_0x1b67f1[_0x1c38d5(0xc2)]?a26_0x4bc9a1[_0x1c38d5(0x12d)]('✔'):a26_0x4bc9a1['red']('✘');let _0x20cadc='';if(_0x1b67f1['schemaValid']&&_0x1b67f1[_0x1c38d5(0x87)]!==undefined&&_0x1b67f1['totalEvents']!==undefined){const _0x485de9=_0x1b67f1['customerPercent']?.['toFixed'](0x1)||'?',_0x1d862e=(_0x1b67f1['customerPercent']??0x0)>=0x32?a26_0x4bc9a1[_0x1c38d5(0x12d)]:(_0x1b67f1[_0x1c38d5(0xd3)]??0x0)>=0x14?a26_0x4bc9a1['yellow']:a26_0x4bc9a1['red'];_0x20cadc='\x20'+a26_0x4bc9a1[_0x1c38d5(0xbf)]('Customers:')+'\x20'+_0x1d862e(formatRows(_0x1b67f1['customersWithEvents']))+'\x20('+_0x485de9+_0x1c38d5(0x9e)+a26_0x4bc9a1[_0x1c38d5(0xbf)](_0x1c38d5(0xf4))+'\x20'+a26_0x4bc9a1[_0x1c38d5(0x9b)](formatRows(_0x1b67f1[_0x1c38d5(0x178)]));}console[_0x1c38d5(0x148)](_0xef7931+'\x20'+a26_0x4bc9a1['bold'](_0x1b67f1[_0x1c38d5(0x134)])+_0x20cadc),console['error']('\x20\x20'+a26_0x4bc9a1[_0x1c38d5(0xbf)](_0x1c38d5(0xbc))+'\x20'+a26_0x4bc9a1[_0x1c38d5(0x99)](_0x1b67f1[_0x1c38d5(0xe9)]+'.'+_0x1b67f1[_0x1c38d5(0xb6)]));const _0xef2d63=_0x1b67f1[_0x1c38d5(0x133)]===_0x1b67f1[_0x1c38d5(0x185)]?a26_0x4bc9a1[_0x1c38d5(0xbf)]('Join\x20on:')+'\x20'+_0x1b67f1[_0x1c38d5(0x133)]:a26_0x4bc9a1[_0x1c38d5(0xbf)](_0x1c38d5(0x8f))+'\x20'+_0x1b67f1[_0x1c38d5(0x133)]+_0x1c38d5(0x101)+_0x1b67f1[_0x1c38d5(0x185)];console[_0x1c38d5(0x148)]('\x20\x20'+_0xef2d63),console[_0x1c38d5(0x148)]('\x20\x20'+a26_0x4bc9a1['dim'](_0x1c38d5(0xaa))),this[_0x1c38d5(0x11e)](_0x1b67f1['columns']),!_0x1b67f1[_0x1c38d5(0xc2)]&&console[_0x1c38d5(0x148)]('\x20\x20'+a26_0x4bc9a1[_0x1c38d5(0x150)]('Error:')+'\x20'+_0x1b67f1[_0x1c38d5(0x184)]);}}['displayColumns'](_0xc029aa){const _0x209c72=a26_0x26812b;for(const _0xfad980 of _0xc029aa){_0xfad980[_0x209c72(0x16e)]===_0xfad980[_0x209c72(0x100)]||_0xfad980[_0x209c72(0x100)]==='*'?console[_0x209c72(0x148)]('\x20\x20\x20\x20-\x20'+_0xfad980[_0x209c72(0x16e)]):console[_0x209c72(0x148)]('\x20\x20\x20\x20-\x20'+_0xfad980[_0x209c72(0x16e)]+'\x20'+a26_0x4bc9a1[_0x209c72(0xbf)]('('+_0xfad980[_0x209c72(0x100)]+')'));}}[a26_0x26812b(0x8c)](_0x282bbe){const _0x46c51e=a26_0x26812b;console[_0x46c51e(0x148)]('─'[_0x46c51e(0x17f)](0x3c));if(_0x282bbe[_0x46c51e(0x13f)]['length']>0x0){console[_0x46c51e(0x148)]('\x0a'+a26_0x4bc9a1[_0x46c51e(0x150)]('Errors:'));for(const _0x642c66 of _0x282bbe[_0x46c51e(0x13f)]){console['error']('\x20\x20'+a26_0x4bc9a1[_0x46c51e(0x150)]('•')+'\x20'+_0x642c66);}}_0x282bbe[_0x46c51e(0xc4)]&&console[_0x46c51e(0x148)]('\x0a'+a26_0x4bc9a1['green']('✔')+_0x46c51e(0x15e));}}export class ParentSegmentPreviewCommand extends BaseCommand{[a26_0x26812b(0x134)]=a26_0x26812b(0x146);['description']=a26_0x26812b(0xe0);async[a26_0x26812b(0xb1)](_0x17f1f0){const _0x3f981c=a26_0x26812b,{options:_0x9bbc7a,args:_0x216757,tdx:_0x2d2ff5}=_0x17f1f0,_0x400107=_0x9bbc7a;if(_0x216757[_0x3f981c(0x173)]===0x0)return console[_0x3f981c(0x148)](a26_0x4bc9a1[_0x3f981c(0x150)](_0x3f981c(0xf5))),console[_0x3f981c(0x148)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x3f981c(0x148)](_0x3f981c(0xda)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x3f981c(0x148)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x3f981c(0x148)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x3f981c(0x148)](_0x3f981c(0xc9)),console[_0x3f981c(0x148)](_0x3f981c(0x8d)),0x1;if(!_0x400107[_0x3f981c(0xa5)]&&!_0x400107['attribute']&&!_0x400107[_0x3f981c(0x165)]&&!_0x400107[_0x3f981c(0x152)])return console[_0x3f981c(0x148)](a26_0x4bc9a1[_0x3f981c(0x150)](_0x3f981c(0x15d))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x3f981c(0x148)]('Options:'),console[_0x3f981c(0x148)](_0x3f981c(0x16f)),console[_0x3f981c(0x148)](_0x3f981c(0x182)),console[_0x3f981c(0x148)](_0x3f981c(0xa0)),console[_0x3f981c(0x148)](_0x3f981c(0xc9)),0x1;const _0x816da1=resolveYamlFile(_0x216757[0x0]);if(!existsSync(_0x816da1))return console[_0x3f981c(0x148)](_0x3f981c(0xa2)+_0x816da1),0x1;_0x400107[_0x3f981c(0x103)]&&(console[_0x3f981c(0x148)](_0x3f981c(0x141)+_0x400107['site']),console[_0x3f981c(0x148)](_0x3f981c(0x15b)+_0x816da1));let _0x5a034a;try{_0x5a034a=readFileSync(_0x816da1,_0x3f981c(0xcb));}catch(_0x319abb){const _0x292c7f=_0x319abb instanceof Error?_0x319abb[_0x3f981c(0xae)]:String(_0x319abb);return console[_0x3f981c(0x148)](_0x3f981c(0x175)+_0x292c7f),0x1;}let _0x32e051;try{_0x32e051=parseYamlString(_0x5a034a);}catch(_0xb27552){const _0x95c33d=_0xb27552 instanceof Error?_0xb27552[_0x3f981c(0xae)]:String(_0xb27552);return console[_0x3f981c(0x148)](a26_0x4bc9a1[_0x3f981c(0x150)](_0x3f981c(0x14b)+_0x95c33d)),0x1;}if(_0x400107[_0x3f981c(0x113)]===!![]||_0x400107[_0x3f981c(0x113)]===''){const _0x303a07=_0x32e051[_0x3f981c(0xba)]?.[_0x3f981c(0x13d)](_0x4721ce=>_0x4721ce[_0x3f981c(0x134)])||[];if(_0x303a07[_0x3f981c(0x173)]===0x0)console[_0x3f981c(0x148)](a26_0x4bc9a1[_0x3f981c(0x150)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console['error'](a26_0x4bc9a1[_0x3f981c(0x150)](_0x3f981c(0xa1))),console['error']('Available\x20attributes:');for(const _0x493e70 of _0x303a07){console[_0x3f981c(0x148)]('\x20\x20'+a26_0x4bc9a1[_0x3f981c(0x9b)](_0x493e70));}console['error'](_0x3f981c(0x8b)+_0x216757[0x0]+_0x3f981c(0x112)+_0x303a07[0x0]+'\x22');}return 0x1;}if(_0x400107[_0x3f981c(0x165)]===!![]||_0x400107['behavior']===''){const _0x211b88=_0x32e051[_0x3f981c(0x13c)]?.[_0x3f981c(0x13d)](_0x1126fb=>_0x1126fb[_0x3f981c(0x134)])||[];if(_0x211b88[_0x3f981c(0x173)]===0x0)console[_0x3f981c(0x148)](a26_0x4bc9a1[_0x3f981c(0x150)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x3f981c(0x148)](a26_0x4bc9a1[_0x3f981c(0x150)](_0x3f981c(0xa8))),console[_0x3f981c(0x148)](_0x3f981c(0xe4));for(const _0xee5203 of _0x211b88){console['error']('\x20\x20'+a26_0x4bc9a1[_0x3f981c(0x9b)](_0xee5203));}console['error'](_0x3f981c(0x8b)+_0x216757[0x0]+_0x3f981c(0xf0)+_0x211b88[0x0]+'\x22');}return 0x1;}const _0xe41683=createCommandSpinner(a26_0x4bc9a1[_0x3f981c(0xbf)](_0x3f981c(0xb7)),{'verbose':_0x400107[_0x3f981c(0x103)]});_0xe41683[_0x3f981c(0x127)]();const _0x443fba={'onProgress':_0x35096b=>{_0xe41683['text']=formatProgressMessage(_0x35096b);}};if(_0x400107[_0x3f981c(0xa5)])_0x443fba['master']=!![];if(_0x400107[_0x3f981c(0x113)]&&typeof _0x400107[_0x3f981c(0x113)]===_0x3f981c(0x156))_0x443fba[_0x3f981c(0x113)]=_0x400107[_0x3f981c(0x113)];if(_0x400107[_0x3f981c(0x165)]&&typeof _0x400107[_0x3f981c(0x165)]===_0x3f981c(0x156))_0x443fba[_0x3f981c(0x165)]=_0x400107[_0x3f981c(0x165)];if(_0x400107[_0x3f981c(0x152)])_0x443fba['enriched']=!![];if(_0x400107[_0x3f981c(0x12a)])_0x443fba[_0x3f981c(0x12a)]=_0x400107['interval'];let _0x2b1184;try{_0x2b1184=await _0x2d2ff5['segment'][_0x3f981c(0x170)](_0x5a034a,_0x443fba),_0xe41683[_0x3f981c(0x189)]();}catch(_0x20f237){_0xe41683[_0x3f981c(0x189)]();throw _0x20f237;}return await this[_0x3f981c(0x14e)](_0x2b1184,{'master':_0x400107[_0x3f981c(0xa5)],'attribute':typeof _0x400107[_0x3f981c(0x113)]===_0x3f981c(0x156)?_0x400107[_0x3f981c(0x113)]:undefined,'behavior':typeof _0x400107[_0x3f981c(0x165)]===_0x3f981c(0x156)?_0x400107[_0x3f981c(0x165)]:undefined,'enriched':_0x400107[_0x3f981c(0x152)]}),_0x2b1184[_0x3f981c(0xc4)]?0x0:0x1;}async['displayPreviewResults'](_0x5ab5c0,_0x5e382a){const _0x9fd550=a26_0x26812b;console[_0x9fd550(0x148)]('\x0a'+a26_0x4bc9a1[_0x9fd550(0x99)](_0x9fd550(0x8a))+'\x20'+_0x5ab5c0['name']),console[_0x9fd550(0x148)]('═'[_0x9fd550(0x17f)](0x3c));if(_0x5e382a[_0x9fd550(0xa5)]&&_0x5ab5c0[_0x9fd550(0x9d)]){const _0x118a41=a26_0x4bc9a1['dim'](_0x9fd550(0x128))+'\x20'+a26_0x4bc9a1[_0x9fd550(0x99)](_0x5ab5c0['master'][_0x9fd550(0xe9)]+'.'+_0x5ab5c0[_0x9fd550(0xa5)][_0x9fd550(0xb6)]);await this[_0x9fd550(0xeb)](_0x118a41,_0x5ab5c0[_0x9fd550(0x9d)]);}else{if(_0x5e382a[_0x9fd550(0x113)]&&_0x5ab5c0['sampleData']){const _0x23ac12=a26_0x4bc9a1[_0x9fd550(0xbf)](_0x9fd550(0x188))+'\x20'+a26_0x4bc9a1[_0x9fd550(0x99)](_0x5e382a[_0x9fd550(0x113)]);await this['displaySampleData'](_0x23ac12,_0x5ab5c0[_0x9fd550(0x9d)]);}else{if(_0x5e382a[_0x9fd550(0x165)]&&_0x5ab5c0['sampleData']){const _0x46e292=a26_0x4bc9a1[_0x9fd550(0xbf)](_0x9fd550(0x180))+'\x20'+a26_0x4bc9a1[_0x9fd550(0x99)](_0x5e382a[_0x9fd550(0x165)]);await this[_0x9fd550(0xeb)](_0x46e292,_0x5ab5c0[_0x9fd550(0x9d)]);}else{if(_0x5e382a[_0x9fd550(0x152)]&&_0x5ab5c0[_0x9fd550(0x9d)]){const _0x19fbd6=a26_0x4bc9a1['dim']('Enriched:')+'\x20'+a26_0x4bc9a1[_0x9fd550(0x99)](_0x9fd550(0x167));await this[_0x9fd550(0xeb)](_0x19fbd6,_0x5ab5c0['sampleData']);}else!_0x5ab5c0[_0x9fd550(0x9d)]&&console['error'](_0x9fd550(0xe7));}}}if(_0x5ab5c0[_0x9fd550(0x13f)]['length']>0x0){console[_0x9fd550(0x148)]('─'[_0x9fd550(0x17f)](0x3c)),console[_0x9fd550(0x148)]('\x0a'+a26_0x4bc9a1[_0x9fd550(0x150)](_0x9fd550(0xd9)));for(const _0x5ad772 of _0x5ab5c0[_0x9fd550(0x13f)]){console['error']('\x20\x20'+a26_0x4bc9a1[_0x9fd550(0x150)]('•')+'\x20'+_0x5ad772);}}}async[a26_0x26812b(0xeb)](_0x3f0ba1,_0x194d1f){const _0x53ec36=a26_0x26812b;if(_0x194d1f['length']===0x0){console['error']('\x0a'+_0x3f0ba1),console['error'](_0x53ec36(0x10b));return;}console[_0x53ec36(0x148)]('\x0a'+_0x3f0ba1);const _0xbad79c=Object[_0x53ec36(0x15a)](_0x194d1f[0x0])['map'](_0x32d454=>({'name':_0x32d454,'type':typeof _0x194d1f[0x0][_0x32d454]===_0x53ec36(0xee)?_0x53ec36(0x111):_0x53ec36(0x110)})),_0x213c0b={'queryId':_0x53ec36(0x10e),'columns':_0xbad79c,'data':_0x194d1f,'stats':{'state':_0x53ec36(0x139),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x194d1f[_0x53ec36(0x173)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0xa1542c=formatAsTable(_0x213c0b,_0x194d1f[_0x53ec36(0x173)],!![]);await writeOutput(_0xa1542c,undefined,_0x53ec36(0xb6));}}export class ParentSegmentRunCommand extends BaseCommand{[a26_0x26812b(0x134)]=a26_0x26812b(0xc0);['description']=a26_0x26812b(0x151);async[a26_0x26812b(0xb1)](_0x1e2adb){const _0x35d843=a26_0x26812b,{options:_0x2a3777,args:_0x2274b4,tdx:_0x45355b}=_0x1e2adb,_0x396df9=_0x2a3777;if(_0x2274b4['length']===0x0)return console[_0x35d843(0x148)](a26_0x4bc9a1[_0x35d843(0x150)](_0x35d843(0xf5))),console[_0x35d843(0x148)]('Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a'),console[_0x35d843(0x148)](a26_0x4bc9a1[_0x35d843(0x9b)](_0x35d843(0x17a))),0x1;const _0x32dfec=_0x2274b4[0x0],_0x3f2ed1=resolveYamlFile(_0x32dfec);if(existsSync(_0x3f2ed1)){_0x396df9[_0x35d843(0x103)]&&console[_0x35d843(0x148)](_0x35d843(0xa3)+_0x3f2ed1);let _0x88f348;try{_0x88f348=readFileSync(_0x3f2ed1,'utf-8');}catch(_0x29fd9c){const _0x32a86b=_0x29fd9c instanceof Error?_0x29fd9c[_0x35d843(0xae)]:String(_0x29fd9c);return console[_0x35d843(0x148)]('Error\x20reading\x20file:\x20'+_0x32a86b),0x1;}const _0x582c53=await withSpinner(_0x35d843(0x9f),()=>_0x45355b[_0x35d843(0x181)][_0x35d843(0x16d)](_0x88f348),{'verbose':_0x396df9['verbose']}),_0x2467fb=_0x582c53[_0x35d843(0x177)],{isNew:_0x55bcbf,name:_0x2ae750,hasChanges:_0x2384d3,diffFormatted:_0x4c056f}=_0x2467fb;if(_0x2384d3){_0x55bcbf?console[_0x35d843(0x148)](_0x35d843(0xd0)+_0x2ae750+'\x27:'):console[_0x35d843(0x148)](_0x35d843(0xea)+_0x2ae750+'\x27:');console['error']('─'[_0x35d843(0x17f)](0x3c)),console[_0x35d843(0x148)](_0x4c056f),console[_0x35d843(0x148)]('─'[_0x35d843(0x17f)](0x3c));const _0x1659e2=_0x55bcbf?_0x35d843(0xf3)+_0x2ae750+_0x35d843(0xcf):_0x35d843(0x95)+_0x2ae750+_0x35d843(0xcf);if(!_0x396df9[_0x35d843(0x15c)]){const _0x161e0b=await confirmKey(_0x1659e2);if(!_0x161e0b)return console[_0x35d843(0x148)](_0x35d843(0xaf)),0x1;}const _0xae43e7=_0x55bcbf?_0x35d843(0xab):_0x35d843(0x160);await withSpinner(_0xae43e7+_0x35d843(0x114)+_0x2ae750+'\x27...',()=>_0x2467fb[_0x35d843(0x144)](),{'verbose':_0x396df9[_0x35d843(0x103)]});const _0x1994eb=_0x55bcbf?_0x35d843(0xf8):_0x35d843(0xdf);console[_0x35d843(0x148)]('✔\x20'+_0x1994eb+_0x35d843(0x114)+_0x2ae750+'\x27');}else console[_0x35d843(0x148)](_0x35d843(0x154)+_0x2ae750+_0x35d843(0x125));}const _0x4817d5=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x32dfec+'\x27...',()=>_0x45355b['segment'][_0x35d843(0xd7)](_0x32dfec),{'verbose':_0x396df9[_0x35d843(0x103)]}),_0x228607=_0x4817d5['data'],_0x57887a=getConsoleUrl(_0x396df9[_0x35d843(0x15f)],_0x35d843(0x11f)+_0x228607[_0x35d843(0x106)]+_0x35d843(0x155)+_0x228607[_0x35d843(0x14c)]+'/attempt/'+_0x228607['workflowAttemptId']);return console[_0x35d843(0x148)]('\x0a✔\x20Workflow\x20started'),console[_0x35d843(0x148)]('\x20\x20'+a26_0x4bc9a1['dim'](_0x35d843(0x13b))+'\x20'+_0x228607[_0x35d843(0x9c)]),console[_0x35d843(0x148)]('\x20\x20'+a26_0x4bc9a1['dim'](_0x35d843(0x8e))+'\x20'+_0x228607[_0x35d843(0x157)]),console[_0x35d843(0x148)]('\x20\x20'+a26_0x4bc9a1[_0x35d843(0xbf)](_0x35d843(0x12f))+'\x20'+_0x228607[_0x35d843(0x14c)]),console[_0x35d843(0x148)]('\x20\x20'+a26_0x4bc9a1[_0x35d843(0xbf)](_0x35d843(0x14d))+'\x20'+_0x228607[_0x35d843(0x183)]),console[_0x35d843(0x148)]('\x20\x20'+_0x57887a),console[_0x35d843(0x148)]('\x0a'+a26_0x4bc9a1[_0x35d843(0xbf)](_0x35d843(0xfd))+'\x20tdx\x20wf\x20attempt\x20'+_0x228607[_0x35d843(0x183)]+_0x35d843(0x140)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a26_0x26812b(0x134)]=a26_0x26812b(0xde);[a26_0x26812b(0x131)]=a26_0x26812b(0x16a);async[a26_0x26812b(0xb1)](_0x15f4be){const _0x5e2e33=a26_0x26812b,{options:_0x42973c,args:_0x536841,tdx:_0x51b66a}=_0x15f4be,_0x531be4=_0x536841[0x0]||_0x42973c['parentSegment'];if(!_0x531be4)return console['error'](a26_0x4bc9a1[_0x5e2e33(0x150)](_0x5e2e33(0xf5))),console['error'](_0x5e2e33(0xfc)),console['error'](a26_0x4bc9a1[_0x5e2e33(0x9b)](_0x5e2e33(0x11b))),0x1;_0x42973c[_0x5e2e33(0x103)]&&(console[_0x5e2e33(0x148)](_0x5e2e33(0x141)+_0x42973c[_0x5e2e33(0x15f)]),console[_0x5e2e33(0x148)]('Parent\x20segment:\x20'+_0x531be4));const _0x1967ef=await withSpinner(_0x5e2e33(0xce)+_0x531be4+_0x5e2e33(0xff),()=>_0x51b66a[_0x5e2e33(0x181)]['listFields'](_0x531be4),{'verbose':_0x42973c[_0x5e2e33(0x103)]}),_0x1dbd25=_0x1967ef[_0x5e2e33(0x177)];console[_0x5e2e33(0x148)](_0x5e2e33(0x109)+_0x1dbd25[_0x5e2e33(0x173)]+_0x5e2e33(0x17e)+(_0x1dbd25[_0x5e2e33(0x173)]!==0x1?'s':''));if(_0x42973c[_0x5e2e33(0x11a)]||_0x42973c['jsonl'])return await handleSDKOutput(_0x1dbd25,_0x42973c),0x0;return displayFieldsHumanReadable(_0x1dbd25,_0x531be4),0x0;}}export class ParentSegmentInfoCommand extends BaseCommand{['name']=a26_0x26812b(0xd8);[a26_0x26812b(0x131)]=a26_0x26812b(0x116);async[a26_0x26812b(0xb1)](_0x162621){const _0x3b134e=a26_0x26812b,{options:_0x32b3a9,args:_0x1ddc79,tdx:_0x2a2736}=_0x162621,_0x431b01=_0x1ddc79[0x0]||_0x32b3a9['parentSegment'];if(!_0x431b01)return console[_0x3b134e(0x148)](a26_0x4bc9a1[_0x3b134e(0x150)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x3b134e(0x148)]('Usage:\x20tdx\x20ps\x20info\x20[name]\x0a'),console[_0x3b134e(0x148)](a26_0x4bc9a1[_0x3b134e(0x9b)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x32b3a9[_0x3b134e(0x103)]&&(console[_0x3b134e(0x148)]('Site:\x20'+_0x32b3a9[_0x3b134e(0x15f)]),console[_0x3b134e(0x148)](_0x3b134e(0x153)+_0x431b01));const _0x42e446=await withSpinner(_0x3b134e(0x168)+_0x431b01+_0x3b134e(0xff),()=>_0x2a2736[_0x3b134e(0x181)][_0x3b134e(0x98)](_0x431b01),{'verbose':_0x32b3a9[_0x3b134e(0x103)]});return await handleSingleObjectOutput(_0x42e446[_0x3b134e(0x177)],_0x32b3a9),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a26_0x26812b(0x134)]=a26_0x26812b(0x187);['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a26_0x26812b(0xb1)](_0x4f72f3){const _0x13d549=a26_0x26812b,{options:_0x56ff11,args:_0x34d203,tdx:_0xd87df2}=_0x4f72f3,_0x5bcad2=_0x34d203[0x0]||_0x56ff11[_0x13d549(0xc3)];if(!_0x5bcad2)return console[_0x13d549(0x148)](a26_0x4bc9a1[_0x13d549(0x150)](_0x13d549(0xf5))),console[_0x13d549(0x148)]('Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a'),console[_0x13d549(0x148)](a26_0x4bc9a1[_0x13d549(0x9b)](_0x13d549(0x11b))),0x1;_0x56ff11[_0x13d549(0x103)]&&(console[_0x13d549(0x148)](_0x13d549(0x141)+_0x56ff11[_0x13d549(0x15f)]),console['error']('Parent\x20segment:\x20'+_0x5bcad2));const _0x5bff3c=await withSpinner(_0x13d549(0x123)+_0x5bcad2+'\x27...',()=>_0xd87df2[_0x13d549(0x181)]['resolveParentId'](_0x5bcad2),{'verbose':_0x56ff11['verbose']}),_0x5915e7=_0x5bff3c['data'],_0xbd7815=await withSpinner(_0x13d549(0xb5)+_0x5bcad2+'\x27...',()=>_0xd87df2[_0x13d549(0x181)][_0x13d549(0xe2)](_0x5915e7),{'verbose':_0x56ff11[_0x13d549(0x103)]}),_0x551827=await executeSchemaQuery(_0xbd7815['data'],_0xd87df2,_0x56ff11);return await handleQueryOutput(_0x551827,_0x56ff11),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a26_0x26812b(0x134)]=a26_0x26812b(0xca);[a26_0x26812b(0x131)]=a26_0x26812b(0xdb);async[a26_0x26812b(0xb1)](_0x19921a){const _0x2bb547=a26_0x26812b,{options:_0x54d1cf,args:_0x55eb60,tdx:_0x2e6b74}=_0x19921a,_0x5e51a2=_0x55eb60[0x0]||_0x54d1cf[_0x2bb547(0xc3)];if(!_0x5e51a2)return console[_0x2bb547(0x148)](a26_0x4bc9a1['red'](_0x2bb547(0xf5))),console[_0x2bb547(0x148)](_0x2bb547(0x10a)),console[_0x2bb547(0x148)](a26_0x4bc9a1[_0x2bb547(0x9b)](_0x2bb547(0x11b))),0x1;_0x54d1cf[_0x2bb547(0x103)]&&(console[_0x2bb547(0x148)](_0x2bb547(0x141)+_0x54d1cf['site']),console[_0x2bb547(0x148)](_0x2bb547(0x153)+_0x5e51a2));const _0x158dc5=await withSpinner(_0x2bb547(0x123)+_0x5e51a2+'\x27...',()=>_0x2e6b74[_0x2bb547(0x181)][_0x2bb547(0xc1)](_0x5e51a2),{'verbose':_0x54d1cf['verbose']}),_0x32fbda=_0x158dc5[_0x2bb547(0x177)],_0x366219=await withSpinner(_0x2bb547(0xb5)+_0x5e51a2+_0x2bb547(0xff),()=>_0x2e6b74['segment'][_0x2bb547(0xe2)](_0x32fbda),{'verbose':_0x54d1cf[_0x2bb547(0x103)]}),_0x3149d2=_0x366219['data'];return _0x54d1cf[_0x2bb547(0x164)]===_0x2bb547(0x11a)||_0x54d1cf['format']===_0x2bb547(0x121)?await handleSDKOutput([{'sql':_0x3149d2}],_0x54d1cf):console[_0x2bb547(0x97)](_0x3149d2),0x0;}}function a26_0x4e65(){const _0x52a2d0=['Output\x20file:\x20','yellow','number','\x20--interval\x20','\x20--behavior\x20\x22','rowCount','1207340bULNQR','Create\x20parent\x20segment\x20\x27','Events:','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','6nEUfaF','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','Created','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','scheduleOption','parent_segment','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','To\x20cancel:','createParent','\x27...','column','\x20=\x20','match','verbose','60741UiyJRk','1539870vWveHT','workflowId','✔\x20Saved\x20parent\x20segment\x20configuration\x20to\x20\x27','endsWith','✔\x20Found\x20','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','\x20\x20No\x20sample\x20data\x20available','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Coverage:','preview','segment:parent:show','varchar','double','\x20--attribute\x20\x22','attribute','\x20parent\x20segment\x20\x27','-1d','Show\x20parent\x20segment\x20details','240545xHcQuV','displayMasterInfo','updateParent','json','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','Error:\x20Parent\x20segment\x20name\x20is\x20required','displayPreviewHints','displayColumns','/app/workflows/','addAttributesFile','jsonl','✔\x20Context\x20set:\x20parent_segment\x20=\x20','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x27\x20is\x20up\x20to\x20date','attributesFile','start','Master:','coveragePercent','interval','\x27\x20with\x20ID:\x20','segment:parent:pull','green','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','Session:','query','description','✔\x20Created\x20parent\x20segment\x20\x27','joinKey','name','listParents','\x27\x20is\x20already\x20up\x20to\x20date','jobId','matchedCount','FINISHED','output','Audience\x20ID:','behaviors','map','2651383eoDLZF','errors','\x20kill','Site:\x20','segment:parent:validate','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','apply','displayBehaviorsStats','segment:parent:preview','\x20--behavior\x20\x22<name>\x22','error','filter','displayAttributesStats','Error\x20parsing\x20YAML:\x20','workflowSessionId','Attempt:','displayPreviewResults','trim','red','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','enriched','Parent\x20segment:\x20','✔\x20No\x20changes\x20-\x20\x27','/sessions/','string','status','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','keys','YAML\x20file:\x20','yes','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x20Configuration\x20is\x20valid','site','Updating','Error:','scheduleType','👥\x20','format','behavior','41008hfyybd','Master\x20+\x20Attributes','Fetching\x20parent\x20segment\x20\x27','tdx\x20segment\x20parent\x20preview\x20','List\x20available\x20fields\x20for\x20segmentation','timezone','displayValidateResults','pushParentYaml','label','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','previewParentYaml','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Table:\x20','length','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Error\x20reading\x20file:\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','data','totalEvents','Options:','Tip:\x20Use\x20`tdx\x20ps\x20list`\x20to\x20list\x20available\x20parent\x20segments','Usage:\x20tdx\x20ps\x20show\x20[name]\x0a','Overwrite\x20\x27','\x20rows\x20','\x20field','repeat','Behavior:','segment','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','workflowAttemptId','schemaError','foreignKey','No\x20parent\x20segments\x20match\x20pattern:\x20','segment:parent:desc','Attribute:','stop','customersWithEvents','\x20--enriched','\x5c$&','Preview:','\x0aUsage:\x20tdx\x20ps\x20preview\x20','displaySummary','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Status:','Join:','all','processedRows','Updating\x20parent\x20segment\x20\x27','Attributes','3353790ppWnmN','Apply\x20changes\x20to\x20\x27','752EMxoBu','log','getParentFull','bold','✔\x20Updated\x20parent\x20segment\x20\x27','cyan','audienceId','sampleData','%)\x20','Analyzing\x20changes...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Error:\x20File\x20not\x20found:\x20','Found\x20YAML\x20file:\x20','addBehaviors','master','use','limit','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Behaviors','Columns:','Creating','.yml','in\x20','message','Aborted.','join','execute','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','pullParentYaml','text','Fetching\x20SQL\x20for\x20\x27','table','Fetching\x20sample\x20data...','toLocaleString','customerGroupFile','attributes','customerGroup','Source:','Listing\x20parent\x20segments...','stats','dim','segment:parent:run','resolveParentId','schemaValid','parentSegment','allValid','population','Executing\x20parent\x20segment\x20query...','Pattern:\x20','segment:parent:push','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','segment:parent:sql','utf-8','segment:parent:create','Master\x20Table','Listing\x20fields\x20for\x20\x27','\x27\x20and\x20run\x20workflow?','\x0aNew\x20parent\x20segment\x20\x27','\x20--attribute\x20\x22<name>\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','customerPercent','replace','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)','segment:parent:list','runParent','segment:parent:info','Errors:','Options\x20(one\x20required):','Get\x20SQL\x20query\x20for\x20parent\x20segment','Name:\x20','SELECT\x20*\x20FROM\x20(\x0a','segment:parent:fields','Updated','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Listing\x20parent\x20segments\x20matching\x20\x27','getParentSQL','Rows:','Available\x20behaviors:','behaviorsFile','addBehaviorsFile','\x0aNo\x20sample\x20data\x20available','4jfxjcL','database','\x0aChanges\x20to\x20apply\x20to\x20\x27','displaySampleData'];a26_0x4e65=function(){return _0x52a2d0;};return a26_0x4e65();}export class ParentSegmentShowCommand extends BaseCommand{['name']=a26_0x26812b(0x10f);['description']=a26_0x26812b(0xb2);async[a26_0x26812b(0xb1)](_0x1027df){const _0x3bcd21=a26_0x26812b,{options:_0x327909,args:_0x765738,tdx:_0xa49d33}=_0x1027df,_0x459f47=_0x765738[0x0]||_0x327909['parentSegment'];if(!_0x459f47)return console[_0x3bcd21(0x148)](a26_0x4bc9a1[_0x3bcd21(0x150)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console['error'](_0x3bcd21(0x17b)),console[_0x3bcd21(0x148)](a26_0x4bc9a1[_0x3bcd21(0x9b)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x327909['verbose']&&(console[_0x3bcd21(0x148)]('Site:\x20'+_0x327909[_0x3bcd21(0x15f)]),console['error'](_0x3bcd21(0x153)+_0x459f47));const _0x50f5c5=await withSpinner(_0x3bcd21(0x123)+_0x459f47+_0x3bcd21(0xff),()=>_0xa49d33['segment'][_0x3bcd21(0xc1)](_0x459f47),{'verbose':_0x327909[_0x3bcd21(0x103)]}),_0x303d1b=_0x50f5c5[_0x3bcd21(0x177)],_0x32d5c3=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x459f47+'\x27...',()=>_0xa49d33[_0x3bcd21(0x181)]['getParentSQL'](_0x303d1b),{'verbose':_0x327909[_0x3bcd21(0x103)]});let _0x4fcb58=_0x32d5c3[_0x3bcd21(0x177)];const _0x446386=resolveLimit(_0x327909[_0x3bcd21(0xa7)],DEFAULT_DISPLAY_LIMIT),_0x1a0864=/\bLIMIT\s+\d+/i['test'](_0x4fcb58);!_0x1a0864&&(_0x4fcb58=_0x4fcb58[_0x3bcd21(0x14f)]()[_0x3bcd21(0xd4)](/;+$/,''),_0x4fcb58=_0x3bcd21(0xdd)+_0x4fcb58+_0x3bcd21(0xd2)+_0x446386);_0x327909['verbose']&&console[_0x3bcd21(0x148)]('SQL\x20query:\x0a'+_0x4fcb58);const _0x372510=await withQuerySpinner(_0x3bcd21(0xc6),async _0x168704=>{const _0x1d669e=_0x3bcd21,_0x13826b=await _0xa49d33[_0x1d669e(0x130)][_0x1d669e(0xb1)](_0x4fcb58,{'catalog':'td','schema':'information_schema','onJobId':_0x2a98ce=>{_0x168704['setJobId'](_0x2a98ce);}});return _0x13826b;},{'verbose':_0x327909['verbose']}),_0x59743d=_0x372510[_0x3bcd21(0x177)],_0x1b9da3=_0x59743d[_0x3bcd21(0x137)]?'\x20[Job\x20ID:\x20'+_0x59743d['jobId']+']':'';return console[_0x3bcd21(0x148)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x59743d[_0x3bcd21(0xbe)][_0x3bcd21(0x91)][_0x3bcd21(0xb8)]()+_0x3bcd21(0x17d)+(_0x3bcd21(0xad)+formatElapsed(_0x59743d[_0x3bcd21(0xbe)]['elapsedTimeMillis'])+_0x1b9da3)),await handleQueryOutput(_0x59743d,_0x327909),0x0;}}
|
|
1
|
+
const a26_0x80c5cf=a26_0x2b05;(function(_0x3f15fc,_0x6ade1){const _0x2257b0=a26_0x2b05,_0x509d8d=_0x3f15fc();while(!![]){try{const _0x2bc68d=-parseInt(_0x2257b0(0x1a0))/0x1+parseInt(_0x2257b0(0x1da))/0x2+-parseInt(_0x2257b0(0x1a7))/0x3+-parseInt(_0x2257b0(0x18b))/0x4*(-parseInt(_0x2257b0(0x15d))/0x5)+-parseInt(_0x2257b0(0x198))/0x6+-parseInt(_0x2257b0(0x181))/0x7*(parseInt(_0x2257b0(0x196))/0x8)+-parseInt(_0x2257b0(0x1fc))/0x9*(-parseInt(_0x2257b0(0x14b))/0xa);if(_0x2bc68d===_0x6ade1)break;else _0x509d8d['push'](_0x509d8d['shift']());}catch(_0xd0d5e9){_0x509d8d['push'](_0x509d8d['shift']());}}}(a26_0x5280,0x31363));import{writeFileSync,readFileSync,existsSync,mkdirSync}from'fs';import a26_0x1725d3 from'path';function a26_0x5280(){const _0x1996c5=['table','scheduleOption','segment:parent:desc','%)\x20','5wwBhju','Aborted.','information_schema','✔\x20No\x20changes\x20-\x20\x27','✔\x20Found\x20','Error:\x20File\x20not\x20found:\x20','Session:','Validate:','segment:parent:pull','sort','displayPreviewHints','resolveParentId','limit','Errors:','listFields','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','segment:parent:run','processedRows','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','displayPreviewResults','\x20parent\x20segment\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Database:\x20','displayColumns','workflowId','Creating\x20parent\x20segment\x20\x27','displayBehaviorsStats','Overwrite\x20\x27','replace','audienceId','Pattern:\x20','Create\x20parent\x20segment\x20\x27','displayAttributesStats','utf-8','28924rkuwdk','✔\x20Created\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','behavior','query','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','yellow','segment:parent:create','192068sIFjGY','Audience\x20ID:','updateParent','✔\x20Updated\x20parent\x20segment\x20\x27','master','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Name:\x20','pullParentYaml','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','site','536uevggm','sampleData','1922148hGGhzV','Show\x20parent\x20segment\x20details','endsWith','joinKey','\x20[Job\x20ID:\x20','listParents','✔\x20Context\x20set:\x20parent_segment\x20=\x20','Events:','155275MipsSk','bold','Attribute:','all','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Executing\x20parent\x20segment\x20query...','tdx\x20segment\x20parent\x20preview\x20','512118JKeyds','interval','\x0aChanges\x20to\x20\x27','SELECT\x20*\x20FROM\x20(\x0a','errors','column','start','validateParentYaml','trim','data','segment:parent:preview','createParent','rowCount','use','Available\x20behaviors:','Attempt:','error','Updating','text','\x27\x20is\x20already\x20up\x20to\x20date','\x20--behavior\x20\x22','attribute','-1d','dim','parent_segment','Output\x20file:\x20','filter','\x20=\x20','coveragePercent','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Fetching\x20SQL\x20for\x20\x27','totalEvents','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','customerPercent','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Site:\x20','👥\x20','Resolving\x20parent\x20segment\x20\x27','string','description','dirname','List\x20parent\x20segments','behaviorsFile','segment','attributes','red','workflowSessionId','Error\x20reading\x20file:\x20','addAttributes','output','keys','600854UuguDQ','enriched','localeCompare','/sessions/','Options:','\x0aNo\x20sample\x20data\x20available','stats','Fetching\x20parent\x20segment\x20\x27','Source:','allValid','columns','cyan','Apply\x20changes\x20to\x20\x27','\x0aNew\x20parent\x20segment\x20\x27','varchar','jobId','\x20\x20No\x20sample\x20data\x20available','Error:\x20--database\x20and\x20--table\x20are\x20required','Master\x20Table','green','Behaviors','verbose','label','runParent','Master\x20+\x20Attributes','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','✔\x20Saved\x20parent\x20segment\x20configuration\x20to\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Error:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Creating','Preview:','Enriched:','27sjDdbc','getParentSQL','log','Validating\x20configuration...','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','\x20tdx\x20wf\x20attempt\x20','\x20field','session','parentSegment','Coverage:','Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a','customerGroup','json','Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a','\x27\x20with\x20ID:\x20','segment:parent:list','Parent\x20segment:\x20','timezone','toFixed','scheduleType','.yaml','pushParentYaml','Fetching\x20sample\x20data...','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Attributes','number','jsonl','segment:parent:sql','\x0aChanges\x20to\x20apply\x20to\x20\x27','database','\x0a✔\x20Workflow\x20started','join','foreignKey','behaviors','workflowAttemptId','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','To\x20view\x20sample\x20data:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20--interval\x20','matchedCount','\x20\x20\x20\x20-\x20','displaySummary','No\x20parent\x20segments\x20found','message','yes','Rows:','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Created','Found\x20YAML\x20file:\x20','Status:','Error:\x20Parent\x20segment\x20name\x20is\x20required','YAML\x20file:\x20','\x20rows\x20','FINISHED','.yml','elapsedTimeMillis','length','name','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','getParentFull','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','schemaValid','Updating\x20parent\x20segment\x20\x27','To\x20cancel:','Join\x20on:','\x20Configuration\x20is\x20valid','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','Error\x20parsing\x20YAML:\x20','Behavior:','Listing\x20parent\x20segments\x20matching\x20\x27','population','stop','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Fetching\x20current\x20configuration\x20for\x20\x27','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','✔\x20Query\x20completed:\x20Processed\x20','\x27...','SQL\x20query:\x0a','schemaError','double','segment:parent:update','/app/workflows/','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','test','displaySampleData','map','Updated','2587700pmHcGS','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','List\x20available\x20fields\x20for\x20segmentation','\x27\x20and\x20run\x20workflow?','Analyzing\x20changes...','displayMasterInfo','segment:parent:show','repeat','format','displayValidateResults','\x20--behavior\x20\x22<name>\x22','apply','execute','Columns:'];a26_0x5280=function(){return _0x1996c5;};return a26_0x5280();}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}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_0x38bf93 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';function a26_0x2b05(_0x1790a9,_0x7918c1){const _0x52805e=a26_0x5280();return a26_0x2b05=function(_0x2b056d,_0x2a197c){_0x2b056d=_0x2b056d-0x12b;let _0x149315=_0x52805e[_0x2b056d];return _0x149315;},a26_0x2b05(_0x1790a9,_0x7918c1);}import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a26_0x80c5cf(0x1bf);function resolveYamlFile(_0x54519b){const _0x1eb2bf=a26_0x80c5cf;if(_0x54519b[_0x1eb2bf(0x19a)](_0x1eb2bf(0x232))||_0x54519b[_0x1eb2bf(0x19a)](_0x1eb2bf(0x210)))return _0x54519b;return a26_0x1725d3['join'](PARENT_SEGMENT_DIR,_0x54519b+_0x1eb2bf(0x232));}function formatProgressMessage(_0x17ec90){const _0x2f345a=a26_0x80c5cf,_0x352a4d=_0x17ec90['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x352a4d){const [,_0x56dde9,_0x452509,_0x29f60f='']=_0x352a4d;return a26_0x38bf93['dim'](_0x56dde9+':')+'\x20'+_0x452509+a26_0x38bf93[_0x2f345a(0x1be)](_0x29f60f);}return a26_0x38bf93[_0x2f345a(0x1be)](_0x17ec90);}export class ParentSegmentListCommand extends BaseCommand{['name']=a26_0x80c5cf(0x20b);[a26_0x80c5cf(0x1ce)]=a26_0x80c5cf(0x1d0);async[a26_0x80c5cf(0x157)](_0x170fa7){const _0x2ff119=a26_0x80c5cf,{options:_0x27f42f,args:_0x3086b3,tdx:_0x24d527}=_0x170fa7,_0x5cf121=_0x3086b3[0x0];_0x27f42f[_0x2ff119(0x1ef)]&&(console[_0x2ff119(0x1b7)]('Site:\x20'+_0x27f42f['site']),_0x5cf121&&console[_0x2ff119(0x1b7)](_0x2ff119(0x17d)+_0x5cf121));const _0x5b6c4a=await withSpinner(_0x5cf121?_0x2ff119(0x139)+_0x5cf121+'\x27...':'Listing\x20parent\x20segments...',()=>_0x24d527[_0x2ff119(0x1d2)][_0x2ff119(0x19d)](),{'verbose':_0x27f42f['verbose']});let _0x44e5ff=_0x5b6c4a[_0x2ff119(0x1b0)];if(_0x5cf121){const _0x269623=_0x5cf121['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x2ff119(0x17b)](/\?/g,'.'),_0x46b185=new RegExp('^'+_0x269623+'$','i');_0x44e5ff=_0x44e5ff[_0x2ff119(0x1c1)](_0x1964f2=>_0x46b185[_0x2ff119(0x147)](_0x1964f2[_0x2ff119(0x1d3)][_0x2ff119(0x12d)]));}_0x44e5ff[_0x2ff119(0x166)]((_0x38a460,_0x3114c9)=>_0x38a460[_0x2ff119(0x1d3)][_0x2ff119(0x12d)][_0x2ff119(0x1dc)](_0x3114c9[_0x2ff119(0x1d3)][_0x2ff119(0x12d)])),console['error'](_0x2ff119(0x161)+_0x44e5ff[_0x2ff119(0x12c)]+'\x20parent\x20segment'+(_0x44e5ff[_0x2ff119(0x12c)]!==0x1?'s':''));if(_0x27f42f[_0x2ff119(0x153)]===_0x2ff119(0x208)||_0x27f42f[_0x2ff119(0x153)]===_0x2ff119(0x216))await handleSDKOutput(_0x44e5ff,_0x27f42f);else{if(_0x44e5ff['length']===0x0)_0x5cf121?console[_0x2ff119(0x1fe)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x5cf121):console['log'](_0x2ff119(0x226));else for(const _0x4db72e of _0x44e5ff){const _0x31fcf2=_0x4db72e[_0x2ff119(0x1d3)][_0x2ff119(0x13a)]?a26_0x38bf93[_0x2ff119(0x1be)]('\x20('+formatRows(_0x4db72e['attributes'][_0x2ff119(0x13a)])+')'):'';console[_0x2ff119(0x1fe)](_0x2ff119(0x1cb)+_0x4db72e[_0x2ff119(0x1d3)][_0x2ff119(0x12d)]+_0x31fcf2);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a26_0x80c5cf(0x18a);[a26_0x80c5cf(0x1ce)]=a26_0x80c5cf(0x22a);async[a26_0x80c5cf(0x157)](_0x4b1517){const _0x510505=a26_0x80c5cf,{options:_0x40d4bb,args:_0x143c57,tdx:_0x55b70d}=_0x4b1517;console['error'](_0x510505(0x1f7)+_0x510505(0x1c7)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x15a6c6=_0x40d4bb;if(_0x143c57['length']===0x0)return console[_0x510505(0x1b7)](_0x510505(0x22e)),console[_0x510505(0x1b7)](_0x510505(0x194)),0x1;const _0x5dc0e3=_0x143c57[0x0];if(!_0x15a6c6[_0x510505(0x219)]||!_0x15a6c6[_0x510505(0x159)])return console[_0x510505(0x1b7)](_0x510505(0x1eb)),console[_0x510505(0x1b7)](_0x510505(0x194)),0x1;_0x15a6c6[_0x510505(0x1ef)]&&(console[_0x510505(0x1b7)](_0x510505(0x1ca)+_0x15a6c6[_0x510505(0x195)]),console[_0x510505(0x1b7)](_0x510505(0x191)+_0x5dc0e3),console[_0x510505(0x1b7)](_0x510505(0x175)+_0x15a6c6[_0x510505(0x219)]),console[_0x510505(0x1b7)]('Table:\x20'+_0x15a6c6[_0x510505(0x159)]));const _0x348236=await loadJSONFromOptions(_0x15a6c6['attributes'],_0x15a6c6['attributesFile']),_0x5ec3e6=await loadJSONFromOptions(_0x15a6c6['behaviors'],_0x15a6c6[_0x510505(0x1d1)]),_0x749494=await loadJSONFromOptions(_0x15a6c6['customerGroup'],_0x15a6c6['customerGroupFile']),_0x5098b3={'name':_0x5dc0e3,'description':_0x15a6c6['description'],'scheduleType':_0x15a6c6['scheduleType'],'scheduleOption':_0x15a6c6[_0x510505(0x15a)],'timezone':_0x15a6c6[_0x510505(0x20d)],'master':{'parentDatabaseName':_0x15a6c6['database'],'parentTableName':_0x15a6c6['table']},'attributes':_0x348236,'behaviors':_0x5ec3e6,'customerGroup':_0x749494},_0x21ef40=await withSpinner(_0x510505(0x178)+_0x5dc0e3+_0x510505(0x140),()=>_0x55b70d['segment'][_0x510505(0x1b2)](_0x5098b3),{'verbose':_0x40d4bb[_0x510505(0x1ef)]}),_0xbcc83f=_0x21ef40['data'];return console[_0x510505(0x1b7)](_0x510505(0x182)+_0xbcc83f['name']+_0x510505(0x20a)+_0xbcc83f['id']),await handleSDKOutput([_0xbcc83f],_0x40d4bb),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]=a26_0x80c5cf(0x144);[a26_0x80c5cf(0x1ce)]=a26_0x80c5cf(0x12e);async[a26_0x80c5cf(0x157)](_0x5dbdab){const _0xdc4dd8=a26_0x80c5cf,{options:_0x579d92,args:_0x35a685,tdx:_0x1910ef}=_0x5dbdab;console[_0xdc4dd8(0x1b7)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0xdc4dd8(0x1c7)+_0xdc4dd8(0x14c));const _0x1f0100=_0x579d92;if(_0x35a685['length']===0x0)return console[_0xdc4dd8(0x1b7)](_0xdc4dd8(0x22e)),console['error'](_0xdc4dd8(0x1c4)),0x1;const _0x221589=_0x35a685[0x0];_0x1f0100[_0xdc4dd8(0x1ef)]&&(console[_0xdc4dd8(0x1b7)]('Site:\x20'+_0x1f0100['site']),console['error'](_0xdc4dd8(0x20c)+_0x221589));const _0x36c5cf=await withSpinner(_0xdc4dd8(0x13d)+_0x221589+_0xdc4dd8(0x140),()=>_0x1910ef[_0xdc4dd8(0x1d2)]['getParentFull'](_0x221589),{'verbose':_0x1f0100[_0xdc4dd8(0x1ef)]}),_0x21942a=_0x36c5cf['data'],_0x294d3c=await loadJSONFromOptions(_0x1f0100[_0xdc4dd8(0x1d7)],_0x1f0100['addAttributesFile']),_0x1bd091=await loadJSONFromOptions(_0x1f0100['addBehaviors'],_0x1f0100['addBehaviorsFile']),_0x3cda5e={'name':_0x21942a['name'],'description':_0x1f0100[_0xdc4dd8(0x1ce)]!==undefined?_0x1f0100[_0xdc4dd8(0x1ce)]:_0x21942a['description'],'scheduleType':_0x1f0100['scheduleType']!==undefined?_0x1f0100[_0xdc4dd8(0x20f)]:_0x21942a[_0xdc4dd8(0x20f)],'scheduleOption':_0x1f0100['scheduleOption']!==undefined?_0x1f0100[_0xdc4dd8(0x15a)]:_0x21942a['scheduleOption'],'timezone':_0x1f0100['timezone']!==undefined?_0x1f0100[_0xdc4dd8(0x20d)]:_0x21942a[_0xdc4dd8(0x20d)],'master':_0x21942a[_0xdc4dd8(0x18f)],'attributes':_0x294d3c?[..._0x21942a[_0xdc4dd8(0x1d3)]||[],..._0x294d3c]:_0x21942a[_0xdc4dd8(0x1d3)],'behaviors':_0x1bd091?[..._0x21942a['behaviors']||[],..._0x1bd091]:_0x21942a['behaviors'],'customerGroup':_0x21942a[_0xdc4dd8(0x207)]},_0x128214=await withSpinner(_0xdc4dd8(0x132)+_0x221589+_0xdc4dd8(0x140),()=>_0x1910ef[_0xdc4dd8(0x1d2)][_0xdc4dd8(0x18d)](_0x221589,_0x3cda5e),{'verbose':_0x1f0100['verbose']}),_0xe67892=_0x128214[_0xdc4dd8(0x1b0)];return console[_0xdc4dd8(0x1b7)](_0xdc4dd8(0x18e)+_0xe67892['name']+'\x27'),await handleSDKOutput([_0xe67892],_0x1f0100),0x0;}}export class ParentSegmentPullCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]=a26_0x80c5cf(0x165);[a26_0x80c5cf(0x1ce)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async['execute'](_0x59b51f){const _0x23cb43=a26_0x80c5cf,{options:_0x4119a3,args:_0x4dc4bb,tdx:_0x1e341b}=_0x59b51f,_0x5be267=_0x4119a3,_0x55044c=_0x4dc4bb[0x0]||_0x4119a3[_0x23cb43(0x204)];if(!_0x55044c)return console['error'](a26_0x38bf93[_0x23cb43(0x1d4)](_0x23cb43(0x21f))),console[_0x23cb43(0x1b7)](_0x23cb43(0x186)),console[_0x23cb43(0x1b7)](a26_0x38bf93[_0x23cb43(0x1e5)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;const _0x51dc3f=_0x5be267[_0x23cb43(0x1d8)]||a26_0x1725d3[_0x23cb43(0x21b)](PARENT_SEGMENT_DIR,_0x55044c+_0x23cb43(0x232));_0x5be267['verbose']&&(console[_0x23cb43(0x1b7)](_0x23cb43(0x1ca)+_0x5be267[_0x23cb43(0x195)]),console[_0x23cb43(0x1b7)](_0x23cb43(0x20c)+_0x55044c),console[_0x23cb43(0x1b7)](_0x23cb43(0x1c0)+_0x51dc3f));const _0x1d3189=await withSpinner(_0x23cb43(0x1e1)+_0x55044c+_0x23cb43(0x140),()=>_0x1e341b[_0x23cb43(0x1d2)][_0x23cb43(0x192)](_0x55044c),{'verbose':_0x5be267[_0x23cb43(0x1ef)]}),_0x14a183=_0x1d3189[_0x23cb43(0x1b0)];if(existsSync(_0x51dc3f)){const _0x155589=readFileSync(_0x51dc3f,_0x23cb43(0x180)),_0x51eada=generateDiff(_0x155589,_0x14a183);if(!hasChanges(_0x51eada))return console[_0x23cb43(0x1b7)]('✔\x20No\x20changes\x20-\x20\x27'+_0x51dc3f+_0x23cb43(0x1ba)),0x0;console[_0x23cb43(0x1b7)](_0x23cb43(0x1a9)+_0x51dc3f+'\x27:'),console[_0x23cb43(0x1b7)]('─'[_0x23cb43(0x152)](0x3c)),console[_0x23cb43(0x1b7)](formatDiffWithColors(_0x51eada)),console['error']('─'[_0x23cb43(0x152)](0x3c));if(!_0x5be267[_0x23cb43(0x228)]){const _0x4c6fb9=await confirmKey(_0x23cb43(0x17a)+_0x51dc3f+'\x27?');if(!_0x4c6fb9)return console[_0x23cb43(0x1b7)](_0x23cb43(0x15e)),0x1;}}const _0x223237=a26_0x1725d3[_0x23cb43(0x1cf)](_0x51dc3f);return!existsSync(_0x223237)&&mkdirSync(_0x223237,{'recursive':!![]}),writeFileSync(_0x51dc3f,_0x14a183,_0x23cb43(0x180)),console[_0x23cb43(0x1b7)](_0x23cb43(0x1f4)+_0x51dc3f+'\x27'),_0x5be267[_0x23cb43(0x1b4)]&&(saveSessionContext({'parent_segment':_0x55044c},_0x5be267[_0x23cb43(0x203)]),console[_0x23cb43(0x1b7)](_0x23cb43(0x19e)+_0x55044c)),0x0;}}export class ParentSegmentPushCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]='segment:parent:push';[a26_0x80c5cf(0x1ce)]=a26_0x80c5cf(0x221);async[a26_0x80c5cf(0x157)](_0x278099){const _0x22c3bb=a26_0x80c5cf,{options:_0x3f3a30,args:_0x5fa89c,tdx:_0x3a3346}=_0x278099,_0xe2871f=_0x3f3a30,_0x22bc6f=_0x5fa89c[0x0]||_0x3f3a30[_0x22c3bb(0x204)];if(!_0x22bc6f)return console[_0x22c3bb(0x1b7)](a26_0x38bf93[_0x22c3bb(0x1d4)](_0x22c3bb(0x21f))),console[_0x22c3bb(0x1b7)](_0x22c3bb(0x209)),console[_0x22c3bb(0x1b7)](a26_0x38bf93[_0x22c3bb(0x1e5)](_0x22c3bb(0x130))),0x1;const _0x4f434c=resolveYamlFile(_0x22bc6f);if(!existsSync(_0x4f434c))return console[_0x22c3bb(0x1b7)](_0x22c3bb(0x162)+_0x4f434c),0x1;_0xe2871f[_0x22c3bb(0x1ef)]&&(console[_0x22c3bb(0x1b7)]('Site:\x20'+_0xe2871f[_0x22c3bb(0x195)]),console['error'](_0x22c3bb(0x22f)+_0x4f434c));let _0x108927;try{_0x108927=readFileSync(_0x4f434c,'utf-8');}catch(_0x13da46){const _0x10d3b9=_0x13da46 instanceof Error?_0x13da46['message']:String(_0x13da46);return console[_0x22c3bb(0x1b7)]('Error\x20reading\x20file:\x20'+_0x10d3b9),0x1;}const _0x81a9ad=await withSpinner(_0x22c3bb(0x14f),()=>_0x3a3346[_0x22c3bb(0x1d2)][_0x22c3bb(0x211)](_0x108927),{'verbose':_0xe2871f[_0x22c3bb(0x1ef)]}),_0x5f37b1=_0x81a9ad[_0x22c3bb(0x1b0)],{isNew:_0x319182,name:_0x1e0aaa,hasChanges:_0xb8f751,diffFormatted:_0x2bf595}=_0x5f37b1;if(!_0xb8f751)return console[_0x22c3bb(0x1b7)](_0x22c3bb(0x160)+_0x1e0aaa+_0x22c3bb(0x1ba)),0x0;_0x319182?console[_0x22c3bb(0x1b7)](_0x22c3bb(0x1e7)+_0x1e0aaa+'\x27:'):console['error'](_0x22c3bb(0x218)+_0x1e0aaa+'\x27:');console[_0x22c3bb(0x1b7)]('─'[_0x22c3bb(0x152)](0x3c)),console[_0x22c3bb(0x1b7)](_0x2bf595),console[_0x22c3bb(0x1b7)]('─'[_0x22c3bb(0x152)](0x3c));const _0x1cbbcd=_0x319182?'Create\x20parent\x20segment\x20\x27'+_0x1e0aaa+'\x27?':_0x22c3bb(0x1e6)+_0x1e0aaa+'\x27?';if(!_0xe2871f[_0x22c3bb(0x228)]){const _0x444446=await confirmKey(_0x1cbbcd);if(!_0x444446)return console[_0x22c3bb(0x1b7)](_0x22c3bb(0x15e)),0x1;}const _0x1ed714=_0x319182?'Creating':_0x22c3bb(0x1b8),_0x4c9227=await withSpinner(_0x1ed714+_0x22c3bb(0x173)+_0x1e0aaa+_0x22c3bb(0x140),()=>_0x5f37b1[_0x22c3bb(0x156)](),{'verbose':_0xe2871f['verbose']}),_0x43b57a=_0x4c9227[_0x22c3bb(0x1b0)],_0x1fd459=getConsoleUrl(_0xe2871f[_0x22c3bb(0x195)],'/app/dw/parentSegments/'+_0x43b57a['id']),_0x199ee3=_0x319182?_0x22c3bb(0x22b):_0x22c3bb(0x14a);return console[_0x22c3bb(0x1b7)]('✔\x20'+_0x199ee3+_0x22c3bb(0x173)+_0x43b57a['name']+'\x27'),console[_0x22c3bb(0x1b7)]('\x20\x20'+_0x1fd459),0x0;}}export class ParentSegmentValidateCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]='segment:parent:validate';['description']=a26_0x80c5cf(0x16c);async['execute'](_0x2d3cb8){const _0x57ad39=a26_0x80c5cf,{options:_0x5ba73d,args:_0x1e509a,tdx:_0x14b185}=_0x2d3cb8,_0x53d36d=_0x5ba73d;if(_0x1e509a[_0x57ad39(0x12c)]===0x0)return console[_0x57ad39(0x1b7)](a26_0x38bf93[_0x57ad39(0x1d4)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x57ad39(0x1b7)](_0x57ad39(0x136)),console[_0x57ad39(0x1b7)](_0x57ad39(0x1de)),console[_0x57ad39(0x1b7)](_0x57ad39(0x146)),console[_0x57ad39(0x1b7)]('\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)'),console[_0x57ad39(0x1b7)](_0x57ad39(0x16f)),0x1;const _0x49a8b4=resolveYamlFile(_0x1e509a[0x0]);if(!existsSync(_0x49a8b4))return console['error']('Error:\x20File\x20not\x20found:\x20'+_0x49a8b4),0x1;_0x53d36d['verbose']&&(console[_0x57ad39(0x1b7)](_0x57ad39(0x1ca)+_0x53d36d[_0x57ad39(0x195)]),console[_0x57ad39(0x1b7)](_0x57ad39(0x22f)+_0x49a8b4));let _0x4b38fe;try{_0x4b38fe=readFileSync(_0x49a8b4,_0x57ad39(0x180));}catch(_0x4621fd){const _0x45e2ba=_0x4621fd instanceof Error?_0x4621fd[_0x57ad39(0x227)]:String(_0x4621fd);return console['error'](_0x57ad39(0x1d6)+_0x45e2ba),0x1;}const _0x3129df=createCommandSpinner(a26_0x38bf93['dim'](_0x57ad39(0x1ff)),{'verbose':_0x53d36d['verbose']});_0x3129df['start']();const _0x7330a3={'onProgress':_0x255f92=>{_0x3129df['text']=formatProgressMessage(_0x255f92);}};if(_0x53d36d['master'])_0x7330a3[_0x57ad39(0x18f)]=!![];if(_0x53d36d['enriched'])_0x7330a3[_0x57ad39(0x1db)]=!![];_0x53d36d[_0x57ad39(0x1bc)]&&(_0x7330a3[_0x57ad39(0x1bc)]=_0x53d36d[_0x57ad39(0x1bc)]);_0x53d36d[_0x57ad39(0x184)]&&(_0x7330a3['behavior']=_0x53d36d['behavior']);if(_0x53d36d[_0x57ad39(0x1a8)])_0x7330a3[_0x57ad39(0x1a8)]=_0x53d36d[_0x57ad39(0x1a8)];let _0x5ccd03;try{_0x5ccd03=await _0x14b185[_0x57ad39(0x1d2)][_0x57ad39(0x1ae)](_0x4b38fe,_0x7330a3),_0x3129df[_0x57ad39(0x13b)]();}catch(_0x454e8e){_0x3129df['stop']();throw _0x454e8e;}const _0x88d25=_0x53d36d[_0x57ad39(0x1a8)]||_0x57ad39(0x1bd);return this['displayValidateResults'](_0x5ccd03,_0x7330a3,_0x49a8b4,_0x88d25),_0x5ccd03[_0x57ad39(0x1e3)]?0x0:0x1;}[a26_0x80c5cf(0x154)](_0x435f1d,_0x9ab05a,_0x28a055,_0x112abf){const _0x394262=a26_0x80c5cf;console[_0x394262(0x1b7)]('\x0a'+a26_0x38bf93[_0x394262(0x1a1)](_0x394262(0x164))+'\x20'+_0x435f1d[_0x394262(0x12d)]),console[_0x394262(0x1b7)]('═'[_0x394262(0x152)](0x3c)),this[_0x394262(0x150)](_0x435f1d);if(typeof _0x9ab05a[_0x394262(0x1bc)]==='string'){this[_0x394262(0x17f)](_0x435f1d),this[_0x394262(0x225)](_0x435f1d),this[_0x394262(0x167)](_0x28a055,_0x112abf,_0x394262(0x1bc),_0x9ab05a[_0x394262(0x1bc)]);return;}if(_0x9ab05a['attribute']===!![]){this[_0x394262(0x17f)](_0x435f1d),this[_0x394262(0x225)](_0x435f1d),this[_0x394262(0x167)](_0x28a055,_0x112abf,_0x394262(0x1d3));return;}if(typeof _0x9ab05a[_0x394262(0x184)]===_0x394262(0x1cd)){this['displayBehaviorsStats'](_0x435f1d,_0x112abf),this[_0x394262(0x225)](_0x435f1d),this[_0x394262(0x167)](_0x28a055,_0x112abf,'behavior',_0x9ab05a[_0x394262(0x184)]);return;}if(_0x9ab05a[_0x394262(0x184)]===!![]){this['displayBehaviorsStats'](_0x435f1d,_0x112abf),this[_0x394262(0x225)](_0x435f1d),this[_0x394262(0x167)](_0x28a055,_0x112abf,'behaviors');return;}this[_0x394262(0x17f)](_0x435f1d),this[_0x394262(0x179)](_0x435f1d,_0x112abf),this['displaySummary'](_0x435f1d),this[_0x394262(0x167)](_0x28a055,_0x112abf,_0x394262(0x1a3));}['displayPreviewHints'](_0x3862bd,_0x587271,_0x48ca4f,_0x42fd6e){const _0x391399=a26_0x80c5cf;console['error']('\x0a'+a26_0x38bf93['dim'](_0x391399(0x220)));const _0x52825d=_0x587271!=='-1d'?_0x391399(0x222)+_0x587271:'';if(_0x48ca4f===_0x391399(0x1bc)&&_0x42fd6e)console[_0x391399(0x1b7)]('\x20\x20'+a26_0x38bf93['dim'](_0x391399(0x1a6)+_0x3862bd+'\x20--attribute\x20\x22'+_0x42fd6e+'\x22'+_0x52825d));else{if(_0x48ca4f===_0x391399(0x184)&&_0x42fd6e)console[_0x391399(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x391399(0x1be)](_0x391399(0x1a6)+_0x3862bd+_0x391399(0x1bb)+_0x42fd6e+'\x22'+_0x52825d));else(_0x48ca4f===_0x391399(0x1d3)||_0x48ca4f===_0x391399(0x1a3))&&console[_0x391399(0x1b7)]('\x20\x20'+a26_0x38bf93['dim'](_0x391399(0x1a6)+_0x3862bd+'\x20--attribute\x20\x22<name>\x22'+_0x52825d));}(_0x48ca4f===_0x391399(0x21d)||_0x48ca4f==='all')&&console[_0x391399(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x391399(0x1be)](_0x391399(0x1a6)+_0x3862bd+_0x391399(0x155)+_0x52825d)),_0x48ca4f===_0x391399(0x1a3)&&console[_0x391399(0x1b7)]('\x20\x20'+a26_0x38bf93['dim'](_0x391399(0x1a6)+_0x3862bd+'\x20--enriched'+_0x52825d));}[a26_0x80c5cf(0x150)](_0x3390c8){const _0x526110=a26_0x80c5cf,{master:_0x329bf2}=_0x3390c8,_0x2e392f=_0x329bf2[_0x526110(0x131)]?a26_0x38bf93['green']('✔'):a26_0x38bf93[_0x526110(0x1d4)]('✘');console['error']('\x0a'+a26_0x38bf93[_0x526110(0x1be)](_0x526110(0x1ec))),console['error'](_0x2e392f+'\x20'+a26_0x38bf93[_0x526110(0x1a1)](_0x329bf2['database']+'.'+_0x329bf2[_0x526110(0x159)])),_0x329bf2[_0x526110(0x131)]?_0x329bf2['rowCount']!==undefined&&console[_0x526110(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x526110(0x1be)](_0x526110(0x229))+'\x20'+a26_0x38bf93[_0x526110(0x1e5)](formatRows(_0x329bf2[_0x526110(0x1b3)]))):console[_0x526110(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x526110(0x1d4)](_0x526110(0x1f6))+'\x20'+_0x329bf2[_0x526110(0x142)]);}[a26_0x80c5cf(0x17f)](_0x5e1dc1){const _0x14d038=a26_0x80c5cf;if(_0x5e1dc1[_0x14d038(0x1d3)]['length']===0x0)return;console[_0x14d038(0x1b7)]('\x0a'+a26_0x38bf93[_0x14d038(0x1be)](_0x14d038(0x214)));for(const _0x379fe8 of _0x5e1dc1[_0x14d038(0x1d3)]){const _0x53b922=_0x379fe8['schemaValid']?a26_0x38bf93['green']('✔'):a26_0x38bf93[_0x14d038(0x1d4)]('✘');let _0x177a6d='';if(_0x379fe8[_0x14d038(0x131)]&&_0x379fe8[_0x14d038(0x223)]!==undefined&&_0x379fe8[_0x14d038(0x1c3)]!==undefined){const _0x355161=_0x379fe8[_0x14d038(0x1c3)][_0x14d038(0x20e)](0x1),_0x506fcc=_0x379fe8[_0x14d038(0x1c3)]>=0x50?a26_0x38bf93['green']:_0x379fe8[_0x14d038(0x1c3)]>=0x32?a26_0x38bf93[_0x14d038(0x189)]:a26_0x38bf93['red'];_0x177a6d='\x20'+a26_0x38bf93[_0x14d038(0x1be)](_0x14d038(0x205))+'\x20'+_0x506fcc(_0x355161+'%')+'\x20('+formatRows(_0x379fe8[_0x14d038(0x223)])+'\x20rows)';}console[_0x14d038(0x1b7)](_0x53b922+'\x20'+a26_0x38bf93['bold'](_0x379fe8[_0x14d038(0x12d)])+_0x177a6d),console[_0x14d038(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x14d038(0x1be)](_0x14d038(0x1e2))+'\x20'+a26_0x38bf93[_0x14d038(0x1a1)](_0x379fe8[_0x14d038(0x219)]+'.'+_0x379fe8[_0x14d038(0x159)]));const _0x5eda34=_0x379fe8[_0x14d038(0x19b)]===_0x379fe8[_0x14d038(0x21c)]?a26_0x38bf93['dim'](_0x14d038(0x134))+'\x20'+_0x379fe8[_0x14d038(0x19b)]:a26_0x38bf93['dim']('Join:')+'\x20'+_0x379fe8[_0x14d038(0x19b)]+_0x14d038(0x1c2)+_0x379fe8[_0x14d038(0x21c)];console[_0x14d038(0x1b7)]('\x20\x20'+_0x5eda34),console[_0x14d038(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x14d038(0x1be)](_0x14d038(0x158))),this['displayColumns'](_0x379fe8['columns']),!_0x379fe8['schemaValid']&&console['error']('\x20\x20'+a26_0x38bf93[_0x14d038(0x1d4)](_0x14d038(0x1f6))+'\x20'+_0x379fe8['schemaError']);}}[a26_0x80c5cf(0x179)](_0x2c03ba,_0x724922){const _0x27fc7a=a26_0x80c5cf;if(_0x2c03ba[_0x27fc7a(0x21d)][_0x27fc7a(0x12c)]===0x0)return;console[_0x27fc7a(0x1b7)]('\x0a'+a26_0x38bf93['dim'](_0x27fc7a(0x1ee))+'\x20'+a26_0x38bf93[_0x27fc7a(0x1be)]('('+_0x724922+')'));for(const _0x222af0 of _0x2c03ba[_0x27fc7a(0x21d)]){const _0x132c95=_0x222af0[_0x27fc7a(0x131)]?a26_0x38bf93['green']('✔'):a26_0x38bf93[_0x27fc7a(0x1d4)]('✘');let _0x3c8b6b='';if(_0x222af0[_0x27fc7a(0x131)]&&_0x222af0['customersWithEvents']!==undefined&&_0x222af0[_0x27fc7a(0x1c6)]!==undefined){const _0x95e65e=_0x222af0[_0x27fc7a(0x1c8)]?.[_0x27fc7a(0x20e)](0x1)||'?',_0x58c4ab=(_0x222af0[_0x27fc7a(0x1c8)]??0x0)>=0x32?a26_0x38bf93[_0x27fc7a(0x1ed)]:(_0x222af0[_0x27fc7a(0x1c8)]??0x0)>=0x14?a26_0x38bf93['yellow']:a26_0x38bf93[_0x27fc7a(0x1d4)];_0x3c8b6b='\x20'+a26_0x38bf93['dim']('Customers:')+'\x20'+_0x58c4ab(formatRows(_0x222af0['customersWithEvents']))+'\x20('+_0x95e65e+_0x27fc7a(0x15c)+a26_0x38bf93[_0x27fc7a(0x1be)](_0x27fc7a(0x19f))+'\x20'+a26_0x38bf93[_0x27fc7a(0x1e5)](formatRows(_0x222af0[_0x27fc7a(0x1c6)]));}console['error'](_0x132c95+'\x20'+a26_0x38bf93[_0x27fc7a(0x1a1)](_0x222af0[_0x27fc7a(0x12d)])+_0x3c8b6b),console[_0x27fc7a(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x27fc7a(0x1be)](_0x27fc7a(0x1e2))+'\x20'+a26_0x38bf93[_0x27fc7a(0x1a1)](_0x222af0['database']+'.'+_0x222af0[_0x27fc7a(0x159)]));const _0x395294=_0x222af0[_0x27fc7a(0x19b)]===_0x222af0['foreignKey']?a26_0x38bf93[_0x27fc7a(0x1be)]('Join\x20on:')+'\x20'+_0x222af0[_0x27fc7a(0x19b)]:a26_0x38bf93['dim']('Join:')+'\x20'+_0x222af0[_0x27fc7a(0x19b)]+'\x20=\x20'+_0x222af0[_0x27fc7a(0x21c)];console[_0x27fc7a(0x1b7)]('\x20\x20'+_0x395294),console[_0x27fc7a(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x27fc7a(0x1be)]('Columns:')),this[_0x27fc7a(0x176)](_0x222af0[_0x27fc7a(0x1e4)]),!_0x222af0[_0x27fc7a(0x131)]&&console[_0x27fc7a(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x27fc7a(0x1d4)](_0x27fc7a(0x1f6))+'\x20'+_0x222af0[_0x27fc7a(0x142)]);}}[a26_0x80c5cf(0x176)](_0x22eaca){const _0x161360=a26_0x80c5cf;for(const _0xd56a89 of _0x22eaca){_0xd56a89['label']===_0xd56a89['column']||_0xd56a89[_0x161360(0x1ac)]==='*'?console[_0x161360(0x1b7)](_0x161360(0x224)+_0xd56a89[_0x161360(0x1f0)]):console[_0x161360(0x1b7)](_0x161360(0x224)+_0xd56a89[_0x161360(0x1f0)]+'\x20'+a26_0x38bf93[_0x161360(0x1be)]('('+_0xd56a89[_0x161360(0x1ac)]+')'));}}[a26_0x80c5cf(0x225)](_0x5c1066){const _0x4de9c6=a26_0x80c5cf;console[_0x4de9c6(0x1b7)]('─'[_0x4de9c6(0x152)](0x3c));if(_0x5c1066[_0x4de9c6(0x1ab)][_0x4de9c6(0x12c)]>0x0){console['error']('\x0a'+a26_0x38bf93['red'](_0x4de9c6(0x16a)));for(const _0x4a68ee of _0x5c1066[_0x4de9c6(0x1ab)]){console[_0x4de9c6(0x1b7)]('\x20\x20'+a26_0x38bf93['red']('•')+'\x20'+_0x4a68ee);}}_0x5c1066['allValid']&&console['error']('\x0a'+a26_0x38bf93[_0x4de9c6(0x1ed)]('✔')+_0x4de9c6(0x135));}}export class ParentSegmentPreviewCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]=a26_0x80c5cf(0x1b1);[a26_0x80c5cf(0x1ce)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async['execute'](_0x5c01b5){const _0x3b7bc2=a26_0x80c5cf,{options:_0x36bb43,args:_0x37bb1e,tdx:_0xa427ca}=_0x5c01b5,_0x29dc89=_0x36bb43;if(_0x37bb1e[_0x3b7bc2(0x12c)]===0x0)return console[_0x3b7bc2(0x1b7)](a26_0x38bf93[_0x3b7bc2(0x1d4)](_0x3b7bc2(0x21f))),console[_0x3b7bc2(0x1b7)](_0x3b7bc2(0x190)),console[_0x3b7bc2(0x1b7)]('Options\x20(one\x20required):'),console['error'](_0x3b7bc2(0x1f3)),console[_0x3b7bc2(0x1b7)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x3b7bc2(0x1b7)](_0x3b7bc2(0x174)),console['error'](_0x3b7bc2(0x13c)),console[_0x3b7bc2(0x1b7)]('\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x29dc89['master']&&!_0x29dc89['attribute']&&!_0x29dc89[_0x3b7bc2(0x184)]&&!_0x29dc89['enriched'])return console['error'](a26_0x38bf93[_0x3b7bc2(0x1d4)](_0x3b7bc2(0x13e))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console['error'](_0x3b7bc2(0x1de)),console[_0x3b7bc2(0x1b7)](_0x3b7bc2(0x1f3)),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console['error']('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error'](_0x3b7bc2(0x13c)),0x1;const _0x29ae93=resolveYamlFile(_0x37bb1e[0x0]);if(!existsSync(_0x29ae93))return console[_0x3b7bc2(0x1b7)](_0x3b7bc2(0x162)+_0x29ae93),0x1;_0x29dc89['verbose']&&(console[_0x3b7bc2(0x1b7)]('Site:\x20'+_0x29dc89[_0x3b7bc2(0x195)]),console[_0x3b7bc2(0x1b7)]('YAML\x20file:\x20'+_0x29ae93));let _0x1b0d66;try{_0x1b0d66=readFileSync(_0x29ae93,'utf-8');}catch(_0x9c13b1){const _0x342de0=_0x9c13b1 instanceof Error?_0x9c13b1[_0x3b7bc2(0x227)]:String(_0x9c13b1);return console[_0x3b7bc2(0x1b7)](_0x3b7bc2(0x1d6)+_0x342de0),0x1;}let _0x398d8f;try{_0x398d8f=parseYamlString(_0x1b0d66);}catch(_0x2f34f3){const _0x3135f=_0x2f34f3 instanceof Error?_0x2f34f3['message']:String(_0x2f34f3);return console[_0x3b7bc2(0x1b7)](a26_0x38bf93['red'](_0x3b7bc2(0x137)+_0x3135f)),0x1;}if(_0x29dc89['attribute']===!![]||_0x29dc89[_0x3b7bc2(0x1bc)]===''){const _0x561365=_0x398d8f[_0x3b7bc2(0x1d3)]?.[_0x3b7bc2(0x149)](_0x710d52=>_0x710d52[_0x3b7bc2(0x12d)])||[];if(_0x561365[_0x3b7bc2(0x12c)]===0x0)console[_0x3b7bc2(0x1b7)](a26_0x38bf93[_0x3b7bc2(0x1d4)](_0x3b7bc2(0x171)));else{console[_0x3b7bc2(0x1b7)](a26_0x38bf93[_0x3b7bc2(0x1d4)](_0x3b7bc2(0x1f8))),console[_0x3b7bc2(0x1b7)]('Available\x20attributes:');for(const _0x27ff09 of _0x561365){console[_0x3b7bc2(0x1b7)]('\x20\x20'+a26_0x38bf93[_0x3b7bc2(0x1e5)](_0x27ff09));}console[_0x3b7bc2(0x1b7)](_0x3b7bc2(0x170)+_0x37bb1e[0x0]+'\x20--attribute\x20\x22'+_0x561365[0x0]+'\x22');}return 0x1;}if(_0x29dc89['behavior']===!![]||_0x29dc89[_0x3b7bc2(0x184)]===''){const _0x978ffa=_0x398d8f[_0x3b7bc2(0x21d)]?.['map'](_0x19ac7e=>_0x19ac7e[_0x3b7bc2(0x12d)])||[];if(_0x978ffa[_0x3b7bc2(0x12c)]===0x0)console[_0x3b7bc2(0x1b7)](a26_0x38bf93[_0x3b7bc2(0x1d4)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x3b7bc2(0x1b7)](a26_0x38bf93[_0x3b7bc2(0x1d4)](_0x3b7bc2(0x193))),console['error'](_0x3b7bc2(0x1b5));for(const _0xb59e61 of _0x978ffa){console['error']('\x20\x20'+a26_0x38bf93[_0x3b7bc2(0x1e5)](_0xb59e61));}console[_0x3b7bc2(0x1b7)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x37bb1e[0x0]+_0x3b7bc2(0x1bb)+_0x978ffa[0x0]+'\x22');}return 0x1;}const _0x3dfdbc=createCommandSpinner(a26_0x38bf93['dim'](_0x3b7bc2(0x212)),{'verbose':_0x29dc89[_0x3b7bc2(0x1ef)]});_0x3dfdbc[_0x3b7bc2(0x1ad)]();const _0x2d11b={'onProgress':_0x6e2212=>{const _0x35b443=_0x3b7bc2;_0x3dfdbc[_0x35b443(0x1b9)]=formatProgressMessage(_0x6e2212);}};if(_0x29dc89[_0x3b7bc2(0x18f)])_0x2d11b[_0x3b7bc2(0x18f)]=!![];if(_0x29dc89['attribute']&&typeof _0x29dc89[_0x3b7bc2(0x1bc)]===_0x3b7bc2(0x1cd))_0x2d11b[_0x3b7bc2(0x1bc)]=_0x29dc89['attribute'];if(_0x29dc89[_0x3b7bc2(0x184)]&&typeof _0x29dc89[_0x3b7bc2(0x184)]===_0x3b7bc2(0x1cd))_0x2d11b[_0x3b7bc2(0x184)]=_0x29dc89['behavior'];if(_0x29dc89[_0x3b7bc2(0x1db)])_0x2d11b['enriched']=!![];if(_0x29dc89[_0x3b7bc2(0x1a8)])_0x2d11b[_0x3b7bc2(0x1a8)]=_0x29dc89[_0x3b7bc2(0x1a8)];let _0x25d246;try{_0x25d246=await _0xa427ca[_0x3b7bc2(0x1d2)]['previewParentYaml'](_0x1b0d66,_0x2d11b),_0x3dfdbc[_0x3b7bc2(0x13b)]();}catch(_0x3b6df1){_0x3dfdbc['stop']();throw _0x3b6df1;}return await this['displayPreviewResults'](_0x25d246,{'master':_0x29dc89['master'],'attribute':typeof _0x29dc89['attribute']===_0x3b7bc2(0x1cd)?_0x29dc89['attribute']:undefined,'behavior':typeof _0x29dc89['behavior']===_0x3b7bc2(0x1cd)?_0x29dc89['behavior']:undefined,'enriched':_0x29dc89['enriched']}),_0x25d246[_0x3b7bc2(0x1e3)]?0x0:0x1;}async[a26_0x80c5cf(0x172)](_0x150f21,_0x4881f5){const _0x35e7a9=a26_0x80c5cf;console[_0x35e7a9(0x1b7)]('\x0a'+a26_0x38bf93[_0x35e7a9(0x1a1)](_0x35e7a9(0x1fa))+'\x20'+_0x150f21[_0x35e7a9(0x12d)]),console[_0x35e7a9(0x1b7)]('═'[_0x35e7a9(0x152)](0x3c));if(_0x4881f5[_0x35e7a9(0x18f)]&&_0x150f21[_0x35e7a9(0x197)]){const _0x48bb64=a26_0x38bf93[_0x35e7a9(0x1be)]('Master:')+'\x20'+a26_0x38bf93[_0x35e7a9(0x1a1)](_0x150f21[_0x35e7a9(0x18f)][_0x35e7a9(0x219)]+'.'+_0x150f21['master'][_0x35e7a9(0x159)]);await this['displaySampleData'](_0x48bb64,_0x150f21['sampleData']);}else{if(_0x4881f5[_0x35e7a9(0x1bc)]&&_0x150f21['sampleData']){const _0x2c609a=a26_0x38bf93[_0x35e7a9(0x1be)](_0x35e7a9(0x1a2))+'\x20'+a26_0x38bf93[_0x35e7a9(0x1a1)](_0x4881f5[_0x35e7a9(0x1bc)]);await this[_0x35e7a9(0x148)](_0x2c609a,_0x150f21['sampleData']);}else{if(_0x4881f5[_0x35e7a9(0x184)]&&_0x150f21['sampleData']){const _0x409548=a26_0x38bf93['dim'](_0x35e7a9(0x138))+'\x20'+a26_0x38bf93['bold'](_0x4881f5[_0x35e7a9(0x184)]);await this['displaySampleData'](_0x409548,_0x150f21[_0x35e7a9(0x197)]);}else{if(_0x4881f5['enriched']&&_0x150f21['sampleData']){const _0x328d9e=a26_0x38bf93[_0x35e7a9(0x1be)](_0x35e7a9(0x1fb))+'\x20'+a26_0x38bf93[_0x35e7a9(0x1a1)](_0x35e7a9(0x1f2));await this[_0x35e7a9(0x148)](_0x328d9e,_0x150f21[_0x35e7a9(0x197)]);}else!_0x150f21[_0x35e7a9(0x197)]&&console[_0x35e7a9(0x1b7)](_0x35e7a9(0x1df));}}}if(_0x150f21[_0x35e7a9(0x1ab)][_0x35e7a9(0x12c)]>0x0){console[_0x35e7a9(0x1b7)]('─'[_0x35e7a9(0x152)](0x3c)),console[_0x35e7a9(0x1b7)]('\x0a'+a26_0x38bf93[_0x35e7a9(0x1d4)]('Errors:'));for(const _0x18da38 of _0x150f21[_0x35e7a9(0x1ab)]){console[_0x35e7a9(0x1b7)]('\x20\x20'+a26_0x38bf93['red']('•')+'\x20'+_0x18da38);}}}async['displaySampleData'](_0x51f44b,_0x443dca){const _0x2c9cd8=a26_0x80c5cf;if(_0x443dca[_0x2c9cd8(0x12c)]===0x0){console[_0x2c9cd8(0x1b7)]('\x0a'+_0x51f44b),console['error'](_0x2c9cd8(0x1ea));return;}console[_0x2c9cd8(0x1b7)]('\x0a'+_0x51f44b);const _0x59e21a=Object[_0x2c9cd8(0x1d9)](_0x443dca[0x0])[_0x2c9cd8(0x149)](_0x30026d=>({'name':_0x30026d,'type':typeof _0x443dca[0x0][_0x30026d]===_0x2c9cd8(0x215)?_0x2c9cd8(0x143):_0x2c9cd8(0x1e8)})),_0x2d7bd9={'queryId':'preview','columns':_0x59e21a,'data':_0x443dca,'stats':{'state':_0x2c9cd8(0x231),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x443dca[_0x2c9cd8(0x12c)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4fd31e=formatAsTable(_0x2d7bd9,_0x443dca[_0x2c9cd8(0x12c)],!![]);await writeOutput(_0x4fd31e,undefined,_0x2c9cd8(0x159));}}export class ParentSegmentRunCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]=a26_0x80c5cf(0x16d);['description']=a26_0x80c5cf(0x1c9);async[a26_0x80c5cf(0x157)](_0x8de635){const _0xb104aa=a26_0x80c5cf,{options:_0x335d98,args:_0x24312a,tdx:_0x1d5e3e}=_0x8de635,_0x220b19=_0x335d98;if(_0x24312a['length']===0x0)return console[_0xb104aa(0x1b7)](a26_0x38bf93[_0xb104aa(0x1d4)](_0xb104aa(0x21f))),console[_0xb104aa(0x1b7)](_0xb104aa(0x206)),console['error'](a26_0x38bf93[_0xb104aa(0x1e5)]('Tip:\x20Use\x20`tdx\x20ps\x20list`\x20to\x20list\x20available\x20parent\x20segments')),0x1;const _0x14cc02=_0x24312a[0x0],_0x5cd444=resolveYamlFile(_0x14cc02);if(existsSync(_0x5cd444)){_0x220b19[_0xb104aa(0x1ef)]&&console[_0xb104aa(0x1b7)](_0xb104aa(0x22c)+_0x5cd444);let _0x1169d5;try{_0x1169d5=readFileSync(_0x5cd444,_0xb104aa(0x180));}catch(_0x43205){const _0x2044d3=_0x43205 instanceof Error?_0x43205[_0xb104aa(0x227)]:String(_0x43205);return console[_0xb104aa(0x1b7)](_0xb104aa(0x1d6)+_0x2044d3),0x1;}const _0x52e2e5=await withSpinner('Analyzing\x20changes...',()=>_0x1d5e3e[_0xb104aa(0x1d2)][_0xb104aa(0x211)](_0x1169d5),{'verbose':_0x220b19['verbose']}),_0x567ce7=_0x52e2e5[_0xb104aa(0x1b0)],{isNew:_0x40b4ea,name:_0x38c1ba,hasChanges:_0x703fdf,diffFormatted:_0x1a60f1}=_0x567ce7;if(_0x703fdf){_0x40b4ea?console[_0xb104aa(0x1b7)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x38c1ba+'\x27:'):console[_0xb104aa(0x1b7)](_0xb104aa(0x218)+_0x38c1ba+'\x27:');console[_0xb104aa(0x1b7)]('─'[_0xb104aa(0x152)](0x3c)),console[_0xb104aa(0x1b7)](_0x1a60f1),console[_0xb104aa(0x1b7)]('─'[_0xb104aa(0x152)](0x3c));const _0xdbc2d5=_0x40b4ea?_0xb104aa(0x17e)+_0x38c1ba+_0xb104aa(0x14e):_0xb104aa(0x1e6)+_0x38c1ba+_0xb104aa(0x14e);if(!_0x220b19[_0xb104aa(0x228)]){const _0x46227c=await confirmKey(_0xdbc2d5);if(!_0x46227c)return console['error']('Aborted.'),0x1;}const _0x5da741=_0x40b4ea?_0xb104aa(0x1f9):_0xb104aa(0x1b8);await withSpinner(_0x5da741+_0xb104aa(0x173)+_0x38c1ba+_0xb104aa(0x140),()=>_0x567ce7[_0xb104aa(0x156)](),{'verbose':_0x220b19['verbose']});const _0x14a96e=_0x40b4ea?'Created':_0xb104aa(0x14a);console[_0xb104aa(0x1b7)]('✔\x20'+_0x14a96e+_0xb104aa(0x173)+_0x38c1ba+'\x27');}else console[_0xb104aa(0x1b7)]('✔\x20No\x20changes\x20-\x20\x27'+_0x38c1ba+'\x27\x20is\x20up\x20to\x20date');}const _0x5bd315=await withSpinner(_0xb104aa(0x213)+_0x14cc02+_0xb104aa(0x140),()=>_0x1d5e3e[_0xb104aa(0x1d2)][_0xb104aa(0x1f1)](_0x14cc02),{'verbose':_0x220b19['verbose']}),_0x389e6f=_0x5bd315[_0xb104aa(0x1b0)],_0x2e2dc1=getConsoleUrl(_0x220b19['site'],_0xb104aa(0x145)+_0x389e6f[_0xb104aa(0x177)]+_0xb104aa(0x1dd)+_0x389e6f['workflowSessionId']+'/attempt/'+_0x389e6f['workflowAttemptId']);return console['error'](_0xb104aa(0x21a)),console['error']('\x20\x20'+a26_0x38bf93[_0xb104aa(0x1be)](_0xb104aa(0x18c))+'\x20'+_0x389e6f[_0xb104aa(0x17c)]),console[_0xb104aa(0x1b7)]('\x20\x20'+a26_0x38bf93[_0xb104aa(0x1be)](_0xb104aa(0x22d))+'\x20'+_0x389e6f['status']),console['error']('\x20\x20'+a26_0x38bf93[_0xb104aa(0x1be)](_0xb104aa(0x163))+'\x20'+_0x389e6f[_0xb104aa(0x1d5)]),console['error']('\x20\x20'+a26_0x38bf93[_0xb104aa(0x1be)](_0xb104aa(0x1b6))+'\x20'+_0x389e6f[_0xb104aa(0x21e)]),console['error']('\x20\x20'+_0x2e2dc1),console[_0xb104aa(0x1b7)]('\x0a'+a26_0x38bf93['dim'](_0xb104aa(0x133))+_0xb104aa(0x201)+_0x389e6f['workflowAttemptId']+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]='segment:parent:fields';['description']=a26_0x80c5cf(0x14d);async['execute'](_0x242482){const _0x45caef=a26_0x80c5cf,{options:_0x47f4a6,args:_0x2d845a,tdx:_0x20367a}=_0x242482,_0x9ac46e=_0x2d845a[0x0]||_0x47f4a6['parentSegment'];if(!_0x9ac46e)return console[_0x45caef(0x1b7)](a26_0x38bf93[_0x45caef(0x1d4)](_0x45caef(0x21f))),console[_0x45caef(0x1b7)](_0x45caef(0x183)),console[_0x45caef(0x1b7)](a26_0x38bf93[_0x45caef(0x1e5)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x47f4a6['verbose']&&(console['error']('Site:\x20'+_0x47f4a6[_0x45caef(0x195)]),console[_0x45caef(0x1b7)](_0x45caef(0x20c)+_0x9ac46e));const _0x4f4a75=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x9ac46e+_0x45caef(0x140),()=>_0x20367a['segment'][_0x45caef(0x16b)](_0x9ac46e),{'verbose':_0x47f4a6[_0x45caef(0x1ef)]}),_0x42736b=_0x4f4a75['data'];console['error']('✔\x20Found\x20'+_0x42736b[_0x45caef(0x12c)]+_0x45caef(0x202)+(_0x42736b[_0x45caef(0x12c)]!==0x1?'s':''));if(_0x47f4a6['json']||_0x47f4a6['jsonl'])return await handleSDKOutput(_0x42736b,_0x47f4a6),0x0;return displayFieldsHumanReadable(_0x42736b,_0x9ac46e),0x0;}}export class ParentSegmentInfoCommand extends BaseCommand{['name']='segment:parent:info';[a26_0x80c5cf(0x1ce)]=a26_0x80c5cf(0x199);async[a26_0x80c5cf(0x157)](_0xb3c17a){const _0x47a035=a26_0x80c5cf,{options:_0x5b7a53,args:_0x451d51,tdx:_0x3cb33f}=_0xb3c17a,_0x87e416=_0x451d51[0x0]||_0x5b7a53[_0x47a035(0x204)];if(!_0x87e416)return console['error'](a26_0x38bf93[_0x47a035(0x1d4)](_0x47a035(0x21f))),console[_0x47a035(0x1b7)]('Usage:\x20tdx\x20ps\x20info\x20[name]\x0a'),console['error'](a26_0x38bf93[_0x47a035(0x1e5)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x5b7a53[_0x47a035(0x1ef)]&&(console[_0x47a035(0x1b7)]('Site:\x20'+_0x5b7a53[_0x47a035(0x195)]),console[_0x47a035(0x1b7)]('Parent\x20segment:\x20'+_0x87e416));const _0x17d162=await withSpinner(_0x47a035(0x1e1)+_0x87e416+_0x47a035(0x140),()=>_0x3cb33f['segment'][_0x47a035(0x12f)](_0x87e416),{'verbose':_0x5b7a53[_0x47a035(0x1ef)]});return await handleSingleObjectOutput(_0x17d162[_0x47a035(0x1b0)],_0x5b7a53),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]=a26_0x80c5cf(0x15b);['description']=a26_0x80c5cf(0x1f5);async[a26_0x80c5cf(0x157)](_0x1a64c2){const _0x51f6f6=a26_0x80c5cf,{options:_0x229b79,args:_0x2bff90,tdx:_0x33d970}=_0x1a64c2,_0x15e9f1=_0x2bff90[0x0]||_0x229b79[_0x51f6f6(0x204)];if(!_0x15e9f1)return console[_0x51f6f6(0x1b7)](a26_0x38bf93[_0x51f6f6(0x1d4)](_0x51f6f6(0x21f))),console['error']('Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a'),console[_0x51f6f6(0x1b7)](a26_0x38bf93[_0x51f6f6(0x1e5)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x229b79[_0x51f6f6(0x1ef)]&&(console[_0x51f6f6(0x1b7)]('Site:\x20'+_0x229b79[_0x51f6f6(0x195)]),console[_0x51f6f6(0x1b7)](_0x51f6f6(0x20c)+_0x15e9f1));const _0x1727a8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x15e9f1+_0x51f6f6(0x140),()=>_0x33d970[_0x51f6f6(0x1d2)][_0x51f6f6(0x168)](_0x15e9f1),{'verbose':_0x229b79[_0x51f6f6(0x1ef)]}),_0x112f71=_0x1727a8['data'],_0x115aa6=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x15e9f1+_0x51f6f6(0x140),()=>_0x33d970[_0x51f6f6(0x1d2)]['getParentSQL'](_0x112f71),{'verbose':_0x229b79['verbose']}),_0x2bb78d=await executeSchemaQuery(_0x115aa6['data'],_0x33d970,_0x229b79);return await handleQueryOutput(_0x2bb78d,_0x229b79),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]=a26_0x80c5cf(0x217);[a26_0x80c5cf(0x1ce)]=a26_0x80c5cf(0x188);async[a26_0x80c5cf(0x157)](_0x2435e5){const _0x2e232f=a26_0x80c5cf,{options:_0x5abd8f,args:_0x432e94,tdx:_0x12ba2d}=_0x2435e5,_0x267a3f=_0x432e94[0x0]||_0x5abd8f['parentSegment'];if(!_0x267a3f)return console['error'](a26_0x38bf93[_0x2e232f(0x1d4)](_0x2e232f(0x21f))),console[_0x2e232f(0x1b7)](_0x2e232f(0x187)),console[_0x2e232f(0x1b7)](a26_0x38bf93['cyan'](_0x2e232f(0x200))),0x1;_0x5abd8f[_0x2e232f(0x1ef)]&&(console[_0x2e232f(0x1b7)](_0x2e232f(0x1ca)+_0x5abd8f[_0x2e232f(0x195)]),console[_0x2e232f(0x1b7)](_0x2e232f(0x20c)+_0x267a3f));const _0x31e525=await withSpinner(_0x2e232f(0x1cc)+_0x267a3f+_0x2e232f(0x140),()=>_0x12ba2d['segment'][_0x2e232f(0x168)](_0x267a3f),{'verbose':_0x5abd8f[_0x2e232f(0x1ef)]}),_0x24b69a=_0x31e525[_0x2e232f(0x1b0)],_0x41ae28=await withSpinner(_0x2e232f(0x1c5)+_0x267a3f+_0x2e232f(0x140),()=>_0x12ba2d['segment'][_0x2e232f(0x1fd)](_0x24b69a),{'verbose':_0x5abd8f[_0x2e232f(0x1ef)]}),_0x3e5ecd=_0x41ae28[_0x2e232f(0x1b0)];return _0x5abd8f[_0x2e232f(0x153)]===_0x2e232f(0x208)||_0x5abd8f['format']===_0x2e232f(0x216)?await handleSDKOutput([{'sql':_0x3e5ecd}],_0x5abd8f):console[_0x2e232f(0x1fe)](_0x3e5ecd),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a26_0x80c5cf(0x12d)]=a26_0x80c5cf(0x151);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a26_0x80c5cf(0x157)](_0x178445){const _0x4a6262=a26_0x80c5cf,{options:_0x3007d1,args:_0x3fa67b,tdx:_0x38920c}=_0x178445,_0x598109=_0x3fa67b[0x0]||_0x3007d1['parentSegment'];if(!_0x598109)return console[_0x4a6262(0x1b7)](a26_0x38bf93[_0x4a6262(0x1d4)](_0x4a6262(0x21f))),console[_0x4a6262(0x1b7)]('Usage:\x20tdx\x20ps\x20show\x20[name]\x0a'),console[_0x4a6262(0x1b7)](a26_0x38bf93[_0x4a6262(0x1e5)](_0x4a6262(0x200))),0x1;_0x3007d1['verbose']&&(console[_0x4a6262(0x1b7)](_0x4a6262(0x1ca)+_0x3007d1[_0x4a6262(0x195)]),console[_0x4a6262(0x1b7)](_0x4a6262(0x20c)+_0x598109));const _0x297f0f=await withSpinner(_0x4a6262(0x1cc)+_0x598109+_0x4a6262(0x140),()=>_0x38920c[_0x4a6262(0x1d2)][_0x4a6262(0x168)](_0x598109),{'verbose':_0x3007d1[_0x4a6262(0x1ef)]}),_0x3a0f90=_0x297f0f['data'],_0x266803=await withSpinner(_0x4a6262(0x1c5)+_0x598109+_0x4a6262(0x140),()=>_0x38920c[_0x4a6262(0x1d2)][_0x4a6262(0x1fd)](_0x3a0f90),{'verbose':_0x3007d1[_0x4a6262(0x1ef)]});let _0x55d11f=_0x266803[_0x4a6262(0x1b0)];const _0x1801d7=resolveLimit(_0x3007d1[_0x4a6262(0x169)],DEFAULT_DISPLAY_LIMIT),_0x1d38f5=/\bLIMIT\s+\d+/i[_0x4a6262(0x147)](_0x55d11f);!_0x1d38f5&&(_0x55d11f=_0x55d11f[_0x4a6262(0x1af)]()['replace'](/;+$/,''),_0x55d11f=_0x4a6262(0x1aa)+_0x55d11f+_0x4a6262(0x1a4)+_0x1801d7);_0x3007d1[_0x4a6262(0x1ef)]&&console['error'](_0x4a6262(0x141)+_0x55d11f);const _0xa03c75=await withQuerySpinner(_0x4a6262(0x1a5),async _0xd9865d=>{const _0x1254ff=_0x4a6262,_0x2a37d3=await _0x38920c[_0x1254ff(0x185)][_0x1254ff(0x157)](_0x55d11f,{'catalog':'td','schema':_0x1254ff(0x15f),'onJobId':_0x13da8c=>{_0xd9865d['setJobId'](_0x13da8c);}});return _0x2a37d3;},{'verbose':_0x3007d1['verbose']}),_0x2f180c=_0xa03c75[_0x4a6262(0x1b0)],_0x53ea10=_0x2f180c[_0x4a6262(0x1e9)]?_0x4a6262(0x19c)+_0x2f180c[_0x4a6262(0x1e9)]+']':'';return console['error'](_0x4a6262(0x13f)+_0x2f180c[_0x4a6262(0x1e0)][_0x4a6262(0x16e)]['toLocaleString']()+_0x4a6262(0x230)+('in\x20'+formatElapsed(_0x2f180c[_0x4a6262(0x1e0)][_0x4a6262(0x12b)])+_0x53ea10)),await handleQueryOutput(_0x2f180c,_0x3007d1),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x29c4ab=a27_0x13f2;(function(_0xd49df2,_0x3619bc){const _0x3a640b=a27_0x13f2,_0x4568a0=_0xd49df2();while(!![]){try{const _0x54119b=-parseInt(_0x3a640b(0x18c))/0x1+parseInt(_0x3a640b(0x18d))/0x2*(parseInt(_0x3a640b(0x18b))/0x3)+-parseInt(_0x3a640b(0x17e))/0x4*(-parseInt(_0x3a640b(0x189))/0x5)+parseInt(_0x3a640b(0x183))/0x6*(-parseInt(_0x3a640b(0x17a))/0x7)+-parseInt(_0x3a640b(0x181))/0x8+-parseInt(_0x3a640b(0x179))/0x9+parseInt(_0x3a640b(0x18a))/0xa*(parseInt(_0x3a640b(0x17b))/0xb);if(_0x54119b===_0x3619bc)break;else _0x4568a0['push'](_0x4568a0['shift']());}catch(_0x1c0402){_0x4568a0['push'](_0x4568a0['shift']());}}}(a27_0x4229,0x8fd55));import{BaseCommand}from'./command.js';function a27_0x4229(){const _0x1d784f=['331285LBtFEE','2uwZiRe','description','scope','List\x20all\x20available\x20profiles','Error:\x20','3679938wNosTE','7UxRHPI','45837sdDStP','length','execute','72840jyiOeQ','\x20\x20Global:\x20~/.config/tdx/tdx.json','profiles','1306912pyEGfm','message','3793866XQEJPt','name','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','config','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','log','125wooHGy','2820GeFHBs','1483917xlyXMJ'];a27_0x4229=function(){return _0x1d784f;};return a27_0x4229();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x13f2(_0x5d4a42,_0x6f568){const _0x4229ac=a27_0x4229();return a27_0x13f2=function(_0x13f257,_0x187939){_0x13f257=_0x13f257-0x177;let _0x154ac7=_0x4229ac[_0x13f257];return _0x154ac7;},a27_0x13f2(_0x5d4a42,_0x6f568);}export class ProfilesCommand extends BaseCommand{[a27_0x29c4ab(0x184)]=a27_0x29c4ab(0x180);[a27_0x29c4ab(0x18e)]=a27_0x29c4ab(0x177);async[a27_0x29c4ab(0x17d)](_0x2d7112){const _0x76a34b=a27_0x29c4ab,{options:_0xc81bf8}=_0x2d7112;try{const _0x559466=listProfiles(),_0x3ed070=getActiveProfile();if(_0x559466[_0x76a34b(0x17c)]===0x0)return console[_0x76a34b(0x188)](_0x76a34b(0x187)),console['log'](_0x76a34b(0x185)),console[_0x76a34b(0x188)](_0x76a34b(0x17f)),0x0;const _0x26263c=_0x559466['map'](_0x145c78=>{const _0x308a19=_0x76a34b,_0x1e7990=_0x145c78[_0x308a19(0x184)]===_0x3ed070,_0x1ddbdc=getProfileParams(_0x145c78[_0x308a19(0x186)]);return{'name':_0x145c78[_0x308a19(0x184)],'active':_0x1e7990,'scope':_0x145c78[_0x308a19(0x18f)],'description':_0x145c78[_0x308a19(0x186)][_0x308a19(0x18e)]||'','params':_0x1ddbdc};});return await handleSDKOutput(_0x26263c,_0xc81bf8),0x0;}catch(_0x6631b6){return _0x6631b6 instanceof Error&&console['error'](_0x76a34b(0x178)+_0x6631b6[_0x76a34b(0x182)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x531931=a28_0x723d;function a28_0x723d(_0x22bd9b,_0x24c578){const _0x589e4b=a28_0x589e();return a28_0x723d=function(_0x723d9f,_0x36ab82){_0x723d9f=_0x723d9f-0x1c4;let _0x1a6cd1=_0x589e4b[_0x723d9f];return _0x1a6cd1;},a28_0x723d(_0x22bd9b,_0x24c578);}function a28_0x589e(){const _0x5a5e43=['Executing\x20query\x20[','output','stats','database','Executing\x20query...','Query\x20completed:\x20Processed\x20','Run\x20Trino\x20queries\x20(streaming)','name','1927422SrNHde','\x20[Job\x20ID:\x20','site','1356IZmZjb','12kOWFWW','setPhase','validate','setExtra','SQL:\x20','data','17888882qwyYRf','Statement\x20','join','completedSplits','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','catalog','error','Error:\x20','jobId','query','Executing\x20statement\x20','Site:\x20','\x0aAll\x20results\x20saved\x20to\x20','8ptEYWi','10wvkjJW','2569278bkiTFT','10445ERswOj','state','totalSplits','145064QJXLOA','args','information_schema','length','processedRows','verbose','\x20rows\x20','setJobId','file','...','options','push','9556479bMTHSh','execute','7643440VaTfDf','\x20-\x20','elapsedTimeMillis','message','description'];a28_0x589e=function(){return _0x5a5e43;};return a28_0x589e();}(function(_0x46199c,_0xec8e4){const _0xd5bf19=a28_0x723d,_0x53a90c=_0x46199c();while(!![]){try{const _0xbc0174=-parseInt(_0xd5bf19(0x1e2))/0x1*(-parseInt(_0xd5bf19(0x1e8))/0x2)+parseInt(_0xd5bf19(0x1e4))/0x3+-parseInt(_0xd5bf19(0x1ce))/0x4*(parseInt(_0xd5bf19(0x1e5))/0x5)+-parseInt(_0xd5bf19(0x1cf))/0x6*(parseInt(_0xd5bf19(0x1cb))/0x7)+parseInt(_0xd5bf19(0x1f6))/0x8+parseInt(_0xd5bf19(0x1f4))/0x9*(parseInt(_0xd5bf19(0x1e3))/0xa)+-parseInt(_0xd5bf19(0x1d5))/0xb;if(_0xbc0174===_0xec8e4)break;else _0x53a90c['push'](_0x53a90c['shift']());}catch(_0x274310){_0x53a90c['push'](_0x53a90c['shift']());}}}(a28_0x589e,0x8adf2));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';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a28_0x531931(0x1ca)]=a28_0x531931(0x1de);[a28_0x531931(0x1fa)]=a28_0x531931(0x1c9);async[a28_0x531931(0x1f5)](_0x1444cc){const _0xf4d115=a28_0x531931,{options:_0x37e110,args:_0x20a039,tdx:_0x26a64f}=_0x1444cc,_0x42418=_0x20a039[0x0],_0x22e59e=_0x37e110[_0xf4d115(0x1f0)];let _0x353208;if(_0x22e59e)try{_0x353208=readSqlStatementsFromFile(_0x22e59e);}catch(_0x2f4c70){return console[_0xf4d115(0x1db)]('Error:\x20'+_0x2f4c70[_0xf4d115(0x1f9)]),0x1;}else try{_0x353208=splitSqlStatements(_0x42418);}catch(_0x2debc2){return console['error'](_0xf4d115(0x1dc)+_0x2debc2[_0xf4d115(0x1f9)]),0x1;}const _0x249f7b=_0x37e110[_0xf4d115(0x1c6)]||_0xf4d115(0x1ea),_0x1bdc6d=_0x37e110[_0xf4d115(0x1da)];try{const _0x28a525=[],_0x46545a=!!_0x37e110[_0xf4d115(0x1c4)];for(let _0x4765f5=0x0;_0x4765f5<_0x353208['length'];_0x4765f5++){const _0x483a06=_0x353208[_0x4765f5],_0x47c93a=_0x4765f5+0x1,_0x859b0a=_0x353208[_0xf4d115(0x1eb)],_0x5ac276=_0x859b0a>0x1;_0x37e110[_0xf4d115(0x1ed)]&&(console[_0xf4d115(0x1db)]('\x0a'+(_0x5ac276?'Statement\x20'+_0x47c93a+'/'+_0x859b0a+':':'')),console[_0xf4d115(0x1db)](_0xf4d115(0x1e0)+_0x37e110[_0xf4d115(0x1cd)]),console['error']('Catalog:\x20'+(_0x1bdc6d||'td')),console['error']('Schema:\x20'+_0x249f7b),console[_0xf4d115(0x1db)](_0xf4d115(0x1d3)+_0x483a06));const _0x44c00a=_0x5ac276?_0xf4d115(0x1df)+_0x47c93a+'/'+_0x859b0a+_0xf4d115(0x1f1):_0xf4d115(0x1c7);try{const _0x1100b1=await withQuerySpinner(_0x44c00a,async _0x729f77=>{const _0x5d3379=_0xf4d115,_0x581cbc=await _0x26a64f[_0x5d3379(0x1de)]['execute'](_0x483a06,{'catalog':_0x1bdc6d,'schema':_0x249f7b,'onJobId':_0x577c28=>{const _0x5ab664=_0x5d3379;_0x729f77[_0x5ab664(0x1ef)](_0x577c28);},'onProgress':_0x1c55db=>{const _0x15f418=_0x5d3379;_0x729f77[_0x15f418(0x1d0)](_0x15f418(0x1fb)+_0x1c55db[_0x15f418(0x1e6)]+']'),_0x729f77[_0x15f418(0x1d2)](formatRows(_0x1c55db[_0x15f418(0x1ec)])+_0x15f418(0x1ee)+_0x1c55db[_0x15f418(0x1d8)]+'/'+_0x1c55db[_0x15f418(0x1e7)]+'\x20splits');}});return _0x581cbc;},{'verbose':_0x37e110['verbose']}),_0x17f40b=_0x1100b1[_0xf4d115(0x1d4)],_0x1e8f25=_0x17f40b[_0xf4d115(0x1dd)]?_0xf4d115(0x1cc)+_0x17f40b[_0xf4d115(0x1dd)]+']':'',_0x58fb9b=_0x5ac276?_0xf4d115(0x1d6)+_0x47c93a+'/'+_0x859b0a+_0xf4d115(0x1f7):'';console[_0xf4d115(0x1db)]('✔\x20'+_0x58fb9b+_0xf4d115(0x1c8)+formatRows(_0x17f40b[_0xf4d115(0x1c5)][_0xf4d115(0x1ec)])+_0xf4d115(0x1ee)+('in\x20'+formatElapsed(_0x17f40b['stats'][_0xf4d115(0x1f8)])+_0x1e8f25));if(_0x5ac276&&_0x46545a){const _0x327798=resolveOutputOptions(_0x37e110),_0x584284=await formatQueryOutput(_0x17f40b,_0x327798);_0x28a525[_0xf4d115(0x1f3)](_0x584284);}else await handleQueryOutput(_0x17f40b,_0x37e110);}catch(_0x505486){const _0x1d97b1=_0x5ac276?_0xf4d115(0x1d6)+_0x47c93a+'/'+_0x859b0a+':\x0a':'',_0x23a803=_0x505486 instanceof SDKError?_0x505486['originalMessage']:_0x505486['message'];return console['error'](''+_0x1d97b1+_0x23a803),0x1;}}if(_0x353208[_0xf4d115(0x1eb)]>0x1&&_0x46545a&&_0x28a525[_0xf4d115(0x1eb)]>0x0){const _0x1bff83=_0x28a525[_0xf4d115(0x1d7)]('\x0a');writeFileSync(_0x37e110[_0xf4d115(0x1c4)],_0x1bff83),console[_0xf4d115(0x1db)](_0xf4d115(0x1e1)+_0x37e110['output']);}return 0x0;}catch(_0x1bd9aa){throw _0x1bd9aa;}}[a28_0x531931(0x1d1)](_0x180ae1){const _0x380fe1=a28_0x531931,_0x336bdf=_0x180ae1[_0x380fe1(0x1e9)][0x0],_0x462676=_0x180ae1[_0x380fe1(0x1f2)]['file'];if(!_0x336bdf&&!_0x462676)return'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';if(_0x336bdf&&_0x462676)return _0x380fe1(0x1d9);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x45cd8a=a29_0x59de;(function(_0x452feb,_0x49fc91){const _0x4dadac=a29_0x59de,_0x19b8eb=_0x452feb();while(!![]){try{const _0x24f347=-parseInt(_0x4dadac(0xed))/0x1+-parseInt(_0x4dadac(0x15f))/0x2+-parseInt(_0x4dadac(0x164))/0x3*(parseInt(_0x4dadac(0x14e))/0x4)+parseInt(_0x4dadac(0x134))/0x5*(parseInt(_0x4dadac(0xfd))/0x6)+parseInt(_0x4dadac(0x173))/0x7*(-parseInt(_0x4dadac(0x103))/0x8)+parseInt(_0x4dadac(0x12b))/0x9*(-parseInt(_0x4dadac(0x147))/0xa)+parseInt(_0x4dadac(0x154))/0xb*(parseInt(_0x4dadac(0xef))/0xc);if(_0x24f347===_0x49fc91)break;else _0x19b8eb['push'](_0x19b8eb['shift']());}catch(_0x13412f){_0x19b8eb['push'](_0x19b8eb['shift']());}}}(a29_0x943a,0xf0f05));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a29_0x59de(_0x5e1677,_0x52c526){const _0x943a50=a29_0x943a();return a29_0x59de=function(_0x59ded4,_0x4a31ad){_0x59ded4=_0x59ded4-0xec;let _0x17e9b7=_0x943a50[_0x59ded4];return _0x17e9b7;},a29_0x59de(_0x5e1677,_0x52c526);}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';export class SegmentDescribeCommand extends BaseCommand{[a29_0x45cd8a(0x126)]=a29_0x45cd8a(0x129);[a29_0x45cd8a(0xfc)]='Show\x20segment\x20or\x20folder\x20details';async[a29_0x45cd8a(0x12a)](_0x4ed681){const _0x328020=a29_0x45cd8a,{options:_0x1bdd6f,args:_0x124213,tdx:_0x45461c}=_0x4ed681,_0x33219e=_0x124213[0x0],_0x1a6bc3=!_0x33219e&&!!_0x1bdd6f[_0x328020(0x114)],_0x5c8d3e=_0x33219e||_0x1bdd6f[_0x328020(0x114)];if(!_0x5c8d3e)return console[_0x328020(0x16c)](_0x328020(0x14d)),console[_0x328020(0x16c)](_0x328020(0x171)),console[_0x328020(0x16c)](_0x328020(0xee)),console[_0x328020(0x16c)](_0x328020(0x132)),console[_0x328020(0x16c)](_0x328020(0x169)),console[_0x328020(0x16c)](_0x328020(0x106)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x133c2d=_0x1bdd6f[_0x328020(0x120)];let _0x12dc84=_0x5c8d3e;!_0x1a6bc3&&_0x133c2d&&!_0x5c8d3e['includes']('/')&&(_0x12dc84=_0x133c2d+'/'+_0x5c8d3e,_0x1bdd6f[_0x328020(0xf8)]&&console[_0x328020(0x16c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x12dc84));const _0x5462d0=await withSpinner('Resolving\x20path\x20\x27'+_0x12dc84+_0x328020(0x131),()=>_0x45461c[_0x328020(0x145)][_0x328020(0xfa)](_0x12dc84),{'verbose':_0x1bdd6f['verbose']}),_0x48cec5=_0x5462d0['data'];_0x1bdd6f[_0x328020(0xf8)]&&(console[_0x328020(0x16c)]('Resolved\x20type:\x20'+_0x48cec5[_0x328020(0x11c)]),console['error'](_0x328020(0x16d)+_0x48cec5[_0x328020(0x123)]),_0x48cec5[_0x328020(0x136)]&&console[_0x328020(0x16c)]('Folder\x20ID:\x20'+_0x48cec5[_0x328020(0x136)]),_0x48cec5['segmentId']&&console[_0x328020(0x16c)](_0x328020(0x140)+_0x48cec5[_0x328020(0x170)]));if(_0x48cec5[_0x328020(0x11c)]===_0x328020(0x165)){const _0x4ed237=await withSpinner(_0x328020(0x166),()=>_0x45461c[_0x328020(0x145)][_0x328020(0x13e)](_0x48cec5['parentId']),{'verbose':_0x1bdd6f[_0x328020(0xf8)]});await handleSingleObjectOutput(_0x4ed237['data'],_0x1bdd6f);}else{if(_0x48cec5[_0x328020(0x11c)]===_0x328020(0x101)){if(!_0x48cec5[_0x328020(0x136)])throw new SDKError(ErrorCode[_0x328020(0xf4)],_0x328020(0x10a));const _0x3675c4=await withSpinner(_0x328020(0x150),()=>_0x45461c[_0x328020(0x145)][_0x328020(0x111)](_0x48cec5[_0x328020(0x136)]),{'verbose':_0x1bdd6f[_0x328020(0xf8)]});await handleSingleObjectOutput(_0x3675c4[_0x328020(0x117)],_0x1bdd6f);}else{if(_0x48cec5['type']===_0x328020(0x145)){if(!_0x48cec5[_0x328020(0x170)])throw new SDKError(ErrorCode[_0x328020(0xf4)],_0x328020(0x155));const _0x3a3206=await withSpinner(_0x328020(0x128),()=>_0x45461c[_0x328020(0x145)][_0x328020(0x119)](_0x48cec5[_0x328020(0x123)],_0x48cec5[_0x328020(0x170)]),{'verbose':_0x1bdd6f['verbose']});await handleSingleObjectOutput(_0x3a3206['data'],_0x1bdd6f);}}}return 0x0;}catch(_0xff46b0){if(_0xff46b0 instanceof SDKError)return console[_0x328020(0x16c)](_0x328020(0x10c)+_0xff46b0[_0x328020(0x11a)]),_0xff46b0['cause']&&console[_0x328020(0x16c)]('\x20\x20Cause:\x20'+_0xff46b0['cause']),0x1;throw _0xff46b0;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a29_0x45cd8a(0xfc)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a29_0x45cd8a(0x12a)](_0x25b827){const _0x4cb9b1=a29_0x45cd8a,{options:_0x12d5a8,args:_0x496537,tdx:_0x130432}=_0x25b827,_0x55b055=_0x496537[0x0],_0x313179=!_0x55b055&&!!_0x12d5a8['parentSegment'],_0x2a6c7e=_0x55b055||_0x12d5a8['parentSegment'];if(!_0x2a6c7e)return console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x15d)),console[_0x4cb9b1(0x16c)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x107)),console['error'](_0x4cb9b1(0x116)),console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x12e)),0x1;try{const _0x24c9d5=_0x12d5a8[_0x4cb9b1(0x120)];let _0x297fd7=_0x2a6c7e;!_0x313179&&_0x24c9d5&&!_0x2a6c7e[_0x4cb9b1(0x130)]('/')&&(_0x297fd7=_0x24c9d5+'/'+_0x2a6c7e,_0x12d5a8[_0x4cb9b1(0xf8)]&&console[_0x4cb9b1(0x16c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x297fd7));const _0x31cf71=await withSpinner(_0x4cb9b1(0x13f)+_0x297fd7+_0x4cb9b1(0x131),()=>_0x130432['segment'][_0x4cb9b1(0xfa)](_0x297fd7),{'verbose':_0x12d5a8['verbose']}),_0x8371f0=_0x31cf71['data'];_0x12d5a8[_0x4cb9b1(0xf8)]&&(console['error'](_0x4cb9b1(0x109)+_0x8371f0[_0x4cb9b1(0x11c)]),console['error'](_0x4cb9b1(0x16d)+_0x8371f0[_0x4cb9b1(0x123)]));if(_0x8371f0[_0x4cb9b1(0x11c)]==='folder')return console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x135)),console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x104)),0x1;let _0x2baa4c;if(_0x8371f0[_0x4cb9b1(0x11c)]===_0x4cb9b1(0x165)){const _0x194273=await withSpinner(_0x4cb9b1(0x15a),()=>_0x130432[_0x4cb9b1(0x145)][_0x4cb9b1(0x143)](_0x8371f0[_0x4cb9b1(0x123)]),{'verbose':_0x12d5a8['verbose']});_0x2baa4c=_0x194273[_0x4cb9b1(0x117)];}else{if(!_0x8371f0['segmentId'])throw new SDKError(ErrorCode[_0x4cb9b1(0xf4)],_0x4cb9b1(0x155));const _0x12957a=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x130432[_0x4cb9b1(0x145)][_0x4cb9b1(0x14c)](_0x8371f0[_0x4cb9b1(0x123)],_0x8371f0['segmentId']),{'verbose':_0x12d5a8[_0x4cb9b1(0xf8)]});_0x2baa4c=_0x12957a[_0x4cb9b1(0x117)];}const _0xcc82d0=resolveLimit(_0x12d5a8[_0x4cb9b1(0x10d)],DEFAULT_DISPLAY_LIMIT),_0x17c49d=/\bLIMIT\s+\d+/i[_0x4cb9b1(0x105)](_0x2baa4c);!_0x17c49d&&(_0x2baa4c=_0x2baa4c[_0x4cb9b1(0x10f)]()[_0x4cb9b1(0x162)](/;+$/,''),_0x2baa4c=_0x4cb9b1(0x172)+_0x2baa4c+_0x4cb9b1(0x11d)+_0xcc82d0);_0x12d5a8['verbose']&&console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x14f)+_0x2baa4c);const _0x18fc3d=await withQuerySpinner(_0x4cb9b1(0x12d),async _0x48c376=>{const _0x1695ac=_0x4cb9b1,_0x241da2=await _0x130432['query'][_0x1695ac(0x12a)](_0x2baa4c,{'catalog':'td','schema':_0x1695ac(0x15c),'onJobId':_0x1e00af=>{const _0x3dcd1c=_0x1695ac;_0x48c376[_0x3dcd1c(0x11f)](_0x1e00af);}});return _0x241da2;},{'verbose':_0x12d5a8[_0x4cb9b1(0xf8)]}),_0x187a07=_0x18fc3d['data'],_0x2e3f13=_0x187a07[_0x4cb9b1(0x13a)]?_0x4cb9b1(0x133)+_0x187a07['jobId']+']':'';return console[_0x4cb9b1(0x16c)](_0x4cb9b1(0xf0)+_0x187a07[_0x4cb9b1(0x12c)][_0x4cb9b1(0x138)][_0x4cb9b1(0x100)]()+_0x4cb9b1(0x141)+('in\x20'+formatElapsed(_0x187a07[_0x4cb9b1(0x12c)][_0x4cb9b1(0x16f)])+_0x2e3f13)),await handleQueryOutput(_0x187a07,_0x12d5a8),0x0;}catch(_0x2b013b){if(_0x2b013b instanceof SDKError)return console[_0x4cb9b1(0x16c)](_0x4cb9b1(0x149)+_0x2b013b[_0x4cb9b1(0x113)]+']'),console['error']('\x0a'+_0x2b013b[_0x4cb9b1(0x11a)]),0x1;throw _0x2b013b;}}}function a29_0x943a(){const _0x28fb9a=['\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20desc\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segment:info','\x20\x20Cause:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','information_schema','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20segment:\x20','3060170hJLmJQ','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','replace','\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience/Marketing/High\x20Value\x22','108AVvlRg','parent','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','parentFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20desc\x20<path>','error','Parent\x20ID:\x20','Show\x20segment\x20schema\x20(column\x20types)','elapsedTimeMillis','segmentId','Usage:\x20tdx\x20segment\x20describe\x20<path>','SELECT\x20*\x20FROM\x20(\x0a','240023gSsyuE','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','1839121fHxghI','Examples:','61357920qmvmAN','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folder\x20name:\x20','Create\x20segment\x20folder\x20for\x20organization','INTERNAL','Error:\x20Folder\x20reference\x20is\x20required','jsonl','resolveFolderId','verbose','\x20folder','resolvePathToResource','Show\x20segment\x20folder\x20details','description','12DbOymk','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','toLocaleString','folder','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','104FLWvWd','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','test','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20folder\x20\x27','Resolved\x20type:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20SQL\x20for\x20segment...','Error:\x20','limit','resolveParentId','trim','cause','getFolder','segment:desc','code','parentSegment','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','data','Resolved\x20parent\x20folder\x20ID:\x20','getSegment','message','Creating\x20folder\x20\x27','type','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segment:sql','setJobId','segmentPath','Site:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','parentId','Parent\x20name:\x20','Show\x20segment\x20or\x20folder\x20details','name','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20segment\x20details...','segment:describe','execute','657WbucvF','stats','Executing\x20segment\x20query...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','json','includes','\x27...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20[Job\x20ID:\x20','3051260KZlfVF','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','folderId','site','processedRows','createFolder','jobId','✔\x20Created\x20folder\x20\x27','length','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','getParent','Resolving\x20path\x20\x27','Segment\x20ID:\x20','\x20rows\x20','✔\x20Found\x20','getParentSQL','Resolved\x20relative\x20path\x20to:\x20','segment','log','200680bfVzjC','\x20\x20tdx\x20segment\x20info\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','✖\x20Query\x20failed\x20[','segment:folder:list','Resolving\x20parent\x20segment\x20\x27','getSegmentSQL','Error:\x20Path\x20or\x20name\x20is\x20required','7428CVPfVz','SQL\x20query:\x0a','Fetching\x20folder\x20details...','format','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20info\x20<path>','11XwjePV','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a29_0x943a=function(){return _0x28fb9a;};return a29_0x943a();}export class SegmentFolderListCommand extends BaseCommand{['name']=a29_0x45cd8a(0x14a);[a29_0x45cd8a(0xfc)]=a29_0x45cd8a(0x115);async['execute'](_0x82a3a7){const _0x30b3c5=a29_0x45cd8a,{options:_0x3cfdea,args:_0x37452b,tdx:_0x4696fe}=_0x82a3a7;if(_0x37452b[_0x30b3c5(0x13c)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x30b3c5(0x16c)](_0x30b3c5(0x167)),0x1;const _0xfe8f00=_0x37452b[0x0];try{_0x3cfdea['verbose']&&(console[_0x30b3c5(0x16c)](_0x30b3c5(0x121)+_0x3cfdea[_0x30b3c5(0x137)]),console[_0x30b3c5(0x16c)]('Parent\x20name:\x20'+_0xfe8f00));const _0x2201b6=await withSpinner(_0x30b3c5(0x14b)+_0xfe8f00+'\x27...',()=>_0x4696fe[_0x30b3c5(0x145)][_0x30b3c5(0x10e)](_0xfe8f00),{'verbose':_0x3cfdea[_0x30b3c5(0xf8)]}),_0x5ef391=_0x2201b6['data'];_0x3cfdea[_0x30b3c5(0xf8)]&&console[_0x30b3c5(0x16c)](_0x30b3c5(0x16a)+_0x5ef391);const _0x5dfda2=await withSpinner(_0x30b3c5(0x160)+_0xfe8f00+_0x30b3c5(0x131),()=>_0x4696fe[_0x30b3c5(0x145)]['listFolders'](_0x5ef391),{'verbose':_0x3cfdea[_0x30b3c5(0xf8)]}),_0x2c21c4=_0x5dfda2[_0x30b3c5(0x117)];return console[_0x30b3c5(0x16c)](_0x30b3c5(0x142)+_0x2c21c4['length']+_0x30b3c5(0xf9)+(_0x2c21c4['length']!==0x1?'s':'')),await handleSDKOutput(_0x2c21c4,_0x3cfdea),0x0;}catch(_0x229205){if(_0x229205 instanceof SDKError)return console[_0x30b3c5(0x16c)]('Error:\x20'+_0x229205['message']),_0x229205[_0x30b3c5(0x110)]&&console[_0x30b3c5(0x16c)]('\x20\x20Cause:\x20'+_0x229205['cause']),0x1;throw _0x229205;}}}export class SegmentFolderShowCommand extends BaseCommand{[a29_0x45cd8a(0x126)]='segment:folder:show';['description']=a29_0x45cd8a(0xfb);async[a29_0x45cd8a(0x12a)](_0x20af7e){const _0x3d6a95=a29_0x45cd8a,{options:_0x2950d3,args:_0x3ad169,tdx:_0x1443fd}=_0x20af7e;if(_0x3ad169[_0x3d6a95(0x13c)]===0x0)return console[_0x3d6a95(0x16c)](_0x3d6a95(0xf5)),console[_0x3d6a95(0x16c)](_0x3d6a95(0x102)),0x1;try{const {parentId:_0x3bed22,childId:_0x1a3d4b}=parseSegmentRef(_0x3ad169[0x0]);_0x2950d3[_0x3d6a95(0xf8)]&&(console[_0x3d6a95(0x16c)](_0x3d6a95(0x121)+_0x2950d3[_0x3d6a95(0x137)]),console[_0x3d6a95(0x16c)](_0x3d6a95(0x124)+_0x3bed22),_0x1a3d4b&&console[_0x3d6a95(0x16c)](_0x3d6a95(0xf2)+_0x1a3d4b));if(!_0x1a3d4b)return console['error'](_0x3d6a95(0x122)),0x1;const _0x3fcde2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3bed22+_0x3d6a95(0x131),()=>_0x1443fd['segment'][_0x3d6a95(0x10e)](_0x3bed22),{'verbose':_0x2950d3[_0x3d6a95(0xf8)]}),_0x6eb750=_0x3fcde2[_0x3d6a95(0x117)];_0x2950d3['verbose']&&console[_0x3d6a95(0x16c)](_0x3d6a95(0x16a)+_0x6eb750);const _0x4b2c90=await withSpinner('Resolving\x20folder\x20\x27'+_0x1a3d4b+_0x3d6a95(0x131),()=>_0x1443fd['segment']['resolveFolderId'](_0x6eb750,_0x1a3d4b),{'verbose':_0x2950d3[_0x3d6a95(0xf8)]}),_0x1122b6=_0x4b2c90[_0x3d6a95(0x117)];_0x2950d3[_0x3d6a95(0xf8)]&&console[_0x3d6a95(0x16c)](_0x3d6a95(0x152)+_0x1122b6);const _0x2bfdd1=await withSpinner(_0x3d6a95(0x108)+_0x1a3d4b+'\x27...',()=>_0x1443fd['segment']['getFolder'](_0x1122b6),{'verbose':_0x2950d3[_0x3d6a95(0xf8)]});return await handleSDKOutput([_0x2bfdd1[_0x3d6a95(0x117)]],_0x2950d3),0x0;}catch(_0x1c36a6){if(_0x1c36a6 instanceof SDKError)return console[_0x3d6a95(0x16c)](_0x3d6a95(0x10c)+_0x1c36a6[_0x3d6a95(0x11a)]),_0x1c36a6[_0x3d6a95(0x110)]&&console[_0x3d6a95(0x16c)](_0x3d6a95(0x159)+_0x1c36a6[_0x3d6a95(0x110)]),0x1;throw _0x1c36a6;}}}export class SegmentSQLCommand extends BaseCommand{[a29_0x45cd8a(0x126)]=a29_0x45cd8a(0x11e);['description']=a29_0x45cd8a(0x15b);async[a29_0x45cd8a(0x12a)](_0x5d2097){const _0x39ac96=a29_0x45cd8a,{options:_0x2dfdd9,args:_0x1e7096,tdx:_0x3ee80a}=_0x5d2097,_0x5d4a09=_0x1e7096[0x0],_0x37abe4=!_0x5d4a09&&!!_0x2dfdd9['parentSegment'],_0x371c79=_0x5d4a09||_0x2dfdd9['parentSegment'];if(!_0x371c79)return console[_0x39ac96(0x16c)](_0x39ac96(0x15d)),console[_0x39ac96(0x16c)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x39ac96(0x16c)](_0x39ac96(0xee)),console[_0x39ac96(0x16c)](_0x39ac96(0x13d)),console[_0x39ac96(0x16c)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x39ac96(0x16c)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x39ac96(0x16c)](_0x39ac96(0x12e)),0x1;try{const _0x262018=_0x2dfdd9[_0x39ac96(0x120)];let _0x43fdf0=_0x371c79;!_0x37abe4&&_0x262018&&!_0x371c79['includes']('/')&&(_0x43fdf0=_0x262018+'/'+_0x371c79,_0x2dfdd9['verbose']&&console[_0x39ac96(0x16c)](_0x39ac96(0x144)+_0x43fdf0));const _0x101847=await withSpinner(_0x39ac96(0x13f)+_0x43fdf0+_0x39ac96(0x131),()=>_0x3ee80a['segment'][_0x39ac96(0xfa)](_0x43fdf0),{'verbose':_0x2dfdd9[_0x39ac96(0xf8)]}),_0x127d65=_0x101847['data'];_0x2dfdd9[_0x39ac96(0xf8)]&&(console[_0x39ac96(0x16c)](_0x39ac96(0x109)+_0x127d65[_0x39ac96(0x11c)]),console[_0x39ac96(0x16c)]('Parent\x20ID:\x20'+_0x127d65['parentId']));if(_0x127d65[_0x39ac96(0x11c)]===_0x39ac96(0x101))return console['error'](_0x39ac96(0x161)),console[_0x39ac96(0x16c)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x571819;if(_0x127d65['type']===_0x39ac96(0x165)){const _0x17ed44=await withSpinner(_0x39ac96(0x15a),()=>_0x3ee80a[_0x39ac96(0x145)][_0x39ac96(0x143)](_0x127d65['parentId']),{'verbose':_0x2dfdd9['verbose']});_0x571819=_0x17ed44[_0x39ac96(0x117)];}else{if(!_0x127d65['segmentId'])throw new SDKError(ErrorCode[_0x39ac96(0xf4)],_0x39ac96(0x155));const _0x16d0ea=await withSpinner(_0x39ac96(0x10b),()=>_0x3ee80a['segment'][_0x39ac96(0x14c)](_0x127d65['parentId'],_0x127d65[_0x39ac96(0x170)]),{'verbose':_0x2dfdd9['verbose']});_0x571819=_0x16d0ea[_0x39ac96(0x117)];}return _0x2dfdd9[_0x39ac96(0x151)]===_0x39ac96(0x12f)||_0x2dfdd9[_0x39ac96(0x151)]===_0x39ac96(0xf6)?await handleSDKOutput([{'sql':_0x571819}],_0x2dfdd9):console[_0x39ac96(0x146)](_0x571819),0x0;}catch(_0x54400f){if(_0x54400f instanceof SDKError)return console[_0x39ac96(0x16c)]('Error:\x20'+_0x54400f[_0x39ac96(0x11a)]),_0x54400f[_0x39ac96(0x110)]&&console[_0x39ac96(0x16c)](_0x39ac96(0x159)+_0x54400f['cause']),0x1;throw _0x54400f;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a29_0x45cd8a(0x126)]='segment:folder:create';[a29_0x45cd8a(0xfc)]=a29_0x45cd8a(0xf3);async[a29_0x45cd8a(0x12a)](_0x4bef1e){const _0x1a8cab=a29_0x45cd8a,{options:_0x1d2ce3,args:_0x49d2c1,tdx:_0x7296f6}=_0x4bef1e,_0x7c5ded=_0x1d2ce3;if(_0x49d2c1[_0x1a8cab(0x13c)]<0x2)return console[_0x1a8cab(0x16c)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1a8cab(0x16c)](_0x1a8cab(0xec)),0x1;const _0x52ac0e=_0x49d2c1[0x0],_0x187c33=_0x49d2c1[0x1];_0x7c5ded['verbose']&&(console[_0x1a8cab(0x16c)](_0x1a8cab(0x121)+_0x7c5ded['site']),console['error'](_0x1a8cab(0x15e)+_0x52ac0e),console[_0x1a8cab(0x16c)](_0x1a8cab(0xf2)+_0x187c33));let _0x4f0a12;if(_0x7c5ded[_0x1a8cab(0x168)]){const _0x130b22=_0x7c5ded[_0x1a8cab(0x168)],_0x43ee75=await withSpinner(_0x1a8cab(0x14b)+_0x52ac0e+'\x27...',()=>_0x7296f6['segment'][_0x1a8cab(0x10e)](_0x52ac0e),{'verbose':_0x7c5ded[_0x1a8cab(0xf8)]}),_0x58993a=_0x43ee75[_0x1a8cab(0x117)],_0x1c5573=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x130b22+'\x27...',()=>_0x7296f6[_0x1a8cab(0x145)][_0x1a8cab(0xf7)](_0x58993a,_0x130b22),{'verbose':_0x7c5ded['verbose']});_0x4f0a12=_0x1c5573[_0x1a8cab(0x117)],_0x7c5ded[_0x1a8cab(0xf8)]&&console[_0x1a8cab(0x16c)](_0x1a8cab(0x118)+_0x4f0a12);}const _0xed5551={'name':_0x187c33,'description':_0x7c5ded[_0x1a8cab(0xfc)],'parentFolderId':_0x4f0a12},_0x48bd31=await withSpinner(_0x1a8cab(0x11b)+_0x187c33+'\x27...',()=>_0x7296f6[_0x1a8cab(0x145)][_0x1a8cab(0x139)](_0x52ac0e,_0xed5551),{'verbose':_0x7c5ded[_0x1a8cab(0xf8)]}),_0x3eca21=_0x48bd31['data'];return console['error'](_0x1a8cab(0x13b)+_0x3eca21[_0x1a8cab(0x126)]+_0x1a8cab(0xfe)+_0x3eca21['id']),await handleSDKOutput([_0x3eca21],_0x7c5ded),0x0;}}export class SegmentInfoCommand extends BaseCommand{[a29_0x45cd8a(0x126)]=a29_0x45cd8a(0x158);[a29_0x45cd8a(0xfc)]=a29_0x45cd8a(0x125);async['execute'](_0x169e5b){const _0x2f40e9=a29_0x45cd8a,{options:_0x1d2acc,args:_0x53c00b,tdx:_0x3b8378}=_0x169e5b,_0x284025=_0x53c00b[0x0],_0x68bdf3=!_0x284025&&!!_0x1d2acc[_0x2f40e9(0x114)],_0x4ed0d2=_0x284025||_0x1d2acc[_0x2f40e9(0x114)];if(!_0x4ed0d2)return console[_0x2f40e9(0x16c)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x2f40e9(0x16c)](_0x2f40e9(0x153)),console[_0x2f40e9(0x16c)](_0x2f40e9(0xee)),console[_0x2f40e9(0x16c)](_0x2f40e9(0x156)),console['error'](_0x2f40e9(0x163)),console[_0x2f40e9(0x16c)](_0x2f40e9(0x148)),console['error'](_0x2f40e9(0x12e)),0x1;try{const _0x469841=_0x1d2acc[_0x2f40e9(0x120)];let _0xdd12fe=_0x4ed0d2;!_0x68bdf3&&_0x469841&&!_0x4ed0d2[_0x2f40e9(0x130)]('/')&&(_0xdd12fe=_0x469841+'/'+_0x4ed0d2,_0x1d2acc[_0x2f40e9(0xf8)]&&console[_0x2f40e9(0x16c)](_0x2f40e9(0x144)+_0xdd12fe));const _0x36b6b7=await withSpinner(_0x2f40e9(0x13f)+_0xdd12fe+_0x2f40e9(0x131),()=>_0x3b8378['segment']['resolvePathToResource'](_0xdd12fe),{'verbose':_0x1d2acc[_0x2f40e9(0xf8)]}),_0x47d8c0=_0x36b6b7['data'];_0x1d2acc[_0x2f40e9(0xf8)]&&(console['error'](_0x2f40e9(0x109)+_0x47d8c0[_0x2f40e9(0x11c)]),console[_0x2f40e9(0x16c)]('Parent\x20ID:\x20'+_0x47d8c0[_0x2f40e9(0x123)]),_0x47d8c0[_0x2f40e9(0x136)]&&console[_0x2f40e9(0x16c)]('Folder\x20ID:\x20'+_0x47d8c0[_0x2f40e9(0x136)]),_0x47d8c0['segmentId']&&console['error'](_0x2f40e9(0x140)+_0x47d8c0['segmentId']));if(_0x47d8c0['type']===_0x2f40e9(0x165)){const _0x3d722e=await withSpinner(_0x2f40e9(0x166),()=>_0x3b8378['segment'][_0x2f40e9(0x13e)](_0x47d8c0[_0x2f40e9(0x123)]),{'verbose':_0x1d2acc[_0x2f40e9(0xf8)]});await handleSingleObjectOutput(_0x3d722e[_0x2f40e9(0x117)],_0x1d2acc);}else{if(_0x47d8c0[_0x2f40e9(0x11c)]==='folder'){if(!_0x47d8c0[_0x2f40e9(0x136)])throw new SDKError(ErrorCode[_0x2f40e9(0xf4)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x12a2e7=await withSpinner(_0x2f40e9(0x150),()=>_0x3b8378[_0x2f40e9(0x145)][_0x2f40e9(0x111)](_0x47d8c0[_0x2f40e9(0x136)]),{'verbose':_0x1d2acc['verbose']});await handleSingleObjectOutput(_0x12a2e7['data'],_0x1d2acc);}else{if(_0x47d8c0[_0x2f40e9(0x11c)]==='segment'){if(!_0x47d8c0[_0x2f40e9(0x170)])throw new SDKError(ErrorCode[_0x2f40e9(0xf4)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x491c2d=await withSpinner(_0x2f40e9(0x128),()=>_0x3b8378[_0x2f40e9(0x145)][_0x2f40e9(0x119)](_0x47d8c0[_0x2f40e9(0x123)],_0x47d8c0[_0x2f40e9(0x170)]),{'verbose':_0x1d2acc['verbose']});await handleSingleObjectOutput(_0x491c2d[_0x2f40e9(0x117)],_0x1d2acc);}}}return 0x0;}catch(_0x309735){if(_0x309735 instanceof SDKError)return console[_0x2f40e9(0x16c)](_0x2f40e9(0x10c)+_0x309735['message']),_0x309735[_0x2f40e9(0x110)]&&console['error']('\x20\x20Cause:\x20'+_0x309735[_0x2f40e9(0x110)]),0x1;throw _0x309735;}}}export class SegmentDescCommand extends BaseCommand{[a29_0x45cd8a(0x126)]=a29_0x45cd8a(0x112);['description']=a29_0x45cd8a(0x16e);async['execute'](_0x24ae8d){const _0x1340c6=a29_0x45cd8a,{options:_0xd793b8,args:_0x3e9e63,tdx:_0x37b36c}=_0x24ae8d,_0x8ae9ae=_0x3e9e63[0x0],_0x1bcdab=!_0x8ae9ae&&!!_0xd793b8[_0x1340c6(0x114)],_0x4141b7=_0x8ae9ae||_0xd793b8[_0x1340c6(0x114)];if(!_0x4141b7)return console[_0x1340c6(0x16c)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x1340c6(0x16c)](_0x1340c6(0x16b)),console[_0x1340c6(0x16c)]('Examples:'),console[_0x1340c6(0x16c)]('\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience\x22'),console[_0x1340c6(0x16c)](_0x1340c6(0xf1)),console[_0x1340c6(0x16c)](_0x1340c6(0x157)),console['error'](_0x1340c6(0x12e)),0x1;try{const _0x41d757=_0xd793b8[_0x1340c6(0x120)];let _0x2d8c09=_0x4141b7;!_0x1bcdab&&_0x41d757&&!_0x4141b7[_0x1340c6(0x130)]('/')&&(_0x2d8c09=_0x41d757+'/'+_0x4141b7,_0xd793b8['verbose']&&console[_0x1340c6(0x16c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2d8c09));const _0x2e8a00=await withSpinner(_0x1340c6(0x13f)+_0x2d8c09+_0x1340c6(0x131),()=>_0x37b36c['segment'][_0x1340c6(0xfa)](_0x2d8c09),{'verbose':_0xd793b8['verbose']}),_0x73f10f=_0x2e8a00[_0x1340c6(0x117)];_0xd793b8['verbose']&&(console['error'](_0x1340c6(0x109)+_0x73f10f[_0x1340c6(0x11c)]),console[_0x1340c6(0x16c)]('Parent\x20ID:\x20'+_0x73f10f[_0x1340c6(0x123)]));if(_0x73f10f[_0x1340c6(0x11c)]==='folder')return console['error'](_0x1340c6(0xff)),console[_0x1340c6(0x16c)](_0x1340c6(0x127)),0x1;let _0x283fea;if(_0x73f10f[_0x1340c6(0x11c)]==='parent'){const _0x49ef26=await withSpinner(_0x1340c6(0x15a),()=>_0x37b36c[_0x1340c6(0x145)]['getParentSQL'](_0x73f10f[_0x1340c6(0x123)]),{'verbose':_0xd793b8[_0x1340c6(0xf8)]});_0x283fea=_0x49ef26[_0x1340c6(0x117)];}else{if(!_0x73f10f[_0x1340c6(0x170)])throw new SDKError(ErrorCode[_0x1340c6(0xf4)],_0x1340c6(0x155));const _0x13403c=await withSpinner(_0x1340c6(0x10b),()=>_0x37b36c['segment'][_0x1340c6(0x14c)](_0x73f10f[_0x1340c6(0x123)],_0x73f10f[_0x1340c6(0x170)]),{'verbose':_0xd793b8['verbose']});_0x283fea=_0x13403c['data'];}const _0x4fa85d=await executeSchemaQuery(_0x283fea,_0x37b36c,_0xd793b8);return await handleQueryOutput(_0x4fa85d,_0xd793b8),0x0;}catch(_0x43cf84){if(_0x43cf84 instanceof SDKError)return console[_0x1340c6(0x16c)]('Error:\x20'+_0x43cf84[_0x1340c6(0x11a)]),_0x43cf84['cause']&&console[_0x1340c6(0x16c)](_0x1340c6(0x159)+_0x43cf84[_0x1340c6(0x110)]),0x1;throw _0x43cf84;}}}
|
|
1
|
+
const a29_0x44af53=a29_0x151e;function a29_0x53e8(){const _0x35a59d=['execute','description','Fetching\x20folder\x20details...','Fetching\x20segment\x20details...','message','parentSegment','Show\x20segment\x20folder\x20details','processedRows','\x20folder','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','error','2583361chdToI','segment:describe','Error:\x20Path\x20or\x20name\x20is\x20required','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','elapsedTimeMillis','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Listing\x20folders\x20for\x20parent\x20\x27','query','Show\x20segment\x20or\x20folder\x20details','Folder\x20ID\x20missing\x20from\x20resolved\x20path','folder','✖\x20Query\x20failed\x20[','getSegment','name','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','length','Fetching\x20SQL\x20for\x20segment...','3GiqYRK','parentId','\x20\x20tdx\x20segment\x20info\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','includes','jobId','test','segment','Resolved\x20parent\x20folder\x20ID:\x20','Create\x20segment\x20folder\x20for\x20organization','segmentPath','3440622FFTIrk','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Parent\x20name:\x20','parent','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x27...','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Parent\x20segment:\x20','Resolved\x20type:\x20','verbose','in\x20','stats','segmentId','getSegmentSQL','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20segment\x20info\x20<path>','segment:sql','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','getParentSQL','segment:folder:list','Resolving\x20parent\x20folder\x20\x27','getParent','Folder\x20name:\x20','Examples:','\x27\x20with\x20ID:\x20','4716720gzKWSI','6032187bOFbPC','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','listFolders','jsonl','getFolder','20koxzVl','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentFolder','✔\x20Created\x20folder\x20\x27','INTERNAL','1406860GoQgRC','information_schema','json','toLocaleString','\x20rows\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','folderId','trim','resolveParentId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','data','type','resolvePathToResource','2675944lTCrBi','Resolving\x20folder\x20\x27','Resolving\x20path\x20\x27','Creating\x20folder\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20desc\x20\x22My\x20Audience\x22','resolveFolderId','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolved\x20relative\x20path\x20to:\x20','format','56534qWEofd','site','Fetching\x20parent\x20segment\x20details...','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segment:info','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Usage:\x20tdx\x20segment\x20desc\x20<path>','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','createFolder','Parent\x20ID:\x20','SQL\x20query:\x0a','5RkAerP','cause','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','replace','Executing\x20segment\x20query...','30awIRyX','\x20\x20Cause:\x20'];a29_0x53e8=function(){return _0x35a59d;};return a29_0x53e8();}(function(_0x83ce55,_0x208ee5){const _0xc665f=a29_0x151e,_0x923661=_0x83ce55();while(!![]){try{const _0x2a05b5=-parseInt(_0xc665f(0x169))/0x1*(parseInt(_0xc665f(0x188))/0x2)+parseInt(_0xc665f(0x13c))/0x3*(parseInt(_0xc665f(0x16e))/0x4)+-parseInt(_0xc665f(0x195))/0x5*(parseInt(_0xc665f(0x146))/0x6)+parseInt(_0xc665f(0x164))/0x7+parseInt(_0xc665f(0x17b))/0x8+-parseInt(_0xc665f(0x163))/0x9+parseInt(_0xc665f(0x19a))/0xa*(parseInt(_0xc665f(0x1a7))/0xb);if(_0x2a05b5===_0x208ee5)break;else _0x923661['push'](_0x923661['shift']());}catch(_0x5a4cd1){_0x923661['push'](_0x923661['shift']());}}}(a29_0x53e8,0x8ff4d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a29_0x151e(_0x12ce2c,_0xc97ed5){const _0x53e840=a29_0x53e8();return a29_0x151e=function(_0x151e8c,_0x1126f8){_0x151e8c=_0x151e8c-0x130;let _0x136f91=_0x53e840[_0x151e8c];return _0x136f91;},a29_0x151e(_0x12ce2c,_0xc97ed5);}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_0x44af53(0x133)]=a29_0x44af53(0x1a8);[a29_0x44af53(0x19d)]='Show\x20segment\x20or\x20folder\x20details';async[a29_0x44af53(0x19c)](_0x34137d){const _0x41b5e7=a29_0x44af53,{options:_0x41de74,args:_0x441dbd,tdx:_0x23cec5}=_0x34137d,_0x3e5b6a=_0x441dbd[0x0],_0x56f32e=!_0x3e5b6a&&!!_0x41de74[_0x41b5e7(0x1a1)],_0x50172a=_0x3e5b6a||_0x41de74['parentSegment'];if(!_0x50172a)return console[_0x41b5e7(0x1a6)](_0x41b5e7(0x1a9)),console[_0x41b5e7(0x1a6)](_0x41b5e7(0x185)),console['error'](_0x41b5e7(0x161)),console[_0x41b5e7(0x1a6)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x41b5e7(0x1a6)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error'](_0x41b5e7(0x1ad)),console['error'](_0x41b5e7(0x165)),0x1;try{const _0x25eb43=_0x41de74[_0x41b5e7(0x145)];let _0x2921aa=_0x50172a;!_0x56f32e&&_0x25eb43&&!_0x50172a[_0x41b5e7(0x13f)]('/')&&(_0x2921aa=_0x25eb43+'/'+_0x50172a,_0x41de74[_0x41b5e7(0x153)]&&console[_0x41b5e7(0x1a6)](_0x41b5e7(0x186)+_0x2921aa));const _0x2497c7=await withSpinner(_0x41b5e7(0x17d)+_0x2921aa+_0x41b5e7(0x14c),()=>_0x23cec5[_0x41b5e7(0x142)]['resolvePathToResource'](_0x2921aa),{'verbose':_0x41de74['verbose']}),_0x6d7f50=_0x2497c7[_0x41b5e7(0x178)];_0x41de74[_0x41b5e7(0x153)]&&(console[_0x41b5e7(0x1a6)]('Resolved\x20type:\x20'+_0x6d7f50[_0x41b5e7(0x179)]),console[_0x41b5e7(0x1a6)](_0x41b5e7(0x193)+_0x6d7f50[_0x41b5e7(0x13d)]),_0x6d7f50['folderId']&&console[_0x41b5e7(0x1a6)]('Folder\x20ID:\x20'+_0x6d7f50['folderId']),_0x6d7f50['segmentId']&&console[_0x41b5e7(0x1a6)](_0x41b5e7(0x18d)+_0x6d7f50[_0x41b5e7(0x156)]));if(_0x6d7f50[_0x41b5e7(0x179)]===_0x41b5e7(0x14a)){const _0xaeb914=await withSpinner(_0x41b5e7(0x18a),()=>_0x23cec5[_0x41b5e7(0x142)]['getParent'](_0x6d7f50[_0x41b5e7(0x13d)]),{'verbose':_0x41de74[_0x41b5e7(0x153)]});await handleSingleObjectOutput(_0xaeb914['data'],_0x41de74);}else{if(_0x6d7f50[_0x41b5e7(0x179)]===_0x41b5e7(0x130)){if(!_0x6d7f50['folderId'])throw new SDKError(ErrorCode['INTERNAL'],_0x41b5e7(0x1b2));const _0xb8af79=await withSpinner(_0x41b5e7(0x19e),()=>_0x23cec5[_0x41b5e7(0x142)][_0x41b5e7(0x168)](_0x6d7f50[_0x41b5e7(0x174)]),{'verbose':_0x41de74['verbose']});await handleSingleObjectOutput(_0xb8af79[_0x41b5e7(0x178)],_0x41de74);}else{if(_0x6d7f50[_0x41b5e7(0x179)]==='segment'){if(!_0x6d7f50[_0x41b5e7(0x156)])throw new SDKError(ErrorCode[_0x41b5e7(0x16d)],_0x41b5e7(0x1aa));const _0x3af246=await withSpinner(_0x41b5e7(0x19f),()=>_0x23cec5['segment'][_0x41b5e7(0x132)](_0x6d7f50[_0x41b5e7(0x13d)],_0x6d7f50['segmentId']),{'verbose':_0x41de74[_0x41b5e7(0x153)]});await handleSingleObjectOutput(_0x3af246['data'],_0x41de74);}}}return 0x0;}catch(_0x23ebe6){if(_0x23ebe6 instanceof SDKError)return console[_0x41b5e7(0x1a6)]('Error:\x20'+_0x23ebe6[_0x41b5e7(0x1a0)]),_0x23ebe6[_0x41b5e7(0x196)]&&console[_0x41b5e7(0x1a6)]('\x20\x20Cause:\x20'+_0x23ebe6[_0x41b5e7(0x196)]),0x1;throw _0x23ebe6;}}}export class SegmentShowCommand extends BaseCommand{[a29_0x44af53(0x133)]='segment:show';['description']=a29_0x44af53(0x1a5);async['execute'](_0x170ba3){const _0x5eefd9=a29_0x44af53,{options:_0x2afc82,args:_0x330003,tdx:_0x308c87}=_0x170ba3,_0x5b8172=_0x330003[0x0],_0x194c73=!_0x5b8172&&!!_0x2afc82[_0x5eefd9(0x1a1)],_0x5e6f45=_0x5b8172||_0x2afc82['parentSegment'];if(!_0x5e6f45)return console[_0x5eefd9(0x1a6)](_0x5eefd9(0x17f)),console[_0x5eefd9(0x1a6)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x5eefd9(0x1a6)]('Examples:'),console[_0x5eefd9(0x1a6)](_0x5eefd9(0x148)),console[_0x5eefd9(0x1a6)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error'](_0x5eefd9(0x173)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x1c1cfa=_0x2afc82['segmentPath'];let _0x4318fd=_0x5e6f45;!_0x194c73&&_0x1c1cfa&&!_0x5e6f45[_0x5eefd9(0x13f)]('/')&&(_0x4318fd=_0x1c1cfa+'/'+_0x5e6f45,_0x2afc82[_0x5eefd9(0x153)]&&console[_0x5eefd9(0x1a6)](_0x5eefd9(0x186)+_0x4318fd));const _0x551187=await withSpinner('Resolving\x20path\x20\x27'+_0x4318fd+_0x5eefd9(0x14c),()=>_0x308c87[_0x5eefd9(0x142)][_0x5eefd9(0x17a)](_0x4318fd),{'verbose':_0x2afc82[_0x5eefd9(0x153)]}),_0x59a33b=_0x551187[_0x5eefd9(0x178)];_0x2afc82[_0x5eefd9(0x153)]&&(console['error'](_0x5eefd9(0x152)+_0x59a33b[_0x5eefd9(0x179)]),console[_0x5eefd9(0x1a6)](_0x5eefd9(0x193)+_0x59a33b[_0x5eefd9(0x13d)]));if(_0x59a33b[_0x5eefd9(0x179)]===_0x5eefd9(0x130))return console[_0x5eefd9(0x1a6)](_0x5eefd9(0x139)),console[_0x5eefd9(0x1a6)](_0x5eefd9(0x184)),0x1;let _0x3e5b59;if(_0x59a33b[_0x5eefd9(0x179)]===_0x5eefd9(0x14a)){const _0x5695c8=await withSpinner(_0x5eefd9(0x14f),()=>_0x308c87[_0x5eefd9(0x142)][_0x5eefd9(0x15c)](_0x59a33b[_0x5eefd9(0x13d)]),{'verbose':_0x2afc82['verbose']});_0x3e5b59=_0x5695c8['data'];}else{if(!_0x59a33b[_0x5eefd9(0x156)])throw new SDKError(ErrorCode[_0x5eefd9(0x16d)],_0x5eefd9(0x1aa));const _0xdb9672=await withSpinner(_0x5eefd9(0x13b),()=>_0x308c87[_0x5eefd9(0x142)][_0x5eefd9(0x157)](_0x59a33b['parentId'],_0x59a33b[_0x5eefd9(0x156)]),{'verbose':_0x2afc82['verbose']});_0x3e5b59=_0xdb9672['data'];}const _0x998fd7=resolveLimit(_0x2afc82['limit'],DEFAULT_DISPLAY_LIMIT),_0x4acd95=/\bLIMIT\s+\d+/i[_0x5eefd9(0x141)](_0x3e5b59);!_0x4acd95&&(_0x3e5b59=_0x3e5b59[_0x5eefd9(0x175)]()[_0x5eefd9(0x198)](/;+$/,''),_0x3e5b59=_0x5eefd9(0x14d)+_0x3e5b59+_0x5eefd9(0x18b)+_0x998fd7);_0x2afc82[_0x5eefd9(0x153)]&&console[_0x5eefd9(0x1a6)](_0x5eefd9(0x194)+_0x3e5b59);const _0x335345=await withQuerySpinner(_0x5eefd9(0x199),async _0x3b27ff=>{const _0x248afa=_0x5eefd9,_0x4d85fe=await _0x308c87[_0x248afa(0x1b0)][_0x248afa(0x19c)](_0x3e5b59,{'catalog':'td','schema':_0x248afa(0x16f),'onJobId':_0x41765f=>{_0x3b27ff['setJobId'](_0x41765f);}});return _0x4d85fe;},{'verbose':_0x2afc82['verbose']}),_0x3bb64e=_0x335345[_0x5eefd9(0x178)],_0xbe5280=_0x3bb64e['jobId']?_0x5eefd9(0x158)+_0x3bb64e[_0x5eefd9(0x140)]+']':'';return console[_0x5eefd9(0x1a6)](_0x5eefd9(0x190)+_0x3bb64e[_0x5eefd9(0x155)][_0x5eefd9(0x1a3)][_0x5eefd9(0x171)]()+_0x5eefd9(0x172)+(_0x5eefd9(0x154)+formatElapsed(_0x3bb64e[_0x5eefd9(0x155)][_0x5eefd9(0x1ac)])+_0xbe5280)),await handleQueryOutput(_0x3bb64e,_0x2afc82),0x0;}catch(_0x2c18c8){if(_0x2c18c8 instanceof SDKError)return console[_0x5eefd9(0x1a6)](_0x5eefd9(0x131)+_0x2c18c8['code']+']'),console[_0x5eefd9(0x1a6)]('\x0a'+_0x2c18c8[_0x5eefd9(0x1a0)]),0x1;throw _0x2c18c8;}}}export class SegmentFolderListCommand extends BaseCommand{[a29_0x44af53(0x133)]=a29_0x44af53(0x15d);[a29_0x44af53(0x19d)]=a29_0x44af53(0x177);async[a29_0x44af53(0x19c)](_0x56d795){const _0x32a283=a29_0x44af53,{options:_0x25d4d9,args:_0x5db50a,tdx:_0x4c4a94}=_0x56d795;if(_0x5db50a[_0x32a283(0x13a)]===0x0)return console['error'](_0x32a283(0x138)),console['error'](_0x32a283(0x18e)),0x1;const _0x218f17=_0x5db50a[0x0];try{_0x25d4d9[_0x32a283(0x153)]&&(console['error']('Site:\x20'+_0x25d4d9['site']),console[_0x32a283(0x1a6)](_0x32a283(0x149)+_0x218f17));const _0xecb268=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x218f17+_0x32a283(0x14c),()=>_0x4c4a94[_0x32a283(0x142)][_0x32a283(0x176)](_0x218f17),{'verbose':_0x25d4d9['verbose']}),_0x1ba37b=_0xecb268['data'];_0x25d4d9[_0x32a283(0x153)]&&console[_0x32a283(0x1a6)]('Resolved\x20parent\x20ID:\x20'+_0x1ba37b);const _0x5b7140=await withSpinner(_0x32a283(0x1af)+_0x218f17+'\x27...',()=>_0x4c4a94['segment'][_0x32a283(0x166)](_0x1ba37b),{'verbose':_0x25d4d9[_0x32a283(0x153)]}),_0x34e5ba=_0x5b7140['data'];return console[_0x32a283(0x1a6)]('✔\x20Found\x20'+_0x34e5ba[_0x32a283(0x13a)]+_0x32a283(0x1a4)+(_0x34e5ba[_0x32a283(0x13a)]!==0x1?'s':'')),await handleSDKOutput(_0x34e5ba,_0x25d4d9),0x0;}catch(_0x48e249){if(_0x48e249 instanceof SDKError)return console[_0x32a283(0x1a6)]('Error:\x20'+_0x48e249[_0x32a283(0x1a0)]),_0x48e249[_0x32a283(0x196)]&&console[_0x32a283(0x1a6)]('\x20\x20Cause:\x20'+_0x48e249[_0x32a283(0x196)]),0x1;throw _0x48e249;}}}export class SegmentFolderShowCommand extends BaseCommand{[a29_0x44af53(0x133)]='segment:folder:show';[a29_0x44af53(0x19d)]=a29_0x44af53(0x1a2);async[a29_0x44af53(0x19c)](_0x5dfc22){const _0x557bb5=a29_0x44af53,{options:_0x17fa15,args:_0x72aa50,tdx:_0x43f93f}=_0x5dfc22;if(_0x72aa50[_0x557bb5(0x13a)]===0x0)return console[_0x557bb5(0x1a6)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x557bb5(0x1a6)](_0x557bb5(0x14b)),0x1;try{const {parentId:_0x18872d,childId:_0x15639f}=parseSegmentRef(_0x72aa50[0x0]);_0x17fa15[_0x557bb5(0x153)]&&(console[_0x557bb5(0x1a6)](_0x557bb5(0x137)+_0x17fa15['site']),console[_0x557bb5(0x1a6)]('Parent\x20name:\x20'+_0x18872d),_0x15639f&&console[_0x557bb5(0x1a6)](_0x557bb5(0x160)+_0x15639f));if(!_0x15639f)return console[_0x557bb5(0x1a6)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x3763dc=await withSpinner(_0x557bb5(0x135)+_0x18872d+_0x557bb5(0x14c),()=>_0x43f93f[_0x557bb5(0x142)]['resolveParentId'](_0x18872d),{'verbose':_0x17fa15[_0x557bb5(0x153)]}),_0x4ef12d=_0x3763dc[_0x557bb5(0x178)];_0x17fa15['verbose']&&console[_0x557bb5(0x1a6)]('Resolved\x20parent\x20ID:\x20'+_0x4ef12d);const _0x2f41b4=await withSpinner(_0x557bb5(0x17c)+_0x15639f+_0x557bb5(0x14c),()=>_0x43f93f[_0x557bb5(0x142)]['resolveFolderId'](_0x4ef12d,_0x15639f),{'verbose':_0x17fa15[_0x557bb5(0x153)]}),_0x1b2645=_0x2f41b4[_0x557bb5(0x178)];_0x17fa15[_0x557bb5(0x153)]&&console[_0x557bb5(0x1a6)](_0x557bb5(0x180)+_0x1b2645);const _0x27f5f1=await withSpinner('Fetching\x20folder\x20\x27'+_0x15639f+'\x27...',()=>_0x43f93f[_0x557bb5(0x142)][_0x557bb5(0x168)](_0x1b2645),{'verbose':_0x17fa15['verbose']});return await handleSDKOutput([_0x27f5f1[_0x557bb5(0x178)]],_0x17fa15),0x0;}catch(_0x133cc9){if(_0x133cc9 instanceof SDKError)return console[_0x557bb5(0x1a6)](_0x557bb5(0x14e)+_0x133cc9[_0x557bb5(0x1a0)]),_0x133cc9[_0x557bb5(0x196)]&&console[_0x557bb5(0x1a6)](_0x557bb5(0x19b)+_0x133cc9['cause']),0x1;throw _0x133cc9;}}}export class SegmentSQLCommand extends BaseCommand{[a29_0x44af53(0x133)]=a29_0x44af53(0x15a);[a29_0x44af53(0x19d)]=a29_0x44af53(0x150);async['execute'](_0x27f50b){const _0x4bb70c=a29_0x44af53,{options:_0x3dfc9d,args:_0x324583,tdx:_0x138c17}=_0x27f50b,_0x218e58=_0x324583[0x0],_0x5dad76=!_0x218e58&&!!_0x3dfc9d['parentSegment'],_0x5d5cc8=_0x218e58||_0x3dfc9d[_0x4bb70c(0x1a1)];if(!_0x5d5cc8)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x4bb70c(0x1a6)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x4bb70c(0x1a6)](_0x4bb70c(0x161)),console[_0x4bb70c(0x1a6)](_0x4bb70c(0x134)),console[_0x4bb70c(0x1a6)](_0x4bb70c(0x147)),console['error'](_0x4bb70c(0x197)),console[_0x4bb70c(0x1a6)](_0x4bb70c(0x165)),0x1;try{const _0xc705a8=_0x3dfc9d[_0x4bb70c(0x145)];let _0x1c7aaa=_0x5d5cc8;!_0x5dad76&&_0xc705a8&&!_0x5d5cc8['includes']('/')&&(_0x1c7aaa=_0xc705a8+'/'+_0x5d5cc8,_0x3dfc9d[_0x4bb70c(0x153)]&&console[_0x4bb70c(0x1a6)]('Resolved\x20relative\x20path\x20to:\x20'+_0x1c7aaa));const _0x280930=await withSpinner('Resolving\x20path\x20\x27'+_0x1c7aaa+'\x27...',()=>_0x138c17[_0x4bb70c(0x142)][_0x4bb70c(0x17a)](_0x1c7aaa),{'verbose':_0x3dfc9d['verbose']}),_0x263261=_0x280930[_0x4bb70c(0x178)];_0x3dfc9d[_0x4bb70c(0x153)]&&(console[_0x4bb70c(0x1a6)](_0x4bb70c(0x152)+_0x263261[_0x4bb70c(0x179)]),console['error'](_0x4bb70c(0x193)+_0x263261['parentId']));if(_0x263261['type']===_0x4bb70c(0x130))return console[_0x4bb70c(0x1a6)](_0x4bb70c(0x191)),console[_0x4bb70c(0x1a6)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x44958f;if(_0x263261[_0x4bb70c(0x179)]==='parent'){const _0x3b3ab1=await withSpinner(_0x4bb70c(0x14f),()=>_0x138c17[_0x4bb70c(0x142)][_0x4bb70c(0x15c)](_0x263261[_0x4bb70c(0x13d)]),{'verbose':_0x3dfc9d[_0x4bb70c(0x153)]});_0x44958f=_0x3b3ab1[_0x4bb70c(0x178)];}else{if(!_0x263261[_0x4bb70c(0x156)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2911a0=await withSpinner(_0x4bb70c(0x13b),()=>_0x138c17['segment'][_0x4bb70c(0x157)](_0x263261[_0x4bb70c(0x13d)],_0x263261['segmentId']),{'verbose':_0x3dfc9d[_0x4bb70c(0x153)]});_0x44958f=_0x2911a0[_0x4bb70c(0x178)];}return _0x3dfc9d[_0x4bb70c(0x187)]===_0x4bb70c(0x170)||_0x3dfc9d[_0x4bb70c(0x187)]===_0x4bb70c(0x167)?await handleSDKOutput([{'sql':_0x44958f}],_0x3dfc9d):console['log'](_0x44958f),0x0;}catch(_0x8ce014){if(_0x8ce014 instanceof SDKError)return console[_0x4bb70c(0x1a6)]('Error:\x20'+_0x8ce014[_0x4bb70c(0x1a0)]),_0x8ce014[_0x4bb70c(0x196)]&&console[_0x4bb70c(0x1a6)]('\x20\x20Cause:\x20'+_0x8ce014[_0x4bb70c(0x196)]),0x1;throw _0x8ce014;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a29_0x44af53(0x19d)]=a29_0x44af53(0x144);async[a29_0x44af53(0x19c)](_0x216af0){const _0x3b9a1c=a29_0x44af53,{options:_0xda822a,args:_0xbe4402,tdx:_0x52d731}=_0x216af0,_0x2e67db=_0xda822a;if(_0xbe4402['length']<0x2)return console[_0x3b9a1c(0x1a6)](_0x3b9a1c(0x15b)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3fb294=_0xbe4402[0x0],_0x15f7a1=_0xbe4402[0x1];_0x2e67db[_0x3b9a1c(0x153)]&&(console[_0x3b9a1c(0x1a6)](_0x3b9a1c(0x137)+_0x2e67db[_0x3b9a1c(0x189)]),console['error'](_0x3b9a1c(0x151)+_0x3fb294),console[_0x3b9a1c(0x1a6)]('Folder\x20name:\x20'+_0x15f7a1));let _0x31c734;if(_0x2e67db[_0x3b9a1c(0x16b)]){const _0x39fe4c=_0x2e67db[_0x3b9a1c(0x16b)],_0x4ba752=await withSpinner(_0x3b9a1c(0x135)+_0x3fb294+_0x3b9a1c(0x14c),()=>_0x52d731[_0x3b9a1c(0x142)]['resolveParentId'](_0x3fb294),{'verbose':_0x2e67db[_0x3b9a1c(0x153)]}),_0x2bedc7=_0x4ba752[_0x3b9a1c(0x178)],_0x352336=await withSpinner(_0x3b9a1c(0x15e)+_0x39fe4c+_0x3b9a1c(0x14c),()=>_0x52d731[_0x3b9a1c(0x142)][_0x3b9a1c(0x183)](_0x2bedc7,_0x39fe4c),{'verbose':_0x2e67db[_0x3b9a1c(0x153)]});_0x31c734=_0x352336[_0x3b9a1c(0x178)],_0x2e67db[_0x3b9a1c(0x153)]&&console['error'](_0x3b9a1c(0x143)+_0x31c734);}const _0x5434a8={'name':_0x15f7a1,'description':_0x2e67db[_0x3b9a1c(0x19d)],'parentFolderId':_0x31c734},_0x15c05c=await withSpinner(_0x3b9a1c(0x17e)+_0x15f7a1+_0x3b9a1c(0x14c),()=>_0x52d731[_0x3b9a1c(0x142)][_0x3b9a1c(0x192)](_0x3fb294,_0x5434a8),{'verbose':_0x2e67db[_0x3b9a1c(0x153)]}),_0x4908bc=_0x15c05c[_0x3b9a1c(0x178)];return console[_0x3b9a1c(0x1a6)](_0x3b9a1c(0x16c)+_0x4908bc[_0x3b9a1c(0x133)]+_0x3b9a1c(0x162)+_0x4908bc['id']),await handleSDKOutput([_0x4908bc],_0x2e67db),0x0;}}export class SegmentInfoCommand extends BaseCommand{[a29_0x44af53(0x133)]=a29_0x44af53(0x18c);[a29_0x44af53(0x19d)]=a29_0x44af53(0x1b1);async['execute'](_0x22d860){const _0x2a862d=a29_0x44af53,{options:_0x59d8bd,args:_0x3c2ec7,tdx:_0xfe0184}=_0x22d860,_0x22af59=_0x3c2ec7[0x0],_0x1cd193=!_0x22af59&&!!_0x59d8bd[_0x2a862d(0x1a1)],_0x4411ab=_0x22af59||_0x59d8bd['parentSegment'];if(!_0x4411ab)return console[_0x2a862d(0x1a6)](_0x2a862d(0x1a9)),console[_0x2a862d(0x1a6)](_0x2a862d(0x159)),console[_0x2a862d(0x1a6)]('Examples:'),console[_0x2a862d(0x1a6)]('\x20\x20tdx\x20segment\x20info\x20\x22My\x20Audience\x22'),console['error'](_0x2a862d(0x136)),console[_0x2a862d(0x1a6)](_0x2a862d(0x13e)),console[_0x2a862d(0x1a6)](_0x2a862d(0x165)),0x1;try{const _0x582476=_0x59d8bd[_0x2a862d(0x145)];let _0x18886d=_0x4411ab;!_0x1cd193&&_0x582476&&!_0x4411ab['includes']('/')&&(_0x18886d=_0x582476+'/'+_0x4411ab,_0x59d8bd['verbose']&&console[_0x2a862d(0x1a6)](_0x2a862d(0x186)+_0x18886d));const _0xb3050b=await withSpinner(_0x2a862d(0x17d)+_0x18886d+_0x2a862d(0x14c),()=>_0xfe0184[_0x2a862d(0x142)][_0x2a862d(0x17a)](_0x18886d),{'verbose':_0x59d8bd[_0x2a862d(0x153)]}),_0x4ceabb=_0xb3050b[_0x2a862d(0x178)];_0x59d8bd[_0x2a862d(0x153)]&&(console[_0x2a862d(0x1a6)]('Resolved\x20type:\x20'+_0x4ceabb[_0x2a862d(0x179)]),console[_0x2a862d(0x1a6)](_0x2a862d(0x193)+_0x4ceabb['parentId']),_0x4ceabb[_0x2a862d(0x174)]&&console[_0x2a862d(0x1a6)](_0x2a862d(0x181)+_0x4ceabb[_0x2a862d(0x174)]),_0x4ceabb[_0x2a862d(0x156)]&&console[_0x2a862d(0x1a6)](_0x2a862d(0x18d)+_0x4ceabb[_0x2a862d(0x156)]));if(_0x4ceabb[_0x2a862d(0x179)]===_0x2a862d(0x14a)){const _0x23b1a5=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0xfe0184[_0x2a862d(0x142)][_0x2a862d(0x15f)](_0x4ceabb[_0x2a862d(0x13d)]),{'verbose':_0x59d8bd[_0x2a862d(0x153)]});await handleSingleObjectOutput(_0x23b1a5[_0x2a862d(0x178)],_0x59d8bd);}else{if(_0x4ceabb[_0x2a862d(0x179)]===_0x2a862d(0x130)){if(!_0x4ceabb[_0x2a862d(0x174)])throw new SDKError(ErrorCode[_0x2a862d(0x16d)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0xf940aa=await withSpinner('Fetching\x20folder\x20details...',()=>_0xfe0184[_0x2a862d(0x142)][_0x2a862d(0x168)](_0x4ceabb[_0x2a862d(0x174)]),{'verbose':_0x59d8bd['verbose']});await handleSingleObjectOutput(_0xf940aa[_0x2a862d(0x178)],_0x59d8bd);}else{if(_0x4ceabb[_0x2a862d(0x179)]===_0x2a862d(0x142)){if(!_0x4ceabb[_0x2a862d(0x156)])throw new SDKError(ErrorCode[_0x2a862d(0x16d)],_0x2a862d(0x1aa));const _0xcd35e7=await withSpinner('Fetching\x20segment\x20details...',()=>_0xfe0184[_0x2a862d(0x142)][_0x2a862d(0x132)](_0x4ceabb[_0x2a862d(0x13d)],_0x4ceabb['segmentId']),{'verbose':_0x59d8bd[_0x2a862d(0x153)]});await handleSingleObjectOutput(_0xcd35e7[_0x2a862d(0x178)],_0x59d8bd);}}}return 0x0;}catch(_0x55d074){if(_0x55d074 instanceof SDKError)return console['error'](_0x2a862d(0x14e)+_0x55d074['message']),_0x55d074[_0x2a862d(0x196)]&&console['error'](_0x2a862d(0x19b)+_0x55d074[_0x2a862d(0x196)]),0x1;throw _0x55d074;}}}export class SegmentDescCommand extends BaseCommand{[a29_0x44af53(0x133)]='segment:desc';[a29_0x44af53(0x19d)]='Show\x20segment\x20schema\x20(column\x20types)';async[a29_0x44af53(0x19c)](_0x38f56e){const _0x1d766f=a29_0x44af53,{options:_0x3183c7,args:_0x1a0944,tdx:_0x532d21}=_0x38f56e,_0x196aa3=_0x1a0944[0x0],_0x2eca1d=!_0x196aa3&&!!_0x3183c7[_0x1d766f(0x1a1)],_0x23db0f=_0x196aa3||_0x3183c7[_0x1d766f(0x1a1)];if(!_0x23db0f)return console[_0x1d766f(0x1a6)](_0x1d766f(0x17f)),console['error'](_0x1d766f(0x18f)),console[_0x1d766f(0x1a6)](_0x1d766f(0x161)),console[_0x1d766f(0x1a6)](_0x1d766f(0x182)),console['error'](_0x1d766f(0x16a)),console['error']('\x20\x20tdx\x20segment\x20desc\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x1d766f(0x1a6)](_0x1d766f(0x165)),0x1;try{const _0x46c9bf=_0x3183c7['segmentPath'];let _0x3e9aa3=_0x23db0f;!_0x2eca1d&&_0x46c9bf&&!_0x23db0f[_0x1d766f(0x13f)]('/')&&(_0x3e9aa3=_0x46c9bf+'/'+_0x23db0f,_0x3183c7['verbose']&&console['error'](_0x1d766f(0x186)+_0x3e9aa3));const _0x39a377=await withSpinner(_0x1d766f(0x17d)+_0x3e9aa3+_0x1d766f(0x14c),()=>_0x532d21['segment'][_0x1d766f(0x17a)](_0x3e9aa3),{'verbose':_0x3183c7[_0x1d766f(0x153)]}),_0x33fe88=_0x39a377[_0x1d766f(0x178)];_0x3183c7[_0x1d766f(0x153)]&&(console[_0x1d766f(0x1a6)]('Resolved\x20type:\x20'+_0x33fe88[_0x1d766f(0x179)]),console['error'](_0x1d766f(0x193)+_0x33fe88['parentId']));if(_0x33fe88[_0x1d766f(0x179)]==='folder')return console[_0x1d766f(0x1a6)](_0x1d766f(0x1ab)),console['error'](_0x1d766f(0x1ae)),0x1;let _0x5dcb58;if(_0x33fe88[_0x1d766f(0x179)]===_0x1d766f(0x14a)){const _0x301131=await withSpinner(_0x1d766f(0x14f),()=>_0x532d21[_0x1d766f(0x142)]['getParentSQL'](_0x33fe88[_0x1d766f(0x13d)]),{'verbose':_0x3183c7['verbose']});_0x5dcb58=_0x301131['data'];}else{if(!_0x33fe88[_0x1d766f(0x156)])throw new SDKError(ErrorCode[_0x1d766f(0x16d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x285b75=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x532d21['segment']['getSegmentSQL'](_0x33fe88['parentId'],_0x33fe88[_0x1d766f(0x156)]),{'verbose':_0x3183c7[_0x1d766f(0x153)]});_0x5dcb58=_0x285b75[_0x1d766f(0x178)];}const _0x20fa74=await executeSchemaQuery(_0x5dcb58,_0x532d21,_0x3183c7);return await handleQueryOutput(_0x20fa74,_0x3183c7),0x0;}catch(_0x108a5c){if(_0x108a5c instanceof SDKError)return console['error']('Error:\x20'+_0x108a5c[_0x1d766f(0x1a0)]),_0x108a5c[_0x1d766f(0x196)]&&console[_0x1d766f(0x1a6)](_0x1d766f(0x19b)+_0x108a5c[_0x1d766f(0x196)]),0x1;throw _0x108a5c;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x4cf7a8=a30_0x2eba;(function(_0x27cda3,_0x4ec88f){const _0x504458=a30_0x2eba,_0x1882a8=_0x27cda3();while(!![]){try{const _0x24a58b=parseInt(_0x504458(0x14e))/0x1*(parseInt(_0x504458(0x166))/0x2)+-parseInt(_0x504458(0x14a))/0x3+parseInt(_0x504458(0x156))/0x4+-parseInt(_0x504458(0x16a))/0x5*(parseInt(_0x504458(0x164))/0x6)+-parseInt(_0x504458(0x152))/0x7*(-parseInt(_0x504458(0x15a))/0x8)+parseInt(_0x504458(0x158))/0x9+-parseInt(_0x504458(0x148))/0xa;if(_0x24a58b===_0x4ec88f)break;else _0x1882a8['push'](_0x1882a8['shift']());}catch(_0x25c975){_0x1882a8['push'](_0x1882a8['shift']());}}}(a30_0xd30e,0x7ddaa));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a30_0x2eba(_0x28ebb8,_0x1696c6){const _0xd30eea=a30_0xd30e();return a30_0x2eba=function(_0x2eba9a,_0x411271){_0x2eba9a=_0x2eba9a-0x147;let _0x43f30a=_0xd30eea[_0x2eba9a];return _0x43f30a;},a30_0x2eba(_0x28ebb8,_0x1696c6);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a30_0xd30e(){const _0x5694bc=['resolvePathToResource','resolveFolderId','type','Parent:\x20','ruleFile','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','verbose','Examples:','Resolving\x20folder\x20path\x20\x27','folderId','segmentPath','error','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','10072850ghPpJc','folder','707580XLCVkr','length','includes','segment','170dSPRtC','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x20\x20\x20Path:\x20','noCountPopulation','2443JhYKaE','Creating\x20segment\x20\x27','rule','Resolving\x20parent\x20segment\x20\x27','2343236wiKdGv','Create\x20child\x20segment\x20with\x20filtering\x20rules','4457097GdBPuY','Parent\x20path:\x20','12688RIHrmL','✔\x20Created\x20segment\x20\x27','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolved\x20relative\x20path\x20to:\x20','name','Site:\x20','description','5223498JDXmMh','data','11702iPOgDl','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','\x27...','segments','5iPDRdb','execute','resolveParentId'];a30_0xd30e=function(){return _0x5694bc;};return a30_0xd30e();}export class SegmentCreateCommand extends BaseCommand{[a30_0x4cf7a8(0x161)]='segment:create';[a30_0x4cf7a8(0x163)]=a30_0x4cf7a8(0x157);async[a30_0x4cf7a8(0x16b)](_0x10ecb6){const _0x439be7=a30_0x4cf7a8,{options:_0x53fdfa,args:_0x19b81f,tdx:_0x6961eb}=_0x10ecb6,_0x571154=_0x53fdfa;if(_0x19b81f['length']===0x0)return console['error'](_0x439be7(0x147)),console[_0x439be7(0x179)](_0x439be7(0x14f)),console[_0x439be7(0x179)](_0x439be7(0x175)),console[_0x439be7(0x179)](_0x439be7(0x167)),console[_0x439be7(0x179)](_0x439be7(0x15f)),console[_0x439be7(0x179)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x322f03=_0x19b81f[0x0],_0x578efa=_0x53fdfa[_0x439be7(0x178)];let _0x890e2e=_0x322f03;_0x578efa&&!_0x322f03[_0x439be7(0x14c)]('/')&&(_0x890e2e=_0x578efa+'/'+_0x322f03,_0x571154[_0x439be7(0x174)]&&console[_0x439be7(0x179)](_0x439be7(0x160)+_0x890e2e));const _0x44d64d=parsePath(_0x890e2e);if(_0x44d64d[_0x439be7(0x169)]['length']<0x2)return console[_0x439be7(0x179)](_0x439be7(0x172)),console[_0x439be7(0x179)](_0x439be7(0x173)),0x1;const _0x36251e=_0x44d64d[_0x439be7(0x169)][0x0],_0x4515c7=getBaseName(_0x890e2e),_0x1c1eb4=getParentPath(_0x890e2e);_0x571154['verbose']&&(console['error'](_0x439be7(0x162)+_0x571154['site']),console[_0x439be7(0x179)]('Target\x20path:\x20'+_0x890e2e),console[_0x439be7(0x179)](_0x439be7(0x170)+_0x36251e),console[_0x439be7(0x179)]('Segment\x20name:\x20'+_0x4515c7),console[_0x439be7(0x179)](_0x439be7(0x159)+_0x1c1eb4));const _0x4a7945=await withSpinner(_0x439be7(0x155)+_0x36251e+_0x439be7(0x168),()=>_0x6961eb[_0x439be7(0x14d)][_0x439be7(0x16c)](_0x36251e),{'verbose':_0x571154['verbose']}),_0x32d3e5=_0x4a7945[_0x439be7(0x165)];let _0x525762;if(_0x44d64d[_0x439be7(0x169)][_0x439be7(0x14b)]>0x2){const _0x33797b=await withSpinner(_0x439be7(0x176)+_0x1c1eb4+_0x439be7(0x168),()=>_0x6961eb[_0x439be7(0x14d)][_0x439be7(0x16d)](_0x1c1eb4),{'verbose':_0x571154[_0x439be7(0x174)]}),_0x1b3b16=_0x33797b[_0x439be7(0x165)];if(_0x1b3b16[_0x439be7(0x16f)]!==_0x439be7(0x149)&&_0x1b3b16['type']!=='parent')return console[_0x439be7(0x179)](_0x439be7(0x15d)),0x1;_0x525762=_0x1b3b16[_0x439be7(0x177)];}else{if(_0x571154[_0x439be7(0x149)]){const _0x50e144=await withSpinner('Resolving\x20folder\x20\x27'+_0x571154[_0x439be7(0x149)]+_0x439be7(0x168),()=>_0x6961eb[_0x439be7(0x14d)][_0x439be7(0x16e)](_0x32d3e5,_0x571154[_0x439be7(0x149)]),{'verbose':_0x571154[_0x439be7(0x174)]});_0x525762=_0x50e144[_0x439be7(0x165)];}}_0x571154[_0x439be7(0x174)]&&_0x525762&&console[_0x439be7(0x179)](_0x439be7(0x15c)+_0x525762);const _0x3b0f9c=await loadJSONFromOptions(_0x571154[_0x439be7(0x154)],_0x571154[_0x439be7(0x171)]),_0x123ae3={'name':_0x4515c7,'description':_0x571154['description'],'rule':_0x3b0f9c,'kind':_0x571154['kind']!==undefined?parseInt(_0x571154['kind'],0xa):undefined,'isVisible':_0x571154['invisible']?![]:undefined,'segmentFolderId':_0x525762,'countPopulation':_0x571154[_0x439be7(0x151)]?![]:undefined},_0x29d53c=await withSpinner(_0x439be7(0x153)+_0x4515c7+_0x439be7(0x168),()=>_0x6961eb[_0x439be7(0x14d)]['createSegment'](_0x32d3e5,_0x123ae3),{'verbose':_0x571154['verbose']}),_0x372910=_0x29d53c['data'];return console[_0x439be7(0x179)](_0x439be7(0x15b)+_0x372910['name']+_0x439be7(0x15e)+_0x372910['id']),_0x890e2e!==_0x322f03&&console['error'](_0x439be7(0x150)+_0x890e2e),await handleSDKOutput([_0x372910],_0x571154),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x94bb47=a31_0xf1c6;(function(_0x198e9f,_0x472b42){const _0x36d4cb=a31_0xf1c6,_0x1ee533=_0x198e9f();while(!![]){try{const _0x3423c1=parseInt(_0x36d4cb(0x16f))/0x1+-parseInt(_0x36d4cb(0x17b))/0x2*(parseInt(_0x36d4cb(0x180))/0x3)+parseInt(_0x36d4cb(0x174))/0x4+-parseInt(_0x36d4cb(0x16b))/0x5*(parseInt(_0x36d4cb(0x179))/0x6)+-parseInt(_0x36d4cb(0x182))/0x7+parseInt(_0x36d4cb(0x178))/0x8*(parseInt(_0x36d4cb(0x172))/0x9)+-parseInt(_0x36d4cb(0x183))/0xa*(-parseInt(_0x36d4cb(0x175))/0xb);if(_0x3423c1===_0x472b42)break;else _0x1ee533['push'](_0x1ee533['shift']());}catch(_0x114dd2){_0x1ee533['push'](_0x1ee533['shift']());}}}(a31_0x5bd9,0xf2da6));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a31_0xf1c6(_0x5736fb,_0x1b8ccc){const _0x5bd91b=a31_0x5bd9();return a31_0xf1c6=function(_0xf1c6d0,_0xb7d036){_0xf1c6d0=_0xf1c6d0-0x16b;let _0x1f6dce=_0x5bd91b[_0xf1c6d0];return _0x1f6dce;},a31_0xf1c6(_0x5736fb,_0x1b8ccc);}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a31_0x94bb47(0x173);[a31_0x94bb47(0x176)]=a31_0x94bb47(0x177);async['execute'](_0x3c72da){const _0x2f10a0=a31_0x94bb47,{options:_0x4f8c2b,args:_0x24d54d,tdx:_0x29ff42}=_0x3c72da,_0x59f317=_0x24d54d[0x0]||_0x4f8c2b[_0x2f10a0(0x17f)];if(!_0x59f317)return console[_0x2f10a0(0x184)](_0x2f10a0(0x16c)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x2f10a0(0x184)](_0x2f10a0(0x185)),0x1;_0x4f8c2b[_0x2f10a0(0x181)]&&(console['error']('Site:\x20'+_0x4f8c2b[_0x2f10a0(0x16d)]),console['error'](_0x2f10a0(0x17d)+_0x59f317));const _0x456707=await withSpinner(_0x2f10a0(0x17a)+_0x59f317+_0x2f10a0(0x187),()=>_0x29ff42[_0x2f10a0(0x188)][_0x2f10a0(0x17c)](_0x59f317),{'verbose':_0x4f8c2b[_0x2f10a0(0x181)]}),_0x5f2615=_0x456707[_0x2f10a0(0x16e)];console[_0x2f10a0(0x184)](_0x2f10a0(0x186)+_0x5f2615[_0x2f10a0(0x17e)]+_0x2f10a0(0x171)+(_0x5f2615[_0x2f10a0(0x17e)]!==0x1?'s':''));if(_0x4f8c2b['json']||_0x4f8c2b[_0x2f10a0(0x170)])return await handleSDKOutput(_0x5f2615,_0x4f8c2b),0x0;return displayFieldsHumanReadable(_0x5f2615,_0x59f317),0x0;}}function a31_0x5bd9(){const _0x4699ad=['site','data','1250231SyrqwD','jsonl','\x20field','36KeJfEv','segment:fields','805220Grbloj','95051HJZBbz','description','List\x20available\x20fields\x20for\x20segmentation','354792oZsowa','12ZIKlzj','Listing\x20fields\x20for\x20\x27','2MlZfou','listFields','Parent\x20segment:\x20','length','parentSegment','28182McwYbo','verbose','5860582RxcAwh','1280YpyKAt','error','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','✔\x20Found\x20','\x27...','segment','2234085XRADIJ','Error:\x20Parent\x20segment\x20name\x20is\x20required'];a31_0x5bd9=function(){return _0x4699ad;};return a31_0x5bd9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a32_0xc2e6(_0x3ea69d,_0x59a585){const _0x32e554=a32_0x32e5();return a32_0xc2e6=function(_0xc2e64a,_0x5ce28f){_0xc2e64a=_0xc2e64a-0x93;let _0x10afbe=_0x32e554[_0xc2e64a];return _0x10afbe;},a32_0xc2e6(_0x3ea69d,_0x59a585);}const a32_0xfd7ed9=a32_0xc2e6;function a32_0x32e5(){const _0x25b8ab=['708172hrFESb','1923275pXiYIK','log','4556232enfsRo','json','execute','name','error','Context\x20details:','230HBIWwL','stringify','segmentPath','1317123AAYwFU','description','943894edxuwW','segment:pwd','format','root','2pFeEOq','jsonl','345798OLlGWs','\x20\x20Path:\x20','12arruLr','248609gLmgWE'];a32_0x32e5=function(){return _0x25b8ab;};return a32_0x32e5();}(function(_0x665a6,_0x22f8f1){const _0x5e743e=a32_0xc2e6,_0x5a6b62=_0x665a6();while(!![]){try{const _0x15a300=parseInt(_0x5e743e(0xa9))/0x1*(parseInt(_0x5e743e(0xa4))/0x2)+-parseInt(_0x5e743e(0x9e))/0x3+parseInt(_0x5e743e(0xaa))/0x4+parseInt(_0x5e743e(0x93))/0x5+parseInt(_0x5e743e(0xa8))/0x6*(parseInt(_0x5e743e(0xa0))/0x7)+parseInt(_0x5e743e(0x95))/0x8+parseInt(_0x5e743e(0xa6))/0x9*(-parseInt(_0x5e743e(0x9b))/0xa);if(_0x15a300===_0x22f8f1)break;else _0x5a6b62['push'](_0x5a6b62['shift']());}catch(_0x1c4fb9){_0x5a6b62['push'](_0x5a6b62['shift']());}}}(a32_0x32e5,0x4fc75));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a32_0xfd7ed9(0x98)]=a32_0xfd7ed9(0xa1);[a32_0xfd7ed9(0x9f)]='Show\x20current\x20segment/folder\x20context';async[a32_0xfd7ed9(0x97)](_0x47029a){const _0x27d701=a32_0xfd7ed9,{options:_0x4cfd74}=_0x47029a;try{const _0x417ed7=_0x4cfd74[_0x27d701(0x9d)];if(!_0x417ed7)return _0x4cfd74[_0x27d701(0xa2)]===_0x27d701(0x96)||_0x4cfd74[_0x27d701(0xa2)]==='jsonl'?console[_0x27d701(0x94)](JSON[_0x27d701(0x9c)]({'path':'/','type':_0x27d701(0xa3)})):console[_0x27d701(0x94)]('/'),0x0;if(_0x4cfd74[_0x27d701(0xa2)]==='json'||_0x4cfd74[_0x27d701(0xa2)]===_0x27d701(0xa5)){const _0x2cf7bb={'path':_0x417ed7};console[_0x27d701(0x94)](JSON[_0x27d701(0x9c)](_0x2cf7bb));}else console[_0x27d701(0x94)](_0x417ed7),_0x4cfd74['verbose']&&(console[_0x27d701(0x99)](''),console[_0x27d701(0x99)](_0x27d701(0x9a)),console[_0x27d701(0x99)](_0x27d701(0xa7)+_0x417ed7),console['error'](''),console[_0x27d701(0x99)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x27d701(0x99)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x4a6dd1){throw _0x4a6dd1;}}}
|