@treasuredata/tdx 0.27.1 → 0.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +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/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.d.ts +17 -0
- package/dist/commands/delivery-command.d.ts.map +1 -0
- package/dist/commands/delivery-command.js +1 -0
- package/dist/commands/delivery-command.js.map +1 -0
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.d.ts +16 -0
- package/dist/commands/engage-campaign-pull-command.d.ts.map +1 -0
- package/dist/commands/engage-campaign-pull-command.js +1 -0
- package/dist/commands/engage-campaign-pull-command.js.map +1 -0
- package/dist/commands/engage-campaign-push-command.d.ts +16 -0
- package/dist/commands/engage-campaign-push-command.d.ts.map +1 -0
- package/dist/commands/engage-campaign-push-command.js +1 -0
- package/dist/commands/engage-campaign-push-command.js.map +1 -0
- package/dist/commands/engage-campaign-validate-command.d.ts +19 -0
- package/dist/commands/engage-campaign-validate-command.d.ts.map +1 -0
- package/dist/commands/engage-campaign-validate-command.js +1 -0
- package/dist/commands/engage-campaign-validate-command.js.map +1 -0
- package/dist/commands/engage-command.d.ts +15 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +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/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-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/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.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/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- 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/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.d.ts +31 -0
- package/dist/sdk/client/delivery-api-client.d.ts.map +1 -0
- package/dist/sdk/client/delivery-api-client.js +1 -0
- package/dist/sdk/client/delivery-api-client.js.map +1 -0
- package/dist/sdk/client/endpoints.d.ts +24 -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/delivery.d.ts +38 -0
- package/dist/sdk/delivery.d.ts.map +1 -0
- package/dist/sdk/delivery.js +1 -0
- package/dist/sdk/delivery.js.map +1 -0
- package/dist/sdk/engage/campaign-pull.d.ts +69 -0
- package/dist/sdk/engage/campaign-pull.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-pull.js +1 -0
- package/dist/sdk/engage/campaign-pull.js.map +1 -0
- package/dist/sdk/engage/campaign-push.d.ts +100 -0
- package/dist/sdk/engage/campaign-push.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-push.js +1 -0
- package/dist/sdk/engage/campaign-push.js.map +1 -0
- package/dist/sdk/engage/campaign-validator.d.ts +18 -0
- package/dist/sdk/engage/campaign-validator.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-validator.js +1 -0
- package/dist/sdk/engage/campaign-validator.js.map +1 -0
- package/dist/sdk/engage/campaign-yaml.d.ts +78 -0
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-yaml.js +1 -0
- package/dist/sdk/engage/campaign-yaml.js.map +1 -0
- package/dist/sdk/engage/types/campaign-def.d.ts +12 -0
- package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -0
- package/dist/sdk/engage/types/campaign-def.js +1 -0
- package/dist/sdk/engage/types/campaign-def.js.map +1 -0
- package/dist/sdk/engage/types/campaign-schema.d.ts +143 -0
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -0
- package/dist/sdk/engage/types/campaign-schema.js +1 -0
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -0
- package/dist/sdk/engage.d.ts +19 -2
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.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-validator.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-recovery.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.d.ts +13 -1
- package/dist/sdk/segment/tdx-config.d.ts.map +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/tdx-config.js.map +1 -1
- package/dist/sdk/segment/validate-files.d.ts +8 -1
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +36 -0
- package/dist/sdk/types/engage.d.ts.map +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/index.js.map +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/archive-validation.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/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.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/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.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 a22_0x2df86f=a22_0x2d13;(function(_0xbc330,_0x1f28f7){const _0x52a5d8=a22_0x2d13,_0x335788=_0xbc330();while(!![]){try{const _0x4ffbfd=-parseInt(_0x52a5d8(0x281))/0x1+-parseInt(_0x52a5d8(0x173))/0x2*(-parseInt(_0x52a5d8(0x245))/0x3)+parseInt(_0x52a5d8(0x1e6))/0x4*(-parseInt(_0x52a5d8(0x29f))/0x5)+-parseInt(_0x52a5d8(0x1ab))/0x6+-parseInt(_0x52a5d8(0x2c3))/0x7*(-parseInt(_0x52a5d8(0x1b1))/0x8)+parseInt(_0x52a5d8(0x18e))/0x9+parseInt(_0x52a5d8(0x2ad))/0xa*(parseInt(_0x52a5d8(0x20f))/0xb);if(_0x4ffbfd===_0x1f28f7)break;else _0x335788['push'](_0x335788['shift']());}catch(_0x45ae56){_0x335788['push'](_0x335788['shift']());}}}(a22_0x3b2e,0xb3141));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x5f4fdc 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,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a22_0x2534e9 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a22_0x3b2e(){const _0x38566b=['\x0a\x20\x20]\x0a}\x0a','customerPercent','varchar','verbose','9002yhafhn','Audience\x20ID:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','jsonl','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Available\x20behaviors:','\x5c$&','\x20\x201.\x20Edit\x20','Show\x20parent\x20segment\x20details','using\x20the\x20default\x20path:\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','utf-8','Status:','%)\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','tdx\x20ps\x20push\x20','Listing\x20parent\x20segments\x20matching\x20\x27','\x0aNew\x20parent\x20segment\x20\x27','-1d','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\x20\x20\x20\x20\x20','displayPreviewHints','realtime:','web','Columns:','personalization','true','No\x20parent\x20segments\x20found','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x22\x20}','json','trim','information_schema','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20\x20Note:\x20','Executing\x20parent\x20segment\x20query...','toLocaleString','Available\x20attributes:','Fetching\x20sample\x20data...','createParent','\x0aChanges\x20to\x20apply\x20to\x20\x27','segment:parent:update','runParent','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','addBehaviors','pushParentYaml','string','yellow','win32','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','primaryKey','segment:parent:push','rowCount','errors','Personalization\x20service\x20description','getParentFull','segment:parent:validate','realtime_enabled','segment:parent:fields','\x20--attribute\x20\x22<name>\x22','name','No\x20RT-enabled\x20parent\x20segments\x20found','number','previewParentYaml','\x20\x20\x20\x20','\x20--behavior\x20\x22<name>\x22','pullParentYaml','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','collectSchema','list','Validating\x20configuration...','dim','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x20tdx\x20wf\x20attempt\x20','last_page_viewed','12QvgGmH','List\x20available\x20fields\x20for\x20segmentation','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','elapsedTimeMillis','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','timezone','start','column_type','error','Source:','filter','Master\x20Table','audienceId','addAttributesFile','\x0a⚠️\x20\x20Migrating:\x20','\x20section','Resolving\x20parent\x20segment\x20\x27','/\x20directory.\x0a','execute','site','✔\x20Created\x20parent\x20segment\x20\x27','\x20+\x20[','type','Next\x20steps:','keys','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','sections','6792138bgwyZw','session','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x20\x20No\x20sample\x20data\x20available','ps:rt:validate','\x20=\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','toLowerCase','replace','processedRows','stop','behaviorsFile','foreignKey','\x20personalization\x20service','realtime','xdg-open','/{name}.yml\x0a','Error:','Master\x20+\x20Attributes','status','\x20rows\x20','behavior','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','endsWith','\x20service(s)\x20configured','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','red','in\x20','4575090tRPsWG','✔\x20Found\x20','customers','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20current\x20configuration\x20for\x20\x27','Name:\x20','1624eidIkL','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','schemaError','\x20Context\x20set:\x20','.customers)','RT\x202.0:','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','\x20Configuration\x20is\x20valid','join','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','query','\x20\x20\x20\x20-\x20','data','displayColumns','Fetching\x20behavior\x20list...','scheduleType','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Overwrite\x20\x27','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20total','coveragePercent','Updating','all','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','/\x20directories\x20exist.','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','resolveParentId','Error:\x20--behavior\x20requires\x20a\x20name\x0a','isDirectory','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x0aNo\x20sample\x20data\x20available','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','bold','message','addBehaviorsFile','Created','stitchingKeys','Table:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Aborted.','`\x20to\x20download\x20the\x20configuration\x20first','listFields','.yml','page_view','ID\x20Stitching:','scheduleOption','validateParentYaml','✔\x20Updated\x20parent\x20segment\x20\x27','\x20[Job\x20ID:\x20','Parent\x20segment:\x20','356992TcuBGI','displaySampleData','Validating\x20RT\x20configuration...','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','column','use','Session:','Updated','displayRealtimeInfo','addAttributes','Listing\x20personalization\x20services\x20for\x20\x27','Fetching\x20SQL\x20for\x20\x27','yes','No\x20parent\x20segments\x20match\x20pattern:\x20','column_name','sourceTableValid','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','FINISHED','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x0a\x20\x20\x20\x20}','Attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','segment:parent:list','indexOf','apply','List\x20parent\x20segments','getBehaviorNames','/\x20and\x20','Analyzing\x20changes...','Creating\x20parent\x20segment\x20\x27','Events:','test','\x20\x20Tables:\x201\x20customers\x20+\x20','\x20behaviors','/app/workflows/','\x20field','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','push','parent_id','\x0aError:','528MXfWYw','getParentSQL','displaySummary','jobId','attribute','To\x20view\x20sample\x20data:','sort','green','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','unref','Error:\x20--attribute\x20requires\x20a\x20name\x0a','behaviors','\x20\x20Database:\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','/app/dw/parentSegments/','ignore','personalization_services','segment:parent:pull','idStitching','Found\x20YAML\x20file:\x20','database','sampleData','\x20trigger=','setJobId','events','Listing\x20RT-enabled\x20parent\x20segments...','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','\x0a✔\x20Workflow\x20started','Listing\x20fields\x20for\x20\x27','\x0a\x20\x20\x20\x20]','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','interval','attributes','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','segment:parent:desc','enabled','workflowSessionId','Fetching\x20customers\x20schema...','Updating\x20parent\x20segment\x20\x27','\x20configured','ps:pz:list','\x27\x20is\x20up\x20to\x20date','Options\x20(one\x20required):\x0a','segment:parent:view','SQL\x20query:\x0a','totalEvents','workflowAttemptId','\x20to\x20push\x20the\x20configuration','displayValidateResults','Error\x20parsing\x20YAML:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','format','sourceTableError','703641jQjGIr','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Join:','Output\x20Database:','Behavior:','ps:rt:list','⚡\x20Not\x20enabled','Fetching\x20parent\x20segment\x20\x27','Rows:','Customers:','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','Options:','displayAttributesStats','single','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','<database>.<table>','platform','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','\x27...','displayMasterInfo','output','log','Schema\x20saved\x20to\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20Added\x20RT\x202.0\x20template\x20section','Site:\x20','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Personalization:','segment:parent:create','customerGroupFile','customersWithEvents','parent_segments','\x20No\x20changes\x20-\x20','localeCompare','user_id','workflowId','darwin','My\x20Service','limit','columns','parentSegment','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Join\x20on:','displayBehaviorsStats','Attribute:','YAML\x20file:\x20','segment:parent:sql','cyan','valid','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','To\x20cancel:','✘\x20Failed\x20to\x20rename\x20directory:\x20','✔\x20No\x20changes\x20-\x20\x27','description','label','master','Error\x20reading\x20file:\x20','\x20\x20\x20','schemaValid','1209338oiUXMm','Output\x20file:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','No\x20personalization\x20services\x20configured','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','open','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','getOutputDatabaseName','👥\x20','text','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x0a⚠️\x20\x20Both\x20','joinKey','\x27\x20and\x20run\x20workflow?','displayPreviewResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','segment:parent:show','personalizationServices','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','stats','Coverage:','\x20Opening\x20','\x0aChanges\x20to\x20\x27','map','\x20--attribute\x20\x22','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','parent_segment','customerGroup','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Create\x20parent\x20segment\x20\x27','15dtaOcW','repeat','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','population','Listing\x20parent\x20segments...','tdx\x20ps\x20preview\x20','\x20is\x20already\x20up\x20to\x20date','toFixed','Options:\x0a','/attempt/','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','\x20parent\x20segment\x20\x27','match','114600sPiMEi','allValid','behavior_','reduce','Pattern:\x20','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','length','/\x20→\x20','Errors:','dirname','Creating','\x20--behavior\x20\x22','\x20parent\x20segment','table','\x20Added\x20personalization\x20template\x20to\x20','enriched','Default','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'];a22_0x3b2e=function(){return _0x38566b;};return a22_0x3b2e();}const PARENT_SEGMENT_DIR=a22_0x2df86f(0x264),LEGACY_PARENT_SEGMENT_DIR=a22_0x2df86f(0x29b);function openBrowser(_0xbe00c0){const _0x52a07b=a22_0x2df86f,_0x4627d6=process[_0x52a07b(0x255)],_0x5e67e5=_0x4627d6===_0x52a07b(0x269)?_0x52a07b(0x286):_0x4627d6===_0x52a07b(0x158)?_0x52a07b(0x179):_0x52a07b(0x19e);spawn(_0x5e67e5,[_0xbe00c0],{'detached':!![],'stdio':_0x52a07b(0x21e)})[_0x52a07b(0x218)]();}function migrateLegacyDirectory(){const _0x52491c=a22_0x2df86f;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x1e7dd3=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x1e7dd3[_0x52491c(0x1ce)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x52491c(0x17b)](a22_0x2534e9[_0x52491c(0x157)](_0x52491c(0x28c)+LEGACY_PARENT_SEGMENT_DIR+_0x52491c(0x202)+PARENT_SEGMENT_DIR+_0x52491c(0x1ca))),console[_0x52491c(0x17b)](a22_0x2534e9[_0x52491c(0x16f)](_0x52491c(0x2d3)+LEGACY_PARENT_SEGMENT_DIR+_0x52491c(0x184))),![];console[_0x52491c(0x17b)](a22_0x2534e9[_0x52491c(0x157)](_0x52491c(0x181)+LEGACY_PARENT_SEGMENT_DIR+_0x52491c(0x2b4)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x52491c(0x17b)](a22_0x2534e9['green']('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2a1779){const _0x3ca290=_0x2a1779 instanceof Error?_0x2a1779[_0x52491c(0x1d5)]:String(_0x2a1779);return console[_0x52491c(0x17b)](a22_0x2534e9[_0x52491c(0x1a9)](_0x52491c(0x279)+_0x3ca290+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x2174ae){return migrateLegacyDirectory(),super['run'](_0x2174ae);}}function resolveYamlFile(_0x4c1214){const _0xdbe5b9=a22_0x2df86f;if(_0x4c1214[_0xdbe5b9(0x1a6)](_0xdbe5b9(0x1de))||_0x4c1214[_0xdbe5b9(0x1a6)]('.yaml'))return _0x4c1214;return a22_0x5f4fdc[_0xdbe5b9(0x1b9)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4c1214)+'.yml');}function formatProgressMessage(_0x2865f9){const _0x27b8e0=a22_0x2df86f,_0x5c85b5=_0x2865f9[_0x27b8e0(0x2ac)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5c85b5){const [,_0x1de51d,_0x43f40d,_0xa20171='']=_0x5c85b5;return a22_0x2534e9['dim'](_0x1de51d+':')+'\x20'+_0x43f40d+a22_0x2534e9[_0x27b8e0(0x16f)](_0xa20171);}return a22_0x2534e9[_0x27b8e0(0x16f)](_0x2865f9);}function showFileNotFoundError(_0xfb7ced,_0x3e6b3b){const _0x43273a=a22_0x2df86f;console[_0x43273a(0x17b)](a22_0x2534e9['red']('Error:\x20File\x20not\x20found:\x20'+_0xfb7ced+'\x0a')),console[_0x43273a(0x17b)](a22_0x2534e9[_0x43273a(0x274)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x3e6b3b+_0x43273a(0x1dc)));}function displayRealtimeValidation(_0x4c0f71){const _0x2ede89=a22_0x2df86f;if(!_0x4c0f71[_0x2ede89(0x19d)])return;const _0x14ce61=_0x4c0f71[_0x2ede89(0x19d)],_0xc8b9a4=_0x14ce61[_0x2ede89(0x233)]?a22_0x2534e9[_0x2ede89(0x216)]('⚡\x20Enabled'):a22_0x2534e9[_0x2ede89(0x157)](_0x2ede89(0x24b));console[_0x2ede89(0x17b)]('\x0a'+a22_0x2534e9[_0x2ede89(0x16f)](_0x2ede89(0x1b6))+'\x20'+_0xc8b9a4);if(_0x14ce61[_0x2ede89(0x227)]&&_0x14ce61[_0x2ede89(0x227)][_0x2ede89(0x2b3)]>0x0){console[_0x2ede89(0x17b)]('\x20\x20'+a22_0x2534e9[_0x2ede89(0x16f)](_0x2ede89(0x205))+'\x20'+_0x14ce61[_0x2ede89(0x227)][_0x2ede89(0x2b3)]+'\x20configured');for(const _0xcbfc5b of _0x14ce61[_0x2ede89(0x227)]){const _0x515c03=_0xcbfc5b[_0x2ede89(0x1f6)]===![]?a22_0x2534e9['red']('✘'):a22_0x2534e9['green']('✔');console[_0x2ede89(0x17b)](_0x2ede89(0x168)+_0x515c03+'\x20'+_0xcbfc5b['name']),_0xcbfc5b[_0x2ede89(0x244)]&&console[_0x2ede89(0x17b)](_0x2ede89(0x2d9)+a22_0x2534e9[_0x2ede89(0x1a9)](_0xcbfc5b[_0x2ede89(0x244)]));}}if(_0x14ce61[_0x2ede89(0x22f)]&&_0x14ce61[_0x2ede89(0x22f)][_0x2ede89(0x2b3)]>0x0){console[_0x2ede89(0x17b)]('\x20\x20'+a22_0x2534e9['dim']('Attributes:')+'\x20'+_0x14ce61['attributes'][_0x2ede89(0x2b3)]+_0x2ede89(0x237));for(const _0x49e93e of _0x14ce61[_0x2ede89(0x22f)]){const _0x357776=_0x49e93e[_0x2ede89(0x275)]?a22_0x2534e9[_0x2ede89(0x216)]('✔'):a22_0x2534e9['red']('✘');console['error'](_0x2ede89(0x168)+_0x357776+'\x20'+_0x49e93e[_0x2ede89(0x164)]+'\x20'+a22_0x2534e9[_0x2ede89(0x16f)]('('+_0x49e93e[_0x2ede89(0x189)]+')'));}}if(_0x14ce61[_0x2ede89(0x221)]){const _0x20f206=_0x14ce61['idStitching']['stitchingKeys']?.['length']?_0x2ede89(0x188)+_0x14ce61[_0x2ede89(0x221)][_0x2ede89(0x1d8)][_0x2ede89(0x1b9)](',\x20')+']':'';console[_0x2ede89(0x17b)]('\x20\x20'+a22_0x2534e9['dim'](_0x2ede89(0x1e0))+'\x20'+_0x14ce61['idStitching'][_0x2ede89(0x15a)]+_0x20f206);}if(_0x14ce61[_0x2ede89(0x292)]&&_0x14ce61['personalizationServices']['length']>0x0){console[_0x2ede89(0x17b)]('\x20\x20'+a22_0x2534e9[_0x2ede89(0x16f)](_0x2ede89(0x260))+'\x20'+_0x14ce61['personalizationServices'][_0x2ede89(0x2b3)]+'\x20service'+(_0x14ce61[_0x2ede89(0x292)]['length']!==0x1?'s':''));for(const _0x1aca19 of _0x14ce61['personalizationServices']){console['error'](_0x2ede89(0x1bc)+_0x1aca19[_0x2ede89(0x164)]);}}}function showParentSegmentNotSetError(_0x23349e){const _0x4452db=a22_0x2df86f;console[_0x4452db(0x17b)](a22_0x2534e9[_0x4452db(0x157)](_0x4452db(0x170))),console['error'](_0x23349e);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x1fd);[a22_0x2df86f(0x27b)]=a22_0x2df86f(0x200);async[a22_0x2df86f(0x185)](_0x1f56fe){const _0x25d81e=a22_0x2df86f,{options:_0x2566cb,args:_0x8732e3,tdx:_0x52e178}=_0x1f56fe,_0x4a0586=_0x8732e3[0x0];_0x2566cb[_0x25d81e(0x2c2)]&&(console[_0x25d81e(0x17b)](_0x25d81e(0x25e)+_0x2566cb[_0x25d81e(0x186)]),_0x4a0586&&console[_0x25d81e(0x17b)](_0x25d81e(0x2b1)+_0x4a0586));const _0x2123fa=await withSpinner(_0x4a0586?_0x25d81e(0x2d5)+_0x4a0586+_0x25d81e(0x257):_0x25d81e(0x2a3),()=>_0x52e178['segment']['listParents'](),{'verbose':_0x2566cb[_0x25d81e(0x2c2)]});let _0x4034e3=_0x2123fa['data'];if(_0x4a0586){const _0x15a21b=_0x4a0586[_0x25d81e(0x197)](/[.+^${}()|[\]\\]/g,_0x25d81e(0x2c9))[_0x25d81e(0x197)](/\*/g,'.*')[_0x25d81e(0x197)](/\?/g,'.'),_0x28db42=new RegExp('^'+_0x15a21b+'$','i');_0x4034e3=_0x4034e3[_0x25d81e(0x17d)](_0x4e0f4a=>_0x28db42[_0x25d81e(0x206)](_0x4e0f4a[_0x25d81e(0x22f)][_0x25d81e(0x164)]));}_0x4034e3[_0x25d81e(0x215)]((_0x5ef870,_0x5747ef)=>_0x5ef870[_0x25d81e(0x22f)][_0x25d81e(0x164)][_0x25d81e(0x266)](_0x5747ef[_0x25d81e(0x22f)][_0x25d81e(0x164)])),console['error'](_0x25d81e(0x1ac)+_0x4034e3[_0x25d81e(0x2b3)]+_0x25d81e(0x2b9)+(_0x4034e3[_0x25d81e(0x2b3)]!==0x1?'s':''));const _0xea24ce=_0x2c3a02=>{const _0x1700d1=_0x25d81e;return getConsoleNextUrl(_0x2566cb[_0x1700d1(0x186)],_0x1700d1(0x21d)+_0x2c3a02);};if(_0x2566cb['format']===_0x25d81e(0x146)||_0x2566cb[_0x25d81e(0x243)]==='jsonl'){const _0x1aeb06=_0x4034e3[_0x25d81e(0x298)](_0xde8959=>({..._0xde8959,'url':_0xea24ce(_0xde8959['id'])}));await handleSDKOutput(_0x1aeb06,_0x2566cb);}else{if(_0x4034e3[_0x25d81e(0x2b3)]===0x0)_0x4a0586?console[_0x25d81e(0x25a)](_0x25d81e(0x1f4)+_0x4a0586):console[_0x25d81e(0x25a)](_0x25d81e(0x141));else for(const _0x47db21 of _0x4034e3){const _0x314a02=_0x47db21[_0x25d81e(0x22f)][_0x25d81e(0x2a2)]?a22_0x2534e9[_0x25d81e(0x16f)]('\x20('+formatRows(_0x47db21['attributes'][_0x25d81e(0x2a2)])+')'):'',_0x1ec0ab=hyperlink(_0x47db21['attributes'][_0x25d81e(0x164)],_0xea24ce(_0x47db21['id']));console['log'](_0x25d81e(0x289)+_0x1ec0ab+_0x314a02);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x261);['description']=a22_0x2df86f(0x1ba);async['execute'](_0x4912e6){const _0x10a845=a22_0x2df86f,{options:_0x5a78d3,args:_0x5827e9,tdx:_0x1906fb}=_0x4912e6;console['error'](_0x10a845(0x1da)+_0x10a845(0x18c)+_0x10a845(0x285));const _0x10a2e8=_0x5a78d3;if(_0x5827e9[_0x10a845(0x2b3)]===0x0)return console[_0x10a845(0x17b)](a22_0x2534e9[_0x10a845(0x1a9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x54894e=_0x5827e9[0x0];if(!_0x10a2e8[_0x10a845(0x223)]||!_0x10a2e8[_0x10a845(0x2ba)])return console[_0x10a845(0x17b)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x10a845(0x17b)](_0x10a845(0x276)),0x1;_0x10a2e8['verbose']&&(console['error'](_0x10a845(0x25e)+_0x10a2e8[_0x10a845(0x186)]),console[_0x10a845(0x17b)](_0x10a845(0x1b0)+_0x54894e),console[_0x10a845(0x17b)]('Database:\x20'+_0x10a2e8['database']),console[_0x10a845(0x17b)](_0x10a845(0x1d9)+_0x10a2e8[_0x10a845(0x2ba)]));const _0x24166d=await loadJSONFromOptions(_0x10a2e8['attributes'],_0x10a2e8['attributesFile']),_0x325047=await loadJSONFromOptions(_0x10a2e8[_0x10a845(0x21a)],_0x10a2e8[_0x10a845(0x19a)]),_0x396734=await loadJSONFromOptions(_0x10a2e8[_0x10a845(0x29c)],_0x10a2e8[_0x10a845(0x262)]),_0x1b2e4d={'name':_0x54894e,'description':_0x10a2e8['description'],'scheduleType':_0x10a2e8['scheduleType'],'scheduleOption':_0x10a2e8[_0x10a845(0x1e1)],'timezone':_0x10a2e8[_0x10a845(0x178)],'master':{'parentDatabaseName':_0x10a2e8[_0x10a845(0x223)],'parentTableName':_0x10a2e8[_0x10a845(0x2ba)]},'attributes':_0x24166d,'behaviors':_0x325047,'customerGroup':_0x396734},_0x337b8f=await withSpinner(_0x10a845(0x204)+_0x54894e+_0x10a845(0x257),()=>_0x1906fb[_0x10a845(0x1d2)][_0x10a845(0x14f)](_0x1b2e4d),{'verbose':_0x5a78d3[_0x10a845(0x2c2)]}),_0x268861=_0x337b8f['data'];return console[_0x10a845(0x17b)](_0x10a845(0x187)+_0x268861['name']+_0x10a845(0x2a9)+_0x268861['id']),await handleSDKOutput([_0x268861],_0x5a78d3),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x151);['description']=a22_0x2df86f(0x29a);async[a22_0x2df86f(0x185)](_0x3f580b){const _0x364ecc=a22_0x2df86f,{options:_0x4e76ca,args:_0x57bc53,tdx:_0x51ba6c}=_0x3f580b;console[_0x364ecc(0x17b)](_0x364ecc(0x142)+_0x364ecc(0x18c)+_0x364ecc(0x285));const _0x3301f4=_0x4e76ca;if(_0x57bc53[_0x364ecc(0x2b3)]===0x0)return console[_0x364ecc(0x17b)](a22_0x2534e9[_0x364ecc(0x1a9)](_0x364ecc(0x25c))),console[_0x364ecc(0x17b)](_0x364ecc(0x26e)),0x1;const _0x4f9b3c=_0x57bc53[0x0];_0x3301f4[_0x364ecc(0x2c2)]&&(console[_0x364ecc(0x17b)](_0x364ecc(0x25e)+_0x3301f4['site']),console[_0x364ecc(0x17b)]('Parent\x20segment:\x20'+_0x4f9b3c));const _0x20cb0e=await withSpinner(_0x364ecc(0x1af)+_0x4f9b3c+'\x27...',()=>_0x51ba6c[_0x364ecc(0x1d2)][_0x364ecc(0x15f)](_0x4f9b3c),{'verbose':_0x3301f4[_0x364ecc(0x2c2)]}),_0xadb8df=_0x20cb0e[_0x364ecc(0x1bd)],_0x29479c=await loadJSONFromOptions(_0x3301f4[_0x364ecc(0x1f0)],_0x3301f4[_0x364ecc(0x180)]),_0x229a21=await loadJSONFromOptions(_0x3301f4[_0x364ecc(0x154)],_0x3301f4[_0x364ecc(0x1d6)]),_0x1b3a56={'name':_0xadb8df['name'],'description':_0x3301f4['description']!==undefined?_0x3301f4[_0x364ecc(0x27b)]:_0xadb8df[_0x364ecc(0x27b)],'scheduleType':_0x3301f4[_0x364ecc(0x1c0)]!==undefined?_0x3301f4[_0x364ecc(0x1c0)]:_0xadb8df[_0x364ecc(0x1c0)],'scheduleOption':_0x3301f4[_0x364ecc(0x1e1)]!==undefined?_0x3301f4[_0x364ecc(0x1e1)]:_0xadb8df[_0x364ecc(0x1e1)],'timezone':_0x3301f4['timezone']!==undefined?_0x3301f4[_0x364ecc(0x178)]:_0xadb8df[_0x364ecc(0x178)],'master':_0xadb8df[_0x364ecc(0x27d)],'attributes':_0x29479c?[..._0xadb8df[_0x364ecc(0x22f)]||[],..._0x29479c]:_0xadb8df[_0x364ecc(0x22f)],'behaviors':_0x229a21?[..._0xadb8df[_0x364ecc(0x21a)]||[],..._0x229a21]:_0xadb8df[_0x364ecc(0x21a)],'customerGroup':_0xadb8df[_0x364ecc(0x29c)]},_0x35a404=await withSpinner(_0x364ecc(0x236)+_0x4f9b3c+_0x364ecc(0x257),()=>_0x51ba6c[_0x364ecc(0x1d2)]['updateParent'](_0x4f9b3c,_0x1b3a56),{'verbose':_0x3301f4['verbose']}),_0x4bcd42=_0x35a404['data'];return console[_0x364ecc(0x17b)](_0x364ecc(0x1e3)+_0x4bcd42[_0x364ecc(0x164)]+'\x27'),await handleSDKOutput([_0x4bcd42],_0x3301f4),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x220);['description']=a22_0x2df86f(0x246);async['execute'](_0x614a27){const _0x968c5d=a22_0x2df86f,{options:_0xb92802,args:_0x27fc8b,tdx:_0x2b986f}=_0x614a27,_0xd0a785=_0xb92802,_0x1af293=_0x27fc8b[0x0]||_0xb92802['parentSegment'];if(!_0x1af293)return showParentSegmentNotSetError(_0x968c5d(0x1a8)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0xd0a785[_0x968c5d(0x1ec)]&&_0xd0a785[_0x968c5d(0x259)])return console[_0x968c5d(0x17b)](a22_0x2534e9[_0x968c5d(0x1a9)](_0x968c5d(0x190))),console[_0x968c5d(0x17b)](a22_0x2534e9[_0x968c5d(0x16f)](_0x968c5d(0x177))),console[_0x968c5d(0x17b)](a22_0x2534e9[_0x968c5d(0x16f)](_0x968c5d(0x2cc)+PARENT_SEGMENT_DIR+_0x968c5d(0x19f))),console[_0x968c5d(0x17b)](a22_0x2534e9[_0x968c5d(0x274)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x363ce0=_0xd0a785[_0x968c5d(0x259)]||a22_0x5f4fdc[_0x968c5d(0x1b9)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1af293)+_0x968c5d(0x1de));_0xd0a785[_0x968c5d(0x2c2)]&&(console[_0x968c5d(0x17b)]('Site:\x20'+_0xd0a785[_0x968c5d(0x186)]),console[_0x968c5d(0x17b)](_0x968c5d(0x1e5)+_0x1af293),console[_0x968c5d(0x17b)](_0x968c5d(0x282)+_0x363ce0));const _0x1b0c4d=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x1af293+_0x968c5d(0x257),()=>_0x2b986f[_0x968c5d(0x1d2)][_0x968c5d(0x16a)](_0x1af293),{'verbose':_0xd0a785[_0x968c5d(0x2c2)]}),_0x1a561d=_0x1b0c4d[_0x968c5d(0x1bd)];if(existsSync(_0x363ce0)){const _0x1a4f7b=readFileSync(_0x363ce0,'utf-8'),_0x1d17fe=generateDiff(_0x1a4f7b,_0x1a561d);if(!hasChanges(_0x1d17fe))console['error'](a22_0x2534e9[_0x968c5d(0x216)]('✔')+_0x968c5d(0x265)+a22_0x2534e9[_0x968c5d(0x274)](_0x363ce0)+_0x968c5d(0x2a5));else{console[_0x968c5d(0x17b)](_0x968c5d(0x297)+_0x363ce0+'\x27:'),console[_0x968c5d(0x17b)]('─'[_0x968c5d(0x2a0)](0x3c)),console['error'](formatDiffWithColors(_0x1d17fe)),console['error']('─'[_0x968c5d(0x2a0)](0x3c));if(!_0xd0a785['yes']){if(!isInteractive())return console[_0x968c5d(0x17b)](a22_0x2534e9[_0x968c5d(0x1a9)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a22_0x2534e9[_0x968c5d(0x16f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b2801=await confirmKey(_0x968c5d(0x1c3)+_0x363ce0+'\x27?');if(!_0x5b2801)return console[_0x968c5d(0x17b)](a22_0x2534e9[_0x968c5d(0x157)]('Aborted.')),0x1;}writeFileSync(_0x363ce0,_0x1a561d,_0x968c5d(0x2d0)),console[_0x968c5d(0x17b)](a22_0x2534e9['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a22_0x2534e9['cyan'](_0x363ce0));}}else{const _0x325aa6=a22_0x5f4fdc[_0x968c5d(0x2b6)](_0x363ce0);!existsSync(_0x325aa6)&&mkdirSync(_0x325aa6,{'recursive':!![]}),writeFileSync(_0x363ce0,_0x1a561d,'utf-8'),console[_0x968c5d(0x17b)](a22_0x2534e9[_0x968c5d(0x216)]('✔')+_0x968c5d(0x1b2)+a22_0x2534e9['cyan'](_0x363ce0));}return saveSessionContext({'parent_segment':_0x1af293},_0xd0a785[_0x968c5d(0x18f)]),console['error'](a22_0x2534e9['green']('✔')+_0x968c5d(0x1b4)+a22_0x2534e9[_0x968c5d(0x16f)](_0x968c5d(0x29b))+'\x20=\x20'+a22_0x2534e9[_0x968c5d(0x274)](_0x1af293)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x15b);[a22_0x2df86f(0x27b)]=a22_0x2df86f(0x22d);async[a22_0x2df86f(0x185)](_0x41fbc5){const _0x3ab76b=a22_0x2df86f,{options:_0x4a1682,args:_0x47f69f,tdx:_0x14e97e}=_0x41fbc5,_0xb161f0=_0x4a1682,_0x22fdc9=_0x47f69f[0x0]||_0x4a1682['parentSegment'];if(!_0x22fdc9)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x3ab76b(0x290)),0x1;const _0x790539=resolveYamlFile(_0x22fdc9);if(!existsSync(_0x790539))return showFileNotFoundError(_0x790539,_0x22fdc9),0x1;_0xb161f0['verbose']&&(console[_0x3ab76b(0x17b)](_0x3ab76b(0x25e)+_0xb161f0[_0x3ab76b(0x186)]),console[_0x3ab76b(0x17b)](_0x3ab76b(0x272)+_0x790539));let _0x59fd87;try{_0x59fd87=readFileSync(_0x790539,_0x3ab76b(0x2d0));}catch(_0x3b0c29){const _0x2cb363=_0x3b0c29 instanceof Error?_0x3b0c29[_0x3ab76b(0x1d5)]:String(_0x3b0c29);return console[_0x3ab76b(0x17b)]('Error\x20reading\x20file:\x20'+_0x2cb363),0x1;}const _0x3ca579=await withSpinner('Analyzing\x20changes...',()=>_0x14e97e[_0x3ab76b(0x1d2)]['pushParentYaml'](_0x59fd87),{'verbose':_0xb161f0[_0x3ab76b(0x2c2)]}),_0x450fd8=_0x3ca579[_0x3ab76b(0x1bd)],{isNew:_0xb8e080,name:_0x407993,hasChanges:_0x30291e,diffFormatted:_0x316ef0}=_0x450fd8;if(!_0x30291e)return console[_0x3ab76b(0x17b)](_0x3ab76b(0x27a)+_0x407993+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0xb8e080?console[_0x3ab76b(0x17b)](_0x3ab76b(0x2d6)+_0x407993+'\x27:'):console[_0x3ab76b(0x17b)](_0x3ab76b(0x150)+_0x407993+'\x27:');console[_0x3ab76b(0x17b)]('─'[_0x3ab76b(0x2a0)](0x3c)),console[_0x3ab76b(0x17b)](_0x316ef0),console[_0x3ab76b(0x17b)]('─'['repeat'](0x3c));const _0x18f2b3=_0xb8e080?_0x3ab76b(0x29e)+_0x407993+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x407993+'\x27?';if(!_0xb161f0[_0x3ab76b(0x1f3)]){if(!isInteractive())return console[_0x3ab76b(0x17b)](a22_0x2534e9[_0x3ab76b(0x1a9)](_0x3ab76b(0x20e)),_0x3ab76b(0x2be)),console[_0x3ab76b(0x17b)](a22_0x2534e9[_0x3ab76b(0x16f)](_0x3ab76b(0x2a1))),0x1;const _0xefc033=await confirmKey(_0x18f2b3);if(!_0xefc033)return console[_0x3ab76b(0x17b)](a22_0x2534e9[_0x3ab76b(0x157)]('Aborted.')),0x1;}const _0x33d5f4=_0xb8e080?'Creating':_0x3ab76b(0x1c7),_0x131a03=await withSpinner(_0x33d5f4+_0x3ab76b(0x2ab)+_0x407993+_0x3ab76b(0x257),()=>_0x450fd8[_0x3ab76b(0x1ff)](),{'verbose':_0xb161f0[_0x3ab76b(0x2c2)]}),_0x1db203=_0x131a03[_0x3ab76b(0x1bd)],_0x2179e2=getConsoleNextUrl(_0xb161f0[_0x3ab76b(0x186)],_0x3ab76b(0x21d)+_0x1db203['id']),_0x588b63=_0xb8e080?_0x3ab76b(0x1d7):_0x3ab76b(0x1ee);return console['error']('✔\x20'+_0x588b63+_0x3ab76b(0x2ab)+_0x1db203['name']+'\x27'),console[_0x3ab76b(0x17b)]('\x20\x20'+_0x2179e2),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x160);[a22_0x2df86f(0x27b)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a22_0x2df86f(0x185)](_0x39e1a8){const _0x2b9e8d=a22_0x2df86f,{options:_0x4b6864,args:_0x57dea5,tdx:_0x238ec7}=_0x39e1a8,_0x284a95=_0x4b6864,_0x2306ee=_0x57dea5[0x0]||_0x4b6864[_0x2b9e8d(0x26d)];if(!_0x2306ee)return showParentSegmentNotSetError(_0x2b9e8d(0x153)+_0x2b9e8d(0x2c5)+_0x2b9e8d(0x2a7)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x2b9e8d(0x25f)+_0x2b9e8d(0x1c9)),0x1;const _0x44a239=resolveYamlFile(_0x2306ee);if(!existsSync(_0x44a239))return showFileNotFoundError(_0x44a239,_0x2306ee),0x1;_0x284a95['verbose']&&(console['error'](_0x2b9e8d(0x25e)+_0x284a95[_0x2b9e8d(0x186)]),console[_0x2b9e8d(0x17b)]('YAML\x20file:\x20'+_0x44a239));let _0x214353;try{_0x214353=readFileSync(_0x44a239,_0x2b9e8d(0x2d0));}catch(_0x5be681){const _0x545583=_0x5be681 instanceof Error?_0x5be681[_0x2b9e8d(0x1d5)]:String(_0x5be681);return console['error']('Error\x20reading\x20file:\x20'+_0x545583),0x1;}const _0x5c1f89=createCommandSpinner(a22_0x2534e9[_0x2b9e8d(0x16f)](_0x2b9e8d(0x16e)),{'verbose':_0x284a95['verbose']});_0x5c1f89[_0x2b9e8d(0x179)]();const _0x44a7f0={'onProgress':_0x4e7242=>{const _0x3d2d02=_0x2b9e8d;_0x5c1f89[_0x3d2d02(0x28a)]=formatProgressMessage(_0x4e7242);}};if(_0x284a95[_0x2b9e8d(0x27d)])_0x44a7f0[_0x2b9e8d(0x27d)]=!![];if(_0x284a95[_0x2b9e8d(0x2bc)])_0x44a7f0['enriched']=!![];_0x284a95['attribute']&&(_0x44a7f0['attribute']=_0x284a95[_0x2b9e8d(0x213)]);_0x284a95['behavior']&&(_0x44a7f0[_0x2b9e8d(0x1a4)]=_0x284a95[_0x2b9e8d(0x1a4)]);if(_0x284a95[_0x2b9e8d(0x22e)])_0x44a7f0[_0x2b9e8d(0x22e)]=_0x284a95[_0x2b9e8d(0x22e)];let _0x259944;try{_0x259944=await _0x238ec7[_0x2b9e8d(0x1d2)][_0x2b9e8d(0x1e2)](_0x214353,_0x44a7f0),_0x5c1f89[_0x2b9e8d(0x199)]();}catch(_0x400d4c){_0x5c1f89[_0x2b9e8d(0x199)]();throw _0x400d4c;}const _0x1bb95d=_0x284a95[_0x2b9e8d(0x22e)]||_0x2b9e8d(0x2d7);return this[_0x2b9e8d(0x240)](_0x259944,_0x44a7f0,_0x44a239,_0x1bb95d),_0x259944[_0x2b9e8d(0x2ae)]?0x0:0x1;}[a22_0x2df86f(0x240)](_0x1fa86c,_0x395344,_0x1f07b3,_0x321beb){const _0xc6f846=a22_0x2df86f;console[_0xc6f846(0x17b)]('\x0a'+a22_0x2534e9['bold']('Validate:')+'\x20'+_0x1fa86c[_0xc6f846(0x164)]),console[_0xc6f846(0x17b)]('═'[_0xc6f846(0x2a0)](0x3c)),this[_0xc6f846(0x258)](_0x1fa86c);if(typeof _0x395344[_0xc6f846(0x213)]===_0xc6f846(0x156)){this[_0xc6f846(0x251)](_0x1fa86c),this[_0xc6f846(0x211)](_0x1fa86c),this[_0xc6f846(0x2da)](_0x1f07b3,_0x321beb,'attribute',_0x395344[_0xc6f846(0x213)]);return;}if(_0x395344[_0xc6f846(0x213)]===!![]){this[_0xc6f846(0x251)](_0x1fa86c),this[_0xc6f846(0x211)](_0x1fa86c),this[_0xc6f846(0x2da)](_0x1f07b3,_0x321beb,_0xc6f846(0x22f));return;}if(typeof _0x395344[_0xc6f846(0x1a4)]==='string'){this[_0xc6f846(0x270)](_0x1fa86c,_0x321beb),this[_0xc6f846(0x211)](_0x1fa86c),this['displayPreviewHints'](_0x1f07b3,_0x321beb,_0xc6f846(0x1a4),_0x395344[_0xc6f846(0x1a4)]);return;}if(_0x395344[_0xc6f846(0x1a4)]===!![]){this[_0xc6f846(0x270)](_0x1fa86c,_0x321beb),this['displaySummary'](_0x1fa86c),this[_0xc6f846(0x2da)](_0x1f07b3,_0x321beb,_0xc6f846(0x21a));return;}this[_0xc6f846(0x251)](_0x1fa86c),this[_0xc6f846(0x270)](_0x1fa86c,_0x321beb),this['displayRealtimeInfo'](_0x1fa86c),this['displaySummary'](_0x1fa86c),this[_0xc6f846(0x2da)](_0x1f07b3,_0x321beb,'all');}[a22_0x2df86f(0x1ef)](_0x2dc406){displayRealtimeValidation(_0x2dc406);}['displayPreviewHints'](_0x2cf8e6,_0x451809,_0x148e05,_0x4cb929){const _0x4a5cad=a22_0x2df86f;console['error']('\x0a'+a22_0x2534e9[_0x4a5cad(0x16f)](_0x4a5cad(0x214)));const _0x8d8256=_0x451809!=='-1d'?'\x20--interval\x20'+_0x451809:'';if(_0x148e05===_0x4a5cad(0x213)&&_0x4cb929)console[_0x4a5cad(0x17b)]('\x20\x20'+a22_0x2534e9['dim'](_0x4a5cad(0x2a4)+_0x2cf8e6+_0x4a5cad(0x299)+_0x4cb929+'\x22'+_0x8d8256));else{if(_0x148e05==='behavior'&&_0x4cb929)console[_0x4a5cad(0x17b)]('\x20\x20'+a22_0x2534e9['dim'](_0x4a5cad(0x2a4)+_0x2cf8e6+'\x20--behavior\x20\x22'+_0x4cb929+'\x22'+_0x8d8256));else(_0x148e05===_0x4a5cad(0x22f)||_0x148e05==='all')&&console[_0x4a5cad(0x17b)]('\x20\x20'+a22_0x2534e9[_0x4a5cad(0x16f)](_0x4a5cad(0x2a4)+_0x2cf8e6+_0x4a5cad(0x163)+_0x8d8256));}(_0x148e05===_0x4a5cad(0x21a)||_0x148e05==='all')&&console[_0x4a5cad(0x17b)]('\x20\x20'+a22_0x2534e9['dim'](_0x4a5cad(0x2a4)+_0x2cf8e6+_0x4a5cad(0x169)+_0x8d8256)),_0x148e05===_0x4a5cad(0x1c8)&&console[_0x4a5cad(0x17b)]('\x20\x20'+a22_0x2534e9['dim']('tdx\x20ps\x20preview\x20'+_0x2cf8e6+'\x20--enriched'+_0x8d8256));}[a22_0x2df86f(0x258)](_0x5a462e){const _0x53a82e=a22_0x2df86f,{master:_0x304072}=_0x5a462e,_0x1ddc53=_0x304072[_0x53a82e(0x280)]?a22_0x2534e9['green']('✔'):a22_0x2534e9[_0x53a82e(0x1a9)]('✘');console[_0x53a82e(0x17b)]('\x0a'+a22_0x2534e9[_0x53a82e(0x16f)](_0x53a82e(0x17e))),console['error'](_0x1ddc53+'\x20'+a22_0x2534e9[_0x53a82e(0x1d4)](_0x304072[_0x53a82e(0x223)]+'.'+_0x304072[_0x53a82e(0x2ba)])),_0x304072[_0x53a82e(0x280)]?_0x304072[_0x53a82e(0x15c)]!==undefined&&console[_0x53a82e(0x17b)]('\x20\x20'+a22_0x2534e9['dim'](_0x53a82e(0x24d))+'\x20'+a22_0x2534e9[_0x53a82e(0x274)](formatRows(_0x304072[_0x53a82e(0x15c)]))):console[_0x53a82e(0x17b)]('\x20\x20'+a22_0x2534e9[_0x53a82e(0x1a9)](_0x53a82e(0x1a0))+'\x20'+_0x304072['schemaError']);}[a22_0x2df86f(0x251)](_0x27caf9){const _0x11e6d1=a22_0x2df86f;if(_0x27caf9[_0x11e6d1(0x22f)][_0x11e6d1(0x2b3)]===0x0)return;console['error']('\x0a'+a22_0x2534e9[_0x11e6d1(0x16f)](_0x11e6d1(0x1fb)));for(const _0x479a3a of _0x27caf9[_0x11e6d1(0x22f)]){const _0x1dbf7f=_0x479a3a[_0x11e6d1(0x280)]?a22_0x2534e9[_0x11e6d1(0x216)]('✔'):a22_0x2534e9[_0x11e6d1(0x1a9)]('✘');let _0xbf8e98='';if(_0x479a3a[_0x11e6d1(0x280)]&&_0x479a3a['matchedCount']!==undefined&&_0x479a3a[_0x11e6d1(0x1c6)]!==undefined){const _0x1f9bc3=_0x479a3a[_0x11e6d1(0x1c6)][_0x11e6d1(0x2a6)](0x1),_0xe107c0=_0x479a3a[_0x11e6d1(0x1c6)]>=0x50?a22_0x2534e9[_0x11e6d1(0x216)]:_0x479a3a[_0x11e6d1(0x1c6)]>=0x32?a22_0x2534e9['yellow']:a22_0x2534e9[_0x11e6d1(0x1a9)];_0xbf8e98='\x20'+a22_0x2534e9[_0x11e6d1(0x16f)](_0x11e6d1(0x295))+'\x20'+_0xe107c0(_0x1f9bc3+'%')+'\x20('+formatRows(_0x479a3a['matchedCount'])+'\x20rows)';}console['error'](_0x1dbf7f+'\x20'+a22_0x2534e9['bold'](_0x479a3a[_0x11e6d1(0x164)])+_0xbf8e98),console['error']('\x20\x20'+a22_0x2534e9[_0x11e6d1(0x16f)](_0x11e6d1(0x17c))+'\x20'+a22_0x2534e9[_0x11e6d1(0x1d4)](_0x479a3a['database']+'.'+_0x479a3a[_0x11e6d1(0x2ba)]));const _0xd964cf=_0x479a3a[_0x11e6d1(0x28d)]===_0x479a3a['foreignKey']?a22_0x2534e9['dim'](_0x11e6d1(0x26f))+'\x20'+_0x479a3a[_0x11e6d1(0x28d)]:a22_0x2534e9[_0x11e6d1(0x16f)](_0x11e6d1(0x247))+'\x20'+_0x479a3a['joinKey']+'\x20=\x20'+_0x479a3a[_0x11e6d1(0x19b)];console['error']('\x20\x20'+_0xd964cf),console['error']('\x20\x20'+a22_0x2534e9[_0x11e6d1(0x16f)](_0x11e6d1(0x2dd))),this['displayColumns'](_0x479a3a[_0x11e6d1(0x26c)]),!_0x479a3a['schemaValid']&&console[_0x11e6d1(0x17b)]('\x20\x20'+a22_0x2534e9[_0x11e6d1(0x1a9)](_0x11e6d1(0x1a0))+'\x20'+_0x479a3a['schemaError']);}}[a22_0x2df86f(0x270)](_0x12157a,_0x29f4cd){const _0x13383e=a22_0x2df86f;if(_0x12157a['behaviors'][_0x13383e(0x2b3)]===0x0)return;console[_0x13383e(0x17b)]('\x0a'+a22_0x2534e9[_0x13383e(0x16f)]('Behaviors')+'\x20'+a22_0x2534e9['dim']('('+_0x29f4cd+')'));for(const _0x2f8324 of _0x12157a[_0x13383e(0x21a)]){const _0x2f7f88=_0x2f8324[_0x13383e(0x280)]?a22_0x2534e9[_0x13383e(0x216)]('✔'):a22_0x2534e9[_0x13383e(0x1a9)]('✘');let _0x2825a9='';if(_0x2f8324[_0x13383e(0x280)]&&_0x2f8324['customersWithEvents']!==undefined&&_0x2f8324[_0x13383e(0x23d)]!==undefined){const _0x839ef4=_0x2f8324['customerPercent']?.[_0x13383e(0x2a6)](0x1)||'?',_0xfa758d=(_0x2f8324[_0x13383e(0x2c0)]??0x0)>=0x32?a22_0x2534e9[_0x13383e(0x216)]:(_0x2f8324[_0x13383e(0x2c0)]??0x0)>=0x14?a22_0x2534e9['yellow']:a22_0x2534e9[_0x13383e(0x1a9)];_0x2825a9='\x20'+a22_0x2534e9['dim'](_0x13383e(0x24e))+'\x20'+_0xfa758d(formatRows(_0x2f8324[_0x13383e(0x263)]))+'\x20('+_0x839ef4+_0x13383e(0x2d2)+a22_0x2534e9[_0x13383e(0x16f)](_0x13383e(0x205))+'\x20'+a22_0x2534e9['cyan'](formatRows(_0x2f8324[_0x13383e(0x23d)]));}console['error'](_0x2f7f88+'\x20'+a22_0x2534e9[_0x13383e(0x1d4)](_0x2f8324[_0x13383e(0x164)])+_0x2825a9),console['error']('\x20\x20'+a22_0x2534e9[_0x13383e(0x16f)]('Source:')+'\x20'+a22_0x2534e9[_0x13383e(0x1d4)](_0x2f8324[_0x13383e(0x223)]+'.'+_0x2f8324['table']));const _0xd216a=_0x2f8324['joinKey']===_0x2f8324[_0x13383e(0x19b)]?a22_0x2534e9[_0x13383e(0x16f)](_0x13383e(0x26f))+'\x20'+_0x2f8324[_0x13383e(0x28d)]:a22_0x2534e9[_0x13383e(0x16f)](_0x13383e(0x247))+'\x20'+_0x2f8324[_0x13383e(0x28d)]+_0x13383e(0x194)+_0x2f8324[_0x13383e(0x19b)];console[_0x13383e(0x17b)]('\x20\x20'+_0xd216a),console[_0x13383e(0x17b)]('\x20\x20'+a22_0x2534e9[_0x13383e(0x16f)]('Columns:')),this[_0x13383e(0x1be)](_0x2f8324[_0x13383e(0x26c)]),!_0x2f8324[_0x13383e(0x280)]&&console[_0x13383e(0x17b)]('\x20\x20'+a22_0x2534e9['red'](_0x13383e(0x1a0))+'\x20'+_0x2f8324[_0x13383e(0x1b3)]);}}[a22_0x2df86f(0x1be)](_0x1fcdf8){const _0x1cd65a=a22_0x2df86f;for(const _0x3bebe1 of _0x1fcdf8){_0x3bebe1['label']===_0x3bebe1[_0x1cd65a(0x1eb)]||_0x3bebe1[_0x1cd65a(0x1eb)]==='*'?console[_0x1cd65a(0x17b)](_0x1cd65a(0x1bc)+_0x3bebe1[_0x1cd65a(0x27c)]):console[_0x1cd65a(0x17b)](_0x1cd65a(0x1bc)+_0x3bebe1[_0x1cd65a(0x27c)]+'\x20'+a22_0x2534e9[_0x1cd65a(0x16f)]('('+_0x3bebe1[_0x1cd65a(0x1eb)]+')'));}}[a22_0x2df86f(0x211)](_0x33bef8){const _0x5b9769=a22_0x2df86f;console[_0x5b9769(0x17b)]('─'['repeat'](0x3c));if(_0x33bef8['errors']['length']>0x0){console[_0x5b9769(0x17b)]('\x0a'+a22_0x2534e9[_0x5b9769(0x1a9)](_0x5b9769(0x2b5)));for(const _0x14fa8d of _0x33bef8[_0x5b9769(0x15d)]){console[_0x5b9769(0x17b)]('\x20\x20'+a22_0x2534e9[_0x5b9769(0x1a9)]('•')+'\x20'+_0x14fa8d);}}_0x33bef8[_0x5b9769(0x2ae)]&&console[_0x5b9769(0x17b)]('\x0a'+a22_0x2534e9['green']('✔')+_0x5b9769(0x1b8));}}function a22_0x2d13(_0x241501,_0x41df2f){_0x241501=_0x241501-0x140;const _0x3b2ee8=a22_0x3b2e();let _0x2d1338=_0x3b2ee8[_0x241501];return _0x2d1338;}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']='segment:parent:preview';['description']=a22_0x2df86f(0x283);async[a22_0x2df86f(0x185)](_0x16bef5){const _0x2aa020=a22_0x2df86f,{options:_0x5c7336,args:_0xdabb72,tdx:_0x103b8e}=_0x16bef5,_0xbfefaa=_0x5c7336,_0x3bc836=_0xdabb72[0x0]||_0x5c7336[_0x2aa020(0x26d)];if(!_0x3bc836)return showParentSegmentNotSetError(_0x2aa020(0x21c)+_0x2aa020(0x242)+_0x2aa020(0x23a)+_0x2aa020(0x230)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x2aa020(0x2ce)+_0x2aa020(0x217)+_0x2aa020(0x1c9)),0x1;if(!_0xbfefaa[_0x2aa020(0x27d)]&&!_0xbfefaa[_0x2aa020(0x213)]&&!_0xbfefaa[_0x2aa020(0x1a4)]&&!_0xbfefaa[_0x2aa020(0x2bc)])return console[_0x2aa020(0x17b)](a22_0x2534e9['red']('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error'](_0x2aa020(0x1c2)),console['error'](_0x2aa020(0x250)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x2aa020(0x17b)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x2aa020(0x17b)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x2aa020(0x17b)](_0x2aa020(0x287)),0x1;const _0x2d6738=resolveYamlFile(_0x3bc836);if(!existsSync(_0x2d6738))return showFileNotFoundError(_0x2d6738,_0x3bc836),0x1;_0xbfefaa[_0x2aa020(0x2c2)]&&(console[_0x2aa020(0x17b)](_0x2aa020(0x25e)+_0xbfefaa['site']),console['error'](_0x2aa020(0x272)+_0x2d6738));let _0x5411f0;try{_0x5411f0=readFileSync(_0x2d6738,'utf-8');}catch(_0x4efdbe){const _0x514edd=_0x4efdbe instanceof Error?_0x4efdbe[_0x2aa020(0x1d5)]:String(_0x4efdbe);return console[_0x2aa020(0x17b)](_0x2aa020(0x27e)+_0x514edd),0x1;}let _0x33dac9;try{_0x33dac9=parseDef(_0x5411f0);}catch(_0xa50002){const _0x371fd3=_0xa50002 instanceof Error?_0xa50002['message']:String(_0xa50002);return console[_0x2aa020(0x17b)](a22_0x2534e9[_0x2aa020(0x1a9)](_0x2aa020(0x241)+_0x371fd3)),0x1;}if(_0xbfefaa[_0x2aa020(0x213)]===!![]||_0xbfefaa[_0x2aa020(0x213)]===''){const _0x36f2c5=_0x33dac9[_0x2aa020(0x22f)]?.[_0x2aa020(0x298)](_0x319e00=>_0x319e00[_0x2aa020(0x164)])||[];if(_0x36f2c5[_0x2aa020(0x2b3)]===0x0)console['error'](a22_0x2534e9[_0x2aa020(0x1a9)](_0x2aa020(0x2cf)));else{console[_0x2aa020(0x17b)](a22_0x2534e9[_0x2aa020(0x1a9)](_0x2aa020(0x219))),console[_0x2aa020(0x17b)](_0x2aa020(0x14d));for(const _0x4ef322 of _0x36f2c5){console[_0x2aa020(0x17b)]('\x20\x20'+a22_0x2534e9[_0x2aa020(0x274)](_0x4ef322));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x3bc836+_0x2aa020(0x299)+_0x36f2c5[0x0]+'\x22');}return 0x1;}if(_0xbfefaa['behavior']===!![]||_0xbfefaa[_0x2aa020(0x1a4)]===''){const _0x328199=_0x33dac9[_0x2aa020(0x21a)]?.[_0x2aa020(0x298)](_0x3fa628=>_0x3fa628[_0x2aa020(0x164)])||[];if(_0x328199[_0x2aa020(0x2b3)]===0x0)console['error'](a22_0x2534e9['red']('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console['error'](a22_0x2534e9[_0x2aa020(0x1a9)](_0x2aa020(0x1cd))),console[_0x2aa020(0x17b)](_0x2aa020(0x2c8));for(const _0x172199 of _0x328199){console[_0x2aa020(0x17b)]('\x20\x20'+a22_0x2534e9[_0x2aa020(0x274)](_0x172199));}console[_0x2aa020(0x17b)](_0x2aa020(0x149)+_0x3bc836+_0x2aa020(0x2b8)+_0x328199[0x0]+'\x22');}return 0x1;}const _0x26ad90=createCommandSpinner(a22_0x2534e9['dim'](_0x2aa020(0x14e)),{'verbose':_0xbfefaa['verbose']});_0x26ad90[_0x2aa020(0x179)]();const _0x13362a={'onProgress':_0x3af835=>{const _0xb02d20=_0x2aa020;_0x26ad90[_0xb02d20(0x28a)]=formatProgressMessage(_0x3af835);}};if(_0xbfefaa[_0x2aa020(0x27d)])_0x13362a[_0x2aa020(0x27d)]=!![];if(_0xbfefaa[_0x2aa020(0x213)]&&typeof _0xbfefaa[_0x2aa020(0x213)]===_0x2aa020(0x156))_0x13362a[_0x2aa020(0x213)]=_0xbfefaa[_0x2aa020(0x213)];if(_0xbfefaa['behavior']&&typeof _0xbfefaa[_0x2aa020(0x1a4)]==='string')_0x13362a[_0x2aa020(0x1a4)]=_0xbfefaa[_0x2aa020(0x1a4)];if(_0xbfefaa['enriched'])_0x13362a[_0x2aa020(0x2bc)]=!![];if(_0xbfefaa[_0x2aa020(0x22e)])_0x13362a[_0x2aa020(0x22e)]=_0xbfefaa[_0x2aa020(0x22e)];let _0x200346;try{_0x200346=await _0x103b8e[_0x2aa020(0x1d2)][_0x2aa020(0x167)](_0x5411f0,_0x13362a),_0x26ad90[_0x2aa020(0x199)]();}catch(_0x5ea434){_0x26ad90[_0x2aa020(0x199)]();throw _0x5ea434;}return await this[_0x2aa020(0x28f)](_0x200346,{'master':_0xbfefaa[_0x2aa020(0x27d)],'attribute':typeof _0xbfefaa['attribute']==='string'?_0xbfefaa[_0x2aa020(0x213)]:undefined,'behavior':typeof _0xbfefaa['behavior']===_0x2aa020(0x156)?_0xbfefaa['behavior']:undefined,'enriched':_0xbfefaa[_0x2aa020(0x2bc)]}),_0x200346['allValid']?0x0:0x1;}async[a22_0x2df86f(0x28f)](_0x30610e,_0x30b7dc){const _0x42375f=a22_0x2df86f;console[_0x42375f(0x17b)]('\x0a'+a22_0x2534e9[_0x42375f(0x1d4)]('Preview:')+'\x20'+_0x30610e['name']),console[_0x42375f(0x17b)]('═'[_0x42375f(0x2a0)](0x3c));if(_0x30b7dc[_0x42375f(0x27d)]&&_0x30610e['sampleData']){const _0x3b7446=a22_0x2534e9[_0x42375f(0x16f)]('Master:')+'\x20'+a22_0x2534e9[_0x42375f(0x1d4)](_0x30610e['master'][_0x42375f(0x223)]+'.'+_0x30610e[_0x42375f(0x27d)][_0x42375f(0x2ba)]);await this[_0x42375f(0x1e7)](_0x3b7446,_0x30610e[_0x42375f(0x224)]);}else{if(_0x30b7dc[_0x42375f(0x213)]&&_0x30610e[_0x42375f(0x224)]){const _0x24ddfa=a22_0x2534e9[_0x42375f(0x16f)](_0x42375f(0x271))+'\x20'+a22_0x2534e9['bold'](_0x30b7dc[_0x42375f(0x213)]);await this['displaySampleData'](_0x24ddfa,_0x30610e[_0x42375f(0x224)]);}else{if(_0x30b7dc[_0x42375f(0x1a4)]&&_0x30610e[_0x42375f(0x224)]){const _0x594514=a22_0x2534e9[_0x42375f(0x16f)](_0x42375f(0x249))+'\x20'+a22_0x2534e9[_0x42375f(0x1d4)](_0x30b7dc['behavior']);await this[_0x42375f(0x1e7)](_0x594514,_0x30610e[_0x42375f(0x224)]);}else{if(_0x30b7dc[_0x42375f(0x2bc)]&&_0x30610e[_0x42375f(0x224)]){const _0x5be7bb=a22_0x2534e9[_0x42375f(0x16f)]('Enriched:')+'\x20'+a22_0x2534e9[_0x42375f(0x1d4)](_0x42375f(0x1a1));await this[_0x42375f(0x1e7)](_0x5be7bb,_0x30610e['sampleData']);}else!_0x30610e[_0x42375f(0x224)]&&console[_0x42375f(0x17b)](_0x42375f(0x1d0));}}}if(_0x30610e['errors'][_0x42375f(0x2b3)]>0x0){console[_0x42375f(0x17b)]('─'[_0x42375f(0x2a0)](0x3c)),console[_0x42375f(0x17b)]('\x0a'+a22_0x2534e9[_0x42375f(0x1a9)](_0x42375f(0x2b5)));for(const _0x970b41 of _0x30610e[_0x42375f(0x15d)]){console[_0x42375f(0x17b)]('\x20\x20'+a22_0x2534e9['red']('•')+'\x20'+_0x970b41);}}}async[a22_0x2df86f(0x1e7)](_0x5ab558,_0x431e7a){const _0x5d949a=a22_0x2df86f;if(_0x431e7a[_0x5d949a(0x2b3)]===0x0){console['error']('\x0a'+_0x5ab558),console[_0x5d949a(0x17b)](_0x5d949a(0x192));return;}console[_0x5d949a(0x17b)]('\x0a'+_0x5ab558);const _0x51659d=Object[_0x5d949a(0x18b)](_0x431e7a[0x0])[_0x5d949a(0x298)](_0x1bc0bb=>({'name':_0x1bc0bb,'type':typeof _0x431e7a[0x0][_0x1bc0bb]===_0x5d949a(0x166)?'double':_0x5d949a(0x2c1)})),_0x563426={'queryId':'preview','columns':_0x51659d,'data':_0x431e7a,'stats':{'state':_0x5d949a(0x1f8),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x431e7a['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x47db8c=formatAsTable(_0x563426,_0x431e7a['length'],!![]);await writeOutput(_0x47db8c,undefined,_0x5d949a(0x2ba));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a22_0x2df86f(0x164)]='segment:parent:run';['description']=a22_0x2df86f(0x1d1);async[a22_0x2df86f(0x185)](_0x407c2d){const _0x449182=a22_0x2df86f,{options:_0x551632,args:_0x4ff289,tdx:_0x227c13}=_0x407c2d,_0x391a32=_0x551632,_0x4fdeac=_0x4ff289[0x0]||_0x551632[_0x449182(0x26d)];if(!_0x4fdeac)return showParentSegmentNotSetError(_0x449182(0x1cf)+_0x449182(0x143)),0x1;const _0x5db703=resolveYamlFile(_0x4fdeac);if(existsSync(_0x5db703)){_0x391a32[_0x449182(0x2c2)]&&console[_0x449182(0x17b)](_0x449182(0x222)+_0x5db703);let _0x202ed3;try{_0x202ed3=readFileSync(_0x5db703,_0x449182(0x2d0));}catch(_0x28b1ca){const _0x470298=_0x28b1ca instanceof Error?_0x28b1ca[_0x449182(0x1d5)]:String(_0x28b1ca);return console['error'](_0x449182(0x27e)+_0x470298),0x1;}const _0x17efd1=await withSpinner(_0x449182(0x203),()=>_0x227c13[_0x449182(0x1d2)][_0x449182(0x155)](_0x202ed3),{'verbose':_0x391a32[_0x449182(0x2c2)]}),_0x4533da=_0x17efd1[_0x449182(0x1bd)],{isNew:_0x450712,name:_0x20f8b7,hasChanges:_0x8b7d36,diffFormatted:_0x143c66}=_0x4533da;if(_0x8b7d36){_0x450712?console[_0x449182(0x17b)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x20f8b7+'\x27:'):console[_0x449182(0x17b)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x20f8b7+'\x27:');console[_0x449182(0x17b)]('─'[_0x449182(0x2a0)](0x3c)),console['error'](_0x143c66),console['error']('─'['repeat'](0x3c));const _0xecd55b=_0x450712?_0x449182(0x29e)+_0x20f8b7+_0x449182(0x28e):'Apply\x20changes\x20to\x20\x27'+_0x20f8b7+_0x449182(0x28e);if(!_0x391a32[_0x449182(0x1f3)]){if(!isInteractive())return console[_0x449182(0x17b)](a22_0x2534e9[_0x449182(0x1a9)](_0x449182(0x20e)),_0x449182(0x2be)),console[_0x449182(0x17b)](a22_0x2534e9[_0x449182(0x16f)](_0x449182(0x2a1))),0x1;const _0x1458e5=await confirmKey(_0xecd55b);if(!_0x1458e5)return console['error'](a22_0x2534e9[_0x449182(0x157)](_0x449182(0x1db))),0x1;}const _0x31e071=_0x450712?_0x449182(0x2b7):_0x449182(0x1c7);await withSpinner(_0x31e071+'\x20parent\x20segment\x20\x27'+_0x20f8b7+_0x449182(0x257),()=>_0x4533da[_0x449182(0x1ff)](),{'verbose':_0x391a32[_0x449182(0x2c2)]});const _0xd43c41=_0x450712?'Created':'Updated';console[_0x449182(0x17b)]('✔\x20'+_0xd43c41+'\x20parent\x20segment\x20\x27'+_0x20f8b7+'\x27');}else console[_0x449182(0x17b)](_0x449182(0x27a)+_0x20f8b7+_0x449182(0x239));}const _0x19f53a=await withSpinner(_0x449182(0x195)+_0x4fdeac+_0x449182(0x257),()=>_0x227c13[_0x449182(0x1d2)][_0x449182(0x152)](_0x4fdeac),{'verbose':_0x391a32[_0x449182(0x2c2)]}),_0x34619c=_0x19f53a[_0x449182(0x1bd)],_0xd80da1=getConsoleUrl(_0x391a32['site'],_0x449182(0x209)+_0x34619c[_0x449182(0x268)]+'/sessions/'+_0x34619c['workflowSessionId']+_0x449182(0x2a8)+_0x34619c[_0x449182(0x23e)]);return console['error'](_0x449182(0x22a)),console[_0x449182(0x17b)]('\x20\x20'+a22_0x2534e9[_0x449182(0x16f)](_0x449182(0x2c4))+'\x20'+_0x34619c[_0x449182(0x17f)]),console[_0x449182(0x17b)]('\x20\x20'+a22_0x2534e9[_0x449182(0x16f)](_0x449182(0x2d1))+'\x20'+_0x34619c[_0x449182(0x1a2)]),console[_0x449182(0x17b)]('\x20\x20'+a22_0x2534e9[_0x449182(0x16f)](_0x449182(0x1ed))+'\x20'+_0x34619c[_0x449182(0x234)]),console[_0x449182(0x17b)]('\x20\x20'+a22_0x2534e9['dim']('Attempt:')+'\x20'+_0x34619c[_0x449182(0x23e)]),console[_0x449182(0x17b)]('\x20\x20'+_0xd80da1),console[_0x449182(0x17b)]('\x0a'+a22_0x2534e9['dim'](_0x449182(0x278))+_0x449182(0x171)+_0x34619c['workflowAttemptId']+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x162);[a22_0x2df86f(0x27b)]=a22_0x2df86f(0x174);async[a22_0x2df86f(0x185)](_0xd0064c){const _0x26f4e2=a22_0x2df86f,{options:_0x37bc4e,args:_0x3fc05c,tdx:_0x118794}=_0xd0064c,_0x5cd643=_0x3fc05c[0x0]||_0x37bc4e[_0x26f4e2(0x26d)];if(!_0x5cd643)return showParentSegmentNotSetError(_0x26f4e2(0x2d8)+_0x26f4e2(0x293)),0x1;_0x37bc4e[_0x26f4e2(0x2c2)]&&(console[_0x26f4e2(0x17b)]('Site:\x20'+_0x37bc4e['site']),console[_0x26f4e2(0x17b)](_0x26f4e2(0x1e5)+_0x5cd643));const _0x1fcb91=await withSpinner(_0x26f4e2(0x22b)+_0x5cd643+_0x26f4e2(0x257),()=>_0x118794[_0x26f4e2(0x1d2)][_0x26f4e2(0x1dd)](_0x5cd643),{'verbose':_0x37bc4e[_0x26f4e2(0x2c2)]}),_0x30b248=_0x1fcb91['data'];console[_0x26f4e2(0x17b)](_0x26f4e2(0x1ac)+_0x30b248['length']+_0x26f4e2(0x20a)+(_0x30b248[_0x26f4e2(0x2b3)]!==0x1?'s':''));if(_0x37bc4e['json']||_0x37bc4e[_0x26f4e2(0x2c6)])return await handleSDKOutput(_0x30b248,_0x37bc4e),0x0;return displayFieldsHumanReadable(_0x30b248,_0x5cd643),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x23b);[a22_0x2df86f(0x27b)]=a22_0x2df86f(0x2cb);async['execute'](_0x5d1850){const _0x589867=a22_0x2df86f,{options:_0x201b8b,args:_0x47e528,tdx:_0x3fcab4}=_0x5d1850,_0x3d016b=_0x201b8b,_0x15d818=_0x47e528[0x0]||_0x201b8b[_0x589867(0x26d)];if(!_0x15d818)return showParentSegmentNotSetError(_0x589867(0x2c7)+_0x589867(0x253)+_0x589867(0x2a7)+_0x589867(0x20b)),0x1;_0x201b8b['verbose']&&(console['error'](_0x589867(0x25e)+_0x201b8b[_0x589867(0x186)]),console[_0x589867(0x17b)]('Parent\x20segment:\x20'+_0x15d818));const _0x34055d=await withSpinner(_0x589867(0x24c)+_0x15d818+_0x589867(0x257),()=>_0x3fcab4[_0x589867(0x1d2)][_0x589867(0x15f)](_0x15d818),{'verbose':_0x201b8b[_0x589867(0x2c2)]}),_0x52d2f0=_0x34055d[_0x589867(0x1bd)];if(_0x3d016b[_0x589867(0x2dc)]){const _0x391fe5=getConsoleNextUrl(_0x3d016b[_0x589867(0x186)],'/app/dw/parentSegments/'+_0x52d2f0['id']);return console['error'](a22_0x2534e9[_0x589867(0x216)]('✔')+_0x589867(0x296)+a22_0x2534e9['cyan'](_0x391fe5)),openBrowser(_0x391fe5),0x0;}return await handleSingleObjectOutput(_0x52d2f0,_0x201b8b),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x232);[a22_0x2df86f(0x27b)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a22_0x2df86f(0x185)](_0x594c22){const _0x511b66=a22_0x2df86f,{options:_0x57c467,args:_0x1b5db8,tdx:_0x472439}=_0x594c22,_0x4a461b=_0x57c467,_0x1824d3=_0x1b5db8[0x0]||_0x57c467[_0x511b66(0x26d)];if(!_0x1824d3)return showParentSegmentNotSetError(_0x511b66(0x24f)+_0x511b66(0x1fc)+_0x511b66(0x2a7)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x57c467['verbose']&&(console[_0x511b66(0x17b)](_0x511b66(0x25e)+_0x57c467['site']),console[_0x511b66(0x17b)](_0x511b66(0x1e5)+_0x1824d3));const _0x579a58=await withSpinner(_0x511b66(0x183)+_0x1824d3+'\x27...',()=>_0x472439[_0x511b66(0x1d2)][_0x511b66(0x1cc)](_0x1824d3),{'verbose':_0x57c467['verbose']}),_0x190506=_0x579a58['data'],_0xb790f4=_0x472439[_0x511b66(0x1d2)][_0x511b66(0x288)](_0x190506);if(_0x4a461b[_0x511b66(0x259)]){const _0x203798=await this['collectSchema'](_0x594c22,_0x1824d3,_0x190506,_0xb790f4),_0x2ea407=this['formatSchemaJson'](_0x203798);writeFileSync(_0x4a461b['output'],_0x2ea407);const _0x5620c0=_0x203798['customers'][_0x511b66(0x26c)][_0x511b66(0x2b3)]+_0x203798['behaviors'][_0x511b66(0x2b0)]((_0x1a7663,_0x94ef60)=>_0x1a7663+_0x94ef60[_0x511b66(0x26c)][_0x511b66(0x2b3)],0x0),_0x218690=_0x203798[_0x511b66(0x21a)][_0x511b66(0x17d)](_0x36b29e=>_0x36b29e[_0x511b66(0x26c)][_0x511b66(0x2b3)]===0x0)[_0x511b66(0x2b3)];return console[_0x511b66(0x25a)](_0x511b66(0x25b)+_0x4a461b[_0x511b66(0x259)]),console[_0x511b66(0x25a)](_0x511b66(0x21b)+_0xb790f4),console[_0x511b66(0x25a)](_0x511b66(0x207)+_0x203798[_0x511b66(0x21a)][_0x511b66(0x2b3)]+_0x511b66(0x208)),console['log']('\x20\x20Columns:\x20'+_0x5620c0+_0x511b66(0x1c5)),_0x218690>0x0&&console[_0x511b66(0x25a)](_0x511b66(0x14a)+_0x218690+_0x511b66(0x1c1)),0x0;}console['error']('\x0a'+a22_0x2534e9[_0x511b66(0x1d4)](_0x511b66(0x248))+'\x20'+a22_0x2534e9[_0x511b66(0x274)](_0xb790f4));const _0x36c3b0=await withSpinner(_0x511b66(0x235),()=>_0x472439[_0x511b66(0x1d2)][_0x511b66(0x210)](_0x190506),{'verbose':_0x57c467[_0x511b66(0x2c2)]});console[_0x511b66(0x17b)]('\x0a'+a22_0x2534e9[_0x511b66(0x1d4)](_0x511b66(0x1ad))+'\x20'+a22_0x2534e9['dim']('('+_0xb790f4+_0x511b66(0x1b5)));const _0x3f8f55=await executeSchemaQuery(_0x36c3b0[_0x511b66(0x1bd)],_0x472439,_0x57c467);await handleQueryOutput(_0x3f8f55,_0x57c467);const _0x3e3981=await withSpinner(_0x511b66(0x1bf),()=>_0x472439['segment'][_0x511b66(0x201)](_0x190506),{'verbose':_0x57c467[_0x511b66(0x2c2)]});for(const _0x3ce738 of _0x3e3981[_0x511b66(0x1bd)]){const _0x4b47b9=_0x511b66(0x2af)+_0x3ce738[_0x511b66(0x196)]()[_0x511b66(0x197)](/\s+/g,'_'),_0x5155ec='SELECT\x20*\x20FROM\x20'+_0xb790f4+'.'+_0x4b47b9;console[_0x511b66(0x17b)]('\x0a'+a22_0x2534e9[_0x511b66(0x1d4)](_0x3ce738)+'\x20'+a22_0x2534e9[_0x511b66(0x16f)]('('+_0xb790f4+'.'+_0x4b47b9+')'));try{const _0x40233b=await executeSchemaQuery(_0x5155ec,_0x472439,_0x57c467);await handleQueryOutput(_0x40233b,_0x57c467);}catch{console[_0x511b66(0x17b)](a22_0x2534e9[_0x511b66(0x157)](_0x511b66(0x1a5)));}}return 0x0;}async[a22_0x2df86f(0x16c)](_0xb69558,_0x142536,_0x2a0940,_0x220bdf){const _0x1ce5f0=a22_0x2df86f,{options:_0x9ce4ce,tdx:_0x2b2070}=_0xb69558,_0x5832f1=await withSpinner(_0x1ce5f0(0x235),()=>_0x2b2070[_0x1ce5f0(0x1d2)]['getParentSQL'](_0x2a0940),{'verbose':_0x9ce4ce[_0x1ce5f0(0x2c2)]}),_0x473f1b=await executeSchemaQuery(_0x5832f1[_0x1ce5f0(0x1bd)],_0x2b2070,_0x9ce4ce),_0x494478=_0x473f1b[_0x1ce5f0(0x1bd)][_0x1ce5f0(0x298)](_0x5358b9=>({'name':_0x5358b9['column_name'],'type':_0x5358b9[_0x1ce5f0(0x17a)]})),_0x4fe167=await withSpinner(_0x1ce5f0(0x1bf),()=>_0x2b2070['segment'][_0x1ce5f0(0x201)](_0x2a0940),{'verbose':_0x9ce4ce[_0x1ce5f0(0x2c2)]}),_0x2fb4f3=[];for(const _0x44f595 of _0x4fe167[_0x1ce5f0(0x1bd)]){const _0x194d4c=_0x1ce5f0(0x2af)+_0x44f595[_0x1ce5f0(0x196)]()[_0x1ce5f0(0x197)](/\s+/g,'_'),_0x1ef79d='SELECT\x20*\x20FROM\x20'+_0x220bdf+'.'+_0x194d4c;let _0x255530=[];try{const _0x3b51ff=await executeSchemaQuery(_0x1ef79d,_0x2b2070,_0x9ce4ce);_0x255530=_0x3b51ff['data'][_0x1ce5f0(0x298)](_0x92af29=>({'name':_0x92af29[_0x1ce5f0(0x1f5)],'type':_0x92af29[_0x1ce5f0(0x17a)]}));}catch{}_0x2fb4f3[_0x1ce5f0(0x20c)]({'table':_0x194d4c,'columns':_0x255530});}return{'database':_0x220bdf,'parent_segment':_0x142536,'parent_id':_0x2a0940,'customers':{'table':_0x1ce5f0(0x1ad),'columns':_0x494478},'behaviors':_0x2fb4f3};}['formatSchemaJson'](_0x2e31d7){const _0xa5b12=a22_0x2df86f,_0x5c4ab6=_0xe97154=>{const _0x17a38=a22_0x2d13;if(_0xe97154[_0x17a38(0x2b3)]===0x0)return'[]';const _0x12e251=_0xe97154[_0x17a38(0x298)](_0x57d356=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x57d356[_0x17a38(0x164)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x57d356[_0x17a38(0x189)]+_0x17a38(0x145));return'[\x0a'+_0x12e251['join'](',\x0a')+_0x17a38(0x22c);},_0x5e2689=_0x2e31d7['behaviors']['map'](_0x5de792=>{const _0x4e6669=a22_0x2d13;return _0x4e6669(0x2b2)+_0x5de792[_0x4e6669(0x2ba)]+_0x4e6669(0x191)+_0x5c4ab6(_0x5de792[_0x4e6669(0x26c)])[_0x4e6669(0x197)](/^/gm,'\x20\x20')['trim']()+_0x4e6669(0x1fa);})[_0xa5b12(0x1b9)](',\x0a');return _0xa5b12(0x1c4)+_0x2e31d7['database']+_0xa5b12(0x1cb)+_0x2e31d7[_0xa5b12(0x29b)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x2e31d7[_0xa5b12(0x20d)]+_0xa5b12(0x1f7)+_0x2e31d7[_0xa5b12(0x1ad)][_0xa5b12(0x2ba)]+_0xa5b12(0x175)+_0x5c4ab6(_0x2e31d7[_0xa5b12(0x1ad)][_0xa5b12(0x26c)])[_0xa5b12(0x197)](/^/gm,'\x20\x20')[_0xa5b12(0x147)]()+_0xa5b12(0x277)+_0x5e2689+_0xa5b12(0x2bf);}}export class ParentSegmentSQLCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x273);[a22_0x2df86f(0x27b)]=a22_0x2df86f(0x2cd);async[a22_0x2df86f(0x185)](_0x3f7f81){const _0x54fe9d=a22_0x2df86f,{options:_0x4dc4fa,args:_0x78ba0c,tdx:_0x3a4156}=_0x3f7f81,_0x46e351=_0x78ba0c[0x0]||_0x4dc4fa[_0x54fe9d(0x26d)];if(!_0x46e351)return showParentSegmentNotSetError(_0x54fe9d(0x28b)+_0x54fe9d(0x144)),0x1;_0x4dc4fa[_0x54fe9d(0x2c2)]&&(console['error'](_0x54fe9d(0x25e)+_0x4dc4fa[_0x54fe9d(0x186)]),console[_0x54fe9d(0x17b)]('Parent\x20segment:\x20'+_0x46e351));const _0x2ce580=await withSpinner(_0x54fe9d(0x183)+_0x46e351+'\x27...',()=>_0x3a4156[_0x54fe9d(0x1d2)][_0x54fe9d(0x1cc)](_0x46e351),{'verbose':_0x4dc4fa[_0x54fe9d(0x2c2)]}),_0x28ec55=_0x2ce580[_0x54fe9d(0x1bd)],_0x5dbc7f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x46e351+_0x54fe9d(0x257),()=>_0x3a4156[_0x54fe9d(0x1d2)]['getParentSQL'](_0x28ec55),{'verbose':_0x4dc4fa[_0x54fe9d(0x2c2)]}),_0x2967a0=_0x5dbc7f[_0x54fe9d(0x1bd)];return _0x4dc4fa[_0x54fe9d(0x243)]===_0x54fe9d(0x146)||_0x4dc4fa[_0x54fe9d(0x243)]===_0x54fe9d(0x2c6)?await handleSDKOutput([{'sql':_0x2967a0}],_0x4dc4fa):console[_0x54fe9d(0x25a)](_0x2967a0),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x291);[a22_0x2df86f(0x27b)]=a22_0x2df86f(0x1f9);async[a22_0x2df86f(0x185)](_0x4dede0){const _0x5cbf66=a22_0x2df86f,{options:_0x21d66a,args:_0xe9bcef,tdx:_0xb4c0f3}=_0x4dede0,_0x59a424=_0xe9bcef[0x0]||_0x21d66a['parentSegment'];if(!_0x59a424)return showParentSegmentNotSetError(_0x5cbf66(0x16b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x21d66a[_0x5cbf66(0x2c2)]&&(console[_0x5cbf66(0x17b)]('Site:\x20'+_0x21d66a['site']),console[_0x5cbf66(0x17b)](_0x5cbf66(0x1e5)+_0x59a424));const _0x44ad8c=await withSpinner(_0x5cbf66(0x183)+_0x59a424+_0x5cbf66(0x257),()=>_0xb4c0f3[_0x5cbf66(0x1d2)][_0x5cbf66(0x1cc)](_0x59a424),{'verbose':_0x21d66a['verbose']}),_0x45aded=_0x44ad8c[_0x5cbf66(0x1bd)],_0x164951=await withSpinner(_0x5cbf66(0x1f2)+_0x59a424+_0x5cbf66(0x257),()=>_0xb4c0f3['segment']['getParentSQL'](_0x45aded),{'verbose':_0x21d66a['verbose']});let _0x1c69d3=_0x164951['data'];const _0x1e5e20=resolveLimit(_0x21d66a[_0x5cbf66(0x26b)],DEFAULT_DISPLAY_LIMIT),_0x519a90=/\bLIMIT\s+\d+/i['test'](_0x1c69d3);!_0x519a90&&(_0x1c69d3=_0x1c69d3['trim']()[_0x5cbf66(0x197)](/;+$/,''),_0x1c69d3='SELECT\x20*\x20FROM\x20(\x0a'+_0x1c69d3+_0x5cbf66(0x29d)+_0x1e5e20);_0x21d66a['verbose']&&console[_0x5cbf66(0x17b)](_0x5cbf66(0x23c)+_0x1c69d3);const _0x218818=await withProgressSpinner(_0x5cbf66(0x14b),async _0x2d41ff=>{const _0x20b0f4=_0x5cbf66,_0x517897=await _0xb4c0f3[_0x20b0f4(0x1bb)][_0x20b0f4(0x185)](_0x1c69d3,{'catalog':'td','schema':_0x20b0f4(0x148),'onJobId':_0x4647b2=>{const _0x4d2742=_0x20b0f4;_0x2d41ff[_0x4d2742(0x226)](_0x4647b2);}});return _0x517897;},{'verbose':_0x21d66a[_0x5cbf66(0x2c2)]}),_0x19725d=_0x218818[_0x5cbf66(0x1bd)],_0x2961e6=_0x19725d[_0x5cbf66(0x212)]?_0x5cbf66(0x1e4)+_0x19725d['jobId']+']':'';return console[_0x5cbf66(0x17b)](_0x5cbf66(0x1ae)+_0x19725d[_0x5cbf66(0x294)][_0x5cbf66(0x198)][_0x5cbf66(0x14c)]()+_0x5cbf66(0x1a3)+(_0x5cbf66(0x1aa)+formatElapsed(_0x19725d[_0x5cbf66(0x294)][_0x5cbf66(0x176)])+_0x2961e6)),await handleQueryOutput(_0x19725d,_0x21d66a),0x0;}}export class PSRtListCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x24a);[a22_0x2df86f(0x27b)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async['execute'](_0x18a168){const _0x57c134=a22_0x2df86f,{options:_0x351aba,args:_0x4819d3,tdx:_0x5cf635}=_0x18a168,_0x50cfa1=_0x4819d3[0x0],_0x269e3a=await withSpinner(_0x50cfa1?_0x57c134(0x1ea)+_0x50cfa1+'\x27...':_0x57c134(0x228),()=>_0x5cf635['realtime'][_0x57c134(0x16d)](),{'verbose':_0x351aba['verbose']});let _0x340e08=_0x269e3a[_0x57c134(0x1bd)]['filter'](_0x566385=>_0x566385[_0x57c134(0x161)]);if(_0x50cfa1){const _0x4a52f1=_0x50cfa1[_0x57c134(0x197)](/[.+^${}()|[\]\\]/g,_0x57c134(0x2c9))['replace'](/\*/g,'.*')[_0x57c134(0x197)](/\?/g,'.'),_0x53bab8=new RegExp('^'+_0x4a52f1+'$','i');_0x340e08=_0x340e08[_0x57c134(0x17d)](_0x4df7d1=>_0x53bab8[_0x57c134(0x206)](_0x4df7d1[_0x57c134(0x164)]));}_0x340e08[_0x57c134(0x215)]((_0x786ca0,_0x574c45)=>_0x786ca0[_0x57c134(0x164)]['localeCompare'](_0x574c45['name'])),console[_0x57c134(0x17b)](_0x57c134(0x1ac)+_0x340e08[_0x57c134(0x2b3)]+'\x20RT-enabled\x20parent\x20segment'+(_0x340e08[_0x57c134(0x2b3)]!==0x1?'s':''));const _0x332ab4=_0x59de00=>{const _0x112e5c=_0x57c134;return getConsoleNextUrl(_0x351aba[_0x112e5c(0x186)],_0x112e5c(0x21d)+_0x59de00);};if(_0x351aba[_0x57c134(0x243)]===_0x57c134(0x146)||_0x351aba[_0x57c134(0x243)]==='jsonl'){const _0x46de1a=_0x340e08[_0x57c134(0x298)](_0x5d2ef8=>({..._0x5d2ef8,'url':_0x332ab4(_0x5d2ef8['id'])}));await handleSDKOutput(_0x46de1a,_0x351aba);}else{if(_0x340e08[_0x57c134(0x2b3)]===0x0)console[_0x57c134(0x25a)](_0x57c134(0x165));else for(const _0x5cd260 of _0x340e08){const _0x3d54c9=_0x5cd260[_0x57c134(0x2a2)]?a22_0x2534e9[_0x57c134(0x16f)]('\x20('+formatRows(_0x5cd260[_0x57c134(0x2a2)])+')'):'',_0x4521f9=hyperlink(_0x5cd260[_0x57c134(0x164)],_0x332ab4(_0x5cd260['id']));console[_0x57c134(0x25a)]('⚡\x20'+_0x4521f9+_0x3d54c9);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a22_0x2df86f(0x193);[a22_0x2df86f(0x27b)]=a22_0x2df86f(0x1e9);async[a22_0x2df86f(0x185)](_0x54b8de){const _0x45b69a=a22_0x2df86f,{options:_0x513132,args:_0x582b14,tdx:_0xa54217}=_0x54b8de,_0x3b0448=_0x582b14[0x0]||_0x513132[_0x45b69a(0x26d)];if(!_0x3b0448)return showParentSegmentNotSetError(_0x45b69a(0x1b7)+_0x45b69a(0x256)),0x1;const _0x57408f=resolveYamlFile(_0x3b0448);if(!existsSync(_0x57408f))return showFileNotFoundError(_0x57408f,_0x3b0448),0x1;let _0x55fc44;try{_0x55fc44=readFileSync(_0x57408f,_0x45b69a(0x2d0));}catch(_0xce8ac5){const _0x2e2a43=_0xce8ac5 instanceof Error?_0xce8ac5[_0x45b69a(0x1d5)]:String(_0xce8ac5);return console[_0x45b69a(0x17b)](_0x45b69a(0x27e)+_0x2e2a43),0x1;}const _0x2568b9=createCommandSpinner(a22_0x2534e9[_0x45b69a(0x16f)](_0x45b69a(0x1e8)),{'verbose':_0x513132['verbose']});_0x2568b9[_0x45b69a(0x179)]();const _0x2b48f7={'realtime':!![],'onProgress':_0x3421e5=>{const _0x2b1d0c=_0x45b69a;_0x2568b9[_0x2b1d0c(0x28a)]=formatProgressMessage(_0x3421e5);}};let _0x23d863;try{_0x23d863=await _0xa54217[_0x45b69a(0x1d2)][_0x45b69a(0x1e2)](_0x55fc44,_0x2b48f7),_0x2568b9[_0x45b69a(0x199)]();}catch(_0x2c8e9b){_0x2568b9[_0x45b69a(0x199)]();throw _0x2c8e9b;}console[_0x45b69a(0x17b)]('\x0a'+a22_0x2534e9[_0x45b69a(0x1d4)]('RT\x202.0\x20Validate:')+'\x20'+_0x23d863[_0x45b69a(0x164)]),console[_0x45b69a(0x17b)]('═'[_0x45b69a(0x2a0)](0x3c)),displayRealtimeValidation(_0x23d863),console[_0x45b69a(0x17b)]('─'[_0x45b69a(0x2a0)](0x3c));if(_0x23d863['errors'][_0x45b69a(0x2b3)]>0x0){console[_0x45b69a(0x17b)]('\x0a'+a22_0x2534e9[_0x45b69a(0x1a9)](_0x45b69a(0x2b5)));for(const _0x4bf872 of _0x23d863[_0x45b69a(0x15d)]){console[_0x45b69a(0x17b)]('\x20\x20'+a22_0x2534e9[_0x45b69a(0x1a9)]('•')+'\x20'+_0x4bf872);}}return _0x23d863['allValid']&&console[_0x45b69a(0x17b)]('\x0a'+a22_0x2534e9[_0x45b69a(0x216)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x23d863[_0x45b69a(0x2ae)]?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a22_0x2df86f(0x164)]=a22_0x2df86f(0x238);[a22_0x2df86f(0x27b)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a22_0x2df86f(0x185)](_0x4e8a25){const _0x79a73f=a22_0x2df86f,{options:_0x51c749,args:_0x1f99c7,tdx:_0x3ad1b4}=_0x4e8a25,_0x32f69c=_0x1f99c7[0x0]||_0x51c749['parentSegment'];if(!_0x32f69c)return showParentSegmentNotSetError(_0x79a73f(0x2aa)+_0x79a73f(0x1d3)),0x1;const _0x5bbf97=await withSpinner(_0x79a73f(0x183)+_0x32f69c+_0x79a73f(0x257),()=>_0x3ad1b4[_0x79a73f(0x1d2)][_0x79a73f(0x1cc)](_0x32f69c),{'verbose':_0x51c749[_0x79a73f(0x2c2)]}),_0x56a6ba=_0x5bbf97[_0x79a73f(0x1bd)],_0x10d2cb=await withSpinner(_0x79a73f(0x1f1)+_0x32f69c+'\x27...',()=>_0x3ad1b4[_0x79a73f(0x2de)]['list'](_0x56a6ba),{'verbose':_0x51c749[_0x79a73f(0x2c2)]}),_0x45ceb7=_0x10d2cb[_0x79a73f(0x1bd)];console[_0x79a73f(0x17b)]('✔\x20Found\x20'+_0x45ceb7[_0x79a73f(0x2b3)]+_0x79a73f(0x19c)+(_0x45ceb7[_0x79a73f(0x2b3)]!==0x1?'s':''));if(_0x51c749['format']==='json'||_0x51c749[_0x79a73f(0x243)]===_0x79a73f(0x2c6))await handleSDKOutput(_0x45ceb7,_0x51c749);else{if(_0x45ceb7[_0x79a73f(0x2b3)]===0x0)console[_0x79a73f(0x25a)](_0x79a73f(0x284)),console[_0x79a73f(0x17b)](a22_0x2534e9[_0x79a73f(0x274)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x4c4fe6 of _0x45ceb7){const _0x357e88=_0x4c4fe6[_0x79a73f(0x18d)]?.[_0x79a73f(0x2b3)]||0x0,_0x825a13=_0x4c4fe6['trigger_event']?a22_0x2534e9[_0x79a73f(0x16f)](_0x79a73f(0x225)+_0x4c4fe6['trigger_event']):'',_0x1aba6e=a22_0x2534e9[_0x79a73f(0x16f)]('\x20('+_0x357e88+_0x79a73f(0x182)+(_0x357e88!==0x1?'s':'')+')');console[_0x79a73f(0x25a)]('\x20\x20'+_0x4c4fe6['name']+_0x825a13+_0x1aba6e),_0x4c4fe6['description']&&console['log'](_0x79a73f(0x168)+a22_0x2534e9[_0x79a73f(0x16f)](_0x4c4fe6[_0x79a73f(0x27b)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a22_0x2df86f(0x164)]='ps:pz:init';[a22_0x2df86f(0x27b)]=a22_0x2df86f(0x231);async[a22_0x2df86f(0x185)](_0x4490cd){const _0x49f7b1=a22_0x2df86f,{options:_0xd1ed5c,args:_0x1f2e5a}=_0x4490cd,_0x2d7e99=_0x1f2e5a[0x0]||_0xd1ed5c[_0x49f7b1(0x26d)];if(!_0x2d7e99)return showParentSegmentNotSetError(_0x49f7b1(0x229)+_0x49f7b1(0x159)),0x1;const _0xcd60e5=resolveYamlFile(_0x2d7e99);if(!existsSync(_0xcd60e5))return showFileNotFoundError(_0xcd60e5,_0x2d7e99),0x1;let _0x4ef012;try{_0x4ef012=readFileSync(_0xcd60e5,'utf-8');}catch(_0x2cd053){const _0x43ca8e=_0x2cd053 instanceof Error?_0x2cd053[_0x49f7b1(0x1d5)]:String(_0x2cd053);return console['error']('Error\x20reading\x20file:\x20'+_0x43ca8e),0x1;}let _0x50655c;try{_0x50655c=parseDef(_0x4ef012);}catch(_0x419165){const _0x337151=_0x419165 instanceof Error?_0x419165[_0x49f7b1(0x1d5)]:String(_0x419165);return console[_0x49f7b1(0x17b)](a22_0x2534e9[_0x49f7b1(0x1a9)](_0x49f7b1(0x241)+_0x337151)),0x1;}if(_0x50655c[_0x49f7b1(0x21f)]&&_0x50655c[_0x49f7b1(0x21f)]['length']>0x0)return console[_0x49f7b1(0x17b)](a22_0x2534e9[_0x49f7b1(0x157)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0xcd60e5)),console[_0x49f7b1(0x17b)](a22_0x2534e9['dim'](_0x49f7b1(0x27f)+_0x50655c[_0x49f7b1(0x21f)][_0x49f7b1(0x2b3)]+_0x49f7b1(0x1a7))),0x1;!_0x50655c['realtime']&&(_0x50655c[_0x49f7b1(0x19d)]={'events':[{'name':_0x49f7b1(0x1df),'source_table':_0x49f7b1(0x254)}],'attributes':[{'name':_0x49f7b1(0x172),'type':_0x49f7b1(0x252)}],'id_stitching':{'primary_key':_0x50655c['master'][_0x49f7b1(0x2ba)]===_0x49f7b1(0x1ad)?'td_client_id':_0x49f7b1(0x267)}});_0x50655c[_0x49f7b1(0x21f)]=[{'name':_0x49f7b1(0x26a),'description':_0x49f7b1(0x15e),'trigger_event':_0x49f7b1(0x1df),'sections':[{'name':_0x49f7b1(0x2bd),'criteria':_0x49f7b1(0x140),'attributes':[_0x49f7b1(0x172)]}]}];const _0x2422f9=serializeDef(_0x50655c);return writeFileSync(_0xcd60e5,_0x2422f9,'utf-8'),console[_0x49f7b1(0x17b)](a22_0x2534e9['green']('✔')+_0x49f7b1(0x2bb)+a22_0x2534e9['cyan'](_0xcd60e5)),(!_0x50655c[_0x49f7b1(0x19d)]||_0x4ef012[_0x49f7b1(0x1fe)](_0x49f7b1(0x2db))===-0x1)&&console['error'](a22_0x2534e9[_0x49f7b1(0x216)]('✔')+_0x49f7b1(0x25d)),console[_0x49f7b1(0x17b)]('\x0a'+a22_0x2534e9['dim'](_0x49f7b1(0x18a))),console[_0x49f7b1(0x17b)](_0x49f7b1(0x2ca)+_0xcd60e5+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x49f7b1(0x17b)]('\x20\x202.\x20Run\x20'+a22_0x2534e9[_0x49f7b1(0x16f)](_0x49f7b1(0x2d4)+_0x2d7e99)+_0x49f7b1(0x23f)),0x0;}}
|
|
1
|
+
const a26_0x3ac8d7=a26_0x3d76;(function(_0x29bb9d,_0x2ea74c){const _0x3578e0=a26_0x3d76,_0xabf569=_0x29bb9d();while(!![]){try{const _0x36d524=-parseInt(_0x3578e0(0x192))/0x1*(parseInt(_0x3578e0(0xd1))/0x2)+parseInt(_0x3578e0(0x113))/0x3+parseInt(_0x3578e0(0x7e))/0x4+-parseInt(_0x3578e0(0xf2))/0x5+parseInt(_0x3578e0(0x16f))/0x6*(parseInt(_0x3578e0(0xec))/0x7)+parseInt(_0x3578e0(0x118))/0x8*(parseInt(_0x3578e0(0x14f))/0x9)+-parseInt(_0x3578e0(0x110))/0xa;if(_0x36d524===_0x2ea74c)break;else _0xabf569['push'](_0xabf569['shift']());}catch(_0x54d0a2){_0xabf569['push'](_0xabf569['shift']());}}}(a26_0x5c9f,0xb1ddd));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a26_0x4f44f4 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,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a26_0x3d76(_0x69112b,_0x53f8aa){_0x69112b=_0x69112b-0x68;const _0x5c9f8c=a26_0x5c9f();let _0x3d76b8=_0x5c9f8c[_0x69112b];return _0x3d76b8;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a26_0x1d7dc3 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=a26_0x3ac8d7(0x1df),LEGACY_PARENT_SEGMENT_DIR=a26_0x3ac8d7(0xfc);function openBrowser(_0x57a2e8){const _0x3a24f7=a26_0x3ac8d7,_0x3339a5=process['platform'],_0xba9704=_0x3339a5===_0x3a24f7(0x77)?_0x3a24f7(0x105):_0x3339a5===_0x3a24f7(0x1ac)?_0x3a24f7(0x191):_0x3a24f7(0x1f3);spawn(_0xba9704,[_0x57a2e8],{'detached':!![],'stdio':_0x3a24f7(0x153)})[_0x3a24f7(0x186)]();}function migrateLegacyDirectory(){const _0x40901b=a26_0x3ac8d7;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x580d34=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x580d34[_0x40901b(0x1f8)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x40901b(0x128)](a26_0x1d7dc3['yellow'](_0x40901b(0x199)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x40901b(0x1ec))),console[_0x40901b(0x128)](a26_0x1d7dc3[_0x40901b(0x144)](_0x40901b(0xdf)+LEGACY_PARENT_SEGMENT_DIR+_0x40901b(0xb7))),![];console[_0x40901b(0x128)](a26_0x1d7dc3[_0x40901b(0x1bb)](_0x40901b(0x1b8)+LEGACY_PARENT_SEGMENT_DIR+_0x40901b(0x13f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x40901b(0x128)](a26_0x1d7dc3[_0x40901b(0x11a)](_0x40901b(0x70)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x5a6209){const _0x4f59bb=_0x5a6209 instanceof Error?_0x5a6209['message']:String(_0x5a6209);return console[_0x40901b(0x128)](a26_0x1d7dc3['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x4f59bb+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x35f1ae){const _0x1faab4=a26_0x3ac8d7;return migrateLegacyDirectory(),super[_0x1faab4(0x121)](_0x35f1ae);}}function resolveYamlFile(_0x1f907b){const _0x37dee6=a26_0x3ac8d7;if(_0x1f907b[_0x37dee6(0x10a)]('.yml')||_0x1f907b[_0x37dee6(0x10a)](_0x37dee6(0x115)))return _0x1f907b;return a26_0x4f44f4[_0x37dee6(0x17a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1f907b)+'.yml');}function formatProgressMessage(_0xb6281){const _0x49adcd=a26_0x3ac8d7,_0x3a98ed=_0xb6281[_0x49adcd(0x8b)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3a98ed){const [,_0x39b0e3,_0x27bca6,_0x41238e='']=_0x3a98ed;return a26_0x1d7dc3[_0x49adcd(0x144)](_0x39b0e3+':')+'\x20'+_0x27bca6+a26_0x1d7dc3['dim'](_0x41238e);}return a26_0x1d7dc3[_0x49adcd(0x144)](_0xb6281);}function showFileNotFoundError(_0x238afd,_0x5703ca){const _0x2e2fe4=a26_0x3ac8d7;console[_0x2e2fe4(0x128)](a26_0x1d7dc3[_0x2e2fe4(0x174)](_0x2e2fe4(0x18d)+_0x238afd+'\x0a')),console[_0x2e2fe4(0x128)](a26_0x1d7dc3[_0x2e2fe4(0x16b)](_0x2e2fe4(0x162)+_0x5703ca+_0x2e2fe4(0xb6)));}function displayRealtimeValidation(_0x3f47f4){const _0x8721e9=a26_0x3ac8d7;if(!_0x3f47f4[_0x8721e9(0x182)])return;const _0x25f9b0=_0x3f47f4[_0x8721e9(0x182)],_0x4eb1f2=_0x25f9b0[_0x8721e9(0xc3)]?a26_0x1d7dc3[_0x8721e9(0x11a)](_0x8721e9(0x8e)):a26_0x1d7dc3['yellow'](_0x8721e9(0x12d));console['error']('\x0a'+a26_0x1d7dc3[_0x8721e9(0x144)](_0x8721e9(0xa9))+'\x20'+_0x4eb1f2);if(_0x25f9b0[_0x8721e9(0x1e7)]&&_0x25f9b0['events'][_0x8721e9(0x1a2)]>0x0){console[_0x8721e9(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x8721e9(0x144)]('Events:')+'\x20'+_0x25f9b0[_0x8721e9(0x1e7)][_0x8721e9(0x1a2)]+'\x20configured');for(const _0x1107c5 of _0x25f9b0[_0x8721e9(0x1e7)]){const _0x321ed2=_0x1107c5[_0x8721e9(0xf7)]===![]?a26_0x1d7dc3[_0x8721e9(0x174)]('✘'):a26_0x1d7dc3[_0x8721e9(0x11a)]('✔');console['error']('\x20\x20\x20\x20'+_0x321ed2+'\x20'+_0x1107c5[_0x8721e9(0xe4)]),_0x1107c5[_0x8721e9(0x17e)]&&console[_0x8721e9(0x128)](_0x8721e9(0x1f5)+a26_0x1d7dc3[_0x8721e9(0x174)](_0x1107c5[_0x8721e9(0x17e)]));}}if(_0x25f9b0[_0x8721e9(0x1ea)]&&_0x25f9b0[_0x8721e9(0x1ea)][_0x8721e9(0x1a2)]>0x0){console['error']('\x20\x20'+a26_0x1d7dc3[_0x8721e9(0x144)](_0x8721e9(0x180))+'\x20'+_0x25f9b0[_0x8721e9(0x1ea)][_0x8721e9(0x1a2)]+'\x20configured');for(const _0x44329c of _0x25f9b0[_0x8721e9(0x1ea)]){const _0x8e63f8=_0x44329c[_0x8721e9(0x17c)]?a26_0x1d7dc3[_0x8721e9(0x11a)]('✔'):a26_0x1d7dc3['red']('✘');console[_0x8721e9(0x128)]('\x20\x20\x20\x20'+_0x8e63f8+'\x20'+_0x44329c[_0x8721e9(0xe4)]+'\x20'+a26_0x1d7dc3['dim']('('+_0x44329c[_0x8721e9(0x13d)]+')'));}}if(_0x25f9b0[_0x8721e9(0x7f)]){const _0x4e932d=_0x25f9b0[_0x8721e9(0x7f)][_0x8721e9(0xce)]?.['length']?_0x8721e9(0x15b)+_0x25f9b0['idStitching'][_0x8721e9(0xce)][_0x8721e9(0x17a)](',\x20')+']':'';console[_0x8721e9(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x8721e9(0x144)](_0x8721e9(0x1bf))+'\x20'+_0x25f9b0[_0x8721e9(0x7f)][_0x8721e9(0xe8)]+_0x4e932d);}if(_0x25f9b0['personalizationServices']&&_0x25f9b0[_0x8721e9(0xfa)][_0x8721e9(0x1a2)]>0x0){console[_0x8721e9(0x128)]('\x20\x20'+a26_0x1d7dc3['dim'](_0x8721e9(0x98))+'\x20'+_0x25f9b0[_0x8721e9(0xfa)][_0x8721e9(0x1a2)]+_0x8721e9(0x163)+(_0x25f9b0['personalizationServices'][_0x8721e9(0x1a2)]!==0x1?'s':''));for(const _0x268d25 of _0x25f9b0[_0x8721e9(0xfa)]){console[_0x8721e9(0x128)](_0x8721e9(0x15a)+_0x268d25['name']);}}}function showParentSegmentNotSetError(_0x252657){const _0x5a9186=a26_0x3ac8d7;console['error'](a26_0x1d7dc3['yellow'](_0x5a9186(0x104))),console[_0x5a9186(0x128)](_0x252657);}export class ParentSegmentListCommand extends BaseCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0x1e8);[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0x1e1);async[a26_0x3ac8d7(0x176)](_0x5a5020){const _0x56ca95=a26_0x3ac8d7,{options:_0x498126,args:_0x240634,tdx:_0x3c9129}=_0x5a5020,_0x3f952e=_0x240634[0x0];_0x498126[_0x56ca95(0x120)]&&(console[_0x56ca95(0x128)](_0x56ca95(0xcc)+_0x498126['site']),_0x3f952e&&console[_0x56ca95(0x128)](_0x56ca95(0xa1)+_0x3f952e));const _0x87e202=await withSpinner(_0x3f952e?_0x56ca95(0x12a)+_0x3f952e+_0x56ca95(0x190):'Listing\x20parent\x20segments...',()=>_0x3c9129['segment']['listParents'](),{'verbose':_0x498126['verbose']});let _0x36acfa=_0x87e202['data'];if(_0x3f952e){const _0x4e9086=_0x3f952e[_0x56ca95(0xd9)](/[.+^${}()|[\]\\]/g,_0x56ca95(0x1c8))[_0x56ca95(0xd9)](/\*/g,'.*')[_0x56ca95(0xd9)](/\?/g,'.'),_0x359976=new RegExp('^'+_0x4e9086+'$','i');_0x36acfa=_0x36acfa[_0x56ca95(0x1ef)](_0x16cf76=>_0x359976[_0x56ca95(0x91)](_0x16cf76[_0x56ca95(0x1ea)]['name']));}_0x36acfa[_0x56ca95(0x18e)]((_0x1a7cb4,_0x4cf994)=>_0x1a7cb4['attributes'][_0x56ca95(0xe4)][_0x56ca95(0x17b)](_0x4cf994[_0x56ca95(0x1ea)][_0x56ca95(0xe4)])),console[_0x56ca95(0x128)]('✔\x20Found\x20'+_0x36acfa['length']+'\x20parent\x20segment'+(_0x36acfa[_0x56ca95(0x1a2)]!==0x1?'s':''));const _0xa5728=_0x6142b2=>{const _0xab55eb=_0x56ca95;return getConsoleNextUrl(_0x498126['site'],_0xab55eb(0xda)+_0x6142b2);};if(_0x498126[_0x56ca95(0xbf)]===_0x56ca95(0xdc)||_0x498126[_0x56ca95(0xbf)]==='jsonl'){const _0x3de957=_0x36acfa[_0x56ca95(0x1ab)](_0x5424c9=>({..._0x5424c9,'url':_0xa5728(_0x5424c9['id'])}));await handleSDKOutput(_0x3de957,_0x498126);}else{if(_0x36acfa['length']===0x0)_0x3f952e?console[_0x56ca95(0x132)](_0x56ca95(0x1c4)+_0x3f952e):console[_0x56ca95(0x132)]('No\x20parent\x20segments\x20found');else for(const _0x3e050d of _0x36acfa){const _0x43c243=_0x3e050d[_0x56ca95(0x1ea)][_0x56ca95(0x1c9)]?a26_0x1d7dc3[_0x56ca95(0x144)]('\x20('+formatRows(_0x3e050d[_0x56ca95(0x1ea)]['population'])+')'):'',_0x3e4784=hyperlink(_0x3e050d['attributes'][_0x56ca95(0xe4)],_0xa5728(_0x3e050d['id']));console[_0x56ca95(0x132)](_0x56ca95(0x1db)+_0x3e4784+_0x43c243);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']='segment:parent:create';['description']=a26_0x3ac8d7(0x80);async['execute'](_0x327fd8){const _0x436c0e=a26_0x3ac8d7,{options:_0x78f07d,args:_0x574194,tdx:_0x23f8d6}=_0x327fd8;console[_0x436c0e(0x128)](_0x436c0e(0x161)+'\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 _0x11c37c=_0x78f07d;if(_0x574194[_0x436c0e(0x1a2)]===0x0)return console[_0x436c0e(0x128)](a26_0x1d7dc3['red'](_0x436c0e(0x149))),console[_0x436c0e(0x128)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x578e95=_0x574194[0x0];if(!_0x11c37c[_0x436c0e(0x1a3)]||!_0x11c37c[_0x436c0e(0x1a6)])return console[_0x436c0e(0x128)](_0x436c0e(0x1bc)),console[_0x436c0e(0x128)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x11c37c[_0x436c0e(0x120)]&&(console['error']('Site:\x20'+_0x11c37c['site']),console['error']('Name:\x20'+_0x578e95),console[_0x436c0e(0x128)](_0x436c0e(0x1ad)+_0x11c37c['database']),console['error'](_0x436c0e(0x84)+_0x11c37c[_0x436c0e(0x1a6)]));const _0x7efb54=await loadJSONFromOptions(_0x11c37c[_0x436c0e(0x1ea)],_0x11c37c[_0x436c0e(0xac)]),_0x554575=await loadJSONFromOptions(_0x11c37c[_0x436c0e(0x156)],_0x11c37c['behaviorsFile']),_0x338084=await loadJSONFromOptions(_0x11c37c['customerGroup'],_0x11c37c[_0x436c0e(0x125)]),_0x275e65={'name':_0x578e95,'description':_0x11c37c[_0x436c0e(0x1a8)],'scheduleType':_0x11c37c[_0x436c0e(0x1a1)],'scheduleOption':_0x11c37c['scheduleOption'],'timezone':_0x11c37c[_0x436c0e(0x146)],'master':{'parentDatabaseName':_0x11c37c['database'],'parentTableName':_0x11c37c[_0x436c0e(0x1a6)]},'attributes':_0x7efb54,'behaviors':_0x554575,'customerGroup':_0x338084},_0x433403=await withSpinner(_0x436c0e(0x148)+_0x578e95+'\x27...',()=>_0x23f8d6[_0x436c0e(0x117)][_0x436c0e(0x135)](_0x275e65),{'verbose':_0x78f07d[_0x436c0e(0x120)]}),_0x59ea95=_0x433403[_0x436c0e(0x1ca)];return console[_0x436c0e(0x128)](_0x436c0e(0x94)+_0x59ea95[_0x436c0e(0xe4)]+_0x436c0e(0x15c)+_0x59ea95['id']),await handleSDKOutput([_0x59ea95],_0x78f07d),0x0;}}function a26_0x5c9f(){const _0xba30ab=['number','parent_segments','parent_id','List\x20parent\x20segments','Listing\x20personalization\x20services\x20for\x20\x27','behavior_','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Fetching\x20behavior\x20list...','\x20No\x20changes\x20-\x20','events','segment:parent:list','\x20\x20Note:\x20','attributes','td_client_id','/\x20directories\x20exist.','web','displayMasterInfo','filter','single','reduce','customers','xdg-open','runParent','\x20\x20\x20\x20\x20\x20','totalEvents','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','isDirectory','Updating','customersWithEvents','\x0aNo\x20sample\x20data\x20available','information_schema','{\x0a\x20\x20\x22database\x22:\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment:parent:validate','schemaValid','addBehaviorsFile','✔\x20Renamed\x20directory\x20to\x20','Output\x20Database:','Updated','realtime:','site','Errors:','pushParentYaml','darwin','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','processedRows','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','varchar','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','5171948pstpyt','idStitching','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','master','✔\x20Query\x20completed:\x20Processed\x20','repeat','Table:\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','segment:parent:preview','stats','\x20parent\x20segment\x20\x27','match','\x20personalization\x20service','coveragePercent','⚡\x20Enabled','\x0aNew\x20parent\x20segment\x20\x27','stop','test','formatSchemaJson','segment:parent:push','✔\x20Created\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','/sessions/','Options:\x0a','Personalization:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20--behavior\x20\x22','jobId','toLowerCase','\x20field','query','Behavior:','getOutputDatabaseName','Pattern:\x20','true','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20to\x20configure\x20your\x20personalization\x20service','joinKey','\x20\x202.\x20Run\x20','\x20--attribute\x20\x22<name>\x22','text','RT\x202.0:','getParentSQL','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','attributesFile','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x27\x20and\x20run\x20workflow?','all','\x20[Job\x20ID:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','\x0a✔\x20Workflow\x20started','\x0a\x20\x20\x20\x20]','attribute','`\x20to\x20download\x20the\x20configuration\x20first','/\x20directory.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Fetching\x20customers\x20schema...','personalization_services','pullParentYaml','segment:parent:fields','addAttributesFile','format','sections','<database>.<table>','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','enabled','errors','\x22,\x20\x22type\x22:\x20\x22','columns','Options:','\x20Context\x20set:\x20','interval','Error\x20parsing\x20YAML:\x20','customerPercent','Site:\x20','Join:','stitchingKeys','listFields','\x0aError:','1301102pcRloF','bold','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20is\x20already\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','setJobId','replace','/app/dw/parentSegments/','displaySummary','json','workflowAttemptId','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','ps:rt:list','label','message','yes','name','\x20kill','using\x20the\x20default\x20path:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','primaryKey','Session:','\x20\x201.\x20Edit\x20','Show\x20parent\x20segment\x20details','2723LEjvDo','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Found\x20YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','Attribute:','3432900zXlTyG','column_name','segment:parent:run','.customers)','string','sourceTableValid','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','personalizationServices','SELECT\x20*\x20FROM\x20','parent_segment','session','toLocaleString','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','resolveParentId','rowCount','in\x20','utf-8','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','open','\x20\x20Columns:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Preview:','workflowId','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','Created','Available\x20attributes:','\x20--attribute\x20\x22','24132770lhsEXy','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Master:','2758284SoTuiU','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','.yaml','workflowSessionId','segment','40GLdREf','last_page_viewed','green','getBehaviorNames','Events:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Enriched:','apply','verbose','run','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','✔\x20Found\x20','customerGroupFile','\x20tdx\x20wf\x20attempt\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','error','Fetching\x20sample\x20data...','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20','Next\x20steps:','⚡\x20Not\x20enabled','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','validateParentYaml','Error\x20reading\x20file:\x20','audienceId','log','\x20--behavior\x20\x22<name>\x22','allValid','createParent','Fetching\x20current\x20configuration\x20for\x20\x27','Aborted.','My\x20Service','tdx\x20ps\x20preview\x20','\x20rows\x20','enriched','push','type','Master\x20+\x20Attributes','/\x20→\x20','\x20rows)','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','foreignKey','\x20to\x20push\x20the\x20configuration','dim','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','timezone','List\x20available\x20fields\x20for\x20segmentation','Creating\x20parent\x20segment\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20\x27','output','status','realtime_enabled','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','1502325jKcuEw','dirname','trigger_event','Overwrite\x20\x27','ignore','Resolving\x20parent\x20segment\x20\x27','%)\x20','behaviors','displayBehaviorsStats','trim','parentSegment','\x20\x20\x20\x20-\x20','\x20+\x20[','\x27\x20with\x20ID:\x20','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x0aChanges\x20to\x20apply\x20to\x20\x27','Personalization\x20service\x20description','Updating\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20service','Source:','Fetching\x20parent\x20segment\x20\x27','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','tdx\x20ps\x20push\x20','updateParent','SELECT\x20*\x20FROM\x20(\x0a','/attempt/','cyan','displayPreviewResults','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','22086hVlbfy','Attempt:','getParentFull','jsonl','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','red','displaySampleData','execute','column','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20--enriched','join','localeCompare','valid','/app/workflows/','sourceTableError','No\x20personalization\x20services\x20configured','Attributes:','use','realtime','Columns:','displayAttributesStats','\x0a\x20\x20\x20\x20}','unref','\x20Added\x20personalization\x20template\x20to\x20','\x20\x20\x20\x20','\x20--interval\x20','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Error:\x20File\x20not\x20found:\x20','sort','SQL\x20query:\x0a','\x27...','start','1HuIKdO','sampleData','matchedCount','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Analyzing\x20changes...','Create\x20parent\x20segment\x20\x27','✔\x20No\x20changes\x20-\x20\x27','\x0a⚠️\x20\x20Both\x20','\x20\x20No\x20sample\x20data\x20available','addAttributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','displayPreviewHints','segment:parent:update','ps:pz:init','collectSchema','scheduleType','length','database','user_id','Executing\x20parent\x20segment\x20query...','table','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','description','\x20behaviors','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','map','win32','Database:\x20','Output\x20file:\x20','keys','behavior','Rows:','Customers:','segment:parent:desc','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Audience\x20ID:','list','personalization','\x0a⚠️\x20\x20Migrating:\x20','\x20=\x20','No\x20RT-enabled\x20parent\x20segments\x20found','yellow','Error:\x20--database\x20and\x20--table\x20are\x20required','To\x20view\x20sample\x20data:','segment:parent:sql','ID\x20Stitching:','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Status:','ps:rt:validate','ps:pz:list','No\x20parent\x20segments\x20match\x20pattern:\x20','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Listing\x20fields\x20for\x20\x27','\x20\x20Database:\x20','\x5c$&','population','data','schemaError','Behaviors','scheduleOption','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','column_type','displayValidateResults','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','addBehaviors','displayRealtimeInfo','Error:','Parent\x20segment:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Apply\x20changes\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','👥\x20','-1d','\x0aChanges\x20to\x20\x27'];a26_0x5c9f=function(){return _0xba30ab;};return a26_0x5c9f();}export class ParentSegmentUpdateCommand extends BaseCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0x19e);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a26_0x3ac8d7(0x176)](_0x11dfdb){const _0x55f752=a26_0x3ac8d7,{options:_0x565b7e,args:_0x4682f0,tdx:_0x1060da}=_0x11dfdb;console['error'](_0x55f752(0x7a)+_0x55f752(0x1f7)+_0x55f752(0xf8));const _0x598214=_0x565b7e;if(_0x4682f0[_0x55f752(0x1a2)]===0x0)return console['error'](a26_0x1d7dc3[_0x55f752(0x174)](_0x55f752(0x149))),console[_0x55f752(0x128)](_0x55f752(0x18c)),0x1;const _0x87d3c6=_0x4682f0[0x0];_0x598214[_0x55f752(0x120)]&&(console[_0x55f752(0x128)](_0x55f752(0xcc)+_0x598214[_0x55f752(0x74)]),console['error'](_0x55f752(0x1d5)+_0x87d3c6));const _0x36ec4e=await withSpinner(_0x55f752(0x136)+_0x87d3c6+_0x55f752(0x190),()=>_0x1060da['segment'][_0x55f752(0x171)](_0x87d3c6),{'verbose':_0x598214[_0x55f752(0x120)]}),_0x5c7796=_0x36ec4e[_0x55f752(0x1ca)],_0x1b6aa7=await loadJSONFromOptions(_0x598214[_0x55f752(0x19b)],_0x598214[_0x55f752(0xbe)]),_0x29aea3=await loadJSONFromOptions(_0x598214[_0x55f752(0x1d2)],_0x598214[_0x55f752(0x6f)]),_0x310352={'name':_0x5c7796[_0x55f752(0xe4)],'description':_0x598214[_0x55f752(0x1a8)]!==undefined?_0x598214[_0x55f752(0x1a8)]:_0x5c7796[_0x55f752(0x1a8)],'scheduleType':_0x598214[_0x55f752(0x1a1)]!==undefined?_0x598214[_0x55f752(0x1a1)]:_0x5c7796['scheduleType'],'scheduleOption':_0x598214[_0x55f752(0x1cd)]!==undefined?_0x598214['scheduleOption']:_0x5c7796['scheduleOption'],'timezone':_0x598214[_0x55f752(0x146)]!==undefined?_0x598214[_0x55f752(0x146)]:_0x5c7796[_0x55f752(0x146)],'master':_0x5c7796[_0x55f752(0x81)],'attributes':_0x1b6aa7?[..._0x5c7796['attributes']||[],..._0x1b6aa7]:_0x5c7796[_0x55f752(0x1ea)],'behaviors':_0x29aea3?[..._0x5c7796[_0x55f752(0x156)]||[],..._0x29aea3]:_0x5c7796['behaviors'],'customerGroup':_0x5c7796['customerGroup']},_0x3cfb9f=await withSpinner(_0x55f752(0x160)+_0x87d3c6+_0x55f752(0x190),()=>_0x1060da[_0x55f752(0x117)][_0x55f752(0x168)](_0x87d3c6,_0x310352),{'verbose':_0x598214[_0x55f752(0x120)]}),_0x4e15d6=_0x3cfb9f[_0x55f752(0x1ca)];return console['error'](_0x55f752(0xb2)+_0x4e15d6['name']+'\x27'),await handleSDKOutput([_0x4e15d6],_0x598214),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a26_0x3ac8d7(0x1a8)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a26_0x3ac8d7(0x176)](_0x2e6c43){const _0x1e9e42=a26_0x3ac8d7,{options:_0x180ae6,args:_0x419902,tdx:_0x38f081}=_0x2e6c43,_0x2b70a6=_0x180ae6,_0x8b4084=_0x419902[0x0]||_0x180ae6['parentSegment'];if(!_0x8b4084)return showParentSegmentNotSetError(_0x1e9e42(0x1d6)+_0x1e9e42(0xa3)),0x1;if(_0x2b70a6[_0x1e9e42(0x181)]&&_0x2b70a6[_0x1e9e42(0x14b)])return console[_0x1e9e42(0x128)](a26_0x1d7dc3[_0x1e9e42(0x174)](_0x1e9e42(0x18b))),console[_0x1e9e42(0x128)](a26_0x1d7dc3[_0x1e9e42(0x144)](_0x1e9e42(0x18a))),console['error'](a26_0x1d7dc3[_0x1e9e42(0x144)](_0x1e9e42(0xe6)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x1e9e42(0x128)](a26_0x1d7dc3[_0x1e9e42(0x16b)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x508f45=_0x2b70a6[_0x1e9e42(0x14b)]||a26_0x4f44f4[_0x1e9e42(0x17a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x8b4084)+'.yml');_0x2b70a6[_0x1e9e42(0x120)]&&(console[_0x1e9e42(0x128)]('Site:\x20'+_0x2b70a6[_0x1e9e42(0x74)]),console[_0x1e9e42(0x128)](_0x1e9e42(0x1d5)+_0x8b4084),console[_0x1e9e42(0x128)](_0x1e9e42(0x1ae)+_0x508f45));const _0x2afafa=await withSpinner(_0x1e9e42(0x165)+_0x8b4084+_0x1e9e42(0x190),()=>_0x38f081[_0x1e9e42(0x117)][_0x1e9e42(0xbc)](_0x8b4084),{'verbose':_0x2b70a6[_0x1e9e42(0x120)]}),_0x143832=_0x2afafa[_0x1e9e42(0x1ca)];if(existsSync(_0x508f45)){const _0x4001ad=readFileSync(_0x508f45,'utf-8'),_0x2f37d2=generateDiff(_0x4001ad,_0x143832);if(!hasChanges(_0x2f37d2))console[_0x1e9e42(0x128)](a26_0x1d7dc3['green']('✔')+_0x1e9e42(0x1e6)+a26_0x1d7dc3['cyan'](_0x508f45)+_0x1e9e42(0xd6));else{console[_0x1e9e42(0x128)](_0x1e9e42(0x1dd)+_0x508f45+'\x27:'),console['error']('─'[_0x1e9e42(0x83)](0x3c)),console[_0x1e9e42(0x128)](formatDiffWithColors(_0x2f37d2)),console[_0x1e9e42(0x128)]('─'['repeat'](0x3c));if(!_0x2b70a6[_0x1e9e42(0xe3)]){if(!isInteractive())return console[_0x1e9e42(0x128)](a26_0x1d7dc3[_0x1e9e42(0x174)]('\x0aError:'),_0x1e9e42(0x6c)),console[_0x1e9e42(0x128)](a26_0x1d7dc3['dim'](_0x1e9e42(0x7b))),0x1;const _0x123980=await confirmKey(_0x1e9e42(0x152)+_0x508f45+'\x27?');if(!_0x123980)return console['error'](a26_0x1d7dc3['yellow'](_0x1e9e42(0x137))),0x1;}writeFileSync(_0x508f45,_0x143832,_0x1e9e42(0x103)),console[_0x1e9e42(0x128)](a26_0x1d7dc3[_0x1e9e42(0x11a)]('✔')+_0x1e9e42(0x114)+a26_0x1d7dc3[_0x1e9e42(0x16b)](_0x508f45));}}else{const _0x24b638=a26_0x4f44f4[_0x1e9e42(0x150)](_0x508f45);!existsSync(_0x24b638)&&mkdirSync(_0x24b638,{'recursive':!![]}),writeFileSync(_0x508f45,_0x143832,_0x1e9e42(0x103)),console['error'](a26_0x1d7dc3['green']('✔')+_0x1e9e42(0x114)+a26_0x1d7dc3['cyan'](_0x508f45));}return saveSessionContext({'parent_segment':_0x8b4084},_0x2b70a6[_0x1e9e42(0xfd)]),console['error'](a26_0x1d7dc3[_0x1e9e42(0x11a)]('✔')+_0x1e9e42(0xc8)+a26_0x1d7dc3['dim'](_0x1e9e42(0xfc))+'\x20=\x20'+a26_0x1d7dc3[_0x1e9e42(0x16b)](_0x8b4084)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0x93);[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0x99);async[a26_0x3ac8d7(0x176)](_0x4ba801){const _0x160d4d=a26_0x3ac8d7,{options:_0x1518f1,args:_0x9c7ecc,tdx:_0x5bd75d}=_0x4ba801,_0x12ae27=_0x1518f1,_0x520a05=_0x9c7ecc[0x0]||_0x1518f1[_0x160d4d(0x159)];if(!_0x520a05)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x160d4d(0x95)),0x1;const _0x587f73=resolveYamlFile(_0x520a05);if(!existsSync(_0x587f73))return showFileNotFoundError(_0x587f73,_0x520a05),0x1;_0x12ae27[_0x160d4d(0x120)]&&(console[_0x160d4d(0x128)](_0x160d4d(0xcc)+_0x12ae27['site']),console[_0x160d4d(0x128)](_0x160d4d(0x86)+_0x587f73));let _0x2e2240;try{_0x2e2240=readFileSync(_0x587f73,_0x160d4d(0x103));}catch(_0x22fb2f){const _0x2cf0ba=_0x22fb2f instanceof Error?_0x22fb2f[_0x160d4d(0xe2)]:String(_0x22fb2f);return console[_0x160d4d(0x128)](_0x160d4d(0x130)+_0x2cf0ba),0x1;}const _0x427e5a=await withSpinner(_0x160d4d(0x196),()=>_0x5bd75d[_0x160d4d(0x117)][_0x160d4d(0x76)](_0x2e2240),{'verbose':_0x12ae27[_0x160d4d(0x120)]}),_0x149d4c=_0x427e5a[_0x160d4d(0x1ca)],{isNew:_0x11a304,name:_0x1ab103,hasChanges:_0x246864,diffFormatted:_0x3e5bd7}=_0x149d4c;if(!_0x246864)return console['error'](_0x160d4d(0x198)+_0x1ab103+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x11a304?console[_0x160d4d(0x128)](_0x160d4d(0x8f)+_0x1ab103+'\x27:'):console[_0x160d4d(0x128)](_0x160d4d(0x15e)+_0x1ab103+'\x27:');console[_0x160d4d(0x128)]('─'[_0x160d4d(0x83)](0x3c)),console[_0x160d4d(0x128)](_0x3e5bd7),console[_0x160d4d(0x128)]('─'[_0x160d4d(0x83)](0x3c));const _0x456b33=_0x11a304?_0x160d4d(0x197)+_0x1ab103+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x1ab103+'\x27?';if(!_0x12ae27[_0x160d4d(0xe3)]){if(!isInteractive())return console[_0x160d4d(0x128)](a26_0x1d7dc3[_0x160d4d(0x174)]('\x0aError:'),_0x160d4d(0x6c)),console[_0x160d4d(0x128)](a26_0x1d7dc3['dim'](_0x160d4d(0x7b))),0x1;const _0x3e8cfa=await confirmKey(_0x456b33);if(!_0x3e8cfa)return console['error'](a26_0x1d7dc3[_0x160d4d(0x1bb)]('Aborted.')),0x1;}const _0x31da87=_0x11a304?'Creating':_0x160d4d(0x1f9),_0x10f122=await withSpinner(_0x31da87+_0x160d4d(0x8a)+_0x1ab103+_0x160d4d(0x190),()=>_0x149d4c[_0x160d4d(0x11f)](),{'verbose':_0x12ae27['verbose']}),_0x4fd4ac=_0x10f122[_0x160d4d(0x1ca)],_0x4bfe91=getConsoleNextUrl(_0x12ae27['site'],_0x160d4d(0xda)+_0x4fd4ac['id']),_0x5eb10f=_0x11a304?_0x160d4d(0x10d):_0x160d4d(0x72);return console[_0x160d4d(0x128)]('✔\x20'+_0x5eb10f+'\x20parent\x20segment\x20\x27'+_0x4fd4ac['name']+'\x27'),console[_0x160d4d(0x128)]('\x20\x20'+_0x4bfe91),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a26_0x3ac8d7(0x6d);['description']=a26_0x3ac8d7(0x127);async['execute'](_0x1db30c){const _0x5e051b=a26_0x3ac8d7,{options:_0x4bbbd2,args:_0x1e4456,tdx:_0x37d19c}=_0x1db30c,_0xe51652=_0x4bbbd2,_0x49bbab=_0x1e4456[0x0]||_0x4bbbd2['parentSegment'];if(!_0x49bbab)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x5e051b(0x19c)+_0x5e051b(0x97)+_0x5e051b(0x12e)+_0x5e051b(0x1a7)+_0x5e051b(0x15d)),0x1;const _0x32bb8a=resolveYamlFile(_0x49bbab);if(!existsSync(_0x32bb8a))return showFileNotFoundError(_0x32bb8a,_0x49bbab),0x1;_0xe51652[_0x5e051b(0x120)]&&(console['error'](_0x5e051b(0xcc)+_0xe51652['site']),console[_0x5e051b(0x128)](_0x5e051b(0x86)+_0x32bb8a));let _0x164024;try{_0x164024=readFileSync(_0x32bb8a,_0x5e051b(0x103));}catch(_0x37d5da){const _0x1a809c=_0x37d5da instanceof Error?_0x37d5da[_0x5e051b(0xe2)]:String(_0x37d5da);return console[_0x5e051b(0x128)]('Error\x20reading\x20file:\x20'+_0x1a809c),0x1;}const _0x29f76b=createCommandSpinner(a26_0x1d7dc3[_0x5e051b(0x144)]('Validating\x20configuration...'),{'verbose':_0xe51652[_0x5e051b(0x120)]});_0x29f76b[_0x5e051b(0x191)]();const _0x509b1c={'onProgress':_0xcf08ff=>{const _0x3771db=_0x5e051b;_0x29f76b[_0x3771db(0xa8)]=formatProgressMessage(_0xcf08ff);}};if(_0xe51652['master'])_0x509b1c[_0x5e051b(0x81)]=!![];if(_0xe51652[_0x5e051b(0x13b)])_0x509b1c['enriched']=!![];_0xe51652['attribute']&&(_0x509b1c[_0x5e051b(0xb5)]=_0xe51652[_0x5e051b(0xb5)]);_0xe51652['behavior']&&(_0x509b1c[_0x5e051b(0x1b0)]=_0xe51652[_0x5e051b(0x1b0)]);if(_0xe51652['interval'])_0x509b1c['interval']=_0xe51652[_0x5e051b(0xc9)];let _0x5d8b2b;try{_0x5d8b2b=await _0x37d19c[_0x5e051b(0x117)][_0x5e051b(0x12f)](_0x164024,_0x509b1c),_0x29f76b['stop']();}catch(_0x3fd909){_0x29f76b[_0x5e051b(0x90)]();throw _0x3fd909;}const _0x8c118b=_0xe51652[_0x5e051b(0xc9)]||_0x5e051b(0x1dc);return this['displayValidateResults'](_0x5d8b2b,_0x509b1c,_0x32bb8a,_0x8c118b),_0x5d8b2b[_0x5e051b(0x134)]?0x0:0x1;}[a26_0x3ac8d7(0x1d0)](_0x13e983,_0x2620ac,_0x45e923,_0x12e35d){const _0x9b7e9a=a26_0x3ac8d7;console[_0x9b7e9a(0x128)]('\x0a'+a26_0x1d7dc3['bold']('Validate:')+'\x20'+_0x13e983[_0x9b7e9a(0xe4)]),console[_0x9b7e9a(0x128)]('═'[_0x9b7e9a(0x83)](0x3c)),this[_0x9b7e9a(0x1ee)](_0x13e983);if(typeof _0x2620ac[_0x9b7e9a(0xb5)]==='string'){this['displayAttributesStats'](_0x13e983),this[_0x9b7e9a(0xdb)](_0x13e983),this['displayPreviewHints'](_0x45e923,_0x12e35d,'attribute',_0x2620ac[_0x9b7e9a(0xb5)]);return;}if(_0x2620ac[_0x9b7e9a(0xb5)]===!![]){this[_0x9b7e9a(0x184)](_0x13e983),this[_0x9b7e9a(0xdb)](_0x13e983),this[_0x9b7e9a(0x19d)](_0x45e923,_0x12e35d,'attributes');return;}if(typeof _0x2620ac[_0x9b7e9a(0x1b0)]===_0x9b7e9a(0xf6)){this[_0x9b7e9a(0x157)](_0x13e983,_0x12e35d),this['displaySummary'](_0x13e983),this[_0x9b7e9a(0x19d)](_0x45e923,_0x12e35d,_0x9b7e9a(0x1b0),_0x2620ac[_0x9b7e9a(0x1b0)]);return;}if(_0x2620ac['behavior']===!![]){this['displayBehaviorsStats'](_0x13e983,_0x12e35d),this[_0x9b7e9a(0xdb)](_0x13e983),this[_0x9b7e9a(0x19d)](_0x45e923,_0x12e35d,'behaviors');return;}this[_0x9b7e9a(0x184)](_0x13e983),this[_0x9b7e9a(0x157)](_0x13e983,_0x12e35d),this[_0x9b7e9a(0x1d3)](_0x13e983),this[_0x9b7e9a(0xdb)](_0x13e983),this[_0x9b7e9a(0x19d)](_0x45e923,_0x12e35d,'all');}[a26_0x3ac8d7(0x1d3)](_0x2d1655){displayRealtimeValidation(_0x2d1655);}[a26_0x3ac8d7(0x19d)](_0x5f397d,_0x1d4741,_0x27b1c0,_0x3f7684){const _0x139cee=a26_0x3ac8d7;console[_0x139cee(0x128)]('\x0a'+a26_0x1d7dc3[_0x139cee(0x144)](_0x139cee(0x1bd)));const _0x46fe3f=_0x1d4741!==_0x139cee(0x1dc)?_0x139cee(0x189)+_0x1d4741:'';if(_0x27b1c0==='attribute'&&_0x3f7684)console['error']('\x20\x20'+a26_0x1d7dc3[_0x139cee(0x144)](_0x139cee(0x139)+_0x5f397d+_0x139cee(0x10f)+_0x3f7684+'\x22'+_0x46fe3f));else{if(_0x27b1c0==='behavior'&&_0x3f7684)console[_0x139cee(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x139cee(0x144)](_0x139cee(0x139)+_0x5f397d+_0x139cee(0x9a)+_0x3f7684+'\x22'+_0x46fe3f));else(_0x27b1c0===_0x139cee(0x1ea)||_0x27b1c0==='all')&&console[_0x139cee(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x139cee(0x144)]('tdx\x20ps\x20preview\x20'+_0x5f397d+_0x139cee(0xa7)+_0x46fe3f));}(_0x27b1c0===_0x139cee(0x156)||_0x27b1c0===_0x139cee(0xb0))&&console['error']('\x20\x20'+a26_0x1d7dc3['dim']('tdx\x20ps\x20preview\x20'+_0x5f397d+_0x139cee(0x133)+_0x46fe3f)),_0x27b1c0===_0x139cee(0xb0)&&console['error']('\x20\x20'+a26_0x1d7dc3[_0x139cee(0x144)]('tdx\x20ps\x20preview\x20'+_0x5f397d+_0x139cee(0x179)+_0x46fe3f));}[a26_0x3ac8d7(0x1ee)](_0x53e32e){const _0x2ebecb=a26_0x3ac8d7,{master:_0x58517c}=_0x53e32e,_0x316daf=_0x58517c[_0x2ebecb(0x6e)]?a26_0x1d7dc3['green']('✔'):a26_0x1d7dc3[_0x2ebecb(0x174)]('✘');console[_0x2ebecb(0x128)]('\x0a'+a26_0x1d7dc3[_0x2ebecb(0x144)]('Master\x20Table')),console[_0x2ebecb(0x128)](_0x316daf+'\x20'+a26_0x1d7dc3[_0x2ebecb(0xd2)](_0x58517c[_0x2ebecb(0x1a3)]+'.'+_0x58517c[_0x2ebecb(0x1a6)])),_0x58517c['schemaValid']?_0x58517c[_0x2ebecb(0x101)]!==undefined&&console['error']('\x20\x20'+a26_0x1d7dc3[_0x2ebecb(0x144)](_0x2ebecb(0x1b1))+'\x20'+a26_0x1d7dc3[_0x2ebecb(0x16b)](formatRows(_0x58517c[_0x2ebecb(0x101)]))):console[_0x2ebecb(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x2ebecb(0x174)]('Error:')+'\x20'+_0x58517c[_0x2ebecb(0x1cb)]);}[a26_0x3ac8d7(0x184)](_0x50e160){const _0x39bef7=a26_0x3ac8d7;if(_0x50e160[_0x39bef7(0x1ea)][_0x39bef7(0x1a2)]===0x0)return;console['error']('\x0a'+a26_0x1d7dc3[_0x39bef7(0x144)]('Attributes'));for(const _0x24d665 of _0x50e160[_0x39bef7(0x1ea)]){const _0x13a99a=_0x24d665[_0x39bef7(0x6e)]?a26_0x1d7dc3[_0x39bef7(0x11a)]('✔'):a26_0x1d7dc3[_0x39bef7(0x174)]('✘');let _0x519d17='';if(_0x24d665[_0x39bef7(0x6e)]&&_0x24d665[_0x39bef7(0x194)]!==undefined&&_0x24d665[_0x39bef7(0x8d)]!==undefined){const _0xefd53c=_0x24d665['coveragePercent']['toFixed'](0x1),_0x44c256=_0x24d665['coveragePercent']>=0x50?a26_0x1d7dc3['green']:_0x24d665['coveragePercent']>=0x32?a26_0x1d7dc3[_0x39bef7(0x1bb)]:a26_0x1d7dc3['red'];_0x519d17='\x20'+a26_0x1d7dc3[_0x39bef7(0x144)]('Coverage:')+'\x20'+_0x44c256(_0xefd53c+'%')+'\x20('+formatRows(_0x24d665[_0x39bef7(0x194)])+_0x39bef7(0x140);}console['error'](_0x13a99a+'\x20'+a26_0x1d7dc3[_0x39bef7(0xd2)](_0x24d665[_0x39bef7(0xe4)])+_0x519d17),console[_0x39bef7(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x39bef7(0x144)](_0x39bef7(0x164))+'\x20'+a26_0x1d7dc3[_0x39bef7(0xd2)](_0x24d665[_0x39bef7(0x1a3)]+'.'+_0x24d665['table']));const _0x5281b4=_0x24d665[_0x39bef7(0xa5)]===_0x24d665['foreignKey']?a26_0x1d7dc3[_0x39bef7(0x144)]('Join\x20on:')+'\x20'+_0x24d665[_0x39bef7(0xa5)]:a26_0x1d7dc3[_0x39bef7(0x144)](_0x39bef7(0xcd))+'\x20'+_0x24d665[_0x39bef7(0xa5)]+_0x39bef7(0x1b9)+_0x24d665[_0x39bef7(0x142)];console[_0x39bef7(0x128)]('\x20\x20'+_0x5281b4),console[_0x39bef7(0x128)]('\x20\x20'+a26_0x1d7dc3['dim'](_0x39bef7(0x183))),this['displayColumns'](_0x24d665[_0x39bef7(0xc6)]),!_0x24d665[_0x39bef7(0x6e)]&&console[_0x39bef7(0x128)]('\x20\x20'+a26_0x1d7dc3['red'](_0x39bef7(0x1d4))+'\x20'+_0x24d665[_0x39bef7(0x1cb)]);}}['displayBehaviorsStats'](_0x53fc35,_0x3df7e8){const _0x123181=a26_0x3ac8d7;if(_0x53fc35[_0x123181(0x156)][_0x123181(0x1a2)]===0x0)return;console[_0x123181(0x128)]('\x0a'+a26_0x1d7dc3[_0x123181(0x144)](_0x123181(0x1cc))+'\x20'+a26_0x1d7dc3[_0x123181(0x144)]('('+_0x3df7e8+')'));for(const _0x1668b9 of _0x53fc35[_0x123181(0x156)]){const _0x7912ae=_0x1668b9[_0x123181(0x6e)]?a26_0x1d7dc3['green']('✔'):a26_0x1d7dc3[_0x123181(0x174)]('✘');let _0x1a060c='';if(_0x1668b9[_0x123181(0x6e)]&&_0x1668b9['customersWithEvents']!==undefined&&_0x1668b9[_0x123181(0x1f6)]!==undefined){const _0x54ae43=_0x1668b9[_0x123181(0xcb)]?.['toFixed'](0x1)||'?',_0x5625b9=(_0x1668b9[_0x123181(0xcb)]??0x0)>=0x32?a26_0x1d7dc3[_0x123181(0x11a)]:(_0x1668b9[_0x123181(0xcb)]??0x0)>=0x14?a26_0x1d7dc3['yellow']:a26_0x1d7dc3[_0x123181(0x174)];_0x1a060c='\x20'+a26_0x1d7dc3[_0x123181(0x144)](_0x123181(0x1b2))+'\x20'+_0x5625b9(formatRows(_0x1668b9[_0x123181(0x68)]))+'\x20('+_0x54ae43+_0x123181(0x155)+a26_0x1d7dc3[_0x123181(0x144)](_0x123181(0x11c))+'\x20'+a26_0x1d7dc3[_0x123181(0x16b)](formatRows(_0x1668b9[_0x123181(0x1f6)]));}console[_0x123181(0x128)](_0x7912ae+'\x20'+a26_0x1d7dc3['bold'](_0x1668b9[_0x123181(0xe4)])+_0x1a060c),console['error']('\x20\x20'+a26_0x1d7dc3['dim'](_0x123181(0x164))+'\x20'+a26_0x1d7dc3[_0x123181(0xd2)](_0x1668b9['database']+'.'+_0x1668b9['table']));const _0x33fffb=_0x1668b9[_0x123181(0xa5)]===_0x1668b9[_0x123181(0x142)]?a26_0x1d7dc3[_0x123181(0x144)]('Join\x20on:')+'\x20'+_0x1668b9[_0x123181(0xa5)]:a26_0x1d7dc3[_0x123181(0x144)]('Join:')+'\x20'+_0x1668b9['joinKey']+_0x123181(0x1b9)+_0x1668b9[_0x123181(0x142)];console[_0x123181(0x128)]('\x20\x20'+_0x33fffb),console[_0x123181(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x123181(0x144)](_0x123181(0x183))),this['displayColumns'](_0x1668b9[_0x123181(0xc6)]),!_0x1668b9[_0x123181(0x6e)]&&console[_0x123181(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x123181(0x174)](_0x123181(0x1d4))+'\x20'+_0x1668b9[_0x123181(0x1cb)]);}}['displayColumns'](_0x1d0a5d){const _0x446137=a26_0x3ac8d7;for(const _0xb3ee56 of _0x1d0a5d){_0xb3ee56[_0x446137(0xe1)]===_0xb3ee56[_0x446137(0x177)]||_0xb3ee56[_0x446137(0x177)]==='*'?console['error'](_0x446137(0x15a)+_0xb3ee56[_0x446137(0xe1)]):console[_0x446137(0x128)]('\x20\x20\x20\x20-\x20'+_0xb3ee56['label']+'\x20'+a26_0x1d7dc3['dim']('('+_0xb3ee56['column']+')'));}}[a26_0x3ac8d7(0xdb)](_0x4c5619){const _0x4582cd=a26_0x3ac8d7;console[_0x4582cd(0x128)]('─'['repeat'](0x3c));if(_0x4c5619[_0x4582cd(0xc4)]['length']>0x0){console[_0x4582cd(0x128)]('\x0a'+a26_0x1d7dc3['red'](_0x4582cd(0x75)));for(const _0x141629 of _0x4c5619[_0x4582cd(0xc4)]){console['error']('\x20\x20'+a26_0x1d7dc3['red']('•')+'\x20'+_0x141629);}}_0x4c5619[_0x4582cd(0x134)]&&console[_0x4582cd(0x128)]('\x0a'+a26_0x1d7dc3[_0x4582cd(0x11a)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a26_0x3ac8d7(0x88);[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0x1c0);async[a26_0x3ac8d7(0x176)](_0x521bb8){const _0x1643dc=a26_0x3ac8d7,{options:_0x1fa153,args:_0x60b789,tdx:_0x1b34c5}=_0x521bb8,_0x168f7a=_0x1fa153,_0x14fe25=_0x60b789[0x0]||_0x1fa153[_0x1643dc(0x159)];if(!_0x14fe25)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'+_0x1643dc(0x87)+'Options\x20(one\x20required):\x0a'+_0x1643dc(0xe7)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x1643dc(0x173)+_0x1643dc(0x111)+_0x1643dc(0x15d)),0x1;if(!_0x168f7a[_0x1643dc(0x81)]&&!_0x168f7a[_0x1643dc(0xb5)]&&!_0x168f7a['behavior']&&!_0x168f7a['enriched'])return console[_0x1643dc(0x128)](a26_0x1d7dc3[_0x1643dc(0x174)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error'](_0x1643dc(0x1aa)),console[_0x1643dc(0x128)](_0x1643dc(0xc7)),console[_0x1643dc(0x128)](_0x1643dc(0xae)),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x1643dc(0x128)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x1643dc(0x128)](_0x1643dc(0x1b4)),0x1;const _0x51b2d1=resolveYamlFile(_0x14fe25);if(!existsSync(_0x51b2d1))return showFileNotFoundError(_0x51b2d1,_0x14fe25),0x1;_0x168f7a[_0x1643dc(0x120)]&&(console['error'](_0x1643dc(0xcc)+_0x168f7a['site']),console['error'](_0x1643dc(0x86)+_0x51b2d1));let _0x39ce32;try{_0x39ce32=readFileSync(_0x51b2d1,_0x1643dc(0x103));}catch(_0x12799a){const _0x5cc8c5=_0x12799a instanceof Error?_0x12799a[_0x1643dc(0xe2)]:String(_0x12799a);return console[_0x1643dc(0x128)]('Error\x20reading\x20file:\x20'+_0x5cc8c5),0x1;}let _0x16d768;try{_0x16d768=parseDef(_0x39ce32);}catch(_0x196585){const _0x489e9e=_0x196585 instanceof Error?_0x196585[_0x1643dc(0xe2)]:String(_0x196585);return console[_0x1643dc(0x128)](a26_0x1d7dc3[_0x1643dc(0x174)]('Error\x20parsing\x20YAML:\x20'+_0x489e9e)),0x1;}if(_0x168f7a[_0x1643dc(0xb5)]===!![]||_0x168f7a['attribute']===''){const _0x585782=_0x16d768[_0x1643dc(0x1ea)]?.[_0x1643dc(0x1ab)](_0xc12d03=>_0xc12d03[_0x1643dc(0xe4)])||[];if(_0x585782[_0x1643dc(0x1a2)]===0x0)console[_0x1643dc(0x128)](a26_0x1d7dc3[_0x1643dc(0x174)](_0x1643dc(0xab)));else{console[_0x1643dc(0x128)](a26_0x1d7dc3[_0x1643dc(0x174)](_0x1643dc(0x11d))),console['error'](_0x1643dc(0x10e));for(const _0x3990d1 of _0x585782){console[_0x1643dc(0x128)]('\x20\x20'+a26_0x1d7dc3['cyan'](_0x3990d1));}console[_0x1643dc(0x128)](_0x1643dc(0x195)+_0x14fe25+_0x1643dc(0x10f)+_0x585782[0x0]+'\x22');}return 0x1;}if(_0x168f7a[_0x1643dc(0x1b0)]===!![]||_0x168f7a[_0x1643dc(0x1b0)]===''){const _0x14ec16=_0x16d768['behaviors']?.['map'](_0x1acaed=>_0x1acaed[_0x1643dc(0xe4)])||[];if(_0x14ec16[_0x1643dc(0x1a2)]===0x0)console[_0x1643dc(0x128)](a26_0x1d7dc3[_0x1643dc(0x174)](_0x1643dc(0xd5)));else{console[_0x1643dc(0x128)](a26_0x1d7dc3[_0x1643dc(0x174)](_0x1643dc(0xed))),console[_0x1643dc(0x128)]('Available\x20behaviors:');for(const _0xcd5f59 of _0x14ec16){console['error']('\x20\x20'+a26_0x1d7dc3[_0x1643dc(0x16b)](_0xcd5f59));}console['error'](_0x1643dc(0x195)+_0x14fe25+_0x1643dc(0x9a)+_0x14ec16[0x0]+'\x22');}return 0x1;}const _0x51584e=createCommandSpinner(a26_0x1d7dc3[_0x1643dc(0x144)](_0x1643dc(0x129)),{'verbose':_0x168f7a[_0x1643dc(0x120)]});_0x51584e[_0x1643dc(0x191)]();const _0x188c35={'onProgress':_0x3fcf93=>{_0x51584e['text']=formatProgressMessage(_0x3fcf93);}};if(_0x168f7a[_0x1643dc(0x81)])_0x188c35[_0x1643dc(0x81)]=!![];if(_0x168f7a[_0x1643dc(0xb5)]&&typeof _0x168f7a[_0x1643dc(0xb5)]==='string')_0x188c35[_0x1643dc(0xb5)]=_0x168f7a[_0x1643dc(0xb5)];if(_0x168f7a[_0x1643dc(0x1b0)]&&typeof _0x168f7a[_0x1643dc(0x1b0)]===_0x1643dc(0xf6))_0x188c35[_0x1643dc(0x1b0)]=_0x168f7a[_0x1643dc(0x1b0)];if(_0x168f7a['enriched'])_0x188c35[_0x1643dc(0x13b)]=!![];if(_0x168f7a['interval'])_0x188c35[_0x1643dc(0xc9)]=_0x168f7a[_0x1643dc(0xc9)];let _0xaaf7f2;try{_0xaaf7f2=await _0x1b34c5[_0x1643dc(0x117)]['previewParentYaml'](_0x39ce32,_0x188c35),_0x51584e['stop']();}catch(_0x19ffb7){_0x51584e[_0x1643dc(0x90)]();throw _0x19ffb7;}return await this[_0x1643dc(0x16c)](_0xaaf7f2,{'master':_0x168f7a[_0x1643dc(0x81)],'attribute':typeof _0x168f7a[_0x1643dc(0xb5)]===_0x1643dc(0xf6)?_0x168f7a['attribute']:undefined,'behavior':typeof _0x168f7a['behavior']===_0x1643dc(0xf6)?_0x168f7a[_0x1643dc(0x1b0)]:undefined,'enriched':_0x168f7a[_0x1643dc(0x13b)]}),_0xaaf7f2['allValid']?0x0:0x1;}async[a26_0x3ac8d7(0x16c)](_0x16eac9,_0x2e7980){const _0x571d1a=a26_0x3ac8d7;console[_0x571d1a(0x128)]('\x0a'+a26_0x1d7dc3[_0x571d1a(0xd2)](_0x571d1a(0x108))+'\x20'+_0x16eac9[_0x571d1a(0xe4)]),console[_0x571d1a(0x128)]('═'['repeat'](0x3c));if(_0x2e7980[_0x571d1a(0x81)]&&_0x16eac9[_0x571d1a(0x193)]){const _0x363d23=a26_0x1d7dc3[_0x571d1a(0x144)](_0x571d1a(0x112))+'\x20'+a26_0x1d7dc3[_0x571d1a(0xd2)](_0x16eac9[_0x571d1a(0x81)][_0x571d1a(0x1a3)]+'.'+_0x16eac9[_0x571d1a(0x81)]['table']);await this[_0x571d1a(0x175)](_0x363d23,_0x16eac9[_0x571d1a(0x193)]);}else{if(_0x2e7980['attribute']&&_0x16eac9[_0x571d1a(0x193)]){const _0x2a7a34=a26_0x1d7dc3[_0x571d1a(0x144)](_0x571d1a(0xf1))+'\x20'+a26_0x1d7dc3['bold'](_0x2e7980[_0x571d1a(0xb5)]);await this[_0x571d1a(0x175)](_0x2a7a34,_0x16eac9['sampleData']);}else{if(_0x2e7980[_0x571d1a(0x1b0)]&&_0x16eac9[_0x571d1a(0x193)]){const _0x4fc7ac=a26_0x1d7dc3[_0x571d1a(0x144)](_0x571d1a(0x9f))+'\x20'+a26_0x1d7dc3[_0x571d1a(0xd2)](_0x2e7980[_0x571d1a(0x1b0)]);await this[_0x571d1a(0x175)](_0x4fc7ac,_0x16eac9[_0x571d1a(0x193)]);}else{if(_0x2e7980['enriched']&&_0x16eac9[_0x571d1a(0x193)]){const _0x809fba=a26_0x1d7dc3[_0x571d1a(0x144)](_0x571d1a(0x11e))+'\x20'+a26_0x1d7dc3['bold'](_0x571d1a(0x13e));await this[_0x571d1a(0x175)](_0x809fba,_0x16eac9[_0x571d1a(0x193)]);}else!_0x16eac9['sampleData']&&console[_0x571d1a(0x128)](_0x571d1a(0x69));}}}if(_0x16eac9[_0x571d1a(0xc4)]['length']>0x0){console[_0x571d1a(0x128)]('─'[_0x571d1a(0x83)](0x3c)),console[_0x571d1a(0x128)]('\x0a'+a26_0x1d7dc3[_0x571d1a(0x174)]('Errors:'));for(const _0x211b0c of _0x16eac9[_0x571d1a(0xc4)]){console['error']('\x20\x20'+a26_0x1d7dc3[_0x571d1a(0x174)]('•')+'\x20'+_0x211b0c);}}}async[a26_0x3ac8d7(0x175)](_0x588fd8,_0x3dc9b1){const _0x52efb6=a26_0x3ac8d7;if(_0x3dc9b1[_0x52efb6(0x1a2)]===0x0){console[_0x52efb6(0x128)]('\x0a'+_0x588fd8),console[_0x52efb6(0x128)](_0x52efb6(0x19a));return;}console['error']('\x0a'+_0x588fd8);const _0x33558e=Object[_0x52efb6(0x1af)](_0x3dc9b1[0x0])[_0x52efb6(0x1ab)](_0x7b51c0=>({'name':_0x7b51c0,'type':typeof _0x3dc9b1[0x0][_0x7b51c0]===_0x52efb6(0x1de)?'double':_0x52efb6(0x7c)})),_0x539e3c={'queryId':'preview','columns':_0x33558e,'data':_0x3dc9b1,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3dc9b1[_0x52efb6(0x1a2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x1e2bd1=formatAsTable(_0x539e3c,_0x3dc9b1[_0x52efb6(0x1a2)],!![]);await writeOutput(_0x1e2bd1,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0xf4);[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0xf9);async['execute'](_0x36ec38){const _0x524e3f=a26_0x3ac8d7,{options:_0x11d4cb,args:_0x329c72,tdx:_0x37e3d4}=_0x36ec38,_0x284fa0=_0x11d4cb,_0x16459e=_0x329c72[0x0]||_0x11d4cb[_0x524e3f(0x159)];if(!_0x16459e)return showParentSegmentNotSetError(_0x524e3f(0xd7)+_0x524e3f(0xc2)),0x1;const _0x53e20d=resolveYamlFile(_0x16459e);if(existsSync(_0x53e20d)){_0x284fa0[_0x524e3f(0x120)]&&console[_0x524e3f(0x128)](_0x524e3f(0xee)+_0x53e20d);let _0x40eec0;try{_0x40eec0=readFileSync(_0x53e20d,'utf-8');}catch(_0x296ce0){const _0x3125bf=_0x296ce0 instanceof Error?_0x296ce0['message']:String(_0x296ce0);return console[_0x524e3f(0x128)]('Error\x20reading\x20file:\x20'+_0x3125bf),0x1;}const _0x24010d=await withSpinner('Analyzing\x20changes...',()=>_0x37e3d4['segment'][_0x524e3f(0x76)](_0x40eec0),{'verbose':_0x284fa0[_0x524e3f(0x120)]}),_0x442d5d=_0x24010d['data'],{isNew:_0x448372,name:_0x5c62e7,hasChanges:_0x1889ca,diffFormatted:_0x13c238}=_0x442d5d;if(_0x1889ca){_0x448372?console['error'](_0x524e3f(0x8f)+_0x5c62e7+'\x27:'):console[_0x524e3f(0x128)](_0x524e3f(0x15e)+_0x5c62e7+'\x27:');console[_0x524e3f(0x128)]('─'[_0x524e3f(0x83)](0x3c)),console[_0x524e3f(0x128)](_0x13c238),console[_0x524e3f(0x128)]('─'['repeat'](0x3c));const _0x1bd160=_0x448372?_0x524e3f(0x197)+_0x5c62e7+_0x524e3f(0xaf):_0x524e3f(0x1d7)+_0x5c62e7+_0x524e3f(0xaf);if(!_0x284fa0[_0x524e3f(0xe3)]){if(!isInteractive())return console[_0x524e3f(0x128)](a26_0x1d7dc3['red'](_0x524e3f(0xd0)),_0x524e3f(0x6c)),console[_0x524e3f(0x128)](a26_0x1d7dc3[_0x524e3f(0x144)](_0x524e3f(0x7b))),0x1;const _0x314026=await confirmKey(_0x1bd160);if(!_0x314026)return console[_0x524e3f(0x128)](a26_0x1d7dc3[_0x524e3f(0x1bb)](_0x524e3f(0x137))),0x1;}const _0x435030=_0x448372?'Creating':_0x524e3f(0x1f9);await withSpinner(_0x435030+_0x524e3f(0x8a)+_0x5c62e7+'\x27...',()=>_0x442d5d['apply'](),{'verbose':_0x284fa0['verbose']});const _0x2de023=_0x448372?_0x524e3f(0x10d):_0x524e3f(0x72);console[_0x524e3f(0x128)]('✔\x20'+_0x2de023+_0x524e3f(0x8a)+_0x5c62e7+'\x27');}else console[_0x524e3f(0x128)](_0x524e3f(0x198)+_0x5c62e7+'\x27\x20is\x20up\x20to\x20date');}const _0x3938b3=await withSpinner(_0x524e3f(0x1ce)+_0x16459e+_0x524e3f(0x190),()=>_0x37e3d4['segment'][_0x524e3f(0x1f4)](_0x16459e),{'verbose':_0x284fa0[_0x524e3f(0x120)]}),_0x3b8693=_0x3938b3[_0x524e3f(0x1ca)],_0x5623c3=getConsoleUrl(_0x284fa0['site'],_0x524e3f(0x17d)+_0x3b8693[_0x524e3f(0x109)]+_0x524e3f(0x96)+_0x3b8693[_0x524e3f(0x116)]+_0x524e3f(0x16a)+_0x3b8693['workflowAttemptId']);return console[_0x524e3f(0x128)](_0x524e3f(0xb3)),console[_0x524e3f(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x524e3f(0x144)](_0x524e3f(0x1b5))+'\x20'+_0x3b8693[_0x524e3f(0x131)]),console[_0x524e3f(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x524e3f(0x144)](_0x524e3f(0x1c1))+'\x20'+_0x3b8693[_0x524e3f(0x14c)]),console[_0x524e3f(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x524e3f(0x144)](_0x524e3f(0xe9))+'\x20'+_0x3b8693[_0x524e3f(0x116)]),console[_0x524e3f(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x524e3f(0x144)](_0x524e3f(0x170))+'\x20'+_0x3b8693[_0x524e3f(0xdd)]),console[_0x524e3f(0x128)]('\x20\x20'+_0x5623c3),console['error']('\x0a'+a26_0x1d7dc3[_0x524e3f(0x144)]('To\x20cancel:')+_0x524e3f(0x126)+_0x3b8693['workflowAttemptId']+_0x524e3f(0xe5)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a26_0x3ac8d7(0xbd);[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0x147);async[a26_0x3ac8d7(0x176)](_0x21fdca){const _0x4018b5=a26_0x3ac8d7,{options:_0x23219b,args:_0x5cc3ec,tdx:_0x14db4f}=_0x21fdca,_0x591d66=_0x5cc3ec[0x0]||_0x23219b['parentSegment'];if(!_0x591d66)return showParentSegmentNotSetError(_0x4018b5(0x1e4)+_0x4018b5(0x1d8)),0x1;_0x23219b[_0x4018b5(0x120)]&&(console['error'](_0x4018b5(0xcc)+_0x23219b['site']),console[_0x4018b5(0x128)]('Parent\x20segment:\x20'+_0x591d66));const _0x4cdd82=await withSpinner(_0x4018b5(0x1c6)+_0x591d66+'\x27...',()=>_0x14db4f['segment'][_0x4018b5(0xcf)](_0x591d66),{'verbose':_0x23219b[_0x4018b5(0x120)]}),_0x360aac=_0x4cdd82[_0x4018b5(0x1ca)];console[_0x4018b5(0x128)](_0x4018b5(0x124)+_0x360aac[_0x4018b5(0x1a2)]+_0x4018b5(0x9d)+(_0x360aac[_0x4018b5(0x1a2)]!==0x1?'s':''));if(_0x23219b[_0x4018b5(0xdc)]||_0x23219b[_0x4018b5(0x172)])return await handleSDKOutput(_0x360aac,_0x23219b),0x0;return displayFieldsHumanReadable(_0x360aac,_0x591d66),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a26_0x3ac8d7(0xe4)]='segment:parent:view';[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0xeb);async[a26_0x3ac8d7(0x176)](_0x15f19d){const _0x12d6ca=a26_0x3ac8d7,{options:_0x276bdf,args:_0x365b9f,tdx:_0x556223}=_0x15f19d,_0x4f9549=_0x276bdf,_0x24e01c=_0x365b9f[0x0]||_0x276bdf['parentSegment'];if(!_0x24e01c)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'+_0x12d6ca(0x10b)+_0x12d6ca(0x97)+_0x12d6ca(0x122)),0x1;_0x276bdf[_0x12d6ca(0x120)]&&(console[_0x12d6ca(0x128)](_0x12d6ca(0xcc)+_0x276bdf['site']),console['error'](_0x12d6ca(0x1d5)+_0x24e01c));const _0x59a27b=await withSpinner(_0x12d6ca(0x165)+_0x24e01c+'\x27...',()=>_0x556223['segment'][_0x12d6ca(0x171)](_0x24e01c),{'verbose':_0x276bdf[_0x12d6ca(0x120)]}),_0x54a3b3=_0x59a27b['data'];if(_0x4f9549[_0x12d6ca(0x1ed)]){const _0x4f2272=getConsoleNextUrl(_0x4f9549[_0x12d6ca(0x74)],_0x12d6ca(0xda)+_0x54a3b3['id']);return console[_0x12d6ca(0x128)](a26_0x1d7dc3[_0x12d6ca(0x11a)]('✔')+'\x20Opening\x20'+a26_0x1d7dc3['cyan'](_0x4f2272)),openBrowser(_0x4f2272),0x0;}return await handleSingleObjectOutput(_0x54a3b3,_0x276bdf),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0x1b3);[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0xde);async['execute'](_0x34ceca){const _0xb3da3=a26_0x3ac8d7,{options:_0x202f61,args:_0x5df1c5,tdx:_0x53e2af}=_0x34ceca,_0x15dbac=_0x202f61,_0x31cb21=_0x5df1c5[0x0]||_0x202f61[_0xb3da3(0x159)];if(!_0x31cb21)return showParentSegmentNotSetError(_0xb3da3(0x10c)+_0xb3da3(0xef)+_0xb3da3(0x97)+_0xb3da3(0x14e)),0x1;_0x202f61[_0xb3da3(0x120)]&&(console[_0xb3da3(0x128)]('Site:\x20'+_0x202f61['site']),console[_0xb3da3(0x128)]('Parent\x20segment:\x20'+_0x31cb21));const _0x52dc0e=await withSpinner(_0xb3da3(0x154)+_0x31cb21+_0xb3da3(0x190),()=>_0x53e2af[_0xb3da3(0x117)][_0xb3da3(0x100)](_0x31cb21),{'verbose':_0x202f61[_0xb3da3(0x120)]}),_0x27a469=_0x52dc0e[_0xb3da3(0x1ca)],_0x3963a7=_0x53e2af['segment'][_0xb3da3(0xa0)](_0x27a469);if(_0x15dbac['output']){const _0x13acae=await this[_0xb3da3(0x1a0)](_0x34ceca,_0x31cb21,_0x27a469,_0x3963a7),_0x10d01a=this['formatSchemaJson'](_0x13acae);writeFileSync(_0x15dbac[_0xb3da3(0x14b)],_0x10d01a);const _0x4beca5=_0x13acae[_0xb3da3(0x1f2)][_0xb3da3(0xc6)][_0xb3da3(0x1a2)]+_0x13acae[_0xb3da3(0x156)][_0xb3da3(0x1f1)]((_0x37a399,_0x3b1170)=>_0x37a399+_0x3b1170[_0xb3da3(0xc6)][_0xb3da3(0x1a2)],0x0),_0x48638e=_0x13acae[_0xb3da3(0x156)]['filter'](_0xdb8a2e=>_0xdb8a2e['columns'][_0xb3da3(0x1a2)]===0x0)['length'];return console[_0xb3da3(0x132)]('Schema\x20saved\x20to\x20'+_0x15dbac['output']),console[_0xb3da3(0x132)](_0xb3da3(0x1c7)+_0x3963a7),console[_0xb3da3(0x132)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x13acae[_0xb3da3(0x156)][_0xb3da3(0x1a2)]+_0xb3da3(0x1a9)),console[_0xb3da3(0x132)](_0xb3da3(0x106)+_0x4beca5+'\x20total'),_0x48638e>0x0&&console[_0xb3da3(0x132)](_0xb3da3(0x1e9)+_0x48638e+_0xb3da3(0x1d1)),0x0;}console[_0xb3da3(0x128)]('\x0a'+a26_0x1d7dc3[_0xb3da3(0xd2)](_0xb3da3(0x71))+'\x20'+a26_0x1d7dc3[_0xb3da3(0x16b)](_0x3963a7));const _0x3e84ce=await withSpinner(_0xb3da3(0xba),()=>_0x53e2af[_0xb3da3(0x117)][_0xb3da3(0xaa)](_0x27a469),{'verbose':_0x202f61[_0xb3da3(0x120)]});console[_0xb3da3(0x128)]('\x0a'+a26_0x1d7dc3[_0xb3da3(0xd2)](_0xb3da3(0x1f2))+'\x20'+a26_0x1d7dc3[_0xb3da3(0x144)]('('+_0x3963a7+_0xb3da3(0xf5)));const _0x1e0078=await executeSchemaQuery(_0x3e84ce['data'],_0x53e2af,_0x202f61);await handleQueryOutput(_0x1e0078,_0x202f61);const _0x219737=await withSpinner(_0xb3da3(0x1e5),()=>_0x53e2af[_0xb3da3(0x117)][_0xb3da3(0x11b)](_0x27a469),{'verbose':_0x202f61[_0xb3da3(0x120)]});for(const _0x43a146 of _0x219737[_0xb3da3(0x1ca)]){const _0x1451f7='behavior_'+_0x43a146[_0xb3da3(0x9c)]()[_0xb3da3(0xd9)](/\s+/g,'_'),_0x366db0=_0xb3da3(0xfb)+_0x3963a7+'.'+_0x1451f7;console[_0xb3da3(0x128)]('\x0a'+a26_0x1d7dc3[_0xb3da3(0xd2)](_0x43a146)+'\x20'+a26_0x1d7dc3[_0xb3da3(0x144)]('('+_0x3963a7+'.'+_0x1451f7+')'));try{const _0x50c461=await executeSchemaQuery(_0x366db0,_0x53e2af,_0x202f61);await handleQueryOutput(_0x50c461,_0x202f61);}catch{console['error'](a26_0x1d7dc3[_0xb3da3(0x1bb)](_0xb3da3(0x141)));}}return 0x0;}async[a26_0x3ac8d7(0x1a0)](_0x34115f,_0x2db04f,_0x5c6235,_0x1411a4){const _0x1f8432=a26_0x3ac8d7,{options:_0x20869d,tdx:_0x53dc8f}=_0x34115f,_0x485cf6=await withSpinner(_0x1f8432(0xba),()=>_0x53dc8f[_0x1f8432(0x117)]['getParentSQL'](_0x5c6235),{'verbose':_0x20869d['verbose']}),_0x5aa1b0=await executeSchemaQuery(_0x485cf6['data'],_0x53dc8f,_0x20869d),_0x5135a4=_0x5aa1b0[_0x1f8432(0x1ca)][_0x1f8432(0x1ab)](_0x186845=>({'name':_0x186845[_0x1f8432(0xf3)],'type':_0x186845[_0x1f8432(0x1cf)]})),_0x9e713f=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x53dc8f[_0x1f8432(0x117)][_0x1f8432(0x11b)](_0x5c6235),{'verbose':_0x20869d[_0x1f8432(0x120)]}),_0x5f2f6=[];for(const _0x568974 of _0x9e713f[_0x1f8432(0x1ca)]){const _0x19dfee=_0x1f8432(0x1e3)+_0x568974[_0x1f8432(0x9c)]()[_0x1f8432(0xd9)](/\s+/g,'_'),_0x56c75f=_0x1f8432(0xfb)+_0x1411a4+'.'+_0x19dfee;let _0x4dbcd9=[];try{const _0x3c32a0=await executeSchemaQuery(_0x56c75f,_0x53dc8f,_0x20869d);_0x4dbcd9=_0x3c32a0[_0x1f8432(0x1ca)][_0x1f8432(0x1ab)](_0x2eb03c=>({'name':_0x2eb03c[_0x1f8432(0xf3)],'type':_0x2eb03c[_0x1f8432(0x1cf)]}));}catch{}_0x5f2f6[_0x1f8432(0x13c)]({'table':_0x19dfee,'columns':_0x4dbcd9});}return{'database':_0x1411a4,'parent_segment':_0x2db04f,'parent_id':_0x5c6235,'customers':{'table':_0x1f8432(0x1f2),'columns':_0x5135a4},'behaviors':_0x5f2f6};}[a26_0x3ac8d7(0x92)](_0x62cb4){const _0x3a6426=a26_0x3ac8d7,_0xecc101=_0x4d50b5=>{const _0x53943b=a26_0x3d76;if(_0x4d50b5[_0x53943b(0x1a2)]===0x0)return'[]';const _0x3479f9=_0x4d50b5[_0x53943b(0x1ab)](_0x23b582=>_0x53943b(0xad)+_0x23b582[_0x53943b(0xe4)]+_0x53943b(0xc5)+_0x23b582[_0x53943b(0x13d)]+'\x22\x20}');return'[\x0a'+_0x3479f9[_0x53943b(0x17a)](',\x0a')+_0x53943b(0xb4);},_0x557033=_0x62cb4[_0x3a6426(0x156)][_0x3a6426(0x1ab)](_0x46846d=>{const _0x479b24=_0x3a6426;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x46846d[_0x479b24(0x1a6)]+_0x479b24(0xff)+_0xecc101(_0x46846d['columns'])['replace'](/^/gm,'\x20\x20')['trim']()+_0x479b24(0x185);})[_0x3a6426(0x17a)](',\x0a');return _0x3a6426(0x6b)+_0x62cb4[_0x3a6426(0x1a3)]+_0x3a6426(0x145)+_0x62cb4['parent_segment']+_0x3a6426(0x85)+_0x62cb4[_0x3a6426(0x1e0)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x62cb4[_0x3a6426(0x1f2)]['table']+_0x3a6426(0x166)+_0xecc101(_0x62cb4[_0x3a6426(0x1f2)][_0x3a6426(0xc6)])[_0x3a6426(0xd9)](/^/gm,'\x20\x20')[_0x3a6426(0x158)]()+_0x3a6426(0x16d)+_0x557033+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a26_0x3ac8d7(0x1be);[a26_0x3ac8d7(0x1a8)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a26_0x3ac8d7(0x176)](_0x5b6662){const _0x3d63f7=a26_0x3ac8d7,{options:_0x35fc2e,args:_0x1369a0,tdx:_0x5c68bf}=_0x5b6662,_0x445b78=_0x1369a0[0x0]||_0x35fc2e[_0x3d63f7(0x159)];if(!_0x445b78)return showParentSegmentNotSetError(_0x3d63f7(0xd3)+_0x3d63f7(0x107)),0x1;_0x35fc2e[_0x3d63f7(0x120)]&&(console[_0x3d63f7(0x128)](_0x3d63f7(0xcc)+_0x35fc2e['site']),console[_0x3d63f7(0x128)](_0x3d63f7(0x1d5)+_0x445b78));const _0x21bb90=await withSpinner(_0x3d63f7(0x154)+_0x445b78+_0x3d63f7(0x190),()=>_0x5c68bf[_0x3d63f7(0x117)]['resolveParentId'](_0x445b78),{'verbose':_0x35fc2e[_0x3d63f7(0x120)]}),_0x8e3edd=_0x21bb90[_0x3d63f7(0x1ca)],_0x3938dc=await withSpinner(_0x3d63f7(0x14a)+_0x445b78+_0x3d63f7(0x190),()=>_0x5c68bf[_0x3d63f7(0x117)][_0x3d63f7(0xaa)](_0x8e3edd),{'verbose':_0x35fc2e[_0x3d63f7(0x120)]}),_0x43efdd=_0x3938dc['data'];return _0x35fc2e['format']==='json'||_0x35fc2e['format']==='jsonl'?await handleSDKOutput([{'sql':_0x43efdd}],_0x35fc2e):console[_0x3d63f7(0x132)](_0x43efdd),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a26_0x3ac8d7(0xe4)]='segment:parent:show';[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0x1da);async[a26_0x3ac8d7(0x176)](_0x5ac5c1){const _0x26d15f=a26_0x3ac8d7,{options:_0x5a32fa,args:_0xca9a3a,tdx:_0x1242cd}=_0x5ac5c1,_0x565f21=_0xca9a3a[0x0]||_0x5a32fa[_0x26d15f(0x159)];if(!_0x565f21)return showParentSegmentNotSetError(_0x26d15f(0x1c5)+_0x26d15f(0x1d9)),0x1;_0x5a32fa[_0x26d15f(0x120)]&&(console[_0x26d15f(0x128)]('Site:\x20'+_0x5a32fa[_0x26d15f(0x74)]),console['error'](_0x26d15f(0x1d5)+_0x565f21));const _0x46cb73=await withSpinner(_0x26d15f(0x154)+_0x565f21+_0x26d15f(0x190),()=>_0x1242cd['segment'][_0x26d15f(0x100)](_0x565f21),{'verbose':_0x5a32fa[_0x26d15f(0x120)]}),_0x5b999e=_0x46cb73[_0x26d15f(0x1ca)],_0x34d7aa=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x565f21+_0x26d15f(0x190),()=>_0x1242cd['segment'][_0x26d15f(0xaa)](_0x5b999e),{'verbose':_0x5a32fa[_0x26d15f(0x120)]});let _0x18360f=_0x34d7aa[_0x26d15f(0x1ca)];const _0x1a0caf=resolveLimit(_0x5a32fa['limit'],DEFAULT_DISPLAY_LIMIT),_0x2eab66=/\bLIMIT\s+\d+/i['test'](_0x18360f);!_0x2eab66&&(_0x18360f=_0x18360f[_0x26d15f(0x158)]()[_0x26d15f(0xd9)](/;+$/,''),_0x18360f=_0x26d15f(0x169)+_0x18360f+_0x26d15f(0x16e)+_0x1a0caf);_0x5a32fa[_0x26d15f(0x120)]&&console['error'](_0x26d15f(0x18f)+_0x18360f);const _0x4e2036=await withProgressSpinner(_0x26d15f(0x1a5),async _0x4e418a=>{const _0xee2b04=_0x26d15f,_0x3cc9d8=await _0x1242cd[_0xee2b04(0x9e)][_0xee2b04(0x176)](_0x18360f,{'catalog':'td','schema':_0xee2b04(0x6a),'onJobId':_0x18e8f0=>{const _0x5a6d34=_0xee2b04;_0x4e418a[_0x5a6d34(0xd8)](_0x18e8f0);}});return _0x3cc9d8;},{'verbose':_0x5a32fa[_0x26d15f(0x120)]}),_0x249b8d=_0x4e2036[_0x26d15f(0x1ca)],_0x1feb41=_0x249b8d[_0x26d15f(0x9b)]?_0x26d15f(0xb1)+_0x249b8d[_0x26d15f(0x9b)]+']':'';return console[_0x26d15f(0x128)](_0x26d15f(0x82)+_0x249b8d['stats'][_0x26d15f(0x79)][_0x26d15f(0xfe)]()+_0x26d15f(0x13a)+(_0x26d15f(0x102)+formatElapsed(_0x249b8d[_0x26d15f(0x89)]['elapsedTimeMillis'])+_0x1feb41)),await handleQueryOutput(_0x249b8d,_0x5a32fa),0x0;}}export class PSRtListCommand extends BaseCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0xe0);[a26_0x3ac8d7(0x1a8)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a26_0x3ac8d7(0x176)](_0x204a42){const _0x25711b=a26_0x3ac8d7,{options:_0x3f9580,args:_0x131b22,tdx:_0x658e2c}=_0x204a42,_0x190fdd=_0x131b22[0x0],_0x33f286=await withSpinner(_0x190fdd?_0x25711b(0x123)+_0x190fdd+'\x27...':'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x658e2c[_0x25711b(0x182)][_0x25711b(0x1b6)](),{'verbose':_0x3f9580[_0x25711b(0x120)]});let _0x5b7465=_0x33f286[_0x25711b(0x1ca)][_0x25711b(0x1ef)](_0x377050=>_0x377050[_0x25711b(0x14d)]);if(_0x190fdd){const _0x17cfe5=_0x190fdd[_0x25711b(0xd9)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x25711b(0xd9)](/\*/g,'.*')[_0x25711b(0xd9)](/\?/g,'.'),_0x4d7a86=new RegExp('^'+_0x17cfe5+'$','i');_0x5b7465=_0x5b7465[_0x25711b(0x1ef)](_0x2ae147=>_0x4d7a86[_0x25711b(0x91)](_0x2ae147[_0x25711b(0xe4)]));}_0x5b7465[_0x25711b(0x18e)]((_0x39422a,_0x49f343)=>_0x39422a[_0x25711b(0xe4)][_0x25711b(0x17b)](_0x49f343[_0x25711b(0xe4)])),console['error'](_0x25711b(0x124)+_0x5b7465[_0x25711b(0x1a2)]+'\x20RT-enabled\x20parent\x20segment'+(_0x5b7465[_0x25711b(0x1a2)]!==0x1?'s':''));const _0x19fa51=_0x458d9f=>{const _0x2df77a=_0x25711b;return getConsoleNextUrl(_0x3f9580['site'],_0x2df77a(0xda)+_0x458d9f);};if(_0x3f9580[_0x25711b(0xbf)]===_0x25711b(0xdc)||_0x3f9580[_0x25711b(0xbf)]==='jsonl'){const _0x310ff9=_0x5b7465[_0x25711b(0x1ab)](_0x2e152c=>({..._0x2e152c,'url':_0x19fa51(_0x2e152c['id'])}));await handleSDKOutput(_0x310ff9,_0x3f9580);}else{if(_0x5b7465[_0x25711b(0x1a2)]===0x0)console[_0x25711b(0x132)](_0x25711b(0x1ba));else for(const _0x305266 of _0x5b7465){const _0x2f5b78=_0x305266[_0x25711b(0x1c9)]?a26_0x1d7dc3[_0x25711b(0x144)]('\x20('+formatRows(_0x305266[_0x25711b(0x1c9)])+')'):'',_0x582de2=hyperlink(_0x305266[_0x25711b(0xe4)],_0x19fa51(_0x305266['id']));console[_0x25711b(0x132)]('⚡\x20'+_0x582de2+_0x2f5b78);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0x1c2);[a26_0x3ac8d7(0x1a8)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a26_0x3ac8d7(0x176)](_0x4a466a){const _0x15b66f=a26_0x3ac8d7,{options:_0x6d86c6,args:_0x1f4b58,tdx:_0x1a78a4}=_0x4a466a,_0x3ae58f=_0x1f4b58[0x0]||_0x6d86c6[_0x15b66f(0x159)];if(!_0x3ae58f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a'+_0x15b66f(0xb8)),0x1;const _0x3a82f2=resolveYamlFile(_0x3ae58f);if(!existsSync(_0x3a82f2))return showFileNotFoundError(_0x3a82f2,_0x3ae58f),0x1;let _0xc427b4;try{_0xc427b4=readFileSync(_0x3a82f2,_0x15b66f(0x103));}catch(_0x4d3c21){const _0x341d0e=_0x4d3c21 instanceof Error?_0x4d3c21[_0x15b66f(0xe2)]:String(_0x4d3c21);return console[_0x15b66f(0x128)]('Error\x20reading\x20file:\x20'+_0x341d0e),0x1;}const _0x433aa0=createCommandSpinner(a26_0x1d7dc3[_0x15b66f(0x144)]('Validating\x20RT\x20configuration...'),{'verbose':_0x6d86c6[_0x15b66f(0x120)]});_0x433aa0[_0x15b66f(0x191)]();const _0x4b9238={'realtime':!![],'onProgress':_0x451359=>{const _0x2d1ed1=_0x15b66f;_0x433aa0[_0x2d1ed1(0xa8)]=formatProgressMessage(_0x451359);}};let _0xa951d9;try{_0xa951d9=await _0x1a78a4[_0x15b66f(0x117)][_0x15b66f(0x12f)](_0xc427b4,_0x4b9238),_0x433aa0['stop']();}catch(_0x1483f2){_0x433aa0['stop']();throw _0x1483f2;}console[_0x15b66f(0x128)]('\x0a'+a26_0x1d7dc3['bold']('RT\x202.0\x20Validate:')+'\x20'+_0xa951d9['name']),console[_0x15b66f(0x128)]('═'[_0x15b66f(0x83)](0x3c)),displayRealtimeValidation(_0xa951d9),console[_0x15b66f(0x128)]('─'[_0x15b66f(0x83)](0x3c));if(_0xa951d9['errors'][_0x15b66f(0x1a2)]>0x0){console[_0x15b66f(0x128)]('\x0a'+a26_0x1d7dc3[_0x15b66f(0x174)](_0x15b66f(0x75)));for(const _0xdd3d55 of _0xa951d9[_0x15b66f(0xc4)]){console[_0x15b66f(0x128)]('\x20\x20'+a26_0x1d7dc3[_0x15b66f(0x174)]('•')+'\x20'+_0xdd3d55);}}return _0xa951d9[_0x15b66f(0x134)]&&console[_0x15b66f(0x128)]('\x0a'+a26_0x1d7dc3[_0x15b66f(0x11a)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0xa951d9['allValid']?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0x1c3);['description']=a26_0x3ac8d7(0xf0);async['execute'](_0xd8407){const _0x5091e5=a26_0x3ac8d7,{options:_0x47ddfd,args:_0x104636,tdx:_0x27a2f5}=_0xd8407,_0x1eacbd=_0x104636[0x0]||_0x47ddfd['parentSegment'];if(!_0x1eacbd)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x5091e5(0x178)),0x1;const _0x226bcb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1eacbd+_0x5091e5(0x190),()=>_0x27a2f5[_0x5091e5(0x117)][_0x5091e5(0x100)](_0x1eacbd),{'verbose':_0x47ddfd[_0x5091e5(0x120)]}),_0x350d2a=_0x226bcb['data'],_0x3a0588=await withSpinner(_0x5091e5(0x1e2)+_0x1eacbd+_0x5091e5(0x190),()=>_0x27a2f5[_0x5091e5(0x1b7)][_0x5091e5(0x1b6)](_0x350d2a),{'verbose':_0x47ddfd[_0x5091e5(0x120)]}),_0x18cfaf=_0x3a0588[_0x5091e5(0x1ca)];console[_0x5091e5(0x128)](_0x5091e5(0x124)+_0x18cfaf['length']+_0x5091e5(0x8c)+(_0x18cfaf[_0x5091e5(0x1a2)]!==0x1?'s':''));if(_0x47ddfd['format']===_0x5091e5(0xdc)||_0x47ddfd['format']===_0x5091e5(0x172))await handleSDKOutput(_0x18cfaf,_0x47ddfd);else{if(_0x18cfaf['length']===0x0)console[_0x5091e5(0x132)](_0x5091e5(0x17f)),console[_0x5091e5(0x128)](a26_0x1d7dc3['cyan']('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x96ac05 of _0x18cfaf){const _0x55fe35=_0x96ac05[_0x5091e5(0xc0)]?.[_0x5091e5(0x1a2)]||0x0,_0x1aa14f=_0x96ac05[_0x5091e5(0x151)]?a26_0x1d7dc3[_0x5091e5(0x144)]('\x20trigger='+_0x96ac05['trigger_event']):'',_0x59b4e4=a26_0x1d7dc3['dim']('\x20('+_0x55fe35+'\x20section'+(_0x55fe35!==0x1?'s':'')+')');console[_0x5091e5(0x132)]('\x20\x20'+_0x96ac05[_0x5091e5(0xe4)]+_0x1aa14f+_0x59b4e4),_0x96ac05[_0x5091e5(0x1a8)]&&console[_0x5091e5(0x132)](_0x5091e5(0x188)+a26_0x1d7dc3[_0x5091e5(0x144)](_0x96ac05[_0x5091e5(0x1a8)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a26_0x3ac8d7(0xe4)]=a26_0x3ac8d7(0x19f);[a26_0x3ac8d7(0x1a8)]=a26_0x3ac8d7(0xb9);async[a26_0x3ac8d7(0x176)](_0x46fb33){const _0x2a3846=a26_0x3ac8d7,{options:_0x2e1a9f,args:_0x3015f2}=_0x46fb33,_0x38cde2=_0x3015f2[0x0]||_0x2e1a9f[_0x2a3846(0x159)];if(!_0x38cde2)return showParentSegmentNotSetError(_0x2a3846(0xd4)+_0x2a3846(0x7d)),0x1;const _0x534026=resolveYamlFile(_0x38cde2);if(!existsSync(_0x534026))return showFileNotFoundError(_0x534026,_0x38cde2),0x1;let _0x403f97;try{_0x403f97=readFileSync(_0x534026,'utf-8');}catch(_0x8b8cf0){const _0x309f56=_0x8b8cf0 instanceof Error?_0x8b8cf0[_0x2a3846(0xe2)]:String(_0x8b8cf0);return console[_0x2a3846(0x128)](_0x2a3846(0x130)+_0x309f56),0x1;}let _0x4a722c;try{_0x4a722c=parseDef(_0x403f97);}catch(_0x2fcdbf){const _0x2817bd=_0x2fcdbf instanceof Error?_0x2fcdbf['message']:String(_0x2fcdbf);return console['error'](a26_0x1d7dc3['red'](_0x2a3846(0xca)+_0x2817bd)),0x1;}if(_0x4a722c[_0x2a3846(0xbb)]&&_0x4a722c[_0x2a3846(0xbb)]['length']>0x0)return console[_0x2a3846(0x128)](a26_0x1d7dc3['yellow'](_0x2a3846(0x78)+_0x534026)),console[_0x2a3846(0x128)](a26_0x1d7dc3[_0x2a3846(0x144)](_0x2a3846(0x12b)+_0x4a722c[_0x2a3846(0xbb)][_0x2a3846(0x1a2)]+'\x20service(s)\x20configured')),0x1;!_0x4a722c[_0x2a3846(0x182)]&&(_0x4a722c['realtime']={'events':[{'name':'page_view','source_table':_0x2a3846(0xc1)}],'attributes':[{'name':_0x2a3846(0x119),'type':_0x2a3846(0x1f0)}],'id_stitching':{'primary_key':_0x4a722c[_0x2a3846(0x81)][_0x2a3846(0x1a6)]===_0x2a3846(0x1f2)?_0x2a3846(0x1eb):_0x2a3846(0x1a4)}});_0x4a722c['personalization_services']=[{'name':_0x2a3846(0x138),'description':_0x2a3846(0x15f),'trigger_event':'page_view','sections':[{'name':'Default','criteria':_0x2a3846(0xa2),'attributes':[_0x2a3846(0x119)]}]}];const _0x4ed687=serializeDef(_0x4a722c);return writeFileSync(_0x534026,_0x4ed687,_0x2a3846(0x103)),console[_0x2a3846(0x128)](a26_0x1d7dc3[_0x2a3846(0x11a)]('✔')+_0x2a3846(0x187)+a26_0x1d7dc3[_0x2a3846(0x16b)](_0x534026)),(!_0x4a722c[_0x2a3846(0x182)]||_0x403f97['indexOf'](_0x2a3846(0x73))===-0x1)&&console[_0x2a3846(0x128)](a26_0x1d7dc3[_0x2a3846(0x11a)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x2a3846(0x128)]('\x0a'+a26_0x1d7dc3['dim'](_0x2a3846(0x12c))),console[_0x2a3846(0x128)](_0x2a3846(0xea)+_0x534026+_0x2a3846(0xa4)),console[_0x2a3846(0x128)](_0x2a3846(0xa6)+a26_0x1d7dc3[_0x2a3846(0x144)](_0x2a3846(0x167)+_0x38cde2)+_0x2a3846(0x143)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a23_0x4e7f(){const _0x36fc1f=['Unknown\x20key\x20\x27','2034840DcHHno','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','tdx:\x20profile\x20remove','Default\x20profile\x20set\x20to:\x20','Validating\x20API\x20key...','validate','profile:create','confirm','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','\x0aSaved\x20to:\x20','join','length','Enter\x20description\x20(optional):','/app/mp/ak','jobs','\x27\x20does\x20not\x20exist.\x20Create\x20it?','VALID_KEYS','profile:use','name','us01','2591372Tytzoq','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','database','message','green','\x20\x20(no\x20profiles\x20found)','site','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','49955420aIckES','profileName','\x27\x20does\x20not\x20exist.','config','dim','getUserInfo','27486ZndJHN','Removal\x20cancelled','6AyqbKS','\x0aAvailable\x20profiles:','apiKey','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','llm_project','red','2768VrtNkf','tdx.json','split','logLevel','default','Failed\x20to\x20remove\x20profile:\x20','trim','yellow','log','Site\x20was\x20not\x20changed.','API\x20key\x20cannot\x20be\x20empty','status','customSite','bold','(session:\x20','Remove\x20a\x20profile','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','Operation\x20cancelled','\x0aSetup\x20cancelled','\x27\x20created','profile','Profile\x20\x27','llm_agent','1qjqyyM','\x27.\x0a\x0aValid\x20keys:\x20','password','Session\x20profile\x20set\x20to:\x20','parent_segment','other','profile:set','Profile\x20name\x20cannot\x20be\x20empty','967629cUwUxz','Create\x20a\x20new\x20profile','3773568EoLKKq','\x27\x20updated:\x20','\x20\x20tdx\x20--profile\x20','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','test','create','description','\x20--default\x27\x20to\x20save\x20permanently','text','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','ERROR','email','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','profile:remove','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','You\x20can\x20find\x20your\x20API\x20key\x20at:','select','error','\x20API\x20key\x20removed\x20from\x20system\x20keychain','3607945VmFrrR','warn','\x27\x20removed\x20from\x20configuration','\x27\x20requires\x20API\x20key\x20validation.','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','\x20Profile\x20\x27','session','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','tdx:\x20profile\x20create','Enter\x20your\x20TD\x20API\x20key:','Enter\x20profile\x20name:','includes','execute','✗\x20Validation\x20failed:\x20'];a23_0x4e7f=function(){return _0x36fc1f;};return a23_0x4e7f();}const a23_0x22f566=a23_0x250d;(function(_0x66658c,_0x9ece3c){const _0x23e371=a23_0x250d,_0x5103ff=_0x66658c();while(!![]){try{const _0x425304=-parseInt(_0x23e371(0x13c))/0x1*(parseInt(_0x23e371(0x16a))/0x2)+-parseInt(_0x23e371(0x144))/0x3+-parseInt(_0x23e371(0x146))/0x4+parseInt(_0x23e371(0x159))/0x5*(-parseInt(_0x23e371(0x11e))/0x6)+-parseInt(_0x23e371(0x17e))/0x7+parseInt(_0x23e371(0x125))/0x8*(-parseInt(_0x23e371(0x11c))/0x9)+parseInt(_0x23e371(0x186))/0xa;if(_0x425304===_0x9ece3c)break;else _0x5103ff['push'](_0x5103ff['shift']());}catch(_0x4950e4){_0x5103ff['push'](_0x5103ff['shift']());}}}(a23_0x4e7f,0x89a06));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';function a23_0x250d(_0x1777c4,_0x220d40){_0x1777c4=_0x1777c4-0x118;const _0x4e7f78=a23_0x4e7f();let _0x250df2=_0x4e7f78[_0x1777c4];return _0x250df2;}import{getConfigDir}from'../core/config.js';import*as a23_0x29375f from'node:path';import{saveSessionContext,getSessionID,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{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a23_0x40b577 from'prompts';import a23_0x36263b from'chalk';function validateProfileName(_0x5c7af1){const _0x50f779=a23_0x250d;if(!_0x5c7af1||!_0x5c7af1[_0x50f779(0x12b)]())return _0x50f779(0x143);const _0x4c5b05=_0x5c7af1[_0x50f779(0x12b)]();if(!/^[a-zA-Z0-9_-]+$/[_0x50f779(0x14a)](_0x4c5b05))return _0x50f779(0x15d);if(profileExists(_0x4c5b05))return _0x50f779(0x13a)+_0x4c5b05+_0x50f779(0x154);return!![];}export class ProfileCreateCommand extends BaseCommand{['name']=a23_0x22f566(0x170);[a23_0x22f566(0x14c)]=a23_0x22f566(0x145);async[a23_0x22f566(0x167)](_0x36e968){const _0x228d30=a23_0x22f566,{options:_0x378376,args:_0x1860e7}=_0x36e968;console[_0x228d30(0x12d)](a23_0x36263b['bold'](_0x228d30(0x163)));let _0x102c36;if(_0x1860e7['length']>0x0&&_0x1860e7[0x0]){const _0x44f671=_0x1860e7[0x0][_0x228d30(0x12b)](),_0x2e49b7=validateProfileName(_0x44f671);if(_0x2e49b7!==!![])return console[_0x228d30(0x157)](a23_0x36263b[_0x228d30(0x124)](_0x2e49b7)),0x1;_0x102c36=_0x44f671;}else{const _0x5ace13=await a23_0x40b577({'type':'text','name':_0x228d30(0x187),'message':_0x228d30(0x165),'validate':validateProfileName});if(!_0x5ace13[_0x228d30(0x187)])return console['log'](_0x228d30(0x137)),0x1;_0x102c36=_0x5ace13[_0x228d30(0x187)][_0x228d30(0x12b)]();}const _0xab9423=await a23_0x40b577({'type':'text','name':_0x228d30(0x14c),'message':_0x228d30(0x176)}),_0x397745=_0xab9423['description']?.[_0x228d30(0x12b)]()||undefined,_0x16ea12=_0x378376[_0x228d30(0x184)]||_0x228d30(0x17d),{choices:_0x1a765a,initialIndex:_0x53e769}=buildSiteChoices(_0x16ea12),_0x37a10e=await a23_0x40b577({'type':_0x228d30(0x156),'name':_0x228d30(0x184),'message':_0x228d30(0x162)+_0x102c36+'\x27:','choices':_0x1a765a,'initial':_0x53e769});if(!_0x37a10e[_0x228d30(0x184)])return console[_0x228d30(0x12d)](_0x228d30(0x137)),0x1;let _0x33a7bf;if(_0x37a10e[_0x228d30(0x184)]===_0x228d30(0x141)){const _0x1dbea1=await a23_0x40b577({'type':_0x228d30(0x14e),'name':'customSite','message':'Enter\x20site\x20name:','initial':_0x228d30(0x17d),'validate':_0x130681=>{const _0x330839=_0x228d30;if(!_0x130681||!_0x130681[_0x330839(0x12b)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0x130681[_0x330839(0x12b)]()))return _0x330839(0x16b);return!![];}});if(!_0x1dbea1[_0x228d30(0x131)])return console[_0x228d30(0x12d)]('\x0aSetup\x20cancelled'),0x1;_0x33a7bf=_0x1dbea1['customSite'];}else _0x33a7bf=_0x37a10e[_0x228d30(0x184)];const _0x5e87be=resolveSite(_0x33a7bf);console[_0x228d30(0x12d)](_0x228d30(0x149)+_0x5e87be),console[_0x228d30(0x12d)](_0x228d30(0x155)),console[_0x228d30(0x12d)]('\x20\x20'+getConsoleUrl(_0x5e87be,_0x228d30(0x177)));const _0x54f600=await a23_0x40b577({'type':_0x228d30(0x13e),'name':_0x228d30(0x120),'message':_0x228d30(0x164),'validate':_0x17690d=>{const _0x39c9fb=_0x228d30;if(!_0x17690d||!_0x17690d[_0x39c9fb(0x12b)]())return _0x39c9fb(0x12f);return!![];}});if(!_0x54f600[_0x228d30(0x120)])return console['log'](_0x228d30(0x137)),0x1;const _0x5a4703=_0x54f600[_0x228d30(0x120)];console[_0x228d30(0x12d)](_0x228d30(0x16e));try{const _0x322679=TDX[_0x228d30(0x14b)]({'site':_0x5e87be,'apiKey':_0x5a4703[_0x228d30(0x12b)](),'logLevel':_0x378376[_0x228d30(0x128)]??LogLevel[_0x228d30(0x150)]}),_0x56d7e4=await _0x322679[_0x228d30(0x178)][_0x228d30(0x11b)]();console[_0x228d30(0x12d)](a23_0x36263b[_0x228d30(0x182)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x56d7e4[_0x228d30(0x151)]+')');const _0x6f3894=await isKeychainAvailable();_0x6f3894?(await saveAPIKeyAsync(_0x5a4703['trim'](),_0x5e87be,_0x102c36),console[_0x228d30(0x12d)](a23_0x36263b[_0x228d30(0x182)]('✓')+_0x228d30(0x185)+_0x102c36+')')):(console['warn'](a23_0x36263b[_0x228d30(0x12c)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x228d30(0x15a)](a23_0x36263b['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x4e0291={'site':_0x5e87be,..._0x397745&&{'description':_0x397745}};return saveProfileToUserConfig(_0x102c36,_0x4e0291),console[_0x228d30(0x12d)](a23_0x36263b['green']('✓')+_0x228d30(0x15e)+_0x102c36+_0x228d30(0x138)),console[_0x228d30(0x12d)](),console[_0x228d30(0x12d)](_0x228d30(0x122)),console[_0x228d30(0x12d)](_0x228d30(0x148)+_0x102c36+_0x228d30(0x160)),console[_0x228d30(0x12d)](_0x228d30(0x148)+_0x102c36+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2de764){if(_0x2de764 instanceof HTTPClientError&&_0x2de764[_0x228d30(0x130)]===0x191)return printAuthError(_0x2de764),0x1;return console['error'](a23_0x36263b[_0x228d30(0x124)](_0x228d30(0x168)+(_0x2de764 instanceof Error?_0x2de764[_0x228d30(0x181)]:String(_0x2de764)))),console['error'](_0x228d30(0x161)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{['name']=a23_0x22f566(0x153);['description']=a23_0x22f566(0x134);['validate'](_0x42b603){const _0x5eb0a7=a23_0x22f566,{args:_0x32acb9}=_0x42b603;if(_0x32acb9[_0x5eb0a7(0x175)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>';return undefined;}async[a23_0x22f566(0x167)](_0x17ded9){const _0x240ca3=a23_0x22f566,{args:_0x15b20a}=_0x17ded9,_0x44302c=_0x15b20a[0x0];console[_0x240ca3(0x12d)](a23_0x36263b[_0x240ca3(0x132)](_0x240ca3(0x16c)));if(!profileExists(_0x44302c)){console['error'](a23_0x36263b['red'](_0x240ca3(0x13a)+_0x44302c+'\x27\x20does\x20not\x20exist.')),console[_0x240ca3(0x12d)](_0x240ca3(0x11f));const _0x5844c6=listProfiles();if(_0x5844c6[_0x240ca3(0x175)]===0x0)console[_0x240ca3(0x12d)](_0x240ca3(0x183));else for(const _0x3e5ac5 of _0x5844c6){console[_0x240ca3(0x12d)]('\x20\x20-\x20'+_0x3e5ac5[_0x240ca3(0x17c)]);}return 0x1;}const _0x5eda82=await a23_0x40b577({'type':'confirm','name':_0x240ca3(0x171),'message':_0x240ca3(0x121)+_0x44302c+'\x27?','initial':![]});if(!_0x5eda82[_0x240ca3(0x171)])return console[_0x240ca3(0x12d)](_0x240ca3(0x11d)),0x0;try{removeProfileFromUserConfig(_0x44302c),console[_0x240ca3(0x12d)](a23_0x36263b[_0x240ca3(0x182)]('✓')+'\x20Profile\x20\x27'+_0x44302c+_0x240ca3(0x15b));}catch(_0x142bb5){return console['error'](a23_0x36263b[_0x240ca3(0x124)](_0x240ca3(0x12a)+(_0x142bb5 instanceof Error?_0x142bb5['message']:String(_0x142bb5)))),0x1;}const _0x435a7d=await isKeychainAvailable();if(_0x435a7d){const _0x7af2ba=await deleteKeychainAPIKey(_0x44302c);_0x7af2ba&&console[_0x240ca3(0x12d)](a23_0x36263b[_0x240ca3(0x182)]('✓')+_0x240ca3(0x158));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a23_0x22f566(0x17c)]=a23_0x22f566(0x142);[a23_0x22f566(0x14c)]='Set\x20a\x20profile\x20configuration\x20value';static [a23_0x22f566(0x17a)]=[a23_0x22f566(0x184),a23_0x22f566(0x180),a23_0x22f566(0x140),a23_0x22f566(0x123),a23_0x22f566(0x13b),a23_0x22f566(0x14c)];[a23_0x22f566(0x16f)](_0x1b0871){const _0x51020b=a23_0x22f566,{args:_0x1b29f0,options:_0x263fda}=_0x1b0871,_0x88f629=_0x263fda[_0x51020b(0x139)]||getActiveProfile();if(!_0x88f629)return'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>';if(_0x1b29f0[_0x51020b(0x175)]===0x0)return _0x51020b(0x14f)+ProfileSetCommand[_0x51020b(0x17a)][_0x51020b(0x174)](',\x20');const _0x3c15e9=_0x1b29f0[0x0];if(!_0x3c15e9[_0x51020b(0x166)]('='))return _0x51020b(0x17f)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');const [_0x21928f]=_0x3c15e9[_0x51020b(0x127)]('=',0x2);if(!ProfileSetCommand['VALID_KEYS'][_0x51020b(0x166)](_0x21928f))return _0x51020b(0x169)+_0x21928f+_0x51020b(0x13d)+ProfileSetCommand[_0x51020b(0x17a)][_0x51020b(0x174)](',\x20');return undefined;}async['execute'](_0x5be231){const _0x476c48=a23_0x22f566,{args:_0x4bc5da,options:_0x2a3916}=_0x5be231,_0x3fae83=_0x2a3916[_0x476c48(0x139)]||getActiveProfile(),[_0xcae45b,..._0x25c424]=_0x4bc5da[0x0][_0x476c48(0x127)]('='),_0x3393cd=_0x25c424[_0x476c48(0x174)]('=');console['log'](a23_0x36263b[_0x476c48(0x132)]('tdx:\x20profile\x20set'));if(!profileExists(_0x3fae83)){const _0x337e51=await a23_0x40b577({'type':_0x476c48(0x171),'name':'create','message':_0x476c48(0x13a)+_0x3fae83+_0x476c48(0x179),'initial':!![]});if(!_0x337e51[_0x476c48(0x14b)])return console['log'](_0x476c48(0x136)),0x1;}const _0x214499=loadProfile(_0x3fae83),_0x2a4e46=_0x214499?.[_0x476c48(0x119)]||{};if(_0xcae45b==='site'){const _0x27997c=resolveSite(_0x3393cd);console[_0x476c48(0x12d)]('Changing\x20site\x20to\x20\x27'+_0x27997c+_0x476c48(0x15c)),console[_0x476c48(0x12d)]('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x476c48(0x12d)]('\x20\x20'+getConsoleUrl(_0x27997c,_0x476c48(0x177)));const _0x4f6d72=await a23_0x40b577({'type':_0x476c48(0x13e),'name':_0x476c48(0x120),'message':_0x476c48(0x172),'validate':_0x1a3f49=>{const _0x244b50=_0x476c48;if(!_0x1a3f49||!_0x1a3f49[_0x244b50(0x12b)]())return _0x244b50(0x12f);return!![];}});if(!_0x4f6d72[_0x476c48(0x120)])return console[_0x476c48(0x12d)]('\x0aOperation\x20cancelled'),0x1;console[_0x476c48(0x12d)]('Validating\x20API\x20key...');try{const _0x546738=TDX[_0x476c48(0x14b)]({'site':_0x27997c,'apiKey':_0x4f6d72[_0x476c48(0x120)][_0x476c48(0x12b)](),'logLevel':_0x2a3916[_0x476c48(0x128)]??LogLevel[_0x476c48(0x150)]}),_0x4c4739=await _0x546738[_0x476c48(0x178)][_0x476c48(0x11b)]();console[_0x476c48(0x12d)](a23_0x36263b[_0x476c48(0x182)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x4c4739[_0x476c48(0x151)]+')');const _0x10ea23=await isKeychainAvailable();_0x10ea23?(await saveAPIKeyAsync(_0x4f6d72[_0x476c48(0x120)]['trim'](),_0x27997c,_0x3fae83),console[_0x476c48(0x12d)](a23_0x36263b[_0x476c48(0x182)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console['warn'](a23_0x36263b[_0x476c48(0x12c)](_0x476c48(0x152))),_0x2a4e46['site']=_0x27997c;}catch(_0x380f45){if(_0x380f45 instanceof HTTPClientError&&_0x380f45['status']===0x191)return printAuthError(_0x380f45),0x1;return console[_0x476c48(0x157)](a23_0x36263b[_0x476c48(0x124)](_0x476c48(0x168)+(_0x380f45 instanceof Error?_0x380f45['message']:String(_0x380f45)))),console[_0x476c48(0x157)](_0x476c48(0x12e)),0x1;}}else _0x2a4e46[_0xcae45b]=_0x3393cd||undefined;return saveProfileToUserConfig(_0x3fae83,_0x2a4e46),console['log'](a23_0x36263b[_0x476c48(0x182)]('✓')+_0x476c48(0x15e)+_0x3fae83+_0x476c48(0x147)+_0xcae45b+'='+(_0x3393cd||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a23_0x22f566(0x17b);['description']='Set\x20session\x20profile';['validate'](_0xf36bf3){const _0x4c1d66=a23_0x22f566,{args:_0x8f3c3b}=_0xf36bf3;if(_0x8f3c3b[_0x4c1d66(0x175)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async[a23_0x22f566(0x167)](_0x1fb359){const _0x2d3e6a=a23_0x22f566,{args:_0x1af297,options:_0x281e12}=_0x1fb359,_0x4ae6bf=_0x1af297[0x0],_0x129650=_0x281e12[_0x2d3e6a(0x129)];cleanExpiredSessions();if(!profileExists(_0x4ae6bf)){console['error'](a23_0x36263b[_0x2d3e6a(0x124)](_0x2d3e6a(0x13a)+_0x4ae6bf+_0x2d3e6a(0x118))),console[_0x2d3e6a(0x12d)]('\x0aAvailable\x20profiles:');const _0x69726d=listProfiles();if(_0x69726d[_0x2d3e6a(0x175)]===0x0)console[_0x2d3e6a(0x12d)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x40fe61 of _0x69726d){console['log']('\x20\x20-\x20'+_0x40fe61[_0x2d3e6a(0x17c)]);}return 0x1;}if(_0x129650){const _0x4b2ef9=a23_0x29375f[_0x2d3e6a(0x174)](getConfigDir(),_0x2d3e6a(0x126));return saveActiveProfileToUserConfig(_0x4ae6bf),console['log'](_0x2d3e6a(0x16d)+a23_0x36263b[_0x2d3e6a(0x182)](_0x4ae6bf)),console[_0x2d3e6a(0x12d)](a23_0x36263b[_0x2d3e6a(0x11a)](_0x2d3e6a(0x173)+_0x4b2ef9)),0x0;}const _0x3811af=getSessionID(_0x281e12[_0x2d3e6a(0x15f)]);return saveSessionContext({'profile':_0x4ae6bf},_0x281e12[_0x2d3e6a(0x15f)]),console[_0x2d3e6a(0x12d)](_0x2d3e6a(0x13f)+a23_0x36263b['green'](_0x4ae6bf)+'\x20'+a23_0x36263b[_0x2d3e6a(0x11a)](_0x2d3e6a(0x133)+_0x3811af+')')),console[_0x2d3e6a(0x12d)](a23_0x36263b[_0x2d3e6a(0x11a)](_0x2d3e6a(0x135)+_0x4ae6bf+_0x2d3e6a(0x14d))),0x0;}}
|
|
1
|
+
const a27_0x747183=a27_0x54d0;(function(_0xcdfa78,_0x28b3f0){const _0x394df7=a27_0x54d0,_0x33a575=_0xcdfa78();while(!![]){try{const _0x1b7351=parseInt(_0x394df7(0x11d))/0x1*(-parseInt(_0x394df7(0xcb))/0x2)+parseInt(_0x394df7(0xf0))/0x3*(parseInt(_0x394df7(0xdd))/0x4)+-parseInt(_0x394df7(0x12c))/0x5*(-parseInt(_0x394df7(0x132))/0x6)+-parseInt(_0x394df7(0x125))/0x7*(parseInt(_0x394df7(0xd5))/0x8)+parseInt(_0x394df7(0x127))/0x9+-parseInt(_0x394df7(0xe0))/0xa+parseInt(_0x394df7(0x12f))/0xb;if(_0x1b7351===_0x28b3f0)break;else _0x33a575['push'](_0x33a575['shift']());}catch(_0x344ffb){_0x33a575['push'](_0x33a575['shift']());}}}(a27_0x12fb,0x45312));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a27_0x5adadd from'node:path';import{saveSessionContext,getSessionID,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{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a27_0x12fb(){const _0x11372d=['VALID_KEYS','\x0aSaved\x20to:\x20','logLevel','log','Profile\x20\x27','(cleared)','llm_agent','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','\x27\x20created','profileName','profile:use','site','profile:set','warn','tdx:\x20profile\x20remove','ERROR','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Enter\x20your\x20TD\x20API\x20key:','\x0aAvailable\x20profiles:','other','tdx:\x20profile\x20create','Profile\x20name\x20cannot\x20be\x20empty','us01','profile','Validating\x20API\x20key...','test','Site\x20was\x20not\x20changed.','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Remove\x20a\x20profile','\x27\x20updated:\x20','database','config','yellow','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','session','split','Default\x20profile\x20set\x20to:\x20','default','length','1gGrLzi','message','tdx.json','profile:remove','\x20\x20tdx\x20--profile\x20','error','join','\x20--default\x27\x20to\x20save\x20permanently','770LADgUl','\x20API\x20key\x20removed\x20from\x20system\x20keychain','1286973dhbrpk','email','dim','password','Enter\x20site\x20name:','2521555hNQBVg','✗\x20Validation\x20failed:\x20','bold','8275740tXvbIs','(session:\x20','getUserInfo','6pXKHBQ','description','jobs','\x27\x20does\x20not\x20exist.','Enter\x20profile\x20name:','Enter\x20description\x20(optional):','execute','Removal\x20cancelled','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','Set\x20session\x20profile','1027282fjrVJn','select','validate','confirm','customSite','\x20\x20-\x20','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','parent_segment','trim','apiKey','27128dCbPUO','includes','create','API\x20key\x20cannot\x20be\x20empty','Site\x20name\x20cannot\x20be\x20empty','Create\x20a\x20new\x20profile','green','red','169900kreXQK','\x20API\x20key\x20is\x20valid\x20(User:\x20','Operation\x20cancelled','2720620TsYkmB','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>','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','name','You\x20can\x20find\x20your\x20API\x20key\x20at:','status','Set\x20a\x20profile\x20configuration\x20value','Session\x20profile\x20set\x20to:\x20','\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x27.\x0a\x0aValid\x20keys:\x20','Changing\x20site\x20to\x20\x27','\x0aSetup\x20cancelled','\x27\x20does\x20not\x20exist.\x20Create\x20it?','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','text','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','3curyiI','\x20Profile\x20\x27','\x0aOperation\x20cancelled','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.'];a27_0x12fb=function(){return _0x11372d;};return a27_0x12fb();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a27_0x4f27d6 from'prompts';import a27_0x4a390e from'chalk';function validateProfileName(_0x42ba0c){const _0x173abe=a27_0x54d0;if(!_0x42ba0c||!_0x42ba0c['trim']())return _0x173abe(0x10b);const _0x484e7c=_0x42ba0c[_0x173abe(0xd3)]();if(!/^[a-zA-Z0-9_-]+$/[_0x173abe(0x10f)](_0x484e7c))return'Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore';if(profileExists(_0x484e7c))return'Profile\x20\x27'+_0x484e7c+_0x173abe(0xf3);return!![];}export class ProfileCreateCommand extends BaseCommand{['name']='profile:create';['description']=a27_0x747183(0xda);async[a27_0x747183(0xc4)](_0x39a2e7){const _0x496bef=a27_0x747183,{options:_0x1d19f6,args:_0x55da2e}=_0x39a2e7;console[_0x496bef(0xf7)](a27_0x4a390e[_0x496bef(0x12e)](_0x496bef(0x10a)));let _0x5602c6;if(_0x55da2e['length']>0x0&&_0x55da2e[0x0]){const _0x4b0364=_0x55da2e[0x0][_0x496bef(0xd3)](),_0x2a5d50=validateProfileName(_0x4b0364);if(_0x2a5d50!==!![])return console[_0x496bef(0x122)](a27_0x4a390e[_0x496bef(0xdc)](_0x2a5d50)),0x1;_0x5602c6=_0x4b0364;}else{const _0x528bac=await a27_0x4f27d6({'type':_0x496bef(0xee),'name':_0x496bef(0xfd),'message':_0x496bef(0xc2),'validate':validateProfileName});if(!_0x528bac[_0x496bef(0xfd)])return console['log'](_0x496bef(0xeb)),0x1;_0x5602c6=_0x528bac[_0x496bef(0xfd)][_0x496bef(0xd3)]();}const _0x564c14=await a27_0x4f27d6({'type':'text','name':_0x496bef(0x133),'message':_0x496bef(0xc3)}),_0x40c34b=_0x564c14[_0x496bef(0x133)]?.[_0x496bef(0xd3)]()||undefined,_0x2654ed=_0x1d19f6[_0x496bef(0xff)]||_0x496bef(0x10c),{choices:_0x66c940,initialIndex:_0x28ab86}=buildSiteChoices(_0x2654ed),_0x30b292=await a27_0x4f27d6({'type':_0x496bef(0xcc),'name':_0x496bef(0xff),'message':_0x496bef(0xc9)+_0x5602c6+'\x27:','choices':_0x66c940,'initial':_0x28ab86});if(!_0x30b292['site'])return console[_0x496bef(0xf7)](_0x496bef(0xeb)),0x1;let _0xb5c18d;if(_0x30b292[_0x496bef(0xff)]===_0x496bef(0x109)){const _0x22d2b5=await a27_0x4f27d6({'type':'text','name':_0x496bef(0xcf),'message':_0x496bef(0x12b),'initial':_0x496bef(0x10c),'validate':_0xde29f2=>{const _0x2e2e21=_0x496bef;if(!_0xde29f2||!_0xde29f2[_0x2e2e21(0xd3)]())return _0x2e2e21(0xd9);if(!/^[a-z0-9-]+$/[_0x2e2e21(0x10f)](_0xde29f2[_0x2e2e21(0xd3)]()))return _0x2e2e21(0xc6);return!![];}});if(!_0x22d2b5['customSite'])return console[_0x496bef(0xf7)]('\x0aSetup\x20cancelled'),0x1;_0xb5c18d=_0x22d2b5[_0x496bef(0xcf)];}else _0xb5c18d=_0x30b292[_0x496bef(0xff)];const _0x581ae1=resolveSite(_0xb5c18d);console[_0x496bef(0xf7)](_0x496bef(0x111)+_0x581ae1),console[_0x496bef(0xf7)](_0x496bef(0xe4)),console[_0x496bef(0xf7)]('\x20\x20'+getConsoleUrl(_0x581ae1,'/app/mp/ak'));const _0x19a816=await a27_0x4f27d6({'type':_0x496bef(0x12a),'name':'apiKey','message':_0x496bef(0x107),'validate':_0x3b3b68=>{const _0x723eb0=_0x496bef;if(!_0x3b3b68||!_0x3b3b68[_0x723eb0(0xd3)]())return _0x723eb0(0xd8);return!![];}});if(!_0x19a816[_0x496bef(0xd4)])return console['log'](_0x496bef(0xeb)),0x1;const _0x39fd7f=_0x19a816[_0x496bef(0xd4)];console[_0x496bef(0xf7)]('Validating\x20API\x20key...');try{const _0xc3f0cc=TDX[_0x496bef(0xd7)]({'site':_0x581ae1,'apiKey':_0x39fd7f[_0x496bef(0xd3)](),'logLevel':_0x1d19f6[_0x496bef(0xf6)]??LogLevel[_0x496bef(0x103)]}),_0x519ad7=await _0xc3f0cc[_0x496bef(0x134)][_0x496bef(0x131)]();console[_0x496bef(0xf7)](a27_0x4a390e[_0x496bef(0xdb)]('✓')+_0x496bef(0xde)+_0x519ad7[_0x496bef(0x128)]+')');const _0x1ac9d5=await isKeychainAvailable();_0x1ac9d5?(await saveAPIKeyAsync(_0x39fd7f['trim'](),_0x581ae1,_0x5602c6),console[_0x496bef(0xf7)](a27_0x4a390e[_0x496bef(0xdb)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x5602c6+')')):(console[_0x496bef(0x101)](a27_0x4a390e[_0x496bef(0x116)](_0x496bef(0xe2))),console[_0x496bef(0x101)](a27_0x4a390e[_0x496bef(0x116)](_0x496bef(0x105))));const _0x208f84={'site':_0x581ae1,..._0x40c34b&&{'description':_0x40c34b}};return saveProfileToUserConfig(_0x5602c6,_0x208f84),console[_0x496bef(0xf7)](a27_0x4a390e[_0x496bef(0xdb)]('✓')+'\x20Profile\x20\x27'+_0x5602c6+_0x496bef(0xfc)),console[_0x496bef(0xf7)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console['log'](_0x496bef(0x121)+_0x5602c6+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log']('\x20\x20tdx\x20--profile\x20'+_0x5602c6+_0x496bef(0xed)),0x0;}catch(_0x332acf){if(_0x332acf instanceof HTTPClientError&&_0x332acf['status']===0x191)return printAuthError(_0x332acf),0x1;return console[_0x496bef(0x122)](a27_0x4a390e[_0x496bef(0xdc)](_0x496bef(0x12d)+(_0x332acf instanceof Error?_0x332acf[_0x496bef(0x11e)]:String(_0x332acf)))),console[_0x496bef(0x122)](_0x496bef(0x104)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a27_0x747183(0xe3)]=a27_0x747183(0x120);[a27_0x747183(0x133)]=a27_0x747183(0x112);[a27_0x747183(0xcd)](_0x5dcb28){const _0x153a04=a27_0x747183,{args:_0x5d178c}=_0x5dcb28;if(_0x5d178c['length']===0x0)return _0x153a04(0xc8);return undefined;}async[a27_0x747183(0xc4)](_0x48ea48){const _0x22d539=a27_0x747183,{args:_0x2946c0}=_0x48ea48,_0x36a331=_0x2946c0[0x0];console[_0x22d539(0xf7)](a27_0x4a390e[_0x22d539(0x12e)](_0x22d539(0x102)));if(!profileExists(_0x36a331)){console[_0x22d539(0x122)](a27_0x4a390e[_0x22d539(0xdc)](_0x22d539(0xf8)+_0x36a331+'\x27\x20does\x20not\x20exist.')),console['log'](_0x22d539(0x108));const _0x26bbb8=listProfiles();if(_0x26bbb8['length']===0x0)console[_0x22d539(0xf7)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x182225 of _0x26bbb8){console[_0x22d539(0xf7)](_0x22d539(0xd0)+_0x182225[_0x22d539(0xe3)]);}return 0x1;}const _0x25a93c=await a27_0x4f27d6({'type':_0x22d539(0xce),'name':_0x22d539(0xce),'message':_0x22d539(0xc7)+_0x36a331+'\x27?','initial':![]});if(!_0x25a93c['confirm'])return console[_0x22d539(0xf7)](_0x22d539(0xc5)),0x0;try{removeProfileFromUserConfig(_0x36a331),console[_0x22d539(0xf7)](a27_0x4a390e['green']('✓')+_0x22d539(0xf1)+_0x36a331+'\x27\x20removed\x20from\x20configuration');}catch(_0x22f5b2){return console[_0x22d539(0x122)](a27_0x4a390e['red']('Failed\x20to\x20remove\x20profile:\x20'+(_0x22f5b2 instanceof Error?_0x22f5b2[_0x22d539(0x11e)]:String(_0x22f5b2)))),0x1;}const _0x5e719b=await isKeychainAvailable();if(_0x5e719b){const _0x466b5d=await deleteKeychainAPIKey(_0x36a331);_0x466b5d&&console[_0x22d539(0xf7)](a27_0x4a390e[_0x22d539(0xdb)]('✓')+_0x22d539(0x126));}return 0x0;}}function a27_0x54d0(_0x43a8af,_0x35d193){_0x43a8af=_0x43a8af-0xc2;const _0x12fb14=a27_0x12fb();let _0x54d0a3=_0x12fb14[_0x43a8af];return _0x54d0a3;}export class ProfileSetCommand extends BaseCommand{[a27_0x747183(0xe3)]=a27_0x747183(0x100);[a27_0x747183(0x133)]=a27_0x747183(0xe6);static [a27_0x747183(0xf4)]=[a27_0x747183(0xff),a27_0x747183(0x114),a27_0x747183(0xd2),'llm_project',a27_0x747183(0xfa),a27_0x747183(0x133)];[a27_0x747183(0xcd)](_0x166949){const _0x5f5ae1=a27_0x747183,{args:_0x386dc0,options:_0x1853ee}=_0x166949,_0x2934fb=_0x1853ee['profile']||getActiveProfile();if(!_0x2934fb)return _0x5f5ae1(0xe1);if(_0x386dc0[_0x5f5ae1(0x11c)]===0x0)return _0x5f5ae1(0x106)+ProfileSetCommand[_0x5f5ae1(0xf4)][_0x5f5ae1(0x123)](',\x20');const _0x260fcc=_0x386dc0[0x0];if(!_0x260fcc[_0x5f5ae1(0xd6)]('='))return _0x5f5ae1(0xef)+ProfileSetCommand[_0x5f5ae1(0xf4)][_0x5f5ae1(0x123)](',\x20');const [_0x3daef1]=_0x260fcc[_0x5f5ae1(0x119)]('=',0x2);if(!ProfileSetCommand[_0x5f5ae1(0xf4)][_0x5f5ae1(0xd6)](_0x3daef1))return'Unknown\x20key\x20\x27'+_0x3daef1+_0x5f5ae1(0xe9)+ProfileSetCommand[_0x5f5ae1(0xf4)][_0x5f5ae1(0x123)](',\x20');return undefined;}async[a27_0x747183(0xc4)](_0x24223f){const _0x51a598=a27_0x747183,{args:_0x393f89,options:_0x4ef72b}=_0x24223f,_0x2fccc7=_0x4ef72b[_0x51a598(0x10d)]||getActiveProfile(),[_0x1cdb5b,..._0x36d257]=_0x393f89[0x0][_0x51a598(0x119)]('='),_0x17c1d2=_0x36d257[_0x51a598(0x123)]('=');console[_0x51a598(0xf7)](a27_0x4a390e[_0x51a598(0x12e)]('tdx:\x20profile\x20set'));if(!profileExists(_0x2fccc7)){const _0x351acd=await a27_0x4f27d6({'type':'confirm','name':_0x51a598(0xd7),'message':_0x51a598(0xf8)+_0x2fccc7+_0x51a598(0xec),'initial':!![]});if(!_0x351acd['create'])return console[_0x51a598(0xf7)](_0x51a598(0xdf)),0x1;}const _0x160432=loadProfile(_0x2fccc7),_0x4d2ee5=_0x160432?.[_0x51a598(0x115)]||{};if(_0x1cdb5b===_0x51a598(0xff)){const _0x4fb573=resolveSite(_0x17c1d2);console['log'](_0x51a598(0xea)+_0x4fb573+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0x51a598(0xf7)](_0x51a598(0xd1)),console[_0x51a598(0xf7)]('\x20\x20'+getConsoleUrl(_0x4fb573,'/app/mp/ak'));const _0x57074e=await a27_0x4f27d6({'type':'password','name':'apiKey','message':_0x51a598(0xfb),'validate':_0x4a6da6=>{const _0x55c18d=_0x51a598;if(!_0x4a6da6||!_0x4a6da6[_0x55c18d(0xd3)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x57074e[_0x51a598(0xd4)])return console[_0x51a598(0xf7)](_0x51a598(0xf2)),0x1;console[_0x51a598(0xf7)](_0x51a598(0x10e));try{const _0x260c91=TDX['create']({'site':_0x4fb573,'apiKey':_0x57074e[_0x51a598(0xd4)]['trim'](),'logLevel':_0x4ef72b['logLevel']??LogLevel[_0x51a598(0x103)]}),_0x4ee22b=await _0x260c91[_0x51a598(0x134)][_0x51a598(0x131)]();console[_0x51a598(0xf7)](a27_0x4a390e[_0x51a598(0xdb)]('✓')+_0x51a598(0xde)+_0x4ee22b[_0x51a598(0x128)]+')');const _0x3f23eb=await isKeychainAvailable();_0x3f23eb?(await saveAPIKeyAsync(_0x57074e[_0x51a598(0xd4)][_0x51a598(0xd3)](),_0x4fb573,_0x2fccc7),console[_0x51a598(0xf7)](a27_0x4a390e[_0x51a598(0xdb)]('✓')+_0x51a598(0xe8))):console[_0x51a598(0x101)](a27_0x4a390e[_0x51a598(0x116)](_0x51a598(0xe2))),_0x4d2ee5[_0x51a598(0xff)]=_0x4fb573;}catch(_0x4d90bd){if(_0x4d90bd instanceof HTTPClientError&&_0x4d90bd[_0x51a598(0xe5)]===0x191)return printAuthError(_0x4d90bd),0x1;return console[_0x51a598(0x122)](a27_0x4a390e[_0x51a598(0xdc)](_0x51a598(0x12d)+(_0x4d90bd instanceof Error?_0x4d90bd[_0x51a598(0x11e)]:String(_0x4d90bd)))),console[_0x51a598(0x122)](_0x51a598(0x110)),0x1;}}else _0x4d2ee5[_0x1cdb5b]=_0x17c1d2||undefined;return saveProfileToUserConfig(_0x2fccc7,_0x4d2ee5),console[_0x51a598(0xf7)](a27_0x4a390e[_0x51a598(0xdb)]('✓')+_0x51a598(0xf1)+_0x2fccc7+_0x51a598(0x113)+_0x1cdb5b+'='+(_0x17c1d2||_0x51a598(0xf9))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a27_0x747183(0xe3)]=a27_0x747183(0xfe);['description']=a27_0x747183(0xca);[a27_0x747183(0xcd)](_0x568a3e){const _0x1b865c=a27_0x747183,{args:_0x25598c}=_0x568a3e;if(_0x25598c[_0x1b865c(0x11c)]===0x0)return _0x1b865c(0x117);return undefined;}async[a27_0x747183(0xc4)](_0x32e8ad){const _0x4a467e=a27_0x747183,{args:_0x4c3100,options:_0x3ff14d}=_0x32e8ad,_0x1c7f6a=_0x4c3100[0x0],_0x5b1353=_0x3ff14d[_0x4a467e(0x11b)];cleanExpiredSessions();if(!profileExists(_0x1c7f6a)){console['error'](a27_0x4a390e[_0x4a467e(0xdc)]('Profile\x20\x27'+_0x1c7f6a+_0x4a467e(0x135))),console[_0x4a467e(0xf7)](_0x4a467e(0x108));const _0x40b350=listProfiles();if(_0x40b350[_0x4a467e(0x11c)]===0x0)console[_0x4a467e(0xf7)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x246239 of _0x40b350){console[_0x4a467e(0xf7)](_0x4a467e(0xd0)+_0x246239[_0x4a467e(0xe3)]);}return 0x1;}if(_0x5b1353){const _0x3f7010=a27_0x5adadd[_0x4a467e(0x123)](getConfigDir(),_0x4a467e(0x11f));return saveActiveProfileToUserConfig(_0x1c7f6a),console['log'](_0x4a467e(0x11a)+a27_0x4a390e[_0x4a467e(0xdb)](_0x1c7f6a)),console['log'](a27_0x4a390e['dim'](_0x4a467e(0xf5)+_0x3f7010)),0x0;}const _0x2dd2b3=getSessionID(_0x3ff14d[_0x4a467e(0x118)]);return saveSessionContext({'profile':_0x1c7f6a},_0x3ff14d[_0x4a467e(0x118)]),console[_0x4a467e(0xf7)](_0x4a467e(0xe7)+a27_0x4a390e['green'](_0x1c7f6a)+'\x20'+a27_0x4a390e[_0x4a467e(0x129)](_0x4a467e(0x130)+_0x2dd2b3+')')),console[_0x4a467e(0xf7)](a27_0x4a390e[_0x4a467e(0x129)]('\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20'+_0x1c7f6a+_0x4a467e(0x124))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x3abff4=a28_0x5a05;(function(_0x7570ee,_0x53160d){const _0x4573ac=a28_0x5a05,_0x2ffc27=_0x7570ee();while(!![]){try{const _0x4d89a7=-parseInt(_0x4573ac(0x13c))/0x1+-parseInt(_0x4573ac(0x12d))/0x2+parseInt(_0x4573ac(0x13d))/0x3+-parseInt(_0x4573ac(0x12b))/0x4*(-parseInt(_0x4573ac(0x134))/0x5)+parseInt(_0x4573ac(0x139))/0x6+-parseInt(_0x4573ac(0x131))/0x7+parseInt(_0x4573ac(0x13e))/0x8*(parseInt(_0x4573ac(0x132))/0x9);if(_0x4d89a7===_0x53160d)break;else _0x2ffc27['push'](_0x2ffc27['shift']());}catch(_0x33cc8c){_0x2ffc27['push'](_0x2ffc27['shift']());}}}(a28_0x21f7,0xcfa1f));import{BaseCommand}from'./command.js';function a28_0x21f7(){const _0x2f1d99=['4136FkomBT','log','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','570044trteEx','profiles','1518604zjPLoS','config','scope','name','3430441eLGZph','1251FNGSyg','error','25teDxYI','execute','length','\x20\x20Global:\x20~/.config/tdx/tdx.json','message','7152822XbSHXQ','description','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','1270351MVIJhK','4180872ZCHCsq'];a28_0x21f7=function(){return _0x2f1d99;};return a28_0x21f7();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a28_0x5a05(_0xfba0db,_0x2b8d56){_0xfba0db=_0xfba0db-0x129;const _0x21f7d8=a28_0x21f7();let _0x5a05bb=_0x21f7d8[_0xfba0db];return _0x5a05bb;}import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a28_0x3abff4(0x130)]=a28_0x3abff4(0x12c);['description']='List\x20all\x20available\x20profiles';async[a28_0x3abff4(0x135)](_0x2ceb4d){const _0x1e7f7e=a28_0x3abff4,{options:_0xd2a5eb}=_0x2ceb4d;try{const _0x5f2a57=listProfiles(),_0x3295ba=getActiveProfile();if(_0x5f2a57[_0x1e7f7e(0x136)]===0x0)return console[_0x1e7f7e(0x129)](_0x1e7f7e(0x13b)),console[_0x1e7f7e(0x129)](_0x1e7f7e(0x12a)),console[_0x1e7f7e(0x129)](_0x1e7f7e(0x137)),0x0;const _0x59969f=_0x5f2a57['map'](_0x1ff3e4=>{const _0x36b6ee=_0x1e7f7e,_0x137dc5=_0x1ff3e4[_0x36b6ee(0x130)]===_0x3295ba,_0xa02265=getProfileParams(_0x1ff3e4[_0x36b6ee(0x12e)]);return{'name':_0x1ff3e4[_0x36b6ee(0x130)],'active':_0x137dc5,'scope':_0x1ff3e4[_0x36b6ee(0x12f)],'description':_0x1ff3e4[_0x36b6ee(0x12e)][_0x36b6ee(0x13a)]||'','params':_0xa02265};});return await handleSDKOutput(_0x59969f,_0xd2a5eb),0x0;}catch(_0x4a384c){return _0x4a384c instanceof Error&&console[_0x1e7f7e(0x133)]('Error:\x20'+_0x4a384c[_0x1e7f7e(0x138)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x38b7e1=a29_0x9aef;(function(_0x8516ee,_0x35a315){const _0x7c0100=a29_0x9aef,_0x5ce694=_0x8516ee();while(!![]){try{const _0x374196=-parseInt(_0x7c0100(0x10c))/0x1*(parseInt(_0x7c0100(0x12c))/0x2)+parseInt(_0x7c0100(0x110))/0x3+-parseInt(_0x7c0100(0x102))/0x4*(parseInt(_0x7c0100(0x11e))/0x5)+parseInt(_0x7c0100(0x122))/0x6*(-parseInt(_0x7c0100(0x11c))/0x7)+parseInt(_0x7c0100(0x10b))/0x8+parseInt(_0x7c0100(0x10d))/0x9+parseInt(_0x7c0100(0x120))/0xa*(parseInt(_0x7c0100(0x126))/0xb);if(_0x374196===_0x35a315)break;else _0x5ce694['push'](_0x5ce694['shift']());}catch(_0x4b1184){_0x5ce694['push'](_0x5ce694['shift']());}}}(a29_0x1471,0x64847));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';function a29_0x9aef(_0x17cb34,_0x1a0d00){_0x17cb34=_0x17cb34-0x100;const _0x1471fb=a29_0x1471();let _0x9aefa4=_0x1471fb[_0x17cb34];return _0x9aefa4;}import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';function a29_0x1471(){const _0x38708e=['stats','956SrGRpg','Error:\x20','Query\x20completed:\x20Processed\x20','error','join','Site:\x20','name','setExtra','SQL:\x20','6349872IDLEMh','157399NcfKZh','1567224rcXgvM','totalSplits','site','835440mgHirw','file','setJobId','Catalog:\x20','\x20[Job\x20ID:\x20','state','completedSplits','output','\x20-\x20','verbose','Schema:\x20','validate','112735smwzEw','execute','15265HPMXcZ','data','1620800nVrtvQ','length','222ETxFAs','information_schema','description','Statement\x20','44wVTkyT','\x0aAll\x20results\x20saved\x20to\x20','\x20rows\x20','Executing\x20statement\x20','query','database','2Yidanx','\x20splits','push','processedRows'];a29_0x1471=function(){return _0x38708e;};return a29_0x1471();}export class QueryCommand extends BaseCommand{[a29_0x38b7e1(0x108)]=a29_0x38b7e1(0x12a);[a29_0x38b7e1(0x124)]='Run\x20Trino\x20queries\x20(streaming)';async[a29_0x38b7e1(0x11d)](_0x54683b){const _0x5189d1=a29_0x38b7e1,{options:_0xb1be0e,args:_0x47ee47,tdx:_0x57b4ca}=_0x54683b,_0x257af7=_0x47ee47[0x0],_0x40f1d7=_0xb1be0e[_0x5189d1(0x111)];let _0x59bad6;try{if(_0x40f1d7)_0x59bad6=readSqlStatementsFromFile(_0x40f1d7);else{if(_0x257af7==='-')_0x59bad6=await readSqlStatementsFromStdin();else{if(_0x257af7&&isSqlFilePath(_0x257af7))_0x59bad6=readSqlStatementsFromFile(_0x257af7);else{if(_0x257af7)_0x59bad6=splitSqlStatements(_0x257af7);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x322069){return console[_0x5189d1(0x105)](_0x5189d1(0x103)+_0x322069['message']),0x1;}const _0x18e41a=_0xb1be0e[_0x5189d1(0x12b)]||_0x5189d1(0x123),_0x50e2d1=_0xb1be0e['catalog'];try{const _0x4e80e4=[],_0x526421=!!_0xb1be0e[_0x5189d1(0x117)];for(let _0x497bc2=0x0;_0x497bc2<_0x59bad6[_0x5189d1(0x121)];_0x497bc2++){const _0x18fe6f=_0x59bad6[_0x497bc2],_0x160801=_0x497bc2+0x1,_0xbc5d77=_0x59bad6[_0x5189d1(0x121)],_0x5f38c0=_0xbc5d77>0x1;_0xb1be0e[_0x5189d1(0x119)]&&(console['error']('\x0a'+(_0x5f38c0?_0x5189d1(0x125)+_0x160801+'/'+_0xbc5d77+':':'')),console[_0x5189d1(0x105)](_0x5189d1(0x107)+_0xb1be0e[_0x5189d1(0x10f)]),console[_0x5189d1(0x105)](_0x5189d1(0x113)+(_0x50e2d1||'td')),console['error'](_0x5189d1(0x11a)+_0x18e41a),console[_0x5189d1(0x105)](_0x5189d1(0x10a)+_0x18fe6f));const _0x104c0c=_0x5f38c0?_0x5189d1(0x129)+_0x160801+'/'+_0xbc5d77+'...':'Executing\x20query...';try{const _0x44b926=await withProgressSpinner(_0x104c0c,async _0x3d5229=>{const _0xc72afb=await _0x57b4ca['query']['execute'](_0x18fe6f,{'catalog':_0x50e2d1,'schema':_0x18e41a,'onJobId':_0x4f9ddc=>{const _0x1d7286=a29_0x9aef;_0x3d5229[_0x1d7286(0x112)](_0x4f9ddc);},'onProgress':_0x43aed0=>{const _0x344d30=a29_0x9aef;_0x3d5229['setPhase']('Executing\x20query\x20['+_0x43aed0[_0x344d30(0x115)]+']'),_0x3d5229[_0x344d30(0x109)](formatRows(_0x43aed0['processedRows'])+'\x20rows\x20'+_0x43aed0[_0x344d30(0x116)]+'/'+_0x43aed0[_0x344d30(0x10e)]+_0x344d30(0x12d));}});return _0xc72afb;},{'verbose':_0xb1be0e['verbose']}),_0x3eee17=_0x44b926[_0x5189d1(0x11f)],_0x23c1e0=_0x3eee17['jobId']?_0x5189d1(0x114)+_0x3eee17['jobId']+']':'',_0x30074e=_0x5f38c0?_0x5189d1(0x125)+_0x160801+'/'+_0xbc5d77+_0x5189d1(0x118):'';console[_0x5189d1(0x105)]('✔\x20'+_0x30074e+_0x5189d1(0x104)+formatRows(_0x3eee17[_0x5189d1(0x101)][_0x5189d1(0x100)])+_0x5189d1(0x128)+('in\x20'+formatElapsed(_0x3eee17[_0x5189d1(0x101)]['elapsedTimeMillis'])+_0x23c1e0));if(_0x5f38c0&&_0x526421){const _0x1629cd=resolveOutputOptions(_0xb1be0e),_0x535871=await formatQueryOutput(_0x3eee17,_0x1629cd);_0x4e80e4[_0x5189d1(0x12e)](_0x535871);}else await handleQueryOutput(_0x3eee17,_0xb1be0e);}catch(_0x3723b5){const _0x90f2ff=_0x5f38c0?_0x5189d1(0x125)+_0x160801+'/'+_0xbc5d77+':\x0a':'',_0x18d129=_0x3723b5 instanceof SDKError?_0x3723b5['originalMessage']:_0x3723b5['message'];return console[_0x5189d1(0x105)](''+_0x90f2ff+_0x18d129),0x1;}}if(_0x59bad6[_0x5189d1(0x121)]>0x1&&_0x526421&&_0x4e80e4[_0x5189d1(0x121)]>0x0){const _0x454efb=_0x4e80e4[_0x5189d1(0x106)]('\x0a');writeFileSync(_0xb1be0e[_0x5189d1(0x117)],_0x454efb),console['error'](_0x5189d1(0x127)+_0xb1be0e[_0x5189d1(0x117)]);}return 0x0;}catch(_0x2b6cce){throw _0x2b6cce;}}[a29_0x38b7e1(0x11b)](_0x91781e){const _0x414513=a29_0x38b7e1,_0x356171=_0x91781e['args'][0x0],_0x525bd4=_0x91781e['options'][_0x414513(0x111)];if(!_0x356171&&!_0x525bd4)return'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';if(_0x356171&&_0x525bd4)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
|