@treasuredata/tdx 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.d.ts +52 -1
- package/dist/client/llm-api-client.d.ts.map +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/llm-api-client.js.map +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/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.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +15 -2
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.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.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/llm.d.ts +107 -2
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x5453af=a29_0x37a3;(function(_0x11336d,_0x25bab6){const _0x355bff=a29_0x37a3,_0x205503=_0x11336d();while(!![]){try{const _0x40ee83=parseInt(_0x355bff(0x20e))/0x1*(-parseInt(_0x355bff(0x1af))/0x2)+-parseInt(_0x355bff(0x16e))/0x3+-parseInt(_0x355bff(0x1eb))/0x4*(parseInt(_0x355bff(0x22e))/0x5)+-parseInt(_0x355bff(0x23a))/0x6+-parseInt(_0x355bff(0x188))/0x7+parseInt(_0x355bff(0x25a))/0x8*(-parseInt(_0x355bff(0x22f))/0x9)+-parseInt(_0x355bff(0x207))/0xa*(-parseInt(_0x355bff(0x219))/0xb);if(_0x40ee83===_0x25bab6)break;else _0x205503['push'](_0x205503['shift']());}catch(_0x3b58b3){_0x205503['push'](_0x205503['shift']());}}}(a29_0x2858,0x36ab1));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a29_0xb8402e from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0xfad20c from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a29_0x5453af(0x1f9),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x287de2){const _0x30c283=a29_0x5453af,_0x1856a8=process[_0x30c283(0x18a)],_0x4fb5f7=_0x1856a8==='darwin'?_0x30c283(0x254):_0x1856a8===_0x30c283(0x273)?_0x30c283(0x27f):_0x30c283(0x170);spawn(_0x4fb5f7,[_0x287de2],{'detached':!![],'stdio':_0x30c283(0x1a3)})[_0x30c283(0x17d)]();}function migrateLegacyDirectory(){const _0x524e6a=a29_0x5453af;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x20ff67=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x20ff67[_0x524e6a(0x189)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x524e6a(0x173)](a29_0xfad20c['yellow'](_0x524e6a(0x177)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x524e6a(0x1e9))),console[_0x524e6a(0x173)](a29_0xfad20c['dim'](_0x524e6a(0x176)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x524e6a(0x173)](a29_0xfad20c[_0x524e6a(0x195)](_0x524e6a(0x1ef)+LEGACY_PARENT_SEGMENT_DIR+_0x524e6a(0x256)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x524e6a(0x173)](a29_0xfad20c['green'](_0x524e6a(0x1f4)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x56b0fa){const _0x48df7e=_0x56b0fa instanceof Error?_0x56b0fa[_0x524e6a(0x175)]:String(_0x56b0fa);return console[_0x524e6a(0x173)](a29_0xfad20c['red'](_0x524e6a(0x259)+_0x48df7e+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x420a2a){const _0x20b171=a29_0x5453af;return migrateLegacyDirectory(),super[_0x20b171(0x21c)](_0x420a2a);}}function resolveYamlFile(_0x31318c){const _0x4a32fd=a29_0x5453af;if(_0x31318c[_0x4a32fd(0x1b0)](_0x4a32fd(0x1a4))||_0x31318c[_0x4a32fd(0x1b0)]('.yaml'))return _0x31318c;return a29_0xb8402e[_0x4a32fd(0x1cd)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x31318c)+'.yml');}function formatProgressMessage(_0x7db43d){const _0x5bf28c=a29_0x5453af,_0x11215a=_0x7db43d['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x11215a){const [,_0x4c3ec4,_0x1b297c,_0x4a8493='']=_0x11215a;return a29_0xfad20c[_0x5bf28c(0x1b9)](_0x4c3ec4+':')+'\x20'+_0x1b297c+a29_0xfad20c[_0x5bf28c(0x1b9)](_0x4a8493);}return a29_0xfad20c[_0x5bf28c(0x1b9)](_0x7db43d);}function showFileNotFoundError(_0x250727,_0x38c36b){const _0x2c77f7=a29_0x5453af;console[_0x2c77f7(0x173)](a29_0xfad20c[_0x2c77f7(0x286)]('Error:\x20File\x20not\x20found:\x20'+_0x250727+'\x0a')),console[_0x2c77f7(0x173)](a29_0xfad20c[_0x2c77f7(0x162)](_0x2c77f7(0x1c9)+_0x38c36b+_0x2c77f7(0x1d3)));}function showParentSegmentNotSetError(_0x3c876c){const _0x3a04c1=a29_0x5453af;console[_0x3a04c1(0x173)](a29_0xfad20c[_0x3a04c1(0x195)](_0x3a04c1(0x17f))),console[_0x3a04c1(0x173)](_0x3c876c);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x5453af(0x185)]=a29_0x5453af(0x1a6);[a29_0x5453af(0x280)]=a29_0x5453af(0x224);async[a29_0x5453af(0x21f)](_0x197203){const _0x86a2b9=a29_0x5453af,{options:_0xaee5ce,args:_0xa05c5d,tdx:_0x5482af}=_0x197203,_0x375706=_0xa05c5d[0x0];_0xaee5ce[_0x86a2b9(0x19d)]&&(console[_0x86a2b9(0x173)](_0x86a2b9(0x255)+_0xaee5ce[_0x86a2b9(0x180)]),_0x375706&&console[_0x86a2b9(0x173)](_0x86a2b9(0x282)+_0x375706));const _0x2eb430=await withSpinner(_0x375706?_0x86a2b9(0x18f)+_0x375706+_0x86a2b9(0x1d4):_0x86a2b9(0x23f),()=>_0x5482af[_0x86a2b9(0x1a8)][_0x86a2b9(0x1fb)](),{'verbose':_0xaee5ce[_0x86a2b9(0x19d)]});let _0x31fc3f=_0x2eb430[_0x86a2b9(0x1e6)];if(_0x375706){const _0x543e1e=_0x375706['replace'](/[.+^${}()|[\]\\]/g,_0x86a2b9(0x1a0))['replace'](/\*/g,'.*')[_0x86a2b9(0x178)](/\?/g,'.'),_0x2db4d4=new RegExp('^'+_0x543e1e+'$','i');_0x31fc3f=_0x31fc3f[_0x86a2b9(0x1d0)](_0x4bac45=>_0x2db4d4['test'](_0x4bac45[_0x86a2b9(0x19a)]['name']));}_0x31fc3f[_0x86a2b9(0x190)]((_0x2dfb96,_0x384082)=>_0x2dfb96[_0x86a2b9(0x19a)][_0x86a2b9(0x185)][_0x86a2b9(0x26f)](_0x384082['attributes'][_0x86a2b9(0x185)])),console[_0x86a2b9(0x173)]('✔\x20Found\x20'+_0x31fc3f[_0x86a2b9(0x1fc)]+_0x86a2b9(0x1c5)+(_0x31fc3f[_0x86a2b9(0x1fc)]!==0x1?'s':''));if(_0xaee5ce[_0x86a2b9(0x16a)]==='json'||_0xaee5ce[_0x86a2b9(0x16a)]===_0x86a2b9(0x24d))await handleSDKOutput(_0x31fc3f,_0xaee5ce);else{if(_0x31fc3f[_0x86a2b9(0x1fc)]===0x0)_0x375706?console['log']('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x375706):console[_0x86a2b9(0x27e)](_0x86a2b9(0x160));else for(const _0x347e84 of _0x31fc3f){const _0x572bac=_0x347e84[_0x86a2b9(0x19a)][_0x86a2b9(0x1cc)]?a29_0xfad20c['dim']('\x20('+formatRows(_0x347e84['attributes'][_0x86a2b9(0x1cc)])+')'):'';console[_0x86a2b9(0x27e)](_0x86a2b9(0x18d)+_0x347e84[_0x86a2b9(0x19a)][_0x86a2b9(0x185)]+_0x572bac);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x5453af(0x185)]=a29_0x5453af(0x194);['description']=a29_0x5453af(0x262);async['execute'](_0x4caf9d){const _0x2ef2d9=a29_0x5453af,{options:_0x26ccc9,args:_0x3a1700,tdx:_0x5c87c8}=_0x4caf9d;console[_0x2ef2d9(0x173)](_0x2ef2d9(0x26b)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2ef2d9(0x229));const _0x1c4f11=_0x26ccc9;if(_0x3a1700[_0x2ef2d9(0x1fc)]===0x0)return console[_0x2ef2d9(0x173)](a29_0xfad20c[_0x2ef2d9(0x286)](_0x2ef2d9(0x230))),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x31350b=_0x3a1700[0x0];if(!_0x1c4f11[_0x2ef2d9(0x27b)]||!_0x1c4f11['table'])return console[_0x2ef2d9(0x173)](_0x2ef2d9(0x288)),console[_0x2ef2d9(0x173)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x1c4f11[_0x2ef2d9(0x19d)]&&(console[_0x2ef2d9(0x173)](_0x2ef2d9(0x255)+_0x1c4f11[_0x2ef2d9(0x180)]),console[_0x2ef2d9(0x173)](_0x2ef2d9(0x287)+_0x31350b),console[_0x2ef2d9(0x173)](_0x2ef2d9(0x1f5)+_0x1c4f11[_0x2ef2d9(0x27b)]),console[_0x2ef2d9(0x173)](_0x2ef2d9(0x249)+_0x1c4f11[_0x2ef2d9(0x24a)]));const _0x47b641=await loadJSONFromOptions(_0x1c4f11[_0x2ef2d9(0x19a)],_0x1c4f11['attributesFile']),_0x2059b1=await loadJSONFromOptions(_0x1c4f11[_0x2ef2d9(0x19e)],_0x1c4f11[_0x2ef2d9(0x235)]),_0x573681=await loadJSONFromOptions(_0x1c4f11['customerGroup'],_0x1c4f11[_0x2ef2d9(0x22d)]),_0x5917cd={'name':_0x31350b,'description':_0x1c4f11[_0x2ef2d9(0x280)],'scheduleType':_0x1c4f11[_0x2ef2d9(0x261)],'scheduleOption':_0x1c4f11[_0x2ef2d9(0x213)],'timezone':_0x1c4f11[_0x2ef2d9(0x1f0)],'master':{'parentDatabaseName':_0x1c4f11[_0x2ef2d9(0x27b)],'parentTableName':_0x1c4f11[_0x2ef2d9(0x24a)]},'attributes':_0x47b641,'behaviors':_0x2059b1,'customerGroup':_0x573681},_0x117671=await withSpinner(_0x2ef2d9(0x250)+_0x31350b+_0x2ef2d9(0x1d4),()=>_0x5c87c8[_0x2ef2d9(0x1a8)][_0x2ef2d9(0x1b6)](_0x5917cd),{'verbose':_0x26ccc9[_0x2ef2d9(0x19d)]}),_0x511e05=_0x117671['data'];return console[_0x2ef2d9(0x173)](_0x2ef2d9(0x21d)+_0x511e05[_0x2ef2d9(0x185)]+'\x27\x20with\x20ID:\x20'+_0x511e05['id']),await handleSDKOutput([_0x511e05],_0x26ccc9),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x5453af(0x185)]=a29_0x5453af(0x218);['description']=a29_0x5453af(0x1ce);async[a29_0x5453af(0x21f)](_0x509ca0){const _0x4d447d=a29_0x5453af,{options:_0x8acd20,args:_0x27fe55,tdx:_0x343386}=_0x509ca0;console[_0x4d447d(0x173)](_0x4d447d(0x244)+_0x4d447d(0x217)+_0x4d447d(0x229));const _0x5f15cc=_0x8acd20;if(_0x27fe55['length']===0x0)return console['error'](a29_0xfad20c[_0x4d447d(0x286)](_0x4d447d(0x230))),console['error'](_0x4d447d(0x277)),0x1;const _0x1b13e7=_0x27fe55[0x0];_0x5f15cc['verbose']&&(console[_0x4d447d(0x173)]('Site:\x20'+_0x5f15cc[_0x4d447d(0x180)]),console[_0x4d447d(0x173)](_0x4d447d(0x1a2)+_0x1b13e7));const _0x6aac09=await withSpinner(_0x4d447d(0x285)+_0x1b13e7+_0x4d447d(0x1d4),()=>_0x343386[_0x4d447d(0x1a8)][_0x4d447d(0x1be)](_0x1b13e7),{'verbose':_0x5f15cc[_0x4d447d(0x19d)]}),_0x2cc103=_0x6aac09[_0x4d447d(0x1e6)],_0x2f2ab3=await loadJSONFromOptions(_0x5f15cc['addAttributes'],_0x5f15cc['addAttributesFile']),_0x5f4bbb=await loadJSONFromOptions(_0x5f15cc[_0x4d447d(0x24b)],_0x5f15cc[_0x4d447d(0x179)]),_0x42bea9={'name':_0x2cc103[_0x4d447d(0x185)],'description':_0x5f15cc[_0x4d447d(0x280)]!==undefined?_0x5f15cc['description']:_0x2cc103[_0x4d447d(0x280)],'scheduleType':_0x5f15cc[_0x4d447d(0x261)]!==undefined?_0x5f15cc[_0x4d447d(0x261)]:_0x2cc103[_0x4d447d(0x261)],'scheduleOption':_0x5f15cc[_0x4d447d(0x213)]!==undefined?_0x5f15cc[_0x4d447d(0x213)]:_0x2cc103['scheduleOption'],'timezone':_0x5f15cc[_0x4d447d(0x1f0)]!==undefined?_0x5f15cc[_0x4d447d(0x1f0)]:_0x2cc103[_0x4d447d(0x1f0)],'master':_0x2cc103[_0x4d447d(0x1d7)],'attributes':_0x2f2ab3?[..._0x2cc103['attributes']||[],..._0x2f2ab3]:_0x2cc103[_0x4d447d(0x19a)],'behaviors':_0x5f4bbb?[..._0x2cc103[_0x4d447d(0x19e)]||[],..._0x5f4bbb]:_0x2cc103[_0x4d447d(0x19e)],'customerGroup':_0x2cc103[_0x4d447d(0x203)]},_0x3c465d=await withSpinner(_0x4d447d(0x24f)+_0x1b13e7+'\x27...',()=>_0x343386[_0x4d447d(0x1a8)][_0x4d447d(0x17e)](_0x1b13e7,_0x42bea9),{'verbose':_0x5f15cc[_0x4d447d(0x19d)]}),_0x32dd5a=_0x3c465d['data'];return console[_0x4d447d(0x173)](_0x4d447d(0x236)+_0x32dd5a[_0x4d447d(0x185)]+'\x27'),await handleSDKOutput([_0x32dd5a],_0x5f15cc),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x5453af(0x185)]=a29_0x5453af(0x1c3);[a29_0x5453af(0x280)]=a29_0x5453af(0x1ff);async['execute'](_0x5b9348){const _0x24d75e=a29_0x5453af,{options:_0xb0ef4f,args:_0x3a85a2,tdx:_0x59d194}=_0x5b9348,_0x208564=_0xb0ef4f,_0x3095ca=_0x3a85a2[0x0]||_0xb0ef4f['parentSegment'];if(!_0x3095ca)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x24d75e(0x271)),0x1;if(_0x208564[_0x24d75e(0x1c8)]&&_0x208564['output'])return console[_0x24d75e(0x173)](a29_0xfad20c['red']('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x24d75e(0x173)](a29_0xfad20c[_0x24d75e(0x1b9)](_0x24d75e(0x1f1))),console[_0x24d75e(0x173)](a29_0xfad20c[_0x24d75e(0x1b9)](_0x24d75e(0x1b2)+PARENT_SEGMENT_DIR+_0x24d75e(0x17a))),console['error'](a29_0xfad20c['cyan'](_0x24d75e(0x20a))),0x1;const _0x1e5546=_0x208564[_0x24d75e(0x1ee)]||a29_0xb8402e[_0x24d75e(0x1cd)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3095ca)+_0x24d75e(0x1a4));_0x208564[_0x24d75e(0x19d)]&&(console[_0x24d75e(0x173)](_0x24d75e(0x255)+_0x208564[_0x24d75e(0x180)]),console['error'](_0x24d75e(0x1a2)+_0x3095ca),console['error'](_0x24d75e(0x1ea)+_0x1e5546));const _0x3725d1=await withSpinner(_0x24d75e(0x1da)+_0x3095ca+_0x24d75e(0x1d4),()=>_0x59d194['segment']['pullParentYaml'](_0x3095ca),{'verbose':_0x208564[_0x24d75e(0x19d)]}),_0x1759bb=_0x3725d1[_0x24d75e(0x1e6)];if(existsSync(_0x1e5546)){const _0x308f3d=readFileSync(_0x1e5546,_0x24d75e(0x193)),_0x49ac12=generateDiff(_0x308f3d,_0x1759bb);if(!hasChanges(_0x49ac12))console[_0x24d75e(0x173)](a29_0xfad20c[_0x24d75e(0x226)]('✔')+'\x20No\x20changes\x20-\x20'+a29_0xfad20c[_0x24d75e(0x162)](_0x1e5546)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x24d75e(0x209)+_0x1e5546+'\x27:'),console['error']('─'[_0x24d75e(0x1ed)](0x3c)),console[_0x24d75e(0x173)](formatDiffWithColors(_0x49ac12)),console[_0x24d75e(0x173)]('─'[_0x24d75e(0x1ed)](0x3c));if(!_0x208564[_0x24d75e(0x27d)]){const _0x323099=await confirmKey('Overwrite\x20\x27'+_0x1e5546+'\x27?');if(!_0x323099)return console[_0x24d75e(0x173)](_0x24d75e(0x166)),0x1;}writeFileSync(_0x1e5546,_0x1759bb,'utf-8'),console[_0x24d75e(0x173)](a29_0xfad20c[_0x24d75e(0x226)]('✔')+_0x24d75e(0x269)+a29_0xfad20c[_0x24d75e(0x162)](_0x1e5546));}}else{const _0x4b1131=a29_0xb8402e['dirname'](_0x1e5546);!existsSync(_0x4b1131)&&mkdirSync(_0x4b1131,{'recursive':!![]}),writeFileSync(_0x1e5546,_0x1759bb,'utf-8'),console[_0x24d75e(0x173)](a29_0xfad20c[_0x24d75e(0x226)]('✔')+_0x24d75e(0x269)+a29_0xfad20c['cyan'](_0x1e5546));}return saveSessionContext({'parent_segment':_0x3095ca},_0x208564[_0x24d75e(0x264)]),console['error'](a29_0xfad20c[_0x24d75e(0x226)]('✔')+_0x24d75e(0x220)+a29_0xfad20c['dim'](_0x24d75e(0x1dd))+_0x24d75e(0x205)+a29_0xfad20c[_0x24d75e(0x162)](_0x3095ca)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';['description']=a29_0x5453af(0x1ab);async[a29_0x5453af(0x21f)](_0x3f5c79){const _0x755f10=a29_0x5453af,{options:_0x443ec7,args:_0x4d9148,tdx:_0x6f8c09}=_0x3f5c79,_0x350a19=_0x443ec7,_0x3cea7d=_0x4d9148[0x0]||_0x443ec7['parentSegment'];if(!_0x3cea7d)return showParentSegmentNotSetError(_0x755f10(0x16c)+_0x755f10(0x186)),0x1;const _0x5ec535=resolveYamlFile(_0x3cea7d);if(!existsSync(_0x5ec535))return showFileNotFoundError(_0x5ec535,_0x3cea7d),0x1;_0x350a19[_0x755f10(0x19d)]&&(console[_0x755f10(0x173)](_0x755f10(0x255)+_0x350a19[_0x755f10(0x180)]),console[_0x755f10(0x173)](_0x755f10(0x1c0)+_0x5ec535));let _0x271c39;try{_0x271c39=readFileSync(_0x5ec535,_0x755f10(0x193));}catch(_0x5d46a3){const _0x42f599=_0x5d46a3 instanceof Error?_0x5d46a3[_0x755f10(0x175)]:String(_0x5d46a3);return console[_0x755f10(0x173)](_0x755f10(0x1d1)+_0x42f599),0x1;}const _0x5f42f6=await withSpinner(_0x755f10(0x1fd),()=>_0x6f8c09[_0x755f10(0x1a8)]['pushParentYaml'](_0x271c39),{'verbose':_0x350a19[_0x755f10(0x19d)]}),_0x28faf1=_0x5f42f6[_0x755f10(0x1e6)],{isNew:_0x509622,name:_0x2eb933,hasChanges:_0x234a51,diffFormatted:_0x38ae1d}=_0x28faf1;if(!_0x234a51)return console['error'](_0x755f10(0x216)+_0x2eb933+_0x755f10(0x21e)),0x0;_0x509622?console[_0x755f10(0x173)](_0x755f10(0x1b5)+_0x2eb933+'\x27:'):console[_0x755f10(0x173)](_0x755f10(0x183)+_0x2eb933+'\x27:');console[_0x755f10(0x173)]('─'[_0x755f10(0x1ed)](0x3c)),console['error'](_0x38ae1d),console[_0x755f10(0x173)]('─'[_0x755f10(0x1ed)](0x3c));const _0x42e08a=_0x509622?_0x755f10(0x23d)+_0x2eb933+'\x27?':_0x755f10(0x172)+_0x2eb933+'\x27?';if(!_0x350a19[_0x755f10(0x27d)]){const _0xdab7b6=await confirmKey(_0x42e08a);if(!_0xdab7b6)return console[_0x755f10(0x173)](_0x755f10(0x166)),0x1;}const _0x37db5d=_0x509622?_0x755f10(0x22c):_0x755f10(0x275),_0x50a954=await withSpinner(_0x37db5d+_0x755f10(0x240)+_0x2eb933+_0x755f10(0x1d4),()=>_0x28faf1[_0x755f10(0x233)](),{'verbose':_0x350a19[_0x755f10(0x19d)]}),_0x5a7707=_0x50a954[_0x755f10(0x1e6)],_0x2ad86a=getConsoleNextUrl(_0x350a19[_0x755f10(0x180)],_0x755f10(0x181)+_0x5a7707['id']),_0x13a792=_0x509622?_0x755f10(0x27a):_0x755f10(0x243);return console[_0x755f10(0x173)]('✔\x20'+_0x13a792+_0x755f10(0x240)+_0x5a7707['name']+'\x27'),console[_0x755f10(0x173)]('\x20\x20'+_0x2ad86a),0x0;}}function a29_0x37a3(_0x40c398,_0x39ee3d){_0x40c398=_0x40c398-0x15a;const _0x285806=a29_0x2858();let _0x37a3b9=_0x285806[_0x40c398];return _0x37a3b9;}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x5453af(0x185)]=a29_0x5453af(0x1e0);[a29_0x5453af(0x280)]=a29_0x5453af(0x24e);async[a29_0x5453af(0x21f)](_0x45ed71){const _0x3e90bc=a29_0x5453af,{options:_0x962bc2,args:_0x45792c,tdx:_0x3958fc}=_0x45ed71,_0x359e80=_0x962bc2,_0x4686cf=_0x45792c[0x0]||_0x962bc2[_0x3e90bc(0x200)];if(!_0x4686cf)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'+_0x3e90bc(0x252)+_0x3e90bc(0x17c)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x4632d0=resolveYamlFile(_0x4686cf);if(!existsSync(_0x4632d0))return showFileNotFoundError(_0x4632d0,_0x4686cf),0x1;_0x359e80[_0x3e90bc(0x19d)]&&(console['error'](_0x3e90bc(0x255)+_0x359e80[_0x3e90bc(0x180)]),console[_0x3e90bc(0x173)](_0x3e90bc(0x1c0)+_0x4632d0));let _0x2ece75;try{_0x2ece75=readFileSync(_0x4632d0,_0x3e90bc(0x193));}catch(_0x5545fc){const _0x37bdb9=_0x5545fc instanceof Error?_0x5545fc[_0x3e90bc(0x175)]:String(_0x5545fc);return console[_0x3e90bc(0x173)](_0x3e90bc(0x1d1)+_0x37bdb9),0x1;}const _0x48c882=createCommandSpinner(a29_0xfad20c[_0x3e90bc(0x1b9)](_0x3e90bc(0x191)),{'verbose':_0x359e80['verbose']});_0x48c882[_0x3e90bc(0x27f)]();const _0xb55ab3={'onProgress':_0x53bd70=>{const _0x51dd23=_0x3e90bc;_0x48c882[_0x51dd23(0x21b)]=formatProgressMessage(_0x53bd70);}};if(_0x359e80['master'])_0xb55ab3[_0x3e90bc(0x1d7)]=!![];if(_0x359e80['enriched'])_0xb55ab3[_0x3e90bc(0x272)]=!![];_0x359e80['attribute']&&(_0xb55ab3[_0x3e90bc(0x197)]=_0x359e80['attribute']);_0x359e80[_0x3e90bc(0x184)]&&(_0xb55ab3['behavior']=_0x359e80[_0x3e90bc(0x184)]);if(_0x359e80[_0x3e90bc(0x22b)])_0xb55ab3['interval']=_0x359e80['interval'];let _0x5df1d6;try{_0x5df1d6=await _0x3958fc[_0x3e90bc(0x1a8)][_0x3e90bc(0x1b3)](_0x2ece75,_0xb55ab3),_0x48c882[_0x3e90bc(0x161)]();}catch(_0x21ef9f){_0x48c882['stop']();throw _0x21ef9f;}const _0x1cd7e2=_0x359e80[_0x3e90bc(0x22b)]||_0x3e90bc(0x1c6);return this['displayValidateResults'](_0x5df1d6,_0xb55ab3,_0x4632d0,_0x1cd7e2),_0x5df1d6[_0x3e90bc(0x1a7)]?0x0:0x1;}['displayValidateResults'](_0x12670a,_0x893169,_0x1ed089,_0x3b1386){const _0x3398d4=a29_0x5453af;console[_0x3398d4(0x173)]('\x0a'+a29_0xfad20c[_0x3398d4(0x1bf)](_0x3398d4(0x245))+'\x20'+_0x12670a['name']),console[_0x3398d4(0x173)]('═'[_0x3398d4(0x1ed)](0x3c)),this[_0x3398d4(0x25f)](_0x12670a);if(typeof _0x893169[_0x3398d4(0x197)]===_0x3398d4(0x17b)){this['displayAttributesStats'](_0x12670a),this[_0x3398d4(0x1ac)](_0x12670a),this['displayPreviewHints'](_0x1ed089,_0x3b1386,_0x3398d4(0x197),_0x893169[_0x3398d4(0x197)]);return;}if(_0x893169[_0x3398d4(0x197)]===!![]){this[_0x3398d4(0x168)](_0x12670a),this[_0x3398d4(0x1ac)](_0x12670a),this[_0x3398d4(0x246)](_0x1ed089,_0x3b1386,_0x3398d4(0x19a));return;}if(typeof _0x893169['behavior']===_0x3398d4(0x17b)){this[_0x3398d4(0x187)](_0x12670a,_0x3b1386),this[_0x3398d4(0x1ac)](_0x12670a),this['displayPreviewHints'](_0x1ed089,_0x3b1386,_0x3398d4(0x184),_0x893169[_0x3398d4(0x184)]);return;}if(_0x893169[_0x3398d4(0x184)]===!![]){this[_0x3398d4(0x187)](_0x12670a,_0x3b1386),this[_0x3398d4(0x1ac)](_0x12670a),this[_0x3398d4(0x246)](_0x1ed089,_0x3b1386,_0x3398d4(0x19e));return;}this['displayAttributesStats'](_0x12670a),this[_0x3398d4(0x187)](_0x12670a,_0x3b1386),this[_0x3398d4(0x1ac)](_0x12670a),this[_0x3398d4(0x246)](_0x1ed089,_0x3b1386,'all');}[a29_0x5453af(0x246)](_0xbac5a4,_0x86369f,_0x172c84,_0x49e419){const _0x4d82de=a29_0x5453af;console[_0x4d82de(0x173)]('\x0a'+a29_0xfad20c[_0x4d82de(0x1b9)](_0x4d82de(0x23c)));const _0x5155b9=_0x86369f!==_0x4d82de(0x1c6)?'\x20--interval\x20'+_0x86369f:'';if(_0x172c84==='attribute'&&_0x49e419)console['error']('\x20\x20'+a29_0xfad20c[_0x4d82de(0x1b9)](_0x4d82de(0x263)+_0xbac5a4+'\x20--attribute\x20\x22'+_0x49e419+'\x22'+_0x5155b9));else{if(_0x172c84===_0x4d82de(0x184)&&_0x49e419)console[_0x4d82de(0x173)]('\x20\x20'+a29_0xfad20c[_0x4d82de(0x1b9)]('tdx\x20segment\x20parent\x20preview\x20'+_0xbac5a4+_0x4d82de(0x18b)+_0x49e419+'\x22'+_0x5155b9));else(_0x172c84===_0x4d82de(0x19a)||_0x172c84===_0x4d82de(0x19b))&&console[_0x4d82de(0x173)]('\x20\x20'+a29_0xfad20c[_0x4d82de(0x1b9)](_0x4d82de(0x263)+_0xbac5a4+_0x4d82de(0x270)+_0x5155b9));}(_0x172c84===_0x4d82de(0x19e)||_0x172c84==='all')&&console[_0x4d82de(0x173)]('\x20\x20'+a29_0xfad20c[_0x4d82de(0x1b9)](_0x4d82de(0x263)+_0xbac5a4+'\x20--behavior\x20\x22<name>\x22'+_0x5155b9)),_0x172c84===_0x4d82de(0x19b)&&console[_0x4d82de(0x173)]('\x20\x20'+a29_0xfad20c[_0x4d82de(0x1b9)](_0x4d82de(0x263)+_0xbac5a4+_0x4d82de(0x225)+_0x5155b9));}[a29_0x5453af(0x25f)](_0x352caa){const _0xe4decf=a29_0x5453af,{master:_0x34ecbc}=_0x352caa,_0x1fd847=_0x34ecbc[_0xe4decf(0x241)]?a29_0xfad20c[_0xe4decf(0x226)]('✔'):a29_0xfad20c[_0xe4decf(0x286)]('✘');console[_0xe4decf(0x173)]('\x0a'+a29_0xfad20c[_0xe4decf(0x1b9)](_0xe4decf(0x278))),console[_0xe4decf(0x173)](_0x1fd847+'\x20'+a29_0xfad20c[_0xe4decf(0x1bf)](_0x34ecbc['database']+'.'+_0x34ecbc[_0xe4decf(0x24a)])),_0x34ecbc[_0xe4decf(0x241)]?_0x34ecbc[_0xe4decf(0x1d9)]!==undefined&&console['error']('\x20\x20'+a29_0xfad20c[_0xe4decf(0x1b9)](_0xe4decf(0x1d5))+'\x20'+a29_0xfad20c[_0xe4decf(0x162)](formatRows(_0x34ecbc[_0xe4decf(0x1d9)]))):console[_0xe4decf(0x173)]('\x20\x20'+a29_0xfad20c[_0xe4decf(0x286)]('Error:')+'\x20'+_0x34ecbc[_0xe4decf(0x25d)]);}[a29_0x5453af(0x168)](_0x583908){const _0x4daac7=a29_0x5453af;if(_0x583908['attributes'][_0x4daac7(0x1fc)]===0x0)return;console[_0x4daac7(0x173)]('\x0a'+a29_0xfad20c[_0x4daac7(0x1b9)](_0x4daac7(0x165)));for(const _0x599dea of _0x583908[_0x4daac7(0x19a)]){const _0x2e00d6=_0x599dea[_0x4daac7(0x241)]?a29_0xfad20c[_0x4daac7(0x226)]('✔'):a29_0xfad20c[_0x4daac7(0x286)]('✘');let _0x3011b7='';if(_0x599dea[_0x4daac7(0x241)]&&_0x599dea[_0x4daac7(0x21a)]!==undefined&&_0x599dea[_0x4daac7(0x15b)]!==undefined){const _0x1e5162=_0x599dea[_0x4daac7(0x15b)]['toFixed'](0x1),_0x33e25b=_0x599dea[_0x4daac7(0x15b)]>=0x50?a29_0xfad20c['green']:_0x599dea[_0x4daac7(0x15b)]>=0x32?a29_0xfad20c['yellow']:a29_0xfad20c['red'];_0x3011b7='\x20'+a29_0xfad20c[_0x4daac7(0x1b9)](_0x4daac7(0x15d))+'\x20'+_0x33e25b(_0x1e5162+'%')+'\x20('+formatRows(_0x599dea[_0x4daac7(0x21a)])+'\x20rows)';}console[_0x4daac7(0x173)](_0x2e00d6+'\x20'+a29_0xfad20c[_0x4daac7(0x1bf)](_0x599dea[_0x4daac7(0x185)])+_0x3011b7),console[_0x4daac7(0x173)]('\x20\x20'+a29_0xfad20c['dim'](_0x4daac7(0x267))+'\x20'+a29_0xfad20c['bold'](_0x599dea[_0x4daac7(0x27b)]+'.'+_0x599dea[_0x4daac7(0x24a)]));const _0x4feb2f=_0x599dea[_0x4daac7(0x1ae)]===_0x599dea['foreignKey']?a29_0xfad20c[_0x4daac7(0x1b9)](_0x4daac7(0x1bc))+'\x20'+_0x599dea[_0x4daac7(0x1ae)]:a29_0xfad20c['dim']('Join:')+'\x20'+_0x599dea[_0x4daac7(0x1ae)]+_0x4daac7(0x205)+_0x599dea[_0x4daac7(0x266)];console[_0x4daac7(0x173)]('\x20\x20'+_0x4feb2f),console['error']('\x20\x20'+a29_0xfad20c[_0x4daac7(0x1b9)]('Columns:')),this['displayColumns'](_0x599dea[_0x4daac7(0x15c)]),!_0x599dea['schemaValid']&&console[_0x4daac7(0x173)]('\x20\x20'+a29_0xfad20c[_0x4daac7(0x286)](_0x4daac7(0x199))+'\x20'+_0x599dea[_0x4daac7(0x25d)]);}}[a29_0x5453af(0x187)](_0x4fcd68,_0x1c1eb7){const _0x46b45c=a29_0x5453af;if(_0x4fcd68[_0x46b45c(0x19e)]['length']===0x0)return;console[_0x46b45c(0x173)]('\x0a'+a29_0xfad20c['dim']('Behaviors')+'\x20'+a29_0xfad20c['dim']('('+_0x1c1eb7+')'));for(const _0xff7cb1 of _0x4fcd68[_0x46b45c(0x19e)]){const _0x58ecda=_0xff7cb1['schemaValid']?a29_0xfad20c[_0x46b45c(0x226)]('✔'):a29_0xfad20c[_0x46b45c(0x286)]('✘');let _0x267000='';if(_0xff7cb1[_0x46b45c(0x241)]&&_0xff7cb1[_0x46b45c(0x25e)]!==undefined&&_0xff7cb1[_0x46b45c(0x169)]!==undefined){const _0x5698b6=_0xff7cb1['customerPercent']?.[_0x46b45c(0x171)](0x1)||'?',_0x400000=(_0xff7cb1[_0x46b45c(0x211)]??0x0)>=0x32?a29_0xfad20c['green']:(_0xff7cb1['customerPercent']??0x0)>=0x14?a29_0xfad20c['yellow']:a29_0xfad20c['red'];_0x267000='\x20'+a29_0xfad20c[_0x46b45c(0x1b9)](_0x46b45c(0x1f8))+'\x20'+_0x400000(formatRows(_0xff7cb1['customersWithEvents']))+'\x20('+_0x5698b6+_0x46b45c(0x1e3)+a29_0xfad20c['dim'](_0x46b45c(0x23e))+'\x20'+a29_0xfad20c[_0x46b45c(0x162)](formatRows(_0xff7cb1[_0x46b45c(0x169)]));}console['error'](_0x58ecda+'\x20'+a29_0xfad20c['bold'](_0xff7cb1[_0x46b45c(0x185)])+_0x267000),console[_0x46b45c(0x173)]('\x20\x20'+a29_0xfad20c[_0x46b45c(0x1b9)](_0x46b45c(0x267))+'\x20'+a29_0xfad20c[_0x46b45c(0x1bf)](_0xff7cb1[_0x46b45c(0x27b)]+'.'+_0xff7cb1[_0x46b45c(0x24a)]));const _0x38e4d1=_0xff7cb1[_0x46b45c(0x1ae)]===_0xff7cb1['foreignKey']?a29_0xfad20c[_0x46b45c(0x1b9)](_0x46b45c(0x1bc))+'\x20'+_0xff7cb1['joinKey']:a29_0xfad20c[_0x46b45c(0x1b9)]('Join:')+'\x20'+_0xff7cb1['joinKey']+_0x46b45c(0x205)+_0xff7cb1[_0x46b45c(0x266)];console[_0x46b45c(0x173)]('\x20\x20'+_0x38e4d1),console[_0x46b45c(0x173)]('\x20\x20'+a29_0xfad20c[_0x46b45c(0x1b9)](_0x46b45c(0x1c1))),this[_0x46b45c(0x164)](_0xff7cb1[_0x46b45c(0x15c)]),!_0xff7cb1['schemaValid']&&console[_0x46b45c(0x173)]('\x20\x20'+a29_0xfad20c['red'](_0x46b45c(0x199))+'\x20'+_0xff7cb1[_0x46b45c(0x25d)]);}}[a29_0x5453af(0x164)](_0x3e7a4f){const _0x1d6517=a29_0x5453af;for(const _0x4ff222 of _0x3e7a4f){_0x4ff222[_0x1d6517(0x1c7)]===_0x4ff222[_0x1d6517(0x16f)]||_0x4ff222[_0x1d6517(0x16f)]==='*'?console[_0x1d6517(0x173)]('\x20\x20\x20\x20-\x20'+_0x4ff222[_0x1d6517(0x1c7)]):console[_0x1d6517(0x173)](_0x1d6517(0x1c2)+_0x4ff222['label']+'\x20'+a29_0xfad20c[_0x1d6517(0x1b9)]('('+_0x4ff222['column']+')'));}}['displaySummary'](_0x131c1f){const _0x37d232=a29_0x5453af;console[_0x37d232(0x173)]('─'['repeat'](0x3c));if(_0x131c1f['errors'][_0x37d232(0x1fc)]>0x0){console[_0x37d232(0x173)]('\x0a'+a29_0xfad20c[_0x37d232(0x286)](_0x37d232(0x1ad)));for(const _0x29f2b0 of _0x131c1f[_0x37d232(0x22a)]){console[_0x37d232(0x173)]('\x20\x20'+a29_0xfad20c[_0x37d232(0x286)]('•')+'\x20'+_0x29f2b0);}}_0x131c1f[_0x37d232(0x1a7)]&&console['error']('\x0a'+a29_0xfad20c['green']('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x5453af(0x185)]='segment:parent:preview';[a29_0x5453af(0x280)]=a29_0x5453af(0x228);async[a29_0x5453af(0x21f)](_0x2a9c6f){const _0x36c8d0=a29_0x5453af,{options:_0x57db8f,args:_0x2fe4f4,tdx:_0x269e34}=_0x2a9c6f,_0x2deb39=_0x57db8f,_0x2e01e5=_0x2fe4f4[0x0]||_0x57db8f[_0x36c8d0(0x200)];if(!_0x2e01e5)return showParentSegmentNotSetError(_0x36c8d0(0x1cf)+_0x36c8d0(0x26c)+_0x36c8d0(0x15e)+_0x36c8d0(0x234)+_0x36c8d0(0x1b7)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x36c8d0(0x260)+_0x36c8d0(0x268)),0x1;if(!_0x2deb39['master']&&!_0x2deb39[_0x36c8d0(0x197)]&&!_0x2deb39[_0x36c8d0(0x184)]&&!_0x2deb39[_0x36c8d0(0x272)])return console['error'](a29_0xfad20c['red'](_0x36c8d0(0x1db))),console[_0x36c8d0(0x173)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x36c8d0(0x173)]('Options:'),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x36c8d0(0x173)](_0x36c8d0(0x1bb)),console['error'](_0x36c8d0(0x198)),0x1;const _0x13330c=resolveYamlFile(_0x2e01e5);if(!existsSync(_0x13330c))return showFileNotFoundError(_0x13330c,_0x2e01e5),0x1;_0x2deb39[_0x36c8d0(0x19d)]&&(console[_0x36c8d0(0x173)](_0x36c8d0(0x255)+_0x2deb39[_0x36c8d0(0x180)]),console[_0x36c8d0(0x173)]('YAML\x20file:\x20'+_0x13330c));let _0xb7d27;try{_0xb7d27=readFileSync(_0x13330c,_0x36c8d0(0x193));}catch(_0x212e7f){const _0x5b9d39=_0x212e7f instanceof Error?_0x212e7f[_0x36c8d0(0x175)]:String(_0x212e7f);return console[_0x36c8d0(0x173)]('Error\x20reading\x20file:\x20'+_0x5b9d39),0x1;}let _0x2d735c;try{_0x2d735c=parseYamlString(_0xb7d27);}catch(_0xb5a083){const _0x30cbb1=_0xb5a083 instanceof Error?_0xb5a083['message']:String(_0xb5a083);return console[_0x36c8d0(0x173)](a29_0xfad20c[_0x36c8d0(0x286)]('Error\x20parsing\x20YAML:\x20'+_0x30cbb1)),0x1;}if(_0x2deb39[_0x36c8d0(0x197)]===!![]||_0x2deb39[_0x36c8d0(0x197)]===''){const _0x334035=_0x2d735c['attributes']?.[_0x36c8d0(0x25c)](_0x449274=>_0x449274['name'])||[];if(_0x334035['length']===0x0)console[_0x36c8d0(0x173)](a29_0xfad20c[_0x36c8d0(0x286)](_0x36c8d0(0x231)));else{console[_0x36c8d0(0x173)](a29_0xfad20c['red'](_0x36c8d0(0x222))),console[_0x36c8d0(0x173)](_0x36c8d0(0x1bd));for(const _0x25f598 of _0x334035){console[_0x36c8d0(0x173)]('\x20\x20'+a29_0xfad20c['cyan'](_0x25f598));}console[_0x36c8d0(0x173)](_0x36c8d0(0x238)+_0x2e01e5+_0x36c8d0(0x1d6)+_0x334035[0x0]+'\x22');}return 0x1;}if(_0x2deb39[_0x36c8d0(0x184)]===!![]||_0x2deb39[_0x36c8d0(0x184)]===''){const _0xa2ffbd=_0x2d735c[_0x36c8d0(0x19e)]?.['map'](_0x35f209=>_0x35f209[_0x36c8d0(0x185)])||[];if(_0xa2ffbd[_0x36c8d0(0x1fc)]===0x0)console[_0x36c8d0(0x173)](a29_0xfad20c[_0x36c8d0(0x286)](_0x36c8d0(0x1b1)));else{console[_0x36c8d0(0x173)](a29_0xfad20c[_0x36c8d0(0x286)](_0x36c8d0(0x1d2))),console['error'](_0x36c8d0(0x174));for(const _0x597579 of _0xa2ffbd){console['error']('\x20\x20'+a29_0xfad20c[_0x36c8d0(0x162)](_0x597579));}console[_0x36c8d0(0x173)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x2e01e5+'\x20--behavior\x20\x22'+_0xa2ffbd[0x0]+'\x22');}return 0x1;}const _0x3d4f59=createCommandSpinner(a29_0xfad20c['dim']('Fetching\x20sample\x20data...'),{'verbose':_0x2deb39['verbose']});_0x3d4f59[_0x36c8d0(0x27f)]();const _0x54c6b9={'onProgress':_0x2e2f2b=>{_0x3d4f59['text']=formatProgressMessage(_0x2e2f2b);}};if(_0x2deb39[_0x36c8d0(0x1d7)])_0x54c6b9[_0x36c8d0(0x1d7)]=!![];if(_0x2deb39[_0x36c8d0(0x197)]&&typeof _0x2deb39[_0x36c8d0(0x197)]===_0x36c8d0(0x17b))_0x54c6b9[_0x36c8d0(0x197)]=_0x2deb39[_0x36c8d0(0x197)];if(_0x2deb39[_0x36c8d0(0x184)]&&typeof _0x2deb39['behavior']==='string')_0x54c6b9[_0x36c8d0(0x184)]=_0x2deb39[_0x36c8d0(0x184)];if(_0x2deb39[_0x36c8d0(0x272)])_0x54c6b9[_0x36c8d0(0x272)]=!![];if(_0x2deb39['interval'])_0x54c6b9[_0x36c8d0(0x22b)]=_0x2deb39[_0x36c8d0(0x22b)];let _0x312e40;try{_0x312e40=await _0x269e34[_0x36c8d0(0x1a8)][_0x36c8d0(0x1e2)](_0xb7d27,_0x54c6b9),_0x3d4f59['stop']();}catch(_0x1fb77c){_0x3d4f59[_0x36c8d0(0x161)]();throw _0x1fb77c;}return await this[_0x36c8d0(0x1a1)](_0x312e40,{'master':_0x2deb39[_0x36c8d0(0x1d7)],'attribute':typeof _0x2deb39[_0x36c8d0(0x197)]===_0x36c8d0(0x17b)?_0x2deb39[_0x36c8d0(0x197)]:undefined,'behavior':typeof _0x2deb39[_0x36c8d0(0x184)]===_0x36c8d0(0x17b)?_0x2deb39['behavior']:undefined,'enriched':_0x2deb39[_0x36c8d0(0x272)]}),_0x312e40[_0x36c8d0(0x1a7)]?0x0:0x1;}async[a29_0x5453af(0x1a1)](_0x199779,_0x56fc67){const _0x4c1416=a29_0x5453af;console['error']('\x0a'+a29_0xfad20c[_0x4c1416(0x1bf)](_0x4c1416(0x25b))+'\x20'+_0x199779[_0x4c1416(0x185)]),console[_0x4c1416(0x173)]('═'['repeat'](0x3c));if(_0x56fc67[_0x4c1416(0x1d7)]&&_0x199779[_0x4c1416(0x201)]){const _0x40d60a=a29_0xfad20c[_0x4c1416(0x1b9)](_0x4c1416(0x1b8))+'\x20'+a29_0xfad20c[_0x4c1416(0x1bf)](_0x199779[_0x4c1416(0x1d7)]['database']+'.'+_0x199779[_0x4c1416(0x1d7)][_0x4c1416(0x24a)]);await this[_0x4c1416(0x23b)](_0x40d60a,_0x199779['sampleData']);}else{if(_0x56fc67[_0x4c1416(0x197)]&&_0x199779[_0x4c1416(0x201)]){const _0x24ca43=a29_0xfad20c['dim'](_0x4c1416(0x1cb))+'\x20'+a29_0xfad20c[_0x4c1416(0x1bf)](_0x56fc67[_0x4c1416(0x197)]);await this[_0x4c1416(0x23b)](_0x24ca43,_0x199779[_0x4c1416(0x201)]);}else{if(_0x56fc67[_0x4c1416(0x184)]&&_0x199779[_0x4c1416(0x201)]){const _0x68cf02=a29_0xfad20c[_0x4c1416(0x1b9)](_0x4c1416(0x1ba))+'\x20'+a29_0xfad20c[_0x4c1416(0x1bf)](_0x56fc67['behavior']);await this[_0x4c1416(0x23b)](_0x68cf02,_0x199779[_0x4c1416(0x201)]);}else{if(_0x56fc67[_0x4c1416(0x272)]&&_0x199779[_0x4c1416(0x201)]){const _0xbe684d=a29_0xfad20c['dim'](_0x4c1416(0x167))+'\x20'+a29_0xfad20c['bold']('Master\x20+\x20Attributes');await this[_0x4c1416(0x23b)](_0xbe684d,_0x199779['sampleData']);}else!_0x199779['sampleData']&&console[_0x4c1416(0x173)](_0x4c1416(0x1e5));}}}if(_0x199779[_0x4c1416(0x22a)][_0x4c1416(0x1fc)]>0x0){console[_0x4c1416(0x173)]('─'['repeat'](0x3c)),console[_0x4c1416(0x173)]('\x0a'+a29_0xfad20c[_0x4c1416(0x286)](_0x4c1416(0x1ad)));for(const _0x441dd2 of _0x199779[_0x4c1416(0x22a)]){console[_0x4c1416(0x173)]('\x20\x20'+a29_0xfad20c[_0x4c1416(0x286)]('•')+'\x20'+_0x441dd2);}}}async[a29_0x5453af(0x23b)](_0x1c124a,_0x4eaf81){const _0x12b68b=a29_0x5453af;if(_0x4eaf81[_0x12b68b(0x1fc)]===0x0){console[_0x12b68b(0x173)]('\x0a'+_0x1c124a),console[_0x12b68b(0x173)](_0x12b68b(0x284));return;}console['error']('\x0a'+_0x1c124a);const _0x25a659=Object[_0x12b68b(0x237)](_0x4eaf81[0x0])[_0x12b68b(0x25c)](_0x4278ec=>({'name':_0x4278ec,'type':typeof _0x4eaf81[0x0][_0x4278ec]===_0x12b68b(0x227)?_0x12b68b(0x251):_0x12b68b(0x232)})),_0x27f486={'queryId':_0x12b68b(0x1fa),'columns':_0x25a659,'data':_0x4eaf81,'stats':{'state':_0x12b68b(0x283),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4eaf81[_0x12b68b(0x1fc)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x595769=formatAsTable(_0x27f486,_0x4eaf81[_0x12b68b(0x1fc)],!![]);await writeOutput(_0x595769,undefined,_0x12b68b(0x24a));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x5453af(0x185)]=a29_0x5453af(0x18e);[a29_0x5453af(0x280)]=a29_0x5453af(0x1f6);async['execute'](_0x5c7057){const _0x4bf6ef=a29_0x5453af,{options:_0x40a94e,args:_0x4983cc,tdx:_0x1b473e}=_0x5c7057,_0x59d70b=_0x40a94e,_0x28130c=_0x4983cc[0x0]||_0x40a94e[_0x4bf6ef(0x200)];if(!_0x28130c)return showParentSegmentNotSetError(_0x4bf6ef(0x16b)+_0x4bf6ef(0x26a)),0x1;const _0x2b4e5e=resolveYamlFile(_0x28130c);if(existsSync(_0x2b4e5e)){_0x59d70b[_0x4bf6ef(0x19d)]&&console[_0x4bf6ef(0x173)]('Found\x20YAML\x20file:\x20'+_0x2b4e5e);let _0x32384;try{_0x32384=readFileSync(_0x2b4e5e,_0x4bf6ef(0x193));}catch(_0x5af553){const _0xf0b0e9=_0x5af553 instanceof Error?_0x5af553['message']:String(_0x5af553);return console['error'](_0x4bf6ef(0x1d1)+_0xf0b0e9),0x1;}const _0x423c4d=await withSpinner(_0x4bf6ef(0x1fd),()=>_0x1b473e[_0x4bf6ef(0x1a8)][_0x4bf6ef(0x1aa)](_0x32384),{'verbose':_0x59d70b[_0x4bf6ef(0x19d)]}),_0x433ddc=_0x423c4d[_0x4bf6ef(0x1e6)],{isNew:_0x5a317e,name:_0x280ac0,hasChanges:_0x2005fc,diffFormatted:_0x2da862}=_0x433ddc;if(_0x2005fc){_0x5a317e?console[_0x4bf6ef(0x173)](_0x4bf6ef(0x1b5)+_0x280ac0+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x280ac0+'\x27:');console[_0x4bf6ef(0x173)]('─'[_0x4bf6ef(0x1ed)](0x3c)),console[_0x4bf6ef(0x173)](_0x2da862),console['error']('─'[_0x4bf6ef(0x1ed)](0x3c));const _0x19e4f8=_0x5a317e?'Create\x20parent\x20segment\x20\x27'+_0x280ac0+_0x4bf6ef(0x1fe):_0x4bf6ef(0x172)+_0x280ac0+_0x4bf6ef(0x1fe);if(!_0x59d70b[_0x4bf6ef(0x27d)]){const _0xc0c64a=await confirmKey(_0x19e4f8);if(!_0xc0c64a)return console[_0x4bf6ef(0x173)](_0x4bf6ef(0x166)),0x1;}const _0xa35174=_0x5a317e?_0x4bf6ef(0x22c):'Updating';await withSpinner(_0xa35174+'\x20parent\x20segment\x20\x27'+_0x280ac0+_0x4bf6ef(0x1d4),()=>_0x433ddc[_0x4bf6ef(0x233)](),{'verbose':_0x59d70b['verbose']});const _0x22a030=_0x5a317e?_0x4bf6ef(0x27a):_0x4bf6ef(0x243);console[_0x4bf6ef(0x173)]('✔\x20'+_0x22a030+'\x20parent\x20segment\x20\x27'+_0x280ac0+'\x27');}else console['error'](_0x4bf6ef(0x216)+_0x280ac0+_0x4bf6ef(0x196));}const _0x54ca59=await withSpinner(_0x4bf6ef(0x163)+_0x28130c+_0x4bf6ef(0x1d4),()=>_0x1b473e[_0x4bf6ef(0x1a8)][_0x4bf6ef(0x208)](_0x28130c),{'verbose':_0x59d70b[_0x4bf6ef(0x19d)]}),_0x6b93db=_0x54ca59[_0x4bf6ef(0x1e6)],_0x465223=getConsoleUrl(_0x59d70b[_0x4bf6ef(0x180)],_0x4bf6ef(0x202)+_0x6b93db[_0x4bf6ef(0x253)]+_0x4bf6ef(0x20f)+_0x6b93db[_0x4bf6ef(0x258)]+'/attempt/'+_0x6b93db[_0x4bf6ef(0x276)]);return console[_0x4bf6ef(0x173)](_0x4bf6ef(0x279)),console[_0x4bf6ef(0x173)]('\x20\x20'+a29_0xfad20c[_0x4bf6ef(0x1b9)](_0x4bf6ef(0x26d))+'\x20'+_0x6b93db[_0x4bf6ef(0x15f)]),console[_0x4bf6ef(0x173)]('\x20\x20'+a29_0xfad20c[_0x4bf6ef(0x1b9)](_0x4bf6ef(0x1c4))+'\x20'+_0x6b93db[_0x4bf6ef(0x1ca)]),console[_0x4bf6ef(0x173)]('\x20\x20'+a29_0xfad20c[_0x4bf6ef(0x1b9)](_0x4bf6ef(0x206))+'\x20'+_0x6b93db[_0x4bf6ef(0x258)]),console['error']('\x20\x20'+a29_0xfad20c['dim'](_0x4bf6ef(0x20c))+'\x20'+_0x6b93db['workflowAttemptId']),console[_0x4bf6ef(0x173)]('\x20\x20'+_0x465223),console['error']('\x0a'+a29_0xfad20c[_0x4bf6ef(0x1b9)]('To\x20cancel:')+_0x4bf6ef(0x1e1)+_0x6b93db[_0x4bf6ef(0x276)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a29_0x5453af(0x280)]=a29_0x5453af(0x223);async[a29_0x5453af(0x21f)](_0x29208e){const _0x424532=a29_0x5453af,{options:_0xd3c295,args:_0x539303,tdx:_0x1305db}=_0x29208e,_0x3a9d0a=_0x539303[0x0]||_0xd3c295[_0x424532(0x200)];if(!_0x3a9d0a)return showParentSegmentNotSetError(_0x424532(0x215)+_0x424532(0x16d)),0x1;_0xd3c295[_0x424532(0x19d)]&&(console[_0x424532(0x173)](_0x424532(0x255)+_0xd3c295['site']),console[_0x424532(0x173)](_0x424532(0x1a2)+_0x3a9d0a));const _0x4a3e4a=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x3a9d0a+_0x424532(0x1d4),()=>_0x1305db[_0x424532(0x1a8)][_0x424532(0x265)](_0x3a9d0a),{'verbose':_0xd3c295['verbose']}),_0xd2df8a=_0x4a3e4a[_0x424532(0x1e6)];console[_0x424532(0x173)](_0x424532(0x1f7)+_0xd2df8a['length']+_0x424532(0x257)+(_0xd2df8a['length']!==0x1?'s':''));if(_0xd3c295[_0x424532(0x1e7)]||_0xd3c295[_0x424532(0x24d)])return await handleSDKOutput(_0xd2df8a,_0xd3c295),0x0;return displayFieldsHumanReadable(_0xd2df8a,_0x3a9d0a),0x0;}}function a29_0x2858(){const _0x2fba94=['displayAttributesStats','totalEvents','format','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\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','1001721hTjnZl','column','xdg-open','toFixed','Apply\x20changes\x20to\x20\x27','error','Available\x20behaviors:','message','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x0a⚠️\x20\x20Both\x20','replace','addBehaviorsFile','/{name}.yml\x0a','string','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','unref','updateParent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','site','/app/dw/parentSegments/','resolveParentId','\x0aChanges\x20to\x20apply\x20to\x20\x27','behavior','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','displayBehaviorsStats','2248176YYQCiF','isDirectory','platform','\x20--behavior\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','👥\x20','segment:parent:run','Listing\x20parent\x20segments\x20matching\x20\x27','sort','Validating\x20configuration...','trim','utf-8','segment:parent:create','yellow','\x27\x20is\x20up\x20to\x20date','attribute','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Error:','attributes','all','query','verbose','behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x5c$&','displayPreviewResults','Parent\x20segment:\x20','ignore','.yml','segment:parent:show','segment:parent:list','allValid','segment','limit','pushParentYaml','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','displaySummary','Errors:','joinKey','46uJVDcH','endsWith','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','using\x20the\x20default\x20path:\x20','validateParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x0aNew\x20parent\x20segment\x20\x27','createParent','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Master:','dim','Behavior:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Join\x20on:','Available\x20attributes:','getParentFull','bold','YAML\x20file:\x20','Columns:','\x20\x20\x20\x20-\x20','segment:parent:pull','Status:','\x20parent\x20segment','-1d','label','use','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','status','Attribute:','population','join','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','filter','Error\x20reading\x20file:\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','`\x20to\x20download\x20the\x20configuration\x20first','\x27...','Rows:','\x20--attribute\x20\x22','master','setJobId','rowCount','Fetching\x20parent\x20segment\x20\x27','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','segment:parent:validate','\x20tdx\x20wf\x20attempt\x20','previewParentYaml','%)\x20','Executing\x20parent\x20segment\x20query...','\x0aNo\x20sample\x20data\x20available','data','json','Show\x20parent\x20segment\x20details','/\x20directories\x20exist.','Output\x20file:\x20','192xGtvXB','test','repeat','output','\x0a⚠️\x20\x20Migrating:\x20','timezone','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','segment:parent:desc','✔\x20Renamed\x20directory\x20to\x20','Database:\x20','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','✔\x20Found\x20','Customers:','parent_segments','preview','listParents','length','Analyzing\x20changes...','\x27\x20and\x20run\x20workflow?','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','parentSegment','sampleData','/app/workflows/','customerGroup','jobId','\x20=\x20','Session:','4428290oLwyYM','runParent','\x0aChanges\x20to\x20\x27','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','getParentSQL','Attempt:','SELECT\x20*\x20FROM\x20(\x0a','59TWNuHL','/sessions/','\x20[Job\x20ID:\x20','customerPercent','in\x20','scheduleOption','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','segment:parent:update','44xJzmKN','matchedCount','text','run','✔\x20Created\x20parent\x20segment\x20\x27','\x27\x20is\x20already\x20up\x20to\x20date','execute','\x20Context\x20set:\x20','\x20rows\x20','Error:\x20--attribute\x20requires\x20a\x20name\x0a','List\x20available\x20fields\x20for\x20segmentation','List\x20parent\x20segments','\x20--enriched','green','number','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','errors','interval','Creating','customerGroupFile','44215eMYMTT','2882277xCXNar','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','varchar','apply','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','behaviorsFile','✔\x20Updated\x20parent\x20segment\x20\x27','keys','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','877476bzCUKL','displaySampleData','To\x20view\x20sample\x20data:','Create\x20parent\x20segment\x20\x27','Events:','Listing\x20parent\x20segments...','\x20parent\x20segment\x20\x27','schemaValid','toLocaleString','Updated','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Validate:','displayPreviewHints','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','✔\x20Query\x20completed:\x20Processed\x20','Table:\x20','table','addBehaviors','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','jsonl','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Updating\x20parent\x20segment\x20\x27','Creating\x20parent\x20segment\x20\x27','double','Options:\x0a','workflowId','open','Site:\x20','/\x20→\x20','\x20field','workflowSessionId','✘\x20Failed\x20to\x20rename\x20directory:\x20','8coDObC','Preview:','map','schemaError','customersWithEvents','displayMasterInfo','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','scheduleType','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','tdx\x20segment\x20parent\x20preview\x20','session','listFields','foreignKey','Source:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\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','Audience\x20ID:','Resolving\x20parent\x20segment\x20\x27','localeCompare','\x20--attribute\x20\x22<name>\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','enriched','win32','Fetching\x20SQL\x20for\x20\x27','Updating','workflowAttemptId','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Master\x20Table','\x0a✔\x20Workflow\x20started','Created','database','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','yes','log','start','description','elapsedTimeMillis','Pattern:\x20','FINISHED','\x20\x20No\x20sample\x20data\x20available','Fetching\x20current\x20configuration\x20for\x20\x27','red','Name:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','web','coveragePercent','columns','Coverage:','Options\x20(one\x20required):\x0a','audienceId','No\x20parent\x20segments\x20found','stop','cyan','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','displayColumns','Attributes','Aborted.','Enriched:'];a29_0x2858=function(){return _0x2fba94;};return a29_0x2858();}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x5453af(0x185)]='segment:parent:view';['description']=a29_0x5453af(0x1e8);async[a29_0x5453af(0x21f)](_0x94cca7){const _0x5864af=a29_0x5453af,{options:_0x5cc6e1,args:_0x3dc832,tdx:_0x26d2a3}=_0x94cca7,_0x32051c=_0x5cc6e1,_0x3d7a0d=_0x3dc832[0x0]||_0x5cc6e1[_0x5864af(0x200)];if(!_0x3d7a0d)return showParentSegmentNotSetError(_0x5864af(0x24c)+_0x5864af(0x19f)+_0x5864af(0x252)+_0x5864af(0x1f2)),0x1;_0x5cc6e1[_0x5864af(0x19d)]&&(console[_0x5864af(0x173)]('Site:\x20'+_0x5cc6e1[_0x5864af(0x180)]),console[_0x5864af(0x173)](_0x5864af(0x1a2)+_0x3d7a0d));const _0x48ef9c=await withSpinner(_0x5864af(0x1da)+_0x3d7a0d+'\x27...',()=>_0x26d2a3[_0x5864af(0x1a8)][_0x5864af(0x1be)](_0x3d7a0d),{'verbose':_0x5cc6e1[_0x5864af(0x19d)]}),_0x30eddc=_0x48ef9c[_0x5864af(0x1e6)];if(_0x32051c[_0x5864af(0x15a)]){const _0x409053=getConsoleNextUrl(_0x32051c[_0x5864af(0x180)],'/app/dw/parentSegments/'+_0x30eddc['id']);return console[_0x5864af(0x173)](a29_0xfad20c['green']('✔')+'\x20Opening\x20'+a29_0xfad20c[_0x5864af(0x162)](_0x409053)),openBrowser(_0x409053),0x0;}return await handleSingleObjectOutput(_0x30eddc,_0x5cc6e1),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a29_0x5453af(0x1f3);[a29_0x5453af(0x280)]=a29_0x5453af(0x18c);async['execute'](_0x3dd26e){const _0x2e3a13=a29_0x5453af,{options:_0x343426,args:_0x390774,tdx:_0x5bb656}=_0x3dd26e,_0x2a80dc=_0x390774[0x0]||_0x343426['parentSegment'];if(!_0x2a80dc)return showParentSegmentNotSetError(_0x2e3a13(0x214)+_0x2e3a13(0x1de)),0x1;_0x343426[_0x2e3a13(0x19d)]&&(console[_0x2e3a13(0x173)]('Site:\x20'+_0x343426['site']),console[_0x2e3a13(0x173)]('Parent\x20segment:\x20'+_0x2a80dc));const _0x3d889e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2a80dc+_0x2e3a13(0x1d4),()=>_0x5bb656['segment'][_0x2e3a13(0x182)](_0x2a80dc),{'verbose':_0x343426['verbose']}),_0x101035=_0x3d889e[_0x2e3a13(0x1e6)],_0x5f48ac=await withSpinner(_0x2e3a13(0x274)+_0x2a80dc+_0x2e3a13(0x1d4),()=>_0x5bb656[_0x2e3a13(0x1a8)][_0x2e3a13(0x20b)](_0x101035),{'verbose':_0x343426[_0x2e3a13(0x19d)]}),_0x29ce5a=await executeSchemaQuery(_0x5f48ac[_0x2e3a13(0x1e6)],_0x5bb656,_0x343426);return await handleQueryOutput(_0x29ce5a,_0x343426),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x5453af(0x185)]='segment:parent:sql';[a29_0x5453af(0x280)]=a29_0x5453af(0x1dc);async['execute'](_0x135ebf){const _0x30f8a5=a29_0x5453af,{options:_0x2d106e,args:_0x5379ea,tdx:_0xd20f8f}=_0x135ebf,_0x49df96=_0x5379ea[0x0]||_0x2d106e[_0x30f8a5(0x200)];if(!_0x49df96)return showParentSegmentNotSetError(_0x30f8a5(0x27c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x2d106e[_0x30f8a5(0x19d)]&&(console[_0x30f8a5(0x173)](_0x30f8a5(0x255)+_0x2d106e['site']),console['error'](_0x30f8a5(0x1a2)+_0x49df96));const _0x9791c0=await withSpinner(_0x30f8a5(0x26e)+_0x49df96+_0x30f8a5(0x1d4),()=>_0xd20f8f['segment']['resolveParentId'](_0x49df96),{'verbose':_0x2d106e[_0x30f8a5(0x19d)]}),_0x30def8=_0x9791c0[_0x30f8a5(0x1e6)],_0x115aa7=await withSpinner(_0x30f8a5(0x274)+_0x49df96+_0x30f8a5(0x1d4),()=>_0xd20f8f[_0x30f8a5(0x1a8)][_0x30f8a5(0x20b)](_0x30def8),{'verbose':_0x2d106e[_0x30f8a5(0x19d)]}),_0x532c82=_0x115aa7['data'];return _0x2d106e[_0x30f8a5(0x16a)]===_0x30f8a5(0x1e7)||_0x2d106e['format']===_0x30f8a5(0x24d)?await handleSDKOutput([{'sql':_0x532c82}],_0x2d106e):console[_0x30f8a5(0x27e)](_0x532c82),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a29_0x5453af(0x1a5);['description']=a29_0x5453af(0x1df);async['execute'](_0x44652b){const _0xe1aee6=a29_0x5453af,{options:_0x2612a2,args:_0x3efba5,tdx:_0x2cd124}=_0x44652b,_0x5d2c06=_0x3efba5[0x0]||_0x2612a2[_0xe1aee6(0x200)];if(!_0x5d2c06)return showParentSegmentNotSetError(_0xe1aee6(0x247)+_0xe1aee6(0x1b4)),0x1;_0x2612a2['verbose']&&(console[_0xe1aee6(0x173)](_0xe1aee6(0x255)+_0x2612a2[_0xe1aee6(0x180)]),console['error']('Parent\x20segment:\x20'+_0x5d2c06));const _0x20e838=await withSpinner(_0xe1aee6(0x26e)+_0x5d2c06+_0xe1aee6(0x1d4),()=>_0x2cd124['segment'][_0xe1aee6(0x182)](_0x5d2c06),{'verbose':_0x2612a2[_0xe1aee6(0x19d)]}),_0x4dacaf=_0x20e838[_0xe1aee6(0x1e6)],_0x105c8a=await withSpinner(_0xe1aee6(0x274)+_0x5d2c06+'\x27...',()=>_0x2cd124[_0xe1aee6(0x1a8)][_0xe1aee6(0x20b)](_0x4dacaf),{'verbose':_0x2612a2[_0xe1aee6(0x19d)]});let _0x51e514=_0x105c8a[_0xe1aee6(0x1e6)];const _0x3ec0e3=resolveLimit(_0x2612a2[_0xe1aee6(0x1a9)],DEFAULT_DISPLAY_LIMIT),_0x36bd08=/\bLIMIT\s+\d+/i[_0xe1aee6(0x1ec)](_0x51e514);!_0x36bd08&&(_0x51e514=_0x51e514[_0xe1aee6(0x192)]()[_0xe1aee6(0x178)](/;+$/,''),_0x51e514=_0xe1aee6(0x20d)+_0x51e514+_0xe1aee6(0x239)+_0x3ec0e3);_0x2612a2[_0xe1aee6(0x19d)]&&console[_0xe1aee6(0x173)]('SQL\x20query:\x0a'+_0x51e514);const _0x3ce854=await withQuerySpinner(_0xe1aee6(0x1e4),async _0x858275=>{const _0x257101=_0xe1aee6,_0x565567=await _0x2cd124[_0x257101(0x19c)][_0x257101(0x21f)](_0x51e514,{'catalog':'td','schema':'information_schema','onJobId':_0x46cfce=>{const _0x2471e5=_0x257101;_0x858275[_0x2471e5(0x1d8)](_0x46cfce);}});return _0x565567;},{'verbose':_0x2612a2['verbose']}),_0x588cbc=_0x3ce854[_0xe1aee6(0x1e6)],_0x35e9f2=_0x588cbc[_0xe1aee6(0x204)]?_0xe1aee6(0x210)+_0x588cbc['jobId']+']':'';return console[_0xe1aee6(0x173)](_0xe1aee6(0x248)+_0x588cbc['stats']['processedRows'][_0xe1aee6(0x242)]()+_0xe1aee6(0x221)+(_0xe1aee6(0x212)+formatElapsed(_0x588cbc['stats'][_0xe1aee6(0x281)])+_0x35e9f2)),await handleQueryOutput(_0x588cbc,_0x2612a2),0x0;}}
|
|
1
|
+
const a29_0x367de6=a29_0x5e17;(function(_0xb7e2e6,_0x52d73c){const _0x14e270=a29_0x5e17,_0x36e10d=_0xb7e2e6();while(!![]){try{const _0x8c7734=parseInt(_0x14e270(0x1e5))/0x1*(parseInt(_0x14e270(0x2d7))/0x2)+parseInt(_0x14e270(0x24a))/0x3+parseInt(_0x14e270(0x207))/0x4+-parseInt(_0x14e270(0x2ba))/0x5+-parseInt(_0x14e270(0x2dc))/0x6+-parseInt(_0x14e270(0x272))/0x7+parseInt(_0x14e270(0x290))/0x8*(parseInt(_0x14e270(0x1e8))/0x9);if(_0x8c7734===_0x52d73c)break;else _0x36e10d['push'](_0x36e10d['shift']());}catch(_0xb5b95e){_0x36e10d['push'](_0x36e10d['shift']());}}}(a29_0x49f3,0x41220));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';function a29_0x49f3(){const _0x4ab331=['map','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','win32','Source:','workflowSessionId','\x0a⚠️\x20\x20Both\x20','✔\x20Created\x20parent\x20segment\x20\x27','\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','open','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','ignore','Output\x20file:\x20','bold','attribute','apply','\x0aChanges\x20to\x20\x27','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','1241277YBZJww','segment:parent:list','processedRows','cyan','Options:\x0a','.yml','foreignKey','jsonl','Preview:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','displayPreviewResults','resolveParentId','segment:parent:update','\x20Opening\x20','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','getParentSQL','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','segment:parent:preview','stats','Aborted.','utf-8','yellow','segment:parent:desc','Columns:','workflowId','sort','join','match','attributesFile','Table:\x20','localeCompare','web','Analyzing\x20changes...','database','text','Create\x20parent\x20segment\x20\x27','runParent','Apply\x20changes\x20to\x20\x27','execute','2668701FjhNfc','Attributes','tdx\x20segment\x20parent\x20preview\x20','toFixed','List\x20available\x20fields\x20for\x20segmentation','\x27\x20with\x20ID:\x20','\x0aNew\x20parent\x20segment\x20\x27','replace','in\x20','setJobId','displayColumns','\x20No\x20changes\x20-\x20','customerGroupFile','segment:parent:fields','Customers:','\x20\x20No\x20sample\x20data\x20available','red','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x27...','YAML\x20file:\x20','varchar','Database:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','verbose','Events:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','string','filter','Join:','Audience\x20ID:','8ubrOCd','\x20--interval\x20','length','behavior','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Enriched:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','green','toLocaleString','displayBehaviorsStats','Error:\x20File\x20not\x20found:\x20','errors','Updating\x20parent\x20segment\x20\x27','scheduleOption','jobId','darwin','Parent\x20segment:\x20','displayAttributesStats','Site:\x20','Attribute:','addBehaviorsFile','segment:parent:show','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','✔\x20Renamed\x20directory\x20to\x20','audienceId','using\x20the\x20default\x20path:\x20','joinKey','✔\x20Query\x20completed:\x20Processed\x20','session','behaviors','Join\x20on:','xdg-open','Name:\x20','displayMasterInfo','pullParentYaml','displayValidateResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','all','Fetching\x20sample\x20data...','Options:','\x27\x20is\x20up\x20to\x20date','table','1406450OpKGjx','scheduleType','master','%)\x20','\x20is\x20already\x20up\x20to\x20date','segment:parent:push','segment:parent:create','customerPercent','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Creating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Behaviors','\x20--enriched','unref','segment','column','Updating','test','timezone','rowCount','Session:','allValid','\x20field','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','output','/\x20→\x20','Status:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','2450ZmSTcW','SQL\x20query:\x0a','endsWith','description','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','2345538cennrk','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','repeat','\x0a⚠️\x20\x20Migrating:\x20','matchedCount','✔\x20No\x20changes\x20-\x20\x27','Error\x20parsing\x20YAML:\x20','\x20parent\x20segment\x20\x27','query','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x27\x20and\x20run\x20workflow?','Behavior:','✘\x20Failed\x20to\x20rename\x20directory:\x20','enriched','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','schemaError','platform','Master\x20+\x20Attributes','segment:parent:sql','message','dim','Created','workflowAttemptId','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','displayPreviewHints','pushParentYaml','\x20\x20\x20\x20-\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Errors:','addAttributesFile','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Get\x20SQL\x20query\x20for\x20parent\x20segment','Creating','dirname','To\x20cancel:','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','yes','Error:\x20Parent\x20segment\x20name\x20is\x20required','`\x20to\x20download\x20the\x20configuration\x20first','coveragePercent','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Rows:','100GOeoTT','\x20--behavior\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','4662612luqzkC','stop','Validate:','start','double','FINISHED','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','interval','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','log','segment:parent:validate','-1d','columns','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20Context\x20set:\x20','validateParentYaml','sampleData','parentSegment','\x20--attribute\x20\x22<name>\x22','/\x20directories\x20exist.','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','displaySummary','\x0aChanges\x20to\x20apply\x20to\x20\x27','/app/dw/parentSegments/','Updated','addBehaviors','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Attempt:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','parent_segment','1063652rFarab','site','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','run','Executing\x20parent\x20segment\x20query...','Listing\x20fields\x20for\x20\x27','json','elapsedTimeMillis','data','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Resolving\x20parent\x20segment\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','getParentFull','✔\x20Found\x20','\x20--behavior\x20\x22<name>\x22','segment:parent:view','displaySampleData','/attempt/','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Error\x20reading\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20=\x20','listParents','customerGroup','status','\x20rows)','Error:','Validating\x20configuration...','Error:\x20--database\x20and\x20--table\x20are\x20required','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','preview','Fetching\x20parent\x20segment\x20\x27','\x27\x20is\x20already\x20up\x20to\x20date','SELECT\x20*\x20FROM\x20(\x0a','information_schema','Listing\x20parent\x20segments\x20matching\x20\x27','attributes','customersWithEvents','format','segment:parent:run','totalEvents','schemaValid','label','Fetching\x20SQL\x20for\x20\x27','\x20parent\x20segment'];a29_0x49f3=function(){return _0x4ab331;};return a29_0x49f3();}import{spawn}from'child_process';import a29_0x31c5f7 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0x454280 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a29_0x367de6(0x206);function openBrowser(_0x2fd43f){const _0x39b447=a29_0x367de6,_0x55d5cf=process[_0x39b447(0x2ed)],_0x84cfc6=_0x55d5cf===_0x39b447(0x29f)?_0x39b447(0x241):_0x55d5cf===_0x39b447(0x23a)?_0x39b447(0x1eb):_0x39b447(0x2af);spawn(_0x84cfc6,[_0x2fd43f],{'detached':!![],'stdio':_0x39b447(0x243)})[_0x39b447(0x2c7)]();}function migrateLegacyDirectory(){const _0x3063a8=a29_0x367de6;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3989ad=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3989ad['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a29_0x454280[_0x3063a8(0x260)](_0x3063a8(0x23d)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x3063a8(0x1fb))),console['error'](a29_0x454280[_0x3063a8(0x1ce)](_0x3063a8(0x249)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x3063a8(0x25a)](a29_0x454280[_0x3063a8(0x260)](_0x3063a8(0x2df)+LEGACY_PARENT_SEGMENT_DIR+_0x3063a8(0x2d4)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x454280[_0x3063a8(0x297)](_0x3063a8(0x2a7)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x307257){const _0x16f4cb=_0x307257 instanceof Error?_0x307257[_0x3063a8(0x1cd)]:String(_0x307257);return console[_0x3063a8(0x25a)](a29_0x454280['red'](_0x3063a8(0x2e8)+_0x16f4cb+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x367de6(0x20a)](_0x331ee8){const _0xf00f64=a29_0x367de6;return migrateLegacyDirectory(),super[_0xf00f64(0x20a)](_0x331ee8);}}function resolveYamlFile(_0x1a2c2c){const _0x531ca6=a29_0x367de6;if(_0x1a2c2c['endsWith'](_0x531ca6(0x24f))||_0x1a2c2c[_0x531ca6(0x2d9)]('.yaml'))return _0x1a2c2c;return a29_0x31c5f7['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1a2c2c)+_0x531ca6(0x24f));}function formatProgressMessage(_0x143e94){const _0x219a05=a29_0x367de6,_0x5067f5=_0x143e94[_0x219a05(0x266)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5067f5){const [,_0x55aa3d,_0x5a88f4,_0x4aef75='']=_0x5067f5;return a29_0x454280[_0x219a05(0x1ce)](_0x55aa3d+':')+'\x20'+_0x5a88f4+a29_0x454280['dim'](_0x4aef75);}return a29_0x454280['dim'](_0x143e94);}function showFileNotFoundError(_0x9129eb,_0x559948){const _0x40cca0=a29_0x367de6;console[_0x40cca0(0x25a)](a29_0x454280['red'](_0x40cca0(0x29a)+_0x9129eb+'\x0a')),console[_0x40cca0(0x25a)](a29_0x454280[_0x40cca0(0x24d)](_0x40cca0(0x226)+_0x559948+_0x40cca0(0x1e1)));}function showParentSegmentNotSetError(_0x5199fa){const _0x532d4d=a29_0x367de6;console[_0x532d4d(0x25a)](a29_0x454280[_0x532d4d(0x260)](_0x532d4d(0x205))),console[_0x532d4d(0x25a)](_0x5199fa);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x24b);['description']='List\x20parent\x20segments';async[a29_0x367de6(0x271)](_0x53e9c0){const _0x482d85=a29_0x367de6,{options:_0x49691b,args:_0x3aaf05,tdx:_0x274151}=_0x53e9c0,_0x6a5bcf=_0x3aaf05[0x0];_0x49691b['verbose']&&(console[_0x482d85(0x25a)]('Site:\x20'+_0x49691b[_0x482d85(0x208)]),_0x6a5bcf&&console[_0x482d85(0x25a)]('Pattern:\x20'+_0x6a5bcf));const _0xd9eee1=await withSpinner(_0x6a5bcf?_0x482d85(0x22c)+_0x6a5bcf+_0x482d85(0x284):'Listing\x20parent\x20segments...',()=>_0x274151[_0x482d85(0x2c8)][_0x482d85(0x21f)](),{'verbose':_0x49691b[_0x482d85(0x289)]});let _0x17f4c6=_0xd9eee1[_0x482d85(0x20f)];if(_0x6a5bcf){const _0x16c7f1=_0x6a5bcf['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x482d85(0x279)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x46091e=new RegExp('^'+_0x16c7f1+'$','i');_0x17f4c6=_0x17f4c6[_0x482d85(0x28d)](_0x52f43c=>_0x46091e['test'](_0x52f43c[_0x482d85(0x22d)]['name']));}_0x17f4c6[_0x482d85(0x264)]((_0x4fe153,_0x2d302b)=>_0x4fe153[_0x482d85(0x22d)][_0x482d85(0x238)][_0x482d85(0x269)](_0x2d302b['attributes'][_0x482d85(0x238)])),console[_0x482d85(0x25a)](_0x482d85(0x215)+_0x17f4c6[_0x482d85(0x292)]+_0x482d85(0x235)+(_0x17f4c6[_0x482d85(0x292)]!==0x1?'s':''));if(_0x49691b[_0x482d85(0x22f)]==='json'||_0x49691b['format']===_0x482d85(0x251))await handleSDKOutput(_0x17f4c6,_0x49691b);else{if(_0x17f4c6['length']===0x0)_0x6a5bcf?console['log'](_0x482d85(0x1d6)+_0x6a5bcf):console['log']('No\x20parent\x20segments\x20found');else for(const _0xc10964 of _0x17f4c6){const _0x10fc95=_0xc10964[_0x482d85(0x22d)]['population']?a29_0x454280[_0x482d85(0x1ce)]('\x20('+formatRows(_0xc10964['attributes']['population'])+')'):'';console[_0x482d85(0x1f1)]('👥\x20'+_0xc10964[_0x482d85(0x22d)]['name']+_0x10fc95);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x2c0);[a29_0x367de6(0x2da)]=a29_0x367de6(0x258);async['execute'](_0x352bdc){const _0x50525e=a29_0x367de6,{options:_0x24215b,args:_0x58486c,tdx:_0x16b3b4}=_0x352bdc;console[_0x50525e(0x25a)](_0x50525e(0x210)+_0x50525e(0x237)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x42cf61=_0x24215b;if(_0x58486c['length']===0x0)return console[_0x50525e(0x25a)](a29_0x454280[_0x50525e(0x282)](_0x50525e(0x1e0))),console[_0x50525e(0x25a)](_0x50525e(0x1de)),0x1;const _0x2298d4=_0x58486c[0x0];if(!_0x42cf61[_0x50525e(0x26c)]||!_0x42cf61[_0x50525e(0x2b9)])return console[_0x50525e(0x25a)](_0x50525e(0x225)),console[_0x50525e(0x25a)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x42cf61['verbose']&&(console[_0x50525e(0x25a)](_0x50525e(0x2a2)+_0x42cf61[_0x50525e(0x208)]),console[_0x50525e(0x25a)](_0x50525e(0x2b0)+_0x2298d4),console[_0x50525e(0x25a)](_0x50525e(0x287)+_0x42cf61['database']),console[_0x50525e(0x25a)](_0x50525e(0x268)+_0x42cf61[_0x50525e(0x2b9)]));const _0x18c0c7=await loadJSONFromOptions(_0x42cf61[_0x50525e(0x22d)],_0x42cf61[_0x50525e(0x267)]),_0x477729=await loadJSONFromOptions(_0x42cf61[_0x50525e(0x2ad)],_0x42cf61['behaviorsFile']),_0x58b4c5=await loadJSONFromOptions(_0x42cf61[_0x50525e(0x220)],_0x42cf61[_0x50525e(0x27e)]),_0x51c59b={'name':_0x2298d4,'description':_0x42cf61['description'],'scheduleType':_0x42cf61[_0x50525e(0x2bb)],'scheduleOption':_0x42cf61[_0x50525e(0x29d)],'timezone':_0x42cf61['timezone'],'master':{'parentDatabaseName':_0x42cf61[_0x50525e(0x26c)],'parentTableName':_0x42cf61[_0x50525e(0x2b9)]},'attributes':_0x18c0c7,'behaviors':_0x477729,'customerGroup':_0x58b4c5},_0x22ee36=await withSpinner(_0x50525e(0x2c3)+_0x2298d4+'\x27...',()=>_0x16b3b4[_0x50525e(0x2c8)]['createParent'](_0x51c59b),{'verbose':_0x24215b[_0x50525e(0x289)]}),_0x35fd4a=_0x22ee36['data'];return console[_0x50525e(0x25a)](_0x50525e(0x23e)+_0x35fd4a[_0x50525e(0x238)]+_0x50525e(0x277)+_0x35fd4a['id']),await handleSDKOutput([_0x35fd4a],_0x24215b),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x256);['description']=a29_0x367de6(0x2db);async[a29_0x367de6(0x271)](_0xbe181){const _0x4d1eea=a29_0x367de6,{options:_0x4e9557,args:_0x2036df,tdx:_0x10f15e}=_0xbe181;console[_0x4d1eea(0x25a)](_0x4d1eea(0x1fc)+'\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 _0x341bc1=_0x4e9557;if(_0x2036df['length']===0x0)return console[_0x4d1eea(0x25a)](a29_0x454280[_0x4d1eea(0x282)](_0x4d1eea(0x1e0))),console[_0x4d1eea(0x25a)](_0x4d1eea(0x1f5)),0x1;const _0x24d32c=_0x2036df[0x0];_0x341bc1[_0x4d1eea(0x289)]&&(console[_0x4d1eea(0x25a)](_0x4d1eea(0x2a2)+_0x341bc1[_0x4d1eea(0x208)]),console['error'](_0x4d1eea(0x2a0)+_0x24d32c));const _0x565ccf=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x24d32c+_0x4d1eea(0x284),()=>_0x10f15e[_0x4d1eea(0x2c8)][_0x4d1eea(0x214)](_0x24d32c),{'verbose':_0x341bc1['verbose']}),_0x92afd7=_0x565ccf[_0x4d1eea(0x20f)],_0x378094=await loadJSONFromOptions(_0x341bc1['addAttributes'],_0x341bc1[_0x4d1eea(0x1d8)]),_0x5d488c=await loadJSONFromOptions(_0x341bc1[_0x4d1eea(0x201)],_0x341bc1[_0x4d1eea(0x2a4)]),_0x30a431={'name':_0x92afd7[_0x4d1eea(0x238)],'description':_0x341bc1[_0x4d1eea(0x2da)]!==undefined?_0x341bc1[_0x4d1eea(0x2da)]:_0x92afd7[_0x4d1eea(0x2da)],'scheduleType':_0x341bc1['scheduleType']!==undefined?_0x341bc1['scheduleType']:_0x92afd7[_0x4d1eea(0x2bb)],'scheduleOption':_0x341bc1[_0x4d1eea(0x29d)]!==undefined?_0x341bc1[_0x4d1eea(0x29d)]:_0x92afd7[_0x4d1eea(0x29d)],'timezone':_0x341bc1[_0x4d1eea(0x2cc)]!==undefined?_0x341bc1[_0x4d1eea(0x2cc)]:_0x92afd7[_0x4d1eea(0x2cc)],'master':_0x92afd7[_0x4d1eea(0x2bc)],'attributes':_0x378094?[..._0x92afd7['attributes']||[],..._0x378094]:_0x92afd7[_0x4d1eea(0x22d)],'behaviors':_0x5d488c?[..._0x92afd7['behaviors']||[],..._0x5d488c]:_0x92afd7[_0x4d1eea(0x2ad)],'customerGroup':_0x92afd7[_0x4d1eea(0x220)]},_0x1b6137=await withSpinner(_0x4d1eea(0x29c)+_0x24d32c+'\x27...',()=>_0x10f15e[_0x4d1eea(0x2c8)]['updateParent'](_0x24d32c,_0x30a431),{'verbose':_0x341bc1[_0x4d1eea(0x289)]}),_0x1d0764=_0x1b6137['data'];return console[_0x4d1eea(0x25a)](_0x4d1eea(0x202)+_0x1d0764[_0x4d1eea(0x238)]+'\x27'),await handleSDKOutput([_0x1d0764],_0x341bc1),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x367de6(0x238)]='segment:parent:pull';[a29_0x367de6(0x2da)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a29_0x367de6(0x271)](_0x40563f){const _0x5f0fa4=a29_0x367de6,{options:_0x527f31,args:_0x321459,tdx:_0x2265e1}=_0x40563f,_0x201d8a=_0x527f31,_0x178bf5=_0x321459[0x0]||_0x527f31['parentSegment'];if(!_0x178bf5)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x5f0fa4(0x28b)),0x1;if(_0x201d8a['use']&&_0x201d8a[_0x5f0fa4(0x2d3)])return console[_0x5f0fa4(0x25a)](a29_0x454280['red'](_0x5f0fa4(0x2c2))),console[_0x5f0fa4(0x25a)](a29_0x454280[_0x5f0fa4(0x1ce)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x5f0fa4(0x25a)](a29_0x454280['dim'](_0x5f0fa4(0x2a9)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x5f0fa4(0x25a)](a29_0x454280[_0x5f0fa4(0x24d)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0xd17662=_0x201d8a[_0x5f0fa4(0x2d3)]||a29_0x31c5f7[_0x5f0fa4(0x265)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x178bf5)+_0x5f0fa4(0x24f));_0x201d8a[_0x5f0fa4(0x289)]&&(console[_0x5f0fa4(0x25a)](_0x5f0fa4(0x2a2)+_0x201d8a[_0x5f0fa4(0x208)]),console['error']('Parent\x20segment:\x20'+_0x178bf5),console[_0x5f0fa4(0x25a)](_0x5f0fa4(0x244)+_0xd17662));const _0x584968=await withSpinner(_0x5f0fa4(0x228)+_0x178bf5+'\x27...',()=>_0x2265e1[_0x5f0fa4(0x2c8)][_0x5f0fa4(0x2b2)](_0x178bf5),{'verbose':_0x201d8a['verbose']}),_0x23e880=_0x584968['data'];if(existsSync(_0xd17662)){const _0x4e47ea=readFileSync(_0xd17662,'utf-8'),_0x26ac58=generateDiff(_0x4e47ea,_0x23e880);if(!hasChanges(_0x26ac58))console[_0x5f0fa4(0x25a)](a29_0x454280['green']('✔')+_0x5f0fa4(0x27d)+a29_0x454280['cyan'](_0xd17662)+_0x5f0fa4(0x2be));else{console[_0x5f0fa4(0x25a)](_0x5f0fa4(0x248)+_0xd17662+'\x27:'),console[_0x5f0fa4(0x25a)]('─'[_0x5f0fa4(0x2de)](0x3c)),console['error'](formatDiffWithColors(_0x26ac58)),console[_0x5f0fa4(0x25a)]('─'[_0x5f0fa4(0x2de)](0x3c));if(!_0x201d8a[_0x5f0fa4(0x1df)]){const _0x3cdd98=await confirmKey('Overwrite\x20\x27'+_0xd17662+'\x27?');if(!_0x3cdd98)return console[_0x5f0fa4(0x25a)](_0x5f0fa4(0x25e)),0x1;}writeFileSync(_0xd17662,_0x23e880,_0x5f0fa4(0x25f)),console['error'](a29_0x454280[_0x5f0fa4(0x297)]('✔')+_0x5f0fa4(0x2ea)+a29_0x454280['cyan'](_0xd17662));}}else{const _0x1355e0=a29_0x31c5f7[_0x5f0fa4(0x1dc)](_0xd17662);!existsSync(_0x1355e0)&&mkdirSync(_0x1355e0,{'recursive':!![]}),writeFileSync(_0xd17662,_0x23e880,_0x5f0fa4(0x25f)),console['error'](a29_0x454280['green']('✔')+_0x5f0fa4(0x2ea)+a29_0x454280[_0x5f0fa4(0x24d)](_0xd17662));}return saveSessionContext({'parent_segment':_0x178bf5},_0x201d8a[_0x5f0fa4(0x2ac)]),console[_0x5f0fa4(0x25a)](a29_0x454280[_0x5f0fa4(0x297)]('✔')+_0x5f0fa4(0x1f6)+a29_0x454280[_0x5f0fa4(0x1ce)](_0x5f0fa4(0x206))+_0x5f0fa4(0x21e)+a29_0x454280[_0x5f0fa4(0x24d)](_0x178bf5)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x2bf);['description']='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0xd82408){const _0x2081ac=a29_0x367de6,{options:_0x2e5ad7,args:_0x7b0c82,tdx:_0xf363e5}=_0xd82408,_0x43db2f=_0x2e5ad7,_0x23afc8=_0x7b0c82[0x0]||_0x2e5ad7[_0x2081ac(0x1f9)];if(!_0x23afc8)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'+_0x2081ac(0x2b4)),0x1;const _0x4c0591=resolveYamlFile(_0x23afc8);if(!existsSync(_0x4c0591))return showFileNotFoundError(_0x4c0591,_0x23afc8),0x1;_0x43db2f[_0x2081ac(0x289)]&&(console['error'](_0x2081ac(0x2a2)+_0x43db2f[_0x2081ac(0x208)]),console[_0x2081ac(0x25a)](_0x2081ac(0x285)+_0x4c0591));let _0x3ff4fd;try{_0x3ff4fd=readFileSync(_0x4c0591,_0x2081ac(0x25f));}catch(_0x1b2e3f){const _0x2e8026=_0x1b2e3f instanceof Error?_0x1b2e3f[_0x2081ac(0x1cd)]:String(_0x1b2e3f);return console['error'](_0x2081ac(0x21b)+_0x2e8026),0x1;}const _0x5997cf=await withSpinner(_0x2081ac(0x26b),()=>_0xf363e5[_0x2081ac(0x2c8)][_0x2081ac(0x1d4)](_0x3ff4fd),{'verbose':_0x43db2f[_0x2081ac(0x289)]}),_0x56d3b2=_0x5997cf[_0x2081ac(0x20f)],{isNew:_0x2256fc,name:_0x507cc4,hasChanges:_0x216d9d,diffFormatted:_0xd88ebb}=_0x56d3b2;if(!_0x216d9d)return console[_0x2081ac(0x25a)](_0x2081ac(0x2e1)+_0x507cc4+_0x2081ac(0x229)),0x0;_0x2256fc?console[_0x2081ac(0x25a)](_0x2081ac(0x278)+_0x507cc4+'\x27:'):console[_0x2081ac(0x25a)](_0x2081ac(0x1fe)+_0x507cc4+'\x27:');console[_0x2081ac(0x25a)]('─'[_0x2081ac(0x2de)](0x3c)),console[_0x2081ac(0x25a)](_0xd88ebb),console['error']('─'[_0x2081ac(0x2de)](0x3c));const _0x4d160a=_0x2256fc?_0x2081ac(0x26e)+_0x507cc4+'\x27?':_0x2081ac(0x270)+_0x507cc4+'\x27?';if(!_0x43db2f[_0x2081ac(0x1df)]){const _0x594701=await confirmKey(_0x4d160a);if(!_0x594701)return console[_0x2081ac(0x25a)](_0x2081ac(0x25e)),0x1;}const _0x44ee7d=_0x2256fc?_0x2081ac(0x1db):'Updating',_0x22c2d6=await withSpinner(_0x44ee7d+_0x2081ac(0x2e3)+_0x507cc4+_0x2081ac(0x284),()=>_0x56d3b2[_0x2081ac(0x247)](),{'verbose':_0x43db2f['verbose']}),_0x34fb6f=_0x22c2d6[_0x2081ac(0x20f)],_0x4d3e72=getConsoleNextUrl(_0x43db2f[_0x2081ac(0x208)],_0x2081ac(0x1ff)+_0x34fb6f['id']),_0x47c89c=_0x2256fc?_0x2081ac(0x1cf):'Updated';return console[_0x2081ac(0x25a)]('✔\x20'+_0x47c89c+_0x2081ac(0x2e3)+_0x34fb6f['name']+'\x27'),console[_0x2081ac(0x25a)]('\x20\x20'+_0x4d3e72),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x1f2);[a29_0x367de6(0x2da)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async['execute'](_0x23648d){const _0x517b24=a29_0x367de6,{options:_0x5a4fd6,args:_0x3943ed,tdx:_0x151307}=_0x23648d,_0x2ddf53=_0x5a4fd6,_0x5de2b9=_0x3943ed[0x0]||_0x5a4fd6[_0x517b24(0x1f9)];if(!_0x5de2b9)return showParentSegmentNotSetError(_0x517b24(0x240)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x517b24(0x24e)+_0x517b24(0x1f0)+_0x517b24(0x23f)+_0x517b24(0x242)),0x1;const _0x2f9441=resolveYamlFile(_0x5de2b9);if(!existsSync(_0x2f9441))return showFileNotFoundError(_0x2f9441,_0x5de2b9),0x1;_0x2ddf53[_0x517b24(0x289)]&&(console[_0x517b24(0x25a)](_0x517b24(0x2a2)+_0x2ddf53[_0x517b24(0x208)]),console[_0x517b24(0x25a)]('YAML\x20file:\x20'+_0x2f9441));let _0x3206b0;try{_0x3206b0=readFileSync(_0x2f9441,_0x517b24(0x25f));}catch(_0x41aea0){const _0x15ce8f=_0x41aea0 instanceof Error?_0x41aea0['message']:String(_0x41aea0);return console['error'](_0x517b24(0x21b)+_0x15ce8f),0x1;}const _0x43e5c0=createCommandSpinner(a29_0x454280[_0x517b24(0x1ce)](_0x517b24(0x224)),{'verbose':_0x2ddf53['verbose']});_0x43e5c0['start']();const _0x3c7786={'onProgress':_0x4f9be6=>{const _0x4bfd6e=_0x517b24;_0x43e5c0[_0x4bfd6e(0x26d)]=formatProgressMessage(_0x4f9be6);}};if(_0x2ddf53[_0x517b24(0x2bc)])_0x3c7786[_0x517b24(0x2bc)]=!![];if(_0x2ddf53[_0x517b24(0x2e9)])_0x3c7786['enriched']=!![];_0x2ddf53[_0x517b24(0x246)]&&(_0x3c7786['attribute']=_0x2ddf53[_0x517b24(0x246)]);_0x2ddf53['behavior']&&(_0x3c7786['behavior']=_0x2ddf53[_0x517b24(0x293)]);if(_0x2ddf53[_0x517b24(0x1ef)])_0x3c7786[_0x517b24(0x1ef)]=_0x2ddf53[_0x517b24(0x1ef)];let _0x350c60;try{_0x350c60=await _0x151307['segment'][_0x517b24(0x1f7)](_0x3206b0,_0x3c7786),_0x43e5c0['stop']();}catch(_0x275b6d){_0x43e5c0[_0x517b24(0x1e9)]();throw _0x275b6d;}const _0x4c2c76=_0x2ddf53['interval']||_0x517b24(0x1f3);return this['displayValidateResults'](_0x350c60,_0x3c7786,_0x2f9441,_0x4c2c76),_0x350c60[_0x517b24(0x2cf)]?0x0:0x1;}[a29_0x367de6(0x2b3)](_0x4c428f,_0x36cc2a,_0x421fc4,_0x458b6b){const _0x29b8bc=a29_0x367de6;console['error']('\x0a'+a29_0x454280[_0x29b8bc(0x245)](_0x29b8bc(0x1ea))+'\x20'+_0x4c428f['name']),console['error']('═'[_0x29b8bc(0x2de)](0x3c)),this[_0x29b8bc(0x2b1)](_0x4c428f);if(typeof _0x36cc2a[_0x29b8bc(0x246)]==='string'){this[_0x29b8bc(0x2a1)](_0x4c428f),this['displaySummary'](_0x4c428f),this[_0x29b8bc(0x1d3)](_0x421fc4,_0x458b6b,_0x29b8bc(0x246),_0x36cc2a[_0x29b8bc(0x246)]);return;}if(_0x36cc2a[_0x29b8bc(0x246)]===!![]){this[_0x29b8bc(0x2a1)](_0x4c428f),this['displaySummary'](_0x4c428f),this[_0x29b8bc(0x1d3)](_0x421fc4,_0x458b6b,'attributes');return;}if(typeof _0x36cc2a[_0x29b8bc(0x293)]===_0x29b8bc(0x28c)){this[_0x29b8bc(0x299)](_0x4c428f,_0x458b6b),this[_0x29b8bc(0x1fd)](_0x4c428f),this['displayPreviewHints'](_0x421fc4,_0x458b6b,_0x29b8bc(0x293),_0x36cc2a['behavior']);return;}if(_0x36cc2a[_0x29b8bc(0x293)]===!![]){this[_0x29b8bc(0x299)](_0x4c428f,_0x458b6b),this['displaySummary'](_0x4c428f),this['displayPreviewHints'](_0x421fc4,_0x458b6b,_0x29b8bc(0x2ad));return;}this['displayAttributesStats'](_0x4c428f),this['displayBehaviorsStats'](_0x4c428f,_0x458b6b),this[_0x29b8bc(0x1fd)](_0x4c428f),this[_0x29b8bc(0x1d3)](_0x421fc4,_0x458b6b,_0x29b8bc(0x2b5));}[a29_0x367de6(0x1d3)](_0x2fd187,_0x4bea79,_0x47dbf6,_0x29538a){const _0x45c4e1=a29_0x367de6;console[_0x45c4e1(0x25a)]('\x0a'+a29_0x454280['dim']('To\x20view\x20sample\x20data:'));const _0x46923d=_0x4bea79!==_0x45c4e1(0x1f3)?_0x45c4e1(0x291)+_0x4bea79:'';if(_0x47dbf6==='attribute'&&_0x29538a)console[_0x45c4e1(0x25a)]('\x20\x20'+a29_0x454280['dim'](_0x45c4e1(0x274)+_0x2fd187+'\x20--attribute\x20\x22'+_0x29538a+'\x22'+_0x46923d));else{if(_0x47dbf6===_0x45c4e1(0x293)&&_0x29538a)console[_0x45c4e1(0x25a)]('\x20\x20'+a29_0x454280[_0x45c4e1(0x1ce)](_0x45c4e1(0x274)+_0x2fd187+_0x45c4e1(0x1e6)+_0x29538a+'\x22'+_0x46923d));else(_0x47dbf6===_0x45c4e1(0x22d)||_0x47dbf6==='all')&&console[_0x45c4e1(0x25a)]('\x20\x20'+a29_0x454280[_0x45c4e1(0x1ce)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2fd187+_0x45c4e1(0x1fa)+_0x46923d));}(_0x47dbf6===_0x45c4e1(0x2ad)||_0x47dbf6===_0x45c4e1(0x2b5))&&console['error']('\x20\x20'+a29_0x454280['dim'](_0x45c4e1(0x274)+_0x2fd187+_0x45c4e1(0x216)+_0x46923d)),_0x47dbf6===_0x45c4e1(0x2b5)&&console[_0x45c4e1(0x25a)]('\x20\x20'+a29_0x454280['dim'](_0x45c4e1(0x274)+_0x2fd187+_0x45c4e1(0x2c6)+_0x46923d));}[a29_0x367de6(0x2b1)](_0x280b69){const _0x6fdaf6=a29_0x367de6,{master:_0x25f3c9}=_0x280b69,_0x240777=_0x25f3c9[_0x6fdaf6(0x232)]?a29_0x454280[_0x6fdaf6(0x297)]('✔'):a29_0x454280[_0x6fdaf6(0x282)]('✘');console[_0x6fdaf6(0x25a)]('\x0a'+a29_0x454280[_0x6fdaf6(0x1ce)]('Master\x20Table')),console[_0x6fdaf6(0x25a)](_0x240777+'\x20'+a29_0x454280[_0x6fdaf6(0x245)](_0x25f3c9[_0x6fdaf6(0x26c)]+'.'+_0x25f3c9[_0x6fdaf6(0x2b9)])),_0x25f3c9['schemaValid']?_0x25f3c9[_0x6fdaf6(0x2cd)]!==undefined&&console['error']('\x20\x20'+a29_0x454280['dim'](_0x6fdaf6(0x1e4))+'\x20'+a29_0x454280[_0x6fdaf6(0x24d)](formatRows(_0x25f3c9[_0x6fdaf6(0x2cd)]))):console[_0x6fdaf6(0x25a)]('\x20\x20'+a29_0x454280[_0x6fdaf6(0x282)]('Error:')+'\x20'+_0x25f3c9[_0x6fdaf6(0x2ec)]);}[a29_0x367de6(0x2a1)](_0x35a044){const _0x56db89=a29_0x367de6;if(_0x35a044['attributes'][_0x56db89(0x292)]===0x0)return;console[_0x56db89(0x25a)]('\x0a'+a29_0x454280[_0x56db89(0x1ce)](_0x56db89(0x273)));for(const _0x140bbc of _0x35a044[_0x56db89(0x22d)]){const _0x29e85b=_0x140bbc[_0x56db89(0x232)]?a29_0x454280[_0x56db89(0x297)]('✔'):a29_0x454280['red']('✘');let _0x43c67e='';if(_0x140bbc[_0x56db89(0x232)]&&_0x140bbc['matchedCount']!==undefined&&_0x140bbc['coveragePercent']!==undefined){const _0x57379b=_0x140bbc[_0x56db89(0x1e2)]['toFixed'](0x1),_0x188fb8=_0x140bbc[_0x56db89(0x1e2)]>=0x50?a29_0x454280['green']:_0x140bbc[_0x56db89(0x1e2)]>=0x32?a29_0x454280[_0x56db89(0x260)]:a29_0x454280[_0x56db89(0x282)];_0x43c67e='\x20'+a29_0x454280[_0x56db89(0x1ce)]('Coverage:')+'\x20'+_0x188fb8(_0x57379b+'%')+'\x20('+formatRows(_0x140bbc[_0x56db89(0x2e0)])+_0x56db89(0x222);}console[_0x56db89(0x25a)](_0x29e85b+'\x20'+a29_0x454280[_0x56db89(0x245)](_0x140bbc[_0x56db89(0x238)])+_0x43c67e),console[_0x56db89(0x25a)]('\x20\x20'+a29_0x454280[_0x56db89(0x1ce)]('Source:')+'\x20'+a29_0x454280['bold'](_0x140bbc[_0x56db89(0x26c)]+'.'+_0x140bbc[_0x56db89(0x2b9)]));const _0x1dbd57=_0x140bbc[_0x56db89(0x2aa)]===_0x140bbc[_0x56db89(0x250)]?a29_0x454280[_0x56db89(0x1ce)](_0x56db89(0x2ae))+'\x20'+_0x140bbc[_0x56db89(0x2aa)]:a29_0x454280[_0x56db89(0x1ce)](_0x56db89(0x28e))+'\x20'+_0x140bbc[_0x56db89(0x2aa)]+_0x56db89(0x21e)+_0x140bbc[_0x56db89(0x250)];console['error']('\x20\x20'+_0x1dbd57),console['error']('\x20\x20'+a29_0x454280[_0x56db89(0x1ce)](_0x56db89(0x262))),this[_0x56db89(0x27c)](_0x140bbc[_0x56db89(0x1f4)]),!_0x140bbc[_0x56db89(0x232)]&&console['error']('\x20\x20'+a29_0x454280[_0x56db89(0x282)]('Error:')+'\x20'+_0x140bbc[_0x56db89(0x2ec)]);}}[a29_0x367de6(0x299)](_0x4859f4,_0x333efd){const _0x581163=a29_0x367de6;if(_0x4859f4[_0x581163(0x2ad)][_0x581163(0x292)]===0x0)return;console['error']('\x0a'+a29_0x454280[_0x581163(0x1ce)](_0x581163(0x2c5))+'\x20'+a29_0x454280[_0x581163(0x1ce)]('('+_0x333efd+')'));for(const _0x2d2313 of _0x4859f4[_0x581163(0x2ad)]){const _0x470386=_0x2d2313[_0x581163(0x232)]?a29_0x454280['green']('✔'):a29_0x454280['red']('✘');let _0x4d956d='';if(_0x2d2313[_0x581163(0x232)]&&_0x2d2313['customersWithEvents']!==undefined&&_0x2d2313[_0x581163(0x231)]!==undefined){const _0xa4b1ba=_0x2d2313[_0x581163(0x2c1)]?.[_0x581163(0x275)](0x1)||'?',_0x4256ca=(_0x2d2313[_0x581163(0x2c1)]??0x0)>=0x32?a29_0x454280[_0x581163(0x297)]:(_0x2d2313[_0x581163(0x2c1)]??0x0)>=0x14?a29_0x454280['yellow']:a29_0x454280[_0x581163(0x282)];_0x4d956d='\x20'+a29_0x454280[_0x581163(0x1ce)](_0x581163(0x280))+'\x20'+_0x4256ca(formatRows(_0x2d2313[_0x581163(0x22e)]))+'\x20('+_0xa4b1ba+_0x581163(0x2bd)+a29_0x454280[_0x581163(0x1ce)](_0x581163(0x28a))+'\x20'+a29_0x454280[_0x581163(0x24d)](formatRows(_0x2d2313['totalEvents']));}console['error'](_0x470386+'\x20'+a29_0x454280[_0x581163(0x245)](_0x2d2313[_0x581163(0x238)])+_0x4d956d),console[_0x581163(0x25a)]('\x20\x20'+a29_0x454280[_0x581163(0x1ce)](_0x581163(0x23b))+'\x20'+a29_0x454280[_0x581163(0x245)](_0x2d2313[_0x581163(0x26c)]+'.'+_0x2d2313['table']));const _0x567b64=_0x2d2313[_0x581163(0x2aa)]===_0x2d2313['foreignKey']?a29_0x454280[_0x581163(0x1ce)](_0x581163(0x2ae))+'\x20'+_0x2d2313['joinKey']:a29_0x454280[_0x581163(0x1ce)](_0x581163(0x28e))+'\x20'+_0x2d2313[_0x581163(0x2aa)]+'\x20=\x20'+_0x2d2313[_0x581163(0x250)];console[_0x581163(0x25a)]('\x20\x20'+_0x567b64),console[_0x581163(0x25a)]('\x20\x20'+a29_0x454280[_0x581163(0x1ce)]('Columns:')),this[_0x581163(0x27c)](_0x2d2313['columns']),!_0x2d2313[_0x581163(0x232)]&&console[_0x581163(0x25a)]('\x20\x20'+a29_0x454280[_0x581163(0x282)](_0x581163(0x223))+'\x20'+_0x2d2313['schemaError']);}}[a29_0x367de6(0x27c)](_0x5032f7){const _0x418b3c=a29_0x367de6;for(const _0x8ae6a of _0x5032f7){_0x8ae6a['label']===_0x8ae6a[_0x418b3c(0x2c9)]||_0x8ae6a[_0x418b3c(0x2c9)]==='*'?console[_0x418b3c(0x25a)](_0x418b3c(0x1d5)+_0x8ae6a[_0x418b3c(0x233)]):console['error']('\x20\x20\x20\x20-\x20'+_0x8ae6a[_0x418b3c(0x233)]+'\x20'+a29_0x454280[_0x418b3c(0x1ce)]('('+_0x8ae6a['column']+')'));}}['displaySummary'](_0x2aed15){const _0x4bb93e=a29_0x367de6;console[_0x4bb93e(0x25a)]('─'[_0x4bb93e(0x2de)](0x3c));if(_0x2aed15['errors']['length']>0x0){console[_0x4bb93e(0x25a)]('\x0a'+a29_0x454280[_0x4bb93e(0x282)](_0x4bb93e(0x1d7)));for(const _0xe773df of _0x2aed15[_0x4bb93e(0x29b)]){console['error']('\x20\x20'+a29_0x454280[_0x4bb93e(0x282)]('•')+'\x20'+_0xe773df);}}_0x2aed15[_0x4bb93e(0x2cf)]&&console[_0x4bb93e(0x25a)]('\x0a'+a29_0x454280[_0x4bb93e(0x297)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x25c);[a29_0x367de6(0x2da)]=a29_0x367de6(0x283);async[a29_0x367de6(0x271)](_0x54113a){const _0x1ddd85=a29_0x367de6,{options:_0x27edfb,args:_0x47d8dc,tdx:_0x213423}=_0x54113a,_0x47e210=_0x27edfb,_0x5a45a0=_0x47d8dc[0x0]||_0x27edfb[_0x1ddd85(0x1f9)];if(!_0x5a45a0)return showParentSegmentNotSetError(_0x1ddd85(0x1e3)+_0x1ddd85(0x239)+'Options\x20(one\x20required):\x0a'+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x1ddd85(0x203)+_0x1ddd85(0x1ee)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x1ddd85(0x242)),0x1;if(!_0x47e210[_0x1ddd85(0x2bc)]&&!_0x47e210[_0x1ddd85(0x246)]&&!_0x47e210[_0x1ddd85(0x293)]&&!_0x47e210[_0x1ddd85(0x2e9)])return console[_0x1ddd85(0x25a)](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x209))),console[_0x1ddd85(0x25a)](_0x1ddd85(0x2c4)),console[_0x1ddd85(0x25a)](_0x1ddd85(0x2b7)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x1ddd85(0x25a)](_0x1ddd85(0x211)),console[_0x1ddd85(0x25a)](_0x1ddd85(0x296)),console[_0x1ddd85(0x25a)](_0x1ddd85(0x294)),0x1;const _0x286ab2=resolveYamlFile(_0x5a45a0);if(!existsSync(_0x286ab2))return showFileNotFoundError(_0x286ab2,_0x5a45a0),0x1;_0x47e210[_0x1ddd85(0x289)]&&(console[_0x1ddd85(0x25a)](_0x1ddd85(0x2a2)+_0x47e210[_0x1ddd85(0x208)]),console[_0x1ddd85(0x25a)]('YAML\x20file:\x20'+_0x286ab2));let _0x41f09a;try{_0x41f09a=readFileSync(_0x286ab2,_0x1ddd85(0x25f));}catch(_0x1676cd){const _0x38a59a=_0x1676cd instanceof Error?_0x1676cd[_0x1ddd85(0x1cd)]:String(_0x1676cd);return console['error']('Error\x20reading\x20file:\x20'+_0x38a59a),0x1;}let _0x591780;try{_0x591780=parseYamlString(_0x41f09a);}catch(_0x439848){const _0x2d2dad=_0x439848 instanceof Error?_0x439848[_0x1ddd85(0x1cd)]:String(_0x439848);return console[_0x1ddd85(0x25a)](a29_0x454280['red'](_0x1ddd85(0x2e2)+_0x2d2dad)),0x1;}if(_0x47e210[_0x1ddd85(0x246)]===!![]||_0x47e210[_0x1ddd85(0x246)]===''){const _0x35de20=_0x591780[_0x1ddd85(0x22d)]?.[_0x1ddd85(0x236)](_0x22b462=>_0x22b462[_0x1ddd85(0x238)])||[];if(_0x35de20[_0x1ddd85(0x292)]===0x0)console['error'](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x1d2)));else{console[_0x1ddd85(0x25a)](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x2d6))),console[_0x1ddd85(0x25a)]('Available\x20attributes:');for(const _0x275ddd of _0x35de20){console[_0x1ddd85(0x25a)]('\x20\x20'+a29_0x454280[_0x1ddd85(0x24d)](_0x275ddd));}console[_0x1ddd85(0x25a)](_0x1ddd85(0x2e5)+_0x5a45a0+'\x20--attribute\x20\x22'+_0x35de20[0x0]+'\x22');}return 0x1;}if(_0x47e210[_0x1ddd85(0x293)]===!![]||_0x47e210[_0x1ddd85(0x293)]===''){const _0x5b30d4=_0x591780['behaviors']?.[_0x1ddd85(0x236)](_0x481a44=>_0x481a44[_0x1ddd85(0x238)])||[];if(_0x5b30d4[_0x1ddd85(0x292)]===0x0)console[_0x1ddd85(0x25a)](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x1d9)));else{console[_0x1ddd85(0x25a)](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x21a))),console['error']('Available\x20behaviors:');for(const _0x2636e8 of _0x5b30d4){console[_0x1ddd85(0x25a)]('\x20\x20'+a29_0x454280['cyan'](_0x2636e8));}console[_0x1ddd85(0x25a)](_0x1ddd85(0x2e5)+_0x5a45a0+_0x1ddd85(0x1e6)+_0x5b30d4[0x0]+'\x22');}return 0x1;}const _0xd31eb9=createCommandSpinner(a29_0x454280[_0x1ddd85(0x1ce)](_0x1ddd85(0x2b6)),{'verbose':_0x47e210[_0x1ddd85(0x289)]});_0xd31eb9['start']();const _0x184d15={'onProgress':_0xaef133=>{const _0x67d70c=_0x1ddd85;_0xd31eb9[_0x67d70c(0x26d)]=formatProgressMessage(_0xaef133);}};if(_0x47e210[_0x1ddd85(0x2bc)])_0x184d15[_0x1ddd85(0x2bc)]=!![];if(_0x47e210[_0x1ddd85(0x246)]&&typeof _0x47e210[_0x1ddd85(0x246)]==='string')_0x184d15[_0x1ddd85(0x246)]=_0x47e210[_0x1ddd85(0x246)];if(_0x47e210['behavior']&&typeof _0x47e210['behavior']===_0x1ddd85(0x28c))_0x184d15[_0x1ddd85(0x293)]=_0x47e210['behavior'];if(_0x47e210[_0x1ddd85(0x2e9)])_0x184d15['enriched']=!![];if(_0x47e210[_0x1ddd85(0x1ef)])_0x184d15['interval']=_0x47e210[_0x1ddd85(0x1ef)];let _0x2cd29e;try{_0x2cd29e=await _0x213423[_0x1ddd85(0x2c8)]['previewParentYaml'](_0x41f09a,_0x184d15),_0xd31eb9['stop']();}catch(_0x594dec){_0xd31eb9[_0x1ddd85(0x1e9)]();throw _0x594dec;}return await this[_0x1ddd85(0x254)](_0x2cd29e,{'master':_0x47e210['master'],'attribute':typeof _0x47e210[_0x1ddd85(0x246)]===_0x1ddd85(0x28c)?_0x47e210[_0x1ddd85(0x246)]:undefined,'behavior':typeof _0x47e210[_0x1ddd85(0x293)]==='string'?_0x47e210[_0x1ddd85(0x293)]:undefined,'enriched':_0x47e210[_0x1ddd85(0x2e9)]}),_0x2cd29e[_0x1ddd85(0x2cf)]?0x0:0x1;}async[a29_0x367de6(0x254)](_0x5d1272,_0x26d6ff){const _0x2b0b87=a29_0x367de6;console[_0x2b0b87(0x25a)]('\x0a'+a29_0x454280['bold'](_0x2b0b87(0x252))+'\x20'+_0x5d1272[_0x2b0b87(0x238)]),console['error']('═'['repeat'](0x3c));if(_0x26d6ff[_0x2b0b87(0x2bc)]&&_0x5d1272['sampleData']){const _0x5bf4f=a29_0x454280['dim']('Master:')+'\x20'+a29_0x454280[_0x2b0b87(0x245)](_0x5d1272[_0x2b0b87(0x2bc)][_0x2b0b87(0x26c)]+'.'+_0x5d1272['master'][_0x2b0b87(0x2b9)]);await this[_0x2b0b87(0x218)](_0x5bf4f,_0x5d1272['sampleData']);}else{if(_0x26d6ff[_0x2b0b87(0x246)]&&_0x5d1272[_0x2b0b87(0x1f8)]){const _0x1bfc8d=a29_0x454280[_0x2b0b87(0x1ce)](_0x2b0b87(0x2a3))+'\x20'+a29_0x454280[_0x2b0b87(0x245)](_0x26d6ff[_0x2b0b87(0x246)]);await this[_0x2b0b87(0x218)](_0x1bfc8d,_0x5d1272[_0x2b0b87(0x1f8)]);}else{if(_0x26d6ff[_0x2b0b87(0x293)]&&_0x5d1272[_0x2b0b87(0x1f8)]){const _0x275b17=a29_0x454280[_0x2b0b87(0x1ce)](_0x2b0b87(0x2e7))+'\x20'+a29_0x454280[_0x2b0b87(0x245)](_0x26d6ff[_0x2b0b87(0x293)]);await this['displaySampleData'](_0x275b17,_0x5d1272[_0x2b0b87(0x1f8)]);}else{if(_0x26d6ff[_0x2b0b87(0x2e9)]&&_0x5d1272[_0x2b0b87(0x1f8)]){const _0x5b564a=a29_0x454280[_0x2b0b87(0x1ce)](_0x2b0b87(0x295))+'\x20'+a29_0x454280[_0x2b0b87(0x245)](_0x2b0b87(0x1cb));await this[_0x2b0b87(0x218)](_0x5b564a,_0x5d1272[_0x2b0b87(0x1f8)]);}else!_0x5d1272[_0x2b0b87(0x1f8)]&&console[_0x2b0b87(0x25a)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x5d1272[_0x2b0b87(0x29b)][_0x2b0b87(0x292)]>0x0){console[_0x2b0b87(0x25a)]('─'[_0x2b0b87(0x2de)](0x3c)),console[_0x2b0b87(0x25a)]('\x0a'+a29_0x454280[_0x2b0b87(0x282)](_0x2b0b87(0x1d7)));for(const _0x43db05 of _0x5d1272['errors']){console[_0x2b0b87(0x25a)]('\x20\x20'+a29_0x454280[_0x2b0b87(0x282)]('•')+'\x20'+_0x43db05);}}}async[a29_0x367de6(0x218)](_0x3a4241,_0x4d6b96){const _0x20ab14=a29_0x367de6;if(_0x4d6b96[_0x20ab14(0x292)]===0x0){console[_0x20ab14(0x25a)]('\x0a'+_0x3a4241),console[_0x20ab14(0x25a)](_0x20ab14(0x281));return;}console[_0x20ab14(0x25a)]('\x0a'+_0x3a4241);const _0x5ca5a4=Object['keys'](_0x4d6b96[0x0])[_0x20ab14(0x236)](_0x50308f=>({'name':_0x50308f,'type':typeof _0x4d6b96[0x0][_0x50308f]==='number'?_0x20ab14(0x1ec):_0x20ab14(0x286)})),_0x4091f3={'queryId':_0x20ab14(0x227),'columns':_0x5ca5a4,'data':_0x4d6b96,'stats':{'state':_0x20ab14(0x1ed),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4d6b96[_0x20ab14(0x292)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x31f301=formatAsTable(_0x4091f3,_0x4d6b96[_0x20ab14(0x292)],!![]);await writeOutput(_0x31f301,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a29_0x367de6(0x230);[a29_0x367de6(0x2da)]=a29_0x367de6(0x2a6);async[a29_0x367de6(0x271)](_0x34ed95){const _0x310db8=a29_0x367de6,{options:_0x19f8ed,args:_0x25e149,tdx:_0x2d2d62}=_0x34ed95,_0x2413fa=_0x19f8ed,_0x487adc=_0x25e149[0x0]||_0x19f8ed['parentSegment'];if(!_0x487adc)return showParentSegmentNotSetError(_0x310db8(0x2dd)+_0x310db8(0x1e7)),0x1;const _0x1256c2=resolveYamlFile(_0x487adc);if(existsSync(_0x1256c2)){_0x2413fa['verbose']&&console['error']('Found\x20YAML\x20file:\x20'+_0x1256c2);let _0x131a94;try{_0x131a94=readFileSync(_0x1256c2,_0x310db8(0x25f));}catch(_0x5450ae){const _0x203dbd=_0x5450ae instanceof Error?_0x5450ae[_0x310db8(0x1cd)]:String(_0x5450ae);return console[_0x310db8(0x25a)](_0x310db8(0x21b)+_0x203dbd),0x1;}const _0x13499c=await withSpinner(_0x310db8(0x26b),()=>_0x2d2d62['segment'][_0x310db8(0x1d4)](_0x131a94),{'verbose':_0x2413fa[_0x310db8(0x289)]}),_0x26900f=_0x13499c[_0x310db8(0x20f)],{isNew:_0x57a733,name:_0x3bc031,hasChanges:_0x1e9900,diffFormatted:_0x3ae6c8}=_0x26900f;if(_0x1e9900){_0x57a733?console[_0x310db8(0x25a)](_0x310db8(0x278)+_0x3bc031+'\x27:'):console[_0x310db8(0x25a)](_0x310db8(0x1fe)+_0x3bc031+'\x27:');console[_0x310db8(0x25a)]('─'[_0x310db8(0x2de)](0x3c)),console['error'](_0x3ae6c8),console['error']('─'[_0x310db8(0x2de)](0x3c));const _0x19aaa2=_0x57a733?'Create\x20parent\x20segment\x20\x27'+_0x3bc031+'\x27\x20and\x20run\x20workflow?':'Apply\x20changes\x20to\x20\x27'+_0x3bc031+_0x310db8(0x2e6);if(!_0x2413fa[_0x310db8(0x1df)]){const _0x522aaa=await confirmKey(_0x19aaa2);if(!_0x522aaa)return console[_0x310db8(0x25a)](_0x310db8(0x25e)),0x1;}const _0x3e542a=_0x57a733?'Creating':_0x310db8(0x2ca);await withSpinner(_0x3e542a+'\x20parent\x20segment\x20\x27'+_0x3bc031+_0x310db8(0x284),()=>_0x26900f['apply'](),{'verbose':_0x2413fa[_0x310db8(0x289)]});const _0x1c2d95=_0x57a733?_0x310db8(0x1cf):_0x310db8(0x200);console[_0x310db8(0x25a)]('✔\x20'+_0x1c2d95+_0x310db8(0x2e3)+_0x3bc031+'\x27');}else console[_0x310db8(0x25a)]('✔\x20No\x20changes\x20-\x20\x27'+_0x3bc031+_0x310db8(0x2b8));}const _0x1a5a9e=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x487adc+_0x310db8(0x284),()=>_0x2d2d62[_0x310db8(0x2c8)][_0x310db8(0x26f)](_0x487adc),{'verbose':_0x2413fa[_0x310db8(0x289)]}),_0x2bf4d0=_0x1a5a9e['data'],_0x5af76c=getConsoleUrl(_0x2413fa['site'],'/app/workflows/'+_0x2bf4d0[_0x310db8(0x263)]+'/sessions/'+_0x2bf4d0['workflowSessionId']+_0x310db8(0x219)+_0x2bf4d0[_0x310db8(0x1d0)]);return console[_0x310db8(0x25a)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a29_0x454280['dim'](_0x310db8(0x28f))+'\x20'+_0x2bf4d0[_0x310db8(0x2a8)]),console[_0x310db8(0x25a)]('\x20\x20'+a29_0x454280[_0x310db8(0x1ce)](_0x310db8(0x2d5))+'\x20'+_0x2bf4d0[_0x310db8(0x221)]),console[_0x310db8(0x25a)]('\x20\x20'+a29_0x454280['dim'](_0x310db8(0x2ce))+'\x20'+_0x2bf4d0[_0x310db8(0x23c)]),console[_0x310db8(0x25a)]('\x20\x20'+a29_0x454280[_0x310db8(0x1ce)](_0x310db8(0x204))+'\x20'+_0x2bf4d0['workflowAttemptId']),console['error']('\x20\x20'+_0x5af76c),console['error']('\x0a'+a29_0x454280[_0x310db8(0x1ce)](_0x310db8(0x1dd))+'\x20tdx\x20wf\x20attempt\x20'+_0x2bf4d0[_0x310db8(0x1d0)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x27f);['description']=a29_0x367de6(0x276);async[a29_0x367de6(0x271)](_0x9bb77f){const _0x106bac=a29_0x367de6,{options:_0x29b628,args:_0x172ea2,tdx:_0x1aad51}=_0x9bb77f,_0x1c893f=_0x172ea2[0x0]||_0x29b628[_0x106bac(0x1f9)];if(!_0x1c893f)return showParentSegmentNotSetError(_0x106bac(0x2d1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x29b628['verbose']&&(console[_0x106bac(0x25a)](_0x106bac(0x2a2)+_0x29b628[_0x106bac(0x208)]),console[_0x106bac(0x25a)]('Parent\x20segment:\x20'+_0x1c893f));const _0xc66827=await withSpinner(_0x106bac(0x20c)+_0x1c893f+_0x106bac(0x284),()=>_0x1aad51[_0x106bac(0x2c8)]['listFields'](_0x1c893f),{'verbose':_0x29b628[_0x106bac(0x289)]}),_0x3621eb=_0xc66827['data'];console['error'](_0x106bac(0x215)+_0x3621eb[_0x106bac(0x292)]+_0x106bac(0x2d0)+(_0x3621eb[_0x106bac(0x292)]!==0x1?'s':''));if(_0x29b628[_0x106bac(0x20d)]||_0x29b628[_0x106bac(0x251)])return await handleSDKOutput(_0x3621eb,_0x29b628),0x0;return displayFieldsHumanReadable(_0x3621eb,_0x1c893f),0x0;}}function a29_0x5e17(_0x1f2980,_0x119c28){_0x1f2980=_0x1f2980-0x1cb;const _0x49f3df=a29_0x49f3();let _0x5e17ff=_0x49f3df[_0x1f2980];return _0x5e17ff;}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x217);[a29_0x367de6(0x2da)]='Show\x20parent\x20segment\x20details';async[a29_0x367de6(0x271)](_0x290cdd){const _0x11d7f0=a29_0x367de6,{options:_0x239753,args:_0x23f245,tdx:_0x16cc9a}=_0x290cdd,_0x43067c=_0x239753,_0x2b122b=_0x23f245[0x0]||_0x239753[_0x11d7f0(0x1f9)];if(!_0x2b122b)return showParentSegmentNotSetError(_0x11d7f0(0x288)+_0x11d7f0(0x25b)+'Options:\x0a'+_0x11d7f0(0x2eb)),0x1;_0x239753[_0x11d7f0(0x289)]&&(console['error'](_0x11d7f0(0x2a2)+_0x239753[_0x11d7f0(0x208)]),console[_0x11d7f0(0x25a)](_0x11d7f0(0x2a0)+_0x2b122b));const _0x9eeb2b=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2b122b+_0x11d7f0(0x284),()=>_0x16cc9a[_0x11d7f0(0x2c8)][_0x11d7f0(0x214)](_0x2b122b),{'verbose':_0x239753['verbose']}),_0x4aaab2=_0x9eeb2b[_0x11d7f0(0x20f)];if(_0x43067c[_0x11d7f0(0x26a)]){const _0x5e7eb5=getConsoleNextUrl(_0x43067c[_0x11d7f0(0x208)],_0x11d7f0(0x1ff)+_0x4aaab2['id']);return console[_0x11d7f0(0x25a)](a29_0x454280[_0x11d7f0(0x297)]('✔')+_0x11d7f0(0x257)+a29_0x454280['cyan'](_0x5e7eb5)),openBrowser(_0x5e7eb5),0x0;}return await handleSingleObjectOutput(_0x4aaab2,_0x239753),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x261);[a29_0x367de6(0x2da)]=a29_0x367de6(0x213);async[a29_0x367de6(0x271)](_0x18b924){const _0x2c97ad=a29_0x367de6,{options:_0x55cee5,args:_0x569e85,tdx:_0x57cddb}=_0x18b924,_0x7cfa5=_0x569e85[0x0]||_0x55cee5[_0x2c97ad(0x1f9)];if(!_0x7cfa5)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'+_0x2c97ad(0x21d)),0x1;_0x55cee5[_0x2c97ad(0x289)]&&(console['error']('Site:\x20'+_0x55cee5[_0x2c97ad(0x208)]),console[_0x2c97ad(0x25a)]('Parent\x20segment:\x20'+_0x7cfa5));const _0x25649b=await withSpinner(_0x2c97ad(0x212)+_0x7cfa5+'\x27...',()=>_0x57cddb[_0x2c97ad(0x2c8)][_0x2c97ad(0x255)](_0x7cfa5),{'verbose':_0x55cee5[_0x2c97ad(0x289)]}),_0x2aa887=_0x25649b['data'],_0x10498f=await withSpinner(_0x2c97ad(0x234)+_0x7cfa5+_0x2c97ad(0x284),()=>_0x57cddb[_0x2c97ad(0x2c8)][_0x2c97ad(0x259)](_0x2aa887),{'verbose':_0x55cee5[_0x2c97ad(0x289)]}),_0x234118=await executeSchemaQuery(_0x10498f[_0x2c97ad(0x20f)],_0x57cddb,_0x55cee5);return await handleQueryOutput(_0x234118,_0x55cee5),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x1cc);[a29_0x367de6(0x2da)]=a29_0x367de6(0x1da);async[a29_0x367de6(0x271)](_0x321e74){const _0x272c85=a29_0x367de6,{options:_0xc8c6d,args:_0x421b11,tdx:_0x42d029}=_0x321e74,_0x50f48b=_0x421b11[0x0]||_0xc8c6d[_0x272c85(0x1f9)];if(!_0x50f48b)return showParentSegmentNotSetError(_0x272c85(0x2d2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0xc8c6d[_0x272c85(0x289)]&&(console[_0x272c85(0x25a)](_0x272c85(0x2a2)+_0xc8c6d[_0x272c85(0x208)]),console['error']('Parent\x20segment:\x20'+_0x50f48b));const _0xb00b84=await withSpinner(_0x272c85(0x212)+_0x50f48b+'\x27...',()=>_0x42d029[_0x272c85(0x2c8)][_0x272c85(0x255)](_0x50f48b),{'verbose':_0xc8c6d['verbose']}),_0x1ad4ff=_0xb00b84['data'],_0x2541b1=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x50f48b+'\x27...',()=>_0x42d029[_0x272c85(0x2c8)][_0x272c85(0x259)](_0x1ad4ff),{'verbose':_0xc8c6d['verbose']}),_0x266f60=_0x2541b1[_0x272c85(0x20f)];return _0xc8c6d[_0x272c85(0x22f)]==='json'||_0xc8c6d[_0x272c85(0x22f)]==='jsonl'?await handleSDKOutput([{'sql':_0x266f60}],_0xc8c6d):console[_0x272c85(0x1f1)](_0x266f60),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x2a5);[a29_0x367de6(0x2da)]=a29_0x367de6(0x1d1);async['execute'](_0x2813bf){const _0x299341=a29_0x367de6,{options:_0x20b98e,args:_0x55cdae,tdx:_0x5d1176}=_0x2813bf,_0x550c94=_0x55cdae[0x0]||_0x20b98e[_0x299341(0x1f9)];if(!_0x550c94)return showParentSegmentNotSetError(_0x299341(0x253)+_0x299341(0x21c)),0x1;_0x20b98e[_0x299341(0x289)]&&(console['error']('Site:\x20'+_0x20b98e[_0x299341(0x208)]),console[_0x299341(0x25a)](_0x299341(0x2a0)+_0x550c94));const _0x21f6c1=await withSpinner(_0x299341(0x212)+_0x550c94+'\x27...',()=>_0x5d1176[_0x299341(0x2c8)][_0x299341(0x255)](_0x550c94),{'verbose':_0x20b98e[_0x299341(0x289)]}),_0x2e3464=_0x21f6c1[_0x299341(0x20f)],_0x472454=await withSpinner(_0x299341(0x234)+_0x550c94+_0x299341(0x284),()=>_0x5d1176[_0x299341(0x2c8)][_0x299341(0x259)](_0x2e3464),{'verbose':_0x20b98e[_0x299341(0x289)]});let _0x378c05=_0x472454[_0x299341(0x20f)];const _0x351cfe=resolveLimit(_0x20b98e['limit'],DEFAULT_DISPLAY_LIMIT),_0x8bcfce=/\bLIMIT\s+\d+/i[_0x299341(0x2cb)](_0x378c05);!_0x8bcfce&&(_0x378c05=_0x378c05['trim']()[_0x299341(0x279)](/;+$/,''),_0x378c05=_0x299341(0x22a)+_0x378c05+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x351cfe);_0x20b98e['verbose']&&console['error'](_0x299341(0x2d8)+_0x378c05);const _0xdb2198=await withQuerySpinner(_0x299341(0x20b),async _0x497a08=>{const _0x21a171=_0x299341,_0x4a2966=await _0x5d1176[_0x21a171(0x2e4)]['execute'](_0x378c05,{'catalog':'td','schema':_0x21a171(0x22b),'onJobId':_0x38e40f=>{const _0x53b08f=_0x21a171;_0x497a08[_0x53b08f(0x27b)](_0x38e40f);}});return _0x4a2966;},{'verbose':_0x20b98e[_0x299341(0x289)]}),_0x3a5de2=_0xdb2198['data'],_0x1efd15=_0x3a5de2[_0x299341(0x29e)]?'\x20[Job\x20ID:\x20'+_0x3a5de2[_0x299341(0x29e)]+']':'';return console['error'](_0x299341(0x2ab)+_0x3a5de2[_0x299341(0x25d)][_0x299341(0x24c)][_0x299341(0x298)]()+'\x20rows\x20'+(_0x299341(0x27a)+formatElapsed(_0x3a5de2[_0x299341(0x25d)][_0x299341(0x20e)])+_0x1efd15)),await handleQueryOutput(_0x3a5de2,_0x20b98e),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x54ecb6=a30_0x1f14;(function(_0x1bf2a3,_0x2e92c5){const _0x40ad49=a30_0x1f14,_0x2d8b96=_0x1bf2a3();while(!![]){try{const _0x5e7fac=-parseInt(_0x40ad49(0xf8))/0x1+-parseInt(_0x40ad49(0x10b))/0x2+parseInt(_0x40ad49(0x108))/0x3*(-parseInt(_0x40ad49(0x100))/0x4)+parseInt(_0x40ad49(0xff))/0x5+parseInt(_0x40ad49(0xfa))/0x6+-parseInt(_0x40ad49(0x106))/0x7*(-parseInt(_0x40ad49(0xf7))/0x8)+-parseInt(_0x40ad49(0x101))/0x9*(parseInt(_0x40ad49(0x107))/0xa);if(_0x5e7fac===_0x2e92c5)break;else _0x2d8b96['push'](_0x2d8b96['shift']());}catch(_0x50a91b){_0x2d8b96['push'](_0x2d8b96['shift']());}}}(a30_0x267e,0x8d830));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a30_0x1f14(_0x4f464e,_0x2bbe39){_0x4f464e=_0x4f464e-0xf7;const _0x267ea4=a30_0x267e();let _0x1f14bf=_0x267ea4[_0x4f464e];return _0x1f14bf;}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0x54ecb6(0x109)]='profiles';[a30_0x54ecb6(0x105)]=a30_0x54ecb6(0x10a);async[a30_0x54ecb6(0xf9)](_0x2bd21e){const _0x8fde12=a30_0x54ecb6,{options:_0x385e20}=_0x2bd21e;try{const _0x1d0b33=listProfiles(),_0x3262af=getActiveProfile();if(_0x1d0b33[_0x8fde12(0x103)]===0x0)return console['log'](_0x8fde12(0x10c)),console[_0x8fde12(0xfc)](_0x8fde12(0xfb)),console[_0x8fde12(0xfc)](_0x8fde12(0x104)),0x0;const _0x2dca28=_0x1d0b33['map'](_0xa74b4b=>{const _0x59b63a=_0x8fde12,_0x2732cd=_0xa74b4b[_0x59b63a(0x109)]===_0x3262af,_0x57c638=getProfileParams(_0xa74b4b[_0x59b63a(0xfd)]);return{'name':_0xa74b4b[_0x59b63a(0x109)],'active':_0x2732cd,'scope':_0xa74b4b['scope'],'description':_0xa74b4b[_0x59b63a(0xfd)][_0x59b63a(0x105)]||'','params':_0x57c638};});return await handleSDKOutput(_0x2dca28,_0x385e20),0x0;}catch(_0x191401){return _0x191401 instanceof Error&&console['error'](_0x8fde12(0x102)+_0x191401[_0x8fde12(0xfe)]),0x1;}}}function a30_0x267e(){const _0x3d1a82=['\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','log','config','message','5062085HZZcrl','32pKPxHE','9NCAJxc','Error:\x20','length','\x20\x20Global:\x20~/.config/tdx/tdx.json','description','287yJufpS','1343830eDHQyT','173055dsxmgL','name','List\x20all\x20available\x20profiles','1081110kVFIZp','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','101512cYvyzU','269683HBclIs','execute','2718402HBIKKp'];a30_0x267e=function(){return _0x3d1a82;};return a30_0x267e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x286302=a31_0x5a26;(function(_0x3e8679,_0x3b2534){const _0x1f1dc0=a31_0x5a26,_0x184727=_0x3e8679();while(!![]){try{const _0x4f9879=-parseInt(_0x1f1dc0(0x77))/0x1+parseInt(_0x1f1dc0(0x82))/0x2*(parseInt(_0x1f1dc0(0x92))/0x3)+parseInt(_0x1f1dc0(0x75))/0x4+parseInt(_0x1f1dc0(0x7f))/0x5+parseInt(_0x1f1dc0(0x7e))/0x6+-parseInt(_0x1f1dc0(0xa2))/0x7*(parseInt(_0x1f1dc0(0xa5))/0x8)+-parseInt(_0x1f1dc0(0x71))/0x9*(parseInt(_0x1f1dc0(0x8a))/0xa);if(_0x4f9879===_0x3b2534)break;else _0x184727['push'](_0x184727['shift']());}catch(_0x4ad0f2){_0x184727['push'](_0x184727['shift']());}}}(a31_0x34e0,0x1f102));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a31_0x5a26(_0x7a5379,_0xa3d131){_0x7a5379=_0x7a5379-0x71;const _0x34e085=a31_0x34e0();let _0x5a26e7=_0x34e085[_0x7a5379];return _0x5a26e7;}import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a31_0x34e0(){const _0x954cff=['1013334blrygW','956670eGBezZ','file','No\x20SQL\x20provided','84698tjKyhI','...','processedRows','verbose','in\x20','push','SQL:\x20','\x20splits','5630vgIQkT','\x20rows\x20','name','options','Executing\x20query...','args','originalMessage','completedSplits','15RHnlZJ','description','message','query','database','elapsedTimeMillis','Executing\x20query\x20[','\x20-\x20','catalog','state','length','setExtra','output','Run\x20Trino\x20queries\x20(streaming)','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','jobId','6251YWaVwS','error','Schema:\x20','648VNjSkS','6885uuaBPA','setJobId','information_schema','validate','251268xyvkFP','data','4523WsyrpJ','Catalog:\x20','Statement\x20','stats','Error:\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','\x0aAll\x20results\x20saved\x20to\x20'];a31_0x34e0=function(){return _0x954cff;};return a31_0x34e0();}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a31_0x286302(0x8c)]=a31_0x286302(0x95);[a31_0x286302(0x93)]=a31_0x286302(0x9f);async['execute'](_0x12a647){const _0x78c5f9=a31_0x286302,{options:_0x536049,args:_0x41cc3e,tdx:_0x43aa67}=_0x12a647,_0x414429=_0x41cc3e[0x0],_0x57801b=_0x536049[_0x78c5f9(0x80)];let _0x52c315;try{if(_0x57801b)_0x52c315=readSqlStatementsFromFile(_0x57801b);else{if(_0x414429==='-')_0x52c315=await readSqlStatementsFromStdin();else{if(_0x414429&&isSqlFilePath(_0x414429))_0x52c315=readSqlStatementsFromFile(_0x414429);else{if(_0x414429)_0x52c315=splitSqlStatements(_0x414429);else throw new Error(_0x78c5f9(0x81));}}}}catch(_0x5370c4){return console['error'](_0x78c5f9(0x7b)+_0x5370c4[_0x78c5f9(0x94)]),0x1;}const _0x1466c8=_0x536049[_0x78c5f9(0x96)]||_0x78c5f9(0x73),_0x57880c=_0x536049[_0x78c5f9(0x9a)];try{const _0x47e563=[],_0x2d4720=!!_0x536049[_0x78c5f9(0x9e)];for(let _0x1447ea=0x0;_0x1447ea<_0x52c315[_0x78c5f9(0x9c)];_0x1447ea++){const _0x2ae7c0=_0x52c315[_0x1447ea],_0x508467=_0x1447ea+0x1,_0x2d4aeb=_0x52c315[_0x78c5f9(0x9c)],_0x32544f=_0x2d4aeb>0x1;_0x536049[_0x78c5f9(0x85)]&&(console['error']('\x0a'+(_0x32544f?'Statement\x20'+_0x508467+'/'+_0x2d4aeb+':':'')),console[_0x78c5f9(0xa3)]('Site:\x20'+_0x536049['site']),console['error'](_0x78c5f9(0x78)+(_0x57880c||'td')),console[_0x78c5f9(0xa3)](_0x78c5f9(0xa4)+_0x1466c8),console[_0x78c5f9(0xa3)](_0x78c5f9(0x88)+_0x2ae7c0));const _0x3615b1=_0x32544f?'Executing\x20statement\x20'+_0x508467+'/'+_0x2d4aeb+_0x78c5f9(0x83):_0x78c5f9(0x8e);try{const _0x3fc1b8=await withQuerySpinner(_0x3615b1,async _0x4a0b8b=>{const _0x4be97a=_0x78c5f9,_0x5bad97=await _0x43aa67[_0x4be97a(0x95)]['execute'](_0x2ae7c0,{'catalog':_0x57880c,'schema':_0x1466c8,'onJobId':_0x51e7ab=>{const _0x4e0203=_0x4be97a;_0x4a0b8b[_0x4e0203(0x72)](_0x51e7ab);},'onProgress':_0x58b261=>{const _0x107512=_0x4be97a;_0x4a0b8b['setPhase'](_0x107512(0x98)+_0x58b261[_0x107512(0x9b)]+']'),_0x4a0b8b[_0x107512(0x9d)](formatRows(_0x58b261['processedRows'])+_0x107512(0x8b)+_0x58b261[_0x107512(0x91)]+'/'+_0x58b261['totalSplits']+_0x107512(0x89));}});return _0x5bad97;},{'verbose':_0x536049['verbose']}),_0x151fa1=_0x3fc1b8[_0x78c5f9(0x76)],_0x23bec1=_0x151fa1[_0x78c5f9(0xa1)]?'\x20[Job\x20ID:\x20'+_0x151fa1[_0x78c5f9(0xa1)]+']':'',_0x1987c5=_0x32544f?_0x78c5f9(0x79)+_0x508467+'/'+_0x2d4aeb+_0x78c5f9(0x99):'';console['error']('✔\x20'+_0x1987c5+'Query\x20completed:\x20Processed\x20'+formatRows(_0x151fa1[_0x78c5f9(0x7a)][_0x78c5f9(0x84)])+_0x78c5f9(0x8b)+(_0x78c5f9(0x86)+formatElapsed(_0x151fa1['stats'][_0x78c5f9(0x97)])+_0x23bec1));if(_0x32544f&&_0x2d4720){const _0x26691a=resolveOutputOptions(_0x536049),_0x179b32=await formatQueryOutput(_0x151fa1,_0x26691a);_0x47e563[_0x78c5f9(0x87)](_0x179b32);}else await handleQueryOutput(_0x151fa1,_0x536049);}catch(_0x94586f){const _0xd5e08a=_0x32544f?'Statement\x20'+_0x508467+'/'+_0x2d4aeb+':\x0a':'',_0xedb168=_0x94586f instanceof SDKError?_0x94586f[_0x78c5f9(0x90)]:_0x94586f[_0x78c5f9(0x94)];return console[_0x78c5f9(0xa3)](''+_0xd5e08a+_0xedb168),0x1;}}if(_0x52c315[_0x78c5f9(0x9c)]>0x1&&_0x2d4720&&_0x47e563[_0x78c5f9(0x9c)]>0x0){const _0x26c745=_0x47e563['join']('\x0a');writeFileSync(_0x536049[_0x78c5f9(0x9e)],_0x26c745),console['error'](_0x78c5f9(0x7d)+_0x536049['output']);}return 0x0;}catch(_0x9a3a9e){throw _0x9a3a9e;}}[a31_0x286302(0x74)](_0x154089){const _0x3a5d98=a31_0x286302,_0x1e74a0=_0x154089[_0x3a5d98(0x8f)][0x0],_0x27449f=_0x154089[_0x3a5d98(0x8d)][_0x3a5d98(0x80)];if(!_0x1e74a0&&!_0x27449f)return _0x3a5d98(0xa0);if(_0x1e74a0&&_0x27449f)return _0x3a5d98(0x7c);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x69f1e0=a32_0x55ef;(function(_0x38c9dd,_0x262820){const _0xbcf698=a32_0x55ef,_0x3ffb8d=_0x38c9dd();while(!![]){try{const _0x504757=parseInt(_0xbcf698(0x150))/0x1*(parseInt(_0xbcf698(0x152))/0x2)+parseInt(_0xbcf698(0x1bd))/0x3*(-parseInt(_0xbcf698(0x18c))/0x4)+parseInt(_0xbcf698(0x19e))/0x5*(parseInt(_0xbcf698(0x18f))/0x6)+parseInt(_0xbcf698(0x1cb))/0x7+-parseInt(_0xbcf698(0x13b))/0x8+parseInt(_0xbcf698(0x188))/0x9+-parseInt(_0xbcf698(0x1a2))/0xa*(parseInt(_0xbcf698(0x19b))/0xb);if(_0x504757===_0x262820)break;else _0x3ffb8d['push'](_0x3ffb8d['shift']());}catch(_0x3f244c){_0x3ffb8d['push'](_0x3ffb8d['shift']());}}}(a32_0x4af2,0x1c328));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a32_0x4af2(){const _0x184658=['\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Folder\x20ID\x20missing\x20from\x20resolved\x20path','verbose','Use:\x20tdx\x20ps\x20view','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','format','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','folderId','replace','\x20Opening\x20','3eHYQBk','Get\x20SQL\x20query\x20for\x20child\x20segment','Segment\x20ID:\x20','\x20\x20Cause:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolving\x20parent\x20segment\x20\x27','log','getSegmentSQL','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Usage:\x20tdx\x20sg\x20show\x20<name>','stats','cause','798161QlEfEh','Options:','Site:\x20','Use:\x20tdx\x20ps\x20view\x20-w','✔\x20Created\x20folder\x20\x27','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x27\x20with\x20ID:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20ID:\x20','INVALID_ARGUMENT','parentFolder','358064SjXUiN','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Create\x20segment\x20folder\x20for\x20organization','Error:\x20','segment:folder:list','SEGMENT_FOLDER_NOT_FOUND','url','/e/','Use:\x20tdx\x20ps\x20sql','\x27...','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','createFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Target\x20path:\x20','Parent\x20ID:\x20','listFolders','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','information_schema','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','toLocaleString','6115QnboDQ','description','46EpHuDS','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','✖\x20Query\x20failed\x20[','Creating\x20folder\x20\x27','segmentId','\x20\x20Full\x20path:\x20','resolveFolderId','/app/ps/','Parent\x20segment:\x20','segmentName','data','Parent\x20name:\x20','Use:\x20tdx\x20ps\x20desc','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','query','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','parentSegment','Resolved\x20YAML\x20file:\x20','json','segment:desc','resolvePathToResource','error','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20path\x20\x27','Usage:\x20tdx\x20sg\x20desc\x20<name>','getParent','Fetching\x20folder\x20details...','web','Resolving\x20\x27','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20SQL\x20for\x20segment...','Show\x20folder\x20or\x20child\x20segment\x20details','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','execute','type','\x20rows\x20','segment','Resolving\x20folder\x20\x27','Executing\x20segment\x20query...','Resolved\x20parent\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','getSegment','Resolved\x20type:\x20','Resolving\x20parent\x20folder\x20\x27','SQL\x20query:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','code','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parent','limit','folderPath','1828089azpkhy','folder','message','\x20\x20Segment\x20name:\x20','444228SOfXwJ','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Path\x20or\x20name\x20is\x20required','354OYSTfn','resolveParentId','Fetching\x20segment\x20details...','(root)','SELECT\x20*\x20FROM\x20(\x0a','parentId','\x20\x20Folder\x20path:\x20','\x20[Job\x20ID:\x20','segment:sql','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','name','3336927KPMmhF','jobId','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','9905Waulrq','\x20\x20Parent\x20segment:\x20','Resolved\x20parent\x20ID:\x20','in\x20','10BnKBmA','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','processedRows','Examples:','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','test','site','elapsedTimeMillis','fullPath','SEGMENT_NOT_FOUND','segment:view','getFolder','length','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Show\x20segment\x20or\x20folder\x20details'];a32_0x4af2=function(){return _0x184658;};return a32_0x4af2();}import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0x252943 from'chalk';function resolveSegmentTarget(_0x3c009d,_0x410d41,_0x2d160d){const _0x3e19c0=a32_0x55ef;if(isYamlFilePath(_0x3c009d))try{const _0x191779=resolveYamlFilePath(_0x3c009d);return _0x2d160d&&(console[_0x3e19c0(0x168)](_0x3e19c0(0x164)+_0x3c009d),console['error'](_0x3e19c0(0x19f)+_0x191779[_0x3e19c0(0x163)]),console['error'](_0x3e19c0(0x18b)+_0x191779[_0x3e19c0(0x15b)]),console['error'](_0x3e19c0(0x195)+(_0x191779[_0x3e19c0(0x187)]||_0x3e19c0(0x192))),console[_0x3e19c0(0x168)](_0x3e19c0(0x157)+_0x191779[_0x3e19c0(0x1ab)])),_0x191779[_0x3e19c0(0x1ab)];}catch(_0x251c71){throw new SDKError(ErrorCode[_0x3e19c0(0x139)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x251c71[_0x3e19c0(0x18a)]);}if(!_0x410d41)throw new SDKError(ErrorCode[_0x3e19c0(0x139)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x410d41+'/'+_0x3c009d;}export class SegmentDescribeCommand extends BaseCommand{[a32_0x69f1e0(0x19a)]='segment:describe';[a32_0x69f1e0(0x151)]=a32_0x69f1e0(0x1b1);async['execute'](_0x2228d1){const _0x2bd1ae=a32_0x69f1e0,{options:_0x59bf2b,args:_0x227f88,tdx:_0x1c6b24}=_0x2228d1,_0x57bb0b=_0x227f88[0x0],_0x54a035=!_0x57bb0b&&!!_0x59bf2b[_0x2bd1ae(0x163)],_0x4f1425=_0x57bb0b||_0x59bf2b[_0x2bd1ae(0x163)];if(!_0x4f1425)return console[_0x2bd1ae(0x168)](_0x2bd1ae(0x18e)),console[_0x2bd1ae(0x168)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x2bd1ae(0x168)](_0x2bd1ae(0x1a5)),console['error'](_0x2bd1ae(0x1b9)),console[_0x2bd1ae(0x168)](_0x2bd1ae(0x184)),console[_0x2bd1ae(0x168)](_0x2bd1ae(0x13d)),console[_0x2bd1ae(0x168)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x46ca89=_0x59bf2b['segmentPath'];let _0x16b7dd=_0x4f1425;!_0x54a035&&_0x46ca89&&!_0x4f1425['includes']('/')&&(_0x16b7dd=_0x46ca89+'/'+_0x4f1425,_0x59bf2b[_0x2bd1ae(0x1b4)]&&console[_0x2bd1ae(0x168)]('Resolved\x20relative\x20path\x20to:\x20'+_0x16b7dd));const _0x5ba280=await withSpinner(_0x2bd1ae(0x16b)+_0x16b7dd+_0x2bd1ae(0x145),()=>_0x1c6b24['segment'][_0x2bd1ae(0x167)](_0x16b7dd),{'verbose':_0x59bf2b[_0x2bd1ae(0x1b4)]}),_0x554700=_0x5ba280[_0x2bd1ae(0x15c)];_0x59bf2b[_0x2bd1ae(0x1b4)]&&(console['error'](_0x2bd1ae(0x17f)+_0x554700[_0x2bd1ae(0x177)]),console['error']('Parent\x20ID:\x20'+_0x554700['parentId']),_0x554700[_0x2bd1ae(0x1ba)]&&console['error']('Folder\x20ID:\x20'+_0x554700['folderId']),_0x554700[_0x2bd1ae(0x156)]&&console[_0x2bd1ae(0x168)](_0x2bd1ae(0x1bf)+_0x554700[_0x2bd1ae(0x156)]));if(_0x554700[_0x2bd1ae(0x177)]===_0x2bd1ae(0x185)){const _0x279bd6=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x1c6b24['segment'][_0x2bd1ae(0x16d)](_0x554700[_0x2bd1ae(0x194)]),{'verbose':_0x59bf2b[_0x2bd1ae(0x1b4)]});await handleSingleObjectOutput(_0x279bd6[_0x2bd1ae(0x15c)],_0x59bf2b);}else{if(_0x554700[_0x2bd1ae(0x177)]===_0x2bd1ae(0x189)){if(!_0x554700[_0x2bd1ae(0x1ba)])throw new SDKError(ErrorCode[_0x2bd1ae(0x141)],_0x2bd1ae(0x1b3));const _0x559c7e=await withSpinner(_0x2bd1ae(0x16e),()=>_0x1c6b24[_0x2bd1ae(0x179)]['getFolder'](_0x554700[_0x2bd1ae(0x1ba)]),{'verbose':_0x59bf2b[_0x2bd1ae(0x1b4)]});await handleSingleObjectOutput(_0x559c7e['data'],_0x59bf2b);}else{if(_0x554700[_0x2bd1ae(0x177)]==='segment'){if(!_0x554700[_0x2bd1ae(0x156)])throw new SDKError(ErrorCode[_0x2bd1ae(0x1ac)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x57f5ef=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1c6b24['segment'][_0x2bd1ae(0x17e)](_0x554700[_0x2bd1ae(0x194)],_0x554700[_0x2bd1ae(0x156)]),{'verbose':_0x59bf2b[_0x2bd1ae(0x1b4)]});await handleSingleObjectOutput(_0x57f5ef[_0x2bd1ae(0x15c)],_0x59bf2b);}}}return 0x0;}catch(_0x571baa){if(_0x571baa instanceof SDKError)return console[_0x2bd1ae(0x168)](_0x2bd1ae(0x13f)+_0x571baa[_0x2bd1ae(0x18a)]),_0x571baa[_0x2bd1ae(0x1ca)]&&console['error']('\x20\x20Cause:\x20'+_0x571baa['cause']),0x1;throw _0x571baa;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x69f1e0(0x19a)]='segment:show';[a32_0x69f1e0(0x151)]=a32_0x69f1e0(0x1c6);async[a32_0x69f1e0(0x176)](_0x50fc39){const _0x2d6f6b=a32_0x69f1e0,{options:_0x122f6f,args:_0x35b8fb,tdx:_0x2f9eb9}=_0x50fc39,_0x4d2c03=_0x35b8fb[0x0];if(!_0x4d2c03)return console['error'](_0x2d6f6b(0x134)),console['error'](_0x2d6f6b(0x1c8)),console[_0x2d6f6b(0x168)](_0x2d6f6b(0x15f)),console[_0x2d6f6b(0x168)](_0x2d6f6b(0x1a5)),console[_0x2d6f6b(0x168)](_0x2d6f6b(0x18d)),console[_0x2d6f6b(0x168)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x30cb0d=_0x122f6f[_0x2d6f6b(0x163)],_0x50cb12=resolveSegmentTarget(_0x4d2c03,_0x30cb0d,_0x122f6f['verbose']);_0x122f6f['verbose']&&console[_0x2d6f6b(0x168)](_0x2d6f6b(0x149)+_0x50cb12);const _0x48f7e4=await withSpinner(_0x2d6f6b(0x170)+_0x4d2c03+_0x2d6f6b(0x145),()=>_0x2f9eb9[_0x2d6f6b(0x179)][_0x2d6f6b(0x167)](_0x50cb12),{'verbose':_0x122f6f[_0x2d6f6b(0x1b4)]}),_0x13bc6e=_0x48f7e4[_0x2d6f6b(0x15c)];_0x122f6f[_0x2d6f6b(0x1b4)]&&(console[_0x2d6f6b(0x168)](_0x2d6f6b(0x17f)+_0x13bc6e[_0x2d6f6b(0x177)]),console['error'](_0x2d6f6b(0x14a)+_0x13bc6e['parentId']));if(_0x13bc6e[_0x2d6f6b(0x177)]===_0x2d6f6b(0x189))return console['error'](_0x2d6f6b(0x1c1)),console[_0x2d6f6b(0x168)](_0x2d6f6b(0x16a)),0x1;if(_0x13bc6e[_0x2d6f6b(0x177)]===_0x2d6f6b(0x185))return console['error'](_0x2d6f6b(0x171)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x13bc6e['segmentId'])throw new SDKError(ErrorCode[_0x2d6f6b(0x1ac)],_0x2d6f6b(0x169));const _0x171902=await withSpinner(_0x2d6f6b(0x172),()=>_0x2f9eb9[_0x2d6f6b(0x179)]['getSegmentSQL'](_0x13bc6e['parentId'],_0x13bc6e['segmentId']),{'verbose':_0x122f6f['verbose']});let _0x35aa65=_0x171902[_0x2d6f6b(0x15c)];const _0x17fc5a=resolveLimit(_0x122f6f[_0x2d6f6b(0x186)],DEFAULT_DISPLAY_LIMIT),_0x1a5573=/\bLIMIT\s+\d+/i[_0x2d6f6b(0x1a8)](_0x35aa65);!_0x1a5573&&(_0x35aa65=_0x35aa65['trim']()[_0x2d6f6b(0x1bb)](/;+$/,''),_0x35aa65=_0x2d6f6b(0x193)+_0x35aa65+_0x2d6f6b(0x19d)+_0x17fc5a);_0x122f6f[_0x2d6f6b(0x1b4)]&&console['error'](_0x2d6f6b(0x181)+_0x35aa65);const _0x3f9685=await withQuerySpinner(_0x2d6f6b(0x17b),async _0x4aa21a=>{const _0x40f50d=_0x2d6f6b,_0x5f1d71=await _0x2f9eb9[_0x40f50d(0x161)]['execute'](_0x35aa65,{'catalog':'td','schema':_0x40f50d(0x14d),'onJobId':_0x45841d=>{_0x4aa21a['setJobId'](_0x45841d);}});return _0x5f1d71;},{'verbose':_0x122f6f[_0x2d6f6b(0x1b4)]}),_0x5cd086=_0x3f9685[_0x2d6f6b(0x15c)],_0xb72db=_0x5cd086[_0x2d6f6b(0x19c)]?_0x2d6f6b(0x196)+_0x5cd086[_0x2d6f6b(0x19c)]+']':'';return console[_0x2d6f6b(0x168)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x5cd086['stats'][_0x2d6f6b(0x1a4)][_0x2d6f6b(0x14f)]()+_0x2d6f6b(0x178)+(_0x2d6f6b(0x1a1)+formatElapsed(_0x5cd086[_0x2d6f6b(0x1c9)][_0x2d6f6b(0x1aa)])+_0xb72db)),await handleQueryOutput(_0x5cd086,_0x122f6f),0x0;}catch(_0x182af3){if(_0x182af3 instanceof SDKError)return console[_0x2d6f6b(0x168)](_0x2d6f6b(0x154)+_0x182af3[_0x2d6f6b(0x183)]+']'),console['error']('\x0a'+_0x182af3[_0x2d6f6b(0x18a)]),0x1;throw _0x182af3;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x69f1e0(0x19a)]=a32_0x69f1e0(0x140);[a32_0x69f1e0(0x151)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a32_0x69f1e0(0x176)](_0xeb263e){const _0x1948ff=a32_0x69f1e0,{options:_0x4c0e83,args:_0x2cb060,tdx:_0x37523b}=_0xeb263e;if(_0x2cb060['length']===0x0)return console[_0x1948ff(0x168)](_0x1948ff(0x174)),console[_0x1948ff(0x168)](_0x1948ff(0x17d)),0x1;const _0x3c4970=_0x2cb060[0x0];try{_0x4c0e83['verbose']&&(console['error']('Site:\x20'+_0x4c0e83[_0x1948ff(0x1a9)]),console[_0x1948ff(0x168)](_0x1948ff(0x15d)+_0x3c4970));const _0x21bbc1=await withSpinner(_0x1948ff(0x1c2)+_0x3c4970+_0x1948ff(0x145),()=>_0x37523b[_0x1948ff(0x179)]['resolveParentId'](_0x3c4970),{'verbose':_0x4c0e83['verbose']}),_0x15b018=_0x21bbc1[_0x1948ff(0x15c)];_0x4c0e83[_0x1948ff(0x1b4)]&&console['error'](_0x1948ff(0x1a0)+_0x15b018);const _0x403399=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x3c4970+_0x1948ff(0x145),()=>_0x37523b['segment'][_0x1948ff(0x14b)](_0x15b018),{'verbose':_0x4c0e83['verbose']}),_0x3c4bfc=_0x403399[_0x1948ff(0x15c)];return console[_0x1948ff(0x168)]('✔\x20Found\x20'+_0x3c4bfc['length']+'\x20folder'+(_0x3c4bfc[_0x1948ff(0x1af)]!==0x1?'s':'')),await handleSDKOutput(_0x3c4bfc,_0x4c0e83),0x0;}catch(_0x28333e){if(_0x28333e instanceof SDKError)return console[_0x1948ff(0x168)](_0x1948ff(0x13f)+_0x28333e[_0x1948ff(0x18a)]),_0x28333e[_0x1948ff(0x1ca)]&&console[_0x1948ff(0x168)](_0x1948ff(0x1c0)+_0x28333e['cause']),0x1;throw _0x28333e;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x69f1e0(0x19a)]='segment:folder:show';['description']='Show\x20segment\x20folder\x20details';async[a32_0x69f1e0(0x176)](_0x3de8b1){const _0x2242ab=a32_0x69f1e0,{options:_0x317bc5,args:_0xed81c,tdx:_0x31bb2b}=_0x3de8b1;if(_0xed81c[_0x2242ab(0x1af)]===0x0)return console[_0x2242ab(0x168)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x2242ab(0x168)](_0x2242ab(0x153)),0x1;try{const {parentId:_0x1bb346,childId:_0x1bda54}=parseSegmentRef(_0xed81c[0x0]);_0x317bc5[_0x2242ab(0x1b4)]&&(console[_0x2242ab(0x168)]('Site:\x20'+_0x317bc5[_0x2242ab(0x1a9)]),console[_0x2242ab(0x168)]('Parent\x20name:\x20'+_0x1bb346),_0x1bda54&&console[_0x2242ab(0x168)]('Folder\x20name:\x20'+_0x1bda54));if(!_0x1bda54)return console[_0x2242ab(0x168)](_0x2242ab(0x162)),0x1;const _0xbfbe88=await withSpinner(_0x2242ab(0x1c2)+_0x1bb346+_0x2242ab(0x145),()=>_0x31bb2b[_0x2242ab(0x179)][_0x2242ab(0x190)](_0x1bb346),{'verbose':_0x317bc5['verbose']}),_0x47c5db=_0xbfbe88['data'];_0x317bc5[_0x2242ab(0x1b4)]&&console[_0x2242ab(0x168)](_0x2242ab(0x1a0)+_0x47c5db);const _0x278ef1=await withSpinner(_0x2242ab(0x17a)+_0x1bda54+'\x27...',()=>_0x31bb2b[_0x2242ab(0x179)][_0x2242ab(0x158)](_0x47c5db,_0x1bda54),{'verbose':_0x317bc5[_0x2242ab(0x1b4)]}),_0x4a6e4a=_0x278ef1['data'];_0x317bc5[_0x2242ab(0x1b4)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x4a6e4a);const _0x1d14bc=await withSpinner('Fetching\x20folder\x20\x27'+_0x1bda54+'\x27...',()=>_0x31bb2b[_0x2242ab(0x179)][_0x2242ab(0x1ae)](_0x4a6e4a),{'verbose':_0x317bc5[_0x2242ab(0x1b4)]});return await handleSDKOutput([_0x1d14bc['data']],_0x317bc5),0x0;}catch(_0x2391f7){if(_0x2391f7 instanceof SDKError)return console['error'](_0x2242ab(0x13f)+_0x2391f7['message']),_0x2391f7[_0x2242ab(0x1ca)]&&console[_0x2242ab(0x168)](_0x2242ab(0x1c0)+_0x2391f7[_0x2242ab(0x1ca)]),0x1;throw _0x2391f7;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x69f1e0(0x19a)]=a32_0x69f1e0(0x197);[a32_0x69f1e0(0x151)]=a32_0x69f1e0(0x1be);async['execute'](_0x4ce115){const _0x243d4e=a32_0x69f1e0,{options:_0x46a6b8,args:_0x25fe58,tdx:_0x45134d}=_0x4ce115,_0x43fed7=_0x25fe58[0x0];if(!_0x43fed7)return console[_0x243d4e(0x168)](_0x243d4e(0x134)),console[_0x243d4e(0x168)](_0x243d4e(0x135)),console['error'](_0x243d4e(0x182)),console[_0x243d4e(0x168)]('Examples:'),console[_0x243d4e(0x168)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x243d4e(0x168)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x285ad6=_0x46a6b8[_0x243d4e(0x163)],_0x510d0=resolveSegmentTarget(_0x43fed7,_0x285ad6,_0x46a6b8[_0x243d4e(0x1b4)]);_0x46a6b8[_0x243d4e(0x1b4)]&&console[_0x243d4e(0x168)](_0x243d4e(0x149)+_0x510d0);const _0x38d269=await withSpinner('Resolving\x20\x27'+_0x43fed7+_0x243d4e(0x145),()=>_0x45134d[_0x243d4e(0x179)][_0x243d4e(0x167)](_0x510d0),{'verbose':_0x46a6b8[_0x243d4e(0x1b4)]}),_0x100209=_0x38d269[_0x243d4e(0x15c)];_0x46a6b8['verbose']&&(console[_0x243d4e(0x168)](_0x243d4e(0x17f)+_0x100209[_0x243d4e(0x177)]),console[_0x243d4e(0x168)](_0x243d4e(0x14a)+_0x100209[_0x243d4e(0x194)]));if(_0x100209[_0x243d4e(0x177)]===_0x243d4e(0x189))return console['error'](_0x243d4e(0x198)),console[_0x243d4e(0x168)](_0x243d4e(0x1c7)),0x1;if(_0x100209[_0x243d4e(0x177)]===_0x243d4e(0x185))return console[_0x243d4e(0x168)](_0x243d4e(0x1b6)),console[_0x243d4e(0x168)](_0x243d4e(0x144)),0x1;if(!_0x100209[_0x243d4e(0x156)])throw new SDKError(ErrorCode[_0x243d4e(0x1ac)],_0x243d4e(0x169));const _0x25f57f=await withSpinner(_0x243d4e(0x172),()=>_0x45134d['segment'][_0x243d4e(0x1c4)](_0x100209[_0x243d4e(0x194)],_0x100209['segmentId']),{'verbose':_0x46a6b8[_0x243d4e(0x1b4)]}),_0x5c3527=_0x25f57f['data'];return _0x46a6b8[_0x243d4e(0x1b8)]===_0x243d4e(0x165)||_0x46a6b8[_0x243d4e(0x1b8)]==='jsonl'?await handleSDKOutput([{'sql':_0x5c3527}],_0x46a6b8):console[_0x243d4e(0x1c3)](_0x5c3527),0x0;}catch(_0x549e02){if(_0x549e02 instanceof SDKError)return console[_0x243d4e(0x168)]('Error:\x20'+_0x549e02[_0x243d4e(0x18a)]),_0x549e02['cause']&&console[_0x243d4e(0x168)](_0x243d4e(0x1c0)+_0x549e02[_0x243d4e(0x1ca)]),0x1;throw _0x549e02;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a32_0x69f1e0(0x19a)]='segment:folder:create';[a32_0x69f1e0(0x151)]=a32_0x69f1e0(0x13e);async[a32_0x69f1e0(0x176)](_0x188fca){const _0x1dbc10=a32_0x69f1e0,{options:_0x5836a5,args:_0x3517ec,tdx:_0x17a4ad}=_0x188fca,_0x49f997=_0x5836a5;if(_0x3517ec[_0x1dbc10(0x1af)]<0x2)return console[_0x1dbc10(0x168)](_0x1dbc10(0x160)),console[_0x1dbc10(0x168)](_0x1dbc10(0x1c5)),0x1;const _0x3dce3a=_0x3517ec[0x0],_0x4c94d2=_0x3517ec[0x1];_0x49f997['verbose']&&(console[_0x1dbc10(0x168)](_0x1dbc10(0x1cd)+_0x49f997[_0x1dbc10(0x1a9)]),console[_0x1dbc10(0x168)](_0x1dbc10(0x15a)+_0x3dce3a),console[_0x1dbc10(0x168)]('Folder\x20name:\x20'+_0x4c94d2));let _0x30eeb7;if(_0x49f997[_0x1dbc10(0x13a)]){const _0x544e5e=_0x49f997['parentFolder'],_0x7b8e1b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3dce3a+_0x1dbc10(0x145),()=>_0x17a4ad[_0x1dbc10(0x179)]['resolveParentId'](_0x3dce3a),{'verbose':_0x49f997[_0x1dbc10(0x1b4)]}),_0x163761=_0x7b8e1b['data'],_0x964d8e=await withSpinner(_0x1dbc10(0x180)+_0x544e5e+_0x1dbc10(0x145),()=>_0x17a4ad[_0x1dbc10(0x179)][_0x1dbc10(0x158)](_0x163761,_0x544e5e),{'verbose':_0x49f997[_0x1dbc10(0x1b4)]});_0x30eeb7=_0x964d8e['data'],_0x49f997[_0x1dbc10(0x1b4)]&&console[_0x1dbc10(0x168)](_0x1dbc10(0x17c)+_0x30eeb7);}const _0x2e9a3d={'name':_0x4c94d2,'description':_0x49f997[_0x1dbc10(0x151)],'parentFolderId':_0x30eeb7},_0x39c204=await withSpinner(_0x1dbc10(0x155)+_0x4c94d2+_0x1dbc10(0x145),()=>_0x17a4ad[_0x1dbc10(0x179)][_0x1dbc10(0x147)](_0x3dce3a,_0x2e9a3d),{'verbose':_0x49f997[_0x1dbc10(0x1b4)]}),_0xf05268=_0x39c204[_0x1dbc10(0x15c)];return console[_0x1dbc10(0x168)](_0x1dbc10(0x1cf)+_0xf05268[_0x1dbc10(0x19a)]+_0x1dbc10(0x136)+_0xf05268['id']),await handleSDKOutput([_0xf05268],_0x49f997),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a32_0x69f1e0(0x1ad);[a32_0x69f1e0(0x151)]=a32_0x69f1e0(0x173);async[a32_0x69f1e0(0x176)](_0x42ca98){const _0x22ee73=a32_0x69f1e0,{options:_0x59bed0,args:_0x3c7e47,tdx:_0x41c682}=_0x42ca98,_0x5b37d5=_0x3c7e47[0x0];if(!_0x5b37d5)return console[_0x22ee73(0x168)](_0x22ee73(0x137)),console[_0x22ee73(0x168)](_0x22ee73(0x1a6)),console[_0x22ee73(0x168)](_0x22ee73(0x14e)),console[_0x22ee73(0x168)](_0x22ee73(0x1cc)),console[_0x22ee73(0x168)](_0x22ee73(0x1b2)),console[_0x22ee73(0x168)]('Examples:'),console[_0x22ee73(0x168)](_0x22ee73(0x1a7)),console['error'](_0x22ee73(0x175)),console['error'](_0x22ee73(0x14c)),console[_0x22ee73(0x168)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x1ffe90=_0x59bed0['parentSegment'],_0x52c231=resolveSegmentTarget(_0x5b37d5,_0x1ffe90,_0x59bed0[_0x22ee73(0x1b4)]);_0x59bed0['verbose']&&console[_0x22ee73(0x168)](_0x22ee73(0x149)+_0x52c231);const _0x2f59dd=await withSpinner('Resolving\x20\x27'+_0x5b37d5+_0x22ee73(0x145),()=>_0x41c682['segment'][_0x22ee73(0x167)](_0x52c231),{'verbose':_0x59bed0['verbose']}),_0x4d2a2f=_0x2f59dd[_0x22ee73(0x15c)];_0x59bed0['verbose']&&(console[_0x22ee73(0x168)]('Resolved\x20type:\x20'+_0x4d2a2f[_0x22ee73(0x177)]),console[_0x22ee73(0x168)](_0x22ee73(0x14a)+_0x4d2a2f[_0x22ee73(0x194)]),_0x4d2a2f[_0x22ee73(0x1ba)]&&console[_0x22ee73(0x168)](_0x22ee73(0x138)+_0x4d2a2f[_0x22ee73(0x1ba)]),_0x4d2a2f[_0x22ee73(0x156)]&&console['error'](_0x22ee73(0x1bf)+_0x4d2a2f[_0x22ee73(0x156)]));if(_0x59bed0[_0x22ee73(0x16f)]){if(_0x4d2a2f[_0x22ee73(0x177)]==='folder')return console[_0x22ee73(0x168)](_0x22ee73(0x146)),0x1;if(_0x4d2a2f[_0x22ee73(0x177)]===_0x22ee73(0x185))return console[_0x22ee73(0x168)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x22ee73(0x168)](_0x22ee73(0x1ce)),0x1;if(!_0x4d2a2f[_0x22ee73(0x156)])throw new SDKError(ErrorCode[_0x22ee73(0x1ac)],_0x22ee73(0x169));const _0x3e1981=getConsoleNextUrl(_0x59bed0[_0x22ee73(0x1a9)],_0x22ee73(0x159)+_0x4d2a2f['parentId']+'/e/'+_0x4d2a2f[_0x22ee73(0x156)]);return console[_0x22ee73(0x168)](a32_0x252943['green']('✔')+_0x22ee73(0x1bc)+a32_0x252943['cyan'](_0x3e1981)),openBrowser(_0x3e1981),0x0;}if(_0x4d2a2f['type']===_0x22ee73(0x189)){if(!_0x4d2a2f[_0x22ee73(0x1ba)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x22ee73(0x1b3));const _0x209084=await withSpinner(_0x22ee73(0x16e),()=>_0x41c682[_0x22ee73(0x179)][_0x22ee73(0x1ae)](_0x4d2a2f[_0x22ee73(0x1ba)]),{'verbose':_0x59bed0['verbose']});await handleSingleObjectOutput(_0x209084[_0x22ee73(0x15c)],_0x59bed0);}else{if(_0x4d2a2f[_0x22ee73(0x177)]===_0x22ee73(0x179)){if(!_0x4d2a2f['segmentId'])throw new SDKError(ErrorCode[_0x22ee73(0x1ac)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1d42ea=await withSpinner(_0x22ee73(0x191),()=>_0x41c682['segment'][_0x22ee73(0x17e)](_0x4d2a2f[_0x22ee73(0x194)],_0x4d2a2f[_0x22ee73(0x156)]),{'verbose':_0x59bed0[_0x22ee73(0x1b4)]}),_0x439320=getConsoleNextUrl(_0x59bed0[_0x22ee73(0x1a9)],_0x22ee73(0x159)+_0x4d2a2f[_0x22ee73(0x194)]+_0x22ee73(0x143)+_0x4d2a2f[_0x22ee73(0x156)]),_0x152e92=_0x1d42ea[_0x22ee73(0x15c)];_0x152e92[_0x22ee73(0x142)]=_0x439320,await handleSingleObjectOutput(_0x152e92,_0x59bed0);}else return console[_0x22ee73(0x168)](_0x22ee73(0x1b7)),console[_0x22ee73(0x168)](_0x22ee73(0x1b5)),0x1;}return 0x0;}catch(_0x5ca094){if(_0x5ca094 instanceof SDKError)return console[_0x22ee73(0x168)](_0x22ee73(0x13f)+_0x5ca094[_0x22ee73(0x18a)]),_0x5ca094[_0x22ee73(0x1ca)]&&console['error']('\x20\x20Cause:\x20'+_0x5ca094[_0x22ee73(0x1ca)]),0x1;throw _0x5ca094;}}}export const SegmentInfoCommand=SegmentViewCommand;function a32_0x55ef(_0x1d216a,_0x2b3876){_0x1d216a=_0x1d216a-0x134;const _0x4af248=a32_0x4af2();let _0x55ef5b=_0x4af248[_0x1d216a];return _0x55ef5b;}export class SegmentDescCommand extends BaseCommand{[a32_0x69f1e0(0x19a)]=a32_0x69f1e0(0x166);[a32_0x69f1e0(0x151)]=a32_0x69f1e0(0x13c);async[a32_0x69f1e0(0x176)](_0x4d0e57){const _0x18424a=a32_0x69f1e0,{options:_0x4efbfc,args:_0x14c352,tdx:_0x117c98}=_0x4d0e57,_0x2018b=_0x14c352[0x0];if(!_0x2018b)return console[_0x18424a(0x168)](_0x18424a(0x134)),console[_0x18424a(0x168)](_0x18424a(0x16c)),console[_0x18424a(0x168)](_0x18424a(0x148)),console[_0x18424a(0x168)]('Examples:'),console[_0x18424a(0x168)](_0x18424a(0x1b0)),console[_0x18424a(0x168)](_0x18424a(0x1a3)),0x1;try{const _0x1e7958=_0x4efbfc['parentSegment'],_0xb50fd6=resolveSegmentTarget(_0x2018b,_0x1e7958,_0x4efbfc[_0x18424a(0x1b4)]);_0x4efbfc['verbose']&&console[_0x18424a(0x168)]('Target\x20path:\x20'+_0xb50fd6);const _0x560a2d=await withSpinner(_0x18424a(0x170)+_0x2018b+'\x27...',()=>_0x117c98[_0x18424a(0x179)][_0x18424a(0x167)](_0xb50fd6),{'verbose':_0x4efbfc[_0x18424a(0x1b4)]}),_0x58c6c1=_0x560a2d[_0x18424a(0x15c)];_0x4efbfc[_0x18424a(0x1b4)]&&(console[_0x18424a(0x168)](_0x18424a(0x17f)+_0x58c6c1[_0x18424a(0x177)]),console['error']('Parent\x20ID:\x20'+_0x58c6c1['parentId']));if(_0x58c6c1[_0x18424a(0x177)]===_0x18424a(0x189))return console[_0x18424a(0x168)](_0x18424a(0x199)),console[_0x18424a(0x168)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x58c6c1[_0x18424a(0x177)]===_0x18424a(0x185))return console[_0x18424a(0x168)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x18424a(0x168)](_0x18424a(0x15e)),0x1;if(!_0x58c6c1[_0x18424a(0x156)])throw new SDKError(ErrorCode[_0x18424a(0x1ac)],_0x18424a(0x169));const _0x402608=await withSpinner(_0x18424a(0x172),()=>_0x117c98[_0x18424a(0x179)][_0x18424a(0x1c4)](_0x58c6c1['parentId'],_0x58c6c1[_0x18424a(0x156)]),{'verbose':_0x4efbfc[_0x18424a(0x1b4)]}),_0x2a3092=_0x402608[_0x18424a(0x15c)],_0x10bfb6=await executeSchemaQuery(_0x2a3092,_0x117c98,_0x4efbfc);return await handleQueryOutput(_0x10bfb6,_0x4efbfc),0x0;}catch(_0x2d6241){if(_0x2d6241 instanceof SDKError)return console[_0x18424a(0x168)]('Error:\x20'+_0x2d6241[_0x18424a(0x18a)]),_0x2d6241[_0x18424a(0x1ca)]&&console[_0x18424a(0x168)]('\x20\x20Cause:\x20'+_0x2d6241[_0x18424a(0x1ca)]),0x1;throw _0x2d6241;}}}
|
|
1
|
+
const a32_0x2274e8=a32_0x2bb6;(function(_0x1d7936,_0x982175){const _0x50f0f0=a32_0x2bb6,_0x31424a=_0x1d7936();while(!![]){try{const _0x4333f7=-parseInt(_0x50f0f0(0x21f))/0x1*(parseInt(_0x50f0f0(0x1fb))/0x2)+-parseInt(_0x50f0f0(0x27b))/0x3*(-parseInt(_0x50f0f0(0x273))/0x4)+-parseInt(_0x50f0f0(0x271))/0x5*(-parseInt(_0x50f0f0(0x1f2))/0x6)+parseInt(_0x50f0f0(0x20e))/0x7+-parseInt(_0x50f0f0(0x229))/0x8+-parseInt(_0x50f0f0(0x1f1))/0x9+-parseInt(_0x50f0f0(0x276))/0xa;if(_0x4333f7===_0x982175)break;else _0x31424a['push'](_0x31424a['shift']());}catch(_0x59d405){_0x31424a['push'](_0x31424a['shift']());}}}(a32_0xa8ad,0x3b6a2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0xa45164 from'chalk';function resolveSegmentTarget(_0x4480e5,_0x533144,_0x3b869c){const _0x220198=a32_0x2bb6;if(isYamlFilePath(_0x4480e5))try{const _0x8249ec=resolveYamlFilePath(_0x4480e5);return _0x3b869c&&(console['error'](_0x220198(0x27f)+_0x4480e5),console['error'](_0x220198(0x250)+_0x8249ec[_0x220198(0x1ff)]),console[_0x220198(0x24f)]('\x20\x20Segment\x20name:\x20'+_0x8249ec['segmentName']),console['error'](_0x220198(0x26b)+(_0x8249ec[_0x220198(0x23e)]||_0x220198(0x289))),console['error'](_0x220198(0x25a)+_0x8249ec['fullPath'])),_0x8249ec[_0x220198(0x253)];}catch(_0x4d609f){throw new SDKError(ErrorCode[_0x220198(0x1f4)],_0x220198(0x210)+_0x4d609f[_0x220198(0x202)]);}if(!_0x533144)throw new SDKError(ErrorCode[_0x220198(0x1f4)],_0x220198(0x20f));return _0x533144+'/'+_0x4480e5;}export class SegmentDescribeCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x1f6);['description']=a32_0x2274e8(0x265);async[a32_0x2274e8(0x213)](_0x45d228){const _0x40e85c=a32_0x2274e8,{options:_0x19c0fc,args:_0x2de484,tdx:_0x3a062b}=_0x45d228,_0x122317=_0x2de484[0x0],_0x5aec66=!_0x122317&&!!_0x19c0fc[_0x40e85c(0x1ff)],_0x566128=_0x122317||_0x19c0fc['parentSegment'];if(!_0x566128)return console[_0x40e85c(0x24f)](_0x40e85c(0x248)),console['error'](_0x40e85c(0x226)),console['error'](_0x40e85c(0x256)),console[_0x40e85c(0x24f)](_0x40e85c(0x22c)),console['error'](_0x40e85c(0x264)),console[_0x40e85c(0x24f)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x40e85c(0x20a)),0x1;try{const _0x321e6a=_0x19c0fc[_0x40e85c(0x1f9)];let _0x1e712f=_0x566128;!_0x5aec66&&_0x321e6a&&!_0x566128['includes']('/')&&(_0x1e712f=_0x321e6a+'/'+_0x566128,_0x19c0fc[_0x40e85c(0x267)]&&console[_0x40e85c(0x24f)](_0x40e85c(0x279)+_0x1e712f));const _0x1075c6=await withSpinner(_0x40e85c(0x268)+_0x1e712f+_0x40e85c(0x26a),()=>_0x3a062b['segment'][_0x40e85c(0x282)](_0x1e712f),{'verbose':_0x19c0fc[_0x40e85c(0x267)]}),_0x5834e8=_0x1075c6[_0x40e85c(0x20c)];_0x19c0fc[_0x40e85c(0x267)]&&(console[_0x40e85c(0x24f)](_0x40e85c(0x217)+_0x5834e8[_0x40e85c(0x1f8)]),console[_0x40e85c(0x24f)](_0x40e85c(0x26c)+_0x5834e8[_0x40e85c(0x23f)]),_0x5834e8['folderId']&&console['error'](_0x40e85c(0x277)+_0x5834e8['folderId']),_0x5834e8['segmentId']&&console[_0x40e85c(0x24f)](_0x40e85c(0x21a)+_0x5834e8[_0x40e85c(0x237)]));if(_0x5834e8[_0x40e85c(0x1f8)]===_0x40e85c(0x28d)){const _0x397d71=await withSpinner(_0x40e85c(0x24d),()=>_0x3a062b[_0x40e85c(0x28e)][_0x40e85c(0x20d)](_0x5834e8[_0x40e85c(0x23f)]),{'verbose':_0x19c0fc['verbose']});await handleSingleObjectOutput(_0x397d71[_0x40e85c(0x20c)],_0x19c0fc);}else{if(_0x5834e8['type']===_0x40e85c(0x25c)){if(!_0x5834e8[_0x40e85c(0x228)])throw new SDKError(ErrorCode[_0x40e85c(0x283)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x332b5d=await withSpinner(_0x40e85c(0x284),()=>_0x3a062b[_0x40e85c(0x28e)][_0x40e85c(0x22d)](_0x5834e8['folderId']),{'verbose':_0x19c0fc['verbose']});await handleSingleObjectOutput(_0x332b5d[_0x40e85c(0x20c)],_0x19c0fc);}else{if(_0x5834e8[_0x40e85c(0x1f8)]===_0x40e85c(0x28e)){if(!_0x5834e8[_0x40e85c(0x237)])throw new SDKError(ErrorCode[_0x40e85c(0x200)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x53a438=await withSpinner(_0x40e85c(0x280),()=>_0x3a062b[_0x40e85c(0x28e)][_0x40e85c(0x247)](_0x5834e8[_0x40e85c(0x23f)],_0x5834e8[_0x40e85c(0x237)]),{'verbose':_0x19c0fc[_0x40e85c(0x267)]});await handleSingleObjectOutput(_0x53a438['data'],_0x19c0fc);}}}return 0x0;}catch(_0x55cd9f){if(_0x55cd9f instanceof SDKError)return console[_0x40e85c(0x24f)](_0x40e85c(0x1ef)+_0x55cd9f[_0x40e85c(0x202)]),_0x55cd9f[_0x40e85c(0x24c)]&&console[_0x40e85c(0x24f)](_0x40e85c(0x204)+_0x55cd9f[_0x40e85c(0x24c)]),0x1;throw _0x55cd9f;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x249);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x215);async[a32_0x2274e8(0x213)](_0x1d5d2b){const _0x446f49=a32_0x2274e8,{options:_0x492a2e,args:_0x27c2f5,tdx:_0x16e80f}=_0x1d5d2b,_0x44915a=_0x27c2f5[0x0];if(!_0x44915a)return console[_0x446f49(0x24f)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x446f49(0x24f)](_0x446f49(0x27c)),console[_0x446f49(0x24f)](_0x446f49(0x256)),console[_0x446f49(0x24f)](_0x446f49(0x23d)),console['error'](_0x446f49(0x260)),0x1;try{const _0x34b2f7=_0x492a2e[_0x446f49(0x1ff)],_0x17bdfd=resolveSegmentTarget(_0x44915a,_0x34b2f7,_0x492a2e['verbose']);_0x492a2e[_0x446f49(0x267)]&&console['error'](_0x446f49(0x258)+_0x17bdfd);const _0x406c14=await withSpinner('Resolving\x20\x27'+_0x44915a+_0x446f49(0x26a),()=>_0x16e80f[_0x446f49(0x28e)][_0x446f49(0x282)](_0x17bdfd),{'verbose':_0x492a2e[_0x446f49(0x267)]}),_0x49cbf5=_0x406c14[_0x446f49(0x20c)];_0x492a2e[_0x446f49(0x267)]&&(console[_0x446f49(0x24f)]('Resolved\x20type:\x20'+_0x49cbf5[_0x446f49(0x1f8)]),console['error']('Parent\x20ID:\x20'+_0x49cbf5[_0x446f49(0x23f)]));if(_0x49cbf5['type']==='folder')return console[_0x446f49(0x24f)](_0x446f49(0x231)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x49cbf5[_0x446f49(0x1f8)]===_0x446f49(0x28d))return console[_0x446f49(0x24f)](_0x446f49(0x220)),console[_0x446f49(0x24f)](_0x446f49(0x244)),0x1;if(!_0x49cbf5[_0x446f49(0x237)])throw new SDKError(ErrorCode[_0x446f49(0x200)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x28a35a=await withSpinner(_0x446f49(0x22e),()=>_0x16e80f['segment'][_0x446f49(0x26f)](_0x49cbf5[_0x446f49(0x23f)],_0x49cbf5[_0x446f49(0x237)]),{'verbose':_0x492a2e[_0x446f49(0x267)]});let _0x214b3c=_0x28a35a[_0x446f49(0x20c)];const _0x3ca9bd=resolveLimit(_0x492a2e[_0x446f49(0x24e)],DEFAULT_DISPLAY_LIMIT),_0x8290b2=/\bLIMIT\s+\d+/i[_0x446f49(0x275)](_0x214b3c);!_0x8290b2&&(_0x214b3c=_0x214b3c['trim']()['replace'](/;+$/,''),_0x214b3c=_0x446f49(0x242)+_0x214b3c+_0x446f49(0x214)+_0x3ca9bd);_0x492a2e[_0x446f49(0x267)]&&console['error'](_0x446f49(0x234)+_0x214b3c);const _0xb96b41=await withQuerySpinner(_0x446f49(0x241),async _0x533b7c=>{const _0x25793a=_0x446f49,_0x29975f=await _0x16e80f[_0x25793a(0x286)][_0x25793a(0x213)](_0x214b3c,{'catalog':'td','schema':'information_schema','onJobId':_0x4bd363=>{const _0x51b659=_0x25793a;_0x533b7c[_0x51b659(0x205)](_0x4bd363);}});return _0x29975f;},{'verbose':_0x492a2e[_0x446f49(0x267)]}),_0x172d79=_0xb96b41['data'],_0x3d7e98=_0x172d79[_0x446f49(0x25e)]?'\x20[Job\x20ID:\x20'+_0x172d79['jobId']+']':'';return console[_0x446f49(0x24f)](_0x446f49(0x238)+_0x172d79[_0x446f49(0x259)][_0x446f49(0x23c)]['toLocaleString']()+_0x446f49(0x209)+('in\x20'+formatElapsed(_0x172d79[_0x446f49(0x259)][_0x446f49(0x24b)])+_0x3d7e98)),await handleQueryOutput(_0x172d79,_0x492a2e),0x0;}catch(_0x5bcb72){if(_0x5bcb72 instanceof SDKError)return console[_0x446f49(0x24f)](_0x446f49(0x251)+_0x5bcb72['code']+']'),console[_0x446f49(0x24f)]('\x0a'+_0x5bcb72['message']),0x1;throw _0x5bcb72;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x2274e8(0x239)]='segment:folder:list';[a32_0x2274e8(0x1f5)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a32_0x2274e8(0x213)](_0x5d35fe){const _0x488e13=a32_0x2274e8,{options:_0x17dcb0,args:_0x16fd8c,tdx:_0x5da57a}=_0x5d35fe;if(_0x16fd8c['length']===0x0)return console[_0x488e13(0x24f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x488e13(0x24f)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x46a534=_0x16fd8c[0x0];try{_0x17dcb0[_0x488e13(0x267)]&&(console[_0x488e13(0x24f)](_0x488e13(0x25d)+_0x17dcb0['site']),console[_0x488e13(0x24f)](_0x488e13(0x285)+_0x46a534));const _0x2dd30=await withSpinner(_0x488e13(0x261)+_0x46a534+_0x488e13(0x26a),()=>_0x5da57a[_0x488e13(0x28e)][_0x488e13(0x243)](_0x46a534),{'verbose':_0x17dcb0[_0x488e13(0x267)]}),_0x434dd8=_0x2dd30['data'];_0x17dcb0[_0x488e13(0x267)]&&console[_0x488e13(0x24f)]('Resolved\x20parent\x20ID:\x20'+_0x434dd8);const _0x46c808=await withSpinner(_0x488e13(0x24a)+_0x46a534+_0x488e13(0x26a),()=>_0x5da57a[_0x488e13(0x28e)]['listFolders'](_0x434dd8),{'verbose':_0x17dcb0[_0x488e13(0x267)]}),_0x29117a=_0x46c808[_0x488e13(0x20c)];return console['error'](_0x488e13(0x252)+_0x29117a[_0x488e13(0x211)]+_0x488e13(0x27e)+(_0x29117a[_0x488e13(0x211)]!==0x1?'s':'')),await handleSDKOutput(_0x29117a,_0x17dcb0),0x0;}catch(_0x1df1ff){if(_0x1df1ff instanceof SDKError)return console[_0x488e13(0x24f)](_0x488e13(0x1ef)+_0x1df1ff[_0x488e13(0x202)]),_0x1df1ff['cause']&&console[_0x488e13(0x24f)]('\x20\x20Cause:\x20'+_0x1df1ff[_0x488e13(0x24c)]),0x1;throw _0x1df1ff;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x1f7);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x21c);async['execute'](_0xf947aa){const _0x1e9669=a32_0x2274e8,{options:_0x1968b7,args:_0x11d9e7,tdx:_0x1dcccb}=_0xf947aa;if(_0x11d9e7[_0x1e9669(0x211)]===0x0)return console[_0x1e9669(0x24f)](_0x1e9669(0x21b)),console[_0x1e9669(0x24f)](_0x1e9669(0x27a)),0x1;try{const {parentId:_0x2aebed,childId:_0x4e4840}=parseSegmentRef(_0x11d9e7[0x0]);_0x1968b7[_0x1e9669(0x267)]&&(console[_0x1e9669(0x24f)](_0x1e9669(0x25d)+_0x1968b7[_0x1e9669(0x269)]),console[_0x1e9669(0x24f)]('Parent\x20name:\x20'+_0x2aebed),_0x4e4840&&console[_0x1e9669(0x24f)](_0x1e9669(0x219)+_0x4e4840));if(!_0x4e4840)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x5cd8ac=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2aebed+_0x1e9669(0x26a),()=>_0x1dcccb[_0x1e9669(0x28e)][_0x1e9669(0x243)](_0x2aebed),{'verbose':_0x1968b7[_0x1e9669(0x267)]}),_0x1c080f=_0x5cd8ac[_0x1e9669(0x20c)];_0x1968b7[_0x1e9669(0x267)]&&console[_0x1e9669(0x24f)](_0x1e9669(0x224)+_0x1c080f);const _0x2eb834=await withSpinner(_0x1e9669(0x221)+_0x4e4840+'\x27...',()=>_0x1dcccb['segment'][_0x1e9669(0x22f)](_0x1c080f,_0x4e4840),{'verbose':_0x1968b7['verbose']}),_0x470387=_0x2eb834[_0x1e9669(0x20c)];_0x1968b7['verbose']&&console[_0x1e9669(0x24f)](_0x1e9669(0x257)+_0x470387);const _0x18cde8=await withSpinner(_0x1e9669(0x208)+_0x4e4840+'\x27...',()=>_0x1dcccb['segment']['getFolder'](_0x470387),{'verbose':_0x1968b7[_0x1e9669(0x267)]});return await handleSDKOutput([_0x18cde8['data']],_0x1968b7),0x0;}catch(_0x93fc6){if(_0x93fc6 instanceof SDKError)return console[_0x1e9669(0x24f)](_0x1e9669(0x1ef)+_0x93fc6[_0x1e9669(0x202)]),_0x93fc6[_0x1e9669(0x24c)]&&console[_0x1e9669(0x24f)](_0x1e9669(0x204)+_0x93fc6[_0x1e9669(0x24c)]),0x1;throw _0x93fc6;}}}function a32_0x2bb6(_0x4d2503,_0x48c265){_0x4d2503=_0x4d2503-0x1ef;const _0xa8ad7a=a32_0xa8ad();let _0x2bb630=_0xa8ad7a[_0x4d2503];return _0x2bb630;}function a32_0xa8ad(){const _0x4af578=['Creating\x20folder\x20\x27','data','getParent','967960dgCrBZ','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','length','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','execute','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','cyan','Resolved\x20type:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20name:\x20','Segment\x20ID:\x20','Error:\x20Folder\x20reference\x20is\x20required','Show\x20segment\x20folder\x20details','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','json','68WHQvwn','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolved\x20parent\x20ID:\x20','log','Usage:\x20tdx\x20segment\x20describe\x20<path>','Create\x20segment\x20folder\x20for\x20organization','folderId','3682664QmpgVS','/app/ps/','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','getFolder','Fetching\x20SQL\x20for\x20segment...','resolveFolderId','Show\x20folder\x20or\x20child\x20segment\x20details','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20sql','\x27\x20with\x20ID:\x20','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20Opening\x20','segmentId','✔\x20Query\x20completed:\x20Processed\x20','name','Resolving\x20parent\x20folder\x20\x27','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','processedRows','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','folderPath','parentId','Usage:\x20tdx\x20sg\x20sql\x20<name>','Executing\x20segment\x20query...','SELECT\x20*\x20FROM\x20(\x0a','resolveParentId','Use:\x20tdx\x20ps\x20show','Options:','segment:sql','getSegment','Error:\x20Path\x20or\x20name\x20is\x20required','segment:show','Listing\x20folders\x20for\x20parent\x20\x27','elapsedTimeMillis','cause','Fetching\x20parent\x20segment\x20details...','limit','error','\x20\x20Parent\x20segment:\x20','✖\x20Query\x20failed\x20[','✔\x20Found\x20','fullPath','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Examples:','Resolved\x20folder\x20ID:\x20','Target\x20path:\x20','stats','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','folder','Site:\x20','jobId','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolving\x20parent\x20segment\x20\x27','/e/','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Show\x20segment\x20or\x20folder\x20details','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','verbose','Resolving\x20path\x20\x27','site','\x27...','\x20\x20Folder\x20path:\x20','Parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20desc','getSegmentSQL','Get\x20SQL\x20query\x20for\x20child\x20segment','405415dDjMoO','Resolving\x20\x27','100ltqomt','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','test','565030joRUMW','Folder\x20ID:\x20','✔\x20Created\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','56538HGUMdV','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','parentFolder','\x20folder','Resolved\x20YAML\x20file:\x20','Fetching\x20segment\x20details...','createFolder','resolvePathToResource','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20folder\x20details...','Parent\x20name:\x20','query','Use:\x20tdx\x20ps\x20view','Parent\x20segment:\x20','(root)','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','segment:desc','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','parent','segment','Error:\x20','segment:folder:create','2217159TJhEbL','30bWzKsq','green','INVALID_ARGUMENT','description','segment:describe','segment:folder:show','type','segmentPath','Use:\x20tdx\x20ps\x20view\x20-w','244caASIi','jsonl','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','parentSegment','SEGMENT_NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','message','segment:view','\x20\x20Cause:\x20','setJobId','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','format','Fetching\x20folder\x20\x27','\x20rows\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'];a32_0xa8ad=function(){return _0x4af578;};return a32_0xa8ad();}export class SegmentSQLCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x246);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x270);async[a32_0x2274e8(0x213)](_0x1020a0){const _0x535a8a=a32_0x2274e8,{options:_0x2d76d8,args:_0x41951b,tdx:_0x2aecd3}=_0x1020a0,_0x10541f=_0x41951b[0x0];if(!_0x10541f)return console[_0x535a8a(0x24f)](_0x535a8a(0x21d)),console[_0x535a8a(0x24f)](_0x535a8a(0x240)),console[_0x535a8a(0x24f)](_0x535a8a(0x201)),console[_0x535a8a(0x24f)](_0x535a8a(0x256)),console[_0x535a8a(0x24f)](_0x535a8a(0x28c)),console[_0x535a8a(0x24f)](_0x535a8a(0x235)),0x1;try{const _0x3795f1=_0x2d76d8[_0x535a8a(0x1ff)],_0x5645fe=resolveSegmentTarget(_0x10541f,_0x3795f1,_0x2d76d8['verbose']);_0x2d76d8[_0x535a8a(0x267)]&&console[_0x535a8a(0x24f)]('Target\x20path:\x20'+_0x5645fe);const _0x1e4313=await withSpinner(_0x535a8a(0x272)+_0x10541f+'\x27...',()=>_0x2aecd3[_0x535a8a(0x28e)][_0x535a8a(0x282)](_0x5645fe),{'verbose':_0x2d76d8[_0x535a8a(0x267)]}),_0x25b651=_0x1e4313[_0x535a8a(0x20c)];_0x2d76d8['verbose']&&(console[_0x535a8a(0x24f)](_0x535a8a(0x217)+_0x25b651[_0x535a8a(0x1f8)]),console['error']('Parent\x20ID:\x20'+_0x25b651[_0x535a8a(0x23f)]));if(_0x25b651[_0x535a8a(0x1f8)]===_0x535a8a(0x25c))return console[_0x535a8a(0x24f)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x535a8a(0x24f)](_0x535a8a(0x1fd)),0x1;if(_0x25b651[_0x535a8a(0x1f8)]===_0x535a8a(0x28d))return console[_0x535a8a(0x24f)](_0x535a8a(0x206)),console[_0x535a8a(0x24f)](_0x535a8a(0x232)),0x1;if(!_0x25b651[_0x535a8a(0x237)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x535a8a(0x22b));const _0x41d05d=await withSpinner(_0x535a8a(0x22e),()=>_0x2aecd3[_0x535a8a(0x28e)]['getSegmentSQL'](_0x25b651[_0x535a8a(0x23f)],_0x25b651[_0x535a8a(0x237)]),{'verbose':_0x2d76d8[_0x535a8a(0x267)]}),_0x1f82eb=_0x41d05d[_0x535a8a(0x20c)];return _0x2d76d8[_0x535a8a(0x207)]===_0x535a8a(0x21e)||_0x2d76d8[_0x535a8a(0x207)]===_0x535a8a(0x1fc)?await handleSDKOutput([{'sql':_0x1f82eb}],_0x2d76d8):console[_0x535a8a(0x225)](_0x1f82eb),0x0;}catch(_0xd6b956){if(_0xd6b956 instanceof SDKError)return console['error'](_0x535a8a(0x1ef)+_0xd6b956[_0x535a8a(0x202)]),_0xd6b956[_0x535a8a(0x24c)]&&console[_0x535a8a(0x24f)]('\x20\x20Cause:\x20'+_0xd6b956[_0x535a8a(0x24c)]),0x1;throw _0xd6b956;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a32_0x2274e8(0x1f0);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x227);async['execute'](_0x258700){const _0x1bf78d=a32_0x2274e8,{options:_0x35983f,args:_0x4f5dd1,tdx:_0x53e962}=_0x258700,_0x467ee3=_0x35983f;if(_0x4f5dd1[_0x1bf78d(0x211)]<0x2)return console[_0x1bf78d(0x24f)](_0x1bf78d(0x28a)),console[_0x1bf78d(0x24f)](_0x1bf78d(0x263)),0x1;const _0xe51827=_0x4f5dd1[0x0],_0x4cec4b=_0x4f5dd1[0x1];_0x467ee3[_0x1bf78d(0x267)]&&(console['error'](_0x1bf78d(0x25d)+_0x467ee3[_0x1bf78d(0x269)]),console[_0x1bf78d(0x24f)](_0x1bf78d(0x288)+_0xe51827),console[_0x1bf78d(0x24f)](_0x1bf78d(0x219)+_0x4cec4b));let _0x56c701;if(_0x467ee3['parentFolder']){const _0x4b8d59=_0x467ee3[_0x1bf78d(0x27d)],_0xc9e9d2=await withSpinner(_0x1bf78d(0x261)+_0xe51827+_0x1bf78d(0x26a),()=>_0x53e962[_0x1bf78d(0x28e)]['resolveParentId'](_0xe51827),{'verbose':_0x467ee3['verbose']}),_0x5dfc16=_0xc9e9d2['data'],_0x76b21f=await withSpinner(_0x1bf78d(0x23a)+_0x4b8d59+_0x1bf78d(0x26a),()=>_0x53e962[_0x1bf78d(0x28e)][_0x1bf78d(0x22f)](_0x5dfc16,_0x4b8d59),{'verbose':_0x467ee3[_0x1bf78d(0x267)]});_0x56c701=_0x76b21f['data'],_0x467ee3[_0x1bf78d(0x267)]&&console[_0x1bf78d(0x24f)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x56c701);}const _0xe71e5b={'name':_0x4cec4b,'description':_0x467ee3[_0x1bf78d(0x1f5)],'parentFolderId':_0x56c701},_0x5acf5a=await withSpinner(_0x1bf78d(0x20b)+_0x4cec4b+_0x1bf78d(0x26a),()=>_0x53e962['segment'][_0x1bf78d(0x281)](_0xe51827,_0xe71e5b),{'verbose':_0x467ee3[_0x1bf78d(0x267)]}),_0x371132=_0x5acf5a[_0x1bf78d(0x20c)];return console[_0x1bf78d(0x24f)](_0x1bf78d(0x278)+_0x371132[_0x1bf78d(0x239)]+_0x1bf78d(0x233)+_0x371132['id']),await handleSDKOutput([_0x371132],_0x467ee3),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x203);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x230);async[a32_0x2274e8(0x213)](_0x3e6914){const _0x55db7d=a32_0x2274e8,{options:_0x34514e,args:_0x4ccc9e,tdx:_0x5f5ec3}=_0x3e6914,_0x55b8a7=_0x4ccc9e[0x0];if(!_0x55b8a7)return console[_0x55db7d(0x24f)](_0x55db7d(0x218)),console[_0x55db7d(0x24f)](_0x55db7d(0x212)),console[_0x55db7d(0x24f)](_0x55db7d(0x26d)),console['error'](_0x55db7d(0x245)),console['error'](_0x55db7d(0x1fe)),console['error']('Examples:'),console['error'](_0x55db7d(0x25b)),console['error'](_0x55db7d(0x23b)),console[_0x55db7d(0x24f)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x55db7d(0x24f)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x57740f=_0x34514e[_0x55db7d(0x1ff)],_0x19cabb=resolveSegmentTarget(_0x55b8a7,_0x57740f,_0x34514e[_0x55db7d(0x267)]);_0x34514e['verbose']&&console[_0x55db7d(0x24f)]('Target\x20path:\x20'+_0x19cabb);const _0x3301db=await withSpinner(_0x55db7d(0x272)+_0x55b8a7+_0x55db7d(0x26a),()=>_0x5f5ec3[_0x55db7d(0x28e)]['resolvePathToResource'](_0x19cabb),{'verbose':_0x34514e['verbose']}),_0x222ce3=_0x3301db[_0x55db7d(0x20c)];_0x34514e[_0x55db7d(0x267)]&&(console[_0x55db7d(0x24f)](_0x55db7d(0x217)+_0x222ce3[_0x55db7d(0x1f8)]),console[_0x55db7d(0x24f)](_0x55db7d(0x26c)+_0x222ce3['parentId']),_0x222ce3['folderId']&&console[_0x55db7d(0x24f)](_0x55db7d(0x277)+_0x222ce3[_0x55db7d(0x228)]),_0x222ce3['segmentId']&&console[_0x55db7d(0x24f)](_0x55db7d(0x21a)+_0x222ce3[_0x55db7d(0x237)]));if(_0x34514e['web']){if(_0x222ce3[_0x55db7d(0x1f8)]===_0x55db7d(0x25c))return console[_0x55db7d(0x24f)](_0x55db7d(0x266)),0x1;if(_0x222ce3[_0x55db7d(0x1f8)]===_0x55db7d(0x28d))return console[_0x55db7d(0x24f)](_0x55db7d(0x274)),console['error'](_0x55db7d(0x1fa)),0x1;if(!_0x222ce3[_0x55db7d(0x237)])throw new SDKError(ErrorCode[_0x55db7d(0x200)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4c638a=getConsoleNextUrl(_0x34514e['site'],'/app/ps/'+_0x222ce3[_0x55db7d(0x23f)]+_0x55db7d(0x262)+_0x222ce3[_0x55db7d(0x237)]);return console[_0x55db7d(0x24f)](a32_0xa45164[_0x55db7d(0x1f3)]('✔')+_0x55db7d(0x236)+a32_0xa45164[_0x55db7d(0x216)](_0x4c638a)),openBrowser(_0x4c638a),0x0;}if(_0x222ce3['type']==='folder'){if(!_0x222ce3['folderId'])throw new SDKError(ErrorCode[_0x55db7d(0x283)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x477490=await withSpinner(_0x55db7d(0x284),()=>_0x5f5ec3[_0x55db7d(0x28e)][_0x55db7d(0x22d)](_0x222ce3[_0x55db7d(0x228)]),{'verbose':_0x34514e[_0x55db7d(0x267)]});await handleSingleObjectOutput(_0x477490[_0x55db7d(0x20c)],_0x34514e);}else{if(_0x222ce3[_0x55db7d(0x1f8)]===_0x55db7d(0x28e)){if(!_0x222ce3[_0x55db7d(0x237)])throw new SDKError(ErrorCode[_0x55db7d(0x200)],_0x55db7d(0x22b));const _0x3a9b44=await withSpinner(_0x55db7d(0x280),()=>_0x5f5ec3[_0x55db7d(0x28e)][_0x55db7d(0x247)](_0x222ce3['parentId'],_0x222ce3[_0x55db7d(0x237)]),{'verbose':_0x34514e[_0x55db7d(0x267)]}),_0x15f242=getConsoleNextUrl(_0x34514e[_0x55db7d(0x269)],_0x55db7d(0x22a)+_0x222ce3[_0x55db7d(0x23f)]+_0x55db7d(0x262)+_0x222ce3[_0x55db7d(0x237)]),_0x3446fb=_0x3a9b44[_0x55db7d(0x20c)];_0x3446fb['url']=_0x15f242,await handleSingleObjectOutput(_0x3446fb,_0x34514e);}else return console[_0x55db7d(0x24f)](_0x55db7d(0x25f)),console[_0x55db7d(0x24f)](_0x55db7d(0x287)),0x1;}return 0x0;}catch(_0x306240){if(_0x306240 instanceof SDKError)return console[_0x55db7d(0x24f)](_0x55db7d(0x1ef)+_0x306240['message']),_0x306240[_0x55db7d(0x24c)]&&console['error']('\x20\x20Cause:\x20'+_0x306240[_0x55db7d(0x24c)]),0x1;throw _0x306240;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x28b);[a32_0x2274e8(0x1f5)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a32_0x2274e8(0x213)](_0x534fea){const _0x7c49cd=a32_0x2274e8,{options:_0x2a34be,args:_0x490059,tdx:_0x342f54}=_0x534fea,_0x32a981=_0x490059[0x0];if(!_0x32a981)return console['error'](_0x7c49cd(0x21d)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x7c49cd(0x24f)](_0x7c49cd(0x222)),console['error'](_0x7c49cd(0x256)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x7c49cd(0x24f)](_0x7c49cd(0x255)),0x1;try{const _0x4c9fab=_0x2a34be['parentSegment'],_0x253825=resolveSegmentTarget(_0x32a981,_0x4c9fab,_0x2a34be[_0x7c49cd(0x267)]);_0x2a34be[_0x7c49cd(0x267)]&&console[_0x7c49cd(0x24f)]('Target\x20path:\x20'+_0x253825);const _0x245d50=await withSpinner(_0x7c49cd(0x272)+_0x32a981+_0x7c49cd(0x26a),()=>_0x342f54[_0x7c49cd(0x28e)][_0x7c49cd(0x282)](_0x253825),{'verbose':_0x2a34be[_0x7c49cd(0x267)]}),_0x4d4479=_0x245d50['data'];_0x2a34be['verbose']&&(console[_0x7c49cd(0x24f)](_0x7c49cd(0x217)+_0x4d4479[_0x7c49cd(0x1f8)]),console[_0x7c49cd(0x24f)](_0x7c49cd(0x26c)+_0x4d4479[_0x7c49cd(0x23f)]));if(_0x4d4479[_0x7c49cd(0x1f8)]===_0x7c49cd(0x25c))return console[_0x7c49cd(0x24f)](_0x7c49cd(0x223)),console[_0x7c49cd(0x24f)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x4d4479[_0x7c49cd(0x1f8)]===_0x7c49cd(0x28d))return console[_0x7c49cd(0x24f)](_0x7c49cd(0x254)),console[_0x7c49cd(0x24f)](_0x7c49cd(0x26e)),0x1;if(!_0x4d4479['segmentId'])throw new SDKError(ErrorCode[_0x7c49cd(0x200)],_0x7c49cd(0x22b));const _0x2a8789=await withSpinner(_0x7c49cd(0x22e),()=>_0x342f54[_0x7c49cd(0x28e)][_0x7c49cd(0x26f)](_0x4d4479[_0x7c49cd(0x23f)],_0x4d4479['segmentId']),{'verbose':_0x2a34be[_0x7c49cd(0x267)]}),_0x1be75b=_0x2a8789[_0x7c49cd(0x20c)],_0x3681fa=await executeSchemaQuery(_0x1be75b,_0x342f54,_0x2a34be);return await handleQueryOutput(_0x3681fa,_0x2a34be),0x0;}catch(_0x5f3da8){if(_0x5f3da8 instanceof SDKError)return console[_0x7c49cd(0x24f)](_0x7c49cd(0x1ef)+_0x5f3da8[_0x7c49cd(0x202)]),_0x5f3da8[_0x7c49cd(0x24c)]&&console[_0x7c49cd(0x24f)](_0x7c49cd(0x204)+_0x5f3da8[_0x7c49cd(0x24c)]),0x1;throw _0x5f3da8;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x35c08b=a33_0x50ef;(function(_0x45974e,_0x1341a8){const _0x8889f9=a33_0x50ef,_0x751cb=_0x45974e();while(!![]){try{const _0x4cd013=parseInt(_0x8889f9(0x1e2))/0x1*(-parseInt(_0x8889f9(0x1de))/0x2)+parseInt(_0x8889f9(0x1fa))/0x3*(parseInt(_0x8889f9(0x1e3))/0x4)+parseInt(_0x8889f9(0x1f8))/0x5*(-parseInt(_0x8889f9(0x1ed))/0x6)+parseInt(_0x8889f9(0x1df))/0x7*(-parseInt(_0x8889f9(0x1f2))/0x8)+-parseInt(_0x8889f9(0x1cc))/0x9+-parseInt(_0x8889f9(0x1cb))/0xa*(-parseInt(_0x8889f9(0x1c5))/0xb)+parseInt(_0x8889f9(0x1c4))/0xc;if(_0x4cd013===_0x1341a8)break;else _0x751cb['push'](_0x751cb['shift']());}catch(_0x444876){_0x751cb['push'](_0x751cb['shift']());}}}(a33_0xbc7f,0x29a6d));import{BaseCommand}from'./command.js';function a33_0x50ef(_0x555855,_0x12fbe0){_0x555855=_0x555855-0x1c1;const _0xbc7f99=a33_0xbc7f();let _0x50ef46=_0xbc7f99[_0x555855];return _0x50ef46;}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x246cc4 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a33_0x35c08b(0x1f7)]=a33_0x35c08b(0x1db);[a33_0x35c08b(0x1d6)]=a33_0x35c08b(0x1d1);async[a33_0x35c08b(0x1f1)](_0x1313a8){const _0x41e742=a33_0x35c08b;console[_0x41e742(0x1c9)](a33_0x246cc4[_0x41e742(0x1fc)](_0x41e742(0x1e4))),console[_0x41e742(0x1c9)](a33_0x246cc4[_0x41e742(0x1fc)](_0x41e742(0x1ea)));const {options:_0x356d1c,args:_0x5d57ab,tdx:_0x37809c}=_0x1313a8,_0x4db96b=_0x356d1c;if(_0x5d57ab[_0x41e742(0x1cd)]===0x0)return console[_0x41e742(0x1c9)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x41e742(0x1c9)](_0x41e742(0x1ec)),console[_0x41e742(0x1c9)](_0x41e742(0x1c7)),console[_0x41e742(0x1c9)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x41e742(0x1c9)](_0x41e742(0x1d9)),console[_0x41e742(0x1c9)](_0x41e742(0x1e6)),0x1;const _0xa0f0c0=_0x5d57ab[0x0],_0x3c3c91=_0x356d1c[_0x41e742(0x1c6)];let _0x377949=_0xa0f0c0;_0x3c3c91&&!_0xa0f0c0[_0x41e742(0x1cf)]('/')&&(_0x377949=_0x3c3c91+'/'+_0xa0f0c0,_0x4db96b[_0x41e742(0x1e1)]&&console[_0x41e742(0x1c9)](_0x41e742(0x1fb)+_0x377949));const _0x57cec9=parsePath(_0x377949);if(_0x57cec9[_0x41e742(0x1f0)][_0x41e742(0x1cd)]<0x2)return console[_0x41e742(0x1c9)](_0x41e742(0x1e8)),console['error'](_0x41e742(0x1c1)),0x1;const _0xd33804=_0x57cec9[_0x41e742(0x1f0)][0x0],_0x492cee=getBaseName(_0x377949),_0xd460dc=getParentPath(_0x377949);_0x4db96b[_0x41e742(0x1e1)]&&(console[_0x41e742(0x1c9)](_0x41e742(0x1d4)+_0x4db96b['site']),console['error'](_0x41e742(0x1c8)+_0x377949),console[_0x41e742(0x1c9)](_0x41e742(0x1dc)+_0xd33804),console[_0x41e742(0x1c9)](_0x41e742(0x1e9)+_0x492cee),console[_0x41e742(0x1c9)]('Parent\x20path:\x20'+_0xd460dc));const _0x47fcdf=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xd33804+'\x27...',()=>_0x37809c[_0x41e742(0x1ce)][_0x41e742(0x1d2)](_0xd33804),{'verbose':_0x4db96b[_0x41e742(0x1e1)]}),_0x457bb6=_0x47fcdf[_0x41e742(0x1c2)];let _0x2afd71;if(_0x57cec9[_0x41e742(0x1f0)]['length']>0x2){const _0x10b9a7=await withSpinner(_0x41e742(0x1ca)+_0xd460dc+_0x41e742(0x1da),()=>_0x37809c[_0x41e742(0x1ce)][_0x41e742(0x1d0)](_0xd460dc),{'verbose':_0x4db96b[_0x41e742(0x1e1)]}),_0x1c0b59=_0x10b9a7[_0x41e742(0x1c2)];if(_0x1c0b59[_0x41e742(0x1ee)]!==_0x41e742(0x1d5)&&_0x1c0b59[_0x41e742(0x1ee)]!==_0x41e742(0x1c3))return console[_0x41e742(0x1c9)](_0x41e742(0x1e0)),0x1;_0x2afd71=_0x1c0b59[_0x41e742(0x1e7)];}else{if(_0x4db96b['folder']){const _0x360392=await withSpinner(_0x41e742(0x1d7)+_0x4db96b[_0x41e742(0x1d5)]+'\x27...',()=>_0x37809c[_0x41e742(0x1ce)][_0x41e742(0x1f3)](_0x457bb6,_0x4db96b[_0x41e742(0x1d5)]),{'verbose':_0x4db96b[_0x41e742(0x1e1)]});_0x2afd71=_0x360392[_0x41e742(0x1c2)];}}_0x4db96b[_0x41e742(0x1e1)]&&_0x2afd71&&console[_0x41e742(0x1c9)]('Resolved\x20folder\x20ID:\x20'+_0x2afd71);const _0x57a0f0=await loadJSONFromOptions(_0x4db96b[_0x41e742(0x1eb)],_0x4db96b[_0x41e742(0x1ef)]),_0x19da05={'name':_0x492cee,'description':_0x4db96b[_0x41e742(0x1d6)],'rule':_0x57a0f0,'kind':_0x4db96b[_0x41e742(0x1f4)]!==undefined?parseInt(_0x4db96b[_0x41e742(0x1f4)],0xa):undefined,'isVisible':_0x4db96b[_0x41e742(0x1f5)]?![]:undefined,'segmentFolderId':_0x2afd71,'countPopulation':_0x4db96b[_0x41e742(0x1f9)]?![]:undefined},_0x2d7c6d=await withSpinner(_0x41e742(0x1f6)+_0x492cee+_0x41e742(0x1da),()=>_0x37809c[_0x41e742(0x1ce)][_0x41e742(0x1dd)](_0x457bb6,_0x19da05),{'verbose':_0x4db96b['verbose']}),_0x884783=_0x2d7c6d[_0x41e742(0x1c2)];return console['error'](_0x41e742(0x1d3)+_0x884783[_0x41e742(0x1f7)]+_0x41e742(0x1d8)+_0x884783['id']),_0x377949!==_0xa0f0c0&&console[_0x41e742(0x1c9)](_0x41e742(0x1e5)+_0x377949),await handleSDKOutput([_0x884783],_0x4db96b),0x0;}}function a33_0xbc7f(){const _0x2e2724=['type','ruleFile','segments','execute','88iMaRwa','resolveFolderId','kind','invisible','Creating\x20segment\x20\x27','name','205Qjzozb','noCountPopulation','82623TqOsNv','Resolved\x20relative\x20path\x20to:\x20','yellow','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','parent','8373204LvJnxh','11HWdRVs','segmentPath','Examples:','Target\x20path:\x20','error','Resolving\x20folder\x20path\x20\x27','1221430VYWueY','1685340RgVuTx','length','segment','includes','resolvePathToResource','Create\x20child\x20segment\x20with\x20filtering\x20rules','resolveParentId','✔\x20Created\x20segment\x20\x27','Site:\x20','folder','description','Resolving\x20folder\x20\x27','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','\x27...','segment:create','Parent:\x20','createSegment','2WIEbrL','63119ejvCdB','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','verbose','268290XJouyT','8VMkZTE','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folderId','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Segment\x20name:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','rule','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','21900AvTrXY'];a33_0xbc7f=function(){return _0x2e2724;};return a33_0xbc7f();}
|