@treasuredata/tdx 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.d.ts +45 -1
- package/dist/client/td-api-client.d.ts.map +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/td-api-client.js.map +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.d.ts +35 -0
- package/dist/commands/connection-command.d.ts.map +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/connection-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +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.d.ts +6 -0
- package/dist/commands/segment-pull-command.d.ts.map +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-pull-command.js.map +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +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.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection-validator.d.ts +119 -0
- package/dist/sdk/connection-validator.d.ts.map +1 -0
- package/dist/sdk/connection-validator.js +1 -0
- package/dist/sdk/connection-validator.js.map +1 -0
- package/dist/sdk/connection.d.ts +120 -1
- package/dist/sdk/connection.d.ts.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/connection.js.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +4 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +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.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +135 -7
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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/cdp.d.ts +2 -1
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/connector-schema.d.ts +182 -0
- package/dist/types/connector-schema.d.ts.map +1 -0
- package/dist/types/connector-schema.js +1 -0
- package/dist/types/connector-schema.js.map +1 -0
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +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.d.ts.map +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/journey-utils.js.map +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_0x367de6=a29_0x5e17;(function(_0xb7e2e6,_0x52d73c){const _0x14e270=a29_0x5e17,_0x36e10d=_0xb7e2e6();while(!![]){try{const _0x8c7734=parseInt(_0x14e270(0x1e5))/0x1*(parseInt(_0x14e270(0x2d7))/0x2)+parseInt(_0x14e270(0x24a))/0x3+parseInt(_0x14e270(0x207))/0x4+-parseInt(_0x14e270(0x2ba))/0x5+-parseInt(_0x14e270(0x2dc))/0x6+-parseInt(_0x14e270(0x272))/0x7+parseInt(_0x14e270(0x290))/0x8*(parseInt(_0x14e270(0x1e8))/0x9);if(_0x8c7734===_0x52d73c)break;else _0x36e10d['push'](_0x36e10d['shift']());}catch(_0xb5b95e){_0x36e10d['push'](_0x36e10d['shift']());}}}(a29_0x49f3,0x41220));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';function a29_0x49f3(){const _0x4ab331=['map','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','win32','Source:','workflowSessionId','\x0a⚠️\x20\x20Both\x20','✔\x20Created\x20parent\x20segment\x20\x27','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','open','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','ignore','Output\x20file:\x20','bold','attribute','apply','\x0aChanges\x20to\x20\x27','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','1241277YBZJww','segment:parent:list','processedRows','cyan','Options:\x0a','.yml','foreignKey','jsonl','Preview:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','displayPreviewResults','resolveParentId','segment:parent:update','\x20Opening\x20','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','getParentSQL','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','segment:parent:preview','stats','Aborted.','utf-8','yellow','segment:parent:desc','Columns:','workflowId','sort','join','match','attributesFile','Table:\x20','localeCompare','web','Analyzing\x20changes...','database','text','Create\x20parent\x20segment\x20\x27','runParent','Apply\x20changes\x20to\x20\x27','execute','2668701FjhNfc','Attributes','tdx\x20segment\x20parent\x20preview\x20','toFixed','List\x20available\x20fields\x20for\x20segmentation','\x27\x20with\x20ID:\x20','\x0aNew\x20parent\x20segment\x20\x27','replace','in\x20','setJobId','displayColumns','\x20No\x20changes\x20-\x20','customerGroupFile','segment:parent:fields','Customers:','\x20\x20No\x20sample\x20data\x20available','red','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x27...','YAML\x20file:\x20','varchar','Database:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','verbose','Events:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','string','filter','Join:','Audience\x20ID:','8ubrOCd','\x20--interval\x20','length','behavior','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Enriched:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','green','toLocaleString','displayBehaviorsStats','Error:\x20File\x20not\x20found:\x20','errors','Updating\x20parent\x20segment\x20\x27','scheduleOption','jobId','darwin','Parent\x20segment:\x20','displayAttributesStats','Site:\x20','Attribute:','addBehaviorsFile','segment:parent:show','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','✔\x20Renamed\x20directory\x20to\x20','audienceId','using\x20the\x20default\x20path:\x20','joinKey','✔\x20Query\x20completed:\x20Processed\x20','session','behaviors','Join\x20on:','xdg-open','Name:\x20','displayMasterInfo','pullParentYaml','displayValidateResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','all','Fetching\x20sample\x20data...','Options:','\x27\x20is\x20up\x20to\x20date','table','1406450OpKGjx','scheduleType','master','%)\x20','\x20is\x20already\x20up\x20to\x20date','segment:parent:push','segment:parent:create','customerPercent','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Creating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Behaviors','\x20--enriched','unref','segment','column','Updating','test','timezone','rowCount','Session:','allValid','\x20field','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','output','/\x20→\x20','Status:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','2450ZmSTcW','SQL\x20query:\x0a','endsWith','description','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','2345538cennrk','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','repeat','\x0a⚠️\x20\x20Migrating:\x20','matchedCount','✔\x20No\x20changes\x20-\x20\x27','Error\x20parsing\x20YAML:\x20','\x20parent\x20segment\x20\x27','query','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x27\x20and\x20run\x20workflow?','Behavior:','✘\x20Failed\x20to\x20rename\x20directory:\x20','enriched','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','schemaError','platform','Master\x20+\x20Attributes','segment:parent:sql','message','dim','Created','workflowAttemptId','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','displayPreviewHints','pushParentYaml','\x20\x20\x20\x20-\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Errors:','addAttributesFile','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Get\x20SQL\x20query\x20for\x20parent\x20segment','Creating','dirname','To\x20cancel:','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','yes','Error:\x20Parent\x20segment\x20name\x20is\x20required','`\x20to\x20download\x20the\x20configuration\x20first','coveragePercent','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Rows:','100GOeoTT','\x20--behavior\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','4662612luqzkC','stop','Validate:','start','double','FINISHED','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','interval','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','log','segment:parent:validate','-1d','columns','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20Context\x20set:\x20','validateParentYaml','sampleData','parentSegment','\x20--attribute\x20\x22<name>\x22','/\x20directories\x20exist.','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','displaySummary','\x0aChanges\x20to\x20apply\x20to\x20\x27','/app/dw/parentSegments/','Updated','addBehaviors','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Attempt:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','parent_segment','1063652rFarab','site','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','run','Executing\x20parent\x20segment\x20query...','Listing\x20fields\x20for\x20\x27','json','elapsedTimeMillis','data','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Resolving\x20parent\x20segment\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','getParentFull','✔\x20Found\x20','\x20--behavior\x20\x22<name>\x22','segment:parent:view','displaySampleData','/attempt/','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Error\x20reading\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20=\x20','listParents','customerGroup','status','\x20rows)','Error:','Validating\x20configuration...','Error:\x20--database\x20and\x20--table\x20are\x20required','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','preview','Fetching\x20parent\x20segment\x20\x27','\x27\x20is\x20already\x20up\x20to\x20date','SELECT\x20*\x20FROM\x20(\x0a','information_schema','Listing\x20parent\x20segments\x20matching\x20\x27','attributes','customersWithEvents','format','segment:parent:run','totalEvents','schemaValid','label','Fetching\x20SQL\x20for\x20\x27','\x20parent\x20segment'];a29_0x49f3=function(){return _0x4ab331;};return a29_0x49f3();}import{spawn}from'child_process';import a29_0x31c5f7 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0x454280 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a29_0x367de6(0x206);function openBrowser(_0x2fd43f){const _0x39b447=a29_0x367de6,_0x55d5cf=process[_0x39b447(0x2ed)],_0x84cfc6=_0x55d5cf===_0x39b447(0x29f)?_0x39b447(0x241):_0x55d5cf===_0x39b447(0x23a)?_0x39b447(0x1eb):_0x39b447(0x2af);spawn(_0x84cfc6,[_0x2fd43f],{'detached':!![],'stdio':_0x39b447(0x243)})[_0x39b447(0x2c7)]();}function migrateLegacyDirectory(){const _0x3063a8=a29_0x367de6;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3989ad=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3989ad['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a29_0x454280[_0x3063a8(0x260)](_0x3063a8(0x23d)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x3063a8(0x1fb))),console['error'](a29_0x454280[_0x3063a8(0x1ce)](_0x3063a8(0x249)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x3063a8(0x25a)](a29_0x454280[_0x3063a8(0x260)](_0x3063a8(0x2df)+LEGACY_PARENT_SEGMENT_DIR+_0x3063a8(0x2d4)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x454280[_0x3063a8(0x297)](_0x3063a8(0x2a7)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x307257){const _0x16f4cb=_0x307257 instanceof Error?_0x307257[_0x3063a8(0x1cd)]:String(_0x307257);return console[_0x3063a8(0x25a)](a29_0x454280['red'](_0x3063a8(0x2e8)+_0x16f4cb+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x367de6(0x20a)](_0x331ee8){const _0xf00f64=a29_0x367de6;return migrateLegacyDirectory(),super[_0xf00f64(0x20a)](_0x331ee8);}}function resolveYamlFile(_0x1a2c2c){const _0x531ca6=a29_0x367de6;if(_0x1a2c2c['endsWith'](_0x531ca6(0x24f))||_0x1a2c2c[_0x531ca6(0x2d9)]('.yaml'))return _0x1a2c2c;return a29_0x31c5f7['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1a2c2c)+_0x531ca6(0x24f));}function formatProgressMessage(_0x143e94){const _0x219a05=a29_0x367de6,_0x5067f5=_0x143e94[_0x219a05(0x266)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5067f5){const [,_0x55aa3d,_0x5a88f4,_0x4aef75='']=_0x5067f5;return a29_0x454280[_0x219a05(0x1ce)](_0x55aa3d+':')+'\x20'+_0x5a88f4+a29_0x454280['dim'](_0x4aef75);}return a29_0x454280['dim'](_0x143e94);}function showFileNotFoundError(_0x9129eb,_0x559948){const _0x40cca0=a29_0x367de6;console[_0x40cca0(0x25a)](a29_0x454280['red'](_0x40cca0(0x29a)+_0x9129eb+'\x0a')),console[_0x40cca0(0x25a)](a29_0x454280[_0x40cca0(0x24d)](_0x40cca0(0x226)+_0x559948+_0x40cca0(0x1e1)));}function showParentSegmentNotSetError(_0x5199fa){const _0x532d4d=a29_0x367de6;console[_0x532d4d(0x25a)](a29_0x454280[_0x532d4d(0x260)](_0x532d4d(0x205))),console[_0x532d4d(0x25a)](_0x5199fa);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x24b);['description']='List\x20parent\x20segments';async[a29_0x367de6(0x271)](_0x53e9c0){const _0x482d85=a29_0x367de6,{options:_0x49691b,args:_0x3aaf05,tdx:_0x274151}=_0x53e9c0,_0x6a5bcf=_0x3aaf05[0x0];_0x49691b['verbose']&&(console[_0x482d85(0x25a)]('Site:\x20'+_0x49691b[_0x482d85(0x208)]),_0x6a5bcf&&console[_0x482d85(0x25a)]('Pattern:\x20'+_0x6a5bcf));const _0xd9eee1=await withSpinner(_0x6a5bcf?_0x482d85(0x22c)+_0x6a5bcf+_0x482d85(0x284):'Listing\x20parent\x20segments...',()=>_0x274151[_0x482d85(0x2c8)][_0x482d85(0x21f)](),{'verbose':_0x49691b[_0x482d85(0x289)]});let _0x17f4c6=_0xd9eee1[_0x482d85(0x20f)];if(_0x6a5bcf){const _0x16c7f1=_0x6a5bcf['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x482d85(0x279)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x46091e=new RegExp('^'+_0x16c7f1+'$','i');_0x17f4c6=_0x17f4c6[_0x482d85(0x28d)](_0x52f43c=>_0x46091e['test'](_0x52f43c[_0x482d85(0x22d)]['name']));}_0x17f4c6[_0x482d85(0x264)]((_0x4fe153,_0x2d302b)=>_0x4fe153[_0x482d85(0x22d)][_0x482d85(0x238)][_0x482d85(0x269)](_0x2d302b['attributes'][_0x482d85(0x238)])),console[_0x482d85(0x25a)](_0x482d85(0x215)+_0x17f4c6[_0x482d85(0x292)]+_0x482d85(0x235)+(_0x17f4c6[_0x482d85(0x292)]!==0x1?'s':''));if(_0x49691b[_0x482d85(0x22f)]==='json'||_0x49691b['format']===_0x482d85(0x251))await handleSDKOutput(_0x17f4c6,_0x49691b);else{if(_0x17f4c6['length']===0x0)_0x6a5bcf?console['log'](_0x482d85(0x1d6)+_0x6a5bcf):console['log']('No\x20parent\x20segments\x20found');else for(const _0xc10964 of _0x17f4c6){const _0x10fc95=_0xc10964[_0x482d85(0x22d)]['population']?a29_0x454280[_0x482d85(0x1ce)]('\x20('+formatRows(_0xc10964['attributes']['population'])+')'):'';console[_0x482d85(0x1f1)]('👥\x20'+_0xc10964[_0x482d85(0x22d)]['name']+_0x10fc95);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x2c0);[a29_0x367de6(0x2da)]=a29_0x367de6(0x258);async['execute'](_0x352bdc){const _0x50525e=a29_0x367de6,{options:_0x24215b,args:_0x58486c,tdx:_0x16b3b4}=_0x352bdc;console[_0x50525e(0x25a)](_0x50525e(0x210)+_0x50525e(0x237)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x42cf61=_0x24215b;if(_0x58486c['length']===0x0)return console[_0x50525e(0x25a)](a29_0x454280[_0x50525e(0x282)](_0x50525e(0x1e0))),console[_0x50525e(0x25a)](_0x50525e(0x1de)),0x1;const _0x2298d4=_0x58486c[0x0];if(!_0x42cf61[_0x50525e(0x26c)]||!_0x42cf61[_0x50525e(0x2b9)])return console[_0x50525e(0x25a)](_0x50525e(0x225)),console[_0x50525e(0x25a)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x42cf61['verbose']&&(console[_0x50525e(0x25a)](_0x50525e(0x2a2)+_0x42cf61[_0x50525e(0x208)]),console[_0x50525e(0x25a)](_0x50525e(0x2b0)+_0x2298d4),console[_0x50525e(0x25a)](_0x50525e(0x287)+_0x42cf61['database']),console[_0x50525e(0x25a)](_0x50525e(0x268)+_0x42cf61[_0x50525e(0x2b9)]));const _0x18c0c7=await loadJSONFromOptions(_0x42cf61[_0x50525e(0x22d)],_0x42cf61[_0x50525e(0x267)]),_0x477729=await loadJSONFromOptions(_0x42cf61[_0x50525e(0x2ad)],_0x42cf61['behaviorsFile']),_0x58b4c5=await loadJSONFromOptions(_0x42cf61[_0x50525e(0x220)],_0x42cf61[_0x50525e(0x27e)]),_0x51c59b={'name':_0x2298d4,'description':_0x42cf61['description'],'scheduleType':_0x42cf61[_0x50525e(0x2bb)],'scheduleOption':_0x42cf61[_0x50525e(0x29d)],'timezone':_0x42cf61['timezone'],'master':{'parentDatabaseName':_0x42cf61[_0x50525e(0x26c)],'parentTableName':_0x42cf61[_0x50525e(0x2b9)]},'attributes':_0x18c0c7,'behaviors':_0x477729,'customerGroup':_0x58b4c5},_0x22ee36=await withSpinner(_0x50525e(0x2c3)+_0x2298d4+'\x27...',()=>_0x16b3b4[_0x50525e(0x2c8)]['createParent'](_0x51c59b),{'verbose':_0x24215b[_0x50525e(0x289)]}),_0x35fd4a=_0x22ee36['data'];return console[_0x50525e(0x25a)](_0x50525e(0x23e)+_0x35fd4a[_0x50525e(0x238)]+_0x50525e(0x277)+_0x35fd4a['id']),await handleSDKOutput([_0x35fd4a],_0x24215b),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x256);['description']=a29_0x367de6(0x2db);async[a29_0x367de6(0x271)](_0xbe181){const _0x4d1eea=a29_0x367de6,{options:_0x4e9557,args:_0x2036df,tdx:_0x10f15e}=_0xbe181;console[_0x4d1eea(0x25a)](_0x4d1eea(0x1fc)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x341bc1=_0x4e9557;if(_0x2036df['length']===0x0)return console[_0x4d1eea(0x25a)](a29_0x454280[_0x4d1eea(0x282)](_0x4d1eea(0x1e0))),console[_0x4d1eea(0x25a)](_0x4d1eea(0x1f5)),0x1;const _0x24d32c=_0x2036df[0x0];_0x341bc1[_0x4d1eea(0x289)]&&(console[_0x4d1eea(0x25a)](_0x4d1eea(0x2a2)+_0x341bc1[_0x4d1eea(0x208)]),console['error'](_0x4d1eea(0x2a0)+_0x24d32c));const _0x565ccf=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x24d32c+_0x4d1eea(0x284),()=>_0x10f15e[_0x4d1eea(0x2c8)][_0x4d1eea(0x214)](_0x24d32c),{'verbose':_0x341bc1['verbose']}),_0x92afd7=_0x565ccf[_0x4d1eea(0x20f)],_0x378094=await loadJSONFromOptions(_0x341bc1['addAttributes'],_0x341bc1[_0x4d1eea(0x1d8)]),_0x5d488c=await loadJSONFromOptions(_0x341bc1[_0x4d1eea(0x201)],_0x341bc1[_0x4d1eea(0x2a4)]),_0x30a431={'name':_0x92afd7[_0x4d1eea(0x238)],'description':_0x341bc1[_0x4d1eea(0x2da)]!==undefined?_0x341bc1[_0x4d1eea(0x2da)]:_0x92afd7[_0x4d1eea(0x2da)],'scheduleType':_0x341bc1['scheduleType']!==undefined?_0x341bc1['scheduleType']:_0x92afd7[_0x4d1eea(0x2bb)],'scheduleOption':_0x341bc1[_0x4d1eea(0x29d)]!==undefined?_0x341bc1[_0x4d1eea(0x29d)]:_0x92afd7[_0x4d1eea(0x29d)],'timezone':_0x341bc1[_0x4d1eea(0x2cc)]!==undefined?_0x341bc1[_0x4d1eea(0x2cc)]:_0x92afd7[_0x4d1eea(0x2cc)],'master':_0x92afd7[_0x4d1eea(0x2bc)],'attributes':_0x378094?[..._0x92afd7['attributes']||[],..._0x378094]:_0x92afd7[_0x4d1eea(0x22d)],'behaviors':_0x5d488c?[..._0x92afd7['behaviors']||[],..._0x5d488c]:_0x92afd7[_0x4d1eea(0x2ad)],'customerGroup':_0x92afd7[_0x4d1eea(0x220)]},_0x1b6137=await withSpinner(_0x4d1eea(0x29c)+_0x24d32c+'\x27...',()=>_0x10f15e[_0x4d1eea(0x2c8)]['updateParent'](_0x24d32c,_0x30a431),{'verbose':_0x341bc1[_0x4d1eea(0x289)]}),_0x1d0764=_0x1b6137['data'];return console[_0x4d1eea(0x25a)](_0x4d1eea(0x202)+_0x1d0764[_0x4d1eea(0x238)]+'\x27'),await handleSDKOutput([_0x1d0764],_0x341bc1),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x367de6(0x238)]='segment:parent:pull';[a29_0x367de6(0x2da)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a29_0x367de6(0x271)](_0x40563f){const _0x5f0fa4=a29_0x367de6,{options:_0x527f31,args:_0x321459,tdx:_0x2265e1}=_0x40563f,_0x201d8a=_0x527f31,_0x178bf5=_0x321459[0x0]||_0x527f31['parentSegment'];if(!_0x178bf5)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x5f0fa4(0x28b)),0x1;if(_0x201d8a['use']&&_0x201d8a[_0x5f0fa4(0x2d3)])return console[_0x5f0fa4(0x25a)](a29_0x454280['red'](_0x5f0fa4(0x2c2))),console[_0x5f0fa4(0x25a)](a29_0x454280[_0x5f0fa4(0x1ce)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x5f0fa4(0x25a)](a29_0x454280['dim'](_0x5f0fa4(0x2a9)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x5f0fa4(0x25a)](a29_0x454280[_0x5f0fa4(0x24d)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0xd17662=_0x201d8a[_0x5f0fa4(0x2d3)]||a29_0x31c5f7[_0x5f0fa4(0x265)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x178bf5)+_0x5f0fa4(0x24f));_0x201d8a[_0x5f0fa4(0x289)]&&(console[_0x5f0fa4(0x25a)](_0x5f0fa4(0x2a2)+_0x201d8a[_0x5f0fa4(0x208)]),console['error']('Parent\x20segment:\x20'+_0x178bf5),console[_0x5f0fa4(0x25a)](_0x5f0fa4(0x244)+_0xd17662));const _0x584968=await withSpinner(_0x5f0fa4(0x228)+_0x178bf5+'\x27...',()=>_0x2265e1[_0x5f0fa4(0x2c8)][_0x5f0fa4(0x2b2)](_0x178bf5),{'verbose':_0x201d8a['verbose']}),_0x23e880=_0x584968['data'];if(existsSync(_0xd17662)){const _0x4e47ea=readFileSync(_0xd17662,'utf-8'),_0x26ac58=generateDiff(_0x4e47ea,_0x23e880);if(!hasChanges(_0x26ac58))console[_0x5f0fa4(0x25a)](a29_0x454280['green']('✔')+_0x5f0fa4(0x27d)+a29_0x454280['cyan'](_0xd17662)+_0x5f0fa4(0x2be));else{console[_0x5f0fa4(0x25a)](_0x5f0fa4(0x248)+_0xd17662+'\x27:'),console[_0x5f0fa4(0x25a)]('─'[_0x5f0fa4(0x2de)](0x3c)),console['error'](formatDiffWithColors(_0x26ac58)),console[_0x5f0fa4(0x25a)]('─'[_0x5f0fa4(0x2de)](0x3c));if(!_0x201d8a[_0x5f0fa4(0x1df)]){const _0x3cdd98=await confirmKey('Overwrite\x20\x27'+_0xd17662+'\x27?');if(!_0x3cdd98)return console[_0x5f0fa4(0x25a)](_0x5f0fa4(0x25e)),0x1;}writeFileSync(_0xd17662,_0x23e880,_0x5f0fa4(0x25f)),console['error'](a29_0x454280[_0x5f0fa4(0x297)]('✔')+_0x5f0fa4(0x2ea)+a29_0x454280['cyan'](_0xd17662));}}else{const _0x1355e0=a29_0x31c5f7[_0x5f0fa4(0x1dc)](_0xd17662);!existsSync(_0x1355e0)&&mkdirSync(_0x1355e0,{'recursive':!![]}),writeFileSync(_0xd17662,_0x23e880,_0x5f0fa4(0x25f)),console['error'](a29_0x454280['green']('✔')+_0x5f0fa4(0x2ea)+a29_0x454280[_0x5f0fa4(0x24d)](_0xd17662));}return saveSessionContext({'parent_segment':_0x178bf5},_0x201d8a[_0x5f0fa4(0x2ac)]),console[_0x5f0fa4(0x25a)](a29_0x454280[_0x5f0fa4(0x297)]('✔')+_0x5f0fa4(0x1f6)+a29_0x454280[_0x5f0fa4(0x1ce)](_0x5f0fa4(0x206))+_0x5f0fa4(0x21e)+a29_0x454280[_0x5f0fa4(0x24d)](_0x178bf5)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x2bf);['description']='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0xd82408){const _0x2081ac=a29_0x367de6,{options:_0x2e5ad7,args:_0x7b0c82,tdx:_0xf363e5}=_0xd82408,_0x43db2f=_0x2e5ad7,_0x23afc8=_0x7b0c82[0x0]||_0x2e5ad7[_0x2081ac(0x1f9)];if(!_0x23afc8)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x2081ac(0x2b4)),0x1;const _0x4c0591=resolveYamlFile(_0x23afc8);if(!existsSync(_0x4c0591))return showFileNotFoundError(_0x4c0591,_0x23afc8),0x1;_0x43db2f[_0x2081ac(0x289)]&&(console['error'](_0x2081ac(0x2a2)+_0x43db2f[_0x2081ac(0x208)]),console[_0x2081ac(0x25a)](_0x2081ac(0x285)+_0x4c0591));let _0x3ff4fd;try{_0x3ff4fd=readFileSync(_0x4c0591,_0x2081ac(0x25f));}catch(_0x1b2e3f){const _0x2e8026=_0x1b2e3f instanceof Error?_0x1b2e3f[_0x2081ac(0x1cd)]:String(_0x1b2e3f);return console['error'](_0x2081ac(0x21b)+_0x2e8026),0x1;}const _0x5997cf=await withSpinner(_0x2081ac(0x26b),()=>_0xf363e5[_0x2081ac(0x2c8)][_0x2081ac(0x1d4)](_0x3ff4fd),{'verbose':_0x43db2f[_0x2081ac(0x289)]}),_0x56d3b2=_0x5997cf[_0x2081ac(0x20f)],{isNew:_0x2256fc,name:_0x507cc4,hasChanges:_0x216d9d,diffFormatted:_0xd88ebb}=_0x56d3b2;if(!_0x216d9d)return console[_0x2081ac(0x25a)](_0x2081ac(0x2e1)+_0x507cc4+_0x2081ac(0x229)),0x0;_0x2256fc?console[_0x2081ac(0x25a)](_0x2081ac(0x278)+_0x507cc4+'\x27:'):console[_0x2081ac(0x25a)](_0x2081ac(0x1fe)+_0x507cc4+'\x27:');console[_0x2081ac(0x25a)]('─'[_0x2081ac(0x2de)](0x3c)),console[_0x2081ac(0x25a)](_0xd88ebb),console['error']('─'[_0x2081ac(0x2de)](0x3c));const _0x4d160a=_0x2256fc?_0x2081ac(0x26e)+_0x507cc4+'\x27?':_0x2081ac(0x270)+_0x507cc4+'\x27?';if(!_0x43db2f[_0x2081ac(0x1df)]){const _0x594701=await confirmKey(_0x4d160a);if(!_0x594701)return console[_0x2081ac(0x25a)](_0x2081ac(0x25e)),0x1;}const _0x44ee7d=_0x2256fc?_0x2081ac(0x1db):'Updating',_0x22c2d6=await withSpinner(_0x44ee7d+_0x2081ac(0x2e3)+_0x507cc4+_0x2081ac(0x284),()=>_0x56d3b2[_0x2081ac(0x247)](),{'verbose':_0x43db2f['verbose']}),_0x34fb6f=_0x22c2d6[_0x2081ac(0x20f)],_0x4d3e72=getConsoleNextUrl(_0x43db2f[_0x2081ac(0x208)],_0x2081ac(0x1ff)+_0x34fb6f['id']),_0x47c89c=_0x2256fc?_0x2081ac(0x1cf):'Updated';return console[_0x2081ac(0x25a)]('✔\x20'+_0x47c89c+_0x2081ac(0x2e3)+_0x34fb6f['name']+'\x27'),console[_0x2081ac(0x25a)]('\x20\x20'+_0x4d3e72),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x1f2);[a29_0x367de6(0x2da)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async['execute'](_0x23648d){const _0x517b24=a29_0x367de6,{options:_0x5a4fd6,args:_0x3943ed,tdx:_0x151307}=_0x23648d,_0x2ddf53=_0x5a4fd6,_0x5de2b9=_0x3943ed[0x0]||_0x5a4fd6[_0x517b24(0x1f9)];if(!_0x5de2b9)return showParentSegmentNotSetError(_0x517b24(0x240)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x517b24(0x24e)+_0x517b24(0x1f0)+_0x517b24(0x23f)+_0x517b24(0x242)),0x1;const _0x2f9441=resolveYamlFile(_0x5de2b9);if(!existsSync(_0x2f9441))return showFileNotFoundError(_0x2f9441,_0x5de2b9),0x1;_0x2ddf53[_0x517b24(0x289)]&&(console[_0x517b24(0x25a)](_0x517b24(0x2a2)+_0x2ddf53[_0x517b24(0x208)]),console[_0x517b24(0x25a)]('YAML\x20file:\x20'+_0x2f9441));let _0x3206b0;try{_0x3206b0=readFileSync(_0x2f9441,_0x517b24(0x25f));}catch(_0x41aea0){const _0x15ce8f=_0x41aea0 instanceof Error?_0x41aea0['message']:String(_0x41aea0);return console['error'](_0x517b24(0x21b)+_0x15ce8f),0x1;}const _0x43e5c0=createCommandSpinner(a29_0x454280[_0x517b24(0x1ce)](_0x517b24(0x224)),{'verbose':_0x2ddf53['verbose']});_0x43e5c0['start']();const _0x3c7786={'onProgress':_0x4f9be6=>{const _0x4bfd6e=_0x517b24;_0x43e5c0[_0x4bfd6e(0x26d)]=formatProgressMessage(_0x4f9be6);}};if(_0x2ddf53[_0x517b24(0x2bc)])_0x3c7786[_0x517b24(0x2bc)]=!![];if(_0x2ddf53[_0x517b24(0x2e9)])_0x3c7786['enriched']=!![];_0x2ddf53[_0x517b24(0x246)]&&(_0x3c7786['attribute']=_0x2ddf53[_0x517b24(0x246)]);_0x2ddf53['behavior']&&(_0x3c7786['behavior']=_0x2ddf53[_0x517b24(0x293)]);if(_0x2ddf53[_0x517b24(0x1ef)])_0x3c7786[_0x517b24(0x1ef)]=_0x2ddf53[_0x517b24(0x1ef)];let _0x350c60;try{_0x350c60=await _0x151307['segment'][_0x517b24(0x1f7)](_0x3206b0,_0x3c7786),_0x43e5c0['stop']();}catch(_0x275b6d){_0x43e5c0[_0x517b24(0x1e9)]();throw _0x275b6d;}const _0x4c2c76=_0x2ddf53['interval']||_0x517b24(0x1f3);return this['displayValidateResults'](_0x350c60,_0x3c7786,_0x2f9441,_0x4c2c76),_0x350c60[_0x517b24(0x2cf)]?0x0:0x1;}[a29_0x367de6(0x2b3)](_0x4c428f,_0x36cc2a,_0x421fc4,_0x458b6b){const _0x29b8bc=a29_0x367de6;console['error']('\x0a'+a29_0x454280[_0x29b8bc(0x245)](_0x29b8bc(0x1ea))+'\x20'+_0x4c428f['name']),console['error']('═'[_0x29b8bc(0x2de)](0x3c)),this[_0x29b8bc(0x2b1)](_0x4c428f);if(typeof _0x36cc2a[_0x29b8bc(0x246)]==='string'){this[_0x29b8bc(0x2a1)](_0x4c428f),this['displaySummary'](_0x4c428f),this[_0x29b8bc(0x1d3)](_0x421fc4,_0x458b6b,_0x29b8bc(0x246),_0x36cc2a[_0x29b8bc(0x246)]);return;}if(_0x36cc2a[_0x29b8bc(0x246)]===!![]){this[_0x29b8bc(0x2a1)](_0x4c428f),this['displaySummary'](_0x4c428f),this[_0x29b8bc(0x1d3)](_0x421fc4,_0x458b6b,'attributes');return;}if(typeof _0x36cc2a[_0x29b8bc(0x293)]===_0x29b8bc(0x28c)){this[_0x29b8bc(0x299)](_0x4c428f,_0x458b6b),this[_0x29b8bc(0x1fd)](_0x4c428f),this['displayPreviewHints'](_0x421fc4,_0x458b6b,_0x29b8bc(0x293),_0x36cc2a['behavior']);return;}if(_0x36cc2a[_0x29b8bc(0x293)]===!![]){this[_0x29b8bc(0x299)](_0x4c428f,_0x458b6b),this['displaySummary'](_0x4c428f),this['displayPreviewHints'](_0x421fc4,_0x458b6b,_0x29b8bc(0x2ad));return;}this['displayAttributesStats'](_0x4c428f),this['displayBehaviorsStats'](_0x4c428f,_0x458b6b),this[_0x29b8bc(0x1fd)](_0x4c428f),this[_0x29b8bc(0x1d3)](_0x421fc4,_0x458b6b,_0x29b8bc(0x2b5));}[a29_0x367de6(0x1d3)](_0x2fd187,_0x4bea79,_0x47dbf6,_0x29538a){const _0x45c4e1=a29_0x367de6;console[_0x45c4e1(0x25a)]('\x0a'+a29_0x454280['dim']('To\x20view\x20sample\x20data:'));const _0x46923d=_0x4bea79!==_0x45c4e1(0x1f3)?_0x45c4e1(0x291)+_0x4bea79:'';if(_0x47dbf6==='attribute'&&_0x29538a)console[_0x45c4e1(0x25a)]('\x20\x20'+a29_0x454280['dim'](_0x45c4e1(0x274)+_0x2fd187+'\x20--attribute\x20\x22'+_0x29538a+'\x22'+_0x46923d));else{if(_0x47dbf6===_0x45c4e1(0x293)&&_0x29538a)console[_0x45c4e1(0x25a)]('\x20\x20'+a29_0x454280[_0x45c4e1(0x1ce)](_0x45c4e1(0x274)+_0x2fd187+_0x45c4e1(0x1e6)+_0x29538a+'\x22'+_0x46923d));else(_0x47dbf6===_0x45c4e1(0x22d)||_0x47dbf6==='all')&&console[_0x45c4e1(0x25a)]('\x20\x20'+a29_0x454280[_0x45c4e1(0x1ce)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2fd187+_0x45c4e1(0x1fa)+_0x46923d));}(_0x47dbf6===_0x45c4e1(0x2ad)||_0x47dbf6===_0x45c4e1(0x2b5))&&console['error']('\x20\x20'+a29_0x454280['dim'](_0x45c4e1(0x274)+_0x2fd187+_0x45c4e1(0x216)+_0x46923d)),_0x47dbf6===_0x45c4e1(0x2b5)&&console[_0x45c4e1(0x25a)]('\x20\x20'+a29_0x454280['dim'](_0x45c4e1(0x274)+_0x2fd187+_0x45c4e1(0x2c6)+_0x46923d));}[a29_0x367de6(0x2b1)](_0x280b69){const _0x6fdaf6=a29_0x367de6,{master:_0x25f3c9}=_0x280b69,_0x240777=_0x25f3c9[_0x6fdaf6(0x232)]?a29_0x454280[_0x6fdaf6(0x297)]('✔'):a29_0x454280[_0x6fdaf6(0x282)]('✘');console[_0x6fdaf6(0x25a)]('\x0a'+a29_0x454280[_0x6fdaf6(0x1ce)]('Master\x20Table')),console[_0x6fdaf6(0x25a)](_0x240777+'\x20'+a29_0x454280[_0x6fdaf6(0x245)](_0x25f3c9[_0x6fdaf6(0x26c)]+'.'+_0x25f3c9[_0x6fdaf6(0x2b9)])),_0x25f3c9['schemaValid']?_0x25f3c9[_0x6fdaf6(0x2cd)]!==undefined&&console['error']('\x20\x20'+a29_0x454280['dim'](_0x6fdaf6(0x1e4))+'\x20'+a29_0x454280[_0x6fdaf6(0x24d)](formatRows(_0x25f3c9[_0x6fdaf6(0x2cd)]))):console[_0x6fdaf6(0x25a)]('\x20\x20'+a29_0x454280[_0x6fdaf6(0x282)]('Error:')+'\x20'+_0x25f3c9[_0x6fdaf6(0x2ec)]);}[a29_0x367de6(0x2a1)](_0x35a044){const _0x56db89=a29_0x367de6;if(_0x35a044['attributes'][_0x56db89(0x292)]===0x0)return;console[_0x56db89(0x25a)]('\x0a'+a29_0x454280[_0x56db89(0x1ce)](_0x56db89(0x273)));for(const _0x140bbc of _0x35a044[_0x56db89(0x22d)]){const _0x29e85b=_0x140bbc[_0x56db89(0x232)]?a29_0x454280[_0x56db89(0x297)]('✔'):a29_0x454280['red']('✘');let _0x43c67e='';if(_0x140bbc[_0x56db89(0x232)]&&_0x140bbc['matchedCount']!==undefined&&_0x140bbc['coveragePercent']!==undefined){const _0x57379b=_0x140bbc[_0x56db89(0x1e2)]['toFixed'](0x1),_0x188fb8=_0x140bbc[_0x56db89(0x1e2)]>=0x50?a29_0x454280['green']:_0x140bbc[_0x56db89(0x1e2)]>=0x32?a29_0x454280[_0x56db89(0x260)]:a29_0x454280[_0x56db89(0x282)];_0x43c67e='\x20'+a29_0x454280[_0x56db89(0x1ce)]('Coverage:')+'\x20'+_0x188fb8(_0x57379b+'%')+'\x20('+formatRows(_0x140bbc[_0x56db89(0x2e0)])+_0x56db89(0x222);}console[_0x56db89(0x25a)](_0x29e85b+'\x20'+a29_0x454280[_0x56db89(0x245)](_0x140bbc[_0x56db89(0x238)])+_0x43c67e),console[_0x56db89(0x25a)]('\x20\x20'+a29_0x454280[_0x56db89(0x1ce)]('Source:')+'\x20'+a29_0x454280['bold'](_0x140bbc[_0x56db89(0x26c)]+'.'+_0x140bbc[_0x56db89(0x2b9)]));const _0x1dbd57=_0x140bbc[_0x56db89(0x2aa)]===_0x140bbc[_0x56db89(0x250)]?a29_0x454280[_0x56db89(0x1ce)](_0x56db89(0x2ae))+'\x20'+_0x140bbc[_0x56db89(0x2aa)]:a29_0x454280[_0x56db89(0x1ce)](_0x56db89(0x28e))+'\x20'+_0x140bbc[_0x56db89(0x2aa)]+_0x56db89(0x21e)+_0x140bbc[_0x56db89(0x250)];console['error']('\x20\x20'+_0x1dbd57),console['error']('\x20\x20'+a29_0x454280[_0x56db89(0x1ce)](_0x56db89(0x262))),this[_0x56db89(0x27c)](_0x140bbc[_0x56db89(0x1f4)]),!_0x140bbc[_0x56db89(0x232)]&&console['error']('\x20\x20'+a29_0x454280[_0x56db89(0x282)]('Error:')+'\x20'+_0x140bbc[_0x56db89(0x2ec)]);}}[a29_0x367de6(0x299)](_0x4859f4,_0x333efd){const _0x581163=a29_0x367de6;if(_0x4859f4[_0x581163(0x2ad)][_0x581163(0x292)]===0x0)return;console['error']('\x0a'+a29_0x454280[_0x581163(0x1ce)](_0x581163(0x2c5))+'\x20'+a29_0x454280[_0x581163(0x1ce)]('('+_0x333efd+')'));for(const _0x2d2313 of _0x4859f4[_0x581163(0x2ad)]){const _0x470386=_0x2d2313[_0x581163(0x232)]?a29_0x454280['green']('✔'):a29_0x454280['red']('✘');let _0x4d956d='';if(_0x2d2313[_0x581163(0x232)]&&_0x2d2313['customersWithEvents']!==undefined&&_0x2d2313[_0x581163(0x231)]!==undefined){const _0xa4b1ba=_0x2d2313[_0x581163(0x2c1)]?.[_0x581163(0x275)](0x1)||'?',_0x4256ca=(_0x2d2313[_0x581163(0x2c1)]??0x0)>=0x32?a29_0x454280[_0x581163(0x297)]:(_0x2d2313[_0x581163(0x2c1)]??0x0)>=0x14?a29_0x454280['yellow']:a29_0x454280[_0x581163(0x282)];_0x4d956d='\x20'+a29_0x454280[_0x581163(0x1ce)](_0x581163(0x280))+'\x20'+_0x4256ca(formatRows(_0x2d2313[_0x581163(0x22e)]))+'\x20('+_0xa4b1ba+_0x581163(0x2bd)+a29_0x454280[_0x581163(0x1ce)](_0x581163(0x28a))+'\x20'+a29_0x454280[_0x581163(0x24d)](formatRows(_0x2d2313['totalEvents']));}console['error'](_0x470386+'\x20'+a29_0x454280[_0x581163(0x245)](_0x2d2313[_0x581163(0x238)])+_0x4d956d),console[_0x581163(0x25a)]('\x20\x20'+a29_0x454280[_0x581163(0x1ce)](_0x581163(0x23b))+'\x20'+a29_0x454280[_0x581163(0x245)](_0x2d2313[_0x581163(0x26c)]+'.'+_0x2d2313['table']));const _0x567b64=_0x2d2313[_0x581163(0x2aa)]===_0x2d2313['foreignKey']?a29_0x454280[_0x581163(0x1ce)](_0x581163(0x2ae))+'\x20'+_0x2d2313['joinKey']:a29_0x454280[_0x581163(0x1ce)](_0x581163(0x28e))+'\x20'+_0x2d2313[_0x581163(0x2aa)]+'\x20=\x20'+_0x2d2313[_0x581163(0x250)];console[_0x581163(0x25a)]('\x20\x20'+_0x567b64),console[_0x581163(0x25a)]('\x20\x20'+a29_0x454280[_0x581163(0x1ce)]('Columns:')),this[_0x581163(0x27c)](_0x2d2313['columns']),!_0x2d2313[_0x581163(0x232)]&&console[_0x581163(0x25a)]('\x20\x20'+a29_0x454280[_0x581163(0x282)](_0x581163(0x223))+'\x20'+_0x2d2313['schemaError']);}}[a29_0x367de6(0x27c)](_0x5032f7){const _0x418b3c=a29_0x367de6;for(const _0x8ae6a of _0x5032f7){_0x8ae6a['label']===_0x8ae6a[_0x418b3c(0x2c9)]||_0x8ae6a[_0x418b3c(0x2c9)]==='*'?console[_0x418b3c(0x25a)](_0x418b3c(0x1d5)+_0x8ae6a[_0x418b3c(0x233)]):console['error']('\x20\x20\x20\x20-\x20'+_0x8ae6a[_0x418b3c(0x233)]+'\x20'+a29_0x454280[_0x418b3c(0x1ce)]('('+_0x8ae6a['column']+')'));}}['displaySummary'](_0x2aed15){const _0x4bb93e=a29_0x367de6;console[_0x4bb93e(0x25a)]('─'[_0x4bb93e(0x2de)](0x3c));if(_0x2aed15['errors']['length']>0x0){console[_0x4bb93e(0x25a)]('\x0a'+a29_0x454280[_0x4bb93e(0x282)](_0x4bb93e(0x1d7)));for(const _0xe773df of _0x2aed15[_0x4bb93e(0x29b)]){console['error']('\x20\x20'+a29_0x454280[_0x4bb93e(0x282)]('•')+'\x20'+_0xe773df);}}_0x2aed15[_0x4bb93e(0x2cf)]&&console[_0x4bb93e(0x25a)]('\x0a'+a29_0x454280[_0x4bb93e(0x297)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x25c);[a29_0x367de6(0x2da)]=a29_0x367de6(0x283);async[a29_0x367de6(0x271)](_0x54113a){const _0x1ddd85=a29_0x367de6,{options:_0x27edfb,args:_0x47d8dc,tdx:_0x213423}=_0x54113a,_0x47e210=_0x27edfb,_0x5a45a0=_0x47d8dc[0x0]||_0x27edfb[_0x1ddd85(0x1f9)];if(!_0x5a45a0)return showParentSegmentNotSetError(_0x1ddd85(0x1e3)+_0x1ddd85(0x239)+'Options\x20(one\x20required):\x0a'+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x1ddd85(0x203)+_0x1ddd85(0x1ee)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x1ddd85(0x242)),0x1;if(!_0x47e210[_0x1ddd85(0x2bc)]&&!_0x47e210[_0x1ddd85(0x246)]&&!_0x47e210[_0x1ddd85(0x293)]&&!_0x47e210[_0x1ddd85(0x2e9)])return console[_0x1ddd85(0x25a)](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x209))),console[_0x1ddd85(0x25a)](_0x1ddd85(0x2c4)),console[_0x1ddd85(0x25a)](_0x1ddd85(0x2b7)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x1ddd85(0x25a)](_0x1ddd85(0x211)),console[_0x1ddd85(0x25a)](_0x1ddd85(0x296)),console[_0x1ddd85(0x25a)](_0x1ddd85(0x294)),0x1;const _0x286ab2=resolveYamlFile(_0x5a45a0);if(!existsSync(_0x286ab2))return showFileNotFoundError(_0x286ab2,_0x5a45a0),0x1;_0x47e210[_0x1ddd85(0x289)]&&(console[_0x1ddd85(0x25a)](_0x1ddd85(0x2a2)+_0x47e210[_0x1ddd85(0x208)]),console[_0x1ddd85(0x25a)]('YAML\x20file:\x20'+_0x286ab2));let _0x41f09a;try{_0x41f09a=readFileSync(_0x286ab2,_0x1ddd85(0x25f));}catch(_0x1676cd){const _0x38a59a=_0x1676cd instanceof Error?_0x1676cd[_0x1ddd85(0x1cd)]:String(_0x1676cd);return console['error']('Error\x20reading\x20file:\x20'+_0x38a59a),0x1;}let _0x591780;try{_0x591780=parseYamlString(_0x41f09a);}catch(_0x439848){const _0x2d2dad=_0x439848 instanceof Error?_0x439848[_0x1ddd85(0x1cd)]:String(_0x439848);return console[_0x1ddd85(0x25a)](a29_0x454280['red'](_0x1ddd85(0x2e2)+_0x2d2dad)),0x1;}if(_0x47e210[_0x1ddd85(0x246)]===!![]||_0x47e210[_0x1ddd85(0x246)]===''){const _0x35de20=_0x591780[_0x1ddd85(0x22d)]?.[_0x1ddd85(0x236)](_0x22b462=>_0x22b462[_0x1ddd85(0x238)])||[];if(_0x35de20[_0x1ddd85(0x292)]===0x0)console['error'](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x1d2)));else{console[_0x1ddd85(0x25a)](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x2d6))),console[_0x1ddd85(0x25a)]('Available\x20attributes:');for(const _0x275ddd of _0x35de20){console[_0x1ddd85(0x25a)]('\x20\x20'+a29_0x454280[_0x1ddd85(0x24d)](_0x275ddd));}console[_0x1ddd85(0x25a)](_0x1ddd85(0x2e5)+_0x5a45a0+'\x20--attribute\x20\x22'+_0x35de20[0x0]+'\x22');}return 0x1;}if(_0x47e210[_0x1ddd85(0x293)]===!![]||_0x47e210[_0x1ddd85(0x293)]===''){const _0x5b30d4=_0x591780['behaviors']?.[_0x1ddd85(0x236)](_0x481a44=>_0x481a44[_0x1ddd85(0x238)])||[];if(_0x5b30d4[_0x1ddd85(0x292)]===0x0)console[_0x1ddd85(0x25a)](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x1d9)));else{console[_0x1ddd85(0x25a)](a29_0x454280[_0x1ddd85(0x282)](_0x1ddd85(0x21a))),console['error']('Available\x20behaviors:');for(const _0x2636e8 of _0x5b30d4){console[_0x1ddd85(0x25a)]('\x20\x20'+a29_0x454280['cyan'](_0x2636e8));}console[_0x1ddd85(0x25a)](_0x1ddd85(0x2e5)+_0x5a45a0+_0x1ddd85(0x1e6)+_0x5b30d4[0x0]+'\x22');}return 0x1;}const _0xd31eb9=createCommandSpinner(a29_0x454280[_0x1ddd85(0x1ce)](_0x1ddd85(0x2b6)),{'verbose':_0x47e210[_0x1ddd85(0x289)]});_0xd31eb9['start']();const _0x184d15={'onProgress':_0xaef133=>{const _0x67d70c=_0x1ddd85;_0xd31eb9[_0x67d70c(0x26d)]=formatProgressMessage(_0xaef133);}};if(_0x47e210[_0x1ddd85(0x2bc)])_0x184d15[_0x1ddd85(0x2bc)]=!![];if(_0x47e210[_0x1ddd85(0x246)]&&typeof _0x47e210[_0x1ddd85(0x246)]==='string')_0x184d15[_0x1ddd85(0x246)]=_0x47e210[_0x1ddd85(0x246)];if(_0x47e210['behavior']&&typeof _0x47e210['behavior']===_0x1ddd85(0x28c))_0x184d15[_0x1ddd85(0x293)]=_0x47e210['behavior'];if(_0x47e210[_0x1ddd85(0x2e9)])_0x184d15['enriched']=!![];if(_0x47e210[_0x1ddd85(0x1ef)])_0x184d15['interval']=_0x47e210[_0x1ddd85(0x1ef)];let _0x2cd29e;try{_0x2cd29e=await _0x213423[_0x1ddd85(0x2c8)]['previewParentYaml'](_0x41f09a,_0x184d15),_0xd31eb9['stop']();}catch(_0x594dec){_0xd31eb9[_0x1ddd85(0x1e9)]();throw _0x594dec;}return await this[_0x1ddd85(0x254)](_0x2cd29e,{'master':_0x47e210['master'],'attribute':typeof _0x47e210[_0x1ddd85(0x246)]===_0x1ddd85(0x28c)?_0x47e210[_0x1ddd85(0x246)]:undefined,'behavior':typeof _0x47e210[_0x1ddd85(0x293)]==='string'?_0x47e210[_0x1ddd85(0x293)]:undefined,'enriched':_0x47e210[_0x1ddd85(0x2e9)]}),_0x2cd29e[_0x1ddd85(0x2cf)]?0x0:0x1;}async[a29_0x367de6(0x254)](_0x5d1272,_0x26d6ff){const _0x2b0b87=a29_0x367de6;console[_0x2b0b87(0x25a)]('\x0a'+a29_0x454280['bold'](_0x2b0b87(0x252))+'\x20'+_0x5d1272[_0x2b0b87(0x238)]),console['error']('═'['repeat'](0x3c));if(_0x26d6ff[_0x2b0b87(0x2bc)]&&_0x5d1272['sampleData']){const _0x5bf4f=a29_0x454280['dim']('Master:')+'\x20'+a29_0x454280[_0x2b0b87(0x245)](_0x5d1272[_0x2b0b87(0x2bc)][_0x2b0b87(0x26c)]+'.'+_0x5d1272['master'][_0x2b0b87(0x2b9)]);await this[_0x2b0b87(0x218)](_0x5bf4f,_0x5d1272['sampleData']);}else{if(_0x26d6ff[_0x2b0b87(0x246)]&&_0x5d1272[_0x2b0b87(0x1f8)]){const _0x1bfc8d=a29_0x454280[_0x2b0b87(0x1ce)](_0x2b0b87(0x2a3))+'\x20'+a29_0x454280[_0x2b0b87(0x245)](_0x26d6ff[_0x2b0b87(0x246)]);await this[_0x2b0b87(0x218)](_0x1bfc8d,_0x5d1272[_0x2b0b87(0x1f8)]);}else{if(_0x26d6ff[_0x2b0b87(0x293)]&&_0x5d1272[_0x2b0b87(0x1f8)]){const _0x275b17=a29_0x454280[_0x2b0b87(0x1ce)](_0x2b0b87(0x2e7))+'\x20'+a29_0x454280[_0x2b0b87(0x245)](_0x26d6ff[_0x2b0b87(0x293)]);await this['displaySampleData'](_0x275b17,_0x5d1272[_0x2b0b87(0x1f8)]);}else{if(_0x26d6ff[_0x2b0b87(0x2e9)]&&_0x5d1272[_0x2b0b87(0x1f8)]){const _0x5b564a=a29_0x454280[_0x2b0b87(0x1ce)](_0x2b0b87(0x295))+'\x20'+a29_0x454280[_0x2b0b87(0x245)](_0x2b0b87(0x1cb));await this[_0x2b0b87(0x218)](_0x5b564a,_0x5d1272[_0x2b0b87(0x1f8)]);}else!_0x5d1272[_0x2b0b87(0x1f8)]&&console[_0x2b0b87(0x25a)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x5d1272[_0x2b0b87(0x29b)][_0x2b0b87(0x292)]>0x0){console[_0x2b0b87(0x25a)]('─'[_0x2b0b87(0x2de)](0x3c)),console[_0x2b0b87(0x25a)]('\x0a'+a29_0x454280[_0x2b0b87(0x282)](_0x2b0b87(0x1d7)));for(const _0x43db05 of _0x5d1272['errors']){console[_0x2b0b87(0x25a)]('\x20\x20'+a29_0x454280[_0x2b0b87(0x282)]('•')+'\x20'+_0x43db05);}}}async[a29_0x367de6(0x218)](_0x3a4241,_0x4d6b96){const _0x20ab14=a29_0x367de6;if(_0x4d6b96[_0x20ab14(0x292)]===0x0){console[_0x20ab14(0x25a)]('\x0a'+_0x3a4241),console[_0x20ab14(0x25a)](_0x20ab14(0x281));return;}console[_0x20ab14(0x25a)]('\x0a'+_0x3a4241);const _0x5ca5a4=Object['keys'](_0x4d6b96[0x0])[_0x20ab14(0x236)](_0x50308f=>({'name':_0x50308f,'type':typeof _0x4d6b96[0x0][_0x50308f]==='number'?_0x20ab14(0x1ec):_0x20ab14(0x286)})),_0x4091f3={'queryId':_0x20ab14(0x227),'columns':_0x5ca5a4,'data':_0x4d6b96,'stats':{'state':_0x20ab14(0x1ed),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4d6b96[_0x20ab14(0x292)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x31f301=formatAsTable(_0x4091f3,_0x4d6b96[_0x20ab14(0x292)],!![]);await writeOutput(_0x31f301,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a29_0x367de6(0x230);[a29_0x367de6(0x2da)]=a29_0x367de6(0x2a6);async[a29_0x367de6(0x271)](_0x34ed95){const _0x310db8=a29_0x367de6,{options:_0x19f8ed,args:_0x25e149,tdx:_0x2d2d62}=_0x34ed95,_0x2413fa=_0x19f8ed,_0x487adc=_0x25e149[0x0]||_0x19f8ed['parentSegment'];if(!_0x487adc)return showParentSegmentNotSetError(_0x310db8(0x2dd)+_0x310db8(0x1e7)),0x1;const _0x1256c2=resolveYamlFile(_0x487adc);if(existsSync(_0x1256c2)){_0x2413fa['verbose']&&console['error']('Found\x20YAML\x20file:\x20'+_0x1256c2);let _0x131a94;try{_0x131a94=readFileSync(_0x1256c2,_0x310db8(0x25f));}catch(_0x5450ae){const _0x203dbd=_0x5450ae instanceof Error?_0x5450ae[_0x310db8(0x1cd)]:String(_0x5450ae);return console[_0x310db8(0x25a)](_0x310db8(0x21b)+_0x203dbd),0x1;}const _0x13499c=await withSpinner(_0x310db8(0x26b),()=>_0x2d2d62['segment'][_0x310db8(0x1d4)](_0x131a94),{'verbose':_0x2413fa[_0x310db8(0x289)]}),_0x26900f=_0x13499c[_0x310db8(0x20f)],{isNew:_0x57a733,name:_0x3bc031,hasChanges:_0x1e9900,diffFormatted:_0x3ae6c8}=_0x26900f;if(_0x1e9900){_0x57a733?console[_0x310db8(0x25a)](_0x310db8(0x278)+_0x3bc031+'\x27:'):console[_0x310db8(0x25a)](_0x310db8(0x1fe)+_0x3bc031+'\x27:');console[_0x310db8(0x25a)]('─'[_0x310db8(0x2de)](0x3c)),console['error'](_0x3ae6c8),console['error']('─'[_0x310db8(0x2de)](0x3c));const _0x19aaa2=_0x57a733?'Create\x20parent\x20segment\x20\x27'+_0x3bc031+'\x27\x20and\x20run\x20workflow?':'Apply\x20changes\x20to\x20\x27'+_0x3bc031+_0x310db8(0x2e6);if(!_0x2413fa[_0x310db8(0x1df)]){const _0x522aaa=await confirmKey(_0x19aaa2);if(!_0x522aaa)return console[_0x310db8(0x25a)](_0x310db8(0x25e)),0x1;}const _0x3e542a=_0x57a733?'Creating':_0x310db8(0x2ca);await withSpinner(_0x3e542a+'\x20parent\x20segment\x20\x27'+_0x3bc031+_0x310db8(0x284),()=>_0x26900f['apply'](),{'verbose':_0x2413fa[_0x310db8(0x289)]});const _0x1c2d95=_0x57a733?_0x310db8(0x1cf):_0x310db8(0x200);console[_0x310db8(0x25a)]('✔\x20'+_0x1c2d95+_0x310db8(0x2e3)+_0x3bc031+'\x27');}else console[_0x310db8(0x25a)]('✔\x20No\x20changes\x20-\x20\x27'+_0x3bc031+_0x310db8(0x2b8));}const _0x1a5a9e=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x487adc+_0x310db8(0x284),()=>_0x2d2d62[_0x310db8(0x2c8)][_0x310db8(0x26f)](_0x487adc),{'verbose':_0x2413fa[_0x310db8(0x289)]}),_0x2bf4d0=_0x1a5a9e['data'],_0x5af76c=getConsoleUrl(_0x2413fa['site'],'/app/workflows/'+_0x2bf4d0[_0x310db8(0x263)]+'/sessions/'+_0x2bf4d0['workflowSessionId']+_0x310db8(0x219)+_0x2bf4d0[_0x310db8(0x1d0)]);return console[_0x310db8(0x25a)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a29_0x454280['dim'](_0x310db8(0x28f))+'\x20'+_0x2bf4d0[_0x310db8(0x2a8)]),console[_0x310db8(0x25a)]('\x20\x20'+a29_0x454280[_0x310db8(0x1ce)](_0x310db8(0x2d5))+'\x20'+_0x2bf4d0[_0x310db8(0x221)]),console[_0x310db8(0x25a)]('\x20\x20'+a29_0x454280['dim'](_0x310db8(0x2ce))+'\x20'+_0x2bf4d0[_0x310db8(0x23c)]),console[_0x310db8(0x25a)]('\x20\x20'+a29_0x454280[_0x310db8(0x1ce)](_0x310db8(0x204))+'\x20'+_0x2bf4d0['workflowAttemptId']),console['error']('\x20\x20'+_0x5af76c),console['error']('\x0a'+a29_0x454280[_0x310db8(0x1ce)](_0x310db8(0x1dd))+'\x20tdx\x20wf\x20attempt\x20'+_0x2bf4d0[_0x310db8(0x1d0)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x27f);['description']=a29_0x367de6(0x276);async[a29_0x367de6(0x271)](_0x9bb77f){const _0x106bac=a29_0x367de6,{options:_0x29b628,args:_0x172ea2,tdx:_0x1aad51}=_0x9bb77f,_0x1c893f=_0x172ea2[0x0]||_0x29b628[_0x106bac(0x1f9)];if(!_0x1c893f)return showParentSegmentNotSetError(_0x106bac(0x2d1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x29b628['verbose']&&(console[_0x106bac(0x25a)](_0x106bac(0x2a2)+_0x29b628[_0x106bac(0x208)]),console[_0x106bac(0x25a)]('Parent\x20segment:\x20'+_0x1c893f));const _0xc66827=await withSpinner(_0x106bac(0x20c)+_0x1c893f+_0x106bac(0x284),()=>_0x1aad51[_0x106bac(0x2c8)]['listFields'](_0x1c893f),{'verbose':_0x29b628[_0x106bac(0x289)]}),_0x3621eb=_0xc66827['data'];console['error'](_0x106bac(0x215)+_0x3621eb[_0x106bac(0x292)]+_0x106bac(0x2d0)+(_0x3621eb[_0x106bac(0x292)]!==0x1?'s':''));if(_0x29b628[_0x106bac(0x20d)]||_0x29b628[_0x106bac(0x251)])return await handleSDKOutput(_0x3621eb,_0x29b628),0x0;return displayFieldsHumanReadable(_0x3621eb,_0x1c893f),0x0;}}function a29_0x5e17(_0x1f2980,_0x119c28){_0x1f2980=_0x1f2980-0x1cb;const _0x49f3df=a29_0x49f3();let _0x5e17ff=_0x49f3df[_0x1f2980];return _0x5e17ff;}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x217);[a29_0x367de6(0x2da)]='Show\x20parent\x20segment\x20details';async[a29_0x367de6(0x271)](_0x290cdd){const _0x11d7f0=a29_0x367de6,{options:_0x239753,args:_0x23f245,tdx:_0x16cc9a}=_0x290cdd,_0x43067c=_0x239753,_0x2b122b=_0x23f245[0x0]||_0x239753[_0x11d7f0(0x1f9)];if(!_0x2b122b)return showParentSegmentNotSetError(_0x11d7f0(0x288)+_0x11d7f0(0x25b)+'Options:\x0a'+_0x11d7f0(0x2eb)),0x1;_0x239753[_0x11d7f0(0x289)]&&(console['error'](_0x11d7f0(0x2a2)+_0x239753[_0x11d7f0(0x208)]),console[_0x11d7f0(0x25a)](_0x11d7f0(0x2a0)+_0x2b122b));const _0x9eeb2b=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2b122b+_0x11d7f0(0x284),()=>_0x16cc9a[_0x11d7f0(0x2c8)][_0x11d7f0(0x214)](_0x2b122b),{'verbose':_0x239753['verbose']}),_0x4aaab2=_0x9eeb2b[_0x11d7f0(0x20f)];if(_0x43067c[_0x11d7f0(0x26a)]){const _0x5e7eb5=getConsoleNextUrl(_0x43067c[_0x11d7f0(0x208)],_0x11d7f0(0x1ff)+_0x4aaab2['id']);return console[_0x11d7f0(0x25a)](a29_0x454280[_0x11d7f0(0x297)]('✔')+_0x11d7f0(0x257)+a29_0x454280['cyan'](_0x5e7eb5)),openBrowser(_0x5e7eb5),0x0;}return await handleSingleObjectOutput(_0x4aaab2,_0x239753),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x261);[a29_0x367de6(0x2da)]=a29_0x367de6(0x213);async[a29_0x367de6(0x271)](_0x18b924){const _0x2c97ad=a29_0x367de6,{options:_0x55cee5,args:_0x569e85,tdx:_0x57cddb}=_0x18b924,_0x7cfa5=_0x569e85[0x0]||_0x55cee5[_0x2c97ad(0x1f9)];if(!_0x7cfa5)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+_0x2c97ad(0x21d)),0x1;_0x55cee5[_0x2c97ad(0x289)]&&(console['error']('Site:\x20'+_0x55cee5[_0x2c97ad(0x208)]),console[_0x2c97ad(0x25a)]('Parent\x20segment:\x20'+_0x7cfa5));const _0x25649b=await withSpinner(_0x2c97ad(0x212)+_0x7cfa5+'\x27...',()=>_0x57cddb[_0x2c97ad(0x2c8)][_0x2c97ad(0x255)](_0x7cfa5),{'verbose':_0x55cee5[_0x2c97ad(0x289)]}),_0x2aa887=_0x25649b['data'],_0x10498f=await withSpinner(_0x2c97ad(0x234)+_0x7cfa5+_0x2c97ad(0x284),()=>_0x57cddb[_0x2c97ad(0x2c8)][_0x2c97ad(0x259)](_0x2aa887),{'verbose':_0x55cee5[_0x2c97ad(0x289)]}),_0x234118=await executeSchemaQuery(_0x10498f[_0x2c97ad(0x20f)],_0x57cddb,_0x55cee5);return await handleQueryOutput(_0x234118,_0x55cee5),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x1cc);[a29_0x367de6(0x2da)]=a29_0x367de6(0x1da);async[a29_0x367de6(0x271)](_0x321e74){const _0x272c85=a29_0x367de6,{options:_0xc8c6d,args:_0x421b11,tdx:_0x42d029}=_0x321e74,_0x50f48b=_0x421b11[0x0]||_0xc8c6d[_0x272c85(0x1f9)];if(!_0x50f48b)return showParentSegmentNotSetError(_0x272c85(0x2d2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0xc8c6d[_0x272c85(0x289)]&&(console[_0x272c85(0x25a)](_0x272c85(0x2a2)+_0xc8c6d[_0x272c85(0x208)]),console['error']('Parent\x20segment:\x20'+_0x50f48b));const _0xb00b84=await withSpinner(_0x272c85(0x212)+_0x50f48b+'\x27...',()=>_0x42d029[_0x272c85(0x2c8)][_0x272c85(0x255)](_0x50f48b),{'verbose':_0xc8c6d['verbose']}),_0x1ad4ff=_0xb00b84['data'],_0x2541b1=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x50f48b+'\x27...',()=>_0x42d029[_0x272c85(0x2c8)][_0x272c85(0x259)](_0x1ad4ff),{'verbose':_0xc8c6d['verbose']}),_0x266f60=_0x2541b1[_0x272c85(0x20f)];return _0xc8c6d[_0x272c85(0x22f)]==='json'||_0xc8c6d[_0x272c85(0x22f)]==='jsonl'?await handleSDKOutput([{'sql':_0x266f60}],_0xc8c6d):console[_0x272c85(0x1f1)](_0x266f60),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x367de6(0x238)]=a29_0x367de6(0x2a5);[a29_0x367de6(0x2da)]=a29_0x367de6(0x1d1);async['execute'](_0x2813bf){const _0x299341=a29_0x367de6,{options:_0x20b98e,args:_0x55cdae,tdx:_0x5d1176}=_0x2813bf,_0x550c94=_0x55cdae[0x0]||_0x20b98e[_0x299341(0x1f9)];if(!_0x550c94)return showParentSegmentNotSetError(_0x299341(0x253)+_0x299341(0x21c)),0x1;_0x20b98e[_0x299341(0x289)]&&(console['error']('Site:\x20'+_0x20b98e[_0x299341(0x208)]),console[_0x299341(0x25a)](_0x299341(0x2a0)+_0x550c94));const _0x21f6c1=await withSpinner(_0x299341(0x212)+_0x550c94+'\x27...',()=>_0x5d1176[_0x299341(0x2c8)][_0x299341(0x255)](_0x550c94),{'verbose':_0x20b98e[_0x299341(0x289)]}),_0x2e3464=_0x21f6c1[_0x299341(0x20f)],_0x472454=await withSpinner(_0x299341(0x234)+_0x550c94+_0x299341(0x284),()=>_0x5d1176[_0x299341(0x2c8)][_0x299341(0x259)](_0x2e3464),{'verbose':_0x20b98e[_0x299341(0x289)]});let _0x378c05=_0x472454[_0x299341(0x20f)];const _0x351cfe=resolveLimit(_0x20b98e['limit'],DEFAULT_DISPLAY_LIMIT),_0x8bcfce=/\bLIMIT\s+\d+/i[_0x299341(0x2cb)](_0x378c05);!_0x8bcfce&&(_0x378c05=_0x378c05['trim']()[_0x299341(0x279)](/;+$/,''),_0x378c05=_0x299341(0x22a)+_0x378c05+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x351cfe);_0x20b98e['verbose']&&console['error'](_0x299341(0x2d8)+_0x378c05);const _0xdb2198=await withQuerySpinner(_0x299341(0x20b),async _0x497a08=>{const _0x21a171=_0x299341,_0x4a2966=await _0x5d1176[_0x21a171(0x2e4)]['execute'](_0x378c05,{'catalog':'td','schema':_0x21a171(0x22b),'onJobId':_0x38e40f=>{const _0x53b08f=_0x21a171;_0x497a08[_0x53b08f(0x27b)](_0x38e40f);}});return _0x4a2966;},{'verbose':_0x20b98e[_0x299341(0x289)]}),_0x3a5de2=_0xdb2198['data'],_0x1efd15=_0x3a5de2[_0x299341(0x29e)]?'\x20[Job\x20ID:\x20'+_0x3a5de2[_0x299341(0x29e)]+']':'';return console['error'](_0x299341(0x2ab)+_0x3a5de2[_0x299341(0x25d)][_0x299341(0x24c)][_0x299341(0x298)]()+'\x20rows\x20'+(_0x299341(0x27a)+formatElapsed(_0x3a5de2[_0x299341(0x25d)][_0x299341(0x20e)])+_0x1efd15)),await handleQueryOutput(_0x3a5de2,_0x20b98e),0x0;}}
|
|
1
|
+
const a29_0x150261=a29_0x1973;(function(_0x37192a,_0x55397f){const _0x4366d1=a29_0x1973,_0x147f52=_0x37192a();while(!![]){try{const _0x1d646b=parseInt(_0x4366d1(0x251))/0x1*(-parseInt(_0x4366d1(0x242))/0x2)+parseInt(_0x4366d1(0x282))/0x3*(-parseInt(_0x4366d1(0x1d0))/0x4)+-parseInt(_0x4366d1(0x1a5))/0x5+-parseInt(_0x4366d1(0x1ce))/0x6*(-parseInt(_0x4366d1(0x203))/0x7)+-parseInt(_0x4366d1(0x238))/0x8*(-parseInt(_0x4366d1(0x219))/0x9)+-parseInt(_0x4366d1(0x23f))/0xa+parseInt(_0x4366d1(0x1dd))/0xb*(parseInt(_0x4366d1(0x1eb))/0xc);if(_0x1d646b===_0x55397f)break;else _0x147f52['push'](_0x147f52['shift']());}catch(_0x28edeb){_0x147f52['push'](_0x147f52['shift']());}}}(a29_0x3970,0x89ef7));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';function a29_0x3970(){const _0x22730c=['Options\x20(one\x20required):\x0a','attribute','\x27\x20is\x20up\x20to\x20date','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Resolving\x20parent\x20segment\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20tdx\x20wf\x20attempt\x20','Attempt:','displaySummary','number','customerGroup','segment:parent:fields','sampleData','\x20kill','message','segment:parent:show','run','Found\x20YAML\x20file:\x20','\x20--attribute\x20\x22<name>\x22','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Listing\x20parent\x20segments\x20matching\x20\x27','.yml','cyan','enriched','segment:parent:push','execute','Site:\x20','varchar','table','segment:parent:list','segment:parent:preview','✔\x20Found\x20','getParentFull','Aborted.','parentSegment','Analyzing\x20changes...','\x20No\x20changes\x20-\x20','start','Errors:','text','in\x20','Fetching\x20sample\x20data...','schemaError','dim','33249IvWFWn','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','ignore','\x20rows\x20','runParent','preview','Rows:','status','/attempt/','joinKey','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','segment:parent:pull','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Master:','/app/dw/parentSegments/','/\x20directory.\x0a','matchedCount','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','displayColumns','columns','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','pullParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20-\x20','interval','Updating','trim','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','segment:parent:update','Parent\x20segment:\x20','Options:\x0a','query','listFields','Fetching\x20SQL\x20for\x20\x27','localeCompare','\x20--behavior\x20\x22<name>\x22','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','-1d','SELECT\x20*\x20FROM\x20(\x0a','verbose','coveragePercent','log','\x0a✔\x20Workflow\x20started','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','No\x20parent\x20segments\x20found','join','session','format','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','`\x20to\x20download\x20the\x20configuration\x20first','tdx\x20segment\x20parent\x20preview\x20','Preview:','Master\x20Table','label','segment','segment:parent:desc','\x20rows)','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','yes','isDirectory','/\x20and\x20','addAttributesFile','parent_segments','repeat','jsonl','Creating','platform','Created','Status:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','unref','Listing\x20fields\x20for\x20\x27','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20Context\x20set:\x20','FINISHED','\x0aNew\x20parent\x20segment\x20\x27','bold','\x20--attribute\x20\x22','SQL\x20query:\x0a','previewParentYaml','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','information_schema','2532115nmZUdv','parent_segment','output','\x27\x20is\x20already\x20up\x20to\x20date','Updated','endsWith','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','resolveParentId','displayPreviewHints','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','allValid','Fetching\x20parent\x20segment\x20\x27','Columns:','win32','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','behavior','behaviors','Error:\x20--behavior\x20requires\x20a\x20name\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','customerGroupFile','\x20=\x20','attributes','Create\x20parent\x20segment\x20\x27','To\x20view\x20sample\x20data:','Master\x20+\x20Attributes','Name:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','string','sort','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','customerPercent','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','elapsedTimeMillis','displaySampleData','green','/{name}.yml\x0a','attributesFile','open','6cRFSyl','workflowSessionId','148KdFvHi','Join\x20on:','toLocaleString','Pattern:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','addBehaviors','stop','double','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','No\x20parent\x20segments\x20match\x20pattern:\x20','11675026hteXYx','\x0a⚠️\x20\x20Both\x20','xdg-open','workflowId','Options:','web','error','\x27...','Events:','\x0aNo\x20sample\x20data\x20available','darwin','replace','Behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','24QNqqKf','Join:','timezone','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Creating\x20parent\x20segment\x20\x27','segment:parent:sql','👥\x20','displayPreviewResults','toFixed','\x20Opening\x20','Audience\x20ID:','Error:\x20--database\x20and\x20--table\x20are\x20required','.yaml','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x0a⚠️\x20\x20Migrating:\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','foreignKey','jobId','scheduleOption','limit','displayBehaviorsStats','✔\x20Renamed\x20directory\x20to\x20','\x20field','1688659hsbdrE','yellow','audienceId','keys','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','segment:parent:create','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','errors','\x20Configuration\x20is\x20valid','validateParentYaml','behaviorsFile','name','createParent','data','displayValidateResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','rowCount','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Updated\x20parent\x20segment\x20\x27','red','\x20--interval\x20','9tqNLLa','%)\x20','segment:parent:run','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Error:\x20File\x20not\x20found:\x20','test','schemaValid','description','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Output\x20file:\x20','✔\x20No\x20changes\x20-\x20\x27','Error:','totalEvents','map','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','database','length','population','List\x20parent\x20segments','Available\x20behaviors:','displayAttributesStats','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','processedRows','column','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x5c$&','apply','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','site','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','listParents','2885192zDmSDe','Behavior:','/sessions/','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','all','setJobId','customersWithEvents','1894640vxzOBm','YAML\x20file:\x20','workflowAttemptId','34UuSXYY','Error\x20reading\x20file:\x20','scheduleType','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20--enriched','utf-8','\x20--behavior\x20\x22','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','json','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20\x20No\x20sample\x20data\x20available','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20parent\x20segment\x20\x27','Source:','61981pNUbHy','master','List\x20available\x20fields\x20for\x20segmentation','segment:parent:validate','stats'];a29_0x3970=function(){return _0x22730c;};return a29_0x3970();}function a29_0x1973(_0x246fc5,_0x67c0d3){_0x246fc5=_0x246fc5-0x194;const _0x3970b1=a29_0x3970();let _0x1973ec=_0x3970b1[_0x246fc5];return _0x1973ec;}import{spawn}from'child_process';import a29_0x2a32a5 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_0x52c60f 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_0x150261(0x2c4),LEGACY_PARENT_SEGMENT_DIR=a29_0x150261(0x1a6);function openBrowser(_0x2e3638){const _0x3d5f67=a29_0x150261,_0x44a277=process[_0x3d5f67(0x195)],_0x2278a6=_0x44a277===_0x3d5f67(0x1e7)?_0x3d5f67(0x1cd):_0x44a277===_0x3d5f67(0x1b3)?_0x3d5f67(0x27b):_0x3d5f67(0x1df);spawn(_0x2278a6,[_0x2e3638],{'detached':!![],'stdio':_0x3d5f67(0x285)})[_0x3d5f67(0x199)]();}function migrateLegacyDirectory(){const _0xf2a17a=a29_0x150261;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x52e786=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x52e786[_0xf2a17a(0x2c1)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x204)](_0xf2a17a(0x1de)+LEGACY_PARENT_SEGMENT_DIR+_0xf2a17a(0x2c2)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x281)](_0xf2a17a(0x1f9)+LEGACY_PARENT_SEGMENT_DIR+_0xf2a17a(0x292))),![];console[_0xf2a17a(0x1e3)](a29_0x52c60f['yellow'](_0xf2a17a(0x1fa)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x52c60f['green'](_0xf2a17a(0x201)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4185c2){const _0x6a5d11=_0x4185c2 instanceof Error?_0x4185c2[_0xf2a17a(0x264)]:String(_0x4185c2);return console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x217)](_0xf2a17a(0x2b5)+_0x6a5d11+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x150261(0x266)](_0x43ac04){return migrateLegacyDirectory(),super['run'](_0x43ac04);}}function resolveYamlFile(_0x456d46){const _0xc9ea4=a29_0x150261;if(_0x456d46[_0xc9ea4(0x1aa)](_0xc9ea4(0x26b))||_0x456d46[_0xc9ea4(0x1aa)](_0xc9ea4(0x1f7)))return _0x456d46;return a29_0x2a32a5[_0xc9ea4(0x2b2)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x456d46)+_0xc9ea4(0x26b));}function formatProgressMessage(_0x5358c7){const _0x1ff317=a29_0x150261,_0x5c8af0=_0x5358c7['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5c8af0){const [,_0x2b9b55,_0x1d6216,_0x1fb01b='']=_0x5c8af0;return a29_0x52c60f['dim'](_0x2b9b55+':')+'\x20'+_0x1d6216+a29_0x52c60f[_0x1ff317(0x281)](_0x1fb01b);}return a29_0x52c60f[_0x1ff317(0x281)](_0x5358c7);}function showFileNotFoundError(_0xeb605d,_0x4f4893){const _0x164de9=a29_0x150261;console[_0x164de9(0x1e3)](a29_0x52c60f['red'](_0x164de9(0x21d)+_0xeb605d+'\x0a')),console[_0x164de9(0x1e3)](a29_0x52c60f[_0x164de9(0x26c)](_0x164de9(0x298)+_0x4f4893+_0x164de9(0x2b7)));}function showParentSegmentNotSetError(_0x23852c){const _0x20fdf0=a29_0x150261;console[_0x20fdf0(0x1e3)](a29_0x52c60f['yellow'](_0x20fdf0(0x1b8))),console['error'](_0x23852c);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x273);['description']=a29_0x150261(0x22b);async[a29_0x150261(0x26f)](_0x82a9f4){const _0x4104b3=a29_0x150261,{options:_0x3cf10c,args:_0x3d8462,tdx:_0x3ed425}=_0x82a9f4,_0x3da3c4=_0x3d8462[0x0];_0x3cf10c['verbose']&&(console[_0x4104b3(0x1e3)]('Site:\x20'+_0x3cf10c['site']),_0x3da3c4&&console[_0x4104b3(0x1e3)](_0x4104b3(0x1d3)+_0x3da3c4));const _0x4db5a3=await withSpinner(_0x3da3c4?_0x4104b3(0x26a)+_0x3da3c4+_0x4104b3(0x1e4):'Listing\x20parent\x20segments...',()=>_0x3ed425[_0x4104b3(0x2bc)][_0x4104b3(0x237)](),{'verbose':_0x3cf10c['verbose']});let _0xfa9e11=_0x4db5a3[_0x4104b3(0x210)];if(_0x3da3c4){const _0x3779c8=_0x3da3c4[_0x4104b3(0x1e8)](/[.+^${}()|[\]\\]/g,_0x4104b3(0x232))[_0x4104b3(0x1e8)](/\*/g,'.*')[_0x4104b3(0x1e8)](/\?/g,'.'),_0x43b58b=new RegExp('^'+_0x3779c8+'$','i');_0xfa9e11=_0xfa9e11['filter'](_0x41df55=>_0x43b58b[_0x4104b3(0x21e)](_0x41df55[_0x4104b3(0x1bc)][_0x4104b3(0x20e)]));}_0xfa9e11[_0x4104b3(0x1c3)]((_0xacce9f,_0x5bf1a6)=>_0xacce9f[_0x4104b3(0x1bc)][_0x4104b3(0x20e)][_0x4104b3(0x2a6)](_0x5bf1a6[_0x4104b3(0x1bc)][_0x4104b3(0x20e)])),console[_0x4104b3(0x1e3)](_0x4104b3(0x275)+_0xfa9e11[_0x4104b3(0x229)]+'\x20parent\x20segment'+(_0xfa9e11[_0x4104b3(0x229)]!==0x1?'s':''));if(_0x3cf10c[_0x4104b3(0x2b4)]===_0x4104b3(0x24a)||_0x3cf10c[_0x4104b3(0x2b4)]===_0x4104b3(0x2c6))await handleSDKOutput(_0xfa9e11,_0x3cf10c);else{if(_0xfa9e11['length']===0x0)_0x3da3c4?console[_0x4104b3(0x2ad)](_0x4104b3(0x1dc)+_0x3da3c4):console[_0x4104b3(0x2ad)](_0x4104b3(0x2b1));else for(const _0xc8b631 of _0xfa9e11){const _0x2ae177=_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x22a)]?a29_0x52c60f[_0x4104b3(0x281)]('\x20('+formatRows(_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x22a)])+')'):'';console[_0x4104b3(0x2ad)](_0x4104b3(0x1f1)+_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x20e)]+_0x2ae177);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x208);[a29_0x150261(0x220)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x150261(0x26f)](_0x26ef50){const _0x5df90d=a29_0x150261,{options:_0x477305,args:_0x458d0f,tdx:_0x1278cf}=_0x26ef50;console[_0x5df90d(0x1e3)](_0x5df90d(0x2b0)+_0x5df90d(0x22e)+_0x5df90d(0x283));const _0x5894e6=_0x477305;if(_0x458d0f[_0x5df90d(0x229)]===0x0)return console[_0x5df90d(0x1e3)](a29_0x52c60f[_0x5df90d(0x217)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x5df90d(0x1e3)](_0x5df90d(0x249)),0x1;const _0x1845b5=_0x458d0f[0x0];if(!_0x5894e6['database']||!_0x5894e6['table'])return console[_0x5df90d(0x1e3)](_0x5df90d(0x1f6)),console[_0x5df90d(0x1e3)](_0x5df90d(0x249)),0x1;_0x5894e6[_0x5df90d(0x2ab)]&&(console['error']('Site:\x20'+_0x5894e6[_0x5df90d(0x235)]),console[_0x5df90d(0x1e3)](_0x5df90d(0x1c0)+_0x1845b5),console[_0x5df90d(0x1e3)]('Database:\x20'+_0x5894e6[_0x5df90d(0x228)]),console[_0x5df90d(0x1e3)]('Table:\x20'+_0x5894e6[_0x5df90d(0x272)]));const _0x59e561=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x1bc)],_0x5894e6[_0x5df90d(0x1cc)]),_0x14aba1=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x1b6)],_0x5894e6[_0x5df90d(0x20d)]),_0x4506da=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x260)],_0x5894e6[_0x5df90d(0x1ba)]),_0x53fcd5={'name':_0x1845b5,'description':_0x5894e6['description'],'scheduleType':_0x5894e6[_0x5df90d(0x244)],'scheduleOption':_0x5894e6[_0x5df90d(0x1fe)],'timezone':_0x5894e6[_0x5df90d(0x1ed)],'master':{'parentDatabaseName':_0x5894e6[_0x5df90d(0x228)],'parentTableName':_0x5894e6['table']},'attributes':_0x59e561,'behaviors':_0x14aba1,'customerGroup':_0x4506da},_0x8391dc=await withSpinner(_0x5df90d(0x1ef)+_0x1845b5+_0x5df90d(0x1e4),()=>_0x1278cf[_0x5df90d(0x2bc)][_0x5df90d(0x20f)](_0x53fcd5),{'verbose':_0x477305[_0x5df90d(0x2ab)]}),_0x476bbf=_0x8391dc[_0x5df90d(0x210)];return console[_0x5df90d(0x1e3)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x476bbf[_0x5df90d(0x20e)]+'\x27\x20with\x20ID:\x20'+_0x476bbf['id']),await handleSDKOutput([_0x476bbf],_0x477305),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a29_0x150261(0x2a0);[a29_0x150261(0x220)]=a29_0x150261(0x1f8);async[a29_0x150261(0x26f)](_0x567e1e){const _0x57f714=a29_0x150261,{options:_0x14bfc4,args:_0x262723,tdx:_0x23d400}=_0x567e1e;console[_0x57f714(0x1e3)](_0x57f714(0x1d6)+_0x57f714(0x22e)+_0x57f714(0x283));const _0x12e8eb=_0x14bfc4;if(_0x262723['length']===0x0)return console[_0x57f714(0x1e3)](a29_0x52c60f[_0x57f714(0x217)](_0x57f714(0x215))),console[_0x57f714(0x1e3)](_0x57f714(0x1c1)),0x1;const _0x158e88=_0x262723[0x0];_0x12e8eb['verbose']&&(console[_0x57f714(0x1e3)](_0x57f714(0x270)+_0x12e8eb[_0x57f714(0x235)]),console['error'](_0x57f714(0x2a1)+_0x158e88));const _0x2d2a16=await withSpinner(_0x57f714(0x24b)+_0x158e88+'\x27...',()=>_0x23d400['segment'][_0x57f714(0x276)](_0x158e88),{'verbose':_0x12e8eb[_0x57f714(0x2ab)]}),_0x1b5014=_0x2d2a16[_0x57f714(0x210)],_0x4db47d=await loadJSONFromOptions(_0x12e8eb['addAttributes'],_0x12e8eb[_0x57f714(0x2c3)]),_0x5b3671=await loadJSONFromOptions(_0x12e8eb[_0x57f714(0x1d8)],_0x12e8eb['addBehaviorsFile']),_0x5a638b={'name':_0x1b5014[_0x57f714(0x20e)],'description':_0x12e8eb[_0x57f714(0x220)]!==undefined?_0x12e8eb[_0x57f714(0x220)]:_0x1b5014[_0x57f714(0x220)],'scheduleType':_0x12e8eb[_0x57f714(0x244)]!==undefined?_0x12e8eb[_0x57f714(0x244)]:_0x1b5014[_0x57f714(0x244)],'scheduleOption':_0x12e8eb['scheduleOption']!==undefined?_0x12e8eb[_0x57f714(0x1fe)]:_0x1b5014[_0x57f714(0x1fe)],'timezone':_0x12e8eb['timezone']!==undefined?_0x12e8eb[_0x57f714(0x1ed)]:_0x1b5014[_0x57f714(0x1ed)],'master':_0x1b5014[_0x57f714(0x252)],'attributes':_0x4db47d?[..._0x1b5014['attributes']||[],..._0x4db47d]:_0x1b5014[_0x57f714(0x1bc)],'behaviors':_0x5b3671?[..._0x1b5014[_0x57f714(0x1b6)]||[],..._0x5b3671]:_0x1b5014[_0x57f714(0x1b6)],'customerGroup':_0x1b5014[_0x57f714(0x260)]},_0x5e5d44=await withSpinner(_0x57f714(0x1ab)+_0x158e88+'\x27...',()=>_0x23d400[_0x57f714(0x2bc)]['updateParent'](_0x158e88,_0x5a638b),{'verbose':_0x12e8eb[_0x57f714(0x2ab)]}),_0x21a381=_0x5e5d44[_0x57f714(0x210)];return console[_0x57f714(0x1e3)](_0x57f714(0x216)+_0x21a381[_0x57f714(0x20e)]+'\x27'),await handleSDKOutput([_0x21a381],_0x12e8eb),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x28e);[a29_0x150261(0x220)]=a29_0x150261(0x23b);async['execute'](_0xb6a4a3){const _0x4b3d4e=a29_0x150261,{options:_0xf09f0f,args:_0x50760d,tdx:_0x3698f0}=_0xb6a4a3,_0x563811=_0xf09f0f,_0x23e2a5=_0x50760d[0x0]||_0xf09f0f[_0x4b3d4e(0x278)];if(!_0x23e2a5)return showParentSegmentNotSetError(_0x4b3d4e(0x209)+_0x4b3d4e(0x1c5)),0x1;if(_0x563811['use']&&_0x563811[_0x4b3d4e(0x1a7)])return console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x217)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x281)](_0x4b3d4e(0x221))),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x281)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x4b3d4e(0x1cb))),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x26c)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x2b2565=_0x563811['output']||a29_0x2a32a5[_0x4b3d4e(0x2b2)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x23e2a5)+_0x4b3d4e(0x26b));_0x563811['verbose']&&(console[_0x4b3d4e(0x1e3)](_0x4b3d4e(0x270)+_0x563811[_0x4b3d4e(0x235)]),console[_0x4b3d4e(0x1e3)]('Parent\x20segment:\x20'+_0x23e2a5),console[_0x4b3d4e(0x1e3)](_0x4b3d4e(0x222)+_0x2b2565));const _0x464140=await withSpinner(_0x4b3d4e(0x1b1)+_0x23e2a5+_0x4b3d4e(0x1e4),()=>_0x3698f0[_0x4b3d4e(0x2bc)][_0x4b3d4e(0x299)](_0x23e2a5),{'verbose':_0x563811[_0x4b3d4e(0x2ab)]}),_0x11c077=_0x464140[_0x4b3d4e(0x210)];if(existsSync(_0x2b2565)){const _0x231662=readFileSync(_0x2b2565,'utf-8'),_0x2dcfd9=generateDiff(_0x231662,_0x11c077);if(!hasChanges(_0x2dcfd9))console[_0x4b3d4e(0x1e3)](a29_0x52c60f['green']('✔')+_0x4b3d4e(0x27a)+a29_0x52c60f['cyan'](_0x2b2565)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x4b3d4e(0x1e3)]('\x0aChanges\x20to\x20\x27'+_0x2b2565+'\x27:'),console['error']('─'[_0x4b3d4e(0x2c5)](0x3c)),console[_0x4b3d4e(0x1e3)](formatDiffWithColors(_0x2dcfd9)),console[_0x4b3d4e(0x1e3)]('─'[_0x4b3d4e(0x2c5)](0x3c));if(!_0x563811[_0x4b3d4e(0x2c0)]){const _0x3c9d05=await confirmKey('Overwrite\x20\x27'+_0x2b2565+'\x27?');if(!_0x3c9d05)return console[_0x4b3d4e(0x1e3)]('Aborted.'),0x1;}writeFileSync(_0x2b2565,_0x11c077,_0x4b3d4e(0x247)),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a29_0x52c60f[_0x4b3d4e(0x26c)](_0x2b2565));}}else{const _0x8c6968=a29_0x2a32a5['dirname'](_0x2b2565);!existsSync(_0x8c6968)&&mkdirSync(_0x8c6968,{'recursive':!![]}),writeFileSync(_0x2b2565,_0x11c077,_0x4b3d4e(0x247)),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+_0x4b3d4e(0x269)+a29_0x52c60f[_0x4b3d4e(0x26c)](_0x2b2565));}return saveSessionContext({'parent_segment':_0x23e2a5},_0x563811[_0x4b3d4e(0x2b3)]),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+_0x4b3d4e(0x19c)+a29_0x52c60f['dim'](_0x4b3d4e(0x1a6))+_0x4b3d4e(0x1bb)+a29_0x52c60f['cyan'](_0x23e2a5)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x26e);[a29_0x150261(0x220)]=a29_0x150261(0x2af);async[a29_0x150261(0x26f)](_0x5ef96b){const _0xd2b4e7=a29_0x150261,{options:_0x218311,args:_0x4edaf8,tdx:_0x2c6794}=_0x5ef96b,_0x43c29b=_0x218311,_0xd17189=_0x4edaf8[0x0]||_0x218311['parentSegment'];if(!_0xd17189)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'+_0xd2b4e7(0x245)),0x1;const _0x4dad05=resolveYamlFile(_0xd17189);if(!existsSync(_0x4dad05))return showFileNotFoundError(_0x4dad05,_0xd17189),0x1;_0x43c29b[_0xd2b4e7(0x2ab)]&&(console['error']('Site:\x20'+_0x43c29b['site']),console[_0xd2b4e7(0x1e3)]('YAML\x20file:\x20'+_0x4dad05));let _0x3dc53a;try{_0x3dc53a=readFileSync(_0x4dad05,_0xd2b4e7(0x247));}catch(_0x286856){const _0x5237bb=_0x286856 instanceof Error?_0x286856['message']:String(_0x286856);return console[_0xd2b4e7(0x1e3)]('Error\x20reading\x20file:\x20'+_0x5237bb),0x1;}const _0x4172d6=await withSpinner('Analyzing\x20changes...',()=>_0x2c6794['segment']['pushParentYaml'](_0x3dc53a),{'verbose':_0x43c29b[_0xd2b4e7(0x2ab)]}),_0x4f317b=_0x4172d6[_0xd2b4e7(0x210)],{isNew:_0x36d947,name:_0x2a2bf2,hasChanges:_0x30f7fd,diffFormatted:_0x1f6806}=_0x4f317b;if(!_0x30f7fd)return console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x223)+_0x2a2bf2+_0xd2b4e7(0x1a8)),0x0;_0x36d947?console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x19e)+_0x2a2bf2+'\x27:'):console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x1b9)+_0x2a2bf2+'\x27:');console[_0xd2b4e7(0x1e3)]('─'[_0xd2b4e7(0x2c5)](0x3c)),console[_0xd2b4e7(0x1e3)](_0x1f6806),console['error']('─'['repeat'](0x3c));const _0x3c4d40=_0x36d947?_0xd2b4e7(0x1bd)+_0x2a2bf2+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2a2bf2+'\x27?';if(!_0x43c29b[_0xd2b4e7(0x2c0)]){const _0x5e05dd=await confirmKey(_0x3c4d40);if(!_0x5e05dd)return console['error'](_0xd2b4e7(0x277)),0x1;}const _0x31c5b0=_0x36d947?_0xd2b4e7(0x194):_0xd2b4e7(0x29d),_0x55a083=await withSpinner(_0x31c5b0+'\x20parent\x20segment\x20\x27'+_0x2a2bf2+_0xd2b4e7(0x1e4),()=>_0x4f317b[_0xd2b4e7(0x233)](),{'verbose':_0x43c29b[_0xd2b4e7(0x2ab)]}),_0x3c720c=_0x55a083[_0xd2b4e7(0x210)],_0x4b7c33=getConsoleNextUrl(_0x43c29b[_0xd2b4e7(0x235)],_0xd2b4e7(0x291)+_0x3c720c['id']),_0x5c7401=_0x36d947?_0xd2b4e7(0x196):_0xd2b4e7(0x1a9);return console[_0xd2b4e7(0x1e3)]('✔\x20'+_0x5c7401+'\x20parent\x20segment\x20\x27'+_0x3c720c[_0xd2b4e7(0x20e)]+'\x27'),console[_0xd2b4e7(0x1e3)]('\x20\x20'+_0x4b7c33),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x254);[a29_0x150261(0x220)]=a29_0x150261(0x227);async['execute'](_0xf27a1d){const _0x165c79=a29_0x150261,{options:_0x53a807,args:_0x2acde1,tdx:_0x549d20}=_0xf27a1d,_0x41d309=_0x53a807,_0x4dda91=_0x2acde1[0x0]||_0x53a807[_0x165c79(0x278)];if(!_0x4dda91)return showParentSegmentNotSetError(_0x165c79(0x29f)+_0x165c79(0x24e)+'Options:\x0a'+_0x165c79(0x234)+_0x165c79(0x1b4)+_0x165c79(0x19b)),0x1;const _0xea4e66=resolveYamlFile(_0x4dda91);if(!existsSync(_0xea4e66))return showFileNotFoundError(_0xea4e66,_0x4dda91),0x1;_0x41d309[_0x165c79(0x2ab)]&&(console[_0x165c79(0x1e3)]('Site:\x20'+_0x41d309[_0x165c79(0x235)]),console[_0x165c79(0x1e3)]('YAML\x20file:\x20'+_0xea4e66));let _0x36b9ea;try{_0x36b9ea=readFileSync(_0xea4e66,_0x165c79(0x247));}catch(_0x1939c7){const _0x40ae07=_0x1939c7 instanceof Error?_0x1939c7[_0x165c79(0x264)]:String(_0x1939c7);return console[_0x165c79(0x1e3)](_0x165c79(0x243)+_0x40ae07),0x1;}const _0x258325=createCommandSpinner(a29_0x52c60f[_0x165c79(0x281)]('Validating\x20configuration...'),{'verbose':_0x41d309[_0x165c79(0x2ab)]});_0x258325[_0x165c79(0x27b)]();const _0x3033d5={'onProgress':_0xb544c=>{const _0x4d6c9e=_0x165c79;_0x258325[_0x4d6c9e(0x27d)]=formatProgressMessage(_0xb544c);}};if(_0x41d309[_0x165c79(0x252)])_0x3033d5[_0x165c79(0x252)]=!![];if(_0x41d309[_0x165c79(0x26d)])_0x3033d5['enriched']=!![];_0x41d309[_0x165c79(0x257)]&&(_0x3033d5[_0x165c79(0x257)]=_0x41d309[_0x165c79(0x257)]);_0x41d309[_0x165c79(0x1b5)]&&(_0x3033d5[_0x165c79(0x1b5)]=_0x41d309[_0x165c79(0x1b5)]);if(_0x41d309[_0x165c79(0x29c)])_0x3033d5[_0x165c79(0x29c)]=_0x41d309[_0x165c79(0x29c)];let _0x490373;try{_0x490373=await _0x549d20['segment'][_0x165c79(0x20c)](_0x36b9ea,_0x3033d5),_0x258325[_0x165c79(0x1d9)]();}catch(_0x1465f2){_0x258325[_0x165c79(0x1d9)]();throw _0x1465f2;}const _0x2aff3d=_0x41d309[_0x165c79(0x29c)]||_0x165c79(0x2a9);return this[_0x165c79(0x211)](_0x490373,_0x3033d5,_0xea4e66,_0x2aff3d),_0x490373[_0x165c79(0x1b0)]?0x0:0x1;}['displayValidateResults'](_0x4035aa,_0x348e84,_0x1d8759,_0xfdb20d){const _0x2812c4=a29_0x150261;console[_0x2812c4(0x1e3)]('\x0a'+a29_0x52c60f[_0x2812c4(0x19f)]('Validate:')+'\x20'+_0x4035aa[_0x2812c4(0x20e)]),console[_0x2812c4(0x1e3)]('═'[_0x2812c4(0x2c5)](0x3c)),this['displayMasterInfo'](_0x4035aa);if(typeof _0x348e84[_0x2812c4(0x257)]==='string'){this[_0x2812c4(0x22d)](_0x4035aa),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x257),_0x348e84[_0x2812c4(0x257)]);return;}if(_0x348e84[_0x2812c4(0x257)]===!![]){this[_0x2812c4(0x22d)](_0x4035aa),this['displaySummary'](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1bc));return;}if(typeof _0x348e84['behavior']===_0x2812c4(0x1c2)){this['displayBehaviorsStats'](_0x4035aa,_0xfdb20d),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1b5),_0x348e84[_0x2812c4(0x1b5)]);return;}if(_0x348e84[_0x2812c4(0x1b5)]===!![]){this[_0x2812c4(0x200)](_0x4035aa,_0xfdb20d),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1b6));return;}this[_0x2812c4(0x22d)](_0x4035aa),this[_0x2812c4(0x200)](_0x4035aa,_0xfdb20d),this['displaySummary'](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x23c));}[a29_0x150261(0x1ae)](_0x27637d,_0x2ab7cd,_0x4ef1e5,_0x4a137c){const _0x22e609=a29_0x150261;console[_0x22e609(0x1e3)]('\x0a'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x1be)));const _0x1c343f=_0x2ab7cd!==_0x22e609(0x2a9)?_0x22e609(0x218)+_0x2ab7cd:'';if(_0x4ef1e5==='attribute'&&_0x4a137c)console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x1a0)+_0x4a137c+'\x22'+_0x1c343f));else{if(_0x4ef1e5==='behavior'&&_0x4a137c)console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x248)+_0x4a137c+'\x22'+_0x1c343f));else(_0x4ef1e5===_0x22e609(0x1bc)||_0x4ef1e5==='all')&&console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x268)+_0x1c343f));}(_0x4ef1e5===_0x22e609(0x1b6)||_0x4ef1e5===_0x22e609(0x23c))&&console['error']('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x2a7)+_0x1c343f)),_0x4ef1e5===_0x22e609(0x23c)&&console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x246)+_0x1c343f));}['displayMasterInfo'](_0xe466e0){const _0x2f1f63=a29_0x150261,{master:_0x562001}=_0xe466e0,_0x39c8d8=_0x562001[_0x2f1f63(0x21f)]?a29_0x52c60f[_0x2f1f63(0x1ca)]('✔'):a29_0x52c60f[_0x2f1f63(0x217)]('✘');console['error']('\x0a'+a29_0x52c60f[_0x2f1f63(0x281)](_0x2f1f63(0x2ba))),console['error'](_0x39c8d8+'\x20'+a29_0x52c60f[_0x2f1f63(0x19f)](_0x562001['database']+'.'+_0x562001['table'])),_0x562001[_0x2f1f63(0x21f)]?_0x562001['rowCount']!==undefined&&console[_0x2f1f63(0x1e3)]('\x20\x20'+a29_0x52c60f['dim'](_0x2f1f63(0x289))+'\x20'+a29_0x52c60f[_0x2f1f63(0x26c)](formatRows(_0x562001[_0x2f1f63(0x213)]))):console[_0x2f1f63(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x2f1f63(0x217)](_0x2f1f63(0x224))+'\x20'+_0x562001[_0x2f1f63(0x280)]);}[a29_0x150261(0x22d)](_0x205015){const _0x47f8b3=a29_0x150261;if(_0x205015[_0x47f8b3(0x1bc)][_0x47f8b3(0x229)]===0x0)return;console[_0x47f8b3(0x1e3)]('\x0a'+a29_0x52c60f[_0x47f8b3(0x281)]('Attributes'));for(const _0x27d9b8 of _0x205015[_0x47f8b3(0x1bc)]){const _0xb2bf99=_0x27d9b8[_0x47f8b3(0x21f)]?a29_0x52c60f[_0x47f8b3(0x1ca)]('✔'):a29_0x52c60f[_0x47f8b3(0x217)]('✘');let _0x41c5e5='';if(_0x27d9b8[_0x47f8b3(0x21f)]&&_0x27d9b8[_0x47f8b3(0x293)]!==undefined&&_0x27d9b8[_0x47f8b3(0x2ac)]!==undefined){const _0x4727e4=_0x27d9b8[_0x47f8b3(0x2ac)][_0x47f8b3(0x1f3)](0x1),_0x5a3912=_0x27d9b8[_0x47f8b3(0x2ac)]>=0x50?a29_0x52c60f['green']:_0x27d9b8[_0x47f8b3(0x2ac)]>=0x32?a29_0x52c60f[_0x47f8b3(0x204)]:a29_0x52c60f['red'];_0x41c5e5='\x20'+a29_0x52c60f[_0x47f8b3(0x281)]('Coverage:')+'\x20'+_0x5a3912(_0x4727e4+'%')+'\x20('+formatRows(_0x27d9b8[_0x47f8b3(0x293)])+_0x47f8b3(0x2be);}console['error'](_0xb2bf99+'\x20'+a29_0x52c60f[_0x47f8b3(0x19f)](_0x27d9b8[_0x47f8b3(0x20e)])+_0x41c5e5),console[_0x47f8b3(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x250))+'\x20'+a29_0x52c60f[_0x47f8b3(0x19f)](_0x27d9b8['database']+'.'+_0x27d9b8['table']));const _0x24abd6=_0x27d9b8[_0x47f8b3(0x28c)]===_0x27d9b8[_0x47f8b3(0x1fc)]?a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1d1))+'\x20'+_0x27d9b8[_0x47f8b3(0x28c)]:a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1ec))+'\x20'+_0x27d9b8[_0x47f8b3(0x28c)]+_0x47f8b3(0x1bb)+_0x27d9b8['foreignKey'];console[_0x47f8b3(0x1e3)]('\x20\x20'+_0x24abd6),console['error']('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1b2))),this[_0x47f8b3(0x296)](_0x27d9b8[_0x47f8b3(0x297)]),!_0x27d9b8[_0x47f8b3(0x21f)]&&console[_0x47f8b3(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x217)](_0x47f8b3(0x224))+'\x20'+_0x27d9b8[_0x47f8b3(0x280)]);}}[a29_0x150261(0x200)](_0x593165,_0x47251b){const _0x3a9254=a29_0x150261;if(_0x593165[_0x3a9254(0x1b6)]['length']===0x0)return;console[_0x3a9254(0x1e3)]('\x0a'+a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x1e9))+'\x20'+a29_0x52c60f['dim']('('+_0x47251b+')'));for(const _0x265f00 of _0x593165['behaviors']){const _0x39ab25=_0x265f00[_0x3a9254(0x21f)]?a29_0x52c60f[_0x3a9254(0x1ca)]('✔'):a29_0x52c60f[_0x3a9254(0x217)]('✘');let _0x39b1ec='';if(_0x265f00[_0x3a9254(0x21f)]&&_0x265f00['customersWithEvents']!==undefined&&_0x265f00[_0x3a9254(0x225)]!==undefined){const _0xedd7da=_0x265f00['customerPercent']?.[_0x3a9254(0x1f3)](0x1)||'?',_0x301dcd=(_0x265f00[_0x3a9254(0x1c6)]??0x0)>=0x32?a29_0x52c60f[_0x3a9254(0x1ca)]:(_0x265f00['customerPercent']??0x0)>=0x14?a29_0x52c60f[_0x3a9254(0x204)]:a29_0x52c60f[_0x3a9254(0x217)];_0x39b1ec='\x20'+a29_0x52c60f[_0x3a9254(0x281)]('Customers:')+'\x20'+_0x301dcd(formatRows(_0x265f00[_0x3a9254(0x23e)]))+'\x20('+_0xedd7da+_0x3a9254(0x21a)+a29_0x52c60f['dim'](_0x3a9254(0x1e5))+'\x20'+a29_0x52c60f['cyan'](formatRows(_0x265f00[_0x3a9254(0x225)]));}console[_0x3a9254(0x1e3)](_0x39ab25+'\x20'+a29_0x52c60f[_0x3a9254(0x19f)](_0x265f00['name'])+_0x39b1ec),console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x250))+'\x20'+a29_0x52c60f[_0x3a9254(0x19f)](_0x265f00[_0x3a9254(0x228)]+'.'+_0x265f00[_0x3a9254(0x272)]));const _0x3258d8=_0x265f00[_0x3a9254(0x28c)]===_0x265f00[_0x3a9254(0x1fc)]?a29_0x52c60f['dim']('Join\x20on:')+'\x20'+_0x265f00[_0x3a9254(0x28c)]:a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x1ec))+'\x20'+_0x265f00[_0x3a9254(0x28c)]+_0x3a9254(0x1bb)+_0x265f00[_0x3a9254(0x1fc)];console[_0x3a9254(0x1e3)]('\x20\x20'+_0x3258d8),console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x281)]('Columns:')),this[_0x3a9254(0x296)](_0x265f00[_0x3a9254(0x297)]),!_0x265f00['schemaValid']&&console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x217)]('Error:')+'\x20'+_0x265f00[_0x3a9254(0x280)]);}}[a29_0x150261(0x296)](_0x109152){const _0x3d1bdd=a29_0x150261;for(const _0x2ddff6 of _0x109152){_0x2ddff6[_0x3d1bdd(0x2bb)]===_0x2ddff6[_0x3d1bdd(0x230)]||_0x2ddff6['column']==='*'?console[_0x3d1bdd(0x1e3)](_0x3d1bdd(0x29b)+_0x2ddff6[_0x3d1bdd(0x2bb)]):console['error'](_0x3d1bdd(0x29b)+_0x2ddff6['label']+'\x20'+a29_0x52c60f['dim']('('+_0x2ddff6[_0x3d1bdd(0x230)]+')'));}}['displaySummary'](_0x1edbde){const _0x53809b=a29_0x150261;console[_0x53809b(0x1e3)]('─'[_0x53809b(0x2c5)](0x3c));if(_0x1edbde[_0x53809b(0x20a)][_0x53809b(0x229)]>0x0){console['error']('\x0a'+a29_0x52c60f[_0x53809b(0x217)](_0x53809b(0x27c)));for(const _0x517759 of _0x1edbde['errors']){console[_0x53809b(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x53809b(0x217)]('•')+'\x20'+_0x517759);}}_0x1edbde[_0x53809b(0x1b0)]&&console[_0x53809b(0x1e3)]('\x0a'+a29_0x52c60f['green']('✔')+_0x53809b(0x20b));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x274);[a29_0x150261(0x220)]=a29_0x150261(0x207);async[a29_0x150261(0x26f)](_0x172888){const _0x1cdb90=a29_0x150261,{options:_0x347c99,args:_0x2f081e,tdx:_0xc5468}=_0x172888,_0x271137=_0x347c99,_0x558938=_0x2f081e[0x0]||_0x347c99[_0x1cdb90(0x278)];if(!_0x558938)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x1cdb90(0x212)+_0x1cdb90(0x256)+_0x1cdb90(0x1d4)+_0x1cdb90(0x198)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x1cdb90(0x1c4)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x271137[_0x1cdb90(0x252)]&&!_0x271137[_0x1cdb90(0x257)]&&!_0x271137[_0x1cdb90(0x1b5)]&&!_0x271137['enriched'])return console['error'](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x294))),console['error'](_0x1cdb90(0x28d)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1e1)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x2b6)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1a3)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x259)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1af)),0x1;const _0xe60df0=resolveYamlFile(_0x558938);if(!existsSync(_0xe60df0))return showFileNotFoundError(_0xe60df0,_0x558938),0x1;_0x271137[_0x1cdb90(0x2ab)]&&(console[_0x1cdb90(0x1e3)]('Site:\x20'+_0x271137[_0x1cdb90(0x235)]),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x240)+_0xe60df0));let _0x4363d2;try{_0x4363d2=readFileSync(_0xe60df0,'utf-8');}catch(_0xb76b26){const _0x5e45ef=_0xb76b26 instanceof Error?_0xb76b26['message']:String(_0xb76b26);return console[_0x1cdb90(0x1e3)](_0x1cdb90(0x243)+_0x5e45ef),0x1;}let _0x161794;try{_0x161794=parseYamlString(_0x4363d2);}catch(_0x3f4daf){const _0x51b59b=_0x3f4daf instanceof Error?_0x3f4daf[_0x1cdb90(0x264)]:String(_0x3f4daf);return console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)]('Error\x20parsing\x20YAML:\x20'+_0x51b59b)),0x1;}if(_0x271137[_0x1cdb90(0x257)]===!![]||_0x271137[_0x1cdb90(0x257)]===''){const _0x31bb7d=_0x161794[_0x1cdb90(0x1bc)]?.[_0x1cdb90(0x226)](_0x16cb33=>_0x16cb33['name'])||[];if(_0x31bb7d[_0x1cdb90(0x229)]===0x0)console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x236)));else{console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x214))),console[_0x1cdb90(0x1e3)]('Available\x20attributes:');for(const _0x1e6bfd of _0x31bb7d){console['error']('\x20\x20'+a29_0x52c60f[_0x1cdb90(0x26c)](_0x1e6bfd));}console['error'](_0x1cdb90(0x284)+_0x558938+'\x20--attribute\x20\x22'+_0x31bb7d[0x0]+'\x22');}return 0x1;}if(_0x271137[_0x1cdb90(0x1b5)]===!![]||_0x271137[_0x1cdb90(0x1b5)]===''){const _0x797410=_0x161794[_0x1cdb90(0x1b6)]?.[_0x1cdb90(0x226)](_0x62d260=>_0x62d260['name'])||[];if(_0x797410[_0x1cdb90(0x229)]===0x0)console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x2a8)));else{console['error'](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x1b7))),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x22c));for(const _0xa8460 of _0x797410){console[_0x1cdb90(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x1cdb90(0x26c)](_0xa8460));}console[_0x1cdb90(0x1e3)](_0x1cdb90(0x284)+_0x558938+_0x1cdb90(0x248)+_0x797410[0x0]+'\x22');}return 0x1;}const _0x351945=createCommandSpinner(a29_0x52c60f[_0x1cdb90(0x281)](_0x1cdb90(0x27f)),{'verbose':_0x271137['verbose']});_0x351945[_0x1cdb90(0x27b)]();const _0x164810={'onProgress':_0x1b2aa9=>{const _0x56ec26=_0x1cdb90;_0x351945[_0x56ec26(0x27d)]=formatProgressMessage(_0x1b2aa9);}};if(_0x271137[_0x1cdb90(0x252)])_0x164810[_0x1cdb90(0x252)]=!![];if(_0x271137['attribute']&&typeof _0x271137[_0x1cdb90(0x257)]===_0x1cdb90(0x1c2))_0x164810['attribute']=_0x271137[_0x1cdb90(0x257)];if(_0x271137[_0x1cdb90(0x1b5)]&&typeof _0x271137[_0x1cdb90(0x1b5)]===_0x1cdb90(0x1c2))_0x164810[_0x1cdb90(0x1b5)]=_0x271137[_0x1cdb90(0x1b5)];if(_0x271137[_0x1cdb90(0x26d)])_0x164810[_0x1cdb90(0x26d)]=!![];if(_0x271137[_0x1cdb90(0x29c)])_0x164810['interval']=_0x271137[_0x1cdb90(0x29c)];let _0x331579;try{_0x331579=await _0xc5468[_0x1cdb90(0x2bc)][_0x1cdb90(0x1a2)](_0x4363d2,_0x164810),_0x351945[_0x1cdb90(0x1d9)]();}catch(_0x3204ab){_0x351945[_0x1cdb90(0x1d9)]();throw _0x3204ab;}return await this['displayPreviewResults'](_0x331579,{'master':_0x271137[_0x1cdb90(0x252)],'attribute':typeof _0x271137[_0x1cdb90(0x257)]===_0x1cdb90(0x1c2)?_0x271137['attribute']:undefined,'behavior':typeof _0x271137[_0x1cdb90(0x1b5)]==='string'?_0x271137[_0x1cdb90(0x1b5)]:undefined,'enriched':_0x271137[_0x1cdb90(0x26d)]}),_0x331579[_0x1cdb90(0x1b0)]?0x0:0x1;}async[a29_0x150261(0x1f2)](_0x5ea2a2,_0x5ea779){const _0x3bf4f9=a29_0x150261;console['error']('\x0a'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x3bf4f9(0x2b9))+'\x20'+_0x5ea2a2[_0x3bf4f9(0x20e)]),console[_0x3bf4f9(0x1e3)]('═'[_0x3bf4f9(0x2c5)](0x3c));if(_0x5ea779[_0x3bf4f9(0x252)]&&_0x5ea2a2[_0x3bf4f9(0x262)]){const _0x5415bc=a29_0x52c60f['dim'](_0x3bf4f9(0x290))+'\x20'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x5ea2a2[_0x3bf4f9(0x252)][_0x3bf4f9(0x228)]+'.'+_0x5ea2a2[_0x3bf4f9(0x252)]['table']);await this[_0x3bf4f9(0x1c9)](_0x5415bc,_0x5ea2a2[_0x3bf4f9(0x262)]);}else{if(_0x5ea779[_0x3bf4f9(0x257)]&&_0x5ea2a2['sampleData']){const _0x374e6e=a29_0x52c60f['dim']('Attribute:')+'\x20'+a29_0x52c60f['bold'](_0x5ea779[_0x3bf4f9(0x257)]);await this[_0x3bf4f9(0x1c9)](_0x374e6e,_0x5ea2a2['sampleData']);}else{if(_0x5ea779[_0x3bf4f9(0x1b5)]&&_0x5ea2a2[_0x3bf4f9(0x262)]){const _0x3b3977=a29_0x52c60f[_0x3bf4f9(0x281)](_0x3bf4f9(0x239))+'\x20'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x5ea779['behavior']);await this[_0x3bf4f9(0x1c9)](_0x3b3977,_0x5ea2a2[_0x3bf4f9(0x262)]);}else{if(_0x5ea779[_0x3bf4f9(0x26d)]&&_0x5ea2a2['sampleData']){const _0x2199e3=a29_0x52c60f['dim']('Enriched:')+'\x20'+a29_0x52c60f['bold'](_0x3bf4f9(0x1bf));await this[_0x3bf4f9(0x1c9)](_0x2199e3,_0x5ea2a2[_0x3bf4f9(0x262)]);}else!_0x5ea2a2[_0x3bf4f9(0x262)]&&console['error'](_0x3bf4f9(0x1e6));}}}if(_0x5ea2a2[_0x3bf4f9(0x20a)][_0x3bf4f9(0x229)]>0x0){console[_0x3bf4f9(0x1e3)]('─'[_0x3bf4f9(0x2c5)](0x3c)),console[_0x3bf4f9(0x1e3)]('\x0a'+a29_0x52c60f['red'](_0x3bf4f9(0x27c)));for(const _0x576aa0 of _0x5ea2a2['errors']){console['error']('\x20\x20'+a29_0x52c60f[_0x3bf4f9(0x217)]('•')+'\x20'+_0x576aa0);}}}async[a29_0x150261(0x1c9)](_0x3e14df,_0x571b8f){const _0x5373fc=a29_0x150261;if(_0x571b8f[_0x5373fc(0x229)]===0x0){console[_0x5373fc(0x1e3)]('\x0a'+_0x3e14df),console[_0x5373fc(0x1e3)](_0x5373fc(0x24d));return;}console[_0x5373fc(0x1e3)]('\x0a'+_0x3e14df);const _0x57168c=Object[_0x5373fc(0x206)](_0x571b8f[0x0])['map'](_0x5c6e7d=>({'name':_0x5c6e7d,'type':typeof _0x571b8f[0x0][_0x5c6e7d]===_0x5373fc(0x25f)?_0x5373fc(0x1da):_0x5373fc(0x271)})),_0x1b7e2b={'queryId':_0x5373fc(0x288),'columns':_0x57168c,'data':_0x571b8f,'stats':{'state':_0x5373fc(0x19d),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x571b8f[_0x5373fc(0x229)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x2decf8=formatAsTable(_0x1b7e2b,_0x571b8f[_0x5373fc(0x229)],!![]);await writeOutput(_0x2decf8,undefined,_0x5373fc(0x272));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x21b);[a29_0x150261(0x220)]=a29_0x150261(0x295);async[a29_0x150261(0x26f)](_0x309859){const _0x3909d8=a29_0x150261,{options:_0x4c9793,args:_0x230c02,tdx:_0x2d6d0f}=_0x309859,_0x4efef9=_0x4c9793,_0x5f46d1=_0x230c02[0x0]||_0x4c9793[_0x3909d8(0x278)];if(!_0x5f46d1)return showParentSegmentNotSetError(_0x3909d8(0x1d5)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x1e1aff=resolveYamlFile(_0x5f46d1);if(existsSync(_0x1e1aff)){_0x4efef9[_0x3909d8(0x2ab)]&&console[_0x3909d8(0x1e3)](_0x3909d8(0x267)+_0x1e1aff);let _0x3557e;try{_0x3557e=readFileSync(_0x1e1aff,_0x3909d8(0x247));}catch(_0x359ddc){const _0x25d8cc=_0x359ddc instanceof Error?_0x359ddc['message']:String(_0x359ddc);return console[_0x3909d8(0x1e3)](_0x3909d8(0x243)+_0x25d8cc),0x1;}const _0x4f6c41=await withSpinner(_0x3909d8(0x279),()=>_0x2d6d0f[_0x3909d8(0x2bc)]['pushParentYaml'](_0x3557e),{'verbose':_0x4efef9['verbose']}),_0x1c8269=_0x4f6c41[_0x3909d8(0x210)],{isNew:_0x1f0599,name:_0x21ef94,hasChanges:_0x346068,diffFormatted:_0x535ee7}=_0x1c8269;if(_0x346068){_0x1f0599?console['error'](_0x3909d8(0x19e)+_0x21ef94+'\x27:'):console['error'](_0x3909d8(0x1b9)+_0x21ef94+'\x27:');console['error']('─'[_0x3909d8(0x2c5)](0x3c)),console[_0x3909d8(0x1e3)](_0x535ee7),console['error']('─'[_0x3909d8(0x2c5)](0x3c));const _0x4b9f9a=_0x1f0599?_0x3909d8(0x1bd)+_0x21ef94+'\x27\x20and\x20run\x20workflow?':'Apply\x20changes\x20to\x20\x27'+_0x21ef94+'\x27\x20and\x20run\x20workflow?';if(!_0x4efef9['yes']){const _0x38144e=await confirmKey(_0x4b9f9a);if(!_0x38144e)return console[_0x3909d8(0x1e3)]('Aborted.'),0x1;}const _0x2a3caa=_0x1f0599?_0x3909d8(0x194):'Updating';await withSpinner(_0x2a3caa+_0x3909d8(0x24f)+_0x21ef94+_0x3909d8(0x1e4),()=>_0x1c8269[_0x3909d8(0x233)](),{'verbose':_0x4efef9[_0x3909d8(0x2ab)]});const _0x498d9a=_0x1f0599?_0x3909d8(0x196):_0x3909d8(0x1a9);console[_0x3909d8(0x1e3)]('✔\x20'+_0x498d9a+_0x3909d8(0x24f)+_0x21ef94+'\x27');}else console[_0x3909d8(0x1e3)](_0x3909d8(0x223)+_0x21ef94+_0x3909d8(0x258));}const _0xf82416=await withSpinner(_0x3909d8(0x1fb)+_0x5f46d1+'\x27...',()=>_0x2d6d0f[_0x3909d8(0x2bc)][_0x3909d8(0x287)](_0x5f46d1),{'verbose':_0x4efef9[_0x3909d8(0x2ab)]}),_0x585df9=_0xf82416[_0x3909d8(0x210)],_0x2e17b8=getConsoleUrl(_0x4efef9[_0x3909d8(0x235)],'/app/workflows/'+_0x585df9[_0x3909d8(0x1e0)]+_0x3909d8(0x23a)+_0x585df9['workflowSessionId']+_0x3909d8(0x28b)+_0x585df9[_0x3909d8(0x241)]);return console['error'](_0x3909d8(0x2ae)),console['error']('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)](_0x3909d8(0x1f5))+'\x20'+_0x585df9[_0x3909d8(0x205)]),console[_0x3909d8(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)](_0x3909d8(0x197))+'\x20'+_0x585df9[_0x3909d8(0x28a)]),console[_0x3909d8(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)]('Session:')+'\x20'+_0x585df9[_0x3909d8(0x1cf)]),console['error']('\x20\x20'+a29_0x52c60f['dim'](_0x3909d8(0x25d))+'\x20'+_0x585df9['workflowAttemptId']),console['error']('\x20\x20'+_0x2e17b8),console[_0x3909d8(0x1e3)]('\x0a'+a29_0x52c60f[_0x3909d8(0x281)]('To\x20cancel:')+_0x3909d8(0x25c)+_0x585df9['workflowAttemptId']+_0x3909d8(0x263)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x261);[a29_0x150261(0x220)]=a29_0x150261(0x253);async[a29_0x150261(0x26f)](_0x17aacb){const _0x59fc87=a29_0x150261,{options:_0x59975c,args:_0x2bf33a,tdx:_0xc643bd}=_0x17aacb,_0x3d88a9=_0x2bf33a[0x0]||_0x59975c[_0x59fc87(0x278)];if(!_0x3d88a9)return showParentSegmentNotSetError(_0x59fc87(0x1ac)+_0x59fc87(0x29a)),0x1;_0x59975c['verbose']&&(console[_0x59fc87(0x1e3)](_0x59fc87(0x270)+_0x59975c['site']),console[_0x59fc87(0x1e3)](_0x59fc87(0x2a1)+_0x3d88a9));const _0x5645f2=await withSpinner(_0x59fc87(0x19a)+_0x3d88a9+'\x27...',()=>_0xc643bd['segment'][_0x59fc87(0x2a4)](_0x3d88a9),{'verbose':_0x59975c[_0x59fc87(0x2ab)]}),_0x186a57=_0x5645f2[_0x59fc87(0x210)];console[_0x59fc87(0x1e3)](_0x59fc87(0x275)+_0x186a57[_0x59fc87(0x229)]+_0x59fc87(0x202)+(_0x186a57[_0x59fc87(0x229)]!==0x1?'s':''));if(_0x59975c[_0x59fc87(0x24a)]||_0x59975c[_0x59fc87(0x2c6)])return await handleSDKOutput(_0x186a57,_0x59975c),0x0;return displayFieldsHumanReadable(_0x186a57,_0x3d88a9),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']='segment:parent:view';[a29_0x150261(0x220)]='Show\x20parent\x20segment\x20details';async[a29_0x150261(0x26f)](_0x2c09d0){const _0x359993=a29_0x150261,{options:_0x431d38,args:_0x5a90ae,tdx:_0x582302}=_0x2c09d0,_0x517da5=_0x431d38,_0x411d21=_0x5a90ae[0x0]||_0x431d38[_0x359993(0x278)];if(!_0x411d21)return showParentSegmentNotSetError(_0x359993(0x1ee)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x359993(0x2a2)+_0x359993(0x1c7)),0x1;_0x431d38[_0x359993(0x2ab)]&&(console[_0x359993(0x1e3)]('Site:\x20'+_0x431d38[_0x359993(0x235)]),console[_0x359993(0x1e3)]('Parent\x20segment:\x20'+_0x411d21));const _0x2ccb38=await withSpinner(_0x359993(0x1b1)+_0x411d21+'\x27...',()=>_0x582302['segment'][_0x359993(0x276)](_0x411d21),{'verbose':_0x431d38[_0x359993(0x2ab)]}),_0x53796a=_0x2ccb38[_0x359993(0x210)];if(_0x517da5[_0x359993(0x1e2)]){const _0x1fbec3=getConsoleNextUrl(_0x517da5[_0x359993(0x235)],_0x359993(0x291)+_0x53796a['id']);return console['error'](a29_0x52c60f[_0x359993(0x1ca)]('✔')+_0x359993(0x1f4)+a29_0x52c60f[_0x359993(0x26c)](_0x1fbec3)),openBrowser(_0x1fbec3),0x0;}return await handleSingleObjectOutput(_0x53796a,_0x431d38),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a29_0x150261(0x2bd);[a29_0x150261(0x220)]=a29_0x150261(0x25b);async['execute'](_0x70b310){const _0x8fc6b9=a29_0x150261,{options:_0x47bc42,args:_0x1993df,tdx:_0x32bc75}=_0x70b310,_0x373a46=_0x1993df[0x0]||_0x47bc42['parentSegment'];if(!_0x373a46)return showParentSegmentNotSetError(_0x8fc6b9(0x2bf)+_0x8fc6b9(0x1ea)),0x1;_0x47bc42[_0x8fc6b9(0x2ab)]&&(console[_0x8fc6b9(0x1e3)](_0x8fc6b9(0x270)+_0x47bc42[_0x8fc6b9(0x235)]),console['error'](_0x8fc6b9(0x2a1)+_0x373a46));const _0x2a6ccb=await withSpinner(_0x8fc6b9(0x25a)+_0x373a46+_0x8fc6b9(0x1e4),()=>_0x32bc75[_0x8fc6b9(0x2bc)][_0x8fc6b9(0x1ad)](_0x373a46),{'verbose':_0x47bc42[_0x8fc6b9(0x2ab)]}),_0x332a4b=_0x2a6ccb[_0x8fc6b9(0x210)],_0x22aa12=await withSpinner(_0x8fc6b9(0x2a5)+_0x373a46+_0x8fc6b9(0x1e4),()=>_0x32bc75[_0x8fc6b9(0x2bc)]['getParentSQL'](_0x332a4b),{'verbose':_0x47bc42[_0x8fc6b9(0x2ab)]}),_0x1fbe23=await executeSchemaQuery(_0x22aa12['data'],_0x32bc75,_0x47bc42);return await handleQueryOutput(_0x1fbe23,_0x47bc42),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x1f0);[a29_0x150261(0x220)]=a29_0x150261(0x1d7);async[a29_0x150261(0x26f)](_0x1500c4){const _0x21ed56=a29_0x150261,{options:_0x3b8d7c,args:_0x5b7b0f,tdx:_0x504a15}=_0x1500c4,_0x58a8a3=_0x5b7b0f[0x0]||_0x3b8d7c[_0x21ed56(0x278)];if(!_0x58a8a3)return showParentSegmentNotSetError(_0x21ed56(0x28f)+_0x21ed56(0x24c)),0x1;_0x3b8d7c[_0x21ed56(0x2ab)]&&(console[_0x21ed56(0x1e3)](_0x21ed56(0x270)+_0x3b8d7c[_0x21ed56(0x235)]),console['error'](_0x21ed56(0x2a1)+_0x58a8a3));const _0x5e9fb7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x58a8a3+_0x21ed56(0x1e4),()=>_0x504a15[_0x21ed56(0x2bc)]['resolveParentId'](_0x58a8a3),{'verbose':_0x3b8d7c[_0x21ed56(0x2ab)]}),_0xbcc481=_0x5e9fb7[_0x21ed56(0x210)],_0xb77947=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x58a8a3+_0x21ed56(0x1e4),()=>_0x504a15['segment']['getParentSQL'](_0xbcc481),{'verbose':_0x3b8d7c[_0x21ed56(0x2ab)]}),_0x1c07e1=_0xb77947['data'];return _0x3b8d7c[_0x21ed56(0x2b4)]==='json'||_0x3b8d7c[_0x21ed56(0x2b4)]===_0x21ed56(0x2c6)?await handleSDKOutput([{'sql':_0x1c07e1}],_0x3b8d7c):console[_0x21ed56(0x2ad)](_0x1c07e1),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x265);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x2463b7){const _0x58af4a=a29_0x150261,{options:_0x9db99d,args:_0x12b1f6,tdx:_0x338d0a}=_0x2463b7,_0x5194f3=_0x12b1f6[0x0]||_0x9db99d[_0x58af4a(0x278)];if(!_0x5194f3)return showParentSegmentNotSetError(_0x58af4a(0x21c)+_0x58af4a(0x1db)),0x1;_0x9db99d['verbose']&&(console[_0x58af4a(0x1e3)](_0x58af4a(0x270)+_0x9db99d[_0x58af4a(0x235)]),console[_0x58af4a(0x1e3)](_0x58af4a(0x2a1)+_0x5194f3));const _0xd6a439=await withSpinner(_0x58af4a(0x25a)+_0x5194f3+'\x27...',()=>_0x338d0a['segment'][_0x58af4a(0x1ad)](_0x5194f3),{'verbose':_0x9db99d[_0x58af4a(0x2ab)]}),_0x28b0ba=_0xd6a439[_0x58af4a(0x210)],_0x3dcf14=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5194f3+_0x58af4a(0x1e4),()=>_0x338d0a[_0x58af4a(0x2bc)]['getParentSQL'](_0x28b0ba),{'verbose':_0x9db99d[_0x58af4a(0x2ab)]});let _0x5658a3=_0x3dcf14['data'];const _0x3244b5=resolveLimit(_0x9db99d[_0x58af4a(0x1ff)],DEFAULT_DISPLAY_LIMIT),_0x1681c1=/\bLIMIT\s+\d+/i[_0x58af4a(0x21e)](_0x5658a3);!_0x1681c1&&(_0x5658a3=_0x5658a3[_0x58af4a(0x29e)]()[_0x58af4a(0x1e8)](/;+$/,''),_0x5658a3=_0x58af4a(0x2aa)+_0x5658a3+_0x58af4a(0x231)+_0x3244b5);_0x9db99d['verbose']&&console[_0x58af4a(0x1e3)](_0x58af4a(0x1a1)+_0x5658a3);const _0x39d255=await withQuerySpinner('Executing\x20parent\x20segment\x20query...',async _0x18a056=>{const _0x593c81=_0x58af4a,_0xee98e2=await _0x338d0a[_0x593c81(0x2a3)]['execute'](_0x5658a3,{'catalog':'td','schema':_0x593c81(0x1a4),'onJobId':_0x1c0bf7=>{const _0x167e2f=_0x593c81;_0x18a056[_0x167e2f(0x23d)](_0x1c0bf7);}});return _0xee98e2;},{'verbose':_0x9db99d[_0x58af4a(0x2ab)]}),_0x2ef5c2=_0x39d255[_0x58af4a(0x210)],_0x100b99=_0x2ef5c2[_0x58af4a(0x1fd)]?'\x20[Job\x20ID:\x20'+_0x2ef5c2[_0x58af4a(0x1fd)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x2ef5c2[_0x58af4a(0x255)][_0x58af4a(0x22f)][_0x58af4a(0x1d2)]()+_0x58af4a(0x286)+(_0x58af4a(0x27e)+formatElapsed(_0x2ef5c2[_0x58af4a(0x255)][_0x58af4a(0x1c8)])+_0x100b99)),await handleQueryOutput(_0x2ef5c2,_0x9db99d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0xb4cc3=a30_0x3119;(function(_0x458094,_0x2c6514){const _0x2bdbef=a30_0x3119,_0x107b61=_0x458094();while(!![]){try{const _0x17a791=parseInt(_0x2bdbef(0x83))/0x1+-parseInt(_0x2bdbef(0x80))/0x2*(-parseInt(_0x2bdbef(0x7d))/0x3)+-parseInt(_0x2bdbef(0x7f))/0x4+parseInt(_0x2bdbef(0x84))/0x5+-parseInt(_0x2bdbef(0x79))/0x6+parseInt(_0x2bdbef(0x78))/0x7*(parseInt(_0x2bdbef(0x7e))/0x8)+parseInt(_0x2bdbef(0x86))/0x9*(parseInt(_0x2bdbef(0x82))/0xa);if(_0x17a791===_0x2c6514)break;else _0x107b61['push'](_0x107b61['shift']());}catch(_0x4dfb42){_0x107b61['push'](_0x107b61['shift']());}}}(a30_0x146c,0xd12f3));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a30_0x3119(_0x5ba88e,_0x1e47ba){_0x5ba88e=_0x5ba88e-0x71;const _0x146c26=a30_0x146c();let _0x3119d4=_0x146c26[_0x5ba88e];return _0x3119d4;}function a30_0x146c(){const _0x419424=['error','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','config','length','7obFIFm','3908916aUqwYT','name','\x20\x20Global:\x20~/.config/tdx/tdx.json','execute','198hKhdFL','1401096qSISIm','4844236mXnoEM','12552GdnHcZ','map','1420VaJCuU','991026FYTbET','3785735SeegAt','scope','24201oBYlpr','description','profiles','Error:\x20','List\x20all\x20available\x20profiles','log','message'];a30_0x146c=function(){return _0x419424;};return a30_0x146c();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0xb4cc3(0x7a)]=a30_0xb4cc3(0x88);[a30_0xb4cc3(0x87)]=a30_0xb4cc3(0x71);async[a30_0xb4cc3(0x7c)](_0x5ce911){const _0x2e63d5=a30_0xb4cc3,{options:_0x3bf9a5}=_0x5ce911;try{const _0x114e64=listProfiles(),_0x1b3be0=getActiveProfile();if(_0x114e64[_0x2e63d5(0x77)]===0x0)return console['log']('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x2e63d5(0x72)](_0x2e63d5(0x75)),console[_0x2e63d5(0x72)](_0x2e63d5(0x7b)),0x0;const _0x893313=_0x114e64[_0x2e63d5(0x81)](_0x5408b4=>{const _0x1d83e8=_0x2e63d5,_0x1f3bd6=_0x5408b4['name']===_0x1b3be0,_0xdbfd8c=getProfileParams(_0x5408b4[_0x1d83e8(0x76)]);return{'name':_0x5408b4[_0x1d83e8(0x7a)],'active':_0x1f3bd6,'scope':_0x5408b4[_0x1d83e8(0x85)],'description':_0x5408b4[_0x1d83e8(0x76)][_0x1d83e8(0x87)]||'','params':_0xdbfd8c};});return await handleSDKOutput(_0x893313,_0x3bf9a5),0x0;}catch(_0x83faa8){return _0x83faa8 instanceof Error&&console[_0x2e63d5(0x74)](_0x2e63d5(0x89)+_0x83faa8[_0x2e63d5(0x73)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0xd30a8d=a31_0xf0cf;(function(_0x720062,_0x1fb136){const _0x1654ce=a31_0xf0cf,_0x470ac3=_0x720062();while(!![]){try{const _0x42aeac=-parseInt(_0x1654ce(0x19c))/0x1*(parseInt(_0x1654ce(0x1a3))/0x2)+-parseInt(_0x1654ce(0x18f))/0x3*(parseInt(_0x1654ce(0x1a5))/0x4)+-parseInt(_0x1654ce(0x17c))/0x5*(parseInt(_0x1654ce(0x17d))/0x6)+-parseInt(_0x1654ce(0x1ad))/0x7+-parseInt(_0x1654ce(0x192))/0x8+parseInt(_0x1654ce(0x1af))/0x9+parseInt(_0x1654ce(0x18e))/0xa;if(_0x42aeac===_0x1fb136)break;else _0x470ac3['push'](_0x470ac3['shift']());}catch(_0x12b79d){_0x470ac3['push'](_0x470ac3['shift']());}}}(a31_0x4e1c,0xd279e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0x4e1c(){const _0x2de3ee=['39205460nPlVIF','5145ROdGtk','\x20-\x20','data','6737592JisGUD','query','validate','message','totalSplits','state','in\x20','file','Query\x20completed:\x20Processed\x20','database','1znqMND','...','originalMessage','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','Executing\x20statement\x20','processedRows','catalog','2227878VXNVAN','site','724LyNIvU','push','Executing\x20query...','completedSplits','setExtra','\x20rows\x20','length','error','4468247bkarQR','name','3476304sDsvvm','elapsedTimeMillis','10JAwgFK','1619454SLfIbt','Site:\x20','jobId','output','Statement\x20','Executing\x20query\x20[','SQL:\x20','\x20[Job\x20ID:\x20','No\x20SQL\x20provided','Run\x20Trino\x20queries\x20(streaming)','join','stats','Schema:\x20','Error:\x20','verbose','Catalog:\x20','setJobId'];a31_0x4e1c=function(){return _0x2de3ee;};return a31_0x4e1c();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';function a31_0xf0cf(_0x531163,_0x3f389f){_0x531163=_0x531163-0x17b;const _0x4e1cb5=a31_0x4e1c();let _0xf0cf7d=_0x4e1cb5[_0x531163];return _0xf0cf7d;}import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a31_0xd30a8d(0x1ae)]='query';['description']=a31_0xd30a8d(0x186);async['execute'](_0x388393){const _0x4260b4=a31_0xd30a8d,{options:_0x13a22b,args:_0x1eea92,tdx:_0x4965f6}=_0x388393,_0x2c2d4b=_0x1eea92[0x0],_0x346d53=_0x13a22b[_0x4260b4(0x199)];let _0x216cd9;try{if(_0x346d53)_0x216cd9=readSqlStatementsFromFile(_0x346d53);else{if(_0x2c2d4b==='-')_0x216cd9=await readSqlStatementsFromStdin();else{if(_0x2c2d4b&&isSqlFilePath(_0x2c2d4b))_0x216cd9=readSqlStatementsFromFile(_0x2c2d4b);else{if(_0x2c2d4b)_0x216cd9=splitSqlStatements(_0x2c2d4b);else throw new Error(_0x4260b4(0x185));}}}}catch(_0x4c9356){return console['error'](_0x4260b4(0x18a)+_0x4c9356[_0x4260b4(0x195)]),0x1;}const _0x8d9371=_0x13a22b[_0x4260b4(0x19b)]||'information_schema',_0x2695df=_0x13a22b[_0x4260b4(0x1a2)];try{const _0x50c189=[],_0x42e3d2=!!_0x13a22b['output'];for(let _0x42216e=0x0;_0x42216e<_0x216cd9['length'];_0x42216e++){const _0x479e07=_0x216cd9[_0x42216e],_0x2f5a82=_0x42216e+0x1,_0x92c747=_0x216cd9[_0x4260b4(0x1ab)],_0x4b03f4=_0x92c747>0x1;_0x13a22b[_0x4260b4(0x18b)]&&(console[_0x4260b4(0x1ac)]('\x0a'+(_0x4b03f4?_0x4260b4(0x181)+_0x2f5a82+'/'+_0x92c747+':':'')),console[_0x4260b4(0x1ac)](_0x4260b4(0x17e)+_0x13a22b[_0x4260b4(0x1a4)]),console[_0x4260b4(0x1ac)](_0x4260b4(0x18c)+(_0x2695df||'td')),console[_0x4260b4(0x1ac)](_0x4260b4(0x189)+_0x8d9371),console[_0x4260b4(0x1ac)](_0x4260b4(0x183)+_0x479e07));const _0x800fc2=_0x4b03f4?_0x4260b4(0x1a0)+_0x2f5a82+'/'+_0x92c747+_0x4260b4(0x19d):_0x4260b4(0x1a7);try{const _0x333b22=await withQuerySpinner(_0x800fc2,async _0x42eebc=>{const _0xb7de0a=_0x4260b4,_0x241a6b=await _0x4965f6[_0xb7de0a(0x193)]['execute'](_0x479e07,{'catalog':_0x2695df,'schema':_0x8d9371,'onJobId':_0x33445f=>{const _0x275c1c=_0xb7de0a;_0x42eebc[_0x275c1c(0x18d)](_0x33445f);},'onProgress':_0xa68a8=>{const _0x4f22ac=_0xb7de0a;_0x42eebc['setPhase'](_0x4f22ac(0x182)+_0xa68a8[_0x4f22ac(0x197)]+']'),_0x42eebc[_0x4f22ac(0x1a9)](formatRows(_0xa68a8['processedRows'])+_0x4f22ac(0x1aa)+_0xa68a8[_0x4f22ac(0x1a8)]+'/'+_0xa68a8[_0x4f22ac(0x196)]+'\x20splits');}});return _0x241a6b;},{'verbose':_0x13a22b[_0x4260b4(0x18b)]}),_0x29428d=_0x333b22[_0x4260b4(0x191)],_0x3a04b3=_0x29428d[_0x4260b4(0x17f)]?_0x4260b4(0x184)+_0x29428d[_0x4260b4(0x17f)]+']':'',_0x3a335b=_0x4b03f4?'Statement\x20'+_0x2f5a82+'/'+_0x92c747+_0x4260b4(0x190):'';console[_0x4260b4(0x1ac)]('✔\x20'+_0x3a335b+_0x4260b4(0x19a)+formatRows(_0x29428d['stats'][_0x4260b4(0x1a1)])+'\x20rows\x20'+(_0x4260b4(0x198)+formatElapsed(_0x29428d[_0x4260b4(0x188)][_0x4260b4(0x17b)])+_0x3a04b3));if(_0x4b03f4&&_0x42e3d2){const _0xf1c2e=resolveOutputOptions(_0x13a22b),_0x3c4721=await formatQueryOutput(_0x29428d,_0xf1c2e);_0x50c189[_0x4260b4(0x1a6)](_0x3c4721);}else await handleQueryOutput(_0x29428d,_0x13a22b);}catch(_0x402434){const _0x4bb563=_0x4b03f4?_0x4260b4(0x181)+_0x2f5a82+'/'+_0x92c747+':\x0a':'',_0x46c4a5=_0x402434 instanceof SDKError?_0x402434[_0x4260b4(0x19e)]:_0x402434[_0x4260b4(0x195)];return console[_0x4260b4(0x1ac)](''+_0x4bb563+_0x46c4a5),0x1;}}if(_0x216cd9[_0x4260b4(0x1ab)]>0x1&&_0x42e3d2&&_0x50c189[_0x4260b4(0x1ab)]>0x0){const _0x244666=_0x50c189[_0x4260b4(0x187)]('\x0a');writeFileSync(_0x13a22b[_0x4260b4(0x180)],_0x244666),console[_0x4260b4(0x1ac)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x13a22b[_0x4260b4(0x180)]);}return 0x0;}catch(_0x453255){throw _0x453255;}}[a31_0xd30a8d(0x194)](_0x493ad8){const _0x49ec27=a31_0xd30a8d,_0x2c865b=_0x493ad8['args'][0x0],_0x3148a2=_0x493ad8['options'][_0x49ec27(0x199)];if(!_0x2c865b&&!_0x3148a2)return _0x49ec27(0x19f);if(_0x2c865b&&_0x3148a2)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x2274e8=a32_0x2bb6;(function(_0x1d7936,_0x982175){const _0x50f0f0=a32_0x2bb6,_0x31424a=_0x1d7936();while(!![]){try{const _0x4333f7=-parseInt(_0x50f0f0(0x21f))/0x1*(parseInt(_0x50f0f0(0x1fb))/0x2)+-parseInt(_0x50f0f0(0x27b))/0x3*(-parseInt(_0x50f0f0(0x273))/0x4)+-parseInt(_0x50f0f0(0x271))/0x5*(-parseInt(_0x50f0f0(0x1f2))/0x6)+parseInt(_0x50f0f0(0x20e))/0x7+-parseInt(_0x50f0f0(0x229))/0x8+-parseInt(_0x50f0f0(0x1f1))/0x9+-parseInt(_0x50f0f0(0x276))/0xa;if(_0x4333f7===_0x982175)break;else _0x31424a['push'](_0x31424a['shift']());}catch(_0x59d405){_0x31424a['push'](_0x31424a['shift']());}}}(a32_0xa8ad,0x3b6a2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0xa45164 from'chalk';function resolveSegmentTarget(_0x4480e5,_0x533144,_0x3b869c){const _0x220198=a32_0x2bb6;if(isYamlFilePath(_0x4480e5))try{const _0x8249ec=resolveYamlFilePath(_0x4480e5);return _0x3b869c&&(console['error'](_0x220198(0x27f)+_0x4480e5),console['error'](_0x220198(0x250)+_0x8249ec[_0x220198(0x1ff)]),console[_0x220198(0x24f)]('\x20\x20Segment\x20name:\x20'+_0x8249ec['segmentName']),console['error'](_0x220198(0x26b)+(_0x8249ec[_0x220198(0x23e)]||_0x220198(0x289))),console['error'](_0x220198(0x25a)+_0x8249ec['fullPath'])),_0x8249ec[_0x220198(0x253)];}catch(_0x4d609f){throw new SDKError(ErrorCode[_0x220198(0x1f4)],_0x220198(0x210)+_0x4d609f[_0x220198(0x202)]);}if(!_0x533144)throw new SDKError(ErrorCode[_0x220198(0x1f4)],_0x220198(0x20f));return _0x533144+'/'+_0x4480e5;}export class SegmentDescribeCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x1f6);['description']=a32_0x2274e8(0x265);async[a32_0x2274e8(0x213)](_0x45d228){const _0x40e85c=a32_0x2274e8,{options:_0x19c0fc,args:_0x2de484,tdx:_0x3a062b}=_0x45d228,_0x122317=_0x2de484[0x0],_0x5aec66=!_0x122317&&!!_0x19c0fc[_0x40e85c(0x1ff)],_0x566128=_0x122317||_0x19c0fc['parentSegment'];if(!_0x566128)return console[_0x40e85c(0x24f)](_0x40e85c(0x248)),console['error'](_0x40e85c(0x226)),console['error'](_0x40e85c(0x256)),console[_0x40e85c(0x24f)](_0x40e85c(0x22c)),console['error'](_0x40e85c(0x264)),console[_0x40e85c(0x24f)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x40e85c(0x20a)),0x1;try{const _0x321e6a=_0x19c0fc[_0x40e85c(0x1f9)];let _0x1e712f=_0x566128;!_0x5aec66&&_0x321e6a&&!_0x566128['includes']('/')&&(_0x1e712f=_0x321e6a+'/'+_0x566128,_0x19c0fc[_0x40e85c(0x267)]&&console[_0x40e85c(0x24f)](_0x40e85c(0x279)+_0x1e712f));const _0x1075c6=await withSpinner(_0x40e85c(0x268)+_0x1e712f+_0x40e85c(0x26a),()=>_0x3a062b['segment'][_0x40e85c(0x282)](_0x1e712f),{'verbose':_0x19c0fc[_0x40e85c(0x267)]}),_0x5834e8=_0x1075c6[_0x40e85c(0x20c)];_0x19c0fc[_0x40e85c(0x267)]&&(console[_0x40e85c(0x24f)](_0x40e85c(0x217)+_0x5834e8[_0x40e85c(0x1f8)]),console[_0x40e85c(0x24f)](_0x40e85c(0x26c)+_0x5834e8[_0x40e85c(0x23f)]),_0x5834e8['folderId']&&console['error'](_0x40e85c(0x277)+_0x5834e8['folderId']),_0x5834e8['segmentId']&&console[_0x40e85c(0x24f)](_0x40e85c(0x21a)+_0x5834e8[_0x40e85c(0x237)]));if(_0x5834e8[_0x40e85c(0x1f8)]===_0x40e85c(0x28d)){const _0x397d71=await withSpinner(_0x40e85c(0x24d),()=>_0x3a062b[_0x40e85c(0x28e)][_0x40e85c(0x20d)](_0x5834e8[_0x40e85c(0x23f)]),{'verbose':_0x19c0fc['verbose']});await handleSingleObjectOutput(_0x397d71[_0x40e85c(0x20c)],_0x19c0fc);}else{if(_0x5834e8['type']===_0x40e85c(0x25c)){if(!_0x5834e8[_0x40e85c(0x228)])throw new SDKError(ErrorCode[_0x40e85c(0x283)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x332b5d=await withSpinner(_0x40e85c(0x284),()=>_0x3a062b[_0x40e85c(0x28e)][_0x40e85c(0x22d)](_0x5834e8['folderId']),{'verbose':_0x19c0fc['verbose']});await handleSingleObjectOutput(_0x332b5d[_0x40e85c(0x20c)],_0x19c0fc);}else{if(_0x5834e8[_0x40e85c(0x1f8)]===_0x40e85c(0x28e)){if(!_0x5834e8[_0x40e85c(0x237)])throw new SDKError(ErrorCode[_0x40e85c(0x200)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x53a438=await withSpinner(_0x40e85c(0x280),()=>_0x3a062b[_0x40e85c(0x28e)][_0x40e85c(0x247)](_0x5834e8[_0x40e85c(0x23f)],_0x5834e8[_0x40e85c(0x237)]),{'verbose':_0x19c0fc[_0x40e85c(0x267)]});await handleSingleObjectOutput(_0x53a438['data'],_0x19c0fc);}}}return 0x0;}catch(_0x55cd9f){if(_0x55cd9f instanceof SDKError)return console[_0x40e85c(0x24f)](_0x40e85c(0x1ef)+_0x55cd9f[_0x40e85c(0x202)]),_0x55cd9f[_0x40e85c(0x24c)]&&console[_0x40e85c(0x24f)](_0x40e85c(0x204)+_0x55cd9f[_0x40e85c(0x24c)]),0x1;throw _0x55cd9f;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x249);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x215);async[a32_0x2274e8(0x213)](_0x1d5d2b){const _0x446f49=a32_0x2274e8,{options:_0x492a2e,args:_0x27c2f5,tdx:_0x16e80f}=_0x1d5d2b,_0x44915a=_0x27c2f5[0x0];if(!_0x44915a)return console[_0x446f49(0x24f)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x446f49(0x24f)](_0x446f49(0x27c)),console[_0x446f49(0x24f)](_0x446f49(0x256)),console[_0x446f49(0x24f)](_0x446f49(0x23d)),console['error'](_0x446f49(0x260)),0x1;try{const _0x34b2f7=_0x492a2e[_0x446f49(0x1ff)],_0x17bdfd=resolveSegmentTarget(_0x44915a,_0x34b2f7,_0x492a2e['verbose']);_0x492a2e[_0x446f49(0x267)]&&console['error'](_0x446f49(0x258)+_0x17bdfd);const _0x406c14=await withSpinner('Resolving\x20\x27'+_0x44915a+_0x446f49(0x26a),()=>_0x16e80f[_0x446f49(0x28e)][_0x446f49(0x282)](_0x17bdfd),{'verbose':_0x492a2e[_0x446f49(0x267)]}),_0x49cbf5=_0x406c14[_0x446f49(0x20c)];_0x492a2e[_0x446f49(0x267)]&&(console[_0x446f49(0x24f)]('Resolved\x20type:\x20'+_0x49cbf5[_0x446f49(0x1f8)]),console['error']('Parent\x20ID:\x20'+_0x49cbf5[_0x446f49(0x23f)]));if(_0x49cbf5['type']==='folder')return console[_0x446f49(0x24f)](_0x446f49(0x231)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x49cbf5[_0x446f49(0x1f8)]===_0x446f49(0x28d))return console[_0x446f49(0x24f)](_0x446f49(0x220)),console[_0x446f49(0x24f)](_0x446f49(0x244)),0x1;if(!_0x49cbf5[_0x446f49(0x237)])throw new SDKError(ErrorCode[_0x446f49(0x200)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x28a35a=await withSpinner(_0x446f49(0x22e),()=>_0x16e80f['segment'][_0x446f49(0x26f)](_0x49cbf5[_0x446f49(0x23f)],_0x49cbf5[_0x446f49(0x237)]),{'verbose':_0x492a2e[_0x446f49(0x267)]});let _0x214b3c=_0x28a35a[_0x446f49(0x20c)];const _0x3ca9bd=resolveLimit(_0x492a2e[_0x446f49(0x24e)],DEFAULT_DISPLAY_LIMIT),_0x8290b2=/\bLIMIT\s+\d+/i[_0x446f49(0x275)](_0x214b3c);!_0x8290b2&&(_0x214b3c=_0x214b3c['trim']()['replace'](/;+$/,''),_0x214b3c=_0x446f49(0x242)+_0x214b3c+_0x446f49(0x214)+_0x3ca9bd);_0x492a2e[_0x446f49(0x267)]&&console['error'](_0x446f49(0x234)+_0x214b3c);const _0xb96b41=await withQuerySpinner(_0x446f49(0x241),async _0x533b7c=>{const _0x25793a=_0x446f49,_0x29975f=await _0x16e80f[_0x25793a(0x286)][_0x25793a(0x213)](_0x214b3c,{'catalog':'td','schema':'information_schema','onJobId':_0x4bd363=>{const _0x51b659=_0x25793a;_0x533b7c[_0x51b659(0x205)](_0x4bd363);}});return _0x29975f;},{'verbose':_0x492a2e[_0x446f49(0x267)]}),_0x172d79=_0xb96b41['data'],_0x3d7e98=_0x172d79[_0x446f49(0x25e)]?'\x20[Job\x20ID:\x20'+_0x172d79['jobId']+']':'';return console[_0x446f49(0x24f)](_0x446f49(0x238)+_0x172d79[_0x446f49(0x259)][_0x446f49(0x23c)]['toLocaleString']()+_0x446f49(0x209)+('in\x20'+formatElapsed(_0x172d79[_0x446f49(0x259)][_0x446f49(0x24b)])+_0x3d7e98)),await handleQueryOutput(_0x172d79,_0x492a2e),0x0;}catch(_0x5bcb72){if(_0x5bcb72 instanceof SDKError)return console[_0x446f49(0x24f)](_0x446f49(0x251)+_0x5bcb72['code']+']'),console[_0x446f49(0x24f)]('\x0a'+_0x5bcb72['message']),0x1;throw _0x5bcb72;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x2274e8(0x239)]='segment:folder:list';[a32_0x2274e8(0x1f5)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a32_0x2274e8(0x213)](_0x5d35fe){const _0x488e13=a32_0x2274e8,{options:_0x17dcb0,args:_0x16fd8c,tdx:_0x5da57a}=_0x5d35fe;if(_0x16fd8c['length']===0x0)return console[_0x488e13(0x24f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x488e13(0x24f)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x46a534=_0x16fd8c[0x0];try{_0x17dcb0[_0x488e13(0x267)]&&(console[_0x488e13(0x24f)](_0x488e13(0x25d)+_0x17dcb0['site']),console[_0x488e13(0x24f)](_0x488e13(0x285)+_0x46a534));const _0x2dd30=await withSpinner(_0x488e13(0x261)+_0x46a534+_0x488e13(0x26a),()=>_0x5da57a[_0x488e13(0x28e)][_0x488e13(0x243)](_0x46a534),{'verbose':_0x17dcb0[_0x488e13(0x267)]}),_0x434dd8=_0x2dd30['data'];_0x17dcb0[_0x488e13(0x267)]&&console[_0x488e13(0x24f)]('Resolved\x20parent\x20ID:\x20'+_0x434dd8);const _0x46c808=await withSpinner(_0x488e13(0x24a)+_0x46a534+_0x488e13(0x26a),()=>_0x5da57a[_0x488e13(0x28e)]['listFolders'](_0x434dd8),{'verbose':_0x17dcb0[_0x488e13(0x267)]}),_0x29117a=_0x46c808[_0x488e13(0x20c)];return console['error'](_0x488e13(0x252)+_0x29117a[_0x488e13(0x211)]+_0x488e13(0x27e)+(_0x29117a[_0x488e13(0x211)]!==0x1?'s':'')),await handleSDKOutput(_0x29117a,_0x17dcb0),0x0;}catch(_0x1df1ff){if(_0x1df1ff instanceof SDKError)return console[_0x488e13(0x24f)](_0x488e13(0x1ef)+_0x1df1ff[_0x488e13(0x202)]),_0x1df1ff['cause']&&console[_0x488e13(0x24f)]('\x20\x20Cause:\x20'+_0x1df1ff[_0x488e13(0x24c)]),0x1;throw _0x1df1ff;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x1f7);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x21c);async['execute'](_0xf947aa){const _0x1e9669=a32_0x2274e8,{options:_0x1968b7,args:_0x11d9e7,tdx:_0x1dcccb}=_0xf947aa;if(_0x11d9e7[_0x1e9669(0x211)]===0x0)return console[_0x1e9669(0x24f)](_0x1e9669(0x21b)),console[_0x1e9669(0x24f)](_0x1e9669(0x27a)),0x1;try{const {parentId:_0x2aebed,childId:_0x4e4840}=parseSegmentRef(_0x11d9e7[0x0]);_0x1968b7[_0x1e9669(0x267)]&&(console[_0x1e9669(0x24f)](_0x1e9669(0x25d)+_0x1968b7[_0x1e9669(0x269)]),console[_0x1e9669(0x24f)]('Parent\x20name:\x20'+_0x2aebed),_0x4e4840&&console[_0x1e9669(0x24f)](_0x1e9669(0x219)+_0x4e4840));if(!_0x4e4840)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x5cd8ac=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2aebed+_0x1e9669(0x26a),()=>_0x1dcccb[_0x1e9669(0x28e)][_0x1e9669(0x243)](_0x2aebed),{'verbose':_0x1968b7[_0x1e9669(0x267)]}),_0x1c080f=_0x5cd8ac[_0x1e9669(0x20c)];_0x1968b7[_0x1e9669(0x267)]&&console[_0x1e9669(0x24f)](_0x1e9669(0x224)+_0x1c080f);const _0x2eb834=await withSpinner(_0x1e9669(0x221)+_0x4e4840+'\x27...',()=>_0x1dcccb['segment'][_0x1e9669(0x22f)](_0x1c080f,_0x4e4840),{'verbose':_0x1968b7['verbose']}),_0x470387=_0x2eb834[_0x1e9669(0x20c)];_0x1968b7['verbose']&&console[_0x1e9669(0x24f)](_0x1e9669(0x257)+_0x470387);const _0x18cde8=await withSpinner(_0x1e9669(0x208)+_0x4e4840+'\x27...',()=>_0x1dcccb['segment']['getFolder'](_0x470387),{'verbose':_0x1968b7[_0x1e9669(0x267)]});return await handleSDKOutput([_0x18cde8['data']],_0x1968b7),0x0;}catch(_0x93fc6){if(_0x93fc6 instanceof SDKError)return console[_0x1e9669(0x24f)](_0x1e9669(0x1ef)+_0x93fc6[_0x1e9669(0x202)]),_0x93fc6[_0x1e9669(0x24c)]&&console[_0x1e9669(0x24f)](_0x1e9669(0x204)+_0x93fc6[_0x1e9669(0x24c)]),0x1;throw _0x93fc6;}}}function a32_0x2bb6(_0x4d2503,_0x48c265){_0x4d2503=_0x4d2503-0x1ef;const _0xa8ad7a=a32_0xa8ad();let _0x2bb630=_0xa8ad7a[_0x4d2503];return _0x2bb630;}function a32_0xa8ad(){const _0x4af578=['Creating\x20folder\x20\x27','data','getParent','967960dgCrBZ','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','length','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','execute','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','cyan','Resolved\x20type:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20name:\x20','Segment\x20ID:\x20','Error:\x20Folder\x20reference\x20is\x20required','Show\x20segment\x20folder\x20details','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','json','68WHQvwn','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolved\x20parent\x20ID:\x20','log','Usage:\x20tdx\x20segment\x20describe\x20<path>','Create\x20segment\x20folder\x20for\x20organization','folderId','3682664QmpgVS','/app/ps/','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','getFolder','Fetching\x20SQL\x20for\x20segment...','resolveFolderId','Show\x20folder\x20or\x20child\x20segment\x20details','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20sql','\x27\x20with\x20ID:\x20','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20Opening\x20','segmentId','✔\x20Query\x20completed:\x20Processed\x20','name','Resolving\x20parent\x20folder\x20\x27','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','processedRows','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','folderPath','parentId','Usage:\x20tdx\x20sg\x20sql\x20<name>','Executing\x20segment\x20query...','SELECT\x20*\x20FROM\x20(\x0a','resolveParentId','Use:\x20tdx\x20ps\x20show','Options:','segment:sql','getSegment','Error:\x20Path\x20or\x20name\x20is\x20required','segment:show','Listing\x20folders\x20for\x20parent\x20\x27','elapsedTimeMillis','cause','Fetching\x20parent\x20segment\x20details...','limit','error','\x20\x20Parent\x20segment:\x20','✖\x20Query\x20failed\x20[','✔\x20Found\x20','fullPath','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Examples:','Resolved\x20folder\x20ID:\x20','Target\x20path:\x20','stats','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','folder','Site:\x20','jobId','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolving\x20parent\x20segment\x20\x27','/e/','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Show\x20segment\x20or\x20folder\x20details','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','verbose','Resolving\x20path\x20\x27','site','\x27...','\x20\x20Folder\x20path:\x20','Parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20desc','getSegmentSQL','Get\x20SQL\x20query\x20for\x20child\x20segment','405415dDjMoO','Resolving\x20\x27','100ltqomt','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','test','565030joRUMW','Folder\x20ID:\x20','✔\x20Created\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','56538HGUMdV','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','parentFolder','\x20folder','Resolved\x20YAML\x20file:\x20','Fetching\x20segment\x20details...','createFolder','resolvePathToResource','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20folder\x20details...','Parent\x20name:\x20','query','Use:\x20tdx\x20ps\x20view','Parent\x20segment:\x20','(root)','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','segment:desc','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','parent','segment','Error:\x20','segment:folder:create','2217159TJhEbL','30bWzKsq','green','INVALID_ARGUMENT','description','segment:describe','segment:folder:show','type','segmentPath','Use:\x20tdx\x20ps\x20view\x20-w','244caASIi','jsonl','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','parentSegment','SEGMENT_NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','message','segment:view','\x20\x20Cause:\x20','setJobId','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','format','Fetching\x20folder\x20\x27','\x20rows\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'];a32_0xa8ad=function(){return _0x4af578;};return a32_0xa8ad();}export class SegmentSQLCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x246);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x270);async[a32_0x2274e8(0x213)](_0x1020a0){const _0x535a8a=a32_0x2274e8,{options:_0x2d76d8,args:_0x41951b,tdx:_0x2aecd3}=_0x1020a0,_0x10541f=_0x41951b[0x0];if(!_0x10541f)return console[_0x535a8a(0x24f)](_0x535a8a(0x21d)),console[_0x535a8a(0x24f)](_0x535a8a(0x240)),console[_0x535a8a(0x24f)](_0x535a8a(0x201)),console[_0x535a8a(0x24f)](_0x535a8a(0x256)),console[_0x535a8a(0x24f)](_0x535a8a(0x28c)),console[_0x535a8a(0x24f)](_0x535a8a(0x235)),0x1;try{const _0x3795f1=_0x2d76d8[_0x535a8a(0x1ff)],_0x5645fe=resolveSegmentTarget(_0x10541f,_0x3795f1,_0x2d76d8['verbose']);_0x2d76d8[_0x535a8a(0x267)]&&console[_0x535a8a(0x24f)]('Target\x20path:\x20'+_0x5645fe);const _0x1e4313=await withSpinner(_0x535a8a(0x272)+_0x10541f+'\x27...',()=>_0x2aecd3[_0x535a8a(0x28e)][_0x535a8a(0x282)](_0x5645fe),{'verbose':_0x2d76d8[_0x535a8a(0x267)]}),_0x25b651=_0x1e4313[_0x535a8a(0x20c)];_0x2d76d8['verbose']&&(console[_0x535a8a(0x24f)](_0x535a8a(0x217)+_0x25b651[_0x535a8a(0x1f8)]),console['error']('Parent\x20ID:\x20'+_0x25b651[_0x535a8a(0x23f)]));if(_0x25b651[_0x535a8a(0x1f8)]===_0x535a8a(0x25c))return console[_0x535a8a(0x24f)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x535a8a(0x24f)](_0x535a8a(0x1fd)),0x1;if(_0x25b651[_0x535a8a(0x1f8)]===_0x535a8a(0x28d))return console[_0x535a8a(0x24f)](_0x535a8a(0x206)),console[_0x535a8a(0x24f)](_0x535a8a(0x232)),0x1;if(!_0x25b651[_0x535a8a(0x237)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x535a8a(0x22b));const _0x41d05d=await withSpinner(_0x535a8a(0x22e),()=>_0x2aecd3[_0x535a8a(0x28e)]['getSegmentSQL'](_0x25b651[_0x535a8a(0x23f)],_0x25b651[_0x535a8a(0x237)]),{'verbose':_0x2d76d8[_0x535a8a(0x267)]}),_0x1f82eb=_0x41d05d[_0x535a8a(0x20c)];return _0x2d76d8[_0x535a8a(0x207)]===_0x535a8a(0x21e)||_0x2d76d8[_0x535a8a(0x207)]===_0x535a8a(0x1fc)?await handleSDKOutput([{'sql':_0x1f82eb}],_0x2d76d8):console[_0x535a8a(0x225)](_0x1f82eb),0x0;}catch(_0xd6b956){if(_0xd6b956 instanceof SDKError)return console['error'](_0x535a8a(0x1ef)+_0xd6b956[_0x535a8a(0x202)]),_0xd6b956[_0x535a8a(0x24c)]&&console[_0x535a8a(0x24f)]('\x20\x20Cause:\x20'+_0xd6b956[_0x535a8a(0x24c)]),0x1;throw _0xd6b956;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a32_0x2274e8(0x1f0);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x227);async['execute'](_0x258700){const _0x1bf78d=a32_0x2274e8,{options:_0x35983f,args:_0x4f5dd1,tdx:_0x53e962}=_0x258700,_0x467ee3=_0x35983f;if(_0x4f5dd1[_0x1bf78d(0x211)]<0x2)return console[_0x1bf78d(0x24f)](_0x1bf78d(0x28a)),console[_0x1bf78d(0x24f)](_0x1bf78d(0x263)),0x1;const _0xe51827=_0x4f5dd1[0x0],_0x4cec4b=_0x4f5dd1[0x1];_0x467ee3[_0x1bf78d(0x267)]&&(console['error'](_0x1bf78d(0x25d)+_0x467ee3[_0x1bf78d(0x269)]),console[_0x1bf78d(0x24f)](_0x1bf78d(0x288)+_0xe51827),console[_0x1bf78d(0x24f)](_0x1bf78d(0x219)+_0x4cec4b));let _0x56c701;if(_0x467ee3['parentFolder']){const _0x4b8d59=_0x467ee3[_0x1bf78d(0x27d)],_0xc9e9d2=await withSpinner(_0x1bf78d(0x261)+_0xe51827+_0x1bf78d(0x26a),()=>_0x53e962[_0x1bf78d(0x28e)]['resolveParentId'](_0xe51827),{'verbose':_0x467ee3['verbose']}),_0x5dfc16=_0xc9e9d2['data'],_0x76b21f=await withSpinner(_0x1bf78d(0x23a)+_0x4b8d59+_0x1bf78d(0x26a),()=>_0x53e962[_0x1bf78d(0x28e)][_0x1bf78d(0x22f)](_0x5dfc16,_0x4b8d59),{'verbose':_0x467ee3[_0x1bf78d(0x267)]});_0x56c701=_0x76b21f['data'],_0x467ee3[_0x1bf78d(0x267)]&&console[_0x1bf78d(0x24f)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x56c701);}const _0xe71e5b={'name':_0x4cec4b,'description':_0x467ee3[_0x1bf78d(0x1f5)],'parentFolderId':_0x56c701},_0x5acf5a=await withSpinner(_0x1bf78d(0x20b)+_0x4cec4b+_0x1bf78d(0x26a),()=>_0x53e962['segment'][_0x1bf78d(0x281)](_0xe51827,_0xe71e5b),{'verbose':_0x467ee3[_0x1bf78d(0x267)]}),_0x371132=_0x5acf5a[_0x1bf78d(0x20c)];return console[_0x1bf78d(0x24f)](_0x1bf78d(0x278)+_0x371132[_0x1bf78d(0x239)]+_0x1bf78d(0x233)+_0x371132['id']),await handleSDKOutput([_0x371132],_0x467ee3),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x203);[a32_0x2274e8(0x1f5)]=a32_0x2274e8(0x230);async[a32_0x2274e8(0x213)](_0x3e6914){const _0x55db7d=a32_0x2274e8,{options:_0x34514e,args:_0x4ccc9e,tdx:_0x5f5ec3}=_0x3e6914,_0x55b8a7=_0x4ccc9e[0x0];if(!_0x55b8a7)return console[_0x55db7d(0x24f)](_0x55db7d(0x218)),console[_0x55db7d(0x24f)](_0x55db7d(0x212)),console[_0x55db7d(0x24f)](_0x55db7d(0x26d)),console['error'](_0x55db7d(0x245)),console['error'](_0x55db7d(0x1fe)),console['error']('Examples:'),console['error'](_0x55db7d(0x25b)),console['error'](_0x55db7d(0x23b)),console[_0x55db7d(0x24f)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x55db7d(0x24f)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x57740f=_0x34514e[_0x55db7d(0x1ff)],_0x19cabb=resolveSegmentTarget(_0x55b8a7,_0x57740f,_0x34514e[_0x55db7d(0x267)]);_0x34514e['verbose']&&console[_0x55db7d(0x24f)]('Target\x20path:\x20'+_0x19cabb);const _0x3301db=await withSpinner(_0x55db7d(0x272)+_0x55b8a7+_0x55db7d(0x26a),()=>_0x5f5ec3[_0x55db7d(0x28e)]['resolvePathToResource'](_0x19cabb),{'verbose':_0x34514e['verbose']}),_0x222ce3=_0x3301db[_0x55db7d(0x20c)];_0x34514e[_0x55db7d(0x267)]&&(console[_0x55db7d(0x24f)](_0x55db7d(0x217)+_0x222ce3[_0x55db7d(0x1f8)]),console[_0x55db7d(0x24f)](_0x55db7d(0x26c)+_0x222ce3['parentId']),_0x222ce3['folderId']&&console[_0x55db7d(0x24f)](_0x55db7d(0x277)+_0x222ce3[_0x55db7d(0x228)]),_0x222ce3['segmentId']&&console[_0x55db7d(0x24f)](_0x55db7d(0x21a)+_0x222ce3[_0x55db7d(0x237)]));if(_0x34514e['web']){if(_0x222ce3[_0x55db7d(0x1f8)]===_0x55db7d(0x25c))return console[_0x55db7d(0x24f)](_0x55db7d(0x266)),0x1;if(_0x222ce3[_0x55db7d(0x1f8)]===_0x55db7d(0x28d))return console[_0x55db7d(0x24f)](_0x55db7d(0x274)),console['error'](_0x55db7d(0x1fa)),0x1;if(!_0x222ce3[_0x55db7d(0x237)])throw new SDKError(ErrorCode[_0x55db7d(0x200)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4c638a=getConsoleNextUrl(_0x34514e['site'],'/app/ps/'+_0x222ce3[_0x55db7d(0x23f)]+_0x55db7d(0x262)+_0x222ce3[_0x55db7d(0x237)]);return console[_0x55db7d(0x24f)](a32_0xa45164[_0x55db7d(0x1f3)]('✔')+_0x55db7d(0x236)+a32_0xa45164[_0x55db7d(0x216)](_0x4c638a)),openBrowser(_0x4c638a),0x0;}if(_0x222ce3['type']==='folder'){if(!_0x222ce3['folderId'])throw new SDKError(ErrorCode[_0x55db7d(0x283)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x477490=await withSpinner(_0x55db7d(0x284),()=>_0x5f5ec3[_0x55db7d(0x28e)][_0x55db7d(0x22d)](_0x222ce3[_0x55db7d(0x228)]),{'verbose':_0x34514e[_0x55db7d(0x267)]});await handleSingleObjectOutput(_0x477490[_0x55db7d(0x20c)],_0x34514e);}else{if(_0x222ce3[_0x55db7d(0x1f8)]===_0x55db7d(0x28e)){if(!_0x222ce3[_0x55db7d(0x237)])throw new SDKError(ErrorCode[_0x55db7d(0x200)],_0x55db7d(0x22b));const _0x3a9b44=await withSpinner(_0x55db7d(0x280),()=>_0x5f5ec3[_0x55db7d(0x28e)][_0x55db7d(0x247)](_0x222ce3['parentId'],_0x222ce3[_0x55db7d(0x237)]),{'verbose':_0x34514e[_0x55db7d(0x267)]}),_0x15f242=getConsoleNextUrl(_0x34514e[_0x55db7d(0x269)],_0x55db7d(0x22a)+_0x222ce3[_0x55db7d(0x23f)]+_0x55db7d(0x262)+_0x222ce3[_0x55db7d(0x237)]),_0x3446fb=_0x3a9b44[_0x55db7d(0x20c)];_0x3446fb['url']=_0x15f242,await handleSingleObjectOutput(_0x3446fb,_0x34514e);}else return console[_0x55db7d(0x24f)](_0x55db7d(0x25f)),console[_0x55db7d(0x24f)](_0x55db7d(0x287)),0x1;}return 0x0;}catch(_0x306240){if(_0x306240 instanceof SDKError)return console[_0x55db7d(0x24f)](_0x55db7d(0x1ef)+_0x306240['message']),_0x306240[_0x55db7d(0x24c)]&&console['error']('\x20\x20Cause:\x20'+_0x306240[_0x55db7d(0x24c)]),0x1;throw _0x306240;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x2274e8(0x239)]=a32_0x2274e8(0x28b);[a32_0x2274e8(0x1f5)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a32_0x2274e8(0x213)](_0x534fea){const _0x7c49cd=a32_0x2274e8,{options:_0x2a34be,args:_0x490059,tdx:_0x342f54}=_0x534fea,_0x32a981=_0x490059[0x0];if(!_0x32a981)return console['error'](_0x7c49cd(0x21d)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x7c49cd(0x24f)](_0x7c49cd(0x222)),console['error'](_0x7c49cd(0x256)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x7c49cd(0x24f)](_0x7c49cd(0x255)),0x1;try{const _0x4c9fab=_0x2a34be['parentSegment'],_0x253825=resolveSegmentTarget(_0x32a981,_0x4c9fab,_0x2a34be[_0x7c49cd(0x267)]);_0x2a34be[_0x7c49cd(0x267)]&&console[_0x7c49cd(0x24f)]('Target\x20path:\x20'+_0x253825);const _0x245d50=await withSpinner(_0x7c49cd(0x272)+_0x32a981+_0x7c49cd(0x26a),()=>_0x342f54[_0x7c49cd(0x28e)][_0x7c49cd(0x282)](_0x253825),{'verbose':_0x2a34be[_0x7c49cd(0x267)]}),_0x4d4479=_0x245d50['data'];_0x2a34be['verbose']&&(console[_0x7c49cd(0x24f)](_0x7c49cd(0x217)+_0x4d4479[_0x7c49cd(0x1f8)]),console[_0x7c49cd(0x24f)](_0x7c49cd(0x26c)+_0x4d4479[_0x7c49cd(0x23f)]));if(_0x4d4479[_0x7c49cd(0x1f8)]===_0x7c49cd(0x25c))return console[_0x7c49cd(0x24f)](_0x7c49cd(0x223)),console[_0x7c49cd(0x24f)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x4d4479[_0x7c49cd(0x1f8)]===_0x7c49cd(0x28d))return console[_0x7c49cd(0x24f)](_0x7c49cd(0x254)),console[_0x7c49cd(0x24f)](_0x7c49cd(0x26e)),0x1;if(!_0x4d4479['segmentId'])throw new SDKError(ErrorCode[_0x7c49cd(0x200)],_0x7c49cd(0x22b));const _0x2a8789=await withSpinner(_0x7c49cd(0x22e),()=>_0x342f54[_0x7c49cd(0x28e)][_0x7c49cd(0x26f)](_0x4d4479[_0x7c49cd(0x23f)],_0x4d4479['segmentId']),{'verbose':_0x2a34be[_0x7c49cd(0x267)]}),_0x1be75b=_0x2a8789[_0x7c49cd(0x20c)],_0x3681fa=await executeSchemaQuery(_0x1be75b,_0x342f54,_0x2a34be);return await handleQueryOutput(_0x3681fa,_0x2a34be),0x0;}catch(_0x5f3da8){if(_0x5f3da8 instanceof SDKError)return console[_0x7c49cd(0x24f)](_0x7c49cd(0x1ef)+_0x5f3da8[_0x7c49cd(0x202)]),_0x5f3da8[_0x7c49cd(0x24c)]&&console[_0x7c49cd(0x24f)](_0x7c49cd(0x204)+_0x5f3da8[_0x7c49cd(0x24c)]),0x1;throw _0x5f3da8;}}}
|
|
1
|
+
const a32_0x28d401=a32_0x266a;(function(_0x2e054a,_0x55d996){const _0x26621f=a32_0x266a,_0x16327d=_0x2e054a();while(!![]){try{const _0x4df906=parseInt(_0x26621f(0xee))/0x1+-parseInt(_0x26621f(0x113))/0x2+-parseInt(_0x26621f(0xd4))/0x3+parseInt(_0x26621f(0x141))/0x4+-parseInt(_0x26621f(0x12f))/0x5+parseInt(_0x26621f(0x14c))/0x6+-parseInt(_0x26621f(0x114))/0x7*(-parseInt(_0x26621f(0x10a))/0x8);if(_0x4df906===_0x55d996)break;else _0x16327d['push'](_0x16327d['shift']());}catch(_0x22db8b){_0x16327d['push'](_0x16327d['shift']());}}}(a32_0x3367,0xdd9d4));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';function a32_0x266a(_0x250dcc,_0x3e9e5e){_0x250dcc=_0x250dcc-0xd1;const _0x3367b6=a32_0x3367();let _0x266a4b=_0x3367b6[_0x250dcc];return _0x266a4b;}function a32_0x3367(){const _0xae9047=['Creating\x20folder\x20\x27','segment:desc','INVALID_ARGUMENT','in\x20','segmentName','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','/e/','limit','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Segment\x20name:\x20','\x27...','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','8489640DGpdfR','Resolving\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','resolveParentId','segment:folder:list','cause','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','code','✖\x20Query\x20failed\x20[','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Executing\x20segment\x20query...','includes','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20view\x20-w','listFolders','Listing\x20folders\x20for\x20parent\x20\x27','type','7080300yySjNf','Folder\x20ID\x20missing\x20from\x20resolved\x20path','test','name','Folder\x20ID:\x20','Parent\x20ID:\x20','\x20\x20Cause:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20[Job\x20ID:\x20','parentSegment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','5085288IrTMOK','fullPath','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','getFolder','execute','message','Resolved\x20folder\x20ID:\x20','error','length','Usage:\x20tdx\x20sg\x20desc\x20<name>','SEGMENT_NOT_FOUND','Segment\x20ID:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:sql','getParent','Folder\x20name:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','replace','segment:folder:create','verbose','query','information_schema','Use:\x20tdx\x20ps\x20show','folder','getSegmentSQL','SQL\x20query:\x0a','4743009vZvXAo','Parent\x20name:\x20','log','Resolved\x20type:\x20','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20folder','\x20rows\x20','Resolving\x20path\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','stats','Fetching\x20folder\x20details...','parent','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Create\x20segment\x20folder\x20for\x20organization','processedRows','\x20\x20Full\x20path:\x20','Resolving\x20parent\x20folder\x20\x27','resolveFolderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','SELECT\x20*\x20FROM\x20(\x0a','segment:describe','\x20Opening\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','✔\x20Created\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','1706647eKzJPx','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Fetching\x20parent\x20segment\x20details...','trim','parentId','Resolved\x20parent\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','elapsedTimeMillis','Error:\x20','segmentId','folderPath','segment:folder:show','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','resolvePathToResource','Use:\x20tdx\x20ps\x20sql','Site:\x20','jobId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','folderId','Resolved\x20YAML\x20file:\x20','Show\x20segment\x20folder\x20details','createFolder','format','10944040tzSvLT','web','site','segment','Parent\x20segment:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Examples:','Resolving\x20parent\x20segment\x20\x27','url','3011224aFZDkP','7jhpthX','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','parentFolder','data','Get\x20SQL\x20query\x20for\x20child\x20segment','description','Fetching\x20SQL\x20for\x20segment...','(root)','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20folder\x20\x27','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Target\x20path:\x20','/app/ps/'];a32_0x3367=function(){return _0xae9047;};return a32_0x3367();}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_0x12689e from'chalk';function resolveSegmentTarget(_0x204d59,_0x4e88c4,_0x5d9cfd){const _0xe3949=a32_0x266a;if(isYamlFilePath(_0x204d59))try{const _0x3431fd=resolveYamlFilePath(_0x204d59);return _0x5d9cfd&&(console['error'](_0xe3949(0x106)+_0x204d59),console[_0xe3949(0x153)]('\x20\x20Parent\x20segment:\x20'+_0x3431fd[_0xe3949(0x14a)]),console['error'](_0xe3949(0x12c)+_0x3431fd[_0xe3949(0x127)]),console[_0xe3949(0x153)](_0xe3949(0xed)+(_0x3431fd[_0xe3949(0xfb)]||_0xe3949(0x11c))),console[_0xe3949(0x153)](_0xe3949(0xe4)+_0x3431fd[_0xe3949(0x14d)])),_0x3431fd[_0xe3949(0x14d)];}catch(_0x11be9b){throw new SDKError(ErrorCode[_0xe3949(0x125)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x11be9b[_0xe3949(0x151)]);}if(!_0x4e88c4)throw new SDKError(ErrorCode[_0xe3949(0x125)],_0xe3949(0x148));return _0x4e88c4+'/'+_0x204d59;}export class SegmentDescribeCommand extends BaseCommand{['name']=a32_0x28d401(0xe9);[a32_0x28d401(0x11a)]=a32_0x28d401(0x13c);async[a32_0x28d401(0x150)](_0x38ac9e){const _0x128376=a32_0x28d401,{options:_0x32f4b0,args:_0x3e3860,tdx:_0x4265d1}=_0x38ac9e,_0x44c53f=_0x3e3860[0x0],_0x4dac72=!_0x44c53f&&!!_0x32f4b0[_0x128376(0x14a)],_0x1a8104=_0x44c53f||_0x32f4b0[_0x128376(0x14a)];if(!_0x1a8104)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x128376(0x153)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error'](_0x128376(0x110)),console[_0x128376(0x153)](_0x128376(0xef)),console[_0x128376(0x153)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error'](_0x128376(0x120)),console[_0x128376(0x153)](_0x128376(0x138)),0x1;try{const _0x9a4b65=_0x32f4b0['segmentPath'];let _0x48a091=_0x1a8104;!_0x4dac72&&_0x9a4b65&&!_0x1a8104[_0x128376(0x13b)]('/')&&(_0x48a091=_0x9a4b65+'/'+_0x1a8104,_0x32f4b0[_0x128376(0x160)]&&console['error'](_0x128376(0xf6)+_0x48a091));const _0xa213df=await withSpinner(_0x128376(0xdc)+_0x48a091+'\x27...',()=>_0x4265d1[_0x128376(0x10d)][_0x128376(0xfe)](_0x48a091),{'verbose':_0x32f4b0[_0x128376(0x160)]}),_0x5c4540=_0xa213df[_0x128376(0x118)];_0x32f4b0[_0x128376(0x160)]&&(console['error'](_0x128376(0xd7)+_0x5c4540[_0x128376(0x140)]),console[_0x128376(0x153)]('Parent\x20ID:\x20'+_0x5c4540['parentId']),_0x5c4540['folderId']&&console[_0x128376(0x153)](_0x128376(0x145)+_0x5c4540[_0x128376(0x105)]),_0x5c4540['segmentId']&&console[_0x128376(0x153)](_0x128376(0x157)+_0x5c4540['segmentId']));if(_0x5c4540[_0x128376(0x140)]===_0x128376(0xe0)){const _0x281c1d=await withSpinner(_0x128376(0xf1),()=>_0x4265d1[_0x128376(0x10d)][_0x128376(0x15b)](_0x5c4540[_0x128376(0xf3)]),{'verbose':_0x32f4b0[_0x128376(0x160)]});await handleSingleObjectOutput(_0x281c1d['data'],_0x32f4b0);}else{if(_0x5c4540[_0x128376(0x140)]===_0x128376(0xd1)){if(!_0x5c4540[_0x128376(0x105)])throw new SDKError(ErrorCode[_0x128376(0x11d)],_0x128376(0x142));const _0x596ad9=await withSpinner(_0x128376(0xdf),()=>_0x4265d1[_0x128376(0x10d)][_0x128376(0x14f)](_0x5c4540['folderId']),{'verbose':_0x32f4b0[_0x128376(0x160)]});await handleSingleObjectOutput(_0x596ad9[_0x128376(0x118)],_0x32f4b0);}else{if(_0x5c4540['type']==='segment'){if(!_0x5c4540[_0x128376(0xfa)])throw new SDKError(ErrorCode[_0x128376(0x156)],_0x128376(0x14b));const _0x1b1fe=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4265d1[_0x128376(0x10d)]['getSegment'](_0x5c4540['parentId'],_0x5c4540['segmentId']),{'verbose':_0x32f4b0[_0x128376(0x160)]});await handleSingleObjectOutput(_0x1b1fe[_0x128376(0x118)],_0x32f4b0);}}}return 0x0;}catch(_0x47c58a){if(_0x47c58a instanceof SDKError)return console[_0x128376(0x153)](_0x128376(0xf9)+_0x47c58a[_0x128376(0x151)]),_0x47c58a[_0x128376(0x134)]&&console[_0x128376(0x153)](_0x128376(0x147)+_0x47c58a[_0x128376(0x134)]),0x1;throw _0x47c58a;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x28d401(0x144)]='segment:show';['description']=a32_0x28d401(0x14e);async[a32_0x28d401(0x150)](_0x145604){const _0x5d0924=a32_0x28d401,{options:_0x2dea5b,args:_0x5cdf7e,tdx:_0x139f35}=_0x145604,_0x4dd051=_0x5cdf7e[0x0];if(!_0x4dd051)return console[_0x5d0924(0x153)](_0x5d0924(0xf7)),console[_0x5d0924(0x153)](_0x5d0924(0x115)),console[_0x5d0924(0x153)](_0x5d0924(0xe7)),console[_0x5d0924(0x153)](_0x5d0924(0x110)),console[_0x5d0924(0x153)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x5d0924(0x153)](_0x5d0924(0x135)),0x1;try{const _0x5f17bc=_0x2dea5b[_0x5d0924(0x14a)],_0x1f78f7=resolveSegmentTarget(_0x4dd051,_0x5f17bc,_0x2dea5b[_0x5d0924(0x160)]);_0x2dea5b['verbose']&&console[_0x5d0924(0x153)](_0x5d0924(0x121)+_0x1f78f7);const _0x140569=await withSpinner(_0x5d0924(0x130)+_0x4dd051+_0x5d0924(0x12d),()=>_0x139f35[_0x5d0924(0x10d)][_0x5d0924(0xfe)](_0x1f78f7),{'verbose':_0x2dea5b[_0x5d0924(0x160)]}),_0x1e9512=_0x140569['data'];_0x2dea5b[_0x5d0924(0x160)]&&(console[_0x5d0924(0x153)](_0x5d0924(0xd7)+_0x1e9512[_0x5d0924(0x140)]),console[_0x5d0924(0x153)](_0x5d0924(0x146)+_0x1e9512[_0x5d0924(0xf3)]));if(_0x1e9512['type']==='folder')return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console['error'](_0x5d0924(0x12e)),0x1;if(_0x1e9512[_0x5d0924(0x140)]===_0x5d0924(0xe0))return console[_0x5d0924(0x153)](_0x5d0924(0x103)),console[_0x5d0924(0x153)](_0x5d0924(0x163)),0x1;if(!_0x1e9512['segmentId'])throw new SDKError(ErrorCode[_0x5d0924(0x156)],_0x5d0924(0x14b));const _0x10a4a5=await withSpinner(_0x5d0924(0x11b),()=>_0x139f35[_0x5d0924(0x10d)][_0x5d0924(0xd2)](_0x1e9512[_0x5d0924(0xf3)],_0x1e9512[_0x5d0924(0xfa)]),{'verbose':_0x2dea5b['verbose']});let _0x43ea29=_0x10a4a5[_0x5d0924(0x118)];const _0x38f78e=resolveLimit(_0x2dea5b[_0x5d0924(0x12a)],DEFAULT_DISPLAY_LIMIT),_0x3f8aef=/\bLIMIT\s+\d+/i[_0x5d0924(0x143)](_0x43ea29);!_0x3f8aef&&(_0x43ea29=_0x43ea29[_0x5d0924(0xf2)]()[_0x5d0924(0x15e)](/;+$/,''),_0x43ea29=_0x5d0924(0xe8)+_0x43ea29+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x38f78e);_0x2dea5b['verbose']&&console[_0x5d0924(0x153)](_0x5d0924(0xd3)+_0x43ea29);const _0x562a85=await withQuerySpinner(_0x5d0924(0x13a),async _0x15da98=>{const _0x140f1e=_0x5d0924,_0x5c4b2e=await _0x139f35[_0x140f1e(0x161)][_0x140f1e(0x150)](_0x43ea29,{'catalog':'td','schema':_0x140f1e(0x162),'onJobId':_0x5ab43=>{_0x15da98['setJobId'](_0x5ab43);}});return _0x5c4b2e;},{'verbose':_0x2dea5b['verbose']}),_0x59ac25=_0x562a85[_0x5d0924(0x118)],_0x4c19cc=_0x59ac25[_0x5d0924(0x101)]?_0x5d0924(0x149)+_0x59ac25[_0x5d0924(0x101)]+']':'';return console[_0x5d0924(0x153)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x59ac25[_0x5d0924(0xde)][_0x5d0924(0xe3)]['toLocaleString']()+_0x5d0924(0xdb)+(_0x5d0924(0x126)+formatElapsed(_0x59ac25[_0x5d0924(0xde)][_0x5d0924(0xf8)])+_0x4c19cc)),await handleQueryOutput(_0x59ac25,_0x2dea5b),0x0;}catch(_0x3eca53){if(_0x3eca53 instanceof SDKError)return console[_0x5d0924(0x153)](_0x5d0924(0x137)+_0x3eca53[_0x5d0924(0x136)]+']'),console['error']('\x0a'+_0x3eca53[_0x5d0924(0x151)]),0x1;throw _0x3eca53;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0x133);[a32_0x28d401(0x11a)]=a32_0x28d401(0x102);async[a32_0x28d401(0x150)](_0x2bde74){const _0x2d0375=a32_0x28d401,{options:_0x3b0fcd,args:_0x4c298d,tdx:_0x16a7cc}=_0x2bde74;if(_0x4c298d[_0x2d0375(0x154)]===0x0)return console[_0x2d0375(0x153)](_0x2d0375(0x159)),console[_0x2d0375(0x153)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x29290f=_0x4c298d[0x0];try{_0x3b0fcd['verbose']&&(console[_0x2d0375(0x153)]('Site:\x20'+_0x3b0fcd[_0x2d0375(0x10c)]),console['error'](_0x2d0375(0xd5)+_0x29290f));const _0x233ce6=await withSpinner(_0x2d0375(0x111)+_0x29290f+_0x2d0375(0x12d),()=>_0x16a7cc[_0x2d0375(0x10d)][_0x2d0375(0x132)](_0x29290f),{'verbose':_0x3b0fcd[_0x2d0375(0x160)]}),_0x4bd9dd=_0x233ce6[_0x2d0375(0x118)];_0x3b0fcd[_0x2d0375(0x160)]&&console['error'](_0x2d0375(0xf4)+_0x4bd9dd);const _0x2c480b=await withSpinner(_0x2d0375(0x13f)+_0x29290f+_0x2d0375(0x12d),()=>_0x16a7cc[_0x2d0375(0x10d)][_0x2d0375(0x13e)](_0x4bd9dd),{'verbose':_0x3b0fcd[_0x2d0375(0x160)]}),_0x21493e=_0x2c480b[_0x2d0375(0x118)];return console[_0x2d0375(0x153)]('✔\x20Found\x20'+_0x21493e[_0x2d0375(0x154)]+_0x2d0375(0xda)+(_0x21493e['length']!==0x1?'s':'')),await handleSDKOutput(_0x21493e,_0x3b0fcd),0x0;}catch(_0x3eeb98){if(_0x3eeb98 instanceof SDKError)return console[_0x2d0375(0x153)](_0x2d0375(0xf9)+_0x3eeb98[_0x2d0375(0x151)]),_0x3eeb98[_0x2d0375(0x134)]&&console[_0x2d0375(0x153)]('\x20\x20Cause:\x20'+_0x3eeb98['cause']),0x1;throw _0x3eeb98;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0xfc);[a32_0x28d401(0x11a)]=a32_0x28d401(0x107);async[a32_0x28d401(0x150)](_0x5d3765){const _0x3a3634=a32_0x28d401,{options:_0x28a41e,args:_0x7883ae,tdx:_0x3686fd}=_0x5d3765;if(_0x7883ae['length']===0x0)return console[_0x3a3634(0x153)](_0x3a3634(0xd8)),console[_0x3a3634(0x153)](_0x3a3634(0x131)),0x1;try{const {parentId:_0x4c6cfe,childId:_0x1742a3}=parseSegmentRef(_0x7883ae[0x0]);_0x28a41e['verbose']&&(console[_0x3a3634(0x153)](_0x3a3634(0x100)+_0x28a41e[_0x3a3634(0x10c)]),console['error'](_0x3a3634(0xd5)+_0x4c6cfe),_0x1742a3&&console[_0x3a3634(0x153)](_0x3a3634(0x15c)+_0x1742a3));if(!_0x1742a3)return console['error'](_0x3a3634(0xd9)),0x1;const _0x235874=await withSpinner(_0x3a3634(0x111)+_0x4c6cfe+_0x3a3634(0x12d),()=>_0x3686fd[_0x3a3634(0x10d)]['resolveParentId'](_0x4c6cfe),{'verbose':_0x28a41e[_0x3a3634(0x160)]}),_0x3e52ff=_0x235874[_0x3a3634(0x118)];_0x28a41e[_0x3a3634(0x160)]&&console['error'](_0x3a3634(0xf4)+_0x3e52ff);const _0x9e38ab=await withSpinner('Resolving\x20folder\x20\x27'+_0x1742a3+_0x3a3634(0x12d),()=>_0x3686fd['segment'][_0x3a3634(0xe6)](_0x3e52ff,_0x1742a3),{'verbose':_0x28a41e[_0x3a3634(0x160)]}),_0x11147a=_0x9e38ab[_0x3a3634(0x118)];_0x28a41e[_0x3a3634(0x160)]&&console[_0x3a3634(0x153)](_0x3a3634(0x152)+_0x11147a);const _0x591ded=await withSpinner(_0x3a3634(0x11e)+_0x1742a3+_0x3a3634(0x12d),()=>_0x3686fd[_0x3a3634(0x10d)][_0x3a3634(0x14f)](_0x11147a),{'verbose':_0x28a41e[_0x3a3634(0x160)]});return await handleSDKOutput([_0x591ded[_0x3a3634(0x118)]],_0x28a41e),0x0;}catch(_0x4d215b){if(_0x4d215b instanceof SDKError)return console['error'](_0x3a3634(0xf9)+_0x4d215b[_0x3a3634(0x151)]),_0x4d215b['cause']&&console[_0x3a3634(0x153)](_0x3a3634(0x147)+_0x4d215b[_0x3a3634(0x134)]),0x1;throw _0x4d215b;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0x15a);[a32_0x28d401(0x11a)]=a32_0x28d401(0x119);async['execute'](_0x18c7b3){const _0x11dfc1=a32_0x28d401,{options:_0x35a619,args:_0x5a3652,tdx:_0x24576d}=_0x18c7b3,_0x29664b=_0x5a3652[0x0];if(!_0x29664b)return console['error'](_0x11dfc1(0xf7)),console[_0x11dfc1(0x153)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x11dfc1(0x153)]('Examples:'),console[_0x11dfc1(0x153)](_0x11dfc1(0x116)),console[_0x11dfc1(0x153)](_0x11dfc1(0x11f)),0x1;try{const _0x23e707=_0x35a619[_0x11dfc1(0x14a)],_0x30ca6f=resolveSegmentTarget(_0x29664b,_0x23e707,_0x35a619[_0x11dfc1(0x160)]);_0x35a619[_0x11dfc1(0x160)]&&console['error'](_0x11dfc1(0x121)+_0x30ca6f);const _0x1b39c6=await withSpinner('Resolving\x20\x27'+_0x29664b+_0x11dfc1(0x12d),()=>_0x24576d[_0x11dfc1(0x10d)][_0x11dfc1(0xfe)](_0x30ca6f),{'verbose':_0x35a619[_0x11dfc1(0x160)]}),_0xc8d33=_0x1b39c6[_0x11dfc1(0x118)];_0x35a619[_0x11dfc1(0x160)]&&(console[_0x11dfc1(0x153)](_0x11dfc1(0xd7)+_0xc8d33[_0x11dfc1(0x140)]),console['error'](_0x11dfc1(0x146)+_0xc8d33['parentId']));if(_0xc8d33['type']===_0x11dfc1(0xd1))return console[_0x11dfc1(0x153)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x11dfc1(0x153)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0xc8d33[_0x11dfc1(0x140)]===_0x11dfc1(0xe0))return console['error'](_0x11dfc1(0x15d)),console[_0x11dfc1(0x153)](_0x11dfc1(0xff)),0x1;if(!_0xc8d33['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x11dfc1(0x14b));const _0x44b903=await withSpinner(_0x11dfc1(0x11b),()=>_0x24576d['segment']['getSegmentSQL'](_0xc8d33['parentId'],_0xc8d33[_0x11dfc1(0xfa)]),{'verbose':_0x35a619[_0x11dfc1(0x160)]}),_0xfc4579=_0x44b903[_0x11dfc1(0x118)];return _0x35a619[_0x11dfc1(0x109)]==='json'||_0x35a619['format']==='jsonl'?await handleSDKOutput([{'sql':_0xfc4579}],_0x35a619):console[_0x11dfc1(0xd6)](_0xfc4579),0x0;}catch(_0xdf1da6){if(_0xdf1da6 instanceof SDKError)return console[_0x11dfc1(0x153)]('Error:\x20'+_0xdf1da6['message']),_0xdf1da6['cause']&&console[_0x11dfc1(0x153)](_0x11dfc1(0x147)+_0xdf1da6[_0x11dfc1(0x134)]),0x1;throw _0xdf1da6;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0x15f);[a32_0x28d401(0x11a)]=a32_0x28d401(0xe2);async['execute'](_0x59982c){const _0x456bb3=a32_0x28d401,{options:_0x514ecf,args:_0x4c978a,tdx:_0x587acc}=_0x59982c,_0x4b2da4=_0x514ecf;if(_0x4c978a[_0x456bb3(0x154)]<0x2)return console[_0x456bb3(0x153)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x4e6f50=_0x4c978a[0x0],_0x1dd98f=_0x4c978a[0x1];_0x4b2da4['verbose']&&(console[_0x456bb3(0x153)]('Site:\x20'+_0x4b2da4[_0x456bb3(0x10c)]),console[_0x456bb3(0x153)](_0x456bb3(0x10e)+_0x4e6f50),console[_0x456bb3(0x153)](_0x456bb3(0x15c)+_0x1dd98f));let _0x1b2389;if(_0x4b2da4['parentFolder']){const _0x4f64cc=_0x4b2da4[_0x456bb3(0x117)],_0x487ec8=await withSpinner(_0x456bb3(0x111)+_0x4e6f50+_0x456bb3(0x12d),()=>_0x587acc[_0x456bb3(0x10d)][_0x456bb3(0x132)](_0x4e6f50),{'verbose':_0x4b2da4[_0x456bb3(0x160)]}),_0x3a5295=_0x487ec8[_0x456bb3(0x118)],_0x4c1421=await withSpinner(_0x456bb3(0xe5)+_0x4f64cc+_0x456bb3(0x12d),()=>_0x587acc[_0x456bb3(0x10d)]['resolveFolderId'](_0x3a5295,_0x4f64cc),{'verbose':_0x4b2da4[_0x456bb3(0x160)]});_0x1b2389=_0x4c1421[_0x456bb3(0x118)],_0x4b2da4[_0x456bb3(0x160)]&&console[_0x456bb3(0x153)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x1b2389);}const _0x37244c={'name':_0x1dd98f,'description':_0x4b2da4['description'],'parentFolderId':_0x1b2389},_0x56e5b2=await withSpinner(_0x456bb3(0x123)+_0x1dd98f+_0x456bb3(0x12d),()=>_0x587acc[_0x456bb3(0x10d)][_0x456bb3(0x108)](_0x4e6f50,_0x37244c),{'verbose':_0x4b2da4['verbose']}),_0x1cee26=_0x56e5b2['data'];return console['error'](_0x456bb3(0xec)+_0x1cee26[_0x456bb3(0x144)]+'\x27\x20with\x20ID:\x20'+_0x1cee26['id']),await handleSDKOutput([_0x1cee26],_0x4b2da4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x28d401(0x144)]='segment:view';['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async[a32_0x28d401(0x150)](_0x3ba4ab){const _0x3c5752=a32_0x28d401,{options:_0x16752e,args:_0xf4458f,tdx:_0x40cd04}=_0x3ba4ab,_0x4d50a3=_0xf4458f[0x0];if(!_0x4d50a3)return console[_0x3c5752(0x153)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3c5752(0x153)](_0x3c5752(0x10f)),console[_0x3c5752(0x153)](_0x3c5752(0xeb)),console[_0x3c5752(0x153)]('Options:'),console[_0x3c5752(0x153)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3c5752(0x153)](_0x3c5752(0x110)),console[_0x3c5752(0x153)](_0x3c5752(0x128)),console[_0x3c5752(0x153)](_0x3c5752(0x104)),console['error'](_0x3c5752(0xf5)),console['error'](_0x3c5752(0xfd)),0x1;try{const _0x40659f=_0x16752e['parentSegment'],_0x2072d5=resolveSegmentTarget(_0x4d50a3,_0x40659f,_0x16752e[_0x3c5752(0x160)]);_0x16752e[_0x3c5752(0x160)]&&console[_0x3c5752(0x153)](_0x3c5752(0x121)+_0x2072d5);const _0x260d3e=await withSpinner(_0x3c5752(0x130)+_0x4d50a3+_0x3c5752(0x12d),()=>_0x40cd04[_0x3c5752(0x10d)]['resolvePathToResource'](_0x2072d5),{'verbose':_0x16752e[_0x3c5752(0x160)]}),_0x1467fc=_0x260d3e[_0x3c5752(0x118)];_0x16752e[_0x3c5752(0x160)]&&(console['error'](_0x3c5752(0xd7)+_0x1467fc[_0x3c5752(0x140)]),console['error']('Parent\x20ID:\x20'+_0x1467fc[_0x3c5752(0xf3)]),_0x1467fc[_0x3c5752(0x105)]&&console[_0x3c5752(0x153)]('Folder\x20ID:\x20'+_0x1467fc[_0x3c5752(0x105)]),_0x1467fc[_0x3c5752(0xfa)]&&console[_0x3c5752(0x153)](_0x3c5752(0x157)+_0x1467fc[_0x3c5752(0xfa)]));if(_0x16752e[_0x3c5752(0x10b)]){if(_0x1467fc['type']===_0x3c5752(0xd1))return console[_0x3c5752(0x153)](_0x3c5752(0x158)),0x1;if(_0x1467fc[_0x3c5752(0x140)]===_0x3c5752(0xe0))return console[_0x3c5752(0x153)](_0x3c5752(0x139)),console[_0x3c5752(0x153)](_0x3c5752(0x13d)),0x1;if(!_0x1467fc['segmentId'])throw new SDKError(ErrorCode[_0x3c5752(0x156)],_0x3c5752(0x14b));const _0x5071bb=getConsoleNextUrl(_0x16752e['site'],_0x3c5752(0x122)+_0x1467fc[_0x3c5752(0xf3)]+_0x3c5752(0x129)+_0x1467fc[_0x3c5752(0xfa)]);return console[_0x3c5752(0x153)](a32_0x12689e['green']('✔')+_0x3c5752(0xea)+a32_0x12689e['cyan'](_0x5071bb)),openBrowser(_0x5071bb),0x0;}if(_0x1467fc[_0x3c5752(0x140)]===_0x3c5752(0xd1)){if(!_0x1467fc['folderId'])throw new SDKError(ErrorCode[_0x3c5752(0x11d)],_0x3c5752(0x142));const _0x46a5c0=await withSpinner(_0x3c5752(0xdf),()=>_0x40cd04[_0x3c5752(0x10d)][_0x3c5752(0x14f)](_0x1467fc['folderId']),{'verbose':_0x16752e[_0x3c5752(0x160)]});await handleSingleObjectOutput(_0x46a5c0[_0x3c5752(0x118)],_0x16752e);}else{if(_0x1467fc['type']===_0x3c5752(0x10d)){if(!_0x1467fc[_0x3c5752(0xfa)])throw new SDKError(ErrorCode[_0x3c5752(0x156)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x8a6a2b=await withSpinner('Fetching\x20segment\x20details...',()=>_0x40cd04[_0x3c5752(0x10d)]['getSegment'](_0x1467fc[_0x3c5752(0xf3)],_0x1467fc['segmentId']),{'verbose':_0x16752e[_0x3c5752(0x160)]}),_0xc08f33=getConsoleNextUrl(_0x16752e['site'],_0x3c5752(0x122)+_0x1467fc['parentId']+_0x3c5752(0x129)+_0x1467fc['segmentId']),_0x287425=_0x8a6a2b[_0x3c5752(0x118)];_0x287425[_0x3c5752(0x112)]=_0xc08f33,await handleSingleObjectOutput(_0x287425,_0x16752e);}else return console[_0x3c5752(0x153)](_0x3c5752(0xe1)),console['error']('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x52c451){if(_0x52c451 instanceof SDKError)return console['error'](_0x3c5752(0xf9)+_0x52c451['message']),_0x52c451[_0x3c5752(0x134)]&&console[_0x3c5752(0x153)](_0x3c5752(0x147)+_0x52c451[_0x3c5752(0x134)]),0x1;throw _0x52c451;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0x124);[a32_0x28d401(0x11a)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a32_0x28d401(0x150)](_0x202b9d){const _0x1f8db1=a32_0x28d401,{options:_0x3a36ae,args:_0x3aba07,tdx:_0xdb7bc9}=_0x202b9d,_0xa74abb=_0x3aba07[0x0];if(!_0xa74abb)return console[_0x1f8db1(0x153)](_0x1f8db1(0xf7)),console[_0x1f8db1(0x153)](_0x1f8db1(0x155)),console[_0x1f8db1(0x153)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x1f8db1(0x153)]('Examples:'),console[_0x1f8db1(0x153)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x77b4ef=_0x3a36ae['parentSegment'],_0x54ddbf=resolveSegmentTarget(_0xa74abb,_0x77b4ef,_0x3a36ae[_0x1f8db1(0x160)]);_0x3a36ae[_0x1f8db1(0x160)]&&console['error'](_0x1f8db1(0x121)+_0x54ddbf);const _0x236a18=await withSpinner(_0x1f8db1(0x130)+_0xa74abb+_0x1f8db1(0x12d),()=>_0xdb7bc9['segment']['resolvePathToResource'](_0x54ddbf),{'verbose':_0x3a36ae['verbose']}),_0x4b6e9b=_0x236a18[_0x1f8db1(0x118)];_0x3a36ae[_0x1f8db1(0x160)]&&(console['error']('Resolved\x20type:\x20'+_0x4b6e9b[_0x1f8db1(0x140)]),console[_0x1f8db1(0x153)](_0x1f8db1(0x146)+_0x4b6e9b[_0x1f8db1(0xf3)]));if(_0x4b6e9b[_0x1f8db1(0x140)]===_0x1f8db1(0xd1))return console[_0x1f8db1(0x153)](_0x1f8db1(0xf0)),console[_0x1f8db1(0x153)](_0x1f8db1(0xdd)),0x1;if(_0x4b6e9b[_0x1f8db1(0x140)]==='parent')return console[_0x1f8db1(0x153)](_0x1f8db1(0x12b)),console[_0x1f8db1(0x153)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x4b6e9b[_0x1f8db1(0xfa)])throw new SDKError(ErrorCode[_0x1f8db1(0x156)],_0x1f8db1(0x14b));const _0x576ad1=await withSpinner(_0x1f8db1(0x11b),()=>_0xdb7bc9[_0x1f8db1(0x10d)][_0x1f8db1(0xd2)](_0x4b6e9b[_0x1f8db1(0xf3)],_0x4b6e9b[_0x1f8db1(0xfa)]),{'verbose':_0x3a36ae[_0x1f8db1(0x160)]}),_0x2ef26c=_0x576ad1[_0x1f8db1(0x118)],_0x2b6f91=await executeSchemaQuery(_0x2ef26c,_0xdb7bc9,_0x3a36ae);return await handleQueryOutput(_0x2b6f91,_0x3a36ae),0x0;}catch(_0x2a25ec){if(_0x2a25ec instanceof SDKError)return console[_0x1f8db1(0x153)]('Error:\x20'+_0x2a25ec[_0x1f8db1(0x151)]),_0x2a25ec[_0x1f8db1(0x134)]&&console['error']('\x20\x20Cause:\x20'+_0x2a25ec[_0x1f8db1(0x134)]),0x1;throw _0x2a25ec;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x56a4db=a33_0x162a;(function(_0x1d7522,_0x30009d){const _0x54bdb6=a33_0x162a,_0x3f13d2=_0x1d7522();while(!![]){try{const _0x100e17=-parseInt(_0x54bdb6(0x106))/0x1+parseInt(_0x54bdb6(0xf0))/0x2+parseInt(_0x54bdb6(0xf4))/0x3+-parseInt(_0x54bdb6(0x11a))/0x4*(parseInt(_0x54bdb6(0x10a))/0x5)+-parseInt(_0x54bdb6(0x112))/0x6*(parseInt(_0x54bdb6(0xfb))/0x7)+-parseInt(_0x54bdb6(0x10d))/0x8*(parseInt(_0x54bdb6(0xeb))/0x9)+parseInt(_0x54bdb6(0x10b))/0xa*(parseInt(_0x54bdb6(0x11c))/0xb);if(_0x100e17===_0x30009d)break;else _0x3f13d2['push'](_0x3f13d2['shift']());}catch(_0x5e54ee){_0x3f13d2['push'](_0x3f13d2['shift']());}}}(a33_0x1f63,0x8044d));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_0x162a(_0x312a79,_0x43abef){_0x312a79=_0x312a79-0xea;const _0x1f6327=a33_0x1f63();let _0x162abd=_0x1f6327[_0x312a79];return _0x162abd;}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x96a0fa from'chalk';export class SegmentCreateCommand extends BaseCommand{[a33_0x56a4db(0xf9)]=a33_0x56a4db(0xfa);[a33_0x56a4db(0x102)]=a33_0x56a4db(0xea);async['execute'](_0x5708dc){const _0x32433b=a33_0x56a4db;console[_0x32433b(0xf8)](a33_0x96a0fa[_0x32433b(0xf6)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a33_0x96a0fa[_0x32433b(0xf6)](_0x32433b(0x110)));const {options:_0x2e3aa6,args:_0x5862ff,tdx:_0x4b21a5}=_0x5708dc,_0x368d95=_0x2e3aa6;if(_0x5862ff[_0x32433b(0x101)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x32433b(0xf8)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0x32433b(0x108)),console[_0x32433b(0xf8)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x32433b(0xf8)](_0x32433b(0xee)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2a2c52=_0x5862ff[0x0],_0x1a2a57=_0x2e3aa6[_0x32433b(0xf3)];let _0x5e4b95=_0x2a2c52;_0x1a2a57&&!_0x2a2c52[_0x32433b(0xf2)]('/')&&(_0x5e4b95=_0x1a2a57+'/'+_0x2a2c52,_0x368d95['verbose']&&console[_0x32433b(0xf8)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5e4b95));const _0x9d74b3=parsePath(_0x5e4b95);if(_0x9d74b3[_0x32433b(0xfc)]['length']<0x2)return console['error'](_0x32433b(0x118)),console[_0x32433b(0xf8)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x234e30=_0x9d74b3['segments'][0x0],_0x549cc7=getBaseName(_0x5e4b95),_0x58e913=getParentPath(_0x5e4b95);_0x368d95[_0x32433b(0x107)]&&(console[_0x32433b(0xf8)]('Site:\x20'+_0x368d95['site']),console[_0x32433b(0xf8)](_0x32433b(0x119)+_0x5e4b95),console[_0x32433b(0xf8)](_0x32433b(0x111)+_0x234e30),console['error']('Segment\x20name:\x20'+_0x549cc7),console[_0x32433b(0xf8)](_0x32433b(0xef)+_0x58e913));const _0x3eedd2=await withSpinner(_0x32433b(0x10c)+_0x234e30+'\x27...',()=>_0x4b21a5[_0x32433b(0x117)][_0x32433b(0xf1)](_0x234e30),{'verbose':_0x368d95[_0x32433b(0x107)]}),_0x4142a3=_0x3eedd2[_0x32433b(0x104)];let _0x7e93f4;if(_0x9d74b3[_0x32433b(0xfc)][_0x32433b(0x101)]>0x2){const _0x16d671=await withSpinner(_0x32433b(0x113)+_0x58e913+_0x32433b(0xfe),()=>_0x4b21a5[_0x32433b(0x117)][_0x32433b(0xff)](_0x58e913),{'verbose':_0x368d95[_0x32433b(0x107)]}),_0x46d54d=_0x16d671[_0x32433b(0x104)];if(_0x46d54d[_0x32433b(0x11b)]!==_0x32433b(0x105)&&_0x46d54d[_0x32433b(0x11b)]!==_0x32433b(0x11d))return console[_0x32433b(0xf8)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x7e93f4=_0x46d54d[_0x32433b(0xf5)];}else{if(_0x368d95[_0x32433b(0x105)]){const _0x5e4c5e=await withSpinner(_0x32433b(0x100)+_0x368d95[_0x32433b(0x105)]+'\x27...',()=>_0x4b21a5[_0x32433b(0x117)][_0x32433b(0x10f)](_0x4142a3,_0x368d95[_0x32433b(0x105)]),{'verbose':_0x368d95['verbose']});_0x7e93f4=_0x5e4c5e[_0x32433b(0x104)];}}_0x368d95[_0x32433b(0x107)]&&_0x7e93f4&&console[_0x32433b(0xf8)](_0x32433b(0xf7)+_0x7e93f4);const _0x37c101=await loadJSONFromOptions(_0x368d95[_0x32433b(0x116)],_0x368d95[_0x32433b(0xed)]),_0x4cec55={'name':_0x549cc7,'description':_0x368d95['description'],'rule':_0x37c101,'kind':_0x368d95['kind']!==undefined?parseInt(_0x368d95[_0x32433b(0x115)],0xa):undefined,'isVisible':_0x368d95[_0x32433b(0x10e)]?![]:undefined,'segmentFolderId':_0x7e93f4,'countPopulation':_0x368d95[_0x32433b(0x109)]?![]:undefined},_0x582f50=await withSpinner(_0x32433b(0xec)+_0x549cc7+_0x32433b(0xfe),()=>_0x4b21a5[_0x32433b(0x117)][_0x32433b(0xfd)](_0x4142a3,_0x4cec55),{'verbose':_0x368d95['verbose']}),_0x2adef7=_0x582f50[_0x32433b(0x104)];return console['error'](_0x32433b(0x103)+_0x2adef7[_0x32433b(0xf9)]+'\x27\x20with\x20ID:\x20'+_0x2adef7['id']),_0x5e4b95!==_0x2a2c52&&console[_0x32433b(0xf8)](_0x32433b(0x114)+_0x5e4b95),await handleSDKOutput([_0x2adef7],_0x368d95),0x0;}}function a33_0x1f63(){const _0x34183c=['6BSdrwp','Resolving\x20folder\x20path\x20\x27','\x20\x20\x20Path:\x20','kind','rule','segment','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Target\x20path:\x20','12cORNuB','type','11yKCELU','parent','Create\x20child\x20segment\x20with\x20filtering\x20rules','515709halhEl','Creating\x20segment\x20\x27','ruleFile','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','1046014yAEhni','resolveParentId','includes','segmentPath','2600898LfskzM','folderId','yellow','Resolved\x20folder\x20ID:\x20','error','name','segment:create','1825943SDnCeH','segments','createSegment','\x27...','resolvePathToResource','Resolving\x20folder\x20\x27','length','description','✔\x20Created\x20segment\x20\x27','data','folder','525591ESQIAb','verbose','Examples:','noCountPopulation','497775zOEWLH','2778220ucUeAH','Resolving\x20parent\x20segment\x20\x27','8gvCRZy','invisible','resolveFolderId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Parent:\x20'];a33_0x1f63=function(){return _0x34183c;};return a33_0x1f63();}
|