@treasuredata/tdx 0.9.7 → 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/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.js +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +36 -7
- 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/endpoints.js +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.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x40f8eb=a29_0x50ab;(function(_0xed943d,_0x6dd519){const _0x1b2c84=a29_0x50ab,_0x38eae3=_0xed943d();while(!![]){try{const _0x34e60e=parseInt(_0x1b2c84(0x18c))/0x1+-parseInt(_0x1b2c84(0x14f))/0x2+-parseInt(_0x1b2c84(0x1e8))/0x3+-parseInt(_0x1b2c84(0x100))/0x4+parseInt(_0x1b2c84(0x1b0))/0x5+parseInt(_0x1b2c84(0x1c3))/0x6*(-parseInt(_0x1b2c84(0x117))/0x7)+-parseInt(_0x1b2c84(0x15b))/0x8*(-parseInt(_0x1b2c84(0xfb))/0x9);if(_0x34e60e===_0x6dd519)break;else _0x38eae3['push'](_0x38eae3['shift']());}catch(_0x3740dd){_0x38eae3['push'](_0x38eae3['shift']());}}}(a29_0x2ecd,0x663a6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a29_0x472bdf 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';function a29_0x50ab(_0x4cabf5,_0x20ebf7){_0x4cabf5=_0x4cabf5-0xc8;const _0x2ecd1=a29_0x2ecd();let _0x50abbb=_0x2ecd1[_0x4cabf5];return _0x50abbb;}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_0x41d2e6 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_0x40f8eb(0xec),LEGACY_PARENT_SEGMENT_DIR=a29_0x40f8eb(0x1b9);function openBrowser(_0x297555){const _0x145855=a29_0x40f8eb,_0x254dcb=process['platform'],_0x12f9a9=_0x254dcb===_0x145855(0x177)?'open':_0x254dcb===_0x145855(0x104)?'start':_0x145855(0xd2);spawn(_0x12f9a9,[_0x297555],{'detached':!![],'stdio':'ignore'})['unref']();}function migrateLegacyDirectory(){const _0xdb72cb=a29_0x40f8eb;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x568103=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x568103['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a29_0x41d2e6[_0xdb72cb(0x1af)](_0xdb72cb(0x105)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0xdb72cb(0x15d))),console[_0xdb72cb(0x150)](a29_0x41d2e6[_0xdb72cb(0x186)](_0xdb72cb(0x164)+LEGACY_PARENT_SEGMENT_DIR+_0xdb72cb(0x119))),![];console['error'](a29_0x41d2e6[_0xdb72cb(0x1af)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xdb72cb(0x150)](a29_0x41d2e6[_0xdb72cb(0x10e)](_0xdb72cb(0x109)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2d0786){const _0x542f0b=_0x2d0786 instanceof Error?_0x2d0786['message']:String(_0x2d0786);return console[_0xdb72cb(0x150)](a29_0x41d2e6['red'](_0xdb72cb(0x17c)+_0x542f0b+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x40f8eb(0x16e)](_0x396a4e){return migrateLegacyDirectory(),super['run'](_0x396a4e);}}function resolveYamlFile(_0x525bc3){const _0x511f8d=a29_0x40f8eb;if(_0x525bc3[_0x511f8d(0x1ce)](_0x511f8d(0xe9))||_0x525bc3['endsWith'](_0x511f8d(0x162)))return _0x525bc3;return a29_0x472bdf[_0x511f8d(0x1b1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x525bc3)+'.yml');}function formatProgressMessage(_0x3d2e91){const _0x4e29a4=a29_0x40f8eb,_0x3c1505=_0x3d2e91[_0x4e29a4(0xe1)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3c1505){const [,_0x4acbc0,_0x160344,_0x42194c='']=_0x3c1505;return a29_0x41d2e6['dim'](_0x4acbc0+':')+'\x20'+_0x160344+a29_0x41d2e6[_0x4e29a4(0x186)](_0x42194c);}return a29_0x41d2e6['dim'](_0x3d2e91);}function showFileNotFoundError(_0x4ac263,_0x5e16c4){const _0x48b024=a29_0x40f8eb;console[_0x48b024(0x150)](a29_0x41d2e6[_0x48b024(0xf4)]('Error:\x20File\x20not\x20found:\x20'+_0x4ac263+'\x0a')),console[_0x48b024(0x150)](a29_0x41d2e6[_0x48b024(0x18b)](_0x48b024(0x1ab)+_0x5e16c4+_0x48b024(0x120)));}function showParentSegmentNotSetError(_0x4d65d1){const _0x5cc931=a29_0x40f8eb;console[_0x5cc931(0x150)](a29_0x41d2e6[_0x5cc931(0x1af)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x5cc931(0x150)](_0x4d65d1);}function a29_0x2ecd(){const _0x448cd5=['trim','Options:\x0a','sampleData','Master\x20+\x20Attributes','addAttributesFile','double','8KfXZOy','varchar','/\x20directories\x20exist.','\x0aChanges\x20to\x20apply\x20to\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Created','\x20\x20\x20\x20-\x20','.yaml','Options:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','totalEvents','displayValidateResults','\x27\x20with\x20ID:\x20','\x20parent\x20segment\x20\x27','session','segment','errors','\x20Configuration\x20is\x20valid','execute','run','allValid','Attributes','\x20rows\x20','Preview:','displayColumns','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Fetching\x20SQL\x20for\x20\x27','yes','darwin','\x20\x20No\x20sample\x20data\x20available','format','tdx\x20segment\x20parent\x20preview\x20','Options\x20(one\x20required):\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20[Job\x20ID:\x20','Source:','interval','columns','displaySampleData','timezone','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','/app/dw/parentSegments/','dim','Overwrite\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','parentSegment','attributes','cyan','621614NdiWVn','start','To\x20cancel:','Output\x20file:\x20','label','addAttributes','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','getParentSQL','rowCount','segment:parent:pull','dirname','pullParentYaml','coveragePercent','behavior','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','addBehaviorsFile','segment:parent:update','foreignKey','using\x20the\x20default\x20path:\x20','segment:parent:run','Session:','Database:\x20','getParentFull','output','Updated','Listing\x20fields\x20for\x20\x27','displayPreviewResults','segment:parent:push','population','\x20Opening\x20','column','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','validateParentYaml','status','displayPreviewHints','yellow','3736420iMCmeG','join','Show\x20parent\x20segment\x20details','enriched','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','segment:parent:view','bold','\x20--attribute\x20\x22','filter','parent_segment','\x20--behavior\x20\x22<name>\x22','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','apply','segment:parent:show','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','workflowId','data','joinKey','1899462wjTfVo','Resolving\x20parent\x20segment\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','/app/workflows/','To\x20view\x20sample\x20data:','segment:parent:validate','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Analyzing\x20changes...','repeat','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20--behavior\x20\x22','endsWith','table','behaviors','localeCompare','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','workflowSessionId','Fetching\x20sample\x20data...','Join:','Enriched:','site','keys','scheduleOption','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','No\x20parent\x20segments\x20found','stop','sort','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','displaySummary','addBehaviors','segment:parent:desc','✔\x20Found\x20','👥\x20','matchedCount','Validating\x20configuration...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','1022337pOIFBH','Parent\x20segment:\x20','✔\x20No\x20changes\x20-\x20\x27','Status:','name','jobId','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x20--attribute\x20\x22<name>\x22','Listing\x20parent\x20segments...','\x0aChanges\x20to\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','verbose','web','xdg-open','FINISHED','information_schema','Master\x20Table','\x27...','Create\x20parent\x20segment\x20\x27','Rows:','Attempt:','customerGroupFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','displayMasterInfo','attribute','\x20rows)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','toLocaleString','match','scheduleType','workflowAttemptId','pushParentYaml','\x20=\x20','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Join\x20on:','displayBehaviorsStats','.yml','createParent','\x27\x20and\x20run\x20workflow?','parent_segments','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x0aNo\x20sample\x20data\x20available','Site:\x20','use','all','setJobId','-1d','red','updateParent','✔\x20Created\x20parent\x20segment\x20\x27','attributesFile','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Columns:','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','3427983tqDufw','customersWithEvents','Error:','Fetching\x20parent\x20segment\x20\x27','text','936924BbcOgG','\x20kill','map','Executing\x20parent\x20segment\x20query...','win32','\x0a⚠️\x20\x20Both\x20','Table:\x20','preview','elapsedTimeMillis','✔\x20Renamed\x20directory\x20to\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','SELECT\x20*\x20FROM\x20(\x0a','Available\x20attributes:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','green','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Validate:','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','in\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','toFixed','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20--attribute\x20requires\x20a\x20name\x0a','14fzMdMw','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','/\x20directory.\x0a','schemaValid','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','\x20Context\x20set:\x20','jsonl','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','`\x20to\x20download\x20the\x20configuration\x20first','message','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Updating','json','master','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','customerPercent','number','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','schemaError','\x0aNew\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Errors:','Audience\x20ID:','\x27\x20is\x20already\x20up\x20to\x20date','Attribute:','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Error:\x20--database\x20and\x20--table\x20are\x20required','database','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','length','\x5c$&','Error\x20parsing\x20YAML:\x20','Behavior:','customerGroup','/attempt/','Creating','string','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Name:\x20','Error\x20reading\x20file:\x20','resolveParentId','\x20tdx\x20wf\x20attempt\x20','segment:parent:create','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20field','displayAttributesStats','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','replace','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','YAML\x20file:\x20','245790hrsbOQ','error','Aborted.','segment:parent:sql','utf-8','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'];a29_0x2ecd=function(){return _0x448cd5;};return a29_0x2ecd();}export class ParentSegmentListCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]='segment:parent:list';[a29_0x40f8eb(0x13f)]='List\x20parent\x20segments';async['execute'](_0x1132df){const _0x301d7e=a29_0x40f8eb,{options:_0x3caca1,args:_0x3f120a,tdx:_0x15e29e}=_0x1132df,_0x1239bc=_0x3f120a[0x0];_0x3caca1['verbose']&&(console['error'](_0x301d7e(0xef)+_0x3caca1[_0x301d7e(0x1d8)]),_0x1239bc&&console[_0x301d7e(0x150)]('Pattern:\x20'+_0x1239bc));const _0x411a92=await withSpinner(_0x1239bc?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x1239bc+_0x301d7e(0xd6):_0x301d7e(0xcd),()=>_0x15e29e[_0x301d7e(0x16a)]['listParents'](),{'verbose':_0x3caca1['verbose']});let _0x538f4f=_0x411a92[_0x301d7e(0x1c1)];if(_0x1239bc){const _0xba3478=_0x1239bc[_0x301d7e(0x14c)](/[.+^${}()|[\]\\]/g,_0x301d7e(0x138))[_0x301d7e(0x14c)](/\*/g,'.*')[_0x301d7e(0x14c)](/\?/g,'.'),_0x2a5316=new RegExp('^'+_0xba3478+'$','i');_0x538f4f=_0x538f4f[_0x301d7e(0x1b8)](_0x2af384=>_0x2a5316['test'](_0x2af384[_0x301d7e(0x18a)][_0x301d7e(0xc9)]));}_0x538f4f[_0x301d7e(0x1de)]((_0x3360f3,_0x4ca1a4)=>_0x3360f3['attributes'][_0x301d7e(0xc9)][_0x301d7e(0x1d1)](_0x4ca1a4[_0x301d7e(0x18a)][_0x301d7e(0xc9)])),console[_0x301d7e(0x150)](_0x301d7e(0x1e3)+_0x538f4f[_0x301d7e(0x137)]+'\x20parent\x20segment'+(_0x538f4f[_0x301d7e(0x137)]!==0x1?'s':''));if(_0x3caca1[_0x301d7e(0x179)]===_0x301d7e(0x124)||_0x3caca1[_0x301d7e(0x179)]===_0x301d7e(0x11d))await handleSDKOutput(_0x538f4f,_0x3caca1);else{if(_0x538f4f[_0x301d7e(0x137)]===0x0)_0x1239bc?console[_0x301d7e(0x132)](_0x301d7e(0xcf)+_0x1239bc):console['log'](_0x301d7e(0x1dc));else for(const _0x44b2b3 of _0x538f4f){const _0x524f11=_0x44b2b3[_0x301d7e(0x18a)][_0x301d7e(0x1a8)]?a29_0x41d2e6[_0x301d7e(0x186)]('\x20('+formatRows(_0x44b2b3[_0x301d7e(0x18a)]['population'])+')'):'';console['log'](_0x301d7e(0x1e4)+_0x44b2b3[_0x301d7e(0x18a)][_0x301d7e(0xc9)]+_0x524f11);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x145);[a29_0x40f8eb(0x13f)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x40f8eb(0x16d)](_0x2e59ee){const _0x4a5f83=a29_0x40f8eb,{options:_0x4a0df4,args:_0x4a2c3f,tdx:_0x409151}=_0x2e59ee;console['error'](_0x4a5f83(0x1b4)+_0x4a5f83(0x11f)+_0x4a5f83(0x10a));const _0x1675ef=_0x4a0df4;if(_0x4a2c3f[_0x4a5f83(0x137)]===0x0)return console[_0x4a5f83(0x150)](a29_0x41d2e6[_0x4a5f83(0xf4)](_0x4a5f83(0xdb))),console[_0x4a5f83(0x150)](_0x4a5f83(0xf8)),0x1;const _0x2c3893=_0x4a2c3f[0x0];if(!_0x1675ef[_0x4a5f83(0x135)]||!_0x1675ef['table'])return console[_0x4a5f83(0x150)](_0x4a5f83(0x134)),console[_0x4a5f83(0x150)](_0x4a5f83(0xf8)),0x1;_0x1675ef[_0x4a5f83(0xd0)]&&(console['error'](_0x4a5f83(0xef)+_0x1675ef[_0x4a5f83(0x1d8)]),console[_0x4a5f83(0x150)](_0x4a5f83(0x141)+_0x2c3893),console[_0x4a5f83(0x150)](_0x4a5f83(0x1a1)+_0x1675ef[_0x4a5f83(0x135)]),console[_0x4a5f83(0x150)](_0x4a5f83(0x106)+_0x1675ef[_0x4a5f83(0x1cf)]));const _0x4fce96=await loadJSONFromOptions(_0x1675ef[_0x4a5f83(0x18a)],_0x1675ef[_0x4a5f83(0xf7)]),_0x492fa2=await loadJSONFromOptions(_0x1675ef['behaviors'],_0x1675ef['behaviorsFile']),_0x56ab63=await loadJSONFromOptions(_0x1675ef['customerGroup'],_0x1675ef[_0x4a5f83(0xda)]),_0x273d9b={'name':_0x2c3893,'description':_0x1675ef[_0x4a5f83(0x13f)],'scheduleType':_0x1675ef[_0x4a5f83(0xe2)],'scheduleOption':_0x1675ef[_0x4a5f83(0x1da)],'timezone':_0x1675ef['timezone'],'master':{'parentDatabaseName':_0x1675ef['database'],'parentTableName':_0x1675ef[_0x4a5f83(0x1cf)]},'attributes':_0x4fce96,'behaviors':_0x492fa2,'customerGroup':_0x56ab63},_0x269b25=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x2c3893+_0x4a5f83(0xd6),()=>_0x409151[_0x4a5f83(0x16a)][_0x4a5f83(0xea)](_0x273d9b),{'verbose':_0x4a0df4[_0x4a5f83(0xd0)]}),_0xbce3ff=_0x269b25[_0x4a5f83(0x1c1)];return console[_0x4a5f83(0x150)](_0x4a5f83(0xf6)+_0xbce3ff[_0x4a5f83(0xc9)]+_0x4a5f83(0x167)+_0xbce3ff['id']),await handleSDKOutput([_0xbce3ff],_0x4a0df4),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x19c);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x40f8eb(0x16d)](_0x298316){const _0x4b278d=a29_0x40f8eb,{options:_0x17023b,args:_0x211bb3,tdx:_0x28afdc}=_0x298316;console[_0x4b278d(0x150)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x4b278d(0x10a));const _0x239e8d=_0x17023b;if(_0x211bb3[_0x4b278d(0x137)]===0x0)return console[_0x4b278d(0x150)](a29_0x41d2e6[_0x4b278d(0xf4)](_0x4b278d(0xdb))),console[_0x4b278d(0x150)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x24ce1c=_0x211bb3[0x0];_0x239e8d[_0x4b278d(0xd0)]&&(console[_0x4b278d(0x150)](_0x4b278d(0xef)+_0x239e8d[_0x4b278d(0x1d8)]),console[_0x4b278d(0x150)]('Parent\x20segment:\x20'+_0x24ce1c));const _0x1992cd=await withSpinner(_0x4b278d(0x183)+_0x24ce1c+_0x4b278d(0xd6),()=>_0x28afdc[_0x4b278d(0x16a)][_0x4b278d(0x1a2)](_0x24ce1c),{'verbose':_0x239e8d['verbose']}),_0x3989d3=_0x1992cd[_0x4b278d(0x1c1)],_0x220a33=await loadJSONFromOptions(_0x239e8d[_0x4b278d(0x191)],_0x239e8d[_0x4b278d(0x159)]),_0x9dfcb7=await loadJSONFromOptions(_0x239e8d[_0x4b278d(0x1e1)],_0x239e8d[_0x4b278d(0x19b)]),_0x431b86={'name':_0x3989d3['name'],'description':_0x239e8d[_0x4b278d(0x13f)]!==undefined?_0x239e8d[_0x4b278d(0x13f)]:_0x3989d3['description'],'scheduleType':_0x239e8d['scheduleType']!==undefined?_0x239e8d['scheduleType']:_0x3989d3[_0x4b278d(0xe2)],'scheduleOption':_0x239e8d[_0x4b278d(0x1da)]!==undefined?_0x239e8d['scheduleOption']:_0x3989d3[_0x4b278d(0x1da)],'timezone':_0x239e8d[_0x4b278d(0x182)]!==undefined?_0x239e8d[_0x4b278d(0x182)]:_0x3989d3[_0x4b278d(0x182)],'master':_0x3989d3[_0x4b278d(0x125)],'attributes':_0x220a33?[..._0x3989d3['attributes']||[],..._0x220a33]:_0x3989d3[_0x4b278d(0x18a)],'behaviors':_0x9dfcb7?[..._0x3989d3['behaviors']||[],..._0x9dfcb7]:_0x3989d3['behaviors'],'customerGroup':_0x3989d3[_0x4b278d(0x13b)]},_0x2cfac9=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x24ce1c+_0x4b278d(0xd6),()=>_0x28afdc[_0x4b278d(0x16a)][_0x4b278d(0xf5)](_0x24ce1c,_0x431b86),{'verbose':_0x239e8d[_0x4b278d(0xd0)]}),_0x361586=_0x2cfac9[_0x4b278d(0x1c1)];return console[_0x4b278d(0x150)](_0x4b278d(0x11e)+_0x361586[_0x4b278d(0xc9)]+'\x27'),await handleSDKOutput([_0x361586],_0x239e8d),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a29_0x40f8eb(0x195);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x113);async[a29_0x40f8eb(0x16d)](_0x4536b8){const _0x284086=a29_0x40f8eb,{options:_0x1caaea,args:_0x1a373d,tdx:_0x44b604}=_0x4536b8,_0x500b5c=_0x1caaea,_0x3b0866=_0x1a373d[0x0]||_0x1caaea[_0x284086(0x189)];if(!_0x3b0866)return showParentSegmentNotSetError(_0x284086(0x19a)+_0x284086(0x133)),0x1;if(_0x500b5c[_0x284086(0xf0)]&&_0x500b5c[_0x284086(0x1a3)])return console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0xf4)](_0x284086(0x12a))),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x1db))),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x19e)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console['error'](a29_0x41d2e6[_0x284086(0x18b)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x20b4c5=_0x500b5c['output']||a29_0x472bdf[_0x284086(0x1b1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3b0866)+_0x284086(0xe9));_0x500b5c['verbose']&&(console[_0x284086(0x150)](_0x284086(0xef)+_0x500b5c['site']),console[_0x284086(0x150)](_0x284086(0x1e9)+_0x3b0866),console['error'](_0x284086(0x18f)+_0x20b4c5));const _0x4b79ae=await withSpinner(_0x284086(0xfe)+_0x3b0866+_0x284086(0xd6),()=>_0x44b604[_0x284086(0x16a)][_0x284086(0x197)](_0x3b0866),{'verbose':_0x500b5c[_0x284086(0xd0)]}),_0x5c4acc=_0x4b79ae[_0x284086(0x1c1)];if(existsSync(_0x20b4c5)){const _0xd507f=readFileSync(_0x20b4c5,_0x284086(0x153)),_0x47e1c6=generateDiff(_0xd507f,_0x5c4acc);if(!hasChanges(_0x47e1c6))console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x10e)]('✔')+'\x20No\x20changes\x20-\x20'+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x284086(0x150)](_0x284086(0xce)+_0x20b4c5+'\x27:'),console['error']('─'[_0x284086(0x1cb)](0x3c)),console[_0x284086(0x150)](formatDiffWithColors(_0x47e1c6)),console[_0x284086(0x150)]('─'[_0x284086(0x1cb)](0x3c));if(!_0x500b5c[_0x284086(0x176)]){const _0x186bbd=await confirmKey(_0x284086(0x187)+_0x20b4c5+'\x27?');if(!_0x186bbd)return console['error'](_0x284086(0x151)),0x1;}writeFileSync(_0x20b4c5,_0x5c4acc,_0x284086(0x153)),console['error'](a29_0x41d2e6['green']('✔')+_0x284086(0x154)+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5));}}else{const _0x752fcd=a29_0x472bdf[_0x284086(0x196)](_0x20b4c5);!existsSync(_0x752fcd)&&mkdirSync(_0x752fcd,{'recursive':!![]}),writeFileSync(_0x20b4c5,_0x5c4acc,'utf-8'),console[_0x284086(0x150)](a29_0x41d2e6['green']('✔')+_0x284086(0x154)+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5));}return saveSessionContext({'parent_segment':_0x3b0866},_0x500b5c[_0x284086(0x169)]),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x10e)]('✔')+_0x284086(0x11c)+a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x1b9))+_0x284086(0xe5)+a29_0x41d2e6[_0x284086(0x18b)](_0x3b0866)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1a7);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x122);async[a29_0x40f8eb(0x16d)](_0x5d35a1){const _0x539592=a29_0x40f8eb,{options:_0x1d2ac8,args:_0x28e1f9,tdx:_0x433630}=_0x5d35a1,_0x3667a3=_0x1d2ac8,_0x4ee828=_0x28e1f9[0x0]||_0x1d2ac8[_0x539592(0x189)];if(!_0x4ee828)return showParentSegmentNotSetError(_0x539592(0x12d)+_0x539592(0x140)),0x1;const _0x18cab9=resolveYamlFile(_0x4ee828);if(!existsSync(_0x18cab9))return showFileNotFoundError(_0x18cab9,_0x4ee828),0x1;_0x3667a3[_0x539592(0xd0)]&&(console[_0x539592(0x150)]('Site:\x20'+_0x3667a3[_0x539592(0x1d8)]),console[_0x539592(0x150)]('YAML\x20file:\x20'+_0x18cab9));let _0x248a5e;try{_0x248a5e=readFileSync(_0x18cab9,_0x539592(0x153));}catch(_0x309abc){const _0x3a1b04=_0x309abc instanceof Error?_0x309abc['message']:String(_0x309abc);return console['error'](_0x539592(0x142)+_0x3a1b04),0x1;}const _0x34927b=await withSpinner(_0x539592(0x1ca),()=>_0x433630[_0x539592(0x16a)][_0x539592(0xe4)](_0x248a5e),{'verbose':_0x3667a3[_0x539592(0xd0)]}),_0x165eb9=_0x34927b[_0x539592(0x1c1)],{isNew:_0x4c33fa,name:_0x16e00b,hasChanges:_0x3591dc,diffFormatted:_0x13a5e5}=_0x165eb9;if(!_0x3591dc)return console[_0x539592(0x150)](_0x539592(0x1ea)+_0x16e00b+_0x539592(0x130)),0x0;_0x4c33fa?console[_0x539592(0x150)](_0x539592(0x12c)+_0x16e00b+'\x27:'):console[_0x539592(0x150)](_0x539592(0x15e)+_0x16e00b+'\x27:');console[_0x539592(0x150)]('─'['repeat'](0x3c)),console[_0x539592(0x150)](_0x13a5e5),console[_0x539592(0x150)]('─'[_0x539592(0x1cb)](0x3c));const _0x2045c6=_0x4c33fa?_0x539592(0xd7)+_0x16e00b+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x16e00b+'\x27?';if(!_0x3667a3['yes']){const _0x1a1a65=await confirmKey(_0x2045c6);if(!_0x1a1a65)return console[_0x539592(0x150)](_0x539592(0x151)),0x1;}const _0x239b43=_0x4c33fa?_0x539592(0x13d):_0x539592(0x123),_0x54dd5e=await withSpinner(_0x239b43+_0x539592(0x168)+_0x16e00b+_0x539592(0xd6),()=>_0x165eb9[_0x539592(0x1bd)](),{'verbose':_0x3667a3['verbose']}),_0x558eb8=_0x54dd5e['data'],_0x420450=getConsoleNextUrl(_0x3667a3[_0x539592(0x1d8)],_0x539592(0x185)+_0x558eb8['id']),_0x5c3013=_0x4c33fa?_0x539592(0x160):_0x539592(0x1a4);return console[_0x539592(0x150)]('✔\x20'+_0x5c3013+'\x20parent\x20segment\x20\x27'+_0x558eb8['name']+'\x27'),console[_0x539592(0x150)]('\x20\x20'+_0x420450),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1c8);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x14b);async['execute'](_0x51d84a){const _0x1dadcc=a29_0x40f8eb,{options:_0x316207,args:_0x493362,tdx:_0x421eab}=_0x51d84a,_0x4ff92b=_0x316207,_0x348844=_0x493362[0x0]||_0x316207['parentSegment'];if(!_0x348844)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x1dadcc(0x115)+_0x1dadcc(0x156)+_0x1dadcc(0x111)+_0x1dadcc(0x1d2)+_0x1dadcc(0x146)),0x1;const _0x54ebef=resolveYamlFile(_0x348844);if(!existsSync(_0x54ebef))return showFileNotFoundError(_0x54ebef,_0x348844),0x1;_0x4ff92b[_0x1dadcc(0xd0)]&&(console[_0x1dadcc(0x150)](_0x1dadcc(0xef)+_0x4ff92b[_0x1dadcc(0x1d8)]),console[_0x1dadcc(0x150)]('YAML\x20file:\x20'+_0x54ebef));let _0x279df6;try{_0x279df6=readFileSync(_0x54ebef,_0x1dadcc(0x153));}catch(_0x17a6d6){const _0x57264c=_0x17a6d6 instanceof Error?_0x17a6d6[_0x1dadcc(0x121)]:String(_0x17a6d6);return console['error'](_0x1dadcc(0x142)+_0x57264c),0x1;}const _0x106f65=createCommandSpinner(a29_0x41d2e6[_0x1dadcc(0x186)](_0x1dadcc(0x1e6)),{'verbose':_0x4ff92b[_0x1dadcc(0xd0)]});_0x106f65[_0x1dadcc(0x18d)]();const _0x435aa0={'onProgress':_0xae780f=>{_0x106f65['text']=formatProgressMessage(_0xae780f);}};if(_0x4ff92b[_0x1dadcc(0x125)])_0x435aa0['master']=!![];if(_0x4ff92b[_0x1dadcc(0x1b3)])_0x435aa0['enriched']=!![];_0x4ff92b['attribute']&&(_0x435aa0['attribute']=_0x4ff92b[_0x1dadcc(0xdd)]);_0x4ff92b[_0x1dadcc(0x199)]&&(_0x435aa0[_0x1dadcc(0x199)]=_0x4ff92b[_0x1dadcc(0x199)]);if(_0x4ff92b['interval'])_0x435aa0[_0x1dadcc(0x17f)]=_0x4ff92b[_0x1dadcc(0x17f)];let _0x26f5af;try{_0x26f5af=await _0x421eab[_0x1dadcc(0x16a)][_0x1dadcc(0x1ac)](_0x279df6,_0x435aa0),_0x106f65[_0x1dadcc(0x1dd)]();}catch(_0x2a91ec){_0x106f65['stop']();throw _0x2a91ec;}const _0x316c27=_0x4ff92b[_0x1dadcc(0x17f)]||_0x1dadcc(0xf3);return this[_0x1dadcc(0x166)](_0x26f5af,_0x435aa0,_0x54ebef,_0x316c27),_0x26f5af[_0x1dadcc(0x16f)]?0x0:0x1;}[a29_0x40f8eb(0x166)](_0x114fdf,_0x1f281a,_0x1c3cd9,_0x33516c){const _0x24694b=a29_0x40f8eb;console['error']('\x0a'+a29_0x41d2e6[_0x24694b(0x1b6)](_0x24694b(0x110))+'\x20'+_0x114fdf[_0x24694b(0xc9)]),console[_0x24694b(0x150)]('═'[_0x24694b(0x1cb)](0x3c)),this[_0x24694b(0xdc)](_0x114fdf);if(typeof _0x1f281a['attribute']===_0x24694b(0x13e)){this[_0x24694b(0x149)](_0x114fdf),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'attribute',_0x1f281a[_0x24694b(0xdd)]);return;}if(_0x1f281a[_0x24694b(0xdd)]===!![]){this['displayAttributesStats'](_0x114fdf),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'attributes');return;}if(typeof _0x1f281a['behavior']==='string'){this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'behavior',_0x1f281a[_0x24694b(0x199)]);return;}if(_0x1f281a['behavior']===!![]){this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this['displaySummary'](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,_0x24694b(0x1d0));return;}this[_0x24694b(0x149)](_0x114fdf),this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this['displaySummary'](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,_0x24694b(0xf1));}['displayPreviewHints'](_0x2b0c01,_0x1ae73b,_0x3f2ad3,_0x5ca8e6){const _0x496380=a29_0x40f8eb;console[_0x496380(0x150)]('\x0a'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x1c7)));const _0x1276b4=_0x1ae73b!==_0x496380(0xf3)?'\x20--interval\x20'+_0x1ae73b:'';if(_0x3f2ad3===_0x496380(0xdd)&&_0x5ca8e6)console['error']('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1b7)+_0x5ca8e6+'\x22'+_0x1276b4));else{if(_0x3f2ad3==='behavior'&&_0x5ca8e6)console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1cd)+_0x5ca8e6+'\x22'+_0x1276b4));else(_0x3f2ad3===_0x496380(0x18a)||_0x3f2ad3==='all')&&console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0xcc)+_0x1276b4));}(_0x3f2ad3===_0x496380(0x1d0)||_0x3f2ad3==='all')&&console['error']('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1ba)+_0x1276b4)),_0x3f2ad3==='all'&&console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+'\x20--enriched'+_0x1276b4));}['displayMasterInfo'](_0x43c874){const _0x55d245=a29_0x40f8eb,{master:_0x3a2ec8}=_0x43c874,_0x4a986a=_0x3a2ec8['schemaValid']?a29_0x41d2e6[_0x55d245(0x10e)]('✔'):a29_0x41d2e6['red']('✘');console[_0x55d245(0x150)]('\x0a'+a29_0x41d2e6[_0x55d245(0x186)](_0x55d245(0xd5))),console[_0x55d245(0x150)](_0x4a986a+'\x20'+a29_0x41d2e6[_0x55d245(0x1b6)](_0x3a2ec8['database']+'.'+_0x3a2ec8[_0x55d245(0x1cf)])),_0x3a2ec8[_0x55d245(0x11a)]?_0x3a2ec8[_0x55d245(0x194)]!==undefined&&console[_0x55d245(0x150)]('\x20\x20'+a29_0x41d2e6[_0x55d245(0x186)](_0x55d245(0xd8))+'\x20'+a29_0x41d2e6[_0x55d245(0x18b)](formatRows(_0x3a2ec8['rowCount']))):console['error']('\x20\x20'+a29_0x41d2e6[_0x55d245(0xf4)]('Error:')+'\x20'+_0x3a2ec8[_0x55d245(0x12b)]);}[a29_0x40f8eb(0x149)](_0x288cca){const _0xd4c3eb=a29_0x40f8eb;if(_0x288cca[_0xd4c3eb(0x18a)]['length']===0x0)return;console[_0xd4c3eb(0x150)]('\x0a'+a29_0x41d2e6['dim'](_0xd4c3eb(0x170)));for(const _0x38e72a of _0x288cca[_0xd4c3eb(0x18a)]){const _0x2f5ea0=_0x38e72a[_0xd4c3eb(0x11a)]?a29_0x41d2e6[_0xd4c3eb(0x10e)]('✔'):a29_0x41d2e6[_0xd4c3eb(0xf4)]('✘');let _0x3d7004='';if(_0x38e72a[_0xd4c3eb(0x11a)]&&_0x38e72a[_0xd4c3eb(0x1e5)]!==undefined&&_0x38e72a['coveragePercent']!==undefined){const _0x4ec3cf=_0x38e72a[_0xd4c3eb(0x198)][_0xd4c3eb(0x114)](0x1),_0x1135b7=_0x38e72a[_0xd4c3eb(0x198)]>=0x50?a29_0x41d2e6[_0xd4c3eb(0x10e)]:_0x38e72a['coveragePercent']>=0x32?a29_0x41d2e6[_0xd4c3eb(0x1af)]:a29_0x41d2e6[_0xd4c3eb(0xf4)];_0x3d7004='\x20'+a29_0x41d2e6['dim']('Coverage:')+'\x20'+_0x1135b7(_0x4ec3cf+'%')+'\x20('+formatRows(_0x38e72a[_0xd4c3eb(0x1e5)])+_0xd4c3eb(0xde);}console['error'](_0x2f5ea0+'\x20'+a29_0x41d2e6['bold'](_0x38e72a[_0xd4c3eb(0xc9)])+_0x3d7004),console[_0xd4c3eb(0x150)]('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0x186)](_0xd4c3eb(0x17e))+'\x20'+a29_0x41d2e6[_0xd4c3eb(0x1b6)](_0x38e72a[_0xd4c3eb(0x135)]+'.'+_0x38e72a[_0xd4c3eb(0x1cf)]));const _0x3acd82=_0x38e72a[_0xd4c3eb(0x1c2)]===_0x38e72a[_0xd4c3eb(0x19d)]?a29_0x41d2e6[_0xd4c3eb(0x186)](_0xd4c3eb(0xe7))+'\x20'+_0x38e72a[_0xd4c3eb(0x1c2)]:a29_0x41d2e6['dim'](_0xd4c3eb(0x1d6))+'\x20'+_0x38e72a[_0xd4c3eb(0x1c2)]+_0xd4c3eb(0xe5)+_0x38e72a[_0xd4c3eb(0x19d)];console['error']('\x20\x20'+_0x3acd82),console[_0xd4c3eb(0x150)]('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0x186)]('Columns:')),this[_0xd4c3eb(0x173)](_0x38e72a[_0xd4c3eb(0x180)]),!_0x38e72a['schemaValid']&&console['error']('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0xf4)](_0xd4c3eb(0xfd))+'\x20'+_0x38e72a[_0xd4c3eb(0x12b)]);}}[a29_0x40f8eb(0xe8)](_0x21a423,_0x4b2fc3){const _0x29a054=a29_0x40f8eb;if(_0x21a423[_0x29a054(0x1d0)][_0x29a054(0x137)]===0x0)return;console[_0x29a054(0x150)]('\x0a'+a29_0x41d2e6[_0x29a054(0x186)]('Behaviors')+'\x20'+a29_0x41d2e6['dim']('('+_0x4b2fc3+')'));for(const _0x459e71 of _0x21a423[_0x29a054(0x1d0)]){const _0x5664c0=_0x459e71[_0x29a054(0x11a)]?a29_0x41d2e6[_0x29a054(0x10e)]('✔'):a29_0x41d2e6[_0x29a054(0xf4)]('✘');let _0x5398da='';if(_0x459e71['schemaValid']&&_0x459e71['customersWithEvents']!==undefined&&_0x459e71[_0x29a054(0x165)]!==undefined){const _0x43a2df=_0x459e71['customerPercent']?.[_0x29a054(0x114)](0x1)||'?',_0x114923=(_0x459e71[_0x29a054(0x127)]??0x0)>=0x32?a29_0x41d2e6[_0x29a054(0x10e)]:(_0x459e71[_0x29a054(0x127)]??0x0)>=0x14?a29_0x41d2e6[_0x29a054(0x1af)]:a29_0x41d2e6[_0x29a054(0xf4)];_0x5398da='\x20'+a29_0x41d2e6[_0x29a054(0x186)]('Customers:')+'\x20'+_0x114923(formatRows(_0x459e71[_0x29a054(0xfc)]))+'\x20('+_0x43a2df+'%)\x20'+a29_0x41d2e6[_0x29a054(0x186)]('Events:')+'\x20'+a29_0x41d2e6[_0x29a054(0x18b)](formatRows(_0x459e71[_0x29a054(0x165)]));}console[_0x29a054(0x150)](_0x5664c0+'\x20'+a29_0x41d2e6['bold'](_0x459e71[_0x29a054(0xc9)])+_0x5398da),console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6[_0x29a054(0x186)](_0x29a054(0x17e))+'\x20'+a29_0x41d2e6[_0x29a054(0x1b6)](_0x459e71[_0x29a054(0x135)]+'.'+_0x459e71[_0x29a054(0x1cf)]));const _0x1c4ce6=_0x459e71['joinKey']===_0x459e71[_0x29a054(0x19d)]?a29_0x41d2e6[_0x29a054(0x186)](_0x29a054(0xe7))+'\x20'+_0x459e71[_0x29a054(0x1c2)]:a29_0x41d2e6[_0x29a054(0x186)]('Join:')+'\x20'+_0x459e71[_0x29a054(0x1c2)]+_0x29a054(0xe5)+_0x459e71[_0x29a054(0x19d)];console[_0x29a054(0x150)]('\x20\x20'+_0x1c4ce6),console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x29a054(0xf9))),this[_0x29a054(0x173)](_0x459e71[_0x29a054(0x180)]),!_0x459e71[_0x29a054(0x11a)]&&console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6[_0x29a054(0xf4)](_0x29a054(0xfd))+'\x20'+_0x459e71[_0x29a054(0x12b)]);}}[a29_0x40f8eb(0x173)](_0x545e74){const _0x4fa933=a29_0x40f8eb;for(const _0x233475 of _0x545e74){_0x233475[_0x4fa933(0x190)]===_0x233475[_0x4fa933(0x1aa)]||_0x233475[_0x4fa933(0x1aa)]==='*'?console[_0x4fa933(0x150)](_0x4fa933(0x161)+_0x233475[_0x4fa933(0x190)]):console[_0x4fa933(0x150)](_0x4fa933(0x161)+_0x233475['label']+'\x20'+a29_0x41d2e6[_0x4fa933(0x186)]('('+_0x233475['column']+')'));}}[a29_0x40f8eb(0x1e0)](_0x3b4b4f){const _0x34223e=a29_0x40f8eb;console[_0x34223e(0x150)]('─'['repeat'](0x3c));if(_0x3b4b4f[_0x34223e(0x16b)][_0x34223e(0x137)]>0x0){console[_0x34223e(0x150)]('\x0a'+a29_0x41d2e6[_0x34223e(0xf4)](_0x34223e(0x12e)));for(const _0x340a24 of _0x3b4b4f[_0x34223e(0x16b)]){console[_0x34223e(0x150)]('\x20\x20'+a29_0x41d2e6[_0x34223e(0xf4)]('•')+'\x20'+_0x340a24);}}_0x3b4b4f[_0x34223e(0x16f)]&&console[_0x34223e(0x150)]('\x0a'+a29_0x41d2e6['green']('✔')+_0x34223e(0x16c));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]='segment:parent:preview';[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x1cc);async[a29_0x40f8eb(0x16d)](_0x2c2ae1){const _0x4eccba=a29_0x40f8eb,{options:_0x1911fc,args:_0x469143,tdx:_0x4cb438}=_0x2c2ae1,_0x58d2f6=_0x1911fc,_0x4aea51=_0x469143[0x0]||_0x1911fc['parentSegment'];if(!_0x4aea51)return showParentSegmentNotSetError(_0x4eccba(0x1d3)+_0x4eccba(0x1df)+_0x4eccba(0x17b)+_0x4eccba(0x136)+_0x4eccba(0x1bc)+_0x4eccba(0x1e7)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x58d2f6[_0x4eccba(0x125)]&&!_0x58d2f6[_0x4eccba(0xdd)]&&!_0x58d2f6['behavior']&&!_0x58d2f6[_0x4eccba(0x1b3)])return console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x118))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x4eccba(0x150)](_0x4eccba(0x163)),console['error'](_0x4eccba(0x1c9)),console[_0x4eccba(0x150)](_0x4eccba(0x126)),console['error'](_0x4eccba(0x1bf)),console[_0x4eccba(0x150)](_0x4eccba(0x1bb)),0x1;const _0x30c199=resolveYamlFile(_0x4aea51);if(!existsSync(_0x30c199))return showFileNotFoundError(_0x30c199,_0x4aea51),0x1;_0x58d2f6[_0x4eccba(0xd0)]&&(console[_0x4eccba(0x150)](_0x4eccba(0xef)+_0x58d2f6['site']),console[_0x4eccba(0x150)](_0x4eccba(0x14e)+_0x30c199));let _0x426dd6;try{_0x426dd6=readFileSync(_0x30c199,'utf-8');}catch(_0x3395be){const _0x1c89b1=_0x3395be instanceof Error?_0x3395be[_0x4eccba(0x121)]:String(_0x3395be);return console[_0x4eccba(0x150)](_0x4eccba(0x142)+_0x1c89b1),0x1;}let _0x6f0a6a;try{_0x6f0a6a=parseYamlString(_0x426dd6);}catch(_0x51b447){const _0x12ee5b=_0x51b447 instanceof Error?_0x51b447['message']:String(_0x51b447);return console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x139)+_0x12ee5b)),0x1;}if(_0x58d2f6[_0x4eccba(0xdd)]===!![]||_0x58d2f6[_0x4eccba(0xdd)]===''){const _0x4af48f=_0x6f0a6a[_0x4eccba(0x18a)]?.[_0x4eccba(0x102)](_0x1ea509=>_0x1ea509[_0x4eccba(0xc9)])||[];if(_0x4af48f[_0x4eccba(0x137)]===0x0)console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x116))),console[_0x4eccba(0x150)](_0x4eccba(0x10c));for(const _0x238a35 of _0x4af48f){console[_0x4eccba(0x150)]('\x20\x20'+a29_0x41d2e6[_0x4eccba(0x18b)](_0x238a35));}console[_0x4eccba(0x150)](_0x4eccba(0x129)+_0x4aea51+_0x4eccba(0x1b7)+_0x4af48f[0x0]+'\x22');}return 0x1;}if(_0x58d2f6[_0x4eccba(0x199)]===!![]||_0x58d2f6[_0x4eccba(0x199)]===''){const _0x58c80b=_0x6f0a6a[_0x4eccba(0x1d0)]?.['map'](_0x53ff49=>_0x53ff49[_0x4eccba(0xc9)])||[];if(_0x58c80b[_0x4eccba(0x137)]===0x0)console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x14d)));else{console['error'](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x1c5))),console[_0x4eccba(0x150)]('Available\x20behaviors:');for(const _0x77bd1c of _0x58c80b){console[_0x4eccba(0x150)]('\x20\x20'+a29_0x41d2e6['cyan'](_0x77bd1c));}console['error'](_0x4eccba(0x129)+_0x4aea51+'\x20--behavior\x20\x22'+_0x58c80b[0x0]+'\x22');}return 0x1;}const _0x10567b=createCommandSpinner(a29_0x41d2e6[_0x4eccba(0x186)](_0x4eccba(0x1d5)),{'verbose':_0x58d2f6[_0x4eccba(0xd0)]});_0x10567b[_0x4eccba(0x18d)]();const _0x499fe7={'onProgress':_0x3b3214=>{const _0x5414f=_0x4eccba;_0x10567b[_0x5414f(0xff)]=formatProgressMessage(_0x3b3214);}};if(_0x58d2f6['master'])_0x499fe7[_0x4eccba(0x125)]=!![];if(_0x58d2f6[_0x4eccba(0xdd)]&&typeof _0x58d2f6['attribute']===_0x4eccba(0x13e))_0x499fe7[_0x4eccba(0xdd)]=_0x58d2f6[_0x4eccba(0xdd)];if(_0x58d2f6['behavior']&&typeof _0x58d2f6['behavior']==='string')_0x499fe7[_0x4eccba(0x199)]=_0x58d2f6[_0x4eccba(0x199)];if(_0x58d2f6[_0x4eccba(0x1b3)])_0x499fe7[_0x4eccba(0x1b3)]=!![];if(_0x58d2f6[_0x4eccba(0x17f)])_0x499fe7[_0x4eccba(0x17f)]=_0x58d2f6['interval'];let _0x1d6b1d;try{_0x1d6b1d=await _0x4cb438[_0x4eccba(0x16a)]['previewParentYaml'](_0x426dd6,_0x499fe7),_0x10567b['stop']();}catch(_0x3c13f){_0x10567b['stop']();throw _0x3c13f;}return await this[_0x4eccba(0x1a6)](_0x1d6b1d,{'master':_0x58d2f6[_0x4eccba(0x125)],'attribute':typeof _0x58d2f6[_0x4eccba(0xdd)]===_0x4eccba(0x13e)?_0x58d2f6[_0x4eccba(0xdd)]:undefined,'behavior':typeof _0x58d2f6[_0x4eccba(0x199)]===_0x4eccba(0x13e)?_0x58d2f6['behavior']:undefined,'enriched':_0x58d2f6[_0x4eccba(0x1b3)]}),_0x1d6b1d['allValid']?0x0:0x1;}async[a29_0x40f8eb(0x1a6)](_0x4771d1,_0x4faf21){const _0x3ef47e=a29_0x40f8eb;console[_0x3ef47e(0x150)]('\x0a'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x3ef47e(0x172))+'\x20'+_0x4771d1['name']),console['error']('═'['repeat'](0x3c));if(_0x4faf21[_0x3ef47e(0x125)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x1e8b86=a29_0x41d2e6[_0x3ef47e(0x186)]('Master:')+'\x20'+a29_0x41d2e6['bold'](_0x4771d1[_0x3ef47e(0x125)][_0x3ef47e(0x135)]+'.'+_0x4771d1['master']['table']);await this[_0x3ef47e(0x181)](_0x1e8b86,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21[_0x3ef47e(0xdd)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x18e5ef=a29_0x41d2e6[_0x3ef47e(0x186)](_0x3ef47e(0x131))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x4faf21[_0x3ef47e(0xdd)]);await this[_0x3ef47e(0x181)](_0x18e5ef,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21[_0x3ef47e(0x199)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x4ec2f1=a29_0x41d2e6['dim'](_0x3ef47e(0x13a))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x4faf21['behavior']);await this[_0x3ef47e(0x181)](_0x4ec2f1,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21['enriched']&&_0x4771d1[_0x3ef47e(0x157)]){const _0x29020d=a29_0x41d2e6[_0x3ef47e(0x186)](_0x3ef47e(0x1d7))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x3ef47e(0x158));await this[_0x3ef47e(0x181)](_0x29020d,_0x4771d1[_0x3ef47e(0x157)]);}else!_0x4771d1['sampleData']&&console[_0x3ef47e(0x150)](_0x3ef47e(0xee));}}}if(_0x4771d1[_0x3ef47e(0x16b)][_0x3ef47e(0x137)]>0x0){console['error']('─'[_0x3ef47e(0x1cb)](0x3c)),console[_0x3ef47e(0x150)]('\x0a'+a29_0x41d2e6[_0x3ef47e(0xf4)](_0x3ef47e(0x12e)));for(const _0x1a6cef of _0x4771d1[_0x3ef47e(0x16b)]){console[_0x3ef47e(0x150)]('\x20\x20'+a29_0x41d2e6[_0x3ef47e(0xf4)]('•')+'\x20'+_0x1a6cef);}}}async[a29_0x40f8eb(0x181)](_0x2aae97,_0x1dc80f){const _0x36f6f9=a29_0x40f8eb;if(_0x1dc80f['length']===0x0){console[_0x36f6f9(0x150)]('\x0a'+_0x2aae97),console['error'](_0x36f6f9(0x178));return;}console[_0x36f6f9(0x150)]('\x0a'+_0x2aae97);const _0x44d5dd=Object[_0x36f6f9(0x1d9)](_0x1dc80f[0x0])['map'](_0xa10959=>({'name':_0xa10959,'type':typeof _0x1dc80f[0x0][_0xa10959]===_0x36f6f9(0x128)?_0x36f6f9(0x15a):_0x36f6f9(0x15c)})),_0x116e7b={'queryId':_0x36f6f9(0x107),'columns':_0x44d5dd,'data':_0x1dc80f,'stats':{'state':_0x36f6f9(0xd3),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1dc80f[_0x36f6f9(0x137)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x41ac44=formatAsTable(_0x116e7b,_0x1dc80f[_0x36f6f9(0x137)],!![]);await writeOutput(_0x41ac44,undefined,_0x36f6f9(0x1cf));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x19f);[a29_0x40f8eb(0x13f)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a29_0x40f8eb(0x16d)](_0x44c385){const _0x3e5739=a29_0x40f8eb,{options:_0x7f0e4f,args:_0x4faa3f,tdx:_0x5a68b0}=_0x44c385,_0x266fc2=_0x7f0e4f,_0x266798=_0x4faa3f[0x0]||_0x7f0e4f[_0x3e5739(0x189)];if(!_0x266798)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x3e5739(0xdf)),0x1;const _0x2e7496=resolveYamlFile(_0x266798);if(existsSync(_0x2e7496)){_0x266fc2[_0x3e5739(0xd0)]&&console['error']('Found\x20YAML\x20file:\x20'+_0x2e7496);let _0x1d3b25;try{_0x1d3b25=readFileSync(_0x2e7496,_0x3e5739(0x153));}catch(_0x41b2d9){const _0x2d8e2f=_0x41b2d9 instanceof Error?_0x41b2d9[_0x3e5739(0x121)]:String(_0x41b2d9);return console[_0x3e5739(0x150)](_0x3e5739(0x142)+_0x2d8e2f),0x1;}const _0x2b3410=await withSpinner(_0x3e5739(0x1ca),()=>_0x5a68b0[_0x3e5739(0x16a)]['pushParentYaml'](_0x1d3b25),{'verbose':_0x266fc2[_0x3e5739(0xd0)]}),_0x280227=_0x2b3410[_0x3e5739(0x1c1)],{isNew:_0x3b27d6,name:_0x7680a7,hasChanges:_0x32e952,diffFormatted:_0x37737e}=_0x280227;if(_0x32e952){_0x3b27d6?console['error'](_0x3e5739(0x12c)+_0x7680a7+'\x27:'):console[_0x3e5739(0x150)](_0x3e5739(0x15e)+_0x7680a7+'\x27:');console['error']('─'[_0x3e5739(0x1cb)](0x3c)),console[_0x3e5739(0x150)](_0x37737e),console['error']('─'['repeat'](0x3c));const _0x4e44d2=_0x3b27d6?_0x3e5739(0xd7)+_0x7680a7+_0x3e5739(0xeb):'Apply\x20changes\x20to\x20\x27'+_0x7680a7+'\x27\x20and\x20run\x20workflow?';if(!_0x266fc2[_0x3e5739(0x176)]){const _0x4d8a75=await confirmKey(_0x4e44d2);if(!_0x4d8a75)return console[_0x3e5739(0x150)](_0x3e5739(0x151)),0x1;}const _0x41605f=_0x3b27d6?_0x3e5739(0x13d):_0x3e5739(0x123);await withSpinner(_0x41605f+'\x20parent\x20segment\x20\x27'+_0x7680a7+_0x3e5739(0xd6),()=>_0x280227[_0x3e5739(0x1bd)](),{'verbose':_0x266fc2[_0x3e5739(0xd0)]});const _0xba39f6=_0x3b27d6?_0x3e5739(0x160):_0x3e5739(0x1a4);console[_0x3e5739(0x150)]('✔\x20'+_0xba39f6+_0x3e5739(0x168)+_0x7680a7+'\x27');}else console[_0x3e5739(0x150)](_0x3e5739(0x1ea)+_0x7680a7+'\x27\x20is\x20up\x20to\x20date');}const _0x15f8f0=await withSpinner(_0x3e5739(0xfa)+_0x266798+'\x27...',()=>_0x5a68b0['segment']['runParent'](_0x266798),{'verbose':_0x266fc2['verbose']}),_0x5b572e=_0x15f8f0['data'],_0x403570=getConsoleUrl(_0x266fc2[_0x3e5739(0x1d8)],_0x3e5739(0x1c6)+_0x5b572e[_0x3e5739(0x1c0)]+'/sessions/'+_0x5b572e[_0x3e5739(0x1d4)]+_0x3e5739(0x13c)+_0x5b572e[_0x3e5739(0xe3)]);return console[_0x3e5739(0x150)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x12f))+'\x20'+_0x5b572e['audienceId']),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x3e5739(0xc8))+'\x20'+_0x5b572e[_0x3e5739(0x1ad)]),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x1a0))+'\x20'+_0x5b572e[_0x3e5739(0x1d4)]),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x3e5739(0xd9))+'\x20'+_0x5b572e['workflowAttemptId']),console[_0x3e5739(0x150)]('\x20\x20'+_0x403570),console['error']('\x0a'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x18e))+_0x3e5739(0x144)+_0x5b572e[_0x3e5739(0xe3)]+_0x3e5739(0x101)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x15f);async['execute'](_0x4f55db){const _0x48b4ff=a29_0x40f8eb,{options:_0x358f51,args:_0x458ea4,tdx:_0x54c37e}=_0x4f55db,_0xd2d729=_0x458ea4[0x0]||_0x358f51[_0x48b4ff(0x189)];if(!_0xd2d729)return showParentSegmentNotSetError(_0x48b4ff(0xe6)+'\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;_0x358f51[_0x48b4ff(0xd0)]&&(console[_0x48b4ff(0x150)](_0x48b4ff(0xef)+_0x358f51['site']),console[_0x48b4ff(0x150)](_0x48b4ff(0x1e9)+_0xd2d729));const _0xd5f563=await withSpinner(_0x48b4ff(0x1a5)+_0xd2d729+_0x48b4ff(0xd6),()=>_0x54c37e['segment']['listFields'](_0xd2d729),{'verbose':_0x358f51['verbose']}),_0x29a818=_0xd5f563[_0x48b4ff(0x1c1)];console[_0x48b4ff(0x150)](_0x48b4ff(0x1e3)+_0x29a818[_0x48b4ff(0x137)]+_0x48b4ff(0x148)+(_0x29a818[_0x48b4ff(0x137)]!==0x1?'s':''));if(_0x358f51[_0x48b4ff(0x124)]||_0x358f51[_0x48b4ff(0x11d)])return await handleSDKOutput(_0x29a818,_0x358f51),0x0;return displayFieldsHumanReadable(_0x29a818,_0xd2d729),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1b5);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x1b2);async[a29_0x40f8eb(0x16d)](_0x100e1a){const _0x2f0d0f=a29_0x40f8eb,{options:_0x590afe,args:_0xf1830a,tdx:_0x10f113}=_0x100e1a,_0x43376e=_0x590afe,_0x471c00=_0xf1830a[0x0]||_0x590afe['parentSegment'];if(!_0x471c00)return showParentSegmentNotSetError(_0x2f0d0f(0x174)+_0x2f0d0f(0x188)+_0x2f0d0f(0x156)+_0x2f0d0f(0xed)),0x1;_0x590afe[_0x2f0d0f(0xd0)]&&(console[_0x2f0d0f(0x150)](_0x2f0d0f(0xef)+_0x590afe[_0x2f0d0f(0x1d8)]),console[_0x2f0d0f(0x150)]('Parent\x20segment:\x20'+_0x471c00));const _0xb0d279=await withSpinner(_0x2f0d0f(0xfe)+_0x471c00+_0x2f0d0f(0xd6),()=>_0x10f113['segment']['getParentFull'](_0x471c00),{'verbose':_0x590afe['verbose']}),_0x2f27a7=_0xb0d279[_0x2f0d0f(0x1c1)];if(_0x43376e[_0x2f0d0f(0xd1)]){const _0x18f041=getConsoleNextUrl(_0x43376e[_0x2f0d0f(0x1d8)],_0x2f0d0f(0x185)+_0x2f27a7['id']);return console[_0x2f0d0f(0x150)](a29_0x41d2e6['green']('✔')+_0x2f0d0f(0x1a9)+a29_0x41d2e6[_0x2f0d0f(0x18b)](_0x18f041)),openBrowser(_0x18f041),0x0;}return await handleSingleObjectOutput(_0x2f27a7,_0x590afe),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1e2);[a29_0x40f8eb(0x13f)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a29_0x40f8eb(0x16d)](_0x5f1941){const _0x1fd189=a29_0x40f8eb,{options:_0xe61666,args:_0x14bde8,tdx:_0x11f654}=_0x5f1941,_0x514f42=_0x14bde8[0x0]||_0xe61666[_0x1fd189(0x189)];if(!_0x514f42)return showParentSegmentNotSetError(_0x1fd189(0x11b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0xe61666[_0x1fd189(0xd0)]&&(console[_0x1fd189(0x150)](_0x1fd189(0xef)+_0xe61666['site']),console[_0x1fd189(0x150)](_0x1fd189(0x1e9)+_0x514f42));const _0x70b853=await withSpinner(_0x1fd189(0x1c4)+_0x514f42+_0x1fd189(0xd6),()=>_0x11f654['segment'][_0x1fd189(0x143)](_0x514f42),{'verbose':_0xe61666[_0x1fd189(0xd0)]}),_0x1d6e9a=_0x70b853[_0x1fd189(0x1c1)],_0x15b9e4=await withSpinner(_0x1fd189(0x175)+_0x514f42+_0x1fd189(0xd6),()=>_0x11f654['segment']['getParentSQL'](_0x1d6e9a),{'verbose':_0xe61666[_0x1fd189(0xd0)]}),_0x1dde82=await executeSchemaQuery(_0x15b9e4[_0x1fd189(0x1c1)],_0x11f654,_0xe61666);return await handleQueryOutput(_0x1dde82,_0xe61666),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a29_0x40f8eb(0x152);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x147);async[a29_0x40f8eb(0x16d)](_0x3b0a65){const _0x3ca9b6=a29_0x40f8eb,{options:_0x339dda,args:_0x26f6e8,tdx:_0x4132a1}=_0x3b0a65,_0x2d7557=_0x26f6e8[0x0]||_0x339dda[_0x3ca9b6(0x189)];if(!_0x2d7557)return showParentSegmentNotSetError(_0x3ca9b6(0xcb)+_0x3ca9b6(0x184)),0x1;_0x339dda[_0x3ca9b6(0xd0)]&&(console[_0x3ca9b6(0x150)](_0x3ca9b6(0xef)+_0x339dda[_0x3ca9b6(0x1d8)]),console[_0x3ca9b6(0x150)](_0x3ca9b6(0x1e9)+_0x2d7557));const _0x3f454b=await withSpinner(_0x3ca9b6(0x1c4)+_0x2d7557+'\x27...',()=>_0x4132a1[_0x3ca9b6(0x16a)]['resolveParentId'](_0x2d7557),{'verbose':_0x339dda[_0x3ca9b6(0xd0)]}),_0x6554de=_0x3f454b[_0x3ca9b6(0x1c1)],_0x4176c3=await withSpinner(_0x3ca9b6(0x175)+_0x2d7557+_0x3ca9b6(0xd6),()=>_0x4132a1[_0x3ca9b6(0x16a)]['getParentSQL'](_0x6554de),{'verbose':_0x339dda[_0x3ca9b6(0xd0)]}),_0x8b436f=_0x4176c3[_0x3ca9b6(0x1c1)];return _0x339dda[_0x3ca9b6(0x179)]===_0x3ca9b6(0x124)||_0x339dda[_0x3ca9b6(0x179)]===_0x3ca9b6(0x11d)?await handleSDKOutput([{'sql':_0x8b436f}],_0x339dda):console[_0x3ca9b6(0x132)](_0x8b436f),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a29_0x40f8eb(0x1be);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x10d);async[a29_0x40f8eb(0x16d)](_0x214782){const _0xa18f52=a29_0x40f8eb,{options:_0x37390d,args:_0x1166ad,tdx:_0x20c0a6}=_0x214782,_0x2354b8=_0x1166ad[0x0]||_0x37390d[_0xa18f52(0x189)];if(!_0x2354b8)return showParentSegmentNotSetError(_0xa18f52(0x192)+_0xa18f52(0x14a)),0x1;_0x37390d[_0xa18f52(0xd0)]&&(console[_0xa18f52(0x150)]('Site:\x20'+_0x37390d[_0xa18f52(0x1d8)]),console[_0xa18f52(0x150)](_0xa18f52(0x1e9)+_0x2354b8));const _0x484071=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2354b8+_0xa18f52(0xd6),()=>_0x20c0a6[_0xa18f52(0x16a)][_0xa18f52(0x143)](_0x2354b8),{'verbose':_0x37390d[_0xa18f52(0xd0)]}),_0x27513f=_0x484071['data'],_0x3ac2f3=await withSpinner(_0xa18f52(0x175)+_0x2354b8+'\x27...',()=>_0x20c0a6[_0xa18f52(0x16a)][_0xa18f52(0x193)](_0x27513f),{'verbose':_0x37390d['verbose']});let _0x3d2955=_0x3ac2f3[_0xa18f52(0x1c1)];const _0x42d53c=resolveLimit(_0x37390d['limit'],DEFAULT_DISPLAY_LIMIT),_0x399803=/\bLIMIT\s+\d+/i['test'](_0x3d2955);!_0x399803&&(_0x3d2955=_0x3d2955[_0xa18f52(0x155)]()['replace'](/;+$/,''),_0x3d2955=_0xa18f52(0x10b)+_0x3d2955+_0xa18f52(0x10f)+_0x42d53c);_0x37390d['verbose']&&console[_0xa18f52(0x150)]('SQL\x20query:\x0a'+_0x3d2955);const _0x449475=await withQuerySpinner(_0xa18f52(0x103),async _0x3a7346=>{const _0xcac343=_0xa18f52,_0x44539f=await _0x20c0a6['query'][_0xcac343(0x16d)](_0x3d2955,{'catalog':'td','schema':_0xcac343(0xd4),'onJobId':_0x5c6e18=>{const _0x546c56=_0xcac343;_0x3a7346[_0x546c56(0xf2)](_0x5c6e18);}});return _0x44539f;},{'verbose':_0x37390d['verbose']}),_0x48d9cd=_0x449475[_0xa18f52(0x1c1)],_0x28d752=_0x48d9cd['jobId']?_0xa18f52(0x17d)+_0x48d9cd[_0xa18f52(0xca)]+']':'';return console[_0xa18f52(0x150)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x48d9cd['stats']['processedRows'][_0xa18f52(0xe0)]()+_0xa18f52(0x171)+(_0xa18f52(0x112)+formatElapsed(_0x48d9cd['stats'][_0xa18f52(0x108)])+_0x28d752)),await handleQueryOutput(_0x48d9cd,_0x37390d),0x0;}}
|
|
1
|
+
const a29_0x1390a3=a29_0x4ed2;(function(_0x2c64c3,_0x45c1b7){const _0x28f8db=a29_0x4ed2,_0x33271c=_0x2c64c3();while(!![]){try{const _0x4b6677=parseInt(_0x28f8db(0x18e))/0x1+-parseInt(_0x28f8db(0x90))/0x2+-parseInt(_0x28f8db(0x16d))/0x3*(parseInt(_0x28f8db(0xe6))/0x4)+-parseInt(_0x28f8db(0x16f))/0x5*(-parseInt(_0x28f8db(0x140))/0x6)+-parseInt(_0x28f8db(0x10f))/0x7+parseInt(_0x28f8db(0x13c))/0x8*(parseInt(_0x28f8db(0x12f))/0x9)+-parseInt(_0x28f8db(0x1ad))/0xa;if(_0x4b6677===_0x45c1b7)break;else _0x33271c['push'](_0x33271c['shift']());}catch(_0x198f5c){_0x33271c['push'](_0x33271c['shift']());}}}(a29_0x8355,0xb8389));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a29_0xb92fdf 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';function a29_0x8355(){const _0x591da5=['Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','toFixed','data','✔\x20Found\x20','schemaValid','Join:','YAML\x20file:\x20','Behaviors','dirname','test','platform','17359100YwyCtC','limit','\x0aChanges\x20to\x20apply\x20to\x20\x27','Aborted.','master','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x20--behavior\x20\x22<name>\x22','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','segment:parent:fields','509508moMEXK','\x20\x20No\x20sample\x20data\x20available','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','behaviors','segment','Behavior:','yes','bold','enriched','Executing\x20parent\x20segment\x20query...','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','jsonl','Error:','Available\x20attributes:','Overwrite\x20\x27','Found\x20YAML\x20file:\x20','Attribute:','parentSegment','column','Error:\x20--database\x20and\x20--table\x20are\x20required','setJobId','✘\x20Failed\x20to\x20rename\x20directory:\x20','No\x20parent\x20segments\x20found','\x20Context\x20set:\x20','\x20--enriched','displayPreviewResults','table','schemaError','Created','localeCompare','Apply\x20changes\x20to\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20No\x20changes\x20-\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','errors','scheduleOption','Pattern:\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','addAttributes','getParentSQL','✔\x20Created\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','segment:parent:show','Source:','Name:\x20','map','attributesFile','resolveParentId','timezone','\x20is\x20already\x20up\x20to\x20date','all','rowCount','interval','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Analyzing\x20changes...','-1d','unref','\x20field','Audience\x20ID:','status','audienceId','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','site','displayColumns','displayBehaviorsStats','Site:\x20','trim','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','workflowAttemptId','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20Configuration\x20is\x20valid','Columns:','sort','\x20=\x20','✔\x20Renamed\x20directory\x20to\x20','Enriched:','customersWithEvents','log','displaySampleData','replace','totalEvents','start','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','coveragePercent','sampleData','4qrxidr','listFields','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','format','Master\x20+\x20Attributes','query','Get\x20SQL\x20query\x20for\x20parent\x20segment','tdx\x20segment\x20parent\x20preview\x20','Events:','segment:parent:create','✔\x20Updated\x20parent\x20segment\x20\x27','\x20Opening\x20','\x27\x20is\x20already\x20up\x20to\x20date','Available\x20behaviors:','double','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','json','joinKey','runParent','segment:parent:push','Table:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','text','createParent','apply','dim','name','open','Fetching\x20SQL\x20for\x20\x27','description','\x27\x20with\x20ID:\x20','segment:parent:list','keys','jobId','message','\x27...','Errors:','web','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','endsWith','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','1928850iGFiZg','.yml','segment:parent:preview','Join\x20on:','Error\x20parsing\x20YAML:\x20','/sessions/','join','Master:','behavior','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','/{name}.yml\x0a','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','darwin','%)\x20','session','ignore','allValid','Database:\x20','addBehaviorsFile','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Error:\x20File\x20not\x20found:\x20','Session:','Create\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x27\x20and\x20run\x20workflow?','isDirectory','Listing\x20parent\x20segments...','segment:parent:sql','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','To\x20cancel:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','9BNZaYP','\x0a⚠️\x20\x20Both\x20','displayPreviewHints','processedRows','Coverage:','Listing\x20parent\x20segments\x20matching\x20\x27','preview','segment:parent:validate','pullParentYaml','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','using\x20the\x20default\x20path:\x20','Updating','listParents','11409896MllmHU','cyan','pushParentYaml','Listing\x20fields\x20for\x20\x27','36JbWHMV','/attempt/','toLocaleString','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','population','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','getParentFull','utf-8','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','workflowSessionId','red','Status:','\x20--attribute\x20\x22<name>\x22','parent_segment','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','\x20\x20\x20\x20-\x20','previewParentYaml','SELECT\x20*\x20FROM\x20(\x0a','displayAttributesStats','\x27\x20is\x20up\x20to\x20date','attribute','customerPercent','output','displaySummary','\x20[Job\x20ID:\x20','👥\x20','label','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','validateParentYaml','segment:parent:pull','✔\x20No\x20changes\x20-\x20\x27','workflowId','List\x20parent\x20segments','Options\x20(one\x20required):\x0a','/\x20and\x20','foreignKey','Creating','stop','\x20--attribute\x20\x22','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','green','180267GBBHVG','use','1170255YJpEfz','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Creating\x20parent\x20segment\x20\x27','\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','/app/dw/parentSegments/','\x20tdx\x20wf\x20attempt\x20','\x20kill','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','repeat','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Updated','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','win32','\x0aNew\x20parent\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','Updating\x20parent\x20segment\x20\x27','database','verbose','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','matchedCount','xdg-open','run','customerGroup','\x20--interval\x20','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','displayValidateResults','To\x20view\x20sample\x20data:','250329YPgvbB','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','attributes','Validating\x20configuration...','Error\x20reading\x20file:\x20','yellow','behaviorsFile','Fetching\x20parent\x20segment\x20\x27','scheduleType','length','Error:\x20Parent\x20segment\x20name\x20is\x20required','string','execute','/\x20directory.\x0a','Show\x20parent\x20segment\x20details','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','.yaml','\x20parent\x20segment\x20\x27','segment:parent:desc','\x0a✔\x20Workflow\x20started'];a29_0x8355=function(){return _0x591da5;};return a29_0x8355();}import a29_0x49befd 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_0x1390a3(0x150);function openBrowser(_0x324ac3){const _0x6bc5b=a29_0x1390a3,_0x2d1f7c=process[_0x6bc5b(0x1ac)],_0x595359=_0x2d1f7c===_0x6bc5b(0x11c)?_0x6bc5b(0x101):_0x2d1f7c===_0x6bc5b(0x17c)?_0x6bc5b(0xe2):_0x6bc5b(0x184);spawn(_0x595359,[_0x324ac3],{'detached':!![],'stdio':_0x6bc5b(0x11f)})[_0x6bc5b(0xc8)]();}function migrateLegacyDirectory(){const _0xaffaf4=a29_0x1390a3;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x29090e=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x29090e[_0xaffaf4(0x129)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xaffaf4(0x8d)](a29_0x49befd[_0xaffaf4(0x193)](_0xaffaf4(0x130)+LEGACY_PARENT_SEGMENT_DIR+_0xaffaf4(0x166)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console['error'](a29_0x49befd[_0xaffaf4(0xff)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xaffaf4(0x19b))),![];console[_0xaffaf4(0x8d)](a29_0x49befd[_0xaffaf4(0x193)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x49befd[_0xaffaf4(0x16c)](_0xaffaf4(0xdb)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x5bf2ab){const _0x3ae71c=_0x5bf2ab instanceof Error?_0x5bf2ab[_0xaffaf4(0x108)]:String(_0x5bf2ab);return console[_0xaffaf4(0x8d)](a29_0x49befd['red'](_0xaffaf4(0xa5)+_0x3ae71c+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x1390a3(0x185)](_0x1808f7){return migrateLegacyDirectory(),super['run'](_0x1808f7);}}function resolveYamlFile(_0x417333){const _0x353cb5=a29_0x1390a3;if(_0x417333[_0x353cb5(0x10d)](_0x353cb5(0x110))||_0x417333[_0x353cb5(0x10d)](_0x353cb5(0x19e)))return _0x417333;return a29_0xb92fdf[_0x353cb5(0x115)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x417333)+_0x353cb5(0x110));}function formatProgressMessage(_0x562f2c){const _0xa7ee86=a29_0x1390a3,_0x133fb7=_0x562f2c['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x133fb7){const [,_0x4c17ab,_0x3c3457,_0x5c2659='']=_0x133fb7;return a29_0x49befd[_0xa7ee86(0xff)](_0x4c17ab+':')+'\x20'+_0x3c3457+a29_0x49befd['dim'](_0x5c2659);}return a29_0x49befd[_0xa7ee86(0xff)](_0x562f2c);}function showFileNotFoundError(_0x1de68e,_0x5883dc){const _0x35f0c0=a29_0x1390a3;console[_0x35f0c0(0x8d)](a29_0x49befd[_0x35f0c0(0x14d)](_0x35f0c0(0x124)+_0x1de68e+'\x0a')),console[_0x35f0c0(0x8d)](a29_0x49befd['cyan'](_0x35f0c0(0x177)+_0x5883dc+'`\x20to\x20download\x20the\x20configuration\x20first'));}function showParentSegmentNotSetError(_0x5c4573){const _0xc437c9=a29_0x1390a3;console[_0xc437c9(0x8d)](a29_0x49befd[_0xc437c9(0x193)](_0xc437c9(0x182))),console[_0xc437c9(0x8d)](_0x5c4573);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0x105);[a29_0x1390a3(0x103)]=a29_0x1390a3(0x164);async['execute'](_0xbd08a1){const _0x247e6c=a29_0x1390a3,{options:_0x46ba23,args:_0x1c575f,tdx:_0x2b162b}=_0xbd08a1,_0x2e00b3=_0x1c575f[0x0];_0x46ba23[_0x247e6c(0x181)]&&(console[_0x247e6c(0x8d)]('Site:\x20'+_0x46ba23[_0x247e6c(0xce)]),_0x2e00b3&&console[_0x247e6c(0x8d)](_0x247e6c(0xb4)+_0x2e00b3));const _0x70811b=await withSpinner(_0x2e00b3?_0x247e6c(0x134)+_0x2e00b3+_0x247e6c(0x109):_0x247e6c(0x12a),()=>_0x2b162b[_0x247e6c(0x94)][_0x247e6c(0x13b)](),{'verbose':_0x46ba23[_0x247e6c(0x181)]});let _0x4c1231=_0x70811b[_0x247e6c(0x1a4)];if(_0x2e00b3){const _0x4c4959=_0x2e00b3[_0x247e6c(0xe0)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x247e6c(0xe0)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x40bfdd=new RegExp('^'+_0x4c4959+'$','i');_0x4c1231=_0x4c1231['filter'](_0x242ccb=>_0x40bfdd[_0x247e6c(0x1ab)](_0x242ccb[_0x247e6c(0x190)][_0x247e6c(0x100)]));}_0x4c1231[_0x247e6c(0xd9)]((_0x3d0aba,_0x36130d)=>_0x3d0aba[_0x247e6c(0x190)]['name'][_0x247e6c(0xad)](_0x36130d[_0x247e6c(0x190)]['name'])),console[_0x247e6c(0x8d)]('✔\x20Found\x20'+_0x4c1231[_0x247e6c(0x197)]+_0x247e6c(0x172)+(_0x4c1231['length']!==0x1?'s':''));if(_0x46ba23['format']===_0x247e6c(0xf6)||_0x46ba23['format']==='jsonl')await handleSDKOutput(_0x4c1231,_0x46ba23);else{if(_0x4c1231[_0x247e6c(0x197)]===0x0)_0x2e00b3?console[_0x247e6c(0xde)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x2e00b3):console[_0x247e6c(0xde)](_0x247e6c(0xa6));else for(const _0xfbac56 of _0x4c1231){const _0xc7c53b=_0xfbac56[_0x247e6c(0x190)][_0x247e6c(0x144)]?a29_0x49befd['dim']('\x20('+formatRows(_0xfbac56[_0x247e6c(0x190)][_0x247e6c(0x144)])+')'):'';console['log'](_0x247e6c(0x15d)+_0xfbac56[_0x247e6c(0x190)]['name']+_0xc7c53b);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0xef);[a29_0x1390a3(0x103)]=a29_0x1390a3(0x11b);async[a29_0x1390a3(0x19a)](_0x33ac70){const _0x3b0f59=a29_0x1390a3,{options:_0x1cb156,args:_0x1bb62e,tdx:_0x371f9b}=_0x33ac70;console[_0x3b0f59(0x8d)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x3b0f59(0xd4)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x4b9e6a=_0x1cb156;if(_0x1bb62e[_0x3b0f59(0x197)]===0x0)return console[_0x3b0f59(0x8d)](a29_0x49befd[_0x3b0f59(0x14d)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x3b0f59(0x8d)](_0x3b0f59(0x18f)),0x1;const _0x5412c9=_0x1bb62e[0x0];if(!_0x4b9e6a[_0x3b0f59(0x180)]||!_0x4b9e6a['table'])return console['error'](_0x3b0f59(0xa3)),console[_0x3b0f59(0x8d)](_0x3b0f59(0x18f)),0x1;_0x4b9e6a['verbose']&&(console[_0x3b0f59(0x8d)]('Site:\x20'+_0x4b9e6a[_0x3b0f59(0xce)]),console[_0x3b0f59(0x8d)](_0x3b0f59(0xbc)+_0x5412c9),console[_0x3b0f59(0x8d)](_0x3b0f59(0x121)+_0x4b9e6a['database']),console[_0x3b0f59(0x8d)](_0x3b0f59(0xfa)+_0x4b9e6a[_0x3b0f59(0xaa)]));const _0x546016=await loadJSONFromOptions(_0x4b9e6a[_0x3b0f59(0x190)],_0x4b9e6a[_0x3b0f59(0xbe)]),_0x2625c4=await loadJSONFromOptions(_0x4b9e6a['behaviors'],_0x4b9e6a[_0x3b0f59(0x194)]),_0x5df8d5=await loadJSONFromOptions(_0x4b9e6a[_0x3b0f59(0x186)],_0x4b9e6a['customerGroupFile']),_0x513c03={'name':_0x5412c9,'description':_0x4b9e6a[_0x3b0f59(0x103)],'scheduleType':_0x4b9e6a[_0x3b0f59(0x196)],'scheduleOption':_0x4b9e6a[_0x3b0f59(0xb3)],'timezone':_0x4b9e6a[_0x3b0f59(0xc0)],'master':{'parentDatabaseName':_0x4b9e6a[_0x3b0f59(0x180)],'parentTableName':_0x4b9e6a[_0x3b0f59(0xaa)]},'attributes':_0x546016,'behaviors':_0x2625c4,'customerGroup':_0x5df8d5},_0x2a6d93=await withSpinner(_0x3b0f59(0x171)+_0x5412c9+_0x3b0f59(0x109),()=>_0x371f9b['segment'][_0x3b0f59(0xfd)](_0x513c03),{'verbose':_0x1cb156[_0x3b0f59(0x181)]}),_0x304230=_0x2a6d93[_0x3b0f59(0x1a4)];return console[_0x3b0f59(0x8d)](_0x3b0f59(0xb8)+_0x304230['name']+_0x3b0f59(0x104)+_0x304230['id']),await handleSDKOutput([_0x304230],_0x1cb156),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x1390a3(0x100)]='segment:parent:update';['description']=a29_0x1390a3(0x10c);async['execute'](_0x36b9c8){const _0x37ff95=a29_0x1390a3,{options:_0x3a1204,args:_0x2ba377,tdx:_0x558a4d}=_0x36b9c8;console[_0x37ff95(0x8d)](_0x37ff95(0xb9)+_0x37ff95(0xd4)+_0x37ff95(0xd6));const _0x172ed6=_0x3a1204;if(_0x2ba377[_0x37ff95(0x197)]===0x0)return console[_0x37ff95(0x8d)](a29_0x49befd[_0x37ff95(0x14d)](_0x37ff95(0x198))),console[_0x37ff95(0x8d)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x523b0e=_0x2ba377[0x0];_0x172ed6['verbose']&&(console[_0x37ff95(0x8d)](_0x37ff95(0xd1)+_0x172ed6['site']),console[_0x37ff95(0x8d)](_0x37ff95(0x188)+_0x523b0e));const _0x4e4c08=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x523b0e+_0x37ff95(0x109),()=>_0x558a4d[_0x37ff95(0x94)][_0x37ff95(0x146)](_0x523b0e),{'verbose':_0x172ed6[_0x37ff95(0x181)]}),_0x30661c=_0x4e4c08['data'],_0x57193b=await loadJSONFromOptions(_0x172ed6[_0x37ff95(0xb6)],_0x172ed6['addAttributesFile']),_0x3fac48=await loadJSONFromOptions(_0x172ed6['addBehaviors'],_0x172ed6[_0x37ff95(0x122)]),_0x316b39={'name':_0x30661c[_0x37ff95(0x100)],'description':_0x172ed6[_0x37ff95(0x103)]!==undefined?_0x172ed6['description']:_0x30661c[_0x37ff95(0x103)],'scheduleType':_0x172ed6[_0x37ff95(0x196)]!==undefined?_0x172ed6[_0x37ff95(0x196)]:_0x30661c[_0x37ff95(0x196)],'scheduleOption':_0x172ed6[_0x37ff95(0xb3)]!==undefined?_0x172ed6['scheduleOption']:_0x30661c[_0x37ff95(0xb3)],'timezone':_0x172ed6['timezone']!==undefined?_0x172ed6[_0x37ff95(0xc0)]:_0x30661c['timezone'],'master':_0x30661c[_0x37ff95(0x88)],'attributes':_0x57193b?[..._0x30661c[_0x37ff95(0x190)]||[],..._0x57193b]:_0x30661c['attributes'],'behaviors':_0x3fac48?[..._0x30661c[_0x37ff95(0x93)]||[],..._0x3fac48]:_0x30661c[_0x37ff95(0x93)],'customerGroup':_0x30661c[_0x37ff95(0x186)]},_0x1f46d2=await withSpinner(_0x37ff95(0x17f)+_0x523b0e+_0x37ff95(0x109),()=>_0x558a4d[_0x37ff95(0x94)]['updateParent'](_0x523b0e,_0x316b39),{'verbose':_0x172ed6[_0x37ff95(0x181)]}),_0x1b04c7=_0x1f46d2[_0x37ff95(0x1a4)];return console[_0x37ff95(0x8d)](_0x37ff95(0xf0)+_0x1b04c7[_0x37ff95(0x100)]+'\x27'),await handleSDKOutput([_0x1b04c7],_0x172ed6),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0x161);[a29_0x1390a3(0x103)]=a29_0x1390a3(0xe3);async['execute'](_0x258e4f){const _0x38f6b2=a29_0x1390a3,{options:_0x3f6ba0,args:_0x48c690,tdx:_0x4dfc44}=_0x258e4f,_0x5e17bb=_0x3f6ba0,_0x2c8fc0=_0x48c690[0x0]||_0x3f6ba0[_0x38f6b2(0xa1)];if(!_0x2c8fc0)return showParentSegmentNotSetError(_0x38f6b2(0x173)+_0x38f6b2(0x189)),0x1;if(_0x5e17bb[_0x38f6b2(0x16e)]&&_0x5e17bb[_0x38f6b2(0x15a)])return console['error'](a29_0x49befd[_0x38f6b2(0x14d)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console['error'](a29_0x49befd[_0x38f6b2(0xff)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x38f6b2(0x8d)](a29_0x49befd['dim'](_0x38f6b2(0x139)+PARENT_SEGMENT_DIR+_0x38f6b2(0x119))),console[_0x38f6b2(0x8d)](a29_0x49befd['cyan'](_0x38f6b2(0x179))),0x1;const _0x13f008=_0x5e17bb[_0x38f6b2(0x15a)]||a29_0xb92fdf[_0x38f6b2(0x115)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2c8fc0)+_0x38f6b2(0x110));_0x5e17bb[_0x38f6b2(0x181)]&&(console[_0x38f6b2(0x8d)](_0x38f6b2(0xd1)+_0x5e17bb[_0x38f6b2(0xce)]),console['error']('Parent\x20segment:\x20'+_0x2c8fc0),console[_0x38f6b2(0x8d)]('Output\x20file:\x20'+_0x13f008));const _0x1b5009=await withSpinner(_0x38f6b2(0x195)+_0x2c8fc0+_0x38f6b2(0x109),()=>_0x4dfc44[_0x38f6b2(0x94)][_0x38f6b2(0x137)](_0x2c8fc0),{'verbose':_0x5e17bb[_0x38f6b2(0x181)]}),_0x47a56f=_0x1b5009[_0x38f6b2(0x1a4)];if(existsSync(_0x13f008)){const _0x1da553=readFileSync(_0x13f008,_0x38f6b2(0x147)),_0x312e80=generateDiff(_0x1da553,_0x47a56f);if(!hasChanges(_0x312e80))console[_0x38f6b2(0x8d)](a29_0x49befd[_0x38f6b2(0x16c)]('✔')+_0x38f6b2(0xb0)+a29_0x49befd[_0x38f6b2(0x13d)](_0x13f008)+_0x38f6b2(0xc1));else{console[_0x38f6b2(0x8d)]('\x0aChanges\x20to\x20\x27'+_0x13f008+'\x27:'),console['error']('─'[_0x38f6b2(0x178)](0x3c)),console[_0x38f6b2(0x8d)](formatDiffWithColors(_0x312e80)),console[_0x38f6b2(0x8d)]('─'[_0x38f6b2(0x178)](0x3c));if(!_0x5e17bb[_0x38f6b2(0x96)]){const _0xf0abe3=await confirmKey(_0x38f6b2(0x9e)+_0x13f008+'\x27?');if(!_0xf0abe3)return console[_0x38f6b2(0x8d)](_0x38f6b2(0x87)),0x1;}writeFileSync(_0x13f008,_0x47a56f,_0x38f6b2(0x147)),console[_0x38f6b2(0x8d)](a29_0x49befd[_0x38f6b2(0x16c)]('✔')+_0x38f6b2(0xf5)+a29_0x49befd[_0x38f6b2(0x13d)](_0x13f008));}}else{const _0x1aaf21=a29_0xb92fdf[_0x38f6b2(0x1aa)](_0x13f008);!existsSync(_0x1aaf21)&&mkdirSync(_0x1aaf21,{'recursive':!![]}),writeFileSync(_0x13f008,_0x47a56f,_0x38f6b2(0x147)),console['error'](a29_0x49befd[_0x38f6b2(0x16c)]('✔')+_0x38f6b2(0xf5)+a29_0x49befd[_0x38f6b2(0x13d)](_0x13f008));}return saveSessionContext({'parent_segment':_0x2c8fc0},_0x5e17bb[_0x38f6b2(0x11e)]),console[_0x38f6b2(0x8d)](a29_0x49befd[_0x38f6b2(0x16c)]('✔')+_0x38f6b2(0xa7)+a29_0x49befd[_0x38f6b2(0xff)]('parent_segment')+'\x20=\x20'+a29_0x49befd[_0x38f6b2(0x13d)](_0x2c8fc0)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0xf9);[a29_0x1390a3(0x103)]=a29_0x1390a3(0x16b);async[a29_0x1390a3(0x19a)](_0x7d4536){const _0x5a0993=a29_0x1390a3,{options:_0x5b3ebf,args:_0x32cec9,tdx:_0x55dca6}=_0x7d4536,_0x38ea57=_0x5b3ebf,_0x538534=_0x32cec9[0x0]||_0x5b3ebf[_0x5a0993(0xa1)];if(!_0x538534)return showParentSegmentNotSetError(_0x5a0993(0x92)+_0x5a0993(0x18b)),0x1;const _0x10029e=resolveYamlFile(_0x538534);if(!existsSync(_0x10029e))return showFileNotFoundError(_0x10029e,_0x538534),0x1;_0x38ea57[_0x5a0993(0x181)]&&(console[_0x5a0993(0x8d)](_0x5a0993(0xd1)+_0x38ea57[_0x5a0993(0xce)]),console[_0x5a0993(0x8d)](_0x5a0993(0x1a8)+_0x10029e));let _0x58e6b5;try{_0x58e6b5=readFileSync(_0x10029e,_0x5a0993(0x147));}catch(_0xef8ba5){const _0x408104=_0xef8ba5 instanceof Error?_0xef8ba5[_0x5a0993(0x108)]:String(_0xef8ba5);return console['error'](_0x5a0993(0x192)+_0x408104),0x1;}const _0x5e9dc4=await withSpinner('Analyzing\x20changes...',()=>_0x55dca6[_0x5a0993(0x94)][_0x5a0993(0x13e)](_0x58e6b5),{'verbose':_0x38ea57[_0x5a0993(0x181)]}),_0x117c41=_0x5e9dc4[_0x5a0993(0x1a4)],{isNew:_0xc78ad9,name:_0x2cc141,hasChanges:_0x274a8f,diffFormatted:_0xdc1e46}=_0x117c41;if(!_0x274a8f)return console[_0x5a0993(0x8d)](_0x5a0993(0x162)+_0x2cc141+_0x5a0993(0xf2)),0x0;_0xc78ad9?console[_0x5a0993(0x8d)](_0x5a0993(0x17d)+_0x2cc141+'\x27:'):console[_0x5a0993(0x8d)](_0x5a0993(0x86)+_0x2cc141+'\x27:');console['error']('─'[_0x5a0993(0x178)](0x3c)),console['error'](_0xdc1e46),console[_0x5a0993(0x8d)]('─'[_0x5a0993(0x178)](0x3c));const _0x1f4f25=_0xc78ad9?'Create\x20parent\x20segment\x20\x27'+_0x2cc141+'\x27?':_0x5a0993(0xae)+_0x2cc141+'\x27?';if(!_0x38ea57[_0x5a0993(0x96)]){const _0x42a085=await confirmKey(_0x1f4f25);if(!_0x42a085)return console[_0x5a0993(0x8d)](_0x5a0993(0x87)),0x1;}const _0xf68a59=_0xc78ad9?'Creating':'Updating',_0x1855e0=await withSpinner(_0xf68a59+_0x5a0993(0x19f)+_0x2cc141+_0x5a0993(0x109),()=>_0x117c41['apply'](),{'verbose':_0x38ea57[_0x5a0993(0x181)]}),_0x2b4d78=_0x1855e0[_0x5a0993(0x1a4)],_0x1fb803=getConsoleNextUrl(_0x38ea57['site'],'/app/dw/parentSegments/'+_0x2b4d78['id']),_0x5a0cb4=_0xc78ad9?_0x5a0993(0xac):_0x5a0993(0x17a);return console[_0x5a0993(0x8d)]('✔\x20'+_0x5a0cb4+'\x20parent\x20segment\x20\x27'+_0x2b4d78[_0x5a0993(0x100)]+'\x27'),console[_0x5a0993(0x8d)]('\x20\x20'+_0x1fb803),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a29_0x1390a3(0x136);[a29_0x1390a3(0x103)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a29_0x1390a3(0x19a)](_0x131029){const _0x3495f8=a29_0x1390a3,{options:_0x17efe3,args:_0x42e254,tdx:_0x47091a}=_0x131029,_0x201168=_0x17efe3,_0x14cd24=_0x42e254[0x0]||_0x17efe3[_0x3495f8(0xa1)];if(!_0x14cd24)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x3495f8(0x143)+_0x3495f8(0x123)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0xae7096=resolveYamlFile(_0x14cd24);if(!existsSync(_0xae7096))return showFileNotFoundError(_0xae7096,_0x14cd24),0x1;_0x201168[_0x3495f8(0x181)]&&(console[_0x3495f8(0x8d)](_0x3495f8(0xd1)+_0x201168[_0x3495f8(0xce)]),console[_0x3495f8(0x8d)](_0x3495f8(0x1a8)+_0xae7096));let _0x2ac566;try{_0x2ac566=readFileSync(_0xae7096,_0x3495f8(0x147));}catch(_0x360dfb){const _0x5b1e87=_0x360dfb instanceof Error?_0x360dfb[_0x3495f8(0x108)]:String(_0x360dfb);return console['error'](_0x3495f8(0x192)+_0x5b1e87),0x1;}const _0x52c0be=createCommandSpinner(a29_0x49befd[_0x3495f8(0xff)](_0x3495f8(0x191)),{'verbose':_0x201168[_0x3495f8(0x181)]});_0x52c0be[_0x3495f8(0xe2)]();const _0x5ac8c5={'onProgress':_0x131214=>{const _0x575add=_0x3495f8;_0x52c0be[_0x575add(0xfc)]=formatProgressMessage(_0x131214);}};if(_0x201168['master'])_0x5ac8c5['master']=!![];if(_0x201168[_0x3495f8(0x98)])_0x5ac8c5[_0x3495f8(0x98)]=!![];_0x201168['attribute']&&(_0x5ac8c5['attribute']=_0x201168[_0x3495f8(0x158)]);_0x201168['behavior']&&(_0x5ac8c5[_0x3495f8(0x117)]=_0x201168[_0x3495f8(0x117)]);if(_0x201168[_0x3495f8(0xc4)])_0x5ac8c5['interval']=_0x201168[_0x3495f8(0xc4)];let _0x24721f;try{_0x24721f=await _0x47091a['segment'][_0x3495f8(0x160)](_0x2ac566,_0x5ac8c5),_0x52c0be[_0x3495f8(0x169)]();}catch(_0x274ead){_0x52c0be[_0x3495f8(0x169)]();throw _0x274ead;}const _0x27b4fc=_0x201168['interval']||_0x3495f8(0xc7);return this[_0x3495f8(0x18c)](_0x24721f,_0x5ac8c5,_0xae7096,_0x27b4fc),_0x24721f[_0x3495f8(0x120)]?0x0:0x1;}[a29_0x1390a3(0x18c)](_0x5fb7fb,_0x1a4b33,_0x4a8b9b,_0x2e4aae){const _0x26af79=a29_0x1390a3;console[_0x26af79(0x8d)]('\x0a'+a29_0x49befd[_0x26af79(0x97)]('Validate:')+'\x20'+_0x5fb7fb[_0x26af79(0x100)]),console[_0x26af79(0x8d)]('═'[_0x26af79(0x178)](0x3c)),this['displayMasterInfo'](_0x5fb7fb);if(typeof _0x1a4b33[_0x26af79(0x158)]===_0x26af79(0x199)){this[_0x26af79(0x156)](_0x5fb7fb),this[_0x26af79(0x15b)](_0x5fb7fb),this[_0x26af79(0x131)](_0x4a8b9b,_0x2e4aae,'attribute',_0x1a4b33[_0x26af79(0x158)]);return;}if(_0x1a4b33[_0x26af79(0x158)]===!![]){this[_0x26af79(0x156)](_0x5fb7fb),this[_0x26af79(0x15b)](_0x5fb7fb),this[_0x26af79(0x131)](_0x4a8b9b,_0x2e4aae,_0x26af79(0x190));return;}if(typeof _0x1a4b33[_0x26af79(0x117)]===_0x26af79(0x199)){this[_0x26af79(0xd0)](_0x5fb7fb,_0x2e4aae),this[_0x26af79(0x15b)](_0x5fb7fb),this[_0x26af79(0x131)](_0x4a8b9b,_0x2e4aae,'behavior',_0x1a4b33[_0x26af79(0x117)]);return;}if(_0x1a4b33['behavior']===!![]){this[_0x26af79(0xd0)](_0x5fb7fb,_0x2e4aae),this[_0x26af79(0x15b)](_0x5fb7fb),this[_0x26af79(0x131)](_0x4a8b9b,_0x2e4aae,_0x26af79(0x93));return;}this[_0x26af79(0x156)](_0x5fb7fb),this[_0x26af79(0xd0)](_0x5fb7fb,_0x2e4aae),this[_0x26af79(0x15b)](_0x5fb7fb),this[_0x26af79(0x131)](_0x4a8b9b,_0x2e4aae,'all');}['displayPreviewHints'](_0x471f7b,_0x32f5d3,_0x38781d,_0xf45b0a){const _0x16da31=a29_0x1390a3;console[_0x16da31(0x8d)]('\x0a'+a29_0x49befd[_0x16da31(0xff)](_0x16da31(0x18d)));const _0x5319e8=_0x32f5d3!==_0x16da31(0xc7)?_0x16da31(0x187)+_0x32f5d3:'';if(_0x38781d===_0x16da31(0x158)&&_0xf45b0a)console[_0x16da31(0x8d)]('\x20\x20'+a29_0x49befd[_0x16da31(0xff)](_0x16da31(0xed)+_0x471f7b+_0x16da31(0x16a)+_0xf45b0a+'\x22'+_0x5319e8));else{if(_0x38781d==='behavior'&&_0xf45b0a)console[_0x16da31(0x8d)]('\x20\x20'+a29_0x49befd[_0x16da31(0xff)]('tdx\x20segment\x20parent\x20preview\x20'+_0x471f7b+'\x20--behavior\x20\x22'+_0xf45b0a+'\x22'+_0x5319e8));else(_0x38781d===_0x16da31(0x190)||_0x38781d==='all')&&console[_0x16da31(0x8d)]('\x20\x20'+a29_0x49befd[_0x16da31(0xff)]('tdx\x20segment\x20parent\x20preview\x20'+_0x471f7b+_0x16da31(0x14f)+_0x5319e8));}(_0x38781d===_0x16da31(0x93)||_0x38781d===_0x16da31(0xc2))&&console[_0x16da31(0x8d)]('\x20\x20'+a29_0x49befd[_0x16da31(0xff)](_0x16da31(0xed)+_0x471f7b+_0x16da31(0x8a)+_0x5319e8)),_0x38781d==='all'&&console[_0x16da31(0x8d)]('\x20\x20'+a29_0x49befd[_0x16da31(0xff)](_0x16da31(0xed)+_0x471f7b+_0x16da31(0xa8)+_0x5319e8));}['displayMasterInfo'](_0x4a0636){const _0x560924=a29_0x1390a3,{master:_0x162ef7}=_0x4a0636,_0xfc394a=_0x162ef7[_0x560924(0x1a6)]?a29_0x49befd[_0x560924(0x16c)]('✔'):a29_0x49befd['red']('✘');console[_0x560924(0x8d)]('\x0a'+a29_0x49befd[_0x560924(0xff)]('Master\x20Table')),console['error'](_0xfc394a+'\x20'+a29_0x49befd[_0x560924(0x97)](_0x162ef7['database']+'.'+_0x162ef7[_0x560924(0xaa)])),_0x162ef7[_0x560924(0x1a6)]?_0x162ef7[_0x560924(0xc3)]!==undefined&&console[_0x560924(0x8d)]('\x20\x20'+a29_0x49befd[_0x560924(0xff)]('Rows:')+'\x20'+a29_0x49befd[_0x560924(0x13d)](formatRows(_0x162ef7['rowCount']))):console[_0x560924(0x8d)]('\x20\x20'+a29_0x49befd[_0x560924(0x14d)]('Error:')+'\x20'+_0x162ef7[_0x560924(0xab)]);}['displayAttributesStats'](_0x2c2cdf){const _0x12fce1=a29_0x1390a3;if(_0x2c2cdf['attributes']['length']===0x0)return;console[_0x12fce1(0x8d)]('\x0a'+a29_0x49befd[_0x12fce1(0xff)](_0x12fce1(0x18a)));for(const _0x4f4a0d of _0x2c2cdf['attributes']){const _0xe99f10=_0x4f4a0d[_0x12fce1(0x1a6)]?a29_0x49befd[_0x12fce1(0x16c)]('✔'):a29_0x49befd[_0x12fce1(0x14d)]('✘');let _0x3d263b='';if(_0x4f4a0d[_0x12fce1(0x1a6)]&&_0x4f4a0d[_0x12fce1(0x183)]!==undefined&&_0x4f4a0d[_0x12fce1(0xe4)]!==undefined){const _0x22e0c5=_0x4f4a0d['coveragePercent']['toFixed'](0x1),_0x37f953=_0x4f4a0d['coveragePercent']>=0x50?a29_0x49befd[_0x12fce1(0x16c)]:_0x4f4a0d['coveragePercent']>=0x32?a29_0x49befd[_0x12fce1(0x193)]:a29_0x49befd[_0x12fce1(0x14d)];_0x3d263b='\x20'+a29_0x49befd['dim'](_0x12fce1(0x133))+'\x20'+_0x37f953(_0x22e0c5+'%')+'\x20('+formatRows(_0x4f4a0d[_0x12fce1(0x183)])+'\x20rows)';}console[_0x12fce1(0x8d)](_0xe99f10+'\x20'+a29_0x49befd['bold'](_0x4f4a0d[_0x12fce1(0x100)])+_0x3d263b),console['error']('\x20\x20'+a29_0x49befd[_0x12fce1(0xff)](_0x12fce1(0xbb))+'\x20'+a29_0x49befd[_0x12fce1(0x97)](_0x4f4a0d[_0x12fce1(0x180)]+'.'+_0x4f4a0d[_0x12fce1(0xaa)]));const _0x5a2e97=_0x4f4a0d[_0x12fce1(0xf7)]===_0x4f4a0d['foreignKey']?a29_0x49befd[_0x12fce1(0xff)](_0x12fce1(0x112))+'\x20'+_0x4f4a0d[_0x12fce1(0xf7)]:a29_0x49befd[_0x12fce1(0xff)](_0x12fce1(0x1a7))+'\x20'+_0x4f4a0d[_0x12fce1(0xf7)]+_0x12fce1(0xda)+_0x4f4a0d[_0x12fce1(0x167)];console[_0x12fce1(0x8d)]('\x20\x20'+_0x5a2e97),console[_0x12fce1(0x8d)]('\x20\x20'+a29_0x49befd['dim']('Columns:')),this[_0x12fce1(0xcf)](_0x4f4a0d['columns']),!_0x4f4a0d[_0x12fce1(0x1a6)]&&console[_0x12fce1(0x8d)]('\x20\x20'+a29_0x49befd['red'](_0x12fce1(0x9c))+'\x20'+_0x4f4a0d['schemaError']);}}[a29_0x1390a3(0xd0)](_0x42d764,_0x47ca45){const _0x3ed612=a29_0x1390a3;if(_0x42d764[_0x3ed612(0x93)]['length']===0x0)return;console[_0x3ed612(0x8d)]('\x0a'+a29_0x49befd['dim'](_0x3ed612(0x1a9))+'\x20'+a29_0x49befd[_0x3ed612(0xff)]('('+_0x47ca45+')'));for(const _0x37e6b8 of _0x42d764[_0x3ed612(0x93)]){const _0x8f9d9=_0x37e6b8[_0x3ed612(0x1a6)]?a29_0x49befd[_0x3ed612(0x16c)]('✔'):a29_0x49befd[_0x3ed612(0x14d)]('✘');let _0x413190='';if(_0x37e6b8[_0x3ed612(0x1a6)]&&_0x37e6b8[_0x3ed612(0xdd)]!==undefined&&_0x37e6b8[_0x3ed612(0xe1)]!==undefined){const _0x5094e8=_0x37e6b8['customerPercent']?.[_0x3ed612(0x1a3)](0x1)||'?',_0x2d5eff=(_0x37e6b8['customerPercent']??0x0)>=0x32?a29_0x49befd[_0x3ed612(0x16c)]:(_0x37e6b8[_0x3ed612(0x159)]??0x0)>=0x14?a29_0x49befd[_0x3ed612(0x193)]:a29_0x49befd[_0x3ed612(0x14d)];_0x413190='\x20'+a29_0x49befd['dim']('Customers:')+'\x20'+_0x2d5eff(formatRows(_0x37e6b8[_0x3ed612(0xdd)]))+'\x20('+_0x5094e8+_0x3ed612(0x11d)+a29_0x49befd[_0x3ed612(0xff)](_0x3ed612(0xee))+'\x20'+a29_0x49befd[_0x3ed612(0x13d)](formatRows(_0x37e6b8['totalEvents']));}console[_0x3ed612(0x8d)](_0x8f9d9+'\x20'+a29_0x49befd[_0x3ed612(0x97)](_0x37e6b8['name'])+_0x413190),console[_0x3ed612(0x8d)]('\x20\x20'+a29_0x49befd['dim'](_0x3ed612(0xbb))+'\x20'+a29_0x49befd['bold'](_0x37e6b8[_0x3ed612(0x180)]+'.'+_0x37e6b8[_0x3ed612(0xaa)]));const _0x396c3e=_0x37e6b8[_0x3ed612(0xf7)]===_0x37e6b8[_0x3ed612(0x167)]?a29_0x49befd['dim']('Join\x20on:')+'\x20'+_0x37e6b8[_0x3ed612(0xf7)]:a29_0x49befd[_0x3ed612(0xff)](_0x3ed612(0x1a7))+'\x20'+_0x37e6b8[_0x3ed612(0xf7)]+_0x3ed612(0xda)+_0x37e6b8[_0x3ed612(0x167)];console['error']('\x20\x20'+_0x396c3e),console[_0x3ed612(0x8d)]('\x20\x20'+a29_0x49befd[_0x3ed612(0xff)](_0x3ed612(0xd8))),this[_0x3ed612(0xcf)](_0x37e6b8['columns']),!_0x37e6b8[_0x3ed612(0x1a6)]&&console[_0x3ed612(0x8d)]('\x20\x20'+a29_0x49befd[_0x3ed612(0x14d)](_0x3ed612(0x9c))+'\x20'+_0x37e6b8['schemaError']);}}['displayColumns'](_0x4abf36){const _0x46a082=a29_0x1390a3;for(const _0x4e3841 of _0x4abf36){_0x4e3841[_0x46a082(0x15e)]===_0x4e3841[_0x46a082(0xa2)]||_0x4e3841[_0x46a082(0xa2)]==='*'?console[_0x46a082(0x8d)](_0x46a082(0x153)+_0x4e3841[_0x46a082(0x15e)]):console[_0x46a082(0x8d)](_0x46a082(0x153)+_0x4e3841[_0x46a082(0x15e)]+'\x20'+a29_0x49befd[_0x46a082(0xff)]('('+_0x4e3841[_0x46a082(0xa2)]+')'));}}[a29_0x1390a3(0x15b)](_0x4d190e){const _0x47b51c=a29_0x1390a3;console[_0x47b51c(0x8d)]('─'['repeat'](0x3c));if(_0x4d190e[_0x47b51c(0xb2)][_0x47b51c(0x197)]>0x0){console[_0x47b51c(0x8d)]('\x0a'+a29_0x49befd[_0x47b51c(0x14d)](_0x47b51c(0x10a)));for(const _0x496089 of _0x4d190e['errors']){console['error']('\x20\x20'+a29_0x49befd['red']('•')+'\x20'+_0x496089);}}_0x4d190e[_0x47b51c(0x120)]&&console[_0x47b51c(0x8d)]('\x0a'+a29_0x49befd[_0x47b51c(0x16c)]('✔')+_0x47b51c(0xd7));}}function a29_0x4ed2(_0xa7d31f,_0x44d599){_0xa7d31f=_0xa7d31f-0x85;const _0x8355bb=a29_0x8355();let _0x4ed202=_0x8355bb[_0xa7d31f];return _0x4ed202;}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0x111);[a29_0x1390a3(0x103)]=a29_0x1390a3(0x17b);async[a29_0x1390a3(0x19a)](_0x65624c){const _0xc6ddfa=a29_0x1390a3,{options:_0x2291b0,args:_0xc720be,tdx:_0x23f968}=_0x65624c,_0x410a83=_0x2291b0,_0x5be393=_0xc720be[0x0]||_0x2291b0[_0xc6ddfa(0xa1)];if(!_0x5be393)return showParentSegmentNotSetError(_0xc6ddfa(0x9a)+_0xc6ddfa(0x14b)+_0xc6ddfa(0x165)+_0xc6ddfa(0x11a)+_0xc6ddfa(0x148)+_0xc6ddfa(0x145)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0xc6ddfa(0x8b)),0x1;if(!_0x410a83[_0xc6ddfa(0x88)]&&!_0x410a83[_0xc6ddfa(0x158)]&&!_0x410a83[_0xc6ddfa(0x117)]&&!_0x410a83[_0xc6ddfa(0x98)])return console[_0xc6ddfa(0x8d)](a29_0x49befd[_0xc6ddfa(0x14d)](_0xc6ddfa(0x12c))),console[_0xc6ddfa(0x8d)](_0xc6ddfa(0x138)),console['error']('Options:'),console[_0xc6ddfa(0x8d)](_0xc6ddfa(0xb1)),console[_0xc6ddfa(0x8d)](_0xc6ddfa(0x89)),console['error']('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0xc6ddfa(0x8d)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x344e53=resolveYamlFile(_0x5be393);if(!existsSync(_0x344e53))return showFileNotFoundError(_0x344e53,_0x5be393),0x1;_0x410a83['verbose']&&(console['error'](_0xc6ddfa(0xd1)+_0x410a83[_0xc6ddfa(0xce)]),console[_0xc6ddfa(0x8d)](_0xc6ddfa(0x1a8)+_0x344e53));let _0x5b6993;try{_0x5b6993=readFileSync(_0x344e53,_0xc6ddfa(0x147));}catch(_0xd1a6a8){const _0x5dd93e=_0xd1a6a8 instanceof Error?_0xd1a6a8[_0xc6ddfa(0x108)]:String(_0xd1a6a8);return console[_0xc6ddfa(0x8d)](_0xc6ddfa(0x192)+_0x5dd93e),0x1;}let _0xa0f2bc;try{_0xa0f2bc=parseYamlString(_0x5b6993);}catch(_0xccc575){const _0xcc87b7=_0xccc575 instanceof Error?_0xccc575[_0xc6ddfa(0x108)]:String(_0xccc575);return console[_0xc6ddfa(0x8d)](a29_0x49befd[_0xc6ddfa(0x14d)](_0xc6ddfa(0x113)+_0xcc87b7)),0x1;}if(_0x410a83[_0xc6ddfa(0x158)]===!![]||_0x410a83[_0xc6ddfa(0x158)]===''){const _0x4e3885=_0xa0f2bc[_0xc6ddfa(0x190)]?.['map'](_0x56936f=>_0x56936f['name'])||[];if(_0x4e3885[_0xc6ddfa(0x197)]===0x0)console['error'](a29_0x49befd['red'](_0xc6ddfa(0xe8)));else{console[_0xc6ddfa(0x8d)](a29_0x49befd[_0xc6ddfa(0x14d)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0xc6ddfa(0x8d)](_0xc6ddfa(0x9d));for(const _0x5219e7 of _0x4e3885){console[_0xc6ddfa(0x8d)]('\x20\x20'+a29_0x49befd[_0xc6ddfa(0x13d)](_0x5219e7));}console[_0xc6ddfa(0x8d)](_0xc6ddfa(0xfb)+_0x5be393+_0xc6ddfa(0x16a)+_0x4e3885[0x0]+'\x22');}return 0x1;}if(_0x410a83[_0xc6ddfa(0x117)]===!![]||_0x410a83[_0xc6ddfa(0x117)]===''){const _0x762850=_0xa0f2bc['behaviors']?.['map'](_0x3171eb=>_0x3171eb[_0xc6ddfa(0x100)])||[];if(_0x762850[_0xc6ddfa(0x197)]===0x0)console[_0xc6ddfa(0x8d)](a29_0x49befd['red'](_0xc6ddfa(0x19d)));else{console['error'](a29_0x49befd['red']('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0xc6ddfa(0xf3));for(const _0x31843f of _0x762850){console[_0xc6ddfa(0x8d)]('\x20\x20'+a29_0x49befd[_0xc6ddfa(0x13d)](_0x31843f));}console[_0xc6ddfa(0x8d)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x5be393+'\x20--behavior\x20\x22'+_0x762850[0x0]+'\x22');}return 0x1;}const _0x1d215d=createCommandSpinner(a29_0x49befd[_0xc6ddfa(0xff)]('Fetching\x20sample\x20data...'),{'verbose':_0x410a83[_0xc6ddfa(0x181)]});_0x1d215d[_0xc6ddfa(0xe2)]();const _0x26f050={'onProgress':_0x545355=>{const _0x29a88d=_0xc6ddfa;_0x1d215d[_0x29a88d(0xfc)]=formatProgressMessage(_0x545355);}};if(_0x410a83[_0xc6ddfa(0x88)])_0x26f050[_0xc6ddfa(0x88)]=!![];if(_0x410a83['attribute']&&typeof _0x410a83[_0xc6ddfa(0x158)]===_0xc6ddfa(0x199))_0x26f050[_0xc6ddfa(0x158)]=_0x410a83[_0xc6ddfa(0x158)];if(_0x410a83[_0xc6ddfa(0x117)]&&typeof _0x410a83['behavior']==='string')_0x26f050[_0xc6ddfa(0x117)]=_0x410a83[_0xc6ddfa(0x117)];if(_0x410a83[_0xc6ddfa(0x98)])_0x26f050[_0xc6ddfa(0x98)]=!![];if(_0x410a83['interval'])_0x26f050[_0xc6ddfa(0xc4)]=_0x410a83[_0xc6ddfa(0xc4)];let _0x206917;try{_0x206917=await _0x23f968[_0xc6ddfa(0x94)][_0xc6ddfa(0x154)](_0x5b6993,_0x26f050),_0x1d215d[_0xc6ddfa(0x169)]();}catch(_0x5de9b0){_0x1d215d[_0xc6ddfa(0x169)]();throw _0x5de9b0;}return await this[_0xc6ddfa(0xa9)](_0x206917,{'master':_0x410a83[_0xc6ddfa(0x88)],'attribute':typeof _0x410a83[_0xc6ddfa(0x158)]===_0xc6ddfa(0x199)?_0x410a83[_0xc6ddfa(0x158)]:undefined,'behavior':typeof _0x410a83[_0xc6ddfa(0x117)]===_0xc6ddfa(0x199)?_0x410a83[_0xc6ddfa(0x117)]:undefined,'enriched':_0x410a83['enriched']}),_0x206917['allValid']?0x0:0x1;}async[a29_0x1390a3(0xa9)](_0x1f9ce0,_0x532c6a){const _0x35b160=a29_0x1390a3;console[_0x35b160(0x8d)]('\x0a'+a29_0x49befd[_0x35b160(0x97)](_0x35b160(0x151))+'\x20'+_0x1f9ce0[_0x35b160(0x100)]),console[_0x35b160(0x8d)]('═'[_0x35b160(0x178)](0x3c));if(_0x532c6a[_0x35b160(0x88)]&&_0x1f9ce0[_0x35b160(0xe5)]){const _0x29c2a8=a29_0x49befd[_0x35b160(0xff)](_0x35b160(0x116))+'\x20'+a29_0x49befd[_0x35b160(0x97)](_0x1f9ce0[_0x35b160(0x88)][_0x35b160(0x180)]+'.'+_0x1f9ce0[_0x35b160(0x88)][_0x35b160(0xaa)]);await this[_0x35b160(0xdf)](_0x29c2a8,_0x1f9ce0['sampleData']);}else{if(_0x532c6a[_0x35b160(0x158)]&&_0x1f9ce0[_0x35b160(0xe5)]){const _0x59bda3=a29_0x49befd[_0x35b160(0xff)](_0x35b160(0xa0))+'\x20'+a29_0x49befd[_0x35b160(0x97)](_0x532c6a['attribute']);await this['displaySampleData'](_0x59bda3,_0x1f9ce0['sampleData']);}else{if(_0x532c6a['behavior']&&_0x1f9ce0[_0x35b160(0xe5)]){const _0x4b7d03=a29_0x49befd[_0x35b160(0xff)](_0x35b160(0x95))+'\x20'+a29_0x49befd[_0x35b160(0x97)](_0x532c6a['behavior']);await this['displaySampleData'](_0x4b7d03,_0x1f9ce0[_0x35b160(0xe5)]);}else{if(_0x532c6a['enriched']&&_0x1f9ce0[_0x35b160(0xe5)]){const _0x10a309=a29_0x49befd['dim'](_0x35b160(0xdc))+'\x20'+a29_0x49befd[_0x35b160(0x97)](_0x35b160(0xea));await this['displaySampleData'](_0x10a309,_0x1f9ce0['sampleData']);}else!_0x1f9ce0[_0x35b160(0xe5)]&&console[_0x35b160(0x8d)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x1f9ce0[_0x35b160(0xb2)][_0x35b160(0x197)]>0x0){console[_0x35b160(0x8d)]('─'[_0x35b160(0x178)](0x3c)),console[_0x35b160(0x8d)]('\x0a'+a29_0x49befd[_0x35b160(0x14d)]('Errors:'));for(const _0x1db8cd of _0x1f9ce0['errors']){console[_0x35b160(0x8d)]('\x20\x20'+a29_0x49befd['red']('•')+'\x20'+_0x1db8cd);}}}async['displaySampleData'](_0x1150c0,_0x42a563){const _0x33fb96=a29_0x1390a3;if(_0x42a563[_0x33fb96(0x197)]===0x0){console['error']('\x0a'+_0x1150c0),console[_0x33fb96(0x8d)](_0x33fb96(0x91));return;}console['error']('\x0a'+_0x1150c0);const _0x125c18=Object[_0x33fb96(0x106)](_0x42a563[0x0])[_0x33fb96(0xbd)](_0x527d96=>({'name':_0x527d96,'type':typeof _0x42a563[0x0][_0x527d96]==='number'?_0x33fb96(0xf4):'varchar'})),_0x5e3e5e={'queryId':_0x33fb96(0x135),'columns':_0x125c18,'data':_0x42a563,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x42a563[_0x33fb96(0x197)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5aab6b=formatAsTable(_0x5e3e5e,_0x42a563[_0x33fb96(0x197)],!![]);await writeOutput(_0x5aab6b,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']='segment:parent:run';[a29_0x1390a3(0x103)]=a29_0x1390a3(0x15f);async[a29_0x1390a3(0x19a)](_0x12fc9f){const _0x1568ca=a29_0x1390a3,{options:_0x5118ab,args:_0x2e258b,tdx:_0xd4dbc6}=_0x12fc9f,_0xc1cde9=_0x5118ab,_0x4ecbbb=_0x2e258b[0x0]||_0x5118ab[_0x1568ca(0xa1)];if(!_0x4ecbbb)return showParentSegmentNotSetError(_0x1568ca(0x1a2)+_0x1568ca(0x8c)),0x1;const _0x1b7fa4=resolveYamlFile(_0x4ecbbb);if(existsSync(_0x1b7fa4)){_0xc1cde9['verbose']&&console[_0x1568ca(0x8d)](_0x1568ca(0x9f)+_0x1b7fa4);let _0x2ea0e2;try{_0x2ea0e2=readFileSync(_0x1b7fa4,_0x1568ca(0x147));}catch(_0x30c131){const _0x4b0dfb=_0x30c131 instanceof Error?_0x30c131['message']:String(_0x30c131);return console['error'](_0x1568ca(0x192)+_0x4b0dfb),0x1;}const _0x4de395=await withSpinner(_0x1568ca(0xc6),()=>_0xd4dbc6[_0x1568ca(0x94)][_0x1568ca(0x13e)](_0x2ea0e2),{'verbose':_0xc1cde9['verbose']}),_0x2d50d5=_0x4de395['data'],{isNew:_0x60ffbb,name:_0x7093c6,hasChanges:_0x16b194,diffFormatted:_0x17ecde}=_0x2d50d5;if(_0x16b194){_0x60ffbb?console['error'](_0x1568ca(0x17d)+_0x7093c6+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x7093c6+'\x27:');console['error']('─'[_0x1568ca(0x178)](0x3c)),console[_0x1568ca(0x8d)](_0x17ecde),console[_0x1568ca(0x8d)]('─'[_0x1568ca(0x178)](0x3c));const _0x46bf4d=_0x60ffbb?_0x1568ca(0x126)+_0x7093c6+_0x1568ca(0x128):_0x1568ca(0xae)+_0x7093c6+_0x1568ca(0x128);if(!_0xc1cde9[_0x1568ca(0x96)]){const _0x4d9de0=await confirmKey(_0x46bf4d);if(!_0x4d9de0)return console[_0x1568ca(0x8d)]('Aborted.'),0x1;}const _0x49f30f=_0x60ffbb?_0x1568ca(0x168):_0x1568ca(0x13a);await withSpinner(_0x49f30f+_0x1568ca(0x19f)+_0x7093c6+_0x1568ca(0x109),()=>_0x2d50d5[_0x1568ca(0xfe)](),{'verbose':_0xc1cde9[_0x1568ca(0x181)]});const _0x22e1c6=_0x60ffbb?_0x1568ca(0xac):_0x1568ca(0x17a);console[_0x1568ca(0x8d)]('✔\x20'+_0x22e1c6+_0x1568ca(0x19f)+_0x7093c6+'\x27');}else console[_0x1568ca(0x8d)](_0x1568ca(0x162)+_0x7093c6+_0x1568ca(0x157));}const _0x126a5c=await withSpinner(_0x1568ca(0xaf)+_0x4ecbbb+_0x1568ca(0x109),()=>_0xd4dbc6[_0x1568ca(0x94)][_0x1568ca(0xf8)](_0x4ecbbb),{'verbose':_0xc1cde9[_0x1568ca(0x181)]}),_0x4aea92=_0x126a5c[_0x1568ca(0x1a4)],_0x5bb4de=getConsoleUrl(_0xc1cde9[_0x1568ca(0xce)],'/app/workflows/'+_0x4aea92[_0x1568ca(0x163)]+_0x1568ca(0x114)+_0x4aea92[_0x1568ca(0x14c)]+_0x1568ca(0x141)+_0x4aea92[_0x1568ca(0xd5)]);return console[_0x1568ca(0x8d)](_0x1568ca(0x1a1)),console[_0x1568ca(0x8d)]('\x20\x20'+a29_0x49befd[_0x1568ca(0xff)](_0x1568ca(0xca))+'\x20'+_0x4aea92[_0x1568ca(0xcc)]),console[_0x1568ca(0x8d)]('\x20\x20'+a29_0x49befd[_0x1568ca(0xff)](_0x1568ca(0x14e))+'\x20'+_0x4aea92[_0x1568ca(0xcb)]),console['error']('\x20\x20'+a29_0x49befd[_0x1568ca(0xff)](_0x1568ca(0x125))+'\x20'+_0x4aea92['workflowSessionId']),console['error']('\x20\x20'+a29_0x49befd[_0x1568ca(0xff)]('Attempt:')+'\x20'+_0x4aea92[_0x1568ca(0xd5)]),console[_0x1568ca(0x8d)]('\x20\x20'+_0x5bb4de),console[_0x1568ca(0x8d)]('\x0a'+a29_0x49befd[_0x1568ca(0xff)](_0x1568ca(0x12d))+_0x1568ca(0x175)+_0x4aea92[_0x1568ca(0xd5)]+_0x1568ca(0x176)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0x8f);[a29_0x1390a3(0x103)]='List\x20available\x20fields\x20for\x20segmentation';async[a29_0x1390a3(0x19a)](_0x22591d){const _0x3d9b6e=a29_0x1390a3,{options:_0x51a120,args:_0x241f72,tdx:_0x25bcaa}=_0x22591d,_0x3fcff3=_0x241f72[0x0]||_0x51a120[_0x3d9b6e(0xa1)];if(!_0x3fcff3)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x3d9b6e(0x8e)),0x1;_0x51a120[_0x3d9b6e(0x181)]&&(console[_0x3d9b6e(0x8d)](_0x3d9b6e(0xd1)+_0x51a120[_0x3d9b6e(0xce)]),console[_0x3d9b6e(0x8d)](_0x3d9b6e(0x188)+_0x3fcff3));const _0x518df2=await withSpinner(_0x3d9b6e(0x13f)+_0x3fcff3+_0x3d9b6e(0x109),()=>_0x25bcaa[_0x3d9b6e(0x94)][_0x3d9b6e(0xe7)](_0x3fcff3),{'verbose':_0x51a120['verbose']}),_0x4b5f24=_0x518df2[_0x3d9b6e(0x1a4)];console[_0x3d9b6e(0x8d)](_0x3d9b6e(0x1a5)+_0x4b5f24['length']+_0x3d9b6e(0xc9)+(_0x4b5f24['length']!==0x1?'s':''));if(_0x51a120[_0x3d9b6e(0xf6)]||_0x51a120[_0x3d9b6e(0x9b)])return await handleSDKOutput(_0x4b5f24,_0x51a120),0x0;return displayFieldsHumanReadable(_0x4b5f24,_0x3fcff3),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x1390a3(0x100)]='segment:parent:view';[a29_0x1390a3(0x103)]=a29_0x1390a3(0x19c);async['execute'](_0x4262ec){const _0x2aedb9=a29_0x1390a3,{options:_0x4b3a55,args:_0x437ed5,tdx:_0x8ade54}=_0x4262ec,_0x4c258=_0x4b3a55,_0x453772=_0x437ed5[0x0]||_0x4b3a55['parentSegment'];if(!_0x453772)return showParentSegmentNotSetError(_0x2aedb9(0x12e)+_0x2aedb9(0x14a)+'Options:\x0a'+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x4b3a55[_0x2aedb9(0x181)]&&(console[_0x2aedb9(0x8d)](_0x2aedb9(0xd1)+_0x4b3a55['site']),console[_0x2aedb9(0x8d)](_0x2aedb9(0x188)+_0x453772));const _0x331b56=await withSpinner(_0x2aedb9(0x195)+_0x453772+_0x2aedb9(0x109),()=>_0x8ade54['segment']['getParentFull'](_0x453772),{'verbose':_0x4b3a55['verbose']}),_0xe6c802=_0x331b56[_0x2aedb9(0x1a4)];if(_0x4c258[_0x2aedb9(0x10b)]){const _0x7d175d=getConsoleNextUrl(_0x4c258['site'],_0x2aedb9(0x174)+_0xe6c802['id']);return console[_0x2aedb9(0x8d)](a29_0x49befd[_0x2aedb9(0x16c)]('✔')+_0x2aedb9(0xf1)+a29_0x49befd[_0x2aedb9(0x13d)](_0x7d175d)),openBrowser(_0x7d175d),0x0;}return await handleSingleObjectOutput(_0xe6c802,_0x4b3a55),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0x1a0);[a29_0x1390a3(0x103)]=a29_0x1390a3(0x170);async[a29_0x1390a3(0x19a)](_0x110291){const _0x380a61=a29_0x1390a3,{options:_0x117446,args:_0x1b8d08,tdx:_0x11167f}=_0x110291,_0x36277b=_0x1b8d08[0x0]||_0x117446['parentSegment'];if(!_0x36277b)return showParentSegmentNotSetError(_0x380a61(0x10e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0x117446[_0x380a61(0x181)]&&(console[_0x380a61(0x8d)](_0x380a61(0xd1)+_0x117446[_0x380a61(0xce)]),console['error'](_0x380a61(0x188)+_0x36277b));const _0x367453=await withSpinner(_0x380a61(0x17e)+_0x36277b+_0x380a61(0x109),()=>_0x11167f['segment'][_0x380a61(0xbf)](_0x36277b),{'verbose':_0x117446[_0x380a61(0x181)]}),_0x1c410d=_0x367453['data'],_0x170ad7=await withSpinner(_0x380a61(0x102)+_0x36277b+_0x380a61(0x109),()=>_0x11167f['segment'][_0x380a61(0xb7)](_0x1c410d),{'verbose':_0x117446[_0x380a61(0x181)]}),_0x3bbe1d=await executeSchemaQuery(_0x170ad7['data'],_0x11167f,_0x117446);return await handleQueryOutput(_0x3bbe1d,_0x117446),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0x12b);[a29_0x1390a3(0x103)]=a29_0x1390a3(0xec);async[a29_0x1390a3(0x19a)](_0x560f13){const _0x63a78f=a29_0x1390a3,{options:_0x16849c,args:_0x2f5820,tdx:_0x276e19}=_0x560f13,_0x1f47be=_0x2f5820[0x0]||_0x16849c[_0x63a78f(0xa1)];if(!_0x1f47be)return showParentSegmentNotSetError(_0x63a78f(0xcd)+_0x63a78f(0x127)),0x1;_0x16849c[_0x63a78f(0x181)]&&(console[_0x63a78f(0x8d)](_0x63a78f(0xd1)+_0x16849c[_0x63a78f(0xce)]),console[_0x63a78f(0x8d)](_0x63a78f(0x188)+_0x1f47be));const _0x25a7b2=await withSpinner(_0x63a78f(0x17e)+_0x1f47be+_0x63a78f(0x109),()=>_0x276e19['segment']['resolveParentId'](_0x1f47be),{'verbose':_0x16849c['verbose']}),_0x3c139f=_0x25a7b2[_0x63a78f(0x1a4)],_0x243a33=await withSpinner(_0x63a78f(0x102)+_0x1f47be+_0x63a78f(0x109),()=>_0x276e19[_0x63a78f(0x94)][_0x63a78f(0xb7)](_0x3c139f),{'verbose':_0x16849c[_0x63a78f(0x181)]}),_0x4bb3cc=_0x243a33[_0x63a78f(0x1a4)];return _0x16849c[_0x63a78f(0xe9)]===_0x63a78f(0xf6)||_0x16849c[_0x63a78f(0xe9)]==='jsonl'?await handleSDKOutput([{'sql':_0x4bb3cc}],_0x16849c):console[_0x63a78f(0xde)](_0x4bb3cc),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x1390a3(0x100)]=a29_0x1390a3(0xba);[a29_0x1390a3(0x103)]=a29_0x1390a3(0x118);async[a29_0x1390a3(0x19a)](_0x1f6a20){const _0x34a0c1=a29_0x1390a3,{options:_0x30e078,args:_0x2fef23,tdx:_0x270326}=_0x1f6a20,_0x2e92f3=_0x2fef23[0x0]||_0x30e078[_0x34a0c1(0xa1)];if(!_0x2e92f3)return showParentSegmentNotSetError(_0x34a0c1(0x152)+_0x34a0c1(0xb5)),0x1;_0x30e078[_0x34a0c1(0x181)]&&(console[_0x34a0c1(0x8d)]('Site:\x20'+_0x30e078['site']),console[_0x34a0c1(0x8d)]('Parent\x20segment:\x20'+_0x2e92f3));const _0x1b63d8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2e92f3+_0x34a0c1(0x109),()=>_0x270326['segment'][_0x34a0c1(0xbf)](_0x2e92f3),{'verbose':_0x30e078[_0x34a0c1(0x181)]}),_0x1a2778=_0x1b63d8[_0x34a0c1(0x1a4)],_0x4009f0=await withSpinner(_0x34a0c1(0x102)+_0x2e92f3+_0x34a0c1(0x109),()=>_0x270326[_0x34a0c1(0x94)][_0x34a0c1(0xb7)](_0x1a2778),{'verbose':_0x30e078['verbose']});let _0x3b6178=_0x4009f0[_0x34a0c1(0x1a4)];const _0x25259e=resolveLimit(_0x30e078[_0x34a0c1(0x85)],DEFAULT_DISPLAY_LIMIT),_0x16b120=/\bLIMIT\s+\d+/i[_0x34a0c1(0x1ab)](_0x3b6178);!_0x16b120&&(_0x3b6178=_0x3b6178[_0x34a0c1(0xd2)]()[_0x34a0c1(0xe0)](/;+$/,''),_0x3b6178=_0x34a0c1(0x155)+_0x3b6178+_0x34a0c1(0xc5)+_0x25259e);_0x30e078[_0x34a0c1(0x181)]&&console['error']('SQL\x20query:\x0a'+_0x3b6178);const _0x4dc963=await withQuerySpinner(_0x34a0c1(0x99),async _0x2df11f=>{const _0x2661a2=_0x34a0c1,_0x467f00=await _0x270326[_0x2661a2(0xeb)][_0x2661a2(0x19a)](_0x3b6178,{'catalog':'td','schema':'information_schema','onJobId':_0xc67980=>{const _0x1a9b1f=_0x2661a2;_0x2df11f[_0x1a9b1f(0xa4)](_0xc67980);}});return _0x467f00;},{'verbose':_0x30e078['verbose']}),_0x4cafeb=_0x4dc963['data'],_0x37be67=_0x4cafeb[_0x34a0c1(0x107)]?_0x34a0c1(0x15c)+_0x4cafeb[_0x34a0c1(0x107)]+']':'';return console['error'](_0x34a0c1(0xd3)+_0x4cafeb['stats'][_0x34a0c1(0x132)][_0x34a0c1(0x142)]()+'\x20rows\x20'+(_0x34a0c1(0x149)+formatElapsed(_0x4cafeb['stats']['elapsedTimeMillis'])+_0x37be67)),await handleQueryOutput(_0x4cafeb,_0x30e078),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x1be352=a30_0x9b0e;function a30_0x422d(){const _0x4ab768=['execute','\x20\x20Global:\x20~/.config/tdx/tdx.json','profiles','99yMBzsg','name','1700750agLVSF','message','config','14276223kciDnl','710917eFOuKn','log','6207256IyJCLO','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','map','List\x20all\x20available\x20profiles','42044EoURmA','2FXiQcw','description','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','length','8638742xGEHFn','error','scope','6213378xUVlzh'];a30_0x422d=function(){return _0x4ab768;};return a30_0x422d();}(function(_0x568b4f,_0x39da4d){const _0x30c6e3=a30_0x9b0e,_0x56518e=_0x568b4f();while(!![]){try{const _0xad9ece=-parseInt(_0x30c6e3(0xd9))/0x1*(parseInt(_0x30c6e3(0xe0))/0x2)+parseInt(_0x30c6e3(0xd3))/0x3*(parseInt(_0x30c6e3(0xdf))/0x4)+-parseInt(_0x30c6e3(0xd5))/0x5+parseInt(_0x30c6e3(0xcf))/0x6+parseInt(_0x30c6e3(0xe4))/0x7+parseInt(_0x30c6e3(0xdb))/0x8+-parseInt(_0x30c6e3(0xd8))/0x9;if(_0xad9ece===_0x39da4d)break;else _0x56518e['push'](_0x56518e['shift']());}catch(_0x30d816){_0x56518e['push'](_0x56518e['shift']());}}}(a30_0x422d,0xb85b5));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a30_0x9b0e(_0x55bee8,_0x50f227){_0x55bee8=_0x55bee8-0xcf;const _0x422d9c=a30_0x422d();let _0x9b0e77=_0x422d9c[_0x55bee8];return _0x9b0e77;}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0x1be352(0xd4)]=a30_0x1be352(0xd2);[a30_0x1be352(0xe1)]=a30_0x1be352(0xde);async[a30_0x1be352(0xd0)](_0x51af89){const _0x157c54=a30_0x1be352,{options:_0x31a8b9}=_0x51af89;try{const _0x5d9724=listProfiles(),_0x48f7cf=getActiveProfile();if(_0x5d9724[_0x157c54(0xe3)]===0x0)return console['log'](_0x157c54(0xe2)),console[_0x157c54(0xda)](_0x157c54(0xdc)),console[_0x157c54(0xda)](_0x157c54(0xd1)),0x0;const _0x3b239f=_0x5d9724[_0x157c54(0xdd)](_0x132e60=>{const _0xb34f3f=_0x157c54,_0x3743d0=_0x132e60[_0xb34f3f(0xd4)]===_0x48f7cf,_0x3765cd=getProfileParams(_0x132e60[_0xb34f3f(0xd7)]);return{'name':_0x132e60[_0xb34f3f(0xd4)],'active':_0x3743d0,'scope':_0x132e60[_0xb34f3f(0xe6)],'description':_0x132e60[_0xb34f3f(0xd7)]['description']||'','params':_0x3765cd};});return await handleSDKOutput(_0x3b239f,_0x31a8b9),0x0;}catch(_0x382b53){return _0x382b53 instanceof Error&&console[_0x157c54(0xe5)]('Error:\x20'+_0x382b53[_0x157c54(0xd6)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x1a0715=a31_0x1512;(function(_0x27d346,_0x1bc36f){const _0x32008f=a31_0x1512,_0x19e700=_0x27d346();while(!![]){try{const _0xfff07c=-parseInt(_0x32008f(0x186))/0x1+-parseInt(_0x32008f(0x19a))/0x2*(-parseInt(_0x32008f(0x1a3))/0x3)+-parseInt(_0x32008f(0x1af))/0x4+-parseInt(_0x32008f(0x184))/0x5+parseInt(_0x32008f(0x189))/0x6+-parseInt(_0x32008f(0x1ae))/0x7*(parseInt(_0x32008f(0x182))/0x8)+-parseInt(_0x32008f(0x1a1))/0x9*(-parseInt(_0x32008f(0x191))/0xa);if(_0xfff07c===_0x1bc36f)break;else _0x19e700['push'](_0x19e700['shift']());}catch(_0x4e8281){_0x19e700['push'](_0x19e700['shift']());}}}(a31_0x1d80,0xbeaf0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0x1d80(){const _0x1e6db4=['jobId','message','50ZWzUAu','Executing\x20query\x20[','verbose','file','Statement\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','processedRows','execute','\x20splits','4dOEZly','in\x20','\x20-\x20','\x20rows\x20','setJobId','data','query','3187521FPMEkK','totalSplits','1719837OBaliO','options','length','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','Run\x20Trino\x20queries\x20(streaming)','error','validate','Schema:\x20','stats','Query\x20completed:\x20Processed\x20','7987kUxcTA','5599888UIkoVk','\x20[Job\x20ID:\x20','3336wlfPcT','\x0aAll\x20results\x20saved\x20to\x20','2472150EubnAc','setExtra','658685rmDVnD','...','Site:\x20','5355126ygczaJ','Executing\x20query...','args','description','output','Error:\x20'];a31_0x1d80=function(){return _0x1e6db4;};return a31_0x1d80();}function a31_0x1512(_0x2c3e9e,_0x5b3409){_0x2c3e9e=_0x2c3e9e-0x182;const _0x1d8084=a31_0x1d80();let _0x1512d9=_0x1d8084[_0x2c3e9e];return _0x1512d9;}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']=a31_0x1a0715(0x1a0);[a31_0x1a0715(0x18c)]=a31_0x1a0715(0x1a8);async['execute'](_0x46bdc0){const _0x1cd7bf=a31_0x1a0715,{options:_0xa3dad4,args:_0x231b54,tdx:_0x1757a3}=_0x46bdc0,_0x41c04d=_0x231b54[0x0],_0x57fa23=_0xa3dad4[_0x1cd7bf(0x194)];let _0x32f935;try{if(_0x57fa23)_0x32f935=readSqlStatementsFromFile(_0x57fa23);else{if(_0x41c04d==='-')_0x32f935=await readSqlStatementsFromStdin();else{if(_0x41c04d&&isSqlFilePath(_0x41c04d))_0x32f935=readSqlStatementsFromFile(_0x41c04d);else{if(_0x41c04d)_0x32f935=splitSqlStatements(_0x41c04d);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x528c4a){return console[_0x1cd7bf(0x1a9)](_0x1cd7bf(0x18e)+_0x528c4a[_0x1cd7bf(0x190)]),0x1;}const _0x24c0b6=_0xa3dad4['database']||'information_schema',_0x5a2b31=_0xa3dad4['catalog'];try{const _0x3a61e2=[],_0x50cc0d=!!_0xa3dad4[_0x1cd7bf(0x18d)];for(let _0x7851b3=0x0;_0x7851b3<_0x32f935['length'];_0x7851b3++){const _0xd5cec0=_0x32f935[_0x7851b3],_0x4db32a=_0x7851b3+0x1,_0x4addc3=_0x32f935['length'],_0x2eb117=_0x4addc3>0x1;_0xa3dad4[_0x1cd7bf(0x193)]&&(console[_0x1cd7bf(0x1a9)]('\x0a'+(_0x2eb117?_0x1cd7bf(0x195)+_0x4db32a+'/'+_0x4addc3+':':'')),console[_0x1cd7bf(0x1a9)](_0x1cd7bf(0x188)+_0xa3dad4['site']),console[_0x1cd7bf(0x1a9)]('Catalog:\x20'+(_0x5a2b31||'td')),console[_0x1cd7bf(0x1a9)](_0x1cd7bf(0x1ab)+_0x24c0b6),console[_0x1cd7bf(0x1a9)]('SQL:\x20'+_0xd5cec0));const _0x52818c=_0x2eb117?_0x1cd7bf(0x1a7)+_0x4db32a+'/'+_0x4addc3+_0x1cd7bf(0x187):_0x1cd7bf(0x18a);try{const _0xfd5ca4=await withQuerySpinner(_0x52818c,async _0x2d2bf0=>{const _0x470360=_0x1cd7bf,_0x43acd6=await _0x1757a3[_0x470360(0x1a0)][_0x470360(0x198)](_0xd5cec0,{'catalog':_0x5a2b31,'schema':_0x24c0b6,'onJobId':_0x1ccc2b=>{const _0x4426fd=_0x470360;_0x2d2bf0[_0x4426fd(0x19e)](_0x1ccc2b);},'onProgress':_0x3f6f8b=>{const _0x2c8a9d=_0x470360;_0x2d2bf0['setPhase'](_0x2c8a9d(0x192)+_0x3f6f8b['state']+']'),_0x2d2bf0[_0x2c8a9d(0x185)](formatRows(_0x3f6f8b['processedRows'])+_0x2c8a9d(0x19d)+_0x3f6f8b['completedSplits']+'/'+_0x3f6f8b[_0x2c8a9d(0x1a2)]+_0x2c8a9d(0x199));}});return _0x43acd6;},{'verbose':_0xa3dad4['verbose']}),_0x3e70c9=_0xfd5ca4[_0x1cd7bf(0x19f)],_0x4426da=_0x3e70c9[_0x1cd7bf(0x18f)]?_0x1cd7bf(0x1b0)+_0x3e70c9[_0x1cd7bf(0x18f)]+']':'',_0x175107=_0x2eb117?_0x1cd7bf(0x195)+_0x4db32a+'/'+_0x4addc3+_0x1cd7bf(0x19c):'';console['error']('✔\x20'+_0x175107+_0x1cd7bf(0x1ad)+formatRows(_0x3e70c9[_0x1cd7bf(0x1ac)][_0x1cd7bf(0x197)])+_0x1cd7bf(0x19d)+(_0x1cd7bf(0x19b)+formatElapsed(_0x3e70c9[_0x1cd7bf(0x1ac)]['elapsedTimeMillis'])+_0x4426da));if(_0x2eb117&&_0x50cc0d){const _0xd06cb6=resolveOutputOptions(_0xa3dad4),_0x15606f=await formatQueryOutput(_0x3e70c9,_0xd06cb6);_0x3a61e2['push'](_0x15606f);}else await handleQueryOutput(_0x3e70c9,_0xa3dad4);}catch(_0x111c9a){const _0x2903a0=_0x2eb117?'Statement\x20'+_0x4db32a+'/'+_0x4addc3+':\x0a':'',_0x4595e7=_0x111c9a instanceof SDKError?_0x111c9a['originalMessage']:_0x111c9a[_0x1cd7bf(0x190)];return console['error'](''+_0x2903a0+_0x4595e7),0x1;}}if(_0x32f935[_0x1cd7bf(0x1a5)]>0x1&&_0x50cc0d&&_0x3a61e2[_0x1cd7bf(0x1a5)]>0x0){const _0x411864=_0x3a61e2['join']('\x0a');writeFileSync(_0xa3dad4[_0x1cd7bf(0x18d)],_0x411864),console[_0x1cd7bf(0x1a9)](_0x1cd7bf(0x183)+_0xa3dad4[_0x1cd7bf(0x18d)]);}return 0x0;}catch(_0x1acf52){throw _0x1acf52;}}[a31_0x1a0715(0x1aa)](_0x5ac476){const _0x5f5a1a=a31_0x1a0715,_0x36dc51=_0x5ac476[_0x5f5a1a(0x18b)][0x0],_0x1109da=_0x5ac476[_0x5f5a1a(0x1a4)][_0x5f5a1a(0x194)];if(!_0x36dc51&&!_0x1109da)return _0x5f5a1a(0x1a6);if(_0x36dc51&&_0x1109da)return _0x5f5a1a(0x196);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0xc1877c=a32_0x1cbf;(function(_0x1d82a7,_0x1135d1){const _0xa2dec8=a32_0x1cbf,_0x3089ed=_0x1d82a7();while(!![]){try{const _0x409b81=-parseInt(_0xa2dec8(0x1da))/0x1*(-parseInt(_0xa2dec8(0x1f7))/0x2)+parseInt(_0xa2dec8(0x208))/0x3*(-parseInt(_0xa2dec8(0x1b1))/0x4)+parseInt(_0xa2dec8(0x1cc))/0x5+-parseInt(_0xa2dec8(0x232))/0x6+-parseInt(_0xa2dec8(0x1f6))/0x7*(-parseInt(_0xa2dec8(0x21f))/0x8)+parseInt(_0xa2dec8(0x1b3))/0x9+-parseInt(_0xa2dec8(0x22d))/0xa*(parseInt(_0xa2dec8(0x225))/0xb);if(_0x409b81===_0x1135d1)break;else _0x3089ed['push'](_0x3089ed['shift']());}catch(_0x5e2eac){_0x3089ed['push'](_0x3089ed['shift']());}}}(a32_0x53dc,0xf3c7a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a32_0x1cbf(_0x1ef2d7,_0x2260c7){_0x1ef2d7=_0x1ef2d7-0x1af;const _0x53dc37=a32_0x53dc();let _0x1cbf10=_0x53dc37[_0x1ef2d7];return _0x1cbf10;}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_0x95fa24 from'chalk';function resolveSegmentTarget(_0xffc000,_0x3ae390,_0x15298e){const _0x22c1c9=a32_0x1cbf;if(isYamlFilePath(_0xffc000))try{const _0x63f7e2=resolveYamlFilePath(_0xffc000);return _0x15298e&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0xffc000),console['error'](_0x22c1c9(0x1b0)+_0x63f7e2['parentSegment']),console[_0x22c1c9(0x23d)]('\x20\x20Segment\x20name:\x20'+_0x63f7e2[_0x22c1c9(0x1e0)]),console[_0x22c1c9(0x23d)]('\x20\x20Folder\x20path:\x20'+(_0x63f7e2['folderPath']||'(root)')),console[_0x22c1c9(0x23d)](_0x22c1c9(0x1e8)+_0x63f7e2['fullPath'])),_0x63f7e2['fullPath'];}catch(_0x4ff906){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x22c1c9(0x1d5)+_0x4ff906[_0x22c1c9(0x1e1)]);}if(!_0x3ae390)throw new SDKError(ErrorCode[_0x22c1c9(0x1d0)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x3ae390+'/'+_0xffc000;}export class SegmentDescribeCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x215);[a32_0xc1877c(0x1c5)]='Show\x20segment\x20or\x20folder\x20details';async[a32_0xc1877c(0x207)](_0x21f0e5){const _0x433937=a32_0xc1877c,{options:_0x40d9ba,args:_0x4390e7,tdx:_0x53a7a4}=_0x21f0e5,_0x3fdaab=_0x4390e7[0x0],_0x446102=!_0x3fdaab&&!!_0x40d9ba[_0x433937(0x20e)],_0x28075e=_0x3fdaab||_0x40d9ba[_0x433937(0x20e)];if(!_0x28075e)return console[_0x433937(0x23d)](_0x433937(0x1d4)),console[_0x433937(0x23d)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x433937(0x23d)](_0x433937(0x1b5)),console[_0x433937(0x23d)](_0x433937(0x200)),console['error'](_0x433937(0x210)),console[_0x433937(0x23d)](_0x433937(0x1d2)),console[_0x433937(0x23d)](_0x433937(0x1e7)),0x1;try{const _0x226069=_0x40d9ba['segmentPath'];let _0x5c4325=_0x28075e;!_0x446102&&_0x226069&&!_0x28075e[_0x433937(0x1c9)]('/')&&(_0x5c4325=_0x226069+'/'+_0x28075e,_0x40d9ba['verbose']&&console[_0x433937(0x23d)](_0x433937(0x236)+_0x5c4325));const _0x89d284=await withSpinner(_0x433937(0x229)+_0x5c4325+'\x27...',()=>_0x53a7a4[_0x433937(0x1c2)]['resolvePathToResource'](_0x5c4325),{'verbose':_0x40d9ba[_0x433937(0x1cb)]}),_0x1e9674=_0x89d284['data'];_0x40d9ba[_0x433937(0x1cb)]&&(console[_0x433937(0x23d)](_0x433937(0x1eb)+_0x1e9674[_0x433937(0x228)]),console[_0x433937(0x23d)]('Parent\x20ID:\x20'+_0x1e9674[_0x433937(0x20c)]),_0x1e9674[_0x433937(0x209)]&&console[_0x433937(0x23d)](_0x433937(0x22b)+_0x1e9674[_0x433937(0x209)]),_0x1e9674['segmentId']&&console[_0x433937(0x23d)]('Segment\x20ID:\x20'+_0x1e9674[_0x433937(0x1fb)]));if(_0x1e9674[_0x433937(0x228)]==='parent'){const _0x48c5cc=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x53a7a4[_0x433937(0x1c2)][_0x433937(0x234)](_0x1e9674[_0x433937(0x20c)]),{'verbose':_0x40d9ba[_0x433937(0x1cb)]});await handleSingleObjectOutput(_0x48c5cc['data'],_0x40d9ba);}else{if(_0x1e9674[_0x433937(0x228)]===_0x433937(0x1d6)){if(!_0x1e9674[_0x433937(0x209)])throw new SDKError(ErrorCode[_0x433937(0x204)],_0x433937(0x1d3));const _0x50bc25=await withSpinner(_0x433937(0x1b6),()=>_0x53a7a4['segment']['getFolder'](_0x1e9674[_0x433937(0x209)]),{'verbose':_0x40d9ba[_0x433937(0x1cb)]});await handleSingleObjectOutput(_0x50bc25[_0x433937(0x23b)],_0x40d9ba);}else{if(_0x1e9674['type']==='segment'){if(!_0x1e9674[_0x433937(0x1fb)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1af701=await withSpinner(_0x433937(0x1cf),()=>_0x53a7a4[_0x433937(0x1c2)][_0x433937(0x20b)](_0x1e9674[_0x433937(0x20c)],_0x1e9674[_0x433937(0x1fb)]),{'verbose':_0x40d9ba[_0x433937(0x1cb)]});await handleSingleObjectOutput(_0x1af701[_0x433937(0x23b)],_0x40d9ba);}}}return 0x0;}catch(_0x3f590c){if(_0x3f590c instanceof SDKError)return console[_0x433937(0x23d)](_0x433937(0x1ec)+_0x3f590c[_0x433937(0x1e1)]),_0x3f590c[_0x433937(0x1bf)]&&console[_0x433937(0x23d)]('\x20\x20Cause:\x20'+_0x3f590c[_0x433937(0x1bf)]),0x1;throw _0x3f590c;}}}function a32_0x53dc(){const _0x2d5bce=['listFolders','✖\x20Query\x20failed\x20[','Use:\x20tdx\x20ps\x20sql','Resolved\x20parent\x20folder\x20ID:\x20','segment:describe','length','name','segment:view','json','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Show\x20segment\x20folder\x20details','getFolder','Get\x20SQL\x20query\x20for\x20child\x20segment','segment:folder:list','1012376qDkrNs','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Fetching\x20SQL\x20for\x20segment...','✔\x20Query\x20completed:\x20Processed\x20','Target\x20path:\x20','toLocaleString','654115sAmzob','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','type','Resolving\x20path\x20\x27','Create\x20segment\x20folder\x20for\x20organization','Folder\x20ID:\x20','jsonl','90oXBYSj','Parent\x20name:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Resolving\x20parent\x20folder\x20\x27','8544552ieqJGU','processedRows','getParent','Parent\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','/e/','\x20folder','Parent\x20segment:\x20','✔\x20Created\x20folder\x20\x27','data','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','error','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','url','Creating\x20folder\x20\x27','resolveParentId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20Parent\x20segment:\x20','25948JiQluz','getSegmentSQL','11528298wOfXwV','Error:\x20Parent\x20segment\x20name\x20is\x20required','Examples:','Fetching\x20folder\x20details...','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','in\x20','site','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Resolved\x20folder\x20ID:\x20','parentFolder','Error:\x20Folder\x20reference\x20is\x20required','cause','createFolder','\x20\x20Cause:\x20','segment','SEGMENT_NOT_FOUND','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','description','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Segment\x20ID:\x20','/app/ps/','includes','Resolving\x20\x27','verbose','7947470bCjQaK','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Show\x20child\x20segment\x20schema\x20(column\x20types)','Fetching\x20segment\x20details...','INVALID_ARGUMENT','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Path\x20or\x20name\x20is\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','folder','\x20[Job\x20ID:\x20','code','segment:folder:create','1TYDaOG','log','\x20Opening\x20','Resolving\x20folder\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','segmentName','message','\x20rows\x20','Options:','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','web','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20Full\x20path:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','cyan','Resolved\x20type:\x20','Error:\x20','trim','parent','Resolving\x20parent\x20segment\x20\x27','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','jobId','7jmujzW','3593314XWnokp','replace','Folder\x20name:\x20','\x27...','segmentId','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','stats','format','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Site:\x20','SELECT\x20*\x20FROM\x20(\x0a','resolvePathToResource','SEGMENT_FOLDER_NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:sql','execute','849AZCjrC','folderId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','getSegment','parentId','Listing\x20folders\x20for\x20parent\x20\x27','parentSegment','resolveFolderId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'];a32_0x53dc=function(){return _0x2d5bce;};return a32_0x53dc();}export class SegmentShowCommand extends BaseCommand{[a32_0xc1877c(0x217)]='segment:show';[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x1f0);async[a32_0xc1877c(0x207)](_0x7278b5){const _0x30141f=a32_0xc1877c,{options:_0x21d7a3,args:_0x5ca12d,tdx:_0x5ad73e}=_0x7278b5,_0x21fd4c=_0x5ca12d[0x0];if(!_0x21fd4c)return console[_0x30141f(0x23d)](_0x30141f(0x21a)),console[_0x30141f(0x23d)](_0x30141f(0x1e9)),console[_0x30141f(0x23d)](_0x30141f(0x205)),console[_0x30141f(0x23d)](_0x30141f(0x1b5)),console[_0x30141f(0x23d)](_0x30141f(0x1fc)),console['error'](_0x30141f(0x1c6)),0x1;try{const _0x57ecb4=_0x21d7a3[_0x30141f(0x20e)],_0x35870f=resolveSegmentTarget(_0x21fd4c,_0x57ecb4,_0x21d7a3[_0x30141f(0x1cb)]);_0x21d7a3[_0x30141f(0x1cb)]&&console[_0x30141f(0x23d)]('Target\x20path:\x20'+_0x35870f);const _0x482a06=await withSpinner('Resolving\x20\x27'+_0x21fd4c+_0x30141f(0x1fa),()=>_0x5ad73e[_0x30141f(0x1c2)][_0x30141f(0x203)](_0x35870f),{'verbose':_0x21d7a3[_0x30141f(0x1cb)]}),_0x2521b3=_0x482a06[_0x30141f(0x23b)];_0x21d7a3[_0x30141f(0x1cb)]&&(console[_0x30141f(0x23d)](_0x30141f(0x1eb)+_0x2521b3[_0x30141f(0x228)]),console[_0x30141f(0x23d)]('Parent\x20ID:\x20'+_0x2521b3[_0x30141f(0x20c)]));if(_0x2521b3[_0x30141f(0x228)]===_0x30141f(0x1d6))return console['error'](_0x30141f(0x23c)),console[_0x30141f(0x23d)](_0x30141f(0x1d1)),0x1;if(_0x2521b3['type']===_0x30141f(0x1ee))return console[_0x30141f(0x23d)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x30141f(0x23d)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x2521b3[_0x30141f(0x1fb)])throw new SDKError(ErrorCode[_0x30141f(0x1c3)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x391019=await withSpinner(_0x30141f(0x221),()=>_0x5ad73e['segment']['getSegmentSQL'](_0x2521b3[_0x30141f(0x20c)],_0x2521b3[_0x30141f(0x1fb)]),{'verbose':_0x21d7a3['verbose']});let _0x11e953=_0x391019['data'];const _0x49262c=resolveLimit(_0x21d7a3['limit'],DEFAULT_DISPLAY_LIMIT),_0xe09b8b=/\bLIMIT\s+\d+/i['test'](_0x11e953);!_0xe09b8b&&(_0x11e953=_0x11e953[_0x30141f(0x1ed)]()[_0x30141f(0x1f8)](/;+$/,''),_0x11e953=_0x30141f(0x202)+_0x11e953+_0x30141f(0x1f2)+_0x49262c);_0x21d7a3['verbose']&&console[_0x30141f(0x23d)]('SQL\x20query:\x0a'+_0x11e953);const _0x1a70a8=await withQuerySpinner('Executing\x20segment\x20query...',async _0x177b88=>{const _0x12e0ab=_0x30141f,_0x527e8d=await _0x5ad73e['query'][_0x12e0ab(0x207)](_0x11e953,{'catalog':'td','schema':'information_schema','onJobId':_0x2de244=>{_0x177b88['setJobId'](_0x2de244);}});return _0x527e8d;},{'verbose':_0x21d7a3[_0x30141f(0x1cb)]}),_0x442638=_0x1a70a8['data'],_0x51950f=_0x442638[_0x30141f(0x1f5)]?_0x30141f(0x1d7)+_0x442638['jobId']+']':'';return console[_0x30141f(0x23d)](_0x30141f(0x222)+_0x442638[_0x30141f(0x1fe)][_0x30141f(0x233)][_0x30141f(0x224)]()+_0x30141f(0x1e2)+(_0x30141f(0x1b8)+formatElapsed(_0x442638[_0x30141f(0x1fe)]['elapsedTimeMillis'])+_0x51950f)),await handleQueryOutput(_0x442638,_0x21d7a3),0x0;}catch(_0x497ada){if(_0x497ada instanceof SDKError)return console[_0x30141f(0x23d)](_0x30141f(0x212)+_0x497ada[_0x30141f(0x1d8)]+']'),console[_0x30141f(0x23d)]('\x0a'+_0x497ada[_0x30141f(0x1e1)]),0x1;throw _0x497ada;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x21e);[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x1af);async['execute'](_0x3ef930){const _0x2e3f94=a32_0xc1877c,{options:_0x2c4942,args:_0x932415,tdx:_0x47978a}=_0x3ef930;if(_0x932415[_0x2e3f94(0x216)]===0x0)return console[_0x2e3f94(0x23d)](_0x2e3f94(0x1b4)),console['error'](_0x2e3f94(0x1bb)),0x1;const _0x14602b=_0x932415[0x0];try{_0x2c4942[_0x2e3f94(0x1cb)]&&(console[_0x2e3f94(0x23d)]('Site:\x20'+_0x2c4942['site']),console[_0x2e3f94(0x23d)]('Parent\x20name:\x20'+_0x14602b));const _0x3ff233=await withSpinner(_0x2e3f94(0x1ef)+_0x14602b+_0x2e3f94(0x1fa),()=>_0x47978a[_0x2e3f94(0x1c2)][_0x2e3f94(0x241)](_0x14602b),{'verbose':_0x2c4942[_0x2e3f94(0x1cb)]}),_0x489c57=_0x3ff233[_0x2e3f94(0x23b)];_0x2c4942['verbose']&&console[_0x2e3f94(0x23d)]('Resolved\x20parent\x20ID:\x20'+_0x489c57);const _0x13db6f=await withSpinner(_0x2e3f94(0x20d)+_0x14602b+'\x27...',()=>_0x47978a[_0x2e3f94(0x1c2)][_0x2e3f94(0x211)](_0x489c57),{'verbose':_0x2c4942[_0x2e3f94(0x1cb)]}),_0x2a8a68=_0x13db6f[_0x2e3f94(0x23b)];return console['error']('✔\x20Found\x20'+_0x2a8a68[_0x2e3f94(0x216)]+_0x2e3f94(0x238)+(_0x2a8a68[_0x2e3f94(0x216)]!==0x1?'s':'')),await handleSDKOutput(_0x2a8a68,_0x2c4942),0x0;}catch(_0x2ddf7e){if(_0x2ddf7e instanceof SDKError)return console[_0x2e3f94(0x23d)](_0x2e3f94(0x1ec)+_0x2ddf7e['message']),_0x2ddf7e[_0x2e3f94(0x1bf)]&&console[_0x2e3f94(0x23d)](_0x2e3f94(0x1c1)+_0x2ddf7e[_0x2e3f94(0x1bf)]),0x1;throw _0x2ddf7e;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0xc1877c(0x217)]='segment:folder:show';[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x21b);async[a32_0xc1877c(0x207)](_0x1aa2b2){const _0x16d238=a32_0xc1877c,{options:_0x3db378,args:_0x51d987,tdx:_0x1deeab}=_0x1aa2b2;if(_0x51d987['length']===0x0)return console['error'](_0x16d238(0x1be)),console[_0x16d238(0x23d)](_0x16d238(0x1f3)),0x1;try{const {parentId:_0x3dd5f5,childId:_0x308439}=parseSegmentRef(_0x51d987[0x0]);_0x3db378['verbose']&&(console['error'](_0x16d238(0x201)+_0x3db378[_0x16d238(0x1b9)]),console[_0x16d238(0x23d)](_0x16d238(0x22e)+_0x3dd5f5),_0x308439&&console[_0x16d238(0x23d)]('Folder\x20name:\x20'+_0x308439));if(!_0x308439)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x24ed1a=await withSpinner(_0x16d238(0x1ef)+_0x3dd5f5+_0x16d238(0x1fa),()=>_0x1deeab[_0x16d238(0x1c2)]['resolveParentId'](_0x3dd5f5),{'verbose':_0x3db378[_0x16d238(0x1cb)]}),_0x200eb9=_0x24ed1a[_0x16d238(0x23b)];_0x3db378[_0x16d238(0x1cb)]&&console[_0x16d238(0x23d)]('Resolved\x20parent\x20ID:\x20'+_0x200eb9);const _0xba5984=await withSpinner(_0x16d238(0x1dd)+_0x308439+_0x16d238(0x1fa),()=>_0x1deeab[_0x16d238(0x1c2)]['resolveFolderId'](_0x200eb9,_0x308439),{'verbose':_0x3db378[_0x16d238(0x1cb)]}),_0x5ae3c5=_0xba5984[_0x16d238(0x23b)];_0x3db378[_0x16d238(0x1cb)]&&console[_0x16d238(0x23d)](_0x16d238(0x1bc)+_0x5ae3c5);const _0x1b4980=await withSpinner('Fetching\x20folder\x20\x27'+_0x308439+_0x16d238(0x1fa),()=>_0x1deeab[_0x16d238(0x1c2)][_0x16d238(0x21c)](_0x5ae3c5),{'verbose':_0x3db378[_0x16d238(0x1cb)]});return await handleSDKOutput([_0x1b4980['data']],_0x3db378),0x0;}catch(_0x4dadcb){if(_0x4dadcb instanceof SDKError)return console['error']('Error:\x20'+_0x4dadcb[_0x16d238(0x1e1)]),_0x4dadcb[_0x16d238(0x1bf)]&&console['error'](_0x16d238(0x1c1)+_0x4dadcb['cause']),0x1;throw _0x4dadcb;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x206);[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x21d);async[a32_0xc1877c(0x207)](_0x4c4d04){const _0x5e5785=a32_0xc1877c,{options:_0x330049,args:_0xd5b603,tdx:_0x347c1e}=_0x4c4d04,_0x3905d1=_0xd5b603[0x0];if(!_0x3905d1)return console[_0x5e5785(0x23d)](_0x5e5785(0x21a)),console[_0x5e5785(0x23d)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x5e5785(0x23d)](_0x5e5785(0x226)),console[_0x5e5785(0x23d)](_0x5e5785(0x1b5)),console['error']('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x11bee0=_0x330049[_0x5e5785(0x20e)],_0x5dc052=resolveSegmentTarget(_0x3905d1,_0x11bee0,_0x330049[_0x5e5785(0x1cb)]);_0x330049['verbose']&&console[_0x5e5785(0x23d)](_0x5e5785(0x223)+_0x5dc052);const _0x58888e=await withSpinner(_0x5e5785(0x1ca)+_0x3905d1+'\x27...',()=>_0x347c1e[_0x5e5785(0x1c2)][_0x5e5785(0x203)](_0x5dc052),{'verbose':_0x330049[_0x5e5785(0x1cb)]}),_0x5ee736=_0x58888e[_0x5e5785(0x23b)];_0x330049['verbose']&&(console[_0x5e5785(0x23d)]('Resolved\x20type:\x20'+_0x5ee736[_0x5e5785(0x228)]),console[_0x5e5785(0x23d)](_0x5e5785(0x235)+_0x5ee736[_0x5e5785(0x20c)]));if(_0x5ee736[_0x5e5785(0x228)]===_0x5e5785(0x1d6))return console[_0x5e5785(0x23d)](_0x5e5785(0x1df)),console['error'](_0x5e5785(0x1de)),0x1;if(_0x5ee736[_0x5e5785(0x228)]==='parent')return console[_0x5e5785(0x23d)](_0x5e5785(0x1b7)),console['error'](_0x5e5785(0x213)),0x1;if(!_0x5ee736['segmentId'])throw new SDKError(ErrorCode[_0x5e5785(0x1c3)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x30852e=await withSpinner(_0x5e5785(0x221),()=>_0x347c1e[_0x5e5785(0x1c2)]['getSegmentSQL'](_0x5ee736[_0x5e5785(0x20c)],_0x5ee736['segmentId']),{'verbose':_0x330049[_0x5e5785(0x1cb)]}),_0x3a277f=_0x30852e[_0x5e5785(0x23b)];return _0x330049['format']===_0x5e5785(0x219)||_0x330049[_0x5e5785(0x1ff)]===_0x5e5785(0x22c)?await handleSDKOutput([{'sql':_0x3a277f}],_0x330049):console[_0x5e5785(0x1db)](_0x3a277f),0x0;}catch(_0x18ffb5){if(_0x18ffb5 instanceof SDKError)return console[_0x5e5785(0x23d)](_0x5e5785(0x1ec)+_0x18ffb5[_0x5e5785(0x1e1)]),_0x18ffb5['cause']&&console['error'](_0x5e5785(0x1c1)+_0x18ffb5['cause']),0x1;throw _0x18ffb5;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x1d9);[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x22a);async[a32_0xc1877c(0x207)](_0x5c7651){const _0x4abccb=a32_0xc1877c,{options:_0x3cd2d7,args:_0xa20891,tdx:_0x32f1da}=_0x5c7651,_0xa8ef0c=_0x3cd2d7;if(_0xa20891[_0x4abccb(0x216)]<0x2)return console[_0x4abccb(0x23d)](_0x4abccb(0x20a)),console[_0x4abccb(0x23d)](_0x4abccb(0x1f1)),0x1;const _0x54e3b2=_0xa20891[0x0],_0x435966=_0xa20891[0x1];_0xa8ef0c[_0x4abccb(0x1cb)]&&(console[_0x4abccb(0x23d)](_0x4abccb(0x201)+_0xa8ef0c[_0x4abccb(0x1b9)]),console[_0x4abccb(0x23d)](_0x4abccb(0x239)+_0x54e3b2),console['error'](_0x4abccb(0x1f9)+_0x435966));let _0xa9df17;if(_0xa8ef0c[_0x4abccb(0x1bd)]){const _0x38f0d2=_0xa8ef0c[_0x4abccb(0x1bd)],_0x519b24=await withSpinner(_0x4abccb(0x1ef)+_0x54e3b2+'\x27...',()=>_0x32f1da[_0x4abccb(0x1c2)][_0x4abccb(0x241)](_0x54e3b2),{'verbose':_0xa8ef0c[_0x4abccb(0x1cb)]}),_0x2f8b32=_0x519b24['data'],_0x23c8c8=await withSpinner(_0x4abccb(0x231)+_0x38f0d2+'\x27...',()=>_0x32f1da[_0x4abccb(0x1c2)][_0x4abccb(0x20f)](_0x2f8b32,_0x38f0d2),{'verbose':_0xa8ef0c[_0x4abccb(0x1cb)]});_0xa9df17=_0x23c8c8[_0x4abccb(0x23b)],_0xa8ef0c[_0x4abccb(0x1cb)]&&console[_0x4abccb(0x23d)](_0x4abccb(0x214)+_0xa9df17);}const _0x1dc577={'name':_0x435966,'description':_0xa8ef0c[_0x4abccb(0x1c5)],'parentFolderId':_0xa9df17},_0x2fa52d=await withSpinner(_0x4abccb(0x240)+_0x435966+'\x27...',()=>_0x32f1da[_0x4abccb(0x1c2)][_0x4abccb(0x1c0)](_0x54e3b2,_0x1dc577),{'verbose':_0xa8ef0c[_0x4abccb(0x1cb)]}),_0x1a9516=_0x2fa52d['data'];return console[_0x4abccb(0x23d)](_0x4abccb(0x23a)+_0x1a9516[_0x4abccb(0x217)]+'\x27\x20with\x20ID:\x20'+_0x1a9516['id']),await handleSDKOutput([_0x1a9516],_0xa8ef0c),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x218);[a32_0xc1877c(0x1c5)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a32_0xc1877c(0x207)](_0x5c5324){const _0x496235=a32_0xc1877c,{options:_0x37489d,args:_0x17bed8,tdx:_0x210262}=_0x5c5324,_0xc9ecd1=_0x17bed8[0x0];if(!_0xc9ecd1)return console[_0x496235(0x23d)](_0x496235(0x1cd)),console[_0x496235(0x23d)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x496235(0x23d)](_0x496235(0x1e6)),console['error'](_0x496235(0x1e3)),console[_0x496235(0x23d)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x496235(0x23d)]('Examples:'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x496235(0x23d)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x496235(0x23d)](_0x496235(0x227)),console[_0x496235(0x23d)](_0x496235(0x1f4)),0x1;try{const _0x15bfcb=_0x37489d[_0x496235(0x20e)],_0x1974d3=resolveSegmentTarget(_0xc9ecd1,_0x15bfcb,_0x37489d[_0x496235(0x1cb)]);_0x37489d['verbose']&&console[_0x496235(0x23d)](_0x496235(0x223)+_0x1974d3);const _0x28fcc8=await withSpinner(_0x496235(0x1ca)+_0xc9ecd1+_0x496235(0x1fa),()=>_0x210262[_0x496235(0x1c2)][_0x496235(0x203)](_0x1974d3),{'verbose':_0x37489d[_0x496235(0x1cb)]}),_0x2a023d=_0x28fcc8[_0x496235(0x23b)];_0x37489d[_0x496235(0x1cb)]&&(console[_0x496235(0x23d)](_0x496235(0x1eb)+_0x2a023d[_0x496235(0x228)]),console['error'](_0x496235(0x235)+_0x2a023d[_0x496235(0x20c)]),_0x2a023d[_0x496235(0x209)]&&console['error'](_0x496235(0x22b)+_0x2a023d['folderId']),_0x2a023d[_0x496235(0x1fb)]&&console[_0x496235(0x23d)](_0x496235(0x1c7)+_0x2a023d[_0x496235(0x1fb)]));if(_0x37489d[_0x496235(0x1e5)]){if(_0x2a023d[_0x496235(0x228)]===_0x496235(0x1d6))return console[_0x496235(0x23d)](_0x496235(0x1fd)),0x1;if(_0x2a023d[_0x496235(0x228)]===_0x496235(0x1ee))return console[_0x496235(0x23d)](_0x496235(0x23e)),console['error']('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x2a023d[_0x496235(0x1fb)])throw new SDKError(ErrorCode[_0x496235(0x1c3)],_0x496235(0x1ba));const _0x2d44de=getConsoleNextUrl(_0x37489d[_0x496235(0x1b9)],_0x496235(0x1c8)+_0x2a023d[_0x496235(0x20c)]+_0x496235(0x237)+_0x2a023d[_0x496235(0x1fb)]);return console[_0x496235(0x23d)](a32_0x95fa24['green']('✔')+_0x496235(0x1dc)+a32_0x95fa24[_0x496235(0x1ea)](_0x2d44de)),openBrowser(_0x2d44de),0x0;}if(_0x2a023d['type']===_0x496235(0x1d6)){if(!_0x2a023d[_0x496235(0x209)])throw new SDKError(ErrorCode[_0x496235(0x204)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x113cc1=await withSpinner(_0x496235(0x1b6),()=>_0x210262['segment']['getFolder'](_0x2a023d[_0x496235(0x209)]),{'verbose':_0x37489d[_0x496235(0x1cb)]});await handleSingleObjectOutput(_0x113cc1['data'],_0x37489d);}else{if(_0x2a023d['type']==='segment'){if(!_0x2a023d[_0x496235(0x1fb)])throw new SDKError(ErrorCode[_0x496235(0x1c3)],_0x496235(0x1ba));const _0x5218ff=await withSpinner('Fetching\x20segment\x20details...',()=>_0x210262[_0x496235(0x1c2)][_0x496235(0x20b)](_0x2a023d['parentId'],_0x2a023d[_0x496235(0x1fb)]),{'verbose':_0x37489d[_0x496235(0x1cb)]}),_0x9c55d=getConsoleNextUrl(_0x37489d[_0x496235(0x1b9)],'/app/ps/'+_0x2a023d['parentId']+_0x496235(0x237)+_0x2a023d['segmentId']),_0x62c8dd=_0x5218ff['data'];_0x62c8dd[_0x496235(0x23f)]=_0x9c55d,await handleSingleObjectOutput(_0x62c8dd,_0x37489d);}else return console[_0x496235(0x23d)](_0x496235(0x230)),console[_0x496235(0x23d)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x27f740){if(_0x27f740 instanceof SDKError)return console[_0x496235(0x23d)](_0x496235(0x1ec)+_0x27f740['message']),_0x27f740[_0x496235(0x1bf)]&&console[_0x496235(0x23d)](_0x496235(0x1c1)+_0x27f740[_0x496235(0x1bf)]),0x1;throw _0x27f740;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0xc1877c(0x217)]='segment:desc';[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x1ce);async['execute'](_0x1124be){const _0x52515e=a32_0xc1877c,{options:_0x137362,args:_0x398f56,tdx:_0x1a29ec}=_0x1124be,_0x461d72=_0x398f56[0x0];if(!_0x461d72)return console[_0x52515e(0x23d)](_0x52515e(0x21a)),console['error'](_0x52515e(0x22f)),console[_0x52515e(0x23d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x52515e(0x23d)](_0x52515e(0x1b5)),console[_0x52515e(0x23d)](_0x52515e(0x220)),console[_0x52515e(0x23d)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xf4b668=_0x137362['parentSegment'],_0x14ccbf=resolveSegmentTarget(_0x461d72,_0xf4b668,_0x137362['verbose']);_0x137362[_0x52515e(0x1cb)]&&console[_0x52515e(0x23d)](_0x52515e(0x223)+_0x14ccbf);const _0x22d04e=await withSpinner('Resolving\x20\x27'+_0x461d72+_0x52515e(0x1fa),()=>_0x1a29ec[_0x52515e(0x1c2)][_0x52515e(0x203)](_0x14ccbf),{'verbose':_0x137362[_0x52515e(0x1cb)]}),_0x3edbd4=_0x22d04e[_0x52515e(0x23b)];_0x137362[_0x52515e(0x1cb)]&&(console['error'](_0x52515e(0x1eb)+_0x3edbd4[_0x52515e(0x228)]),console['error'](_0x52515e(0x235)+_0x3edbd4[_0x52515e(0x20c)]));if(_0x3edbd4[_0x52515e(0x228)]===_0x52515e(0x1d6))return console['error'](_0x52515e(0x1e4)),console[_0x52515e(0x23d)](_0x52515e(0x1de)),0x1;if(_0x3edbd4[_0x52515e(0x228)]===_0x52515e(0x1ee))return console[_0x52515e(0x23d)](_0x52515e(0x1c4)),console[_0x52515e(0x23d)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x3edbd4[_0x52515e(0x1fb)])throw new SDKError(ErrorCode[_0x52515e(0x1c3)],_0x52515e(0x1ba));const _0x25f564=await withSpinner(_0x52515e(0x221),()=>_0x1a29ec['segment'][_0x52515e(0x1b2)](_0x3edbd4[_0x52515e(0x20c)],_0x3edbd4[_0x52515e(0x1fb)]),{'verbose':_0x137362[_0x52515e(0x1cb)]}),_0x4bbb7d=_0x25f564[_0x52515e(0x23b)],_0x1d7132=await executeSchemaQuery(_0x4bbb7d,_0x1a29ec,_0x137362);return await handleQueryOutput(_0x1d7132,_0x137362),0x0;}catch(_0x2f76fa){if(_0x2f76fa instanceof SDKError)return console[_0x52515e(0x23d)]('Error:\x20'+_0x2f76fa[_0x52515e(0x1e1)]),_0x2f76fa[_0x52515e(0x1bf)]&&console[_0x52515e(0x23d)](_0x52515e(0x1c1)+_0x2f76fa[_0x52515e(0x1bf)]),0x1;throw _0x2f76fa;}}}
|
|
1
|
+
function a32_0x2f7c(_0x185fff,_0x17df21){_0x185fff=_0x185fff-0x1aa;const _0x51422e=a32_0x5142();let _0x2f7c36=_0x51422e[_0x185fff];return _0x2f7c36;}const a32_0x27ec5a=a32_0x2f7c;(function(_0x141bb2,_0x43287a){const _0x3253d1=a32_0x2f7c,_0x799a73=_0x141bb2();while(!![]){try{const _0x45f513=-parseInt(_0x3253d1(0x1fa))/0x1+-parseInt(_0x3253d1(0x1f3))/0x2+-parseInt(_0x3253d1(0x247))/0x3*(parseInt(_0x3253d1(0x1f1))/0x4)+-parseInt(_0x3253d1(0x209))/0x5+parseInt(_0x3253d1(0x21f))/0x6*(-parseInt(_0x3253d1(0x1b1))/0x7)+parseInt(_0x3253d1(0x1d7))/0x8+-parseInt(_0x3253d1(0x1ed))/0x9*(-parseInt(_0x3253d1(0x21e))/0xa);if(_0x45f513===_0x43287a)break;else _0x799a73['push'](_0x799a73['shift']());}catch(_0x174b4a){_0x799a73['push'](_0x799a73['shift']());}}}(a32_0x5142,0x5ad07));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_0x546a13 from'chalk';function resolveSegmentTarget(_0x1ec84a,_0x2df664,_0x50be4a){const _0x2e1311=a32_0x2f7c;if(isYamlFilePath(_0x1ec84a))try{const _0x48922c=resolveYamlFilePath(_0x1ec84a);return _0x50be4a&&(console[_0x2e1311(0x226)](_0x2e1311(0x223)+_0x1ec84a),console[_0x2e1311(0x226)](_0x2e1311(0x1ae)+_0x48922c['parentSegment']),console[_0x2e1311(0x226)]('\x20\x20Segment\x20name:\x20'+_0x48922c[_0x2e1311(0x205)]),console[_0x2e1311(0x226)](_0x2e1311(0x218)+(_0x48922c[_0x2e1311(0x213)]||_0x2e1311(0x1c6))),console['error'](_0x2e1311(0x1dc)+_0x48922c[_0x2e1311(0x1d1)])),_0x48922c[_0x2e1311(0x1d1)];}catch(_0x2f708c){throw new SDKError(ErrorCode[_0x2e1311(0x1c0)],_0x2e1311(0x1b2)+_0x2f708c[_0x2e1311(0x1df)]);}if(!_0x2df664)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x2df664+'/'+_0x1ec84a;}export class SegmentDescribeCommand extends BaseCommand{['name']=a32_0x27ec5a(0x222);[a32_0x27ec5a(0x1d4)]=a32_0x27ec5a(0x22a);async[a32_0x27ec5a(0x1ef)](_0xfd3ca9){const _0x1e372e=a32_0x27ec5a,{options:_0x53e6ba,args:_0x5434a2,tdx:_0x4c66ba}=_0xfd3ca9,_0x310f1b=_0x5434a2[0x0],_0x2fabeb=!_0x310f1b&&!!_0x53e6ba[_0x1e372e(0x1c3)],_0x1677c6=_0x310f1b||_0x53e6ba[_0x1e372e(0x1c3)];if(!_0x1677c6)return console[_0x1e372e(0x226)](_0x1e372e(0x22d)),console[_0x1e372e(0x226)](_0x1e372e(0x1b8)),console[_0x1e372e(0x226)](_0x1e372e(0x23b)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x1e372e(0x226)](_0x1e372e(0x245)),console['error'](_0x1e372e(0x238)),console[_0x1e372e(0x226)](_0x1e372e(0x1de)),0x1;try{const _0x489c36=_0x53e6ba[_0x1e372e(0x22f)];let _0x16836e=_0x1677c6;!_0x2fabeb&&_0x489c36&&!_0x1677c6[_0x1e372e(0x1cd)]('/')&&(_0x16836e=_0x489c36+'/'+_0x1677c6,_0x53e6ba[_0x1e372e(0x211)]&&console[_0x1e372e(0x226)](_0x1e372e(0x1c9)+_0x16836e));const _0x4a3ec7=await withSpinner(_0x1e372e(0x1d2)+_0x16836e+_0x1e372e(0x1ba),()=>_0x4c66ba[_0x1e372e(0x1d3)][_0x1e372e(0x1f7)](_0x16836e),{'verbose':_0x53e6ba[_0x1e372e(0x211)]}),_0x4313c5=_0x4a3ec7['data'];_0x53e6ba[_0x1e372e(0x211)]&&(console[_0x1e372e(0x226)](_0x1e372e(0x220)+_0x4313c5[_0x1e372e(0x1f0)]),console['error'](_0x1e372e(0x1e7)+_0x4313c5[_0x1e372e(0x1d0)]),_0x4313c5['folderId']&&console[_0x1e372e(0x226)]('Folder\x20ID:\x20'+_0x4313c5[_0x1e372e(0x1dd)]),_0x4313c5[_0x1e372e(0x20e)]&&console[_0x1e372e(0x226)](_0x1e372e(0x215)+_0x4313c5[_0x1e372e(0x20e)]));if(_0x4313c5['type']===_0x1e372e(0x1ac)){const _0x1de25c=await withSpinner(_0x1e372e(0x22b),()=>_0x4c66ba['segment'][_0x1e372e(0x214)](_0x4313c5[_0x1e372e(0x1d0)]),{'verbose':_0x53e6ba['verbose']});await handleSingleObjectOutput(_0x1de25c[_0x1e372e(0x1ee)],_0x53e6ba);}else{if(_0x4313c5[_0x1e372e(0x1f0)]===_0x1e372e(0x225)){if(!_0x4313c5[_0x1e372e(0x1dd)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1e372e(0x246));const _0x18cb0b=await withSpinner(_0x1e372e(0x1db),()=>_0x4c66ba[_0x1e372e(0x1d3)]['getFolder'](_0x4313c5[_0x1e372e(0x1dd)]),{'verbose':_0x53e6ba[_0x1e372e(0x211)]});await handleSingleObjectOutput(_0x18cb0b[_0x1e372e(0x1ee)],_0x53e6ba);}else{if(_0x4313c5['type']==='segment'){if(!_0x4313c5[_0x1e372e(0x20e)])throw new SDKError(ErrorCode[_0x1e372e(0x21d)],_0x1e372e(0x1e9));const _0x56ec76=await withSpinner(_0x1e372e(0x239),()=>_0x4c66ba[_0x1e372e(0x1d3)]['getSegment'](_0x4313c5['parentId'],_0x4313c5[_0x1e372e(0x20e)]),{'verbose':_0x53e6ba[_0x1e372e(0x211)]});await handleSingleObjectOutput(_0x56ec76[_0x1e372e(0x1ee)],_0x53e6ba);}}}return 0x0;}catch(_0x242a4b){if(_0x242a4b instanceof SDKError)return console[_0x1e372e(0x226)](_0x1e372e(0x1e6)+_0x242a4b[_0x1e372e(0x1df)]),_0x242a4b[_0x1e372e(0x234)]&&console[_0x1e372e(0x226)]('\x20\x20Cause:\x20'+_0x242a4b[_0x1e372e(0x234)]),0x1;throw _0x242a4b;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x27ec5a(0x244)]=a32_0x27ec5a(0x1eb);[a32_0x27ec5a(0x1d4)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x2cd1f6){const _0x4e7e27=a32_0x27ec5a,{options:_0x12c932,args:_0x19b180,tdx:_0x5a3dcd}=_0x2cd1f6,_0x46e860=_0x19b180[0x0];if(!_0x46e860)return console[_0x4e7e27(0x226)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4e7e27(0x226)](_0x4e7e27(0x1e2)),console[_0x4e7e27(0x226)](_0x4e7e27(0x21a)),console[_0x4e7e27(0x226)](_0x4e7e27(0x23b)),console[_0x4e7e27(0x226)](_0x4e7e27(0x1ec)),console['error'](_0x4e7e27(0x1f8)),0x1;try{const _0x11e185=_0x12c932[_0x4e7e27(0x1c3)],_0x2ac2c7=resolveSegmentTarget(_0x46e860,_0x11e185,_0x12c932['verbose']);_0x12c932[_0x4e7e27(0x211)]&&console[_0x4e7e27(0x226)](_0x4e7e27(0x21b)+_0x2ac2c7);const _0x415114=await withSpinner('Resolving\x20\x27'+_0x46e860+_0x4e7e27(0x1ba),()=>_0x5a3dcd[_0x4e7e27(0x1d3)]['resolvePathToResource'](_0x2ac2c7),{'verbose':_0x12c932[_0x4e7e27(0x211)]}),_0x424d0e=_0x415114['data'];_0x12c932[_0x4e7e27(0x211)]&&(console[_0x4e7e27(0x226)]('Resolved\x20type:\x20'+_0x424d0e[_0x4e7e27(0x1f0)]),console['error'](_0x4e7e27(0x1e7)+_0x424d0e[_0x4e7e27(0x1d0)]));if(_0x424d0e['type']===_0x4e7e27(0x225))return console[_0x4e7e27(0x226)](_0x4e7e27(0x1fe)),console[_0x4e7e27(0x226)](_0x4e7e27(0x1b5)),0x1;if(_0x424d0e[_0x4e7e27(0x1f0)]===_0x4e7e27(0x1ac))return console['error']('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4e7e27(0x226)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x424d0e[_0x4e7e27(0x20e)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4e7e27(0x1e9));const _0x5071c0=await withSpinner(_0x4e7e27(0x20b),()=>_0x5a3dcd[_0x4e7e27(0x1d3)][_0x4e7e27(0x1b9)](_0x424d0e[_0x4e7e27(0x1d0)],_0x424d0e[_0x4e7e27(0x20e)]),{'verbose':_0x12c932['verbose']});let _0x220402=_0x5071c0[_0x4e7e27(0x1ee)];const _0x419793=resolveLimit(_0x12c932['limit'],DEFAULT_DISPLAY_LIMIT),_0x9b0c7a=/\bLIMIT\s+\d+/i['test'](_0x220402);!_0x9b0c7a&&(_0x220402=_0x220402[_0x4e7e27(0x1c7)]()[_0x4e7e27(0x1ff)](/;+$/,''),_0x220402=_0x4e7e27(0x212)+_0x220402+_0x4e7e27(0x1f2)+_0x419793);_0x12c932['verbose']&&console[_0x4e7e27(0x226)]('SQL\x20query:\x0a'+_0x220402);const _0x3945fd=await withQuerySpinner(_0x4e7e27(0x230),async _0xce651b=>{const _0xae877f=_0x4e7e27,_0x4f3bdd=await _0x5a3dcd[_0xae877f(0x1e3)][_0xae877f(0x1ef)](_0x220402,{'catalog':'td','schema':_0xae877f(0x1c4),'onJobId':_0x54125d=>{const _0x436a42=_0xae877f;_0xce651b[_0x436a42(0x1ad)](_0x54125d);}});return _0x4f3bdd;},{'verbose':_0x12c932[_0x4e7e27(0x211)]}),_0x53db64=_0x3945fd[_0x4e7e27(0x1ee)],_0xf4fb98=_0x53db64['jobId']?_0x4e7e27(0x20f)+_0x53db64[_0x4e7e27(0x204)]+']':'';return console[_0x4e7e27(0x226)](_0x4e7e27(0x1c2)+_0x53db64['stats'][_0x4e7e27(0x1cc)][_0x4e7e27(0x1d8)]()+'\x20rows\x20'+(_0x4e7e27(0x216)+formatElapsed(_0x53db64[_0x4e7e27(0x1c1)]['elapsedTimeMillis'])+_0xf4fb98)),await handleQueryOutput(_0x53db64,_0x12c932),0x0;}catch(_0x544267){if(_0x544267 instanceof SDKError)return console[_0x4e7e27(0x226)](_0x4e7e27(0x1da)+_0x544267['code']+']'),console[_0x4e7e27(0x226)]('\x0a'+_0x544267[_0x4e7e27(0x1df)]),0x1;throw _0x544267;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a32_0x27ec5a(0x210);[a32_0x27ec5a(0x1d4)]=a32_0x27ec5a(0x206);async[a32_0x27ec5a(0x1ef)](_0x546472){const _0x4c98f2=a32_0x27ec5a,{options:_0x4cf684,args:_0x46f162,tdx:_0x23572c}=_0x546472;if(_0x46f162[_0x4c98f2(0x1e8)]===0x0)return console[_0x4c98f2(0x226)](_0x4c98f2(0x207)),console[_0x4c98f2(0x226)](_0x4c98f2(0x1ca)),0x1;const _0x110846=_0x46f162[0x0];try{_0x4cf684[_0x4c98f2(0x211)]&&(console[_0x4c98f2(0x226)](_0x4c98f2(0x1fb)+_0x4cf684[_0x4c98f2(0x1aa)]),console[_0x4c98f2(0x226)](_0x4c98f2(0x20a)+_0x110846));const _0x272871=await withSpinner(_0x4c98f2(0x240)+_0x110846+'\x27...',()=>_0x23572c[_0x4c98f2(0x1d3)][_0x4c98f2(0x241)](_0x110846),{'verbose':_0x4cf684[_0x4c98f2(0x211)]}),_0x5b1179=_0x272871[_0x4c98f2(0x1ee)];_0x4cf684[_0x4c98f2(0x211)]&&console[_0x4c98f2(0x226)](_0x4c98f2(0x1cb)+_0x5b1179);const _0x35176b=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x110846+_0x4c98f2(0x1ba),()=>_0x23572c[_0x4c98f2(0x1d3)][_0x4c98f2(0x1b4)](_0x5b1179),{'verbose':_0x4cf684['verbose']}),_0x148694=_0x35176b[_0x4c98f2(0x1ee)];return console[_0x4c98f2(0x226)](_0x4c98f2(0x232)+_0x148694[_0x4c98f2(0x1e8)]+_0x4c98f2(0x1e0)+(_0x148694[_0x4c98f2(0x1e8)]!==0x1?'s':'')),await handleSDKOutput(_0x148694,_0x4cf684),0x0;}catch(_0x364961){if(_0x364961 instanceof SDKError)return console['error'](_0x4c98f2(0x1e6)+_0x364961[_0x4c98f2(0x1df)]),_0x364961[_0x4c98f2(0x234)]&&console[_0x4c98f2(0x226)](_0x4c98f2(0x219)+_0x364961[_0x4c98f2(0x234)]),0x1;throw _0x364961;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x27ec5a(0x244)]='segment:folder:show';[a32_0x27ec5a(0x1d4)]=a32_0x27ec5a(0x228);async[a32_0x27ec5a(0x1ef)](_0x1a41fc){const _0x1fb9a0=a32_0x27ec5a,{options:_0x39a7db,args:_0xb16523,tdx:_0x3cbce3}=_0x1a41fc;if(_0xb16523[_0x1fb9a0(0x1e8)]===0x0)return console[_0x1fb9a0(0x226)](_0x1fb9a0(0x1f4)),console[_0x1fb9a0(0x226)](_0x1fb9a0(0x1c5)),0x1;try{const {parentId:_0x9863ae,childId:_0x174586}=parseSegmentRef(_0xb16523[0x0]);_0x39a7db['verbose']&&(console['error'](_0x1fb9a0(0x1fb)+_0x39a7db[_0x1fb9a0(0x1aa)]),console[_0x1fb9a0(0x226)](_0x1fb9a0(0x20a)+_0x9863ae),_0x174586&&console[_0x1fb9a0(0x226)](_0x1fb9a0(0x1b7)+_0x174586));if(!_0x174586)return console[_0x1fb9a0(0x226)](_0x1fb9a0(0x1b0)),0x1;const _0x158d38=await withSpinner(_0x1fb9a0(0x240)+_0x9863ae+_0x1fb9a0(0x1ba),()=>_0x3cbce3['segment'][_0x1fb9a0(0x241)](_0x9863ae),{'verbose':_0x39a7db['verbose']}),_0x29c9ef=_0x158d38[_0x1fb9a0(0x1ee)];_0x39a7db['verbose']&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x29c9ef);const _0x58309e=await withSpinner(_0x1fb9a0(0x221)+_0x174586+_0x1fb9a0(0x1ba),()=>_0x3cbce3[_0x1fb9a0(0x1d3)][_0x1fb9a0(0x237)](_0x29c9ef,_0x174586),{'verbose':_0x39a7db[_0x1fb9a0(0x211)]}),_0x4be735=_0x58309e[_0x1fb9a0(0x1ee)];_0x39a7db[_0x1fb9a0(0x211)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x4be735);const _0xebdc33=await withSpinner(_0x1fb9a0(0x1d9)+_0x174586+_0x1fb9a0(0x1ba),()=>_0x3cbce3[_0x1fb9a0(0x1d3)]['getFolder'](_0x4be735),{'verbose':_0x39a7db[_0x1fb9a0(0x211)]});return await handleSDKOutput([_0xebdc33[_0x1fb9a0(0x1ee)]],_0x39a7db),0x0;}catch(_0x385892){if(_0x385892 instanceof SDKError)return console['error'](_0x1fb9a0(0x1e6)+_0x385892['message']),_0x385892[_0x1fb9a0(0x234)]&&console[_0x1fb9a0(0x226)](_0x1fb9a0(0x219)+_0x385892['cause']),0x1;throw _0x385892;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x27ec5a(0x244)]=a32_0x27ec5a(0x23c);[a32_0x27ec5a(0x1d4)]=a32_0x27ec5a(0x1b6);async[a32_0x27ec5a(0x1ef)](_0x50576d){const _0x301e9a=a32_0x27ec5a,{options:_0x35bd27,args:_0x127645,tdx:_0x4afeec}=_0x50576d,_0x4fc3bd=_0x127645[0x0];if(!_0x4fc3bd)return console[_0x301e9a(0x226)](_0x301e9a(0x1fc)),console[_0x301e9a(0x226)](_0x301e9a(0x1bb)),console[_0x301e9a(0x226)](_0x301e9a(0x1f5)),console[_0x301e9a(0x226)](_0x301e9a(0x23b)),console[_0x301e9a(0x226)](_0x301e9a(0x1bf)),console[_0x301e9a(0x226)](_0x301e9a(0x200)),0x1;try{const _0x5de7fe=_0x35bd27['parentSegment'],_0x4383e5=resolveSegmentTarget(_0x4fc3bd,_0x5de7fe,_0x35bd27[_0x301e9a(0x211)]);_0x35bd27[_0x301e9a(0x211)]&&console[_0x301e9a(0x226)](_0x301e9a(0x21b)+_0x4383e5);const _0x35bf1b=await withSpinner(_0x301e9a(0x23d)+_0x4fc3bd+_0x301e9a(0x1ba),()=>_0x4afeec['segment']['resolvePathToResource'](_0x4383e5),{'verbose':_0x35bd27[_0x301e9a(0x211)]}),_0x43edc1=_0x35bf1b[_0x301e9a(0x1ee)];_0x35bd27[_0x301e9a(0x211)]&&(console[_0x301e9a(0x226)]('Resolved\x20type:\x20'+_0x43edc1[_0x301e9a(0x1f0)]),console[_0x301e9a(0x226)](_0x301e9a(0x1e7)+_0x43edc1[_0x301e9a(0x1d0)]));if(_0x43edc1['type']===_0x301e9a(0x225))return console[_0x301e9a(0x226)](_0x301e9a(0x1fd)),console['error'](_0x301e9a(0x208)),0x1;if(_0x43edc1[_0x301e9a(0x1f0)]===_0x301e9a(0x1ac))return console['error'](_0x301e9a(0x1ea)),console['error']('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x43edc1[_0x301e9a(0x20e)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1732a4=await withSpinner(_0x301e9a(0x20b),()=>_0x4afeec[_0x301e9a(0x1d3)][_0x301e9a(0x1b9)](_0x43edc1[_0x301e9a(0x1d0)],_0x43edc1['segmentId']),{'verbose':_0x35bd27['verbose']}),_0x2bf443=_0x1732a4['data'];return _0x35bd27[_0x301e9a(0x23a)]===_0x301e9a(0x1af)||_0x35bd27[_0x301e9a(0x23a)]===_0x301e9a(0x1f6)?await handleSDKOutput([{'sql':_0x2bf443}],_0x35bd27):console[_0x301e9a(0x23f)](_0x2bf443),0x0;}catch(_0x127f7e){if(_0x127f7e instanceof SDKError)return console[_0x301e9a(0x226)](_0x301e9a(0x1e6)+_0x127f7e['message']),_0x127f7e[_0x301e9a(0x234)]&&console[_0x301e9a(0x226)](_0x301e9a(0x219)+_0x127f7e[_0x301e9a(0x234)]),0x1;throw _0x127f7e;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a32_0x27ec5a(0x244)]='segment:folder:create';[a32_0x27ec5a(0x1d4)]='Create\x20segment\x20folder\x20for\x20organization';async[a32_0x27ec5a(0x1ef)](_0x461671){const _0x5ca77d=a32_0x27ec5a,{options:_0x209402,args:_0x339c5b,tdx:_0x14c86a}=_0x461671,_0xe0c160=_0x209402;if(_0x339c5b[_0x5ca77d(0x1e8)]<0x2)return console[_0x5ca77d(0x226)](_0x5ca77d(0x1c8)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0xc0bcb9=_0x339c5b[0x0],_0x29a06e=_0x339c5b[0x1];_0xe0c160[_0x5ca77d(0x211)]&&(console[_0x5ca77d(0x226)](_0x5ca77d(0x1fb)+_0xe0c160[_0x5ca77d(0x1aa)]),console[_0x5ca77d(0x226)](_0x5ca77d(0x1bc)+_0xc0bcb9),console[_0x5ca77d(0x226)](_0x5ca77d(0x1b7)+_0x29a06e));let _0x453f89;if(_0xe0c160['parentFolder']){const _0x246f11=_0xe0c160['parentFolder'],_0x20d014=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xc0bcb9+_0x5ca77d(0x1ba),()=>_0x14c86a[_0x5ca77d(0x1d3)][_0x5ca77d(0x241)](_0xc0bcb9),{'verbose':_0xe0c160[_0x5ca77d(0x211)]}),_0x599faf=_0x20d014[_0x5ca77d(0x1ee)],_0x28d65f=await withSpinner(_0x5ca77d(0x1d6)+_0x246f11+'\x27...',()=>_0x14c86a[_0x5ca77d(0x1d3)][_0x5ca77d(0x237)](_0x599faf,_0x246f11),{'verbose':_0xe0c160[_0x5ca77d(0x211)]});_0x453f89=_0x28d65f[_0x5ca77d(0x1ee)],_0xe0c160['verbose']&&console[_0x5ca77d(0x226)](_0x5ca77d(0x1ab)+_0x453f89);}const _0x558aa9={'name':_0x29a06e,'description':_0xe0c160['description'],'parentFolderId':_0x453f89},_0x2a8c02=await withSpinner(_0x5ca77d(0x233)+_0x29a06e+_0x5ca77d(0x1ba),()=>_0x14c86a[_0x5ca77d(0x1d3)][_0x5ca77d(0x231)](_0xc0bcb9,_0x558aa9),{'verbose':_0xe0c160['verbose']}),_0x1d5c92=_0x2a8c02[_0x5ca77d(0x1ee)];return console[_0x5ca77d(0x226)]('✔\x20Created\x20folder\x20\x27'+_0x1d5c92[_0x5ca77d(0x244)]+_0x5ca77d(0x1be)+_0x1d5c92['id']),await handleSDKOutput([_0x1d5c92],_0xe0c160),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a32_0x27ec5a(0x229);['description']=a32_0x27ec5a(0x236);async[a32_0x27ec5a(0x1ef)](_0x5376b4){const _0x30eaab=a32_0x27ec5a,{options:_0x4336fc,args:_0x53c63b,tdx:_0x3ba8e9}=_0x5376b4,_0x5345b2=_0x53c63b[0x0];if(!_0x5345b2)return console[_0x30eaab(0x226)](_0x30eaab(0x23e)),console[_0x30eaab(0x226)](_0x30eaab(0x217)),console[_0x30eaab(0x226)](_0x30eaab(0x227)),console[_0x30eaab(0x226)](_0x30eaab(0x224)),console[_0x30eaab(0x226)](_0x30eaab(0x242)),console[_0x30eaab(0x226)](_0x30eaab(0x23b)),console['error'](_0x30eaab(0x20c)),console[_0x30eaab(0x226)](_0x30eaab(0x1b3)),console[_0x30eaab(0x226)](_0x30eaab(0x201)),console[_0x30eaab(0x226)](_0x30eaab(0x235)),0x1;try{const _0xacd9f5=_0x4336fc[_0x30eaab(0x1c3)],_0x119ff=resolveSegmentTarget(_0x5345b2,_0xacd9f5,_0x4336fc[_0x30eaab(0x211)]);_0x4336fc[_0x30eaab(0x211)]&&console[_0x30eaab(0x226)](_0x30eaab(0x21b)+_0x119ff);const _0x32c209=await withSpinner(_0x30eaab(0x23d)+_0x5345b2+'\x27...',()=>_0x3ba8e9[_0x30eaab(0x1d3)]['resolvePathToResource'](_0x119ff),{'verbose':_0x4336fc[_0x30eaab(0x211)]}),_0x1d5dae=_0x32c209[_0x30eaab(0x1ee)];_0x4336fc[_0x30eaab(0x211)]&&(console[_0x30eaab(0x226)](_0x30eaab(0x220)+_0x1d5dae[_0x30eaab(0x1f0)]),console[_0x30eaab(0x226)](_0x30eaab(0x1e7)+_0x1d5dae[_0x30eaab(0x1d0)]),_0x1d5dae[_0x30eaab(0x1dd)]&&console['error'](_0x30eaab(0x20d)+_0x1d5dae[_0x30eaab(0x1dd)]),_0x1d5dae['segmentId']&&console[_0x30eaab(0x226)]('Segment\x20ID:\x20'+_0x1d5dae[_0x30eaab(0x20e)]));if(_0x4336fc['web']){if(_0x1d5dae[_0x30eaab(0x1f0)]===_0x30eaab(0x225))return console[_0x30eaab(0x226)](_0x30eaab(0x1cf)),0x1;if(_0x1d5dae['type']==='parent')return console[_0x30eaab(0x226)](_0x30eaab(0x22e)),console[_0x30eaab(0x226)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x1d5dae[_0x30eaab(0x20e)])throw new SDKError(ErrorCode[_0x30eaab(0x21d)],_0x30eaab(0x1e9));const _0xd37176=getConsoleNextUrl(_0x4336fc[_0x30eaab(0x1aa)],_0x30eaab(0x1bd)+_0x1d5dae[_0x30eaab(0x1d0)]+_0x30eaab(0x1e4)+_0x1d5dae[_0x30eaab(0x20e)]);return console[_0x30eaab(0x226)](a32_0x546a13[_0x30eaab(0x203)]('✔')+_0x30eaab(0x1d5)+a32_0x546a13['cyan'](_0xd37176)),openBrowser(_0xd37176),0x0;}if(_0x1d5dae[_0x30eaab(0x1f0)]===_0x30eaab(0x225)){if(!_0x1d5dae['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x30eaab(0x246));const _0x10e017=await withSpinner('Fetching\x20folder\x20details...',()=>_0x3ba8e9[_0x30eaab(0x1d3)]['getFolder'](_0x1d5dae[_0x30eaab(0x1dd)]),{'verbose':_0x4336fc[_0x30eaab(0x211)]});await handleSingleObjectOutput(_0x10e017['data'],_0x4336fc);}else{if(_0x1d5dae[_0x30eaab(0x1f0)]===_0x30eaab(0x1d3)){if(!_0x1d5dae[_0x30eaab(0x20e)])throw new SDKError(ErrorCode[_0x30eaab(0x21d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x51d675=await withSpinner(_0x30eaab(0x239),()=>_0x3ba8e9['segment'][_0x30eaab(0x243)](_0x1d5dae['parentId'],_0x1d5dae['segmentId']),{'verbose':_0x4336fc[_0x30eaab(0x211)]}),_0x173bf9=getConsoleNextUrl(_0x4336fc[_0x30eaab(0x1aa)],_0x30eaab(0x1bd)+_0x1d5dae['parentId']+_0x30eaab(0x1e4)+_0x1d5dae['segmentId']),_0x547e96=_0x51d675[_0x30eaab(0x1ee)];_0x547e96[_0x30eaab(0x1ce)]=_0x173bf9,await handleSingleObjectOutput(_0x547e96,_0x4336fc);}else return console[_0x30eaab(0x226)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x30eaab(0x226)](_0x30eaab(0x21c)),0x1;}return 0x0;}catch(_0x303578){if(_0x303578 instanceof SDKError)return console[_0x30eaab(0x226)](_0x30eaab(0x1e6)+_0x303578[_0x30eaab(0x1df)]),_0x303578['cause']&&console[_0x30eaab(0x226)]('\x20\x20Cause:\x20'+_0x303578['cause']),0x1;throw _0x303578;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a32_0x27ec5a(0x202);['description']=a32_0x27ec5a(0x22c);async[a32_0x27ec5a(0x1ef)](_0x57b0ef){const _0xd5cc2f=a32_0x27ec5a,{options:_0x3553fb,args:_0x4093e9,tdx:_0x3a9392}=_0x57b0ef,_0x461989=_0x4093e9[0x0];if(!_0x461989)return console[_0xd5cc2f(0x226)](_0xd5cc2f(0x1fc)),console[_0xd5cc2f(0x226)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0xd5cc2f(0x1e1)),console[_0xd5cc2f(0x226)](_0xd5cc2f(0x23b)),console[_0xd5cc2f(0x226)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0xd5cc2f(0x226)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2aa3af=_0x3553fb[_0xd5cc2f(0x1c3)],_0x211754=resolveSegmentTarget(_0x461989,_0x2aa3af,_0x3553fb[_0xd5cc2f(0x211)]);_0x3553fb[_0xd5cc2f(0x211)]&&console[_0xd5cc2f(0x226)](_0xd5cc2f(0x21b)+_0x211754);const _0x163dfe=await withSpinner(_0xd5cc2f(0x23d)+_0x461989+_0xd5cc2f(0x1ba),()=>_0x3a9392[_0xd5cc2f(0x1d3)]['resolvePathToResource'](_0x211754),{'verbose':_0x3553fb[_0xd5cc2f(0x211)]}),_0x143f4e=_0x163dfe[_0xd5cc2f(0x1ee)];_0x3553fb[_0xd5cc2f(0x211)]&&(console[_0xd5cc2f(0x226)](_0xd5cc2f(0x220)+_0x143f4e[_0xd5cc2f(0x1f0)]),console[_0xd5cc2f(0x226)](_0xd5cc2f(0x1e7)+_0x143f4e[_0xd5cc2f(0x1d0)]));if(_0x143f4e['type']===_0xd5cc2f(0x225))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0xd5cc2f(0x226)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x143f4e[_0xd5cc2f(0x1f0)]==='parent')return console[_0xd5cc2f(0x226)](_0xd5cc2f(0x1f9)),console[_0xd5cc2f(0x226)](_0xd5cc2f(0x1e5)),0x1;if(!_0x143f4e['segmentId'])throw new SDKError(ErrorCode[_0xd5cc2f(0x21d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5b9851=await withSpinner(_0xd5cc2f(0x20b),()=>_0x3a9392[_0xd5cc2f(0x1d3)][_0xd5cc2f(0x1b9)](_0x143f4e[_0xd5cc2f(0x1d0)],_0x143f4e[_0xd5cc2f(0x20e)]),{'verbose':_0x3553fb[_0xd5cc2f(0x211)]}),_0x39fa0e=_0x5b9851[_0xd5cc2f(0x1ee)],_0x46b453=await executeSchemaQuery(_0x39fa0e,_0x3a9392,_0x3553fb);return await handleQueryOutput(_0x46b453,_0x3553fb),0x0;}catch(_0x4b87f5){if(_0x4b87f5 instanceof SDKError)return console['error'](_0xd5cc2f(0x1e6)+_0x4b87f5[_0xd5cc2f(0x1df)]),_0x4b87f5['cause']&&console[_0xd5cc2f(0x226)]('\x20\x20Cause:\x20'+_0x4b87f5[_0xd5cc2f(0x234)]),0x1;throw _0x4b87f5;}}}function a32_0x5142(){const _0x3a6d6b=['Resolving\x20parent\x20folder\x20\x27','2644496UsqIMp','toLocaleString','Fetching\x20folder\x20\x27','✖\x20Query\x20failed\x20[','Fetching\x20folder\x20details...','\x20\x20Full\x20path:\x20','folderId','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','message','\x20folder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20show\x20<name>','query','/e/','Use:\x20tdx\x20ps\x20desc','Error:\x20','Parent\x20ID:\x20','length','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:show','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','171PSoazu','data','execute','type','964xaksYg','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','967486XlNNSw','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','jsonl','resolvePathToResource','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','576328OIdMOi','Site:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','replace','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment:desc','green','jobId','segmentName','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Parent\x20segment\x20name\x20is\x20required','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','3398190hXVIYo','Parent\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Folder\x20ID:\x20','segmentId','\x20[Job\x20ID:\x20','segment:folder:list','verbose','SELECT\x20*\x20FROM\x20(\x0a','folderPath','getParent','Segment\x20ID:\x20','in\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20Folder\x20path:\x20','\x20\x20Cause:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Target\x20path:\x20','Use:\x20tdx\x20ps\x20view','SEGMENT_NOT_FOUND','1266090RaWuiv','367392CmkujF','Resolved\x20type:\x20','Resolving\x20folder\x20\x27','segment:describe','Resolved\x20YAML\x20file:\x20','Options:','folder','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Show\x20segment\x20folder\x20details','segment:view','Show\x20segment\x20or\x20folder\x20details','Fetching\x20parent\x20segment\x20details...','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','segmentPath','Executing\x20segment\x20query...','createFolder','✔\x20Found\x20','Creating\x20folder\x20\x27','cause','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Show\x20folder\x20or\x20child\x20segment\x20details','resolveFolderId','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20segment\x20details...','format','Examples:','segment:sql','Resolving\x20\x27','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','log','Resolving\x20parent\x20segment\x20\x27','resolveParentId','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','getSegment','name','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folder\x20ID\x20missing\x20from\x20resolved\x20path','7011TqFuOD','site','Resolved\x20parent\x20folder\x20ID:\x20','parent','setJobId','\x20\x20Parent\x20segment:\x20','json','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','7cWoWbk','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','listFolders','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Get\x20SQL\x20query\x20for\x20child\x20segment','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','getSegmentSQL','\x27...','Usage:\x20tdx\x20sg\x20sql\x20<name>','Parent\x20segment:\x20','/app/ps/','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','INVALID_ARGUMENT','stats','✔\x20Query\x20completed:\x20Processed\x20','parentSegment','information_schema','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','(root)','trim','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Resolved\x20parent\x20ID:\x20','processedRows','includes','url','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','parentId','fullPath','Resolving\x20path\x20\x27','segment','description','\x20Opening\x20'];a32_0x5142=function(){return _0x3a6d6b;};return a32_0x5142();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x3fb34a=a33_0x41af;(function(_0x24c59d,_0x57a374){const _0x442962=a33_0x41af,_0x54b82a=_0x24c59d();while(!![]){try{const _0x3c1df3=parseInt(_0x442962(0x17d))/0x1*(parseInt(_0x442962(0x177))/0x2)+parseInt(_0x442962(0x172))/0x3*(parseInt(_0x442962(0x17b))/0x4)+parseInt(_0x442962(0x186))/0x5*(-parseInt(_0x442962(0x157))/0x6)+parseInt(_0x442962(0x178))/0x7*(parseInt(_0x442962(0x15c))/0x8)+parseInt(_0x442962(0x188))/0x9*(-parseInt(_0x442962(0x162))/0xa)+-parseInt(_0x442962(0x15f))/0xb+-parseInt(_0x442962(0x165))/0xc;if(_0x3c1df3===_0x57a374)break;else _0x54b82a['push'](_0x54b82a['shift']());}catch(_0x387c19){_0x54b82a['push'](_0x54b82a['shift']());}}}(a33_0x2ee2,0x91aa7));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x2ee2(){const _0xdbc745=['\x27...','folder','369rTVzIA','data','createSegment','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Create\x20child\x20segment\x20with\x20filtering\x20rules','411124YlNrGz','42mImmgr','length','rule','5812lKcygv','Target\x20path:\x20','5Ycxydw','Examples:','name','Resolving\x20parent\x20segment\x20\x27','execute','segments','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','parent','type','30VUGaLy','\x27\x20with\x20ID:\x20','18pXRtYV','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','ruleFile','82674ZxuyVA','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent\x20path:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','1446488kgYJWN','error','verbose','3784990wfrYHL','site','kind','4453340NgYrHG','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','resolveParentId','4527792tEFcnE','noCountPopulation','Parent:\x20','yellow','Resolving\x20folder\x20path\x20\x27','segmentPath','Creating\x20segment\x20\x27','segment','description','segment:create','folderId'];a33_0x2ee2=function(){return _0xdbc745;};return a33_0x2ee2();}function a33_0x41af(_0x457334,_0x279b23){_0x457334=_0x457334-0x157;const _0x2ee285=a33_0x2ee2();let _0x41aff8=_0x2ee285[_0x457334];return _0x41aff8;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x282043 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a33_0x3fb34a(0x16e);[a33_0x3fb34a(0x16d)]=a33_0x3fb34a(0x176);async[a33_0x3fb34a(0x181)](_0x17ac7b){const _0x33f85c=a33_0x3fb34a;console[_0x33f85c(0x15d)](a33_0x282043[_0x33f85c(0x168)](_0x33f85c(0x183))),console[_0x33f85c(0x15d)](a33_0x282043[_0x33f85c(0x168)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x4968f7,args:_0x32edc8,tdx:_0xc737d1}=_0x17ac7b,_0x3d5ae9=_0x4968f7;if(_0x32edc8['length']===0x0)return console['error'](_0x33f85c(0x15a)),console[_0x33f85c(0x15d)](_0x33f85c(0x163)),console[_0x33f85c(0x15d)](_0x33f85c(0x17e)),console[_0x33f85c(0x15d)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x33f85c(0x15d)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x33f85c(0x15d)](_0x33f85c(0x158)),0x1;const _0x2263f0=_0x32edc8[0x0],_0x3e737b=_0x4968f7[_0x33f85c(0x16a)];let _0x198998=_0x2263f0;_0x3e737b&&!_0x2263f0['includes']('/')&&(_0x198998=_0x3e737b+'/'+_0x2263f0,_0x3d5ae9[_0x33f85c(0x15e)]&&console[_0x33f85c(0x15d)](_0x33f85c(0x18a)+_0x198998));const _0x251404=parsePath(_0x198998);if(_0x251404[_0x33f85c(0x182)][_0x33f85c(0x179)]<0x2)return console[_0x33f85c(0x15d)](_0x33f85c(0x175)),console[_0x33f85c(0x15d)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0xabb2c7=_0x251404[_0x33f85c(0x182)][0x0],_0x4b6fd1=getBaseName(_0x198998),_0x40f90f=getParentPath(_0x198998);_0x3d5ae9[_0x33f85c(0x15e)]&&(console[_0x33f85c(0x15d)]('Site:\x20'+_0x3d5ae9[_0x33f85c(0x160)]),console['error'](_0x33f85c(0x17c)+_0x198998),console[_0x33f85c(0x15d)](_0x33f85c(0x167)+_0xabb2c7),console['error']('Segment\x20name:\x20'+_0x4b6fd1),console['error'](_0x33f85c(0x159)+_0x40f90f));const _0x326a3a=await withSpinner(_0x33f85c(0x180)+_0xabb2c7+_0x33f85c(0x170),()=>_0xc737d1[_0x33f85c(0x16c)][_0x33f85c(0x164)](_0xabb2c7),{'verbose':_0x3d5ae9['verbose']}),_0x1a66c5=_0x326a3a[_0x33f85c(0x173)];let _0x55954d;if(_0x251404[_0x33f85c(0x182)][_0x33f85c(0x179)]>0x2){const _0x3ba22f=await withSpinner(_0x33f85c(0x169)+_0x40f90f+_0x33f85c(0x170),()=>_0xc737d1['segment'][_0x33f85c(0x189)](_0x40f90f),{'verbose':_0x3d5ae9[_0x33f85c(0x15e)]}),_0x29ae7d=_0x3ba22f[_0x33f85c(0x173)];if(_0x29ae7d[_0x33f85c(0x185)]!==_0x33f85c(0x171)&&_0x29ae7d[_0x33f85c(0x185)]!==_0x33f85c(0x184))return console[_0x33f85c(0x15d)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x55954d=_0x29ae7d[_0x33f85c(0x16f)];}else{if(_0x3d5ae9[_0x33f85c(0x171)]){const _0x2ebb8c=await withSpinner('Resolving\x20folder\x20\x27'+_0x3d5ae9['folder']+_0x33f85c(0x170),()=>_0xc737d1[_0x33f85c(0x16c)]['resolveFolderId'](_0x1a66c5,_0x3d5ae9[_0x33f85c(0x171)]),{'verbose':_0x3d5ae9[_0x33f85c(0x15e)]});_0x55954d=_0x2ebb8c[_0x33f85c(0x173)];}}_0x3d5ae9['verbose']&&_0x55954d&&console[_0x33f85c(0x15d)](_0x33f85c(0x15b)+_0x55954d);const _0x24c0ad=await loadJSONFromOptions(_0x3d5ae9[_0x33f85c(0x17a)],_0x3d5ae9[_0x33f85c(0x18b)]),_0x3d7c94={'name':_0x4b6fd1,'description':_0x3d5ae9[_0x33f85c(0x16d)],'rule':_0x24c0ad,'kind':_0x3d5ae9[_0x33f85c(0x161)]!==undefined?parseInt(_0x3d5ae9[_0x33f85c(0x161)],0xa):undefined,'isVisible':_0x3d5ae9['invisible']?![]:undefined,'segmentFolderId':_0x55954d,'countPopulation':_0x3d5ae9[_0x33f85c(0x166)]?![]:undefined},_0x1bd0f3=await withSpinner(_0x33f85c(0x16b)+_0x4b6fd1+'\x27...',()=>_0xc737d1[_0x33f85c(0x16c)][_0x33f85c(0x174)](_0x1a66c5,_0x3d7c94),{'verbose':_0x3d5ae9[_0x33f85c(0x15e)]}),_0x3ea105=_0x1bd0f3[_0x33f85c(0x173)];return console[_0x33f85c(0x15d)]('✔\x20Created\x20segment\x20\x27'+_0x3ea105[_0x33f85c(0x17f)]+_0x33f85c(0x187)+_0x3ea105['id']),_0x198998!==_0x2263f0&&console[_0x33f85c(0x15d)]('\x20\x20\x20Path:\x20'+_0x198998),await handleSDKOutput([_0x3ea105],_0x3d5ae9),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a34_0x2afb(_0x3db123,_0x16843b){_0x3db123=_0x3db123-0x97;const _0x318820=a34_0x3188();let _0x2afb3e=_0x318820[_0x3db123];return _0x2afb3e;}const a34_0x5e81f8=a34_0x2afb;(function(_0x413bdf,_0xe30feb){const _0x4c80da=a34_0x2afb,_0x35e18f=_0x413bdf();while(!![]){try{const _0xb3c783=parseInt(_0x4c80da(0x9c))/0x1+-parseInt(_0x4c80da(0x9e))/0x2+parseInt(_0x4c80da(0x9b))/0x3+parseInt(_0x4c80da(0xa2))/0x4*(parseInt(_0x4c80da(0x98))/0x5)+-parseInt(_0x4c80da(0xb1))/0x6+-parseInt(_0x4c80da(0xad))/0x7+parseInt(_0x4c80da(0xa7))/0x8*(parseInt(_0x4c80da(0xa9))/0x9);if(_0xb3c783===_0xe30feb)break;else _0x35e18f['push'](_0x35e18f['shift']());}catch(_0x3574b7){_0x35e18f['push'](_0x35e18f['shift']());}}}(a34_0x3188,0x20389));function a34_0x3188(){const _0x5d11df=['verbose','1309238Ehozmy','segment:fields','error','name','416838dBGWRp','execute','List\x20available\x20fields\x20for\x20segmentation','15YlvFYv','parentSegment','listFields','29808tdvNiz','178305vIAdlR','Error:\x20Parent\x20segment\x20name\x20is\x20required','77578UnUHww','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Listing\x20fields\x20for\x20\x27','\x27...','92756PJWXEB','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','length','json','8yClCFM','✔\x20Found\x20','1525185rmXnOz','segment','site'];a34_0x3188=function(){return _0x5d11df;};return a34_0x3188();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a34_0x5e81f8(0xb0)]=a34_0x5e81f8(0xae);['description']=a34_0x5e81f8(0x97);async[a34_0x5e81f8(0xb2)](_0x5aef12){const _0x229fd8=a34_0x5e81f8,{options:_0x2e5fd4,args:_0x43c4d4,tdx:_0x1db0b6}=_0x5aef12,_0x1b9169=_0x43c4d4[0x0]||_0x2e5fd4[_0x229fd8(0x99)];if(!_0x1b9169)return console[_0x229fd8(0xaf)](_0x229fd8(0x9d)),console['error'](_0x229fd8(0xa4)),console[_0x229fd8(0xaf)](_0x229fd8(0x9f)),0x1;_0x2e5fd4[_0x229fd8(0xac)]&&(console[_0x229fd8(0xaf)]('Site:\x20'+_0x2e5fd4[_0x229fd8(0xab)]),console['error'](_0x229fd8(0xa3)+_0x1b9169));const _0x2374be=await withSpinner(_0x229fd8(0xa0)+_0x1b9169+_0x229fd8(0xa1),()=>_0x1db0b6[_0x229fd8(0xaa)][_0x229fd8(0x9a)](_0x1b9169),{'verbose':_0x2e5fd4[_0x229fd8(0xac)]}),_0x3efcd0=_0x2374be['data'];console[_0x229fd8(0xaf)](_0x229fd8(0xa8)+_0x3efcd0[_0x229fd8(0xa5)]+'\x20field'+(_0x3efcd0[_0x229fd8(0xa5)]!==0x1?'s':''));if(_0x2e5fd4[_0x229fd8(0xa6)]||_0x2e5fd4['jsonl'])return await handleSDKOutput(_0x3efcd0,_0x2e5fd4),0x0;return displayFieldsHumanReadable(_0x3efcd0,_0x1b9169),0x0;}}
|