@treasuredata/tdx 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.d.ts +35 -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.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +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 +45 -1
- 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 +27 -20
- 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 +80 -4
- 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_0x192174=a29_0x193b;(function(_0x443d3d,_0x47e923){const _0x40d020=a29_0x193b,_0x5441ad=_0x443d3d();while(!![]){try{const _0x3542bc=parseInt(_0x40d020(0x29e))/0x1+parseInt(_0x40d020(0x1cc))/0x2+parseInt(_0x40d020(0x2c6))/0x3+-parseInt(_0x40d020(0x1be))/0x4+-parseInt(_0x40d020(0x25f))/0x5+-parseInt(_0x40d020(0x215))/0x6*(-parseInt(_0x40d020(0x281))/0x7)+-parseInt(_0x40d020(0x1dd))/0x8;if(_0x3542bc===_0x47e923)break;else _0x5441ad['push'](_0x5441ad['shift']());}catch(_0x5674db){_0x5441ad['push'](_0x5441ad['shift']());}}}(a29_0x20ad,0x30e6b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';function a29_0x20ad(){const _0x1b377a=['displaySampleData','stats','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','displayColumns','all','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','resolveParentId','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','schemaValid','allValid','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20--behavior\x20\x22','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','customerPercent','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','963660mrmxEt','Fetching\x20parent\x20segment\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','database','\x0aUsage:\x20tdx\x20ps\x20preview\x20','number','query','Session:','Analyzing\x20changes...','Master\x20Table','isDirectory','tdx\x20segment\x20parent\x20preview\x20','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','550324wtFHuL','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20field','\x20parent\x20segment\x20\x27','\x20--attribute\x20\x22','getParentSQL','Created','yes','Resolving\x20parent\x20segment\x20\x27','open','sampleData','List\x20available\x20fields\x20for\x20segmentation','customersWithEvents','map','\x27\x20is\x20up\x20to\x20date','Rows:','toLocaleString','4320136rHJeNX','segment:parent:validate','joinKey','Listing\x20fields\x20for\x20\x27','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','name','match','Aborted.','.yml','behavior','YAML\x20file:\x20','parent_segment','\x20--enriched','red','elapsedTimeMillis','/{name}.yml\x0a','start','\x0aChanges\x20to\x20\x27','✔\x20No\x20changes\x20-\x20\x27','data','\x20=\x20','Attribute:','output','\x20--behavior\x20\x22<name>\x22','\x27...','✔\x20Query\x20completed:\x20Processed\x20','pushParentYaml','Status:','darwin','table','Source:','platform','jobId','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','format','dim','scheduleType','foreignKey','displayPreviewHints','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20--interval\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','listFields','attributes','yellow','Columns:','bold','\x27\x20is\x20already\x20up\x20to\x20date','\x20--attribute\x20\x22<name>\x22','Creating','Listing\x20parent\x20segments\x20matching\x20\x27','✔\x20Updated\x20parent\x20segment\x20\x27','displayBehaviorsStats','timezone','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','6Guutyr','\x5c$&','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','sort','addAttributes','Error:','displayValidateResults','Output\x20file:\x20','Database:\x20','\x20[Job\x20ID:\x20','segment:parent:fields','segment:parent:list','using\x20the\x20default\x20path:\x20','displayMasterInfo','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','To\x20view\x20sample\x20data:','List\x20parent\x20segments','customerGroup','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','workflowAttemptId','Fetching\x20current\x20configuration\x20for\x20\x27','segment:parent:show','Error:\x20File\x20not\x20found:\x20','log','totalEvents','scheduleOption','join','✔\x20Found\x20','Options\x20(one\x20required):\x0a','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Listing\x20parent\x20segments...','`\x20to\x20download\x20the\x20configuration\x20first','displayAttributesStats','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','segment:parent:pull','green','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','string','FINISHED','/\x20directories\x20exist.','Name:\x20','\x0aNew\x20parent\x20segment\x20\x27','apply','ignore','displaySummary','coveragePercent','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','master','/\x20directory.\x0a','Updating\x20parent\x20segment\x20\x27','Master\x20+\x20Attributes','/\x20→\x20','Master:','Options:\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','description','runParent','\x27\x20and\x20run\x20workflow?','schemaError','Preview:','Behaviors','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Behavior:','utf-8','✔\x20Created\x20parent\x20segment\x20\x27','.yaml','No\x20parent\x20segments\x20found','interval','parentSegment','segment:parent:desc','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','867455YmODfE','session','createParent','endsWith','Executing\x20parent\x20segment\x20query...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20kill','\x0aChanges\x20to\x20apply\x20to\x20\x27','run','addAttributesFile','column','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Available\x20behaviors:','test','workflowId','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Validating\x20configuration...','\x0a⚠️\x20\x20Migrating:\x20','/sessions/','Fetching\x20SQL\x20for\x20\x27','workflowSessionId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','jsonl','\x20\x20\x20\x20-\x20','previewParentYaml','Found\x20YAML\x20file:\x20','SQL\x20query:\x0a','/app/workflows/','Site:\x20','\x0a✔\x20Workflow\x20started','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','/attempt/','segment:parent:push','addBehaviors','2323454VIuMGC','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Apply\x20changes\x20to\x20\x27','\x27\x20with\x20ID:\x20','setJobId','\x20parent\x20segment','Errors:','cyan','👥\x20','segment','site','length','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','population','Error\x20reading\x20file:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Error:\x20Parent\x20segment\x20name\x20is\x20required','trim','toFixed','text','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','columns','Join\x20on:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','in\x20','Parent\x20segment:\x20','listParents','enriched','201153RKjfDm','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','json','varchar','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','attributesFile','/app/dw/parentSegments/','error','pullParentYaml','Coverage:','stop','\x20rows)','double','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','rowCount','customerGroupFile','displayPreviewResults','message','attribute','Customers:','matchedCount','Error\x20parsing\x20YAML:\x20','keys','execute','filter','replace','verbose','addBehaviorsFile','getParentFull','xdg-open','✔\x20Renamed\x20directory\x20to\x20','updateParent','Join:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x20\x20No\x20sample\x20data\x20available','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','errors','Pattern:\x20','repeat','1039455BqUfqJ','Validate:','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','label','behaviors','preview','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Create\x20parent\x20segment\x20\x27','segment:parent:run','Updating'];a29_0x20ad=function(){return _0x1b377a;};return a29_0x20ad();}import a29_0x46e08e 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';function a29_0x193b(_0x44c409,_0x43ebbf){_0x44c409=_0x44c409-0x1b4;const _0x20adc4=a29_0x20ad();let _0x193ba8=_0x20adc4[_0x44c409];return _0x193ba8;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0x4cd30e 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='parent_segment';function openBrowser(_0xcd05af){const _0x18542e=a29_0x193b,_0x209be4=process[_0x18542e(0x1fc)],_0x87378e=_0x209be4===_0x18542e(0x1f9)?_0x18542e(0x1d5):_0x209be4==='win32'?_0x18542e(0x1ed):_0x18542e(0x2bc);spawn(_0x87378e,[_0xcd05af],{'detached':!![],'stdio':_0x18542e(0x242)})['unref']();}function migrateLegacyDirectory(){const _0x1242f7=a29_0x193b;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x48b660=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x48b660[_0x1242f7(0x1c8)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x1242f7(0x2a6)](a29_0x4cd30e[_0x1242f7(0x20a)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x1242f7(0x23e))),console[_0x1242f7(0x2a6)](a29_0x4cd30e['dim'](_0x1242f7(0x25e)+LEGACY_PARENT_SEGMENT_DIR+_0x1242f7(0x247))),![];console[_0x1242f7(0x2a6)](a29_0x4cd30e[_0x1242f7(0x20a)](_0x1242f7(0x270)+LEGACY_PARENT_SEGMENT_DIR+_0x1242f7(0x24a)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x4cd30e[_0x1242f7(0x239)](_0x1242f7(0x2bd)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x22fd34){const _0x543522=_0x22fd34 instanceof Error?_0x22fd34[_0x1242f7(0x2b0)]:String(_0x22fd34);return console['error'](a29_0x4cd30e['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x543522+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x192174(0x267)](_0x1f18a6){const _0x5ffa0d=a29_0x192174;return migrateLegacyDirectory(),super[_0x5ffa0d(0x267)](_0x1f18a6);}}function resolveYamlFile(_0x4ff979){const _0x51f9c8=a29_0x192174;if(_0x4ff979[_0x51f9c8(0x262)](_0x51f9c8(0x1e5))||_0x4ff979[_0x51f9c8(0x262)](_0x51f9c8(0x258)))return _0x4ff979;return a29_0x46e08e[_0x51f9c8(0x22f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4ff979)+_0x51f9c8(0x1e5));}function formatProgressMessage(_0x5302a0){const _0x8299de=a29_0x192174,_0x20aba1=_0x5302a0[_0x8299de(0x1e3)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x20aba1){const [,_0x8388c9,_0x1d34a5,_0x29d37e='']=_0x20aba1;return a29_0x4cd30e[_0x8299de(0x201)](_0x8388c9+':')+'\x20'+_0x1d34a5+a29_0x4cd30e[_0x8299de(0x201)](_0x29d37e);}return a29_0x4cd30e[_0x8299de(0x201)](_0x5302a0);}function showFileNotFoundError(_0x5c6c39,_0x10e0f8){const _0x220ef6=a29_0x192174;console[_0x220ef6(0x2a6)](a29_0x4cd30e[_0x220ef6(0x1ea)](_0x220ef6(0x22b)+_0x5c6c39+'\x0a')),console[_0x220ef6(0x2a6)](a29_0x4cd30e['cyan'](_0x220ef6(0x26a)+_0x10e0f8+_0x220ef6(0x234)));}function showParentSegmentNotSetError(_0x4edbcc){const _0x2a390a=a29_0x192174;console[_0x2a390a(0x2a6)](a29_0x4cd30e[_0x2a390a(0x20a)](_0x2a390a(0x207))),console[_0x2a390a(0x2a6)](_0x4edbcc);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x220);[a29_0x192174(0x24e)]=a29_0x192174(0x225);async[a29_0x192174(0x2b6)](_0x4e56bc){const _0x1a159f=a29_0x192174,{options:_0x12d0a3,args:_0x57819b,tdx:_0x1dad05}=_0x4e56bc,_0x161021=_0x57819b[0x0];_0x12d0a3[_0x1a159f(0x2b9)]&&(console[_0x1a159f(0x2a6)](_0x1a159f(0x27b)+_0x12d0a3[_0x1a159f(0x28b)]),_0x161021&&console[_0x1a159f(0x2a6)](_0x1a159f(0x2c4)+_0x161021));const _0x11c498=await withSpinner(_0x161021?_0x1a159f(0x210)+_0x161021+_0x1a159f(0x1f5):_0x1a159f(0x233),()=>_0x1dad05['segment'][_0x1a159f(0x29c)](),{'verbose':_0x12d0a3[_0x1a159f(0x2b9)]});let _0x209410=_0x11c498['data'];if(_0x161021){const _0x62884a=_0x161021[_0x1a159f(0x2b8)](/[.+^${}()|[\]\\]/g,_0x1a159f(0x216))[_0x1a159f(0x2b8)](/\*/g,'.*')[_0x1a159f(0x2b8)](/\?/g,'.'),_0x42b4b2=new RegExp('^'+_0x62884a+'$','i');_0x209410=_0x209410[_0x1a159f(0x2b7)](_0x20a669=>_0x42b4b2[_0x1a159f(0x26c)](_0x20a669['attributes'][_0x1a159f(0x1e2)]));}_0x209410[_0x1a159f(0x218)]((_0xc09054,_0x347ecd)=>_0xc09054[_0x1a159f(0x209)][_0x1a159f(0x1e2)]['localeCompare'](_0x347ecd[_0x1a159f(0x209)][_0x1a159f(0x1e2)])),console['error']('✔\x20Found\x20'+_0x209410[_0x1a159f(0x28c)]+_0x1a159f(0x286)+(_0x209410[_0x1a159f(0x28c)]!==0x1?'s':''));if(_0x12d0a3[_0x1a159f(0x200)]===_0x1a159f(0x2a0)||_0x12d0a3[_0x1a159f(0x200)]===_0x1a159f(0x275))await handleSDKOutput(_0x209410,_0x12d0a3);else{if(_0x209410[_0x1a159f(0x28c)]===0x0)_0x161021?console['log']('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x161021):console['log'](_0x1a159f(0x259));else for(const _0x2fb2f9 of _0x209410){const _0x55a714=_0x2fb2f9[_0x1a159f(0x209)][_0x1a159f(0x28e)]?a29_0x4cd30e[_0x1a159f(0x201)]('\x20('+formatRows(_0x2fb2f9['attributes']['population'])+')'):'';console[_0x1a159f(0x22c)](_0x1a159f(0x289)+_0x2fb2f9['attributes']['name']+_0x55a714);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']='segment:parent:create';[a29_0x192174(0x24e)]=a29_0x192174(0x23b);async[a29_0x192174(0x2b6)](_0x264ef2){const _0x37d869=a29_0x192174,{options:_0x20fd97,args:_0x3360a6,tdx:_0x518c2e}=_0x264ef2;console[_0x37d869(0x2a6)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+'\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 _0xd2f34f=_0x20fd97;if(_0x3360a6[_0x37d869(0x28c)]===0x0)return console['error'](a29_0x4cd30e['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x37d869(0x2a6)](_0x37d869(0x296)),0x1;const _0x1ca10e=_0x3360a6[0x0];if(!_0xd2f34f['database']||!_0xd2f34f[_0x37d869(0x1fa)])return console['error'](_0x37d869(0x290)),console[_0x37d869(0x2a6)](_0x37d869(0x296)),0x1;_0xd2f34f[_0x37d869(0x2b9)]&&(console[_0x37d869(0x2a6)](_0x37d869(0x27b)+_0xd2f34f[_0x37d869(0x28b)]),console[_0x37d869(0x2a6)](_0x37d869(0x23f)+_0x1ca10e),console[_0x37d869(0x2a6)](_0x37d869(0x21d)+_0xd2f34f['database']),console[_0x37d869(0x2a6)]('Table:\x20'+_0xd2f34f[_0x37d869(0x1fa)]));const _0x455d8d=await loadJSONFromOptions(_0xd2f34f[_0x37d869(0x209)],_0xd2f34f[_0x37d869(0x2a4)]),_0x36c080=await loadJSONFromOptions(_0xd2f34f[_0x37d869(0x2cb)],_0xd2f34f['behaviorsFile']),_0x55fcae=await loadJSONFromOptions(_0xd2f34f[_0x37d869(0x226)],_0xd2f34f[_0x37d869(0x2ae)]),_0xbc87f={'name':_0x1ca10e,'description':_0xd2f34f[_0x37d869(0x24e)],'scheduleType':_0xd2f34f['scheduleType'],'scheduleOption':_0xd2f34f[_0x37d869(0x22e)],'timezone':_0xd2f34f[_0x37d869(0x213)],'master':{'parentDatabaseName':_0xd2f34f[_0x37d869(0x1c1)],'parentTableName':_0xd2f34f['table']},'attributes':_0x455d8d,'behaviors':_0x36c080,'customerGroup':_0x55fcae},_0x4e98dc=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x1ca10e+_0x37d869(0x1f5),()=>_0x518c2e[_0x37d869(0x28a)][_0x37d869(0x261)](_0xbc87f),{'verbose':_0x20fd97[_0x37d869(0x2b9)]}),_0x23acde=_0x4e98dc[_0x37d869(0x1f0)];return console[_0x37d869(0x2a6)](_0x37d869(0x257)+_0x23acde[_0x37d869(0x1e2)]+_0x37d869(0x284)+_0x23acde['id']),await handleSDKOutput([_0x23acde],_0x20fd97),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x192174(0x1e2)]='segment:parent:update';[a29_0x192174(0x24e)]=a29_0x192174(0x291);async[a29_0x192174(0x2b6)](_0x1fbd45){const _0x573eb1=a29_0x192174,{options:_0x2f2c18,args:_0x281f06,tdx:_0x533bcf}=_0x1fbd45;console[_0x573eb1(0x2a6)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x573eb1(0x232));const _0x52812e=_0x2f2c18;if(_0x281f06[_0x573eb1(0x28c)]===0x0)return console[_0x573eb1(0x2a6)](a29_0x4cd30e['red'](_0x573eb1(0x292))),console['error'](_0x573eb1(0x254)),0x1;const _0x23bd34=_0x281f06[0x0];_0x52812e[_0x573eb1(0x2b9)]&&(console[_0x573eb1(0x2a6)](_0x573eb1(0x27b)+_0x52812e[_0x573eb1(0x28b)]),console[_0x573eb1(0x2a6)](_0x573eb1(0x29b)+_0x23bd34));const _0x4d75e8=await withSpinner(_0x573eb1(0x229)+_0x23bd34+'\x27...',()=>_0x533bcf[_0x573eb1(0x28a)][_0x573eb1(0x2bb)](_0x23bd34),{'verbose':_0x52812e[_0x573eb1(0x2b9)]}),_0x532aa3=_0x4d75e8[_0x573eb1(0x1f0)],_0x2f10e0=await loadJSONFromOptions(_0x52812e[_0x573eb1(0x219)],_0x52812e[_0x573eb1(0x268)]),_0x43c7f2=await loadJSONFromOptions(_0x52812e[_0x573eb1(0x280)],_0x52812e[_0x573eb1(0x2ba)]),_0x551a5d={'name':_0x532aa3[_0x573eb1(0x1e2)],'description':_0x52812e[_0x573eb1(0x24e)]!==undefined?_0x52812e[_0x573eb1(0x24e)]:_0x532aa3[_0x573eb1(0x24e)],'scheduleType':_0x52812e[_0x573eb1(0x202)]!==undefined?_0x52812e['scheduleType']:_0x532aa3[_0x573eb1(0x202)],'scheduleOption':_0x52812e[_0x573eb1(0x22e)]!==undefined?_0x52812e[_0x573eb1(0x22e)]:_0x532aa3[_0x573eb1(0x22e)],'timezone':_0x52812e['timezone']!==undefined?_0x52812e[_0x573eb1(0x213)]:_0x532aa3[_0x573eb1(0x213)],'master':_0x532aa3[_0x573eb1(0x246)],'attributes':_0x2f10e0?[..._0x532aa3[_0x573eb1(0x209)]||[],..._0x2f10e0]:_0x532aa3['attributes'],'behaviors':_0x43c7f2?[..._0x532aa3['behaviors']||[],..._0x43c7f2]:_0x532aa3[_0x573eb1(0x2cb)],'customerGroup':_0x532aa3[_0x573eb1(0x226)]},_0x485301=await withSpinner(_0x573eb1(0x248)+_0x23bd34+_0x573eb1(0x1f5),()=>_0x533bcf[_0x573eb1(0x28a)][_0x573eb1(0x2be)](_0x23bd34,_0x551a5d),{'verbose':_0x52812e[_0x573eb1(0x2b9)]}),_0x5e23e5=_0x485301[_0x573eb1(0x1f0)];return console[_0x573eb1(0x2a6)](_0x573eb1(0x211)+_0x5e23e5[_0x573eb1(0x1e2)]+'\x27'),await handleSDKOutput([_0x5e23e5],_0x52812e),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x238);[a29_0x192174(0x24e)]=a29_0x192174(0x1cd);async[a29_0x192174(0x2b6)](_0x5b62b3){const _0x471990=a29_0x192174,{options:_0x24881b,args:_0x972473,tdx:_0x51f1cd}=_0x5b62b3,_0x42881c=_0x24881b,_0x4e5554=_0x972473[0x0]||_0x24881b[_0x471990(0x25b)];if(!_0x4e5554)return showParentSegmentNotSetError(_0x471990(0x1cb)+_0x471990(0x2a2)),0x1;if(_0x42881c['use']&&_0x42881c['output'])return console['error'](a29_0x4cd30e[_0x471990(0x1ea)](_0x471990(0x2d4))),console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x201)](_0x471990(0x1ca))),console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x201)](_0x471990(0x221)+PARENT_SEGMENT_DIR+_0x471990(0x1ec))),console['error'](a29_0x4cd30e[_0x471990(0x288)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x154816=_0x42881c[_0x471990(0x1f3)]||a29_0x46e08e[_0x471990(0x22f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4e5554)+_0x471990(0x1e5));_0x42881c[_0x471990(0x2b9)]&&(console['error'](_0x471990(0x27b)+_0x42881c[_0x471990(0x28b)]),console[_0x471990(0x2a6)]('Parent\x20segment:\x20'+_0x4e5554),console[_0x471990(0x2a6)](_0x471990(0x21c)+_0x154816));const _0x207896=await withSpinner(_0x471990(0x1bf)+_0x4e5554+_0x471990(0x1f5),()=>_0x51f1cd[_0x471990(0x28a)][_0x471990(0x2a7)](_0x4e5554),{'verbose':_0x42881c[_0x471990(0x2b9)]}),_0x2d289b=_0x207896['data'];if(existsSync(_0x154816)){const _0x46dd99=readFileSync(_0x154816,_0x471990(0x256)),_0xa13606=generateDiff(_0x46dd99,_0x2d289b);if(!hasChanges(_0xa13606))console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x239)]('✔')+'\x20No\x20changes\x20-\x20'+a29_0x4cd30e[_0x471990(0x288)](_0x154816)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x471990(0x1ee)+_0x154816+'\x27:'),console[_0x471990(0x2a6)]('─'[_0x471990(0x2c5)](0x3c)),console[_0x471990(0x2a6)](formatDiffWithColors(_0xa13606)),console[_0x471990(0x2a6)]('─'[_0x471990(0x2c5)](0x3c));if(!_0x42881c['yes']){const _0x3b42e4=await confirmKey('Overwrite\x20\x27'+_0x154816+'\x27?');if(!_0x3b42e4)return console[_0x471990(0x2a6)]('Aborted.'),0x1;}writeFileSync(_0x154816,_0x2d289b,_0x471990(0x256)),console[_0x471990(0x2a6)](a29_0x4cd30e['green']('✔')+_0x471990(0x26e)+a29_0x4cd30e[_0x471990(0x288)](_0x154816));}}else{const _0x1f90fb=a29_0x46e08e['dirname'](_0x154816);!existsSync(_0x1f90fb)&&mkdirSync(_0x1f90fb,{'recursive':!![]}),writeFileSync(_0x154816,_0x2d289b,_0x471990(0x256)),console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x239)]('✔')+_0x471990(0x26e)+a29_0x4cd30e[_0x471990(0x288)](_0x154816));}return saveSessionContext({'parent_segment':_0x4e5554},_0x42881c[_0x471990(0x260)]),console[_0x471990(0x2a6)](a29_0x4cd30e[_0x471990(0x239)]('✔')+'\x20Context\x20set:\x20'+a29_0x4cd30e[_0x471990(0x201)](_0x471990(0x1e8))+_0x471990(0x1f1)+a29_0x4cd30e[_0x471990(0x288)](_0x4e5554)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x27f);[a29_0x192174(0x24e)]=a29_0x192174(0x1ff);async[a29_0x192174(0x2b6)](_0x5b61a7){const _0x79d5d8=a29_0x192174,{options:_0x484730,args:_0x142f21,tdx:_0x1fd95}=_0x5b61a7,_0x52282d=_0x484730,_0x258d4b=_0x142f21[0x0]||_0x484730[_0x79d5d8(0x25b)];if(!_0x258d4b)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'+_0x79d5d8(0x2d5)),0x1;const _0x44782d=resolveYamlFile(_0x258d4b);if(!existsSync(_0x44782d))return showFileNotFoundError(_0x44782d,_0x258d4b),0x1;_0x52282d[_0x79d5d8(0x2b9)]&&(console[_0x79d5d8(0x2a6)](_0x79d5d8(0x27b)+_0x52282d['site']),console[_0x79d5d8(0x2a6)](_0x79d5d8(0x1e7)+_0x44782d));let _0x13887f;try{_0x13887f=readFileSync(_0x44782d,'utf-8');}catch(_0x391209){const _0x58086d=_0x391209 instanceof Error?_0x391209[_0x79d5d8(0x2b0)]:String(_0x391209);return console[_0x79d5d8(0x2a6)]('Error\x20reading\x20file:\x20'+_0x58086d),0x1;}const _0x4cf654=await withSpinner(_0x79d5d8(0x1c6),()=>_0x1fd95[_0x79d5d8(0x28a)][_0x79d5d8(0x1f7)](_0x13887f),{'verbose':_0x52282d[_0x79d5d8(0x2b9)]}),_0x9689e6=_0x4cf654[_0x79d5d8(0x1f0)],{isNew:_0x358b2c,name:_0x18d017,hasChanges:_0x4be11a,diffFormatted:_0x1f5d5b}=_0x9689e6;if(!_0x4be11a)return console['error'](_0x79d5d8(0x1ef)+_0x18d017+_0x79d5d8(0x20d)),0x0;_0x358b2c?console[_0x79d5d8(0x2a6)](_0x79d5d8(0x240)+_0x18d017+'\x27:'):console[_0x79d5d8(0x2a6)](_0x79d5d8(0x266)+_0x18d017+'\x27:');console[_0x79d5d8(0x2a6)]('─'[_0x79d5d8(0x2c5)](0x3c)),console[_0x79d5d8(0x2a6)](_0x1f5d5b),console[_0x79d5d8(0x2a6)]('─'['repeat'](0x3c));const _0x3f797a=_0x358b2c?_0x79d5d8(0x2ce)+_0x18d017+'\x27?':_0x79d5d8(0x283)+_0x18d017+'\x27?';if(!_0x52282d[_0x79d5d8(0x1d3)]){const _0x3b185f=await confirmKey(_0x3f797a);if(!_0x3b185f)return console[_0x79d5d8(0x2a6)](_0x79d5d8(0x1e4)),0x1;}const _0x42bafd=_0x358b2c?_0x79d5d8(0x20f):_0x79d5d8(0x2d0),_0x58c31c=await withSpinner(_0x42bafd+_0x79d5d8(0x1cf)+_0x18d017+_0x79d5d8(0x1f5),()=>_0x9689e6[_0x79d5d8(0x241)](),{'verbose':_0x52282d[_0x79d5d8(0x2b9)]}),_0x36f2f1=_0x58c31c[_0x79d5d8(0x1f0)],_0x474117=getConsoleNextUrl(_0x52282d['site'],'/app/dw/parentSegments/'+_0x36f2f1['id']),_0x1b8e78=_0x358b2c?_0x79d5d8(0x1d2):'Updated';return console[_0x79d5d8(0x2a6)]('✔\x20'+_0x1b8e78+_0x79d5d8(0x1cf)+_0x36f2f1[_0x79d5d8(0x1e2)]+'\x27'),console[_0x79d5d8(0x2a6)]('\x20\x20'+_0x474117),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x1de);[a29_0x192174(0x24e)]=a29_0x192174(0x25d);async[a29_0x192174(0x2b6)](_0x39df52){const _0x50adf2=a29_0x192174,{options:_0x316094,args:_0x27222a,tdx:_0x5025ee}=_0x39df52,_0x4107fe=_0x316094,_0xb240b0=_0x27222a[0x0]||_0x316094[_0x50adf2(0x25b)];if(!_0xb240b0)return showParentSegmentNotSetError(_0x50adf2(0x2c2)+_0x50adf2(0x282)+_0x50adf2(0x24c)+_0x50adf2(0x2d3)+_0x50adf2(0x1fe)+_0x50adf2(0x1e1)),0x1;const _0x5428ae=resolveYamlFile(_0xb240b0);if(!existsSync(_0x5428ae))return showFileNotFoundError(_0x5428ae,_0xb240b0),0x1;_0x4107fe[_0x50adf2(0x2b9)]&&(console[_0x50adf2(0x2a6)](_0x50adf2(0x27b)+_0x4107fe[_0x50adf2(0x28b)]),console[_0x50adf2(0x2a6)]('YAML\x20file:\x20'+_0x5428ae));let _0x18ebac;try{_0x18ebac=readFileSync(_0x5428ae,_0x50adf2(0x256));}catch(_0x314c7f){const _0x3e198a=_0x314c7f instanceof Error?_0x314c7f['message']:String(_0x314c7f);return console[_0x50adf2(0x2a6)](_0x50adf2(0x28f)+_0x3e198a),0x1;}const _0x2ce437=createCommandSpinner(a29_0x4cd30e[_0x50adf2(0x201)](_0x50adf2(0x26f)),{'verbose':_0x4107fe[_0x50adf2(0x2b9)]});_0x2ce437[_0x50adf2(0x1ed)]();const _0x288c50={'onProgress':_0xfb62d8=>{const _0xedb851=_0x50adf2;_0x2ce437[_0xedb851(0x295)]=formatProgressMessage(_0xfb62d8);}};if(_0x4107fe[_0x50adf2(0x246)])_0x288c50[_0x50adf2(0x246)]=!![];if(_0x4107fe[_0x50adf2(0x29d)])_0x288c50[_0x50adf2(0x29d)]=!![];_0x4107fe[_0x50adf2(0x2b1)]&&(_0x288c50['attribute']=_0x4107fe['attribute']);_0x4107fe[_0x50adf2(0x1e6)]&&(_0x288c50['behavior']=_0x4107fe[_0x50adf2(0x1e6)]);if(_0x4107fe[_0x50adf2(0x25a)])_0x288c50[_0x50adf2(0x25a)]=_0x4107fe[_0x50adf2(0x25a)];let _0x123e62;try{_0x123e62=await _0x5025ee[_0x50adf2(0x28a)]['validateParentYaml'](_0x18ebac,_0x288c50),_0x2ce437[_0x50adf2(0x2a9)]();}catch(_0x47aee7){_0x2ce437[_0x50adf2(0x2a9)]();throw _0x47aee7;}const _0x92fdec=_0x4107fe[_0x50adf2(0x25a)]||'-1d';return this['displayValidateResults'](_0x123e62,_0x288c50,_0x5428ae,_0x92fdec),_0x123e62['allValid']?0x0:0x1;}[a29_0x192174(0x21b)](_0x4a10eb,_0x11dcca,_0x3e58b2,_0x2e32ec){const _0x423d9e=a29_0x192174;console['error']('\x0a'+a29_0x4cd30e[_0x423d9e(0x20c)](_0x423d9e(0x2c7))+'\x20'+_0x4a10eb[_0x423d9e(0x1e2)]),console[_0x423d9e(0x2a6)]('═'[_0x423d9e(0x2c5)](0x3c)),this[_0x423d9e(0x222)](_0x4a10eb);if(typeof _0x11dcca[_0x423d9e(0x2b1)]==='string'){this['displayAttributesStats'](_0x4a10eb),this[_0x423d9e(0x243)](_0x4a10eb),this[_0x423d9e(0x204)](_0x3e58b2,_0x2e32ec,_0x423d9e(0x2b1),_0x11dcca[_0x423d9e(0x2b1)]);return;}if(_0x11dcca[_0x423d9e(0x2b1)]===!![]){this[_0x423d9e(0x235)](_0x4a10eb),this[_0x423d9e(0x243)](_0x4a10eb),this[_0x423d9e(0x204)](_0x3e58b2,_0x2e32ec,_0x423d9e(0x209));return;}if(typeof _0x11dcca['behavior']===_0x423d9e(0x23c)){this[_0x423d9e(0x212)](_0x4a10eb,_0x2e32ec),this[_0x423d9e(0x243)](_0x4a10eb),this[_0x423d9e(0x204)](_0x3e58b2,_0x2e32ec,_0x423d9e(0x1e6),_0x11dcca[_0x423d9e(0x1e6)]);return;}if(_0x11dcca[_0x423d9e(0x1e6)]===!![]){this[_0x423d9e(0x212)](_0x4a10eb,_0x2e32ec),this[_0x423d9e(0x243)](_0x4a10eb),this['displayPreviewHints'](_0x3e58b2,_0x2e32ec,_0x423d9e(0x2cb));return;}this[_0x423d9e(0x235)](_0x4a10eb),this[_0x423d9e(0x212)](_0x4a10eb,_0x2e32ec),this[_0x423d9e(0x243)](_0x4a10eb),this['displayPreviewHints'](_0x3e58b2,_0x2e32ec,_0x423d9e(0x2d7));}[a29_0x192174(0x204)](_0x2e9287,_0x33e220,_0xe43cdb,_0x296cd2){const _0x44f6a8=a29_0x192174;console[_0x44f6a8(0x2a6)]('\x0a'+a29_0x4cd30e[_0x44f6a8(0x201)](_0x44f6a8(0x224)));const _0x501a75=_0x33e220!=='-1d'?_0x44f6a8(0x206)+_0x33e220:'';if(_0xe43cdb===_0x44f6a8(0x2b1)&&_0x296cd2)console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x44f6a8(0x201)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2e9287+_0x44f6a8(0x1d0)+_0x296cd2+'\x22'+_0x501a75));else{if(_0xe43cdb==='behavior'&&_0x296cd2)console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e['dim'](_0x44f6a8(0x1c9)+_0x2e9287+_0x44f6a8(0x1ba)+_0x296cd2+'\x22'+_0x501a75));else(_0xe43cdb===_0x44f6a8(0x209)||_0xe43cdb===_0x44f6a8(0x2d7))&&console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x44f6a8(0x201)](_0x44f6a8(0x1c9)+_0x2e9287+_0x44f6a8(0x20e)+_0x501a75));}(_0xe43cdb===_0x44f6a8(0x2cb)||_0xe43cdb===_0x44f6a8(0x2d7))&&console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e['dim'](_0x44f6a8(0x1c9)+_0x2e9287+_0x44f6a8(0x1f4)+_0x501a75)),_0xe43cdb===_0x44f6a8(0x2d7)&&console[_0x44f6a8(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x44f6a8(0x201)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2e9287+_0x44f6a8(0x1e9)+_0x501a75));}[a29_0x192174(0x222)](_0x56f01e){const _0x18cc72=a29_0x192174,{master:_0x449c63}=_0x56f01e,_0x27fa28=_0x449c63[_0x18cc72(0x1b7)]?a29_0x4cd30e[_0x18cc72(0x239)]('✔'):a29_0x4cd30e[_0x18cc72(0x1ea)]('✘');console[_0x18cc72(0x2a6)]('\x0a'+a29_0x4cd30e['dim'](_0x18cc72(0x1c7))),console['error'](_0x27fa28+'\x20'+a29_0x4cd30e[_0x18cc72(0x20c)](_0x449c63[_0x18cc72(0x1c1)]+'.'+_0x449c63['table'])),_0x449c63[_0x18cc72(0x1b7)]?_0x449c63[_0x18cc72(0x2ad)]!==undefined&&console[_0x18cc72(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x18cc72(0x201)](_0x18cc72(0x1db))+'\x20'+a29_0x4cd30e[_0x18cc72(0x288)](formatRows(_0x449c63['rowCount']))):console[_0x18cc72(0x2a6)]('\x20\x20'+a29_0x4cd30e['red'](_0x18cc72(0x21a))+'\x20'+_0x449c63['schemaError']);}[a29_0x192174(0x235)](_0x249ca8){const _0x1dad13=a29_0x192174;if(_0x249ca8[_0x1dad13(0x209)][_0x1dad13(0x28c)]===0x0)return;console['error']('\x0a'+a29_0x4cd30e[_0x1dad13(0x201)]('Attributes'));for(const _0x97efc0 of _0x249ca8[_0x1dad13(0x209)]){const _0x17867b=_0x97efc0[_0x1dad13(0x1b7)]?a29_0x4cd30e[_0x1dad13(0x239)]('✔'):a29_0x4cd30e['red']('✘');let _0x3328dd='';if(_0x97efc0[_0x1dad13(0x1b7)]&&_0x97efc0[_0x1dad13(0x2b3)]!==undefined&&_0x97efc0[_0x1dad13(0x244)]!==undefined){const _0x5f41c4=_0x97efc0[_0x1dad13(0x244)]['toFixed'](0x1),_0xc9d6f=_0x97efc0[_0x1dad13(0x244)]>=0x50?a29_0x4cd30e[_0x1dad13(0x239)]:_0x97efc0['coveragePercent']>=0x32?a29_0x4cd30e[_0x1dad13(0x20a)]:a29_0x4cd30e[_0x1dad13(0x1ea)];_0x3328dd='\x20'+a29_0x4cd30e[_0x1dad13(0x201)](_0x1dad13(0x2a8))+'\x20'+_0xc9d6f(_0x5f41c4+'%')+'\x20('+formatRows(_0x97efc0[_0x1dad13(0x2b3)])+_0x1dad13(0x2aa);}console[_0x1dad13(0x2a6)](_0x17867b+'\x20'+a29_0x4cd30e[_0x1dad13(0x20c)](_0x97efc0[_0x1dad13(0x1e2)])+_0x3328dd),console['error']('\x20\x20'+a29_0x4cd30e['dim']('Source:')+'\x20'+a29_0x4cd30e[_0x1dad13(0x20c)](_0x97efc0[_0x1dad13(0x1c1)]+'.'+_0x97efc0[_0x1dad13(0x1fa)]));const _0x187480=_0x97efc0[_0x1dad13(0x1df)]===_0x97efc0['foreignKey']?a29_0x4cd30e['dim'](_0x1dad13(0x298))+'\x20'+_0x97efc0[_0x1dad13(0x1df)]:a29_0x4cd30e[_0x1dad13(0x201)]('Join:')+'\x20'+_0x97efc0['joinKey']+_0x1dad13(0x1f1)+_0x97efc0[_0x1dad13(0x203)];console['error']('\x20\x20'+_0x187480),console[_0x1dad13(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x1dad13(0x201)](_0x1dad13(0x20b))),this[_0x1dad13(0x2d6)](_0x97efc0['columns']),!_0x97efc0[_0x1dad13(0x1b7)]&&console[_0x1dad13(0x2a6)]('\x20\x20'+a29_0x4cd30e['red'](_0x1dad13(0x21a))+'\x20'+_0x97efc0['schemaError']);}}[a29_0x192174(0x212)](_0x196f15,_0x26a7b0){const _0x5c3dc6=a29_0x192174;if(_0x196f15[_0x5c3dc6(0x2cb)][_0x5c3dc6(0x28c)]===0x0)return;console[_0x5c3dc6(0x2a6)]('\x0a'+a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x253))+'\x20'+a29_0x4cd30e[_0x5c3dc6(0x201)]('('+_0x26a7b0+')'));for(const _0x2af336 of _0x196f15[_0x5c3dc6(0x2cb)]){const _0xc334ef=_0x2af336[_0x5c3dc6(0x1b7)]?a29_0x4cd30e[_0x5c3dc6(0x239)]('✔'):a29_0x4cd30e['red']('✘');let _0x3eb9cc='';if(_0x2af336[_0x5c3dc6(0x1b7)]&&_0x2af336['customersWithEvents']!==undefined&&_0x2af336[_0x5c3dc6(0x22d)]!==undefined){const _0x3222c2=_0x2af336['customerPercent']?.[_0x5c3dc6(0x294)](0x1)||'?',_0x5acfce=(_0x2af336[_0x5c3dc6(0x1bc)]??0x0)>=0x32?a29_0x4cd30e['green']:(_0x2af336[_0x5c3dc6(0x1bc)]??0x0)>=0x14?a29_0x4cd30e[_0x5c3dc6(0x20a)]:a29_0x4cd30e['red'];_0x3eb9cc='\x20'+a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x2b2))+'\x20'+_0x5acfce(formatRows(_0x2af336[_0x5c3dc6(0x1d8)]))+'\x20('+_0x3222c2+'%)\x20'+a29_0x4cd30e[_0x5c3dc6(0x201)]('Events:')+'\x20'+a29_0x4cd30e[_0x5c3dc6(0x288)](formatRows(_0x2af336[_0x5c3dc6(0x22d)]));}console['error'](_0xc334ef+'\x20'+a29_0x4cd30e[_0x5c3dc6(0x20c)](_0x2af336['name'])+_0x3eb9cc),console[_0x5c3dc6(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x1fb))+'\x20'+a29_0x4cd30e[_0x5c3dc6(0x20c)](_0x2af336[_0x5c3dc6(0x1c1)]+'.'+_0x2af336[_0x5c3dc6(0x1fa)]));const _0x4c2015=_0x2af336[_0x5c3dc6(0x1df)]===_0x2af336[_0x5c3dc6(0x203)]?a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x298))+'\x20'+_0x2af336[_0x5c3dc6(0x1df)]:a29_0x4cd30e[_0x5c3dc6(0x201)](_0x5c3dc6(0x2bf))+'\x20'+_0x2af336[_0x5c3dc6(0x1df)]+_0x5c3dc6(0x1f1)+_0x2af336[_0x5c3dc6(0x203)];console['error']('\x20\x20'+_0x4c2015),console[_0x5c3dc6(0x2a6)]('\x20\x20'+a29_0x4cd30e['dim'](_0x5c3dc6(0x20b))),this[_0x5c3dc6(0x2d6)](_0x2af336[_0x5c3dc6(0x297)]),!_0x2af336['schemaValid']&&console[_0x5c3dc6(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x5c3dc6(0x1ea)](_0x5c3dc6(0x21a))+'\x20'+_0x2af336[_0x5c3dc6(0x251)]);}}[a29_0x192174(0x2d6)](_0x4c00a3){const _0x3c0cf3=a29_0x192174;for(const _0x163add of _0x4c00a3){_0x163add[_0x3c0cf3(0x2ca)]===_0x163add[_0x3c0cf3(0x269)]||_0x163add[_0x3c0cf3(0x269)]==='*'?console['error'](_0x3c0cf3(0x276)+_0x163add[_0x3c0cf3(0x2ca)]):console[_0x3c0cf3(0x2a6)](_0x3c0cf3(0x276)+_0x163add[_0x3c0cf3(0x2ca)]+'\x20'+a29_0x4cd30e[_0x3c0cf3(0x201)]('('+_0x163add[_0x3c0cf3(0x269)]+')'));}}[a29_0x192174(0x243)](_0x3f8732){const _0x95da38=a29_0x192174;console[_0x95da38(0x2a6)]('─'[_0x95da38(0x2c5)](0x3c));if(_0x3f8732[_0x95da38(0x2c3)][_0x95da38(0x28c)]>0x0){console[_0x95da38(0x2a6)]('\x0a'+a29_0x4cd30e[_0x95da38(0x1ea)]('Errors:'));for(const _0x193845 of _0x3f8732[_0x95da38(0x2c3)]){console[_0x95da38(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x95da38(0x1ea)]('•')+'\x20'+_0x193845);}}_0x3f8732[_0x95da38(0x1b8)]&&console[_0x95da38(0x2a6)]('\x0a'+a29_0x4cd30e[_0x95da38(0x239)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]='segment:parent:preview';['description']=a29_0x192174(0x227);async['execute'](_0x4e19af){const _0x2709dc=a29_0x192174,{options:_0x4c33d3,args:_0x3d688e,tdx:_0x30f06e}=_0x4e19af,_0x550a40=_0x4c33d3,_0x266893=_0x3d688e[0x0]||_0x4c33d3[_0x2709dc(0x25b)];if(!_0x266893)return showParentSegmentNotSetError(_0x2709dc(0x214)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x2709dc(0x231)+_0x2709dc(0x1bd)+_0x2709dc(0x223)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x2709dc(0x1e1)),0x1;if(!_0x550a40[_0x2709dc(0x246)]&&!_0x550a40[_0x2709dc(0x2b1)]&&!_0x550a40[_0x2709dc(0x1e6)]&&!_0x550a40[_0x2709dc(0x29d)])return console['error'](a29_0x4cd30e[_0x2709dc(0x1ea)](_0x2709dc(0x23a))),console[_0x2709dc(0x2a6)](_0x2709dc(0x1b5)),console[_0x2709dc(0x2a6)]('Options:'),console[_0x2709dc(0x2a6)](_0x2709dc(0x2d8)),console[_0x2709dc(0x2a6)](_0x2709dc(0x299)),console[_0x2709dc(0x2a6)](_0x2709dc(0x28d)),console['error'](_0x2709dc(0x1b9)),0x1;const _0x2b1167=resolveYamlFile(_0x266893);if(!existsSync(_0x2b1167))return showFileNotFoundError(_0x2b1167,_0x266893),0x1;_0x550a40['verbose']&&(console['error'](_0x2709dc(0x27b)+_0x550a40[_0x2709dc(0x28b)]),console[_0x2709dc(0x2a6)]('YAML\x20file:\x20'+_0x2b1167));let _0x3c9d0d;try{_0x3c9d0d=readFileSync(_0x2b1167,_0x2709dc(0x256));}catch(_0x5905ea){const _0x4b8fe6=_0x5905ea instanceof Error?_0x5905ea[_0x2709dc(0x2b0)]:String(_0x5905ea);return console[_0x2709dc(0x2a6)](_0x2709dc(0x28f)+_0x4b8fe6),0x1;}let _0x533c13;try{_0x533c13=parseYamlString(_0x3c9d0d);}catch(_0x15e719){const _0x2ae555=_0x15e719 instanceof Error?_0x15e719['message']:String(_0x15e719);return console[_0x2709dc(0x2a6)](a29_0x4cd30e[_0x2709dc(0x1ea)](_0x2709dc(0x2b4)+_0x2ae555)),0x1;}if(_0x550a40[_0x2709dc(0x2b1)]===!![]||_0x550a40['attribute']===''){const _0x392e6c=_0x533c13[_0x2709dc(0x209)]?.[_0x2709dc(0x1d9)](_0x55bd3d=>_0x55bd3d[_0x2709dc(0x1e2)])||[];if(_0x392e6c['length']===0x0)console[_0x2709dc(0x2a6)](a29_0x4cd30e[_0x2709dc(0x1ea)](_0x2709dc(0x1bb)));else{console[_0x2709dc(0x2a6)](a29_0x4cd30e[_0x2709dc(0x1ea)](_0x2709dc(0x2c0))),console[_0x2709dc(0x2a6)]('Available\x20attributes:');for(const _0x22c28e of _0x392e6c){console[_0x2709dc(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x2709dc(0x288)](_0x22c28e));}console[_0x2709dc(0x2a6)](_0x2709dc(0x1c2)+_0x266893+_0x2709dc(0x1d0)+_0x392e6c[0x0]+'\x22');}return 0x1;}if(_0x550a40[_0x2709dc(0x1e6)]===!![]||_0x550a40['behavior']===''){const _0x646e0b=_0x533c13[_0x2709dc(0x2cb)]?.[_0x2709dc(0x1d9)](_0x406255=>_0x406255[_0x2709dc(0x1e2)])||[];if(_0x646e0b[_0x2709dc(0x28c)]===0x0)console[_0x2709dc(0x2a6)](a29_0x4cd30e[_0x2709dc(0x1ea)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console['error'](a29_0x4cd30e['red'](_0x2709dc(0x2c9))),console[_0x2709dc(0x2a6)](_0x2709dc(0x26b));for(const _0x2620c3 of _0x646e0b){console[_0x2709dc(0x2a6)]('\x20\x20'+a29_0x4cd30e['cyan'](_0x2620c3));}console[_0x2709dc(0x2a6)](_0x2709dc(0x1c2)+_0x266893+_0x2709dc(0x1ba)+_0x646e0b[0x0]+'\x22');}return 0x1;}const _0x27ee08=createCommandSpinner(a29_0x4cd30e['dim']('Fetching\x20sample\x20data...'),{'verbose':_0x550a40['verbose']});_0x27ee08[_0x2709dc(0x1ed)]();const _0x2c2318={'onProgress':_0x1aeee5=>{_0x27ee08['text']=formatProgressMessage(_0x1aeee5);}};if(_0x550a40[_0x2709dc(0x246)])_0x2c2318['master']=!![];if(_0x550a40['attribute']&&typeof _0x550a40[_0x2709dc(0x2b1)]===_0x2709dc(0x23c))_0x2c2318[_0x2709dc(0x2b1)]=_0x550a40[_0x2709dc(0x2b1)];if(_0x550a40['behavior']&&typeof _0x550a40[_0x2709dc(0x1e6)]===_0x2709dc(0x23c))_0x2c2318['behavior']=_0x550a40['behavior'];if(_0x550a40[_0x2709dc(0x29d)])_0x2c2318[_0x2709dc(0x29d)]=!![];if(_0x550a40['interval'])_0x2c2318[_0x2709dc(0x25a)]=_0x550a40['interval'];let _0x400a24;try{_0x400a24=await _0x30f06e[_0x2709dc(0x28a)][_0x2709dc(0x277)](_0x3c9d0d,_0x2c2318),_0x27ee08[_0x2709dc(0x2a9)]();}catch(_0x288e58){_0x27ee08['stop']();throw _0x288e58;}return await this['displayPreviewResults'](_0x400a24,{'master':_0x550a40[_0x2709dc(0x246)],'attribute':typeof _0x550a40[_0x2709dc(0x2b1)]===_0x2709dc(0x23c)?_0x550a40[_0x2709dc(0x2b1)]:undefined,'behavior':typeof _0x550a40[_0x2709dc(0x1e6)]===_0x2709dc(0x23c)?_0x550a40[_0x2709dc(0x1e6)]:undefined,'enriched':_0x550a40[_0x2709dc(0x29d)]}),_0x400a24['allValid']?0x0:0x1;}async[a29_0x192174(0x2af)](_0x17b0da,_0xbfc97b){const _0x4c9ca6=a29_0x192174;console['error']('\x0a'+a29_0x4cd30e[_0x4c9ca6(0x20c)](_0x4c9ca6(0x252))+'\x20'+_0x17b0da[_0x4c9ca6(0x1e2)]),console[_0x4c9ca6(0x2a6)]('═'['repeat'](0x3c));if(_0xbfc97b['master']&&_0x17b0da[_0x4c9ca6(0x1d6)]){const _0x43ed2f=a29_0x4cd30e[_0x4c9ca6(0x201)](_0x4c9ca6(0x24b))+'\x20'+a29_0x4cd30e['bold'](_0x17b0da['master'][_0x4c9ca6(0x1c1)]+'.'+_0x17b0da[_0x4c9ca6(0x246)][_0x4c9ca6(0x1fa)]);await this[_0x4c9ca6(0x2d1)](_0x43ed2f,_0x17b0da['sampleData']);}else{if(_0xbfc97b[_0x4c9ca6(0x2b1)]&&_0x17b0da[_0x4c9ca6(0x1d6)]){const _0xd660a1=a29_0x4cd30e[_0x4c9ca6(0x201)](_0x4c9ca6(0x1f2))+'\x20'+a29_0x4cd30e[_0x4c9ca6(0x20c)](_0xbfc97b['attribute']);await this['displaySampleData'](_0xd660a1,_0x17b0da[_0x4c9ca6(0x1d6)]);}else{if(_0xbfc97b[_0x4c9ca6(0x1e6)]&&_0x17b0da[_0x4c9ca6(0x1d6)]){const _0x13b003=a29_0x4cd30e[_0x4c9ca6(0x201)](_0x4c9ca6(0x255))+'\x20'+a29_0x4cd30e[_0x4c9ca6(0x20c)](_0xbfc97b[_0x4c9ca6(0x1e6)]);await this[_0x4c9ca6(0x2d1)](_0x13b003,_0x17b0da[_0x4c9ca6(0x1d6)]);}else{if(_0xbfc97b['enriched']&&_0x17b0da[_0x4c9ca6(0x1d6)]){const _0x1aa849=a29_0x4cd30e['dim']('Enriched:')+'\x20'+a29_0x4cd30e[_0x4c9ca6(0x20c)](_0x4c9ca6(0x249));await this['displaySampleData'](_0x1aa849,_0x17b0da[_0x4c9ca6(0x1d6)]);}else!_0x17b0da['sampleData']&&console[_0x4c9ca6(0x2a6)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x17b0da[_0x4c9ca6(0x2c3)][_0x4c9ca6(0x28c)]>0x0){console[_0x4c9ca6(0x2a6)]('─'['repeat'](0x3c)),console[_0x4c9ca6(0x2a6)]('\x0a'+a29_0x4cd30e[_0x4c9ca6(0x1ea)](_0x4c9ca6(0x287)));for(const _0x30f4ba of _0x17b0da[_0x4c9ca6(0x2c3)]){console[_0x4c9ca6(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x4c9ca6(0x1ea)]('•')+'\x20'+_0x30f4ba);}}}async[a29_0x192174(0x2d1)](_0x307152,_0x5f23e1){const _0x329fea=a29_0x192174;if(_0x5f23e1[_0x329fea(0x28c)]===0x0){console[_0x329fea(0x2a6)]('\x0a'+_0x307152),console[_0x329fea(0x2a6)](_0x329fea(0x2c1));return;}console['error']('\x0a'+_0x307152);const _0x2c80fb=Object[_0x329fea(0x2b5)](_0x5f23e1[0x0])['map'](_0x56c67c=>({'name':_0x56c67c,'type':typeof _0x5f23e1[0x0][_0x56c67c]===_0x329fea(0x1c3)?_0x329fea(0x2ab):_0x329fea(0x2a1)})),_0x1bf3a7={'queryId':_0x329fea(0x2cc),'columns':_0x2c80fb,'data':_0x5f23e1,'stats':{'state':_0x329fea(0x23d),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5f23e1[_0x329fea(0x28c)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x58d84a=formatAsTable(_0x1bf3a7,_0x5f23e1[_0x329fea(0x28c)],!![]);await writeOutput(_0x58d84a,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x2cf);[a29_0x192174(0x24e)]=a29_0x192174(0x29f);async['execute'](_0x2ab6fb){const _0x3cd705=a29_0x192174,{options:_0x36df98,args:_0x1fde6e,tdx:_0x1d4a41}=_0x2ab6fb,_0x1c58a5=_0x36df98,_0xaf3cc=_0x1fde6e[0x0]||_0x36df98[_0x3cd705(0x25b)];if(!_0xaf3cc)return showParentSegmentNotSetError(_0x3cd705(0x27d)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x2f8c7b=resolveYamlFile(_0xaf3cc);if(existsSync(_0x2f8c7b)){_0x1c58a5[_0x3cd705(0x2b9)]&&console[_0x3cd705(0x2a6)](_0x3cd705(0x278)+_0x2f8c7b);let _0x3b6644;try{_0x3b6644=readFileSync(_0x2f8c7b,_0x3cd705(0x256));}catch(_0x596ef8){const _0x5347f6=_0x596ef8 instanceof Error?_0x596ef8[_0x3cd705(0x2b0)]:String(_0x596ef8);return console[_0x3cd705(0x2a6)](_0x3cd705(0x28f)+_0x5347f6),0x1;}const _0x2ce902=await withSpinner(_0x3cd705(0x1c6),()=>_0x1d4a41['segment']['pushParentYaml'](_0x3b6644),{'verbose':_0x1c58a5[_0x3cd705(0x2b9)]}),_0x34247d=_0x2ce902[_0x3cd705(0x1f0)],{isNew:_0x3c3035,name:_0x29207b,hasChanges:_0x47534d,diffFormatted:_0x152cd9}=_0x34247d;if(_0x47534d){_0x3c3035?console['error'](_0x3cd705(0x240)+_0x29207b+'\x27:'):console[_0x3cd705(0x2a6)](_0x3cd705(0x266)+_0x29207b+'\x27:');console[_0x3cd705(0x2a6)]('─'[_0x3cd705(0x2c5)](0x3c)),console[_0x3cd705(0x2a6)](_0x152cd9),console[_0x3cd705(0x2a6)]('─'['repeat'](0x3c));const _0x27568d=_0x3c3035?_0x3cd705(0x2ce)+_0x29207b+_0x3cd705(0x250):_0x3cd705(0x283)+_0x29207b+'\x27\x20and\x20run\x20workflow?';if(!_0x1c58a5[_0x3cd705(0x1d3)]){const _0x2c743=await confirmKey(_0x27568d);if(!_0x2c743)return console[_0x3cd705(0x2a6)](_0x3cd705(0x1e4)),0x1;}const _0x4fdd32=_0x3c3035?_0x3cd705(0x20f):_0x3cd705(0x2d0);await withSpinner(_0x4fdd32+_0x3cd705(0x1cf)+_0x29207b+_0x3cd705(0x1f5),()=>_0x34247d[_0x3cd705(0x241)](),{'verbose':_0x1c58a5[_0x3cd705(0x2b9)]});const _0x4f9356=_0x3c3035?'Created':'Updated';console[_0x3cd705(0x2a6)]('✔\x20'+_0x4f9356+_0x3cd705(0x1cf)+_0x29207b+'\x27');}else console[_0x3cd705(0x2a6)](_0x3cd705(0x1ef)+_0x29207b+_0x3cd705(0x1da));}const _0x482e71=await withSpinner(_0x3cd705(0x1c0)+_0xaf3cc+_0x3cd705(0x1f5),()=>_0x1d4a41[_0x3cd705(0x28a)][_0x3cd705(0x24f)](_0xaf3cc),{'verbose':_0x1c58a5[_0x3cd705(0x2b9)]}),_0x2c8065=_0x482e71['data'],_0x3d9e2d=getConsoleUrl(_0x1c58a5[_0x3cd705(0x28b)],_0x3cd705(0x27a)+_0x2c8065[_0x3cd705(0x26d)]+_0x3cd705(0x271)+_0x2c8065[_0x3cd705(0x273)]+_0x3cd705(0x27e)+_0x2c8065['workflowAttemptId']);return console[_0x3cd705(0x2a6)](_0x3cd705(0x27c)),console['error']('\x20\x20'+a29_0x4cd30e[_0x3cd705(0x201)]('Audience\x20ID:')+'\x20'+_0x2c8065['audienceId']),console[_0x3cd705(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x3cd705(0x201)](_0x3cd705(0x1f8))+'\x20'+_0x2c8065['status']),console[_0x3cd705(0x2a6)]('\x20\x20'+a29_0x4cd30e[_0x3cd705(0x201)](_0x3cd705(0x1c5))+'\x20'+_0x2c8065[_0x3cd705(0x273)]),console['error']('\x20\x20'+a29_0x4cd30e[_0x3cd705(0x201)]('Attempt:')+'\x20'+_0x2c8065['workflowAttemptId']),console['error']('\x20\x20'+_0x3d9e2d),console['error']('\x0a'+a29_0x4cd30e[_0x3cd705(0x201)]('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x2c8065[_0x3cd705(0x228)]+_0x3cd705(0x265)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x21f);['description']=a29_0x192174(0x1d7);async[a29_0x192174(0x2b6)](_0x439040){const _0x4f8ecd=a29_0x192174,{options:_0x52da37,args:_0x44754c,tdx:_0x16f2ab}=_0x439040,_0x45f9e3=_0x44754c[0x0]||_0x52da37[_0x4f8ecd(0x25b)];if(!_0x45f9e3)return showParentSegmentNotSetError(_0x4f8ecd(0x245)+_0x4f8ecd(0x2ac)),0x1;_0x52da37[_0x4f8ecd(0x2b9)]&&(console[_0x4f8ecd(0x2a6)](_0x4f8ecd(0x27b)+_0x52da37['site']),console[_0x4f8ecd(0x2a6)](_0x4f8ecd(0x29b)+_0x45f9e3));const _0x4ecf98=await withSpinner(_0x4f8ecd(0x1e0)+_0x45f9e3+_0x4f8ecd(0x1f5),()=>_0x16f2ab[_0x4f8ecd(0x28a)][_0x4f8ecd(0x208)](_0x45f9e3),{'verbose':_0x52da37[_0x4f8ecd(0x2b9)]}),_0x2775ed=_0x4ecf98[_0x4f8ecd(0x1f0)];console['error'](_0x4f8ecd(0x230)+_0x2775ed[_0x4f8ecd(0x28c)]+_0x4f8ecd(0x1ce)+(_0x2775ed[_0x4f8ecd(0x28c)]!==0x1?'s':''));if(_0x52da37[_0x4f8ecd(0x2a0)]||_0x52da37[_0x4f8ecd(0x275)])return await handleSDKOutput(_0x2775ed,_0x52da37),0x0;return displayFieldsHumanReadable(_0x2775ed,_0x45f9e3),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x192174(0x1e2)]='segment:parent:view';['description']='Show\x20parent\x20segment\x20details';async[a29_0x192174(0x2b6)](_0x1d4f1d){const _0x36b53f=a29_0x192174,{options:_0x39068e,args:_0x57d93d,tdx:_0xaf877e}=_0x1d4f1d,_0x445a00=_0x39068e,_0x4d006d=_0x57d93d[0x0]||_0x39068e['parentSegment'];if(!_0x4d006d)return showParentSegmentNotSetError(_0x36b53f(0x1b6)+_0x36b53f(0x274)+_0x36b53f(0x24c)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x39068e['verbose']&&(console[_0x36b53f(0x2a6)](_0x36b53f(0x27b)+_0x39068e['site']),console[_0x36b53f(0x2a6)]('Parent\x20segment:\x20'+_0x4d006d));const _0x5e87b2=await withSpinner(_0x36b53f(0x1bf)+_0x4d006d+'\x27...',()=>_0xaf877e[_0x36b53f(0x28a)][_0x36b53f(0x2bb)](_0x4d006d),{'verbose':_0x39068e[_0x36b53f(0x2b9)]}),_0xd64bc7=_0x5e87b2[_0x36b53f(0x1f0)];if(_0x445a00['web']){const _0x12f04f=getConsoleNextUrl(_0x445a00[_0x36b53f(0x28b)],_0x36b53f(0x2a5)+_0xd64bc7['id']);return console[_0x36b53f(0x2a6)](a29_0x4cd30e[_0x36b53f(0x239)]('✔')+'\x20Opening\x20'+a29_0x4cd30e[_0x36b53f(0x288)](_0x12f04f)),openBrowser(_0x12f04f),0x0;}return await handleSingleObjectOutput(_0xd64bc7,_0x39068e),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x25c);['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a29_0x192174(0x2b6)](_0x5db736){const _0xefd6d=a29_0x192174,{options:_0x439712,args:_0x4175af,tdx:_0x4d884c}=_0x5db736,_0x291ea5=_0x4175af[0x0]||_0x439712[_0xefd6d(0x25b)];if(!_0x291ea5)return showParentSegmentNotSetError(_0xefd6d(0x2c8)+_0xefd6d(0x264)),0x1;_0x439712[_0xefd6d(0x2b9)]&&(console[_0xefd6d(0x2a6)](_0xefd6d(0x27b)+_0x439712[_0xefd6d(0x28b)]),console[_0xefd6d(0x2a6)]('Parent\x20segment:\x20'+_0x291ea5));const _0x1039b9=await withSpinner(_0xefd6d(0x1d4)+_0x291ea5+_0xefd6d(0x1f5),()=>_0x4d884c[_0xefd6d(0x28a)]['resolveParentId'](_0x291ea5),{'verbose':_0x439712['verbose']}),_0x4f8e0c=_0x1039b9[_0xefd6d(0x1f0)],_0x5b31a2=await withSpinner(_0xefd6d(0x272)+_0x291ea5+_0xefd6d(0x1f5),()=>_0x4d884c['segment']['getParentSQL'](_0x4f8e0c),{'verbose':_0x439712[_0xefd6d(0x2b9)]}),_0x3749ea=await executeSchemaQuery(_0x5b31a2[_0xefd6d(0x1f0)],_0x4d884c,_0x439712);return await handleQueryOutput(_0x3749ea,_0x439712),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x192174(0x1e2)]='segment:parent:sql';[a29_0x192174(0x24e)]=a29_0x192174(0x205);async[a29_0x192174(0x2b6)](_0x65818a){const _0x2f9c8b=a29_0x192174,{options:_0x33216c,args:_0x78ae3,tdx:_0x72c597}=_0x65818a,_0x2f4e0d=_0x78ae3[0x0]||_0x33216c[_0x2f9c8b(0x25b)];if(!_0x2f4e0d)return showParentSegmentNotSetError(_0x2f9c8b(0x217)+_0x2f9c8b(0x237)),0x1;_0x33216c['verbose']&&(console[_0x2f9c8b(0x2a6)]('Site:\x20'+_0x33216c[_0x2f9c8b(0x28b)]),console[_0x2f9c8b(0x2a6)]('Parent\x20segment:\x20'+_0x2f4e0d));const _0x413f34=await withSpinner(_0x2f9c8b(0x1d4)+_0x2f4e0d+_0x2f9c8b(0x1f5),()=>_0x72c597[_0x2f9c8b(0x28a)][_0x2f9c8b(0x1b4)](_0x2f4e0d),{'verbose':_0x33216c['verbose']}),_0x11dca1=_0x413f34[_0x2f9c8b(0x1f0)],_0x7c118c=await withSpinner(_0x2f9c8b(0x272)+_0x2f4e0d+_0x2f9c8b(0x1f5),()=>_0x72c597[_0x2f9c8b(0x28a)][_0x2f9c8b(0x1d1)](_0x11dca1),{'verbose':_0x33216c[_0x2f9c8b(0x2b9)]}),_0x1d49b7=_0x7c118c[_0x2f9c8b(0x1f0)];return _0x33216c[_0x2f9c8b(0x200)]===_0x2f9c8b(0x2a0)||_0x33216c[_0x2f9c8b(0x200)]===_0x2f9c8b(0x275)?await handleSDKOutput([{'sql':_0x1d49b7}],_0x33216c):console[_0x2f9c8b(0x22c)](_0x1d49b7),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x192174(0x1e2)]=a29_0x192174(0x22a);[a29_0x192174(0x24e)]=a29_0x192174(0x2cd);async['execute'](_0x373da3){const _0xea21d3=a29_0x192174,{options:_0x110ae5,args:_0x39c004,tdx:_0xf90b32}=_0x373da3,_0x2969aa=_0x39c004[0x0]||_0x110ae5['parentSegment'];if(!_0x2969aa)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0xea21d3(0x2a3)),0x1;_0x110ae5[_0xea21d3(0x2b9)]&&(console[_0xea21d3(0x2a6)](_0xea21d3(0x27b)+_0x110ae5[_0xea21d3(0x28b)]),console[_0xea21d3(0x2a6)](_0xea21d3(0x29b)+_0x2969aa));const _0x56e72c=await withSpinner(_0xea21d3(0x1d4)+_0x2969aa+_0xea21d3(0x1f5),()=>_0xf90b32[_0xea21d3(0x28a)][_0xea21d3(0x1b4)](_0x2969aa),{'verbose':_0x110ae5['verbose']}),_0x5eb46c=_0x56e72c[_0xea21d3(0x1f0)],_0x413898=await withSpinner(_0xea21d3(0x272)+_0x2969aa+_0xea21d3(0x1f5),()=>_0xf90b32['segment'][_0xea21d3(0x1d1)](_0x5eb46c),{'verbose':_0x110ae5[_0xea21d3(0x2b9)]});let _0x3fea7d=_0x413898[_0xea21d3(0x1f0)];const _0x69f07a=resolveLimit(_0x110ae5['limit'],DEFAULT_DISPLAY_LIMIT),_0x16fdfd=/\bLIMIT\s+\d+/i[_0xea21d3(0x26c)](_0x3fea7d);!_0x16fdfd&&(_0x3fea7d=_0x3fea7d[_0xea21d3(0x293)]()[_0xea21d3(0x2b8)](/;+$/,''),_0x3fea7d=_0xea21d3(0x236)+_0x3fea7d+_0xea21d3(0x24d)+_0x69f07a);_0x110ae5['verbose']&&console[_0xea21d3(0x2a6)](_0xea21d3(0x279)+_0x3fea7d);const _0x2af38b=await withQuerySpinner(_0xea21d3(0x263),async _0x3aadd4=>{const _0x56ca7e=_0xea21d3,_0x22a8c4=await _0xf90b32[_0x56ca7e(0x1c4)][_0x56ca7e(0x2b6)](_0x3fea7d,{'catalog':'td','schema':'information_schema','onJobId':_0x442c55=>{const _0x2fb30c=_0x56ca7e;_0x3aadd4[_0x2fb30c(0x285)](_0x442c55);}});return _0x22a8c4;},{'verbose':_0x110ae5['verbose']}),_0x2ca5a9=_0x2af38b['data'],_0x489c48=_0x2ca5a9[_0xea21d3(0x1fd)]?_0xea21d3(0x21e)+_0x2ca5a9['jobId']+']':'';return console['error'](_0xea21d3(0x1f6)+_0x2ca5a9['stats']['processedRows'][_0xea21d3(0x1dc)]()+'\x20rows\x20'+(_0xea21d3(0x29a)+formatElapsed(_0x2ca5a9[_0xea21d3(0x2d2)][_0xea21d3(0x1eb)])+_0x489c48)),await handleQueryOutput(_0x2ca5a9,_0x110ae5),0x0;}}
|
|
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 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x39e785=a30_0x4dde;(function(_0x550f8f,_0x518052){const _0x40e7b7=a30_0x4dde,_0x5aed69=_0x550f8f();while(!![]){try{const _0x4fc7cb=-parseInt(_0x40e7b7(0xdb))/0x1+parseInt(_0x40e7b7(0xd1))/0x2+-parseInt(_0x40e7b7(0xd4))/0x3+parseInt(_0x40e7b7(0xd6))/0x4+parseInt(_0x40e7b7(0xd7))/0x5*(-parseInt(_0x40e7b7(0xda))/0x6)+-parseInt(_0x40e7b7(0xd8))/0x7+parseInt(_0x40e7b7(0xd3))/0x8*(parseInt(_0x40e7b7(0xcf))/0x9);if(_0x4fc7cb===_0x518052)break;else _0x5aed69['push'](_0x5aed69['shift']());}catch(_0x46fb76){_0x5aed69['push'](_0x5aed69['shift']());}}}(a30_0x7ba1,0x21ab9));function a30_0x7ba1(){const _0x22219d=['275755KKgdDE','name','message','error','profiles','length','execute','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','List\x20all\x20available\x20profiles','4421646lgerFa','config','205666BvTTDB','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','8PiWROi','709287QDvFiR','description','867236vAVNWI','135CGEzoX','673974RRTDJl','log','14346VAvRUQ'];a30_0x7ba1=function(){return _0x22219d;};return a30_0x7ba1();}function a30_0x4dde(_0x5021e7,_0x477f88){_0x5021e7=_0x5021e7-0xcd;const _0x7ba1f0=a30_0x7ba1();let _0x4dde22=_0x7ba1f0[_0x5021e7];return _0x4dde22;}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0x39e785(0xdc)]=a30_0x39e785(0xdf);[a30_0x39e785(0xd5)]=a30_0x39e785(0xce);async[a30_0x39e785(0xe1)](_0x714cf){const _0x55c489=a30_0x39e785,{options:_0x54753d}=_0x714cf;try{const _0x5702f3=listProfiles(),_0x31d90f=getActiveProfile();if(_0x5702f3[_0x55c489(0xe0)]===0x0)return console[_0x55c489(0xd9)](_0x55c489(0xd2)),console[_0x55c489(0xd9)](_0x55c489(0xcd)),console[_0x55c489(0xd9)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x533204=_0x5702f3['map'](_0x3fb3e2=>{const _0x41919b=_0x55c489,_0x22084b=_0x3fb3e2[_0x41919b(0xdc)]===_0x31d90f,_0x3e218a=getProfileParams(_0x3fb3e2[_0x41919b(0xd0)]);return{'name':_0x3fb3e2[_0x41919b(0xdc)],'active':_0x22084b,'scope':_0x3fb3e2['scope'],'description':_0x3fb3e2[_0x41919b(0xd0)]['description']||'','params':_0x3e218a};});return await handleSDKOutput(_0x533204,_0x54753d),0x0;}catch(_0x7ac078){return _0x7ac078 instanceof Error&&console[_0x55c489(0xde)]('Error:\x20'+_0x7ac078[_0x55c489(0xdd)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x17c242=a31_0x1619;function a31_0xb2c5(){const _0x1ba3ae=['8786511RatFSZ','totalSplits','join','setExtra','originalMessage','20cbPFau','Statement\x20','619615MdaMWA','8057852cMAYFw','verbose','file','133yMaDqo','push','query','message','Site:\x20','output','elapsedTimeMillis','...','Run\x20Trino\x20queries\x20(streaming)','length','database','setJobId','completedSplits','10DHyCQL','164410TykxAp','information_schema','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','13rIPxes','\x20[Job\x20ID:\x20','\x20rows\x20','3525036FIDvrK','processedRows','\x0aAll\x20results\x20saved\x20to\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','Schema:\x20','execute','168248DxGQmX','SQL:\x20','Catalog:\x20','validate','stats','Query\x20completed:\x20Processed\x20','jobId','catalog','Executing\x20query\x20[','2790750cMJZUq','No\x20SQL\x20provided','Executing\x20query...','error'];a31_0xb2c5=function(){return _0x1ba3ae;};return a31_0xb2c5();}(function(_0x5f0fa1,_0xa32222){const _0x240aa7=a31_0x1619,_0x2a8190=_0x5f0fa1();while(!![]){try{const _0x7da31=parseInt(_0x240aa7(0xe2))/0x1*(-parseInt(_0x240aa7(0xdf))/0x2)+parseInt(_0x240aa7(0xe5))/0x3+-parseInt(_0x240aa7(0xcb))/0x4*(parseInt(_0x240aa7(0xcd))/0x5)+parseInt(_0x240aa7(0xc2))/0x6+-parseInt(_0x240aa7(0xd1))/0x7*(-parseInt(_0x240aa7(0xb9))/0x8)+-parseInt(_0x240aa7(0xc6))/0x9*(-parseInt(_0x240aa7(0xde))/0xa)+-parseInt(_0x240aa7(0xce))/0xb;if(_0x7da31===_0xa32222)break;else _0x2a8190['push'](_0x2a8190['shift']());}catch(_0xcbdbd8){_0x2a8190['push'](_0x2a8190['shift']());}}}(a31_0xb2c5,0x914f9));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a31_0x1619(_0x594a46,_0x2804e7){_0x594a46=_0x594a46-0xb7;const _0xb2c5b6=a31_0xb2c5();let _0x16196d=_0xb2c5b6[_0x594a46];return _0x16196d;}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']=a31_0x17c242(0xd3);['description']=a31_0x17c242(0xd9);async[a31_0x17c242(0xb8)](_0x4fde24){const _0x2498a4=a31_0x17c242,{options:_0x7c8337,args:_0x53f685,tdx:_0x2448a0}=_0x4fde24,_0x53cb57=_0x53f685[0x0],_0x5deb28=_0x7c8337['file'];let _0x574be0;try{if(_0x5deb28)_0x574be0=readSqlStatementsFromFile(_0x5deb28);else{if(_0x53cb57==='-')_0x574be0=await readSqlStatementsFromStdin();else{if(_0x53cb57&&isSqlFilePath(_0x53cb57))_0x574be0=readSqlStatementsFromFile(_0x53cb57);else{if(_0x53cb57)_0x574be0=splitSqlStatements(_0x53cb57);else throw new Error(_0x2498a4(0xc3));}}}}catch(_0x499335){return console[_0x2498a4(0xc5)]('Error:\x20'+_0x499335[_0x2498a4(0xd4)]),0x1;}const _0x186049=_0x7c8337[_0x2498a4(0xdb)]||_0x2498a4(0xe0),_0xc20f5e=_0x7c8337[_0x2498a4(0xc0)];try{const _0x1e275a=[],_0x5936aa=!!_0x7c8337[_0x2498a4(0xd6)];for(let _0x8f43c5=0x0;_0x8f43c5<_0x574be0[_0x2498a4(0xda)];_0x8f43c5++){const _0x4abe91=_0x574be0[_0x8f43c5],_0xeaf007=_0x8f43c5+0x1,_0x436984=_0x574be0['length'],_0x4174a8=_0x436984>0x1;_0x7c8337['verbose']&&(console['error']('\x0a'+(_0x4174a8?_0x2498a4(0xcc)+_0xeaf007+'/'+_0x436984+':':'')),console['error'](_0x2498a4(0xd5)+_0x7c8337['site']),console[_0x2498a4(0xc5)](_0x2498a4(0xbb)+(_0xc20f5e||'td')),console[_0x2498a4(0xc5)](_0x2498a4(0xb7)+_0x186049),console[_0x2498a4(0xc5)](_0x2498a4(0xba)+_0x4abe91));const _0x3966ab=_0x4174a8?'Executing\x20statement\x20'+_0xeaf007+'/'+_0x436984+_0x2498a4(0xd8):_0x2498a4(0xc4);try{const _0x2e8fde=await withQuerySpinner(_0x3966ab,async _0x41d15f=>{const _0x503ae3=_0x2498a4,_0x3ebbce=await _0x2448a0['query'][_0x503ae3(0xb8)](_0x4abe91,{'catalog':_0xc20f5e,'schema':_0x186049,'onJobId':_0x507400=>{const _0x4bc952=_0x503ae3;_0x41d15f[_0x4bc952(0xdc)](_0x507400);},'onProgress':_0x4a1da9=>{const _0x11912b=_0x503ae3;_0x41d15f['setPhase'](_0x11912b(0xc1)+_0x4a1da9['state']+']'),_0x41d15f[_0x11912b(0xc9)](formatRows(_0x4a1da9[_0x11912b(0xe6)])+_0x11912b(0xe4)+_0x4a1da9[_0x11912b(0xdd)]+'/'+_0x4a1da9[_0x11912b(0xc7)]+'\x20splits');}});return _0x3ebbce;},{'verbose':_0x7c8337[_0x2498a4(0xcf)]}),_0x24e67f=_0x2e8fde['data'],_0x1f7ed6=_0x24e67f[_0x2498a4(0xbf)]?_0x2498a4(0xe3)+_0x24e67f[_0x2498a4(0xbf)]+']':'',_0x1e8dba=_0x4174a8?_0x2498a4(0xcc)+_0xeaf007+'/'+_0x436984+'\x20-\x20':'';console[_0x2498a4(0xc5)]('✔\x20'+_0x1e8dba+_0x2498a4(0xbe)+formatRows(_0x24e67f[_0x2498a4(0xbd)][_0x2498a4(0xe6)])+_0x2498a4(0xe4)+('in\x20'+formatElapsed(_0x24e67f[_0x2498a4(0xbd)][_0x2498a4(0xd7)])+_0x1f7ed6));if(_0x4174a8&&_0x5936aa){const _0x37e8e4=resolveOutputOptions(_0x7c8337),_0x8367aa=await formatQueryOutput(_0x24e67f,_0x37e8e4);_0x1e275a[_0x2498a4(0xd2)](_0x8367aa);}else await handleQueryOutput(_0x24e67f,_0x7c8337);}catch(_0x4afc23){const _0x4e3a07=_0x4174a8?_0x2498a4(0xcc)+_0xeaf007+'/'+_0x436984+':\x0a':'',_0x2896e0=_0x4afc23 instanceof SDKError?_0x4afc23[_0x2498a4(0xca)]:_0x4afc23[_0x2498a4(0xd4)];return console['error'](''+_0x4e3a07+_0x2896e0),0x1;}}if(_0x574be0[_0x2498a4(0xda)]>0x1&&_0x5936aa&&_0x1e275a[_0x2498a4(0xda)]>0x0){const _0x25659c=_0x1e275a[_0x2498a4(0xc8)]('\x0a');writeFileSync(_0x7c8337[_0x2498a4(0xd6)],_0x25659c),console[_0x2498a4(0xc5)](_0x2498a4(0xe7)+_0x7c8337[_0x2498a4(0xd6)]);}return 0x0;}catch(_0x490ab5){throw _0x490ab5;}}[a31_0x17c242(0xbc)](_0x214358){const _0x26ab5e=a31_0x17c242,_0x1aef1a=_0x214358['args'][0x0],_0x384e69=_0x214358['options'][_0x26ab5e(0xd0)];if(!_0x1aef1a&&!_0x384e69)return _0x26ab5e(0xe1);if(_0x1aef1a&&_0x384e69)return _0x26ab5e(0xe8);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x413ad9=a32_0x50f8;(function(_0x317f71,_0x5c72d6){const _0x5a2e16=a32_0x50f8,_0x309fd6=_0x317f71();while(!![]){try{const _0x593d8a=parseInt(_0x5a2e16(0x136))/0x1*(-parseInt(_0x5a2e16(0x107))/0x2)+-parseInt(_0x5a2e16(0x104))/0x3+-parseInt(_0x5a2e16(0x15c))/0x4*(parseInt(_0x5a2e16(0x133))/0x5)+parseInt(_0x5a2e16(0x110))/0x6*(-parseInt(_0x5a2e16(0xca))/0x7)+parseInt(_0x5a2e16(0xde))/0x8*(-parseInt(_0x5a2e16(0x103))/0x9)+-parseInt(_0x5a2e16(0xcf))/0xa*(-parseInt(_0x5a2e16(0x153))/0xb)+parseInt(_0x5a2e16(0x11b))/0xc;if(_0x593d8a===_0x5c72d6)break;else _0x309fd6['push'](_0x309fd6['shift']());}catch(_0xa8d2e3){_0x309fd6['push'](_0x309fd6['shift']());}}}(a32_0x8792,0x60613));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_0x56ea1f from'chalk';function a32_0x50f8(_0x390fc2,_0x3b5b92){_0x390fc2=_0x390fc2-0xc9;const _0x87924a=a32_0x8792();let _0x50f85c=_0x87924a[_0x390fc2];return _0x50f85c;}function resolveSegmentTarget(_0x2299b7,_0x4f787,_0x789469){const _0x187501=a32_0x50f8;if(isYamlFilePath(_0x2299b7))try{const _0x12153c=resolveYamlFilePath(_0x2299b7);return _0x789469&&(console[_0x187501(0x12c)](_0x187501(0x137)+_0x2299b7),console[_0x187501(0x12c)](_0x187501(0x146)+_0x12153c[_0x187501(0x164)]),console[_0x187501(0x12c)](_0x187501(0xd5)+_0x12153c['segmentName']),console[_0x187501(0x12c)](_0x187501(0x135)+(_0x12153c[_0x187501(0xf2)]||_0x187501(0xcd))),console['error']('\x20\x20Full\x20path:\x20'+_0x12153c[_0x187501(0xd9)])),_0x12153c['fullPath'];}catch(_0xd7aa34){throw new SDKError(ErrorCode[_0x187501(0x112)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xd7aa34[_0x187501(0x147)]);}if(!_0x4f787)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x187501(0x15d));return _0x4f787+'/'+_0x2299b7;}function a32_0x8792(){const _0x4198f0=['Site:\x20','data','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','site','folderPath','stats','✔\x20Found\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20ps\x20show','length','Create\x20segment\x20folder\x20for\x20organization','log','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','parentFolder','SELECT\x20*\x20FROM\x20(\x0a','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20view','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:describe','Use:\x20tdx\x20ps\x20view\x20-w','7461ECjbIC','1636002VjBaNW','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','8486QOjhnU','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20','Parent\x20name:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Folder\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','6fVjtbB','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','INVALID_ARGUMENT','SEGMENT_NOT_FOUND','Options:','limit','web','Use:\x20tdx\x20ps\x20sql','Parent\x20ID:\x20','/app/ps/','url','33563340HntlDw','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','elapsedTimeMillis','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','verbose','Fetching\x20segment\x20details...','Fetching\x20folder\x20\x27','✔\x20Created\x20folder\x20\x27','\x20rows\x20','Resolved\x20parent\x20folder\x20ID:\x20','Segment\x20ID:\x20','format','segment:folder:show','\x27...','Show\x20child\x20segment\x20schema\x20(column\x20types)','execute','error','Resolved\x20folder\x20ID:\x20','Listing\x20folders\x20for\x20parent\x20\x27','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','query','type','includes','1355xdHHxa','name','\x20\x20Folder\x20path:\x20','93rtpxuL','Resolved\x20YAML\x20file:\x20','Show\x20segment\x20folder\x20details','Use:\x20tdx\x20ps\x20desc','segmentId','description','Parent\x20segment:\x20','jsonl','Resolved\x20parent\x20ID:\x20','segment:desc','Error:\x20Folder\x20reference\x20is\x20required','segment','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','listFolders','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','getSegmentSQL','\x20\x20Parent\x20segment:\x20','message','Target\x20path:\x20','cyan','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolved\x20relative\x20path\x20to:\x20','green','cause','SEGMENT_FOLDER_NOT_FOUND','processedRows','json','segment:sql','resolveFolderId','3729pkVVXk','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','parentId','Creating\x20folder\x20\x27','folderId','Folder\x20name:\x20','/e/','segment:view','7628dPYLBu','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','getParent','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','resolveParentId','SQL\x20query:\x0a','parentSegment','resolvePathToResource','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','5221328LpurPq','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','(root)','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','6610DxFhON','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','replace','folder','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20Segment\x20name:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20[Job\x20ID:\x20','parent','fullPath','getSegment','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','Show\x20folder\x20or\x20child\x20segment\x20details','4088UnVBzh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Fetching\x20SQL\x20for\x20segment...','✔\x20Query\x20completed:\x20Processed\x20','jobId','Examples:','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20Opening\x20','Resolved\x20type:\x20','\x20\x20Cause:\x20','in\x20','getFolder','segment:folder:create','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a32_0x8792=function(){return _0x4198f0;};return a32_0x8792();}export class SegmentDescribeCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x101);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0xfe);async[a32_0x413ad9(0x12b)](_0x2cab24){const _0x458ecd=a32_0x413ad9,{options:_0x597858,args:_0x207b03,tdx:_0x280b2a}=_0x2cab24,_0x112d62=_0x207b03[0x0],_0x2ab8c1=!_0x112d62&&!!_0x597858[_0x458ecd(0x164)],_0x578c99=_0x112d62||_0x597858[_0x458ecd(0x164)];if(!_0x578c99)return console[_0x458ecd(0x12c)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x458ecd(0x12c)](_0x458ecd(0xdc)),console[_0x458ecd(0x12c)](_0x458ecd(0xe3)),console['error'](_0x458ecd(0xd1)),console[_0x458ecd(0x12c)](_0x458ecd(0x100)),console[_0x458ecd(0x12c)](_0x458ecd(0xf5)),console[_0x458ecd(0x12c)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x21ed39=_0x597858['segmentPath'];let _0x22a917=_0x578c99;!_0x2ab8c1&&_0x21ed39&&!_0x578c99[_0x458ecd(0x132)]('/')&&(_0x22a917=_0x21ed39+'/'+_0x578c99,_0x597858[_0x458ecd(0x120)]&&console['error'](_0x458ecd(0x14b)+_0x22a917));const _0x4ad6bd=await withSpinner('Resolving\x20path\x20\x27'+_0x22a917+'\x27...',()=>_0x280b2a[_0x458ecd(0x141)][_0x458ecd(0x165)](_0x22a917),{'verbose':_0x597858['verbose']}),_0x3dc0dc=_0x4ad6bd[_0x458ecd(0xee)];_0x597858[_0x458ecd(0x120)]&&(console['error'](_0x458ecd(0xe7)+_0x3dc0dc[_0x458ecd(0x131)]),console[_0x458ecd(0x12c)]('Parent\x20ID:\x20'+_0x3dc0dc['parentId']),_0x3dc0dc['folderId']&&console[_0x458ecd(0x12c)](_0x458ecd(0x10e)+_0x3dc0dc[_0x458ecd(0x158)]),_0x3dc0dc[_0x458ecd(0x13a)]&&console[_0x458ecd(0x12c)](_0x458ecd(0x126)+_0x3dc0dc[_0x458ecd(0x13a)]));if(_0x3dc0dc[_0x458ecd(0x131)]===_0x458ecd(0xd8)){const _0x1d5298=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x280b2a['segment'][_0x458ecd(0x160)](_0x3dc0dc[_0x458ecd(0x156)]),{'verbose':_0x597858[_0x458ecd(0x120)]});await handleSingleObjectOutput(_0x1d5298[_0x458ecd(0xee)],_0x597858);}else{if(_0x3dc0dc[_0x458ecd(0x131)]===_0x458ecd(0xd3)){if(!_0x3dc0dc[_0x458ecd(0x158)])throw new SDKError(ErrorCode[_0x458ecd(0x14e)],_0x458ecd(0x108));const _0x2e3747=await withSpinner(_0x458ecd(0x105),()=>_0x280b2a[_0x458ecd(0x141)][_0x458ecd(0xea)](_0x3dc0dc[_0x458ecd(0x158)]),{'verbose':_0x597858[_0x458ecd(0x120)]});await handleSingleObjectOutput(_0x2e3747[_0x458ecd(0xee)],_0x597858);}else{if(_0x3dc0dc['type']===_0x458ecd(0x141)){if(!_0x3dc0dc['segmentId'])throw new SDKError(ErrorCode[_0x458ecd(0x113)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x125152=await withSpinner('Fetching\x20segment\x20details...',()=>_0x280b2a['segment']['getSegment'](_0x3dc0dc[_0x458ecd(0x156)],_0x3dc0dc[_0x458ecd(0x13a)]),{'verbose':_0x597858['verbose']});await handleSingleObjectOutput(_0x125152[_0x458ecd(0xee)],_0x597858);}}}return 0x0;}catch(_0x229f71){if(_0x229f71 instanceof SDKError)return console['error'](_0x458ecd(0x10a)+_0x229f71['message']),_0x229f71[_0x458ecd(0x14d)]&&console[_0x458ecd(0x12c)](_0x458ecd(0xe8)+_0x229f71['cause']),0x1;throw _0x229f71;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x413ad9(0x134)]='segment:show';[a32_0x413ad9(0x13b)]=a32_0x413ad9(0x14a);async['execute'](_0x16b212){const _0x159e89=a32_0x413ad9,{options:_0x340e96,args:_0x1d1d6b,tdx:_0x4bcd28}=_0x16b212,_0x1db9c1=_0x1d1d6b[0x0];if(!_0x1db9c1)return console['error'](_0x159e89(0x155)),console[_0x159e89(0x12c)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x159e89(0x12c)](_0x159e89(0xf0)),console['error'](_0x159e89(0xe3)),console['error'](_0x159e89(0x11c)),console[_0x159e89(0x12c)](_0x159e89(0x10c)),0x1;try{const _0x482fa1=_0x340e96[_0x159e89(0x164)],_0x5da0fc=resolveSegmentTarget(_0x1db9c1,_0x482fa1,_0x340e96[_0x159e89(0x120)]);_0x340e96[_0x159e89(0x120)]&&console[_0x159e89(0x12c)](_0x159e89(0x148)+_0x5da0fc);const _0x4b4c89=await withSpinner(_0x159e89(0x15e)+_0x1db9c1+_0x159e89(0x129),()=>_0x4bcd28[_0x159e89(0x141)]['resolvePathToResource'](_0x5da0fc),{'verbose':_0x340e96[_0x159e89(0x120)]}),_0x1f9ba5=_0x4b4c89[_0x159e89(0xee)];_0x340e96[_0x159e89(0x120)]&&(console[_0x159e89(0x12c)](_0x159e89(0xe7)+_0x1f9ba5[_0x159e89(0x131)]),console[_0x159e89(0x12c)](_0x159e89(0x118)+_0x1f9ba5['parentId']));if(_0x1f9ba5[_0x159e89(0x131)]===_0x159e89(0xd3))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x159e89(0x12c)](_0x159e89(0xd0)),0x1;if(_0x1f9ba5[_0x159e89(0x131)]===_0x159e89(0xd8))return console[_0x159e89(0x12c)](_0x159e89(0x11f)),console[_0x159e89(0x12c)](_0x159e89(0xf6)),0x1;if(!_0x1f9ba5['segmentId'])throw new SDKError(ErrorCode[_0x159e89(0x113)],_0x159e89(0xec));const _0x114a73=await withSpinner(_0x159e89(0xe0),()=>_0x4bcd28[_0x159e89(0x141)][_0x159e89(0x145)](_0x1f9ba5[_0x159e89(0x156)],_0x1f9ba5['segmentId']),{'verbose':_0x340e96[_0x159e89(0x120)]});let _0x413afc=_0x114a73[_0x159e89(0xee)];const _0x3b2461=resolveLimit(_0x340e96[_0x159e89(0x115)],DEFAULT_DISPLAY_LIMIT),_0x12efd7=/\bLIMIT\s+\d+/i['test'](_0x413afc);!_0x12efd7&&(_0x413afc=_0x413afc['trim']()[_0x159e89(0xd2)](/;+$/,''),_0x413afc=_0x159e89(0xfd)+_0x413afc+_0x159e89(0x109)+_0x3b2461);_0x340e96[_0x159e89(0x120)]&&console[_0x159e89(0x12c)](_0x159e89(0x163)+_0x413afc);const _0x4f246e=await withQuerySpinner('Executing\x20segment\x20query...',async _0x481693=>{const _0x246156=_0x159e89,_0x97f4f1=await _0x4bcd28[_0x246156(0x130)][_0x246156(0x12b)](_0x413afc,{'catalog':'td','schema':'information_schema','onJobId':_0x2b60b1=>{_0x481693['setJobId'](_0x2b60b1);}});return _0x97f4f1;},{'verbose':_0x340e96[_0x159e89(0x120)]}),_0x3f8a35=_0x4f246e[_0x159e89(0xee)],_0x5d88b9=_0x3f8a35['jobId']?_0x159e89(0xd7)+_0x3f8a35[_0x159e89(0xe2)]+']':'';return console[_0x159e89(0x12c)](_0x159e89(0xe1)+_0x3f8a35['stats'][_0x159e89(0x14f)]['toLocaleString']()+_0x159e89(0x124)+(_0x159e89(0xe9)+formatElapsed(_0x3f8a35[_0x159e89(0xf3)][_0x159e89(0x11d)])+_0x5d88b9)),await handleQueryOutput(_0x3f8a35,_0x340e96),0x0;}catch(_0x3c8912){if(_0x3c8912 instanceof SDKError)return console[_0x159e89(0x12c)]('✖\x20Query\x20failed\x20['+_0x3c8912['code']+']'),console[_0x159e89(0x12c)]('\x0a'+_0x3c8912[_0x159e89(0x147)]),0x1;throw _0x3c8912;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0xcb);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0x12f);async[a32_0x413ad9(0x12b)](_0x537c92){const _0x235a51=a32_0x413ad9,{options:_0x3fc3ba,args:_0x49dd29,tdx:_0x52f9f6}=_0x537c92;if(_0x49dd29[_0x235a51(0xf7)]===0x0)return console[_0x235a51(0x12c)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x235a51(0x12c)](_0x235a51(0x15f)),0x1;const _0x5dd55e=_0x49dd29[0x0];try{_0x3fc3ba[_0x235a51(0x120)]&&(console[_0x235a51(0x12c)](_0x235a51(0xed)+_0x3fc3ba['site']),console[_0x235a51(0x12c)](_0x235a51(0x10b)+_0x5dd55e));const _0x52670a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5dd55e+_0x235a51(0x129),()=>_0x52f9f6[_0x235a51(0x141)][_0x235a51(0x162)](_0x5dd55e),{'verbose':_0x3fc3ba[_0x235a51(0x120)]}),_0x23eaad=_0x52670a['data'];_0x3fc3ba[_0x235a51(0x120)]&&console[_0x235a51(0x12c)](_0x235a51(0x13e)+_0x23eaad);const _0x3721c2=await withSpinner(_0x235a51(0x12e)+_0x5dd55e+_0x235a51(0x129),()=>_0x52f9f6[_0x235a51(0x141)][_0x235a51(0x143)](_0x23eaad),{'verbose':_0x3fc3ba[_0x235a51(0x120)]}),_0x105f1c=_0x3721c2[_0x235a51(0xee)];return console[_0x235a51(0x12c)](_0x235a51(0xf4)+_0x105f1c['length']+'\x20folder'+(_0x105f1c[_0x235a51(0xf7)]!==0x1?'s':'')),await handleSDKOutput(_0x105f1c,_0x3fc3ba),0x0;}catch(_0x19c4c3){if(_0x19c4c3 instanceof SDKError)return console[_0x235a51(0x12c)](_0x235a51(0x10a)+_0x19c4c3['message']),_0x19c4c3[_0x235a51(0x14d)]&&console[_0x235a51(0x12c)](_0x235a51(0xe8)+_0x19c4c3['cause']),0x1;throw _0x19c4c3;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x128);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0x138);async[a32_0x413ad9(0x12b)](_0x155163){const _0x372608=a32_0x413ad9,{options:_0x110f5e,args:_0x26b145,tdx:_0x3aac45}=_0x155163;if(_0x26b145[_0x372608(0xf7)]===0x0)return console[_0x372608(0x12c)](_0x372608(0x140)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x7b522e,childId:_0x521c33}=parseSegmentRef(_0x26b145[0x0]);_0x110f5e[_0x372608(0x120)]&&(console[_0x372608(0x12c)](_0x372608(0xed)+_0x110f5e[_0x372608(0xf1)]),console[_0x372608(0x12c)](_0x372608(0x10b)+_0x7b522e),_0x521c33&&console['error'](_0x372608(0x159)+_0x521c33));if(!_0x521c33)return console[_0x372608(0x12c)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x5c7af3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x7b522e+_0x372608(0x129),()=>_0x3aac45[_0x372608(0x141)][_0x372608(0x162)](_0x7b522e),{'verbose':_0x110f5e[_0x372608(0x120)]}),_0x57dfeb=_0x5c7af3['data'];_0x110f5e[_0x372608(0x120)]&&console[_0x372608(0x12c)](_0x372608(0x13e)+_0x57dfeb);const _0x4c7e58=await withSpinner('Resolving\x20folder\x20\x27'+_0x521c33+_0x372608(0x129),()=>_0x3aac45[_0x372608(0x141)][_0x372608(0x152)](_0x57dfeb,_0x521c33),{'verbose':_0x110f5e[_0x372608(0x120)]}),_0x78a3da=_0x4c7e58['data'];_0x110f5e[_0x372608(0x120)]&&console[_0x372608(0x12c)](_0x372608(0x12d)+_0x78a3da);const _0x9e74e8=await withSpinner(_0x372608(0x122)+_0x521c33+_0x372608(0x129),()=>_0x3aac45[_0x372608(0x141)][_0x372608(0xea)](_0x78a3da),{'verbose':_0x110f5e['verbose']});return await handleSDKOutput([_0x9e74e8[_0x372608(0xee)]],_0x110f5e),0x0;}catch(_0x10f100){if(_0x10f100 instanceof SDKError)return console['error'](_0x372608(0x10a)+_0x10f100[_0x372608(0x147)]),_0x10f100[_0x372608(0x14d)]&&console[_0x372608(0x12c)](_0x372608(0xe8)+_0x10f100[_0x372608(0x14d)]),0x1;throw _0x10f100;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x151);['description']=a32_0x413ad9(0xd6);async[a32_0x413ad9(0x12b)](_0x3a235c){const _0x477fc4=a32_0x413ad9,{options:_0x2a7599,args:_0x1449b7,tdx:_0x13094f}=_0x3a235c,_0x2be35d=_0x1449b7[0x0];if(!_0x2be35d)return console[_0x477fc4(0x12c)](_0x477fc4(0x155)),console[_0x477fc4(0x12c)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x477fc4(0xfb)),console['error'](_0x477fc4(0xe3)),console['error'](_0x477fc4(0x144)),console['error'](_0x477fc4(0x161)),0x1;try{const _0x4f306f=_0x2a7599[_0x477fc4(0x164)],_0x19369b=resolveSegmentTarget(_0x2be35d,_0x4f306f,_0x2a7599[_0x477fc4(0x120)]);_0x2a7599[_0x477fc4(0x120)]&&console[_0x477fc4(0x12c)](_0x477fc4(0x148)+_0x19369b);const _0x564710=await withSpinner(_0x477fc4(0x15e)+_0x2be35d+_0x477fc4(0x129),()=>_0x13094f[_0x477fc4(0x141)][_0x477fc4(0x165)](_0x19369b),{'verbose':_0x2a7599[_0x477fc4(0x120)]}),_0xb3f3ef=_0x564710['data'];_0x2a7599[_0x477fc4(0x120)]&&(console[_0x477fc4(0x12c)]('Resolved\x20type:\x20'+_0xb3f3ef[_0x477fc4(0x131)]),console[_0x477fc4(0x12c)](_0x477fc4(0x118)+_0xb3f3ef[_0x477fc4(0x156)]));if(_0xb3f3ef[_0x477fc4(0x131)]===_0x477fc4(0xd3))return console[_0x477fc4(0x12c)](_0x477fc4(0xfa)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0xb3f3ef['type']===_0x477fc4(0xd8))return console[_0x477fc4(0x12c)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x477fc4(0x117)),0x1;if(!_0xb3f3ef['segmentId'])throw new SDKError(ErrorCode[_0x477fc4(0x113)],_0x477fc4(0xec));const _0x170fb7=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x13094f[_0x477fc4(0x141)][_0x477fc4(0x145)](_0xb3f3ef[_0x477fc4(0x156)],_0xb3f3ef[_0x477fc4(0x13a)]),{'verbose':_0x2a7599[_0x477fc4(0x120)]}),_0x1a057b=_0x170fb7['data'];return _0x2a7599[_0x477fc4(0x127)]===_0x477fc4(0x150)||_0x2a7599[_0x477fc4(0x127)]===_0x477fc4(0x13d)?await handleSDKOutput([{'sql':_0x1a057b}],_0x2a7599):console[_0x477fc4(0xf9)](_0x1a057b),0x0;}catch(_0x2c35d3){if(_0x2c35d3 instanceof SDKError)return console[_0x477fc4(0x12c)](_0x477fc4(0x10a)+_0x2c35d3[_0x477fc4(0x147)]),_0x2c35d3[_0x477fc4(0x14d)]&&console[_0x477fc4(0x12c)](_0x477fc4(0xe8)+_0x2c35d3[_0x477fc4(0x14d)]),0x1;throw _0x2c35d3;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a32_0x413ad9(0xeb);['description']=a32_0x413ad9(0xf8);async[a32_0x413ad9(0x12b)](_0x450f2c){const _0x56b22d=a32_0x413ad9,{options:_0x4d9a7a,args:_0x3533f1,tdx:_0x169fc7}=_0x450f2c,_0x353073=_0x4d9a7a;if(_0x3533f1[_0x56b22d(0xf7)]<0x2)return console[_0x56b22d(0x12c)](_0x56b22d(0xd4)),console[_0x56b22d(0x12c)](_0x56b22d(0xcc)),0x1;const _0x3e8fb4=_0x3533f1[0x0],_0x4b157f=_0x3533f1[0x1];_0x353073[_0x56b22d(0x120)]&&(console[_0x56b22d(0x12c)](_0x56b22d(0xed)+_0x353073[_0x56b22d(0xf1)]),console[_0x56b22d(0x12c)](_0x56b22d(0x13c)+_0x3e8fb4),console[_0x56b22d(0x12c)](_0x56b22d(0x159)+_0x4b157f));let _0x27c4fc;if(_0x353073[_0x56b22d(0xfc)]){const _0x1bc503=_0x353073[_0x56b22d(0xfc)],_0x32f42a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3e8fb4+'\x27...',()=>_0x169fc7[_0x56b22d(0x141)][_0x56b22d(0x162)](_0x3e8fb4),{'verbose':_0x353073[_0x56b22d(0x120)]}),_0x4a0ba1=_0x32f42a[_0x56b22d(0xee)],_0x45119a=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x1bc503+'\x27...',()=>_0x169fc7[_0x56b22d(0x141)][_0x56b22d(0x152)](_0x4a0ba1,_0x1bc503),{'verbose':_0x353073[_0x56b22d(0x120)]});_0x27c4fc=_0x45119a[_0x56b22d(0xee)],_0x353073['verbose']&&console[_0x56b22d(0x12c)](_0x56b22d(0x125)+_0x27c4fc);}const _0x11bba1={'name':_0x4b157f,'description':_0x353073[_0x56b22d(0x13b)],'parentFolderId':_0x27c4fc},_0x3bfd7f=await withSpinner(_0x56b22d(0x157)+_0x4b157f+_0x56b22d(0x129),()=>_0x169fc7[_0x56b22d(0x141)]['createFolder'](_0x3e8fb4,_0x11bba1),{'verbose':_0x353073[_0x56b22d(0x120)]}),_0x8b7d0b=_0x3bfd7f[_0x56b22d(0xee)];return console['error'](_0x56b22d(0x123)+_0x8b7d0b[_0x56b22d(0x134)]+_0x56b22d(0xdb)+_0x8b7d0b['id']),await handleSDKOutput([_0x8b7d0b],_0x353073),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x15b);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0xdd);async[a32_0x413ad9(0x12b)](_0x476b59){const _0x523f69=a32_0x413ad9,{options:_0xe2305d,args:_0xe1e5a2,tdx:_0x21f838}=_0x476b59,_0x50e2d7=_0xe1e5a2[0x0];if(!_0x50e2d7)return console[_0x523f69(0x12c)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x523f69(0x12c)](_0x523f69(0xce)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x523f69(0x12c)](_0x523f69(0x114)),console[_0x523f69(0x12c)](_0x523f69(0x111)),console[_0x523f69(0x12c)]('Examples:'),console[_0x523f69(0x12c)](_0x523f69(0x10f)),console['error'](_0x523f69(0x11e)),console[_0x523f69(0x12c)](_0x523f69(0xe4)),console[_0x523f69(0x12c)](_0x523f69(0x154)),0x1;try{const _0x1b2a46=_0xe2305d[_0x523f69(0x164)],_0x4020a4=resolveSegmentTarget(_0x50e2d7,_0x1b2a46,_0xe2305d['verbose']);_0xe2305d['verbose']&&console[_0x523f69(0x12c)](_0x523f69(0x148)+_0x4020a4);const _0x5532d4=await withSpinner(_0x523f69(0x15e)+_0x50e2d7+_0x523f69(0x129),()=>_0x21f838[_0x523f69(0x141)][_0x523f69(0x165)](_0x4020a4),{'verbose':_0xe2305d[_0x523f69(0x120)]}),_0x27816e=_0x5532d4['data'];_0xe2305d[_0x523f69(0x120)]&&(console[_0x523f69(0x12c)]('Resolved\x20type:\x20'+_0x27816e['type']),console[_0x523f69(0x12c)]('Parent\x20ID:\x20'+_0x27816e['parentId']),_0x27816e['folderId']&&console[_0x523f69(0x12c)](_0x523f69(0x10e)+_0x27816e[_0x523f69(0x158)]),_0x27816e[_0x523f69(0x13a)]&&console[_0x523f69(0x12c)](_0x523f69(0x126)+_0x27816e[_0x523f69(0x13a)]));if(_0xe2305d[_0x523f69(0x116)]){if(_0x27816e[_0x523f69(0x131)]===_0x523f69(0xd3))return console[_0x523f69(0x12c)](_0x523f69(0xe5)),0x1;if(_0x27816e['type']===_0x523f69(0xd8))return console[_0x523f69(0x12c)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x523f69(0x12c)](_0x523f69(0x102)),0x1;if(!_0x27816e[_0x523f69(0x13a)])throw new SDKError(ErrorCode[_0x523f69(0x113)],_0x523f69(0xec));const _0x28131a=getConsoleNextUrl(_0xe2305d['site'],_0x523f69(0x119)+_0x27816e['parentId']+_0x523f69(0x15a)+_0x27816e['segmentId']);return console[_0x523f69(0x12c)](a32_0x56ea1f[_0x523f69(0x14c)]('✔')+_0x523f69(0xe6)+a32_0x56ea1f[_0x523f69(0x149)](_0x28131a)),openBrowser(_0x28131a),0x0;}if(_0x27816e[_0x523f69(0x131)]===_0x523f69(0xd3)){if(!_0x27816e[_0x523f69(0x158)])throw new SDKError(ErrorCode[_0x523f69(0x14e)],_0x523f69(0x108));const _0x3fffcc=await withSpinner(_0x523f69(0x105),()=>_0x21f838[_0x523f69(0x141)][_0x523f69(0xea)](_0x27816e[_0x523f69(0x158)]),{'verbose':_0xe2305d[_0x523f69(0x120)]});await handleSingleObjectOutput(_0x3fffcc[_0x523f69(0xee)],_0xe2305d);}else{if(_0x27816e[_0x523f69(0x131)]===_0x523f69(0x141)){if(!_0x27816e[_0x523f69(0x13a)])throw new SDKError(ErrorCode[_0x523f69(0x113)],_0x523f69(0xec));const _0x113bf0=await withSpinner(_0x523f69(0x121),()=>_0x21f838[_0x523f69(0x141)][_0x523f69(0xda)](_0x27816e[_0x523f69(0x156)],_0x27816e[_0x523f69(0x13a)]),{'verbose':_0xe2305d[_0x523f69(0x120)]}),_0x1bb621=getConsoleNextUrl(_0xe2305d['site'],'/app/ps/'+_0x27816e[_0x523f69(0x156)]+_0x523f69(0x15a)+_0x27816e['segmentId']),_0x26b93b=_0x113bf0['data'];_0x26b93b[_0x523f69(0x11a)]=_0x1bb621,await handleSingleObjectOutput(_0x26b93b,_0xe2305d);}else return console[_0x523f69(0x12c)](_0x523f69(0x142)),console[_0x523f69(0x12c)](_0x523f69(0xff)),0x1;}return 0x0;}catch(_0x10bd59){if(_0x10bd59 instanceof SDKError)return console['error'](_0x523f69(0x10a)+_0x10bd59[_0x523f69(0x147)]),_0x10bd59[_0x523f69(0x14d)]&&console[_0x523f69(0x12c)](_0x523f69(0xe8)+_0x10bd59['cause']),0x1;throw _0x10bd59;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x13f);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0x12a);async[a32_0x413ad9(0x12b)](_0x471d09){const _0x52ac8f=a32_0x413ad9,{options:_0x486773,args:_0x366784,tdx:_0x37cdda}=_0x471d09,_0x25ea26=_0x366784[0x0];if(!_0x25ea26)return console[_0x52ac8f(0x12c)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x52ac8f(0xdf)),console['error'](_0x52ac8f(0xe3)),console[_0x52ac8f(0x12c)](_0x52ac8f(0xc9)),console[_0x52ac8f(0x12c)](_0x52ac8f(0x106)),0x1;try{const _0x117b67=_0x486773['parentSegment'],_0x7ea73c=resolveSegmentTarget(_0x25ea26,_0x117b67,_0x486773[_0x52ac8f(0x120)]);_0x486773[_0x52ac8f(0x120)]&&console[_0x52ac8f(0x12c)](_0x52ac8f(0x148)+_0x7ea73c);const _0x9d0082=await withSpinner(_0x52ac8f(0x15e)+_0x25ea26+'\x27...',()=>_0x37cdda[_0x52ac8f(0x141)][_0x52ac8f(0x165)](_0x7ea73c),{'verbose':_0x486773[_0x52ac8f(0x120)]}),_0x5f03f8=_0x9d0082[_0x52ac8f(0xee)];_0x486773[_0x52ac8f(0x120)]&&(console[_0x52ac8f(0x12c)](_0x52ac8f(0xe7)+_0x5f03f8[_0x52ac8f(0x131)]),console[_0x52ac8f(0x12c)](_0x52ac8f(0x118)+_0x5f03f8['parentId']));if(_0x5f03f8[_0x52ac8f(0x131)]===_0x52ac8f(0xd3))return console[_0x52ac8f(0x12c)](_0x52ac8f(0x10d)),console['error'](_0x52ac8f(0xef)),0x1;if(_0x5f03f8[_0x52ac8f(0x131)]===_0x52ac8f(0xd8))return console[_0x52ac8f(0x12c)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x52ac8f(0x139)),0x1;if(!_0x5f03f8[_0x52ac8f(0x13a)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x52ac8f(0xec));const _0x550b59=await withSpinner(_0x52ac8f(0xe0),()=>_0x37cdda['segment'][_0x52ac8f(0x145)](_0x5f03f8[_0x52ac8f(0x156)],_0x5f03f8[_0x52ac8f(0x13a)]),{'verbose':_0x486773['verbose']}),_0x3e1156=_0x550b59['data'],_0x4df6b5=await executeSchemaQuery(_0x3e1156,_0x37cdda,_0x486773);return await handleQueryOutput(_0x4df6b5,_0x486773),0x0;}catch(_0x3b38c3){if(_0x3b38c3 instanceof SDKError)return console[_0x52ac8f(0x12c)](_0x52ac8f(0x10a)+_0x3b38c3[_0x52ac8f(0x147)]),_0x3b38c3[_0x52ac8f(0x14d)]&&console[_0x52ac8f(0x12c)]('\x20\x20Cause:\x20'+_0x3b38c3[_0x52ac8f(0x14d)]),0x1;throw _0x3b38c3;}}}
|
|
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 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x38c3ef=a33_0x4f8f;(function(_0x4421f,_0x21619c){const _0x59b2db=a33_0x4f8f,_0xaf4bfa=_0x4421f();while(!![]){try{const _0x18712c=parseInt(_0x59b2db(0x18c))/0x1*(parseInt(_0x59b2db(0x182))/0x2)+parseInt(_0x59b2db(0x195))/0x3*(parseInt(_0x59b2db(0x181))/0x4)+-parseInt(_0x59b2db(0x176))/0x5*(-parseInt(_0x59b2db(0x19e))/0x6)+-parseInt(_0x59b2db(0x19f))/0x7*(parseInt(_0x59b2db(0x188))/0x8)+parseInt(_0x59b2db(0x180))/0x9+parseInt(_0x59b2db(0x17c))/0xa*(parseInt(_0x59b2db(0x185))/0xb)+-parseInt(_0x59b2db(0x192))/0xc;if(_0x18712c===_0x21619c)break;else _0xaf4bfa['push'](_0xaf4bfa['shift']());}catch(_0x21a571){_0xaf4bfa['push'](_0xaf4bfa['shift']());}}}(a33_0xffee,0xd8613));function a33_0x4f8f(_0x1611cc,_0x551ddd){_0x1611cc=_0x1611cc-0x16a;const _0xffee07=a33_0xffee();let _0x4f8f26=_0xffee07[_0x1611cc];return _0x4f8f26;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a33_0xffee(){const _0x5d5391=['createSegment','Site:\x20','Examples:','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','1959890qDiASY','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Segment\x20name:\x20','name','Parent\x20path:\x20','yellow','8134590OzHZoe','execute','type','parent','5003181bqcMLv','1644tPHPXb','163154imySTg','segment','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','11vXryCP','data','Resolved\x20folder\x20ID:\x20','87016Xtriiv','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20folder\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','9RJspFM','\x27...','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','folder','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Resolving\x20parent\x20segment\x20\x27','10478220CJyARy','✔\x20Created\x20segment\x20\x27','error','3837tcVqci','segments','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folderId','rule','verbose','length','Create\x20child\x20segment\x20with\x20filtering\x20rules','invisible','6gyrjjJ','812UBWIzz','kind','Creating\x20segment\x20\x27','\x20\x20\x20Path:\x20','description','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Target\x20path:\x20','includes','\x27\x20with\x20ID:\x20'];a33_0xffee=function(){return _0x5d5391;};return a33_0xffee();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0xc0eebf from'chalk';export class SegmentCreateCommand extends BaseCommand{[a33_0x38c3ef(0x179)]='segment:create';[a33_0x38c3ef(0x16d)]=a33_0x38c3ef(0x19c);async[a33_0x38c3ef(0x17d)](_0x3ecf8b){const _0x9fc379=a33_0x38c3ef;console[_0x9fc379(0x194)](a33_0xc0eebf[_0x9fc379(0x17b)](_0x9fc379(0x175))),console['error'](a33_0xc0eebf[_0x9fc379(0x17b)](_0x9fc379(0x18b)));const {options:_0x15d37e,args:_0x38087e,tdx:_0x12c487}=_0x3ecf8b,_0x54c92b=_0x15d37e;if(_0x38087e[_0x9fc379(0x19b)]===0x0)return console['error'](_0x9fc379(0x197)),console['error'](_0x9fc379(0x16e)),console['error'](_0x9fc379(0x174)),console[_0x9fc379(0x194)](_0x9fc379(0x184)),console[_0x9fc379(0x194)](_0x9fc379(0x177)),console[_0x9fc379(0x194)](_0x9fc379(0x189)),0x1;const _0x2cc154=_0x38087e[0x0],_0x40c788=_0x15d37e['segmentPath'];let _0x5bf3b0=_0x2cc154;_0x40c788&&!_0x2cc154[_0x9fc379(0x170)]('/')&&(_0x5bf3b0=_0x40c788+'/'+_0x2cc154,_0x54c92b[_0x9fc379(0x19a)]&&console[_0x9fc379(0x194)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5bf3b0));const _0x580a2f=parsePath(_0x5bf3b0);if(_0x580a2f[_0x9fc379(0x196)][_0x9fc379(0x19b)]<0x2)return console[_0x9fc379(0x194)](_0x9fc379(0x190)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x261583=_0x580a2f[_0x9fc379(0x196)][0x0],_0x1ce763=getBaseName(_0x5bf3b0),_0x301615=getParentPath(_0x5bf3b0);_0x54c92b[_0x9fc379(0x19a)]&&(console[_0x9fc379(0x194)](_0x9fc379(0x173)+_0x54c92b['site']),console[_0x9fc379(0x194)](_0x9fc379(0x16f)+_0x5bf3b0),console['error']('Parent:\x20'+_0x261583),console[_0x9fc379(0x194)](_0x9fc379(0x178)+_0x1ce763),console[_0x9fc379(0x194)](_0x9fc379(0x17a)+_0x301615));const _0x4eb306=await withSpinner(_0x9fc379(0x191)+_0x261583+_0x9fc379(0x18d),()=>_0x12c487[_0x9fc379(0x183)]['resolveParentId'](_0x261583),{'verbose':_0x54c92b['verbose']}),_0x5ab4ed=_0x4eb306[_0x9fc379(0x186)];let _0x33f93e;if(_0x580a2f[_0x9fc379(0x196)][_0x9fc379(0x19b)]>0x2){const _0xc9941a=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x301615+_0x9fc379(0x18d),()=>_0x12c487[_0x9fc379(0x183)]['resolvePathToResource'](_0x301615),{'verbose':_0x54c92b[_0x9fc379(0x19a)]}),_0x2420df=_0xc9941a['data'];if(_0x2420df[_0x9fc379(0x17e)]!==_0x9fc379(0x18f)&&_0x2420df['type']!==_0x9fc379(0x17f))return console[_0x9fc379(0x194)](_0x9fc379(0x18e)),0x1;_0x33f93e=_0x2420df[_0x9fc379(0x198)];}else{if(_0x54c92b[_0x9fc379(0x18f)]){const _0x153fef=await withSpinner(_0x9fc379(0x18a)+_0x54c92b['folder']+_0x9fc379(0x18d),()=>_0x12c487[_0x9fc379(0x183)]['resolveFolderId'](_0x5ab4ed,_0x54c92b[_0x9fc379(0x18f)]),{'verbose':_0x54c92b[_0x9fc379(0x19a)]});_0x33f93e=_0x153fef[_0x9fc379(0x186)];}}_0x54c92b[_0x9fc379(0x19a)]&&_0x33f93e&&console[_0x9fc379(0x194)](_0x9fc379(0x187)+_0x33f93e);const _0x19d710=await loadJSONFromOptions(_0x54c92b[_0x9fc379(0x199)],_0x54c92b['ruleFile']),_0x40be9d={'name':_0x1ce763,'description':_0x54c92b[_0x9fc379(0x16d)],'rule':_0x19d710,'kind':_0x54c92b[_0x9fc379(0x16a)]!==undefined?parseInt(_0x54c92b[_0x9fc379(0x16a)],0xa):undefined,'isVisible':_0x54c92b[_0x9fc379(0x19d)]?![]:undefined,'segmentFolderId':_0x33f93e,'countPopulation':_0x54c92b['noCountPopulation']?![]:undefined},_0x4e9e04=await withSpinner(_0x9fc379(0x16b)+_0x1ce763+_0x9fc379(0x18d),()=>_0x12c487['segment'][_0x9fc379(0x172)](_0x5ab4ed,_0x40be9d),{'verbose':_0x54c92b[_0x9fc379(0x19a)]}),_0x8babab=_0x4e9e04[_0x9fc379(0x186)];return console[_0x9fc379(0x194)](_0x9fc379(0x193)+_0x8babab[_0x9fc379(0x179)]+_0x9fc379(0x171)+_0x8babab['id']),_0x5bf3b0!==_0x2cc154&&console[_0x9fc379(0x194)](_0x9fc379(0x16c)+_0x5bf3b0),await handleSDKOutput([_0x8babab],_0x54c92b),0x0;}}
|