@treasuredata/tdx 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +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/connection-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-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/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/user-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/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.d.ts +11 -19
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +1 -1
- package/dist/proxy/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/conversation-utils.js.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.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/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.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/async.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-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0xe4513=a27_0x545b;(function(_0x445de0,_0x59044d){const _0x6886b3=a27_0x545b,_0x6a0ae6=_0x445de0();while(!![]){try{const _0x34688c=parseInt(_0x6886b3(0x28e))/0x1+parseInt(_0x6886b3(0x1c7))/0x2+-parseInt(_0x6886b3(0x196))/0x3+parseInt(_0x6886b3(0x192))/0x4+parseInt(_0x6886b3(0x27f))/0x5*(parseInt(_0x6886b3(0x176))/0x6)+parseInt(_0x6886b3(0x1c6))/0x7*(parseInt(_0x6886b3(0x25b))/0x8)+-parseInt(_0x6886b3(0x25c))/0x9;if(_0x34688c===_0x59044d)break;else _0x6a0ae6['push'](_0x6a0ae6['shift']());}catch(_0x25acbd){_0x6a0ae6['push'](_0x6a0ae6['shift']());}}}(a27_0x32a9,0xbafbd));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0x2eadbd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a27_0x393c4e from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0xe4513(0x270),LEGACY_PARENT_SEGMENT_DIR=a27_0xe4513(0x190);function openBrowser(_0x1bcf64){const _0xd1b997=a27_0xe4513,_0x17b786=process[_0xd1b997(0x182)],_0x5a1389=_0x17b786==='darwin'?_0xd1b997(0x181):_0x17b786===_0xd1b997(0x251)?_0xd1b997(0x246):_0xd1b997(0x21b);spawn(_0x5a1389,[_0x1bcf64],{'detached':!![],'stdio':_0xd1b997(0x211)})['unref']();}function sanitizeFileName(_0x1d7209){const _0x5dc4e3=a27_0xe4513;return _0x1d7209[_0x5dc4e3(0x1c4)]()[_0x5dc4e3(0x1bf)](/[/\\:*?"<>|]/g,'-')[_0x5dc4e3(0x1bf)](/\s+/g,'-')[_0x5dc4e3(0x1bf)](/-+/g,'-')[_0x5dc4e3(0x1bf)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0xed170b=a27_0xe4513;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x547270=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x547270['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xed170b(0x257)](a27_0x393c4e['yellow'](_0xed170b(0x19b)+LEGACY_PARENT_SEGMENT_DIR+_0xed170b(0x256)+PARENT_SEGMENT_DIR+_0xed170b(0x1dd))),console[_0xed170b(0x257)](a27_0x393c4e['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xed170b(0x259))),![];console[_0xed170b(0x257)](a27_0x393c4e[_0xed170b(0x274)](_0xed170b(0x1f2)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a27_0x393c4e[_0xed170b(0x20c)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3f1f5d){const _0x45176f=_0x3f1f5d instanceof Error?_0x3f1f5d[_0xed170b(0x1d5)]:String(_0x3f1f5d);return console[_0xed170b(0x257)](a27_0x393c4e['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x45176f+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a27_0xe4513(0x1d0)](_0x596470){const _0x1d1c9a=a27_0xe4513;return migrateLegacyDirectory(),super[_0x1d1c9a(0x1d0)](_0x596470);}}function resolveYamlFile(_0xbf1dc5){const _0xb2aae=a27_0xe4513;if(_0xbf1dc5['endsWith'](_0xb2aae(0x24b))||_0xbf1dc5[_0xb2aae(0x220)](_0xb2aae(0x1c3)))return _0xbf1dc5;return a27_0x2eadbd[_0xb2aae(0x1aa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xbf1dc5)+'.yml');}function formatProgressMessage(_0x555582){const _0x5d31d0=a27_0xe4513,_0x7fc1cd=_0x555582[_0x5d31d0(0x1ff)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x7fc1cd){const [,_0x3b973d,_0x2dc7f3,_0x36fe5e='']=_0x7fc1cd;return a27_0x393c4e[_0x5d31d0(0x21d)](_0x3b973d+':')+'\x20'+_0x2dc7f3+a27_0x393c4e[_0x5d31d0(0x21d)](_0x36fe5e);}return a27_0x393c4e[_0x5d31d0(0x21d)](_0x555582);}function showFileNotFoundError(_0x3d64cc,_0x62b8f8){const _0x120742=a27_0xe4513;console[_0x120742(0x257)](a27_0x393c4e[_0x120742(0x25f)](_0x120742(0x267)+_0x3d64cc+'\x0a')),console['error'](a27_0x393c4e[_0x120742(0x1cc)](_0x120742(0x177)+_0x62b8f8+_0x120742(0x1e5)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x20a);[a27_0xe4513(0x21f)]=a27_0xe4513(0x283);async[a27_0xe4513(0x1b0)](_0x5414e4){const _0x1c25e7=a27_0xe4513,{options:_0x2a4f94,args:_0x361bb6,tdx:_0x297cad}=_0x5414e4,_0x5d3294=_0x361bb6[0x0];_0x2a4f94[_0x1c25e7(0x28f)]&&(console[_0x1c25e7(0x257)](_0x1c25e7(0x175)+_0x2a4f94[_0x1c25e7(0x27c)]),_0x5d3294&&console[_0x1c25e7(0x257)]('Pattern:\x20'+_0x5d3294));const _0x1e5493=await withSpinner(_0x5d3294?_0x1c25e7(0x26a)+_0x5d3294+'\x27...':_0x1c25e7(0x277),()=>_0x297cad[_0x1c25e7(0x20f)]['listParents'](),{'verbose':_0x2a4f94[_0x1c25e7(0x28f)]});let _0x434746=_0x1e5493['data'];if(_0x5d3294){const _0x4e49b3=_0x5d3294[_0x1c25e7(0x1bf)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x1c25e7(0x1bf)](/\?/g,'.'),_0x273e84=new RegExp('^'+_0x4e49b3+'$','i');_0x434746=_0x434746[_0x1c25e7(0x247)](_0x1b9496=>_0x273e84[_0x1c25e7(0x236)](_0x1b9496[_0x1c25e7(0x189)][_0x1c25e7(0x262)]));}_0x434746[_0x1c25e7(0x210)]((_0x43175f,_0x78e1e0)=>_0x43175f[_0x1c25e7(0x189)][_0x1c25e7(0x262)][_0x1c25e7(0x215)](_0x78e1e0['attributes'][_0x1c25e7(0x262)])),console[_0x1c25e7(0x257)](_0x1c25e7(0x25d)+_0x434746[_0x1c25e7(0x239)]+_0x1c25e7(0x1f1)+(_0x434746[_0x1c25e7(0x239)]!==0x1?'s':''));if(_0x2a4f94[_0x1c25e7(0x1cf)]===_0x1c25e7(0x253)||_0x2a4f94[_0x1c25e7(0x1cf)]==='jsonl')await handleSDKOutput(_0x434746,_0x2a4f94);else{if(_0x434746['length']===0x0)_0x5d3294?console['log'](_0x1c25e7(0x22c)+_0x5d3294):console['log']('No\x20parent\x20segments\x20found');else for(const _0x4c0560 of _0x434746){const _0x34238d=_0x4c0560['attributes'][_0x1c25e7(0x282)]?a27_0x393c4e[_0x1c25e7(0x21d)]('\x20('+formatRows(_0x4c0560['attributes'][_0x1c25e7(0x282)])+')'):'';console['log'](_0x1c25e7(0x1f7)+_0x4c0560[_0x1c25e7(0x189)][_0x1c25e7(0x262)]+_0x34238d);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x184);['description']='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0xe4513(0x1b0)](_0x375306){const _0x467244=a27_0xe4513,{options:_0x1d2980,args:_0x28b50d,tdx:_0x523542}=_0x375306;console[_0x467244(0x257)](_0x467244(0x1ab)+_0x467244(0x18a)+_0x467244(0x233));const _0x34bf47=_0x1d2980;if(_0x28b50d[_0x467244(0x239)]===0x0)return console['error'](_0x467244(0x1f6)),console[_0x467244(0x257)](_0x467244(0x273)),0x1;const _0x50ab66=_0x28b50d[0x0];if(!_0x34bf47[_0x467244(0x19a)]||!_0x34bf47['table'])return console[_0x467244(0x257)](_0x467244(0x1e0)),console[_0x467244(0x257)](_0x467244(0x273)),0x1;_0x34bf47[_0x467244(0x28f)]&&(console['error'](_0x467244(0x175)+_0x34bf47[_0x467244(0x27c)]),console[_0x467244(0x257)](_0x467244(0x24e)+_0x50ab66),console['error'](_0x467244(0x248)+_0x34bf47['database']),console[_0x467244(0x257)](_0x467244(0x1f3)+_0x34bf47['table']));const _0x382391=await loadJSONFromOptions(_0x34bf47['attributes'],_0x34bf47[_0x467244(0x261)]),_0x142f3b=await loadJSONFromOptions(_0x34bf47[_0x467244(0x1a1)],_0x34bf47[_0x467244(0x1f5)]),_0x52e895=await loadJSONFromOptions(_0x34bf47[_0x467244(0x243)],_0x34bf47[_0x467244(0x183)]),_0x3eb728={'name':_0x50ab66,'description':_0x34bf47[_0x467244(0x21f)],'scheduleType':_0x34bf47[_0x467244(0x279)],'scheduleOption':_0x34bf47[_0x467244(0x1a0)],'timezone':_0x34bf47[_0x467244(0x255)],'master':{'parentDatabaseName':_0x34bf47['database'],'parentTableName':_0x34bf47[_0x467244(0x258)]},'attributes':_0x382391,'behaviors':_0x142f3b,'customerGroup':_0x52e895},_0x2cc7fc=await withSpinner(_0x467244(0x221)+_0x50ab66+'\x27...',()=>_0x523542[_0x467244(0x20f)]['createParent'](_0x3eb728),{'verbose':_0x1d2980[_0x467244(0x28f)]}),_0x9ab870=_0x2cc7fc[_0x467244(0x226)];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x9ab870[_0x467244(0x262)]+_0x467244(0x1af)+_0x9ab870['id']),await handleSDKOutput([_0x9ab870],_0x1d2980),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0xe4513(0x1b0)](_0x3d28c1){const _0x2db336=a27_0xe4513,{options:_0xf5407a,args:_0x29243d,tdx:_0xdd5c59}=_0x3d28c1;console[_0x2db336(0x257)](_0x2db336(0x1b5)+_0x2db336(0x18a)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3aabc9=_0xf5407a;if(_0x29243d[_0x2db336(0x239)]===0x0)return console[_0x2db336(0x257)](_0x2db336(0x1f6)),console[_0x2db336(0x257)](_0x2db336(0x288)),0x1;const _0x1a64ac=_0x29243d[0x0];_0x3aabc9[_0x2db336(0x28f)]&&(console[_0x2db336(0x257)](_0x2db336(0x175)+_0x3aabc9[_0x2db336(0x27c)]),console['error'](_0x2db336(0x198)+_0x1a64ac));const _0x13e8ea=await withSpinner(_0x2db336(0x241)+_0x1a64ac+_0x2db336(0x275),()=>_0xdd5c59['segment']['getParentFull'](_0x1a64ac),{'verbose':_0x3aabc9[_0x2db336(0x28f)]}),_0x14f8b1=_0x13e8ea['data'],_0x505bc7=await loadJSONFromOptions(_0x3aabc9['addAttributes'],_0x3aabc9[_0x2db336(0x1bc)]),_0x813b1e=await loadJSONFromOptions(_0x3aabc9[_0x2db336(0x23b)],_0x3aabc9['addBehaviorsFile']),_0x5bb024={'name':_0x14f8b1['name'],'description':_0x3aabc9['description']!==undefined?_0x3aabc9['description']:_0x14f8b1[_0x2db336(0x21f)],'scheduleType':_0x3aabc9[_0x2db336(0x279)]!==undefined?_0x3aabc9[_0x2db336(0x279)]:_0x14f8b1['scheduleType'],'scheduleOption':_0x3aabc9['scheduleOption']!==undefined?_0x3aabc9[_0x2db336(0x1a0)]:_0x14f8b1[_0x2db336(0x1a0)],'timezone':_0x3aabc9[_0x2db336(0x255)]!==undefined?_0x3aabc9[_0x2db336(0x255)]:_0x14f8b1['timezone'],'master':_0x14f8b1[_0x2db336(0x1ec)],'attributes':_0x505bc7?[..._0x14f8b1['attributes']||[],..._0x505bc7]:_0x14f8b1[_0x2db336(0x189)],'behaviors':_0x813b1e?[..._0x14f8b1[_0x2db336(0x1a1)]||[],..._0x813b1e]:_0x14f8b1[_0x2db336(0x1a1)],'customerGroup':_0x14f8b1[_0x2db336(0x243)]},_0x1471d6=await withSpinner(_0x2db336(0x1d9)+_0x1a64ac+_0x2db336(0x275),()=>_0xdd5c59[_0x2db336(0x20f)][_0x2db336(0x23a)](_0x1a64ac,_0x5bb024),{'verbose':_0x3aabc9[_0x2db336(0x28f)]}),_0x205037=_0x1471d6[_0x2db336(0x226)];return console['error'](_0x2db336(0x24d)+_0x205037['name']+'\x27'),await handleSDKOutput([_0x205037],_0x3aabc9),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x18b);['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a27_0xe4513(0x1b0)](_0x39978e){const _0x706327=a27_0xe4513,{options:_0x360a04,args:_0x434c6,tdx:_0x204405}=_0x39978e,_0x2feb6a=_0x360a04,_0x4559e2=_0x434c6[0x0]||_0x360a04[_0x706327(0x17a)];if(!_0x4559e2)return console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x25f)](_0x706327(0x229))),console['error'](_0x706327(0x1bb)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x1cc)](_0x706327(0x1c2))),0x1;if(_0x2feb6a[_0x706327(0x214)]&&_0x2feb6a[_0x706327(0x292)])return console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x25f)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console['error'](a27_0x393c4e['dim'](_0x706327(0x1a4))),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x21d)](_0x706327(0x18f)+PARENT_SEGMENT_DIR+_0x706327(0x240))),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x1cc)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x534a91=_0x2feb6a[_0x706327(0x292)]||a27_0x2eadbd[_0x706327(0x1aa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4559e2)+_0x706327(0x24b));_0x2feb6a['verbose']&&(console[_0x706327(0x257)]('Site:\x20'+_0x2feb6a['site']),console[_0x706327(0x257)]('Parent\x20segment:\x20'+_0x4559e2),console['error'](_0x706327(0x271)+_0x534a91));const _0x4dd2ba=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4559e2+'\x27...',()=>_0x204405[_0x706327(0x20f)][_0x706327(0x26d)](_0x4559e2),{'verbose':_0x2feb6a[_0x706327(0x28f)]}),_0x553d9e=_0x4dd2ba['data'];if(existsSync(_0x534a91)){const _0x4bddb5=readFileSync(_0x534a91,_0x706327(0x1d1)),_0xff2e1c=generateDiff(_0x4bddb5,_0x553d9e);if(!hasChanges(_0xff2e1c))console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x266)+a27_0x393c4e['cyan'](_0x534a91)+_0x706327(0x289));else{console[_0x706327(0x257)]('\x0aChanges\x20to\x20\x27'+_0x534a91+'\x27:'),console[_0x706327(0x257)]('─'[_0x706327(0x18d)](0x3c)),console['error'](formatDiffWithColors(_0xff2e1c)),console[_0x706327(0x257)]('─'[_0x706327(0x18d)](0x3c));if(!_0x2feb6a[_0x706327(0x22e)]){const _0x54a040=await confirmKey('Overwrite\x20\x27'+_0x534a91+'\x27?');if(!_0x54a040)return console[_0x706327(0x257)](_0x706327(0x260)),0x1;}writeFileSync(_0x534a91,_0x553d9e,_0x706327(0x1d1)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x27d)+a27_0x393c4e[_0x706327(0x1cc)](_0x534a91));}}else{const _0x5e3cb4=a27_0x2eadbd[_0x706327(0x205)](_0x534a91);!existsSync(_0x5e3cb4)&&mkdirSync(_0x5e3cb4,{'recursive':!![]}),writeFileSync(_0x534a91,_0x553d9e,_0x706327(0x1d1)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x27d)+a27_0x393c4e['cyan'](_0x534a91));}return saveSessionContext({'parent_segment':_0x4559e2},_0x2feb6a['session']),console[_0x706327(0x257)](a27_0x393c4e['green']('✔')+'\x20Context\x20set:\x20'+a27_0x393c4e['dim'](_0x706327(0x190))+_0x706327(0x18c)+a27_0x393c4e[_0x706327(0x1cc)](_0x4559e2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x1a5);[a27_0xe4513(0x21f)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a27_0xe4513(0x1b0)](_0x3be310){const _0x51e7e3=a27_0xe4513,{options:_0xe40479,args:_0x4a4bc2,tdx:_0x2036d0}=_0x3be310,_0x1b6870=_0xe40479,_0x2fd141=_0x4a4bc2[0x0]||_0xe40479[_0x51e7e3(0x17a)];if(!_0x2fd141)return console[_0x51e7e3(0x257)](a27_0x393c4e['red'](_0x51e7e3(0x229))),console[_0x51e7e3(0x257)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console[_0x51e7e3(0x257)](a27_0x393c4e['cyan']('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first')),0x1;const _0xaebbc2=resolveYamlFile(_0x2fd141);if(!existsSync(_0xaebbc2))return showFileNotFoundError(_0xaebbc2,_0x2fd141),0x1;_0x1b6870['verbose']&&(console[_0x51e7e3(0x257)]('Site:\x20'+_0x1b6870[_0x51e7e3(0x27c)]),console[_0x51e7e3(0x257)]('YAML\x20file:\x20'+_0xaebbc2));let _0x314748;try{_0x314748=readFileSync(_0xaebbc2,_0x51e7e3(0x1d1));}catch(_0x33e732){const _0x2932d5=_0x33e732 instanceof Error?_0x33e732[_0x51e7e3(0x1d5)]:String(_0x33e732);return console[_0x51e7e3(0x257)](_0x51e7e3(0x278)+_0x2932d5),0x1;}const _0x3a7f8a=await withSpinner(_0x51e7e3(0x1fd),()=>_0x2036d0[_0x51e7e3(0x20f)]['pushParentYaml'](_0x314748),{'verbose':_0x1b6870[_0x51e7e3(0x28f)]}),_0x557f1a=_0x3a7f8a[_0x51e7e3(0x226)],{isNew:_0x24704c,name:_0x5a23c3,hasChanges:_0x936347,diffFormatted:_0x50f9e2}=_0x557f1a;if(!_0x936347)return console[_0x51e7e3(0x257)](_0x51e7e3(0x1a3)+_0x5a23c3+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x24704c?console[_0x51e7e3(0x257)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x5a23c3+'\x27:'):console[_0x51e7e3(0x257)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x5a23c3+'\x27:');console[_0x51e7e3(0x257)]('─'[_0x51e7e3(0x18d)](0x3c)),console[_0x51e7e3(0x257)](_0x50f9e2),console['error']('─'[_0x51e7e3(0x18d)](0x3c));const _0x2f1ee5=_0x24704c?_0x51e7e3(0x197)+_0x5a23c3+'\x27?':_0x51e7e3(0x18e)+_0x5a23c3+'\x27?';if(!_0x1b6870['yes']){const _0x45a613=await confirmKey(_0x2f1ee5);if(!_0x45a613)return console[_0x51e7e3(0x257)]('Aborted.'),0x1;}const _0x4a095d=_0x24704c?_0x51e7e3(0x28a):_0x51e7e3(0x204),_0x1ad3ba=await withSpinner(_0x4a095d+_0x51e7e3(0x1b4)+_0x5a23c3+_0x51e7e3(0x275),()=>_0x557f1a[_0x51e7e3(0x27e)](),{'verbose':_0x1b6870[_0x51e7e3(0x28f)]}),_0x3991f0=_0x1ad3ba['data'],_0x390646=getConsoleNextUrl(_0x1b6870[_0x51e7e3(0x27c)],_0x51e7e3(0x26b)+_0x3991f0['id']),_0x9a7de6=_0x24704c?_0x51e7e3(0x20b):_0x51e7e3(0x1da);return console['error']('✔\x20'+_0x9a7de6+'\x20parent\x20segment\x20\x27'+_0x3991f0[_0x51e7e3(0x262)]+'\x27'),console[_0x51e7e3(0x257)]('\x20\x20'+_0x390646),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x21a);[a27_0xe4513(0x21f)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a27_0xe4513(0x1b0)](_0x537193){const _0x454202=a27_0xe4513,{options:_0x52384b,args:_0x15dd46,tdx:_0x4370e4}=_0x537193,_0x1e063a=_0x52384b,_0xddacae=_0x15dd46[0x0]||_0x52384b['parentSegment'];if(!_0xddacae)return console[_0x454202(0x257)](a27_0x393c4e[_0x454202(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x454202(0x257)](_0x454202(0x23d)),console[_0x454202(0x257)](_0x454202(0x1f0)),console[_0x454202(0x257)](_0x454202(0x1f9)),console['error']('\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)'),console[_0x454202(0x257)](_0x454202(0x193)),console[_0x454202(0x257)](a27_0x393c4e[_0x454202(0x1cc)](_0x454202(0x1ca))),0x1;const _0x521335=resolveYamlFile(_0xddacae);if(!existsSync(_0x521335))return showFileNotFoundError(_0x521335,_0xddacae),0x1;_0x1e063a[_0x454202(0x28f)]&&(console[_0x454202(0x257)](_0x454202(0x175)+_0x1e063a['site']),console['error'](_0x454202(0x1b2)+_0x521335));let _0x35f1bc;try{_0x35f1bc=readFileSync(_0x521335,_0x454202(0x1d1));}catch(_0x342500){const _0x374612=_0x342500 instanceof Error?_0x342500[_0x454202(0x1d5)]:String(_0x342500);return console[_0x454202(0x257)](_0x454202(0x278)+_0x374612),0x1;}const _0x2a99d8=createCommandSpinner(a27_0x393c4e[_0x454202(0x21d)]('Validating\x20configuration...'),{'verbose':_0x1e063a[_0x454202(0x28f)]});_0x2a99d8[_0x454202(0x246)]();const _0x39e43c={'onProgress':_0x1a83e9=>{const _0x28272e=_0x454202;_0x2a99d8[_0x28272e(0x1de)]=formatProgressMessage(_0x1a83e9);}};if(_0x1e063a[_0x454202(0x1ec)])_0x39e43c[_0x454202(0x1ec)]=!![];if(_0x1e063a[_0x454202(0x17f)])_0x39e43c[_0x454202(0x17f)]=!![];_0x1e063a[_0x454202(0x219)]&&(_0x39e43c[_0x454202(0x219)]=_0x1e063a[_0x454202(0x219)]);_0x1e063a[_0x454202(0x206)]&&(_0x39e43c['behavior']=_0x1e063a[_0x454202(0x206)]);if(_0x1e063a['interval'])_0x39e43c['interval']=_0x1e063a[_0x454202(0x1bd)];let _0x3f65ad;try{_0x3f65ad=await _0x4370e4[_0x454202(0x20f)][_0x454202(0x208)](_0x35f1bc,_0x39e43c),_0x2a99d8[_0x454202(0x1b3)]();}catch(_0xe196d1){_0x2a99d8[_0x454202(0x1b3)]();throw _0xe196d1;}const _0x48c68c=_0x1e063a[_0x454202(0x1bd)]||_0x454202(0x1dc);return this[_0x454202(0x272)](_0x3f65ad,_0x39e43c,_0x521335,_0x48c68c),_0x3f65ad['allValid']?0x0:0x1;}[a27_0xe4513(0x272)](_0x143da4,_0x10d31d,_0x139a06,_0x1f9cf1){const _0x42c44d=a27_0xe4513;console[_0x42c44d(0x257)]('\x0a'+a27_0x393c4e[_0x42c44d(0x1d6)](_0x42c44d(0x269))+'\x20'+_0x143da4['name']),console[_0x42c44d(0x257)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x143da4);if(typeof _0x10d31d[_0x42c44d(0x219)]===_0x42c44d(0x1a6)){this['displayAttributesStats'](_0x143da4),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,'attribute',_0x10d31d[_0x42c44d(0x219)]);return;}if(_0x10d31d[_0x42c44d(0x219)]===!![]){this[_0x42c44d(0x245)](_0x143da4),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,_0x42c44d(0x189));return;}if(typeof _0x10d31d['behavior']==='string'){this['displayBehaviorsStats'](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,_0x42c44d(0x206),_0x10d31d[_0x42c44d(0x206)]);return;}if(_0x10d31d[_0x42c44d(0x206)]===!![]){this[_0x42c44d(0x223)](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this['displayPreviewHints'](_0x139a06,_0x1f9cf1,_0x42c44d(0x1a1));return;}this[_0x42c44d(0x245)](_0x143da4),this[_0x42c44d(0x223)](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,'all');}['displayPreviewHints'](_0x248f3e,_0x2190a4,_0x224222,_0x43602f){const _0x1a148a=a27_0xe4513;console[_0x1a148a(0x257)]('\x0a'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x252)));const _0x437d63=_0x2190a4!==_0x1a148a(0x1dc)?_0x1a148a(0x232)+_0x2190a4:'';if(_0x224222==='attribute'&&_0x43602f)console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e['dim'](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x22a)+_0x43602f+'\x22'+_0x437d63));else{if(_0x224222===_0x1a148a(0x206)&&_0x43602f)console['error']('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x24f)+_0x43602f+'\x22'+_0x437d63));else(_0x224222===_0x1a148a(0x189)||_0x224222===_0x1a148a(0x1fb))&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x19d)+_0x437d63));}(_0x224222==='behaviors'||_0x224222===_0x1a148a(0x1fb))&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)]('tdx\x20segment\x20parent\x20preview\x20'+_0x248f3e+_0x1a148a(0x1c9)+_0x437d63)),_0x224222===_0x1a148a(0x1fb)&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e['dim'](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x1a7)+_0x437d63));}['displayMasterInfo'](_0x1f773d){const _0x15f35b=a27_0xe4513,{master:_0x590b65}=_0x1f773d,_0x118efa=_0x590b65[_0x15f35b(0x24a)]?a27_0x393c4e[_0x15f35b(0x20c)]('✔'):a27_0x393c4e['red']('✘');console[_0x15f35b(0x257)]('\x0a'+a27_0x393c4e[_0x15f35b(0x21d)](_0x15f35b(0x1eb))),console['error'](_0x118efa+'\x20'+a27_0x393c4e[_0x15f35b(0x1d6)](_0x590b65[_0x15f35b(0x19a)]+'.'+_0x590b65[_0x15f35b(0x258)])),_0x590b65[_0x15f35b(0x24a)]?_0x590b65[_0x15f35b(0x20e)]!==undefined&&console[_0x15f35b(0x257)]('\x20\x20'+a27_0x393c4e[_0x15f35b(0x21d)](_0x15f35b(0x1e2))+'\x20'+a27_0x393c4e[_0x15f35b(0x1cc)](formatRows(_0x590b65['rowCount']))):console[_0x15f35b(0x257)]('\x20\x20'+a27_0x393c4e['red'](_0x15f35b(0x1ba))+'\x20'+_0x590b65[_0x15f35b(0x213)]);}[a27_0xe4513(0x245)](_0x4fa0d2){const _0x1ffb6c=a27_0xe4513;if(_0x4fa0d2[_0x1ffb6c(0x189)]['length']===0x0)return;console[_0x1ffb6c(0x257)]('\x0a'+a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x1fa)));for(const _0x14598f of _0x4fa0d2['attributes']){const _0x46e617=_0x14598f[_0x1ffb6c(0x24a)]?a27_0x393c4e[_0x1ffb6c(0x20c)]('✔'):a27_0x393c4e['red']('✘');let _0x59ecce='';if(_0x14598f[_0x1ffb6c(0x24a)]&&_0x14598f[_0x1ffb6c(0x291)]!==undefined&&_0x14598f[_0x1ffb6c(0x17d)]!==undefined){const _0x53567a=_0x14598f[_0x1ffb6c(0x17d)][_0x1ffb6c(0x19f)](0x1),_0x450d75=_0x14598f[_0x1ffb6c(0x17d)]>=0x50?a27_0x393c4e[_0x1ffb6c(0x20c)]:_0x14598f[_0x1ffb6c(0x17d)]>=0x32?a27_0x393c4e[_0x1ffb6c(0x274)]:a27_0x393c4e['red'];_0x59ecce='\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)]('Coverage:')+'\x20'+_0x450d75(_0x53567a+'%')+'\x20('+formatRows(_0x14598f[_0x1ffb6c(0x291)])+_0x1ffb6c(0x263);}console[_0x1ffb6c(0x257)](_0x46e617+'\x20'+a27_0x393c4e[_0x1ffb6c(0x1d6)](_0x14598f[_0x1ffb6c(0x262)])+_0x59ecce),console['error']('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x1e8))+'\x20'+a27_0x393c4e[_0x1ffb6c(0x1d6)](_0x14598f['database']+'.'+_0x14598f[_0x1ffb6c(0x258)]));const _0x6bea5c=_0x14598f['joinKey']===_0x14598f[_0x1ffb6c(0x27a)]?a27_0x393c4e[_0x1ffb6c(0x21d)]('Join\x20on:')+'\x20'+_0x14598f['joinKey']:a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x254))+'\x20'+_0x14598f[_0x1ffb6c(0x25a)]+_0x1ffb6c(0x18c)+_0x14598f[_0x1ffb6c(0x27a)];console[_0x1ffb6c(0x257)]('\x20\x20'+_0x6bea5c),console['error']('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)]('Columns:')),this[_0x1ffb6c(0x1cd)](_0x14598f[_0x1ffb6c(0x199)]),!_0x14598f[_0x1ffb6c(0x24a)]&&console[_0x1ffb6c(0x257)]('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x25f)](_0x1ffb6c(0x1ba))+'\x20'+_0x14598f['schemaError']);}}[a27_0xe4513(0x223)](_0x284d70,_0x5c0d0b){const _0x383aee=a27_0xe4513;if(_0x284d70['behaviors'][_0x383aee(0x239)]===0x0)return;console[_0x383aee(0x257)]('\x0a'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1c1))+'\x20'+a27_0x393c4e[_0x383aee(0x21d)]('('+_0x5c0d0b+')'));for(const _0x479c3a of _0x284d70['behaviors']){const _0x1f9b2e=_0x479c3a[_0x383aee(0x24a)]?a27_0x393c4e[_0x383aee(0x20c)]('✔'):a27_0x393c4e['red']('✘');let _0x4efea2='';if(_0x479c3a['schemaValid']&&_0x479c3a['customersWithEvents']!==undefined&&_0x479c3a[_0x383aee(0x25e)]!==undefined){const _0x2d4e01=_0x479c3a[_0x383aee(0x280)]?.[_0x383aee(0x19f)](0x1)||'?',_0x42cfe1=(_0x479c3a['customerPercent']??0x0)>=0x32?a27_0x393c4e[_0x383aee(0x20c)]:(_0x479c3a[_0x383aee(0x280)]??0x0)>=0x14?a27_0x393c4e[_0x383aee(0x274)]:a27_0x393c4e[_0x383aee(0x25f)];_0x4efea2='\x20'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1ed))+'\x20'+_0x42cfe1(formatRows(_0x479c3a[_0x383aee(0x231)]))+'\x20('+_0x2d4e01+'%)\x20'+a27_0x393c4e['dim'](_0x383aee(0x1c0))+'\x20'+a27_0x393c4e['cyan'](formatRows(_0x479c3a[_0x383aee(0x25e)]));}console[_0x383aee(0x257)](_0x1f9b2e+'\x20'+a27_0x393c4e['bold'](_0x479c3a['name'])+_0x4efea2),console[_0x383aee(0x257)]('\x20\x20'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1e8))+'\x20'+a27_0x393c4e[_0x383aee(0x1d6)](_0x479c3a[_0x383aee(0x19a)]+'.'+_0x479c3a[_0x383aee(0x258)]));const _0x9a5840=_0x479c3a[_0x383aee(0x25a)]===_0x479c3a[_0x383aee(0x27a)]?a27_0x393c4e['dim'](_0x383aee(0x1db))+'\x20'+_0x479c3a[_0x383aee(0x25a)]:a27_0x393c4e['dim'](_0x383aee(0x254))+'\x20'+_0x479c3a['joinKey']+_0x383aee(0x18c)+_0x479c3a[_0x383aee(0x27a)];console[_0x383aee(0x257)]('\x20\x20'+_0x9a5840),console['error']('\x20\x20'+a27_0x393c4e['dim'](_0x383aee(0x1d7))),this[_0x383aee(0x1cd)](_0x479c3a[_0x383aee(0x199)]),!_0x479c3a[_0x383aee(0x24a)]&&console['error']('\x20\x20'+a27_0x393c4e[_0x383aee(0x25f)]('Error:')+'\x20'+_0x479c3a['schemaError']);}}[a27_0xe4513(0x1cd)](_0x2f3615){const _0x5557cb=a27_0xe4513;for(const _0xf8eeb7 of _0x2f3615){_0xf8eeb7['label']===_0xf8eeb7[_0x5557cb(0x187)]||_0xf8eeb7[_0x5557cb(0x187)]==='*'?console[_0x5557cb(0x257)](_0x5557cb(0x1f8)+_0xf8eeb7['label']):console['error'](_0x5557cb(0x1f8)+_0xf8eeb7[_0x5557cb(0x188)]+'\x20'+a27_0x393c4e['dim']('('+_0xf8eeb7[_0x5557cb(0x187)]+')'));}}[a27_0xe4513(0x1f4)](_0x308b3e){const _0x31f453=a27_0xe4513;console[_0x31f453(0x257)]('─'[_0x31f453(0x18d)](0x3c));if(_0x308b3e[_0x31f453(0x17c)][_0x31f453(0x239)]>0x0){console[_0x31f453(0x257)]('\x0a'+a27_0x393c4e[_0x31f453(0x25f)](_0x31f453(0x1b9)));for(const _0x995649 of _0x308b3e['errors']){console[_0x31f453(0x257)]('\x20\x20'+a27_0x393c4e[_0x31f453(0x25f)]('•')+'\x20'+_0x995649);}}_0x308b3e[_0x31f453(0x222)]&&console[_0x31f453(0x257)]('\x0a'+a27_0x393c4e[_0x31f453(0x20c)]('✔')+_0x31f453(0x28d));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x264);[a27_0xe4513(0x21f)]=a27_0xe4513(0x1b6);async[a27_0xe4513(0x1b0)](_0x980ec9){const _0x573298=a27_0xe4513,{options:_0x4b4117,args:_0x164bf6,tdx:_0x19cd02}=_0x980ec9,_0x1238db=_0x4b4117,_0x43ec50=_0x164bf6[0x0]||_0x4b4117[_0x573298(0x17a)];if(!_0x43ec50)return console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x229))),console[_0x573298(0x257)](_0x573298(0x1ae)),console[_0x573298(0x257)](_0x573298(0x1e4)),console['error'](_0x573298(0x1e9)),console[_0x573298(0x257)](_0x573298(0x1fe)),console[_0x573298(0x257)](_0x573298(0x1d8)),console[_0x573298(0x257)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),console[_0x573298(0x257)](_0x573298(0x193)),console[_0x573298(0x257)](a27_0x393c4e['cyan'](_0x573298(0x1ca))),0x1;if(!_0x1238db[_0x573298(0x1ec)]&&!_0x1238db[_0x573298(0x219)]&&!_0x1238db[_0x573298(0x206)]&&!_0x1238db[_0x573298(0x17f)])return console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x194))),console[_0x573298(0x257)](_0x573298(0x1ae)),console['error'](_0x573298(0x1f0)),console[_0x573298(0x257)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x573298(0x257)](_0x573298(0x1fe)),console[_0x573298(0x257)](_0x573298(0x1d8)),console[_0x573298(0x257)](_0x573298(0x227)),0x1;const _0x544844=resolveYamlFile(_0x43ec50);if(!existsSync(_0x544844))return showFileNotFoundError(_0x544844,_0x43ec50),0x1;_0x1238db[_0x573298(0x28f)]&&(console[_0x573298(0x257)](_0x573298(0x175)+_0x1238db[_0x573298(0x27c)]),console[_0x573298(0x257)](_0x573298(0x1b2)+_0x544844));let _0x1e6c6a;try{_0x1e6c6a=readFileSync(_0x544844,_0x573298(0x1d1));}catch(_0x11e38e){const _0xedcfb0=_0x11e38e instanceof Error?_0x11e38e['message']:String(_0x11e38e);return console[_0x573298(0x257)](_0x573298(0x278)+_0xedcfb0),0x1;}let _0x274b95;try{_0x274b95=parseYamlString(_0x1e6c6a);}catch(_0x380012){const _0x412180=_0x380012 instanceof Error?_0x380012[_0x573298(0x1d5)]:String(_0x380012);return console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)]('Error\x20parsing\x20YAML:\x20'+_0x412180)),0x1;}if(_0x1238db[_0x573298(0x219)]===!![]||_0x1238db[_0x573298(0x219)]===''){const _0x4e64e4=_0x274b95[_0x573298(0x189)]?.['map'](_0x1c971a=>_0x1c971a[_0x573298(0x262)])||[];if(_0x4e64e4[_0x573298(0x239)]===0x0)console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x1a8)));else{console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x202))),console[_0x573298(0x257)](_0x573298(0x287));for(const _0x49b7dc of _0x4e64e4){console[_0x573298(0x257)]('\x20\x20'+a27_0x393c4e[_0x573298(0x1cc)](_0x49b7dc));}console['error'](_0x573298(0x265)+_0x43ec50+'\x20--attribute\x20\x22'+_0x4e64e4[0x0]+'\x22');}return 0x1;}if(_0x1238db[_0x573298(0x206)]===!![]||_0x1238db[_0x573298(0x206)]===''){const _0x11c77f=_0x274b95[_0x573298(0x1a1)]?.[_0x573298(0x200)](_0x2dea67=>_0x2dea67[_0x573298(0x262)])||[];if(_0x11c77f[_0x573298(0x239)]===0x0)console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x217))),console['error'](_0x573298(0x1d4));for(const _0x5e303a of _0x11c77f){console['error']('\x20\x20'+a27_0x393c4e['cyan'](_0x5e303a));}console[_0x573298(0x257)](_0x573298(0x265)+_0x43ec50+_0x573298(0x24f)+_0x11c77f[0x0]+'\x22');}return 0x1;}const _0x7ea2a8=createCommandSpinner(a27_0x393c4e[_0x573298(0x21d)](_0x573298(0x249)),{'verbose':_0x1238db[_0x573298(0x28f)]});_0x7ea2a8[_0x573298(0x246)]();const _0x2a3b15={'onProgress':_0x46be19=>{const _0x57e2cc=_0x573298;_0x7ea2a8[_0x57e2cc(0x1de)]=formatProgressMessage(_0x46be19);}};if(_0x1238db[_0x573298(0x1ec)])_0x2a3b15['master']=!![];if(_0x1238db[_0x573298(0x219)]&&typeof _0x1238db['attribute']===_0x573298(0x1a6))_0x2a3b15[_0x573298(0x219)]=_0x1238db[_0x573298(0x219)];if(_0x1238db[_0x573298(0x206)]&&typeof _0x1238db[_0x573298(0x206)]===_0x573298(0x1a6))_0x2a3b15['behavior']=_0x1238db[_0x573298(0x206)];if(_0x1238db[_0x573298(0x17f)])_0x2a3b15[_0x573298(0x17f)]=!![];if(_0x1238db[_0x573298(0x1bd)])_0x2a3b15[_0x573298(0x1bd)]=_0x1238db[_0x573298(0x1bd)];let _0x486efb;try{_0x486efb=await _0x19cd02['segment'][_0x573298(0x21e)](_0x1e6c6a,_0x2a3b15),_0x7ea2a8[_0x573298(0x1b3)]();}catch(_0x5a5ecc){_0x7ea2a8[_0x573298(0x1b3)]();throw _0x5a5ecc;}return await this[_0x573298(0x191)](_0x486efb,{'master':_0x1238db[_0x573298(0x1ec)],'attribute':typeof _0x1238db[_0x573298(0x219)]===_0x573298(0x1a6)?_0x1238db[_0x573298(0x219)]:undefined,'behavior':typeof _0x1238db[_0x573298(0x206)]==='string'?_0x1238db[_0x573298(0x206)]:undefined,'enriched':_0x1238db[_0x573298(0x17f)]}),_0x486efb['allValid']?0x0:0x1;}async[a27_0xe4513(0x191)](_0x5a4e2e,_0x2f9989){const _0x5d4e7b=a27_0xe4513;console[_0x5d4e7b(0x257)]('\x0a'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x5d4e7b(0x1d2))+'\x20'+_0x5a4e2e[_0x5d4e7b(0x262)]),console[_0x5d4e7b(0x257)]('═'['repeat'](0x3c));if(_0x2f9989['master']&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x521585=a27_0x393c4e[_0x5d4e7b(0x21d)]('Master:')+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x5a4e2e[_0x5d4e7b(0x1ec)][_0x5d4e7b(0x19a)]+'.'+_0x5a4e2e[_0x5d4e7b(0x1ec)]['table']);await this[_0x5d4e7b(0x24c)](_0x521585,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else{if(_0x2f9989[_0x5d4e7b(0x219)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x579597=a27_0x393c4e[_0x5d4e7b(0x21d)](_0x5d4e7b(0x28b))+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x2f9989['attribute']);await this[_0x5d4e7b(0x24c)](_0x579597,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else{if(_0x2f9989[_0x5d4e7b(0x206)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x131c3c=a27_0x393c4e['dim']('Behavior:')+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x2f9989[_0x5d4e7b(0x206)]);await this[_0x5d4e7b(0x24c)](_0x131c3c,_0x5a4e2e['sampleData']);}else{if(_0x2f9989[_0x5d4e7b(0x17f)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x41ecef=a27_0x393c4e[_0x5d4e7b(0x21d)]('Enriched:')+'\x20'+a27_0x393c4e['bold'](_0x5d4e7b(0x235));await this[_0x5d4e7b(0x24c)](_0x41ecef,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else!_0x5a4e2e['sampleData']&&console[_0x5d4e7b(0x257)](_0x5d4e7b(0x1df));}}}if(_0x5a4e2e['errors'][_0x5d4e7b(0x239)]>0x0){console[_0x5d4e7b(0x257)]('─'['repeat'](0x3c)),console[_0x5d4e7b(0x257)]('\x0a'+a27_0x393c4e['red']('Errors:'));for(const _0x37467c of _0x5a4e2e[_0x5d4e7b(0x17c)]){console['error']('\x20\x20'+a27_0x393c4e['red']('•')+'\x20'+_0x37467c);}}}async[a27_0xe4513(0x24c)](_0x2d37dd,_0x467583){const _0x426667=a27_0xe4513;if(_0x467583[_0x426667(0x239)]===0x0){console['error']('\x0a'+_0x2d37dd),console[_0x426667(0x257)](_0x426667(0x17b));return;}console[_0x426667(0x257)]('\x0a'+_0x2d37dd);const _0x398837=Object[_0x426667(0x284)](_0x467583[0x0])['map'](_0x223ba0=>({'name':_0x223ba0,'type':typeof _0x467583[0x0][_0x223ba0]===_0x426667(0x22f)?_0x426667(0x201):_0x426667(0x238)})),_0x3aee7f={'queryId':_0x426667(0x244),'columns':_0x398837,'data':_0x467583,'stats':{'state':_0x426667(0x1ad),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x467583[_0x426667(0x239)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x7f9d10=formatAsTable(_0x3aee7f,_0x467583[_0x426667(0x239)],!![]);await writeOutput(_0x7f9d10,undefined,_0x426667(0x258));}}function a27_0x545b(_0x47f12d,_0x521d1c){_0x47f12d=_0x47f12d-0x175;const _0x32a9bd=a27_0x32a9();let _0x545b49=_0x32a9bd[_0x47f12d];return _0x545b49;}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x23f);[a27_0xe4513(0x21f)]=a27_0xe4513(0x26e);async[a27_0xe4513(0x1b0)](_0x39bc7e){const _0x20524e=a27_0xe4513,{options:_0x4ec766,args:_0x3eb623,tdx:_0x1f538e}=_0x39bc7e,_0x479fbf=_0x4ec766,_0x10278f=_0x3eb623[0x0]||_0x4ec766[_0x20524e(0x17a)];if(!_0x10278f)return console[_0x20524e(0x257)](a27_0x393c4e[_0x20524e(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x20524e(0x257)](_0x20524e(0x1c5)),console[_0x20524e(0x257)](a27_0x393c4e[_0x20524e(0x1cc)](_0x20524e(0x1c2))),0x1;const _0x3880c6=resolveYamlFile(_0x10278f);if(existsSync(_0x3880c6)){_0x479fbf['verbose']&&console[_0x20524e(0x257)]('Found\x20YAML\x20file:\x20'+_0x3880c6);let _0x2daed;try{_0x2daed=readFileSync(_0x3880c6,_0x20524e(0x1d1));}catch(_0x58ddbb){const _0x53184b=_0x58ddbb instanceof Error?_0x58ddbb[_0x20524e(0x1d5)]:String(_0x58ddbb);return console[_0x20524e(0x257)](_0x20524e(0x278)+_0x53184b),0x1;}const _0x2b0bb4=await withSpinner(_0x20524e(0x1fd),()=>_0x1f538e[_0x20524e(0x20f)][_0x20524e(0x23c)](_0x2daed),{'verbose':_0x479fbf[_0x20524e(0x28f)]}),_0x72163c=_0x2b0bb4[_0x20524e(0x226)],{isNew:_0x6af045,name:_0x40a8b2,hasChanges:_0x26b37c,diffFormatted:_0x53003b}=_0x72163c;if(_0x26b37c){_0x6af045?console['error'](_0x20524e(0x1d3)+_0x40a8b2+'\x27:'):console[_0x20524e(0x257)](_0x20524e(0x26c)+_0x40a8b2+'\x27:');console[_0x20524e(0x257)]('─'[_0x20524e(0x18d)](0x3c)),console[_0x20524e(0x257)](_0x53003b),console[_0x20524e(0x257)]('─'[_0x20524e(0x18d)](0x3c));const _0x3f3250=_0x6af045?_0x20524e(0x197)+_0x40a8b2+_0x20524e(0x22b):'Apply\x20changes\x20to\x20\x27'+_0x40a8b2+_0x20524e(0x22b);if(!_0x479fbf[_0x20524e(0x22e)]){const _0x1cf0b0=await confirmKey(_0x3f3250);if(!_0x1cf0b0)return console[_0x20524e(0x257)]('Aborted.'),0x1;}const _0x5e6152=_0x6af045?_0x20524e(0x28a):_0x20524e(0x204);await withSpinner(_0x5e6152+_0x20524e(0x1b4)+_0x40a8b2+_0x20524e(0x275),()=>_0x72163c[_0x20524e(0x27e)](),{'verbose':_0x479fbf['verbose']});const _0x300cb2=_0x6af045?_0x20524e(0x20b):_0x20524e(0x1da);console[_0x20524e(0x257)]('✔\x20'+_0x300cb2+_0x20524e(0x1b4)+_0x40a8b2+'\x27');}else console[_0x20524e(0x257)](_0x20524e(0x1a3)+_0x40a8b2+_0x20524e(0x207));}const _0x6e7f36=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x10278f+_0x20524e(0x275),()=>_0x1f538e[_0x20524e(0x20f)][_0x20524e(0x23e)](_0x10278f),{'verbose':_0x479fbf[_0x20524e(0x28f)]}),_0x377259=_0x6e7f36[_0x20524e(0x226)],_0x301faf=getConsoleUrl(_0x479fbf[_0x20524e(0x27c)],_0x20524e(0x242)+_0x377259[_0x20524e(0x17e)]+_0x20524e(0x1e1)+_0x377259[_0x20524e(0x19e)]+_0x20524e(0x234)+_0x377259[_0x20524e(0x228)]);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x218))+'\x20'+_0x377259['audienceId']),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x21c))+'\x20'+_0x377259[_0x20524e(0x1b1)]),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x180))+'\x20'+_0x377259[_0x20524e(0x19e)]),console['error']('\x20\x20'+a27_0x393c4e['dim'](_0x20524e(0x225))+'\x20'+_0x377259[_0x20524e(0x228)]),console[_0x20524e(0x257)]('\x20\x20'+_0x301faf),console[_0x20524e(0x257)]('\x0a'+a27_0x393c4e['dim'](_0x20524e(0x27b))+_0x20524e(0x1ce)+_0x377259[_0x20524e(0x228)]+_0x20524e(0x1e7)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x1b7);[a27_0xe4513(0x21f)]=a27_0xe4513(0x185);async[a27_0xe4513(0x1b0)](_0x125af1){const _0x17779d=a27_0xe4513,{options:_0x26196,args:_0x33d7d5,tdx:_0x146ac6}=_0x125af1,_0x24c200=_0x33d7d5[0x0]||_0x26196[_0x17779d(0x17a)];if(!_0x24c200)return console['error'](a27_0x393c4e[_0x17779d(0x25f)](_0x17779d(0x229))),console[_0x17779d(0x257)](_0x17779d(0x28c)),console[_0x17779d(0x257)](a27_0x393c4e[_0x17779d(0x1cc)](_0x17779d(0x1c2))),0x1;_0x26196['verbose']&&(console['error'](_0x17779d(0x175)+_0x26196['site']),console[_0x17779d(0x257)](_0x17779d(0x198)+_0x24c200));const _0x1f5e89=await withSpinner(_0x17779d(0x290)+_0x24c200+'\x27...',()=>_0x146ac6[_0x17779d(0x20f)]['listFields'](_0x24c200),{'verbose':_0x26196['verbose']}),_0x362d1c=_0x1f5e89[_0x17779d(0x226)];console['error'](_0x17779d(0x25d)+_0x362d1c[_0x17779d(0x239)]+'\x20field'+(_0x362d1c['length']!==0x1?'s':''));if(_0x26196[_0x17779d(0x253)]||_0x26196['jsonl'])return await handleSDKOutput(_0x362d1c,_0x26196),0x0;return displayFieldsHumanReadable(_0x362d1c,_0x24c200),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0xe4513(0x262)]='segment:parent:view';['description']='Show\x20parent\x20segment\x20details';async[a27_0xe4513(0x1b0)](_0x2647ac){const _0x4f4c3b=a27_0xe4513,{options:_0x624d66,args:_0xb886b7,tdx:_0x537ad5}=_0x2647ac,_0x19f858=_0x624d66,_0x40a441=_0xb886b7[0x0]||_0x624d66[_0x4f4c3b(0x17a)];if(!_0x40a441)return console[_0x4f4c3b(0x257)](a27_0x393c4e[_0x4f4c3b(0x25f)](_0x4f4c3b(0x229))),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x1be)),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x1f0)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),console[_0x4f4c3b(0x257)](a27_0x393c4e[_0x4f4c3b(0x1cc)](_0x4f4c3b(0x1ca))),0x1;_0x624d66[_0x4f4c3b(0x28f)]&&(console[_0x4f4c3b(0x257)](_0x4f4c3b(0x175)+_0x624d66[_0x4f4c3b(0x27c)]),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x198)+_0x40a441));const _0x5fd958=await withSpinner(_0x4f4c3b(0x1e6)+_0x40a441+'\x27...',()=>_0x537ad5[_0x4f4c3b(0x20f)]['getParentFull'](_0x40a441),{'verbose':_0x624d66[_0x4f4c3b(0x28f)]}),_0x2bbfab=_0x5fd958['data'];if(_0x19f858[_0x4f4c3b(0x216)]){const _0x40a56f=getConsoleNextUrl(_0x19f858[_0x4f4c3b(0x27c)],_0x4f4c3b(0x26b)+_0x2bbfab['id']);return console['error'](a27_0x393c4e[_0x4f4c3b(0x20c)]('✔')+'\x20Opening\x20'+a27_0x393c4e[_0x4f4c3b(0x1cc)](_0x40a56f)),openBrowser(_0x40a56f),0x0;}return await handleSingleObjectOutput(_0x2bbfab,_0x624d66),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x186);['description']=a27_0xe4513(0x250);async['execute'](_0x1bed8a){const _0xacb483=a27_0xe4513,{options:_0x30191e,args:_0x343cad,tdx:_0x5ab886}=_0x1bed8a,_0x3fa2b1=_0x343cad[0x0]||_0x30191e['parentSegment'];if(!_0x3fa2b1)return console[_0xacb483(0x257)](a27_0x393c4e[_0xacb483(0x25f)](_0xacb483(0x229))),console[_0xacb483(0x257)](_0xacb483(0x1cb)),console[_0xacb483(0x257)](a27_0x393c4e['cyan'](_0xacb483(0x1c2))),0x1;_0x30191e[_0xacb483(0x28f)]&&(console['error']('Site:\x20'+_0x30191e[_0xacb483(0x27c)]),console[_0xacb483(0x257)](_0xacb483(0x198)+_0x3fa2b1));const _0x5d4f3f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3fa2b1+_0xacb483(0x275),()=>_0x5ab886['segment'][_0xacb483(0x212)](_0x3fa2b1),{'verbose':_0x30191e[_0xacb483(0x28f)]}),_0x287d7d=_0x5d4f3f['data'],_0x336910=await withSpinner(_0xacb483(0x1a2)+_0x3fa2b1+_0xacb483(0x275),()=>_0x5ab886[_0xacb483(0x20f)][_0xacb483(0x1e3)](_0x287d7d),{'verbose':_0x30191e[_0xacb483(0x28f)]}),_0x2894cd=await executeSchemaQuery(_0x336910[_0xacb483(0x226)],_0x5ab886,_0x30191e);return await handleQueryOutput(_0x2894cd,_0x30191e),0x0;}}function a27_0x32a9(){const _0x23918a=['Fetching\x20SQL\x20for\x20\x27','✔\x20No\x20changes\x20-\x20\x27','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','segment:parent:push','string','\x20--enriched','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','jsonl','join','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','FINISHED','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x27\x20with\x20ID:\x20','execute','status','YAML\x20file:\x20','stop','\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','segment:parent:fields','stats','Errors:','Error:','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','addAttributesFile','interval','Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a','replace','Events:','Behaviors','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','.yaml','toLowerCase','Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a','77mEWmLv','245336CGWHvz','processedRows','\x20--behavior\x20\x22<name>\x22','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','cyan','displayColumns','\x20tdx\x20wf\x20attempt\x20','format','run','utf-8','Preview:','\x0aNew\x20parent\x20segment\x20\x27','Available\x20behaviors:','message','bold','Columns:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Updating\x20parent\x20segment\x20\x27','Updated','Join\x20on:','-1d','/\x20directories\x20exist.','text','\x0aNo\x20sample\x20data\x20available','Error:\x20--database\x20and\x20--table\x20are\x20required','/sessions/','Rows:','getParentSQL','Options\x20(one\x20required):','`\x20to\x20download\x20the\x20configuration\x20first','Fetching\x20parent\x20segment\x20\x27','\x20kill','Source:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','sampleData','Master\x20Table','master','Customers:','limit','✔\x20Query\x20completed:\x20Processed\x20','Options:','\x20parent\x20segment','\x0a⚠️\x20\x20Migrating:\x20','Table:\x20','displaySummary','behaviorsFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','👥\x20','\x20\x20\x20\x20-\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','Attributes','all','setJobId','Analyzing\x20changes...','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','match','map','double','Error:\x20--attribute\x20requires\x20a\x20name\x0a','information_schema','Updating','dirname','behavior','\x27\x20is\x20up\x20to\x20date','validateParentYaml','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segment:parent:list','Created','green','in\x20','rowCount','segment','sort','ignore','resolveParentId','schemaError','use','localeCompare','web','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Audience\x20ID:','attribute','segment:parent:validate','xdg-open','Status:','dim','previewParentYaml','description','endsWith','Creating\x20parent\x20segment\x20\x27','allValid','displayBehaviorsStats','elapsedTimeMillis','Attempt:','data','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','workflowAttemptId','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','\x20--attribute\x20\x22','\x27\x20and\x20run\x20workflow?','No\x20parent\x20segments\x20match\x20pattern:\x20','segment:parent:sql','yes','number','displayPreviewHints','customersWithEvents','\x20--interval\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','/attempt/','Master\x20+\x20Attributes','test','Get\x20SQL\x20query\x20for\x20parent\x20segment','varchar','length','updateParent','addBehaviors','pushParentYaml','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','runParent','segment:parent:run','/{name}.yml\x0a','Fetching\x20current\x20configuration\x20for\x20\x27','/app/workflows/','customerGroup','preview','displayAttributesStats','start','filter','Database:\x20','Fetching\x20sample\x20data...','schemaValid','.yml','displaySampleData','✔\x20Updated\x20parent\x20segment\x20\x27','Name:\x20','\x20--behavior\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','win32','To\x20view\x20sample\x20data:','json','Join:','timezone','/\x20and\x20','error','table','/\x20directory.\x0a','joinKey','924656jxIioK','30213837qaXGxR','✔\x20Found\x20','totalEvents','red','Aborted.','attributesFile','name','\x20rows)','segment:parent:preview','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20No\x20changes\x20-\x20','Error:\x20File\x20not\x20found:\x20','tdx\x20segment\x20parent\x20preview\x20','Validate:','Listing\x20parent\x20segments\x20matching\x20\x27','/app/dw/parentSegments/','\x0aChanges\x20to\x20apply\x20to\x20\x27','pullParentYaml','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20rows\x20','parent_segments','Output\x20file:\x20','displayValidateResults','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','yellow','\x27...','jobId','Listing\x20parent\x20segments...','Error\x20reading\x20file:\x20','scheduleType','foreignKey','To\x20cancel:','site','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','apply','204415ZMoSPd','customerPercent','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','population','List\x20parent\x20segments','keys','trim','SQL\x20query:\x0a','Available\x20attributes:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20is\x20already\x20up\x20to\x20date','Creating','Attribute:','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','\x20Configuration\x20is\x20valid','850662iZTuCI','verbose','Listing\x20fields\x20for\x20\x27','matchedCount','output','Site:\x20','168pigaYj','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Resolving\x20parent\x20segment\x20\x27','toLocaleString','parentSegment','\x20\x20No\x20sample\x20data\x20available','errors','coveragePercent','workflowId','enriched','Session:','open','platform','customerGroupFile','segment:parent:create','List\x20available\x20fields\x20for\x20segmentation','segment:parent:desc','column','label','attributes','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','segment:parent:pull','\x20=\x20','repeat','Apply\x20changes\x20to\x20\x27','using\x20the\x20default\x20path:\x20','parent_segment','displayPreviewResults','5752088utOlAM','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','SELECT\x20*\x20FROM\x20(\x0a','2113500cEXzzX','Create\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','columns','database','\x0a⚠️\x20\x20Both\x20','Executing\x20parent\x20segment\x20query...','\x20--attribute\x20\x22<name>\x22','workflowSessionId','toFixed','scheduleOption','behaviors'];a27_0x32a9=function(){return _0x23918a;};return a27_0x32a9();}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x22d);[a27_0xe4513(0x21f)]=a27_0xe4513(0x237);async[a27_0xe4513(0x1b0)](_0x5a57d0){const _0x40bf1b=a27_0xe4513,{options:_0x103209,args:_0x18f87b,tdx:_0x411b74}=_0x5a57d0,_0x49e4d7=_0x18f87b[0x0]||_0x103209['parentSegment'];if(!_0x49e4d7)return console[_0x40bf1b(0x257)](a27_0x393c4e[_0x40bf1b(0x25f)](_0x40bf1b(0x229))),console[_0x40bf1b(0x257)](_0x40bf1b(0x1ac)),console[_0x40bf1b(0x257)](a27_0x393c4e['cyan'](_0x40bf1b(0x1c2))),0x1;_0x103209[_0x40bf1b(0x28f)]&&(console[_0x40bf1b(0x257)]('Site:\x20'+_0x103209[_0x40bf1b(0x27c)]),console['error'](_0x40bf1b(0x198)+_0x49e4d7));const _0x116043=await withSpinner(_0x40bf1b(0x178)+_0x49e4d7+_0x40bf1b(0x275),()=>_0x411b74[_0x40bf1b(0x20f)][_0x40bf1b(0x212)](_0x49e4d7),{'verbose':_0x103209[_0x40bf1b(0x28f)]}),_0x2dd4f7=_0x116043[_0x40bf1b(0x226)],_0x319bf6=await withSpinner(_0x40bf1b(0x1a2)+_0x49e4d7+_0x40bf1b(0x275),()=>_0x411b74[_0x40bf1b(0x20f)][_0x40bf1b(0x1e3)](_0x2dd4f7),{'verbose':_0x103209[_0x40bf1b(0x28f)]}),_0x1c2b37=_0x319bf6[_0x40bf1b(0x226)];return _0x103209[_0x40bf1b(0x1cf)]===_0x40bf1b(0x253)||_0x103209[_0x40bf1b(0x1cf)]===_0x40bf1b(0x1a9)?await handleSDKOutput([{'sql':_0x1c2b37}],_0x103209):console['log'](_0x1c2b37),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0xe4513(0x262)]='segment:parent:show';[a27_0xe4513(0x21f)]=a27_0xe4513(0x281);async[a27_0xe4513(0x1b0)](_0x516264){const _0x2718c1=a27_0xe4513,{options:_0x20f6e2,args:_0x1ea97f,tdx:_0x4a1f42}=_0x516264,_0x5c6626=_0x1ea97f[0x0]||_0x20f6e2['parentSegment'];if(!_0x5c6626)return console[_0x2718c1(0x257)](a27_0x393c4e[_0x2718c1(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x2718c1(0x257)]('Usage:\x20tdx\x20ps\x20show\x20[name]\x0a'),console['error'](a27_0x393c4e[_0x2718c1(0x1cc)](_0x2718c1(0x1c2))),0x1;_0x20f6e2[_0x2718c1(0x28f)]&&(console[_0x2718c1(0x257)]('Site:\x20'+_0x20f6e2[_0x2718c1(0x27c)]),console[_0x2718c1(0x257)]('Parent\x20segment:\x20'+_0x5c6626));const _0x406a8c=await withSpinner(_0x2718c1(0x178)+_0x5c6626+_0x2718c1(0x275),()=>_0x4a1f42['segment'][_0x2718c1(0x212)](_0x5c6626),{'verbose':_0x20f6e2[_0x2718c1(0x28f)]}),_0x376079=_0x406a8c[_0x2718c1(0x226)],_0x568eb7=await withSpinner(_0x2718c1(0x1a2)+_0x5c6626+_0x2718c1(0x275),()=>_0x4a1f42['segment']['getParentSQL'](_0x376079),{'verbose':_0x20f6e2[_0x2718c1(0x28f)]});let _0x4b96ad=_0x568eb7[_0x2718c1(0x226)];const _0x4824df=resolveLimit(_0x20f6e2[_0x2718c1(0x1ee)],DEFAULT_DISPLAY_LIMIT),_0x1b9111=/\bLIMIT\s+\d+/i[_0x2718c1(0x236)](_0x4b96ad);!_0x1b9111&&(_0x4b96ad=_0x4b96ad[_0x2718c1(0x285)]()[_0x2718c1(0x1bf)](/;+$/,''),_0x4b96ad=_0x2718c1(0x195)+_0x4b96ad+_0x2718c1(0x209)+_0x4824df);_0x20f6e2[_0x2718c1(0x28f)]&&console[_0x2718c1(0x257)](_0x2718c1(0x286)+_0x4b96ad);const _0x1d2b5d=await withQuerySpinner(_0x2718c1(0x19c),async _0x59f800=>{const _0x41475a=_0x2718c1,_0xb696fb=await _0x4a1f42['query'][_0x41475a(0x1b0)](_0x4b96ad,{'catalog':'td','schema':_0x41475a(0x203),'onJobId':_0x3906c0=>{const _0x281684=_0x41475a;_0x59f800[_0x281684(0x1fc)](_0x3906c0);}});return _0xb696fb;},{'verbose':_0x20f6e2[_0x2718c1(0x28f)]}),_0x532816=_0x1d2b5d[_0x2718c1(0x226)],_0x4f6fa0=_0x532816[_0x2718c1(0x276)]?'\x20[Job\x20ID:\x20'+_0x532816[_0x2718c1(0x276)]+']':'';return console[_0x2718c1(0x257)](_0x2718c1(0x1ef)+_0x532816[_0x2718c1(0x1b8)][_0x2718c1(0x1c8)][_0x2718c1(0x179)]()+_0x2718c1(0x26f)+(_0x2718c1(0x20d)+formatElapsed(_0x532816[_0x2718c1(0x1b8)][_0x2718c1(0x224)])+_0x4f6fa0)),await handleQueryOutput(_0x532816,_0x20f6e2),0x0;}}
|
|
1
|
+
const a27_0x30a75a=a27_0x35ca;(function(_0x23f6e8,_0x4096c9){const _0x3fcca8=a27_0x35ca,_0x46043c=_0x23f6e8();while(!![]){try{const _0x4bbd72=parseInt(_0x3fcca8(0x230))/0x1+parseInt(_0x3fcca8(0x229))/0x2*(-parseInt(_0x3fcca8(0x2b3))/0x3)+parseInt(_0x3fcca8(0x215))/0x4*(parseInt(_0x3fcca8(0x2ec))/0x5)+parseInt(_0x3fcca8(0x2bb))/0x6*(-parseInt(_0x3fcca8(0x1f4))/0x7)+-parseInt(_0x3fcca8(0x24f))/0x8+parseInt(_0x3fcca8(0x2a7))/0x9+parseInt(_0x3fcca8(0x21c))/0xa;if(_0x4bbd72===_0x4096c9)break;else _0x46043c['push'](_0x46043c['shift']());}catch(_0x498c1c){_0x46043c['push'](_0x46043c['shift']());}}}(a27_0x36e2,0xc0d35));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0xb285cd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';function a27_0x36e2(){const _0x33b68e=['filter','preview','\x0a⚠️\x20\x20Both\x20','format','bold','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Resolving\x20parent\x20segment\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','sort','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','green','jobId','\x27\x20and\x20run\x20workflow?','Overwrite\x20\x27','ignore','\x20tdx\x20wf\x20attempt\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','allValid','segment:parent:fields','Coverage:','keys','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','Fetching\x20parent\x20segment\x20\x27','label','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20Configuration\x20is\x20valid','xdg-open','\x27...','join','rowCount','Events:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','population','\x0a✔\x20Workflow\x20started','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','tdx\x20segment\x20parent\x20preview\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20is\x20already\x20up\x20to\x20date','Created','win32','text','Site:\x20','Enriched:','parent_segments','joinKey','Usage:\x20tdx\x20ps\x20show\x20[name]\x0a','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','processedRows','Analyzing\x20changes...','displayValidateResults','Available\x20behaviors:','Errors:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Pattern:\x20','Listing\x20fields\x20for\x20\x27','Join\x20on:','log','output','test','Show\x20parent\x20segment\x20schema\x20(column\x20types)','json','displaySummary','getParentSQL','Attributes','parentSegment','displayPreviewHints','\x20Opening\x20','/app/dw/parentSegments/','updateParent','customersWithEvents','schemaValid','YAML\x20file:\x20','varchar','Executing\x20parent\x20segment\x20query...','scheduleOption','displayPreviewResults','Creating','1993077NXFBVy','Join:','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','No\x20parent\x20segments\x20found','\x20=\x20','\x27\x20with\x20ID:\x20','columns','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','✘\x20Failed\x20to\x20rename\x20directory:\x20','pullParentYaml','coveragePercent','36609vXtcMS','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','length','runParent','Columns:','errors','✔\x20No\x20changes\x20-\x20\x27','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','6dIPvjE','Attempt:','\x20--behavior\x20\x22','apply','SQL\x20query:\x0a','listFields','matchedCount','Updating','foreignKey','Source:','segment:parent:validate','\x20No\x20changes\x20-\x20','/sessions/','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','toLowerCase','utf-8','Error:\x20--behavior\x20requires\x20a\x20name\x0a','message','Updating\x20parent\x20segment\x20\x27','👥\x20','scheduleType','workflowAttemptId','Error:\x20--attribute\x20requires\x20a\x20name\x0a','previewParentYaml','dim','double','Audience\x20ID:','Database:\x20','\x0aChanges\x20to\x20\x27','\x20--behavior\x20\x22<name>\x22','.yaml','totalEvents','Behavior:','FINISHED','toLocaleString','name','Options:','List\x20parent\x20segments','Show\x20parent\x20segment\x20details','attributes','Listing\x20parent\x20segments...','trim','table','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)','Master\x20Table','\x20[Job\x20ID:\x20','behavior','\x20Context\x20set:\x20','displayMasterInfo','3800675aFJYfM','resolveParentId','Fetching\x20sample\x20data...','\x20parent\x20segment','createParent','segment:parent:create','\x0a⚠️\x20\x20Migrating:\x20','stats','start','jsonl','customerGroupFile','Output\x20file:\x20','`\x20to\x20download\x20the\x20configuration\x20first','segment:parent:show','match','toFixed','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','.yml','platform','pushParentYaml','interval','Preview:','Parent\x20segment:\x20','stop','using\x20the\x20default\x20path:\x20','replace','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','yes','Create\x20parent\x20segment\x20\x27','attribute','data','Apply\x20changes\x20to\x20\x27','\x0aNo\x20sample\x20data\x20available','open','cyan','behaviorsFile','verbose','in\x20','\x20--enriched','yellow','Listing\x20parent\x20segments\x20matching\x20\x27','darwin','SELECT\x20*\x20FROM\x20(\x0a','audienceId','\x20--interval\x20','/\x20→\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','5236882EUiyZi','workflowId','Fetching\x20current\x20configuration\x20for\x20\x27','addAttributes','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','column','segment:parent:desc','displayBehaviorsStats','Customers:','setJobId','schemaError','Available\x20attributes:','enriched','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','✔\x20Found\x20','-1d','error','✔\x20Renamed\x20directory\x20to\x20','\x20kill','\x20\x20\x20\x20-\x20','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','unref','displaySampleData','Aborted.','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','red','\x20--attribute\x20\x22','\x20\x20No\x20sample\x20data\x20available','sampleData','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','addAttributesFile','isDirectory','4IiUzrp','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','\x0aChanges\x20to\x20apply\x20to\x20\x27','use','workflowSessionId','repeat','segment:parent:run','14147010QXNAxe','getParentFull','Error\x20reading\x20file:\x20','/{name}.yml\x0a','validateParentYaml','database','Updated','session','string','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','displayColumns','\x27\x20is\x20already\x20up\x20to\x20date','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','82cCfSao','timezone','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','localeCompare','/\x20directory.\x0a','\x20rows)','1180151rEkWfh','behaviors','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','listParents','\x0aNew\x20parent\x20segment\x20\x27','execute','Error:\x20--database\x20and\x20--table\x20are\x20required','customerPercent','site','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','run','description','Behaviors','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment','all','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Fetching\x20SQL\x20for\x20\x27','\x20parent\x20segment\x20\x27','Options\x20(one\x20required):','\x0aUsage:\x20tdx\x20ps\x20preview\x20','✔\x20Query\x20completed:\x20Processed\x20','addBehaviorsFile','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','dirname','addBehaviors','displayAttributesStats','Error:','parent_segment','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','segment:parent:push','12305424qrOCpQ','endsWith','number','\x20rows\x20','query','Attribute:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Status:','master'];a27_0x36e2=function(){return _0x33b68e;};return a27_0x36e2();}function a27_0x35ca(_0x439e34,_0x59b56f){_0x439e34=_0x439e34-0x1e5;const _0x36e288=a27_0x36e2();let _0x35ca1e=_0x36e288[_0x439e34];return _0x35ca1e;}import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a27_0x44fedf from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0x30a75a(0x284),LEGACY_PARENT_SEGMENT_DIR=a27_0x30a75a(0x24c);function openBrowser(_0xb7f3cb){const _0x5c2927=a27_0x30a75a,_0x428ef7=process[_0x5c2927(0x2fe)],_0x5927c8=_0x428ef7===_0x5c2927(0x1ee)?_0x5c2927(0x1e6):_0x428ef7===_0x5c2927(0x280)?_0x5c2927(0x2f4):_0x5c2927(0x273);spawn(_0x5927c8,[_0xb7f3cb],{'detached':!![],'stdio':_0x5c2927(0x266)})[_0x5c2927(0x20a)]();}function sanitizeFileName(_0x188f75){const _0x34e308=a27_0x30a75a;return _0x188f75[_0x34e308(0x2c9)]()[_0x34e308(0x305)](/[/\\:*?"<>|]/g,'-')[_0x34e308(0x305)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x34e308(0x305)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0x5a7608=a27_0x30a75a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x568617=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x568617[_0x5a7608(0x214)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5a7608(0x205)](a27_0x44fedf['yellow'](_0x5a7608(0x25a)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x5a7608(0x205)](a27_0x44fedf[_0x5a7608(0x2d3)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x5a7608(0x22e))),![];console['error'](a27_0x44fedf['yellow'](_0x5a7608(0x2f2)+LEGACY_PARENT_SEGMENT_DIR+_0x5a7608(0x1f2)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5a7608(0x205)](a27_0x44fedf[_0x5a7608(0x262)](_0x5a7608(0x206)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x512dc7){const _0x368565=_0x512dc7 instanceof Error?_0x512dc7[_0x5a7608(0x2cc)]:String(_0x512dc7);return console['error'](a27_0x44fedf['red'](_0x5a7608(0x2b0)+_0x368565+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x3f789a){const _0x546d6c=a27_0x30a75a;return migrateLegacyDirectory(),super[_0x546d6c(0x23a)](_0x3f789a);}}function resolveYamlFile(_0x3be3f8){const _0x2984f1=a27_0x30a75a;if(_0x3be3f8['endsWith'](_0x2984f1(0x2fd))||_0x3be3f8[_0x2984f1(0x250)](_0x2984f1(0x2d9)))return _0x3be3f8;return a27_0xb285cd[_0x2984f1(0x275)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3be3f8)+'.yml');}function formatProgressMessage(_0x2cf8ff){const _0x4095b3=a27_0x30a75a,_0x809bf0=_0x2cf8ff[_0x4095b3(0x2fa)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x809bf0){const [,_0x3df69c,_0x1a5a3e,_0x1e367c='']=_0x809bf0;return a27_0x44fedf['dim'](_0x3df69c+':')+'\x20'+_0x1a5a3e+a27_0x44fedf[_0x4095b3(0x2d3)](_0x1e367c);}return a27_0x44fedf[_0x4095b3(0x2d3)](_0x2cf8ff);}function showFileNotFoundError(_0x19875f,_0x467aef){const _0x2604f7=a27_0x30a75a;console['error'](a27_0x44fedf[_0x2604f7(0x20e)]('Error:\x20File\x20not\x20found:\x20'+_0x19875f+'\x0a')),console[_0x2604f7(0x205)](a27_0x44fedf[_0x2604f7(0x1e7)](_0x2604f7(0x27d)+_0x467aef+_0x2604f7(0x2f8)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:list';['description']=a27_0x30a75a(0x2e0);async[a27_0x30a75a(0x235)](_0x301dec){const _0x196d99=a27_0x30a75a,{options:_0x335d33,args:_0x519a2f,tdx:_0x56ea1c}=_0x301dec,_0x2229e9=_0x519a2f[0x0];_0x335d33['verbose']&&(console['error'](_0x196d99(0x282)+_0x335d33[_0x196d99(0x238)]),_0x2229e9&&console[_0x196d99(0x205)](_0x196d99(0x28f)+_0x2229e9));const _0x1fe611=await withSpinner(_0x2229e9?_0x196d99(0x1ed)+_0x2229e9+_0x196d99(0x274):_0x196d99(0x2e3),()=>_0x56ea1c['segment'][_0x196d99(0x233)](),{'verbose':_0x335d33[_0x196d99(0x1e9)]});let _0x57a615=_0x1fe611[_0x196d99(0x30a)];if(_0x2229e9){const _0x4d6f37=_0x2229e9['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x196d99(0x305)](/\*/g,'.*')[_0x196d99(0x305)](/\?/g,'.'),_0x5e2c8e=new RegExp('^'+_0x4d6f37+'$','i');_0x57a615=_0x57a615[_0x196d99(0x258)](_0x3f76ac=>_0x5e2c8e[_0x196d99(0x294)](_0x3f76ac['attributes']['name']));}_0x57a615[_0x196d99(0x260)]((_0x38e090,_0x170b21)=>_0x38e090['attributes'][_0x196d99(0x2de)][_0x196d99(0x22d)](_0x170b21[_0x196d99(0x2e2)][_0x196d99(0x2de)])),console['error'](_0x196d99(0x203)+_0x57a615[_0x196d99(0x2b5)]+_0x196d99(0x2ef)+(_0x57a615[_0x196d99(0x2b5)]!==0x1?'s':''));if(_0x335d33['format']===_0x196d99(0x296)||_0x335d33['format']===_0x196d99(0x2f5))await handleSDKOutput(_0x57a615,_0x335d33);else{if(_0x57a615[_0x196d99(0x2b5)]===0x0)_0x2229e9?console[_0x196d99(0x292)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x2229e9):console[_0x196d99(0x292)](_0x196d99(0x2ab));else for(const _0x3ea2eb of _0x57a615){const _0xbb2b0c=_0x3ea2eb[_0x196d99(0x2e2)]['population']?a27_0x44fedf['dim']('\x20('+formatRows(_0x3ea2eb[_0x196d99(0x2e2)][_0x196d99(0x279)])+')'):'';console[_0x196d99(0x292)](_0x196d99(0x2ce)+_0x3ea2eb['attributes'][_0x196d99(0x2de)]+_0xbb2b0c);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2f1);['description']=a27_0x30a75a(0x2af);async[a27_0x30a75a(0x235)](_0x219eba){const _0x10dbca=a27_0x30a75a,{options:_0x4b506a,args:_0x2ec14a,tdx:_0x544b11}=_0x219eba;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x10dbca(0x28e)+_0x10dbca(0x228));const _0xfdd04c=_0x4b506a;if(_0x2ec14a['length']===0x0)return console[_0x10dbca(0x205)](_0x10dbca(0x23d)),console[_0x10dbca(0x205)](_0x10dbca(0x2aa)),0x1;const _0x224523=_0x2ec14a[0x0];if(!_0xfdd04c['database']||!_0xfdd04c['table'])return console[_0x10dbca(0x205)](_0x10dbca(0x236)),console[_0x10dbca(0x205)](_0x10dbca(0x2aa)),0x1;_0xfdd04c[_0x10dbca(0x1e9)]&&(console['error'](_0x10dbca(0x282)+_0xfdd04c[_0x10dbca(0x238)]),console[_0x10dbca(0x205)]('Name:\x20'+_0x224523),console[_0x10dbca(0x205)](_0x10dbca(0x2d6)+_0xfdd04c[_0x10dbca(0x221)]),console[_0x10dbca(0x205)]('Table:\x20'+_0xfdd04c['table']));const _0x233ab4=await loadJSONFromOptions(_0xfdd04c[_0x10dbca(0x2e2)],_0xfdd04c['attributesFile']),_0x5b0aa8=await loadJSONFromOptions(_0xfdd04c['behaviors'],_0xfdd04c[_0x10dbca(0x1e8)]),_0x3ecf4d=await loadJSONFromOptions(_0xfdd04c['customerGroup'],_0xfdd04c[_0x10dbca(0x2f6)]),_0x368fa9={'name':_0x224523,'description':_0xfdd04c[_0x10dbca(0x23b)],'scheduleType':_0xfdd04c[_0x10dbca(0x2cf)],'scheduleOption':_0xfdd04c[_0x10dbca(0x2a4)],'timezone':_0xfdd04c[_0x10dbca(0x22a)],'master':{'parentDatabaseName':_0xfdd04c[_0x10dbca(0x221)],'parentTableName':_0xfdd04c[_0x10dbca(0x2e5)]},'attributes':_0x233ab4,'behaviors':_0x5b0aa8,'customerGroup':_0x3ecf4d},_0x16fad2=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x224523+_0x10dbca(0x274),()=>_0x544b11[_0x10dbca(0x23e)][_0x10dbca(0x2f0)](_0x368fa9),{'verbose':_0x4b506a[_0x10dbca(0x1e9)]}),_0xe539f6=_0x16fad2['data'];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0xe539f6['name']+_0x10dbca(0x2ad)+_0xe539f6['id']),await handleSDKOutput([_0xe539f6],_0x4b506a),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:update';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x232);async[a27_0x30a75a(0x235)](_0xbe24e5){const _0x2425da=a27_0x30a75a,{options:_0x16b2c6,args:_0x209eda,tdx:_0x209392}=_0xbe24e5;console[_0x2425da(0x205)](_0x2425da(0x2c8)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2425da(0x228));const _0x890642=_0x16b2c6;if(_0x209eda[_0x2425da(0x2b5)]===0x0)return console[_0x2425da(0x205)](_0x2425da(0x23d)),console[_0x2425da(0x205)](_0x2425da(0x212)),0x1;const _0x556617=_0x209eda[0x0];_0x890642[_0x2425da(0x1e9)]&&(console['error'](_0x2425da(0x282)+_0x890642[_0x2425da(0x238)]),console['error'](_0x2425da(0x302)+_0x556617));const _0x188af9=await withSpinner(_0x2425da(0x1f6)+_0x556617+_0x2425da(0x274),()=>_0x209392[_0x2425da(0x23e)][_0x2425da(0x21d)](_0x556617),{'verbose':_0x890642[_0x2425da(0x1e9)]}),_0x1f3f00=_0x188af9[_0x2425da(0x30a)],_0x2c6a51=await loadJSONFromOptions(_0x890642[_0x2425da(0x1f7)],_0x890642[_0x2425da(0x213)]),_0x3bb1ba=await loadJSONFromOptions(_0x890642[_0x2425da(0x249)],_0x890642[_0x2425da(0x246)]),_0x3e0207={'name':_0x1f3f00[_0x2425da(0x2de)],'description':_0x890642[_0x2425da(0x23b)]!==undefined?_0x890642[_0x2425da(0x23b)]:_0x1f3f00[_0x2425da(0x23b)],'scheduleType':_0x890642['scheduleType']!==undefined?_0x890642[_0x2425da(0x2cf)]:_0x1f3f00['scheduleType'],'scheduleOption':_0x890642[_0x2425da(0x2a4)]!==undefined?_0x890642[_0x2425da(0x2a4)]:_0x1f3f00[_0x2425da(0x2a4)],'timezone':_0x890642[_0x2425da(0x22a)]!==undefined?_0x890642['timezone']:_0x1f3f00[_0x2425da(0x22a)],'master':_0x1f3f00[_0x2425da(0x257)],'attributes':_0x2c6a51?[..._0x1f3f00[_0x2425da(0x2e2)]||[],..._0x2c6a51]:_0x1f3f00[_0x2425da(0x2e2)],'behaviors':_0x3bb1ba?[..._0x1f3f00[_0x2425da(0x231)]||[],..._0x3bb1ba]:_0x1f3f00[_0x2425da(0x231)],'customerGroup':_0x1f3f00['customerGroup']},_0x312e1d=await withSpinner(_0x2425da(0x2cd)+_0x556617+_0x2425da(0x274),()=>_0x209392[_0x2425da(0x23e)][_0x2425da(0x29e)](_0x556617,_0x3e0207),{'verbose':_0x890642[_0x2425da(0x1e9)]}),_0x15c430=_0x312e1d[_0x2425da(0x30a)];return console[_0x2425da(0x205)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x15c430['name']+'\x27'),await handleSDKOutput([_0x15c430],_0x890642),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]='segment:parent:pull';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x255);async[a27_0x30a75a(0x235)](_0x10b570){const _0x1b0bfb=a27_0x30a75a,{options:_0xb9253e,args:_0x2ff880,tdx:_0x27866d}=_0x10b570,_0x51f581=_0xb9253e,_0x31ce8f=_0x2ff880[0x0]||_0xb9253e['parentSegment'];if(!_0x31ce8f)return console[_0x1b0bfb(0x205)](a27_0x44fedf['red'](_0x1b0bfb(0x22c))),console[_0x1b0bfb(0x205)](_0x1b0bfb(0x287)),console['error'](a27_0x44fedf[_0x1b0bfb(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;if(_0x51f581[_0x1b0bfb(0x218)]&&_0x51f581[_0x1b0bfb(0x293)])return console[_0x1b0bfb(0x205)](a27_0x44fedf['red']('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x1b0bfb(0x205)](a27_0x44fedf[_0x1b0bfb(0x2d3)](_0x1b0bfb(0x216))),console[_0x1b0bfb(0x205)](a27_0x44fedf['dim'](_0x1b0bfb(0x304)+PARENT_SEGMENT_DIR+_0x1b0bfb(0x21f))),console[_0x1b0bfb(0x205)](a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x1b0bfb(0x2b4))),0x1;const _0x6583c=_0x51f581[_0x1b0bfb(0x293)]||a27_0xb285cd[_0x1b0bfb(0x275)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x31ce8f)+_0x1b0bfb(0x2fd));_0x51f581[_0x1b0bfb(0x1e9)]&&(console['error']('Site:\x20'+_0x51f581[_0x1b0bfb(0x238)]),console['error'](_0x1b0bfb(0x302)+_0x31ce8f),console[_0x1b0bfb(0x205)](_0x1b0bfb(0x2f7)+_0x6583c));const _0x16a614=await withSpinner(_0x1b0bfb(0x26e)+_0x31ce8f+_0x1b0bfb(0x274),()=>_0x27866d[_0x1b0bfb(0x23e)][_0x1b0bfb(0x2b1)](_0x31ce8f),{'verbose':_0x51f581[_0x1b0bfb(0x1e9)]}),_0x4faa91=_0x16a614[_0x1b0bfb(0x30a)];if(existsSync(_0x6583c)){const _0x586b5d=readFileSync(_0x6583c,'utf-8'),_0x2df525=generateDiff(_0x586b5d,_0x4faa91);if(!hasChanges(_0x2df525))console['error'](a27_0x44fedf['green']('✔')+_0x1b0bfb(0x2c6)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c)+_0x1b0bfb(0x27e));else{console[_0x1b0bfb(0x205)](_0x1b0bfb(0x2d7)+_0x6583c+'\x27:'),console[_0x1b0bfb(0x205)]('─'[_0x1b0bfb(0x21a)](0x3c)),console['error'](formatDiffWithColors(_0x2df525)),console[_0x1b0bfb(0x205)]('─'[_0x1b0bfb(0x21a)](0x3c));if(!_0x51f581[_0x1b0bfb(0x307)]){const _0x1468df=await confirmKey(_0x1b0bfb(0x265)+_0x6583c+'\x27?');if(!_0x1468df)return console['error'](_0x1b0bfb(0x20c)),0x1;}writeFileSync(_0x6583c,_0x4faa91,_0x1b0bfb(0x2ca)),console['error'](a27_0x44fedf[_0x1b0bfb(0x262)]('✔')+_0x1b0bfb(0x268)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c));}}else{const _0x9194a8=a27_0xb285cd[_0x1b0bfb(0x248)](_0x6583c);!existsSync(_0x9194a8)&&mkdirSync(_0x9194a8,{'recursive':!![]}),writeFileSync(_0x6583c,_0x4faa91,_0x1b0bfb(0x2ca)),console['error'](a27_0x44fedf[_0x1b0bfb(0x262)]('✔')+_0x1b0bfb(0x268)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c));}return saveSessionContext({'parent_segment':_0x31ce8f},_0x51f581[_0x1b0bfb(0x223)]),console[_0x1b0bfb(0x205)](a27_0x44fedf['green']('✔')+_0x1b0bfb(0x2ea)+a27_0x44fedf[_0x1b0bfb(0x2d3)](_0x1b0bfb(0x24c))+_0x1b0bfb(0x2ac)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x31ce8f)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a27_0x30a75a(0x24e);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x306);async[a27_0x30a75a(0x235)](_0x485597){const _0x182f14=a27_0x30a75a,{options:_0x21affd,args:_0x1f5540,tdx:_0x4c0f6e}=_0x485597,_0x4e7138=_0x21affd,_0x198d2f=_0x1f5540[0x0]||_0x21affd[_0x182f14(0x29a)];if(!_0x198d2f)return console['error'](a27_0x44fedf[_0x182f14(0x20e)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x182f14(0x205)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console['error'](a27_0x44fedf[_0x182f14(0x1e7)](_0x182f14(0x27b))),0x1;const _0x45fe2c=resolveYamlFile(_0x198d2f);if(!existsSync(_0x45fe2c))return showFileNotFoundError(_0x45fe2c,_0x198d2f),0x1;_0x4e7138[_0x182f14(0x1e9)]&&(console['error'](_0x182f14(0x282)+_0x4e7138[_0x182f14(0x238)]),console['error'](_0x182f14(0x2a1)+_0x45fe2c));let _0x5220d0;try{_0x5220d0=readFileSync(_0x45fe2c,_0x182f14(0x2ca));}catch(_0x400434){const _0x340c86=_0x400434 instanceof Error?_0x400434[_0x182f14(0x2cc)]:String(_0x400434);return console['error'](_0x182f14(0x21e)+_0x340c86),0x1;}const _0x12283d=await withSpinner(_0x182f14(0x28a),()=>_0x4c0f6e[_0x182f14(0x23e)][_0x182f14(0x2ff)](_0x5220d0),{'verbose':_0x4e7138['verbose']}),_0x35f20b=_0x12283d[_0x182f14(0x30a)],{isNew:_0x32ddb0,name:_0x566c53,hasChanges:_0x28dead,diffFormatted:_0x235431}=_0x35f20b;if(!_0x28dead)return console[_0x182f14(0x205)]('✔\x20No\x20changes\x20-\x20\x27'+_0x566c53+_0x182f14(0x227)),0x0;_0x32ddb0?console[_0x182f14(0x205)](_0x182f14(0x234)+_0x566c53+'\x27:'):console['error'](_0x182f14(0x217)+_0x566c53+'\x27:');console['error']('─'[_0x182f14(0x21a)](0x3c)),console[_0x182f14(0x205)](_0x235431),console[_0x182f14(0x205)]('─'['repeat'](0x3c));const _0x210743=_0x32ddb0?_0x182f14(0x308)+_0x566c53+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x566c53+'\x27?';if(!_0x4e7138['yes']){const _0x5e1dea=await confirmKey(_0x210743);if(!_0x5e1dea)return console[_0x182f14(0x205)](_0x182f14(0x20c)),0x1;}const _0x37d0b1=_0x32ddb0?_0x182f14(0x2a6):_0x182f14(0x2c2),_0x953f71=await withSpinner(_0x37d0b1+_0x182f14(0x242)+_0x566c53+_0x182f14(0x274),()=>_0x35f20b[_0x182f14(0x2be)](),{'verbose':_0x4e7138[_0x182f14(0x1e9)]}),_0x3f0c74=_0x953f71[_0x182f14(0x30a)],_0x2ed640=getConsoleNextUrl(_0x4e7138['site'],_0x182f14(0x29d)+_0x3f0c74['id']),_0x1fc621=_0x32ddb0?_0x182f14(0x27f):_0x182f14(0x222);return console['error']('✔\x20'+_0x1fc621+'\x20parent\x20segment\x20\x27'+_0x3f0c74[_0x182f14(0x2de)]+'\x27'),console[_0x182f14(0x205)]('\x20\x20'+_0x2ed640),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2c5);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x1f3);async[a27_0x30a75a(0x235)](_0x5a48c1){const _0x49196e=a27_0x30a75a,{options:_0x194548,args:_0x471aa3,tdx:_0x470d67}=_0x5a48c1,_0x5660f4=_0x194548,_0x3b7536=_0x471aa3[0x0]||_0x194548[_0x49196e(0x29a)];if(!_0x3b7536)return console[_0x49196e(0x205)](a27_0x44fedf['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x49196e(0x205)](_0x49196e(0x225)),console[_0x49196e(0x205)]('Options:'),console[_0x49196e(0x205)](_0x49196e(0x202)),console[_0x49196e(0x205)](_0x49196e(0x2e6)),console[_0x49196e(0x205)](_0x49196e(0x240)),console[_0x49196e(0x205)](a27_0x44fedf[_0x49196e(0x1e7)]('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;const _0x26d7db=resolveYamlFile(_0x3b7536);if(!existsSync(_0x26d7db))return showFileNotFoundError(_0x26d7db,_0x3b7536),0x1;_0x5660f4[_0x49196e(0x1e9)]&&(console[_0x49196e(0x205)](_0x49196e(0x282)+_0x5660f4[_0x49196e(0x238)]),console[_0x49196e(0x205)](_0x49196e(0x2a1)+_0x26d7db));let _0x547f44;try{_0x547f44=readFileSync(_0x26d7db,'utf-8');}catch(_0x483aa5){const _0x5efa6a=_0x483aa5 instanceof Error?_0x483aa5['message']:String(_0x483aa5);return console[_0x49196e(0x205)](_0x49196e(0x21e)+_0x5efa6a),0x1;}const _0x47db24=createCommandSpinner(a27_0x44fedf['dim']('Validating\x20configuration...'),{'verbose':_0x5660f4[_0x49196e(0x1e9)]});_0x47db24['start']();const _0x8b91bd={'onProgress':_0x907597=>{_0x47db24['text']=formatProgressMessage(_0x907597);}};if(_0x5660f4[_0x49196e(0x257)])_0x8b91bd[_0x49196e(0x257)]=!![];if(_0x5660f4[_0x49196e(0x201)])_0x8b91bd[_0x49196e(0x201)]=!![];_0x5660f4['attribute']&&(_0x8b91bd[_0x49196e(0x309)]=_0x5660f4[_0x49196e(0x309)]);_0x5660f4[_0x49196e(0x2e9)]&&(_0x8b91bd[_0x49196e(0x2e9)]=_0x5660f4[_0x49196e(0x2e9)]);if(_0x5660f4[_0x49196e(0x300)])_0x8b91bd['interval']=_0x5660f4[_0x49196e(0x300)];let _0x4c9760;try{_0x4c9760=await _0x470d67[_0x49196e(0x23e)][_0x49196e(0x220)](_0x547f44,_0x8b91bd),_0x47db24[_0x49196e(0x303)]();}catch(_0x19dbad){_0x47db24[_0x49196e(0x303)]();throw _0x19dbad;}const _0xb334b9=_0x5660f4[_0x49196e(0x300)]||_0x49196e(0x204);return this[_0x49196e(0x28b)](_0x4c9760,_0x8b91bd,_0x26d7db,_0xb334b9),_0x4c9760[_0x49196e(0x269)]?0x0:0x1;}['displayValidateResults'](_0x42e583,_0x23daa2,_0x1f7f73,_0xe5fd9c){const _0x59eb2a=a27_0x30a75a;console[_0x59eb2a(0x205)]('\x0a'+a27_0x44fedf[_0x59eb2a(0x25c)]('Validate:')+'\x20'+_0x42e583[_0x59eb2a(0x2de)]),console['error']('═'[_0x59eb2a(0x21a)](0x3c)),this[_0x59eb2a(0x2eb)](_0x42e583);if(typeof _0x23daa2[_0x59eb2a(0x309)]==='string'){this['displayAttributesStats'](_0x42e583),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x309),_0x23daa2['attribute']);return;}if(_0x23daa2[_0x59eb2a(0x309)]===!![]){this[_0x59eb2a(0x24a)](_0x42e583),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x2e2));return;}if(typeof _0x23daa2[_0x59eb2a(0x2e9)]===_0x59eb2a(0x224)){this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this[_0x59eb2a(0x29b)](_0x1f7f73,_0xe5fd9c,'behavior',_0x23daa2['behavior']);return;}if(_0x23daa2[_0x59eb2a(0x2e9)]===!![]){this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,'behaviors');return;}this[_0x59eb2a(0x24a)](_0x42e583),this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this[_0x59eb2a(0x29b)](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x23f));}[a27_0x30a75a(0x29b)](_0x131945,_0x17908b,_0x419fe1,_0x4b8d30){const _0x56197a=a27_0x30a75a;console[_0x56197a(0x205)]('\x0a'+a27_0x44fedf[_0x56197a(0x2d3)]('To\x20view\x20sample\x20data:'));const _0x51149a=_0x17908b!=='-1d'?_0x56197a(0x1f1)+_0x17908b:'';if(_0x419fe1==='attribute'&&_0x4b8d30)console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)]('tdx\x20segment\x20parent\x20preview\x20'+_0x131945+_0x56197a(0x20f)+_0x4b8d30+'\x22'+_0x51149a));else{if(_0x419fe1===_0x56197a(0x2e9)&&_0x4b8d30)console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x56197a(0x27c)+_0x131945+_0x56197a(0x2bd)+_0x4b8d30+'\x22'+_0x51149a));else(_0x419fe1===_0x56197a(0x2e2)||_0x419fe1===_0x56197a(0x23f))&&console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)](_0x56197a(0x27c)+_0x131945+'\x20--attribute\x20\x22<name>\x22'+_0x51149a));}(_0x419fe1==='behaviors'||_0x419fe1===_0x56197a(0x23f))&&console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x56197a(0x27c)+_0x131945+_0x56197a(0x2d8)+_0x51149a)),_0x419fe1==='all'&&console['error']('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)](_0x56197a(0x27c)+_0x131945+_0x56197a(0x1eb)+_0x51149a));}['displayMasterInfo'](_0x1de8d9){const _0x3010f1=a27_0x30a75a,{master:_0x2a38ba}=_0x1de8d9,_0x4c88d0=_0x2a38ba[_0x3010f1(0x2a0)]?a27_0x44fedf[_0x3010f1(0x262)]('✔'):a27_0x44fedf[_0x3010f1(0x20e)]('✘');console[_0x3010f1(0x205)]('\x0a'+a27_0x44fedf[_0x3010f1(0x2d3)](_0x3010f1(0x2e7))),console['error'](_0x4c88d0+'\x20'+a27_0x44fedf['bold'](_0x2a38ba[_0x3010f1(0x221)]+'.'+_0x2a38ba['table'])),_0x2a38ba[_0x3010f1(0x2a0)]?_0x2a38ba[_0x3010f1(0x276)]!==undefined&&console[_0x3010f1(0x205)]('\x20\x20'+a27_0x44fedf[_0x3010f1(0x2d3)]('Rows:')+'\x20'+a27_0x44fedf[_0x3010f1(0x1e7)](formatRows(_0x2a38ba[_0x3010f1(0x276)]))):console[_0x3010f1(0x205)]('\x20\x20'+a27_0x44fedf[_0x3010f1(0x20e)](_0x3010f1(0x24b))+'\x20'+_0x2a38ba['schemaError']);}[a27_0x30a75a(0x24a)](_0xb1e83f){const _0x594535=a27_0x30a75a;if(_0xb1e83f[_0x594535(0x2e2)][_0x594535(0x2b5)]===0x0)return;console[_0x594535(0x205)]('\x0a'+a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x299)));for(const _0x534552 of _0xb1e83f['attributes']){const _0x2f7d4e=_0x534552[_0x594535(0x2a0)]?a27_0x44fedf[_0x594535(0x262)]('✔'):a27_0x44fedf[_0x594535(0x20e)]('✘');let _0x1d5e64='';if(_0x534552['schemaValid']&&_0x534552[_0x594535(0x2c1)]!==undefined&&_0x534552[_0x594535(0x2b2)]!==undefined){const _0x968d34=_0x534552['coveragePercent'][_0x594535(0x2fb)](0x1),_0x370d05=_0x534552[_0x594535(0x2b2)]>=0x50?a27_0x44fedf[_0x594535(0x262)]:_0x534552['coveragePercent']>=0x32?a27_0x44fedf[_0x594535(0x1ec)]:a27_0x44fedf['red'];_0x1d5e64='\x20'+a27_0x44fedf['dim'](_0x594535(0x26b))+'\x20'+_0x370d05(_0x968d34+'%')+'\x20('+formatRows(_0x534552['matchedCount'])+_0x594535(0x22f);}console['error'](_0x2f7d4e+'\x20'+a27_0x44fedf[_0x594535(0x25c)](_0x534552['name'])+_0x1d5e64),console[_0x594535(0x205)]('\x20\x20'+a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x2c4))+'\x20'+a27_0x44fedf['bold'](_0x534552[_0x594535(0x221)]+'.'+_0x534552[_0x594535(0x2e5)]));const _0x2016aa=_0x534552['joinKey']===_0x534552[_0x594535(0x2c3)]?a27_0x44fedf['dim'](_0x594535(0x291))+'\x20'+_0x534552[_0x594535(0x285)]:a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x2a8))+'\x20'+_0x534552[_0x594535(0x285)]+_0x594535(0x2ac)+_0x534552[_0x594535(0x2c3)];console[_0x594535(0x205)]('\x20\x20'+_0x2016aa),console[_0x594535(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x594535(0x2b7))),this[_0x594535(0x226)](_0x534552[_0x594535(0x2ae)]),!_0x534552[_0x594535(0x2a0)]&&console['error']('\x20\x20'+a27_0x44fedf[_0x594535(0x20e)](_0x594535(0x24b))+'\x20'+_0x534552[_0x594535(0x1ff)]);}}[a27_0x30a75a(0x1fc)](_0x2edd66,_0x1e5b02){const _0x4838fc=a27_0x30a75a;if(_0x2edd66[_0x4838fc(0x231)][_0x4838fc(0x2b5)]===0x0)return;console[_0x4838fc(0x205)]('\x0a'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x23c))+'\x20'+a27_0x44fedf[_0x4838fc(0x2d3)]('('+_0x1e5b02+')'));for(const _0x4dbf15 of _0x2edd66[_0x4838fc(0x231)]){const _0xa53356=_0x4dbf15[_0x4838fc(0x2a0)]?a27_0x44fedf[_0x4838fc(0x262)]('✔'):a27_0x44fedf[_0x4838fc(0x20e)]('✘');let _0x3bae14='';if(_0x4dbf15['schemaValid']&&_0x4dbf15['customersWithEvents']!==undefined&&_0x4dbf15[_0x4838fc(0x2da)]!==undefined){const _0x29e1e3=_0x4dbf15['customerPercent']?.[_0x4838fc(0x2fb)](0x1)||'?',_0x1c5e8e=(_0x4dbf15[_0x4838fc(0x237)]??0x0)>=0x32?a27_0x44fedf[_0x4838fc(0x262)]:(_0x4dbf15['customerPercent']??0x0)>=0x14?a27_0x44fedf[_0x4838fc(0x1ec)]:a27_0x44fedf[_0x4838fc(0x20e)];_0x3bae14='\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x1fd))+'\x20'+_0x1c5e8e(formatRows(_0x4dbf15[_0x4838fc(0x29f)]))+'\x20('+_0x29e1e3+'%)\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x277))+'\x20'+a27_0x44fedf[_0x4838fc(0x1e7)](formatRows(_0x4dbf15['totalEvents']));}console[_0x4838fc(0x205)](_0xa53356+'\x20'+a27_0x44fedf[_0x4838fc(0x25c)](_0x4dbf15['name'])+_0x3bae14),console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x4838fc(0x2c4))+'\x20'+a27_0x44fedf[_0x4838fc(0x25c)](_0x4dbf15[_0x4838fc(0x221)]+'.'+_0x4dbf15[_0x4838fc(0x2e5)]));const _0x46aa22=_0x4dbf15['joinKey']===_0x4dbf15[_0x4838fc(0x2c3)]?a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x291))+'\x20'+_0x4dbf15[_0x4838fc(0x285)]:a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x2a8))+'\x20'+_0x4dbf15[_0x4838fc(0x285)]+'\x20=\x20'+_0x4dbf15[_0x4838fc(0x2c3)];console['error']('\x20\x20'+_0x46aa22),console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x2b7))),this['displayColumns'](_0x4dbf15['columns']),!_0x4dbf15[_0x4838fc(0x2a0)]&&console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf[_0x4838fc(0x20e)](_0x4838fc(0x24b))+'\x20'+_0x4dbf15[_0x4838fc(0x1ff)]);}}['displayColumns'](_0x19f3b5){const _0x326685=a27_0x30a75a;for(const _0x5570bd of _0x19f3b5){_0x5570bd[_0x326685(0x26f)]===_0x5570bd[_0x326685(0x1fa)]||_0x5570bd[_0x326685(0x1fa)]==='*'?console[_0x326685(0x205)](_0x326685(0x208)+_0x5570bd[_0x326685(0x26f)]):console[_0x326685(0x205)](_0x326685(0x208)+_0x5570bd[_0x326685(0x26f)]+'\x20'+a27_0x44fedf[_0x326685(0x2d3)]('('+_0x5570bd['column']+')'));}}[a27_0x30a75a(0x297)](_0x17bded){const _0x321be5=a27_0x30a75a;console[_0x321be5(0x205)]('─'[_0x321be5(0x21a)](0x3c));if(_0x17bded[_0x321be5(0x2b8)][_0x321be5(0x2b5)]>0x0){console['error']('\x0a'+a27_0x44fedf[_0x321be5(0x20e)]('Errors:'));for(const _0x2c500f of _0x17bded[_0x321be5(0x2b8)]){console[_0x321be5(0x205)]('\x20\x20'+a27_0x44fedf[_0x321be5(0x20e)]('•')+'\x20'+_0x2c500f);}}_0x17bded[_0x321be5(0x269)]&&console[_0x321be5(0x205)]('\x0a'+a27_0x44fedf[_0x321be5(0x262)]('✔')+_0x321be5(0x272));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]='segment:parent:preview';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x22b);async[a27_0x30a75a(0x235)](_0x47bda4){const _0x42389a=a27_0x30a75a,{options:_0x394aad,args:_0x51bebf,tdx:_0x5a6e85}=_0x47bda4,_0xcfb746=_0x394aad,_0xca4540=_0x51bebf[0x0]||_0x394aad[_0x42389a(0x29a)];if(!_0xca4540)return console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x22c))),console[_0x42389a(0x205)](_0x42389a(0x271)),console[_0x42389a(0x205)](_0x42389a(0x243)),console[_0x42389a(0x205)](_0x42389a(0x1f8)),console[_0x42389a(0x205)](_0x42389a(0x278)),console['error'](_0x42389a(0x2fc)),console[_0x42389a(0x205)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),console[_0x42389a(0x205)]('\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x1e7)](_0x42389a(0x209))),0x1;if(!_0xcfb746[_0x42389a(0x257)]&&!_0xcfb746['attribute']&&!_0xcfb746[_0x42389a(0x2e9)]&&!_0xcfb746['enriched'])return console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x1f9))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x42389a(0x205)](_0x42389a(0x2df)),console[_0x42389a(0x205)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x42389a(0x205)](_0x42389a(0x278)),console[_0x42389a(0x205)](_0x42389a(0x2fc)),console[_0x42389a(0x205)](_0x42389a(0x2ba)),0x1;const _0x116d89=resolveYamlFile(_0xca4540);if(!existsSync(_0x116d89))return showFileNotFoundError(_0x116d89,_0xca4540),0x1;_0xcfb746['verbose']&&(console['error']('Site:\x20'+_0xcfb746['site']),console[_0x42389a(0x205)](_0x42389a(0x2a1)+_0x116d89));let _0x34af0a;try{_0x34af0a=readFileSync(_0x116d89,'utf-8');}catch(_0x2d1093){const _0x3ede24=_0x2d1093 instanceof Error?_0x2d1093[_0x42389a(0x2cc)]:String(_0x2d1093);return console[_0x42389a(0x205)](_0x42389a(0x21e)+_0x3ede24),0x1;}let _0x545212;try{_0x545212=parseYamlString(_0x34af0a);}catch(_0x32d8f8){const _0x351df8=_0x32d8f8 instanceof Error?_0x32d8f8['message']:String(_0x32d8f8);return console[_0x42389a(0x205)](a27_0x44fedf['red'](_0x42389a(0x270)+_0x351df8)),0x1;}if(_0xcfb746['attribute']===!![]||_0xcfb746[_0x42389a(0x309)]===''){const _0x1635da=_0x545212[_0x42389a(0x2e2)]?.['map'](_0x3b51ae=>_0x3b51ae[_0x42389a(0x2de)])||[];if(_0x1635da['length']===0x0)console[_0x42389a(0x205)](a27_0x44fedf['red'](_0x42389a(0x247)));else{console['error'](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x2d1))),console[_0x42389a(0x205)](_0x42389a(0x200));for(const _0x126cf7 of _0x1635da){console[_0x42389a(0x205)]('\x20\x20'+a27_0x44fedf[_0x42389a(0x1e7)](_0x126cf7));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0xca4540+'\x20--attribute\x20\x22'+_0x1635da[0x0]+'\x22');}return 0x1;}if(_0xcfb746[_0x42389a(0x2e9)]===!![]||_0xcfb746[_0x42389a(0x2e9)]===''){const _0x4ba45b=_0x545212['behaviors']?.['map'](_0x255442=>_0x255442['name'])||[];if(_0x4ba45b[_0x42389a(0x2b5)]===0x0)console['error'](a27_0x44fedf['red'](_0x42389a(0x24d)));else{console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x2cb))),console[_0x42389a(0x205)](_0x42389a(0x28c));for(const _0x49f7bc of _0x4ba45b){console[_0x42389a(0x205)]('\x20\x20'+a27_0x44fedf['cyan'](_0x49f7bc));}console['error'](_0x42389a(0x244)+_0xca4540+_0x42389a(0x2bd)+_0x4ba45b[0x0]+'\x22');}return 0x1;}const _0x187f26=createCommandSpinner(a27_0x44fedf[_0x42389a(0x2d3)](_0x42389a(0x2ee)),{'verbose':_0xcfb746['verbose']});_0x187f26[_0x42389a(0x2f4)]();const _0x4a8a3b={'onProgress':_0x159ef2=>{const _0x5051c1=_0x42389a;_0x187f26[_0x5051c1(0x281)]=formatProgressMessage(_0x159ef2);}};if(_0xcfb746[_0x42389a(0x257)])_0x4a8a3b[_0x42389a(0x257)]=!![];if(_0xcfb746[_0x42389a(0x309)]&&typeof _0xcfb746['attribute']==='string')_0x4a8a3b[_0x42389a(0x309)]=_0xcfb746[_0x42389a(0x309)];if(_0xcfb746[_0x42389a(0x2e9)]&&typeof _0xcfb746[_0x42389a(0x2e9)]==='string')_0x4a8a3b['behavior']=_0xcfb746[_0x42389a(0x2e9)];if(_0xcfb746[_0x42389a(0x201)])_0x4a8a3b[_0x42389a(0x201)]=!![];if(_0xcfb746['interval'])_0x4a8a3b[_0x42389a(0x300)]=_0xcfb746[_0x42389a(0x300)];let _0x48535f;try{_0x48535f=await _0x5a6e85[_0x42389a(0x23e)][_0x42389a(0x2d2)](_0x34af0a,_0x4a8a3b),_0x187f26['stop']();}catch(_0x28e829){_0x187f26[_0x42389a(0x303)]();throw _0x28e829;}return await this[_0x42389a(0x2a5)](_0x48535f,{'master':_0xcfb746[_0x42389a(0x257)],'attribute':typeof _0xcfb746['attribute']==='string'?_0xcfb746[_0x42389a(0x309)]:undefined,'behavior':typeof _0xcfb746[_0x42389a(0x2e9)]===_0x42389a(0x224)?_0xcfb746[_0x42389a(0x2e9)]:undefined,'enriched':_0xcfb746['enriched']}),_0x48535f[_0x42389a(0x269)]?0x0:0x1;}async[a27_0x30a75a(0x2a5)](_0x122d28,_0x3e4aea){const _0x1c784a=a27_0x30a75a;console['error']('\x0a'+a27_0x44fedf['bold'](_0x1c784a(0x301))+'\x20'+_0x122d28[_0x1c784a(0x2de)]),console[_0x1c784a(0x205)]('═'[_0x1c784a(0x21a)](0x3c));if(_0x3e4aea['master']&&_0x122d28['sampleData']){const _0x1d6a3f=a27_0x44fedf[_0x1c784a(0x2d3)]('Master:')+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)](_0x122d28[_0x1c784a(0x257)]['database']+'.'+_0x122d28['master'][_0x1c784a(0x2e5)]);await this[_0x1c784a(0x20b)](_0x1d6a3f,_0x122d28['sampleData']);}else{if(_0x3e4aea[_0x1c784a(0x309)]&&_0x122d28[_0x1c784a(0x211)]){const _0xf481d0=a27_0x44fedf[_0x1c784a(0x2d3)](_0x1c784a(0x254))+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)](_0x3e4aea[_0x1c784a(0x309)]);await this[_0x1c784a(0x20b)](_0xf481d0,_0x122d28[_0x1c784a(0x211)]);}else{if(_0x3e4aea['behavior']&&_0x122d28[_0x1c784a(0x211)]){const _0x15f43c=a27_0x44fedf['dim'](_0x1c784a(0x2db))+'\x20'+a27_0x44fedf['bold'](_0x3e4aea[_0x1c784a(0x2e9)]);await this[_0x1c784a(0x20b)](_0x15f43c,_0x122d28[_0x1c784a(0x211)]);}else{if(_0x3e4aea[_0x1c784a(0x201)]&&_0x122d28['sampleData']){const _0x2892e1=a27_0x44fedf[_0x1c784a(0x2d3)](_0x1c784a(0x283))+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)]('Master\x20+\x20Attributes');await this[_0x1c784a(0x20b)](_0x2892e1,_0x122d28[_0x1c784a(0x211)]);}else!_0x122d28['sampleData']&&console['error'](_0x1c784a(0x1e5));}}}if(_0x122d28['errors'][_0x1c784a(0x2b5)]>0x0){console[_0x1c784a(0x205)]('─'[_0x1c784a(0x21a)](0x3c)),console[_0x1c784a(0x205)]('\x0a'+a27_0x44fedf[_0x1c784a(0x20e)](_0x1c784a(0x28d)));for(const _0x1adaea of _0x122d28['errors']){console[_0x1c784a(0x205)]('\x20\x20'+a27_0x44fedf[_0x1c784a(0x20e)]('•')+'\x20'+_0x1adaea);}}}async['displaySampleData'](_0x8dceb3,_0x55f920){const _0x465127=a27_0x30a75a;if(_0x55f920[_0x465127(0x2b5)]===0x0){console['error']('\x0a'+_0x8dceb3),console[_0x465127(0x205)](_0x465127(0x210));return;}console[_0x465127(0x205)]('\x0a'+_0x8dceb3);const _0xb1f503=Object[_0x465127(0x26c)](_0x55f920[0x0])['map'](_0xff0499=>({'name':_0xff0499,'type':typeof _0x55f920[0x0][_0xff0499]===_0x465127(0x251)?_0x465127(0x2d4):_0x465127(0x2a2)})),_0x36337d={'queryId':_0x465127(0x259),'columns':_0xb1f503,'data':_0x55f920,'stats':{'state':_0x465127(0x2dc),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x55f920[_0x465127(0x2b5)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x21a893=formatAsTable(_0x36337d,_0x55f920[_0x465127(0x2b5)],!![]);await writeOutput(_0x21a893,undefined,_0x465127(0x2e5));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a27_0x30a75a(0x21b);[a27_0x30a75a(0x23b)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a27_0x30a75a(0x235)](_0x392c83){const _0x3a43ad=a27_0x30a75a,{options:_0x1d3756,args:_0x59d3d8,tdx:_0x271b9d}=_0x392c83,_0x977c04=_0x1d3756,_0x32d041=_0x59d3d8[0x0]||_0x1d3756[_0x3a43ad(0x29a)];if(!_0x32d041)return console[_0x3a43ad(0x205)](a27_0x44fedf[_0x3a43ad(0x20e)](_0x3a43ad(0x22c))),console[_0x3a43ad(0x205)]('Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a'),console[_0x3a43ad(0x205)](a27_0x44fedf[_0x3a43ad(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;const _0x26af5f=resolveYamlFile(_0x32d041);if(existsSync(_0x26af5f)){_0x977c04[_0x3a43ad(0x1e9)]&&console[_0x3a43ad(0x205)]('Found\x20YAML\x20file:\x20'+_0x26af5f);let _0x4a41ae;try{_0x4a41ae=readFileSync(_0x26af5f,_0x3a43ad(0x2ca));}catch(_0x4b5e88){const _0x111993=_0x4b5e88 instanceof Error?_0x4b5e88[_0x3a43ad(0x2cc)]:String(_0x4b5e88);return console[_0x3a43ad(0x205)](_0x3a43ad(0x21e)+_0x111993),0x1;}const _0x5b5eb9=await withSpinner(_0x3a43ad(0x28a),()=>_0x271b9d['segment']['pushParentYaml'](_0x4a41ae),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]}),_0x98b980=_0x5b5eb9[_0x3a43ad(0x30a)],{isNew:_0x50862e,name:_0x2a4b8a,hasChanges:_0x160fef,diffFormatted:_0x4830ff}=_0x98b980;if(_0x160fef){_0x50862e?console[_0x3a43ad(0x205)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x2a4b8a+'\x27:'):console[_0x3a43ad(0x205)](_0x3a43ad(0x217)+_0x2a4b8a+'\x27:');console[_0x3a43ad(0x205)]('─'[_0x3a43ad(0x21a)](0x3c)),console[_0x3a43ad(0x205)](_0x4830ff),console[_0x3a43ad(0x205)]('─'[_0x3a43ad(0x21a)](0x3c));const _0x2287c1=_0x50862e?_0x3a43ad(0x308)+_0x2a4b8a+_0x3a43ad(0x264):_0x3a43ad(0x30b)+_0x2a4b8a+_0x3a43ad(0x264);if(!_0x977c04[_0x3a43ad(0x307)]){const _0x366986=await confirmKey(_0x2287c1);if(!_0x366986)return console[_0x3a43ad(0x205)](_0x3a43ad(0x20c)),0x1;}const _0x409840=_0x50862e?_0x3a43ad(0x2a6):_0x3a43ad(0x2c2);await withSpinner(_0x409840+_0x3a43ad(0x242)+_0x2a4b8a+_0x3a43ad(0x274),()=>_0x98b980[_0x3a43ad(0x2be)](),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]});const _0xae1497=_0x50862e?_0x3a43ad(0x27f):'Updated';console['error']('✔\x20'+_0xae1497+_0x3a43ad(0x242)+_0x2a4b8a+'\x27');}else console[_0x3a43ad(0x205)](_0x3a43ad(0x2b9)+_0x2a4b8a+'\x27\x20is\x20up\x20to\x20date');}const _0x2786ab=await withSpinner(_0x3a43ad(0x25d)+_0x32d041+'\x27...',()=>_0x271b9d[_0x3a43ad(0x23e)][_0x3a43ad(0x2b6)](_0x32d041),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]}),_0x2301b5=_0x2786ab[_0x3a43ad(0x30a)],_0x2f7c42=getConsoleUrl(_0x977c04[_0x3a43ad(0x238)],'/app/workflows/'+_0x2301b5[_0x3a43ad(0x1f5)]+_0x3a43ad(0x2c7)+_0x2301b5[_0x3a43ad(0x219)]+'/attempt/'+_0x2301b5['workflowAttemptId']);return console[_0x3a43ad(0x205)](_0x3a43ad(0x27a)),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x2d5))+'\x20'+_0x2301b5[_0x3a43ad(0x1f0)]),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x256))+'\x20'+_0x2301b5['status']),console['error']('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)]('Session:')+'\x20'+_0x2301b5[_0x3a43ad(0x219)]),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x2bc))+'\x20'+_0x2301b5[_0x3a43ad(0x2d0)]),console['error']('\x20\x20'+_0x2f7c42),console[_0x3a43ad(0x205)]('\x0a'+a27_0x44fedf[_0x3a43ad(0x2d3)]('To\x20cancel:')+_0x3a43ad(0x267)+_0x2301b5[_0x3a43ad(0x2d0)]+_0x3a43ad(0x207)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x26a);['description']=a27_0x30a75a(0x2a9);async[a27_0x30a75a(0x235)](_0x8a1c10){const _0x43a4cd=a27_0x30a75a,{options:_0x545e4b,args:_0x2c6065,tdx:_0x1670c4}=_0x8a1c10,_0x24e3b2=_0x2c6065[0x0]||_0x545e4b['parentSegment'];if(!_0x24e3b2)return console[_0x43a4cd(0x205)](a27_0x44fedf[_0x43a4cd(0x20e)](_0x43a4cd(0x22c))),console[_0x43a4cd(0x205)](_0x43a4cd(0x26d)),console[_0x43a4cd(0x205)](a27_0x44fedf['cyan'](_0x43a4cd(0x288))),0x1;_0x545e4b[_0x43a4cd(0x1e9)]&&(console[_0x43a4cd(0x205)](_0x43a4cd(0x282)+_0x545e4b[_0x43a4cd(0x238)]),console[_0x43a4cd(0x205)](_0x43a4cd(0x302)+_0x24e3b2));const _0x294f3f=await withSpinner(_0x43a4cd(0x290)+_0x24e3b2+_0x43a4cd(0x274),()=>_0x1670c4[_0x43a4cd(0x23e)][_0x43a4cd(0x2c0)](_0x24e3b2),{'verbose':_0x545e4b[_0x43a4cd(0x1e9)]}),_0x53110d=_0x294f3f['data'];console[_0x43a4cd(0x205)](_0x43a4cd(0x203)+_0x53110d['length']+'\x20field'+(_0x53110d['length']!==0x1?'s':''));if(_0x545e4b[_0x43a4cd(0x296)]||_0x545e4b[_0x43a4cd(0x2f5)])return await handleSDKOutput(_0x53110d,_0x545e4b),0x0;return displayFieldsHumanReadable(_0x53110d,_0x24e3b2),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:view';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x2e1);async[a27_0x30a75a(0x235)](_0x296d83){const _0x18d720=a27_0x30a75a,{options:_0x239273,args:_0x263fcf,tdx:_0x55d578}=_0x296d83,_0x5bb925=_0x239273,_0x529b6f=_0x263fcf[0x0]||_0x239273['parentSegment'];if(!_0x529b6f)return console[_0x18d720(0x205)](a27_0x44fedf[_0x18d720(0x20e)](_0x18d720(0x22c))),console[_0x18d720(0x205)]('Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a'),console[_0x18d720(0x205)](_0x18d720(0x2df)),console['error'](_0x18d720(0x20d)),console['error'](a27_0x44fedf['cyan']('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x239273[_0x18d720(0x1e9)]&&(console[_0x18d720(0x205)](_0x18d720(0x282)+_0x239273[_0x18d720(0x238)]),console[_0x18d720(0x205)](_0x18d720(0x302)+_0x529b6f));const _0x2202ad=await withSpinner(_0x18d720(0x26e)+_0x529b6f+'\x27...',()=>_0x55d578['segment'][_0x18d720(0x21d)](_0x529b6f),{'verbose':_0x239273[_0x18d720(0x1e9)]}),_0x28f0bd=_0x2202ad[_0x18d720(0x30a)];if(_0x5bb925['web']){const _0xcb1cd=getConsoleNextUrl(_0x5bb925['site'],_0x18d720(0x29d)+_0x28f0bd['id']);return console['error'](a27_0x44fedf['green']('✔')+_0x18d720(0x29c)+a27_0x44fedf['cyan'](_0xcb1cd)),openBrowser(_0xcb1cd),0x0;}return await handleSingleObjectOutput(_0x28f0bd,_0x239273),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a27_0x30a75a(0x1fb);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x295);async[a27_0x30a75a(0x235)](_0x1eb9ef){const _0x4389e8=a27_0x30a75a,{options:_0x3353be,args:_0x1cead5,tdx:_0x2598c8}=_0x1eb9ef,_0x3f6bf2=_0x1cead5[0x0]||_0x3353be[_0x4389e8(0x29a)];if(!_0x3f6bf2)return console[_0x4389e8(0x205)](a27_0x44fedf['red'](_0x4389e8(0x22c))),console[_0x4389e8(0x205)](_0x4389e8(0x239)),console[_0x4389e8(0x205)](a27_0x44fedf[_0x4389e8(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x3353be[_0x4389e8(0x1e9)]&&(console['error'](_0x4389e8(0x282)+_0x3353be[_0x4389e8(0x238)]),console[_0x4389e8(0x205)](_0x4389e8(0x302)+_0x3f6bf2));const _0x155404=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3f6bf2+_0x4389e8(0x274),()=>_0x2598c8['segment'][_0x4389e8(0x2ed)](_0x3f6bf2),{'verbose':_0x3353be[_0x4389e8(0x1e9)]}),_0x449c5a=_0x155404['data'],_0x17a50=await withSpinner(_0x4389e8(0x241)+_0x3f6bf2+_0x4389e8(0x274),()=>_0x2598c8['segment']['getParentSQL'](_0x449c5a),{'verbose':_0x3353be[_0x4389e8(0x1e9)]}),_0x19ee6e=await executeSchemaQuery(_0x17a50[_0x4389e8(0x30a)],_0x2598c8,_0x3353be);return await handleQueryOutput(_0x19ee6e,_0x3353be),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:sql';[a27_0x30a75a(0x23b)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a27_0x30a75a(0x235)](_0xcf8a97){const _0x33a08a=a27_0x30a75a,{options:_0x7537a2,args:_0x56eb83,tdx:_0x58640d}=_0xcf8a97,_0xdd0e2f=_0x56eb83[0x0]||_0x7537a2[_0x33a08a(0x29a)];if(!_0xdd0e2f)return console[_0x33a08a(0x205)](a27_0x44fedf[_0x33a08a(0x20e)](_0x33a08a(0x22c))),console['error']('Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a'),console[_0x33a08a(0x205)](a27_0x44fedf[_0x33a08a(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x7537a2[_0x33a08a(0x1e9)]&&(console[_0x33a08a(0x205)](_0x33a08a(0x282)+_0x7537a2['site']),console['error'](_0x33a08a(0x302)+_0xdd0e2f));const _0x3c5956=await withSpinner(_0x33a08a(0x25e)+_0xdd0e2f+'\x27...',()=>_0x58640d['segment'][_0x33a08a(0x2ed)](_0xdd0e2f),{'verbose':_0x7537a2['verbose']}),_0x81d5da=_0x3c5956['data'],_0x3f7794=await withSpinner(_0x33a08a(0x241)+_0xdd0e2f+_0x33a08a(0x274),()=>_0x58640d[_0x33a08a(0x23e)][_0x33a08a(0x298)](_0x81d5da),{'verbose':_0x7537a2[_0x33a08a(0x1e9)]}),_0x4fdb87=_0x3f7794[_0x33a08a(0x30a)];return _0x7537a2[_0x33a08a(0x25b)]==='json'||_0x7537a2[_0x33a08a(0x25b)]===_0x33a08a(0x2f5)?await handleSDKOutput([{'sql':_0x4fdb87}],_0x7537a2):console[_0x33a08a(0x292)](_0x4fdb87),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2f9);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x261);async[a27_0x30a75a(0x235)](_0x6f19d0){const _0x2f6df9=a27_0x30a75a,{options:_0x2f2995,args:_0x27f45e,tdx:_0x5d70a1}=_0x6f19d0,_0x107506=_0x27f45e[0x0]||_0x2f2995[_0x2f6df9(0x29a)];if(!_0x107506)return console['error'](a27_0x44fedf[_0x2f6df9(0x20e)](_0x2f6df9(0x22c))),console[_0x2f6df9(0x205)](_0x2f6df9(0x286)),console[_0x2f6df9(0x205)](a27_0x44fedf['cyan'](_0x2f6df9(0x288))),0x1;_0x2f2995['verbose']&&(console[_0x2f6df9(0x205)](_0x2f6df9(0x282)+_0x2f2995['site']),console[_0x2f6df9(0x205)](_0x2f6df9(0x302)+_0x107506));const _0x166eda=await withSpinner(_0x2f6df9(0x25e)+_0x107506+_0x2f6df9(0x274),()=>_0x5d70a1[_0x2f6df9(0x23e)][_0x2f6df9(0x2ed)](_0x107506),{'verbose':_0x2f2995['verbose']}),_0x58bd44=_0x166eda['data'],_0x2a644b=await withSpinner(_0x2f6df9(0x241)+_0x107506+_0x2f6df9(0x274),()=>_0x5d70a1['segment'][_0x2f6df9(0x298)](_0x58bd44),{'verbose':_0x2f2995[_0x2f6df9(0x1e9)]});let _0x37b7a9=_0x2a644b[_0x2f6df9(0x30a)];const _0x26b952=resolveLimit(_0x2f2995['limit'],DEFAULT_DISPLAY_LIMIT),_0x4aedd0=/\bLIMIT\s+\d+/i['test'](_0x37b7a9);!_0x4aedd0&&(_0x37b7a9=_0x37b7a9[_0x2f6df9(0x2e4)]()[_0x2f6df9(0x305)](/;+$/,''),_0x37b7a9=_0x2f6df9(0x1ef)+_0x37b7a9+_0x2f6df9(0x25f)+_0x26b952);_0x2f2995[_0x2f6df9(0x1e9)]&&console[_0x2f6df9(0x205)](_0x2f6df9(0x2bf)+_0x37b7a9);const _0x3a2d80=await withQuerySpinner(_0x2f6df9(0x2a3),async _0x81e43f=>{const _0x405a27=_0x2f6df9,_0x434db4=await _0x5d70a1[_0x405a27(0x253)]['execute'](_0x37b7a9,{'catalog':'td','schema':'information_schema','onJobId':_0x5fd164=>{const _0x4622cb=_0x405a27;_0x81e43f[_0x4622cb(0x1fe)](_0x5fd164);}});return _0x434db4;},{'verbose':_0x2f2995[_0x2f6df9(0x1e9)]}),_0x4a17db=_0x3a2d80['data'],_0x2deced=_0x4a17db[_0x2f6df9(0x263)]?_0x2f6df9(0x2e8)+_0x4a17db[_0x2f6df9(0x263)]+']':'';return console['error'](_0x2f6df9(0x245)+_0x4a17db[_0x2f6df9(0x2f3)][_0x2f6df9(0x289)][_0x2f6df9(0x2dd)]()+_0x2f6df9(0x252)+(_0x2f6df9(0x1ea)+formatElapsed(_0x4a17db[_0x2f6df9(0x2f3)]['elapsedTimeMillis'])+_0x2deced)),await handleQueryOutput(_0x4a17db,_0x2f2995),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x3029da=a28_0x1a81;function a28_0x437d(){const _0x265189=['error','12qlssfs','21CikMHo','1323932NryWXR','15590ujfFoL','log','\x20\x20Global:\x20~/.config/tdx/tdx.json','294IuLFHK','config','3ngzrhb','name','735633iPEGsN','27235aegwlD','1325610UqhMLq','5949VEwScI','4736941kMkikn','scope','profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','message','map','length','description','185624wANgtV'];a28_0x437d=function(){return _0x265189;};return a28_0x437d();}function a28_0x1a81(_0x546aa2,_0x364e45){_0x546aa2=_0x546aa2-0x186;const _0x437d21=a28_0x437d();let _0x1a8116=_0x437d21[_0x546aa2];return _0x1a8116;}(function(_0x204e71,_0x57047e){const _0x470599=a28_0x1a81,_0x54e3bb=_0x204e71();while(!![]){try{const _0x393485=parseInt(_0x470599(0x198))/0x1+parseInt(_0x470599(0x19a))/0x2+-parseInt(_0x470599(0x196))/0x3*(-parseInt(_0x470599(0x190))/0x4)+parseInt(_0x470599(0x199))/0x5*(parseInt(_0x470599(0x194))/0x6)+parseInt(_0x470599(0x18f))/0x7*(parseInt(_0x470599(0x18c))/0x8)+parseInt(_0x470599(0x19b))/0x9*(-parseInt(_0x470599(0x191))/0xa)+parseInt(_0x470599(0x19c))/0xb*(-parseInt(_0x470599(0x18e))/0xc);if(_0x393485===_0x57047e)break;else _0x54e3bb['push'](_0x54e3bb['shift']());}catch(_0x13602b){_0x54e3bb['push'](_0x54e3bb['shift']());}}}(a28_0x437d,0x93a83));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a28_0x3029da(0x197)]=a28_0x3029da(0x186);[a28_0x3029da(0x18b)]='List\x20all\x20available\x20profiles';async['execute'](_0x4476f9){const _0x5d3e40=a28_0x3029da,{options:_0x46a100}=_0x4476f9;try{const _0x434c31=listProfiles(),_0xd0fdfc=getActiveProfile();if(_0x434c31[_0x5d3e40(0x18a)]===0x0)return console['log'](_0x5d3e40(0x187)),console[_0x5d3e40(0x192)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x5d3e40(0x192)](_0x5d3e40(0x193)),0x0;const _0x53b2fc=_0x434c31[_0x5d3e40(0x189)](_0x84a8f2=>{const _0x94331d=_0x5d3e40,_0x1cb5aa=_0x84a8f2[_0x94331d(0x197)]===_0xd0fdfc,_0x3c9113=getProfileParams(_0x84a8f2['config']);return{'name':_0x84a8f2[_0x94331d(0x197)],'active':_0x1cb5aa,'scope':_0x84a8f2[_0x94331d(0x19d)],'description':_0x84a8f2[_0x94331d(0x195)][_0x94331d(0x18b)]||'','params':_0x3c9113};});return await handleSDKOutput(_0x53b2fc,_0x46a100),0x0;}catch(_0x3ae3b4){return _0x3ae3b4 instanceof Error&&console[_0x5d3e40(0x18d)]('Error:\x20'+_0x3ae3b4[_0x5d3e40(0x188)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x182567=a29_0x1a07;(function(_0x779976,_0x169155){const _0x2764af=a29_0x1a07,_0x282453=_0x779976();while(!![]){try{const _0x2016dd=parseInt(_0x2764af(0xc8))/0x1+parseInt(_0x2764af(0xb8))/0x2*(parseInt(_0x2764af(0xc2))/0x3)+parseInt(_0x2764af(0xa9))/0x4+parseInt(_0x2764af(0xc4))/0x5*(parseInt(_0x2764af(0xce))/0x6)+parseInt(_0x2764af(0xcd))/0x7+parseInt(_0x2764af(0xaa))/0x8+-parseInt(_0x2764af(0xc0))/0x9;if(_0x2016dd===_0x169155)break;else _0x282453['push'](_0x282453['shift']());}catch(_0x54620d){_0x282453['push'](_0x282453['shift']());}}}(a29_0x78ce,0x8408b));function a29_0x78ce(){const _0x11ff08=['database','push','setExtra','Run\x20Trino\x20queries\x20(streaming)','setJobId','processedRows','state','error','in\x20','2926664FDWrzC','7910384ChUcFy','execute','jobId','Statement\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','stats','query','Executing\x20statement\x20','Executing\x20query\x20[','options','output','\x20rows\x20','Query\x20completed:\x20Processed\x20','Site:\x20','1659106XRZosy','data','\x20splits','description','SQL:\x20','file','setPhase','message','32921577JzEizL','...','3aNaqot','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','5UaiFbZ','validate','Error:\x20','name','600424QeVnbP','elapsedTimeMillis','information_schema','length','originalMessage','5733945NBjfAv','1375128xPqWcB','join','\x20[Job\x20ID:\x20','Catalog:\x20','args','\x20-\x20','verbose'];a29_0x78ce=function(){return _0x11ff08;};return a29_0x78ce();}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';function a29_0x1a07(_0x333dcc,_0x331bb8){_0x333dcc=_0x333dcc-0xa4;const _0x78ceb1=a29_0x78ce();let _0x1a07d6=_0x78ceb1[_0x333dcc];return _0x1a07d6;}export class QueryCommand extends BaseCommand{[a29_0x182567(0xc7)]='query';[a29_0x182567(0xbb)]=a29_0x182567(0xd8);async[a29_0x182567(0xab)](_0x3a6586){const _0x3e0e12=a29_0x182567,{options:_0xf7b84a,args:_0x2dcddc,tdx:_0x34f32b}=_0x3a6586,_0x53ffe4=_0x2dcddc[0x0],_0x248c2a=_0xf7b84a[_0x3e0e12(0xbd)];let _0x131ca3;if(_0x248c2a)try{_0x131ca3=readSqlStatementsFromFile(_0x248c2a);}catch(_0x44ba43){return console['error'](_0x3e0e12(0xc6)+_0x44ba43['message']),0x1;}else try{_0x131ca3=splitSqlStatements(_0x53ffe4);}catch(_0x20fcd5){return console['error'](_0x3e0e12(0xc6)+_0x20fcd5[_0x3e0e12(0xbf)]),0x1;}const _0x370bcc=_0xf7b84a[_0x3e0e12(0xd5)]||_0x3e0e12(0xca),_0x949de8=_0xf7b84a['catalog'];try{const _0x3f5f1d=[],_0x54edfa=!!_0xf7b84a[_0x3e0e12(0xb4)];for(let _0x37c404=0x0;_0x37c404<_0x131ca3[_0x3e0e12(0xcb)];_0x37c404++){const _0x3c1de9=_0x131ca3[_0x37c404],_0x35ced4=_0x37c404+0x1,_0x4342f7=_0x131ca3[_0x3e0e12(0xcb)],_0x5b67f4=_0x4342f7>0x1;_0xf7b84a[_0x3e0e12(0xd4)]&&(console['error']('\x0a'+(_0x5b67f4?_0x3e0e12(0xad)+_0x35ced4+'/'+_0x4342f7+':':'')),console['error'](_0x3e0e12(0xb7)+_0xf7b84a['site']),console['error'](_0x3e0e12(0xd1)+(_0x949de8||'td')),console[_0x3e0e12(0xa7)]('Schema:\x20'+_0x370bcc),console['error'](_0x3e0e12(0xbc)+_0x3c1de9));const _0x1f352f=_0x5b67f4?_0x3e0e12(0xb1)+_0x35ced4+'/'+_0x4342f7+_0x3e0e12(0xc1):'Executing\x20query...';try{const _0x182ed1=await withQuerySpinner(_0x1f352f,async _0x193922=>{const _0x23389a=_0x3e0e12,_0x119581=await _0x34f32b[_0x23389a(0xb0)][_0x23389a(0xab)](_0x3c1de9,{'catalog':_0x949de8,'schema':_0x370bcc,'onJobId':_0x1c5de4=>{const _0x4277ae=_0x23389a;_0x193922[_0x4277ae(0xa4)](_0x1c5de4);},'onProgress':_0x28f321=>{const _0x1ab76c=_0x23389a;_0x193922[_0x1ab76c(0xbe)](_0x1ab76c(0xb2)+_0x28f321[_0x1ab76c(0xa6)]+']'),_0x193922[_0x1ab76c(0xd7)](formatRows(_0x28f321[_0x1ab76c(0xa5)])+_0x1ab76c(0xb5)+_0x28f321['completedSplits']+'/'+_0x28f321['totalSplits']+_0x1ab76c(0xba));}});return _0x119581;},{'verbose':_0xf7b84a[_0x3e0e12(0xd4)]}),_0x393ce1=_0x182ed1[_0x3e0e12(0xb9)],_0x5d3f71=_0x393ce1['jobId']?_0x3e0e12(0xd0)+_0x393ce1[_0x3e0e12(0xac)]+']':'',_0x2b1c31=_0x5b67f4?'Statement\x20'+_0x35ced4+'/'+_0x4342f7+_0x3e0e12(0xd3):'';console[_0x3e0e12(0xa7)]('✔\x20'+_0x2b1c31+_0x3e0e12(0xb6)+formatRows(_0x393ce1[_0x3e0e12(0xaf)]['processedRows'])+_0x3e0e12(0xb5)+(_0x3e0e12(0xa8)+formatElapsed(_0x393ce1[_0x3e0e12(0xaf)][_0x3e0e12(0xc9)])+_0x5d3f71));if(_0x5b67f4&&_0x54edfa){const _0x18d0f2=resolveOutputOptions(_0xf7b84a),_0x3fd37a=await formatQueryOutput(_0x393ce1,_0x18d0f2);_0x3f5f1d[_0x3e0e12(0xd6)](_0x3fd37a);}else await handleQueryOutput(_0x393ce1,_0xf7b84a);}catch(_0x462edc){const _0x309e78=_0x5b67f4?_0x3e0e12(0xad)+_0x35ced4+'/'+_0x4342f7+':\x0a':'',_0x13be55=_0x462edc instanceof SDKError?_0x462edc[_0x3e0e12(0xcc)]:_0x462edc[_0x3e0e12(0xbf)];return console[_0x3e0e12(0xa7)](''+_0x309e78+_0x13be55),0x1;}}if(_0x131ca3[_0x3e0e12(0xcb)]>0x1&&_0x54edfa&&_0x3f5f1d[_0x3e0e12(0xcb)]>0x0){const _0x480da8=_0x3f5f1d[_0x3e0e12(0xcf)]('\x0a');writeFileSync(_0xf7b84a['output'],_0x480da8),console[_0x3e0e12(0xa7)]('\x0aAll\x20results\x20saved\x20to\x20'+_0xf7b84a['output']);}return 0x0;}catch(_0x443a7c){throw _0x443a7c;}}[a29_0x182567(0xc5)](_0x4e68a8){const _0x4b68dc=a29_0x182567,_0x37268d=_0x4e68a8[_0x4b68dc(0xd2)][0x0],_0x462398=_0x4e68a8[_0x4b68dc(0xb3)][_0x4b68dc(0xbd)];if(!_0x37268d&&!_0x462398)return _0x4b68dc(0xc3);if(_0x37268d&&_0x462398)return _0x4b68dc(0xae);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x5786e6=a30_0x44e6;(function(_0x5a1c34,_0xc273a7){const _0x14d5dc=a30_0x44e6,_0x24a614=_0x5a1c34();while(!![]){try{const _0x12eca5=-parseInt(_0x14d5dc(0x17b))/0x1+parseInt(_0x14d5dc(0x1e2))/0x2+-parseInt(_0x14d5dc(0x1f2))/0x3*(-parseInt(_0x14d5dc(0x1f5))/0x4)+parseInt(_0x14d5dc(0x1fb))/0x5+-parseInt(_0x14d5dc(0x1af))/0x6+-parseInt(_0x14d5dc(0x1e4))/0x7+parseInt(_0x14d5dc(0x17f))/0x8*(parseInt(_0x14d5dc(0x1f7))/0x9);if(_0x12eca5===_0xc273a7)break;else _0x24a614['push'](_0x24a614['shift']());}catch(_0x23d7ac){_0x24a614['push'](_0x24a614['shift']());}}}(a30_0x3689,0x31b07));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';function resolveSegmentTarget(_0x1d47b9,_0x576adf,_0x35fd7b){const _0x29670e=a30_0x44e6;if(isYamlFilePath(_0x1d47b9))try{const _0x1a9573=resolveYamlFilePath(_0x1d47b9);return _0x35fd7b&&(console[_0x29670e(0x1a1)](_0x29670e(0x1d8)+_0x1d47b9),console[_0x29670e(0x1a1)](_0x29670e(0x194)+_0x1a9573[_0x29670e(0x170)]),console['error'](_0x29670e(0x1e8)+_0x1a9573[_0x29670e(0x176)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x1a9573[_0x29670e(0x1e3)]||'(root)')),console['error']('\x20\x20Full\x20path:\x20'+_0x1a9573[_0x29670e(0x1b7)])),_0x1a9573[_0x29670e(0x1b7)];}catch(_0x1e5d37){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1e5d37[_0x29670e(0x184)]);}if(!_0x576adf)throw new SDKError(ErrorCode[_0x29670e(0x196)],_0x29670e(0x1ec));return _0x576adf+'/'+_0x1d47b9;}export class SegmentDescribeCommand extends BaseCommand{['name']=a30_0x5786e6(0x1f4);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x16b);async[a30_0x5786e6(0x177)](_0x4a8fed){const _0x1dd7b1=a30_0x5786e6,{options:_0x384e66,args:_0x372646,tdx:_0x622a3b}=_0x4a8fed,_0x47e4c2=_0x372646[0x0],_0x2f04db=!_0x47e4c2&&!!_0x384e66['parentSegment'],_0x3c485a=_0x47e4c2||_0x384e66[_0x1dd7b1(0x170)];if(!_0x3c485a)return console['error'](_0x1dd7b1(0x1f9)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x197)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1c7)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1b8)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x187)),console['error'](_0x1dd7b1(0x1b5)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x175)),0x1;try{const _0x3929f0=_0x384e66[_0x1dd7b1(0x19d)];let _0x5c4d09=_0x3c485a;!_0x2f04db&&_0x3929f0&&!_0x3c485a['includes']('/')&&(_0x5c4d09=_0x3929f0+'/'+_0x3c485a,_0x384e66[_0x1dd7b1(0x1b3)]&&console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x16a)+_0x5c4d09));const _0x512d2c=await withSpinner(_0x1dd7b1(0x1c0)+_0x5c4d09+'\x27...',()=>_0x622a3b[_0x1dd7b1(0x17a)]['resolvePathToResource'](_0x5c4d09),{'verbose':_0x384e66['verbose']}),_0x14156d=_0x512d2c['data'];_0x384e66[_0x1dd7b1(0x1b3)]&&(console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1d0)+_0x14156d[_0x1dd7b1(0x17c)]),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1ce)+_0x14156d[_0x1dd7b1(0x1f6)]),_0x14156d['folderId']&&console[_0x1dd7b1(0x1a1)]('Folder\x20ID:\x20'+_0x14156d['folderId']),_0x14156d[_0x1dd7b1(0x1d9)]&&console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1b1)+_0x14156d[_0x1dd7b1(0x1d9)]));if(_0x14156d['type']===_0x1dd7b1(0x1ca)){const _0x58a97a=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x622a3b[_0x1dd7b1(0x17a)][_0x1dd7b1(0x185)](_0x14156d[_0x1dd7b1(0x1f6)]),{'verbose':_0x384e66['verbose']});await handleSingleObjectOutput(_0x58a97a[_0x1dd7b1(0x1db)],_0x384e66);}else{if(_0x14156d[_0x1dd7b1(0x17c)]===_0x1dd7b1(0x1cf)){if(!_0x14156d[_0x1dd7b1(0x19a)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x545cef=await withSpinner(_0x1dd7b1(0x18a),()=>_0x622a3b['segment'][_0x1dd7b1(0x1a3)](_0x14156d[_0x1dd7b1(0x19a)]),{'verbose':_0x384e66[_0x1dd7b1(0x1b3)]});await handleSingleObjectOutput(_0x545cef[_0x1dd7b1(0x1db)],_0x384e66);}else{if(_0x14156d[_0x1dd7b1(0x17c)]===_0x1dd7b1(0x17a)){if(!_0x14156d[_0x1dd7b1(0x1d9)])throw new SDKError(ErrorCode[_0x1dd7b1(0x195)],_0x1dd7b1(0x1e1));const _0x626e68=await withSpinner(_0x1dd7b1(0x1d7),()=>_0x622a3b[_0x1dd7b1(0x17a)][_0x1dd7b1(0x1df)](_0x14156d['parentId'],_0x14156d[_0x1dd7b1(0x1d9)]),{'verbose':_0x384e66[_0x1dd7b1(0x1b3)]});await handleSingleObjectOutput(_0x626e68[_0x1dd7b1(0x1db)],_0x384e66);}}}return 0x0;}catch(_0x181fa4){if(_0x181fa4 instanceof SDKError)return console[_0x1dd7b1(0x1a1)]('Error:\x20'+_0x181fa4[_0x1dd7b1(0x184)]),_0x181fa4[_0x1dd7b1(0x193)]&&console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1e7)+_0x181fa4[_0x1dd7b1(0x193)]),0x1;throw _0x181fa4;}}}export class SegmentShowCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x1ba);[a30_0x5786e6(0x192)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x175eae){const _0x192e19=a30_0x5786e6,{options:_0x142fce,args:_0x25f809,tdx:_0x405561}=_0x175eae,_0x3f4173=_0x25f809[0x0];if(!_0x3f4173)return console[_0x192e19(0x1a1)](_0x192e19(0x1b2)),console['error'](_0x192e19(0x1b0)),console[_0x192e19(0x1a1)](_0x192e19(0x1a4)),console['error']('Examples:'),console[_0x192e19(0x1a1)](_0x192e19(0x1e0)),console[_0x192e19(0x1a1)](_0x192e19(0x1be)),0x1;try{const _0x7d0a00=_0x142fce[_0x192e19(0x170)],_0x177016=resolveSegmentTarget(_0x3f4173,_0x7d0a00,_0x142fce[_0x192e19(0x1b3)]);_0x142fce[_0x192e19(0x1b3)]&&console[_0x192e19(0x1a1)](_0x192e19(0x1a6)+_0x177016);const _0x535f00=await withSpinner(_0x192e19(0x169)+_0x3f4173+'\x27...',()=>_0x405561[_0x192e19(0x17a)][_0x192e19(0x1eb)](_0x177016),{'verbose':_0x142fce['verbose']}),_0x40ae7d=_0x535f00[_0x192e19(0x1db)];_0x142fce['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x40ae7d[_0x192e19(0x17c)]),console[_0x192e19(0x1a1)]('Parent\x20ID:\x20'+_0x40ae7d[_0x192e19(0x1f6)]));if(_0x40ae7d[_0x192e19(0x17c)]===_0x192e19(0x1cf))return console['error'](_0x192e19(0x1c9)),console['error'](_0x192e19(0x1ef)),0x1;if(_0x40ae7d[_0x192e19(0x17c)]===_0x192e19(0x1ca))return console[_0x192e19(0x1a1)](_0x192e19(0x18c)),console[_0x192e19(0x1a1)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x40ae7d[_0x192e19(0x1d9)])throw new SDKError(ErrorCode[_0x192e19(0x195)],_0x192e19(0x1e1));const _0x4054a1=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x405561[_0x192e19(0x17a)][_0x192e19(0x1c5)](_0x40ae7d[_0x192e19(0x1f6)],_0x40ae7d[_0x192e19(0x1d9)]),{'verbose':_0x142fce[_0x192e19(0x1b3)]});let _0x4c9528=_0x4054a1[_0x192e19(0x1db)];const _0x190945=resolveLimit(_0x142fce[_0x192e19(0x1f0)],DEFAULT_DISPLAY_LIMIT),_0x4b1df2=/\bLIMIT\s+\d+/i[_0x192e19(0x17e)](_0x4c9528);!_0x4b1df2&&(_0x4c9528=_0x4c9528['trim']()[_0x192e19(0x188)](/;+$/,''),_0x4c9528=_0x192e19(0x1b6)+_0x4c9528+_0x192e19(0x1ae)+_0x190945);_0x142fce[_0x192e19(0x1b3)]&&console[_0x192e19(0x1a1)](_0x192e19(0x179)+_0x4c9528);const _0x210534=await withQuerySpinner(_0x192e19(0x190),async _0x480e4d=>{const _0x4ec6f0=_0x192e19,_0x2caec5=await _0x405561[_0x4ec6f0(0x18d)][_0x4ec6f0(0x177)](_0x4c9528,{'catalog':'td','schema':_0x4ec6f0(0x1a9),'onJobId':_0x34a31e=>{const _0xda8fdc=_0x4ec6f0;_0x480e4d[_0xda8fdc(0x1c3)](_0x34a31e);}});return _0x2caec5;},{'verbose':_0x142fce['verbose']}),_0x29ed60=_0x210534['data'],_0x1ab272=_0x29ed60[_0x192e19(0x1b9)]?_0x192e19(0x1dd)+_0x29ed60['jobId']+']':'';return console['error'](_0x192e19(0x1bf)+_0x29ed60['stats'][_0x192e19(0x198)][_0x192e19(0x1c2)]()+_0x192e19(0x1fa)+(_0x192e19(0x1e6)+formatElapsed(_0x29ed60['stats'][_0x192e19(0x16c)])+_0x1ab272)),await handleQueryOutput(_0x29ed60,_0x142fce),0x0;}catch(_0x13aece){if(_0x13aece instanceof SDKError)return console[_0x192e19(0x1a1)](_0x192e19(0x1b4)+_0x13aece[_0x192e19(0x1ab)]+']'),console[_0x192e19(0x1a1)]('\x0a'+_0x13aece['message']),0x1;throw _0x13aece;}}}function a30_0x44e6(_0x1e4be3,_0x513d32){_0x1e4be3=_0x1e4be3-0x167;const _0x36895d=a30_0x3689();let _0x44e65f=_0x36895d[_0x1e4be3];return _0x44e65f;}export class SegmentFolderListCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x1ee);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x1bb);async[a30_0x5786e6(0x177)](_0x442643){const _0x4c3865=a30_0x5786e6,{options:_0x4066fa,args:_0x18f6ea,tdx:_0x363be2}=_0x442643;if(_0x18f6ea[_0x4c3865(0x19e)]===0x0)return console[_0x4c3865(0x1a1)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x4c3865(0x1a1)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x3efa82=_0x18f6ea[0x0];try{_0x4066fa[_0x4c3865(0x1b3)]&&(console[_0x4c3865(0x1a1)](_0x4c3865(0x1f3)+_0x4066fa[_0x4c3865(0x19b)]),console['error']('Parent\x20name:\x20'+_0x3efa82));const _0x1e0f73=await withSpinner(_0x4c3865(0x1a5)+_0x3efa82+_0x4c3865(0x1a7),()=>_0x363be2[_0x4c3865(0x17a)][_0x4c3865(0x1ad)](_0x3efa82),{'verbose':_0x4066fa[_0x4c3865(0x1b3)]}),_0x2b4dcc=_0x1e0f73[_0x4c3865(0x1db)];_0x4066fa[_0x4c3865(0x1b3)]&&console[_0x4c3865(0x1a1)](_0x4c3865(0x180)+_0x2b4dcc);const _0x2c390d=await withSpinner(_0x4c3865(0x18f)+_0x3efa82+_0x4c3865(0x1a7),()=>_0x363be2[_0x4c3865(0x17a)][_0x4c3865(0x18e)](_0x2b4dcc),{'verbose':_0x4066fa[_0x4c3865(0x1b3)]}),_0x5bd37e=_0x2c390d[_0x4c3865(0x1db)];return console[_0x4c3865(0x1a1)](_0x4c3865(0x178)+_0x5bd37e[_0x4c3865(0x19e)]+'\x20folder'+(_0x5bd37e['length']!==0x1?'s':'')),await handleSDKOutput(_0x5bd37e,_0x4066fa),0x0;}catch(_0x23e83b){if(_0x23e83b instanceof SDKError)return console[_0x4c3865(0x1a1)](_0x4c3865(0x19f)+_0x23e83b[_0x4c3865(0x184)]),_0x23e83b[_0x4c3865(0x193)]&&console[_0x4c3865(0x1a1)]('\x20\x20Cause:\x20'+_0x23e83b[_0x4c3865(0x193)]),0x1;throw _0x23e83b;}}}export class SegmentFolderShowCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x189);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x191);async[a30_0x5786e6(0x177)](_0x467c0f){const _0x501bf8=a30_0x5786e6,{options:_0x488585,args:_0x3fa6a7,tdx:_0x47261d}=_0x467c0f;if(_0x3fa6a7[_0x501bf8(0x19e)]===0x0)return console[_0x501bf8(0x1a1)](_0x501bf8(0x182)),console[_0x501bf8(0x1a1)](_0x501bf8(0x1d3)),0x1;try{const {parentId:_0x5a95ed,childId:_0x42cc30}=parseSegmentRef(_0x3fa6a7[0x0]);_0x488585[_0x501bf8(0x1b3)]&&(console['error'](_0x501bf8(0x1f3)+_0x488585[_0x501bf8(0x19b)]),console[_0x501bf8(0x1a1)](_0x501bf8(0x17d)+_0x5a95ed),_0x42cc30&&console['error'](_0x501bf8(0x199)+_0x42cc30));if(!_0x42cc30)return console['error'](_0x501bf8(0x1cb)),0x1;const _0x5ce6d0=await withSpinner(_0x501bf8(0x1a5)+_0x5a95ed+'\x27...',()=>_0x47261d['segment'][_0x501bf8(0x1ad)](_0x5a95ed),{'verbose':_0x488585[_0x501bf8(0x1b3)]}),_0x578bcf=_0x5ce6d0['data'];_0x488585['verbose']&&console[_0x501bf8(0x1a1)](_0x501bf8(0x180)+_0x578bcf);const _0xaa2ce2=await withSpinner('Resolving\x20folder\x20\x27'+_0x42cc30+_0x501bf8(0x1a7),()=>_0x47261d[_0x501bf8(0x17a)]['resolveFolderId'](_0x578bcf,_0x42cc30),{'verbose':_0x488585[_0x501bf8(0x1b3)]}),_0x44d511=_0xaa2ce2[_0x501bf8(0x1db)];_0x488585[_0x501bf8(0x1b3)]&&console[_0x501bf8(0x1a1)](_0x501bf8(0x172)+_0x44d511);const _0x29c2a1=await withSpinner('Fetching\x20folder\x20\x27'+_0x42cc30+_0x501bf8(0x1a7),()=>_0x47261d[_0x501bf8(0x17a)][_0x501bf8(0x1a3)](_0x44d511),{'verbose':_0x488585[_0x501bf8(0x1b3)]});return await handleSDKOutput([_0x29c2a1[_0x501bf8(0x1db)]],_0x488585),0x0;}catch(_0x59c1b6){if(_0x59c1b6 instanceof SDKError)return console[_0x501bf8(0x1a1)](_0x501bf8(0x19f)+_0x59c1b6[_0x501bf8(0x184)]),_0x59c1b6[_0x501bf8(0x193)]&&console['error'](_0x501bf8(0x1e7)+_0x59c1b6[_0x501bf8(0x193)]),0x1;throw _0x59c1b6;}}}function a30_0x3689(){const _0x2677d8=['8ZeokRv','Resolved\x20parent\x20ID:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Folder\x20reference\x20is\x20required','createFolder','message','getParent','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','replace','segment:folder:show','Fetching\x20folder\x20details...','Usage:\x20tdx\x20sg\x20view\x20<name>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','query','listFolders','Listing\x20folders\x20for\x20parent\x20\x27','Executing\x20segment\x20query...','Show\x20segment\x20folder\x20details','description','cause','\x20\x20Parent\x20segment:\x20','SEGMENT_NOT_FOUND','INVALID_ARGUMENT','Usage:\x20tdx\x20segment\x20describe\x20<path>','processedRows','Folder\x20name:\x20','folderId','site','segment:sql','segmentPath','length','Error:\x20','resolveFolderId','error','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Resolving\x20parent\x20segment\x20\x27','Target\x20path:\x20','\x27...','Parent\x20segment:\x20','information_schema','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','code','Folder\x20ID\x20missing\x20from\x20resolved\x20path','resolveParentId','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','660378DGKqzf','Usage:\x20tdx\x20sg\x20show\x20<name>','Segment\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','verbose','✖\x20Query\x20failed\x20[','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SELECT\x20*\x20FROM\x20(\x0a','fullPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','jobId','segment:show','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolved\x20parent\x20folder\x20ID:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','✔\x20Query\x20completed:\x20Processed\x20','Resolving\x20path\x20\x27','segment:view','toLocaleString','setJobId','Creating\x20folder\x20\x27','getSegmentSQL','parentFolder','Examples:','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','parent','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20SQL\x20for\x20segment...','Parent\x20ID:\x20','folder','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Resolving\x20parent\x20folder\x20\x27','Fetching\x20segment\x20details...','Resolved\x20YAML\x20file:\x20','segmentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','data','Use:\x20tdx\x20ps\x20view','\x20[Job\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','getSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Segment\x20ID\x20missing\x20from\x20resolved\x20path','420418EXUyGC','folderPath','955150RuSHPh','segment:folder:create','in\x20','\x20\x20Cause:\x20','\x20\x20Segment\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','jsonl','resolvePathToResource','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','name','segment:folder:list','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','limit','Use:\x20tdx\x20ps\x20desc','42hYekCB','Site:\x20','segment:describe','77116jLijHT','parentId','318267qkeVAl','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Error:\x20Path\x20or\x20name\x20is\x20required','\x20rows\x20','361745wNTSOI','Use:\x20tdx\x20ps\x20sql','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Show\x20segment\x20or\x20folder\x20details','elapsedTimeMillis','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','parentSegment','segment:desc','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segmentName','execute','✔\x20Found\x20','SQL\x20query:\x0a','segment','137787DDzfAk','type','Parent\x20name:\x20','test'];a30_0x3689=function(){return _0x2677d8;};return a30_0x3689();}export class SegmentSQLCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x19c);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x174);async['execute'](_0x57da02){const _0x2240f3=a30_0x5786e6,{options:_0x475fd7,args:_0x77659f,tdx:_0x5932b3}=_0x57da02,_0x3f8199=_0x77659f[0x0];if(!_0x3f8199)return console[_0x2240f3(0x1a1)](_0x2240f3(0x1b2)),console[_0x2240f3(0x1a1)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x2240f3(0x1da)),console[_0x2240f3(0x1a1)](_0x2240f3(0x1c7)),console[_0x2240f3(0x1a1)](_0x2240f3(0x1d1)),console['error']('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3e6645=_0x475fd7[_0x2240f3(0x170)],_0x4e7af6=resolveSegmentTarget(_0x3f8199,_0x3e6645,_0x475fd7[_0x2240f3(0x1b3)]);_0x475fd7['verbose']&&console['error'](_0x2240f3(0x1a6)+_0x4e7af6);const _0xbc38a=await withSpinner(_0x2240f3(0x169)+_0x3f8199+'\x27...',()=>_0x5932b3[_0x2240f3(0x17a)][_0x2240f3(0x1eb)](_0x4e7af6),{'verbose':_0x475fd7[_0x2240f3(0x1b3)]}),_0x3a4c86=_0xbc38a[_0x2240f3(0x1db)];_0x475fd7[_0x2240f3(0x1b3)]&&(console[_0x2240f3(0x1a1)](_0x2240f3(0x1d0)+_0x3a4c86[_0x2240f3(0x17c)]),console[_0x2240f3(0x1a1)](_0x2240f3(0x1ce)+_0x3a4c86[_0x2240f3(0x1f6)]));if(_0x3a4c86['type']===_0x2240f3(0x1cf))return console[_0x2240f3(0x1a1)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x2240f3(0x1a1)](_0x2240f3(0x186)),0x1;if(_0x3a4c86[_0x2240f3(0x17c)]===_0x2240f3(0x1ca))return console['error'](_0x2240f3(0x168)),console[_0x2240f3(0x1a1)](_0x2240f3(0x167)),0x1;if(!_0x3a4c86[_0x2240f3(0x1d9)])throw new SDKError(ErrorCode[_0x2240f3(0x195)],_0x2240f3(0x1e1));const _0x2aa85a=await withSpinner(_0x2240f3(0x1cd),()=>_0x5932b3[_0x2240f3(0x17a)]['getSegmentSQL'](_0x3a4c86[_0x2240f3(0x1f6)],_0x3a4c86[_0x2240f3(0x1d9)]),{'verbose':_0x475fd7[_0x2240f3(0x1b3)]}),_0x5fa1b0=_0x2aa85a[_0x2240f3(0x1db)];return _0x475fd7[_0x2240f3(0x1d4)]==='json'||_0x475fd7[_0x2240f3(0x1d4)]===_0x2240f3(0x1ea)?await handleSDKOutput([{'sql':_0x5fa1b0}],_0x475fd7):console['log'](_0x5fa1b0),0x0;}catch(_0x122fbc){if(_0x122fbc instanceof SDKError)return console[_0x2240f3(0x1a1)](_0x2240f3(0x19f)+_0x122fbc[_0x2240f3(0x184)]),_0x122fbc[_0x2240f3(0x193)]&&console[_0x2240f3(0x1a1)](_0x2240f3(0x1e7)+_0x122fbc['cause']),0x1;throw _0x122fbc;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x1e5);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x16e);async[a30_0x5786e6(0x177)](_0x4b78b8){const _0x5845c7=a30_0x5786e6,{options:_0x3899b2,args:_0x20ed11,tdx:_0x4e0778}=_0x4b78b8,_0x3ec2ea=_0x3899b2;if(_0x20ed11[_0x5845c7(0x19e)]<0x2)return console[_0x5845c7(0x1a1)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x5845c7(0x1e9)),0x1;const _0x1e9952=_0x20ed11[0x0],_0x5eb27d=_0x20ed11[0x1];_0x3ec2ea[_0x5845c7(0x1b3)]&&(console['error'](_0x5845c7(0x1f3)+_0x3ec2ea['site']),console[_0x5845c7(0x1a1)](_0x5845c7(0x1a8)+_0x1e9952),console[_0x5845c7(0x1a1)](_0x5845c7(0x199)+_0x5eb27d));let _0x4d5358;if(_0x3ec2ea['parentFolder']){const _0x3e6f72=_0x3ec2ea[_0x5845c7(0x1c6)],_0x289158=await withSpinner(_0x5845c7(0x1a5)+_0x1e9952+_0x5845c7(0x1a7),()=>_0x4e0778[_0x5845c7(0x17a)][_0x5845c7(0x1ad)](_0x1e9952),{'verbose':_0x3ec2ea[_0x5845c7(0x1b3)]}),_0x510eda=_0x289158[_0x5845c7(0x1db)],_0x495631=await withSpinner(_0x5845c7(0x1d6)+_0x3e6f72+_0x5845c7(0x1a7),()=>_0x4e0778[_0x5845c7(0x17a)][_0x5845c7(0x1a0)](_0x510eda,_0x3e6f72),{'verbose':_0x3ec2ea[_0x5845c7(0x1b3)]});_0x4d5358=_0x495631[_0x5845c7(0x1db)],_0x3ec2ea['verbose']&&console[_0x5845c7(0x1a1)](_0x5845c7(0x1bc)+_0x4d5358);}const _0x40e12b={'name':_0x5eb27d,'description':_0x3ec2ea[_0x5845c7(0x192)],'parentFolderId':_0x4d5358},_0x332393=await withSpinner(_0x5845c7(0x1c4)+_0x5eb27d+_0x5845c7(0x1a7),()=>_0x4e0778[_0x5845c7(0x17a)][_0x5845c7(0x183)](_0x1e9952,_0x40e12b),{'verbose':_0x3ec2ea[_0x5845c7(0x1b3)]}),_0x2f7683=_0x332393[_0x5845c7(0x1db)];return console[_0x5845c7(0x1a1)](_0x5845c7(0x1d2)+_0x2f7683[_0x5845c7(0x1ed)]+'\x27\x20with\x20ID:\x20'+_0x2f7683['id']),await handleSDKOutput([_0x2f7683],_0x3ec2ea),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a30_0x5786e6(0x1c1);['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x568dc6){const _0x278558=a30_0x5786e6,{options:_0x1d82cd,args:_0x4d2dad,tdx:_0x2105da}=_0x568dc6,_0x16035a=_0x4d2dad[0x0];if(!_0x16035a)return console[_0x278558(0x1a1)](_0x278558(0x16f)),console['error'](_0x278558(0x18b)),console[_0x278558(0x1a1)](_0x278558(0x1aa)),console[_0x278558(0x1a1)](_0x278558(0x1c7)),console[_0x278558(0x1a1)](_0x278558(0x1a2)),console['error'](_0x278558(0x16d)),console['error'](_0x278558(0x1de)),0x1;try{const _0xd29fa7=_0x1d82cd[_0x278558(0x170)],_0x1d8e2d=resolveSegmentTarget(_0x16035a,_0xd29fa7,_0x1d82cd[_0x278558(0x1b3)]);_0x1d82cd['verbose']&&console[_0x278558(0x1a1)](_0x278558(0x1a6)+_0x1d8e2d);const _0x61049a=await withSpinner(_0x278558(0x169)+_0x16035a+_0x278558(0x1a7),()=>_0x2105da[_0x278558(0x17a)]['resolvePathToResource'](_0x1d8e2d),{'verbose':_0x1d82cd[_0x278558(0x1b3)]}),_0x3c9769=_0x61049a[_0x278558(0x1db)];_0x1d82cd['verbose']&&(console[_0x278558(0x1a1)](_0x278558(0x1d0)+_0x3c9769['type']),console[_0x278558(0x1a1)]('Parent\x20ID:\x20'+_0x3c9769[_0x278558(0x1f6)]),_0x3c9769['folderId']&&console['error']('Folder\x20ID:\x20'+_0x3c9769[_0x278558(0x19a)]),_0x3c9769[_0x278558(0x1d9)]&&console['error'](_0x278558(0x1b1)+_0x3c9769[_0x278558(0x1d9)]));if(_0x3c9769[_0x278558(0x17c)]===_0x278558(0x1cf)){if(!_0x3c9769['folderId'])throw new SDKError(ErrorCode[_0x278558(0x1cc)],_0x278558(0x1ac));const _0x2b7d84=await withSpinner(_0x278558(0x18a),()=>_0x2105da[_0x278558(0x17a)][_0x278558(0x1a3)](_0x3c9769[_0x278558(0x19a)]),{'verbose':_0x1d82cd[_0x278558(0x1b3)]});await handleSingleObjectOutput(_0x2b7d84[_0x278558(0x1db)],_0x1d82cd);}else{if(_0x3c9769[_0x278558(0x17c)]===_0x278558(0x17a)){if(!_0x3c9769[_0x278558(0x1d9)])throw new SDKError(ErrorCode[_0x278558(0x195)],_0x278558(0x1e1));const _0x307e42=await withSpinner(_0x278558(0x1d7),()=>_0x2105da[_0x278558(0x17a)][_0x278558(0x1df)](_0x3c9769[_0x278558(0x1f6)],_0x3c9769[_0x278558(0x1d9)]),{'verbose':_0x1d82cd[_0x278558(0x1b3)]});await handleSingleObjectOutput(_0x307e42[_0x278558(0x1db)],_0x1d82cd);}else return console[_0x278558(0x1a1)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x278558(0x1a1)](_0x278558(0x1dc)),0x1;}return 0x0;}catch(_0x8d32bc){if(_0x8d32bc instanceof SDKError)return console[_0x278558(0x1a1)](_0x278558(0x19f)+_0x8d32bc[_0x278558(0x184)]),_0x8d32bc['cause']&&console[_0x278558(0x1a1)](_0x278558(0x1e7)+_0x8d32bc['cause']),0x1;throw _0x8d32bc;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x171);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x1bd);async['execute'](_0x11153e){const _0x480e27=a30_0x5786e6,{options:_0xb622ca,args:_0x43ea5c,tdx:_0x276cf1}=_0x11153e,_0x329771=_0x43ea5c[0x0];if(!_0x329771)return console['error'](_0x480e27(0x1b2)),console[_0x480e27(0x1a1)](_0x480e27(0x181)),console[_0x480e27(0x1a1)](_0x480e27(0x1d5)),console[_0x480e27(0x1a1)](_0x480e27(0x1c7)),console[_0x480e27(0x1a1)](_0x480e27(0x1c8)),console[_0x480e27(0x1a1)](_0x480e27(0x1f8)),0x1;try{const _0x116e68=_0xb622ca['parentSegment'],_0x13257f=resolveSegmentTarget(_0x329771,_0x116e68,_0xb622ca[_0x480e27(0x1b3)]);_0xb622ca[_0x480e27(0x1b3)]&&console[_0x480e27(0x1a1)](_0x480e27(0x1a6)+_0x13257f);const _0x11a775=await withSpinner('Resolving\x20\x27'+_0x329771+_0x480e27(0x1a7),()=>_0x276cf1[_0x480e27(0x17a)][_0x480e27(0x1eb)](_0x13257f),{'verbose':_0xb622ca[_0x480e27(0x1b3)]}),_0x2ac9f0=_0x11a775[_0x480e27(0x1db)];_0xb622ca['verbose']&&(console[_0x480e27(0x1a1)]('Resolved\x20type:\x20'+_0x2ac9f0[_0x480e27(0x17c)]),console['error'](_0x480e27(0x1ce)+_0x2ac9f0[_0x480e27(0x1f6)]));if(_0x2ac9f0['type']===_0x480e27(0x1cf))return console[_0x480e27(0x1a1)](_0x480e27(0x173)),console['error'](_0x480e27(0x186)),0x1;if(_0x2ac9f0[_0x480e27(0x17c)]===_0x480e27(0x1ca))return console[_0x480e27(0x1a1)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x480e27(0x1f1)),0x1;if(!_0x2ac9f0[_0x480e27(0x1d9)])throw new SDKError(ErrorCode[_0x480e27(0x195)],_0x480e27(0x1e1));const _0x4bb071=await withSpinner(_0x480e27(0x1cd),()=>_0x276cf1[_0x480e27(0x17a)][_0x480e27(0x1c5)](_0x2ac9f0[_0x480e27(0x1f6)],_0x2ac9f0[_0x480e27(0x1d9)]),{'verbose':_0xb622ca[_0x480e27(0x1b3)]}),_0x1341e8=_0x4bb071[_0x480e27(0x1db)],_0x404af3=await executeSchemaQuery(_0x1341e8,_0x276cf1,_0xb622ca);return await handleQueryOutput(_0x404af3,_0xb622ca),0x0;}catch(_0x1c0d95){if(_0x1c0d95 instanceof SDKError)return console[_0x480e27(0x1a1)]('Error:\x20'+_0x1c0d95[_0x480e27(0x184)]),_0x1c0d95[_0x480e27(0x193)]&&console[_0x480e27(0x1a1)](_0x480e27(0x1e7)+_0x1c0d95[_0x480e27(0x193)]),0x1;throw _0x1c0d95;}}}
|
|
1
|
+
const a30_0x2c4a73=a30_0xb2a0;(function(_0x49a787,_0x14ab12){const _0x397555=a30_0xb2a0,_0x35b08c=_0x49a787();while(!![]){try{const _0x537085=parseInt(_0x397555(0x78))/0x1*(parseInt(_0x397555(0xdc))/0x2)+-parseInt(_0x397555(0xa0))/0x3+-parseInt(_0x397555(0xe2))/0x4+-parseInt(_0x397555(0xc2))/0x5+parseInt(_0x397555(0x88))/0x6*(parseInt(_0x397555(0xf6))/0x7)+-parseInt(_0x397555(0x74))/0x8+parseInt(_0x397555(0xfa))/0x9;if(_0x537085===_0x14ab12)break;else _0x35b08c['push'](_0x35b08c['shift']());}catch(_0x312a91){_0x35b08c['push'](_0x35b08c['shift']());}}}(a30_0x1469,0x1e608));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 a30_0x1469(){const _0xf8d242=['Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Examples:','site','\x20\x20Segment\x20name:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Fetching\x20segment\x20details...','48186eUAlce','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Folder\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20folder\x20ID:\x20','Parent\x20name:\x20','Fetching\x20parent\x20segment\x20details...','Use:\x20tdx\x20ps\x20view','getSegment','segment:show','createFolder','trim','\x27...','segment','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolving\x20parent\x20folder\x20\x27','segmentId','Parent\x20ID:\x20','Fetching\x20folder\x20details...','Show\x20segment\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Error:\x20Path\x20or\x20name\x20is\x20required','Resolving\x20\x27','70776zqIOlr','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:folder:create','Usage:\x20tdx\x20sg\x20desc\x20<name>','Folder\x20name:\x20','Parent\x20segment:\x20','message','\x20\x20Full\x20path:\x20','stats','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','format','\x27\x20with\x20ID:\x20','(root)','Show\x20folder\x20or\x20child\x20segment\x20details','getFolder','segmentPath','type','resolvePathToResource','\x20\x20Cause:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','json','log','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parentFolder','Usage:\x20tdx\x20sg\x20sql\x20<name>','parentId','\x20[Job\x20ID:\x20','parentSegment','segmentName','getSegmentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','data','Error:\x20Folder\x20reference\x20is\x20required','resolveParentId','736285ykTtkJ','cause','name','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','error','Executing\x20segment\x20query...','Get\x20SQL\x20query\x20for\x20child\x20segment','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','limit','segment:folder:show','getParent','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20Folder\x20path:\x20','segment:view','\x20rows\x20','Resolving\x20path\x20\x27','code','description','folder','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Usage:\x20tdx\x20segment\x20describe\x20<path>','folderId','Resolved\x20parent\x20ID:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','2190WabHnU','Create\x20segment\x20folder\x20for\x20organization','Use:\x20tdx\x20ps\x20show','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolved\x20parent\x20folder\x20ID:\x20','SEGMENT_FOLDER_NOT_FOUND','108732onzYNo','Usage:\x20tdx\x20sg\x20view\x20<name>','SEGMENT_NOT_FOUND','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Resolved\x20type:\x20','✖\x20Query\x20failed\x20[','Listing\x20folders\x20for\x20parent\x20\x27','Target\x20path:\x20','resolveFolderId','Error:\x20','segment:describe','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','replace','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20folder\x20\x27','Use:\x20tdx\x20ps\x20sql','\x20\x20Parent\x20segment:\x20','63gJOcOl','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','3220830bZcGIX','segment:folder:list','length','Fetching\x20SQL\x20for\x20segment...','INVALID_ARGUMENT','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','execute','folderPath','verbose','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','processedRows','Use:\x20tdx\x20ps\x20desc','fullPath','Resolving\x20folder\x20\x27','Resolved\x20YAML\x20file:\x20','1063024kqdWeo','parent','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolved\x20relative\x20path\x20to:\x20','23agkulh','includes','jobId','SQL\x20query:\x0a','segment:sql','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','information_schema'];a30_0x1469=function(){return _0xf8d242;};return a30_0x1469();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';function resolveSegmentTarget(_0x4e4d8d,_0x3678fc,_0xe2eb71){const _0x32f648=a30_0xb2a0;if(isYamlFilePath(_0x4e4d8d))try{const _0x1b87fe=resolveYamlFilePath(_0x4e4d8d);return _0xe2eb71&&(console[_0x32f648(0xc6)](_0x32f648(0x73)+_0x4e4d8d),console[_0x32f648(0xc6)](_0x32f648(0xf5)+_0x1b87fe[_0x32f648(0xbb)]),console[_0x32f648(0xc6)](_0x32f648(0x85)+_0x1b87fe[_0x32f648(0xbc)]),console['error'](_0x32f648(0xcf)+(_0x1b87fe[_0x32f648(0x6c)]||_0x32f648(0xac))),console[_0x32f648(0xc6)](_0x32f648(0xa7)+_0x1b87fe[_0x32f648(0x71)])),_0x1b87fe[_0x32f648(0x71)];}catch(_0x748101){throw new SDKError(ErrorCode[_0x32f648(0x69)],_0x32f648(0x81)+_0x748101[_0x32f648(0xa6)]);}if(!_0x3678fc)throw new SDKError(ErrorCode[_0x32f648(0x69)],_0x32f648(0x76));return _0x3678fc+'/'+_0x4e4d8d;}export class SegmentDescribeCommand extends BaseCommand{[a30_0x2c4a73(0xc4)]=a30_0x2c4a73(0xef);[a30_0x2c4a73(0xd4)]=a30_0x2c4a73(0xe5);async[a30_0x2c4a73(0x6b)](_0x187253){const _0x3f4220=a30_0x2c4a73,{options:_0x3648a7,args:_0x5dfecf,tdx:_0x78b3b1}=_0x187253,_0x51c00a=_0x5dfecf[0x0],_0x2a823e=!_0x51c00a&&!!_0x3648a7[_0x3f4220(0xbb)],_0x12a970=_0x51c00a||_0x3648a7[_0x3f4220(0xbb)];if(!_0x12a970)return console[_0x3f4220(0xc6)](_0x3f4220(0x9e)),console['error'](_0x3f4220(0xd8)),console[_0x3f4220(0xc6)](_0x3f4220(0x83)),console[_0x3f4220(0xc6)](_0x3f4220(0xce)),console[_0x3f4220(0xc6)](_0x3f4220(0x7d)),console[_0x3f4220(0xc6)](_0x3f4220(0xc5)),console[_0x3f4220(0xc6)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x2abaa1=_0x3648a7[_0x3f4220(0xaf)];let _0x3b9223=_0x12a970;!_0x2a823e&&_0x2abaa1&&!_0x12a970[_0x3f4220(0x79)]('/')&&(_0x3b9223=_0x2abaa1+'/'+_0x12a970,_0x3648a7['verbose']&&console[_0x3f4220(0xc6)](_0x3f4220(0x77)+_0x3b9223));const _0x3eff53=await withSpinner(_0x3f4220(0xd2)+_0x3b9223+'\x27...',()=>_0x78b3b1[_0x3f4220(0x96)][_0x3f4220(0xb1)](_0x3b9223),{'verbose':_0x3648a7[_0x3f4220(0x6d)]}),_0x4d696d=_0x3eff53[_0x3f4220(0xbf)];_0x3648a7[_0x3f4220(0x6d)]&&(console[_0x3f4220(0xc6)](_0x3f4220(0xe9)+_0x4d696d[_0x3f4220(0xb0)]),console['error'](_0x3f4220(0x9a)+_0x4d696d[_0x3f4220(0xb9)]),_0x4d696d[_0x3f4220(0xd9)]&&console[_0x3f4220(0xc6)](_0x3f4220(0x8a)+_0x4d696d[_0x3f4220(0xd9)]),_0x4d696d[_0x3f4220(0x99)]&&console[_0x3f4220(0xc6)]('Segment\x20ID:\x20'+_0x4d696d[_0x3f4220(0x99)]));if(_0x4d696d[_0x3f4220(0xb0)]==='parent'){const _0x1add34=await withSpinner(_0x3f4220(0x8f),()=>_0x78b3b1[_0x3f4220(0x96)][_0x3f4220(0xcc)](_0x4d696d[_0x3f4220(0xb9)]),{'verbose':_0x3648a7['verbose']});await handleSingleObjectOutput(_0x1add34[_0x3f4220(0xbf)],_0x3648a7);}else{if(_0x4d696d['type']==='folder'){if(!_0x4d696d[_0x3f4220(0xd9)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x3f4220(0x7e));const _0x5c5949=await withSpinner(_0x3f4220(0x9b),()=>_0x78b3b1['segment'][_0x3f4220(0xae)](_0x4d696d['folderId']),{'verbose':_0x3648a7[_0x3f4220(0x6d)]});await handleSingleObjectOutput(_0x5c5949[_0x3f4220(0xbf)],_0x3648a7);}else{if(_0x4d696d[_0x3f4220(0xb0)]===_0x3f4220(0x96)){if(!_0x4d696d[_0x3f4220(0x99)])throw new SDKError(ErrorCode[_0x3f4220(0xe4)],_0x3f4220(0xf9));const _0x564cf1=await withSpinner(_0x3f4220(0x87),()=>_0x78b3b1[_0x3f4220(0x96)][_0x3f4220(0x91)](_0x4d696d[_0x3f4220(0xb9)],_0x4d696d[_0x3f4220(0x99)]),{'verbose':_0x3648a7['verbose']});await handleSingleObjectOutput(_0x564cf1['data'],_0x3648a7);}}}return 0x0;}catch(_0x4613c0){if(_0x4613c0 instanceof SDKError)return console[_0x3f4220(0xc6)](_0x3f4220(0xee)+_0x4613c0[_0x3f4220(0xa6)]),_0x4613c0['cause']&&console[_0x3f4220(0xc6)](_0x3f4220(0xb2)+_0x4613c0['cause']),0x1;throw _0x4613c0;}}}export class SegmentShowCommand extends BaseCommand{[a30_0x2c4a73(0xc4)]=a30_0x2c4a73(0x92);[a30_0x2c4a73(0xd4)]=a30_0x2c4a73(0x86);async[a30_0x2c4a73(0x6b)](_0x599072){const _0x3c8425=a30_0x2c4a73,{options:_0x25a27,args:_0xa73c63,tdx:_0x31a767}=_0x599072,_0x879243=_0xa73c63[0x0];if(!_0x879243)return console[_0x3c8425(0xc6)](_0x3c8425(0x6a)),console[_0x3c8425(0xc6)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x3c8425(0xc6)](_0x3c8425(0x7f)),console[_0x3c8425(0xc6)]('Examples:'),console[_0x3c8425(0xc6)](_0x3c8425(0xe8)),console['error']('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x58ff1e=_0x25a27[_0x3c8425(0xbb)],_0x3968e4=resolveSegmentTarget(_0x879243,_0x58ff1e,_0x25a27['verbose']);_0x25a27['verbose']&&console[_0x3c8425(0xc6)](_0x3c8425(0xec)+_0x3968e4);const _0x3e23ad=await withSpinner(_0x3c8425(0x9f)+_0x879243+'\x27...',()=>_0x31a767[_0x3c8425(0x96)]['resolvePathToResource'](_0x3968e4),{'verbose':_0x25a27[_0x3c8425(0x6d)]}),_0x2fa367=_0x3e23ad[_0x3c8425(0xbf)];_0x25a27[_0x3c8425(0x6d)]&&(console[_0x3c8425(0xc6)](_0x3c8425(0xe9)+_0x2fa367[_0x3c8425(0xb0)]),console[_0x3c8425(0xc6)]('Parent\x20ID:\x20'+_0x2fa367[_0x3c8425(0xb9)]));if(_0x2fa367['type']==='folder')return console[_0x3c8425(0xc6)](_0x3c8425(0x89)),console[_0x3c8425(0xc6)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x2fa367['type']===_0x3c8425(0x75))return console['error'](_0x3c8425(0xf2)),console[_0x3c8425(0xc6)](_0x3c8425(0xde)),0x1;if(!_0x2fa367[_0x3c8425(0x99)])throw new SDKError(ErrorCode[_0x3c8425(0xe4)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x305e10=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x31a767[_0x3c8425(0x96)][_0x3c8425(0xbd)](_0x2fa367['parentId'],_0x2fa367['segmentId']),{'verbose':_0x25a27[_0x3c8425(0x6d)]});let _0x22ce12=_0x305e10[_0x3c8425(0xbf)];const _0x112243=resolveLimit(_0x25a27[_0x3c8425(0xca)],DEFAULT_DISPLAY_LIMIT),_0x2aaa91=/\bLIMIT\s+\d+/i['test'](_0x22ce12);!_0x2aaa91&&(_0x22ce12=_0x22ce12[_0x3c8425(0x94)]()[_0x3c8425(0xf1)](/;+$/,''),_0x22ce12=_0x3c8425(0xf7)+_0x22ce12+_0x3c8425(0xb6)+_0x112243);_0x25a27['verbose']&&console[_0x3c8425(0xc6)](_0x3c8425(0x7b)+_0x22ce12);const _0x2fc5fa=await withQuerySpinner(_0x3c8425(0xc7),async _0x454f5e=>{const _0x45cb2c=_0x3c8425,_0x2a5ced=await _0x31a767['query'][_0x45cb2c(0x6b)](_0x22ce12,{'catalog':'td','schema':_0x45cb2c(0x80),'onJobId':_0x35881f=>{_0x454f5e['setJobId'](_0x35881f);}});return _0x2a5ced;},{'verbose':_0x25a27[_0x3c8425(0x6d)]}),_0x3a23a2=_0x2fc5fa[_0x3c8425(0xbf)],_0x101568=_0x3a23a2['jobId']?_0x3c8425(0xba)+_0x3a23a2[_0x3c8425(0x7a)]+']':'';return console[_0x3c8425(0xc6)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x3a23a2[_0x3c8425(0xa8)][_0x3c8425(0x6f)]['toLocaleString']()+_0x3c8425(0xd1)+('in\x20'+formatElapsed(_0x3a23a2[_0x3c8425(0xa8)]['elapsedTimeMillis'])+_0x101568)),await handleQueryOutput(_0x3a23a2,_0x25a27),0x0;}catch(_0x133749){if(_0x133749 instanceof SDKError)return console['error'](_0x3c8425(0xea)+_0x133749[_0x3c8425(0xd3)]+']'),console[_0x3c8425(0xc6)]('\x0a'+_0x133749[_0x3c8425(0xa6)]),0x1;throw _0x133749;}}}export class SegmentFolderListCommand extends BaseCommand{[a30_0x2c4a73(0xc4)]=a30_0x2c4a73(0xfb);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x4af0ac){const _0x18a119=a30_0x2c4a73,{options:_0x28e83f,args:_0x4ffa1c,tdx:_0x463777}=_0x4af0ac;if(_0x4ffa1c[_0x18a119(0x67)]===0x0)return console[_0x18a119(0xc6)](_0x18a119(0x82)),console[_0x18a119(0xc6)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x230d06=_0x4ffa1c[0x0];try{_0x28e83f[_0x18a119(0x6d)]&&(console[_0x18a119(0xc6)]('Site:\x20'+_0x28e83f['site']),console[_0x18a119(0xc6)]('Parent\x20name:\x20'+_0x230d06));const _0xb275c=await withSpinner(_0x18a119(0x8b)+_0x230d06+_0x18a119(0x95),()=>_0x463777[_0x18a119(0x96)][_0x18a119(0xc1)](_0x230d06),{'verbose':_0x28e83f[_0x18a119(0x6d)]}),_0x1ef531=_0xb275c['data'];_0x28e83f[_0x18a119(0x6d)]&&console[_0x18a119(0xc6)](_0x18a119(0xda)+_0x1ef531);const _0x12c552=await withSpinner(_0x18a119(0xeb)+_0x230d06+_0x18a119(0x95),()=>_0x463777[_0x18a119(0x96)]['listFolders'](_0x1ef531),{'verbose':_0x28e83f['verbose']}),_0x573537=_0x12c552['data'];return console['error']('✔\x20Found\x20'+_0x573537['length']+'\x20folder'+(_0x573537[_0x18a119(0x67)]!==0x1?'s':'')),await handleSDKOutput(_0x573537,_0x28e83f),0x0;}catch(_0x2cf875){if(_0x2cf875 instanceof SDKError)return console['error']('Error:\x20'+_0x2cf875['message']),_0x2cf875[_0x18a119(0xc3)]&&console[_0x18a119(0xc6)](_0x18a119(0xb2)+_0x2cf875[_0x18a119(0xc3)]),0x1;throw _0x2cf875;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a30_0x2c4a73(0xcb);[a30_0x2c4a73(0xd4)]=a30_0x2c4a73(0x9c);async['execute'](_0x1de214){const _0x22c97a=a30_0x2c4a73,{options:_0x28a61d,args:_0x290168,tdx:_0x472755}=_0x1de214;if(_0x290168['length']===0x0)return console[_0x22c97a(0xc6)](_0x22c97a(0xc0)),console[_0x22c97a(0xc6)](_0x22c97a(0xd6)),0x1;try{const {parentId:_0x121a86,childId:_0x2256a5}=parseSegmentRef(_0x290168[0x0]);_0x28a61d[_0x22c97a(0x6d)]&&(console[_0x22c97a(0xc6)]('Site:\x20'+_0x28a61d[_0x22c97a(0x84)]),console[_0x22c97a(0xc6)](_0x22c97a(0x8e)+_0x121a86),_0x2256a5&&console[_0x22c97a(0xc6)](_0x22c97a(0xa4)+_0x2256a5));if(!_0x2256a5)return console[_0x22c97a(0xc6)](_0x22c97a(0xc9)),0x1;const _0x18a88a=await withSpinner(_0x22c97a(0x8b)+_0x121a86+_0x22c97a(0x95),()=>_0x472755[_0x22c97a(0x96)]['resolveParentId'](_0x121a86),{'verbose':_0x28a61d[_0x22c97a(0x6d)]}),_0x2061e4=_0x18a88a[_0x22c97a(0xbf)];_0x28a61d[_0x22c97a(0x6d)]&&console[_0x22c97a(0xc6)]('Resolved\x20parent\x20ID:\x20'+_0x2061e4);const _0x2aedea=await withSpinner(_0x22c97a(0x72)+_0x2256a5+_0x22c97a(0x95),()=>_0x472755[_0x22c97a(0x96)][_0x22c97a(0xed)](_0x2061e4,_0x2256a5),{'verbose':_0x28a61d['verbose']}),_0x18b17b=_0x2aedea[_0x22c97a(0xbf)];_0x28a61d[_0x22c97a(0x6d)]&&console[_0x22c97a(0xc6)](_0x22c97a(0x8d)+_0x18b17b);const _0x116cb0=await withSpinner(_0x22c97a(0xf3)+_0x2256a5+_0x22c97a(0x95),()=>_0x472755['segment']['getFolder'](_0x18b17b),{'verbose':_0x28a61d['verbose']});return await handleSDKOutput([_0x116cb0[_0x22c97a(0xbf)]],_0x28a61d),0x0;}catch(_0x27793f){if(_0x27793f instanceof SDKError)return console[_0x22c97a(0xc6)]('Error:\x20'+_0x27793f[_0x22c97a(0xa6)]),_0x27793f[_0x22c97a(0xc3)]&&console[_0x22c97a(0xc6)](_0x22c97a(0xb2)+_0x27793f[_0x22c97a(0xc3)]),0x1;throw _0x27793f;}}}export class SegmentSQLCommand extends BaseCommand{[a30_0x2c4a73(0xc4)]=a30_0x2c4a73(0x7c);['description']=a30_0x2c4a73(0xc8);async[a30_0x2c4a73(0x6b)](_0x4ccd05){const _0x16eabf=a30_0x2c4a73,{options:_0x2d673b,args:_0x44ccf4,tdx:_0x2c5fbd}=_0x4ccd05,_0x41eb39=_0x44ccf4[0x0];if(!_0x41eb39)return console[_0x16eabf(0xc6)](_0x16eabf(0x6a)),console[_0x16eabf(0xc6)](_0x16eabf(0xb8)),console[_0x16eabf(0xc6)](_0x16eabf(0x9d)),console[_0x16eabf(0xc6)](_0x16eabf(0x83)),console[_0x16eabf(0xc6)](_0x16eabf(0xf0)),console['error'](_0x16eabf(0xe6)),0x1;try{const _0x500084=_0x2d673b[_0x16eabf(0xbb)],_0x101e30=resolveSegmentTarget(_0x41eb39,_0x500084,_0x2d673b['verbose']);_0x2d673b['verbose']&&console[_0x16eabf(0xc6)](_0x16eabf(0xec)+_0x101e30);const _0x17cc26=await withSpinner(_0x16eabf(0x9f)+_0x41eb39+'\x27...',()=>_0x2c5fbd['segment']['resolvePathToResource'](_0x101e30),{'verbose':_0x2d673b[_0x16eabf(0x6d)]}),_0xe3b015=_0x17cc26['data'];_0x2d673b[_0x16eabf(0x6d)]&&(console[_0x16eabf(0xc6)](_0x16eabf(0xe9)+_0xe3b015[_0x16eabf(0xb0)]),console[_0x16eabf(0xc6)](_0x16eabf(0x9a)+_0xe3b015[_0x16eabf(0xb9)]));if(_0xe3b015[_0x16eabf(0xb0)]===_0x16eabf(0xd5))return console[_0x16eabf(0xc6)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console['error'](_0x16eabf(0xd7)),0x1;if(_0xe3b015[_0x16eabf(0xb0)]==='parent')return console['error'](_0x16eabf(0x8c)),console[_0x16eabf(0xc6)](_0x16eabf(0xf4)),0x1;if(!_0xe3b015[_0x16eabf(0x99)])throw new SDKError(ErrorCode[_0x16eabf(0xe4)],_0x16eabf(0xf9));const _0xc6144e=await withSpinner(_0x16eabf(0x68),()=>_0x2c5fbd[_0x16eabf(0x96)][_0x16eabf(0xbd)](_0xe3b015[_0x16eabf(0xb9)],_0xe3b015[_0x16eabf(0x99)]),{'verbose':_0x2d673b[_0x16eabf(0x6d)]}),_0x541252=_0xc6144e[_0x16eabf(0xbf)];return _0x2d673b[_0x16eabf(0xaa)]===_0x16eabf(0xb4)||_0x2d673b['format']==='jsonl'?await handleSDKOutput([{'sql':_0x541252}],_0x2d673b):console[_0x16eabf(0xb5)](_0x541252),0x0;}catch(_0x3478cc){if(_0x3478cc instanceof SDKError)return console[_0x16eabf(0xc6)](_0x16eabf(0xee)+_0x3478cc[_0x16eabf(0xa6)]),_0x3478cc['cause']&&console[_0x16eabf(0xc6)](_0x16eabf(0xb2)+_0x3478cc[_0x16eabf(0xc3)]),0x1;throw _0x3478cc;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a30_0x2c4a73(0xa2);[a30_0x2c4a73(0xd4)]=a30_0x2c4a73(0xdd);async['execute'](_0x41173c){const _0x40ffd5=a30_0x2c4a73,{options:_0x4aa00c,args:_0x3a5638,tdx:_0x2bdf04}=_0x41173c,_0x3a2c57=_0x4aa00c;if(_0x3a5638[_0x40ffd5(0x67)]<0x2)return console[_0x40ffd5(0xc6)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x40ffd5(0xc6)](_0x40ffd5(0x97)),0x1;const _0x23504e=_0x3a5638[0x0],_0x41716f=_0x3a5638[0x1];_0x3a2c57[_0x40ffd5(0x6d)]&&(console['error']('Site:\x20'+_0x3a2c57[_0x40ffd5(0x84)]),console['error'](_0x40ffd5(0xa5)+_0x23504e),console['error']('Folder\x20name:\x20'+_0x41716f));let _0x16c528;if(_0x3a2c57[_0x40ffd5(0xb7)]){const _0x2f5f97=_0x3a2c57[_0x40ffd5(0xb7)],_0x125222=await withSpinner(_0x40ffd5(0x8b)+_0x23504e+_0x40ffd5(0x95),()=>_0x2bdf04[_0x40ffd5(0x96)][_0x40ffd5(0xc1)](_0x23504e),{'verbose':_0x3a2c57[_0x40ffd5(0x6d)]}),_0x229dc9=_0x125222['data'],_0x10a63e=await withSpinner(_0x40ffd5(0x98)+_0x2f5f97+_0x40ffd5(0x95),()=>_0x2bdf04[_0x40ffd5(0x96)][_0x40ffd5(0xed)](_0x229dc9,_0x2f5f97),{'verbose':_0x3a2c57[_0x40ffd5(0x6d)]});_0x16c528=_0x10a63e[_0x40ffd5(0xbf)],_0x3a2c57[_0x40ffd5(0x6d)]&&console[_0x40ffd5(0xc6)](_0x40ffd5(0xe0)+_0x16c528);}const _0x1e5d7f={'name':_0x41716f,'description':_0x3a2c57[_0x40ffd5(0xd4)],'parentFolderId':_0x16c528},_0xff36b=await withSpinner('Creating\x20folder\x20\x27'+_0x41716f+_0x40ffd5(0x95),()=>_0x2bdf04['segment'][_0x40ffd5(0x93)](_0x23504e,_0x1e5d7f),{'verbose':_0x3a2c57[_0x40ffd5(0x6d)]}),_0x41fabe=_0xff36b[_0x40ffd5(0xbf)];return console[_0x40ffd5(0xc6)](_0x40ffd5(0xe7)+_0x41fabe[_0x40ffd5(0xc4)]+_0x40ffd5(0xab)+_0x41fabe['id']),await handleSDKOutput([_0x41fabe],_0x3a2c57),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a30_0x2c4a73(0xd0);[a30_0x2c4a73(0xd4)]=a30_0x2c4a73(0xad);async[a30_0x2c4a73(0x6b)](_0x49f978){const _0x4175c2=a30_0x2c4a73,{options:_0x15e050,args:_0x4e4453,tdx:_0x276d75}=_0x49f978,_0x2c04b7=_0x4e4453[0x0];if(!_0x2c04b7)return console[_0x4175c2(0xc6)](_0x4175c2(0xdb)),console['error'](_0x4175c2(0xe3)),console[_0x4175c2(0xc6)](_0x4175c2(0xbe)),console[_0x4175c2(0xc6)](_0x4175c2(0x83)),console[_0x4175c2(0xc6)](_0x4175c2(0xcd)),console[_0x4175c2(0xc6)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x4175c2(0xc6)](_0x4175c2(0xa9)),0x1;try{const _0x356d1f=_0x15e050[_0x4175c2(0xbb)],_0x227f16=resolveSegmentTarget(_0x2c04b7,_0x356d1f,_0x15e050[_0x4175c2(0x6d)]);_0x15e050[_0x4175c2(0x6d)]&&console[_0x4175c2(0xc6)](_0x4175c2(0xec)+_0x227f16);const _0x43e600=await withSpinner(_0x4175c2(0x9f)+_0x2c04b7+_0x4175c2(0x95),()=>_0x276d75[_0x4175c2(0x96)][_0x4175c2(0xb1)](_0x227f16),{'verbose':_0x15e050[_0x4175c2(0x6d)]}),_0x35e5ec=_0x43e600[_0x4175c2(0xbf)];_0x15e050[_0x4175c2(0x6d)]&&(console[_0x4175c2(0xc6)](_0x4175c2(0xe9)+_0x35e5ec[_0x4175c2(0xb0)]),console['error'](_0x4175c2(0x9a)+_0x35e5ec[_0x4175c2(0xb9)]),_0x35e5ec[_0x4175c2(0xd9)]&&console[_0x4175c2(0xc6)]('Folder\x20ID:\x20'+_0x35e5ec[_0x4175c2(0xd9)]),_0x35e5ec[_0x4175c2(0x99)]&&console[_0x4175c2(0xc6)]('Segment\x20ID:\x20'+_0x35e5ec[_0x4175c2(0x99)]));if(_0x35e5ec[_0x4175c2(0xb0)]===_0x4175c2(0xd5)){if(!_0x35e5ec[_0x4175c2(0xd9)])throw new SDKError(ErrorCode[_0x4175c2(0xe1)],_0x4175c2(0x7e));const _0x5d3b6a=await withSpinner(_0x4175c2(0x9b),()=>_0x276d75[_0x4175c2(0x96)][_0x4175c2(0xae)](_0x35e5ec[_0x4175c2(0xd9)]),{'verbose':_0x15e050['verbose']});await handleSingleObjectOutput(_0x5d3b6a['data'],_0x15e050);}else{if(_0x35e5ec['type']===_0x4175c2(0x96)){if(!_0x35e5ec[_0x4175c2(0x99)])throw new SDKError(ErrorCode[_0x4175c2(0xe4)],_0x4175c2(0xf9));const _0x31e4de=await withSpinner(_0x4175c2(0x87),()=>_0x276d75[_0x4175c2(0x96)]['getSegment'](_0x35e5ec[_0x4175c2(0xb9)],_0x35e5ec[_0x4175c2(0x99)]),{'verbose':_0x15e050['verbose']});await handleSingleObjectOutput(_0x31e4de[_0x4175c2(0xbf)],_0x15e050);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x4175c2(0xc6)](_0x4175c2(0x90)),0x1;}return 0x0;}catch(_0xad7d92){if(_0xad7d92 instanceof SDKError)return console[_0x4175c2(0xc6)]('Error:\x20'+_0xad7d92[_0x4175c2(0xa6)]),_0xad7d92[_0x4175c2(0xc3)]&&console['error'](_0x4175c2(0xb2)+_0xad7d92['cause']),0x1;throw _0xad7d92;}}}export const SegmentInfoCommand=SegmentViewCommand;function a30_0xb2a0(_0x206853,_0x12c497){_0x206853=_0x206853-0x67;const _0x14694c=a30_0x1469();let _0xb2a0aa=_0x14694c[_0x206853];return _0xb2a0aa;}export class SegmentDescCommand extends BaseCommand{[a30_0x2c4a73(0xc4)]='segment:desc';['description']=a30_0x2c4a73(0xb3);async[a30_0x2c4a73(0x6b)](_0x2e7f0b){const _0x386bf7=a30_0x2c4a73,{options:_0x1e6a88,args:_0x26f68c,tdx:_0x538303}=_0x2e7f0b,_0x25147b=_0x26f68c[0x0];if(!_0x25147b)return console[_0x386bf7(0xc6)](_0x386bf7(0x6a)),console[_0x386bf7(0xc6)](_0x386bf7(0xa3)),console[_0x386bf7(0xc6)](_0x386bf7(0xf8)),console['error'](_0x386bf7(0x83)),console[_0x386bf7(0xc6)](_0x386bf7(0x6e)),console[_0x386bf7(0xc6)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x4b3b50=_0x1e6a88[_0x386bf7(0xbb)],_0x162239=resolveSegmentTarget(_0x25147b,_0x4b3b50,_0x1e6a88[_0x386bf7(0x6d)]);_0x1e6a88['verbose']&&console[_0x386bf7(0xc6)]('Target\x20path:\x20'+_0x162239);const _0x1ecf13=await withSpinner(_0x386bf7(0x9f)+_0x25147b+'\x27...',()=>_0x538303[_0x386bf7(0x96)][_0x386bf7(0xb1)](_0x162239),{'verbose':_0x1e6a88['verbose']}),_0x35a8f0=_0x1ecf13[_0x386bf7(0xbf)];_0x1e6a88[_0x386bf7(0x6d)]&&(console[_0x386bf7(0xc6)](_0x386bf7(0xe9)+_0x35a8f0[_0x386bf7(0xb0)]),console['error'](_0x386bf7(0x9a)+_0x35a8f0[_0x386bf7(0xb9)]));if(_0x35a8f0[_0x386bf7(0xb0)]==='folder')return console[_0x386bf7(0xc6)](_0x386bf7(0xdf)),console['error'](_0x386bf7(0xd7)),0x1;if(_0x35a8f0[_0x386bf7(0xb0)]===_0x386bf7(0x75))return console[_0x386bf7(0xc6)](_0x386bf7(0xa1)),console[_0x386bf7(0xc6)](_0x386bf7(0x70)),0x1;if(!_0x35a8f0[_0x386bf7(0x99)])throw new SDKError(ErrorCode[_0x386bf7(0xe4)],_0x386bf7(0xf9));const _0x1917b5=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x538303['segment'][_0x386bf7(0xbd)](_0x35a8f0[_0x386bf7(0xb9)],_0x35a8f0['segmentId']),{'verbose':_0x1e6a88[_0x386bf7(0x6d)]}),_0xfb308c=_0x1917b5[_0x386bf7(0xbf)],_0x56c74f=await executeSchemaQuery(_0xfb308c,_0x538303,_0x1e6a88);return await handleQueryOutput(_0x56c74f,_0x1e6a88),0x0;}catch(_0x21adc2){if(_0x21adc2 instanceof SDKError)return console['error'](_0x386bf7(0xee)+_0x21adc2[_0x386bf7(0xa6)]),_0x21adc2[_0x386bf7(0xc3)]&&console[_0x386bf7(0xc6)](_0x386bf7(0xb2)+_0x21adc2[_0x386bf7(0xc3)]),0x1;throw _0x21adc2;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a31_0x1bb36b=a31_0x44c8;(function(_0x22a820,_0x50fdc5){const _0x1de507=a31_0x44c8,_0x4172b7=_0x22a820();while(!![]){try{const _0x34259b=-parseInt(_0x1de507(0x186))/0x1+-parseInt(_0x1de507(0x183))/0x2+parseInt(_0x1de507(0x193))/0x3+-parseInt(_0x1de507(0x178))/0x4*(parseInt(_0x1de507(0x170))/0x5)+-parseInt(_0x1de507(0x172))/0x6*(-parseInt(_0x1de507(0x192))/0x7)+parseInt(_0x1de507(0x18c))/0x8+parseInt(_0x1de507(0x190))/0x9;if(_0x34259b===_0x50fdc5)break;else _0x4172b7['push'](_0x4172b7['shift']());}catch(_0x2d3057){_0x4172b7['push'](_0x4172b7['shift']());}}}(a31_0x55f3,0x56d4f));function a31_0x44c8(_0x3c32ef,_0x5cecc8){_0x3c32ef=_0x3c32ef-0x168;const _0x55f3fe=a31_0x55f3();let _0x44c8c0=_0x55f3fe[_0x3c32ef];return _0x44c8c0;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a31_0x55f3(){const _0xf2eabc=['execute','1253434uIOhAl','parent','resolveFolderId','695607eYSJGb','name','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segments','\x27...','1110264KTMHBl','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','length','site','9967293LLKEIG','error','98vRoPpU','906870kAqBnE','Creating\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','kind','resolveParentId','Target\x20path:\x20','\x27\x20with\x20ID:\x20','noCountPopulation','description','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','segment:create','25aRvWPm','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','89298ExHSfQ','Resolving\x20parent\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','data','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Parent\x20path:\x20','63140UPvLKE','Resolved\x20folder\x20ID:\x20','yellow','folderId','folder','type','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'];a31_0x55f3=function(){return _0xf2eabc;};return a31_0x55f3();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a31_0x4962ae from'chalk';export class SegmentCreateCommand extends BaseCommand{[a31_0x1bb36b(0x187)]=a31_0x1bb36b(0x16f);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a31_0x1bb36b(0x182)](_0xa7de5e){const _0x4f6232=a31_0x1bb36b;console[_0x4f6232(0x191)](a31_0x4962ae[_0x4f6232(0x17a)](_0x4f6232(0x18d))),console[_0x4f6232(0x191)](a31_0x4962ae[_0x4f6232(0x17a)](_0x4f6232(0x174)));const {options:_0x41bc2d,args:_0x22756a,tdx:_0x1e5f71}=_0xa7de5e,_0x1f6c8c=_0x41bc2d;if(_0x22756a[_0x4f6232(0x18e)]===0x0)return console[_0x4f6232(0x191)](_0x4f6232(0x181)),console[_0x4f6232(0x191)](_0x4f6232(0x189)),console['error']('Examples:'),console[_0x4f6232(0x191)](_0x4f6232(0x16e)),console[_0x4f6232(0x191)](_0x4f6232(0x188)),console[_0x4f6232(0x191)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0xb2eab5=_0x22756a[0x0],_0x21b914=_0x41bc2d['segmentPath'];let _0x474c87=_0xb2eab5;_0x21b914&&!_0xb2eab5['includes']('/')&&(_0x474c87=_0x21b914+'/'+_0xb2eab5,_0x1f6c8c[_0x4f6232(0x180)]&&console[_0x4f6232(0x191)]('Resolved\x20relative\x20path\x20to:\x20'+_0x474c87));const _0x3f7234=parsePath(_0x474c87);if(_0x3f7234['segments'][_0x4f6232(0x18e)]<0x2)return console[_0x4f6232(0x191)](_0x4f6232(0x171)),console[_0x4f6232(0x191)](_0x4f6232(0x195)),0x1;const _0x2b7311=_0x3f7234[_0x4f6232(0x18a)][0x0],_0x50a006=getBaseName(_0x474c87),_0x2955dd=getParentPath(_0x474c87);_0x1f6c8c[_0x4f6232(0x180)]&&(console[_0x4f6232(0x191)]('Site:\x20'+_0x1f6c8c[_0x4f6232(0x18f)]),console[_0x4f6232(0x191)](_0x4f6232(0x16a)+_0x474c87),console['error']('Parent:\x20'+_0x2b7311),console[_0x4f6232(0x191)]('Segment\x20name:\x20'+_0x50a006),console['error'](_0x4f6232(0x177)+_0x2955dd));const _0x257e37=await withSpinner(_0x4f6232(0x173)+_0x2b7311+_0x4f6232(0x18b),()=>_0x1e5f71['segment'][_0x4f6232(0x169)](_0x2b7311),{'verbose':_0x1f6c8c[_0x4f6232(0x180)]}),_0xaff29f=_0x257e37['data'];let _0x551a8e;if(_0x3f7234[_0x4f6232(0x18a)][_0x4f6232(0x18e)]>0x2){const _0x1657d7=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x2955dd+'\x27...',()=>_0x1e5f71['segment']['resolvePathToResource'](_0x2955dd),{'verbose':_0x1f6c8c[_0x4f6232(0x180)]}),_0x5ac0c3=_0x1657d7[_0x4f6232(0x175)];if(_0x5ac0c3[_0x4f6232(0x17d)]!==_0x4f6232(0x17c)&&_0x5ac0c3[_0x4f6232(0x17d)]!==_0x4f6232(0x184))return console[_0x4f6232(0x191)](_0x4f6232(0x176)),0x1;_0x551a8e=_0x5ac0c3[_0x4f6232(0x17b)];}else{if(_0x1f6c8c['folder']){const _0x4ef40e=await withSpinner(_0x4f6232(0x17f)+_0x1f6c8c[_0x4f6232(0x17c)]+'\x27...',()=>_0x1e5f71['segment'][_0x4f6232(0x185)](_0xaff29f,_0x1f6c8c[_0x4f6232(0x17c)]),{'verbose':_0x1f6c8c[_0x4f6232(0x180)]});_0x551a8e=_0x4ef40e[_0x4f6232(0x175)];}}_0x1f6c8c[_0x4f6232(0x180)]&&_0x551a8e&&console[_0x4f6232(0x191)](_0x4f6232(0x179)+_0x551a8e);const _0x245130=await loadJSONFromOptions(_0x1f6c8c['rule'],_0x1f6c8c['ruleFile']),_0x42644b={'name':_0x50a006,'description':_0x1f6c8c[_0x4f6232(0x16d)],'rule':_0x245130,'kind':_0x1f6c8c[_0x4f6232(0x168)]!==undefined?parseInt(_0x1f6c8c[_0x4f6232(0x168)],0xa):undefined,'isVisible':_0x1f6c8c['invisible']?![]:undefined,'segmentFolderId':_0x551a8e,'countPopulation':_0x1f6c8c[_0x4f6232(0x16c)]?![]:undefined},_0x97e404=await withSpinner(_0x4f6232(0x194)+_0x50a006+_0x4f6232(0x18b),()=>_0x1e5f71['segment']['createSegment'](_0xaff29f,_0x42644b),{'verbose':_0x1f6c8c[_0x4f6232(0x180)]}),_0x39f583=_0x97e404['data'];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x39f583[_0x4f6232(0x187)]+_0x4f6232(0x16b)+_0x39f583['id']),_0x474c87!==_0xb2eab5&&console[_0x4f6232(0x191)](_0x4f6232(0x17e)+_0x474c87),await handleSDKOutput([_0x39f583],_0x1f6c8c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x4cb1d7=a32_0x1a27;(function(_0x50eca8,_0x2f3a56){const _0x296db1=a32_0x1a27,_0x46c474=_0x50eca8();while(!![]){try{const _0x5a72e8=parseInt(_0x296db1(0x105))/0x1*(parseInt(_0x296db1(0x109))/0x2)+parseInt(_0x296db1(0x10f))/0x3+-parseInt(_0x296db1(0xfb))/0x4*(parseInt(_0x296db1(0x104))/0x5)+parseInt(_0x296db1(0xf3))/0x6+parseInt(_0x296db1(0x10e))/0x7+-parseInt(_0x296db1(0x10c))/0x8+parseInt(_0x296db1(0x107))/0x9;if(_0x5a72e8===_0x2f3a56)break;else _0x46c474['push'](_0x46c474['shift']());}catch(_0x463cb0){_0x46c474['push'](_0x46c474['shift']());}}}(a32_0x66ce,0xc32c7));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a32_0x1a27(_0x58f940,_0x3d9dc0){_0x58f940=_0x58f940-0xf2;const _0x66ce84=a32_0x66ce();let _0x1a2722=_0x66ce84[_0x58f940];return _0x1a2722;}import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a32_0x4cb1d7(0xfe)]=a32_0x4cb1d7(0x102);['description']=a32_0x4cb1d7(0xf9);async[a32_0x4cb1d7(0x106)](_0x264f95){const _0x2fcbe8=a32_0x4cb1d7,{options:_0x17a38c,args:_0x46c6a9,tdx:_0x50da2e}=_0x264f95,_0x243954=_0x46c6a9[0x0]||_0x17a38c[_0x2fcbe8(0x10b)];if(!_0x243954)return console['error'](_0x2fcbe8(0x101)),console[_0x2fcbe8(0xfd)](_0x2fcbe8(0x10a)),console[_0x2fcbe8(0xfd)](_0x2fcbe8(0xfa)),0x1;_0x17a38c[_0x2fcbe8(0xf5)]&&(console[_0x2fcbe8(0xfd)](_0x2fcbe8(0xf4)+_0x17a38c['site']),console[_0x2fcbe8(0xfd)](_0x2fcbe8(0xff)+_0x243954));const _0x49202a=await withSpinner(_0x2fcbe8(0x100)+_0x243954+_0x2fcbe8(0x10d),()=>_0x50da2e[_0x2fcbe8(0xf8)][_0x2fcbe8(0xf6)](_0x243954),{'verbose':_0x17a38c[_0x2fcbe8(0xf5)]}),_0x2b0f45=_0x49202a[_0x2fcbe8(0x103)];console['error']('✔\x20Found\x20'+_0x2b0f45[_0x2fcbe8(0x108)]+_0x2fcbe8(0xfc)+(_0x2b0f45[_0x2fcbe8(0x108)]!==0x1?'s':''));if(_0x17a38c[_0x2fcbe8(0xf2)]||_0x17a38c[_0x2fcbe8(0xf7)])return await handleSDKOutput(_0x2b0f45,_0x17a38c),0x0;return displayFieldsHumanReadable(_0x2b0f45,_0x243954),0x0;}}function a32_0x66ce(){const _0x106f57=['listFields','jsonl','segment','List\x20available\x20fields\x20for\x20segmentation','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','229288MJcPKc','\x20field','error','name','Parent\x20segment:\x20','Listing\x20fields\x20for\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:fields','data','125ckwNNn','1112774xXomFU','execute','11008386QOLFpe','length','2MbpqGw','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','parentSegment','9325992NRryOK','\x27...','3136322hYJCpX','421350kkqsew','json','2842836PDdDQs','Site:\x20','verbose'];a32_0x66ce=function(){return _0x106f57;};return a32_0x66ce();}
|