@treasuredata/tdx 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +1 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts +3 -4
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/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/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.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/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +2 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +86 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -0
- package/dist/proxy/passthrough-server.js +1 -0
- package/dist/proxy/passthrough-server.js.map +1 -0
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +99 -0
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -0
- package/dist/proxy/sse-usage-parser.js +1 -0
- package/dist/proxy/sse-usage-parser.js.map +1 -0
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +5 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.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-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x106a0d=a21_0x1807;(function(_0x24c54a,_0xc1c49c){const _0x5c2d02=a21_0x1807,_0x5f203f=_0x24c54a();while(!![]){try{const _0x55d9fb=parseInt(_0x5c2d02(0x242))/0x1+-parseInt(_0x5c2d02(0x214))/0x2*(parseInt(_0x5c2d02(0x2d2))/0x3)+parseInt(_0x5c2d02(0x2cf))/0x4+-parseInt(_0x5c2d02(0x202))/0x5+-parseInt(_0x5c2d02(0x2e2))/0x6*(parseInt(_0x5c2d02(0x2bf))/0x7)+parseInt(_0x5c2d02(0x227))/0x8+parseInt(_0x5c2d02(0x274))/0x9;if(_0x55d9fb===_0xc1c49c)break;else _0x5f203f['push'](_0x5f203f['shift']());}catch(_0x4f18f9){_0x5f203f['push'](_0x5f203f['shift']());}}}(a21_0x46e0,0x616cb));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0xa509c0 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';function a21_0x46e0(){const _0x1766f6=['Listing\x20parent\x20segments\x20matching\x20\x27','parent_segments','Listing\x20fields\x20for\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','resolveParentId','✔\x20Updated\x20parent\x20segment\x20\x27','darwin','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Validating\x20configuration...','yellow','displaySummary','dirname','parent_segment','addAttributes','setJobId','replace','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20kill','Error:','updateParent','varchar','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','/sessions/','validateParentYaml','\x20parent\x20segment\x20\x27','\x20is\x20already\x20up\x20to\x20date','parentSegment','%)\x20','output','/\x20→\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','joinKey','Error\x20parsing\x20YAML:\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Show\x20parent\x20segment\x20schema\x20(column\x20types)','isDirectory','length','segment:parent:sql','/app/dw/parentSegments/','workflowSessionId','sampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','customerGroupFile','Customers:','toFixed','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','segment:parent:show','trim','3573720IaLSpp','Error:\x20File\x20not\x20found:\x20','Creating','Errors:','✔\x20Renamed\x20directory\x20to\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Site:\x20','Validate:','string','match','columns','\x20Opening\x20','open','getParentSQL','\x5c$&','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--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x20=\x20','1040186sssWvf','label','customerPercent','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Behaviors','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','elapsedTimeMillis','all','coveragePercent','stop','addAttributesFile','json','Fetching\x20sample\x20data...','jobId','Error:\x20--database\x20and\x20--table\x20are\x20required','/\x20directory.\x0a','errors','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','3802864Rjstro','✔\x20Found\x20','✔\x20No\x20changes\x20-\x20\x27','behaviors','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error\x20reading\x20file:\x20','matchedCount','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Fetching\x20parent\x20segment\x20\x27','audienceId','text','\x20field','scheduleType','information_schema','utf-8','in\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','attribute','To\x20cancel:','Updated','-1d','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Resolving\x20parent\x20segment\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','/attempt/','run','551957IhAgur','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','schemaValid','column','Found\x20YAML\x20file:\x20','.yaml','web','Available\x20attributes:','Show\x20parent\x20segment\x20details','site','map','population','error','listParents','displayColumns','jsonl','repeat','Join\x20on:','\x27\x20is\x20already\x20up\x20to\x20date','\x20rows)','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Join:','localeCompare','/app/workflows/','pushParentYaml','preview','Analyzing\x20changes...','Available\x20behaviors:','Master\x20+\x20Attributes','join','segment','yes','Attempt:','👥\x20','\x20No\x20changes\x20-\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','Behavior:','Session:','/\x20and\x20','previewParentYaml','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20--behavior\x20\x22<name>\x22','apply','displayMasterInfo','\x0aUsage:\x20tdx\x20ps\x20preview\x20','workflowId','List\x20parent\x20segments','segment:parent:validate','segment:parent:pull','endsWith','4202667JEtOcc','Enriched:','enriched','Rows:','processedRows','sort','getParentFull','\x0aNo\x20sample\x20data\x20available','To\x20view\x20sample\x20data:','master','customerGroup','bold','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','double','cyan','Fetching\x20SQL\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Preview:','data','toLocaleString','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','✔\x20Created\x20parent\x20segment\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Aborted.','segment:parent:create','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','using\x20the\x20default\x20path:\x20','\x27...','use','workflowAttemptId','Fetching\x20current\x20configuration\x20for\x20\x27','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','behaviorsFile','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','log','rowCount','/{name}.yml\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','tdx\x20segment\x20parent\x20preview\x20','\x0a⚠️\x20\x20Migrating:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Coverage:','totalEvents','Apply\x20changes\x20to\x20\x27','number','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','schemaError','Create\x20parent\x20segment\x20\x27','\x20\x20\x20\x20-\x20','.yml','displayPreviewHints','segment:parent:update','test','verbose','green','\x20--attribute\x20\x22<name>\x22','✔\x20Query\x20completed:\x20Processed\x20','segment:parent:push','displaySampleData','createParent','platform','Parent\x20segment:\x20','Listing\x20parent\x20segments...','format','timezone','Error:\x20--behavior\x20requires\x20a\x20name\x0a','723506CwVAQb','/\x20directories\x20exist.','unref','displayAttributesStats','\x0aChanges\x20to\x20\x27','dim','\x20Context\x20set:\x20','Audience\x20ID:','segment:parent:list','interval','listFields','\x27\x20is\x20up\x20to\x20date','runParent','foreignKey','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','xdg-open','971872NqlOgu','keys','\x27\x20and\x20run\x20workflow?','3bXEWPS','red','table','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','execute','\x20Configuration\x20is\x20valid','attributesFile','SELECT\x20*\x20FROM\x20(\x0a','name','pullParentYaml','Source:','\x0a⚠️\x20\x20Both\x20','query','database','displayPreviewResults','6PWRGhw','Status:','displayBehaviorsStats','✘\x20Failed\x20to\x20rename\x20directory:\x20','description','message','start','behavior','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Executing\x20parent\x20segment\x20query...','addBehaviors','displayValidateResults','\x20tdx\x20wf\x20attempt\x20','scheduleOption','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Overwrite\x20\x27','YAML\x20file:\x20','attributes','segment:parent:view','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x20--attribute\x20\x22','\x20parent\x20segment','Events:','Options:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','filter','allValid','Updating','stats'];a21_0x46e0=function(){return _0x1766f6;};return a21_0x46e0();}import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a21_0x301366 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a21_0x106a0d(0x301),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x5ab562){const _0x5d4bdf=a21_0x106a0d,_0x224b29=process[_0x5d4bdf(0x2b9)],_0x16e2cd=_0x224b29===_0x5d4bdf(0x306)?_0x5d4bdf(0x20e):_0x224b29==='win32'?_0x5d4bdf(0x2e8):_0x5d4bdf(0x2ce);spawn(_0x16e2cd,[_0x5ab562],{'detached':!![],'stdio':'ignore'})[_0x5d4bdf(0x2c1)]();}function migrateLegacyDirectory(){const _0xc3b8e0=a21_0x106a0d;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x26ea83=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x26ea83[_0xc3b8e0(0x1f5)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a21_0x301366[_0xc3b8e0(0x309)](_0xc3b8e0(0x2de)+LEGACY_PARENT_SEGMENT_DIR+_0xc3b8e0(0x268)+PARENT_SEGMENT_DIR+_0xc3b8e0(0x2c0))),console[_0xc3b8e0(0x24e)](a21_0x301366[_0xc3b8e0(0x2c4)](_0xc3b8e0(0x207)+LEGACY_PARENT_SEGMENT_DIR+_0xc3b8e0(0x224))),![];console['error'](a21_0x301366[_0xc3b8e0(0x309)](_0xc3b8e0(0x2a0)+LEGACY_PARENT_SEGMENT_DIR+_0xc3b8e0(0x1ef)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xc3b8e0(0x24e)](a21_0x301366[_0xc3b8e0(0x2b3)](_0xc3b8e0(0x206)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x785301){const _0x2f62b3=_0x785301 instanceof Error?_0x785301[_0xc3b8e0(0x2e7)]:String(_0x785301);return console[_0xc3b8e0(0x24e)](a21_0x301366[_0xc3b8e0(0x2d3)](_0xc3b8e0(0x2e5)+_0x2f62b3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0x106a0d(0x241)](_0x391207){const _0x4b8f2a=a21_0x106a0d;return migrateLegacyDirectory(),super[_0x4b8f2a(0x241)](_0x391207);}}function resolveYamlFile(_0x4f7804){const _0x496f81=a21_0x106a0d;if(_0x4f7804[_0x496f81(0x273)](_0x496f81(0x2ae))||_0x4f7804[_0x496f81(0x273)](_0x496f81(0x247)))return _0x4f7804;return a21_0xa509c0[_0x496f81(0x25f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4f7804)+_0x496f81(0x2ae));}function formatProgressMessage(_0x3a7429){const _0x1c4ccd=a21_0x106a0d,_0x62a55a=_0x3a7429[_0x1c4ccd(0x20b)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x62a55a){const [,_0x113c6b,_0x4682cd,_0x15ee96='']=_0x62a55a;return a21_0x301366[_0x1c4ccd(0x2c4)](_0x113c6b+':')+'\x20'+_0x4682cd+a21_0x301366[_0x1c4ccd(0x2c4)](_0x15ee96);}return a21_0x301366[_0x1c4ccd(0x2c4)](_0x3a7429);}function showFileNotFoundError(_0x1c436e,_0x10db46){const _0x2e6709=a21_0x106a0d;console[_0x2e6709(0x24e)](a21_0x301366[_0x2e6709(0x2d3)](_0x2e6709(0x203)+_0x1c436e+'\x0a')),console[_0x2e6709(0x24e)](a21_0x301366[_0x2e6709(0x282)](_0x2e6709(0x1f0)+_0x10db46+_0x2e6709(0x2a9)));}function showParentSegmentNotSetError(_0x589214){const _0x6a4751=a21_0x106a0d;console['error'](a21_0x301366[_0x6a4751(0x309)](_0x6a4751(0x303))),console[_0x6a4751(0x24e)](_0x589214);}function a21_0x1807(_0x3fda62,_0x29be53){_0x3fda62=_0x3fda62-0x1de;const _0x46e0e5=a21_0x46e0();let _0x180771=_0x46e0e5[_0x3fda62];return _0x180771;}export class ParentSegmentListCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x2c7);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x270);async[a21_0x106a0d(0x2d7)](_0x532968){const _0x21837d=a21_0x106a0d,{options:_0x1fdb06,args:_0x1a7cae,tdx:_0x536a6a}=_0x532968,_0x4f6aa8=_0x1a7cae[0x0];_0x1fdb06[_0x21837d(0x2b2)]&&(console[_0x21837d(0x24e)]('Site:\x20'+_0x1fdb06['site']),_0x4f6aa8&&console[_0x21837d(0x24e)]('Pattern:\x20'+_0x4f6aa8));const _0x4860d0=await withSpinner(_0x4f6aa8?_0x21837d(0x300)+_0x4f6aa8+_0x21837d(0x293):_0x21837d(0x2bb),()=>_0x536a6a[_0x21837d(0x260)][_0x21837d(0x24f)](),{'verbose':_0x1fdb06[_0x21837d(0x2b2)]});let _0x38ec47=_0x4860d0[_0x21837d(0x287)];if(_0x4f6aa8){const _0x282c7f=_0x4f6aa8[_0x21837d(0x1e1)](/[.+^${}()|[\]\\]/g,_0x21837d(0x210))[_0x21837d(0x1e1)](/\*/g,'.*')[_0x21837d(0x1e1)](/\?/g,'.'),_0x6e2ff=new RegExp('^'+_0x282c7f+'$','i');_0x38ec47=_0x38ec47[_0x21837d(0x2fc)](_0xe77ef0=>_0x6e2ff[_0x21837d(0x2b1)](_0xe77ef0[_0x21837d(0x2f3)]['name']));}_0x38ec47[_0x21837d(0x279)]((_0x46a078,_0x69a8c0)=>_0x46a078[_0x21837d(0x2f3)]['name'][_0x21837d(0x258)](_0x69a8c0['attributes'][_0x21837d(0x2db)])),console[_0x21837d(0x24e)]('✔\x20Found\x20'+_0x38ec47[_0x21837d(0x1f6)]+_0x21837d(0x2f7)+(_0x38ec47[_0x21837d(0x1f6)]!==0x1?'s':''));const _0x4eeb1e=_0x230f87=>{const _0x3507bc=_0x21837d;return getConsoleNextUrl(_0x1fdb06[_0x3507bc(0x24b)],_0x3507bc(0x1f8)+_0x230f87);};if(_0x1fdb06[_0x21837d(0x2bc)]==='json'||_0x1fdb06[_0x21837d(0x2bc)]===_0x21837d(0x251)){const _0x208eb=_0x38ec47['map'](_0x5c349c=>({..._0x5c349c,'url':_0x4eeb1e(_0x5c349c['id'])}));await handleSDKOutput(_0x208eb,_0x1fdb06);}else{if(_0x38ec47[_0x21837d(0x1f6)]===0x0)_0x4f6aa8?console[_0x21837d(0x29b)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x4f6aa8):console[_0x21837d(0x29b)]('No\x20parent\x20segments\x20found');else for(const _0x2dc71e of _0x38ec47){const _0x41b993=_0x2dc71e[_0x21837d(0x2f3)][_0x21837d(0x24d)]?a21_0x301366[_0x21837d(0x2c4)]('\x20('+formatRows(_0x2dc71e[_0x21837d(0x2f3)][_0x21837d(0x24d)])+')'):'',_0x2006a0=hyperlink(_0x2dc71e[_0x21837d(0x2f3)][_0x21837d(0x2db)],_0x4eeb1e(_0x2dc71e['id']));console[_0x21837d(0x29b)](_0x21837d(0x263)+_0x2006a0+_0x41b993);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x28f);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x29a);async[a21_0x106a0d(0x2d7)](_0x35b00d){const _0x31634b=a21_0x106a0d,{options:_0x51f33a,args:_0x56b9a4,tdx:_0x16bf95}=_0x35b00d;console[_0x31634b(0x24e)](_0x31634b(0x307)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x5848ad=_0x51f33a;if(_0x56b9a4['length']===0x0)return console[_0x31634b(0x24e)](a21_0x301366[_0x31634b(0x2d3)](_0x31634b(0x29e))),console[_0x31634b(0x24e)](_0x31634b(0x285)),0x1;const _0x1922e0=_0x56b9a4[0x0];if(!_0x5848ad['database']||!_0x5848ad[_0x31634b(0x2d4)])return console[_0x31634b(0x24e)](_0x31634b(0x223)),console[_0x31634b(0x24e)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x5848ad[_0x31634b(0x2b2)]&&(console[_0x31634b(0x24e)](_0x31634b(0x208)+_0x5848ad['site']),console['error']('Name:\x20'+_0x1922e0),console['error']('Database:\x20'+_0x5848ad[_0x31634b(0x2e0)]),console[_0x31634b(0x24e)]('Table:\x20'+_0x5848ad[_0x31634b(0x2d4)]));const _0x3ebbdc=await loadJSONFromOptions(_0x5848ad[_0x31634b(0x2f3)],_0x5848ad[_0x31634b(0x2d9)]),_0x591b83=await loadJSONFromOptions(_0x5848ad[_0x31634b(0x22a)],_0x5848ad[_0x31634b(0x299)]),_0x5d1a02=await loadJSONFromOptions(_0x5848ad[_0x31634b(0x27e)],_0x5848ad[_0x31634b(0x1fc)]),_0x4f44bf={'name':_0x1922e0,'description':_0x5848ad['description'],'scheduleType':_0x5848ad[_0x31634b(0x233)],'scheduleOption':_0x5848ad[_0x31634b(0x2ef)],'timezone':_0x5848ad[_0x31634b(0x2bd)],'master':{'parentDatabaseName':_0x5848ad[_0x31634b(0x2e0)],'parentTableName':_0x5848ad[_0x31634b(0x2d4)]},'attributes':_0x3ebbdc,'behaviors':_0x591b83,'customerGroup':_0x5d1a02},_0xd31e36=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x1922e0+_0x31634b(0x293),()=>_0x16bf95[_0x31634b(0x260)][_0x31634b(0x2b8)](_0x4f44bf),{'verbose':_0x51f33a['verbose']}),_0x9a01fc=_0xd31e36[_0x31634b(0x287)];return console[_0x31634b(0x24e)](_0x31634b(0x28c)+_0x9a01fc[_0x31634b(0x2db)]+'\x27\x20with\x20ID:\x20'+_0x9a01fc['id']),await handleSDKOutput([_0x9a01fc],_0x51f33a),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x2b0);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x1f3);async[a21_0x106a0d(0x2d7)](_0x4afa12){const _0x502ddb=a21_0x106a0d,{options:_0x380607,args:_0x34c06c,tdx:_0x4a07db}=_0x4afa12;console[_0x502ddb(0x24e)]('\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'+_0x502ddb(0x2cd));const _0x542581=_0x380607;if(_0x34c06c[_0x502ddb(0x1f6)]===0x0)return console['error'](a21_0x301366[_0x502ddb(0x2d3)](_0x502ddb(0x29e))),console[_0x502ddb(0x24e)](_0x502ddb(0x2fa)),0x1;const _0x4b9201=_0x34c06c[0x0];_0x542581[_0x502ddb(0x2b2)]&&(console['error'](_0x502ddb(0x208)+_0x542581[_0x502ddb(0x24b)]),console[_0x502ddb(0x24e)](_0x502ddb(0x2ba)+_0x4b9201));const _0x4c207b=await withSpinner(_0x502ddb(0x296)+_0x4b9201+'\x27...',()=>_0x4a07db[_0x502ddb(0x260)][_0x502ddb(0x27a)](_0x4b9201),{'verbose':_0x542581[_0x502ddb(0x2b2)]}),_0x262ee3=_0x4c207b['data'],_0xa1ea67=await loadJSONFromOptions(_0x542581[_0x502ddb(0x1df)],_0x542581[_0x502ddb(0x21f)]),_0x3ce206=await loadJSONFromOptions(_0x542581[_0x502ddb(0x2ec)],_0x542581['addBehaviorsFile']),_0x4f3d9f={'name':_0x262ee3[_0x502ddb(0x2db)],'description':_0x542581[_0x502ddb(0x2e6)]!==undefined?_0x542581[_0x502ddb(0x2e6)]:_0x262ee3[_0x502ddb(0x2e6)],'scheduleType':_0x542581[_0x502ddb(0x233)]!==undefined?_0x542581['scheduleType']:_0x262ee3[_0x502ddb(0x233)],'scheduleOption':_0x542581[_0x502ddb(0x2ef)]!==undefined?_0x542581[_0x502ddb(0x2ef)]:_0x262ee3[_0x502ddb(0x2ef)],'timezone':_0x542581['timezone']!==undefined?_0x542581[_0x502ddb(0x2bd)]:_0x262ee3['timezone'],'master':_0x262ee3['master'],'attributes':_0xa1ea67?[..._0x262ee3['attributes']||[],..._0xa1ea67]:_0x262ee3[_0x502ddb(0x2f3)],'behaviors':_0x3ce206?[..._0x262ee3[_0x502ddb(0x22a)]||[],..._0x3ce206]:_0x262ee3[_0x502ddb(0x22a)],'customerGroup':_0x262ee3[_0x502ddb(0x27e)]},_0x32d210=await withSpinner(_0x502ddb(0x297)+_0x4b9201+_0x502ddb(0x293),()=>_0x4a07db[_0x502ddb(0x260)][_0x502ddb(0x1e5)](_0x4b9201,_0x4f3d9f),{'verbose':_0x542581[_0x502ddb(0x2b2)]}),_0x3d238a=_0x32d210['data'];return console[_0x502ddb(0x24e)](_0x502ddb(0x305)+_0x3d238a['name']+'\x27'),await handleSDKOutput([_0x3d238a],_0x542581),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x272);[a21_0x106a0d(0x2e6)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a21_0x106a0d(0x2d7)](_0x5ae186){const _0x483360=a21_0x106a0d,{options:_0x567aac,args:_0x296cbd,tdx:_0x1dfaf6}=_0x5ae186,_0x57dba7=_0x567aac,_0x2656cf=_0x296cbd[0x0]||_0x567aac[_0x483360(0x1ec)];if(!_0x2656cf)return showParentSegmentNotSetError(_0x483360(0x23d)+_0x483360(0x2a2)),0x1;if(_0x57dba7[_0x483360(0x294)]&&_0x57dba7[_0x483360(0x1ee)])return console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2d3)](_0x483360(0x2ea))),console[_0x483360(0x24e)](a21_0x301366['dim'](_0x483360(0x290))),console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2c4)](_0x483360(0x292)+PARENT_SEGMENT_DIR+_0x483360(0x29d))),console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x282)](_0x483360(0x238))),0x1;const _0x51e412=_0x57dba7[_0x483360(0x1ee)]||a21_0xa509c0[_0x483360(0x25f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2656cf)+'.yml');_0x57dba7[_0x483360(0x2b2)]&&(console[_0x483360(0x24e)]('Site:\x20'+_0x57dba7[_0x483360(0x24b)]),console[_0x483360(0x24e)]('Parent\x20segment:\x20'+_0x2656cf),console[_0x483360(0x24e)]('Output\x20file:\x20'+_0x51e412));const _0x803ab6=await withSpinner(_0x483360(0x22f)+_0x2656cf+'\x27...',()=>_0x1dfaf6[_0x483360(0x260)][_0x483360(0x2dc)](_0x2656cf),{'verbose':_0x57dba7['verbose']}),_0x3df178=_0x803ab6[_0x483360(0x287)];if(existsSync(_0x51e412)){const _0x47aac8=readFileSync(_0x51e412,_0x483360(0x235)),_0x4405e3=generateDiff(_0x47aac8,_0x3df178);if(!hasChanges(_0x4405e3))console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2b3)]('✔')+_0x483360(0x264)+a21_0x301366['cyan'](_0x51e412)+_0x483360(0x1eb));else{console[_0x483360(0x24e)](_0x483360(0x2c3)+_0x51e412+'\x27:'),console[_0x483360(0x24e)]('─'[_0x483360(0x252)](0x3c)),console[_0x483360(0x24e)](formatDiffWithColors(_0x4405e3)),console['error']('─'[_0x483360(0x252)](0x3c));if(!_0x57dba7[_0x483360(0x261)]){const _0x4a7a90=await confirmKey(_0x483360(0x2f1)+_0x51e412+'\x27?');if(!_0x4a7a90)return console['error'](_0x483360(0x28e)),0x1;}writeFileSync(_0x51e412,_0x3df178,_0x483360(0x235)),console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2b3)]('✔')+_0x483360(0x2d6)+a21_0x301366[_0x483360(0x282)](_0x51e412));}}else{const _0x1c3299=a21_0xa509c0[_0x483360(0x30b)](_0x51e412);!existsSync(_0x1c3299)&&mkdirSync(_0x1c3299,{'recursive':!![]}),writeFileSync(_0x51e412,_0x3df178,_0x483360(0x235)),console['error'](a21_0x301366[_0x483360(0x2b3)]('✔')+_0x483360(0x2d6)+a21_0x301366[_0x483360(0x282)](_0x51e412));}return saveSessionContext({'parent_segment':_0x2656cf},_0x57dba7['session']),console[_0x483360(0x24e)](a21_0x301366[_0x483360(0x2b3)]('✔')+_0x483360(0x2c5)+a21_0x301366[_0x483360(0x2c4)](_0x483360(0x1de))+_0x483360(0x213)+a21_0x301366[_0x483360(0x282)](_0x2656cf)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x2b6);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x280);async[a21_0x106a0d(0x2d7)](_0x494f0a){const _0x1a4b30=a21_0x106a0d,{options:_0x4443ee,args:_0x3f6266,tdx:_0x2afbae}=_0x494f0a,_0x155e4e=_0x4443ee,_0x57fe7b=_0x3f6266[0x0]||_0x4443ee[_0x1a4b30(0x1ec)];if(!_0x57fe7b)return showParentSegmentNotSetError(_0x1a4b30(0x217)+_0x1a4b30(0x1fb)),0x1;const _0x312e2c=resolveYamlFile(_0x57fe7b);if(!existsSync(_0x312e2c))return showFileNotFoundError(_0x312e2c,_0x57fe7b),0x1;_0x155e4e['verbose']&&(console['error'](_0x1a4b30(0x208)+_0x155e4e[_0x1a4b30(0x24b)]),console[_0x1a4b30(0x24e)]('YAML\x20file:\x20'+_0x312e2c));let _0x53bd39;try{_0x53bd39=readFileSync(_0x312e2c,_0x1a4b30(0x235));}catch(_0x4c4112){const _0x41e2a3=_0x4c4112 instanceof Error?_0x4c4112[_0x1a4b30(0x2e7)]:String(_0x4c4112);return console[_0x1a4b30(0x24e)](_0x1a4b30(0x22c)+_0x41e2a3),0x1;}const _0x98f45c=await withSpinner(_0x1a4b30(0x25c),()=>_0x2afbae[_0x1a4b30(0x260)]['pushParentYaml'](_0x53bd39),{'verbose':_0x155e4e[_0x1a4b30(0x2b2)]}),_0x1a8739=_0x98f45c[_0x1a4b30(0x287)],{isNew:_0x34bee1,name:_0x7b966e,hasChanges:_0x2d4b1b,diffFormatted:_0x391470}=_0x1a8739;if(!_0x2d4b1b)return console['error'](_0x1a4b30(0x229)+_0x7b966e+_0x1a4b30(0x254)),0x0;_0x34bee1?console[_0x1a4b30(0x24e)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x7b966e+'\x27:'):console[_0x1a4b30(0x24e)](_0x1a4b30(0x289)+_0x7b966e+'\x27:');console['error']('─'[_0x1a4b30(0x252)](0x3c)),console['error'](_0x391470),console['error']('─'[_0x1a4b30(0x252)](0x3c));const _0x42a1ec=_0x34bee1?_0x1a4b30(0x2ac)+_0x7b966e+'\x27?':_0x1a4b30(0x2a7)+_0x7b966e+'\x27?';if(!_0x155e4e['yes']){const _0x3229af=await confirmKey(_0x42a1ec);if(!_0x3229af)return console['error'](_0x1a4b30(0x28e)),0x1;}const _0x461e6b=_0x34bee1?_0x1a4b30(0x204):'Updating',_0x545a3e=await withSpinner(_0x461e6b+_0x1a4b30(0x1ea)+_0x7b966e+'\x27...',()=>_0x1a8739['apply'](),{'verbose':_0x155e4e[_0x1a4b30(0x2b2)]}),_0x5492f4=_0x545a3e[_0x1a4b30(0x287)],_0x1e2e10=getConsoleNextUrl(_0x155e4e[_0x1a4b30(0x24b)],_0x1a4b30(0x1f8)+_0x5492f4['id']),_0x14ad1b=_0x34bee1?'Created':_0x1a4b30(0x23b);return console[_0x1a4b30(0x24e)]('✔\x20'+_0x14ad1b+'\x20parent\x20segment\x20\x27'+_0x5492f4['name']+'\x27'),console[_0x1a4b30(0x24e)]('\x20\x20'+_0x1e2e10),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x271);[a21_0x106a0d(0x2e6)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async['execute'](_0x279610){const _0x5b3de8=a21_0x106a0d,{options:_0x376d81,args:_0x529451,tdx:_0x1a9921}=_0x279610,_0x674d7e=_0x376d81,_0x1b1965=_0x529451[0x0]||_0x376d81['parentSegment'];if(!_0x1b1965)return showParentSegmentNotSetError(_0x5b3de8(0x28b)+'\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'+_0x5b3de8(0x23f)+_0x5b3de8(0x212)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x353e51=resolveYamlFile(_0x1b1965);if(!existsSync(_0x353e51))return showFileNotFoundError(_0x353e51,_0x1b1965),0x1;_0x674d7e['verbose']&&(console[_0x5b3de8(0x24e)](_0x5b3de8(0x208)+_0x674d7e[_0x5b3de8(0x24b)]),console['error'](_0x5b3de8(0x2f2)+_0x353e51));let _0x3d8982;try{_0x3d8982=readFileSync(_0x353e51,'utf-8');}catch(_0x19e36d){const _0x50231c=_0x19e36d instanceof Error?_0x19e36d[_0x5b3de8(0x2e7)]:String(_0x19e36d);return console[_0x5b3de8(0x24e)]('Error\x20reading\x20file:\x20'+_0x50231c),0x1;}const _0x38cb4e=createCommandSpinner(a21_0x301366['dim'](_0x5b3de8(0x308)),{'verbose':_0x674d7e[_0x5b3de8(0x2b2)]});_0x38cb4e[_0x5b3de8(0x2e8)]();const _0x29e7b6={'onProgress':_0x39199b=>{const _0x3add7b=_0x5b3de8;_0x38cb4e[_0x3add7b(0x231)]=formatProgressMessage(_0x39199b);}};if(_0x674d7e[_0x5b3de8(0x27d)])_0x29e7b6['master']=!![];if(_0x674d7e['enriched'])_0x29e7b6[_0x5b3de8(0x276)]=!![];_0x674d7e[_0x5b3de8(0x239)]&&(_0x29e7b6[_0x5b3de8(0x239)]=_0x674d7e['attribute']);_0x674d7e[_0x5b3de8(0x2e9)]&&(_0x29e7b6['behavior']=_0x674d7e['behavior']);if(_0x674d7e[_0x5b3de8(0x2c8)])_0x29e7b6['interval']=_0x674d7e[_0x5b3de8(0x2c8)];let _0x1dc8da;try{_0x1dc8da=await _0x1a9921[_0x5b3de8(0x260)][_0x5b3de8(0x1e9)](_0x3d8982,_0x29e7b6),_0x38cb4e[_0x5b3de8(0x21e)]();}catch(_0x5bf744){_0x38cb4e['stop']();throw _0x5bf744;}const _0x1b6878=_0x674d7e[_0x5b3de8(0x2c8)]||_0x5b3de8(0x23c);return this[_0x5b3de8(0x2ed)](_0x1dc8da,_0x29e7b6,_0x353e51,_0x1b6878),_0x1dc8da[_0x5b3de8(0x2fd)]?0x0:0x1;}[a21_0x106a0d(0x2ed)](_0x3e066c,_0x4023e8,_0x491146,_0x2a9f1f){const _0x6380b9=a21_0x106a0d;console[_0x6380b9(0x24e)]('\x0a'+a21_0x301366['bold'](_0x6380b9(0x209))+'\x20'+_0x3e066c[_0x6380b9(0x2db)]),console[_0x6380b9(0x24e)]('═'['repeat'](0x3c)),this[_0x6380b9(0x26d)](_0x3e066c);if(typeof _0x4023e8[_0x6380b9(0x239)]===_0x6380b9(0x20a)){this['displayAttributesStats'](_0x3e066c),this[_0x6380b9(0x30a)](_0x3e066c),this[_0x6380b9(0x2af)](_0x491146,_0x2a9f1f,_0x6380b9(0x239),_0x4023e8[_0x6380b9(0x239)]);return;}if(_0x4023e8['attribute']===!![]){this[_0x6380b9(0x2c2)](_0x3e066c),this['displaySummary'](_0x3e066c),this[_0x6380b9(0x2af)](_0x491146,_0x2a9f1f,_0x6380b9(0x2f3));return;}if(typeof _0x4023e8['behavior']===_0x6380b9(0x20a)){this[_0x6380b9(0x2e4)](_0x3e066c,_0x2a9f1f),this[_0x6380b9(0x30a)](_0x3e066c),this[_0x6380b9(0x2af)](_0x491146,_0x2a9f1f,_0x6380b9(0x2e9),_0x4023e8['behavior']);return;}if(_0x4023e8[_0x6380b9(0x2e9)]===!![]){this[_0x6380b9(0x2e4)](_0x3e066c,_0x2a9f1f),this[_0x6380b9(0x30a)](_0x3e066c),this[_0x6380b9(0x2af)](_0x491146,_0x2a9f1f,'behaviors');return;}this[_0x6380b9(0x2c2)](_0x3e066c),this[_0x6380b9(0x2e4)](_0x3e066c,_0x2a9f1f),this[_0x6380b9(0x30a)](_0x3e066c),this['displayPreviewHints'](_0x491146,_0x2a9f1f,_0x6380b9(0x21c));}[a21_0x106a0d(0x2af)](_0x1b5079,_0x354d8b,_0x1db451,_0xcc30ef){const _0xbb0ae1=a21_0x106a0d;console[_0xbb0ae1(0x24e)]('\x0a'+a21_0x301366[_0xbb0ae1(0x2c4)](_0xbb0ae1(0x27c)));const _0x3f4c10=_0x354d8b!==_0xbb0ae1(0x23c)?'\x20--interval\x20'+_0x354d8b:'';if(_0x1db451===_0xbb0ae1(0x239)&&_0xcc30ef)console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366[_0xbb0ae1(0x2c4)](_0xbb0ae1(0x29f)+_0x1b5079+_0xbb0ae1(0x2f6)+_0xcc30ef+'\x22'+_0x3f4c10));else{if(_0x1db451===_0xbb0ae1(0x2e9)&&_0xcc30ef)console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366[_0xbb0ae1(0x2c4)](_0xbb0ae1(0x29f)+_0x1b5079+'\x20--behavior\x20\x22'+_0xcc30ef+'\x22'+_0x3f4c10));else(_0x1db451==='attributes'||_0x1db451===_0xbb0ae1(0x21c))&&console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366['dim'](_0xbb0ae1(0x29f)+_0x1b5079+_0xbb0ae1(0x2b4)+_0x3f4c10));}(_0x1db451===_0xbb0ae1(0x22a)||_0x1db451===_0xbb0ae1(0x21c))&&console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366[_0xbb0ae1(0x2c4)](_0xbb0ae1(0x29f)+_0x1b5079+_0xbb0ae1(0x26b)+_0x3f4c10)),_0x1db451===_0xbb0ae1(0x21c)&&console[_0xbb0ae1(0x24e)]('\x20\x20'+a21_0x301366[_0xbb0ae1(0x2c4)]('tdx\x20segment\x20parent\x20preview\x20'+_0x1b5079+'\x20--enriched'+_0x3f4c10));}['displayMasterInfo'](_0x331c91){const _0x252fad=a21_0x106a0d,{master:_0x136c94}=_0x331c91,_0x4f2c2e=_0x136c94[_0x252fad(0x244)]?a21_0x301366[_0x252fad(0x2b3)]('✔'):a21_0x301366['red']('✘');console[_0x252fad(0x24e)]('\x0a'+a21_0x301366[_0x252fad(0x2c4)]('Master\x20Table')),console['error'](_0x4f2c2e+'\x20'+a21_0x301366['bold'](_0x136c94['database']+'.'+_0x136c94['table'])),_0x136c94[_0x252fad(0x244)]?_0x136c94[_0x252fad(0x29c)]!==undefined&&console['error']('\x20\x20'+a21_0x301366[_0x252fad(0x2c4)](_0x252fad(0x277))+'\x20'+a21_0x301366[_0x252fad(0x282)](formatRows(_0x136c94[_0x252fad(0x29c)]))):console[_0x252fad(0x24e)]('\x20\x20'+a21_0x301366[_0x252fad(0x2d3)]('Error:')+'\x20'+_0x136c94[_0x252fad(0x2ab)]);}[a21_0x106a0d(0x2c2)](_0x3e008b){const _0x17efc4=a21_0x106a0d;if(_0x3e008b[_0x17efc4(0x2f3)][_0x17efc4(0x1f6)]===0x0)return;console[_0x17efc4(0x24e)]('\x0a'+a21_0x301366[_0x17efc4(0x2c4)]('Attributes'));for(const _0x31cd0a of _0x3e008b['attributes']){const _0xffb3bf=_0x31cd0a['schemaValid']?a21_0x301366[_0x17efc4(0x2b3)]('✔'):a21_0x301366[_0x17efc4(0x2d3)]('✘');let _0x3ad7fa='';if(_0x31cd0a[_0x17efc4(0x244)]&&_0x31cd0a[_0x17efc4(0x22d)]!==undefined&&_0x31cd0a['coveragePercent']!==undefined){const _0xc2df83=_0x31cd0a[_0x17efc4(0x21d)][_0x17efc4(0x1fe)](0x1),_0xd49b95=_0x31cd0a['coveragePercent']>=0x50?a21_0x301366[_0x17efc4(0x2b3)]:_0x31cd0a['coveragePercent']>=0x32?a21_0x301366[_0x17efc4(0x309)]:a21_0x301366[_0x17efc4(0x2d3)];_0x3ad7fa='\x20'+a21_0x301366[_0x17efc4(0x2c4)](_0x17efc4(0x2a5))+'\x20'+_0xd49b95(_0xc2df83+'%')+'\x20('+formatRows(_0x31cd0a[_0x17efc4(0x22d)])+_0x17efc4(0x255);}console[_0x17efc4(0x24e)](_0xffb3bf+'\x20'+a21_0x301366[_0x17efc4(0x27f)](_0x31cd0a[_0x17efc4(0x2db)])+_0x3ad7fa),console[_0x17efc4(0x24e)]('\x20\x20'+a21_0x301366[_0x17efc4(0x2c4)](_0x17efc4(0x2dd))+'\x20'+a21_0x301366[_0x17efc4(0x27f)](_0x31cd0a[_0x17efc4(0x2e0)]+'.'+_0x31cd0a[_0x17efc4(0x2d4)]));const _0x557c0b=_0x31cd0a[_0x17efc4(0x1f1)]===_0x31cd0a['foreignKey']?a21_0x301366[_0x17efc4(0x2c4)](_0x17efc4(0x253))+'\x20'+_0x31cd0a[_0x17efc4(0x1f1)]:a21_0x301366['dim'](_0x17efc4(0x257))+'\x20'+_0x31cd0a['joinKey']+_0x17efc4(0x213)+_0x31cd0a[_0x17efc4(0x2cc)];console[_0x17efc4(0x24e)]('\x20\x20'+_0x557c0b),console['error']('\x20\x20'+a21_0x301366[_0x17efc4(0x2c4)]('Columns:')),this[_0x17efc4(0x250)](_0x31cd0a[_0x17efc4(0x20c)]),!_0x31cd0a[_0x17efc4(0x244)]&&console[_0x17efc4(0x24e)]('\x20\x20'+a21_0x301366[_0x17efc4(0x2d3)]('Error:')+'\x20'+_0x31cd0a[_0x17efc4(0x2ab)]);}}[a21_0x106a0d(0x2e4)](_0x51a81f,_0x2e85d9){const _0x1cda81=a21_0x106a0d;if(_0x51a81f[_0x1cda81(0x22a)][_0x1cda81(0x1f6)]===0x0)return;console[_0x1cda81(0x24e)]('\x0a'+a21_0x301366['dim'](_0x1cda81(0x219))+'\x20'+a21_0x301366['dim']('('+_0x2e85d9+')'));for(const _0x4ea462 of _0x51a81f[_0x1cda81(0x22a)]){const _0x42c7ad=_0x4ea462[_0x1cda81(0x244)]?a21_0x301366[_0x1cda81(0x2b3)]('✔'):a21_0x301366['red']('✘');let _0x22a213='';if(_0x4ea462[_0x1cda81(0x244)]&&_0x4ea462['customersWithEvents']!==undefined&&_0x4ea462[_0x1cda81(0x2a6)]!==undefined){const _0x9d328c=_0x4ea462['customerPercent']?.[_0x1cda81(0x1fe)](0x1)||'?',_0x2032e6=(_0x4ea462[_0x1cda81(0x216)]??0x0)>=0x32?a21_0x301366[_0x1cda81(0x2b3)]:(_0x4ea462[_0x1cda81(0x216)]??0x0)>=0x14?a21_0x301366[_0x1cda81(0x309)]:a21_0x301366[_0x1cda81(0x2d3)];_0x22a213='\x20'+a21_0x301366['dim'](_0x1cda81(0x1fd))+'\x20'+_0x2032e6(formatRows(_0x4ea462['customersWithEvents']))+'\x20('+_0x9d328c+_0x1cda81(0x1ed)+a21_0x301366[_0x1cda81(0x2c4)](_0x1cda81(0x2f8))+'\x20'+a21_0x301366['cyan'](formatRows(_0x4ea462[_0x1cda81(0x2a6)]));}console['error'](_0x42c7ad+'\x20'+a21_0x301366['bold'](_0x4ea462[_0x1cda81(0x2db)])+_0x22a213),console[_0x1cda81(0x24e)]('\x20\x20'+a21_0x301366[_0x1cda81(0x2c4)](_0x1cda81(0x2dd))+'\x20'+a21_0x301366[_0x1cda81(0x27f)](_0x4ea462[_0x1cda81(0x2e0)]+'.'+_0x4ea462['table']));const _0x1d92d9=_0x4ea462['joinKey']===_0x4ea462[_0x1cda81(0x2cc)]?a21_0x301366[_0x1cda81(0x2c4)]('Join\x20on:')+'\x20'+_0x4ea462[_0x1cda81(0x1f1)]:a21_0x301366[_0x1cda81(0x2c4)](_0x1cda81(0x257))+'\x20'+_0x4ea462[_0x1cda81(0x1f1)]+'\x20=\x20'+_0x4ea462[_0x1cda81(0x2cc)];console[_0x1cda81(0x24e)]('\x20\x20'+_0x1d92d9),console[_0x1cda81(0x24e)]('\x20\x20'+a21_0x301366[_0x1cda81(0x2c4)]('Columns:')),this['displayColumns'](_0x4ea462['columns']),!_0x4ea462[_0x1cda81(0x244)]&&console[_0x1cda81(0x24e)]('\x20\x20'+a21_0x301366[_0x1cda81(0x2d3)](_0x1cda81(0x1e4))+'\x20'+_0x4ea462[_0x1cda81(0x2ab)]);}}[a21_0x106a0d(0x250)](_0x27d941){const _0x435127=a21_0x106a0d;for(const _0x1777d5 of _0x27d941){_0x1777d5['label']===_0x1777d5[_0x435127(0x245)]||_0x1777d5[_0x435127(0x245)]==='*'?console['error'](_0x435127(0x2ad)+_0x1777d5['label']):console[_0x435127(0x24e)](_0x435127(0x2ad)+_0x1777d5[_0x435127(0x215)]+'\x20'+a21_0x301366[_0x435127(0x2c4)]('('+_0x1777d5[_0x435127(0x245)]+')'));}}[a21_0x106a0d(0x30a)](_0xaf5409){const _0x358e8b=a21_0x106a0d;console[_0x358e8b(0x24e)]('─'['repeat'](0x3c));if(_0xaf5409[_0x358e8b(0x225)]['length']>0x0){console[_0x358e8b(0x24e)]('\x0a'+a21_0x301366['red'](_0x358e8b(0x205)));for(const _0x5d3de5 of _0xaf5409[_0x358e8b(0x225)]){console[_0x358e8b(0x24e)]('\x20\x20'+a21_0x301366[_0x358e8b(0x2d3)]('•')+'\x20'+_0x5d3de5);}}_0xaf5409['allValid']&&console[_0x358e8b(0x24e)]('\x0a'+a21_0x301366[_0x358e8b(0x2b3)]('✔')+_0x358e8b(0x2d8));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']='segment:parent:preview';[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x22e);async['execute'](_0x5d4dea){const _0x4728e3=a21_0x106a0d,{options:_0x7753d3,args:_0x32e4d5,tdx:_0x496524}=_0x5d4dea,_0x3c0f2b=_0x7753d3,_0x595f29=_0x32e4d5[0x0]||_0x7753d3[_0x4728e3(0x1ec)];if(!_0x595f29)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x4728e3(0x2f0)+'Options\x20(one\x20required):\x0a'+_0x4728e3(0x2aa)+_0x4728e3(0x26a)+_0x4728e3(0x1e2)+_0x4728e3(0x256)+_0x4728e3(0x2a3)),0x1;if(!_0x3c0f2b[_0x4728e3(0x27d)]&&!_0x3c0f2b[_0x4728e3(0x239)]&&!_0x3c0f2b['behavior']&&!_0x3c0f2b[_0x4728e3(0x276)])return console[_0x4728e3(0x24e)](a21_0x301366[_0x4728e3(0x2d3)](_0x4728e3(0x1ff))),console[_0x4728e3(0x24e)](_0x4728e3(0x237)),console[_0x4728e3(0x24e)](_0x4728e3(0x2f9)),console[_0x4728e3(0x24e)](_0x4728e3(0x218)),console[_0x4728e3(0x24e)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x4728e3(0x24e)](_0x4728e3(0x243)),console['error'](_0x4728e3(0x1e7)),0x1;const _0x34ed5c=resolveYamlFile(_0x595f29);if(!existsSync(_0x34ed5c))return showFileNotFoundError(_0x34ed5c,_0x595f29),0x1;_0x3c0f2b[_0x4728e3(0x2b2)]&&(console[_0x4728e3(0x24e)](_0x4728e3(0x208)+_0x3c0f2b[_0x4728e3(0x24b)]),console[_0x4728e3(0x24e)](_0x4728e3(0x2f2)+_0x34ed5c));let _0x188cc3;try{_0x188cc3=readFileSync(_0x34ed5c,_0x4728e3(0x235));}catch(_0x347ebb){const _0x21b5fd=_0x347ebb instanceof Error?_0x347ebb[_0x4728e3(0x2e7)]:String(_0x347ebb);return console[_0x4728e3(0x24e)](_0x4728e3(0x22c)+_0x21b5fd),0x1;}let _0x5bf0f6;try{_0x5bf0f6=parseDef(_0x188cc3);}catch(_0x95b62b){const _0x14bc0c=_0x95b62b instanceof Error?_0x95b62b[_0x4728e3(0x2e7)]:String(_0x95b62b);return console[_0x4728e3(0x24e)](a21_0x301366[_0x4728e3(0x2d3)](_0x4728e3(0x1f2)+_0x14bc0c)),0x1;}if(_0x3c0f2b[_0x4728e3(0x239)]===!![]||_0x3c0f2b['attribute']===''){const _0x21f14c=_0x5bf0f6['attributes']?.['map'](_0x267d4f=>_0x267d4f[_0x4728e3(0x2db)])||[];if(_0x21f14c[_0x4728e3(0x1f6)]===0x0)console['error'](a21_0x301366[_0x4728e3(0x2d3)](_0x4728e3(0x21a)));else{console[_0x4728e3(0x24e)](a21_0x301366[_0x4728e3(0x2d3)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x4728e3(0x24e)](_0x4728e3(0x249));for(const _0x3cc9e7 of _0x21f14c){console[_0x4728e3(0x24e)]('\x20\x20'+a21_0x301366[_0x4728e3(0x282)](_0x3cc9e7));}console[_0x4728e3(0x24e)](_0x4728e3(0x26e)+_0x595f29+'\x20--attribute\x20\x22'+_0x21f14c[0x0]+'\x22');}return 0x1;}if(_0x3c0f2b[_0x4728e3(0x2e9)]===!![]||_0x3c0f2b[_0x4728e3(0x2e9)]===''){const _0x160263=_0x5bf0f6['behaviors']?.[_0x4728e3(0x24c)](_0x53ea13=>_0x53ea13[_0x4728e3(0x2db)])||[];if(_0x160263[_0x4728e3(0x1f6)]===0x0)console['error'](a21_0x301366['red'](_0x4728e3(0x2a4)));else{console[_0x4728e3(0x24e)](a21_0x301366[_0x4728e3(0x2d3)](_0x4728e3(0x2be))),console[_0x4728e3(0x24e)](_0x4728e3(0x25d));for(const _0x8ecb2c of _0x160263){console[_0x4728e3(0x24e)]('\x20\x20'+a21_0x301366['cyan'](_0x8ecb2c));}console[_0x4728e3(0x24e)](_0x4728e3(0x26e)+_0x595f29+'\x20--behavior\x20\x22'+_0x160263[0x0]+'\x22');}return 0x1;}const _0x4c569a=createCommandSpinner(a21_0x301366[_0x4728e3(0x2c4)](_0x4728e3(0x221)),{'verbose':_0x3c0f2b[_0x4728e3(0x2b2)]});_0x4c569a['start']();const _0x195cb0={'onProgress':_0x3cbb57=>{const _0x39dff1=_0x4728e3;_0x4c569a[_0x39dff1(0x231)]=formatProgressMessage(_0x3cbb57);}};if(_0x3c0f2b[_0x4728e3(0x27d)])_0x195cb0[_0x4728e3(0x27d)]=!![];if(_0x3c0f2b['attribute']&&typeof _0x3c0f2b[_0x4728e3(0x239)]==='string')_0x195cb0[_0x4728e3(0x239)]=_0x3c0f2b[_0x4728e3(0x239)];if(_0x3c0f2b[_0x4728e3(0x2e9)]&&typeof _0x3c0f2b[_0x4728e3(0x2e9)]===_0x4728e3(0x20a))_0x195cb0[_0x4728e3(0x2e9)]=_0x3c0f2b[_0x4728e3(0x2e9)];if(_0x3c0f2b['enriched'])_0x195cb0[_0x4728e3(0x276)]=!![];if(_0x3c0f2b[_0x4728e3(0x2c8)])_0x195cb0['interval']=_0x3c0f2b[_0x4728e3(0x2c8)];let _0x1646a4;try{_0x1646a4=await _0x496524[_0x4728e3(0x260)][_0x4728e3(0x269)](_0x188cc3,_0x195cb0),_0x4c569a['stop']();}catch(_0x3694ea){_0x4c569a['stop']();throw _0x3694ea;}return await this[_0x4728e3(0x2e1)](_0x1646a4,{'master':_0x3c0f2b[_0x4728e3(0x27d)],'attribute':typeof _0x3c0f2b[_0x4728e3(0x239)]===_0x4728e3(0x20a)?_0x3c0f2b['attribute']:undefined,'behavior':typeof _0x3c0f2b[_0x4728e3(0x2e9)]===_0x4728e3(0x20a)?_0x3c0f2b[_0x4728e3(0x2e9)]:undefined,'enriched':_0x3c0f2b[_0x4728e3(0x276)]}),_0x1646a4['allValid']?0x0:0x1;}async[a21_0x106a0d(0x2e1)](_0x4474e9,_0x55e9d3){const _0x1916b0=a21_0x106a0d;console['error']('\x0a'+a21_0x301366['bold'](_0x1916b0(0x286))+'\x20'+_0x4474e9[_0x1916b0(0x2db)]),console['error']('═'[_0x1916b0(0x252)](0x3c));if(_0x55e9d3['master']&&_0x4474e9[_0x1916b0(0x1fa)]){const _0x4d93a4=a21_0x301366[_0x1916b0(0x2c4)]('Master:')+'\x20'+a21_0x301366[_0x1916b0(0x27f)](_0x4474e9[_0x1916b0(0x27d)]['database']+'.'+_0x4474e9[_0x1916b0(0x27d)][_0x1916b0(0x2d4)]);await this['displaySampleData'](_0x4d93a4,_0x4474e9['sampleData']);}else{if(_0x55e9d3[_0x1916b0(0x239)]&&_0x4474e9['sampleData']){const _0x31bc9b=a21_0x301366[_0x1916b0(0x2c4)]('Attribute:')+'\x20'+a21_0x301366[_0x1916b0(0x27f)](_0x55e9d3[_0x1916b0(0x239)]);await this[_0x1916b0(0x2b7)](_0x31bc9b,_0x4474e9[_0x1916b0(0x1fa)]);}else{if(_0x55e9d3[_0x1916b0(0x2e9)]&&_0x4474e9[_0x1916b0(0x1fa)]){const _0x2cf569=a21_0x301366[_0x1916b0(0x2c4)](_0x1916b0(0x266))+'\x20'+a21_0x301366[_0x1916b0(0x27f)](_0x55e9d3[_0x1916b0(0x2e9)]);await this[_0x1916b0(0x2b7)](_0x2cf569,_0x4474e9[_0x1916b0(0x1fa)]);}else{if(_0x55e9d3[_0x1916b0(0x276)]&&_0x4474e9[_0x1916b0(0x1fa)]){const _0x1f126a=a21_0x301366[_0x1916b0(0x2c4)](_0x1916b0(0x275))+'\x20'+a21_0x301366[_0x1916b0(0x27f)](_0x1916b0(0x25e));await this[_0x1916b0(0x2b7)](_0x1f126a,_0x4474e9[_0x1916b0(0x1fa)]);}else!_0x4474e9[_0x1916b0(0x1fa)]&&console['error'](_0x1916b0(0x27b));}}}if(_0x4474e9['errors'][_0x1916b0(0x1f6)]>0x0){console['error']('─'[_0x1916b0(0x252)](0x3c)),console['error']('\x0a'+a21_0x301366[_0x1916b0(0x2d3)](_0x1916b0(0x205)));for(const _0x5d1cf1 of _0x4474e9[_0x1916b0(0x225)]){console[_0x1916b0(0x24e)]('\x20\x20'+a21_0x301366[_0x1916b0(0x2d3)]('•')+'\x20'+_0x5d1cf1);}}}async[a21_0x106a0d(0x2b7)](_0x49358f,_0x2e266f){const _0x225864=a21_0x106a0d;if(_0x2e266f[_0x225864(0x1f6)]===0x0){console[_0x225864(0x24e)]('\x0a'+_0x49358f),console[_0x225864(0x24e)]('\x20\x20No\x20sample\x20data\x20available');return;}console['error']('\x0a'+_0x49358f);const _0x35a23b=Object[_0x225864(0x2d0)](_0x2e266f[0x0])[_0x225864(0x24c)](_0x244eff=>({'name':_0x244eff,'type':typeof _0x2e266f[0x0][_0x244eff]===_0x225864(0x2a8)?_0x225864(0x281):_0x225864(0x1e6)})),_0x15aecc={'queryId':_0x225864(0x25b),'columns':_0x35a23b,'data':_0x2e266f,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2e266f[_0x225864(0x1f6)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x3344b0=formatAsTable(_0x15aecc,_0x2e266f[_0x225864(0x1f6)],!![]);await writeOutput(_0x3344b0,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']='segment:parent:run';[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x291);async[a21_0x106a0d(0x2d7)](_0x130a21){const _0x12f332=a21_0x106a0d,{options:_0x576825,args:_0x8bbabe,tdx:_0x40e662}=_0x130a21,_0x127faf=_0x576825,_0x26b08f=_0x8bbabe[0x0]||_0x576825[_0x12f332(0x1ec)];if(!_0x26b08f)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x4d49d0=resolveYamlFile(_0x26b08f);if(existsSync(_0x4d49d0)){_0x127faf[_0x12f332(0x2b2)]&&console[_0x12f332(0x24e)](_0x12f332(0x246)+_0x4d49d0);let _0xdca6cf;try{_0xdca6cf=readFileSync(_0x4d49d0,_0x12f332(0x235));}catch(_0x592aa6){const _0x325f3d=_0x592aa6 instanceof Error?_0x592aa6[_0x12f332(0x2e7)]:String(_0x592aa6);return console[_0x12f332(0x24e)](_0x12f332(0x22c)+_0x325f3d),0x1;}const _0x460e4e=await withSpinner('Analyzing\x20changes...',()=>_0x40e662[_0x12f332(0x260)][_0x12f332(0x25a)](_0xdca6cf),{'verbose':_0x127faf[_0x12f332(0x2b2)]}),_0x479cc9=_0x460e4e[_0x12f332(0x287)],{isNew:_0x4a44e2,name:_0xb760f7,hasChanges:_0x14f8f9,diffFormatted:_0x39b284}=_0x479cc9;if(_0x14f8f9){_0x4a44e2?console[_0x12f332(0x24e)]('\x0aNew\x20parent\x20segment\x20\x27'+_0xb760f7+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0xb760f7+'\x27:');console['error']('─'[_0x12f332(0x252)](0x3c)),console['error'](_0x39b284),console[_0x12f332(0x24e)]('─'[_0x12f332(0x252)](0x3c));const _0x433e81=_0x4a44e2?'Create\x20parent\x20segment\x20\x27'+_0xb760f7+_0x12f332(0x2d1):'Apply\x20changes\x20to\x20\x27'+_0xb760f7+'\x27\x20and\x20run\x20workflow?';if(!_0x127faf['yes']){const _0xcf3ed7=await confirmKey(_0x433e81);if(!_0xcf3ed7)return console['error']('Aborted.'),0x1;}const _0x2607ea=_0x4a44e2?_0x12f332(0x204):_0x12f332(0x2fe);await withSpinner(_0x2607ea+_0x12f332(0x1ea)+_0xb760f7+_0x12f332(0x293),()=>_0x479cc9[_0x12f332(0x26c)](),{'verbose':_0x127faf['verbose']});const _0x3f36=_0x4a44e2?'Created':_0x12f332(0x23b);console['error']('✔\x20'+_0x3f36+_0x12f332(0x1ea)+_0xb760f7+'\x27');}else console[_0x12f332(0x24e)](_0x12f332(0x229)+_0xb760f7+_0x12f332(0x2ca));}const _0x1090fa=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x26b08f+_0x12f332(0x293),()=>_0x40e662[_0x12f332(0x260)][_0x12f332(0x2cb)](_0x26b08f),{'verbose':_0x127faf[_0x12f332(0x2b2)]}),_0x2d0d81=_0x1090fa['data'],_0x45343c=getConsoleUrl(_0x127faf[_0x12f332(0x24b)],_0x12f332(0x259)+_0x2d0d81[_0x12f332(0x26f)]+_0x12f332(0x1e8)+_0x2d0d81[_0x12f332(0x1f9)]+_0x12f332(0x240)+_0x2d0d81['workflowAttemptId']);return console[_0x12f332(0x24e)]('\x0a✔\x20Workflow\x20started'),console[_0x12f332(0x24e)]('\x20\x20'+a21_0x301366[_0x12f332(0x2c4)](_0x12f332(0x2c6))+'\x20'+_0x2d0d81[_0x12f332(0x230)]),console['error']('\x20\x20'+a21_0x301366['dim'](_0x12f332(0x2e3))+'\x20'+_0x2d0d81['status']),console[_0x12f332(0x24e)]('\x20\x20'+a21_0x301366['dim'](_0x12f332(0x267))+'\x20'+_0x2d0d81[_0x12f332(0x1f9)]),console[_0x12f332(0x24e)]('\x20\x20'+a21_0x301366[_0x12f332(0x2c4)](_0x12f332(0x262))+'\x20'+_0x2d0d81[_0x12f332(0x295)]),console['error']('\x20\x20'+_0x45343c),console[_0x12f332(0x24e)]('\x0a'+a21_0x301366[_0x12f332(0x2c4)](_0x12f332(0x23a))+_0x12f332(0x2ee)+_0x2d0d81[_0x12f332(0x295)]+_0x12f332(0x1e3)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x284);async['execute'](_0x2603b1){const _0x204bfc=a21_0x106a0d,{options:_0x1d3435,args:_0x271c84,tdx:_0x22787a}=_0x2603b1,_0x82a00a=_0x271c84[0x0]||_0x1d3435['parentSegment'];if(!_0x82a00a)return showParentSegmentNotSetError(_0x204bfc(0x298)+_0x204bfc(0x2f5)),0x1;_0x1d3435[_0x204bfc(0x2b2)]&&(console['error'](_0x204bfc(0x208)+_0x1d3435[_0x204bfc(0x24b)]),console[_0x204bfc(0x24e)](_0x204bfc(0x2ba)+_0x82a00a));const _0x57baad=await withSpinner(_0x204bfc(0x302)+_0x82a00a+_0x204bfc(0x293),()=>_0x22787a[_0x204bfc(0x260)][_0x204bfc(0x2c9)](_0x82a00a),{'verbose':_0x1d3435[_0x204bfc(0x2b2)]}),_0x1d4d9e=_0x57baad['data'];console['error'](_0x204bfc(0x228)+_0x1d4d9e[_0x204bfc(0x1f6)]+_0x204bfc(0x232)+(_0x1d4d9e[_0x204bfc(0x1f6)]!==0x1?'s':''));if(_0x1d3435['json']||_0x1d3435['jsonl'])return await handleSDKOutput(_0x1d4d9e,_0x1d3435),0x0;return displayFieldsHumanReadable(_0x1d4d9e,_0x82a00a),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x2f4);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x24a);async[a21_0x106a0d(0x2d7)](_0xbb5eac){const _0x391a3f=a21_0x106a0d,{options:_0x262333,args:_0x27db31,tdx:_0x546287}=_0xbb5eac,_0x29688b=_0x262333,_0x18d9e7=_0x27db31[0x0]||_0x262333[_0x391a3f(0x1ec)];if(!_0x18d9e7)return showParentSegmentNotSetError(_0x391a3f(0x226)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x391a3f(0x2d5)),0x1;_0x262333['verbose']&&(console['error'](_0x391a3f(0x208)+_0x262333[_0x391a3f(0x24b)]),console[_0x391a3f(0x24e)](_0x391a3f(0x2ba)+_0x18d9e7));const _0x1c910f=await withSpinner(_0x391a3f(0x22f)+_0x18d9e7+_0x391a3f(0x293),()=>_0x546287['segment'][_0x391a3f(0x27a)](_0x18d9e7),{'verbose':_0x262333[_0x391a3f(0x2b2)]}),_0x4c0c95=_0x1c910f['data'];if(_0x29688b[_0x391a3f(0x248)]){const _0x17e16=getConsoleNextUrl(_0x29688b[_0x391a3f(0x24b)],_0x391a3f(0x1f8)+_0x4c0c95['id']);return console[_0x391a3f(0x24e)](a21_0x301366[_0x391a3f(0x2b3)]('✔')+_0x391a3f(0x20d)+a21_0x301366['cyan'](_0x17e16)),openBrowser(_0x17e16),0x0;}return await handleSingleObjectOutput(_0x4c0c95,_0x262333),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a21_0x106a0d(0x2db)]='segment:parent:desc';[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x1f4);async[a21_0x106a0d(0x2d7)](_0x4cf585){const _0x13feb5=a21_0x106a0d,{options:_0x5bf1ea,args:_0xa9d68a,tdx:_0x3b327f}=_0x4cf585,_0xc24a54=_0xa9d68a[0x0]||_0x5bf1ea[_0x13feb5(0x1ec)];if(!_0xc24a54)return showParentSegmentNotSetError(_0x13feb5(0x2fb)+_0x13feb5(0x28a)),0x1;_0x5bf1ea['verbose']&&(console['error'](_0x13feb5(0x208)+_0x5bf1ea['site']),console[_0x13feb5(0x24e)](_0x13feb5(0x2ba)+_0xc24a54));const _0x26604e=await withSpinner(_0x13feb5(0x23e)+_0xc24a54+_0x13feb5(0x293),()=>_0x3b327f['segment'][_0x13feb5(0x304)](_0xc24a54),{'verbose':_0x5bf1ea[_0x13feb5(0x2b2)]}),_0xc9eb1d=_0x26604e[_0x13feb5(0x287)],_0x40a2fb=await withSpinner(_0x13feb5(0x283)+_0xc24a54+'\x27...',()=>_0x3b327f[_0x13feb5(0x260)][_0x13feb5(0x20f)](_0xc9eb1d),{'verbose':_0x5bf1ea[_0x13feb5(0x2b2)]}),_0x1dae19=await executeSchemaQuery(_0x40a2fb[_0x13feb5(0x287)],_0x3b327f,_0x5bf1ea);return await handleQueryOutput(_0x1dae19,_0x5bf1ea),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a21_0x106a0d(0x1f7);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x265);async['execute'](_0x5ef070){const _0x59d871=a21_0x106a0d,{options:_0x3f2b99,args:_0x661b3a,tdx:_0x2a08fb}=_0x5ef070,_0x5513bb=_0x661b3a[0x0]||_0x3f2b99[_0x59d871(0x1ec)];if(!_0x5513bb)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x3f2b99[_0x59d871(0x2b2)]&&(console[_0x59d871(0x24e)]('Site:\x20'+_0x3f2b99[_0x59d871(0x24b)]),console['error'](_0x59d871(0x2ba)+_0x5513bb));const _0x19af36=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5513bb+_0x59d871(0x293),()=>_0x2a08fb['segment'][_0x59d871(0x304)](_0x5513bb),{'verbose':_0x3f2b99[_0x59d871(0x2b2)]}),_0x56d7df=_0x19af36[_0x59d871(0x287)],_0x276d0a=await withSpinner(_0x59d871(0x283)+_0x5513bb+'\x27...',()=>_0x2a08fb[_0x59d871(0x260)]['getParentSQL'](_0x56d7df),{'verbose':_0x3f2b99[_0x59d871(0x2b2)]}),_0xd7ee5c=_0x276d0a[_0x59d871(0x287)];return _0x3f2b99['format']===_0x59d871(0x220)||_0x3f2b99[_0x59d871(0x2bc)]==='jsonl'?await handleSDKOutput([{'sql':_0xd7ee5c}],_0x3f2b99):console[_0x59d871(0x29b)](_0xd7ee5c),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a21_0x106a0d(0x2db)]=a21_0x106a0d(0x200);[a21_0x106a0d(0x2e6)]=a21_0x106a0d(0x22b);async[a21_0x106a0d(0x2d7)](_0x49a2b7){const _0x379f32=a21_0x106a0d,{options:_0x6e7e5c,args:_0x230bca,tdx:_0x5e322e}=_0x49a2b7,_0xa1f8ac=_0x230bca[0x0]||_0x6e7e5c[_0x379f32(0x1ec)];if(!_0xa1f8ac)return showParentSegmentNotSetError(_0x379f32(0x211)+_0x379f32(0x2a1)),0x1;_0x6e7e5c[_0x379f32(0x2b2)]&&(console[_0x379f32(0x24e)](_0x379f32(0x208)+_0x6e7e5c[_0x379f32(0x24b)]),console[_0x379f32(0x24e)](_0x379f32(0x2ba)+_0xa1f8ac));const _0x4665f3=await withSpinner(_0x379f32(0x23e)+_0xa1f8ac+_0x379f32(0x293),()=>_0x5e322e[_0x379f32(0x260)][_0x379f32(0x304)](_0xa1f8ac),{'verbose':_0x6e7e5c[_0x379f32(0x2b2)]}),_0x50d871=_0x4665f3['data'],_0x467259=await withSpinner(_0x379f32(0x283)+_0xa1f8ac+_0x379f32(0x293),()=>_0x5e322e['segment'][_0x379f32(0x20f)](_0x50d871),{'verbose':_0x6e7e5c[_0x379f32(0x2b2)]});let _0x37f7b9=_0x467259[_0x379f32(0x287)];const _0x854f68=resolveLimit(_0x6e7e5c['limit'],DEFAULT_DISPLAY_LIMIT),_0x1673fc=/\bLIMIT\s+\d+/i[_0x379f32(0x2b1)](_0x37f7b9);!_0x1673fc&&(_0x37f7b9=_0x37f7b9[_0x379f32(0x201)]()[_0x379f32(0x1e1)](/;+$/,''),_0x37f7b9=_0x379f32(0x2da)+_0x37f7b9+_0x379f32(0x28d)+_0x854f68);_0x6e7e5c[_0x379f32(0x2b2)]&&console[_0x379f32(0x24e)]('SQL\x20query:\x0a'+_0x37f7b9);const _0x1c9fa7=await withProgressSpinner(_0x379f32(0x2eb),async _0x22c6f8=>{const _0x5d29af=_0x379f32,_0x3d590d=await _0x5e322e[_0x5d29af(0x2df)][_0x5d29af(0x2d7)](_0x37f7b9,{'catalog':'td','schema':_0x5d29af(0x234),'onJobId':_0x552033=>{const _0x542a02=_0x5d29af;_0x22c6f8[_0x542a02(0x1e0)](_0x552033);}});return _0x3d590d;},{'verbose':_0x6e7e5c['verbose']}),_0x42f040=_0x1c9fa7[_0x379f32(0x287)],_0x58bbaf=_0x42f040[_0x379f32(0x222)]?'\x20[Job\x20ID:\x20'+_0x42f040['jobId']+']':'';return console[_0x379f32(0x24e)](_0x379f32(0x2b5)+_0x42f040['stats'][_0x379f32(0x278)][_0x379f32(0x288)]()+'\x20rows\x20'+(_0x379f32(0x236)+formatElapsed(_0x42f040[_0x379f32(0x2ff)][_0x379f32(0x21b)])+_0x58bbaf)),await handleQueryOutput(_0x42f040,_0x6e7e5c),0x0;}}
|
|
1
|
+
const a21_0x1b6475=a21_0xfa15;(function(_0x59a664,_0x1988e8){const _0x569854=a21_0xfa15,_0x4b472a=_0x59a664();while(!![]){try{const _0x57a6b2=parseInt(_0x569854(0x11c))/0x1+parseInt(_0x569854(0x142))/0x2+parseInt(_0x569854(0x1df))/0x3+-parseInt(_0x569854(0x245))/0x4*(-parseInt(_0x569854(0x191))/0x5)+-parseInt(_0x569854(0x135))/0x6+-parseInt(_0x569854(0x19f))/0x7+-parseInt(_0x569854(0x228))/0x8;if(_0x57a6b2===_0x1988e8)break;else _0x4b472a['push'](_0x4b472a['shift']());}catch(_0x5901f7){_0x4b472a['push'](_0x4b472a['shift']());}}}(a21_0x452a,0x945dd));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0x440b2f from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a21_0x173b75 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a21_0x1b6475(0x1ca),LEGACY_PARENT_SEGMENT_DIR=a21_0x1b6475(0x248);function a21_0xfa15(_0x366cf2,_0x4b8bcb){_0x366cf2=_0x366cf2-0x11b;const _0x452ab1=a21_0x452a();let _0xfa1554=_0x452ab1[_0x366cf2];return _0xfa1554;}function openBrowser(_0x1494ff){const _0x430b04=a21_0x1b6475,_0x1644d1=process['platform'],_0x43e974=_0x1644d1===_0x430b04(0x12e)?'open':_0x1644d1===_0x430b04(0x1ed)?_0x430b04(0x128):_0x430b04(0x239);spawn(_0x43e974,[_0x1494ff],{'detached':!![],'stdio':_0x430b04(0x1b8)})[_0x430b04(0x20e)]();}function migrateLegacyDirectory(){const _0x5848e8=a21_0x1b6475;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x194b4c=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x194b4c[_0x5848e8(0x20d)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5848e8(0x1fe)](a21_0x173b75[_0x5848e8(0x126)](_0x5848e8(0x1f0)+LEGACY_PARENT_SEGMENT_DIR+_0x5848e8(0x1c0)+PARENT_SEGMENT_DIR+_0x5848e8(0x131))),console[_0x5848e8(0x1fe)](a21_0x173b75[_0x5848e8(0x238)](_0x5848e8(0x1e3)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x5848e8(0x1fe)](a21_0x173b75['yellow'](_0x5848e8(0x1b2)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5848e8(0x1fe)](a21_0x173b75['green'](_0x5848e8(0x1eb)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1b426e){const _0x40f3a4=_0x1b426e instanceof Error?_0x1b426e[_0x5848e8(0x16f)]:String(_0x1b426e);return console[_0x5848e8(0x1fe)](a21_0x173b75['red'](_0x5848e8(0x20f)+_0x40f3a4+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0x1b6475(0x1d8)](_0x24717a){const _0x4c2f4f=a21_0x1b6475;return migrateLegacyDirectory(),super[_0x4c2f4f(0x1d8)](_0x24717a);}}function resolveYamlFile(_0x2f55ea){const _0x9f3c54=a21_0x1b6475;if(_0x2f55ea['endsWith']('.yml')||_0x2f55ea[_0x9f3c54(0x240)](_0x9f3c54(0x234)))return _0x2f55ea;return a21_0x440b2f[_0x9f3c54(0x20c)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2f55ea)+_0x9f3c54(0x19a));}function formatProgressMessage(_0x16f8a1){const _0x229e0a=a21_0x1b6475,_0x5a2c81=_0x16f8a1[_0x229e0a(0x1be)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5a2c81){const [,_0x1d3ac6,_0x194143,_0x543c30='']=_0x5a2c81;return a21_0x173b75[_0x229e0a(0x238)](_0x1d3ac6+':')+'\x20'+_0x194143+a21_0x173b75[_0x229e0a(0x238)](_0x543c30);}return a21_0x173b75[_0x229e0a(0x238)](_0x16f8a1);}function showFileNotFoundError(_0x293d8a,_0x29bfe3){const _0xbb0e84=a21_0x1b6475;console[_0xbb0e84(0x1fe)](a21_0x173b75['red']('Error:\x20File\x20not\x20found:\x20'+_0x293d8a+'\x0a')),console[_0xbb0e84(0x1fe)](a21_0x173b75[_0xbb0e84(0x152)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x29bfe3+_0xbb0e84(0x156)));}function showParentSegmentNotSetError(_0x457e53){const _0x12e406=a21_0x1b6475;console['error'](a21_0x173b75[_0x12e406(0x126)](_0x12e406(0x1d3))),console['error'](_0x457e53);}export class ParentSegmentListCommand extends BaseCommand{['name']=a21_0x1b6475(0x1bc);[a21_0x1b6475(0x144)]=a21_0x1b6475(0x22f);async[a21_0x1b6475(0x129)](_0x4f8ad9){const _0x486d63=a21_0x1b6475,{options:_0x520ff3,args:_0x6d4346,tdx:_0x3ccaf1}=_0x4f8ad9,_0x11a94c=_0x6d4346[0x0];_0x520ff3[_0x486d63(0x241)]&&(console[_0x486d63(0x1fe)](_0x486d63(0x220)+_0x520ff3['site']),_0x11a94c&&console[_0x486d63(0x1fe)](_0x486d63(0x185)+_0x11a94c));const _0x34674c=await withSpinner(_0x11a94c?_0x486d63(0x205)+_0x11a94c+'\x27...':_0x486d63(0x1f2),()=>_0x3ccaf1[_0x486d63(0x192)][_0x486d63(0x148)](),{'verbose':_0x520ff3[_0x486d63(0x241)]});let _0x303265=_0x34674c['data'];if(_0x11a94c){const _0x4ab2ba=_0x11a94c[_0x486d63(0x124)](/[.+^${}()|[\]\\]/g,_0x486d63(0x226))[_0x486d63(0x124)](/\*/g,'.*')[_0x486d63(0x124)](/\?/g,'.'),_0x2eac54=new RegExp('^'+_0x4ab2ba+'$','i');_0x303265=_0x303265[_0x486d63(0x140)](_0x4c8d79=>_0x2eac54[_0x486d63(0x150)](_0x4c8d79[_0x486d63(0x17d)]['name']));}_0x303265['sort']((_0x1ce335,_0x753f04)=>_0x1ce335[_0x486d63(0x17d)]['name'][_0x486d63(0x221)](_0x753f04[_0x486d63(0x17d)][_0x486d63(0x1b4)])),console['error'](_0x486d63(0x130)+_0x303265[_0x486d63(0x15f)]+_0x486d63(0x1aa)+(_0x303265[_0x486d63(0x15f)]!==0x1?'s':''));const _0x24b039=_0x2ebbdc=>{return getConsoleNextUrl(_0x520ff3['site'],'/app/dw/parentSegments/'+_0x2ebbdc);};if(_0x520ff3['format']===_0x486d63(0x13b)||_0x520ff3[_0x486d63(0x1b6)]===_0x486d63(0x1a0)){const _0x2f9b9b=_0x303265[_0x486d63(0x151)](_0x784bd0=>({..._0x784bd0,'url':_0x24b039(_0x784bd0['id'])}));await handleSDKOutput(_0x2f9b9b,_0x520ff3);}else{if(_0x303265['length']===0x0)_0x11a94c?console[_0x486d63(0x1b0)](_0x486d63(0x1f1)+_0x11a94c):console[_0x486d63(0x1b0)]('No\x20parent\x20segments\x20found');else for(const _0x3e508b of _0x303265){const _0x2f04e1=_0x3e508b['attributes'][_0x486d63(0x1dd)]?a21_0x173b75[_0x486d63(0x238)]('\x20('+formatRows(_0x3e508b[_0x486d63(0x17d)][_0x486d63(0x1dd)])+')'):'',_0x4d9b63=hyperlink(_0x3e508b[_0x486d63(0x17d)][_0x486d63(0x1b4)],_0x24b039(_0x3e508b['id']));console[_0x486d63(0x1b0)](_0x486d63(0x1cb)+_0x4d9b63+_0x2f04e1);}}return 0x0;}}function a21_0x452a(){const _0x355d87=['join','isDirectory','unref','✘\x20Failed\x20to\x20rename\x20directory:\x20','string','workflowSessionId','Behaviors','processedRows','Error\x20parsing\x20YAML:\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','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','column','To\x20cancel:','displaySampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','use','-1d','enriched','Source:','/app/dw/parentSegments/','Site:\x20','localeCompare','attributesFile','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Get\x20SQL\x20query\x20for\x20parent\x20segment','columns','\x5c$&','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','19711072uZfhXu','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','%)\x20','matchedCount','\x20tdx\x20wf\x20attempt\x20','workflowAttemptId','List\x20parent\x20segments','Aborted.','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Fetching\x20sample\x20data...','Validating\x20configuration...','.yaml','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','output','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','dim','xdg-open','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Options:','master','Error:\x20--behavior\x20requires\x20a\x20name\x0a','rowCount','endsWith','verbose','\x20rows\x20','Behavior:','Fetching\x20parent\x20segment\x20\x27','4Ffyray','Analyzing\x20changes...','\x0aUsage:\x20tdx\x20ps\x20preview\x20','parent_segment','Join\x20on:','trim','displayValidateResults','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','879615yIwziP','tdx\x20segment\x20parent\x20preview\x20','Updating','Show\x20parent\x20segment\x20details','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Rows:','preview','customerGroupFile','replace','scheduleType','yellow','getParentSQL','start','execute','timezone','\x20=\x20','varchar','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','darwin','interval','✔\x20Found\x20','/\x20directories\x20exist.','stats','status','foreignKey','1277166MtUZDX','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Attempt:','Master:','using\x20the\x20default\x20path:\x20','json','Create\x20parent\x20segment\x20\x27','/attempt/','scheduleOption','\x27\x20and\x20run\x20workflow?','filter','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','2020452JtpVVk','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','description','Parent\x20segment:\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Join:','listParents','coveragePercent','displayMasterInfo','\x20is\x20already\x20up\x20to\x20date','stop','validateParentYaml','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','addAttributes','test','map','cyan','database','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','apply','`\x20to\x20download\x20the\x20configuration\x20first','\x20field','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','addBehaviorsFile','segment:parent:run','\x27\x20with\x20ID:\x20','Errors:','\x20--enriched','\x20Context\x20set:\x20','length','displaySummary','To\x20view\x20sample\x20data:','Master\x20Table','Preview:','joinKey','displayAttributesStats','Error\x20reading\x20file:\x20','workflowId','addBehaviors','session','label','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Status:','displayBehaviorsStats','message','Attribute:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','sampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20--attribute\x20\x22','Output\x20file:\x20','Attributes','listFields','errors','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','behaviors','Events:','attributes','\x20[Job\x20ID:\x20','information_schema','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','behavior','segment:parent:fields','table','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Pattern:\x20','segment:parent:create','repeat','double','keys','addAttributesFile','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','audienceId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Options\x20(one\x20required):\x0a','Apply\x20changes\x20to\x20\x27','\x20Opening\x20','2538055gKfOrG','segment','toFixed','Error:','segment:parent:push','Error:\x20--attribute\x20requires\x20a\x20name\x0a','customerGroup','\x20--attribute\x20\x22<name>\x22','limit','.yml','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Resolving\x20parent\x20segment\x20\x27','behaviorsFile','✔\x20Created\x20parent\x20segment\x20\x27','2115792FBWZCq','jsonl','\x20No\x20changes\x20-\x20','List\x20available\x20fields\x20for\x20segmentation','allValid','\x20\x20\x20\x20-\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','web','Audience\x20ID:','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20parent\x20segment','Master\x20+\x20Attributes','segment:parent:desc','Validate:','Fetching\x20SQL\x20for\x20\x27','segment:parent:show','log','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x0a⚠️\x20\x20Migrating:\x20','getParentFull','name','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','format','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','ignore','segment:parent:pull','bold','✔\x20No\x20changes\x20-\x20\x27','segment:parent:list','Updated','match','Enriched:','/\x20and\x20','attribute','setJobId','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','all','displayPreviewResults','data','Created','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','parent_segments','👥\x20','\x0aNo\x20sample\x20data\x20available','Listing\x20fields\x20for\x20\x27','\x27...','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','pushParentYaml','elapsedTimeMillis','schemaError','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','segment:parent:update','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','YAML\x20file:\x20','jobId','run','displayColumns','customersWithEvents','schemaValid','Columns:','population','\x0aChanges\x20to\x20apply\x20to\x20\x27','3567774jlstVF','green','segment:parent:sql','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20kill','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Creating','parentSegment','customerPercent','yes','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','✔\x20Renamed\x20directory\x20to\x20','totalEvents','win32','SELECT\x20*\x20FROM\x20(\x0a','site','\x0a⚠️\x20\x20Both\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Listing\x20parent\x20segments...','Available\x20attributes:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','previewParentYaml','/sessions/','SQL\x20query:\x0a','segment:parent:validate','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20--behavior\x20\x22','resolveParentId','✔\x20Query\x20completed:\x20Processed\x20','utf-8','error','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Table:\x20','\x0a✔\x20Workflow\x20started','\x20parent\x20segment\x20\x27','pullParentYaml','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','displayPreviewHints','\x20\x20No\x20sample\x20data\x20available','/{name}.yml\x0a','Creating\x20parent\x20segment\x20\x27','\x0aNew\x20parent\x20segment\x20\x27'];a21_0x452a=function(){return _0x355d87;};return a21_0x452a();}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x186);[a21_0x1b6475(0x144)]=a21_0x1b6475(0x16c);async[a21_0x1b6475(0x129)](_0x26aab2){const _0x36f489=a21_0x1b6475,{options:_0x27a1e0,args:_0x473b9a,tdx:_0x397327}=_0x26aab2;console[_0x36f489(0x1fe)](_0x36f489(0x18d)+_0x36f489(0x11b)+_0x36f489(0x19b));const _0x4669f3=_0x27a1e0;if(_0x473b9a[_0x36f489(0x15f)]===0x0)return console[_0x36f489(0x1fe)](a21_0x173b75[_0x36f489(0x1c8)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x36f489(0x1fe)](_0x36f489(0x1e2)),0x1;const _0x44ceef=_0x473b9a[0x0];if(!_0x4669f3[_0x36f489(0x153)]||!_0x4669f3['table'])return console[_0x36f489(0x1fe)](_0x36f489(0x1a5)),console['error'](_0x36f489(0x1e2)),0x1;_0x4669f3[_0x36f489(0x241)]&&(console['error'](_0x36f489(0x220)+_0x4669f3[_0x36f489(0x1ef)]),console['error']('Name:\x20'+_0x44ceef),console[_0x36f489(0x1fe)]('Database:\x20'+_0x4669f3[_0x36f489(0x153)]),console[_0x36f489(0x1fe)](_0x36f489(0x201)+_0x4669f3[_0x36f489(0x183)]));const _0x450429=await loadJSONFromOptions(_0x4669f3['attributes'],_0x4669f3[_0x36f489(0x222)]),_0x332b84=await loadJSONFromOptions(_0x4669f3[_0x36f489(0x17b)],_0x4669f3[_0x36f489(0x19d)]),_0x5c27b6=await loadJSONFromOptions(_0x4669f3['customerGroup'],_0x4669f3[_0x36f489(0x123)]),_0x2331c0={'name':_0x44ceef,'description':_0x4669f3[_0x36f489(0x144)],'scheduleType':_0x4669f3[_0x36f489(0x125)],'scheduleOption':_0x4669f3[_0x36f489(0x13e)],'timezone':_0x4669f3[_0x36f489(0x12a)],'master':{'parentDatabaseName':_0x4669f3[_0x36f489(0x153)],'parentTableName':_0x4669f3[_0x36f489(0x183)]},'attributes':_0x450429,'behaviors':_0x332b84,'customerGroup':_0x5c27b6},_0x35b11c=await withSpinner(_0x36f489(0x20a)+_0x44ceef+_0x36f489(0x1ce),()=>_0x397327['segment']['createParent'](_0x2331c0),{'verbose':_0x27a1e0['verbose']}),_0x12d9f6=_0x35b11c['data'];return console['error'](_0x36f489(0x19e)+_0x12d9f6['name']+_0x36f489(0x15b)+_0x12d9f6['id']),await handleSDKOutput([_0x12d9f6],_0x27a1e0),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x1d4);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a21_0x1b6475(0x129)](_0x56b142){const _0x51af61=a21_0x1b6475,{options:_0x5a0fe1,args:_0x4e5589,tdx:_0x245483}=_0x56b142;console[_0x51af61(0x1fe)](_0x51af61(0x16b)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x51af61(0x19b));const _0x44dd46=_0x5a0fe1;if(_0x4e5589['length']===0x0)return console[_0x51af61(0x1fe)](a21_0x173b75[_0x51af61(0x1c8)](_0x51af61(0x229))),console[_0x51af61(0x1fe)](_0x51af61(0x184)),0x1;const _0x1d89ed=_0x4e5589[0x0];_0x44dd46['verbose']&&(console[_0x51af61(0x1fe)]('Site:\x20'+_0x44dd46[_0x51af61(0x1ef)]),console[_0x51af61(0x1fe)](_0x51af61(0x145)+_0x1d89ed));const _0x1d99bf=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x1d89ed+_0x51af61(0x1ce),()=>_0x245483[_0x51af61(0x192)][_0x51af61(0x1b3)](_0x1d89ed),{'verbose':_0x44dd46[_0x51af61(0x241)]}),_0x245aa4=_0x1d99bf['data'],_0x29a47c=await loadJSONFromOptions(_0x44dd46[_0x51af61(0x14f)],_0x44dd46[_0x51af61(0x18a)]),_0xb885cd=await loadJSONFromOptions(_0x44dd46[_0x51af61(0x168)],_0x44dd46[_0x51af61(0x159)]),_0x26721={'name':_0x245aa4[_0x51af61(0x1b4)],'description':_0x44dd46['description']!==undefined?_0x44dd46[_0x51af61(0x144)]:_0x245aa4['description'],'scheduleType':_0x44dd46['scheduleType']!==undefined?_0x44dd46[_0x51af61(0x125)]:_0x245aa4[_0x51af61(0x125)],'scheduleOption':_0x44dd46[_0x51af61(0x13e)]!==undefined?_0x44dd46['scheduleOption']:_0x245aa4[_0x51af61(0x13e)],'timezone':_0x44dd46[_0x51af61(0x12a)]!==undefined?_0x44dd46[_0x51af61(0x12a)]:_0x245aa4[_0x51af61(0x12a)],'master':_0x245aa4['master'],'attributes':_0x29a47c?[..._0x245aa4[_0x51af61(0x17d)]||[],..._0x29a47c]:_0x245aa4[_0x51af61(0x17d)],'behaviors':_0xb885cd?[..._0x245aa4[_0x51af61(0x17b)]||[],..._0xb885cd]:_0x245aa4[_0x51af61(0x17b)],'customerGroup':_0x245aa4[_0x51af61(0x197)]},_0x478685=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x1d89ed+_0x51af61(0x1ce),()=>_0x245483[_0x51af61(0x192)]['updateParent'](_0x1d89ed,_0x26721),{'verbose':_0x44dd46[_0x51af61(0x241)]}),_0x279888=_0x478685[_0x51af61(0x1c6)];return console[_0x51af61(0x1fe)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x279888[_0x51af61(0x1b4)]+'\x27'),await handleSDKOutput([_0x279888],_0x44dd46),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x1b9);[a21_0x1b6475(0x144)]=a21_0x1b6475(0x158);async[a21_0x1b6475(0x129)](_0xa891be){const _0x2b651f=a21_0x1b6475,{options:_0x2a9ce1,args:_0x449a3e,tdx:_0x2db00d}=_0xa891be,_0x6100d7=_0x2a9ce1,_0x1a911a=_0x449a3e[0x0]||_0x2a9ce1[_0x2b651f(0x1e7)];if(!_0x1a911a)return showParentSegmentNotSetError(_0x2b651f(0x1c3)+_0x2b651f(0x173)),0x1;if(_0x6100d7[_0x2b651f(0x21b)]&&_0x6100d7[_0x2b651f(0x236)])return console[_0x2b651f(0x1fe)](a21_0x173b75[_0x2b651f(0x1c8)](_0x2b651f(0x200))),console[_0x2b651f(0x1fe)](a21_0x173b75[_0x2b651f(0x238)](_0x2b651f(0x1b5))),console[_0x2b651f(0x1fe)](a21_0x173b75[_0x2b651f(0x238)](_0x2b651f(0x13a)+PARENT_SEGMENT_DIR+_0x2b651f(0x209))),console[_0x2b651f(0x1fe)](a21_0x173b75[_0x2b651f(0x152)](_0x2b651f(0x18b))),0x1;const _0x59d48b=_0x6100d7[_0x2b651f(0x236)]||a21_0x440b2f[_0x2b651f(0x20c)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1a911a)+_0x2b651f(0x19a));_0x6100d7[_0x2b651f(0x241)]&&(console[_0x2b651f(0x1fe)](_0x2b651f(0x220)+_0x6100d7[_0x2b651f(0x1ef)]),console[_0x2b651f(0x1fe)](_0x2b651f(0x145)+_0x1a911a),console[_0x2b651f(0x1fe)](_0x2b651f(0x176)+_0x59d48b));const _0x2f6725=await withSpinner(_0x2b651f(0x244)+_0x1a911a+_0x2b651f(0x1ce),()=>_0x2db00d[_0x2b651f(0x192)][_0x2b651f(0x204)](_0x1a911a),{'verbose':_0x6100d7['verbose']}),_0x3e1e26=_0x2f6725[_0x2b651f(0x1c6)];if(existsSync(_0x59d48b)){const _0x4f2776=readFileSync(_0x59d48b,_0x2b651f(0x1fd)),_0x3336eb=generateDiff(_0x4f2776,_0x3e1e26);if(!hasChanges(_0x3336eb))console['error'](a21_0x173b75[_0x2b651f(0x1e0)]('✔')+_0x2b651f(0x1a1)+a21_0x173b75[_0x2b651f(0x152)](_0x59d48b)+_0x2b651f(0x14b));else{console['error']('\x0aChanges\x20to\x20\x27'+_0x59d48b+'\x27:'),console[_0x2b651f(0x1fe)]('─'['repeat'](0x3c)),console[_0x2b651f(0x1fe)](formatDiffWithColors(_0x3336eb)),console['error']('─'['repeat'](0x3c));if(!_0x6100d7[_0x2b651f(0x1e9)]){const _0x41af51=await confirmKey('Overwrite\x20\x27'+_0x59d48b+'\x27?');if(!_0x41af51)return console[_0x2b651f(0x1fe)](_0x2b651f(0x230)),0x1;}writeFileSync(_0x59d48b,_0x3e1e26,_0x2b651f(0x1fd)),console['error'](a21_0x173b75[_0x2b651f(0x1e0)]('✔')+_0x2b651f(0x1f9)+a21_0x173b75[_0x2b651f(0x152)](_0x59d48b));}}else{const _0x531298=a21_0x440b2f['dirname'](_0x59d48b);!existsSync(_0x531298)&&mkdirSync(_0x531298,{'recursive':!![]}),writeFileSync(_0x59d48b,_0x3e1e26,'utf-8'),console[_0x2b651f(0x1fe)](a21_0x173b75[_0x2b651f(0x1e0)]('✔')+_0x2b651f(0x1f9)+a21_0x173b75[_0x2b651f(0x152)](_0x59d48b));}return saveSessionContext({'parent_segment':_0x1a911a},_0x6100d7[_0x2b651f(0x169)]),console[_0x2b651f(0x1fe)](a21_0x173b75[_0x2b651f(0x1e0)]('✔')+_0x2b651f(0x15e)+a21_0x173b75[_0x2b651f(0x238)]('parent_segment')+_0x2b651f(0x12b)+a21_0x173b75['cyan'](_0x1a911a)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x195);[a21_0x1b6475(0x144)]=a21_0x1b6475(0x14e);async[a21_0x1b6475(0x129)](_0x38a948){const _0x4f92e8=a21_0x1b6475,{options:_0x4d2a13,args:_0x18607f,tdx:_0x272028}=_0x38a948,_0x1bf218=_0x4d2a13,_0x5052b1=_0x18607f[0x0]||_0x4d2a13[_0x4f92e8(0x1e7)];if(!_0x5052b1)return showParentSegmentNotSetError(_0x4f92e8(0x1b7)+_0x4f92e8(0x1c9)),0x1;const _0x20f8e3=resolveYamlFile(_0x5052b1);if(!existsSync(_0x20f8e3))return showFileNotFoundError(_0x20f8e3,_0x5052b1),0x1;_0x1bf218[_0x4f92e8(0x241)]&&(console[_0x4f92e8(0x1fe)]('Site:\x20'+_0x1bf218['site']),console['error'](_0x4f92e8(0x1d6)+_0x20f8e3));let _0x373d4d;try{_0x373d4d=readFileSync(_0x20f8e3,_0x4f92e8(0x1fd));}catch(_0x3e50d8){const _0x50147c=_0x3e50d8 instanceof Error?_0x3e50d8[_0x4f92e8(0x16f)]:String(_0x3e50d8);return console[_0x4f92e8(0x1fe)](_0x4f92e8(0x166)+_0x50147c),0x1;}const _0x211b8e=await withSpinner(_0x4f92e8(0x246),()=>_0x272028[_0x4f92e8(0x192)][_0x4f92e8(0x1d0)](_0x373d4d),{'verbose':_0x1bf218[_0x4f92e8(0x241)]}),_0x3131a1=_0x211b8e[_0x4f92e8(0x1c6)],{isNew:_0x51e67c,name:_0x2c89d0,hasChanges:_0xfdb1b0,diffFormatted:_0x5584c8}=_0x3131a1;if(!_0xfdb1b0)return console[_0x4f92e8(0x1fe)](_0x4f92e8(0x1bb)+_0x2c89d0+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x51e67c?console[_0x4f92e8(0x1fe)](_0x4f92e8(0x20b)+_0x2c89d0+'\x27:'):console[_0x4f92e8(0x1fe)](_0x4f92e8(0x1de)+_0x2c89d0+'\x27:');console['error']('─'[_0x4f92e8(0x187)](0x3c)),console[_0x4f92e8(0x1fe)](_0x5584c8),console['error']('─'[_0x4f92e8(0x187)](0x3c));const _0x25e8cd=_0x51e67c?'Create\x20parent\x20segment\x20\x27'+_0x2c89d0+'\x27?':_0x4f92e8(0x18f)+_0x2c89d0+'\x27?';if(!_0x1bf218[_0x4f92e8(0x1e9)]){const _0x12f69b=await confirmKey(_0x25e8cd);if(!_0x12f69b)return console[_0x4f92e8(0x1fe)](_0x4f92e8(0x230)),0x1;}const _0x27e8c0=_0x51e67c?'Creating':_0x4f92e8(0x11e),_0x19d27c=await withSpinner(_0x27e8c0+_0x4f92e8(0x203)+_0x2c89d0+'\x27...',()=>_0x3131a1[_0x4f92e8(0x155)](),{'verbose':_0x1bf218[_0x4f92e8(0x241)]}),_0xa07632=_0x19d27c[_0x4f92e8(0x1c6)],_0x337eb6=getConsoleNextUrl(_0x1bf218[_0x4f92e8(0x1ef)],_0x4f92e8(0x21f)+_0xa07632['id']),_0x4fa022=_0x51e67c?_0x4f92e8(0x1c7):'Updated';return console['error']('✔\x20'+_0x4fa022+_0x4f92e8(0x203)+_0xa07632[_0x4f92e8(0x1b4)]+'\x27'),console[_0x4f92e8(0x1fe)]('\x20\x20'+_0x337eb6),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a21_0x1b6475(0x1f8);[a21_0x1b6475(0x144)]=a21_0x1b6475(0x237);async[a21_0x1b6475(0x129)](_0x96945f){const _0x76ebb3=a21_0x1b6475,{options:_0x5055de,args:_0x3a475a,tdx:_0x27076b}=_0x96945f,_0x49cc1a=_0x5055de,_0x3ccd11=_0x3a475a[0x0]||_0x5055de[_0x76ebb3(0x1e7)];if(!_0x3ccd11)return showParentSegmentNotSetError(_0x76ebb3(0x1ea)+_0x76ebb3(0x171)+'Options:\x0a'+_0x76ebb3(0x1a9)+_0x76ebb3(0x1b1)+_0x76ebb3(0x1f4)),0x1;const _0x24f781=resolveYamlFile(_0x3ccd11);if(!existsSync(_0x24f781))return showFileNotFoundError(_0x24f781,_0x3ccd11),0x1;_0x49cc1a[_0x76ebb3(0x241)]&&(console['error'](_0x76ebb3(0x220)+_0x49cc1a['site']),console[_0x76ebb3(0x1fe)](_0x76ebb3(0x1d6)+_0x24f781));let _0x5f5bbc;try{_0x5f5bbc=readFileSync(_0x24f781,_0x76ebb3(0x1fd));}catch(_0x45ba0d){const _0x13f707=_0x45ba0d instanceof Error?_0x45ba0d[_0x76ebb3(0x16f)]:String(_0x45ba0d);return console['error']('Error\x20reading\x20file:\x20'+_0x13f707),0x1;}const _0x3dbdff=createCommandSpinner(a21_0x173b75['dim'](_0x76ebb3(0x233)),{'verbose':_0x49cc1a['verbose']});_0x3dbdff['start']();const _0x4c8126={'onProgress':_0x72af71=>{_0x3dbdff['text']=formatProgressMessage(_0x72af71);}};if(_0x49cc1a[_0x76ebb3(0x23d)])_0x4c8126[_0x76ebb3(0x23d)]=!![];if(_0x49cc1a[_0x76ebb3(0x21d)])_0x4c8126[_0x76ebb3(0x21d)]=!![];_0x49cc1a[_0x76ebb3(0x1c1)]&&(_0x4c8126[_0x76ebb3(0x1c1)]=_0x49cc1a['attribute']);_0x49cc1a[_0x76ebb3(0x181)]&&(_0x4c8126['behavior']=_0x49cc1a[_0x76ebb3(0x181)]);if(_0x49cc1a[_0x76ebb3(0x12f)])_0x4c8126['interval']=_0x49cc1a[_0x76ebb3(0x12f)];let _0x256ff6;try{_0x256ff6=await _0x27076b[_0x76ebb3(0x192)][_0x76ebb3(0x14d)](_0x5f5bbc,_0x4c8126),_0x3dbdff[_0x76ebb3(0x14c)]();}catch(_0x253cbd){_0x3dbdff['stop']();throw _0x253cbd;}const _0x25da69=_0x49cc1a[_0x76ebb3(0x12f)]||_0x76ebb3(0x21c);return this[_0x76ebb3(0x24b)](_0x256ff6,_0x4c8126,_0x24f781,_0x25da69),_0x256ff6[_0x76ebb3(0x1a3)]?0x0:0x1;}[a21_0x1b6475(0x24b)](_0x3ff787,_0x5c23a9,_0x12f1fb,_0x405ed4){const _0x8c4d56=a21_0x1b6475;console[_0x8c4d56(0x1fe)]('\x0a'+a21_0x173b75[_0x8c4d56(0x1ba)](_0x8c4d56(0x1ad))+'\x20'+_0x3ff787[_0x8c4d56(0x1b4)]),console['error']('═'[_0x8c4d56(0x187)](0x3c)),this[_0x8c4d56(0x14a)](_0x3ff787);if(typeof _0x5c23a9[_0x8c4d56(0x1c1)]===_0x8c4d56(0x210)){this[_0x8c4d56(0x165)](_0x3ff787),this[_0x8c4d56(0x160)](_0x3ff787),this[_0x8c4d56(0x207)](_0x12f1fb,_0x405ed4,_0x8c4d56(0x1c1),_0x5c23a9[_0x8c4d56(0x1c1)]);return;}if(_0x5c23a9['attribute']===!![]){this[_0x8c4d56(0x165)](_0x3ff787),this['displaySummary'](_0x3ff787),this[_0x8c4d56(0x207)](_0x12f1fb,_0x405ed4,_0x8c4d56(0x17d));return;}if(typeof _0x5c23a9[_0x8c4d56(0x181)]===_0x8c4d56(0x210)){this['displayBehaviorsStats'](_0x3ff787,_0x405ed4),this[_0x8c4d56(0x160)](_0x3ff787),this[_0x8c4d56(0x207)](_0x12f1fb,_0x405ed4,_0x8c4d56(0x181),_0x5c23a9[_0x8c4d56(0x181)]);return;}if(_0x5c23a9[_0x8c4d56(0x181)]===!![]){this[_0x8c4d56(0x16e)](_0x3ff787,_0x405ed4),this[_0x8c4d56(0x160)](_0x3ff787),this[_0x8c4d56(0x207)](_0x12f1fb,_0x405ed4,_0x8c4d56(0x17b));return;}this[_0x8c4d56(0x165)](_0x3ff787),this[_0x8c4d56(0x16e)](_0x3ff787,_0x405ed4),this['displaySummary'](_0x3ff787),this[_0x8c4d56(0x207)](_0x12f1fb,_0x405ed4,_0x8c4d56(0x1c4));}[a21_0x1b6475(0x207)](_0x2036de,_0x1a1e1a,_0x4f3cd2,_0x2dd2da){const _0x1d7572=a21_0x1b6475;console[_0x1d7572(0x1fe)]('\x0a'+a21_0x173b75[_0x1d7572(0x238)](_0x1d7572(0x161)));const _0x2fea4b=_0x1a1e1a!==_0x1d7572(0x21c)?'\x20--interval\x20'+_0x1a1e1a:'';if(_0x4f3cd2===_0x1d7572(0x1c1)&&_0x2dd2da)console['error']('\x20\x20'+a21_0x173b75['dim'](_0x1d7572(0x11d)+_0x2036de+_0x1d7572(0x175)+_0x2dd2da+'\x22'+_0x2fea4b));else{if(_0x4f3cd2===_0x1d7572(0x181)&&_0x2dd2da)console[_0x1d7572(0x1fe)]('\x20\x20'+a21_0x173b75[_0x1d7572(0x238)]('tdx\x20segment\x20parent\x20preview\x20'+_0x2036de+_0x1d7572(0x1fa)+_0x2dd2da+'\x22'+_0x2fea4b));else(_0x4f3cd2==='attributes'||_0x4f3cd2===_0x1d7572(0x1c4))&&console['error']('\x20\x20'+a21_0x173b75[_0x1d7572(0x238)](_0x1d7572(0x11d)+_0x2036de+_0x1d7572(0x198)+_0x2fea4b));}(_0x4f3cd2===_0x1d7572(0x17b)||_0x4f3cd2===_0x1d7572(0x1c4))&&console[_0x1d7572(0x1fe)]('\x20\x20'+a21_0x173b75[_0x1d7572(0x238)](_0x1d7572(0x11d)+_0x2036de+'\x20--behavior\x20\x22<name>\x22'+_0x2fea4b)),_0x4f3cd2==='all'&&console[_0x1d7572(0x1fe)]('\x20\x20'+a21_0x173b75[_0x1d7572(0x238)](_0x1d7572(0x11d)+_0x2036de+_0x1d7572(0x15d)+_0x2fea4b));}['displayMasterInfo'](_0x130e22){const _0x2e01ce=a21_0x1b6475,{master:_0x5af271}=_0x130e22,_0x50ce6f=_0x5af271[_0x2e01ce(0x1db)]?a21_0x173b75['green']('✔'):a21_0x173b75['red']('✘');console[_0x2e01ce(0x1fe)]('\x0a'+a21_0x173b75[_0x2e01ce(0x238)](_0x2e01ce(0x162))),console[_0x2e01ce(0x1fe)](_0x50ce6f+'\x20'+a21_0x173b75[_0x2e01ce(0x1ba)](_0x5af271['database']+'.'+_0x5af271[_0x2e01ce(0x183)])),_0x5af271[_0x2e01ce(0x1db)]?_0x5af271[_0x2e01ce(0x23f)]!==undefined&&console['error']('\x20\x20'+a21_0x173b75['dim'](_0x2e01ce(0x121))+'\x20'+a21_0x173b75[_0x2e01ce(0x152)](formatRows(_0x5af271[_0x2e01ce(0x23f)]))):console[_0x2e01ce(0x1fe)]('\x20\x20'+a21_0x173b75[_0x2e01ce(0x1c8)]('Error:')+'\x20'+_0x5af271[_0x2e01ce(0x1d2)]);}[a21_0x1b6475(0x165)](_0x35625b){const _0x143269=a21_0x1b6475;if(_0x35625b[_0x143269(0x17d)][_0x143269(0x15f)]===0x0)return;console[_0x143269(0x1fe)]('\x0a'+a21_0x173b75['dim'](_0x143269(0x177)));for(const _0x191cf7 of _0x35625b[_0x143269(0x17d)]){const _0x41f13b=_0x191cf7[_0x143269(0x1db)]?a21_0x173b75[_0x143269(0x1e0)]('✔'):a21_0x173b75[_0x143269(0x1c8)]('✘');let _0x4cd35f='';if(_0x191cf7[_0x143269(0x1db)]&&_0x191cf7[_0x143269(0x22c)]!==undefined&&_0x191cf7[_0x143269(0x149)]!==undefined){const _0x1332a2=_0x191cf7[_0x143269(0x149)][_0x143269(0x193)](0x1),_0x570d55=_0x191cf7[_0x143269(0x149)]>=0x50?a21_0x173b75[_0x143269(0x1e0)]:_0x191cf7[_0x143269(0x149)]>=0x32?a21_0x173b75[_0x143269(0x126)]:a21_0x173b75[_0x143269(0x1c8)];_0x4cd35f='\x20'+a21_0x173b75[_0x143269(0x238)]('Coverage:')+'\x20'+_0x570d55(_0x1332a2+'%')+'\x20('+formatRows(_0x191cf7[_0x143269(0x22c)])+'\x20rows)';}console['error'](_0x41f13b+'\x20'+a21_0x173b75[_0x143269(0x1ba)](_0x191cf7[_0x143269(0x1b4)])+_0x4cd35f),console[_0x143269(0x1fe)]('\x20\x20'+a21_0x173b75['dim'](_0x143269(0x21e))+'\x20'+a21_0x173b75['bold'](_0x191cf7[_0x143269(0x153)]+'.'+_0x191cf7['table']));const _0x39056e=_0x191cf7[_0x143269(0x164)]===_0x191cf7[_0x143269(0x134)]?a21_0x173b75[_0x143269(0x238)](_0x143269(0x249))+'\x20'+_0x191cf7[_0x143269(0x164)]:a21_0x173b75[_0x143269(0x238)](_0x143269(0x147))+'\x20'+_0x191cf7['joinKey']+_0x143269(0x12b)+_0x191cf7['foreignKey'];console[_0x143269(0x1fe)]('\x20\x20'+_0x39056e),console[_0x143269(0x1fe)]('\x20\x20'+a21_0x173b75['dim'](_0x143269(0x1dc))),this[_0x143269(0x1d9)](_0x191cf7[_0x143269(0x225)]),!_0x191cf7[_0x143269(0x1db)]&&console[_0x143269(0x1fe)]('\x20\x20'+a21_0x173b75[_0x143269(0x1c8)](_0x143269(0x194))+'\x20'+_0x191cf7[_0x143269(0x1d2)]);}}['displayBehaviorsStats'](_0x3fc823,_0x419698){const _0x31e946=a21_0x1b6475;if(_0x3fc823[_0x31e946(0x17b)][_0x31e946(0x15f)]===0x0)return;console['error']('\x0a'+a21_0x173b75[_0x31e946(0x238)](_0x31e946(0x212))+'\x20'+a21_0x173b75[_0x31e946(0x238)]('('+_0x419698+')'));for(const _0x519789 of _0x3fc823[_0x31e946(0x17b)]){const _0x41b783=_0x519789[_0x31e946(0x1db)]?a21_0x173b75['green']('✔'):a21_0x173b75[_0x31e946(0x1c8)]('✘');let _0x51012e='';if(_0x519789['schemaValid']&&_0x519789[_0x31e946(0x1da)]!==undefined&&_0x519789[_0x31e946(0x1ec)]!==undefined){const _0x4dc22f=_0x519789[_0x31e946(0x1e8)]?.[_0x31e946(0x193)](0x1)||'?',_0x2c34bd=(_0x519789[_0x31e946(0x1e8)]??0x0)>=0x32?a21_0x173b75[_0x31e946(0x1e0)]:(_0x519789[_0x31e946(0x1e8)]??0x0)>=0x14?a21_0x173b75['yellow']:a21_0x173b75[_0x31e946(0x1c8)];_0x51012e='\x20'+a21_0x173b75[_0x31e946(0x238)]('Customers:')+'\x20'+_0x2c34bd(formatRows(_0x519789[_0x31e946(0x1da)]))+'\x20('+_0x4dc22f+_0x31e946(0x22b)+a21_0x173b75[_0x31e946(0x238)](_0x31e946(0x17c))+'\x20'+a21_0x173b75[_0x31e946(0x152)](formatRows(_0x519789[_0x31e946(0x1ec)]));}console[_0x31e946(0x1fe)](_0x41b783+'\x20'+a21_0x173b75['bold'](_0x519789[_0x31e946(0x1b4)])+_0x51012e),console[_0x31e946(0x1fe)]('\x20\x20'+a21_0x173b75[_0x31e946(0x238)](_0x31e946(0x21e))+'\x20'+a21_0x173b75[_0x31e946(0x1ba)](_0x519789['database']+'.'+_0x519789[_0x31e946(0x183)]));const _0x28b9c4=_0x519789[_0x31e946(0x164)]===_0x519789[_0x31e946(0x134)]?a21_0x173b75[_0x31e946(0x238)](_0x31e946(0x249))+'\x20'+_0x519789[_0x31e946(0x164)]:a21_0x173b75[_0x31e946(0x238)](_0x31e946(0x147))+'\x20'+_0x519789['joinKey']+_0x31e946(0x12b)+_0x519789[_0x31e946(0x134)];console['error']('\x20\x20'+_0x28b9c4),console[_0x31e946(0x1fe)]('\x20\x20'+a21_0x173b75[_0x31e946(0x238)](_0x31e946(0x1dc))),this[_0x31e946(0x1d9)](_0x519789['columns']),!_0x519789['schemaValid']&&console[_0x31e946(0x1fe)]('\x20\x20'+a21_0x173b75[_0x31e946(0x1c8)](_0x31e946(0x194))+'\x20'+_0x519789[_0x31e946(0x1d2)]);}}[a21_0x1b6475(0x1d9)](_0x1765c1){const _0x2f4850=a21_0x1b6475;for(const _0x228bf7 of _0x1765c1){_0x228bf7[_0x2f4850(0x16a)]===_0x228bf7[_0x2f4850(0x217)]||_0x228bf7[_0x2f4850(0x217)]==='*'?console[_0x2f4850(0x1fe)](_0x2f4850(0x1a4)+_0x228bf7[_0x2f4850(0x16a)]):console['error'](_0x2f4850(0x1a4)+_0x228bf7[_0x2f4850(0x16a)]+'\x20'+a21_0x173b75[_0x2f4850(0x238)]('('+_0x228bf7[_0x2f4850(0x217)]+')'));}}[a21_0x1b6475(0x160)](_0x3d71ed){const _0x2a088f=a21_0x1b6475;console[_0x2a088f(0x1fe)]('─'[_0x2a088f(0x187)](0x3c));if(_0x3d71ed[_0x2a088f(0x179)][_0x2a088f(0x15f)]>0x0){console['error']('\x0a'+a21_0x173b75[_0x2a088f(0x1c8)](_0x2a088f(0x15c)));for(const _0x3ecb65 of _0x3d71ed['errors']){console[_0x2a088f(0x1fe)]('\x20\x20'+a21_0x173b75[_0x2a088f(0x1c8)]('•')+'\x20'+_0x3ecb65);}}_0x3d71ed[_0x2a088f(0x1a3)]&&console[_0x2a088f(0x1fe)]('\x0a'+a21_0x173b75[_0x2a088f(0x1e0)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a21_0x1b6475(0x1b4)]='segment:parent:preview';['description']='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async['execute'](_0x2c03a7){const _0x49b281=a21_0x1b6475,{options:_0x24f005,args:_0x55532a,tdx:_0x27b4de}=_0x2c03a7,_0x3433e2=_0x24f005,_0xdb3506=_0x55532a[0x0]||_0x24f005[_0x49b281(0x1e7)];if(!_0xdb3506)return showParentSegmentNotSetError(_0x49b281(0x216)+_0x49b281(0x23a)+_0x49b281(0x18e)+_0x49b281(0x1ff)+_0x49b281(0x180)+_0x49b281(0x141)+_0x49b281(0x12d)+_0x49b281(0x1f4)),0x1;if(!_0x3433e2[_0x49b281(0x23d)]&&!_0x3433e2[_0x49b281(0x1c1)]&&!_0x3433e2['behavior']&&!_0x3433e2[_0x49b281(0x21d)])return console[_0x49b281(0x1fe)](a21_0x173b75[_0x49b281(0x1c8)](_0x49b281(0x120))),console[_0x49b281(0x1fe)](_0x49b281(0x143)),console['error'](_0x49b281(0x23c)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x49b281(0x1fe)](_0x49b281(0x146)),console[_0x49b281(0x1fe)](_0x49b281(0x206)),console['error']('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x46a16c=resolveYamlFile(_0xdb3506);if(!existsSync(_0x46a16c))return showFileNotFoundError(_0x46a16c,_0xdb3506),0x1;_0x3433e2[_0x49b281(0x241)]&&(console[_0x49b281(0x1fe)](_0x49b281(0x220)+_0x3433e2[_0x49b281(0x1ef)]),console[_0x49b281(0x1fe)](_0x49b281(0x1d6)+_0x46a16c));let _0x17a9cd;try{_0x17a9cd=readFileSync(_0x46a16c,_0x49b281(0x1fd));}catch(_0x50ad60){const _0x245868=_0x50ad60 instanceof Error?_0x50ad60[_0x49b281(0x16f)]:String(_0x50ad60);return console[_0x49b281(0x1fe)](_0x49b281(0x166)+_0x245868),0x1;}let _0x646330;try{_0x646330=parseDef(_0x17a9cd);}catch(_0x205156){const _0x446549=_0x205156 instanceof Error?_0x205156[_0x49b281(0x16f)]:String(_0x205156);return console['error'](a21_0x173b75[_0x49b281(0x1c8)](_0x49b281(0x214)+_0x446549)),0x1;}if(_0x3433e2['attribute']===!![]||_0x3433e2[_0x49b281(0x1c1)]===''){const _0x59e834=_0x646330[_0x49b281(0x17d)]?.['map'](_0x58fcce=>_0x58fcce['name'])||[];if(_0x59e834['length']===0x0)console['error'](a21_0x173b75['red'](_0x49b281(0x1a8)));else{console['error'](a21_0x173b75[_0x49b281(0x1c8)](_0x49b281(0x196))),console['error'](_0x49b281(0x1f3));for(const _0x57c831 of _0x59e834){console['error']('\x20\x20'+a21_0x173b75[_0x49b281(0x152)](_0x57c831));}console[_0x49b281(0x1fe)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0xdb3506+_0x49b281(0x175)+_0x59e834[0x0]+'\x22');}return 0x1;}if(_0x3433e2[_0x49b281(0x181)]===!![]||_0x3433e2['behavior']===''){const _0x27c160=_0x646330[_0x49b281(0x17b)]?.[_0x49b281(0x151)](_0x44a2ed=>_0x44a2ed[_0x49b281(0x1b4)])||[];if(_0x27c160['length']===0x0)console[_0x49b281(0x1fe)](a21_0x173b75[_0x49b281(0x1c8)](_0x49b281(0x223)));else{console[_0x49b281(0x1fe)](a21_0x173b75[_0x49b281(0x1c8)](_0x49b281(0x23e))),console[_0x49b281(0x1fe)]('Available\x20behaviors:');for(const _0x5ed0f2 of _0x27c160){console[_0x49b281(0x1fe)]('\x20\x20'+a21_0x173b75['cyan'](_0x5ed0f2));}console[_0x49b281(0x1fe)](_0x49b281(0x247)+_0xdb3506+'\x20--behavior\x20\x22'+_0x27c160[0x0]+'\x22');}return 0x1;}const _0x528f12=createCommandSpinner(a21_0x173b75[_0x49b281(0x238)](_0x49b281(0x232)),{'verbose':_0x3433e2['verbose']});_0x528f12[_0x49b281(0x128)]();const _0x2dd685={'onProgress':_0x50ff80=>{_0x528f12['text']=formatProgressMessage(_0x50ff80);}};if(_0x3433e2[_0x49b281(0x23d)])_0x2dd685[_0x49b281(0x23d)]=!![];if(_0x3433e2[_0x49b281(0x1c1)]&&typeof _0x3433e2[_0x49b281(0x1c1)]===_0x49b281(0x210))_0x2dd685[_0x49b281(0x1c1)]=_0x3433e2[_0x49b281(0x1c1)];if(_0x3433e2[_0x49b281(0x181)]&&typeof _0x3433e2[_0x49b281(0x181)]===_0x49b281(0x210))_0x2dd685[_0x49b281(0x181)]=_0x3433e2[_0x49b281(0x181)];if(_0x3433e2[_0x49b281(0x21d)])_0x2dd685['enriched']=!![];if(_0x3433e2['interval'])_0x2dd685[_0x49b281(0x12f)]=_0x3433e2[_0x49b281(0x12f)];let _0x21b473;try{_0x21b473=await _0x27b4de[_0x49b281(0x192)][_0x49b281(0x1f5)](_0x17a9cd,_0x2dd685),_0x528f12[_0x49b281(0x14c)]();}catch(_0x378b6d){_0x528f12[_0x49b281(0x14c)]();throw _0x378b6d;}return await this[_0x49b281(0x1c5)](_0x21b473,{'master':_0x3433e2['master'],'attribute':typeof _0x3433e2[_0x49b281(0x1c1)]===_0x49b281(0x210)?_0x3433e2[_0x49b281(0x1c1)]:undefined,'behavior':typeof _0x3433e2[_0x49b281(0x181)]===_0x49b281(0x210)?_0x3433e2[_0x49b281(0x181)]:undefined,'enriched':_0x3433e2[_0x49b281(0x21d)]}),_0x21b473[_0x49b281(0x1a3)]?0x0:0x1;}async[a21_0x1b6475(0x1c5)](_0x20d30d,_0x46a881){const _0x2bd6e1=a21_0x1b6475;console['error']('\x0a'+a21_0x173b75[_0x2bd6e1(0x1ba)](_0x2bd6e1(0x163))+'\x20'+_0x20d30d[_0x2bd6e1(0x1b4)]),console[_0x2bd6e1(0x1fe)]('═'['repeat'](0x3c));if(_0x46a881[_0x2bd6e1(0x23d)]&&_0x20d30d[_0x2bd6e1(0x172)]){const _0x4b1438=a21_0x173b75[_0x2bd6e1(0x238)](_0x2bd6e1(0x139))+'\x20'+a21_0x173b75[_0x2bd6e1(0x1ba)](_0x20d30d[_0x2bd6e1(0x23d)]['database']+'.'+_0x20d30d['master'][_0x2bd6e1(0x183)]);await this[_0x2bd6e1(0x219)](_0x4b1438,_0x20d30d['sampleData']);}else{if(_0x46a881[_0x2bd6e1(0x1c1)]&&_0x20d30d[_0x2bd6e1(0x172)]){const _0x7f3f9d=a21_0x173b75[_0x2bd6e1(0x238)](_0x2bd6e1(0x170))+'\x20'+a21_0x173b75[_0x2bd6e1(0x1ba)](_0x46a881['attribute']);await this[_0x2bd6e1(0x219)](_0x7f3f9d,_0x20d30d[_0x2bd6e1(0x172)]);}else{if(_0x46a881[_0x2bd6e1(0x181)]&&_0x20d30d['sampleData']){const _0x46cefc=a21_0x173b75['dim'](_0x2bd6e1(0x243))+'\x20'+a21_0x173b75[_0x2bd6e1(0x1ba)](_0x46a881['behavior']);await this[_0x2bd6e1(0x219)](_0x46cefc,_0x20d30d[_0x2bd6e1(0x172)]);}else{if(_0x46a881[_0x2bd6e1(0x21d)]&&_0x20d30d[_0x2bd6e1(0x172)]){const _0x179a44=a21_0x173b75[_0x2bd6e1(0x238)](_0x2bd6e1(0x1bf))+'\x20'+a21_0x173b75['bold'](_0x2bd6e1(0x1ab));await this[_0x2bd6e1(0x219)](_0x179a44,_0x20d30d[_0x2bd6e1(0x172)]);}else!_0x20d30d[_0x2bd6e1(0x172)]&&console['error'](_0x2bd6e1(0x1cc));}}}if(_0x20d30d[_0x2bd6e1(0x179)]['length']>0x0){console[_0x2bd6e1(0x1fe)]('─'[_0x2bd6e1(0x187)](0x3c)),console[_0x2bd6e1(0x1fe)]('\x0a'+a21_0x173b75['red'](_0x2bd6e1(0x15c)));for(const _0x50846e of _0x20d30d['errors']){console[_0x2bd6e1(0x1fe)]('\x20\x20'+a21_0x173b75[_0x2bd6e1(0x1c8)]('•')+'\x20'+_0x50846e);}}}async[a21_0x1b6475(0x219)](_0xec8d4,_0x2a0219){const _0x23f6b6=a21_0x1b6475;if(_0x2a0219['length']===0x0){console[_0x23f6b6(0x1fe)]('\x0a'+_0xec8d4),console['error'](_0x23f6b6(0x208));return;}console[_0x23f6b6(0x1fe)]('\x0a'+_0xec8d4);const _0x373a93=Object[_0x23f6b6(0x189)](_0x2a0219[0x0])[_0x23f6b6(0x151)](_0x5e85de=>({'name':_0x5e85de,'type':typeof _0x2a0219[0x0][_0x5e85de]==='number'?_0x23f6b6(0x188):_0x23f6b6(0x12c)})),_0x387190={'queryId':_0x23f6b6(0x122),'columns':_0x373a93,'data':_0x2a0219,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2a0219['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x1f3a2a=formatAsTable(_0x387190,_0x2a0219[_0x23f6b6(0x15f)],!![]);await writeOutput(_0x1f3a2a,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x15a);[a21_0x1b6475(0x144)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a21_0x1b6475(0x129)](_0x47c32f){const _0x1b5127=a21_0x1b6475,{options:_0x35278a,args:_0x30f427,tdx:_0x519d17}=_0x47c32f,_0x459547=_0x35278a,_0x1f4e5c=_0x30f427[0x0]||_0x35278a[_0x1b5127(0x1e7)];if(!_0x1f4e5c)return showParentSegmentNotSetError(_0x1b5127(0x1e5)+_0x1b5127(0x21a)),0x1;const _0x5dbcdb=resolveYamlFile(_0x1f4e5c);if(existsSync(_0x5dbcdb)){_0x459547['verbose']&&console[_0x1b5127(0x1fe)]('Found\x20YAML\x20file:\x20'+_0x5dbcdb);let _0x2e40fd;try{_0x2e40fd=readFileSync(_0x5dbcdb,_0x1b5127(0x1fd));}catch(_0x307a7d){const _0x1e303f=_0x307a7d instanceof Error?_0x307a7d[_0x1b5127(0x16f)]:String(_0x307a7d);return console[_0x1b5127(0x1fe)](_0x1b5127(0x166)+_0x1e303f),0x1;}const _0x37269b=await withSpinner('Analyzing\x20changes...',()=>_0x519d17[_0x1b5127(0x192)][_0x1b5127(0x1d0)](_0x2e40fd),{'verbose':_0x459547[_0x1b5127(0x241)]}),_0x3970cb=_0x37269b[_0x1b5127(0x1c6)],{isNew:_0x21827f,name:_0x529884,hasChanges:_0x218c51,diffFormatted:_0x3e5e28}=_0x3970cb;if(_0x218c51){_0x21827f?console[_0x1b5127(0x1fe)](_0x1b5127(0x20b)+_0x529884+'\x27:'):console['error'](_0x1b5127(0x1de)+_0x529884+'\x27:');console[_0x1b5127(0x1fe)]('─'[_0x1b5127(0x187)](0x3c)),console[_0x1b5127(0x1fe)](_0x3e5e28),console[_0x1b5127(0x1fe)]('─'['repeat'](0x3c));const _0x5d35f0=_0x21827f?_0x1b5127(0x13c)+_0x529884+_0x1b5127(0x13f):_0x1b5127(0x18f)+_0x529884+_0x1b5127(0x13f);if(!_0x459547[_0x1b5127(0x1e9)]){const _0x2cac22=await confirmKey(_0x5d35f0);if(!_0x2cac22)return console['error'](_0x1b5127(0x230)),0x1;}const _0x49fd25=_0x21827f?_0x1b5127(0x1e6):_0x1b5127(0x11e);await withSpinner(_0x49fd25+_0x1b5127(0x203)+_0x529884+_0x1b5127(0x1ce),()=>_0x3970cb['apply'](),{'verbose':_0x459547[_0x1b5127(0x241)]});const _0x11af75=_0x21827f?_0x1b5127(0x1c7):_0x1b5127(0x1bd);console[_0x1b5127(0x1fe)]('✔\x20'+_0x11af75+_0x1b5127(0x203)+_0x529884+'\x27');}else console[_0x1b5127(0x1fe)](_0x1b5127(0x1bb)+_0x529884+'\x27\x20is\x20up\x20to\x20date');}const _0xc6650b=await withSpinner(_0x1b5127(0x1d5)+_0x1f4e5c+_0x1b5127(0x1ce),()=>_0x519d17['segment']['runParent'](_0x1f4e5c),{'verbose':_0x459547[_0x1b5127(0x241)]}),_0xbc76de=_0xc6650b[_0x1b5127(0x1c6)],_0x23a261=getConsoleUrl(_0x459547[_0x1b5127(0x1ef)],'/app/workflows/'+_0xbc76de[_0x1b5127(0x167)]+_0x1b5127(0x1f6)+_0xbc76de[_0x1b5127(0x211)]+_0x1b5127(0x13d)+_0xbc76de['workflowAttemptId']);return console[_0x1b5127(0x1fe)](_0x1b5127(0x202)),console['error']('\x20\x20'+a21_0x173b75[_0x1b5127(0x238)](_0x1b5127(0x1a7))+'\x20'+_0xbc76de[_0x1b5127(0x18c)]),console['error']('\x20\x20'+a21_0x173b75[_0x1b5127(0x238)](_0x1b5127(0x16d))+'\x20'+_0xbc76de[_0x1b5127(0x133)]),console['error']('\x20\x20'+a21_0x173b75[_0x1b5127(0x238)]('Session:')+'\x20'+_0xbc76de[_0x1b5127(0x211)]),console[_0x1b5127(0x1fe)]('\x20\x20'+a21_0x173b75[_0x1b5127(0x238)](_0x1b5127(0x138))+'\x20'+_0xbc76de[_0x1b5127(0x22e)]),console[_0x1b5127(0x1fe)]('\x20\x20'+_0x23a261),console[_0x1b5127(0x1fe)]('\x0a'+a21_0x173b75['dim'](_0x1b5127(0x218))+_0x1b5127(0x22d)+_0xbc76de['workflowAttemptId']+_0x1b5127(0x1e4)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x182);[a21_0x1b6475(0x144)]=a21_0x1b6475(0x1a2);async[a21_0x1b6475(0x129)](_0x41acef){const _0x2ebfa5=a21_0x1b6475,{options:_0x3a289f,args:_0x4742e6,tdx:_0x4ee666}=_0x41acef,_0x3d7c65=_0x4742e6[0x0]||_0x3a289f[_0x2ebfa5(0x1e7)];if(!_0x3d7c65)return showParentSegmentNotSetError(_0x2ebfa5(0x22a)+_0x2ebfa5(0x154)),0x1;_0x3a289f[_0x2ebfa5(0x241)]&&(console['error']('Site:\x20'+_0x3a289f['site']),console[_0x2ebfa5(0x1fe)](_0x2ebfa5(0x145)+_0x3d7c65));const _0x138afa=await withSpinner(_0x2ebfa5(0x1cd)+_0x3d7c65+_0x2ebfa5(0x1ce),()=>_0x4ee666[_0x2ebfa5(0x192)][_0x2ebfa5(0x178)](_0x3d7c65),{'verbose':_0x3a289f[_0x2ebfa5(0x241)]}),_0x522cb6=_0x138afa[_0x2ebfa5(0x1c6)];console[_0x2ebfa5(0x1fe)](_0x2ebfa5(0x130)+_0x522cb6[_0x2ebfa5(0x15f)]+_0x2ebfa5(0x157)+(_0x522cb6[_0x2ebfa5(0x15f)]!==0x1?'s':''));if(_0x3a289f['json']||_0x3a289f['jsonl'])return await handleSDKOutput(_0x522cb6,_0x3a289f),0x0;return displayFieldsHumanReadable(_0x522cb6,_0x3d7c65),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']='segment:parent:view';[a21_0x1b6475(0x144)]=a21_0x1b6475(0x11f);async['execute'](_0x541df4){const _0x38868b=a21_0x1b6475,{options:_0xb6a9ae,args:_0x1e89a3,tdx:_0x46920a}=_0x541df4,_0x15dbc6=_0xb6a9ae,_0x590054=_0x1e89a3[0x0]||_0xb6a9ae[_0x38868b(0x1e7)];if(!_0x590054)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x38868b(0x227)+'Options:\x0a'+_0x38868b(0x235)),0x1;_0xb6a9ae[_0x38868b(0x241)]&&(console[_0x38868b(0x1fe)]('Site:\x20'+_0xb6a9ae['site']),console[_0x38868b(0x1fe)](_0x38868b(0x145)+_0x590054));const _0x305f30=await withSpinner(_0x38868b(0x244)+_0x590054+_0x38868b(0x1ce),()=>_0x46920a[_0x38868b(0x192)]['getParentFull'](_0x590054),{'verbose':_0xb6a9ae[_0x38868b(0x241)]}),_0x521337=_0x305f30['data'];if(_0x15dbc6[_0x38868b(0x1a6)]){const _0x11a605=getConsoleNextUrl(_0x15dbc6[_0x38868b(0x1ef)],'/app/dw/parentSegments/'+_0x521337['id']);return console[_0x38868b(0x1fe)](a21_0x173b75[_0x38868b(0x1e0)]('✔')+_0x38868b(0x190)+a21_0x173b75[_0x38868b(0x152)](_0x11a605)),openBrowser(_0x11a605),0x0;}return await handleSingleObjectOutput(_0x521337,_0xb6a9ae),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x1ac);['description']=a21_0x1b6475(0x136);async[a21_0x1b6475(0x129)](_0x169fdd){const _0x46ebad=a21_0x1b6475,{options:_0xce9885,args:_0x39717a,tdx:_0x17167d}=_0x169fdd,_0x3e6485=_0x39717a[0x0]||_0xce9885[_0x46ebad(0x1e7)];if(!_0x3e6485)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+_0x46ebad(0x174)),0x1;_0xce9885[_0x46ebad(0x241)]&&(console[_0x46ebad(0x1fe)](_0x46ebad(0x220)+_0xce9885['site']),console[_0x46ebad(0x1fe)](_0x46ebad(0x145)+_0x3e6485));const _0x4973b5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3e6485+_0x46ebad(0x1ce),()=>_0x17167d['segment']['resolveParentId'](_0x3e6485),{'verbose':_0xce9885[_0x46ebad(0x241)]}),_0x133a49=_0x4973b5[_0x46ebad(0x1c6)],_0x81fa8=await withSpinner(_0x46ebad(0x1ae)+_0x3e6485+_0x46ebad(0x1ce),()=>_0x17167d[_0x46ebad(0x192)][_0x46ebad(0x127)](_0x133a49),{'verbose':_0xce9885[_0x46ebad(0x241)]}),_0x21004c=await executeSchemaQuery(_0x81fa8['data'],_0x17167d,_0xce9885);return await handleQueryOutput(_0x21004c,_0xce9885),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x1e1);[a21_0x1b6475(0x144)]=a21_0x1b6475(0x224);async[a21_0x1b6475(0x129)](_0x15b57b){const _0x4a4a0b=a21_0x1b6475,{options:_0x23c4cc,args:_0x2479e1,tdx:_0x4741cb}=_0x15b57b,_0x478db1=_0x2479e1[0x0]||_0x23c4cc[_0x4a4a0b(0x1e7)];if(!_0x478db1)return showParentSegmentNotSetError(_0x4a4a0b(0x23b)+_0x4a4a0b(0x231)),0x1;_0x23c4cc[_0x4a4a0b(0x241)]&&(console[_0x4a4a0b(0x1fe)](_0x4a4a0b(0x220)+_0x23c4cc[_0x4a4a0b(0x1ef)]),console['error'](_0x4a4a0b(0x145)+_0x478db1));const _0x5388a3=await withSpinner(_0x4a4a0b(0x19c)+_0x478db1+_0x4a4a0b(0x1ce),()=>_0x4741cb[_0x4a4a0b(0x192)]['resolveParentId'](_0x478db1),{'verbose':_0x23c4cc[_0x4a4a0b(0x241)]}),_0x1ada0=_0x5388a3[_0x4a4a0b(0x1c6)],_0x29fee3=await withSpinner(_0x4a4a0b(0x1ae)+_0x478db1+_0x4a4a0b(0x1ce),()=>_0x4741cb[_0x4a4a0b(0x192)][_0x4a4a0b(0x127)](_0x1ada0),{'verbose':_0x23c4cc[_0x4a4a0b(0x241)]}),_0x1bc255=_0x29fee3[_0x4a4a0b(0x1c6)];return _0x23c4cc[_0x4a4a0b(0x1b6)]===_0x4a4a0b(0x13b)||_0x23c4cc[_0x4a4a0b(0x1b6)]==='jsonl'?await handleSDKOutput([{'sql':_0x1bc255}],_0x23c4cc):console[_0x4a4a0b(0x1b0)](_0x1bc255),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a21_0x1b6475(0x1b4)]=a21_0x1b6475(0x1af);[a21_0x1b6475(0x144)]=a21_0x1b6475(0x1cf);async[a21_0x1b6475(0x129)](_0xa7198f){const _0x55be7c=a21_0x1b6475,{options:_0xe5e5d8,args:_0x3a5cc9,tdx:_0x348efb}=_0xa7198f,_0x3bb1ca=_0x3a5cc9[0x0]||_0xe5e5d8['parentSegment'];if(!_0x3bb1ca)return showParentSegmentNotSetError(_0x55be7c(0x17a)+_0x55be7c(0x215)),0x1;_0xe5e5d8[_0x55be7c(0x241)]&&(console[_0x55be7c(0x1fe)](_0x55be7c(0x220)+_0xe5e5d8[_0x55be7c(0x1ef)]),console[_0x55be7c(0x1fe)](_0x55be7c(0x145)+_0x3bb1ca));const _0xa657b4=await withSpinner(_0x55be7c(0x19c)+_0x3bb1ca+_0x55be7c(0x1ce),()=>_0x348efb['segment'][_0x55be7c(0x1fb)](_0x3bb1ca),{'verbose':_0xe5e5d8[_0x55be7c(0x241)]}),_0x1724ff=_0xa657b4[_0x55be7c(0x1c6)],_0x43a3ba=await withSpinner(_0x55be7c(0x1ae)+_0x3bb1ca+_0x55be7c(0x1ce),()=>_0x348efb[_0x55be7c(0x192)][_0x55be7c(0x127)](_0x1724ff),{'verbose':_0xe5e5d8[_0x55be7c(0x241)]});let _0x33b105=_0x43a3ba[_0x55be7c(0x1c6)];const _0x4c28d7=resolveLimit(_0xe5e5d8[_0x55be7c(0x199)],DEFAULT_DISPLAY_LIMIT),_0xd825ee=/\bLIMIT\s+\d+/i['test'](_0x33b105);!_0xd825ee&&(_0x33b105=_0x33b105[_0x55be7c(0x24a)]()['replace'](/;+$/,''),_0x33b105=_0x55be7c(0x1ee)+_0x33b105+_0x55be7c(0x137)+_0x4c28d7);_0xe5e5d8['verbose']&&console[_0x55be7c(0x1fe)](_0x55be7c(0x1f7)+_0x33b105);const _0x2b4a11=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x1d5164=>{const _0x4ac10b=_0x55be7c,_0x1d61d0=await _0x348efb['query'][_0x4ac10b(0x129)](_0x33b105,{'catalog':'td','schema':_0x4ac10b(0x17f),'onJobId':_0x35a1dd=>{const _0x2cf7af=_0x4ac10b;_0x1d5164[_0x2cf7af(0x1c2)](_0x35a1dd);}});return _0x1d61d0;},{'verbose':_0xe5e5d8[_0x55be7c(0x241)]}),_0x594545=_0x2b4a11[_0x55be7c(0x1c6)],_0x17171d=_0x594545['jobId']?_0x55be7c(0x17e)+_0x594545[_0x55be7c(0x1d7)]+']':'';return console[_0x55be7c(0x1fe)](_0x55be7c(0x1fc)+_0x594545[_0x55be7c(0x132)][_0x55be7c(0x213)]['toLocaleString']()+_0x55be7c(0x242)+('in\x20'+formatElapsed(_0x594545[_0x55be7c(0x132)][_0x55be7c(0x1d1)])+_0x17171d)),await handleQueryOutput(_0x594545,_0xe5e5d8),0x0;}}
|
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
5
|
* tdx profile # List all profiles (same as tdx profiles)
|
|
6
|
-
* tdx profile create
|
|
6
|
+
* tdx profile create [name] # Create a new profile (optionally specify name)
|
|
7
7
|
* tdx profile remove <name> # Remove a profile
|
|
8
8
|
* tdx profile set <key>=<value> # Set a profile configuration value
|
|
9
9
|
* tdx profile use <name> # Set session profile
|
|
10
10
|
*/
|
|
11
11
|
import { BaseCommand, type CommandContext } from './command.js';
|
|
12
12
|
/**
|
|
13
|
-
* Profile create command - Create a new profile
|
|
14
|
-
* Similar to 'tdx auth setup --profile xxx' but more discoverable
|
|
13
|
+
* Profile create command - Create a new profile
|
|
15
14
|
*/
|
|
16
15
|
export declare class ProfileCreateCommand extends BaseCommand {
|
|
17
16
|
readonly name = "profile:create";
|
|
18
|
-
readonly description = "Create a new profile
|
|
17
|
+
readonly description = "Create a new profile";
|
|
19
18
|
execute(context: CommandContext): Promise<number>;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-command.d.ts","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"profile-command.d.ts","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AA0ChF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,0BAA0B;IAExC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgLxD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,sBAAsB;IAE1C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAQzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAwDxD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,uCAAuC;IAG3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAqF;IAEvH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IA0BzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAkGxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,yBAAyB;IAE7C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAQzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAiCxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x2cdd56=a22_0x53db;(function(_0x114d9e,_0x261f9b){const _0x4114e8=a22_0x53db,_0xe400a9=_0x114d9e();while(!![]){try{const _0xc27b1e=parseInt(_0x4114e8(0x140))/0x1*(-parseInt(_0x4114e8(0x130))/0x2)+parseInt(_0x4114e8(0x11b))/0x3*(parseInt(_0x4114e8(0x125))/0x4)+parseInt(_0x4114e8(0xf5))/0x5*(-parseInt(_0x4114e8(0x115))/0x6)+parseInt(_0x4114e8(0xf1))/0x7+-parseInt(_0x4114e8(0x13e))/0x8*(-parseInt(_0x4114e8(0x117))/0x9)+parseInt(_0x4114e8(0x14f))/0xa+-parseInt(_0x4114e8(0x121))/0xb;if(_0xc27b1e===_0x261f9b)break;else _0xe400a9['push'](_0xe400a9['shift']());}catch(_0x2cf97c){_0xe400a9['push'](_0xe400a9['shift']());}}}(a22_0x1a78,0x5925a));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile}from'../core/profile.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a22_0x1a78(){const _0x264256=['error','value','Changing\x20site\x20to\x20\x27','\x20Profile\x20\x27','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','API\x20key\x20cannot\x20be\x20empty','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Session\x20profile\x20set\x20to:\x20','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','create','us01','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x0aSetup\x20cancelled','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','Profile\x20\x27','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','\x20\x20tdx\x20--profile\x20','confirm','4832163iasVVZ','profile:create','push','eu\x20\x20\x20-\x20Europe','54445kDqnCK','✗\x20Validation\x20failed:\x20','jp\x20\x20\x20-\x20Japan','Site\x20name\x20cannot\x20be\x20empty','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','toString','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','description','session','Enter\x20site\x20name:','customSite','ap02','bold','validate','execute','profile','jobs','select','yellow','You\x20can\x20find\x20your\x20API\x20key\x20at:','red','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','\x27\x20removed\x20from\x20configuration','split','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','Remove\x20a\x20profile','\x27\x20does\x20not\x20exist.\x20Create\x20it?','other','jp01','getUserInfo','text','log','108VEpJye','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','2477016nZLAQd','ERROR','(session:\x20','\x20API\x20key\x20saved\x20to\x20system\x20keychain','17058bucNce','llm_project','(cleared)','warn','test','site','9661707xvHNTA','status','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','\x0aAvailable\x20profiles:','188JfYGJJ','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','profile:remove','includes','\x27\x20does\x20not\x20exist.','\x20\x20(no\x20profiles\x20found)','apiKey','\x20API\x20key\x20is\x20valid\x20(User:\x20','name','length','Profile\x20name\x20cannot\x20be\x20empty','10IBTFTj','Failed\x20to\x20remove\x20profile:\x20','join','\x20API\x20key\x20removed\x20from\x20system\x20keychain','password','profile:use','Site\x20was\x20not\x20changed.','trim','VALID_KEYS','profile:set','\x20\x20-\x20','/app/mp/ak','\x27.\x0a\x0aValid\x20keys:\x20','email','8nXumHF','us\x20\x20\x20-\x20United\x20States','38342gZdaso','Removal\x20cancelled','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','green','eu01','logLevel','message','config','tdx:\x20profile\x20set','dim','tdx:\x20profile\x20remove','Set\x20session\x20profile','Set\x20a\x20profile\x20configuration\x20value','Create\x20a\x20new\x20profile\x20interactively','profileName','3984200RKQnAu','Enter\x20description\x20(optional):','Validating\x20API\x20key...'];a22_0x1a78=function(){return _0x264256;};return a22_0x1a78();}import{HTTPClientError}from'../sdk/client/http-client.js';function a22_0x53db(_0x4d18bd,_0x102cab){_0x4d18bd=_0x4d18bd-0xee;const _0x1a78a2=a22_0x1a78();let _0x53dbc4=_0x1a78a2[_0x4d18bd];return _0x53dbc4;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a22_0x3b4c16 from'prompts';import a22_0x4528d7 from'chalk';export class ProfileCreateCommand extends BaseCommand{['name']=a22_0x2cdd56(0xf2);[a22_0x2cdd56(0xfc)]=a22_0x2cdd56(0x14d);async[a22_0x2cdd56(0x103)](_0x2254b8){const _0x1fc503=a22_0x2cdd56,{options:_0x30bee4}=_0x2254b8;console[_0x1fc503(0x114)](a22_0x4528d7['bold']('tdx:\x20profile\x20create'));const _0xb65455=await a22_0x3b4c16({'type':'text','name':_0x1fc503(0x14e),'message':'Enter\x20profile\x20name:','validate':_0x20c84c=>{const _0x1d9955=_0x1fc503;if(!_0x20c84c||!_0x20c84c[_0x1d9955(0x137)]())return _0x1d9955(0x12f);if(!/^[a-zA-Z0-9_-]+$/['test'](_0x20c84c[_0x1d9955(0x137)]()))return _0x1d9955(0x10d);if(profileExists(_0x20c84c[_0x1d9955(0x137)]()))return'Profile\x20\x27'+_0x20c84c[_0x1d9955(0x137)]()+'\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.';return!![];}});if(!_0xb65455[_0x1fc503(0x14e)])return console['log'](_0x1fc503(0x15e)),0x1;const _0x3aefcc=_0xb65455[_0x1fc503(0x14e)][_0x1fc503(0x137)](),_0x120e28=await a22_0x3b4c16({'type':_0x1fc503(0x113),'name':'description','message':_0x1fc503(0x150)}),_0x9b4573=_0x120e28[_0x1fc503(0xfc)]?.[_0x1fc503(0x137)]()||undefined,_0x306d83=_0x30bee4['site']||_0x1fc503(0x15c),_0x210713=[{'title':_0x1fc503(0x13f),'value':_0x1fc503(0x15c)},{'title':_0x1fc503(0xf7),'value':_0x1fc503(0x111)},{'title':_0x1fc503(0xf4),'value':_0x1fc503(0x144)},{'title':'ap02\x20-\x20Korea','value':_0x1fc503(0x100)}];let _0x1c701a=_0x210713['findIndex'](_0x115b6a=>_0x115b6a[_0x1fc503(0x153)]===_0x306d83);_0x1c701a===-0x1&&_0x306d83!==_0x1fc503(0x15c)&&(_0x210713['push']({'title':_0x306d83,'value':_0x306d83}),_0x1c701a=_0x210713[_0x1fc503(0x12e)]-0x1);_0x210713[_0x1fc503(0xf3)]({'title':'Enter\x20custom\x20site','value':_0x1fc503(0x110)});const _0x207a74=await a22_0x3b4c16({'type':_0x1fc503(0x106),'name':_0x1fc503(0x120),'message':_0x1fc503(0xf9)+_0x3aefcc+'\x27:','choices':_0x210713,'initial':_0x1c701a>=0x0?_0x1c701a:0x0});if(!_0x207a74[_0x1fc503(0x120)])return console[_0x1fc503(0x114)](_0x1fc503(0x15e)),0x1;let _0x3ee8f6;if(_0x207a74[_0x1fc503(0x120)]===_0x1fc503(0x110)){const _0x41406b=await a22_0x3b4c16({'type':_0x1fc503(0x113),'name':'customSite','message':_0x1fc503(0xfe),'initial':_0x1fc503(0x15c),'validate':_0x115028=>{const _0x43bd26=_0x1fc503;if(!_0x115028||!_0x115028[_0x43bd26(0x137)]())return _0x43bd26(0xf8);if(!/^[a-z0-9-]+$/[_0x43bd26(0x11f)](_0x115028['trim']()))return _0x43bd26(0x156);return!![];}});if(!_0x41406b['customSite'])return console[_0x1fc503(0x114)]('\x0aSetup\x20cancelled'),0x1;_0x3ee8f6=_0x41406b[_0x1fc503(0xff)];}else _0x3ee8f6=_0x207a74[_0x1fc503(0x120)];const _0x2d0d94=resolveSite(_0x3ee8f6);console[_0x1fc503(0x114)]('\x0aSetting\x20up\x20authentication\x20for\x20site:\x20'+_0x2d0d94),console[_0x1fc503(0x114)](_0x1fc503(0x108)),console[_0x1fc503(0x114)]('\x20\x20'+getConsoleUrl(_0x2d0d94,_0x1fc503(0x13b)));const _0x566f07=await a22_0x3b4c16({'type':_0x1fc503(0x134),'name':_0x1fc503(0x12b),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x58706f=>{const _0x17b7f5=_0x1fc503;if(!_0x58706f||!_0x58706f[_0x17b7f5(0x137)]())return _0x17b7f5(0x157);return!![];}});if(!_0x566f07['apiKey'])return console['log'](_0x1fc503(0x15e)),0x1;const _0x1931a8=_0x566f07[_0x1fc503(0x12b)];console['log'](_0x1fc503(0x151));try{const _0x6bb142=TDX['create']({'site':_0x2d0d94,'apiKey':_0x1931a8[_0x1fc503(0x137)](),'logLevel':_0x30bee4[_0x1fc503(0x145)]??LogLevel[_0x1fc503(0x118)]}),_0x5bf01a=await _0x6bb142[_0x1fc503(0x105)][_0x1fc503(0x112)]();console[_0x1fc503(0x114)](a22_0x4528d7[_0x1fc503(0x143)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x5bf01a[_0x1fc503(0x13d)]+')');const _0x3b32ca=await isKeychainAvailable();_0x3b32ca?(await saveAPIKeyAsync(_0x1931a8[_0x1fc503(0x137)](),_0x2d0d94,_0x3aefcc),console[_0x1fc503(0x114)](a22_0x4528d7[_0x1fc503(0x143)]('✓')+_0x1fc503(0x142)+_0x3aefcc+')')):(console[_0x1fc503(0x11e)](a22_0x4528d7['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x1fc503(0x11e)](a22_0x4528d7[_0x1fc503(0x107)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x1531fe={'site':_0x2d0d94,..._0x9b4573&&{'description':_0x9b4573}};return saveProfileToUserConfig(_0x3aefcc,_0x1531fe),console['log'](a22_0x4528d7[_0x1fc503(0x143)]('✓')+_0x1fc503(0x155)+_0x3aefcc+'\x27\x20created'),console['log'](),console[_0x1fc503(0x114)](_0x1fc503(0xee)),console[_0x1fc503(0x114)](_0x1fc503(0xef)+_0x3aefcc+_0x1fc503(0x158)),console[_0x1fc503(0x114)](_0x1fc503(0xef)+_0x3aefcc+_0x1fc503(0x116)),0x0;}catch(_0x4287b9){if(_0x4287b9 instanceof HTTPClientError&&_0x4287b9[_0x1fc503(0x122)]===0x191)return printAuthError(_0x4287b9),0x1;return console[_0x1fc503(0x152)](a22_0x4528d7['red']('✗\x20Validation\x20failed:\x20'+(_0x4287b9 instanceof Error?_0x4287b9[_0x1fc503(0x146)]:String(_0x4287b9)))),console['error'](_0x1fc503(0x10a)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{['name']=a22_0x2cdd56(0x127);[a22_0x2cdd56(0xfc)]=a22_0x2cdd56(0x10e);['validate'](_0x9ab473){const _0x1cffe4=a22_0x2cdd56,{args:_0x4bb6f1}=_0x9ab473;if(_0x4bb6f1[_0x1cffe4(0x12e)]===0x0)return _0x1cffe4(0x15a);return undefined;}async[a22_0x2cdd56(0x103)](_0x3184bc){const _0x2cef55=a22_0x2cdd56,{args:_0x1cb192}=_0x3184bc,_0x118ff3=_0x1cb192[0x0];console['log'](a22_0x4528d7[_0x2cef55(0x101)](_0x2cef55(0x14a)));if(!profileExists(_0x118ff3)){console['error'](a22_0x4528d7[_0x2cef55(0x109)](_0x2cef55(0x160)+_0x118ff3+_0x2cef55(0x129))),console[_0x2cef55(0x114)]('\x0aAvailable\x20profiles:');const _0x587bbb=listProfiles();if(_0x587bbb[_0x2cef55(0x12e)]===0x0)console[_0x2cef55(0x114)](_0x2cef55(0x12a));else for(const _0x203690 of _0x587bbb){console[_0x2cef55(0x114)]('\x20\x20-\x20'+_0x203690[_0x2cef55(0x12d)]);}return 0x1;}const _0x16912e=await a22_0x3b4c16({'type':_0x2cef55(0xf0),'name':_0x2cef55(0xf0),'message':_0x2cef55(0x123)+_0x118ff3+'\x27?','initial':![]});if(!_0x16912e[_0x2cef55(0xf0)])return console[_0x2cef55(0x114)](_0x2cef55(0x141)),0x0;try{removeProfileFromUserConfig(_0x118ff3),console['log'](a22_0x4528d7[_0x2cef55(0x143)]('✓')+'\x20Profile\x20\x27'+_0x118ff3+_0x2cef55(0x10b));}catch(_0x573108){return console[_0x2cef55(0x152)](a22_0x4528d7[_0x2cef55(0x109)](_0x2cef55(0x131)+(_0x573108 instanceof Error?_0x573108[_0x2cef55(0x146)]:String(_0x573108)))),0x1;}const _0x5618e9=await isKeychainAvailable();if(_0x5618e9){const _0x2ef248=await deleteKeychainAPIKey(_0x118ff3);_0x2ef248&&console['log'](a22_0x4528d7['green']('✓')+_0x2cef55(0x133));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a22_0x2cdd56(0x12d)]=a22_0x2cdd56(0x139);['description']=a22_0x2cdd56(0x14c);static ['VALID_KEYS']=[a22_0x2cdd56(0x120),'database','parent_segment',a22_0x2cdd56(0x11c),'llm_agent','description'];[a22_0x2cdd56(0x102)](_0x43a935){const _0x37a325=a22_0x2cdd56,{args:_0x32cef8,options:_0x1fda4f}=_0x43a935,_0x1b6b77=_0x1fda4f[_0x37a325(0x104)]||getActiveProfile();if(!_0x1b6b77)return _0x37a325(0x126);if(_0x32cef8[_0x37a325(0x12e)]===0x0)return _0x37a325(0xfb)+ProfileSetCommand[_0x37a325(0x138)][_0x37a325(0x132)](',\x20');const _0x55abc7=_0x32cef8[0x0];if(!_0x55abc7['includes']('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x37a325(0x138)][_0x37a325(0x132)](',\x20');const [_0x15b7c6]=_0x55abc7[_0x37a325(0x10c)]('=',0x2);if(!ProfileSetCommand[_0x37a325(0x138)][_0x37a325(0x128)](_0x15b7c6))return'Unknown\x20key\x20\x27'+_0x15b7c6+_0x37a325(0x13c)+ProfileSetCommand[_0x37a325(0x138)]['join'](',\x20');return undefined;}async[a22_0x2cdd56(0x103)](_0x5416c4){const _0x2acd09=a22_0x2cdd56,{args:_0x1b8781,options:_0x4e0a78}=_0x5416c4,_0x1208d4=_0x4e0a78[_0x2acd09(0x104)]||getActiveProfile(),[_0x16bf21,..._0x48352e]=_0x1b8781[0x0][_0x2acd09(0x10c)]('='),_0x27206e=_0x48352e[_0x2acd09(0x132)]('=');console[_0x2acd09(0x114)](a22_0x4528d7[_0x2acd09(0x101)](_0x2acd09(0x148)));if(!profileExists(_0x1208d4)){const _0x51b879=await a22_0x3b4c16({'type':_0x2acd09(0xf0),'name':_0x2acd09(0x15b),'message':_0x2acd09(0x160)+_0x1208d4+_0x2acd09(0x10f),'initial':!![]});if(!_0x51b879[_0x2acd09(0x15b)])return console['log']('Operation\x20cancelled'),0x1;}const _0x43d522=loadProfile(_0x1208d4),_0x87b63c=_0x43d522?.[_0x2acd09(0x147)]||{};if(_0x16bf21===_0x2acd09(0x120)){const _0xa4e483=resolveSite(_0x27206e);console['log'](_0x2acd09(0x154)+_0xa4e483+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0x2acd09(0x114)](_0x2acd09(0x15f)),console[_0x2acd09(0x114)]('\x20\x20'+getConsoleUrl(_0xa4e483,_0x2acd09(0x13b)));const _0x1cc594=await a22_0x3b4c16({'type':_0x2acd09(0x134),'name':_0x2acd09(0x12b),'message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x56751b=>{const _0x441f3a=_0x2acd09;if(!_0x56751b||!_0x56751b[_0x441f3a(0x137)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x1cc594['apiKey'])return console[_0x2acd09(0x114)]('\x0aOperation\x20cancelled'),0x1;console['log']('Validating\x20API\x20key...');try{const _0xb5e0fb=TDX[_0x2acd09(0x15b)]({'site':_0xa4e483,'apiKey':_0x1cc594[_0x2acd09(0x12b)][_0x2acd09(0x137)](),'logLevel':_0x4e0a78[_0x2acd09(0x145)]??LogLevel[_0x2acd09(0x118)]}),_0x96c118=await _0xb5e0fb[_0x2acd09(0x105)][_0x2acd09(0x112)]();console[_0x2acd09(0x114)](a22_0x4528d7['green']('✓')+_0x2acd09(0x12c)+_0x96c118[_0x2acd09(0x13d)]+')');const _0x29aa96=await isKeychainAvailable();_0x29aa96?(await saveAPIKeyAsync(_0x1cc594[_0x2acd09(0x12b)][_0x2acd09(0x137)](),_0xa4e483,_0x1208d4),console['log'](a22_0x4528d7[_0x2acd09(0x143)]('✓')+_0x2acd09(0x11a))):console[_0x2acd09(0x11e)](a22_0x4528d7[_0x2acd09(0x107)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x87b63c[_0x2acd09(0x120)]=_0xa4e483;}catch(_0x5e1ffe){if(_0x5e1ffe instanceof HTTPClientError&&_0x5e1ffe['status']===0x191)return printAuthError(_0x5e1ffe),0x1;return console[_0x2acd09(0x152)](a22_0x4528d7[_0x2acd09(0x109)](_0x2acd09(0xf6)+(_0x5e1ffe instanceof Error?_0x5e1ffe[_0x2acd09(0x146)]:String(_0x5e1ffe)))),console[_0x2acd09(0x152)](_0x2acd09(0x136)),0x1;}}else _0x87b63c[_0x16bf21]=_0x27206e||undefined;return saveProfileToUserConfig(_0x1208d4,_0x87b63c),console[_0x2acd09(0x114)](a22_0x4528d7[_0x2acd09(0x143)]('✓')+'\x20Profile\x20\x27'+_0x1208d4+'\x27\x20updated:\x20'+_0x16bf21+'='+(_0x27206e||_0x2acd09(0x11d))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a22_0x2cdd56(0x12d)]=a22_0x2cdd56(0x135);['description']=a22_0x2cdd56(0x14b);[a22_0x2cdd56(0x102)](_0x32869f){const _0x4cee34=a22_0x2cdd56,{args:_0x54ac44}=_0x32869f;if(_0x54ac44[_0x4cee34(0x12e)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>';return undefined;}async[a22_0x2cdd56(0x103)](_0x401157){const _0x163ac6=a22_0x2cdd56,{args:_0x2b75a9,options:_0x5e1ed4}=_0x401157,_0x13e407=_0x2b75a9[0x0];cleanExpiredSessions();if(!profileExists(_0x13e407)){console['error'](a22_0x4528d7[_0x163ac6(0x109)](_0x163ac6(0x160)+_0x13e407+_0x163ac6(0x129))),console[_0x163ac6(0x114)](_0x163ac6(0x124));const _0x34ff7b=listProfiles();if(_0x34ff7b[_0x163ac6(0x12e)]===0x0)console[_0x163ac6(0x114)]('\x20\x20(no\x20profiles\x20found)');else for(const _0xe0d53 of _0x34ff7b){console[_0x163ac6(0x114)](_0x163ac6(0x13a)+_0xe0d53[_0x163ac6(0x12d)]);}return 0x1;}const _0xb9fdbd=_0x5e1ed4[_0x163ac6(0xfd)]||getCurrentSessionPID()[_0x163ac6(0xfa)]();return saveSessionContext({'profile':_0x13e407},_0x5e1ed4[_0x163ac6(0xfd)]),console[_0x163ac6(0x114)](_0x163ac6(0x159)+a22_0x4528d7[_0x163ac6(0x143)](_0x13e407)+'\x20'+a22_0x4528d7[_0x163ac6(0x149)](_0x163ac6(0x119)+_0xb9fdbd+')')),console[_0x163ac6(0x114)](a22_0x4528d7['dim'](_0x163ac6(0x15d))),0x0;}}
|
|
1
|
+
const a22_0x28ea61=a22_0x3fa7;function a22_0x5140(){const _0x355360=['parent_segment','select','session','8rbHNLU','ap02\x20-\x20Korea','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','includes','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Site\x20name\x20cannot\x20be\x20empty','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x20Profile\x20\x27','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','/app/mp/ak','jp\x20\x20\x20-\x20Japan','value','Enter\x20description\x20(optional):','dim','name','status','Validating\x20API\x20key...','text','profile:remove','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','us01','\x0aOperation\x20cancelled','bold','11avWeMe','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','log','Profile\x20\x27','error','length','\x27\x20created','\x27\x20does\x20not\x20exist.\x20Create\x20it?','1349201rVwMeE','18brzcWy','description','profile:set','\x0aAvailable\x20profiles:','Removal\x20cancelled','\x27\x20removed\x20from\x20configuration','9271600wfQgpl','profile:create','Profile\x20name\x20cannot\x20be\x20empty','API\x20key\x20cannot\x20be\x20empty','site','\x20API\x20key\x20is\x20valid\x20(User:\x20','tdx:\x20profile\x20create','6vLfpkv','\x20\x20(no\x20profiles\x20found)','other','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20API\x20key\x20removed\x20from\x20system\x20keychain','customSite','email','ERROR','join','290289BGFQel','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','Enter\x20your\x20TD\x20API\x20key:','24426tQqMQi','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','create','Set\x20a\x20profile\x20configuration\x20value','confirm','red','config','profileName','15dteHuv','apiKey','jp01','You\x20can\x20find\x20your\x20API\x20key\x20at:','logLevel','validate','eu01','VALID_KEYS','trim','5892NoSRkG','51298XzOpnx','green','3844917tbsvqe','\x0aSetup\x20cancelled','execute','ap02','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','649376LqjMsx','Failed\x20to\x20remove\x20profile:\x20','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','password','\x20\x20tdx\x20--profile\x20','\x20API\x20key\x20saved\x20to\x20system\x20keychain','toString','eu\x20\x20\x20-\x20Europe','Enter\x20custom\x20site','profile:use','push','message','\x27\x20does\x20not\x20exist.','(cleared)','test','Set\x20session\x20profile','\x27\x20updated:\x20','jobs','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','split','warn','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','\x20\x20-\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','llm_project','Remove\x20a\x20profile','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','us\x20\x20\x20-\x20United\x20States','yellow'];a22_0x5140=function(){return _0x355360;};return a22_0x5140();}(function(_0x518e71,_0x2a0725){const _0x55d6fa=a22_0x3fa7,_0x264b81=_0x518e71();while(!![]){try{const _0x1529f0=parseInt(_0x55d6fa(0xbd))/0x1*(-parseInt(_0x55d6fa(0xb4))/0x2)+-parseInt(_0x55d6fa(0xc0))/0x3+parseInt(_0x55d6fa(0xd9))/0x4*(parseInt(_0x55d6fa(0xc8))/0x5)+parseInt(_0x55d6fa(0xa7))/0x6*(-parseInt(_0x55d6fa(0xa6))/0x7)+parseInt(_0x55d6fa(0x85))/0x8*(parseInt(_0x55d6fa(0xd4))/0x9)+parseInt(_0x55d6fa(0xad))/0xa*(-parseInt(_0x55d6fa(0x9d))/0xb)+-parseInt(_0x55d6fa(0xd1))/0xc*(-parseInt(_0x55d6fa(0xd2))/0xd);if(_0x1529f0===_0x2a0725)break;else _0x264b81['push'](_0x264b81['shift']());}catch(_0x32debe){_0x264b81['push'](_0x264b81['shift']());}}}(a22_0x5140,0x72185));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile}from'../core/profile.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a22_0xa32683 from'prompts';function a22_0x3fa7(_0x4fce09,_0x3275e0){_0x4fce09=_0x4fce09-0x76;const _0x51403f=a22_0x5140();let _0x3fa7d0=_0x51403f[_0x4fce09];return _0x3fa7d0;}import a22_0x3de8d5 from'chalk';function validateProfileName(_0x12eede){const _0x3299b4=a22_0x3fa7;if(!_0x12eede||!_0x12eede[_0x3299b4(0xd0)]())return _0x3299b4(0xaf);const _0x9de44b=_0x12eede[_0x3299b4(0xd0)]();if(!/^[a-zA-Z0-9_-]+$/[_0x3299b4(0xe8)](_0x9de44b))return'Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore';if(profileExists(_0x9de44b))return'Profile\x20\x27'+_0x9de44b+_0x3299b4(0x9e);return!![];}export class ProfileCreateCommand extends BaseCommand{[a22_0x28ea61(0x93)]=a22_0x28ea61(0xae);[a22_0x28ea61(0xa8)]='Create\x20a\x20new\x20profile';async[a22_0x28ea61(0xd6)](_0x26131a){const _0x37dc72=a22_0x28ea61,{options:_0x2d8965,args:_0x21c14f}=_0x26131a;console['log'](a22_0x3de8d5[_0x37dc72(0x9c)](_0x37dc72(0xb3)));let _0x13ad04;if(_0x21c14f[_0x37dc72(0xa3)]>0x0&&_0x21c14f[0x0]){const _0x9900f=_0x21c14f[0x0][_0x37dc72(0xd0)](),_0x237308=validateProfileName(_0x9900f);if(_0x237308!==!![])return console['error'](a22_0x3de8d5[_0x37dc72(0xc5)](_0x237308)),0x1;_0x13ad04=_0x9900f;}else{const _0x187071=await a22_0xa32683({'type':_0x37dc72(0x96),'name':_0x37dc72(0xc7),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x187071[_0x37dc72(0xc7)])return console[_0x37dc72(0xa0)](_0x37dc72(0xd5)),0x1;_0x13ad04=_0x187071[_0x37dc72(0xc7)][_0x37dc72(0xd0)]();}const _0x290909=await a22_0xa32683({'type':'text','name':'description','message':_0x37dc72(0x91)}),_0x2978e1=_0x290909['description']?.[_0x37dc72(0xd0)]()||undefined,_0x2150f6=_0x2d8965[_0x37dc72(0xb1)]||_0x37dc72(0x9a),_0x1e19df=[{'title':_0x37dc72(0x80),'value':_0x37dc72(0x9a)},{'title':_0x37dc72(0x8f),'value':_0x37dc72(0xca)},{'title':_0x37dc72(0xe1),'value':_0x37dc72(0xce)},{'title':_0x37dc72(0x86),'value':_0x37dc72(0xd7)}];let _0x3225a1=_0x1e19df['findIndex'](_0x32adca=>_0x32adca[_0x37dc72(0x90)]===_0x2150f6);_0x3225a1===-0x1&&_0x2150f6!==_0x37dc72(0x9a)&&(_0x1e19df[_0x37dc72(0xe4)]({'title':_0x2150f6,'value':_0x2150f6}),_0x3225a1=_0x1e19df[_0x37dc72(0xa3)]-0x1);_0x1e19df['push']({'title':_0x37dc72(0xe2),'value':_0x37dc72(0xb6)});const _0x4f9117=await a22_0xa32683({'type':_0x37dc72(0x83),'name':'site','message':_0x37dc72(0xdc)+_0x13ad04+'\x27:','choices':_0x1e19df,'initial':_0x3225a1>=0x0?_0x3225a1:0x0});if(!_0x4f9117[_0x37dc72(0xb1)])return console[_0x37dc72(0xa0)]('\x0aSetup\x20cancelled'),0x1;let _0x4a3576;if(_0x4f9117[_0x37dc72(0xb1)]===_0x37dc72(0xb6)){const _0x52e7a2=await a22_0xa32683({'type':'text','name':_0x37dc72(0xb9),'message':'Enter\x20site\x20name:','initial':_0x37dc72(0x9a),'validate':_0x3840ed=>{const _0x1c0790=_0x37dc72;if(!_0x3840ed||!_0x3840ed[_0x1c0790(0xd0)]())return _0x1c0790(0x8a);if(!/^[a-z0-9-]+$/[_0x1c0790(0xe8)](_0x3840ed['trim']()))return _0x1c0790(0x89);return!![];}});if(!_0x52e7a2['customSite'])return console['log'](_0x37dc72(0xd5)),0x1;_0x4a3576=_0x52e7a2[_0x37dc72(0xb9)];}else _0x4a3576=_0x4f9117[_0x37dc72(0xb1)];const _0x3af965=resolveSite(_0x4a3576);console[_0x37dc72(0xa0)](_0x37dc72(0x9f)+_0x3af965),console[_0x37dc72(0xa0)](_0x37dc72(0xcb)),console[_0x37dc72(0xa0)]('\x20\x20'+getConsoleUrl(_0x3af965,_0x37dc72(0x8e)));const _0x105273=await a22_0xa32683({'type':_0x37dc72(0xdd),'name':_0x37dc72(0xc9),'message':_0x37dc72(0xbf),'validate':_0x50dbff=>{const _0x2f6880=_0x37dc72;if(!_0x50dbff||!_0x50dbff[_0x2f6880(0xd0)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x105273[_0x37dc72(0xc9)])return console[_0x37dc72(0xa0)](_0x37dc72(0xd5)),0x1;const _0x194949=_0x105273[_0x37dc72(0xc9)];console['log'](_0x37dc72(0x95));try{const _0x5c452c=TDX[_0x37dc72(0xc2)]({'site':_0x3af965,'apiKey':_0x194949[_0x37dc72(0xd0)](),'logLevel':_0x2d8965[_0x37dc72(0xcc)]??LogLevel[_0x37dc72(0xbb)]}),_0x14a7e7=await _0x5c452c[_0x37dc72(0x76)]['getUserInfo']();console[_0x37dc72(0xa0)](a22_0x3de8d5[_0x37dc72(0xd3)]('✓')+_0x37dc72(0xb2)+_0x14a7e7[_0x37dc72(0xba)]+')');const _0x244baf=await isKeychainAvailable();_0x244baf?(await saveAPIKeyAsync(_0x194949[_0x37dc72(0xd0)](),_0x3af965,_0x13ad04),console[_0x37dc72(0xa0)](a22_0x3de8d5['green']('✓')+_0x37dc72(0x7a)+_0x13ad04+')')):(console[_0x37dc72(0x79)](a22_0x3de8d5[_0x37dc72(0x81)](_0x37dc72(0x87))),console[_0x37dc72(0x79)](a22_0x3de8d5[_0x37dc72(0x81)](_0x37dc72(0x99))));const _0x389855={'site':_0x3af965,..._0x2978e1&&{'description':_0x2978e1}};return saveProfileToUserConfig(_0x13ad04,_0x389855),console[_0x37dc72(0xa0)](a22_0x3de8d5['green']('✓')+_0x37dc72(0x8c)+_0x13ad04+_0x37dc72(0xa4)),console[_0x37dc72(0xa0)](),console[_0x37dc72(0xa0)](_0x37dc72(0x98)),console['log']('\x20\x20tdx\x20--profile\x20'+_0x13ad04+_0x37dc72(0xb7)),console[_0x37dc72(0xa0)](_0x37dc72(0xde)+_0x13ad04+_0x37dc72(0x77)),0x0;}catch(_0x230273){if(_0x230273 instanceof HTTPClientError&&_0x230273['status']===0x191)return printAuthError(_0x230273),0x1;return console[_0x37dc72(0xa2)](a22_0x3de8d5['red']('✗\x20Validation\x20failed:\x20'+(_0x230273 instanceof Error?_0x230273[_0x37dc72(0xe5)]:String(_0x230273)))),console[_0x37dc72(0xa2)](_0x37dc72(0xc1)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a22_0x28ea61(0x93)]=a22_0x28ea61(0x97);[a22_0x28ea61(0xa8)]=a22_0x28ea61(0x7e);[a22_0x28ea61(0xcd)](_0x3651cb){const _0x1f74c2=a22_0x28ea61,{args:_0x13536c}=_0x3651cb;if(_0x13536c[_0x1f74c2(0xa3)]===0x0)return _0x1f74c2(0xd8);return undefined;}async[a22_0x28ea61(0xd6)](_0x3cf42a){const _0x371325=a22_0x28ea61,{args:_0xa407c9}=_0x3cf42a,_0x40e8aa=_0xa407c9[0x0];console[_0x371325(0xa0)](a22_0x3de8d5[_0x371325(0x9c)]('tdx:\x20profile\x20remove'));if(!profileExists(_0x40e8aa)){console[_0x371325(0xa2)](a22_0x3de8d5[_0x371325(0xc5)](_0x371325(0xa1)+_0x40e8aa+_0x371325(0xe6))),console['log']('\x0aAvailable\x20profiles:');const _0x1bfb7d=listProfiles();if(_0x1bfb7d[_0x371325(0xa3)]===0x0)console[_0x371325(0xa0)](_0x371325(0xb5));else for(const _0x543d47 of _0x1bfb7d){console[_0x371325(0xa0)](_0x371325(0x7b)+_0x543d47[_0x371325(0x93)]);}return 0x1;}const _0x4d6586=await a22_0xa32683({'type':_0x371325(0xc4),'name':_0x371325(0xc4),'message':_0x371325(0xbe)+_0x40e8aa+'\x27?','initial':![]});if(!_0x4d6586[_0x371325(0xc4)])return console[_0x371325(0xa0)](_0x371325(0xab)),0x0;try{removeProfileFromUserConfig(_0x40e8aa),console['log'](a22_0x3de8d5[_0x371325(0xd3)]('✓')+_0x371325(0x8c)+_0x40e8aa+_0x371325(0xac));}catch(_0x2d99a0){return console['error'](a22_0x3de8d5[_0x371325(0xc5)](_0x371325(0xda)+(_0x2d99a0 instanceof Error?_0x2d99a0['message']:String(_0x2d99a0)))),0x1;}const _0x3f4c94=await isKeychainAvailable();if(_0x3f4c94){const _0x156a0f=await deleteKeychainAPIKey(_0x40e8aa);_0x156a0f&&console[_0x371325(0xa0)](a22_0x3de8d5[_0x371325(0xd3)]('✓')+_0x371325(0xb8));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a22_0x28ea61(0x93)]=a22_0x28ea61(0xa9);[a22_0x28ea61(0xa8)]=a22_0x28ea61(0xc3);static [a22_0x28ea61(0xcf)]=[a22_0x28ea61(0xb1),'database',a22_0x28ea61(0x82),a22_0x28ea61(0x7d),'llm_agent',a22_0x28ea61(0xa8)];['validate'](_0x4c9a13){const _0x290d63=a22_0x28ea61,{args:_0x2e326e,options:_0x553eeb}=_0x4c9a13,_0x304eab=_0x553eeb['profile']||getActiveProfile();if(!_0x304eab)return _0x290d63(0xdb);if(_0x2e326e[_0x290d63(0xa3)]===0x0)return _0x290d63(0x8b)+ProfileSetCommand[_0x290d63(0xcf)][_0x290d63(0xbc)](',\x20');const _0x4a4671=_0x2e326e[0x0];if(!_0x4a4671[_0x290d63(0x88)]('='))return _0x290d63(0x7f)+ProfileSetCommand[_0x290d63(0xcf)][_0x290d63(0xbc)](',\x20');const [_0x23e81e]=_0x4a4671[_0x290d63(0x78)]('=',0x2);if(!ProfileSetCommand['VALID_KEYS'][_0x290d63(0x88)](_0x23e81e))return'Unknown\x20key\x20\x27'+_0x23e81e+'\x27.\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand['VALID_KEYS'][_0x290d63(0xbc)](',\x20');return undefined;}async[a22_0x28ea61(0xd6)](_0x552510){const _0xa6cd6c=a22_0x28ea61,{args:_0x3f6d9c,options:_0x12da7b}=_0x552510,_0x3cc9af=_0x12da7b['profile']||getActiveProfile(),[_0x33befd,..._0x50dfa5]=_0x3f6d9c[0x0][_0xa6cd6c(0x78)]('='),_0x4994a2=_0x50dfa5[_0xa6cd6c(0xbc)]('=');console[_0xa6cd6c(0xa0)](a22_0x3de8d5[_0xa6cd6c(0x9c)]('tdx:\x20profile\x20set'));if(!profileExists(_0x3cc9af)){const _0x4922da=await a22_0xa32683({'type':_0xa6cd6c(0xc4),'name':_0xa6cd6c(0xc2),'message':_0xa6cd6c(0xa1)+_0x3cc9af+_0xa6cd6c(0xa5),'initial':!![]});if(!_0x4922da[_0xa6cd6c(0xc2)])return console[_0xa6cd6c(0xa0)]('Operation\x20cancelled'),0x1;}const _0x439d9e=loadProfile(_0x3cc9af),_0x176f80=_0x439d9e?.[_0xa6cd6c(0xc6)]||{};if(_0x33befd===_0xa6cd6c(0xb1)){const _0x246433=resolveSite(_0x4994a2);console[_0xa6cd6c(0xa0)]('Changing\x20site\x20to\x20\x27'+_0x246433+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0xa6cd6c(0xa0)](_0xa6cd6c(0x8d)),console[_0xa6cd6c(0xa0)]('\x20\x20'+getConsoleUrl(_0x246433,'/app/mp/ak'));const _0xfd33c8=await a22_0xa32683({'type':_0xa6cd6c(0xdd),'name':_0xa6cd6c(0xc9),'message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x591a0d=>{const _0x41dc10=_0xa6cd6c;if(!_0x591a0d||!_0x591a0d['trim']())return _0x41dc10(0xb0);return!![];}});if(!_0xfd33c8['apiKey'])return console['log'](_0xa6cd6c(0x9b)),0x1;console[_0xa6cd6c(0xa0)](_0xa6cd6c(0x95));try{const _0x47e12e=TDX[_0xa6cd6c(0xc2)]({'site':_0x246433,'apiKey':_0xfd33c8[_0xa6cd6c(0xc9)][_0xa6cd6c(0xd0)](),'logLevel':_0x12da7b[_0xa6cd6c(0xcc)]??LogLevel['ERROR']}),_0x59b762=await _0x47e12e[_0xa6cd6c(0x76)]['getUserInfo']();console['log'](a22_0x3de8d5[_0xa6cd6c(0xd3)]('✓')+_0xa6cd6c(0xb2)+_0x59b762[_0xa6cd6c(0xba)]+')');const _0x30f088=await isKeychainAvailable();_0x30f088?(await saveAPIKeyAsync(_0xfd33c8['apiKey'][_0xa6cd6c(0xd0)](),_0x246433,_0x3cc9af),console[_0xa6cd6c(0xa0)](a22_0x3de8d5[_0xa6cd6c(0xd3)]('✓')+_0xa6cd6c(0xdf))):console[_0xa6cd6c(0x79)](a22_0x3de8d5['yellow'](_0xa6cd6c(0x87))),_0x176f80['site']=_0x246433;}catch(_0x50ea7b){if(_0x50ea7b instanceof HTTPClientError&&_0x50ea7b[_0xa6cd6c(0x94)]===0x191)return printAuthError(_0x50ea7b),0x1;return console[_0xa6cd6c(0xa2)](a22_0x3de8d5[_0xa6cd6c(0xc5)]('✗\x20Validation\x20failed:\x20'+(_0x50ea7b instanceof Error?_0x50ea7b[_0xa6cd6c(0xe5)]:String(_0x50ea7b)))),console[_0xa6cd6c(0xa2)]('Site\x20was\x20not\x20changed.'),0x1;}}else _0x176f80[_0x33befd]=_0x4994a2||undefined;return saveProfileToUserConfig(_0x3cc9af,_0x176f80),console[_0xa6cd6c(0xa0)](a22_0x3de8d5[_0xa6cd6c(0xd3)]('✓')+_0xa6cd6c(0x8c)+_0x3cc9af+_0xa6cd6c(0xea)+_0x33befd+'='+(_0x4994a2||_0xa6cd6c(0xe7))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a22_0x28ea61(0x93)]=a22_0x28ea61(0xe3);[a22_0x28ea61(0xa8)]=a22_0x28ea61(0xe9);[a22_0x28ea61(0xcd)](_0x530a48){const _0x556037=a22_0x28ea61,{args:_0x3208b5}=_0x530a48;if(_0x3208b5[_0x556037(0xa3)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>';return undefined;}async['execute'](_0x4012ed){const _0x4b3df3=a22_0x28ea61,{args:_0x203ff0,options:_0x4676d3}=_0x4012ed,_0x4d3e1d=_0x203ff0[0x0];cleanExpiredSessions();if(!profileExists(_0x4d3e1d)){console[_0x4b3df3(0xa2)](a22_0x3de8d5[_0x4b3df3(0xc5)](_0x4b3df3(0xa1)+_0x4d3e1d+_0x4b3df3(0xe6))),console[_0x4b3df3(0xa0)](_0x4b3df3(0xaa));const _0x50ca1d=listProfiles();if(_0x50ca1d[_0x4b3df3(0xa3)]===0x0)console[_0x4b3df3(0xa0)](_0x4b3df3(0xb5));else for(const _0x19556d of _0x50ca1d){console[_0x4b3df3(0xa0)](_0x4b3df3(0x7b)+_0x19556d[_0x4b3df3(0x93)]);}return 0x1;}const _0x178b6a=_0x4676d3[_0x4b3df3(0x84)]||getCurrentSessionPID()[_0x4b3df3(0xe0)]();return saveSessionContext({'profile':_0x4d3e1d},_0x4676d3[_0x4b3df3(0x84)]),console[_0x4b3df3(0xa0)]('Session\x20profile\x20set\x20to:\x20'+a22_0x3de8d5[_0x4b3df3(0xd3)](_0x4d3e1d)+'\x20'+a22_0x3de8d5[_0x4b3df3(0x92)]('(session:\x20'+_0x178b6a+')')),console[_0x4b3df3(0xa0)](a22_0x3de8d5['dim'](_0x4b3df3(0x7c))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-command.js","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,gBAAgB,GAEjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IAC1C,IAAI,GAAG,gBAAgB,CAAC;IACxB,WAAW,GAAG,oCAAoC,CAAC;IAE5D,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAA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AC,EAAE,CAAC;gBAC1B,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;oBACzB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC/B,CAAC;YACH,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC;QAED,yBAAyB;QACzB,MAAM,SAAS,GAAI,OAAO,CAAC,OAAkB,IAAI,oBAAoB,EAAE,CAAC,QAAQ,EAAE,CAAC;QACnF,kBAAkB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,OAAO,CAAC,OAA6B,CAAC,CAAC;QAEpF,OAAO,CAAC,GAAG,CACT,2BAA2B,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,aAAa,SAAS,GAAG,CAAC,EAAE,CAC9F,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC,CAAC;QAElF,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x4d3087=a23_0x28ea;(function(_0x20a7aa,_0x4232ab){const _0x1a38e5=a23_0x28ea,_0xa70d4b=_0x20a7aa();while(!![]){try{const _0x95f598=parseInt(_0x1a38e5(0x140))/0x1+parseInt(_0x1a38e5(0x146))/0x2+-parseInt(_0x1a38e5(0x13e))/0x3+parseInt(_0x1a38e5(0x14b))/0x4+-parseInt(_0x1a38e5(0x144))/0x5*(-parseInt(_0x1a38e5(0x13f))/0x6)+-parseInt(_0x1a38e5(0x147))/0x7+-parseInt(_0x1a38e5(0x149))/0x8*(-parseInt(_0x1a38e5(0x13d))/0x9);if(_0x95f598===_0x4232ab)break;else _0xa70d4b['push'](_0xa70d4b['shift']());}catch(_0x3c8658){_0xa70d4b['push'](_0xa70d4b['shift']());}}}(a23_0x4980,0xb02d2));function a23_0x4980(){const _0x414190=['name','1144848CajHpP','description','262192upJuVU','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','execute','List\x20all\x20available\x20profiles','\x20\x20Global:\x20~/.config/tdx/tdx.json','error','message','27OApQEe','3604794UGOYVh','483594dufOtp','1016794DKFoQR','profiles','map','log','75mqmeEJ','config','369298vwBacg','6874546PMvcyD'];a23_0x4980=function(){return _0x414190;};return a23_0x4980();}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';function a23_0x28ea(_0x59991e,_0x239681){_0x59991e=_0x59991e-0x139;const _0x498003=a23_0x4980();let _0x28eaf1=_0x498003[_0x59991e];return _0x28eaf1;}export class ProfilesCommand extends BaseCommand{[a23_0x4d3087(0x148)]=a23_0x4d3087(0x141);['description']=a23_0x4d3087(0x139);async[a23_0x4d3087(0x14d)](_0x1ca9d8){const _0x3d7ac6=a23_0x4d3087,{options:_0x328c5b}=_0x1ca9d8;try{const _0x4cb4c3=listProfiles(),_0x20f561=getActiveProfile();if(_0x4cb4c3['length']===0x0)return console[_0x3d7ac6(0x143)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x3d7ac6(0x143)](_0x3d7ac6(0x14c)),console[_0x3d7ac6(0x143)](_0x3d7ac6(0x13a)),0x0;const _0x2c63c6=_0x4cb4c3[_0x3d7ac6(0x142)](_0x2e973e=>{const _0x590a29=_0x3d7ac6,_0x1c7ef5=_0x2e973e[_0x590a29(0x148)]===_0x20f561,_0x3bcf17=getProfileParams(_0x2e973e['config']);return{'name':_0x2e973e[_0x590a29(0x148)],'active':_0x1c7ef5,'scope':_0x2e973e['scope'],'description':_0x2e973e[_0x590a29(0x145)][_0x590a29(0x14a)]||'','params':_0x3bcf17};});return await handleSDKOutput(_0x2c63c6,_0x328c5b),0x0;}catch(_0x524630){return _0x524630 instanceof Error&&console[_0x3d7ac6(0x13b)]('Error:\x20'+_0x524630[_0x3d7ac6(0x13c)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0xbde2f=a24_0x4022;function a24_0x4022(_0xa5e215,_0x3fc37e){_0xa5e215=_0xa5e215-0xdb;const _0x2e2467=a24_0x2e24();let _0x402264=_0x2e2467[_0xa5e215];return _0x402264;}(function(_0x4157dc,_0x53badb){const _0x42a9de=a24_0x4022,_0x5c6632=_0x4157dc();while(!![]){try{const _0x599627=-parseInt(_0x42a9de(0x115))/0x1+-parseInt(_0x42a9de(0xe4))/0x2*(parseInt(_0x42a9de(0xf3))/0x3)+parseInt(_0x42a9de(0x102))/0x4*(-parseInt(_0x42a9de(0xdd))/0x5)+-parseInt(_0x42a9de(0xf8))/0x6*(parseInt(_0x42a9de(0x10d))/0x7)+parseInt(_0x42a9de(0x113))/0x8*(-parseInt(_0x42a9de(0x109))/0x9)+-parseInt(_0x42a9de(0xe3))/0xa+parseInt(_0x42a9de(0x101))/0xb*(parseInt(_0x42a9de(0xe1))/0xc);if(_0x599627===_0x53badb)break;else _0x5c6632['push'](_0x5c6632['shift']());}catch(_0x257a6e){_0x5c6632['push'](_0x5c6632['shift']());}}}(a24_0x2e24,0xdd1e3));function a24_0x2e24(){const _0x8f4b6=['64485SsjfEX','args','Run\x20Trino\x20queries\x20(streaming)','setPhase','12241061uTsgJJ','length','Query\x20completed:\x20Processed\x20','\x20rows\x20','join','execute','1976oZDgdZ','information_schema','1237012fpYfCu','Executing\x20query\x20[','\x0aAll\x20results\x20saved\x20to\x20','1127465FZzPzp','No\x20SQL\x20provided','processedRows','stats','2916492BGqpyy','database','2700620VnOGvs','622QkMLim','jobId','query','originalMessage','Executing\x20statement\x20','push','catalog','...','\x20-\x20','totalSplits','name','validate','\x20[Job\x20ID:\x20','options','setJobId','237xlHOra','Statement\x20','description','Executing\x20query...','message','6gJoMRg','setExtra','SQL:\x20','site','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','file','in\x20','output','completedSplits','341mnjylX','28TgVuOR','Schema:\x20','error','verbose','Error:\x20','state','\x20splits'];a24_0x2e24=function(){return _0x8f4b6;};return a24_0x2e24();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a24_0xbde2f(0xee)]=a24_0xbde2f(0xe6);[a24_0xbde2f(0xf5)]=a24_0xbde2f(0x10b);async[a24_0xbde2f(0x112)](_0x589388){const _0x1d4423=a24_0xbde2f,{options:_0x48b91d,args:_0x15a536,tdx:_0x26050e}=_0x589388,_0x8c68d8=_0x15a536[0x0],_0x4ab651=_0x48b91d[_0x1d4423(0xfd)];let _0x21a684;try{if(_0x4ab651)_0x21a684=readSqlStatementsFromFile(_0x4ab651);else{if(_0x8c68d8==='-')_0x21a684=await readSqlStatementsFromStdin();else{if(_0x8c68d8&&isSqlFilePath(_0x8c68d8))_0x21a684=readSqlStatementsFromFile(_0x8c68d8);else{if(_0x8c68d8)_0x21a684=splitSqlStatements(_0x8c68d8);else throw new Error(_0x1d4423(0xde));}}}}catch(_0x10e36f){return console[_0x1d4423(0x104)](_0x1d4423(0x106)+_0x10e36f[_0x1d4423(0xf7)]),0x1;}const _0x3064dd=_0x48b91d[_0x1d4423(0xe2)]||_0x1d4423(0x114),_0x453b60=_0x48b91d[_0x1d4423(0xea)];try{const _0x453783=[],_0x542b69=!!_0x48b91d[_0x1d4423(0xff)];for(let _0x17b8bc=0x0;_0x17b8bc<_0x21a684[_0x1d4423(0x10e)];_0x17b8bc++){const _0x1d57a4=_0x21a684[_0x17b8bc],_0x573de7=_0x17b8bc+0x1,_0x1d92b7=_0x21a684['length'],_0x2be7b4=_0x1d92b7>0x1;_0x48b91d[_0x1d4423(0x105)]&&(console[_0x1d4423(0x104)]('\x0a'+(_0x2be7b4?'Statement\x20'+_0x573de7+'/'+_0x1d92b7+':':'')),console[_0x1d4423(0x104)]('Site:\x20'+_0x48b91d[_0x1d4423(0xfb)]),console[_0x1d4423(0x104)]('Catalog:\x20'+(_0x453b60||'td')),console[_0x1d4423(0x104)](_0x1d4423(0x103)+_0x3064dd),console[_0x1d4423(0x104)](_0x1d4423(0xfa)+_0x1d57a4));const _0x298231=_0x2be7b4?_0x1d4423(0xe8)+_0x573de7+'/'+_0x1d92b7+_0x1d4423(0xeb):_0x1d4423(0xf6);try{const _0x1eb2ec=await withProgressSpinner(_0x298231,async _0x402db3=>{const _0x5d8d97=_0x1d4423,_0x4a4dfe=await _0x26050e['query'][_0x5d8d97(0x112)](_0x1d57a4,{'catalog':_0x453b60,'schema':_0x3064dd,'onJobId':_0x3244fc=>{const _0x10edd9=_0x5d8d97;_0x402db3[_0x10edd9(0xf2)](_0x3244fc);},'onProgress':_0x45fed5=>{const _0x22f188=_0x5d8d97;_0x402db3[_0x22f188(0x10c)](_0x22f188(0xdb)+_0x45fed5[_0x22f188(0x107)]+']'),_0x402db3[_0x22f188(0xf9)](formatRows(_0x45fed5[_0x22f188(0xdf)])+_0x22f188(0x110)+_0x45fed5[_0x22f188(0x100)]+'/'+_0x45fed5[_0x22f188(0xed)]+_0x22f188(0x108));}});return _0x4a4dfe;},{'verbose':_0x48b91d[_0x1d4423(0x105)]}),_0xffc94e=_0x1eb2ec['data'],_0x3d1d32=_0xffc94e[_0x1d4423(0xe5)]?_0x1d4423(0xf0)+_0xffc94e['jobId']+']':'',_0x46a6b8=_0x2be7b4?'Statement\x20'+_0x573de7+'/'+_0x1d92b7+_0x1d4423(0xec):'';console[_0x1d4423(0x104)]('✔\x20'+_0x46a6b8+_0x1d4423(0x10f)+formatRows(_0xffc94e[_0x1d4423(0xe0)]['processedRows'])+'\x20rows\x20'+(_0x1d4423(0xfe)+formatElapsed(_0xffc94e[_0x1d4423(0xe0)]['elapsedTimeMillis'])+_0x3d1d32));if(_0x2be7b4&&_0x542b69){const _0x18d2c=resolveOutputOptions(_0x48b91d),_0x5722be=await formatQueryOutput(_0xffc94e,_0x18d2c);_0x453783[_0x1d4423(0xe9)](_0x5722be);}else await handleQueryOutput(_0xffc94e,_0x48b91d);}catch(_0x50d0c1){const _0x264eca=_0x2be7b4?_0x1d4423(0xf4)+_0x573de7+'/'+_0x1d92b7+':\x0a':'',_0x5c3953=_0x50d0c1 instanceof SDKError?_0x50d0c1[_0x1d4423(0xe7)]:_0x50d0c1[_0x1d4423(0xf7)];return console[_0x1d4423(0x104)](''+_0x264eca+_0x5c3953),0x1;}}if(_0x21a684[_0x1d4423(0x10e)]>0x1&&_0x542b69&&_0x453783[_0x1d4423(0x10e)]>0x0){const _0x110e23=_0x453783[_0x1d4423(0x111)]('\x0a');writeFileSync(_0x48b91d[_0x1d4423(0xff)],_0x110e23),console['error'](_0x1d4423(0xdc)+_0x48b91d['output']);}return 0x0;}catch(_0x412564){throw _0x412564;}}[a24_0xbde2f(0xef)](_0x2e6f7c){const _0x205ff4=a24_0xbde2f,_0x1b45d5=_0x2e6f7c[_0x205ff4(0x10a)][0x0],_0x9ba02=_0x2e6f7c[_0x205ff4(0xf1)]['file'];if(!_0x1b45d5&&!_0x9ba02)return _0x205ff4(0xfc);if(_0x1b45d5&&_0x9ba02)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
|