@treasuredata/tdx 0.14.4 → 0.14.6
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 +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.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.d.ts +0 -8
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/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/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/journey-command.js +1 -1
- package/dist/commands/journey-validate-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/profile-command.d.ts +1 -1
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-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/segment-validate-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/unset-command.d.ts +18 -0
- package/dist/commands/unset-command.d.ts.map +1 -0
- package/dist/commands/unset-command.js +1 -0
- package/dist/commands/unset-command.js.map +1 -0
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +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/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.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.d.ts +18 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +11 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +3 -2
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.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/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-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/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts +46 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.d.ts +3 -0
- package/dist/utils/spinner.d.ts.map +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/spinner.js.map +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x52fe5b=a21_0x4595;(function(_0x440ed0,_0xd95c2b){const _0x1746bc=a21_0x4595,_0x5aa4a1=_0x440ed0();while(!![]){try{const _0x2b6904=parseInt(_0x1746bc(0x1f7))/0x1+-parseInt(_0x1746bc(0x2c9))/0x2+parseInt(_0x1746bc(0x271))/0x3*(-parseInt(_0x1746bc(0x205))/0x4)+-parseInt(_0x1746bc(0x24f))/0x5+-parseInt(_0x1746bc(0x2cd))/0x6*(-parseInt(_0x1746bc(0x1ea))/0x7)+-parseInt(_0x1746bc(0x1db))/0x8*(parseInt(_0x1746bc(0x2b4))/0x9)+parseInt(_0x1746bc(0x246))/0xa;if(_0x2b6904===_0xd95c2b)break;else _0x5aa4a1['push'](_0x5aa4a1['shift']());}catch(_0x992603){_0x5aa4a1['push'](_0x5aa4a1['shift']());}}}(a21_0x4a9f,0x98f02));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0x47a985 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,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'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a21_0x854bff from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a21_0x52fe5b(0x2c0),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x11eece){const _0x52ba8f=a21_0x52fe5b,_0x45bc08=process['platform'],_0x593970=_0x45bc08===_0x52ba8f(0x245)?_0x52ba8f(0x2c6):_0x45bc08===_0x52ba8f(0x2ec)?'start':_0x52ba8f(0x26a);spawn(_0x593970,[_0x11eece],{'detached':!![],'stdio':_0x52ba8f(0x213)})[_0x52ba8f(0x25e)]();}function migrateLegacyDirectory(){const _0x470259=a21_0x52fe5b;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x42f13b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x42f13b[_0x470259(0x28b)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1de)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x470259(0x2b0)+PARENT_SEGMENT_DIR+_0x470259(0x28e))),console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x2a1)](_0x470259(0x1ce)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1de)](_0x470259(0x284)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1fd)](_0x470259(0x258)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1fb4ee){const _0x435a11=_0x1fb4ee instanceof Error?_0x1fb4ee[_0x470259(0x1e6)]:String(_0x1fb4ee);return console[_0x470259(0x27e)](a21_0x854bff['red'](_0x470259(0x251)+_0x435a11+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0x52fe5b(0x21c)](_0x237d91){const _0x25c9ca=a21_0x52fe5b;return migrateLegacyDirectory(),super[_0x25c9ca(0x21c)](_0x237d91);}}function resolveYamlFile(_0x28329f){const _0x40b8ac=a21_0x52fe5b;if(_0x28329f[_0x40b8ac(0x212)](_0x40b8ac(0x2e4))||_0x28329f['endsWith'](_0x40b8ac(0x25d)))return _0x28329f;return a21_0x47a985[_0x40b8ac(0x23f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x28329f)+_0x40b8ac(0x2e4));}function formatProgressMessage(_0x10cc55){const _0x94aa66=a21_0x52fe5b,_0x52dd5b=_0x10cc55['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x52dd5b){const [,_0xbc5b6d,_0x50ad44,_0x23f94e='']=_0x52dd5b;return a21_0x854bff[_0x94aa66(0x2a1)](_0xbc5b6d+':')+'\x20'+_0x50ad44+a21_0x854bff['dim'](_0x23f94e);}return a21_0x854bff['dim'](_0x10cc55);}function showFileNotFoundError(_0x399219,_0x174621){const _0x25ee3c=a21_0x52fe5b;console['error'](a21_0x854bff[_0x25ee3c(0x2da)](_0x25ee3c(0x22b)+_0x399219+'\x0a')),console['error'](a21_0x854bff['cyan'](_0x25ee3c(0x2c4)+_0x174621+'`\x20to\x20download\x20the\x20configuration\x20first'));}function showParentSegmentNotSetError(_0x565648){const _0x34c811=a21_0x52fe5b;console[_0x34c811(0x27e)](a21_0x854bff[_0x34c811(0x1de)](_0x34c811(0x273))),console['error'](_0x565648);}export class ParentSegmentListCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:list';['description']=a21_0x52fe5b(0x1df);async[a21_0x52fe5b(0x1fa)](_0x52fa99){const _0x317863=a21_0x52fe5b,{options:_0x508930,args:_0x94812d,tdx:_0x1548c5}=_0x52fa99,_0x11e7a4=_0x94812d[0x0];_0x508930[_0x317863(0x297)]&&(console['error'](_0x317863(0x2db)+_0x508930[_0x317863(0x228)]),_0x11e7a4&&console['error'](_0x317863(0x25a)+_0x11e7a4));const _0x42eb95=await withSpinner(_0x11e7a4?_0x317863(0x1d1)+_0x11e7a4+_0x317863(0x1e3):_0x317863(0x203),()=>_0x1548c5[_0x317863(0x201)][_0x317863(0x256)](),{'verbose':_0x508930['verbose']});let _0x462de5=_0x42eb95['data'];if(_0x11e7a4){const _0x580b71=_0x11e7a4[_0x317863(0x2e8)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x317863(0x2e8)](/\*/g,'.*')[_0x317863(0x2e8)](/\?/g,'.'),_0x29c5c0=new RegExp('^'+_0x580b71+'$','i');_0x462de5=_0x462de5['filter'](_0x400c31=>_0x29c5c0[_0x317863(0x234)](_0x400c31[_0x317863(0x2d7)][_0x317863(0x221)]));}_0x462de5[_0x317863(0x208)]((_0x842dfa,_0xfda354)=>_0x842dfa[_0x317863(0x2d7)][_0x317863(0x221)][_0x317863(0x1ec)](_0xfda354[_0x317863(0x2d7)][_0x317863(0x221)])),console[_0x317863(0x27e)](_0x317863(0x242)+_0x462de5['length']+'\x20parent\x20segment'+(_0x462de5[_0x317863(0x240)]!==0x1?'s':''));const _0x4045b3=_0x522aa2=>{const _0x3e5543=_0x317863;return getConsoleNextUrl(_0x508930[_0x3e5543(0x228)],_0x3e5543(0x2d4)+_0x522aa2);};if(_0x508930[_0x317863(0x262)]===_0x317863(0x278)||_0x508930[_0x317863(0x262)]==='jsonl'){const _0x5e16c2=_0x462de5[_0x317863(0x1d4)](_0x5321b2=>({..._0x5321b2,'url':_0x4045b3(_0x5321b2['id'])}));await handleSDKOutput(_0x5e16c2,_0x508930);}else{if(_0x462de5[_0x317863(0x240)]===0x0)_0x11e7a4?console[_0x317863(0x1f3)](_0x317863(0x279)+_0x11e7a4):console[_0x317863(0x1f3)]('No\x20parent\x20segments\x20found');else for(const _0x23166e of _0x462de5){const _0x5ca0a4=_0x23166e[_0x317863(0x2d7)][_0x317863(0x2aa)]?a21_0x854bff[_0x317863(0x2a1)]('\x20('+formatRows(_0x23166e['attributes']['population'])+')'):'',_0xd31cd9=hyperlink(_0x23166e['attributes'][_0x317863(0x221)],_0x4045b3(_0x23166e['id']));console[_0x317863(0x1f3)]('👥\x20'+_0xd31cd9+_0x5ca0a4);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x290);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x229);async[a21_0x52fe5b(0x1fa)](_0x507843){const _0x4e6e9a=a21_0x52fe5b,{options:_0x2dbca1,args:_0x5effe7,tdx:_0x9b918d}=_0x507843;console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x252)+_0x4e6e9a(0x2b6)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x38a62a=_0x2dbca1;if(_0x5effe7[_0x4e6e9a(0x240)]===0x0)return console[_0x4e6e9a(0x27e)](a21_0x854bff['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2a5)),0x1;const _0x3cb678=_0x5effe7[0x0];if(!_0x38a62a['database']||!_0x38a62a[_0x4e6e9a(0x2a3)])return console['error']('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2a5)),0x1;_0x38a62a[_0x4e6e9a(0x297)]&&(console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2db)+_0x38a62a[_0x4e6e9a(0x228)]),console[_0x4e6e9a(0x27e)]('Name:\x20'+_0x3cb678),console[_0x4e6e9a(0x27e)]('Database:\x20'+_0x38a62a['database']),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x210)+_0x38a62a['table']));const _0x50e9a3=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x2d7)],_0x38a62a['attributesFile']),_0x91606d=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x2df)],_0x38a62a[_0x4e6e9a(0x283)]),_0xbfc9fe=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x1e5)],_0x38a62a[_0x4e6e9a(0x243)]),_0x13636c={'name':_0x3cb678,'description':_0x38a62a['description'],'scheduleType':_0x38a62a[_0x4e6e9a(0x26f)],'scheduleOption':_0x38a62a['scheduleOption'],'timezone':_0x38a62a[_0x4e6e9a(0x2af)],'master':{'parentDatabaseName':_0x38a62a[_0x4e6e9a(0x2cf)],'parentTableName':_0x38a62a['table']},'attributes':_0x50e9a3,'behaviors':_0x91606d,'customerGroup':_0xbfc9fe},_0x334b1c=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x3cb678+_0x4e6e9a(0x1e3),()=>_0x9b918d['segment'][_0x4e6e9a(0x222)](_0x13636c),{'verbose':_0x2dbca1[_0x4e6e9a(0x297)]}),_0x34d3cd=_0x334b1c[_0x4e6e9a(0x29c)];return console[_0x4e6e9a(0x27e)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x34d3cd[_0x4e6e9a(0x221)]+_0x4e6e9a(0x25f)+_0x34d3cd['id']),await handleSDKOutput([_0x34d3cd],_0x2dbca1),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:update';[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x26c);async[a21_0x52fe5b(0x1fa)](_0x182424){const _0x4516aa=a21_0x52fe5b,{options:_0x45b32c,args:_0x3e7689,tdx:_0x2cbe72}=_0x182424;console[_0x4516aa(0x27e)](_0x4516aa(0x291)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x495dc9=_0x45b32c;if(_0x3e7689[_0x4516aa(0x240)]===0x0)return console[_0x4516aa(0x27e)](a21_0x854bff[_0x4516aa(0x2da)](_0x4516aa(0x2ce))),console[_0x4516aa(0x27e)](_0x4516aa(0x214)),0x1;const _0x3af2fe=_0x3e7689[0x0];_0x495dc9[_0x4516aa(0x297)]&&(console[_0x4516aa(0x27e)](_0x4516aa(0x2db)+_0x495dc9[_0x4516aa(0x228)]),console[_0x4516aa(0x27e)](_0x4516aa(0x200)+_0x3af2fe));const _0x4c9ee2=await withSpinner(_0x4516aa(0x20a)+_0x3af2fe+_0x4516aa(0x1e3),()=>_0x2cbe72[_0x4516aa(0x201)][_0x4516aa(0x1d8)](_0x3af2fe),{'verbose':_0x495dc9[_0x4516aa(0x297)]}),_0x50f4da=_0x4c9ee2[_0x4516aa(0x29c)],_0xd23497=await loadJSONFromOptions(_0x495dc9[_0x4516aa(0x216)],_0x495dc9[_0x4516aa(0x2e3)]),_0x5aa8b2=await loadJSONFromOptions(_0x495dc9[_0x4516aa(0x2bd)],_0x495dc9[_0x4516aa(0x1eb)]),_0x4dc8d9={'name':_0x50f4da['name'],'description':_0x495dc9[_0x4516aa(0x211)]!==undefined?_0x495dc9[_0x4516aa(0x211)]:_0x50f4da[_0x4516aa(0x211)],'scheduleType':_0x495dc9[_0x4516aa(0x26f)]!==undefined?_0x495dc9[_0x4516aa(0x26f)]:_0x50f4da['scheduleType'],'scheduleOption':_0x495dc9['scheduleOption']!==undefined?_0x495dc9[_0x4516aa(0x2e6)]:_0x50f4da['scheduleOption'],'timezone':_0x495dc9[_0x4516aa(0x2af)]!==undefined?_0x495dc9[_0x4516aa(0x2af)]:_0x50f4da[_0x4516aa(0x2af)],'master':_0x50f4da[_0x4516aa(0x1f6)],'attributes':_0xd23497?[..._0x50f4da['attributes']||[],..._0xd23497]:_0x50f4da['attributes'],'behaviors':_0x5aa8b2?[..._0x50f4da[_0x4516aa(0x2df)]||[],..._0x5aa8b2]:_0x50f4da[_0x4516aa(0x2df)],'customerGroup':_0x50f4da['customerGroup']},_0x325d28=await withSpinner(_0x4516aa(0x23c)+_0x3af2fe+_0x4516aa(0x1e3),()=>_0x2cbe72['segment'][_0x4516aa(0x2c8)](_0x3af2fe,_0x4dc8d9),{'verbose':_0x495dc9[_0x4516aa(0x297)]}),_0x33125e=_0x325d28['data'];return console[_0x4516aa(0x27e)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x33125e[_0x4516aa(0x221)]+'\x27'),await handleSDKOutput([_0x33125e],_0x495dc9),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x28c);['description']=a21_0x52fe5b(0x2a8);async[a21_0x52fe5b(0x1fa)](_0x302781){const _0x47d4d3=a21_0x52fe5b,{options:_0x4c2fde,args:_0x411f9e,tdx:_0x5f02dc}=_0x302781,_0x275728=_0x4c2fde,_0x59b9d2=_0x411f9e[0x0]||_0x4c2fde[_0x47d4d3(0x1e1)];if(!_0x59b9d2)return showParentSegmentNotSetError(_0x47d4d3(0x2d9)+_0x47d4d3(0x21d)),0x1;if(_0x275728[_0x47d4d3(0x270)]&&_0x275728['output'])return console['error'](a21_0x854bff[_0x47d4d3(0x2da)](_0x47d4d3(0x2b7))),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x2a1)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console['error'](a21_0x854bff['dim'](_0x47d4d3(0x202)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x2c1)](_0x47d4d3(0x274))),0x1;const _0x408550=_0x275728['output']||a21_0x47a985['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x59b9d2)+_0x47d4d3(0x2e4));_0x275728['verbose']&&(console[_0x47d4d3(0x27e)]('Site:\x20'+_0x275728['site']),console['error']('Parent\x20segment:\x20'+_0x59b9d2),console[_0x47d4d3(0x27e)](_0x47d4d3(0x299)+_0x408550));const _0x36df2b=await withSpinner(_0x47d4d3(0x20f)+_0x59b9d2+_0x47d4d3(0x1e3),()=>_0x5f02dc[_0x47d4d3(0x201)][_0x47d4d3(0x26e)](_0x59b9d2),{'verbose':_0x275728[_0x47d4d3(0x297)]}),_0x3002ec=_0x36df2b[_0x47d4d3(0x29c)];if(existsSync(_0x408550)){const _0x41a3fa=readFileSync(_0x408550,_0x47d4d3(0x2bc)),_0x50233d=generateDiff(_0x41a3fa,_0x3002ec);if(!hasChanges(_0x50233d))console['error'](a21_0x854bff['green']('✔')+_0x47d4d3(0x1f5)+a21_0x854bff[_0x47d4d3(0x2c1)](_0x408550)+'\x20is\x20already\x20up\x20to\x20date');else{console['error']('\x0aChanges\x20to\x20\x27'+_0x408550+'\x27:'),console['error']('─'[_0x47d4d3(0x288)](0x3c)),console[_0x47d4d3(0x27e)](formatDiffWithColors(_0x50233d)),console['error']('─'[_0x47d4d3(0x288)](0x3c));if(!_0x275728[_0x47d4d3(0x2c3)]){const _0x523954=await confirmKey(_0x47d4d3(0x24d)+_0x408550+'\x27?');if(!_0x523954)return console[_0x47d4d3(0x27e)](_0x47d4d3(0x1f0)),0x1;}writeFileSync(_0x408550,_0x3002ec,_0x47d4d3(0x2bc)),console['error'](a21_0x854bff[_0x47d4d3(0x1fd)]('✔')+_0x47d4d3(0x2d5)+a21_0x854bff['cyan'](_0x408550));}}else{const _0x27e361=a21_0x47a985[_0x47d4d3(0x27b)](_0x408550);!existsSync(_0x27e361)&&mkdirSync(_0x27e361,{'recursive':!![]}),writeFileSync(_0x408550,_0x3002ec,'utf-8'),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x1fd)]('✔')+_0x47d4d3(0x2d5)+a21_0x854bff[_0x47d4d3(0x2c1)](_0x408550));}return saveSessionContext({'parent_segment':_0x59b9d2},_0x275728[_0x47d4d3(0x227)]),console[_0x47d4d3(0x27e)](a21_0x854bff['green']('✔')+'\x20Context\x20set:\x20'+a21_0x854bff[_0x47d4d3(0x2a1)](_0x47d4d3(0x255))+_0x47d4d3(0x28f)+a21_0x854bff['cyan'](_0x59b9d2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a21_0x52fe5b(0x1e4);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x1dc);async[a21_0x52fe5b(0x1fa)](_0x7e2f71){const _0xb054ba=a21_0x52fe5b,{options:_0x381e19,args:_0x46eb5d,tdx:_0x4ca6a7}=_0x7e2f71,_0x270731=_0x381e19,_0x517e44=_0x46eb5d[0x0]||_0x381e19['parentSegment'];if(!_0x517e44)return showParentSegmentNotSetError(_0xb054ba(0x29e)+_0xb054ba(0x2ca)),0x1;const _0x271e75=resolveYamlFile(_0x517e44);if(!existsSync(_0x271e75))return showFileNotFoundError(_0x271e75,_0x517e44),0x1;_0x270731['verbose']&&(console[_0xb054ba(0x27e)](_0xb054ba(0x2db)+_0x270731['site']),console[_0xb054ba(0x27e)](_0xb054ba(0x225)+_0x271e75));let _0x31a676;try{_0x31a676=readFileSync(_0x271e75,_0xb054ba(0x2bc));}catch(_0x5897d1){const _0x18c11a=_0x5897d1 instanceof Error?_0x5897d1[_0xb054ba(0x1e6)]:String(_0x5897d1);return console[_0xb054ba(0x27e)]('Error\x20reading\x20file:\x20'+_0x18c11a),0x1;}const _0x266c94=await withSpinner('Analyzing\x20changes...',()=>_0x4ca6a7['segment'][_0xb054ba(0x296)](_0x31a676),{'verbose':_0x270731['verbose']}),_0x163773=_0x266c94['data'],{isNew:_0x3d71a2,name:_0x1128f6,hasChanges:_0x1b3376,diffFormatted:_0x159bc6}=_0x163773;if(!_0x1b3376)return console[_0xb054ba(0x27e)]('✔\x20No\x20changes\x20-\x20\x27'+_0x1128f6+_0xb054ba(0x2bf)),0x0;_0x3d71a2?console['error'](_0xb054ba(0x23b)+_0x1128f6+'\x27:'):console[_0xb054ba(0x27e)](_0xb054ba(0x22a)+_0x1128f6+'\x27:');console[_0xb054ba(0x27e)]('─'['repeat'](0x3c)),console[_0xb054ba(0x27e)](_0x159bc6),console['error']('─'[_0xb054ba(0x288)](0x3c));const _0x2d1dac=_0x3d71a2?_0xb054ba(0x265)+_0x1128f6+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x1128f6+'\x27?';if(!_0x270731['yes']){const _0x3dc207=await confirmKey(_0x2d1dac);if(!_0x3dc207)return console[_0xb054ba(0x27e)](_0xb054ba(0x1f0)),0x1;}const _0x711bfd=_0x3d71a2?_0xb054ba(0x287):_0xb054ba(0x1ff),_0x53bdac=await withSpinner(_0x711bfd+'\x20parent\x20segment\x20\x27'+_0x1128f6+_0xb054ba(0x1e3),()=>_0x163773[_0xb054ba(0x2cb)](),{'verbose':_0x270731[_0xb054ba(0x297)]}),_0x33ca39=_0x53bdac[_0xb054ba(0x29c)],_0x39ecf0=getConsoleNextUrl(_0x270731[_0xb054ba(0x228)],'/app/dw/parentSegments/'+_0x33ca39['id']),_0x1dd449=_0x3d71a2?_0xb054ba(0x2bb):_0xb054ba(0x207);return console[_0xb054ba(0x27e)]('✔\x20'+_0x1dd449+_0xb054ba(0x2c2)+_0x33ca39['name']+'\x27'),console['error']('\x20\x20'+_0x39ecf0),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x223);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x233);async['execute'](_0x4acfd9){const _0x4cb219=a21_0x52fe5b,{options:_0x49790a,args:_0x4064a5,tdx:_0x2634f6}=_0x4acfd9,_0x177560=_0x49790a,_0x495bc7=_0x4064a5[0x0]||_0x49790a[_0x4cb219(0x1e1)];if(!_0x495bc7)return showParentSegmentNotSetError(_0x4cb219(0x220)+_0x4cb219(0x226)+_0x4cb219(0x20c)+_0x4cb219(0x23e)+_0x4cb219(0x21f)+_0x4cb219(0x232)),0x1;const _0x1b0141=resolveYamlFile(_0x495bc7);if(!existsSync(_0x1b0141))return showFileNotFoundError(_0x1b0141,_0x495bc7),0x1;_0x177560['verbose']&&(console[_0x4cb219(0x27e)](_0x4cb219(0x2db)+_0x177560['site']),console[_0x4cb219(0x27e)](_0x4cb219(0x225)+_0x1b0141));let _0x23fb4f;try{_0x23fb4f=readFileSync(_0x1b0141,_0x4cb219(0x2bc));}catch(_0x3914e5){const _0x190bc5=_0x3914e5 instanceof Error?_0x3914e5[_0x4cb219(0x1e6)]:String(_0x3914e5);return console[_0x4cb219(0x27e)](_0x4cb219(0x1f8)+_0x190bc5),0x1;}const _0xf39ffe=createCommandSpinner(a21_0x854bff['dim'](_0x4cb219(0x2a2)),{'verbose':_0x177560['verbose']});_0xf39ffe[_0x4cb219(0x1ee)]();const _0x1b787e={'onProgress':_0x35c151=>{_0xf39ffe['text']=formatProgressMessage(_0x35c151);}};if(_0x177560[_0x4cb219(0x1f6)])_0x1b787e[_0x4cb219(0x1f6)]=!![];if(_0x177560['enriched'])_0x1b787e[_0x4cb219(0x2e9)]=!![];_0x177560[_0x4cb219(0x27d)]&&(_0x1b787e[_0x4cb219(0x27d)]=_0x177560[_0x4cb219(0x27d)]);_0x177560['behavior']&&(_0x1b787e[_0x4cb219(0x29d)]=_0x177560[_0x4cb219(0x29d)]);if(_0x177560[_0x4cb219(0x2dc)])_0x1b787e['interval']=_0x177560[_0x4cb219(0x2dc)];let _0x9bc1ea;try{_0x9bc1ea=await _0x2634f6['segment'][_0x4cb219(0x2b2)](_0x23fb4f,_0x1b787e),_0xf39ffe[_0x4cb219(0x268)]();}catch(_0x493cd0){_0xf39ffe[_0x4cb219(0x268)]();throw _0x493cd0;}const _0x755a73=_0x177560[_0x4cb219(0x2dc)]||'-1d';return this['displayValidateResults'](_0x9bc1ea,_0x1b787e,_0x1b0141,_0x755a73),_0x9bc1ea['allValid']?0x0:0x1;}[a21_0x52fe5b(0x26d)](_0x61d64c,_0x24d223,_0x172ca2,_0x2fde0a){const _0x350574=a21_0x52fe5b;console[_0x350574(0x27e)]('\x0a'+a21_0x854bff[_0x350574(0x26b)](_0x350574(0x2f1))+'\x20'+_0x61d64c[_0x350574(0x221)]),console[_0x350574(0x27e)]('═'[_0x350574(0x288)](0x3c)),this[_0x350574(0x248)](_0x61d64c);if(typeof _0x24d223[_0x350574(0x27d)]===_0x350574(0x24b)){this[_0x350574(0x27c)](_0x61d64c),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,'attribute',_0x24d223['attribute']);return;}if(_0x24d223[_0x350574(0x27d)]===!![]){this['displayAttributesStats'](_0x61d64c),this['displaySummary'](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x2d7));return;}if(typeof _0x24d223[_0x350574(0x29d)]===_0x350574(0x24b)){this['displayBehaviorsStats'](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x29d),_0x24d223[_0x350574(0x29d)]);return;}if(_0x24d223['behavior']===!![]){this[_0x350574(0x235)](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this['displayPreviewHints'](_0x172ca2,_0x2fde0a,'behaviors');return;}this[_0x350574(0x27c)](_0x61d64c),this[_0x350574(0x235)](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x276));}['displayPreviewHints'](_0x3b8c54,_0x28b698,_0x1c31b6,_0x186f6f){const _0x28a5cf=a21_0x52fe5b;console[_0x28a5cf(0x27e)]('\x0a'+a21_0x854bff['dim'](_0x28a5cf(0x241)));const _0x58a1ad=_0x28b698!==_0x28a5cf(0x2de)?_0x28a5cf(0x219)+_0x28b698:'';if(_0x1c31b6==='attribute'&&_0x186f6f)console['error']('\x20\x20'+a21_0x854bff['dim'](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x1e0)+_0x186f6f+'\x22'+_0x58a1ad));else{if(_0x1c31b6==='behavior'&&_0x186f6f)console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x231)+_0x186f6f+'\x22'+_0x58a1ad));else(_0x1c31b6===_0x28a5cf(0x2d7)||_0x1c31b6===_0x28a5cf(0x276))&&console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x1fc)+_0x58a1ad));}(_0x1c31b6===_0x28a5cf(0x2df)||_0x1c31b6==='all')&&console['error']('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)]('tdx\x20segment\x20parent\x20preview\x20'+_0x3b8c54+'\x20--behavior\x20\x22<name>\x22'+_0x58a1ad)),_0x1c31b6===_0x28a5cf(0x276)&&console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x224)+_0x58a1ad));}[a21_0x52fe5b(0x248)](_0x418a90){const _0x125413=a21_0x52fe5b,{master:_0xe04aa5}=_0x418a90,_0x586569=_0xe04aa5['schemaValid']?a21_0x854bff[_0x125413(0x1fd)]('✔'):a21_0x854bff[_0x125413(0x2da)]('✘');console[_0x125413(0x27e)]('\x0a'+a21_0x854bff[_0x125413(0x2a1)](_0x125413(0x21e))),console['error'](_0x586569+'\x20'+a21_0x854bff[_0x125413(0x26b)](_0xe04aa5['database']+'.'+_0xe04aa5[_0x125413(0x2a3)])),_0xe04aa5['schemaValid']?_0xe04aa5[_0x125413(0x2ee)]!==undefined&&console[_0x125413(0x27e)]('\x20\x20'+a21_0x854bff[_0x125413(0x2a1)](_0x125413(0x2ef))+'\x20'+a21_0x854bff[_0x125413(0x2c1)](formatRows(_0xe04aa5[_0x125413(0x2ee)]))):console[_0x125413(0x27e)]('\x20\x20'+a21_0x854bff[_0x125413(0x2da)](_0x125413(0x264))+'\x20'+_0xe04aa5['schemaError']);}[a21_0x52fe5b(0x27c)](_0x11ce9c){const _0x3f3c16=a21_0x52fe5b;if(_0x11ce9c[_0x3f3c16(0x2d7)][_0x3f3c16(0x240)]===0x0)return;console[_0x3f3c16(0x27e)]('\x0a'+a21_0x854bff[_0x3f3c16(0x2a1)](_0x3f3c16(0x2f2)));for(const _0x3eb07c of _0x11ce9c['attributes']){const _0x4de414=_0x3eb07c[_0x3f3c16(0x2b8)]?a21_0x854bff['green']('✔'):a21_0x854bff[_0x3f3c16(0x2da)]('✘');let _0x12d29f='';if(_0x3eb07c[_0x3f3c16(0x2b8)]&&_0x3eb07c[_0x3f3c16(0x1f1)]!==undefined&&_0x3eb07c[_0x3f3c16(0x261)]!==undefined){const _0xe8a6a6=_0x3eb07c[_0x3f3c16(0x261)][_0x3f3c16(0x236)](0x1),_0x3d60cb=_0x3eb07c[_0x3f3c16(0x261)]>=0x50?a21_0x854bff[_0x3f3c16(0x1fd)]:_0x3eb07c['coveragePercent']>=0x32?a21_0x854bff[_0x3f3c16(0x1de)]:a21_0x854bff['red'];_0x12d29f='\x20'+a21_0x854bff[_0x3f3c16(0x2a1)]('Coverage:')+'\x20'+_0x3d60cb(_0xe8a6a6+'%')+'\x20('+formatRows(_0x3eb07c['matchedCount'])+_0x3f3c16(0x25c);}console[_0x3f3c16(0x27e)](_0x4de414+'\x20'+a21_0x854bff[_0x3f3c16(0x26b)](_0x3eb07c[_0x3f3c16(0x221)])+_0x12d29f),console[_0x3f3c16(0x27e)]('\x20\x20'+a21_0x854bff[_0x3f3c16(0x2a1)]('Source:')+'\x20'+a21_0x854bff[_0x3f3c16(0x26b)](_0x3eb07c[_0x3f3c16(0x2cf)]+'.'+_0x3eb07c[_0x3f3c16(0x2a3)]));const _0x5c1f91=_0x3eb07c['joinKey']===_0x3eb07c[_0x3f3c16(0x1d5)]?a21_0x854bff[_0x3f3c16(0x2a1)](_0x3f3c16(0x2a0))+'\x20'+_0x3eb07c[_0x3f3c16(0x2d8)]:a21_0x854bff[_0x3f3c16(0x2a1)]('Join:')+'\x20'+_0x3eb07c[_0x3f3c16(0x2d8)]+_0x3f3c16(0x28f)+_0x3eb07c['foreignKey'];console[_0x3f3c16(0x27e)]('\x20\x20'+_0x5c1f91),console['error']('\x20\x20'+a21_0x854bff['dim'](_0x3f3c16(0x1d3))),this['displayColumns'](_0x3eb07c[_0x3f3c16(0x2b1)]),!_0x3eb07c[_0x3f3c16(0x2b8)]&&console[_0x3f3c16(0x27e)]('\x20\x20'+a21_0x854bff[_0x3f3c16(0x2da)](_0x3f3c16(0x264))+'\x20'+_0x3eb07c['schemaError']);}}[a21_0x52fe5b(0x235)](_0x54d7c3,_0x3918bf){const _0x3ae84b=a21_0x52fe5b;if(_0x54d7c3['behaviors']['length']===0x0)return;console[_0x3ae84b(0x27e)]('\x0a'+a21_0x854bff[_0x3ae84b(0x2a1)]('Behaviors')+'\x20'+a21_0x854bff[_0x3ae84b(0x2a1)]('('+_0x3918bf+')'));for(const _0x49f96e of _0x54d7c3[_0x3ae84b(0x2df)]){const _0x293478=_0x49f96e[_0x3ae84b(0x2b8)]?a21_0x854bff[_0x3ae84b(0x1fd)]('✔'):a21_0x854bff[_0x3ae84b(0x2da)]('✘');let _0x2d05ba='';if(_0x49f96e[_0x3ae84b(0x2b8)]&&_0x49f96e['customersWithEvents']!==undefined&&_0x49f96e[_0x3ae84b(0x2e5)]!==undefined){const _0x17b0bb=_0x49f96e['customerPercent']?.[_0x3ae84b(0x236)](0x1)||'?',_0x264027=(_0x49f96e[_0x3ae84b(0x272)]??0x0)>=0x32?a21_0x854bff[_0x3ae84b(0x1fd)]:(_0x49f96e[_0x3ae84b(0x272)]??0x0)>=0x14?a21_0x854bff[_0x3ae84b(0x1de)]:a21_0x854bff['red'];_0x2d05ba='\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x2e1))+'\x20'+_0x264027(formatRows(_0x49f96e[_0x3ae84b(0x23d)]))+'\x20('+_0x17b0bb+'%)\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x24e))+'\x20'+a21_0x854bff[_0x3ae84b(0x2c1)](formatRows(_0x49f96e[_0x3ae84b(0x2e5)]));}console['error'](_0x293478+'\x20'+a21_0x854bff[_0x3ae84b(0x26b)](_0x49f96e[_0x3ae84b(0x221)])+_0x2d05ba),console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x267))+'\x20'+a21_0x854bff[_0x3ae84b(0x26b)](_0x49f96e[_0x3ae84b(0x2cf)]+'.'+_0x49f96e[_0x3ae84b(0x2a3)]));const _0x21058a=_0x49f96e['joinKey']===_0x49f96e[_0x3ae84b(0x1d5)]?a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x2a0))+'\x20'+_0x49f96e['joinKey']:a21_0x854bff['dim'](_0x3ae84b(0x29f))+'\x20'+_0x49f96e[_0x3ae84b(0x2d8)]+_0x3ae84b(0x28f)+_0x49f96e[_0x3ae84b(0x1d5)];console['error']('\x20\x20'+_0x21058a),console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x1d3))),this[_0x3ae84b(0x239)](_0x49f96e[_0x3ae84b(0x2b1)]),!_0x49f96e[_0x3ae84b(0x2b8)]&&console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2da)]('Error:')+'\x20'+_0x49f96e['schemaError']);}}['displayColumns'](_0x3d0a6e){const _0x26ae2a=a21_0x52fe5b;for(const _0x3a3df4 of _0x3d0a6e){_0x3a3df4[_0x26ae2a(0x2be)]===_0x3a3df4[_0x26ae2a(0x1d6)]||_0x3a3df4['column']==='*'?console[_0x26ae2a(0x27e)](_0x26ae2a(0x230)+_0x3a3df4[_0x26ae2a(0x2be)]):console['error'](_0x26ae2a(0x230)+_0x3a3df4[_0x26ae2a(0x2be)]+'\x20'+a21_0x854bff[_0x26ae2a(0x2a1)]('('+_0x3a3df4[_0x26ae2a(0x1d6)]+')'));}}[a21_0x52fe5b(0x266)](_0x3706e2){const _0x3b0ffb=a21_0x52fe5b;console['error']('─'[_0x3b0ffb(0x288)](0x3c));if(_0x3706e2[_0x3b0ffb(0x24a)][_0x3b0ffb(0x240)]>0x0){console[_0x3b0ffb(0x27e)]('\x0a'+a21_0x854bff[_0x3b0ffb(0x2da)](_0x3b0ffb(0x2c5)));for(const _0x3b8db5 of _0x3706e2[_0x3b0ffb(0x24a)]){console['error']('\x20\x20'+a21_0x854bff[_0x3b0ffb(0x2da)]('•')+'\x20'+_0x3b8db5);}}_0x3706e2[_0x3b0ffb(0x238)]&&console[_0x3b0ffb(0x27e)]('\x0a'+a21_0x854bff[_0x3b0ffb(0x1fd)]('✔')+_0x3b0ffb(0x217));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x275);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x1d0);async['execute'](_0x3fc93c){const _0x438f62=a21_0x52fe5b,{options:_0x1aab97,args:_0x2bf2c4,tdx:_0x1abaae}=_0x3fc93c,_0x5d01bc=_0x1aab97,_0x2ae92c=_0x2bf2c4[0x0]||_0x1aab97[_0x438f62(0x1e1)];if(!_0x2ae92c)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x438f62(0x1fb)+_0x438f62(0x28d)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x438f62(0x20b)+_0x438f62(0x1f4)+_0x438f62(0x232)),0x1;if(!_0x5d01bc[_0x438f62(0x1f6)]&&!_0x5d01bc[_0x438f62(0x27d)]&&!_0x5d01bc['behavior']&&!_0x5d01bc[_0x438f62(0x2e9)])return console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x438f62(0x27e)](_0x438f62(0x247)),console[_0x438f62(0x27e)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x438f62(0x27e)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x438f62(0x27e)](_0x438f62(0x263)),console['error'](_0x438f62(0x2a7)),0x1;const _0x35288d=resolveYamlFile(_0x2ae92c);if(!existsSync(_0x35288d))return showFileNotFoundError(_0x35288d,_0x2ae92c),0x1;_0x5d01bc[_0x438f62(0x297)]&&(console[_0x438f62(0x27e)]('Site:\x20'+_0x5d01bc['site']),console['error'](_0x438f62(0x225)+_0x35288d));let _0x359ec2;try{_0x359ec2=readFileSync(_0x35288d,_0x438f62(0x2bc));}catch(_0x2512ad){const _0x26a55e=_0x2512ad instanceof Error?_0x2512ad['message']:String(_0x2512ad);return console[_0x438f62(0x27e)](_0x438f62(0x1f8)+_0x26a55e),0x1;}let _0x1f55e2;try{_0x1f55e2=parseDef(_0x359ec2);}catch(_0x3524cc){const _0xd3f164=_0x3524cc instanceof Error?_0x3524cc[_0x438f62(0x1e6)]:String(_0x3524cc);return console[_0x438f62(0x27e)](a21_0x854bff['red'](_0x438f62(0x2d1)+_0xd3f164)),0x1;}if(_0x5d01bc[_0x438f62(0x27d)]===!![]||_0x5d01bc[_0x438f62(0x27d)]===''){const _0x3aaa29=_0x1f55e2[_0x438f62(0x2d7)]?.['map'](_0x3e77bb=>_0x3e77bb['name'])||[];if(_0x3aaa29[_0x438f62(0x240)]===0x0)console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x438f62(0x27e)](a21_0x854bff['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x438f62(0x27e)](_0x438f62(0x2ea));for(const _0x8297ad of _0x3aaa29){console[_0x438f62(0x27e)]('\x20\x20'+a21_0x854bff[_0x438f62(0x2c1)](_0x8297ad));}console[_0x438f62(0x27e)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x2ae92c+_0x438f62(0x1e0)+_0x3aaa29[0x0]+'\x22');}return 0x1;}if(_0x5d01bc[_0x438f62(0x29d)]===!![]||_0x5d01bc[_0x438f62(0x29d)]===''){const _0x10a9ee=_0x1f55e2[_0x438f62(0x2df)]?.['map'](_0x4c9ebf=>_0x4c9ebf['name'])||[];if(_0x10a9ee[_0x438f62(0x240)]===0x0)console['error'](a21_0x854bff[_0x438f62(0x2da)](_0x438f62(0x282)));else{console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x438f62(0x298));for(const _0x32d82c of _0x10a9ee){console[_0x438f62(0x27e)]('\x20\x20'+a21_0x854bff[_0x438f62(0x2c1)](_0x32d82c));}console[_0x438f62(0x27e)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x2ae92c+_0x438f62(0x231)+_0x10a9ee[0x0]+'\x22');}return 0x1;}const _0x254857=createCommandSpinner(a21_0x854bff[_0x438f62(0x2a1)](_0x438f62(0x204)),{'verbose':_0x5d01bc[_0x438f62(0x297)]});_0x254857[_0x438f62(0x1ee)]();const _0x33cf31={'onProgress':_0x13fec1=>{const _0x13e790=_0x438f62;_0x254857[_0x13e790(0x24c)]=formatProgressMessage(_0x13fec1);}};if(_0x5d01bc[_0x438f62(0x1f6)])_0x33cf31['master']=!![];if(_0x5d01bc[_0x438f62(0x27d)]&&typeof _0x5d01bc[_0x438f62(0x27d)]==='string')_0x33cf31[_0x438f62(0x27d)]=_0x5d01bc[_0x438f62(0x27d)];if(_0x5d01bc['behavior']&&typeof _0x5d01bc[_0x438f62(0x29d)]===_0x438f62(0x24b))_0x33cf31[_0x438f62(0x29d)]=_0x5d01bc['behavior'];if(_0x5d01bc['enriched'])_0x33cf31[_0x438f62(0x2e9)]=!![];if(_0x5d01bc['interval'])_0x33cf31['interval']=_0x5d01bc[_0x438f62(0x2dc)];let _0x839d97;try{_0x839d97=await _0x1abaae[_0x438f62(0x201)][_0x438f62(0x294)](_0x359ec2,_0x33cf31),_0x254857[_0x438f62(0x268)]();}catch(_0x43bedf){_0x254857['stop']();throw _0x43bedf;}return await this[_0x438f62(0x2dd)](_0x839d97,{'master':_0x5d01bc[_0x438f62(0x1f6)],'attribute':typeof _0x5d01bc['attribute']==='string'?_0x5d01bc[_0x438f62(0x27d)]:undefined,'behavior':typeof _0x5d01bc['behavior']===_0x438f62(0x24b)?_0x5d01bc['behavior']:undefined,'enriched':_0x5d01bc[_0x438f62(0x2e9)]}),_0x839d97['allValid']?0x0:0x1;}async['displayPreviewResults'](_0x2c18ce,_0x3c4be9){const _0x565165=a21_0x52fe5b;console[_0x565165(0x27e)]('\x0a'+a21_0x854bff[_0x565165(0x26b)](_0x565165(0x281))+'\x20'+_0x2c18ce[_0x565165(0x221)]),console['error']('═'['repeat'](0x3c));if(_0x3c4be9[_0x565165(0x1f6)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x1f3063=a21_0x854bff[_0x565165(0x2a1)](_0x565165(0x2d3))+'\x20'+a21_0x854bff[_0x565165(0x26b)](_0x2c18ce[_0x565165(0x1f6)][_0x565165(0x2cf)]+'.'+_0x2c18ce[_0x565165(0x1f6)]['table']);await this[_0x565165(0x2ed)](_0x1f3063,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x27d)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x3cc4a1=a21_0x854bff['dim'](_0x565165(0x20e))+'\x20'+a21_0x854bff[_0x565165(0x26b)](_0x3c4be9[_0x565165(0x27d)]);await this[_0x565165(0x2ed)](_0x3cc4a1,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x29d)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x3e0e33=a21_0x854bff[_0x565165(0x2a1)]('Behavior:')+'\x20'+a21_0x854bff['bold'](_0x3c4be9[_0x565165(0x29d)]);await this[_0x565165(0x2ed)](_0x3e0e33,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x2e9)]&&_0x2c18ce['sampleData']){const _0x442237=a21_0x854bff[_0x565165(0x2a1)]('Enriched:')+'\x20'+a21_0x854bff[_0x565165(0x26b)]('Master\x20+\x20Attributes');await this['displaySampleData'](_0x442237,_0x2c18ce[_0x565165(0x2ac)]);}else!_0x2c18ce[_0x565165(0x2ac)]&&console[_0x565165(0x27e)](_0x565165(0x1e2));}}}if(_0x2c18ce[_0x565165(0x24a)][_0x565165(0x240)]>0x0){console[_0x565165(0x27e)]('─'[_0x565165(0x288)](0x3c)),console[_0x565165(0x27e)]('\x0a'+a21_0x854bff[_0x565165(0x2da)]('Errors:'));for(const _0x358195 of _0x2c18ce['errors']){console[_0x565165(0x27e)]('\x20\x20'+a21_0x854bff['red']('•')+'\x20'+_0x358195);}}}async[a21_0x52fe5b(0x2ed)](_0x47b755,_0x444432){const _0x49a291=a21_0x52fe5b;if(_0x444432[_0x49a291(0x240)]===0x0){console[_0x49a291(0x27e)]('\x0a'+_0x47b755),console[_0x49a291(0x27e)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x49a291(0x27e)]('\x0a'+_0x47b755);const _0x1db3ac=Object['keys'](_0x444432[0x0])[_0x49a291(0x1d4)](_0x4c9c02=>({'name':_0x4c9c02,'type':typeof _0x444432[0x0][_0x4c9c02]==='number'?_0x49a291(0x2d2):_0x49a291(0x218)})),_0x2f4cce={'queryId':_0x49a291(0x2d6),'columns':_0x1db3ac,'data':_0x444432,'stats':{'state':_0x49a291(0x2ae),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x444432[_0x49a291(0x240)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x14fe99=formatAsTable(_0x2f4cce,_0x444432[_0x49a291(0x240)],!![]);await writeOutput(_0x14fe99,undefined,_0x49a291(0x2a3));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x250);[a21_0x52fe5b(0x211)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x254c21){const _0xe0c25=a21_0x52fe5b,{options:_0x3602c3,args:_0x1c5024,tdx:_0x149a63}=_0x254c21,_0xdad49a=_0x3602c3,_0x5d2c83=_0x1c5024[0x0]||_0x3602c3[_0xe0c25(0x1e1)];if(!_0x5d2c83)return showParentSegmentNotSetError(_0xe0c25(0x2a9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x227b6b=resolveYamlFile(_0x5d2c83);if(existsSync(_0x227b6b)){_0xdad49a[_0xe0c25(0x297)]&&console['error'](_0xe0c25(0x289)+_0x227b6b);let _0x3172c1;try{_0x3172c1=readFileSync(_0x227b6b,'utf-8');}catch(_0x1c755f){const _0xec8547=_0x1c755f instanceof Error?_0x1c755f[_0xe0c25(0x1e6)]:String(_0x1c755f);return console[_0xe0c25(0x27e)]('Error\x20reading\x20file:\x20'+_0xec8547),0x1;}const _0x109e83=await withSpinner('Analyzing\x20changes...',()=>_0x149a63[_0xe0c25(0x201)][_0xe0c25(0x296)](_0x3172c1),{'verbose':_0xdad49a['verbose']}),_0x5c0eed=_0x109e83['data'],{isNew:_0x4dfb07,name:_0x28cc49,hasChanges:_0x2e726c,diffFormatted:_0x34f0dc}=_0x5c0eed;if(_0x2e726c){_0x4dfb07?console[_0xe0c25(0x27e)](_0xe0c25(0x23b)+_0x28cc49+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x28cc49+'\x27:');console['error']('─'[_0xe0c25(0x288)](0x3c)),console[_0xe0c25(0x27e)](_0x34f0dc),console[_0xe0c25(0x27e)]('─'[_0xe0c25(0x288)](0x3c));const _0x40b7db=_0x4dfb07?_0xe0c25(0x265)+_0x28cc49+'\x27\x20and\x20run\x20workflow?':_0xe0c25(0x1e7)+_0x28cc49+_0xe0c25(0x2b3);if(!_0xdad49a[_0xe0c25(0x2c3)]){const _0x1c8697=await confirmKey(_0x40b7db);if(!_0x1c8697)return console[_0xe0c25(0x27e)]('Aborted.'),0x1;}const _0x10f4d9=_0x4dfb07?'Creating':_0xe0c25(0x1ff);await withSpinner(_0x10f4d9+_0xe0c25(0x2c2)+_0x28cc49+_0xe0c25(0x1e3),()=>_0x5c0eed[_0xe0c25(0x2cb)](),{'verbose':_0xdad49a['verbose']});const _0x4c540d=_0x4dfb07?_0xe0c25(0x2bb):_0xe0c25(0x207);console[_0xe0c25(0x27e)]('✔\x20'+_0x4c540d+_0xe0c25(0x2c2)+_0x28cc49+'\x27');}else console[_0xe0c25(0x27e)](_0xe0c25(0x27a)+_0x28cc49+'\x27\x20is\x20up\x20to\x20date');}const _0x141dad=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x5d2c83+_0xe0c25(0x1e3),()=>_0x149a63[_0xe0c25(0x201)][_0xe0c25(0x2ab)](_0x5d2c83),{'verbose':_0xdad49a[_0xe0c25(0x297)]}),_0x55fb20=_0x141dad[_0xe0c25(0x29c)],_0x392049=getConsoleUrl(_0xdad49a[_0xe0c25(0x228)],_0xe0c25(0x293)+_0x55fb20[_0xe0c25(0x1f9)]+_0xe0c25(0x237)+_0x55fb20[_0xe0c25(0x254)]+_0xe0c25(0x257)+_0x55fb20[_0xe0c25(0x277)]);return console[_0xe0c25(0x27e)](_0xe0c25(0x269)),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff[_0xe0c25(0x2a1)](_0xe0c25(0x2c7))+'\x20'+_0x55fb20[_0xe0c25(0x2a6)]),console['error']('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x1e9))+'\x20'+_0x55fb20[_0xe0c25(0x1d9)]),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x209))+'\x20'+_0x55fb20[_0xe0c25(0x254)]),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x21b))+'\x20'+_0x55fb20[_0xe0c25(0x277)]),console[_0xe0c25(0x27e)]('\x20\x20'+_0x392049),console[_0xe0c25(0x27e)]('\x0a'+a21_0x854bff['dim'](_0xe0c25(0x29b))+_0xe0c25(0x23a)+_0x55fb20[_0xe0c25(0x277)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x286);['description']='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x1d4b9f){const _0x4f54d7=a21_0x52fe5b,{options:_0x4661a6,args:_0x3d32f9,tdx:_0x5c0746}=_0x1d4b9f,_0x25fe2f=_0x3d32f9[0x0]||_0x4661a6[_0x4f54d7(0x1e1)];if(!_0x25fe2f)return showParentSegmentNotSetError(_0x4f54d7(0x2e7)+_0x4f54d7(0x244)),0x1;_0x4661a6[_0x4f54d7(0x297)]&&(console['error'](_0x4f54d7(0x2db)+_0x4661a6[_0x4f54d7(0x228)]),console[_0x4f54d7(0x27e)](_0x4f54d7(0x200)+_0x25fe2f));const _0x173a4a=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x25fe2f+_0x4f54d7(0x1e3),()=>_0x5c0746[_0x4f54d7(0x201)][_0x4f54d7(0x2b9)](_0x25fe2f),{'verbose':_0x4661a6['verbose']}),_0x5ee6de=_0x173a4a[_0x4f54d7(0x29c)];console[_0x4f54d7(0x27e)](_0x4f54d7(0x242)+_0x5ee6de['length']+_0x4f54d7(0x1da)+(_0x5ee6de[_0x4f54d7(0x240)]!==0x1?'s':''));if(_0x4661a6[_0x4f54d7(0x278)]||_0x4661a6['jsonl'])return await handleSDKOutput(_0x5ee6de,_0x4661a6),0x0;return displayFieldsHumanReadable(_0x5ee6de,_0x25fe2f),0x0;}}function a21_0x4a9f(){const _0x1573d3=['Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','behaviorsFile','\x0a⚠️\x20\x20Migrating:\x20','Fetching\x20SQL\x20for\x20\x27','segment:parent:fields','Creating','repeat','Found\x20YAML\x20file:\x20','elapsedTimeMillis','isDirectory','segment:parent:pull','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','/\x20directories\x20exist.','\x20=\x20','segment:parent:create','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','getParentSQL','/app/workflows/','previewParentYaml','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','pushParentYaml','verbose','Available\x20behaviors:','Output\x20file:\x20','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','To\x20cancel:','data','behavior','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Join:','Join\x20on:','dim','Validating\x20configuration...','table','tdx\x20segment\x20parent\x20preview\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','audienceId','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','population','runParent','sampleData','trim','FINISHED','timezone','/\x20and\x20','columns','validateParentYaml','\x27\x20and\x20run\x20workflow?','1137186haeXFa','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','schemaValid','listFields','processedRows','Created','utf-8','addBehaviors','label','\x27\x20is\x20already\x20up\x20to\x20date','parent_segments','cyan','\x20parent\x20segment\x20\x27','yes','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Errors:','open','Audience\x20ID:','updateParent','1082912qDUOic','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','apply','jobId','451662ePvYnc','Error:\x20Parent\x20segment\x20name\x20is\x20required','database','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Error\x20parsing\x20YAML:\x20','double','Master:','/app/dw/parentSegments/','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','preview','attributes','joinKey','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','red','Site:\x20','interval','displayPreviewResults','-1d','behaviors','stats','Customers:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','addAttributesFile','.yml','totalEvents','scheduleOption','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','replace','enriched','Available\x20attributes:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','win32','displaySampleData','rowCount','Rows:','Executing\x20parent\x20segment\x20query...','Validate:','Attributes','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20[Job\x20ID:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Listing\x20parent\x20segments\x20matching\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','Columns:','map','foreignKey','column','\x20rows\x20','getParentFull','status','\x20field','64uIHdvc','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','query','yellow','List\x20parent\x20segments','\x20--attribute\x20\x22','parentSegment','\x0aNo\x20sample\x20data\x20available','\x27...','segment:parent:push','customerGroup','message','Apply\x20changes\x20to\x20\x27','web','Status:','35FljAMi','addBehaviorsFile','localeCompare','segment:parent:view','start','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Aborted.','matchedCount','setJobId','log','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20No\x20changes\x20-\x20','master','237429DosxPd','Error\x20reading\x20file:\x20','workflowId','execute','Options\x20(one\x20required):\x0a','\x20--attribute\x20\x22<name>\x22','green','resolveParentId','Updating','Parent\x20segment:\x20','segment','using\x20the\x20default\x20path:\x20','Listing\x20parent\x20segments...','Fetching\x20sample\x20data...','1414028owUFui','Show\x20parent\x20segment\x20details','Updated','sort','Session:','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Options:\x0a','in\x20','Attribute:','Fetching\x20parent\x20segment\x20\x27','Table:\x20','description','endsWith','ignore','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','displayPreviewHints','addAttributes','\x20Configuration\x20is\x20valid','varchar','\x20--interval\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Attempt:','run','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Master\x20Table','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','name','createParent','segment:parent:validate','\x20--enriched','YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','session','site','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x0aChanges\x20to\x20apply\x20to\x20\x27','Error:\x20File\x20not\x20found:\x20','\x20Opening\x20','limit','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20-\x20','\x20--behavior\x20\x22','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','test','displayBehaviorsStats','toFixed','/sessions/','allValid','displayColumns','\x20tdx\x20wf\x20attempt\x20','\x0aNew\x20parent\x20segment\x20\x27','Updating\x20parent\x20segment\x20\x27','customersWithEvents','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','join','length','To\x20view\x20sample\x20data:','✔\x20Found\x20','customerGroupFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','darwin','33291470DFYOMO','Options:','displayMasterInfo','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','errors','string','text','Overwrite\x20\x27','Events:','3518590ECMzyY','segment:parent:run','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','✔\x20Query\x20completed:\x20Processed\x20','workflowSessionId','parent_segment','listParents','/attempt/','✔\x20Renamed\x20directory\x20to\x20','toLocaleString','Pattern:\x20','segment:parent:desc','\x20rows)','.yaml','unref','\x27\x20with\x20ID:\x20','SQL\x20query:\x0a','coveragePercent','format','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Error:','Create\x20parent\x20segment\x20\x27','displaySummary','Source:','stop','\x0a✔\x20Workflow\x20started','xdg-open','bold','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','displayValidateResults','pullParentYaml','scheduleType','use','9adhBZv','customerPercent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','segment:parent:preview','all','workflowAttemptId','json','No\x20parent\x20segments\x20match\x20pattern:\x20','✔\x20No\x20changes\x20-\x20\x27','dirname','displayAttributesStats','attribute','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','segment:parent:sql','Preview:'];a21_0x4a9f=function(){return _0x1573d3;};return a21_0x4a9f();}export class ParentSegmentViewCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x1ed);['description']=a21_0x52fe5b(0x206);async[a21_0x52fe5b(0x1fa)](_0x14bf7d){const _0x15b7ed=a21_0x52fe5b,{options:_0x41d102,args:_0x45d6db,tdx:_0x22ca33}=_0x14bf7d,_0x4c896d=_0x41d102,_0x58ab79=_0x45d6db[0x0]||_0x41d102[_0x15b7ed(0x1e1)];if(!_0x58ab79)return showParentSegmentNotSetError(_0x15b7ed(0x2eb)+_0x15b7ed(0x249)+_0x15b7ed(0x20c)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x41d102[_0x15b7ed(0x297)]&&(console[_0x15b7ed(0x27e)]('Site:\x20'+_0x41d102[_0x15b7ed(0x228)]),console[_0x15b7ed(0x27e)]('Parent\x20segment:\x20'+_0x58ab79));const _0x1fcfc9=await withSpinner(_0x15b7ed(0x20f)+_0x58ab79+_0x15b7ed(0x1e3),()=>_0x22ca33[_0x15b7ed(0x201)]['getParentFull'](_0x58ab79),{'verbose':_0x41d102['verbose']}),_0x11d384=_0x1fcfc9[_0x15b7ed(0x29c)];if(_0x4c896d[_0x15b7ed(0x1e8)]){const _0x350441=getConsoleNextUrl(_0x4c896d[_0x15b7ed(0x228)],_0x15b7ed(0x2d4)+_0x11d384['id']);return console['error'](a21_0x854bff['green']('✔')+_0x15b7ed(0x22c)+a21_0x854bff[_0x15b7ed(0x2c1)](_0x350441)),openBrowser(_0x350441),0x0;}return await handleSingleObjectOutput(_0x11d384,_0x41d102),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a21_0x52fe5b(0x25b);['description']=a21_0x52fe5b(0x21a);async[a21_0x52fe5b(0x1fa)](_0x4d3944){const _0x110268=a21_0x52fe5b,{options:_0x3127fd,args:_0x54c277,tdx:_0x5b73f2}=_0x4d3944,_0x2d718b=_0x54c277[0x0]||_0x3127fd[_0x110268(0x1e1)];if(!_0x2d718b)return showParentSegmentNotSetError(_0x110268(0x1ef)+_0x110268(0x27f)),0x1;_0x3127fd[_0x110268(0x297)]&&(console['error'](_0x110268(0x2db)+_0x3127fd[_0x110268(0x228)]),console['error']('Parent\x20segment:\x20'+_0x2d718b));const _0x1274cf=await withSpinner(_0x110268(0x22e)+_0x2d718b+_0x110268(0x1e3),()=>_0x5b73f2[_0x110268(0x201)]['resolveParentId'](_0x2d718b),{'verbose':_0x3127fd[_0x110268(0x297)]}),_0x4e2d32=_0x1274cf[_0x110268(0x29c)],_0x59e8b9=await withSpinner(_0x110268(0x285)+_0x2d718b+_0x110268(0x1e3),()=>_0x5b73f2[_0x110268(0x201)]['getParentSQL'](_0x4e2d32),{'verbose':_0x3127fd[_0x110268(0x297)]}),_0x38e1af=await executeSchemaQuery(_0x59e8b9[_0x110268(0x29c)],_0x5b73f2,_0x3127fd);return await handleQueryOutput(_0x38e1af,_0x3127fd),0x0;}}function a21_0x4595(_0x542d35,_0x4f943f){_0x542d35=_0x542d35-0x1ce;const _0x4a9fbc=a21_0x4a9f();let _0x4595d8=_0x4a9fbc[_0x542d35];return _0x4595d8;}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a21_0x52fe5b(0x280);['description']=a21_0x52fe5b(0x1d2);async['execute'](_0x5de5d1){const _0x3b695d=a21_0x52fe5b,{options:_0x268771,args:_0x56d412,tdx:_0x4fa419}=_0x5de5d1,_0x3cb36e=_0x56d412[0x0]||_0x268771[_0x3b695d(0x1e1)];if(!_0x3cb36e)return showParentSegmentNotSetError(_0x3b695d(0x2b5)+_0x3b695d(0x22f)),0x1;_0x268771[_0x3b695d(0x297)]&&(console[_0x3b695d(0x27e)](_0x3b695d(0x2db)+_0x268771[_0x3b695d(0x228)]),console[_0x3b695d(0x27e)](_0x3b695d(0x200)+_0x3cb36e));const _0x25f0ee=await withSpinner(_0x3b695d(0x22e)+_0x3cb36e+_0x3b695d(0x1e3),()=>_0x4fa419['segment']['resolveParentId'](_0x3cb36e),{'verbose':_0x268771[_0x3b695d(0x297)]}),_0x429c50=_0x25f0ee[_0x3b695d(0x29c)],_0x5c615f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3cb36e+'\x27...',()=>_0x4fa419[_0x3b695d(0x201)]['getParentSQL'](_0x429c50),{'verbose':_0x268771['verbose']}),_0x4260f6=_0x5c615f[_0x3b695d(0x29c)];return _0x268771['format']===_0x3b695d(0x278)||_0x268771[_0x3b695d(0x262)]==='jsonl'?await handleSDKOutput([{'sql':_0x4260f6}],_0x268771):console[_0x3b695d(0x1f3)](_0x4260f6),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:show';[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x29a);async[a21_0x52fe5b(0x1fa)](_0x52d57d){const _0x428f0a=a21_0x52fe5b,{options:_0x3cb695,args:_0xf295e8,tdx:_0x5ede1c}=_0x52d57d,_0x1580d7=_0xf295e8[0x0]||_0x3cb695[_0x428f0a(0x1e1)];if(!_0x1580d7)return showParentSegmentNotSetError(_0x428f0a(0x2e2)+_0x428f0a(0x2d0)),0x1;_0x3cb695[_0x428f0a(0x297)]&&(console[_0x428f0a(0x27e)](_0x428f0a(0x2db)+_0x3cb695[_0x428f0a(0x228)]),console[_0x428f0a(0x27e)](_0x428f0a(0x200)+_0x1580d7));const _0x382c79=await withSpinner(_0x428f0a(0x22e)+_0x1580d7+'\x27...',()=>_0x5ede1c[_0x428f0a(0x201)][_0x428f0a(0x1fe)](_0x1580d7),{'verbose':_0x3cb695[_0x428f0a(0x297)]}),_0xe84d94=_0x382c79['data'],_0xbf5bff=await withSpinner(_0x428f0a(0x285)+_0x1580d7+_0x428f0a(0x1e3),()=>_0x5ede1c[_0x428f0a(0x201)][_0x428f0a(0x292)](_0xe84d94),{'verbose':_0x3cb695[_0x428f0a(0x297)]});let _0x3308a4=_0xbf5bff[_0x428f0a(0x29c)];const _0x248dcf=resolveLimit(_0x3cb695[_0x428f0a(0x22d)],DEFAULT_DISPLAY_LIMIT),_0x598692=/\bLIMIT\s+\d+/i[_0x428f0a(0x234)](_0x3308a4);!_0x598692&&(_0x3308a4=_0x3308a4[_0x428f0a(0x2ad)]()[_0x428f0a(0x2e8)](/;+$/,''),_0x3308a4='SELECT\x20*\x20FROM\x20(\x0a'+_0x3308a4+_0x428f0a(0x295)+_0x248dcf);_0x3cb695[_0x428f0a(0x297)]&&console[_0x428f0a(0x27e)](_0x428f0a(0x260)+_0x3308a4);const _0x2c02ec=await withProgressSpinner(_0x428f0a(0x2f0),async _0x1ce52e=>{const _0x1b4bcd=_0x428f0a,_0x4aa28a=await _0x5ede1c[_0x1b4bcd(0x1dd)][_0x1b4bcd(0x1fa)](_0x3308a4,{'catalog':'td','schema':'information_schema','onJobId':_0x8cc8ec=>{const _0x2ae3b1=_0x1b4bcd;_0x1ce52e[_0x2ae3b1(0x1f2)](_0x8cc8ec);}});return _0x4aa28a;},{'verbose':_0x3cb695['verbose']}),_0x433dc0=_0x2c02ec[_0x428f0a(0x29c)],_0x5c81d8=_0x433dc0[_0x428f0a(0x2cc)]?_0x428f0a(0x1cf)+_0x433dc0['jobId']+']':'';return console[_0x428f0a(0x27e)](_0x428f0a(0x253)+_0x433dc0['stats'][_0x428f0a(0x2ba)][_0x428f0a(0x259)]()+_0x428f0a(0x1d7)+(_0x428f0a(0x20d)+formatElapsed(_0x433dc0[_0x428f0a(0x2e0)][_0x428f0a(0x28a)])+_0x5c81d8)),await handleQueryOutput(_0x433dc0,_0x3cb695),0x0;}}
|
|
1
|
+
const a21_0x3eafb8=a21_0xda3b;(function(_0x35cf8f,_0xb85be5){const _0x485648=a21_0xda3b,_0x5ee386=_0x35cf8f();while(!![]){try{const _0x3ca636=parseInt(_0x485648(0x19a))/0x1+parseInt(_0x485648(0xd6))/0x2+-parseInt(_0x485648(0xf2))/0x3*(-parseInt(_0x485648(0x13e))/0x4)+-parseInt(_0x485648(0x1c5))/0x5+-parseInt(_0x485648(0xdf))/0x6+-parseInt(_0x485648(0x168))/0x7*(-parseInt(_0x485648(0x120))/0x8)+parseInt(_0x485648(0xe6))/0x9*(-parseInt(_0x485648(0x180))/0xa);if(_0x3ca636===_0xb85be5)break;else _0x5ee386['push'](_0x5ee386['shift']());}catch(_0x383679){_0x5ee386['push'](_0x5ee386['shift']());}}}(a21_0x7168,0xa4b4a));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0x34a43a from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a21_0xda3b(_0x48fe6d,_0x4c0c9d){_0x48fe6d=_0x48fe6d-0x9d;const _0x716888=a21_0x7168();let _0xda3b9=_0x716888[_0x48fe6d];return _0xda3b9;}import{withSpinner,withProgressSpinner,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'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a21_0x112008 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a21_0x3eafb8(0x175),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x34c6b0){const _0x4427fa=a21_0x3eafb8,_0x42c6bc=process[_0x4427fa(0x131)],_0x2258a0=_0x42c6bc===_0x4427fa(0x1b5)?_0x4427fa(0x16a):_0x42c6bc==='win32'?_0x4427fa(0x1b1):_0x4427fa(0x196);spawn(_0x2258a0,[_0x34c6b0],{'detached':!![],'stdio':_0x4427fa(0x165)})[_0x4427fa(0x9f)]();}function migrateLegacyDirectory(){const _0x4f32a1=a21_0x3eafb8;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x202d6b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x202d6b[_0x4f32a1(0xda)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a21_0x112008[_0x4f32a1(0xbc)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x4f32a1(0xe7)+PARENT_SEGMENT_DIR+_0x4f32a1(0x1ca))),console[_0x4f32a1(0x19f)](a21_0x112008['dim'](_0x4f32a1(0x134)+LEGACY_PARENT_SEGMENT_DIR+_0x4f32a1(0x172))),![];console[_0x4f32a1(0x19f)](a21_0x112008[_0x4f32a1(0xbc)](_0x4f32a1(0xce)+LEGACY_PARENT_SEGMENT_DIR+_0x4f32a1(0x12f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x4f32a1(0x19f)](a21_0x112008[_0x4f32a1(0x156)](_0x4f32a1(0x14a)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x55714b){const _0x1dc324=_0x55714b instanceof Error?_0x55714b['message']:String(_0x55714b);return console[_0x4f32a1(0x19f)](a21_0x112008[_0x4f32a1(0xa3)](_0x4f32a1(0x18a)+_0x1dc324+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0x3eafb8(0x11f)](_0x33164a){const _0x31baa9=a21_0x3eafb8;return migrateLegacyDirectory(),super[_0x31baa9(0x11f)](_0x33164a);}}function resolveYamlFile(_0x376a83){const _0x17f25d=a21_0x3eafb8;if(_0x376a83['endsWith'](_0x17f25d(0xd4))||_0x376a83[_0x17f25d(0x17e)]('.yaml'))return _0x376a83;return a21_0x34a43a[_0x17f25d(0x15d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x376a83)+_0x17f25d(0xd4));}function formatProgressMessage(_0x304ef6){const _0x1b4f72=a21_0x3eafb8,_0x1119ae=_0x304ef6[_0x1b4f72(0xef)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1119ae){const [,_0x4207a5,_0x2911db,_0xe979a2='']=_0x1119ae;return a21_0x112008[_0x1b4f72(0x145)](_0x4207a5+':')+'\x20'+_0x2911db+a21_0x112008[_0x1b4f72(0x145)](_0xe979a2);}return a21_0x112008[_0x1b4f72(0x145)](_0x304ef6);}function showFileNotFoundError(_0x51bb37,_0x20614e){const _0x117bb8=a21_0x3eafb8;console['error'](a21_0x112008[_0x117bb8(0xa3)]('Error:\x20File\x20not\x20found:\x20'+_0x51bb37+'\x0a')),console[_0x117bb8(0x19f)](a21_0x112008['cyan'](_0x117bb8(0xae)+_0x20614e+_0x117bb8(0x150)));}function showParentSegmentNotSetError(_0x44830a){const _0x3c2124=a21_0x3eafb8;console[_0x3c2124(0x19f)](a21_0x112008['yellow'](_0x3c2124(0xc3))),console[_0x3c2124(0x19f)](_0x44830a);}export class ParentSegmentListCommand extends BaseCommand{['name']=a21_0x3eafb8(0x132);[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0xcc);async[a21_0x3eafb8(0x118)](_0x5197de){const _0x1072b3=a21_0x3eafb8,{options:_0xe8ca52,args:_0x5bb2e0,tdx:_0x1523a9}=_0x5197de,_0x2e3887=_0x5bb2e0[0x0];_0xe8ca52['verbose']&&(console['error']('Site:\x20'+_0xe8ca52[_0x1072b3(0x116)]),_0x2e3887&&console['error']('Pattern:\x20'+_0x2e3887));const _0x5f3616=await withSpinner(_0x2e3887?_0x1072b3(0xeb)+_0x2e3887+_0x1072b3(0x1a9):_0x1072b3(0xc9),()=>_0x1523a9[_0x1072b3(0x16b)][_0x1072b3(0x1a4)](),{'verbose':_0xe8ca52[_0x1072b3(0x100)]});let _0x5b6537=_0x5f3616[_0x1072b3(0x1ab)];if(_0x2e3887){const _0x4d041a=_0x2e3887[_0x1072b3(0xbe)](/[.+^${}()|[\]\\]/g,_0x1072b3(0x146))[_0x1072b3(0xbe)](/\*/g,'.*')[_0x1072b3(0xbe)](/\?/g,'.'),_0x2c2657=new RegExp('^'+_0x4d041a+'$','i');_0x5b6537=_0x5b6537[_0x1072b3(0x1a0)](_0x273bcb=>_0x2c2657[_0x1072b3(0x9d)](_0x273bcb[_0x1072b3(0x139)]['name']));}_0x5b6537[_0x1072b3(0x158)]((_0x293958,_0x10dc94)=>_0x293958[_0x1072b3(0x139)][_0x1072b3(0xf7)]['localeCompare'](_0x10dc94[_0x1072b3(0x139)]['name'])),console[_0x1072b3(0x19f)]('✔\x20Found\x20'+_0x5b6537['length']+'\x20parent\x20segment'+(_0x5b6537[_0x1072b3(0x169)]!==0x1?'s':''));const _0x1819c7=_0x54863d=>{const _0x4f8b4a=_0x1072b3;return getConsoleNextUrl(_0xe8ca52[_0x4f8b4a(0x116)],'/app/dw/parentSegments/'+_0x54863d);};if(_0xe8ca52[_0x1072b3(0xf0)]==='json'||_0xe8ca52['format']===_0x1072b3(0xad)){const _0x54092c=_0x5b6537[_0x1072b3(0x1b4)](_0x4dbf76=>({..._0x4dbf76,'url':_0x1819c7(_0x4dbf76['id'])}));await handleSDKOutput(_0x54092c,_0xe8ca52);}else{if(_0x5b6537[_0x1072b3(0x169)]===0x0)_0x2e3887?console[_0x1072b3(0x167)](_0x1072b3(0xe4)+_0x2e3887):console[_0x1072b3(0x167)](_0x1072b3(0xe1));else for(const _0x35f1aa of _0x5b6537){const _0x18fabf=_0x35f1aa[_0x1072b3(0x139)][_0x1072b3(0x1a7)]?a21_0x112008[_0x1072b3(0x145)]('\x20('+formatRows(_0x35f1aa['attributes'][_0x1072b3(0x1a7)])+')'):'',_0x6be79f=hyperlink(_0x35f1aa[_0x1072b3(0x139)][_0x1072b3(0xf7)],_0x1819c7(_0x35f1aa['id']));console[_0x1072b3(0x167)](_0x1072b3(0xd3)+_0x6be79f+_0x18fabf);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x3eafb8(0xf7)]=a21_0x3eafb8(0x1b9);['description']=a21_0x3eafb8(0x1ba);async[a21_0x3eafb8(0x118)](_0xae03d5){const _0x10d66b=a21_0x3eafb8,{options:_0x52f8e0,args:_0x10f412,tdx:_0x340630}=_0xae03d5;console[_0x10d66b(0x19f)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x10d66b(0x1a2)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x2d65f8=_0x52f8e0;if(_0x10f412[_0x10d66b(0x169)]===0x0)return console[_0x10d66b(0x19f)](a21_0x112008[_0x10d66b(0xa3)](_0x10d66b(0xb1))),console[_0x10d66b(0x19f)](_0x10d66b(0xc7)),0x1;const _0x488685=_0x10f412[0x0];if(!_0x2d65f8[_0x10d66b(0xf4)]||!_0x2d65f8['table'])return console[_0x10d66b(0x19f)](_0x10d66b(0x1a3)),console[_0x10d66b(0x19f)](_0x10d66b(0xc7)),0x1;_0x2d65f8[_0x10d66b(0x100)]&&(console['error'](_0x10d66b(0x15f)+_0x2d65f8['site']),console['error'](_0x10d66b(0xa1)+_0x488685),console['error'](_0x10d66b(0x133)+_0x2d65f8[_0x10d66b(0xf4)]),console[_0x10d66b(0x19f)]('Table:\x20'+_0x2d65f8['table']));const _0x467965=await loadJSONFromOptions(_0x2d65f8[_0x10d66b(0x139)],_0x2d65f8[_0x10d66b(0xd7)]),_0x37bae0=await loadJSONFromOptions(_0x2d65f8['behaviors'],_0x2d65f8['behaviorsFile']),_0x4f8086=await loadJSONFromOptions(_0x2d65f8[_0x10d66b(0x15e)],_0x2d65f8[_0x10d66b(0x147)]),_0x4b3cd4={'name':_0x488685,'description':_0x2d65f8[_0x10d66b(0x17a)],'scheduleType':_0x2d65f8['scheduleType'],'scheduleOption':_0x2d65f8[_0x10d66b(0x115)],'timezone':_0x2d65f8[_0x10d66b(0x11e)],'master':{'parentDatabaseName':_0x2d65f8[_0x10d66b(0xf4)],'parentTableName':_0x2d65f8[_0x10d66b(0x111)]},'attributes':_0x467965,'behaviors':_0x37bae0,'customerGroup':_0x4f8086},_0xb04bf0=await withSpinner(_0x10d66b(0xb7)+_0x488685+_0x10d66b(0x1a9),()=>_0x340630['segment'][_0x10d66b(0x1b7)](_0x4b3cd4),{'verbose':_0x52f8e0[_0x10d66b(0x100)]}),_0x3faa60=_0xb04bf0[_0x10d66b(0x1ab)];return console[_0x10d66b(0x19f)](_0x10d66b(0x102)+_0x3faa60[_0x10d66b(0xf7)]+_0x10d66b(0xfc)+_0x3faa60['id']),await handleSDKOutput([_0x3faa60],_0x52f8e0),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x3eafb8(0xf7)]=a21_0x3eafb8(0xee);[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0xdd);async[a21_0x3eafb8(0x118)](_0x25e5c5){const _0x4e8714=a21_0x3eafb8,{options:_0x3561c8,args:_0x4a4c70,tdx:_0x46960e}=_0x25e5c5;console[_0x4e8714(0x19f)](_0x4e8714(0xd0)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x4e8714(0xa8));const _0x30ba8f=_0x3561c8;if(_0x4a4c70[_0x4e8714(0x169)]===0x0)return console['error'](a21_0x112008[_0x4e8714(0xa3)](_0x4e8714(0xb1))),console[_0x4e8714(0x19f)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0xb3df8e=_0x4a4c70[0x0];_0x30ba8f['verbose']&&(console[_0x4e8714(0x19f)](_0x4e8714(0x15f)+_0x30ba8f[_0x4e8714(0x116)]),console[_0x4e8714(0x19f)]('Parent\x20segment:\x20'+_0xb3df8e));const _0x4be878=await withSpinner(_0x4e8714(0x189)+_0xb3df8e+_0x4e8714(0x1a9),()=>_0x46960e[_0x4e8714(0x16b)][_0x4e8714(0x107)](_0xb3df8e),{'verbose':_0x30ba8f['verbose']}),_0x304e38=_0x4be878['data'],_0x5e06c7=await loadJSONFromOptions(_0x30ba8f[_0x4e8714(0x1ac)],_0x30ba8f[_0x4e8714(0x13a)]),_0x2ce039=await loadJSONFromOptions(_0x30ba8f[_0x4e8714(0x19e)],_0x30ba8f[_0x4e8714(0x122)]),_0x50d033={'name':_0x304e38['name'],'description':_0x30ba8f[_0x4e8714(0x17a)]!==undefined?_0x30ba8f['description']:_0x304e38[_0x4e8714(0x17a)],'scheduleType':_0x30ba8f[_0x4e8714(0x187)]!==undefined?_0x30ba8f[_0x4e8714(0x187)]:_0x304e38[_0x4e8714(0x187)],'scheduleOption':_0x30ba8f[_0x4e8714(0x115)]!==undefined?_0x30ba8f[_0x4e8714(0x115)]:_0x304e38[_0x4e8714(0x115)],'timezone':_0x30ba8f[_0x4e8714(0x11e)]!==undefined?_0x30ba8f[_0x4e8714(0x11e)]:_0x304e38[_0x4e8714(0x11e)],'master':_0x304e38['master'],'attributes':_0x5e06c7?[..._0x304e38[_0x4e8714(0x139)]||[],..._0x5e06c7]:_0x304e38[_0x4e8714(0x139)],'behaviors':_0x2ce039?[..._0x304e38[_0x4e8714(0xbd)]||[],..._0x2ce039]:_0x304e38['behaviors'],'customerGroup':_0x304e38[_0x4e8714(0x15e)]},_0x3e5299=await withSpinner(_0x4e8714(0x10f)+_0xb3df8e+'\x27...',()=>_0x46960e[_0x4e8714(0x16b)][_0x4e8714(0x19b)](_0xb3df8e,_0x50d033),{'verbose':_0x30ba8f['verbose']}),_0x266258=_0x3e5299[_0x4e8714(0x1ab)];return console['error'](_0x4e8714(0x178)+_0x266258['name']+'\x27'),await handleSDKOutput([_0x266258],_0x30ba8f),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0x3eafb8(0xf7)]='segment:parent:pull';['description']=a21_0x3eafb8(0x184);async[a21_0x3eafb8(0x118)](_0x2389e3){const _0x5259d7=a21_0x3eafb8,{options:_0x5c8277,args:_0x36514a,tdx:_0x3ec6b3}=_0x2389e3,_0x2c35d2=_0x5c8277,_0x352ed2=_0x36514a[0x0]||_0x5c8277['parentSegment'];if(!_0x352ed2)return showParentSegmentNotSetError(_0x5259d7(0x10c)+_0x5259d7(0x1aa)),0x1;if(_0x2c35d2[_0x5259d7(0x1b0)]&&_0x2c35d2[_0x5259d7(0x135)])return console[_0x5259d7(0x19f)](a21_0x112008[_0x5259d7(0xa3)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x5259d7(0x19f)](a21_0x112008[_0x5259d7(0x145)](_0x5259d7(0xf5))),console[_0x5259d7(0x19f)](a21_0x112008[_0x5259d7(0x145)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x5259d7(0xfe))),console[_0x5259d7(0x19f)](a21_0x112008[_0x5259d7(0x18b)](_0x5259d7(0x173))),0x1;const _0xea4f6a=_0x2c35d2['output']||a21_0x34a43a[_0x5259d7(0x15d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x352ed2)+_0x5259d7(0xd4));_0x2c35d2[_0x5259d7(0x100)]&&(console[_0x5259d7(0x19f)](_0x5259d7(0x15f)+_0x2c35d2['site']),console['error']('Parent\x20segment:\x20'+_0x352ed2),console[_0x5259d7(0x19f)]('Output\x20file:\x20'+_0xea4f6a));const _0x59fca0=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x352ed2+'\x27...',()=>_0x3ec6b3[_0x5259d7(0x16b)][_0x5259d7(0x121)](_0x352ed2),{'verbose':_0x2c35d2['verbose']}),_0x45898d=_0x59fca0['data'];if(existsSync(_0xea4f6a)){const _0x56425b=readFileSync(_0xea4f6a,'utf-8'),_0x2e72b9=generateDiff(_0x56425b,_0x45898d);if(!hasChanges(_0x2e72b9))console[_0x5259d7(0x19f)](a21_0x112008[_0x5259d7(0x156)]('✔')+_0x5259d7(0xca)+a21_0x112008[_0x5259d7(0x18b)](_0xea4f6a)+_0x5259d7(0x103));else{console[_0x5259d7(0x19f)](_0x5259d7(0x1b8)+_0xea4f6a+'\x27:'),console[_0x5259d7(0x19f)]('─'[_0x5259d7(0x1b3)](0x3c)),console[_0x5259d7(0x19f)](formatDiffWithColors(_0x2e72b9)),console[_0x5259d7(0x19f)]('─'[_0x5259d7(0x1b3)](0x3c));if(!_0x2c35d2['yes']){const _0x16f8ee=await confirmKey(_0x5259d7(0xf9)+_0xea4f6a+'\x27?');if(!_0x16f8ee)return console[_0x5259d7(0x19f)]('Aborted.'),0x1;}writeFileSync(_0xea4f6a,_0x45898d,_0x5259d7(0x112)),console['error'](a21_0x112008[_0x5259d7(0x156)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a21_0x112008[_0x5259d7(0x18b)](_0xea4f6a));}}else{const _0x11e01b=a21_0x34a43a[_0x5259d7(0x161)](_0xea4f6a);!existsSync(_0x11e01b)&&mkdirSync(_0x11e01b,{'recursive':!![]}),writeFileSync(_0xea4f6a,_0x45898d,_0x5259d7(0x112)),console[_0x5259d7(0x19f)](a21_0x112008[_0x5259d7(0x156)]('✔')+_0x5259d7(0x17c)+a21_0x112008[_0x5259d7(0x18b)](_0xea4f6a));}return saveSessionContext({'parent_segment':_0x352ed2},_0x2c35d2[_0x5259d7(0xdb)]),console['error'](a21_0x112008['green']('✔')+_0x5259d7(0x1bb)+a21_0x112008[_0x5259d7(0x145)](_0x5259d7(0x14d))+_0x5259d7(0x1c0)+a21_0x112008[_0x5259d7(0x18b)](_0x352ed2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a21_0x3eafb8(0xf7)]=a21_0x3eafb8(0x1c2);[a21_0x3eafb8(0x17a)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a21_0x3eafb8(0x118)](_0x26ded6){const _0x45a760=a21_0x3eafb8,{options:_0x3acb24,args:_0x521e4a,tdx:_0x56de57}=_0x26ded6,_0x13170d=_0x3acb24,_0xffeff6=_0x521e4a[0x0]||_0x3acb24[_0x45a760(0x14e)];if(!_0xffeff6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x45a760(0x199)),0x1;const _0x2ff6a4=resolveYamlFile(_0xffeff6);if(!existsSync(_0x2ff6a4))return showFileNotFoundError(_0x2ff6a4,_0xffeff6),0x1;_0x13170d['verbose']&&(console[_0x45a760(0x19f)](_0x45a760(0x15f)+_0x13170d[_0x45a760(0x116)]),console[_0x45a760(0x19f)](_0x45a760(0x10b)+_0x2ff6a4));let _0x102101;try{_0x102101=readFileSync(_0x2ff6a4,_0x45a760(0x112));}catch(_0x1c41d3){const _0x3e7fa5=_0x1c41d3 instanceof Error?_0x1c41d3['message']:String(_0x1c41d3);return console[_0x45a760(0x19f)](_0x45a760(0xd9)+_0x3e7fa5),0x1;}const _0x21f27e=await withSpinner(_0x45a760(0x129),()=>_0x56de57[_0x45a760(0x16b)][_0x45a760(0xff)](_0x102101),{'verbose':_0x13170d[_0x45a760(0x100)]}),_0x2de511=_0x21f27e[_0x45a760(0x1ab)],{isNew:_0x417925,name:_0x4cccf9,hasChanges:_0x3d2e15,diffFormatted:_0x4ab726}=_0x2de511;if(!_0x3d2e15)return console[_0x45a760(0x19f)](_0x45a760(0xb2)+_0x4cccf9+_0x45a760(0x144)),0x0;_0x417925?console['error'](_0x45a760(0xe9)+_0x4cccf9+'\x27:'):console[_0x45a760(0x19f)](_0x45a760(0x1ad)+_0x4cccf9+'\x27:');console[_0x45a760(0x19f)]('─'['repeat'](0x3c)),console[_0x45a760(0x19f)](_0x4ab726),console[_0x45a760(0x19f)]('─'['repeat'](0x3c));const _0xd0f42d=_0x417925?_0x45a760(0xf1)+_0x4cccf9+'\x27?':_0x45a760(0x193)+_0x4cccf9+'\x27?';if(!_0x13170d[_0x45a760(0x1be)]){const _0x431cef=await confirmKey(_0xd0f42d);if(!_0x431cef)return console[_0x45a760(0x19f)](_0x45a760(0xcb)),0x1;}const _0x1e9edc=_0x417925?_0x45a760(0x17b):_0x45a760(0x125),_0x3fc5ce=await withSpinner(_0x1e9edc+_0x45a760(0x128)+_0x4cccf9+'\x27...',()=>_0x2de511['apply'](),{'verbose':_0x13170d[_0x45a760(0x100)]}),_0x1d166b=_0x3fc5ce[_0x45a760(0x1ab)],_0x339b05=getConsoleNextUrl(_0x13170d[_0x45a760(0x116)],_0x45a760(0x1bd)+_0x1d166b['id']),_0x54af38=_0x417925?_0x45a760(0x138):_0x45a760(0x1ae);return console[_0x45a760(0x19f)]('✔\x20'+_0x54af38+_0x45a760(0x128)+_0x1d166b[_0x45a760(0xf7)]+'\x27'),console[_0x45a760(0x19f)]('\x20\x20'+_0x339b05),0x0;}}function a21_0x7168(){const _0x4e7235=['text','parent_segment','parentSegment','Join\x20on:','`\x20to\x20download\x20the\x20configuration\x20first','segment:parent:preview','Parent\x20segment:\x20','To\x20cancel:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','displayBehaviorsStats','green','varchar','sort','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','joinKey','resolveParentId','join','customerGroup','Site:\x20','Available\x20behaviors:','dirname','workflowSessionId','listFields','errors','ignore','preview','log','70rYslXU','length','open','segment','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','keys','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20rows)','setJobId','/\x20directory.\x0a','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','parent_segments','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20--behavior\x20\x22<name>\x22','✔\x20Updated\x20parent\x20segment\x20\x27','label','description','Creating','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','schemaError','endsWith','bold','2470dvzSGx','Master\x20Table','displayPreviewResults','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','scheduleType','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Fetching\x20current\x20configuration\x20for\x20\x27','✘\x20Failed\x20to\x20rename\x20directory:\x20','cyan','\x20kill','previewParentYaml','displaySummary','\x20--attribute\x20\x22','Fetching\x20SQL\x20for\x20\x27','displayPreviewHints','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Apply\x20changes\x20to\x20\x27','Master:','columns','xdg-open','To\x20view\x20sample\x20data:','✔\x20Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','30192JdGeCm','updateParent','validateParentYaml','jobId','addBehaviors','error','filter','coveragePercent','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Error:\x20--database\x20and\x20--table\x20are\x20required','listParents','Errors:','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','population','query','\x27...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','data','addAttributes','\x0aChanges\x20to\x20apply\x20to\x20\x27','Updated','all','use','start','Join:','repeat','map','darwin','column','createParent','\x0aChanges\x20to\x20\x27','segment:parent:create','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20Context\x20set:\x20','/sessions/','/app/dw/parentSegments/','yes','SELECT\x20*\x20FROM\x20(\x0a','\x20=\x20','Show\x20parent\x20segment\x20details','segment:parent:push','List\x20available\x20fields\x20for\x20segmentation','schemaValid','411365LuNpMt','interval','message','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','/\x20directories\x20exist.','rowCount','test','attribute','unref','\x0a✔\x20Workflow\x20started','Name:\x20','\x20tdx\x20wf\x20attempt\x20','red','customerPercent','information_schema','matchedCount','Columns:','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Events:','Behavior:','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','jsonl','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','tdx\x20segment\x20parent\x20preview\x20','Error:','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20No\x20changes\x20-\x20\x27','\x20--behavior\x20\x22','behavior','elapsedTimeMillis','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Creating\x20parent\x20segment\x20\x27','segment:parent:run','Executing\x20parent\x20segment\x20query...','segment:parent:fields','\x20[Job\x20ID:\x20','yellow','behaviors','replace','✔\x20Query\x20completed:\x20Processed\x20','sampleData','Rows:','limit','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','toLocaleString','\x20Configuration\x20is\x20valid','json','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','double','Listing\x20parent\x20segments...','\x20No\x20changes\x20-\x20','Aborted.','List\x20parent\x20segments','Customers:','\x0a⚠️\x20\x20Migrating:\x20','/attempt/','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','displayMasterInfo','👥\x20','.yml','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','231952RpckJi','attributesFile','Master\x20+\x20Attributes','Error\x20reading\x20file:\x20','isDirectory','session','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','enriched','5893248zxQZRH','Attribute:','No\x20parent\x20segments\x20found','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','toFixed','No\x20parent\x20segments\x20match\x20pattern:\x20','Options:','7767iARIaI','/\x20and\x20','segment:parent:view','\x0aNew\x20parent\x20segment\x20\x27','displayColumns','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','foreignKey','segment:parent:update','match','format','Create\x20parent\x20segment\x20\x27','6027ZkoHiS','segment:parent:desc','database','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Audience\x20ID:','name','FINISHED','Overwrite\x20\x27','/app/workflows/','status','\x27\x20with\x20ID:\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','/{name}.yml\x0a','pushParentYaml','verbose','master','✔\x20Created\x20parent\x20segment\x20\x27','\x20is\x20already\x20up\x20to\x20date','processedRows','allValid','Source:','getParentFull','getParentSQL','\x20\x20\x20\x20-\x20','Status:','YAML\x20file:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','workflowAttemptId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Updating\x20parent\x20segment\x20\x27','displaySampleData','table','utf-8','trim','Options:\x0a','scheduleOption','site','audienceId','execute','stop','\x27\x20is\x20up\x20to\x20date','web','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20--attribute\x20\x22<name>\x22','timezone','run','670216whmaix','pullParentYaml','addBehaviorsFile','\x20--interval\x20','\x20Opening\x20','Updating','displayValidateResults','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x20parent\x20segment\x20\x27','Analyzing\x20changes...','Preview:','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Found\x20YAML\x20file:\x20','SQL\x20query:\x0a','\x27\x20and\x20run\x20workflow?','/\x20→\x20','Validate:','platform','segment:parent:list','Database:\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','output','displayAttributesStats','string','Created','attributes','addAttributesFile','Options\x20(one\x20required):\x0a','segment:parent:show','Attributes','1928rMSqgo','Resolving\x20parent\x20segment\x20\x27','Enriched:','stats','totalEvents','Listing\x20fields\x20for\x20\x27','\x27\x20is\x20already\x20up\x20to\x20date','dim','\x5c$&','customerGroupFile','\x0aUsage:\x20tdx\x20ps\x20preview\x20','customersWithEvents','✔\x20Renamed\x20directory\x20to\x20','Attempt:'];a21_0x7168=function(){return _0x4e7235;};return a21_0x7168();}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a21_0x3eafb8(0xf7)]='segment:parent:validate';[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0x183);async[a21_0x3eafb8(0x118)](_0x518f58){const _0x44d8b3=a21_0x3eafb8,{options:_0x1c2e9c,args:_0x456d27,tdx:_0x4deec8}=_0x518f58,_0x3d4c2d=_0x1c2e9c,_0x23d51f=_0x456d27[0x0]||_0x1c2e9c[_0x44d8b3(0x14e)];if(!_0x23d51f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x44d8b3(0x12b)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x44d8b3(0x16d)),0x1;const _0x29b431=resolveYamlFile(_0x23d51f);if(!existsSync(_0x29b431))return showFileNotFoundError(_0x29b431,_0x23d51f),0x1;_0x3d4c2d[_0x44d8b3(0x100)]&&(console[_0x44d8b3(0x19f)](_0x44d8b3(0x15f)+_0x3d4c2d[_0x44d8b3(0x116)]),console[_0x44d8b3(0x19f)](_0x44d8b3(0x10b)+_0x29b431));let _0x169ca5;try{_0x169ca5=readFileSync(_0x29b431,'utf-8');}catch(_0x120322){const _0xd3b84f=_0x120322 instanceof Error?_0x120322[_0x44d8b3(0x1c7)]:String(_0x120322);return console[_0x44d8b3(0x19f)]('Error\x20reading\x20file:\x20'+_0xd3b84f),0x1;}const _0x555181=createCommandSpinner(a21_0x112008[_0x44d8b3(0x145)]('Validating\x20configuration...'),{'verbose':_0x3d4c2d['verbose']});_0x555181[_0x44d8b3(0x1b1)]();const _0x355afd={'onProgress':_0x4e23db=>{const _0x16add5=_0x44d8b3;_0x555181[_0x16add5(0x14c)]=formatProgressMessage(_0x4e23db);}};if(_0x3d4c2d['master'])_0x355afd[_0x44d8b3(0x101)]=!![];if(_0x3d4c2d['enriched'])_0x355afd[_0x44d8b3(0xde)]=!![];_0x3d4c2d[_0x44d8b3(0x9e)]&&(_0x355afd[_0x44d8b3(0x9e)]=_0x3d4c2d[_0x44d8b3(0x9e)]);_0x3d4c2d[_0x44d8b3(0xb4)]&&(_0x355afd[_0x44d8b3(0xb4)]=_0x3d4c2d[_0x44d8b3(0xb4)]);if(_0x3d4c2d[_0x44d8b3(0x1c6)])_0x355afd[_0x44d8b3(0x1c6)]=_0x3d4c2d[_0x44d8b3(0x1c6)];let _0x1bf57c;try{_0x1bf57c=await _0x4deec8[_0x44d8b3(0x16b)][_0x44d8b3(0x19c)](_0x169ca5,_0x355afd),_0x555181[_0x44d8b3(0x119)]();}catch(_0xfdfe6){_0x555181[_0x44d8b3(0x119)]();throw _0xfdfe6;}const _0x4c0623=_0x3d4c2d[_0x44d8b3(0x1c6)]||'-1d';return this[_0x44d8b3(0x126)](_0x1bf57c,_0x355afd,_0x29b431,_0x4c0623),_0x1bf57c['allValid']?0x0:0x1;}['displayValidateResults'](_0x5de67f,_0x1af8cb,_0x47c5dd,_0x42bb79){const _0x464794=a21_0x3eafb8;console[_0x464794(0x19f)]('\x0a'+a21_0x112008[_0x464794(0x17f)](_0x464794(0x130))+'\x20'+_0x5de67f['name']),console[_0x464794(0x19f)]('═'[_0x464794(0x1b3)](0x3c)),this[_0x464794(0xd2)](_0x5de67f);if(typeof _0x1af8cb[_0x464794(0x9e)]===_0x464794(0x137)){this[_0x464794(0x136)](_0x5de67f),this['displaySummary'](_0x5de67f),this[_0x464794(0x191)](_0x47c5dd,_0x42bb79,_0x464794(0x9e),_0x1af8cb[_0x464794(0x9e)]);return;}if(_0x1af8cb[_0x464794(0x9e)]===!![]){this[_0x464794(0x136)](_0x5de67f),this['displaySummary'](_0x5de67f),this['displayPreviewHints'](_0x47c5dd,_0x42bb79,'attributes');return;}if(typeof _0x1af8cb[_0x464794(0xb4)]===_0x464794(0x137)){this[_0x464794(0x155)](_0x5de67f,_0x42bb79),this[_0x464794(0x18e)](_0x5de67f),this['displayPreviewHints'](_0x47c5dd,_0x42bb79,'behavior',_0x1af8cb[_0x464794(0xb4)]);return;}if(_0x1af8cb['behavior']===!![]){this['displayBehaviorsStats'](_0x5de67f,_0x42bb79),this[_0x464794(0x18e)](_0x5de67f),this['displayPreviewHints'](_0x47c5dd,_0x42bb79,_0x464794(0xbd));return;}this[_0x464794(0x136)](_0x5de67f),this[_0x464794(0x155)](_0x5de67f,_0x42bb79),this['displaySummary'](_0x5de67f),this['displayPreviewHints'](_0x47c5dd,_0x42bb79,'all');}[a21_0x3eafb8(0x191)](_0x1674e1,_0x51393b,_0x5e33df,_0x54dfe8){const _0x539531=a21_0x3eafb8;console[_0x539531(0x19f)]('\x0a'+a21_0x112008[_0x539531(0x145)](_0x539531(0x197)));const _0xcbf8c1=_0x51393b!=='-1d'?_0x539531(0x123)+_0x51393b:'';if(_0x5e33df===_0x539531(0x9e)&&_0x54dfe8)console[_0x539531(0x19f)]('\x20\x20'+a21_0x112008[_0x539531(0x145)](_0x539531(0xaf)+_0x1674e1+_0x539531(0x18f)+_0x54dfe8+'\x22'+_0xcbf8c1));else{if(_0x5e33df===_0x539531(0xb4)&&_0x54dfe8)console[_0x539531(0x19f)]('\x20\x20'+a21_0x112008[_0x539531(0x145)]('tdx\x20segment\x20parent\x20preview\x20'+_0x1674e1+_0x539531(0xb3)+_0x54dfe8+'\x22'+_0xcbf8c1));else(_0x5e33df===_0x539531(0x139)||_0x5e33df===_0x539531(0x1af))&&console['error']('\x20\x20'+a21_0x112008['dim'](_0x539531(0xaf)+_0x1674e1+_0x539531(0x11d)+_0xcbf8c1));}(_0x5e33df===_0x539531(0xbd)||_0x5e33df==='all')&&console[_0x539531(0x19f)]('\x20\x20'+a21_0x112008[_0x539531(0x145)](_0x539531(0xaf)+_0x1674e1+_0x539531(0x177)+_0xcbf8c1)),_0x5e33df===_0x539531(0x1af)&&console['error']('\x20\x20'+a21_0x112008[_0x539531(0x145)]('tdx\x20segment\x20parent\x20preview\x20'+_0x1674e1+'\x20--enriched'+_0xcbf8c1));}[a21_0x3eafb8(0xd2)](_0xb98148){const _0x140252=a21_0x3eafb8,{master:_0x350482}=_0xb98148,_0x3e9d8f=_0x350482[_0x140252(0x1c4)]?a21_0x112008[_0x140252(0x156)]('✔'):a21_0x112008['red']('✘');console[_0x140252(0x19f)]('\x0a'+a21_0x112008[_0x140252(0x145)](_0x140252(0x181))),console['error'](_0x3e9d8f+'\x20'+a21_0x112008['bold'](_0x350482[_0x140252(0xf4)]+'.'+_0x350482[_0x140252(0x111)])),_0x350482[_0x140252(0x1c4)]?_0x350482[_0x140252(0x1cb)]!==undefined&&console[_0x140252(0x19f)]('\x20\x20'+a21_0x112008[_0x140252(0x145)](_0x140252(0xc1))+'\x20'+a21_0x112008[_0x140252(0x18b)](formatRows(_0x350482[_0x140252(0x1cb)]))):console[_0x140252(0x19f)]('\x20\x20'+a21_0x112008[_0x140252(0xa3)](_0x140252(0xb0))+'\x20'+_0x350482['schemaError']);}[a21_0x3eafb8(0x136)](_0x111873){const _0xb20d85=a21_0x3eafb8;if(_0x111873[_0xb20d85(0x139)][_0xb20d85(0x169)]===0x0)return;console[_0xb20d85(0x19f)]('\x0a'+a21_0x112008['dim'](_0xb20d85(0x13d)));for(const _0x12bd45 of _0x111873[_0xb20d85(0x139)]){const _0x1ae5e1=_0x12bd45[_0xb20d85(0x1c4)]?a21_0x112008[_0xb20d85(0x156)]('✔'):a21_0x112008[_0xb20d85(0xa3)]('✘');let _0x234af4='';if(_0x12bd45['schemaValid']&&_0x12bd45['matchedCount']!==undefined&&_0x12bd45[_0xb20d85(0x1a1)]!==undefined){const _0x48ae03=_0x12bd45[_0xb20d85(0x1a1)][_0xb20d85(0xe3)](0x1),_0x1cd2af=_0x12bd45['coveragePercent']>=0x50?a21_0x112008[_0xb20d85(0x156)]:_0x12bd45[_0xb20d85(0x1a1)]>=0x32?a21_0x112008[_0xb20d85(0xbc)]:a21_0x112008[_0xb20d85(0xa3)];_0x234af4='\x20'+a21_0x112008['dim']('Coverage:')+'\x20'+_0x1cd2af(_0x48ae03+'%')+'\x20('+formatRows(_0x12bd45[_0xb20d85(0xa6)])+_0xb20d85(0x170);}console[_0xb20d85(0x19f)](_0x1ae5e1+'\x20'+a21_0x112008['bold'](_0x12bd45[_0xb20d85(0xf7)])+_0x234af4),console[_0xb20d85(0x19f)]('\x20\x20'+a21_0x112008['dim'](_0xb20d85(0x106))+'\x20'+a21_0x112008[_0xb20d85(0x17f)](_0x12bd45[_0xb20d85(0xf4)]+'.'+_0x12bd45[_0xb20d85(0x111)]));const _0x33e7ac=_0x12bd45[_0xb20d85(0x15b)]===_0x12bd45[_0xb20d85(0xed)]?a21_0x112008[_0xb20d85(0x145)]('Join\x20on:')+'\x20'+_0x12bd45[_0xb20d85(0x15b)]:a21_0x112008[_0xb20d85(0x145)](_0xb20d85(0x1b2))+'\x20'+_0x12bd45[_0xb20d85(0x15b)]+_0xb20d85(0x1c0)+_0x12bd45[_0xb20d85(0xed)];console[_0xb20d85(0x19f)]('\x20\x20'+_0x33e7ac),console[_0xb20d85(0x19f)]('\x20\x20'+a21_0x112008['dim'](_0xb20d85(0xa7))),this[_0xb20d85(0xea)](_0x12bd45[_0xb20d85(0x195)]),!_0x12bd45[_0xb20d85(0x1c4)]&&console[_0xb20d85(0x19f)]('\x20\x20'+a21_0x112008[_0xb20d85(0xa3)](_0xb20d85(0xb0))+'\x20'+_0x12bd45[_0xb20d85(0x17d)]);}}['displayBehaviorsStats'](_0x240eb7,_0xb8092c){const _0xdc9750=a21_0x3eafb8;if(_0x240eb7[_0xdc9750(0xbd)][_0xdc9750(0x169)]===0x0)return;console[_0xdc9750(0x19f)]('\x0a'+a21_0x112008[_0xdc9750(0x145)]('Behaviors')+'\x20'+a21_0x112008[_0xdc9750(0x145)]('('+_0xb8092c+')'));for(const _0x5841ed of _0x240eb7['behaviors']){const _0x1c9bd1=_0x5841ed[_0xdc9750(0x1c4)]?a21_0x112008[_0xdc9750(0x156)]('✔'):a21_0x112008[_0xdc9750(0xa3)]('✘');let _0x4f62c5='';if(_0x5841ed['schemaValid']&&_0x5841ed[_0xdc9750(0x149)]!==undefined&&_0x5841ed[_0xdc9750(0x142)]!==undefined){const _0x2f6ad2=_0x5841ed[_0xdc9750(0xa4)]?.[_0xdc9750(0xe3)](0x1)||'?',_0x3837ca=(_0x5841ed['customerPercent']??0x0)>=0x32?a21_0x112008[_0xdc9750(0x156)]:(_0x5841ed[_0xdc9750(0xa4)]??0x0)>=0x14?a21_0x112008['yellow']:a21_0x112008[_0xdc9750(0xa3)];_0x4f62c5='\x20'+a21_0x112008[_0xdc9750(0x145)](_0xdc9750(0xcd))+'\x20'+_0x3837ca(formatRows(_0x5841ed[_0xdc9750(0x149)]))+'\x20('+_0x2f6ad2+'%)\x20'+a21_0x112008['dim'](_0xdc9750(0xaa))+'\x20'+a21_0x112008['cyan'](formatRows(_0x5841ed['totalEvents']));}console[_0xdc9750(0x19f)](_0x1c9bd1+'\x20'+a21_0x112008[_0xdc9750(0x17f)](_0x5841ed['name'])+_0x4f62c5),console['error']('\x20\x20'+a21_0x112008[_0xdc9750(0x145)]('Source:')+'\x20'+a21_0x112008[_0xdc9750(0x17f)](_0x5841ed[_0xdc9750(0xf4)]+'.'+_0x5841ed['table']));const _0x2f074d=_0x5841ed[_0xdc9750(0x15b)]===_0x5841ed['foreignKey']?a21_0x112008[_0xdc9750(0x145)](_0xdc9750(0x14f))+'\x20'+_0x5841ed[_0xdc9750(0x15b)]:a21_0x112008['dim'](_0xdc9750(0x1b2))+'\x20'+_0x5841ed[_0xdc9750(0x15b)]+_0xdc9750(0x1c0)+_0x5841ed[_0xdc9750(0xed)];console[_0xdc9750(0x19f)]('\x20\x20'+_0x2f074d),console[_0xdc9750(0x19f)]('\x20\x20'+a21_0x112008[_0xdc9750(0x145)](_0xdc9750(0xa7))),this[_0xdc9750(0xea)](_0x5841ed[_0xdc9750(0x195)]),!_0x5841ed['schemaValid']&&console[_0xdc9750(0x19f)]('\x20\x20'+a21_0x112008[_0xdc9750(0xa3)]('Error:')+'\x20'+_0x5841ed[_0xdc9750(0x17d)]);}}[a21_0x3eafb8(0xea)](_0x349bcf){const _0x4aaddd=a21_0x3eafb8;for(const _0x355cb6 of _0x349bcf){_0x355cb6['label']===_0x355cb6['column']||_0x355cb6[_0x4aaddd(0x1b6)]==='*'?console[_0x4aaddd(0x19f)](_0x4aaddd(0x109)+_0x355cb6['label']):console[_0x4aaddd(0x19f)](_0x4aaddd(0x109)+_0x355cb6[_0x4aaddd(0x179)]+'\x20'+a21_0x112008['dim']('('+_0x355cb6['column']+')'));}}['displaySummary'](_0x51ea3d){const _0x1e3670=a21_0x3eafb8;console['error']('─'[_0x1e3670(0x1b3)](0x3c));if(_0x51ea3d[_0x1e3670(0x164)][_0x1e3670(0x169)]>0x0){console[_0x1e3670(0x19f)]('\x0a'+a21_0x112008['red'](_0x1e3670(0x1a5)));for(const _0x463a0b of _0x51ea3d[_0x1e3670(0x164)]){console[_0x1e3670(0x19f)]('\x20\x20'+a21_0x112008['red']('•')+'\x20'+_0x463a0b);}}_0x51ea3d[_0x1e3670(0x105)]&&console[_0x1e3670(0x19f)]('\x0a'+a21_0x112008[_0x1e3670(0x156)]('✔')+_0x1e3670(0xc5));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a21_0x3eafb8(0xf7)]=a21_0x3eafb8(0x151);[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0x11c);async['execute'](_0x2c7fe2){const _0x215100=a21_0x3eafb8,{options:_0x4f6a32,args:_0x1a2120,tdx:_0x16dd78}=_0x2c7fe2,_0x20b10b=_0x4f6a32,_0x531ca3=_0x1a2120[0x0]||_0x4f6a32[_0x215100(0x14e)];if(!_0x531ca3)return showParentSegmentNotSetError(_0x215100(0xd5)+_0x215100(0xa9)+_0x215100(0x13b)+_0x215100(0x127)+_0x215100(0x185)+_0x215100(0x10e)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x215100(0x16d)),0x1;if(!_0x20b10b[_0x215100(0x101)]&&!_0x20b10b[_0x215100(0x9e)]&&!_0x20b10b[_0x215100(0xb4)]&&!_0x20b10b[_0x215100(0xde)])return console['error'](a21_0x112008[_0x215100(0xa3)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error'](_0x215100(0xdc)),console[_0x215100(0x19f)](_0x215100(0xe5)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x215100(0x19f)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console['error'](_0x215100(0x1c8)),console[_0x215100(0x19f)](_0x215100(0xe2)),0x1;const _0x29be38=resolveYamlFile(_0x531ca3);if(!existsSync(_0x29be38))return showFileNotFoundError(_0x29be38,_0x531ca3),0x1;_0x20b10b['verbose']&&(console[_0x215100(0x19f)]('Site:\x20'+_0x20b10b[_0x215100(0x116)]),console[_0x215100(0x19f)](_0x215100(0x10b)+_0x29be38));let _0x1acaa1;try{_0x1acaa1=readFileSync(_0x29be38,_0x215100(0x112));}catch(_0x5c3d99){const _0x4b064f=_0x5c3d99 instanceof Error?_0x5c3d99[_0x215100(0x1c7)]:String(_0x5c3d99);return console[_0x215100(0x19f)]('Error\x20reading\x20file:\x20'+_0x4b064f),0x1;}let _0x6ad404;try{_0x6ad404=parseDef(_0x1acaa1);}catch(_0x20305a){const _0x7b07a=_0x20305a instanceof Error?_0x20305a['message']:String(_0x20305a);return console[_0x215100(0x19f)](a21_0x112008[_0x215100(0xa3)]('Error\x20parsing\x20YAML:\x20'+_0x7b07a)),0x1;}if(_0x20b10b['attribute']===!![]||_0x20b10b[_0x215100(0x9e)]===''){const _0x318b38=_0x6ad404[_0x215100(0x139)]?.['map'](_0x1497c8=>_0x1497c8[_0x215100(0xf7)])||[];if(_0x318b38[_0x215100(0x169)]===0x0)console['error'](a21_0x112008[_0x215100(0xa3)](_0x215100(0xfd)));else{console[_0x215100(0x19f)](a21_0x112008[_0x215100(0xa3)](_0x215100(0x188))),console[_0x215100(0x19f)]('Available\x20attributes:');for(const _0x407f80 of _0x318b38){console[_0x215100(0x19f)]('\x20\x20'+a21_0x112008['cyan'](_0x407f80));}console[_0x215100(0x19f)](_0x215100(0x148)+_0x531ca3+_0x215100(0x18f)+_0x318b38[0x0]+'\x22');}return 0x1;}if(_0x20b10b[_0x215100(0xb4)]===!![]||_0x20b10b['behavior']===''){const _0x551f2c=_0x6ad404[_0x215100(0xbd)]?.[_0x215100(0x1b4)](_0xcb876b=>_0xcb876b[_0x215100(0xf7)])||[];if(_0x551f2c[_0x215100(0x169)]===0x0)console[_0x215100(0x19f)](a21_0x112008[_0x215100(0xa3)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x215100(0x19f)](a21_0x112008[_0x215100(0xa3)](_0x215100(0x192))),console[_0x215100(0x19f)](_0x215100(0x160));for(const _0x5eca6b of _0x551f2c){console['error']('\x20\x20'+a21_0x112008[_0x215100(0x18b)](_0x5eca6b));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x531ca3+_0x215100(0xb3)+_0x551f2c[0x0]+'\x22');}return 0x1;}const _0x196811=createCommandSpinner(a21_0x112008[_0x215100(0x145)]('Fetching\x20sample\x20data...'),{'verbose':_0x20b10b[_0x215100(0x100)]});_0x196811[_0x215100(0x1b1)]();const _0x4e2061={'onProgress':_0x563174=>{const _0x1e1665=_0x215100;_0x196811[_0x1e1665(0x14c)]=formatProgressMessage(_0x563174);}};if(_0x20b10b['master'])_0x4e2061['master']=!![];if(_0x20b10b[_0x215100(0x9e)]&&typeof _0x20b10b['attribute']===_0x215100(0x137))_0x4e2061[_0x215100(0x9e)]=_0x20b10b[_0x215100(0x9e)];if(_0x20b10b[_0x215100(0xb4)]&&typeof _0x20b10b['behavior']===_0x215100(0x137))_0x4e2061[_0x215100(0xb4)]=_0x20b10b[_0x215100(0xb4)];if(_0x20b10b['enriched'])_0x4e2061[_0x215100(0xde)]=!![];if(_0x20b10b[_0x215100(0x1c6)])_0x4e2061['interval']=_0x20b10b[_0x215100(0x1c6)];let _0x2d4d99;try{_0x2d4d99=await _0x16dd78[_0x215100(0x16b)][_0x215100(0x18d)](_0x1acaa1,_0x4e2061),_0x196811[_0x215100(0x119)]();}catch(_0x2f85c5){_0x196811['stop']();throw _0x2f85c5;}return await this[_0x215100(0x182)](_0x2d4d99,{'master':_0x20b10b[_0x215100(0x101)],'attribute':typeof _0x20b10b[_0x215100(0x9e)]==='string'?_0x20b10b[_0x215100(0x9e)]:undefined,'behavior':typeof _0x20b10b[_0x215100(0xb4)]===_0x215100(0x137)?_0x20b10b[_0x215100(0xb4)]:undefined,'enriched':_0x20b10b[_0x215100(0xde)]}),_0x2d4d99[_0x215100(0x105)]?0x0:0x1;}async[a21_0x3eafb8(0x182)](_0x282c3f,_0x854439){const _0x582653=a21_0x3eafb8;console['error']('\x0a'+a21_0x112008[_0x582653(0x17f)](_0x582653(0x12a))+'\x20'+_0x282c3f[_0x582653(0xf7)]),console['error']('═'['repeat'](0x3c));if(_0x854439['master']&&_0x282c3f[_0x582653(0xc0)]){const _0x56caa5=a21_0x112008[_0x582653(0x145)](_0x582653(0x194))+'\x20'+a21_0x112008[_0x582653(0x17f)](_0x282c3f[_0x582653(0x101)][_0x582653(0xf4)]+'.'+_0x282c3f[_0x582653(0x101)]['table']);await this[_0x582653(0x110)](_0x56caa5,_0x282c3f[_0x582653(0xc0)]);}else{if(_0x854439[_0x582653(0x9e)]&&_0x282c3f[_0x582653(0xc0)]){const _0x4dd5e2=a21_0x112008[_0x582653(0x145)](_0x582653(0xe0))+'\x20'+a21_0x112008[_0x582653(0x17f)](_0x854439[_0x582653(0x9e)]);await this[_0x582653(0x110)](_0x4dd5e2,_0x282c3f['sampleData']);}else{if(_0x854439[_0x582653(0xb4)]&&_0x282c3f[_0x582653(0xc0)]){const _0x387ef9=a21_0x112008[_0x582653(0x145)](_0x582653(0xab))+'\x20'+a21_0x112008[_0x582653(0x17f)](_0x854439[_0x582653(0xb4)]);await this[_0x582653(0x110)](_0x387ef9,_0x282c3f['sampleData']);}else{if(_0x854439['enriched']&&_0x282c3f['sampleData']){const _0x8a2d37=a21_0x112008[_0x582653(0x145)](_0x582653(0x140))+'\x20'+a21_0x112008[_0x582653(0x17f)](_0x582653(0xd8));await this[_0x582653(0x110)](_0x8a2d37,_0x282c3f[_0x582653(0xc0)]);}else!_0x282c3f['sampleData']&&console[_0x582653(0x19f)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x282c3f[_0x582653(0x164)]['length']>0x0){console[_0x582653(0x19f)]('─'[_0x582653(0x1b3)](0x3c)),console[_0x582653(0x19f)]('\x0a'+a21_0x112008[_0x582653(0xa3)]('Errors:'));for(const _0x3388f2 of _0x282c3f[_0x582653(0x164)]){console['error']('\x20\x20'+a21_0x112008[_0x582653(0xa3)]('•')+'\x20'+_0x3388f2);}}}async[a21_0x3eafb8(0x110)](_0x2179ae,_0x4bf9df){const _0x23a12b=a21_0x3eafb8;if(_0x4bf9df[_0x23a12b(0x169)]===0x0){console['error']('\x0a'+_0x2179ae),console[_0x23a12b(0x19f)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x23a12b(0x19f)]('\x0a'+_0x2179ae);const _0xdc7c5e=Object[_0x23a12b(0x16e)](_0x4bf9df[0x0])[_0x23a12b(0x1b4)](_0x3c80d8=>({'name':_0x3c80d8,'type':typeof _0x4bf9df[0x0][_0x3c80d8]==='number'?_0x23a12b(0xc8):_0x23a12b(0x157)})),_0x512a32={'queryId':_0x23a12b(0x166),'columns':_0xdc7c5e,'data':_0x4bf9df,'stats':{'state':_0x23a12b(0xf8),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4bf9df[_0x23a12b(0x169)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x81d11e=formatAsTable(_0x512a32,_0x4bf9df[_0x23a12b(0x169)],!![]);await writeOutput(_0x81d11e,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a21_0x3eafb8(0xf7)]=a21_0x3eafb8(0xb8);[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0x174);async[a21_0x3eafb8(0x118)](_0x230033){const _0x2bfaf4=a21_0x3eafb8,{options:_0x231bbf,args:_0x4e0de9,tdx:_0xea9bad}=_0x230033,_0x23b5fa=_0x231bbf,_0x28efdf=_0x4e0de9[0x0]||_0x231bbf['parentSegment'];if(!_0x28efdf)return showParentSegmentNotSetError(_0x2bfaf4(0x159)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x312459=resolveYamlFile(_0x28efdf);if(existsSync(_0x312459)){_0x23b5fa[_0x2bfaf4(0x100)]&&console['error'](_0x2bfaf4(0x12c)+_0x312459);let _0x111ca0;try{_0x111ca0=readFileSync(_0x312459,_0x2bfaf4(0x112));}catch(_0x25aadb){const _0x5badbc=_0x25aadb instanceof Error?_0x25aadb[_0x2bfaf4(0x1c7)]:String(_0x25aadb);return console[_0x2bfaf4(0x19f)]('Error\x20reading\x20file:\x20'+_0x5badbc),0x1;}const _0x2fbedf=await withSpinner('Analyzing\x20changes...',()=>_0xea9bad['segment'][_0x2bfaf4(0xff)](_0x111ca0),{'verbose':_0x23b5fa['verbose']}),_0x2c166e=_0x2fbedf[_0x2bfaf4(0x1ab)],{isNew:_0x42ae00,name:_0x28c699,hasChanges:_0x4e7f5e,diffFormatted:_0x3408df}=_0x2c166e;if(_0x4e7f5e){_0x42ae00?console[_0x2bfaf4(0x19f)](_0x2bfaf4(0xe9)+_0x28c699+'\x27:'):console['error'](_0x2bfaf4(0x1ad)+_0x28c699+'\x27:');console[_0x2bfaf4(0x19f)]('─'[_0x2bfaf4(0x1b3)](0x3c)),console['error'](_0x3408df),console['error']('─'[_0x2bfaf4(0x1b3)](0x3c));const _0x2e7f9e=_0x42ae00?_0x2bfaf4(0xf1)+_0x28c699+'\x27\x20and\x20run\x20workflow?':_0x2bfaf4(0x193)+_0x28c699+_0x2bfaf4(0x12e);if(!_0x23b5fa[_0x2bfaf4(0x1be)]){const _0x228c45=await confirmKey(_0x2e7f9e);if(!_0x228c45)return console[_0x2bfaf4(0x19f)](_0x2bfaf4(0xcb)),0x1;}const _0x31e934=_0x42ae00?'Creating':'Updating';await withSpinner(_0x31e934+_0x2bfaf4(0x128)+_0x28c699+'\x27...',()=>_0x2c166e['apply'](),{'verbose':_0x23b5fa[_0x2bfaf4(0x100)]});const _0xb1cd94=_0x42ae00?_0x2bfaf4(0x138):'Updated';console[_0x2bfaf4(0x19f)]('✔\x20'+_0xb1cd94+_0x2bfaf4(0x128)+_0x28c699+'\x27');}else console[_0x2bfaf4(0x19f)](_0x2bfaf4(0xb2)+_0x28c699+_0x2bfaf4(0x11a));}const _0x23ab63=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x28efdf+_0x2bfaf4(0x1a9),()=>_0xea9bad[_0x2bfaf4(0x16b)]['runParent'](_0x28efdf),{'verbose':_0x23b5fa['verbose']}),_0x3365ca=_0x23ab63['data'],_0xed8751=getConsoleUrl(_0x23b5fa[_0x2bfaf4(0x116)],_0x2bfaf4(0xfa)+_0x3365ca['workflowId']+_0x2bfaf4(0x1bc)+_0x3365ca['workflowSessionId']+_0x2bfaf4(0xcf)+_0x3365ca['workflowAttemptId']);return console[_0x2bfaf4(0x19f)](_0x2bfaf4(0xa0)),console[_0x2bfaf4(0x19f)]('\x20\x20'+a21_0x112008[_0x2bfaf4(0x145)](_0x2bfaf4(0xf6))+'\x20'+_0x3365ca[_0x2bfaf4(0x117)]),console['error']('\x20\x20'+a21_0x112008[_0x2bfaf4(0x145)](_0x2bfaf4(0x10a))+'\x20'+_0x3365ca[_0x2bfaf4(0xfb)]),console[_0x2bfaf4(0x19f)]('\x20\x20'+a21_0x112008[_0x2bfaf4(0x145)]('Session:')+'\x20'+_0x3365ca[_0x2bfaf4(0x162)]),console[_0x2bfaf4(0x19f)]('\x20\x20'+a21_0x112008[_0x2bfaf4(0x145)](_0x2bfaf4(0x14b))+'\x20'+_0x3365ca[_0x2bfaf4(0x10d)]),console[_0x2bfaf4(0x19f)]('\x20\x20'+_0xed8751),console['error']('\x0a'+a21_0x112008[_0x2bfaf4(0x145)](_0x2bfaf4(0x153))+_0x2bfaf4(0xa2)+_0x3365ca[_0x2bfaf4(0x10d)]+_0x2bfaf4(0x18c)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a21_0x3eafb8(0xf7)]=a21_0x3eafb8(0xba);[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0x1c3);async[a21_0x3eafb8(0x118)](_0x43c48b){const _0x178d69=a21_0x3eafb8,{options:_0xebf05,args:_0x1d741b,tdx:_0x2f8228}=_0x43c48b,_0x20b60d=_0x1d741b[0x0]||_0xebf05['parentSegment'];if(!_0x20b60d)return showParentSegmentNotSetError(_0x178d69(0xb6)+_0x178d69(0xec)),0x1;_0xebf05['verbose']&&(console['error'](_0x178d69(0x15f)+_0xebf05['site']),console[_0x178d69(0x19f)](_0x178d69(0x152)+_0x20b60d));const _0xdce3c2=await withSpinner(_0x178d69(0x143)+_0x20b60d+'\x27...',()=>_0x2f8228[_0x178d69(0x16b)][_0x178d69(0x163)](_0x20b60d),{'verbose':_0xebf05[_0x178d69(0x100)]}),_0x1442c9=_0xdce3c2[_0x178d69(0x1ab)];console[_0x178d69(0x19f)](_0x178d69(0x198)+_0x1442c9[_0x178d69(0x169)]+'\x20field'+(_0x1442c9[_0x178d69(0x169)]!==0x1?'s':''));if(_0xebf05[_0x178d69(0xc6)]||_0xebf05[_0x178d69(0xad)])return await handleSDKOutput(_0x1442c9,_0xebf05),0x0;return displayFieldsHumanReadable(_0x1442c9,_0x20b60d),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a21_0x3eafb8(0xf7)]=a21_0x3eafb8(0xe8);[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0x1c1);async[a21_0x3eafb8(0x118)](_0x13ce4d){const _0x5212da=a21_0x3eafb8,{options:_0x24da79,args:_0x5cbdce,tdx:_0x57fec0}=_0x13ce4d,_0x21d544=_0x24da79,_0x26b1cf=_0x5cbdce[0x0]||_0x24da79[_0x5212da(0x14e)];if(!_0x26b1cf)return showParentSegmentNotSetError(_0x5212da(0x15a)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x5212da(0x114)+_0x5212da(0x1c9)),0x1;_0x24da79[_0x5212da(0x100)]&&(console[_0x5212da(0x19f)](_0x5212da(0x15f)+_0x24da79[_0x5212da(0x116)]),console[_0x5212da(0x19f)](_0x5212da(0x152)+_0x26b1cf));const _0x4e2169=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x26b1cf+'\x27...',()=>_0x57fec0[_0x5212da(0x16b)][_0x5212da(0x107)](_0x26b1cf),{'verbose':_0x24da79[_0x5212da(0x100)]}),_0x5a7399=_0x4e2169['data'];if(_0x21d544[_0x5212da(0x11b)]){const _0x4e783b=getConsoleNextUrl(_0x21d544[_0x5212da(0x116)],_0x5212da(0x1bd)+_0x5a7399['id']);return console[_0x5212da(0x19f)](a21_0x112008[_0x5212da(0x156)]('✔')+_0x5212da(0x124)+a21_0x112008[_0x5212da(0x18b)](_0x4e783b)),openBrowser(_0x4e783b),0x0;}return await handleSingleObjectOutput(_0x5a7399,_0x24da79),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a21_0x3eafb8(0xf7)]=a21_0x3eafb8(0xf3);[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0x154);async[a21_0x3eafb8(0x118)](_0x5cfbac){const _0x16f502=a21_0x3eafb8,{options:_0x3ca526,args:_0x128ddd,tdx:_0x48e414}=_0x5cfbac,_0x13f9ec=_0x128ddd[0x0]||_0x3ca526[_0x16f502(0x14e)];if(!_0x13f9ec)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+_0x16f502(0x16f)),0x1;_0x3ca526['verbose']&&(console['error'](_0x16f502(0x15f)+_0x3ca526[_0x16f502(0x116)]),console[_0x16f502(0x19f)](_0x16f502(0x152)+_0x13f9ec));const _0x269479=await withSpinner(_0x16f502(0x13f)+_0x13f9ec+_0x16f502(0x1a9),()=>_0x48e414[_0x16f502(0x16b)][_0x16f502(0x15c)](_0x13f9ec),{'verbose':_0x3ca526[_0x16f502(0x100)]}),_0x593f2c=_0x269479['data'],_0x3ca999=await withSpinner(_0x16f502(0x190)+_0x13f9ec+'\x27...',()=>_0x48e414[_0x16f502(0x16b)][_0x16f502(0x108)](_0x593f2c),{'verbose':_0x3ca526[_0x16f502(0x100)]}),_0x2282cc=await executeSchemaQuery(_0x3ca999[_0x16f502(0x1ab)],_0x48e414,_0x3ca526);return await handleQueryOutput(_0x2282cc,_0x3ca526),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']='segment:parent:sql';[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0xd1);async[a21_0x3eafb8(0x118)](_0x1a4e4c){const _0x15d8b9=a21_0x3eafb8,{options:_0x35b87b,args:_0x4cbb10,tdx:_0x37f0ac}=_0x1a4e4c,_0x1eb22a=_0x4cbb10[0x0]||_0x35b87b[_0x15d8b9(0x14e)];if(!_0x1eb22a)return showParentSegmentNotSetError(_0x15d8b9(0x1a6)+_0x15d8b9(0x186)),0x1;_0x35b87b[_0x15d8b9(0x100)]&&(console[_0x15d8b9(0x19f)]('Site:\x20'+_0x35b87b['site']),console[_0x15d8b9(0x19f)](_0x15d8b9(0x152)+_0x1eb22a));const _0x54fea4=await withSpinner(_0x15d8b9(0x13f)+_0x1eb22a+_0x15d8b9(0x1a9),()=>_0x37f0ac[_0x15d8b9(0x16b)]['resolveParentId'](_0x1eb22a),{'verbose':_0x35b87b[_0x15d8b9(0x100)]}),_0x34b913=_0x54fea4[_0x15d8b9(0x1ab)],_0x3be095=await withSpinner(_0x15d8b9(0x190)+_0x1eb22a+_0x15d8b9(0x1a9),()=>_0x37f0ac[_0x15d8b9(0x16b)][_0x15d8b9(0x108)](_0x34b913),{'verbose':_0x35b87b['verbose']}),_0x28ee05=_0x3be095[_0x15d8b9(0x1ab)];return _0x35b87b[_0x15d8b9(0xf0)]===_0x15d8b9(0xc6)||_0x35b87b['format']===_0x15d8b9(0xad)?await handleSDKOutput([{'sql':_0x28ee05}],_0x35b87b):console[_0x15d8b9(0x167)](_0x28ee05),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a21_0x3eafb8(0x13c);[a21_0x3eafb8(0x17a)]=a21_0x3eafb8(0x176);async[a21_0x3eafb8(0x118)](_0x242f00){const _0x49aa64=a21_0x3eafb8,{options:_0x3ca6ea,args:_0x123f71,tdx:_0x571a7a}=_0x242f00,_0x866b40=_0x123f71[0x0]||_0x3ca6ea['parentSegment'];if(!_0x866b40)return showParentSegmentNotSetError(_0x49aa64(0x16c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x3ca6ea['verbose']&&(console['error'](_0x49aa64(0x15f)+_0x3ca6ea['site']),console[_0x49aa64(0x19f)](_0x49aa64(0x152)+_0x866b40));const _0x173cef=await withSpinner(_0x49aa64(0x13f)+_0x866b40+_0x49aa64(0x1a9),()=>_0x571a7a[_0x49aa64(0x16b)][_0x49aa64(0x15c)](_0x866b40),{'verbose':_0x3ca6ea[_0x49aa64(0x100)]}),_0x504b5e=_0x173cef[_0x49aa64(0x1ab)],_0x59552a=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x866b40+_0x49aa64(0x1a9),()=>_0x571a7a[_0x49aa64(0x16b)][_0x49aa64(0x108)](_0x504b5e),{'verbose':_0x3ca6ea[_0x49aa64(0x100)]});let _0x1f5b77=_0x59552a['data'];const _0x4d35af=resolveLimit(_0x3ca6ea[_0x49aa64(0xc2)],DEFAULT_DISPLAY_LIMIT),_0x5e0de3=/\bLIMIT\s+\d+/i[_0x49aa64(0x9d)](_0x1f5b77);!_0x5e0de3&&(_0x1f5b77=_0x1f5b77[_0x49aa64(0x113)]()[_0x49aa64(0xbe)](/;+$/,''),_0x1f5b77=_0x49aa64(0x1bf)+_0x1f5b77+_0x49aa64(0xac)+_0x4d35af);_0x3ca6ea[_0x49aa64(0x100)]&&console[_0x49aa64(0x19f)](_0x49aa64(0x12d)+_0x1f5b77);const _0xd76359=await withProgressSpinner(_0x49aa64(0xb9),async _0x3c76a2=>{const _0x570989=_0x49aa64,_0x28b9d9=await _0x571a7a[_0x570989(0x1a8)][_0x570989(0x118)](_0x1f5b77,{'catalog':'td','schema':_0x570989(0xa5),'onJobId':_0x4e06a4=>{const _0x3ea82f=_0x570989;_0x3c76a2[_0x3ea82f(0x171)](_0x4e06a4);}});return _0x28b9d9;},{'verbose':_0x3ca6ea[_0x49aa64(0x100)]}),_0x2aca00=_0xd76359[_0x49aa64(0x1ab)],_0xd59d93=_0x2aca00[_0x49aa64(0x19d)]?_0x49aa64(0xbb)+_0x2aca00[_0x49aa64(0x19d)]+']':'';return console['error'](_0x49aa64(0xbf)+_0x2aca00[_0x49aa64(0x141)][_0x49aa64(0x104)][_0x49aa64(0xc4)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x2aca00[_0x49aa64(0x141)][_0x49aa64(0xb5)])+_0xd59d93)),await handleQueryOutput(_0x2aca00,_0x3ca6ea),0x0;}}
|
|
@@ -37,7 +37,7 @@ export declare class ProfileSetCommand extends BaseCommand {
|
|
|
37
37
|
execute(context: CommandContext): Promise<number>;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Profile use command - Set session profile
|
|
40
|
+
* Profile use command - Set session profile or global default profile
|
|
41
41
|
* Same as 'tdx use profile <name>' but more discoverable
|
|
42
42
|
*/
|
|
43
43
|
export declare class ProfileUseCommand extends BaseCommand {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-command.d.ts","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"profile-command.d.ts","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AA6ChF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,0BAA0B;IAExC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgLxD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,sBAAsB;IAE1C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAQzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAwDxD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,uCAAuC;IAG3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAqF;IAEvH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IA0BzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAkGxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,yBAAyB;IAE7C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAQzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2CxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0xa81a40=a22_0x36f4;(function(_0x284c76,_0x349d4f){const _0x1655d7=a22_0x36f4,_0x2cdc31=_0x284c76();while(!![]){try{const _0x141b3f=parseInt(_0x1655d7(0x138))/0x1*(parseInt(_0x1655d7(0x122))/0x2)+-parseInt(_0x1655d7(0x158))/0x3+parseInt(_0x1655d7(0x154))/0x4+parseInt(_0x1655d7(0x160))/0x5*(parseInt(_0x1655d7(0x11b))/0x6)+-parseInt(_0x1655d7(0x149))/0x7*(-parseInt(_0x1655d7(0x153))/0x8)+-parseInt(_0x1655d7(0x166))/0x9*(parseInt(_0x1655d7(0x180))/0xa)+-parseInt(_0x1655d7(0x174))/0xb;if(_0x141b3f===_0x349d4f)break;else _0x2cdc31['push'](_0x2cdc31['shift']());}catch(_0x408443){_0x2cdc31['push'](_0x2cdc31['shift']());}}}(a22_0x4434,0xed5ad));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile}from'../core/profile.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a22_0x4434(){const _0x4693c5=['getUserInfo','message','\x20\x20tdx\x20--profile\x20','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','Profile\x20\x27','jobs','tdx:\x20profile\x20remove','95744NFzPvk','4118484fzaQcJ','findIndex','red','ap02\x20-\x20Korea','2025435HIlYhB','profile:set','text','other','warn','Validating\x20API\x20key...','profile:use','green','525obOUVQ','create','tdx:\x20profile\x20set','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','profileName','parent_segment','9pUjlTV','\x20\x20(no\x20profiles\x20found)','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Site\x20was\x20not\x20changed.','select','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x20\x20-\x20','config','\x20API\x20key\x20is\x20valid\x20(User:\x20','Operation\x20cancelled','Set\x20session\x20profile','profile:remove','execute','test','8511030mjVcgZ','\x27\x20removed\x20from\x20configuration','logLevel','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>','description','Session\x20profile\x20set\x20to:\x20','✗\x20Validation\x20failed:\x20','API\x20key\x20cannot\x20be\x20empty','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','name','error','\x27.\x0a\x0aValid\x20keys:\x20','10715310xfFMrF','length','status','Changing\x20site\x20to\x20\x27','join','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','email','profile','us\x20\x20\x20-\x20United\x20States','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Removal\x20cancelled','\x27\x20updated:\x20','tdx:\x20profile\x20create','\x27\x20created','\x27\x20requires\x20API\x20key\x20validation.','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','39654LTAmUz','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20Profile\x20\x27','profile:create','Enter\x20profile\x20name:','site','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','276770LhsTaA','ap02','session','dim','customSite','(session:\x20','\x0aOperation\x20cancelled','Enter\x20description\x20(optional):','bold','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','\x20API\x20key\x20removed\x20from\x20system\x20keychain','apiKey','jp\x20\x20\x20-\x20Japan','push','Set\x20a\x20profile\x20configuration\x20value','yellow','\x0aAvailable\x20profiles:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','log','validate','Remove\x20a\x20profile','\x27\x20does\x20not\x20exist.\x20Create\x20it?','5DekWAe','Profile\x20name\x20cannot\x20be\x20empty','split','eu01','includes','\x0aSetup\x20cancelled','confirm','Failed\x20to\x20remove\x20profile:\x20','database','us01','password','\x27\x20does\x20not\x20exist.','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','\x20API\x20key\x20saved\x20to\x20system\x20keychain','trim','VALID_KEYS','630jsEzrp','jp01','llm_project'];a22_0x4434=function(){return _0x4693c5;};return a22_0x4434();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a22_0x296651 from'prompts';import a22_0x373702 from'chalk';function validateProfileName(_0x1236a8){const _0x5cf86d=a22_0x36f4;if(!_0x1236a8||!_0x1236a8[_0x5cf86d(0x147)]())return _0x5cf86d(0x139);const _0x309d23=_0x1236a8[_0x5cf86d(0x147)]();if(!/^[a-zA-Z0-9_-]+$/[_0x5cf86d(0x173)](_0x309d23))return _0x5cf86d(0x17c);if(profileExists(_0x309d23))return'Profile\x20\x27'+_0x309d23+_0x5cf86d(0x18a);return!![];}export class ProfileCreateCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x11e);[a22_0xa81a40(0x178)]='Create\x20a\x20new\x20profile';async['execute'](_0x5a12ee){const _0x49bed3=a22_0xa81a40,{options:_0x1f3480,args:_0x37bd09}=_0x5a12ee;console['log'](a22_0x373702[_0x49bed3(0x12a)](_0x49bed3(0x18d)));let _0x2cba8a;if(_0x37bd09[_0x49bed3(0x181)]>0x0&&_0x37bd09[0x0]){const _0x310876=_0x37bd09[0x0][_0x49bed3(0x147)](),_0x59fddb=validateProfileName(_0x310876);if(_0x59fddb!==!![])return console[_0x49bed3(0x17e)](a22_0x373702[_0x49bed3(0x156)](_0x59fddb)),0x1;_0x2cba8a=_0x310876;}else{const _0x1191bb=await a22_0x296651({'type':_0x49bed3(0x15a),'name':'profileName','message':_0x49bed3(0x11f),'validate':validateProfileName});if(!_0x1191bb[_0x49bed3(0x164)])return console[_0x49bed3(0x134)]('\x0aSetup\x20cancelled'),0x1;_0x2cba8a=_0x1191bb[_0x49bed3(0x164)][_0x49bed3(0x147)]();}const _0x4bf864=await a22_0x296651({'type':_0x49bed3(0x15a),'name':_0x49bed3(0x178),'message':_0x49bed3(0x129)}),_0x587ec7=_0x4bf864[_0x49bed3(0x178)]?.[_0x49bed3(0x147)]()||undefined,_0x227cb0=_0x1f3480[_0x49bed3(0x120)]||_0x49bed3(0x141),_0x1772b7=[{'title':_0x49bed3(0x188),'value':_0x49bed3(0x141)},{'title':_0x49bed3(0x12e),'value':_0x49bed3(0x14a)},{'title':'eu\x20\x20\x20-\x20Europe','value':_0x49bed3(0x13b)},{'title':_0x49bed3(0x157),'value':_0x49bed3(0x123)}];let _0x8a4489=_0x1772b7[_0x49bed3(0x155)](_0x2c75a0=>_0x2c75a0['value']===_0x227cb0);_0x8a4489===-0x1&&_0x227cb0!==_0x49bed3(0x141)&&(_0x1772b7[_0x49bed3(0x12f)]({'title':_0x227cb0,'value':_0x227cb0}),_0x8a4489=_0x1772b7[_0x49bed3(0x181)]-0x1);_0x1772b7[_0x49bed3(0x12f)]({'title':'Enter\x20custom\x20site','value':_0x49bed3(0x15b)});const _0x2ed623=await a22_0x296651({'type':_0x49bed3(0x16a),'name':'site','message':_0x49bed3(0x189)+_0x2cba8a+'\x27:','choices':_0x1772b7,'initial':_0x8a4489>=0x0?_0x8a4489:0x0});if(!_0x2ed623[_0x49bed3(0x120)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x30dc61;if(_0x2ed623[_0x49bed3(0x120)]==='other'){const _0x23d131=await a22_0x296651({'type':_0x49bed3(0x15a),'name':_0x49bed3(0x126),'message':'Enter\x20site\x20name:','initial':_0x49bed3(0x141),'validate':_0x44f806=>{const _0x518b20=_0x49bed3;if(!_0x44f806||!_0x44f806[_0x518b20(0x147)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x518b20(0x173)](_0x44f806[_0x518b20(0x147)]()))return _0x518b20(0x144);return!![];}});if(!_0x23d131[_0x49bed3(0x126)])return console[_0x49bed3(0x134)](_0x49bed3(0x13d)),0x1;_0x30dc61=_0x23d131[_0x49bed3(0x126)];}else _0x30dc61=_0x2ed623[_0x49bed3(0x120)];const _0x1e4ba2=resolveSite(_0x30dc61);console[_0x49bed3(0x134)](_0x49bed3(0x168)+_0x1e4ba2),console[_0x49bed3(0x134)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x49bed3(0x134)]('\x20\x20'+getConsoleUrl(_0x1e4ba2,'/app/mp/ak'));const _0x386a41=await a22_0x296651({'type':_0x49bed3(0x142),'name':_0x49bed3(0x12d),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x38f196=>{const _0x3840d2=_0x49bed3;if(!_0x38f196||!_0x38f196[_0x3840d2(0x147)]())return _0x3840d2(0x17b);return!![];}});if(!_0x386a41[_0x49bed3(0x12d)])return console[_0x49bed3(0x134)](_0x49bed3(0x13d)),0x1;const _0xe44cea=_0x386a41[_0x49bed3(0x12d)];console[_0x49bed3(0x134)](_0x49bed3(0x15d));try{const _0x237661=TDX['create']({'site':_0x1e4ba2,'apiKey':_0xe44cea[_0x49bed3(0x147)](),'logLevel':_0x1f3480['logLevel']??LogLevel['ERROR']}),_0x1e6365=await _0x237661['jobs'][_0x49bed3(0x14c)]();console[_0x49bed3(0x134)](a22_0x373702[_0x49bed3(0x15f)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1e6365[_0x49bed3(0x186)]+')');const _0x16a892=await isKeychainAvailable();_0x16a892?(await saveAPIKeyAsync(_0xe44cea[_0x49bed3(0x147)](),_0x1e4ba2,_0x2cba8a),console[_0x49bed3(0x134)](a22_0x373702['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x2cba8a+')')):(console[_0x49bed3(0x15c)](a22_0x373702['yellow'](_0x49bed3(0x133))),console[_0x49bed3(0x15c)](a22_0x373702[_0x49bed3(0x131)](_0x49bed3(0x163))));const _0xe2aa7a={'site':_0x1e4ba2,..._0x587ec7&&{'description':_0x587ec7}};return saveProfileToUserConfig(_0x2cba8a,_0xe2aa7a),console[_0x49bed3(0x134)](a22_0x373702[_0x49bed3(0x15f)]('✓')+_0x49bed3(0x11d)+_0x2cba8a+_0x49bed3(0x18e)),console['log'](),console[_0x49bed3(0x134)](_0x49bed3(0x12b)),console[_0x49bed3(0x134)](_0x49bed3(0x14e)+_0x2cba8a+_0x49bed3(0x11c)),console[_0x49bed3(0x134)](_0x49bed3(0x14e)+_0x2cba8a+_0x49bed3(0x121)),0x0;}catch(_0x3106ef){if(_0x3106ef instanceof HTTPClientError&&_0x3106ef[_0x49bed3(0x182)]===0x191)return printAuthError(_0x3106ef),0x1;return console['error'](a22_0x373702['red'](_0x49bed3(0x17a)+(_0x3106ef instanceof Error?_0x3106ef[_0x49bed3(0x14d)]:String(_0x3106ef)))),console[_0x49bed3(0x17e)](_0x49bed3(0x145)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x171);['description']=a22_0xa81a40(0x136);['validate'](_0x54de16){const _0x43fc63=a22_0xa81a40,{args:_0x410fbe}=_0x54de16;if(_0x410fbe['length']===0x0)return _0x43fc63(0x14f);return undefined;}async[a22_0xa81a40(0x172)](_0x270824){const _0x14f7fd=a22_0xa81a40,{args:_0x3e6436}=_0x270824,_0x31932f=_0x3e6436[0x0];console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x12a)](_0x14f7fd(0x152)));if(!profileExists(_0x31932f)){console['error'](a22_0x373702[_0x14f7fd(0x156)](_0x14f7fd(0x150)+_0x31932f+_0x14f7fd(0x143))),console[_0x14f7fd(0x134)](_0x14f7fd(0x132));const _0x28f0f2=listProfiles();if(_0x28f0f2[_0x14f7fd(0x181)]===0x0)console[_0x14f7fd(0x134)](_0x14f7fd(0x167));else for(const _0x1af2f3 of _0x28f0f2){console['log'](_0x14f7fd(0x16c)+_0x1af2f3[_0x14f7fd(0x17d)]);}return 0x1;}const _0x42b51b=await a22_0x296651({'type':_0x14f7fd(0x13e),'name':_0x14f7fd(0x13e),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x31932f+'\x27?','initial':![]});if(!_0x42b51b[_0x14f7fd(0x13e)])return console[_0x14f7fd(0x134)](_0x14f7fd(0x18b)),0x0;try{removeProfileFromUserConfig(_0x31932f),console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x15f)]('✓')+_0x14f7fd(0x11d)+_0x31932f+_0x14f7fd(0x175));}catch(_0xda011){return console[_0x14f7fd(0x17e)](a22_0x373702[_0x14f7fd(0x156)](_0x14f7fd(0x13f)+(_0xda011 instanceof Error?_0xda011[_0x14f7fd(0x14d)]:String(_0xda011)))),0x1;}const _0x1af25f=await isKeychainAvailable();if(_0x1af25f){const _0x18fc3c=await deleteKeychainAPIKey(_0x31932f);_0x18fc3c&&console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x15f)]('✓')+_0x14f7fd(0x12c));}return 0x0;}}function a22_0x36f4(_0x479ed1,_0x42ff23){_0x479ed1=_0x479ed1-0x119;const _0x443484=a22_0x4434();let _0x36f42f=_0x443484[_0x479ed1];return _0x36f42f;}export class ProfileSetCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x159);['description']=a22_0xa81a40(0x130);static [a22_0xa81a40(0x148)]=['site',a22_0xa81a40(0x140),a22_0xa81a40(0x165),a22_0xa81a40(0x14b),'llm_agent',a22_0xa81a40(0x178)];[a22_0xa81a40(0x135)](_0x84efb7){const _0x35d5bf=a22_0xa81a40,{args:_0x189964,options:_0x1b78be}=_0x84efb7,_0x13b27b=_0x1b78be[_0x35d5bf(0x187)]||getActiveProfile();if(!_0x13b27b)return _0x35d5bf(0x11a);if(_0x189964[_0x35d5bf(0x181)]===0x0)return _0x35d5bf(0x16b)+ProfileSetCommand['VALID_KEYS'][_0x35d5bf(0x184)](',\x20');const _0x392c30=_0x189964[0x0];if(!_0x392c30[_0x35d5bf(0x13c)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand['VALID_KEYS'][_0x35d5bf(0x184)](',\x20');const [_0x124bba]=_0x392c30['split']('=',0x2);if(!ProfileSetCommand[_0x35d5bf(0x148)]['includes'](_0x124bba))return'Unknown\x20key\x20\x27'+_0x124bba+_0x35d5bf(0x17f)+ProfileSetCommand[_0x35d5bf(0x148)][_0x35d5bf(0x184)](',\x20');return undefined;}async[a22_0xa81a40(0x172)](_0x4a967c){const _0x2a7b37=a22_0xa81a40,{args:_0x3c9841,options:_0x53b344}=_0x4a967c,_0x492498=_0x53b344[_0x2a7b37(0x187)]||getActiveProfile(),[_0x23aaba,..._0x19742c]=_0x3c9841[0x0][_0x2a7b37(0x13a)]('='),_0x6072c9=_0x19742c[_0x2a7b37(0x184)]('=');console['log'](a22_0x373702[_0x2a7b37(0x12a)](_0x2a7b37(0x162)));if(!profileExists(_0x492498)){const _0x16cf56=await a22_0x296651({'type':'confirm','name':_0x2a7b37(0x161),'message':_0x2a7b37(0x150)+_0x492498+_0x2a7b37(0x137),'initial':!![]});if(!_0x16cf56[_0x2a7b37(0x161)])return console[_0x2a7b37(0x134)](_0x2a7b37(0x16f)),0x1;}const _0x2f0c80=loadProfile(_0x492498),_0x51be3d=_0x2f0c80?.[_0x2a7b37(0x16d)]||{};if(_0x23aaba===_0x2a7b37(0x120)){const _0x392b97=resolveSite(_0x6072c9);console['log'](_0x2a7b37(0x183)+_0x392b97+_0x2a7b37(0x119)),console['log'](_0x2a7b37(0x185)),console[_0x2a7b37(0x134)]('\x20\x20'+getConsoleUrl(_0x392b97,'/app/mp/ak'));const _0x5674c5=await a22_0x296651({'type':_0x2a7b37(0x142),'name':_0x2a7b37(0x12d),'message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x4cebf4=>{const _0x5e1452=_0x2a7b37;if(!_0x4cebf4||!_0x4cebf4[_0x5e1452(0x147)]())return _0x5e1452(0x17b);return!![];}});if(!_0x5674c5[_0x2a7b37(0x12d)])return console[_0x2a7b37(0x134)](_0x2a7b37(0x128)),0x1;console['log'](_0x2a7b37(0x15d));try{const _0x3a0037=TDX[_0x2a7b37(0x161)]({'site':_0x392b97,'apiKey':_0x5674c5[_0x2a7b37(0x12d)]['trim'](),'logLevel':_0x53b344[_0x2a7b37(0x176)]??LogLevel['ERROR']}),_0x1d6270=await _0x3a0037[_0x2a7b37(0x151)][_0x2a7b37(0x14c)]();console[_0x2a7b37(0x134)](a22_0x373702[_0x2a7b37(0x15f)]('✓')+_0x2a7b37(0x16e)+_0x1d6270['email']+')');const _0x1181ad=await isKeychainAvailable();_0x1181ad?(await saveAPIKeyAsync(_0x5674c5[_0x2a7b37(0x12d)][_0x2a7b37(0x147)](),_0x392b97,_0x492498),console['log'](a22_0x373702['green']('✓')+_0x2a7b37(0x146))):console['warn'](a22_0x373702[_0x2a7b37(0x131)](_0x2a7b37(0x133))),_0x51be3d[_0x2a7b37(0x120)]=_0x392b97;}catch(_0x21f89a){if(_0x21f89a instanceof HTTPClientError&&_0x21f89a[_0x2a7b37(0x182)]===0x191)return printAuthError(_0x21f89a),0x1;return console[_0x2a7b37(0x17e)](a22_0x373702[_0x2a7b37(0x156)](_0x2a7b37(0x17a)+(_0x21f89a instanceof Error?_0x21f89a[_0x2a7b37(0x14d)]:String(_0x21f89a)))),console[_0x2a7b37(0x17e)](_0x2a7b37(0x169)),0x1;}}else _0x51be3d[_0x23aaba]=_0x6072c9||undefined;return saveProfileToUserConfig(_0x492498,_0x51be3d),console['log'](a22_0x373702[_0x2a7b37(0x15f)]('✓')+_0x2a7b37(0x11d)+_0x492498+_0x2a7b37(0x18c)+_0x23aaba+'='+(_0x6072c9||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a22_0xa81a40(0x15e);[a22_0xa81a40(0x178)]=a22_0xa81a40(0x170);[a22_0xa81a40(0x135)](_0x13797b){const _0x252ca3=a22_0xa81a40,{args:_0x494ee6}=_0x13797b;if(_0x494ee6[_0x252ca3(0x181)]===0x0)return _0x252ca3(0x177);return undefined;}async[a22_0xa81a40(0x172)](_0x13c5b7){const _0x220dc5=a22_0xa81a40,{args:_0x2e4d80,options:_0x117dd}=_0x13c5b7,_0x2a1647=_0x2e4d80[0x0];cleanExpiredSessions();if(!profileExists(_0x2a1647)){console['error'](a22_0x373702[_0x220dc5(0x156)](_0x220dc5(0x150)+_0x2a1647+_0x220dc5(0x143))),console[_0x220dc5(0x134)]('\x0aAvailable\x20profiles:');const _0x245bee=listProfiles();if(_0x245bee['length']===0x0)console[_0x220dc5(0x134)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x509b3e of _0x245bee){console[_0x220dc5(0x134)](_0x220dc5(0x16c)+_0x509b3e[_0x220dc5(0x17d)]);}return 0x1;}const _0x470e3d=_0x117dd[_0x220dc5(0x124)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x2a1647},_0x117dd['session']),console['log'](_0x220dc5(0x179)+a22_0x373702[_0x220dc5(0x15f)](_0x2a1647)+'\x20'+a22_0x373702[_0x220dc5(0x125)](_0x220dc5(0x127)+_0x470e3d+')')),console['log'](a22_0x373702[_0x220dc5(0x125)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}}
|
|
1
|
+
const a22_0x159ae9=a22_0x2272;(function(_0x5562c1,_0x41cb6a){const _0x293faa=a22_0x2272,_0x5db3c0=_0x5562c1();while(!![]){try{const _0x2405d0=-parseInt(_0x293faa(0xd7))/0x1+-parseInt(_0x293faa(0xd9))/0x2*(-parseInt(_0x293faa(0xf9))/0x3)+-parseInt(_0x293faa(0xf6))/0x4+parseInt(_0x293faa(0xdd))/0x5+-parseInt(_0x293faa(0xea))/0x6+-parseInt(_0x293faa(0x123))/0x7*(parseInt(_0x293faa(0xc9))/0x8)+parseInt(_0x293faa(0x10c))/0x9;if(_0x2405d0===_0x41cb6a)break;else _0x5db3c0['push'](_0x5db3c0['shift']());}catch(_0x122e68){_0x5db3c0['push'](_0x5db3c0['shift']());}}}(a22_0x819f,0x1f6dd));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a22_0x5c1b19 from'node:path';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a22_0x819f(){const _0xd1fe73=['push','tdx:\x20profile\x20set','parent_segment','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Operation\x20cancelled','status','Changing\x20site\x20to\x20\x27','config','Enter\x20site\x20name:','toString','3052134uBiBHN','yellow','Profile\x20\x27','trim','description','profile:create','test','You\x20can\x20find\x20your\x20API\x20key\x20at:','dim','findIndex','\x20API\x20key\x20removed\x20from\x20system\x20keychain','eu\x20\x20\x20-\x20Europe','ERROR','select','tdx:\x20profile\x20remove','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Session\x20profile\x20set\x20to:\x20','length','\x27\x20does\x20not\x20exist.','includes','name','profile:use','Remove\x20a\x20profile','7TyaGiE','Set\x20session\x20profile','\x20--default\x27\x20to\x20save\x20permanently','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','email','\x20API\x20key\x20saved\x20to\x20system\x20keychain','llm_project','jobs','error','Enter\x20description\x20(optional):','API\x20key\x20cannot\x20be\x20empty','validate','Set\x20a\x20profile\x20configuration\x20value','Enter\x20profile\x20name:','jp\x20\x20\x20-\x20Japan','(cleared)','profile:remove','\x0aOperation\x20cancelled','VALID_KEYS','Enter\x20custom\x20site','confirm','apiKey','\x0aSetup\x20cancelled','Site\x20name\x20cannot\x20be\x20empty','red','join','1117672TXOeTK','password','text','green','getUserInfo','Validating\x20API\x20key...','(session:\x20','tdx.json','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','create','Profile\x20name\x20cannot\x20be\x20empty','execute','tdx:\x20profile\x20create','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','144536wiOisj','site','2idrUCA','bold','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','warn','960815yuJmyr','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','\x0aAvailable\x20profiles:','Site\x20was\x20not\x20changed.','customSite','logLevel','profileName','default','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','/app/mp/ak','ap02','message','208428enBtmS','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Unknown\x20key\x20\x27','us01','✗\x20Validation\x20failed:\x20','\x20\x20(no\x20profiles\x20found)','log','\x20API\x20key\x20is\x20valid\x20(User:\x20','profile','split','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x27\x20requires\x20API\x20key\x20validation.','929592bjCDby','\x27\x20removed\x20from\x20configuration','llm_agent','446475kQjufo','\x27\x20does\x20not\x20exist.\x20Create\x20it?','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','\x20Profile\x20\x27','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','value','\x27\x20created','\x27\x20updated:\x20'];a22_0x819f=function(){return _0xd1fe73;};return a22_0x819f();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a22_0x68ba84 from'prompts';function a22_0x2272(_0x4197ba,_0x3987e5){_0x4197ba=_0x4197ba-0xb5;const _0x819f3=a22_0x819f();let _0x2272d8=_0x819f3[_0x4197ba];return _0x2272d8;}import a22_0x102c98 from'chalk';function validateProfileName(_0x30fffc){const _0x39a5a8=a22_0x2272;if(!_0x30fffc||!_0x30fffc[_0x39a5a8(0x10f)]())return _0x39a5a8(0xd3);const _0x3676d5=_0x30fffc[_0x39a5a8(0x10f)]();if(!/^[a-zA-Z0-9_-]+$/[_0x39a5a8(0x112)](_0x3676d5))return'Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore';if(profileExists(_0x3676d5))return _0x39a5a8(0x10e)+_0x3676d5+_0x39a5a8(0xfd);return!![];}export class ProfileCreateCommand extends BaseCommand{[a22_0x159ae9(0x120)]=a22_0x159ae9(0x111);[a22_0x159ae9(0x110)]='Create\x20a\x20new\x20profile';async['execute'](_0x5cc35a){const _0x564e02=a22_0x159ae9,{options:_0x1d4076,args:_0x2ec8f3}=_0x5cc35a;console[_0x564e02(0xf0)](a22_0x102c98[_0x564e02(0xda)](_0x564e02(0xd5)));let _0x2f63d4;if(_0x2ec8f3['length']>0x0&&_0x2ec8f3[0x0]){const _0x1e3b40=_0x2ec8f3[0x0][_0x564e02(0x10f)](),_0x8c72a=validateProfileName(_0x1e3b40);if(_0x8c72a!==!![])return console[_0x564e02(0xb7)](a22_0x102c98[_0x564e02(0xc7)](_0x8c72a)),0x1;_0x2f63d4=_0x1e3b40;}else{const _0x2d1297=await a22_0x68ba84({'type':'text','name':_0x564e02(0xe3),'message':_0x564e02(0xbc),'validate':validateProfileName});if(!_0x2d1297[_0x564e02(0xe3)])return console[_0x564e02(0xf0)](_0x564e02(0xc5)),0x1;_0x2f63d4=_0x2d1297['profileName'][_0x564e02(0x10f)]();}const _0x394b8f=await a22_0x68ba84({'type':_0x564e02(0xcb),'name':_0x564e02(0x110),'message':_0x564e02(0xb8)}),_0x338ec0=_0x394b8f['description']?.[_0x564e02(0x10f)]()||undefined,_0xcec6e4=_0x1d4076[_0x564e02(0xd8)]||_0x564e02(0xed),_0x32a1a4=[{'title':'us\x20\x20\x20-\x20United\x20States','value':_0x564e02(0xed)},{'title':_0x564e02(0xbd),'value':'jp01'},{'title':_0x564e02(0x117),'value':'eu01'},{'title':'ap02\x20-\x20Korea','value':_0x564e02(0xe8)}];let _0x347336=_0x32a1a4[_0x564e02(0x115)](_0x50d519=>_0x50d519[_0x564e02(0xfe)]===_0xcec6e4);_0x347336===-0x1&&_0xcec6e4!==_0x564e02(0xed)&&(_0x32a1a4[_0x564e02(0x101)]({'title':_0xcec6e4,'value':_0xcec6e4}),_0x347336=_0x32a1a4['length']-0x1);_0x32a1a4[_0x564e02(0x101)]({'title':_0x564e02(0xc2),'value':'other'});const _0x244c6c=await a22_0x68ba84({'type':_0x564e02(0x119),'name':_0x564e02(0xd8),'message':_0x564e02(0xe6)+_0x2f63d4+'\x27:','choices':_0x32a1a4,'initial':_0x347336>=0x0?_0x347336:0x0});if(!_0x244c6c['site'])return console[_0x564e02(0xf0)](_0x564e02(0xc5)),0x1;let _0x45bf94;if(_0x244c6c[_0x564e02(0xd8)]==='other'){const _0x5a2d6a=await a22_0x68ba84({'type':'text','name':_0x564e02(0xe1),'message':_0x564e02(0x10a),'initial':_0x564e02(0xed),'validate':_0x305a45=>{const _0x2fba74=_0x564e02;if(!_0x305a45||!_0x305a45[_0x2fba74(0x10f)]())return _0x2fba74(0xc6);if(!/^[a-z0-9-]+$/['test'](_0x305a45[_0x2fba74(0x10f)]()))return _0x2fba74(0x126);return!![];}});if(!_0x5a2d6a[_0x564e02(0xe1)])return console['log'](_0x564e02(0xc5)),0x1;_0x45bf94=_0x5a2d6a['customSite'];}else _0x45bf94=_0x244c6c[_0x564e02(0xd8)];const _0x373f59=resolveSite(_0x45bf94);console[_0x564e02(0xf0)](_0x564e02(0x105)+_0x373f59),console[_0x564e02(0xf0)](_0x564e02(0x113)),console['log']('\x20\x20'+getConsoleUrl(_0x373f59,_0x564e02(0xe7)));const _0x2cb10d=await a22_0x68ba84({'type':_0x564e02(0xca),'name':_0x564e02(0xc4),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x24d827=>{const _0x1a4ab6=_0x564e02;if(!_0x24d827||!_0x24d827[_0x1a4ab6(0x10f)]())return _0x1a4ab6(0xb9);return!![];}});if(!_0x2cb10d[_0x564e02(0xc4)])return console[_0x564e02(0xf0)]('\x0aSetup\x20cancelled'),0x1;const _0x54524c=_0x2cb10d[_0x564e02(0xc4)];console[_0x564e02(0xf0)](_0x564e02(0xce));try{const _0x1d773f=TDX[_0x564e02(0xd2)]({'site':_0x373f59,'apiKey':_0x54524c[_0x564e02(0x10f)](),'logLevel':_0x1d4076[_0x564e02(0xe2)]??LogLevel[_0x564e02(0x118)]}),_0x5b974d=await _0x1d773f[_0x564e02(0xb6)][_0x564e02(0xcd)]();console[_0x564e02(0xf0)](a22_0x102c98[_0x564e02(0xcc)]('✓')+_0x564e02(0xf1)+_0x5b974d[_0x564e02(0x127)]+')');const _0x5520fe=await isKeychainAvailable();_0x5520fe?(await saveAPIKeyAsync(_0x54524c[_0x564e02(0x10f)](),_0x373f59,_0x2f63d4),console[_0x564e02(0xf0)](a22_0x102c98[_0x564e02(0xcc)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x2f63d4+')')):(console[_0x564e02(0xdc)](a22_0x102c98[_0x564e02(0x10d)](_0x564e02(0xe5))),console[_0x564e02(0xdc)](a22_0x102c98['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x5554a2={'site':_0x373f59,..._0x338ec0&&{'description':_0x338ec0}};return saveProfileToUserConfig(_0x2f63d4,_0x5554a2),console[_0x564e02(0xf0)](a22_0x102c98[_0x564e02(0xcc)]('✓')+_0x564e02(0xfc)+_0x2f63d4+_0x564e02(0xff)),console[_0x564e02(0xf0)](),console[_0x564e02(0xf0)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x564e02(0xf0)]('\x20\x20tdx\x20--profile\x20'+_0x2f63d4+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log']('\x20\x20tdx\x20--profile\x20'+_0x2f63d4+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x40ea65){if(_0x40ea65 instanceof HTTPClientError&&_0x40ea65[_0x564e02(0x107)]===0x191)return printAuthError(_0x40ea65),0x1;return console[_0x564e02(0xb7)](a22_0x102c98['red']('✗\x20Validation\x20failed:\x20'+(_0x40ea65 instanceof Error?_0x40ea65['message']:String(_0x40ea65)))),console[_0x564e02(0xb7)](_0x564e02(0xeb)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a22_0x159ae9(0x120)]=a22_0x159ae9(0xbf);[a22_0x159ae9(0x110)]=a22_0x159ae9(0x122);['validate'](_0x57890b){const _0x4b4e46=a22_0x159ae9,{args:_0x5856c6}=_0x57890b;if(_0x5856c6[_0x4b4e46(0x11d)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>';return undefined;}async[a22_0x159ae9(0xd4)](_0xf76aa9){const _0x58d642=a22_0x159ae9,{args:_0x137930}=_0xf76aa9,_0x3701f6=_0x137930[0x0];console[_0x58d642(0xf0)](a22_0x102c98['bold'](_0x58d642(0x11a)));if(!profileExists(_0x3701f6)){console[_0x58d642(0xb7)](a22_0x102c98[_0x58d642(0xc7)]('Profile\x20\x27'+_0x3701f6+_0x58d642(0x11e))),console[_0x58d642(0xf0)](_0x58d642(0xdf));const _0x50ae0a=listProfiles();if(_0x50ae0a[_0x58d642(0x11d)]===0x0)console[_0x58d642(0xf0)](_0x58d642(0xef));else for(const _0x40c865 of _0x50ae0a){console[_0x58d642(0xf0)]('\x20\x20-\x20'+_0x40c865['name']);}return 0x1;}const _0x49e269=await a22_0x68ba84({'type':_0x58d642(0xc3),'name':_0x58d642(0xc3),'message':_0x58d642(0xd1)+_0x3701f6+'\x27?','initial':![]});if(!_0x49e269[_0x58d642(0xc3)])return console[_0x58d642(0xf0)]('Removal\x20cancelled'),0x0;try{removeProfileFromUserConfig(_0x3701f6),console[_0x58d642(0xf0)](a22_0x102c98[_0x58d642(0xcc)]('✓')+'\x20Profile\x20\x27'+_0x3701f6+_0x58d642(0xf7));}catch(_0x227e09){return console[_0x58d642(0xb7)](a22_0x102c98[_0x58d642(0xc7)]('Failed\x20to\x20remove\x20profile:\x20'+(_0x227e09 instanceof Error?_0x227e09[_0x58d642(0xe9)]:String(_0x227e09)))),0x1;}const _0x537fe7=await isKeychainAvailable();if(_0x537fe7){const _0x33f653=await deleteKeychainAPIKey(_0x3701f6);_0x33f653&&console[_0x58d642(0xf0)](a22_0x102c98[_0x58d642(0xcc)]('✓')+_0x58d642(0x116));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a22_0x159ae9(0x120)]='profile:set';[a22_0x159ae9(0x110)]=a22_0x159ae9(0xbb);static [a22_0x159ae9(0xc1)]=[a22_0x159ae9(0xd8),'database',a22_0x159ae9(0x103),a22_0x159ae9(0xb5),a22_0x159ae9(0xf8),a22_0x159ae9(0x110)];[a22_0x159ae9(0xba)](_0x2aaefa){const _0x4e17dc=a22_0x159ae9,{args:_0x655818,options:_0x3fd282}=_0x2aaefa,_0x59a2dc=_0x3fd282[_0x4e17dc(0xf2)]||getActiveProfile();if(!_0x59a2dc)return _0x4e17dc(0xde);if(_0x655818[_0x4e17dc(0x11d)]===0x0)return _0x4e17dc(0xf4)+ProfileSetCommand[_0x4e17dc(0xc1)][_0x4e17dc(0xc8)](',\x20');const _0x2b6f17=_0x655818[0x0];if(!_0x2b6f17['includes']('='))return _0x4e17dc(0x11b)+ProfileSetCommand[_0x4e17dc(0xc1)][_0x4e17dc(0xc8)](',\x20');const [_0x447a2e]=_0x2b6f17[_0x4e17dc(0xf3)]('=',0x2);if(!ProfileSetCommand[_0x4e17dc(0xc1)][_0x4e17dc(0x11f)](_0x447a2e))return _0x4e17dc(0xec)+_0x447a2e+'\x27.\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x4e17dc(0xc1)][_0x4e17dc(0xc8)](',\x20');return undefined;}async['execute'](_0x1097a3){const _0x24b6b=a22_0x159ae9,{args:_0x1cee69,options:_0x144fa2}=_0x1097a3,_0x26528f=_0x144fa2[_0x24b6b(0xf2)]||getActiveProfile(),[_0x5401be,..._0x52afaa]=_0x1cee69[0x0][_0x24b6b(0xf3)]('='),_0x50d10f=_0x52afaa[_0x24b6b(0xc8)]('=');console['log'](a22_0x102c98[_0x24b6b(0xda)](_0x24b6b(0x102)));if(!profileExists(_0x26528f)){const _0x96d62=await a22_0x68ba84({'type':_0x24b6b(0xc3),'name':'create','message':_0x24b6b(0x10e)+_0x26528f+_0x24b6b(0xfa),'initial':!![]});if(!_0x96d62[_0x24b6b(0xd2)])return console[_0x24b6b(0xf0)](_0x24b6b(0x106)),0x1;}const _0x37a997=loadProfile(_0x26528f),_0x202652=_0x37a997?.[_0x24b6b(0x109)]||{};if(_0x5401be===_0x24b6b(0xd8)){const _0x3506bc=resolveSite(_0x50d10f);console[_0x24b6b(0xf0)](_0x24b6b(0x108)+_0x3506bc+_0x24b6b(0xf5)),console['log'](_0x24b6b(0xd6)),console['log']('\x20\x20'+getConsoleUrl(_0x3506bc,_0x24b6b(0xe7)));const _0x3c26ef=await a22_0x68ba84({'type':_0x24b6b(0xca),'name':_0x24b6b(0xc4),'message':_0x24b6b(0xfb),'validate':_0xdf8bd5=>{const _0x948582=_0x24b6b;if(!_0xdf8bd5||!_0xdf8bd5[_0x948582(0x10f)]())return _0x948582(0xb9);return!![];}});if(!_0x3c26ef[_0x24b6b(0xc4)])return console['log'](_0x24b6b(0xc0)),0x1;console[_0x24b6b(0xf0)](_0x24b6b(0xce));try{const _0x16ddd1=TDX[_0x24b6b(0xd2)]({'site':_0x3506bc,'apiKey':_0x3c26ef[_0x24b6b(0xc4)][_0x24b6b(0x10f)](),'logLevel':_0x144fa2[_0x24b6b(0xe2)]??LogLevel[_0x24b6b(0x118)]}),_0x355574=await _0x16ddd1[_0x24b6b(0xb6)][_0x24b6b(0xcd)]();console[_0x24b6b(0xf0)](a22_0x102c98[_0x24b6b(0xcc)]('✓')+_0x24b6b(0xf1)+_0x355574[_0x24b6b(0x127)]+')');const _0xd8c599=await isKeychainAvailable();_0xd8c599?(await saveAPIKeyAsync(_0x3c26ef[_0x24b6b(0xc4)][_0x24b6b(0x10f)](),_0x3506bc,_0x26528f),console[_0x24b6b(0xf0)](a22_0x102c98[_0x24b6b(0xcc)]('✓')+_0x24b6b(0x128))):console[_0x24b6b(0xdc)](a22_0x102c98['yellow'](_0x24b6b(0xe5))),_0x202652[_0x24b6b(0xd8)]=_0x3506bc;}catch(_0x3319b8){if(_0x3319b8 instanceof HTTPClientError&&_0x3319b8[_0x24b6b(0x107)]===0x191)return printAuthError(_0x3319b8),0x1;return console[_0x24b6b(0xb7)](a22_0x102c98[_0x24b6b(0xc7)](_0x24b6b(0xee)+(_0x3319b8 instanceof Error?_0x3319b8[_0x24b6b(0xe9)]:String(_0x3319b8)))),console['error'](_0x24b6b(0xe0)),0x1;}}else _0x202652[_0x5401be]=_0x50d10f||undefined;return saveProfileToUserConfig(_0x26528f,_0x202652),console[_0x24b6b(0xf0)](a22_0x102c98[_0x24b6b(0xcc)]('✓')+_0x24b6b(0xfc)+_0x26528f+_0x24b6b(0x100)+_0x5401be+'='+(_0x50d10f||_0x24b6b(0xbe))),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a22_0x159ae9(0x121);[a22_0x159ae9(0x110)]=a22_0x159ae9(0x124);[a22_0x159ae9(0xba)](_0x2c2d12){const _0x3b813a=a22_0x159ae9,{args:_0x2fc602}=_0x2c2d12;if(_0x2fc602[_0x3b813a(0x11d)]===0x0)return _0x3b813a(0x104);return undefined;}async[a22_0x159ae9(0xd4)](_0xec0cdb){const _0x4a644b=a22_0x159ae9,{args:_0x54350f,options:_0x582dd6}=_0xec0cdb,_0x594bff=_0x54350f[0x0],_0x15f7d2=_0x582dd6[_0x4a644b(0xe4)];cleanExpiredSessions();if(!profileExists(_0x594bff)){console[_0x4a644b(0xb7)](a22_0x102c98['red'](_0x4a644b(0x10e)+_0x594bff+'\x27\x20does\x20not\x20exist.')),console[_0x4a644b(0xf0)]('\x0aAvailable\x20profiles:');const _0x1aa8ee=listProfiles();if(_0x1aa8ee[_0x4a644b(0x11d)]===0x0)console['log']('\x20\x20(no\x20profiles\x20found)');else for(const _0x4df58a of _0x1aa8ee){console['log']('\x20\x20-\x20'+_0x4df58a['name']);}return 0x1;}if(_0x15f7d2){const _0x4de777=a22_0x5c1b19['join'](getConfigDir(),_0x4a644b(0xd0));return saveActiveProfileToUserConfig(_0x594bff),console[_0x4a644b(0xf0)]('Default\x20profile\x20set\x20to:\x20'+a22_0x102c98[_0x4a644b(0xcc)](_0x594bff)),console[_0x4a644b(0xf0)](a22_0x102c98[_0x4a644b(0x114)]('\x0aSaved\x20to:\x20'+_0x4de777)),0x0;}const _0x24d19c=_0x582dd6['session']||getCurrentSessionPID()[_0x4a644b(0x10b)]();return saveSessionContext({'profile':_0x594bff},_0x582dd6['session']),console[_0x4a644b(0xf0)](_0x4a644b(0x11c)+a22_0x102c98[_0x4a644b(0xcc)](_0x594bff)+'\x20'+a22_0x102c98[_0x4a644b(0x114)](_0x4a644b(0xcf)+_0x24d19c+')')),console[_0x4a644b(0xf0)](a22_0x102c98['dim'](_0x4a644b(0xdb)+_0x594bff+_0x4a644b(0x125))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-command.js","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,gBAAgB,GAEjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oBAAoB,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1
|
+
function a23_0x1d37(_0x31d2f3,_0x5cbd08){_0x31d2f3=_0x31d2f3-0x73;const _0x317b9d=a23_0x317b();let _0x1d375f=_0x317b9d[_0x31d2f3];return _0x1d375f;}const a23_0x3b6071=a23_0x1d37;(function(_0x1e82ec,_0x39cbeb){const _0x4a3ba1=a23_0x1d37,_0x4a5999=_0x1e82ec();while(!![]){try{const _0x2be955=parseInt(_0x4a3ba1(0x85))/0x1+-parseInt(_0x4a3ba1(0x84))/0x2+-parseInt(_0x4a3ba1(0x88))/0x3*(parseInt(_0x4a3ba1(0x75))/0x4)+parseInt(_0x4a3ba1(0x7d))/0x5+-parseInt(_0x4a3ba1(0x74))/0x6+parseInt(_0x4a3ba1(0x87))/0x7*(-parseInt(_0x4a3ba1(0x86))/0x8)+parseInt(_0x4a3ba1(0x82))/0x9;if(_0x2be955===_0x39cbeb)break;else _0x4a5999['push'](_0x4a5999['shift']());}catch(_0x5e6161){_0x4a5999['push'](_0x4a5999['shift']());}}}(a23_0x317b,0xc4650));import{BaseCommand}from'./command.js';function a23_0x317b(){const _0x11d812=['description','profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','message','execute','2632985bbuaUm','config','error','name','Error:\x20','32156145utJDZf','List\x20all\x20available\x20profiles','1988846XVtFzb','455612NFNhFm','8ZxBMMH','10625783WRbWks','111ndEoPx','length','map','5514546MoYSzG','34508zwQXAQ','\x20\x20Global:\x20~/.config/tdx/tdx.json','log'];a23_0x317b=function(){return _0x11d812;};return a23_0x317b();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a23_0x3b6071(0x80)]=a23_0x3b6071(0x79);[a23_0x3b6071(0x78)]=a23_0x3b6071(0x83);async[a23_0x3b6071(0x7c)](_0x338611){const _0x187bb7=a23_0x3b6071,{options:_0x5c8986}=_0x338611;try{const _0x84cb06=listProfiles(),_0x18fac6=getActiveProfile();if(_0x84cb06[_0x187bb7(0x89)]===0x0)return console[_0x187bb7(0x77)](_0x187bb7(0x7a)),console[_0x187bb7(0x77)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console['log'](_0x187bb7(0x76)),0x0;const _0x3e4aa9=_0x84cb06[_0x187bb7(0x73)](_0x6b66ef=>{const _0xb8ec7e=_0x187bb7,_0x88c673=_0x6b66ef[_0xb8ec7e(0x80)]===_0x18fac6,_0x3c6cfa=getProfileParams(_0x6b66ef[_0xb8ec7e(0x7e)]);return{'name':_0x6b66ef['name'],'active':_0x88c673,'scope':_0x6b66ef['scope'],'description':_0x6b66ef[_0xb8ec7e(0x7e)][_0xb8ec7e(0x78)]||'','params':_0x3c6cfa};});return await handleSDKOutput(_0x3e4aa9,_0x5c8986),0x0;}catch(_0x3d3f04){return _0x3d3f04 instanceof Error&&console[_0x187bb7(0x7f)](_0x187bb7(0x81)+_0x3d3f04[_0x187bb7(0x7b)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x12770a=a24_0x2a07;(function(_0xb1b80f,_0x1a11c6){const _0x1bcc0c=a24_0x2a07,_0x548701=_0xb1b80f();while(!![]){try{const _0x4fa622=parseInt(_0x1bcc0c(0x165))/0x1*(-parseInt(_0x1bcc0c(0x178))/0x2)+parseInt(_0x1bcc0c(0x163))/0x3+parseInt(_0x1bcc0c(0x182))/0x4+-parseInt(_0x1bcc0c(0x155))/0x5+-parseInt(_0x1bcc0c(0x161))/0x6+-parseInt(_0x1bcc0c(0x17c))/0x7*(parseInt(_0x1bcc0c(0x15f))/0x8)+-parseInt(_0x1bcc0c(0x176))/0x9*(-parseInt(_0x1bcc0c(0x17b))/0xa);if(_0x4fa622===_0x1a11c6)break;else _0x548701['push'](_0x548701['shift']());}catch(_0x2e46a9){_0x548701['push'](_0x548701['shift']());}}}(a24_0x279b,0xe3b0a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';function a24_0x2a07(_0xa47ce7,_0x2a6400){_0xa47ce7=_0xa47ce7-0x152;const _0x279bfe=a24_0x279b();let _0x2a071d=_0x279bfe[_0xa47ce7];return _0x2a071d;}import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{['name']=a24_0x12770a(0x162);[a24_0x12770a(0x156)]=a24_0x12770a(0x159);async['execute'](_0x3e5029){const _0x443abe=a24_0x12770a,{options:_0x548945,args:_0x37d059,tdx:_0x56476b}=_0x3e5029,_0x8bb793=_0x37d059[0x0],_0x25a7b3=_0x548945[_0x443abe(0x16f)];let _0x3f8b2e;try{if(_0x25a7b3)_0x3f8b2e=readSqlStatementsFromFile(_0x25a7b3);else{if(_0x8bb793==='-')_0x3f8b2e=await readSqlStatementsFromStdin();else{if(_0x8bb793&&isSqlFilePath(_0x8bb793))_0x3f8b2e=readSqlStatementsFromFile(_0x8bb793);else{if(_0x8bb793)_0x3f8b2e=splitSqlStatements(_0x8bb793);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x272770){return console[_0x443abe(0x169)](_0x443abe(0x15a)+_0x272770[_0x443abe(0x157)]),0x1;}const _0x19bb6b=_0x548945[_0x443abe(0x171)]||_0x443abe(0x15d),_0x1eafec=_0x548945[_0x443abe(0x17e)];try{const _0x43c4e7=[],_0x2a8e75=!!_0x548945['output'];for(let _0x17c359=0x0;_0x17c359<_0x3f8b2e[_0x443abe(0x173)];_0x17c359++){const _0xf46077=_0x3f8b2e[_0x17c359],_0x490dca=_0x17c359+0x1,_0x298669=_0x3f8b2e['length'],_0x5ed265=_0x298669>0x1;_0x548945[_0x443abe(0x16c)]&&(console[_0x443abe(0x169)]('\x0a'+(_0x5ed265?'Statement\x20'+_0x490dca+'/'+_0x298669+':':'')),console['error'](_0x443abe(0x15c)+_0x548945[_0x443abe(0x17a)]),console[_0x443abe(0x169)](_0x443abe(0x177)+(_0x1eafec||'td')),console[_0x443abe(0x169)]('Schema:\x20'+_0x19bb6b),console['error'](_0x443abe(0x158)+_0xf46077));const _0x2f80b7=_0x5ed265?'Executing\x20statement\x20'+_0x490dca+'/'+_0x298669+_0x443abe(0x172):_0x443abe(0x16b);try{const _0x493208=await withProgressSpinner(_0x2f80b7,async _0xb5cc28=>{const _0x1be581=_0x443abe,_0x336bd2=await _0x56476b[_0x1be581(0x162)][_0x1be581(0x181)](_0xf46077,{'catalog':_0x1eafec,'schema':_0x19bb6b,'onJobId':_0x4c1027=>{const _0x4b19fe=_0x1be581;_0xb5cc28[_0x4b19fe(0x167)](_0x4c1027);},'onProgress':_0x2cf155=>{const _0x19089=_0x1be581;_0xb5cc28[_0x19089(0x168)](_0x19089(0x16e)+_0x2cf155[_0x19089(0x15e)]+']'),_0xb5cc28[_0x19089(0x17d)](formatRows(_0x2cf155['processedRows'])+_0x19089(0x164)+_0x2cf155['completedSplits']+'/'+_0x2cf155[_0x19089(0x180)]+_0x19089(0x152));}});return _0x336bd2;},{'verbose':_0x548945[_0x443abe(0x16c)]}),_0x3706c8=_0x493208[_0x443abe(0x15b)],_0x539742=_0x3706c8[_0x443abe(0x17f)]?'\x20[Job\x20ID:\x20'+_0x3706c8[_0x443abe(0x17f)]+']':'',_0x445050=_0x5ed265?_0x443abe(0x154)+_0x490dca+'/'+_0x298669+'\x20-\x20':'';console[_0x443abe(0x169)]('✔\x20'+_0x445050+_0x443abe(0x160)+formatRows(_0x3706c8[_0x443abe(0x16d)]['processedRows'])+_0x443abe(0x164)+(_0x443abe(0x16a)+formatElapsed(_0x3706c8[_0x443abe(0x16d)][_0x443abe(0x175)])+_0x539742));if(_0x5ed265&&_0x2a8e75){const _0x4323fc=resolveOutputOptions(_0x548945),_0x3cf510=await formatQueryOutput(_0x3706c8,_0x4323fc);_0x43c4e7[_0x443abe(0x153)](_0x3cf510);}else await handleQueryOutput(_0x3706c8,_0x548945);}catch(_0x41afcb){const _0xe0bf0=_0x5ed265?_0x443abe(0x154)+_0x490dca+'/'+_0x298669+':\x0a':'',_0x3bcd32=_0x41afcb instanceof SDKError?_0x41afcb[_0x443abe(0x179)]:_0x41afcb[_0x443abe(0x157)];return console[_0x443abe(0x169)](''+_0xe0bf0+_0x3bcd32),0x1;}}if(_0x3f8b2e[_0x443abe(0x173)]>0x1&&_0x2a8e75&&_0x43c4e7[_0x443abe(0x173)]>0x0){const _0x528e89=_0x43c4e7[_0x443abe(0x166)]('\x0a');writeFileSync(_0x548945['output'],_0x528e89),console[_0x443abe(0x169)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x548945['output']);}return 0x0;}catch(_0x199012){throw _0x199012;}}[a24_0x12770a(0x174)](_0x54a3b7){const _0x39f5b1=a24_0x12770a,_0x226f4d=_0x54a3b7[_0x39f5b1(0x170)][0x0],_0xf1797d=_0x54a3b7['options'][_0x39f5b1(0x16f)];if(!_0x226f4d&&!_0xf1797d)return'Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options';if(_0x226f4d&&_0xf1797d)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}function a24_0x279b(){const _0x1545b7=['241869ORsIxS','\x20rows\x20','34605WGPSiL','join','setJobId','setPhase','error','in\x20','Executing\x20query...','verbose','stats','Executing\x20query\x20[','file','args','database','...','length','validate','elapsedTimeMillis','837DYeQti','Catalog:\x20','2LDLPnM','originalMessage','site','236490nUkUJc','14bvGBpJ','setExtra','catalog','jobId','totalSplits','execute','5601100TlNyLp','\x20splits','push','Statement\x20','3605790nAabsF','description','message','SQL:\x20','Run\x20Trino\x20queries\x20(streaming)','Error:\x20','data','Site:\x20','information_schema','state','4838512Kdvtwo','Query\x20completed:\x20Processed\x20','4693476CEUxvG','query'];a24_0x279b=function(){return _0x1545b7;};return a24_0x279b();}
|