@treasuredata/tdx 0.16.3 → 0.16.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.d.ts +4 -0
- package/dist/commands/agent-test-command.d.ts.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/agent-test-command.js.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +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/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.d.ts +3 -0
- package/dist/commands/mcp-command.d.ts.map +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/mcp-command.js.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/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.d.ts +7 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/connection-cache.d.ts.map +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/connection-cache.js.map +1 -1
- package/dist/core/constants.d.ts +22 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/constants.js.map +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.d.ts.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/keychain.js.map +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.d.ts.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/user-cache.js.map +1 -1
- package/dist/core/version.d.ts +2 -2
- 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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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.d.ts +2 -0
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.d.ts +3 -6
- package/dist/sdk/agent/test/evaluator.d.ts.map +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/evaluator.js.map +1 -1
- package/dist/sdk/agent/test/executor.d.ts +57 -1
- package/dist/sdk/agent/test/executor.d.ts.map +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/executor.js.map +1 -1
- package/dist/sdk/agent/test/index.d.ts +2 -2
- package/dist/sdk/agent/test/index.d.ts.map +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/index.js.map +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.d.ts.map +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/test/parser.js.map +1 -1
- package/dist/sdk/agent/test/types.d.ts +44 -0
- package/dist/sdk/agent/test/types.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +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.d.ts +6 -0
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.d.ts.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/chat-cache.js.map +1 -1
- package/dist/sdk/llm/index.d.ts +11 -3
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/llm.d.ts +39 -0
- package/dist/sdk/types/llm.d.ts.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/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.d.ts +88 -0
- package/dist/utils/global-cache.d.ts.map +1 -0
- package/dist/utils/global-cache.js +1 -0
- package/dist/utils/global-cache.js.map +1 -0
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.d.ts +48 -0
- package/dist/utils/local-cache.d.ts.map +1 -0
- package/dist/utils/local-cache.js +1 -0
- package/dist/utils/local-cache.js.map +1 -0
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tdx-logger.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x5f52b8=a23_0x4bc1;(function(_0x1616b8,_0x2b09c1){const _0x25d08a=a23_0x4bc1,_0x325fde=_0x1616b8();while(!![]){try{const _0x238fce=-parseInt(_0x25d08a(0x292))/0x1*(-parseInt(_0x25d08a(0x283))/0x2)+-parseInt(_0x25d08a(0x266))/0x3*(-parseInt(_0x25d08a(0x29b))/0x4)+-parseInt(_0x25d08a(0x2c1))/0x5*(parseInt(_0x25d08a(0x228))/0x6)+-parseInt(_0x25d08a(0x2ad))/0x7*(-parseInt(_0x25d08a(0x1cc))/0x8)+parseInt(_0x25d08a(0x298))/0x9*(-parseInt(_0x25d08a(0x20b))/0xa)+parseInt(_0x25d08a(0x209))/0xb*(-parseInt(_0x25d08a(0x221))/0xc)+parseInt(_0x25d08a(0x21d))/0xd*(-parseInt(_0x25d08a(0x26e))/0xe);if(_0x238fce===_0x2b09c1)break;else _0x325fde['push'](_0x325fde['shift']());}catch(_0x40a702){_0x325fde['push'](_0x325fde['shift']());}}}(a23_0x289e,0xe508d));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a23_0x684510 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a23_0x12ece1 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=a23_0x5f52b8(0x2c8),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x1d684c){const _0x26e976=a23_0x5f52b8,_0x16f1fd=process[_0x26e976(0x26b)],_0x142cba=_0x16f1fd==='darwin'?'open':_0x16f1fd===_0x26e976(0x1be)?_0x26e976(0x213):_0x26e976(0x1f8);spawn(_0x142cba,[_0x1d684c],{'detached':!![],'stdio':'ignore'})[_0x26e976(0x21b)]();}function migrateLegacyDirectory(){const _0x372fa2=a23_0x5f52b8;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x53e4de=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x53e4de[_0x372fa2(0x1e6)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a23_0x12ece1[_0x372fa2(0x23f)](_0x372fa2(0x256)+LEGACY_PARENT_SEGMENT_DIR+_0x372fa2(0x1ec)+PARENT_SEGMENT_DIR+_0x372fa2(0x23d))),console[_0x372fa2(0x210)](a23_0x12ece1[_0x372fa2(0x2bf)](_0x372fa2(0x206)+LEGACY_PARENT_SEGMENT_DIR+_0x372fa2(0x21c))),![];console['error'](a23_0x12ece1['yellow'](_0x372fa2(0x2b6)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a23_0x12ece1[_0x372fa2(0x2c4)](_0x372fa2(0x201)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x16a8e9){const _0x21f9f3=_0x16a8e9 instanceof Error?_0x16a8e9[_0x372fa2(0x226)]:String(_0x16a8e9);return console[_0x372fa2(0x210)](a23_0x12ece1[_0x372fa2(0x1e8)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x21f9f3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a23_0x5f52b8(0x252)](_0x568294){return migrateLegacyDirectory(),super['run'](_0x568294);}}function resolveYamlFile(_0x11fda0){const _0x3c0682=a23_0x5f52b8;if(_0x11fda0['endsWith'](_0x3c0682(0x2b0))||_0x11fda0[_0x3c0682(0x1d6)](_0x3c0682(0x1da)))return _0x11fda0;return a23_0x684510[_0x3c0682(0x261)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x11fda0)+_0x3c0682(0x2b0));}function formatProgressMessage(_0x2b0eb9){const _0x59d803=a23_0x5f52b8,_0x3d79e2=_0x2b0eb9[_0x59d803(0x262)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3d79e2){const [,_0x3f43ce,_0x3e62a4,_0x360fa8='']=_0x3d79e2;return a23_0x12ece1[_0x59d803(0x2bf)](_0x3f43ce+':')+'\x20'+_0x3e62a4+a23_0x12ece1['dim'](_0x360fa8);}return a23_0x12ece1[_0x59d803(0x2bf)](_0x2b0eb9);}function showFileNotFoundError(_0x4b95c4,_0xace18e){const _0x53c267=a23_0x5f52b8;console[_0x53c267(0x210)](a23_0x12ece1['red'](_0x53c267(0x1a8)+_0x4b95c4+'\x0a')),console[_0x53c267(0x210)](a23_0x12ece1['cyan'](_0x53c267(0x225)+_0xace18e+_0x53c267(0x1de)));}function showParentSegmentNotSetError(_0x28fda9){const _0x23f716=a23_0x5f52b8;console[_0x23f716(0x210)](a23_0x12ece1[_0x23f716(0x23f)](_0x23f716(0x276))),console[_0x23f716(0x210)](_0x28fda9);}export class ParentSegmentListCommand extends BaseCommand{[a23_0x5f52b8(0x26c)]='segment:parent:list';[a23_0x5f52b8(0x284)]=a23_0x5f52b8(0x29a);async['execute'](_0x31cd4c){const _0x1d950e=a23_0x5f52b8,{options:_0x27bbf6,args:_0x270ebe,tdx:_0x468bb8}=_0x31cd4c,_0x576674=_0x270ebe[0x0];_0x27bbf6['verbose']&&(console['error'](_0x1d950e(0x1ae)+_0x27bbf6[_0x1d950e(0x23b)]),_0x576674&&console[_0x1d950e(0x210)](_0x1d950e(0x1a2)+_0x576674));const _0x32039a=await withSpinner(_0x576674?_0x1d950e(0x1e0)+_0x576674+_0x1d950e(0x215):_0x1d950e(0x270),()=>_0x468bb8[_0x1d950e(0x222)][_0x1d950e(0x1b8)](),{'verbose':_0x27bbf6['verbose']});let _0x469aee=_0x32039a[_0x1d950e(0x29c)];if(_0x576674){const _0xc4efdc=_0x576674['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x1d950e(0x282)](/\?/g,'.'),_0x1c3996=new RegExp('^'+_0xc4efdc+'$','i');_0x469aee=_0x469aee[_0x1d950e(0x22e)](_0x5571f2=>_0x1c3996[_0x1d950e(0x231)](_0x5571f2['attributes'][_0x1d950e(0x26c)]));}_0x469aee[_0x1d950e(0x2c3)]((_0x20b6af,_0x40e8d2)=>_0x20b6af['attributes'][_0x1d950e(0x26c)]['localeCompare'](_0x40e8d2[_0x1d950e(0x1ac)][_0x1d950e(0x26c)])),console[_0x1d950e(0x210)]('✔\x20Found\x20'+_0x469aee[_0x1d950e(0x255)]+_0x1d950e(0x20f)+(_0x469aee[_0x1d950e(0x255)]!==0x1?'s':''));const _0x14a931=_0x3f2fa8=>{const _0x25180d=_0x1d950e;return getConsoleNextUrl(_0x27bbf6[_0x25180d(0x23b)],'/app/dw/parentSegments/'+_0x3f2fa8);};if(_0x27bbf6[_0x1d950e(0x2c2)]===_0x1d950e(0x1c2)||_0x27bbf6[_0x1d950e(0x2c2)]===_0x1d950e(0x291)){const _0x151c64=_0x469aee[_0x1d950e(0x1bd)](_0x11833a=>({..._0x11833a,'url':_0x14a931(_0x11833a['id'])}));await handleSDKOutput(_0x151c64,_0x27bbf6);}else{if(_0x469aee[_0x1d950e(0x255)]===0x0)_0x576674?console[_0x1d950e(0x278)](_0x1d950e(0x28b)+_0x576674):console[_0x1d950e(0x278)](_0x1d950e(0x25a));else for(const _0x11222b of _0x469aee){const _0xcb56d5=_0x11222b[_0x1d950e(0x1ac)][_0x1d950e(0x224)]?a23_0x12ece1[_0x1d950e(0x2bf)]('\x20('+formatRows(_0x11222b[_0x1d950e(0x1ac)][_0x1d950e(0x224)])+')'):'',_0x61e352=hyperlink(_0x11222b[_0x1d950e(0x1ac)][_0x1d950e(0x26c)],_0x14a931(_0x11222b['id']));console['log'](_0x1d950e(0x212)+_0x61e352+_0xcb56d5);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a23_0x5f52b8(0x26c)]=a23_0x5f52b8(0x204);[a23_0x5f52b8(0x284)]=a23_0x5f52b8(0x254);async[a23_0x5f52b8(0x234)](_0x54d13f){const _0x323d79=a23_0x5f52b8,{options:_0x3ce1f6,args:_0x44c837,tdx:_0x54163a}=_0x54d13f;console[_0x323d79(0x210)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x11c6e9=_0x3ce1f6;if(_0x44c837[_0x323d79(0x255)]===0x0)return console[_0x323d79(0x210)](a23_0x12ece1[_0x323d79(0x1e8)](_0x323d79(0x1dd))),console['error'](_0x323d79(0x1bb)),0x1;const _0x26fd05=_0x44c837[0x0];if(!_0x11c6e9['database']||!_0x11c6e9[_0x323d79(0x280)])return console['error'](_0x323d79(0x1d9)),console['error'](_0x323d79(0x1bb)),0x1;_0x11c6e9[_0x323d79(0x1cb)]&&(console[_0x323d79(0x210)](_0x323d79(0x1ae)+_0x11c6e9[_0x323d79(0x23b)]),console[_0x323d79(0x210)](_0x323d79(0x2ae)+_0x26fd05),console['error'](_0x323d79(0x1cf)+_0x11c6e9[_0x323d79(0x1ed)]),console[_0x323d79(0x210)](_0x323d79(0x1a6)+_0x11c6e9['table']));const _0x427251=await loadJSONFromOptions(_0x11c6e9['attributes'],_0x11c6e9[_0x323d79(0x28d)]),_0x124fd5=await loadJSONFromOptions(_0x11c6e9['behaviors'],_0x11c6e9[_0x323d79(0x247)]),_0x28be6c=await loadJSONFromOptions(_0x11c6e9[_0x323d79(0x1d5)],_0x11c6e9[_0x323d79(0x1d7)]),_0x3cced7={'name':_0x26fd05,'description':_0x11c6e9[_0x323d79(0x284)],'scheduleType':_0x11c6e9[_0x323d79(0x28a)],'scheduleOption':_0x11c6e9[_0x323d79(0x2af)],'timezone':_0x11c6e9[_0x323d79(0x24d)],'master':{'parentDatabaseName':_0x11c6e9[_0x323d79(0x1ed)],'parentTableName':_0x11c6e9[_0x323d79(0x280)]},'attributes':_0x427251,'behaviors':_0x124fd5,'customerGroup':_0x28be6c},_0x43ba02=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x26fd05+_0x323d79(0x215),()=>_0x54163a[_0x323d79(0x222)][_0x323d79(0x22d)](_0x3cced7),{'verbose':_0x3ce1f6['verbose']}),_0x1a0e5f=_0x43ba02[_0x323d79(0x29c)];return console['error'](_0x323d79(0x290)+_0x1a0e5f[_0x323d79(0x26c)]+_0x323d79(0x2c0)+_0x1a0e5f['id']),await handleSDKOutput([_0x1a0e5f],_0x3ce1f6),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a23_0x5f52b8(0x26c)]='segment:parent:update';[a23_0x5f52b8(0x284)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a23_0x5f52b8(0x234)](_0x1a0f91){const _0x8dcd31=a23_0x5f52b8,{options:_0x10b117,args:_0x3c56b6,tdx:_0x414771}=_0x1a0f91;console['error'](_0x8dcd31(0x233)+_0x8dcd31(0x21f)+_0x8dcd31(0x2be));const _0x56484c=_0x10b117;if(_0x3c56b6[_0x8dcd31(0x255)]===0x0)return console[_0x8dcd31(0x210)](a23_0x12ece1[_0x8dcd31(0x1e8)](_0x8dcd31(0x1dd))),console[_0x8dcd31(0x210)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x494ea3=_0x3c56b6[0x0];_0x56484c[_0x8dcd31(0x1cb)]&&(console[_0x8dcd31(0x210)](_0x8dcd31(0x1ae)+_0x56484c['site']),console['error']('Parent\x20segment:\x20'+_0x494ea3));const _0x1c80a0=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x494ea3+_0x8dcd31(0x215),()=>_0x414771[_0x8dcd31(0x222)][_0x8dcd31(0x1cd)](_0x494ea3),{'verbose':_0x56484c[_0x8dcd31(0x1cb)]}),_0x2bfada=_0x1c80a0[_0x8dcd31(0x29c)],_0x5ec13f=await loadJSONFromOptions(_0x56484c[_0x8dcd31(0x24b)],_0x56484c['addAttributesFile']),_0x36fc16=await loadJSONFromOptions(_0x56484c[_0x8dcd31(0x2b9)],_0x56484c[_0x8dcd31(0x1ce)]),_0x57ae1e={'name':_0x2bfada[_0x8dcd31(0x26c)],'description':_0x56484c[_0x8dcd31(0x284)]!==undefined?_0x56484c['description']:_0x2bfada[_0x8dcd31(0x284)],'scheduleType':_0x56484c[_0x8dcd31(0x28a)]!==undefined?_0x56484c[_0x8dcd31(0x28a)]:_0x2bfada[_0x8dcd31(0x28a)],'scheduleOption':_0x56484c[_0x8dcd31(0x2af)]!==undefined?_0x56484c[_0x8dcd31(0x2af)]:_0x2bfada[_0x8dcd31(0x2af)],'timezone':_0x56484c[_0x8dcd31(0x24d)]!==undefined?_0x56484c[_0x8dcd31(0x24d)]:_0x2bfada[_0x8dcd31(0x24d)],'master':_0x2bfada[_0x8dcd31(0x26d)],'attributes':_0x5ec13f?[..._0x2bfada[_0x8dcd31(0x1ac)]||[],..._0x5ec13f]:_0x2bfada['attributes'],'behaviors':_0x36fc16?[..._0x2bfada['behaviors']||[],..._0x36fc16]:_0x2bfada[_0x8dcd31(0x2b1)],'customerGroup':_0x2bfada['customerGroup']},_0x90e2cb=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x494ea3+_0x8dcd31(0x215),()=>_0x414771['segment']['updateParent'](_0x494ea3,_0x57ae1e),{'verbose':_0x56484c[_0x8dcd31(0x1cb)]}),_0x57d00d=_0x90e2cb[_0x8dcd31(0x29c)];return console[_0x8dcd31(0x210)](_0x8dcd31(0x22a)+_0x57d00d[_0x8dcd31(0x26c)]+'\x27'),await handleSDKOutput([_0x57d00d],_0x56484c),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a23_0x5f52b8(0x26c)]=a23_0x5f52b8(0x2b5);['description']=a23_0x5f52b8(0x1bc);async[a23_0x5f52b8(0x234)](_0x21cff2){const _0x4e99e7=a23_0x5f52b8,{options:_0x453847,args:_0x587e05,tdx:_0x14717e}=_0x21cff2,_0x2e0e94=_0x453847,_0xd8a2f9=_0x587e05[0x0]||_0x453847[_0x4e99e7(0x240)];if(!_0xd8a2f9)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x2e0e94[_0x4e99e7(0x2a9)]&&_0x2e0e94[_0x4e99e7(0x1b2)])return console[_0x4e99e7(0x210)](a23_0x12ece1[_0x4e99e7(0x1e8)](_0x4e99e7(0x1f3))),console[_0x4e99e7(0x210)](a23_0x12ece1[_0x4e99e7(0x2bf)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x4e99e7(0x210)](a23_0x12ece1[_0x4e99e7(0x2bf)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x4e99e7(0x294))),console['error'](a23_0x12ece1[_0x4e99e7(0x220)](_0x4e99e7(0x299))),0x1;const _0x2b51d6=_0x2e0e94[_0x4e99e7(0x1b2)]||a23_0x684510['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0xd8a2f9)+_0x4e99e7(0x2b0));_0x2e0e94[_0x4e99e7(0x1cb)]&&(console[_0x4e99e7(0x210)]('Site:\x20'+_0x2e0e94[_0x4e99e7(0x23b)]),console['error']('Parent\x20segment:\x20'+_0xd8a2f9),console[_0x4e99e7(0x210)]('Output\x20file:\x20'+_0x2b51d6));const _0x11e254=await withSpinner(_0x4e99e7(0x2b3)+_0xd8a2f9+'\x27...',()=>_0x14717e[_0x4e99e7(0x222)][_0x4e99e7(0x1b6)](_0xd8a2f9),{'verbose':_0x2e0e94['verbose']}),_0x31ee00=_0x11e254['data'];if(existsSync(_0x2b51d6)){const _0x219e7a=readFileSync(_0x2b51d6,_0x4e99e7(0x232)),_0x1b283f=generateDiff(_0x219e7a,_0x31ee00);if(!hasChanges(_0x1b283f))console[_0x4e99e7(0x210)](a23_0x12ece1[_0x4e99e7(0x2c4)]('✔')+_0x4e99e7(0x20e)+a23_0x12ece1[_0x4e99e7(0x220)](_0x2b51d6)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x4e99e7(0x210)](_0x4e99e7(0x1af)+_0x2b51d6+'\x27:'),console[_0x4e99e7(0x210)]('─'[_0x4e99e7(0x1c1)](0x3c)),console[_0x4e99e7(0x210)](formatDiffWithColors(_0x1b283f)),console[_0x4e99e7(0x210)]('─'[_0x4e99e7(0x1c1)](0x3c));if(!_0x2e0e94[_0x4e99e7(0x23c)]){const _0x404844=await confirmKey(_0x4e99e7(0x1a9)+_0x2b51d6+'\x27?');if(!_0x404844)return console['error']('Aborted.'),0x1;}writeFileSync(_0x2b51d6,_0x31ee00,_0x4e99e7(0x232)),console[_0x4e99e7(0x210)](a23_0x12ece1['green']('✔')+_0x4e99e7(0x259)+a23_0x12ece1['cyan'](_0x2b51d6));}}else{const _0x16ddcc=a23_0x684510[_0x4e99e7(0x21a)](_0x2b51d6);!existsSync(_0x16ddcc)&&mkdirSync(_0x16ddcc,{'recursive':!![]}),writeFileSync(_0x2b51d6,_0x31ee00,_0x4e99e7(0x232)),console[_0x4e99e7(0x210)](a23_0x12ece1[_0x4e99e7(0x2c4)]('✔')+_0x4e99e7(0x259)+a23_0x12ece1['cyan'](_0x2b51d6));}return saveSessionContext({'parent_segment':_0xd8a2f9},_0x2e0e94[_0x4e99e7(0x242)]),console[_0x4e99e7(0x210)](a23_0x12ece1[_0x4e99e7(0x2c4)]('✔')+_0x4e99e7(0x1a4)+a23_0x12ece1[_0x4e99e7(0x2bf)](_0x4e99e7(0x203))+_0x4e99e7(0x2a7)+a23_0x12ece1[_0x4e99e7(0x220)](_0xd8a2f9)),0x0;}}function a23_0x4bc1(_0x46b7db,_0x32f5c9){_0x46b7db=_0x46b7db-0x1a1;const _0x289e4f=a23_0x289e();let _0x4bc168=_0x289e4f[_0x46b7db];return _0x4bc168;}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a23_0x5f52b8(0x26c)]=a23_0x5f52b8(0x275);[a23_0x5f52b8(0x284)]=a23_0x5f52b8(0x27f);async['execute'](_0x307fd2){const _0x170147=a23_0x5f52b8,{options:_0x1d5181,args:_0x4bb015,tdx:_0x48bea7}=_0x307fd2,_0x226f6b=_0x1d5181,_0x4dee34=_0x4bb015[0x0]||_0x1d5181['parentSegment'];if(!_0x4dee34)return showParentSegmentNotSetError(_0x170147(0x1ff)+_0x170147(0x2bc)),0x1;const _0xb5d7bf=resolveYamlFile(_0x4dee34);if(!existsSync(_0xb5d7bf))return showFileNotFoundError(_0xb5d7bf,_0x4dee34),0x1;_0x226f6b['verbose']&&(console[_0x170147(0x210)](_0x170147(0x1ae)+_0x226f6b[_0x170147(0x23b)]),console[_0x170147(0x210)](_0x170147(0x25d)+_0xb5d7bf));let _0x4bad31;try{_0x4bad31=readFileSync(_0xb5d7bf,_0x170147(0x232));}catch(_0x29d9a5){const _0x146f75=_0x29d9a5 instanceof Error?_0x29d9a5[_0x170147(0x226)]:String(_0x29d9a5);return console[_0x170147(0x210)](_0x170147(0x202)+_0x146f75),0x1;}const _0x3ca824=await withSpinner(_0x170147(0x257),()=>_0x48bea7[_0x170147(0x222)][_0x170147(0x2a4)](_0x4bad31),{'verbose':_0x226f6b['verbose']}),_0x1182ad=_0x3ca824[_0x170147(0x29c)],{isNew:_0x24b8b7,name:_0x40e5c4,hasChanges:_0x100a4f,diffFormatted:_0x1d1e68}=_0x1182ad;if(!_0x100a4f)return console[_0x170147(0x210)](_0x170147(0x1f1)+_0x40e5c4+_0x170147(0x29d)),0x0;_0x24b8b7?console[_0x170147(0x210)](_0x170147(0x25f)+_0x40e5c4+'\x27:'):console[_0x170147(0x210)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x40e5c4+'\x27:');console[_0x170147(0x210)]('─'[_0x170147(0x1c1)](0x3c)),console[_0x170147(0x210)](_0x1d1e68),console[_0x170147(0x210)]('─'[_0x170147(0x1c1)](0x3c));const _0xc50f44=_0x24b8b7?_0x170147(0x1a3)+_0x40e5c4+'\x27?':_0x170147(0x272)+_0x40e5c4+'\x27?';if(!_0x226f6b[_0x170147(0x23c)]){const _0x274d20=await confirmKey(_0xc50f44);if(!_0x274d20)return console[_0x170147(0x210)]('Aborted.'),0x1;}const _0x129b09=_0x24b8b7?'Creating':_0x170147(0x1b0),_0x17ad2a=await withSpinner(_0x129b09+_0x170147(0x246)+_0x40e5c4+_0x170147(0x215),()=>_0x1182ad[_0x170147(0x281)](),{'verbose':_0x226f6b['verbose']}),_0x19ee47=_0x17ad2a[_0x170147(0x29c)],_0x393043=getConsoleNextUrl(_0x226f6b[_0x170147(0x23b)],_0x170147(0x21e)+_0x19ee47['id']),_0x5c2df9=_0x24b8b7?'Created':_0x170147(0x296);return console[_0x170147(0x210)]('✔\x20'+_0x5c2df9+_0x170147(0x246)+_0x19ee47[_0x170147(0x26c)]+'\x27'),console[_0x170147(0x210)]('\x20\x20'+_0x393043),0x0;}}function a23_0x289e(){const _0x267b7e=['✔\x20Created\x20parent\x20segment\x20\x27','jsonl','2101ogcsSB','string','/{name}.yml\x0a','Parent\x20segment:\x20','Updated','stop','31905JilIlF','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','List\x20parent\x20segments','2257468ChRmxL','data','\x27\x20is\x20already\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','trim','elapsedTimeMillis','Behaviors','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','pushParentYaml','Preview:','\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','toLocaleString','use','varchar','audienceId','\x20Configuration\x20is\x20valid','4668146sDGIhO','Name:\x20','scheduleOption','.yml','behaviors','\x0aNo\x20sample\x20data\x20available','Fetching\x20parent\x20segment\x20\x27','segment:parent:view','segment:parent:pull','\x0a⚠️\x20\x20Migrating:\x20','segment:parent:desc','-1d','addBehaviors','label','Audience\x20ID:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','dim','\x27\x20with\x20ID:\x20','1105NNvARy','format','sort','green','previewParentYaml','segment:parent:show','Validating\x20configuration...','parent_segments','Fetching\x20SQL\x20for\x20\x27','\x27\x20is\x20up\x20to\x20date','displayBehaviorsStats','Master:','Pattern:\x20','Create\x20parent\x20segment\x20\x27','\x20Context\x20set:\x20','displayAttributesStats','Table:\x20','runParent','Error:\x20File\x20not\x20found:\x20','Overwrite\x20\x27','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','attributes','Error:','Site:\x20','\x0aChanges\x20to\x20\x27','Updating','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','output','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','keys','Enriched:','pullParentYaml','displayMasterInfo','listParents','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Options:\x0a','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','map','win32','displayPreviewHints','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','repeat','json','Created','Session:','getParentSQL','\x20--behavior\x20\x22','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','displayPreviewResults','Listing\x20fields\x20for\x20\x27','verbose','16fVZCaW','getParentFull','addBehaviorsFile','Database:\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','workflowAttemptId','\x20tdx\x20wf\x20attempt\x20','%)\x20','\x20--attribute\x20\x22','customerGroup','endsWith','customerGroupFile','bold','Error:\x20--database\x20and\x20--table\x20are\x20required','.yaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','Customers:','Error:\x20Parent\x20segment\x20name\x20is\x20required','`\x20to\x20download\x20the\x20configuration\x20first','customersWithEvents','Listing\x20parent\x20segments\x20matching\x20\x27','foreignKey','To\x20view\x20sample\x20data:','Events:','Errors:','Attributes','isDirectory','Join\x20on:','red','behavior','workflowSessionId','rowCount','/\x20and\x20','database','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','status','\x27\x20and\x20run\x20workflow?','✔\x20No\x20changes\x20-\x20\x27','Columns:','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','in\x20','limit','attribute','Master\x20Table','xdg-open','displaySampleData','SELECT\x20*\x20FROM\x20(\x0a','customerPercent','/app/workflows/','segment:parent:sql','Behavior:','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x0a✔\x20Workflow\x20started','✔\x20Renamed\x20directory\x20to\x20','Error\x20reading\x20file:\x20','parent_segment','segment:parent:create','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Attempt:','workflowId','33rZcsdt','toFixed','20AlHhMw','jobId','schemaError','\x20No\x20changes\x20-\x20','\x20parent\x20segment','error','/sessions/','👥\x20','start','segment:parent:validate','\x27...','SQL\x20query:\x0a','resolveParentId','Validate:','Creating','dirname','unref','/\x20directory.\x0a','9675146Wvyekp','/app/dw/parentSegments/','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','cyan','3287676MTbqfY','segment','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','population','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','message','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','11928VVRKkB','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20Updated\x20parent\x20segment\x20\x27','column','Aborted.','createParent','filter','setJobId','tdx\x20segment\x20parent\x20preview\x20','test','utf-8','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','execute','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','web','all','listFields','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20--behavior\x20\x22<name>\x22','site','yes','/\x20directories\x20exist.','text','yellow','parentSegment','processedRows','session','Show\x20parent\x20segment\x20schema\x20(column\x20types)','displaySummary','✔\x20Query\x20completed:\x20Processed\x20','\x20parent\x20segment\x20\x27','behaviorsFile','Master\x20+\x20Attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20rows)','addAttributes','double','timezone','schemaValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','stats','List\x20available\x20fields\x20for\x20segmentation','run','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','length','\x0a⚠️\x20\x20Both\x20','Analyzing\x20changes...','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','No\x20parent\x20segments\x20found','Status:','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','YAML\x20file:\x20','\x20\x20No\x20sample\x20data\x20available','\x0aNew\x20parent\x20segment\x20\x27','\x20Opening\x20','join','match','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x0aChanges\x20to\x20apply\x20to\x20\x27','sampleData','3bWdqVT','Executing\x20parent\x20segment\x20query...','FINISHED','joinKey','preview','platform','name','master','14nWtGeM','Error\x20parsing\x20YAML:\x20','Listing\x20parent\x20segments...','enriched','Apply\x20changes\x20to\x20\x27','displayColumns','Join:','segment:parent:push','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','matchedCount','log','Show\x20parent\x20segment\x20details','displayValidateResults','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','totalEvents','information_schema','Rows:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','table','apply','replace','1002ZpSkos','description','errors','Options:','allValid','coveragePercent','segment:parent:preview','scheduleType','No\x20parent\x20segments\x20match\x20pattern:\x20','interval','attributesFile','Available\x20attributes:','segment:parent:fields'];a23_0x289e=function(){return _0x267b7e;};return a23_0x289e();}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a23_0x5f52b8(0x214);[a23_0x5f52b8(0x284)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a23_0x5f52b8(0x234)](_0x26eff9){const _0x3ca651=a23_0x5f52b8,{options:_0x3fd6e4,args:_0x197dad,tdx:_0x43f26d}=_0x26eff9,_0x18b370=_0x3fd6e4,_0xfb6c5f=_0x197dad[0x0]||_0x3fd6e4['parentSegment'];if(!_0xfb6c5f)return showParentSegmentNotSetError(_0x3ca651(0x223)+_0x3ca651(0x2a3)+_0x3ca651(0x1ba)+_0x3ca651(0x1ee)+_0x3ca651(0x27b)+_0x3ca651(0x263)),0x1;const _0x2b9d1f=resolveYamlFile(_0xfb6c5f);if(!existsSync(_0x2b9d1f))return showFileNotFoundError(_0x2b9d1f,_0xfb6c5f),0x1;_0x18b370[_0x3ca651(0x1cb)]&&(console[_0x3ca651(0x210)](_0x3ca651(0x1ae)+_0x18b370[_0x3ca651(0x23b)]),console['error']('YAML\x20file:\x20'+_0x2b9d1f));let _0x3df3dd;try{_0x3df3dd=readFileSync(_0x2b9d1f,_0x3ca651(0x232));}catch(_0x2d5e09){const _0x6c6155=_0x2d5e09 instanceof Error?_0x2d5e09['message']:String(_0x2d5e09);return console[_0x3ca651(0x210)]('Error\x20reading\x20file:\x20'+_0x6c6155),0x1;}const _0x3ee4fa=createCommandSpinner(a23_0x12ece1[_0x3ca651(0x2bf)](_0x3ca651(0x2c7)),{'verbose':_0x18b370[_0x3ca651(0x1cb)]});_0x3ee4fa[_0x3ca651(0x213)]();const _0x328093={'onProgress':_0x396bef=>{const _0x3c6bf8=_0x3ca651;_0x3ee4fa[_0x3c6bf8(0x23e)]=formatProgressMessage(_0x396bef);}};if(_0x18b370[_0x3ca651(0x26d)])_0x328093['master']=!![];if(_0x18b370[_0x3ca651(0x271)])_0x328093['enriched']=!![];_0x18b370[_0x3ca651(0x1f6)]&&(_0x328093[_0x3ca651(0x1f6)]=_0x18b370['attribute']);_0x18b370['behavior']&&(_0x328093[_0x3ca651(0x1e9)]=_0x18b370[_0x3ca651(0x1e9)]);if(_0x18b370[_0x3ca651(0x28c)])_0x328093[_0x3ca651(0x28c)]=_0x18b370[_0x3ca651(0x28c)];let _0x148d0d;try{_0x148d0d=await _0x43f26d[_0x3ca651(0x222)]['validateParentYaml'](_0x3df3dd,_0x328093),_0x3ee4fa['stop']();}catch(_0x5a347f){_0x3ee4fa[_0x3ca651(0x297)]();throw _0x5a347f;}const _0x8c7510=_0x18b370[_0x3ca651(0x28c)]||_0x3ca651(0x2b8);return this[_0x3ca651(0x27a)](_0x148d0d,_0x328093,_0x2b9d1f,_0x8c7510),_0x148d0d[_0x3ca651(0x287)]?0x0:0x1;}['displayValidateResults'](_0x4107ee,_0xe046fb,_0x29e400,_0x2da93c){const _0x4bbba0=a23_0x5f52b8;console[_0x4bbba0(0x210)]('\x0a'+a23_0x12ece1['bold'](_0x4bbba0(0x218))+'\x20'+_0x4107ee[_0x4bbba0(0x26c)]),console[_0x4bbba0(0x210)]('═'[_0x4bbba0(0x1c1)](0x3c)),this[_0x4bbba0(0x1b7)](_0x4107ee);if(typeof _0xe046fb['attribute']===_0x4bbba0(0x293)){this[_0x4bbba0(0x1a5)](_0x4107ee),this[_0x4bbba0(0x244)](_0x4107ee),this['displayPreviewHints'](_0x29e400,_0x2da93c,_0x4bbba0(0x1f6),_0xe046fb[_0x4bbba0(0x1f6)]);return;}if(_0xe046fb[_0x4bbba0(0x1f6)]===!![]){this['displayAttributesStats'](_0x4107ee),this[_0x4bbba0(0x244)](_0x4107ee),this[_0x4bbba0(0x1bf)](_0x29e400,_0x2da93c,_0x4bbba0(0x1ac));return;}if(typeof _0xe046fb[_0x4bbba0(0x1e9)]==='string'){this[_0x4bbba0(0x2cb)](_0x4107ee,_0x2da93c),this['displaySummary'](_0x4107ee),this[_0x4bbba0(0x1bf)](_0x29e400,_0x2da93c,_0x4bbba0(0x1e9),_0xe046fb[_0x4bbba0(0x1e9)]);return;}if(_0xe046fb[_0x4bbba0(0x1e9)]===!![]){this[_0x4bbba0(0x2cb)](_0x4107ee,_0x2da93c),this['displaySummary'](_0x4107ee),this['displayPreviewHints'](_0x29e400,_0x2da93c,_0x4bbba0(0x2b1));return;}this['displayAttributesStats'](_0x4107ee),this['displayBehaviorsStats'](_0x4107ee,_0x2da93c),this['displaySummary'](_0x4107ee),this['displayPreviewHints'](_0x29e400,_0x2da93c,_0x4bbba0(0x237));}[a23_0x5f52b8(0x1bf)](_0x4143ad,_0x5cf5b9,_0x31484f,_0x2a2bbd){const _0xcad1de=a23_0x5f52b8;console[_0xcad1de(0x210)]('\x0a'+a23_0x12ece1[_0xcad1de(0x2bf)](_0xcad1de(0x1e2)));const _0x50e53d=_0x5cf5b9!==_0xcad1de(0x2b8)?'\x20--interval\x20'+_0x5cf5b9:'';if(_0x31484f===_0xcad1de(0x1f6)&&_0x2a2bbd)console[_0xcad1de(0x210)]('\x20\x20'+a23_0x12ece1['dim'](_0xcad1de(0x230)+_0x4143ad+'\x20--attribute\x20\x22'+_0x2a2bbd+'\x22'+_0x50e53d));else{if(_0x31484f==='behavior'&&_0x2a2bbd)console[_0xcad1de(0x210)]('\x20\x20'+a23_0x12ece1[_0xcad1de(0x2bf)](_0xcad1de(0x230)+_0x4143ad+'\x20--behavior\x20\x22'+_0x2a2bbd+'\x22'+_0x50e53d));else(_0x31484f==='attributes'||_0x31484f===_0xcad1de(0x237))&&console['error']('\x20\x20'+a23_0x12ece1[_0xcad1de(0x2bf)](_0xcad1de(0x230)+_0x4143ad+'\x20--attribute\x20\x22<name>\x22'+_0x50e53d));}(_0x31484f===_0xcad1de(0x2b1)||_0x31484f===_0xcad1de(0x237))&&console[_0xcad1de(0x210)]('\x20\x20'+a23_0x12ece1[_0xcad1de(0x2bf)]('tdx\x20segment\x20parent\x20preview\x20'+_0x4143ad+_0xcad1de(0x23a)+_0x50e53d)),_0x31484f===_0xcad1de(0x237)&&console[_0xcad1de(0x210)]('\x20\x20'+a23_0x12ece1[_0xcad1de(0x2bf)](_0xcad1de(0x230)+_0x4143ad+'\x20--enriched'+_0x50e53d));}[a23_0x5f52b8(0x1b7)](_0x43b858){const _0x265de2=a23_0x5f52b8,{master:_0x5bec0d}=_0x43b858,_0x3992af=_0x5bec0d[_0x265de2(0x24e)]?a23_0x12ece1['green']('✔'):a23_0x12ece1[_0x265de2(0x1e8)]('✘');console[_0x265de2(0x210)]('\x0a'+a23_0x12ece1[_0x265de2(0x2bf)](_0x265de2(0x1f7))),console[_0x265de2(0x210)](_0x3992af+'\x20'+a23_0x12ece1['bold'](_0x5bec0d[_0x265de2(0x1ed)]+'.'+_0x5bec0d['table'])),_0x5bec0d[_0x265de2(0x24e)]?_0x5bec0d[_0x265de2(0x1eb)]!==undefined&&console[_0x265de2(0x210)]('\x20\x20'+a23_0x12ece1[_0x265de2(0x2bf)](_0x265de2(0x27e))+'\x20'+a23_0x12ece1[_0x265de2(0x220)](formatRows(_0x5bec0d['rowCount']))):console['error']('\x20\x20'+a23_0x12ece1['red']('Error:')+'\x20'+_0x5bec0d[_0x265de2(0x20d)]);}[a23_0x5f52b8(0x1a5)](_0x16d05f){const _0x2caa25=a23_0x5f52b8;if(_0x16d05f[_0x2caa25(0x1ac)][_0x2caa25(0x255)]===0x0)return;console['error']('\x0a'+a23_0x12ece1[_0x2caa25(0x2bf)](_0x2caa25(0x1e5)));for(const _0x3926e5 of _0x16d05f['attributes']){const _0x2a88ee=_0x3926e5[_0x2caa25(0x24e)]?a23_0x12ece1[_0x2caa25(0x2c4)]('✔'):a23_0x12ece1[_0x2caa25(0x1e8)]('✘');let _0x5aa4ea='';if(_0x3926e5[_0x2caa25(0x24e)]&&_0x3926e5[_0x2caa25(0x277)]!==undefined&&_0x3926e5['coveragePercent']!==undefined){const _0x37b140=_0x3926e5[_0x2caa25(0x288)][_0x2caa25(0x20a)](0x1),_0x5c57e8=_0x3926e5[_0x2caa25(0x288)]>=0x50?a23_0x12ece1[_0x2caa25(0x2c4)]:_0x3926e5['coveragePercent']>=0x32?a23_0x12ece1[_0x2caa25(0x23f)]:a23_0x12ece1[_0x2caa25(0x1e8)];_0x5aa4ea='\x20'+a23_0x12ece1[_0x2caa25(0x2bf)]('Coverage:')+'\x20'+_0x5c57e8(_0x37b140+'%')+'\x20('+formatRows(_0x3926e5[_0x2caa25(0x277)])+_0x2caa25(0x24a);}console[_0x2caa25(0x210)](_0x2a88ee+'\x20'+a23_0x12ece1[_0x2caa25(0x1d8)](_0x3926e5[_0x2caa25(0x26c)])+_0x5aa4ea),console[_0x2caa25(0x210)]('\x20\x20'+a23_0x12ece1[_0x2caa25(0x2bf)]('Source:')+'\x20'+a23_0x12ece1[_0x2caa25(0x1d8)](_0x3926e5[_0x2caa25(0x1ed)]+'.'+_0x3926e5[_0x2caa25(0x280)]));const _0x293857=_0x3926e5[_0x2caa25(0x269)]===_0x3926e5['foreignKey']?a23_0x12ece1[_0x2caa25(0x2bf)]('Join\x20on:')+'\x20'+_0x3926e5[_0x2caa25(0x269)]:a23_0x12ece1[_0x2caa25(0x2bf)](_0x2caa25(0x274))+'\x20'+_0x3926e5['joinKey']+_0x2caa25(0x2a7)+_0x3926e5[_0x2caa25(0x1e1)];console[_0x2caa25(0x210)]('\x20\x20'+_0x293857),console['error']('\x20\x20'+a23_0x12ece1[_0x2caa25(0x2bf)](_0x2caa25(0x1f2))),this['displayColumns'](_0x3926e5['columns']),!_0x3926e5['schemaValid']&&console['error']('\x20\x20'+a23_0x12ece1[_0x2caa25(0x1e8)](_0x2caa25(0x1ad))+'\x20'+_0x3926e5['schemaError']);}}[a23_0x5f52b8(0x2cb)](_0x161b12,_0x4480a4){const _0x2b718b=a23_0x5f52b8;if(_0x161b12[_0x2b718b(0x2b1)][_0x2b718b(0x255)]===0x0)return;console['error']('\x0a'+a23_0x12ece1[_0x2b718b(0x2bf)](_0x2b718b(0x2a1))+'\x20'+a23_0x12ece1['dim']('('+_0x4480a4+')'));for(const _0x296182 of _0x161b12[_0x2b718b(0x2b1)]){const _0x307ff3=_0x296182[_0x2b718b(0x24e)]?a23_0x12ece1[_0x2b718b(0x2c4)]('✔'):a23_0x12ece1['red']('✘');let _0x5c2d40='';if(_0x296182[_0x2b718b(0x24e)]&&_0x296182[_0x2b718b(0x1df)]!==undefined&&_0x296182['totalEvents']!==undefined){const _0x546e45=_0x296182['customerPercent']?.[_0x2b718b(0x20a)](0x1)||'?',_0x126043=(_0x296182['customerPercent']??0x0)>=0x32?a23_0x12ece1[_0x2b718b(0x2c4)]:(_0x296182[_0x2b718b(0x1fb)]??0x0)>=0x14?a23_0x12ece1[_0x2b718b(0x23f)]:a23_0x12ece1[_0x2b718b(0x1e8)];_0x5c2d40='\x20'+a23_0x12ece1[_0x2b718b(0x2bf)](_0x2b718b(0x1dc))+'\x20'+_0x126043(formatRows(_0x296182['customersWithEvents']))+'\x20('+_0x546e45+_0x2b718b(0x1d3)+a23_0x12ece1[_0x2b718b(0x2bf)](_0x2b718b(0x1e3))+'\x20'+a23_0x12ece1[_0x2b718b(0x220)](formatRows(_0x296182[_0x2b718b(0x27c)]));}console[_0x2b718b(0x210)](_0x307ff3+'\x20'+a23_0x12ece1[_0x2b718b(0x1d8)](_0x296182[_0x2b718b(0x26c)])+_0x5c2d40),console[_0x2b718b(0x210)]('\x20\x20'+a23_0x12ece1[_0x2b718b(0x2bf)]('Source:')+'\x20'+a23_0x12ece1[_0x2b718b(0x1d8)](_0x296182[_0x2b718b(0x1ed)]+'.'+_0x296182[_0x2b718b(0x280)]));const _0x56d806=_0x296182[_0x2b718b(0x269)]===_0x296182[_0x2b718b(0x1e1)]?a23_0x12ece1[_0x2b718b(0x2bf)](_0x2b718b(0x1e7))+'\x20'+_0x296182[_0x2b718b(0x269)]:a23_0x12ece1[_0x2b718b(0x2bf)]('Join:')+'\x20'+_0x296182['joinKey']+_0x2b718b(0x2a7)+_0x296182[_0x2b718b(0x1e1)];console[_0x2b718b(0x210)]('\x20\x20'+_0x56d806),console['error']('\x20\x20'+a23_0x12ece1[_0x2b718b(0x2bf)](_0x2b718b(0x1f2))),this[_0x2b718b(0x273)](_0x296182['columns']),!_0x296182[_0x2b718b(0x24e)]&&console[_0x2b718b(0x210)]('\x20\x20'+a23_0x12ece1[_0x2b718b(0x1e8)](_0x2b718b(0x1ad))+'\x20'+_0x296182[_0x2b718b(0x20d)]);}}[a23_0x5f52b8(0x273)](_0x128c44){const _0x55a2ef=a23_0x5f52b8;for(const _0x5b5de7 of _0x128c44){_0x5b5de7['label']===_0x5b5de7['column']||_0x5b5de7[_0x55a2ef(0x22b)]==='*'?console[_0x55a2ef(0x210)]('\x20\x20\x20\x20-\x20'+_0x5b5de7['label']):console['error']('\x20\x20\x20\x20-\x20'+_0x5b5de7[_0x55a2ef(0x2ba)]+'\x20'+a23_0x12ece1[_0x55a2ef(0x2bf)]('('+_0x5b5de7[_0x55a2ef(0x22b)]+')'));}}[a23_0x5f52b8(0x244)](_0x50e1c3){const _0x25febc=a23_0x5f52b8;console[_0x25febc(0x210)]('─'[_0x25febc(0x1c1)](0x3c));if(_0x50e1c3[_0x25febc(0x285)][_0x25febc(0x255)]>0x0){console[_0x25febc(0x210)]('\x0a'+a23_0x12ece1[_0x25febc(0x1e8)](_0x25febc(0x1e4)));for(const _0x20aea3 of _0x50e1c3[_0x25febc(0x285)]){console['error']('\x20\x20'+a23_0x12ece1['red']('•')+'\x20'+_0x20aea3);}}_0x50e1c3[_0x25febc(0x287)]&&console[_0x25febc(0x210)]('\x0a'+a23_0x12ece1['green']('✔')+_0x25febc(0x2ac));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a23_0x5f52b8(0x26c)]=a23_0x5f52b8(0x289);['description']=a23_0x5f52b8(0x229);async['execute'](_0x1f11cd){const _0x5468c0=a23_0x5f52b8,{options:_0x3136a0,args:_0x38792e,tdx:_0x573914}=_0x1f11cd,_0x156fb1=_0x3136a0,_0x59e035=_0x38792e[0x0]||_0x3136a0[_0x5468c0(0x240)];if(!_0x59e035)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+'Options\x20(one\x20required):\x0a'+_0x5468c0(0x1c7)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x5468c0(0x235)+_0x5468c0(0x263)),0x1;if(!_0x156fb1['master']&&!_0x156fb1[_0x5468c0(0x1f6)]&&!_0x156fb1[_0x5468c0(0x1e9)]&&!_0x156fb1[_0x5468c0(0x271)])return console[_0x5468c0(0x210)](a23_0x12ece1[_0x5468c0(0x1e8)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x5468c0(0x210)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x5468c0(0x210)](_0x5468c0(0x286)),console['error'](_0x5468c0(0x2bd)),console[_0x5468c0(0x210)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x5468c0(0x210)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x5468c0(0x210)](_0x5468c0(0x1aa)),0x1;const _0x10b75c=resolveYamlFile(_0x59e035);if(!existsSync(_0x10b75c))return showFileNotFoundError(_0x10b75c,_0x59e035),0x1;_0x156fb1[_0x5468c0(0x1cb)]&&(console[_0x5468c0(0x210)](_0x5468c0(0x1ae)+_0x156fb1[_0x5468c0(0x23b)]),console[_0x5468c0(0x210)](_0x5468c0(0x25d)+_0x10b75c));let _0x12b12c;try{_0x12b12c=readFileSync(_0x10b75c,_0x5468c0(0x232));}catch(_0x182381){const _0x1f420c=_0x182381 instanceof Error?_0x182381[_0x5468c0(0x226)]:String(_0x182381);return console[_0x5468c0(0x210)](_0x5468c0(0x202)+_0x1f420c),0x1;}let _0x487828;try{_0x487828=parseDef(_0x12b12c);}catch(_0x411728){const _0x4f6f1e=_0x411728 instanceof Error?_0x411728[_0x5468c0(0x226)]:String(_0x411728);return console[_0x5468c0(0x210)](a23_0x12ece1[_0x5468c0(0x1e8)](_0x5468c0(0x26f)+_0x4f6f1e)),0x1;}if(_0x156fb1[_0x5468c0(0x1f6)]===!![]||_0x156fb1['attribute']===''){const _0x422779=_0x487828[_0x5468c0(0x1ac)]?.[_0x5468c0(0x1bd)](_0x2cf4b7=>_0x2cf4b7[_0x5468c0(0x26c)])||[];if(_0x422779[_0x5468c0(0x255)]===0x0)console[_0x5468c0(0x210)](a23_0x12ece1[_0x5468c0(0x1e8)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console['error'](a23_0x12ece1[_0x5468c0(0x1e8)](_0x5468c0(0x2a2))),console[_0x5468c0(0x210)](_0x5468c0(0x28e));for(const _0x1fac31 of _0x422779){console['error']('\x20\x20'+a23_0x12ece1[_0x5468c0(0x220)](_0x1fac31));}console[_0x5468c0(0x210)](_0x5468c0(0x239)+_0x59e035+_0x5468c0(0x1d4)+_0x422779[0x0]+'\x22');}return 0x1;}if(_0x156fb1[_0x5468c0(0x1e9)]===!![]||_0x156fb1[_0x5468c0(0x1e9)]===''){const _0x2eb687=_0x487828[_0x5468c0(0x2b1)]?.[_0x5468c0(0x1bd)](_0x1ca900=>_0x1ca900[_0x5468c0(0x26c)])||[];if(_0x2eb687['length']===0x0)console[_0x5468c0(0x210)](a23_0x12ece1[_0x5468c0(0x1e8)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x5468c0(0x210)](a23_0x12ece1['red'](_0x5468c0(0x1d0))),console[_0x5468c0(0x210)]('Available\x20behaviors:');for(const _0x59eb1c of _0x2eb687){console[_0x5468c0(0x210)]('\x20\x20'+a23_0x12ece1[_0x5468c0(0x220)](_0x59eb1c));}console[_0x5468c0(0x210)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x59e035+_0x5468c0(0x1c6)+_0x2eb687[0x0]+'\x22');}return 0x1;}const _0x68c52e=createCommandSpinner(a23_0x12ece1[_0x5468c0(0x2bf)]('Fetching\x20sample\x20data...'),{'verbose':_0x156fb1['verbose']});_0x68c52e['start']();const _0x27c72e={'onProgress':_0x502737=>{_0x68c52e['text']=formatProgressMessage(_0x502737);}};if(_0x156fb1[_0x5468c0(0x26d)])_0x27c72e[_0x5468c0(0x26d)]=!![];if(_0x156fb1[_0x5468c0(0x1f6)]&&typeof _0x156fb1['attribute']===_0x5468c0(0x293))_0x27c72e[_0x5468c0(0x1f6)]=_0x156fb1['attribute'];if(_0x156fb1[_0x5468c0(0x1e9)]&&typeof _0x156fb1['behavior']===_0x5468c0(0x293))_0x27c72e[_0x5468c0(0x1e9)]=_0x156fb1['behavior'];if(_0x156fb1[_0x5468c0(0x271)])_0x27c72e['enriched']=!![];if(_0x156fb1[_0x5468c0(0x28c)])_0x27c72e[_0x5468c0(0x28c)]=_0x156fb1['interval'];let _0x4868cf;try{_0x4868cf=await _0x573914[_0x5468c0(0x222)][_0x5468c0(0x2c5)](_0x12b12c,_0x27c72e),_0x68c52e[_0x5468c0(0x297)]();}catch(_0x122691){_0x68c52e[_0x5468c0(0x297)]();throw _0x122691;}return await this[_0x5468c0(0x1c9)](_0x4868cf,{'master':_0x156fb1[_0x5468c0(0x26d)],'attribute':typeof _0x156fb1[_0x5468c0(0x1f6)]===_0x5468c0(0x293)?_0x156fb1[_0x5468c0(0x1f6)]:undefined,'behavior':typeof _0x156fb1[_0x5468c0(0x1e9)]===_0x5468c0(0x293)?_0x156fb1[_0x5468c0(0x1e9)]:undefined,'enriched':_0x156fb1[_0x5468c0(0x271)]}),_0x4868cf[_0x5468c0(0x287)]?0x0:0x1;}async[a23_0x5f52b8(0x1c9)](_0x4acab8,_0x40a26a){const _0x13bdd6=a23_0x5f52b8;console[_0x13bdd6(0x210)]('\x0a'+a23_0x12ece1[_0x13bdd6(0x1d8)](_0x13bdd6(0x2a5))+'\x20'+_0x4acab8[_0x13bdd6(0x26c)]),console[_0x13bdd6(0x210)]('═'['repeat'](0x3c));if(_0x40a26a[_0x13bdd6(0x26d)]&&_0x4acab8[_0x13bdd6(0x265)]){const _0x4ac9f9=a23_0x12ece1[_0x13bdd6(0x2bf)](_0x13bdd6(0x1a1))+'\x20'+a23_0x12ece1[_0x13bdd6(0x1d8)](_0x4acab8['master'][_0x13bdd6(0x1ed)]+'.'+_0x4acab8[_0x13bdd6(0x26d)]['table']);await this[_0x13bdd6(0x1f9)](_0x4ac9f9,_0x4acab8['sampleData']);}else{if(_0x40a26a[_0x13bdd6(0x1f6)]&&_0x4acab8[_0x13bdd6(0x265)]){const _0x3a3ffb=a23_0x12ece1[_0x13bdd6(0x2bf)]('Attribute:')+'\x20'+a23_0x12ece1[_0x13bdd6(0x1d8)](_0x40a26a[_0x13bdd6(0x1f6)]);await this[_0x13bdd6(0x1f9)](_0x3a3ffb,_0x4acab8['sampleData']);}else{if(_0x40a26a[_0x13bdd6(0x1e9)]&&_0x4acab8[_0x13bdd6(0x265)]){const _0x578331=a23_0x12ece1['dim'](_0x13bdd6(0x1fe))+'\x20'+a23_0x12ece1['bold'](_0x40a26a[_0x13bdd6(0x1e9)]);await this['displaySampleData'](_0x578331,_0x4acab8[_0x13bdd6(0x265)]);}else{if(_0x40a26a[_0x13bdd6(0x271)]&&_0x4acab8[_0x13bdd6(0x265)]){const _0x5e384f=a23_0x12ece1['dim'](_0x13bdd6(0x1b5))+'\x20'+a23_0x12ece1[_0x13bdd6(0x1d8)](_0x13bdd6(0x248));await this[_0x13bdd6(0x1f9)](_0x5e384f,_0x4acab8[_0x13bdd6(0x265)]);}else!_0x4acab8[_0x13bdd6(0x265)]&&console[_0x13bdd6(0x210)](_0x13bdd6(0x2b2));}}}if(_0x4acab8['errors'][_0x13bdd6(0x255)]>0x0){console[_0x13bdd6(0x210)]('─'[_0x13bdd6(0x1c1)](0x3c)),console[_0x13bdd6(0x210)]('\x0a'+a23_0x12ece1[_0x13bdd6(0x1e8)](_0x13bdd6(0x1e4)));for(const _0x37757e of _0x4acab8[_0x13bdd6(0x285)]){console['error']('\x20\x20'+a23_0x12ece1[_0x13bdd6(0x1e8)]('•')+'\x20'+_0x37757e);}}}async['displaySampleData'](_0x284e8f,_0x3242df){const _0x17b309=a23_0x5f52b8;if(_0x3242df['length']===0x0){console[_0x17b309(0x210)]('\x0a'+_0x284e8f),console[_0x17b309(0x210)](_0x17b309(0x25e));return;}console[_0x17b309(0x210)]('\x0a'+_0x284e8f);const _0x4cbfb3=Object[_0x17b309(0x1b4)](_0x3242df[0x0])[_0x17b309(0x1bd)](_0x43028c=>({'name':_0x43028c,'type':typeof _0x3242df[0x0][_0x43028c]==='number'?_0x17b309(0x24c):_0x17b309(0x2aa)})),_0x10ea68={'queryId':_0x17b309(0x26a),'columns':_0x4cbfb3,'data':_0x3242df,'stats':{'state':_0x17b309(0x268),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3242df[_0x17b309(0x255)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5a6b85=formatAsTable(_0x10ea68,_0x3242df[_0x17b309(0x255)],!![]);await writeOutput(_0x5a6b85,undefined,_0x17b309(0x280));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a23_0x5f52b8(0x26c)]='segment:parent:run';[a23_0x5f52b8(0x284)]=a23_0x5f52b8(0x1ab);async[a23_0x5f52b8(0x234)](_0x11b94c){const _0x305434=a23_0x5f52b8,{options:_0x21c0b7,args:_0x28dbe2,tdx:_0x5f1b3c}=_0x11b94c,_0xebed47=_0x21c0b7,_0x32a4ca=_0x28dbe2[0x0]||_0x21c0b7['parentSegment'];if(!_0x32a4ca)return showParentSegmentNotSetError(_0x305434(0x1b3)+_0x305434(0x1b1)),0x1;const _0x351718=resolveYamlFile(_0x32a4ca);if(existsSync(_0x351718)){_0xebed47[_0x305434(0x1cb)]&&console[_0x305434(0x210)]('Found\x20YAML\x20file:\x20'+_0x351718);let _0x1597d5;try{_0x1597d5=readFileSync(_0x351718,_0x305434(0x232));}catch(_0x33e522){const _0x1c0ef8=_0x33e522 instanceof Error?_0x33e522[_0x305434(0x226)]:String(_0x33e522);return console[_0x305434(0x210)](_0x305434(0x202)+_0x1c0ef8),0x1;}const _0x51f5bd=await withSpinner(_0x305434(0x257),()=>_0x5f1b3c['segment'][_0x305434(0x2a4)](_0x1597d5),{'verbose':_0xebed47[_0x305434(0x1cb)]}),_0x401a90=_0x51f5bd[_0x305434(0x29c)],{isNew:_0x9e8ad8,name:_0x4e17ec,hasChanges:_0x9468a6,diffFormatted:_0x43ff34}=_0x401a90;if(_0x9468a6){_0x9e8ad8?console['error'](_0x305434(0x25f)+_0x4e17ec+'\x27:'):console[_0x305434(0x210)](_0x305434(0x264)+_0x4e17ec+'\x27:');console[_0x305434(0x210)]('─'[_0x305434(0x1c1)](0x3c)),console['error'](_0x43ff34),console[_0x305434(0x210)]('─'[_0x305434(0x1c1)](0x3c));const _0x33a7c2=_0x9e8ad8?_0x305434(0x1a3)+_0x4e17ec+_0x305434(0x1f0):_0x305434(0x272)+_0x4e17ec+_0x305434(0x1f0);if(!_0xebed47[_0x305434(0x23c)]){const _0x719ea4=await confirmKey(_0x33a7c2);if(!_0x719ea4)return console[_0x305434(0x210)](_0x305434(0x22c)),0x1;}const _0xd995de=_0x9e8ad8?_0x305434(0x219):'Updating';await withSpinner(_0xd995de+_0x305434(0x246)+_0x4e17ec+_0x305434(0x215),()=>_0x401a90[_0x305434(0x281)](),{'verbose':_0xebed47[_0x305434(0x1cb)]});const _0x2813a6=_0x9e8ad8?_0x305434(0x1c3):_0x305434(0x296);console[_0x305434(0x210)]('✔\x20'+_0x2813a6+_0x305434(0x246)+_0x4e17ec+'\x27');}else console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x4e17ec+_0x305434(0x2ca));}const _0x5d7056=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x32a4ca+_0x305434(0x215),()=>_0x5f1b3c['segment'][_0x305434(0x1a7)](_0x32a4ca),{'verbose':_0xebed47[_0x305434(0x1cb)]}),_0x4bd63b=_0x5d7056[_0x305434(0x29c)],_0x365716=getConsoleUrl(_0xebed47[_0x305434(0x23b)],_0x305434(0x1fc)+_0x4bd63b[_0x305434(0x208)]+_0x305434(0x211)+_0x4bd63b[_0x305434(0x1ea)]+'/attempt/'+_0x4bd63b[_0x305434(0x1d1)]);return console[_0x305434(0x210)](_0x305434(0x200)),console[_0x305434(0x210)]('\x20\x20'+a23_0x12ece1[_0x305434(0x2bf)](_0x305434(0x2bb))+'\x20'+_0x4bd63b[_0x305434(0x2ab)]),console[_0x305434(0x210)]('\x20\x20'+a23_0x12ece1[_0x305434(0x2bf)](_0x305434(0x25b))+'\x20'+_0x4bd63b[_0x305434(0x1ef)]),console[_0x305434(0x210)]('\x20\x20'+a23_0x12ece1[_0x305434(0x2bf)](_0x305434(0x1c4))+'\x20'+_0x4bd63b[_0x305434(0x1ea)]),console[_0x305434(0x210)]('\x20\x20'+a23_0x12ece1['dim'](_0x305434(0x207))+'\x20'+_0x4bd63b[_0x305434(0x1d1)]),console[_0x305434(0x210)]('\x20\x20'+_0x365716),console[_0x305434(0x210)]('\x0a'+a23_0x12ece1['dim']('To\x20cancel:')+_0x305434(0x1d2)+_0x4bd63b[_0x305434(0x1d1)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a23_0x5f52b8(0x26c)]=a23_0x5f52b8(0x28f);[a23_0x5f52b8(0x284)]=a23_0x5f52b8(0x251);async['execute'](_0x3d351e){const _0x40250e=a23_0x5f52b8,{options:_0x4cc18e,args:_0x4cadb5,tdx:_0x385745}=_0x3d351e,_0x455c8e=_0x4cadb5[0x0]||_0x4cc18e[_0x40250e(0x240)];if(!_0x455c8e)return showParentSegmentNotSetError(_0x40250e(0x29e)+_0x40250e(0x2a6)),0x1;_0x4cc18e['verbose']&&(console[_0x40250e(0x210)]('Site:\x20'+_0x4cc18e[_0x40250e(0x23b)]),console['error'](_0x40250e(0x295)+_0x455c8e));const _0x2ff2c8=await withSpinner(_0x40250e(0x1ca)+_0x455c8e+_0x40250e(0x215),()=>_0x385745['segment'][_0x40250e(0x238)](_0x455c8e),{'verbose':_0x4cc18e['verbose']}),_0x5f56ca=_0x2ff2c8['data'];console['error']('✔\x20Found\x20'+_0x5f56ca[_0x40250e(0x255)]+'\x20field'+(_0x5f56ca[_0x40250e(0x255)]!==0x1?'s':''));if(_0x4cc18e[_0x40250e(0x1c2)]||_0x4cc18e[_0x40250e(0x291)])return await handleSDKOutput(_0x5f56ca,_0x4cc18e),0x0;return displayFieldsHumanReadable(_0x5f56ca,_0x455c8e),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a23_0x5f52b8(0x26c)]=a23_0x5f52b8(0x2b4);['description']=a23_0x5f52b8(0x279);async[a23_0x5f52b8(0x234)](_0x44d66c){const _0x1e0087=a23_0x5f52b8,{options:_0x6d40,args:_0x425ff8,tdx:_0x3eb7fc}=_0x44d66c,_0x345c0f=_0x6d40,_0x52bc6c=_0x425ff8[0x0]||_0x6d40[_0x1e0087(0x240)];if(!_0x52bc6c)return showParentSegmentNotSetError(_0x1e0087(0x1b9)+_0x1e0087(0x24f)+_0x1e0087(0x1ba)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x6d40[_0x1e0087(0x1cb)]&&(console['error']('Site:\x20'+_0x6d40[_0x1e0087(0x23b)]),console['error'](_0x1e0087(0x295)+_0x52bc6c));const _0x30c9d1=await withSpinner(_0x1e0087(0x2b3)+_0x52bc6c+_0x1e0087(0x215),()=>_0x3eb7fc[_0x1e0087(0x222)][_0x1e0087(0x1cd)](_0x52bc6c),{'verbose':_0x6d40[_0x1e0087(0x1cb)]}),_0x1e931b=_0x30c9d1[_0x1e0087(0x29c)];if(_0x345c0f[_0x1e0087(0x236)]){const _0x5ebff6=getConsoleNextUrl(_0x345c0f[_0x1e0087(0x23b)],_0x1e0087(0x21e)+_0x1e931b['id']);return console[_0x1e0087(0x210)](a23_0x12ece1[_0x1e0087(0x2c4)]('✔')+_0x1e0087(0x260)+a23_0x12ece1['cyan'](_0x5ebff6)),openBrowser(_0x5ebff6),0x0;}return await handleSingleObjectOutput(_0x1e931b,_0x6d40),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a23_0x5f52b8(0x26c)]=a23_0x5f52b8(0x2b7);[a23_0x5f52b8(0x284)]=a23_0x5f52b8(0x243);async[a23_0x5f52b8(0x234)](_0x556b0c){const _0x39611c=a23_0x5f52b8,{options:_0x4aec48,args:_0x1c62ed,tdx:_0x4b8430}=_0x556b0c,_0x2a6a86=_0x1c62ed[0x0]||_0x4aec48[_0x39611c(0x240)];if(!_0x2a6a86)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+_0x39611c(0x1db)),0x1;_0x4aec48[_0x39611c(0x1cb)]&&(console[_0x39611c(0x210)]('Site:\x20'+_0x4aec48[_0x39611c(0x23b)]),console[_0x39611c(0x210)]('Parent\x20segment:\x20'+_0x2a6a86));const _0x765755=await withSpinner(_0x39611c(0x205)+_0x2a6a86+_0x39611c(0x215),()=>_0x4b8430['segment'][_0x39611c(0x217)](_0x2a6a86),{'verbose':_0x4aec48[_0x39611c(0x1cb)]}),_0x5b1cc4=_0x765755[_0x39611c(0x29c)],_0x20e3b0=await withSpinner(_0x39611c(0x2c9)+_0x2a6a86+'\x27...',()=>_0x4b8430[_0x39611c(0x222)][_0x39611c(0x1c5)](_0x5b1cc4),{'verbose':_0x4aec48[_0x39611c(0x1cb)]}),_0x32a28e=await executeSchemaQuery(_0x20e3b0[_0x39611c(0x29c)],_0x4b8430,_0x4aec48);return await handleQueryOutput(_0x32a28e,_0x4aec48),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a23_0x5f52b8(0x1fd);[a23_0x5f52b8(0x284)]=a23_0x5f52b8(0x258);async[a23_0x5f52b8(0x234)](_0x1ebb96){const _0x5aafe5=a23_0x5f52b8,{options:_0x3d5d92,args:_0x23664b,tdx:_0x19764c}=_0x1ebb96,_0xc7e205=_0x23664b[0x0]||_0x3d5d92[_0x5aafe5(0x240)];if(!_0xc7e205)return showParentSegmentNotSetError(_0x5aafe5(0x25c)+_0x5aafe5(0x249)),0x1;_0x3d5d92[_0x5aafe5(0x1cb)]&&(console[_0x5aafe5(0x210)](_0x5aafe5(0x1ae)+_0x3d5d92[_0x5aafe5(0x23b)]),console[_0x5aafe5(0x210)](_0x5aafe5(0x295)+_0xc7e205));const _0x155c6c=await withSpinner(_0x5aafe5(0x205)+_0xc7e205+_0x5aafe5(0x215),()=>_0x19764c[_0x5aafe5(0x222)]['resolveParentId'](_0xc7e205),{'verbose':_0x3d5d92[_0x5aafe5(0x1cb)]}),_0x24b44d=_0x155c6c['data'],_0x1456e4=await withSpinner(_0x5aafe5(0x2c9)+_0xc7e205+'\x27...',()=>_0x19764c[_0x5aafe5(0x222)][_0x5aafe5(0x1c5)](_0x24b44d),{'verbose':_0x3d5d92[_0x5aafe5(0x1cb)]}),_0x15801c=_0x1456e4[_0x5aafe5(0x29c)];return _0x3d5d92[_0x5aafe5(0x2c2)]===_0x5aafe5(0x1c2)||_0x3d5d92[_0x5aafe5(0x2c2)]===_0x5aafe5(0x291)?await handleSDKOutput([{'sql':_0x15801c}],_0x3d5d92):console[_0x5aafe5(0x278)](_0x15801c),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a23_0x5f52b8(0x2c6);[a23_0x5f52b8(0x284)]=a23_0x5f52b8(0x1c8);async['execute'](_0x590217){const _0x321f23=a23_0x5f52b8,{options:_0xae10bb,args:_0x10218f,tdx:_0x49da8e}=_0x590217,_0x5caf1b=_0x10218f[0x0]||_0xae10bb['parentSegment'];if(!_0x5caf1b)return showParentSegmentNotSetError(_0x321f23(0x1c0)+_0x321f23(0x253)),0x1;_0xae10bb[_0x321f23(0x1cb)]&&(console['error'](_0x321f23(0x1ae)+_0xae10bb[_0x321f23(0x23b)]),console[_0x321f23(0x210)](_0x321f23(0x295)+_0x5caf1b));const _0x2279d6=await withSpinner(_0x321f23(0x205)+_0x5caf1b+_0x321f23(0x215),()=>_0x49da8e['segment'][_0x321f23(0x217)](_0x5caf1b),{'verbose':_0xae10bb[_0x321f23(0x1cb)]}),_0xcb5883=_0x2279d6['data'],_0x1da526=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5caf1b+_0x321f23(0x215),()=>_0x49da8e['segment']['getParentSQL'](_0xcb5883),{'verbose':_0xae10bb[_0x321f23(0x1cb)]});let _0xb5a681=_0x1da526[_0x321f23(0x29c)];const _0x3e038f=resolveLimit(_0xae10bb[_0x321f23(0x1f5)],DEFAULT_DISPLAY_LIMIT),_0x53d1cb=/\bLIMIT\s+\d+/i[_0x321f23(0x231)](_0xb5a681);!_0x53d1cb&&(_0xb5a681=_0xb5a681[_0x321f23(0x29f)]()['replace'](/;+$/,''),_0xb5a681=_0x321f23(0x1fa)+_0xb5a681+_0x321f23(0x227)+_0x3e038f);_0xae10bb[_0x321f23(0x1cb)]&&console['error'](_0x321f23(0x216)+_0xb5a681);const _0x5dabd6=await withProgressSpinner(_0x321f23(0x267),async _0x537961=>{const _0x5afbba=_0x321f23,_0x4154d2=await _0x49da8e['query'][_0x5afbba(0x234)](_0xb5a681,{'catalog':'td','schema':_0x5afbba(0x27d),'onJobId':_0x4c496b=>{const _0x193a66=_0x5afbba;_0x537961[_0x193a66(0x22f)](_0x4c496b);}});return _0x4154d2;},{'verbose':_0xae10bb['verbose']}),_0x8300f4=_0x5dabd6[_0x321f23(0x29c)],_0x53c881=_0x8300f4[_0x321f23(0x20c)]?'\x20[Job\x20ID:\x20'+_0x8300f4[_0x321f23(0x20c)]+']':'';return console[_0x321f23(0x210)](_0x321f23(0x245)+_0x8300f4['stats'][_0x321f23(0x241)][_0x321f23(0x2a8)]()+'\x20rows\x20'+(_0x321f23(0x1f4)+formatElapsed(_0x8300f4[_0x321f23(0x250)][_0x321f23(0x2a0)])+_0x53c881)),await handleQueryOutput(_0x8300f4,_0xae10bb),0x0;}}
|
|
1
|
+
const a23_0x250cc6=a23_0x3769;(function(_0xe63bb6,_0xb0423a){const _0x2dfa7a=a23_0x3769,_0x17a5f8=_0xe63bb6();while(!![]){try{const _0x5350a5=parseInt(_0x2dfa7a(0x1d5))/0x1+parseInt(_0x2dfa7a(0x156))/0x2+-parseInt(_0x2dfa7a(0x1e6))/0x3*(-parseInt(_0x2dfa7a(0x24f))/0x4)+-parseInt(_0x2dfa7a(0x1c1))/0x5*(parseInt(_0x2dfa7a(0x1e5))/0x6)+-parseInt(_0x2dfa7a(0x242))/0x7*(parseInt(_0x2dfa7a(0x232))/0x8)+-parseInt(_0x2dfa7a(0x23a))/0x9+parseInt(_0x2dfa7a(0x140))/0xa;if(_0x5350a5===_0xb0423a)break;else _0x17a5f8['push'](_0x17a5f8['shift']());}catch(_0x50201b){_0x17a5f8['push'](_0x17a5f8['shift']());}}}(a23_0x4814,0xb0254));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a23_0x3fb4f2 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a23_0xda7a3c 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 a23_0x4814(){const _0x1c8ec6=['\x0a✔\x20Workflow\x20started','1495qZtazR','YAML\x20file:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20--attribute\x20\x22','✔\x20No\x20changes\x20-\x20\x27','displayPreviewResults','customerGroup','Error\x20reading\x20file:\x20','apply','Errors:','parentSegment','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Behaviors','toLocaleString','toFixed','stop','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Columns:','filter','571139DuBgyu','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20--behavior\x20\x22<name>\x22','format','/app/dw/parentSegments/','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','✔\x20Created\x20parent\x20segment\x20\x27','site','pushParentYaml','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','interval','\x20tdx\x20wf\x20attempt\x20','behavior','Master\x20Table','16194EkxaXW','616263yohwIs','\x20field','win32','data','open','table','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x0a⚠️\x20\x20Both\x20','segment:parent:create','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Options:\x0a','addAttributesFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','map','Events:','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','log','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','SELECT\x20*\x20FROM\x20(\x0a','Join\x20on:','errors','Session:','addBehaviors','\x0aNo\x20sample\x20data\x20available','Attributes','Executing\x20parent\x20segment\x20query...','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','xdg-open','List\x20parent\x20segments','segment:parent:push','getParentSQL','Coverage:','/\x20directories\x20exist.','✔\x20Updated\x20parent\x20segment\x20\x27','repeat','Analyzing\x20changes...','Options\x20(one\x20required):\x0a','output','dim','displayMasterInfo','scheduleType','Enriched:','displayPreviewHints','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','join','/\x20and\x20','segment:parent:list','runParent','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20\x20No\x20sample\x20data\x20available','\x20\x20\x20\x20-\x20','updateParent','Preview:','\x27\x20and\x20run\x20workflow?','/\x20→\x20','\x20Opening\x20','Join:','in\x20','displayBehaviorsStats','Attempt:','Created','run','Found\x20YAML\x20file:\x20','displayAttributesStats','Apply\x20changes\x20to\x20\x27','preview','Error:','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','schemaError','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20Configuration\x20is\x20valid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','unref','query','Status:','74056Bwslsq','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','matchedCount','Listing\x20fields\x20for\x20\x27','previewParentYaml','workflowSessionId','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Available\x20attributes:','8632953mSgvwh','name','label','segment','addAttributes','jsonl','column','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','357WWsMZI','Fetching\x20current\x20configuration\x20for\x20\x27','\x20=\x20','test','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Options:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','List\x20available\x20fields\x20for\x20segmentation','error','workflowAttemptId','bold','16NbnXIM','✔\x20Found\x20','To\x20cancel:','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x27\x20is\x20already\x20up\x20to\x20date','createParent','schemaValid','To\x20view\x20sample\x20data:','sort','displayValidateResults','pullParentYaml','rowCount','limit','Updating\x20parent\x20segment\x20\x27','.yml','\x20--interval\x20','start','green','Error:\x20--behavior\x20requires\x20a\x20name\x0a','segment:parent:sql','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x0a⚠️\x20\x20Migrating:\x20','red','message','yes','\x0aChanges\x20to\x20\x27','utf-8','resolveParentId','audienceId','verbose','Updated','master','tdx\x20segment\x20parent\x20preview\x20','%)\x20','enriched','match','using\x20the\x20default\x20path:\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','6634100tlNocb','setJobId','\x0aChanges\x20to\x20apply\x20to\x20\x27','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','behaviorsFile','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','/sessions/','elapsedTimeMillis','totalEvents','attribute','attributes','listFields','segment:parent:desc','✘\x20Failed\x20to\x20rename\x20directory:\x20','timezone','\x0aNew\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Master\x20+\x20Attributes','string','Creating\x20parent\x20segment\x20\x27','\x27...','replace','1807168uYHHuU','Audience\x20ID:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','✔\x20Query\x20completed:\x20Processed\x20','parent_segment','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','customerPercent','dirname','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','text','isDirectory','execute','Creating','jobId','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:parent:show','allValid','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Attribute:','localeCompare','Fetching\x20SQL\x20for\x20\x27','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','-1d','json','varchar','Parent\x20segment:\x20','processedRows','displayColumns','\x5c$&','customersWithEvents','Pattern:\x20','Updating','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Error:\x20--database\x20and\x20--table\x20are\x20required','Site:\x20','\x20--attribute\x20\x22<name>\x22','database','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','darwin','description','\x27\x20with\x20ID:\x20','foreignKey','Output\x20file:\x20','behaviors','FINISHED','Resolving\x20parent\x20segment\x20\x27','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','No\x20parent\x20segments\x20match\x20pattern:\x20','Database:\x20','session','.yaml','joinKey','sampleData','✔\x20Renamed\x20directory\x20to\x20','all','status','👥\x20','double','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Create\x20parent\x20segment\x20\x27','\x20Context\x20set:\x20','\x27\x20is\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','use','Name:\x20','\x20rows)','columns','/app/workflows/','length','Master:','parent_segments','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','stats','Aborted.','coveragePercent','Error:\x20File\x20not\x20found:\x20','getParentFull','endsWith','\x20parent\x20segment\x20\x27','keys','Rows:','addBehaviorsFile','Validate:','customerGroupFile','yellow','Show\x20parent\x20segment\x20details','\x20No\x20changes\x20-\x20','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','scheduleOption','Overwrite\x20\x27','Validating\x20configuration...','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Fetching\x20parent\x20segment\x20\x27','trim','displaySummary','\x20--behavior\x20\x22','cyan','displaySampleData','platform','segment:parent:fields'];a23_0x4814=function(){return _0x1c8ec6;};return a23_0x4814();}const PARENT_SEGMENT_DIR=a23_0x250cc6(0x19f),LEGACY_PARENT_SEGMENT_DIR=a23_0x250cc6(0x15a);function openBrowser(_0x16cdf3){const _0x5227a9=a23_0x250cc6,_0x42e9ae=process[_0x5227a9(0x1be)],_0x329488=_0x42e9ae===_0x5227a9(0x17f)?_0x5227a9(0x1ea):_0x42e9ae===_0x5227a9(0x1e8)?'start':_0x5227a9(0x202);spawn(_0x329488,[_0x16cdf3],{'detached':!![],'stdio':'ignore'})[_0x5227a9(0x22f)]();}function migrateLegacyDirectory(){const _0x2a1459=a23_0x250cc6;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x440425=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x440425[_0x2a1459(0x162)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x2a1459(0x24c)](a23_0xda7a3c[_0x2a1459(0x1b0)](_0x2a1459(0x1ed)+LEGACY_PARENT_SEGMENT_DIR+_0x2a1459(0x214)+PARENT_SEGMENT_DIR+_0x2a1459(0x207))),console[_0x2a1459(0x24c)](a23_0xda7a3c[_0x2a1459(0x20d)](_0x2a1459(0x1d2)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x2a1459(0x24c)](a23_0xda7a3c[_0x2a1459(0x1b0)](_0x2a1459(0x12f)+LEGACY_PARENT_SEGMENT_DIR+_0x2a1459(0x21d)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x2a1459(0x24c)](a23_0xda7a3c[_0x2a1459(0x12b)](_0x2a1459(0x18e)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x10bf2c){const _0x54f4cd=_0x10bf2c instanceof Error?_0x10bf2c['message']:String(_0x10bf2c);return console[_0x2a1459(0x24c)](a23_0xda7a3c['red'](_0x2a1459(0x14d)+_0x54f4cd+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x26c5bd){const _0xa9892e=a23_0x250cc6;return migrateLegacyDirectory(),super[_0xa9892e(0x224)](_0x26c5bd);}}function resolveYamlFile(_0x5a7be1){const _0x2f43c2=a23_0x250cc6;if(_0x5a7be1[_0x2f43c2(0x1a9)](_0x2f43c2(0x128))||_0x5a7be1['endsWith'](_0x2f43c2(0x18b)))return _0x5a7be1;return a23_0x3fb4f2[_0x2f43c2(0x213)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5a7be1)+_0x2f43c2(0x128));}function formatProgressMessage(_0xa59a2a){const _0x6b9133=a23_0x250cc6,_0x179ef5=_0xa59a2a[_0x6b9133(0x13d)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x179ef5){const [,_0x49eaab,_0x105285,_0x5a3157='']=_0x179ef5;return a23_0xda7a3c[_0x6b9133(0x20d)](_0x49eaab+':')+'\x20'+_0x105285+a23_0xda7a3c[_0x6b9133(0x20d)](_0x5a3157);}return a23_0xda7a3c['dim'](_0xa59a2a);}function showFileNotFoundError(_0x3726fb,_0xcd0671){const _0x11a8ea=a23_0x250cc6;console['error'](a23_0xda7a3c[_0x11a8ea(0x130)](_0x11a8ea(0x1a7)+_0x3726fb+'\x0a')),console['error'](a23_0xda7a3c['cyan']('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0xcd0671+_0x11a8ea(0x15f)));}function showParentSegmentNotSetError(_0x4b85d0){const _0x4990e2=a23_0x250cc6;console[_0x4990e2(0x24c)](a23_0xda7a3c[_0x4990e2(0x1b0)](_0x4990e2(0x1df))),console[_0x4990e2(0x24c)](_0x4b85d0);}export class ParentSegmentListCommand extends BaseCommand{['name']=a23_0x250cc6(0x215);['description']=a23_0x250cc6(0x203);async[a23_0x250cc6(0x163)](_0x5c513f){const _0x5899bc=a23_0x250cc6,{options:_0x447b9c,args:_0x2d3bba,tdx:_0x7e6b56}=_0x5c513f,_0x487c39=_0x2d3bba[0x0];_0x447b9c[_0x5899bc(0x137)]&&(console['error'](_0x5899bc(0x17b)+_0x447b9c[_0x5899bc(0x1dc)]),_0x487c39&&console[_0x5899bc(0x24c)](_0x5899bc(0x176)+_0x487c39));const _0x447e57=await withSpinner(_0x487c39?_0x5899bc(0x246)+_0x487c39+_0x5899bc(0x154):'Listing\x20parent\x20segments...',()=>_0x7e6b56[_0x5899bc(0x23d)]['listParents'](),{'verbose':_0x447b9c['verbose']});let _0x30d066=_0x447e57[_0x5899bc(0x1e9)];if(_0x487c39){const _0x46b15e=_0x487c39[_0x5899bc(0x155)](/[.+^${}()|[\]\\]/g,_0x5899bc(0x174))[_0x5899bc(0x155)](/\*/g,'.*')[_0x5899bc(0x155)](/\?/g,'.'),_0x24ba0b=new RegExp('^'+_0x46b15e+'$','i');_0x30d066=_0x30d066[_0x5899bc(0x1d4)](_0x565f33=>_0x24ba0b[_0x5899bc(0x245)](_0x565f33['attributes']['name']));}_0x30d066[_0x5899bc(0x122)]((_0x30ae39,_0x1bfb6b)=>_0x30ae39['attributes'][_0x5899bc(0x23b)][_0x5899bc(0x16b)](_0x1bfb6b['attributes']['name'])),console[_0x5899bc(0x24c)](_0x5899bc(0x11b)+_0x30d066[_0x5899bc(0x19d)]+'\x20parent\x20segment'+(_0x30d066[_0x5899bc(0x19d)]!==0x1?'s':''));const _0x328d93=_0x1fdf91=>{const _0x51171a=_0x5899bc;return getConsoleNextUrl(_0x447b9c[_0x51171a(0x1dc)],_0x51171a(0x1d9)+_0x1fdf91);};if(_0x447b9c[_0x5899bc(0x1d8)]===_0x5899bc(0x16f)||_0x447b9c['format']===_0x5899bc(0x23f)){const _0x1c7f7e=_0x30d066[_0x5899bc(0x1f4)](_0x5ce3fe=>({..._0x5ce3fe,'url':_0x328d93(_0x5ce3fe['id'])}));await handleSDKOutput(_0x1c7f7e,_0x447b9c);}else{if(_0x30d066[_0x5899bc(0x19d)]===0x0)_0x487c39?console[_0x5899bc(0x1f7)](_0x5899bc(0x188)+_0x487c39):console[_0x5899bc(0x1f7)]('No\x20parent\x20segments\x20found');else for(const _0x52aa0 of _0x30d066){const _0x359554=_0x52aa0[_0x5899bc(0x14a)]['population']?a23_0xda7a3c[_0x5899bc(0x20d)]('\x20('+formatRows(_0x52aa0['attributes']['population'])+')'):'',_0x4bccda=hyperlink(_0x52aa0['attributes']['name'],_0x328d93(_0x52aa0['id']));console[_0x5899bc(0x1f7)](_0x5899bc(0x191)+_0x4bccda+_0x359554);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a23_0x250cc6(0x1ee);[a23_0x250cc6(0x180)]=a23_0x250cc6(0x212);async[a23_0x250cc6(0x163)](_0x28e6bb){const _0x8861a8=a23_0x250cc6,{options:_0x174bbf,args:_0xd187bc,tdx:_0x2844e8}=_0x28e6bb;console[_0x8861a8(0x24c)](_0x8861a8(0x178)+_0x8861a8(0x169)+_0x8861a8(0x12e));const _0x637b68=_0x174bbf;if(_0xd187bc[_0x8861a8(0x19d)]===0x0)return console[_0x8861a8(0x24c)](a23_0xda7a3c[_0x8861a8(0x130)](_0x8861a8(0x166))),console[_0x8861a8(0x24c)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x24f305=_0xd187bc[0x0];if(!_0x637b68['database']||!_0x637b68['table'])return console[_0x8861a8(0x24c)](_0x8861a8(0x17a)),console['error'](_0x8861a8(0x22a)),0x1;_0x637b68[_0x8861a8(0x137)]&&(console['error'](_0x8861a8(0x17b)+_0x637b68[_0x8861a8(0x1dc)]),console['error'](_0x8861a8(0x199)+_0x24f305),console[_0x8861a8(0x24c)](_0x8861a8(0x189)+_0x637b68['database']),console[_0x8861a8(0x24c)]('Table:\x20'+_0x637b68[_0x8861a8(0x1eb)]));const _0x1af408=await loadJSONFromOptions(_0x637b68[_0x8861a8(0x14a)],_0x637b68['attributesFile']),_0x194182=await loadJSONFromOptions(_0x637b68[_0x8861a8(0x184)],_0x637b68[_0x8861a8(0x144)]),_0x263f82=await loadJSONFromOptions(_0x637b68[_0x8861a8(0x1c7)],_0x637b68[_0x8861a8(0x1af)]),_0x26f826={'name':_0x24f305,'description':_0x637b68[_0x8861a8(0x180)],'scheduleType':_0x637b68[_0x8861a8(0x20f)],'scheduleOption':_0x637b68['scheduleOption'],'timezone':_0x637b68['timezone'],'master':{'parentDatabaseName':_0x637b68[_0x8861a8(0x17d)],'parentTableName':_0x637b68['table']},'attributes':_0x1af408,'behaviors':_0x194182,'customerGroup':_0x263f82},_0x2cc615=await withSpinner(_0x8861a8(0x153)+_0x24f305+_0x8861a8(0x154),()=>_0x2844e8['segment'][_0x8861a8(0x11f)](_0x26f826),{'verbose':_0x174bbf['verbose']}),_0x59ac0d=_0x2cc615[_0x8861a8(0x1e9)];return console['error'](_0x8861a8(0x1db)+_0x59ac0d['name']+_0x8861a8(0x181)+_0x59ac0d['id']),await handleSDKOutput([_0x59ac0d],_0x174bbf),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a23_0x250cc6(0x23b)]='segment:parent:update';[a23_0x250cc6(0x180)]=a23_0x250cc6(0x143);async[a23_0x250cc6(0x163)](_0x47355a){const _0x39a26a=a23_0x250cc6,{options:_0xddd4b,args:_0x4d1acb,tdx:_0x4a6f2c}=_0x47355a;console[_0x39a26a(0x24c)](_0x39a26a(0x179)+_0x39a26a(0x169)+_0x39a26a(0x12e));const _0x20bcb8=_0xddd4b;if(_0x4d1acb[_0x39a26a(0x19d)]===0x0)return console['error'](a23_0xda7a3c[_0x39a26a(0x130)](_0x39a26a(0x166))),console[_0x39a26a(0x24c)](_0x39a26a(0x238)),0x1;const _0x5f0758=_0x4d1acb[0x0];_0x20bcb8[_0x39a26a(0x137)]&&(console['error'](_0x39a26a(0x17b)+_0x20bcb8[_0x39a26a(0x1dc)]),console[_0x39a26a(0x24c)](_0x39a26a(0x171)+_0x5f0758));const _0x1f5364=await withSpinner(_0x39a26a(0x243)+_0x5f0758+_0x39a26a(0x154),()=>_0x4a6f2c['segment']['getParentFull'](_0x5f0758),{'verbose':_0x20bcb8[_0x39a26a(0x137)]}),_0x299d1c=_0x1f5364['data'],_0x1ac66b=await loadJSONFromOptions(_0x20bcb8[_0x39a26a(0x23e)],_0x20bcb8[_0x39a26a(0x1f1)]),_0x3034ae=await loadJSONFromOptions(_0x20bcb8[_0x39a26a(0x1fd)],_0x20bcb8[_0x39a26a(0x1ad)]),_0xc84116={'name':_0x299d1c[_0x39a26a(0x23b)],'description':_0x20bcb8[_0x39a26a(0x180)]!==undefined?_0x20bcb8[_0x39a26a(0x180)]:_0x299d1c[_0x39a26a(0x180)],'scheduleType':_0x20bcb8['scheduleType']!==undefined?_0x20bcb8[_0x39a26a(0x20f)]:_0x299d1c[_0x39a26a(0x20f)],'scheduleOption':_0x20bcb8['scheduleOption']!==undefined?_0x20bcb8[_0x39a26a(0x1b4)]:_0x299d1c[_0x39a26a(0x1b4)],'timezone':_0x20bcb8[_0x39a26a(0x14e)]!==undefined?_0x20bcb8[_0x39a26a(0x14e)]:_0x299d1c[_0x39a26a(0x14e)],'master':_0x299d1c[_0x39a26a(0x139)],'attributes':_0x1ac66b?[..._0x299d1c['attributes']||[],..._0x1ac66b]:_0x299d1c[_0x39a26a(0x14a)],'behaviors':_0x3034ae?[..._0x299d1c['behaviors']||[],..._0x3034ae]:_0x299d1c['behaviors'],'customerGroup':_0x299d1c['customerGroup']},_0x3c3fae=await withSpinner(_0x39a26a(0x127)+_0x5f0758+'\x27...',()=>_0x4a6f2c[_0x39a26a(0x23d)][_0x39a26a(0x21a)](_0x5f0758,_0xc84116),{'verbose':_0x20bcb8[_0x39a26a(0x137)]}),_0x2fc61d=_0x3c3fae[_0x39a26a(0x1e9)];return console[_0x39a26a(0x24c)](_0x39a26a(0x208)+_0x2fc61d['name']+'\x27'),await handleSDKOutput([_0x2fc61d],_0x20bcb8),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a23_0x250cc6(0x23b)]='segment:parent:pull';['description']=a23_0x250cc6(0x1ec);async[a23_0x250cc6(0x163)](_0x1dced8){const _0x4d3668=a23_0x250cc6,{options:_0x321ba0,args:_0x355619,tdx:_0x33ecbb}=_0x1dced8,_0x193186=_0x321ba0,_0x2a9813=_0x355619[0x0]||_0x321ba0['parentSegment'];if(!_0x2a9813)return showParentSegmentNotSetError(_0x4d3668(0x1a2)+_0x4d3668(0x22e)),0x1;if(_0x193186[_0x4d3668(0x198)]&&_0x193186[_0x4d3668(0x20c)])return console[_0x4d3668(0x24c)](a23_0xda7a3c[_0x4d3668(0x130)](_0x4d3668(0x187))),console[_0x4d3668(0x24c)](a23_0xda7a3c[_0x4d3668(0x20d)](_0x4d3668(0x1de))),console[_0x4d3668(0x24c)](a23_0xda7a3c[_0x4d3668(0x20d)](_0x4d3668(0x13e)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x4d3668(0x24c)](a23_0xda7a3c['cyan'](_0x4d3668(0x1ef))),0x1;const _0x14788c=_0x193186['output']||a23_0x3fb4f2[_0x4d3668(0x213)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2a9813)+_0x4d3668(0x128));_0x193186[_0x4d3668(0x137)]&&(console[_0x4d3668(0x24c)](_0x4d3668(0x17b)+_0x193186['site']),console[_0x4d3668(0x24c)]('Parent\x20segment:\x20'+_0x2a9813),console[_0x4d3668(0x24c)](_0x4d3668(0x183)+_0x14788c));const _0xa0c691=await withSpinner(_0x4d3668(0x1b8)+_0x2a9813+_0x4d3668(0x154),()=>_0x33ecbb[_0x4d3668(0x23d)][_0x4d3668(0x124)](_0x2a9813),{'verbose':_0x193186['verbose']}),_0x46667f=_0xa0c691[_0x4d3668(0x1e9)];if(existsSync(_0x14788c)){const _0x1808ac=readFileSync(_0x14788c,_0x4d3668(0x134)),_0x31bb11=generateDiff(_0x1808ac,_0x46667f);if(!hasChanges(_0x31bb11))console[_0x4d3668(0x24c)](a23_0xda7a3c[_0x4d3668(0x12b)]('✔')+_0x4d3668(0x1b2)+a23_0xda7a3c[_0x4d3668(0x1bc)](_0x14788c)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x4d3668(0x24c)](_0x4d3668(0x133)+_0x14788c+'\x27:'),console['error']('─'[_0x4d3668(0x209)](0x3c)),console[_0x4d3668(0x24c)](formatDiffWithColors(_0x31bb11)),console['error']('─'[_0x4d3668(0x209)](0x3c));if(!_0x193186['yes']){const _0x534797=await confirmKey(_0x4d3668(0x1b5)+_0x14788c+'\x27?');if(!_0x534797)return console[_0x4d3668(0x24c)](_0x4d3668(0x1a5)),0x1;}writeFileSync(_0x14788c,_0x46667f,'utf-8'),console['error'](a23_0xda7a3c['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a23_0xda7a3c['cyan'](_0x14788c));}}else{const _0x3f8484=a23_0x3fb4f2[_0x4d3668(0x15d)](_0x14788c);!existsSync(_0x3f8484)&&mkdirSync(_0x3f8484,{'recursive':!![]}),writeFileSync(_0x14788c,_0x46667f,_0x4d3668(0x134)),console[_0x4d3668(0x24c)](a23_0xda7a3c[_0x4d3668(0x12b)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a23_0xda7a3c[_0x4d3668(0x1bc)](_0x14788c));}return saveSessionContext({'parent_segment':_0x2a9813},_0x193186[_0x4d3668(0x18a)]),console[_0x4d3668(0x24c)](a23_0xda7a3c['green']('✔')+_0x4d3668(0x195)+a23_0xda7a3c[_0x4d3668(0x20d)](_0x4d3668(0x15a))+'\x20=\x20'+a23_0xda7a3c[_0x4d3668(0x1bc)](_0x2a9813)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a23_0x250cc6(0x23b)]=a23_0x250cc6(0x204);[a23_0x250cc6(0x180)]=a23_0x250cc6(0x1a0);async[a23_0x250cc6(0x163)](_0x57075a){const _0x1d29b3=a23_0x250cc6,{options:_0x5d115e,args:_0x53e2ff,tdx:_0x40e890}=_0x57075a,_0x55bd06=_0x5d115e,_0x3ab184=_0x53e2ff[0x0]||_0x5d115e[_0x1d29b3(0x1cb)];if(!_0x3ab184)return showParentSegmentNotSetError(_0x1d29b3(0x1f6)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x4d9aaa=resolveYamlFile(_0x3ab184);if(!existsSync(_0x4d9aaa))return showFileNotFoundError(_0x4d9aaa,_0x3ab184),0x1;_0x55bd06[_0x1d29b3(0x137)]&&(console[_0x1d29b3(0x24c)](_0x1d29b3(0x17b)+_0x55bd06[_0x1d29b3(0x1dc)]),console['error'](_0x1d29b3(0x1c2)+_0x4d9aaa));let _0x12a127;try{_0x12a127=readFileSync(_0x4d9aaa,_0x1d29b3(0x134));}catch(_0x95df46){const _0x56b0e1=_0x95df46 instanceof Error?_0x95df46['message']:String(_0x95df46);return console['error']('Error\x20reading\x20file:\x20'+_0x56b0e1),0x1;}const _0x123ccd=await withSpinner(_0x1d29b3(0x20a),()=>_0x40e890['segment']['pushParentYaml'](_0x12a127),{'verbose':_0x55bd06['verbose']}),_0x24712e=_0x123ccd[_0x1d29b3(0x1e9)],{isNew:_0x2dc188,name:_0x3f750c,hasChanges:_0x53dd69,diffFormatted:_0x5f3987}=_0x24712e;if(!_0x53dd69)return console[_0x1d29b3(0x24c)](_0x1d29b3(0x1c5)+_0x3f750c+_0x1d29b3(0x11e)),0x0;_0x2dc188?console[_0x1d29b3(0x24c)](_0x1d29b3(0x14f)+_0x3f750c+'\x27:'):console[_0x1d29b3(0x24c)](_0x1d29b3(0x142)+_0x3f750c+'\x27:');console['error']('─'['repeat'](0x3c)),console['error'](_0x5f3987),console[_0x1d29b3(0x24c)]('─'[_0x1d29b3(0x209)](0x3c));const _0x44edc8=_0x2dc188?_0x1d29b3(0x194)+_0x3f750c+'\x27?':_0x1d29b3(0x227)+_0x3f750c+'\x27?';if(!_0x55bd06[_0x1d29b3(0x132)]){const _0x22a67c=await confirmKey(_0x44edc8);if(!_0x22a67c)return console[_0x1d29b3(0x24c)]('Aborted.'),0x1;}const _0x189a6d=_0x2dc188?_0x1d29b3(0x164):_0x1d29b3(0x177),_0x172e57=await withSpinner(_0x189a6d+_0x1d29b3(0x1aa)+_0x3f750c+_0x1d29b3(0x154),()=>_0x24712e[_0x1d29b3(0x1c9)](),{'verbose':_0x55bd06[_0x1d29b3(0x137)]}),_0x55f687=_0x172e57[_0x1d29b3(0x1e9)],_0x4985c2=getConsoleNextUrl(_0x55bd06[_0x1d29b3(0x1dc)],_0x1d29b3(0x1d9)+_0x55f687['id']),_0x3edd49=_0x2dc188?_0x1d29b3(0x223):_0x1d29b3(0x138);return console[_0x1d29b3(0x24c)]('✔\x20'+_0x3edd49+_0x1d29b3(0x1aa)+_0x55f687[_0x1d29b3(0x23b)]+'\x27'),console['error']('\x20\x20'+_0x4985c2),0x0;}}function a23_0x3769(_0x416f21,_0x5aee5d){_0x416f21=_0x416f21-0x11b;const _0x481458=a23_0x4814();let _0x376910=_0x481458[_0x416f21];return _0x376910;}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a23_0x250cc6(0x23b)]='segment:parent:validate';['description']=a23_0x250cc6(0x16d);async[a23_0x250cc6(0x163)](_0x2a8a24){const _0x135dd5=a23_0x250cc6,{options:_0x3cdb95,args:_0x49ee04,tdx:_0x296269}=_0x2a8a24,_0x5e3672=_0x3cdb95,_0x349dc7=_0x49ee04[0x0]||_0x3cdb95['parentSegment'];if(!_0x349dc7)return showParentSegmentNotSetError(_0x135dd5(0x1b3)+_0x135dd5(0x247)+_0x135dd5(0x1f0)+_0x135dd5(0x1f3)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x560c43=resolveYamlFile(_0x349dc7);if(!existsSync(_0x560c43))return showFileNotFoundError(_0x560c43,_0x349dc7),0x1;_0x5e3672[_0x135dd5(0x137)]&&(console[_0x135dd5(0x24c)]('Site:\x20'+_0x5e3672[_0x135dd5(0x1dc)]),console[_0x135dd5(0x24c)](_0x135dd5(0x1c2)+_0x560c43));let _0x277907;try{_0x277907=readFileSync(_0x560c43,_0x135dd5(0x134));}catch(_0x396c4c){const _0x53d160=_0x396c4c instanceof Error?_0x396c4c[_0x135dd5(0x131)]:String(_0x396c4c);return console[_0x135dd5(0x24c)](_0x135dd5(0x1c8)+_0x53d160),0x1;}const _0x30ad63=createCommandSpinner(a23_0xda7a3c[_0x135dd5(0x20d)](_0x135dd5(0x1b6)),{'verbose':_0x5e3672[_0x135dd5(0x137)]});_0x30ad63[_0x135dd5(0x12a)]();const _0x17d2d9={'onProgress':_0x35b1f2=>{_0x30ad63['text']=formatProgressMessage(_0x35b1f2);}};if(_0x5e3672[_0x135dd5(0x139)])_0x17d2d9['master']=!![];if(_0x5e3672[_0x135dd5(0x13c)])_0x17d2d9[_0x135dd5(0x13c)]=!![];_0x5e3672[_0x135dd5(0x149)]&&(_0x17d2d9['attribute']=_0x5e3672[_0x135dd5(0x149)]);_0x5e3672['behavior']&&(_0x17d2d9[_0x135dd5(0x1e3)]=_0x5e3672[_0x135dd5(0x1e3)]);if(_0x5e3672['interval'])_0x17d2d9[_0x135dd5(0x1e1)]=_0x5e3672[_0x135dd5(0x1e1)];let _0xcc1532;try{_0xcc1532=await _0x296269[_0x135dd5(0x23d)]['validateParentYaml'](_0x277907,_0x17d2d9),_0x30ad63[_0x135dd5(0x1d0)]();}catch(_0x916680){_0x30ad63['stop']();throw _0x916680;}const _0x4d579d=_0x5e3672['interval']||_0x135dd5(0x16e);return this[_0x135dd5(0x123)](_0xcc1532,_0x17d2d9,_0x560c43,_0x4d579d),_0xcc1532[_0x135dd5(0x168)]?0x0:0x1;}[a23_0x250cc6(0x123)](_0x2e71ff,_0x34966d,_0x3263ed,_0x24fe56){const _0x24f3c0=a23_0x250cc6;console[_0x24f3c0(0x24c)]('\x0a'+a23_0xda7a3c['bold'](_0x24f3c0(0x1ae))+'\x20'+_0x2e71ff[_0x24f3c0(0x23b)]),console[_0x24f3c0(0x24c)]('═'[_0x24f3c0(0x209)](0x3c)),this[_0x24f3c0(0x20e)](_0x2e71ff);if(typeof _0x34966d['attribute']==='string'){this[_0x24f3c0(0x226)](_0x2e71ff),this[_0x24f3c0(0x1ba)](_0x2e71ff),this[_0x24f3c0(0x211)](_0x3263ed,_0x24fe56,'attribute',_0x34966d[_0x24f3c0(0x149)]);return;}if(_0x34966d[_0x24f3c0(0x149)]===!![]){this[_0x24f3c0(0x226)](_0x2e71ff),this[_0x24f3c0(0x1ba)](_0x2e71ff),this[_0x24f3c0(0x211)](_0x3263ed,_0x24fe56,'attributes');return;}if(typeof _0x34966d[_0x24f3c0(0x1e3)]===_0x24f3c0(0x152)){this['displayBehaviorsStats'](_0x2e71ff,_0x24fe56),this[_0x24f3c0(0x1ba)](_0x2e71ff),this['displayPreviewHints'](_0x3263ed,_0x24fe56,'behavior',_0x34966d[_0x24f3c0(0x1e3)]);return;}if(_0x34966d[_0x24f3c0(0x1e3)]===!![]){this['displayBehaviorsStats'](_0x2e71ff,_0x24fe56),this[_0x24f3c0(0x1ba)](_0x2e71ff),this[_0x24f3c0(0x211)](_0x3263ed,_0x24fe56,_0x24f3c0(0x184));return;}this[_0x24f3c0(0x226)](_0x2e71ff),this[_0x24f3c0(0x221)](_0x2e71ff,_0x24fe56),this[_0x24f3c0(0x1ba)](_0x2e71ff),this[_0x24f3c0(0x211)](_0x3263ed,_0x24fe56,_0x24f3c0(0x18f));}[a23_0x250cc6(0x211)](_0x5b6c2b,_0xfbeac9,_0xdb9504,_0x17989a){const _0x337205=a23_0x250cc6;console['error']('\x0a'+a23_0xda7a3c[_0x337205(0x20d)](_0x337205(0x121)));const _0x534b0f=_0xfbeac9!==_0x337205(0x16e)?_0x337205(0x129)+_0xfbeac9:'';if(_0xdb9504===_0x337205(0x149)&&_0x17989a)console['error']('\x20\x20'+a23_0xda7a3c[_0x337205(0x20d)](_0x337205(0x13a)+_0x5b6c2b+_0x337205(0x1c4)+_0x17989a+'\x22'+_0x534b0f));else{if(_0xdb9504===_0x337205(0x1e3)&&_0x17989a)console['error']('\x20\x20'+a23_0xda7a3c[_0x337205(0x20d)]('tdx\x20segment\x20parent\x20preview\x20'+_0x5b6c2b+_0x337205(0x1bb)+_0x17989a+'\x22'+_0x534b0f));else(_0xdb9504===_0x337205(0x14a)||_0xdb9504===_0x337205(0x18f))&&console[_0x337205(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x337205(0x20d)](_0x337205(0x13a)+_0x5b6c2b+_0x337205(0x17c)+_0x534b0f));}(_0xdb9504===_0x337205(0x184)||_0xdb9504==='all')&&console['error']('\x20\x20'+a23_0xda7a3c[_0x337205(0x20d)](_0x337205(0x13a)+_0x5b6c2b+_0x337205(0x1d7)+_0x534b0f)),_0xdb9504===_0x337205(0x18f)&&console['error']('\x20\x20'+a23_0xda7a3c[_0x337205(0x20d)](_0x337205(0x13a)+_0x5b6c2b+'\x20--enriched'+_0x534b0f));}['displayMasterInfo'](_0x89f1f9){const _0xed421d=a23_0x250cc6,{master:_0x3004d2}=_0x89f1f9,_0x1030dc=_0x3004d2[_0xed421d(0x120)]?a23_0xda7a3c[_0xed421d(0x12b)]('✔'):a23_0xda7a3c[_0xed421d(0x130)]('✘');console['error']('\x0a'+a23_0xda7a3c['dim'](_0xed421d(0x1e4))),console['error'](_0x1030dc+'\x20'+a23_0xda7a3c[_0xed421d(0x24e)](_0x3004d2['database']+'.'+_0x3004d2[_0xed421d(0x1eb)])),_0x3004d2[_0xed421d(0x120)]?_0x3004d2[_0xed421d(0x125)]!==undefined&&console['error']('\x20\x20'+a23_0xda7a3c[_0xed421d(0x20d)](_0xed421d(0x1ac))+'\x20'+a23_0xda7a3c['cyan'](formatRows(_0x3004d2[_0xed421d(0x125)]))):console[_0xed421d(0x24c)]('\x20\x20'+a23_0xda7a3c[_0xed421d(0x130)](_0xed421d(0x229))+'\x20'+_0x3004d2[_0xed421d(0x22b)]);}[a23_0x250cc6(0x226)](_0x19b20e){const _0x4cff94=a23_0x250cc6;if(_0x19b20e[_0x4cff94(0x14a)][_0x4cff94(0x19d)]===0x0)return;console[_0x4cff94(0x24c)]('\x0a'+a23_0xda7a3c[_0x4cff94(0x20d)](_0x4cff94(0x1ff)));for(const _0x58187a of _0x19b20e[_0x4cff94(0x14a)]){const _0x48fb81=_0x58187a[_0x4cff94(0x120)]?a23_0xda7a3c[_0x4cff94(0x12b)]('✔'):a23_0xda7a3c[_0x4cff94(0x130)]('✘');let _0x317c7d='';if(_0x58187a[_0x4cff94(0x120)]&&_0x58187a[_0x4cff94(0x234)]!==undefined&&_0x58187a[_0x4cff94(0x1a6)]!==undefined){const _0x163f7b=_0x58187a[_0x4cff94(0x1a6)][_0x4cff94(0x1cf)](0x1),_0x294538=_0x58187a[_0x4cff94(0x1a6)]>=0x50?a23_0xda7a3c['green']:_0x58187a[_0x4cff94(0x1a6)]>=0x32?a23_0xda7a3c[_0x4cff94(0x1b0)]:a23_0xda7a3c[_0x4cff94(0x130)];_0x317c7d='\x20'+a23_0xda7a3c[_0x4cff94(0x20d)](_0x4cff94(0x206))+'\x20'+_0x294538(_0x163f7b+'%')+'\x20('+formatRows(_0x58187a[_0x4cff94(0x234)])+_0x4cff94(0x19a);}console[_0x4cff94(0x24c)](_0x48fb81+'\x20'+a23_0xda7a3c['bold'](_0x58187a['name'])+_0x317c7d),console[_0x4cff94(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x4cff94(0x20d)]('Source:')+'\x20'+a23_0xda7a3c['bold'](_0x58187a[_0x4cff94(0x17d)]+'.'+_0x58187a[_0x4cff94(0x1eb)]));const _0x17fec9=_0x58187a[_0x4cff94(0x18c)]===_0x58187a[_0x4cff94(0x182)]?a23_0xda7a3c[_0x4cff94(0x20d)](_0x4cff94(0x1fa))+'\x20'+_0x58187a[_0x4cff94(0x18c)]:a23_0xda7a3c[_0x4cff94(0x20d)](_0x4cff94(0x21f))+'\x20'+_0x58187a['joinKey']+_0x4cff94(0x244)+_0x58187a[_0x4cff94(0x182)];console[_0x4cff94(0x24c)]('\x20\x20'+_0x17fec9),console[_0x4cff94(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x4cff94(0x20d)](_0x4cff94(0x1d3))),this['displayColumns'](_0x58187a[_0x4cff94(0x19b)]),!_0x58187a[_0x4cff94(0x120)]&&console['error']('\x20\x20'+a23_0xda7a3c[_0x4cff94(0x130)](_0x4cff94(0x229))+'\x20'+_0x58187a['schemaError']);}}[a23_0x250cc6(0x221)](_0x54d6fc,_0x4b785a){const _0x3fc0dc=a23_0x250cc6;if(_0x54d6fc['behaviors']['length']===0x0)return;console[_0x3fc0dc(0x24c)]('\x0a'+a23_0xda7a3c[_0x3fc0dc(0x20d)](_0x3fc0dc(0x1cd))+'\x20'+a23_0xda7a3c[_0x3fc0dc(0x20d)]('('+_0x4b785a+')'));for(const _0x3cc2f0 of _0x54d6fc[_0x3fc0dc(0x184)]){const _0x21fd35=_0x3cc2f0[_0x3fc0dc(0x120)]?a23_0xda7a3c['green']('✔'):a23_0xda7a3c[_0x3fc0dc(0x130)]('✘');let _0x4ba760='';if(_0x3cc2f0[_0x3fc0dc(0x120)]&&_0x3cc2f0[_0x3fc0dc(0x175)]!==undefined&&_0x3cc2f0[_0x3fc0dc(0x148)]!==undefined){const _0x36ac6d=_0x3cc2f0[_0x3fc0dc(0x15c)]?.['toFixed'](0x1)||'?',_0x4b77e9=(_0x3cc2f0[_0x3fc0dc(0x15c)]??0x0)>=0x32?a23_0xda7a3c[_0x3fc0dc(0x12b)]:(_0x3cc2f0[_0x3fc0dc(0x15c)]??0x0)>=0x14?a23_0xda7a3c[_0x3fc0dc(0x1b0)]:a23_0xda7a3c['red'];_0x4ba760='\x20'+a23_0xda7a3c[_0x3fc0dc(0x20d)]('Customers:')+'\x20'+_0x4b77e9(formatRows(_0x3cc2f0[_0x3fc0dc(0x175)]))+'\x20('+_0x36ac6d+_0x3fc0dc(0x13b)+a23_0xda7a3c['dim'](_0x3fc0dc(0x1f5))+'\x20'+a23_0xda7a3c[_0x3fc0dc(0x1bc)](formatRows(_0x3cc2f0[_0x3fc0dc(0x148)]));}console[_0x3fc0dc(0x24c)](_0x21fd35+'\x20'+a23_0xda7a3c['bold'](_0x3cc2f0['name'])+_0x4ba760),console[_0x3fc0dc(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x3fc0dc(0x20d)]('Source:')+'\x20'+a23_0xda7a3c[_0x3fc0dc(0x24e)](_0x3cc2f0[_0x3fc0dc(0x17d)]+'.'+_0x3cc2f0[_0x3fc0dc(0x1eb)]));const _0x1802ba=_0x3cc2f0[_0x3fc0dc(0x18c)]===_0x3cc2f0[_0x3fc0dc(0x182)]?a23_0xda7a3c[_0x3fc0dc(0x20d)](_0x3fc0dc(0x1fa))+'\x20'+_0x3cc2f0[_0x3fc0dc(0x18c)]:a23_0xda7a3c[_0x3fc0dc(0x20d)](_0x3fc0dc(0x21f))+'\x20'+_0x3cc2f0[_0x3fc0dc(0x18c)]+_0x3fc0dc(0x244)+_0x3cc2f0[_0x3fc0dc(0x182)];console[_0x3fc0dc(0x24c)]('\x20\x20'+_0x1802ba),console['error']('\x20\x20'+a23_0xda7a3c[_0x3fc0dc(0x20d)]('Columns:')),this['displayColumns'](_0x3cc2f0['columns']),!_0x3cc2f0[_0x3fc0dc(0x120)]&&console[_0x3fc0dc(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x3fc0dc(0x130)]('Error:')+'\x20'+_0x3cc2f0[_0x3fc0dc(0x22b)]);}}[a23_0x250cc6(0x173)](_0x39b95e){const _0x4cfe97=a23_0x250cc6;for(const _0x1d50de of _0x39b95e){_0x1d50de['label']===_0x1d50de['column']||_0x1d50de[_0x4cfe97(0x240)]==='*'?console[_0x4cfe97(0x24c)](_0x4cfe97(0x219)+_0x1d50de[_0x4cfe97(0x23c)]):console[_0x4cfe97(0x24c)](_0x4cfe97(0x219)+_0x1d50de[_0x4cfe97(0x23c)]+'\x20'+a23_0xda7a3c['dim']('('+_0x1d50de[_0x4cfe97(0x240)]+')'));}}[a23_0x250cc6(0x1ba)](_0x353017){const _0x40958a=a23_0x250cc6;console[_0x40958a(0x24c)]('─'['repeat'](0x3c));if(_0x353017['errors'][_0x40958a(0x19d)]>0x0){console[_0x40958a(0x24c)]('\x0a'+a23_0xda7a3c[_0x40958a(0x130)](_0x40958a(0x1ca)));for(const _0x30f7f5 of _0x353017['errors']){console[_0x40958a(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x40958a(0x130)]('•')+'\x20'+_0x30f7f5);}}_0x353017[_0x40958a(0x168)]&&console[_0x40958a(0x24c)]('\x0a'+a23_0xda7a3c[_0x40958a(0x12b)]('✔')+_0x40958a(0x22d));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a23_0x250cc6(0x23b)]='segment:parent:preview';[a23_0x250cc6(0x180)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a23_0x250cc6(0x163)](_0x3a6f4d){const _0x4efc13=a23_0x250cc6,{options:_0x24bb9b,args:_0x41fca8,tdx:_0x4f0550}=_0x3a6f4d,_0x3a19ae=_0x24bb9b,_0x2154ac=_0x41fca8[0x0]||_0x24bb9b[_0x4efc13(0x1cb)];if(!_0x2154ac)return showParentSegmentNotSetError(_0x4efc13(0x1d6)+_0x4efc13(0x158)+_0x4efc13(0x20b)+_0x4efc13(0x1da)+_0x4efc13(0x15b)+_0x4efc13(0x193)+_0x4efc13(0x1c3)+_0x4efc13(0x160)),0x1;if(!_0x3a19ae[_0x4efc13(0x139)]&&!_0x3a19ae['attribute']&&!_0x3a19ae[_0x4efc13(0x1e3)]&&!_0x3a19ae[_0x4efc13(0x13c)])return console[_0x4efc13(0x24c)](a23_0xda7a3c[_0x4efc13(0x130)](_0x4efc13(0x1b7))),console[_0x4efc13(0x24c)](_0x4efc13(0x1a1)),console[_0x4efc13(0x24c)](_0x4efc13(0x249)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x4efc13(0x24c)](_0x4efc13(0x13f)),console[_0x4efc13(0x24c)](_0x4efc13(0x1f8)),console[_0x4efc13(0x24c)](_0x4efc13(0x241)),0x1;const _0x2e6b57=resolveYamlFile(_0x2154ac);if(!existsSync(_0x2e6b57))return showFileNotFoundError(_0x2e6b57,_0x2154ac),0x1;_0x3a19ae['verbose']&&(console['error'](_0x4efc13(0x17b)+_0x3a19ae[_0x4efc13(0x1dc)]),console[_0x4efc13(0x24c)]('YAML\x20file:\x20'+_0x2e6b57));let _0x4c6300;try{_0x4c6300=readFileSync(_0x2e6b57,'utf-8');}catch(_0x1dfb67){const _0x4da5af=_0x1dfb67 instanceof Error?_0x1dfb67['message']:String(_0x1dfb67);return console[_0x4efc13(0x24c)]('Error\x20reading\x20file:\x20'+_0x4da5af),0x1;}let _0x4c76d5;try{_0x4c76d5=parseDef(_0x4c6300);}catch(_0x3aef43){const _0xc373f0=_0x3aef43 instanceof Error?_0x3aef43[_0x4efc13(0x131)]:String(_0x3aef43);return console[_0x4efc13(0x24c)](a23_0xda7a3c[_0x4efc13(0x130)]('Error\x20parsing\x20YAML:\x20'+_0xc373f0)),0x1;}if(_0x3a19ae[_0x4efc13(0x149)]===!![]||_0x3a19ae[_0x4efc13(0x149)]===''){const _0x3195ca=_0x4c76d5[_0x4efc13(0x14a)]?.[_0x4efc13(0x1f4)](_0x20b090=>_0x20b090[_0x4efc13(0x23b)])||[];if(_0x3195ca[_0x4efc13(0x19d)]===0x0)console['error'](a23_0xda7a3c[_0x4efc13(0x130)](_0x4efc13(0x1e0)));else{console[_0x4efc13(0x24c)](a23_0xda7a3c[_0x4efc13(0x130)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x4efc13(0x24c)](_0x4efc13(0x239));for(const _0x118008 of _0x3195ca){console[_0x4efc13(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x4efc13(0x1bc)](_0x118008));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x2154ac+_0x4efc13(0x1c4)+_0x3195ca[0x0]+'\x22');}return 0x1;}if(_0x3a19ae[_0x4efc13(0x1e3)]===!![]||_0x3a19ae[_0x4efc13(0x1e3)]===''){const _0x3f462f=_0x4c76d5[_0x4efc13(0x184)]?.[_0x4efc13(0x1f4)](_0x28c8a8=>_0x28c8a8[_0x4efc13(0x23b)])||[];if(_0x3f462f[_0x4efc13(0x19d)]===0x0)console[_0x4efc13(0x24c)](a23_0xda7a3c[_0x4efc13(0x130)](_0x4efc13(0x1cc)));else{console[_0x4efc13(0x24c)](a23_0xda7a3c['red'](_0x4efc13(0x12c))),console[_0x4efc13(0x24c)]('Available\x20behaviors:');for(const _0x1ff561 of _0x3f462f){console[_0x4efc13(0x24c)]('\x20\x20'+a23_0xda7a3c['cyan'](_0x1ff561));}console['error'](_0x4efc13(0x248)+_0x2154ac+_0x4efc13(0x1bb)+_0x3f462f[0x0]+'\x22');}return 0x1;}const _0x1a72eb=createCommandSpinner(a23_0xda7a3c[_0x4efc13(0x20d)]('Fetching\x20sample\x20data...'),{'verbose':_0x3a19ae[_0x4efc13(0x137)]});_0x1a72eb[_0x4efc13(0x12a)]();const _0x22cead={'onProgress':_0x41ca89=>{const _0x7b4d02=_0x4efc13;_0x1a72eb[_0x7b4d02(0x161)]=formatProgressMessage(_0x41ca89);}};if(_0x3a19ae['master'])_0x22cead['master']=!![];if(_0x3a19ae[_0x4efc13(0x149)]&&typeof _0x3a19ae['attribute']===_0x4efc13(0x152))_0x22cead['attribute']=_0x3a19ae[_0x4efc13(0x149)];if(_0x3a19ae[_0x4efc13(0x1e3)]&&typeof _0x3a19ae[_0x4efc13(0x1e3)]===_0x4efc13(0x152))_0x22cead[_0x4efc13(0x1e3)]=_0x3a19ae[_0x4efc13(0x1e3)];if(_0x3a19ae['enriched'])_0x22cead[_0x4efc13(0x13c)]=!![];if(_0x3a19ae[_0x4efc13(0x1e1)])_0x22cead[_0x4efc13(0x1e1)]=_0x3a19ae['interval'];let _0x59c27a;try{_0x59c27a=await _0x4f0550[_0x4efc13(0x23d)][_0x4efc13(0x236)](_0x4c6300,_0x22cead),_0x1a72eb['stop']();}catch(_0x5c4d0f){_0x1a72eb['stop']();throw _0x5c4d0f;}return await this['displayPreviewResults'](_0x59c27a,{'master':_0x3a19ae['master'],'attribute':typeof _0x3a19ae['attribute']==='string'?_0x3a19ae[_0x4efc13(0x149)]:undefined,'behavior':typeof _0x3a19ae[_0x4efc13(0x1e3)]===_0x4efc13(0x152)?_0x3a19ae[_0x4efc13(0x1e3)]:undefined,'enriched':_0x3a19ae[_0x4efc13(0x13c)]}),_0x59c27a[_0x4efc13(0x168)]?0x0:0x1;}async[a23_0x250cc6(0x1c6)](_0x4b716a,_0x5a5a25){const _0x4bb900=a23_0x250cc6;console[_0x4bb900(0x24c)]('\x0a'+a23_0xda7a3c['bold'](_0x4bb900(0x21b))+'\x20'+_0x4b716a['name']),console[_0x4bb900(0x24c)]('═'[_0x4bb900(0x209)](0x3c));if(_0x5a5a25[_0x4bb900(0x139)]&&_0x4b716a[_0x4bb900(0x18d)]){const _0x1d3b90=a23_0xda7a3c[_0x4bb900(0x20d)](_0x4bb900(0x19e))+'\x20'+a23_0xda7a3c[_0x4bb900(0x24e)](_0x4b716a[_0x4bb900(0x139)][_0x4bb900(0x17d)]+'.'+_0x4b716a[_0x4bb900(0x139)][_0x4bb900(0x1eb)]);await this[_0x4bb900(0x1bd)](_0x1d3b90,_0x4b716a[_0x4bb900(0x18d)]);}else{if(_0x5a5a25[_0x4bb900(0x149)]&&_0x4b716a['sampleData']){const _0x5c44e2=a23_0xda7a3c[_0x4bb900(0x20d)](_0x4bb900(0x16a))+'\x20'+a23_0xda7a3c[_0x4bb900(0x24e)](_0x5a5a25[_0x4bb900(0x149)]);await this[_0x4bb900(0x1bd)](_0x5c44e2,_0x4b716a[_0x4bb900(0x18d)]);}else{if(_0x5a5a25[_0x4bb900(0x1e3)]&&_0x4b716a[_0x4bb900(0x18d)]){const _0x2195e8=a23_0xda7a3c[_0x4bb900(0x20d)]('Behavior:')+'\x20'+a23_0xda7a3c[_0x4bb900(0x24e)](_0x5a5a25[_0x4bb900(0x1e3)]);await this[_0x4bb900(0x1bd)](_0x2195e8,_0x4b716a[_0x4bb900(0x18d)]);}else{if(_0x5a5a25[_0x4bb900(0x13c)]&&_0x4b716a['sampleData']){const _0x473306=a23_0xda7a3c[_0x4bb900(0x20d)](_0x4bb900(0x210))+'\x20'+a23_0xda7a3c['bold'](_0x4bb900(0x151));await this['displaySampleData'](_0x473306,_0x4b716a['sampleData']);}else!_0x4b716a[_0x4bb900(0x18d)]&&console[_0x4bb900(0x24c)](_0x4bb900(0x1fe));}}}if(_0x4b716a['errors']['length']>0x0){console['error']('─'[_0x4bb900(0x209)](0x3c)),console[_0x4bb900(0x24c)]('\x0a'+a23_0xda7a3c[_0x4bb900(0x130)](_0x4bb900(0x1ca)));for(const _0x41acfd of _0x4b716a[_0x4bb900(0x1fb)]){console[_0x4bb900(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x4bb900(0x130)]('•')+'\x20'+_0x41acfd);}}}async['displaySampleData'](_0xfc7138,_0x1899d5){const _0x16bfe5=a23_0x250cc6;if(_0x1899d5[_0x16bfe5(0x19d)]===0x0){console[_0x16bfe5(0x24c)]('\x0a'+_0xfc7138),console[_0x16bfe5(0x24c)](_0x16bfe5(0x218));return;}console[_0x16bfe5(0x24c)]('\x0a'+_0xfc7138);const _0x5dff05=Object[_0x16bfe5(0x1ab)](_0x1899d5[0x0])[_0x16bfe5(0x1f4)](_0x46f0a5=>({'name':_0x46f0a5,'type':typeof _0x1899d5[0x0][_0x46f0a5]==='number'?_0x16bfe5(0x192):_0x16bfe5(0x170)})),_0x3bc057={'queryId':_0x16bfe5(0x228),'columns':_0x5dff05,'data':_0x1899d5,'stats':{'state':_0x16bfe5(0x185),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1899d5[_0x16bfe5(0x19d)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x1116c5=formatAsTable(_0x3bc057,_0x1899d5['length'],!![]);await writeOutput(_0x1116c5,undefined,_0x16bfe5(0x1eb));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a23_0x250cc6(0x23b)]='segment:parent:run';['description']=a23_0x250cc6(0x145);async['execute'](_0x5f4fbf){const _0x36604f=a23_0x250cc6,{options:_0x4f98f7,args:_0x1cf94f,tdx:_0x348269}=_0x5f4fbf,_0x5d0fb6=_0x4f98f7,_0x8e6637=_0x1cf94f[0x0]||_0x4f98f7[_0x36604f(0x1cb)];if(!_0x8e6637)return showParentSegmentNotSetError(_0x36604f(0x17e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x697f04=resolveYamlFile(_0x8e6637);if(existsSync(_0x697f04)){_0x5d0fb6[_0x36604f(0x137)]&&console[_0x36604f(0x24c)](_0x36604f(0x225)+_0x697f04);let _0x55a10f;try{_0x55a10f=readFileSync(_0x697f04,_0x36604f(0x134));}catch(_0x2feb1c){const _0x5bc03b=_0x2feb1c instanceof Error?_0x2feb1c['message']:String(_0x2feb1c);return console[_0x36604f(0x24c)](_0x36604f(0x1c8)+_0x5bc03b),0x1;}const _0x39e9d4=await withSpinner(_0x36604f(0x20a),()=>_0x348269[_0x36604f(0x23d)][_0x36604f(0x1dd)](_0x55a10f),{'verbose':_0x5d0fb6[_0x36604f(0x137)]}),_0x452888=_0x39e9d4[_0x36604f(0x1e9)],{isNew:_0x978097,name:_0x3547aa,hasChanges:_0x565115,diffFormatted:_0x1b5ae2}=_0x452888;if(_0x565115){_0x978097?console[_0x36604f(0x24c)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x3547aa+'\x27:'):console['error'](_0x36604f(0x142)+_0x3547aa+'\x27:');console[_0x36604f(0x24c)]('─'['repeat'](0x3c)),console[_0x36604f(0x24c)](_0x1b5ae2),console[_0x36604f(0x24c)]('─'[_0x36604f(0x209)](0x3c));const _0x48989a=_0x978097?_0x36604f(0x194)+_0x3547aa+_0x36604f(0x21c):_0x36604f(0x227)+_0x3547aa+_0x36604f(0x21c);if(!_0x5d0fb6[_0x36604f(0x132)]){const _0x3a415d=await confirmKey(_0x48989a);if(!_0x3a415d)return console['error'](_0x36604f(0x1a5)),0x1;}const _0x548661=_0x978097?_0x36604f(0x164):_0x36604f(0x177);await withSpinner(_0x548661+_0x36604f(0x1aa)+_0x3547aa+_0x36604f(0x154),()=>_0x452888[_0x36604f(0x1c9)](),{'verbose':_0x5d0fb6[_0x36604f(0x137)]});const _0x1491f9=_0x978097?_0x36604f(0x223):_0x36604f(0x138);console[_0x36604f(0x24c)]('✔\x20'+_0x1491f9+'\x20parent\x20segment\x20\x27'+_0x3547aa+'\x27');}else console[_0x36604f(0x24c)](_0x36604f(0x1c5)+_0x3547aa+_0x36604f(0x196));}const _0x569f2a=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x8e6637+'\x27...',()=>_0x348269[_0x36604f(0x23d)][_0x36604f(0x216)](_0x8e6637),{'verbose':_0x5d0fb6[_0x36604f(0x137)]}),_0x52fda8=_0x569f2a['data'],_0x41bff9=getConsoleUrl(_0x5d0fb6[_0x36604f(0x1dc)],_0x36604f(0x19c)+_0x52fda8['workflowId']+_0x36604f(0x146)+_0x52fda8[_0x36604f(0x237)]+'/attempt/'+_0x52fda8[_0x36604f(0x24d)]);return console['error'](_0x36604f(0x1c0)),console[_0x36604f(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x36604f(0x20d)](_0x36604f(0x157))+'\x20'+_0x52fda8[_0x36604f(0x136)]),console[_0x36604f(0x24c)]('\x20\x20'+a23_0xda7a3c['dim'](_0x36604f(0x231))+'\x20'+_0x52fda8[_0x36604f(0x190)]),console[_0x36604f(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x36604f(0x20d)](_0x36604f(0x1fc))+'\x20'+_0x52fda8['workflowSessionId']),console[_0x36604f(0x24c)]('\x20\x20'+a23_0xda7a3c[_0x36604f(0x20d)](_0x36604f(0x222))+'\x20'+_0x52fda8[_0x36604f(0x24d)]),console[_0x36604f(0x24c)]('\x20\x20'+_0x41bff9),console[_0x36604f(0x24c)]('\x0a'+a23_0xda7a3c[_0x36604f(0x20d)](_0x36604f(0x11c))+_0x36604f(0x1e2)+_0x52fda8[_0x36604f(0x24d)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a23_0x250cc6(0x1bf);[a23_0x250cc6(0x180)]=a23_0x250cc6(0x24b);async[a23_0x250cc6(0x163)](_0x165b06){const _0x4ec541=a23_0x250cc6,{options:_0x5dbabe,args:_0x5a8e83,tdx:_0x1b804b}=_0x165b06,_0x42a753=_0x5a8e83[0x0]||_0x5dbabe[_0x4ec541(0x1cb)];if(!_0x42a753)return showParentSegmentNotSetError(_0x4ec541(0x1a3)+_0x4ec541(0x15e)),0x1;_0x5dbabe['verbose']&&(console['error'](_0x4ec541(0x17b)+_0x5dbabe[_0x4ec541(0x1dc)]),console[_0x4ec541(0x24c)]('Parent\x20segment:\x20'+_0x42a753));const _0x562817=await withSpinner(_0x4ec541(0x235)+_0x42a753+_0x4ec541(0x154),()=>_0x1b804b['segment'][_0x4ec541(0x14b)](_0x42a753),{'verbose':_0x5dbabe[_0x4ec541(0x137)]}),_0x425f36=_0x562817[_0x4ec541(0x1e9)];console['error'](_0x4ec541(0x11b)+_0x425f36[_0x4ec541(0x19d)]+_0x4ec541(0x1e7)+(_0x425f36[_0x4ec541(0x19d)]!==0x1?'s':''));if(_0x5dbabe[_0x4ec541(0x16f)]||_0x5dbabe['jsonl'])return await handleSDKOutput(_0x425f36,_0x5dbabe),0x0;return displayFieldsHumanReadable(_0x425f36,_0x42a753),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a23_0x250cc6(0x23b)]='segment:parent:view';[a23_0x250cc6(0x180)]=a23_0x250cc6(0x1b1);async[a23_0x250cc6(0x163)](_0x13afe9){const _0x305bd7=a23_0x250cc6,{options:_0x162141,args:_0x1927dd,tdx:_0x1e1924}=_0x13afe9,_0x216e74=_0x162141,_0xb6badb=_0x1927dd[0x0]||_0x162141[_0x305bd7(0x1cb)];if(!_0xb6badb)return showParentSegmentNotSetError(_0x305bd7(0x197)+_0x305bd7(0x233)+'Options:\x0a'+_0x305bd7(0x217)),0x1;_0x162141[_0x305bd7(0x137)]&&(console[_0x305bd7(0x24c)](_0x305bd7(0x17b)+_0x162141[_0x305bd7(0x1dc)]),console[_0x305bd7(0x24c)]('Parent\x20segment:\x20'+_0xb6badb));const _0x282e53=await withSpinner(_0x305bd7(0x1b8)+_0xb6badb+_0x305bd7(0x154),()=>_0x1e1924[_0x305bd7(0x23d)][_0x305bd7(0x1a8)](_0xb6badb),{'verbose':_0x162141[_0x305bd7(0x137)]}),_0x3168f1=_0x282e53['data'];if(_0x216e74['web']){const _0xafd317=getConsoleNextUrl(_0x216e74[_0x305bd7(0x1dc)],_0x305bd7(0x1d9)+_0x3168f1['id']);return console[_0x305bd7(0x24c)](a23_0xda7a3c['green']('✔')+_0x305bd7(0x21e)+a23_0xda7a3c[_0x305bd7(0x1bc)](_0xafd317)),openBrowser(_0xafd317),0x0;}return await handleSingleObjectOutput(_0x3168f1,_0x162141),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a23_0x250cc6(0x14c);[a23_0x250cc6(0x180)]=a23_0x250cc6(0x1d1);async['execute'](_0x5a8946){const _0xc534c1=a23_0x250cc6,{options:_0xae8650,args:_0x6f5bad,tdx:_0x48ce76}=_0x5a8946,_0x2d6bcf=_0x6f5bad[0x0]||_0xae8650[_0xc534c1(0x1cb)];if(!_0x2d6bcf)return showParentSegmentNotSetError(_0xc534c1(0x150)+_0xc534c1(0x1f2)),0x1;_0xae8650[_0xc534c1(0x137)]&&(console['error'](_0xc534c1(0x17b)+_0xae8650[_0xc534c1(0x1dc)]),console[_0xc534c1(0x24c)](_0xc534c1(0x171)+_0x2d6bcf));const _0x105736=await withSpinner(_0xc534c1(0x186)+_0x2d6bcf+_0xc534c1(0x154),()=>_0x48ce76[_0xc534c1(0x23d)]['resolveParentId'](_0x2d6bcf),{'verbose':_0xae8650[_0xc534c1(0x137)]}),_0x528b9c=_0x105736[_0xc534c1(0x1e9)],_0x24e440=await withSpinner(_0xc534c1(0x16c)+_0x2d6bcf+'\x27...',()=>_0x48ce76[_0xc534c1(0x23d)][_0xc534c1(0x205)](_0x528b9c),{'verbose':_0xae8650[_0xc534c1(0x137)]}),_0x3f56bc=await executeSchemaQuery(_0x24e440[_0xc534c1(0x1e9)],_0x48ce76,_0xae8650);return await handleQueryOutput(_0x3f56bc,_0xae8650),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a23_0x250cc6(0x23b)]=a23_0x250cc6(0x12d);[a23_0x250cc6(0x180)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a23_0x250cc6(0x163)](_0x5ee3b2){const _0x2e149c=a23_0x250cc6,{options:_0x22bf57,args:_0x128cea,tdx:_0x194fd9}=_0x5ee3b2,_0x8077a9=_0x128cea[0x0]||_0x22bf57[_0x2e149c(0x1cb)];if(!_0x8077a9)return showParentSegmentNotSetError(_0x2e149c(0x201)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x22bf57[_0x2e149c(0x137)]&&(console[_0x2e149c(0x24c)](_0x2e149c(0x17b)+_0x22bf57[_0x2e149c(0x1dc)]),console[_0x2e149c(0x24c)](_0x2e149c(0x171)+_0x8077a9));const _0x9eaafd=await withSpinner(_0x2e149c(0x186)+_0x8077a9+_0x2e149c(0x154),()=>_0x194fd9[_0x2e149c(0x23d)][_0x2e149c(0x135)](_0x8077a9),{'verbose':_0x22bf57['verbose']}),_0x769814=_0x9eaafd[_0x2e149c(0x1e9)],_0x2dd69e=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x8077a9+'\x27...',()=>_0x194fd9[_0x2e149c(0x23d)]['getParentSQL'](_0x769814),{'verbose':_0x22bf57[_0x2e149c(0x137)]}),_0x309e28=_0x2dd69e[_0x2e149c(0x1e9)];return _0x22bf57[_0x2e149c(0x1d8)]===_0x2e149c(0x16f)||_0x22bf57['format']===_0x2e149c(0x23f)?await handleSDKOutput([{'sql':_0x309e28}],_0x22bf57):console['log'](_0x309e28),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a23_0x250cc6(0x23b)]=a23_0x250cc6(0x167);['description']=a23_0x250cc6(0x22c);async[a23_0x250cc6(0x163)](_0x44998d){const _0x391b30=a23_0x250cc6,{options:_0xe93306,args:_0x140c38,tdx:_0x19cba9}=_0x44998d,_0xe56e3=_0x140c38[0x0]||_0xe93306['parentSegment'];if(!_0xe56e3)return showParentSegmentNotSetError(_0x391b30(0x24a)+'\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;_0xe93306[_0x391b30(0x137)]&&(console[_0x391b30(0x24c)](_0x391b30(0x17b)+_0xe93306['site']),console['error'](_0x391b30(0x171)+_0xe56e3));const _0x334fef=await withSpinner(_0x391b30(0x186)+_0xe56e3+_0x391b30(0x154),()=>_0x19cba9['segment'][_0x391b30(0x135)](_0xe56e3),{'verbose':_0xe93306['verbose']}),_0x9718ec=_0x334fef['data'],_0x1eee7f=await withSpinner(_0x391b30(0x16c)+_0xe56e3+_0x391b30(0x154),()=>_0x19cba9[_0x391b30(0x23d)][_0x391b30(0x205)](_0x9718ec),{'verbose':_0xe93306['verbose']});let _0x3847f8=_0x1eee7f[_0x391b30(0x1e9)];const _0x54b5bf=resolveLimit(_0xe93306[_0x391b30(0x126)],DEFAULT_DISPLAY_LIMIT),_0x45803d=/\bLIMIT\s+\d+/i[_0x391b30(0x245)](_0x3847f8);!_0x45803d&&(_0x3847f8=_0x3847f8[_0x391b30(0x1b9)]()[_0x391b30(0x155)](/;+$/,''),_0x3847f8=_0x391b30(0x1f9)+_0x3847f8+_0x391b30(0x11d)+_0x54b5bf);_0xe93306['verbose']&&console['error']('SQL\x20query:\x0a'+_0x3847f8);const _0x14d46=await withProgressSpinner(_0x391b30(0x200),async _0x5a4495=>{const _0xbf4cf0=_0x391b30,_0xd629b4=await _0x19cba9[_0xbf4cf0(0x230)][_0xbf4cf0(0x163)](_0x3847f8,{'catalog':'td','schema':'information_schema','onJobId':_0x65572a=>{const _0x1c9abe=_0xbf4cf0;_0x5a4495[_0x1c9abe(0x141)](_0x65572a);}});return _0xd629b4;},{'verbose':_0xe93306[_0x391b30(0x137)]}),_0x251f63=_0x14d46[_0x391b30(0x1e9)],_0xe79615=_0x251f63[_0x391b30(0x165)]?'\x20[Job\x20ID:\x20'+_0x251f63[_0x391b30(0x165)]+']':'';return console[_0x391b30(0x24c)](_0x391b30(0x159)+_0x251f63[_0x391b30(0x1a4)][_0x391b30(0x172)][_0x391b30(0x1ce)]()+'\x20rows\x20'+(_0x391b30(0x220)+formatElapsed(_0x251f63['stats'][_0x391b30(0x147)])+_0xe79615)),await handleQueryOutput(_0x251f63,_0xe93306),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-command.d.ts","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"profile-command.d.ts","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AA8ChF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,0BAA0B;IAExC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAqKxD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,sBAAsB;IAE1C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAQzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAwDxD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,uCAAuC;IAG3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAqF;IAEvH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IA0BzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAkGxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,yBAAyB;IAE7C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAQzD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2CxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x4c767c=a24_0xaf30;(function(_0x13afbf,_0x24ede1){const _0x40be76=a24_0xaf30,_0x400794=_0x13afbf();while(!![]){try{const _0x13e3fd=parseInt(_0x40be76(0x16e))/0x1*(-parseInt(_0x40be76(0x1a7))/0x2)+-parseInt(_0x40be76(0x1ac))/0x3*(parseInt(_0x40be76(0x19d))/0x4)+-parseInt(_0x40be76(0x183))/0x5+-parseInt(_0x40be76(0x141))/0x6*(-parseInt(_0x40be76(0x18c))/0x7)+-parseInt(_0x40be76(0x1ae))/0x8*(-parseInt(_0x40be76(0x169))/0x9)+-parseInt(_0x40be76(0x152))/0xa+parseInt(_0x40be76(0x151))/0xb*(parseInt(_0x40be76(0x173))/0xc);if(_0x13e3fd===_0x24ede1)break;else _0x400794['push'](_0x400794['shift']());}catch(_0x33c2c8){_0x400794['push'](_0x400794['shift']());}}}(a24_0x2f72,0xc9273));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a24_0x2f72(){const _0x4fd0a1=['jp\x20\x20\x20-\x20Japan','ap02','description','password','customSite','\x27\x20requires\x20API\x20key\x20validation.','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Changing\x20site\x20to\x20\x27','530328rnyYyc','profile','tdx.json','other','\x0aOperation\x20cancelled','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','toString','us01','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Site\x20was\x20not\x20changed.','\x0aSetup\x20cancelled','green','text','Enter\x20site\x20name:','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','profile:remove','430617AHEKHy','16259450USRnHJ','split','eu01','\x20\x20tdx\x20--profile\x20','\x27\x20does\x20not\x20exist.','You\x20can\x20find\x20your\x20API\x20key\x20at:','session','\x20\x20(no\x20profiles\x20found)','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','Session\x20profile\x20set\x20to:\x20','\x20API\x20key\x20saved\x20to\x20system\x20keychain','✗\x20Validation\x20failed:\x20','Site\x20name\x20cannot\x20be\x20empty','log','Create\x20a\x20new\x20profile','default','\x20API\x20key\x20is\x20valid\x20(User:\x20','parent_segment','trim','Enter\x20your\x20TD\x20API\x20key:','create','/app/mp/ak','Validating\x20API\x20key...','63pEttXW','\x0aSaved\x20to:\x20','\x27.\x0a\x0aValid\x20keys:\x20','\x20Profile\x20\x27','red','72434ncQEXm','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','getUserInfo','email','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','828GaTXmf','message','validate','\x20\x20-\x20','includes','Profile\x20\x27','Default\x20profile\x20set\x20to:\x20','eu\x20\x20\x20-\x20Europe','findIndex','site','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','error','execute','llm_agent','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','apiKey','710820uunrMg','name','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','config','dim','select','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','profile:create','push','91RcAXAe','length','Profile\x20name\x20cannot\x20be\x20empty','warn','(session:\x20','\x27\x20does\x20not\x20exist.\x20Create\x20it?','Enter\x20profile\x20name:','tdx:\x20profile\x20remove','confirm','llm_project','(cleared)','\x0aAvailable\x20profiles:','VALID_KEYS','profileName','bold','join','\x27\x20updated:\x20','20Wwndvu','jobs','Set\x20a\x20profile\x20configuration\x20value','tdx:\x20profile\x20create','yellow','profile:use','profile:set','Enter\x20custom\x20site','value','Operation\x20cancelled','22tdZbpV','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','status','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','753957izIRYQ','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','908816HSqqgJ','logLevel','ERROR'];a24_0x2f72=function(){return _0x4fd0a1;};return a24_0x2f72();}import*as a24_0x590ba5 from'node:path';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a24_0xaf30(_0x368c0d,_0x50275e){_0x368c0d=_0x368c0d-0x141;const _0x2f721f=a24_0x2f72();let _0xaf302f=_0x2f721f[_0x368c0d];return _0xaf302f;}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a24_0x2237cf from'prompts';import a24_0x21870b from'chalk';function validateProfileName(_0x369096){const _0x396e88=a24_0xaf30;if(!_0x369096||!_0x369096[_0x396e88(0x164)]())return _0x396e88(0x18e);const _0x55784e=_0x369096['trim']();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x55784e))return _0x396e88(0x14f);if(profileExists(_0x55784e))return _0x396e88(0x178)+_0x55784e+_0x396e88(0x1b7);return!![];}export class ProfileCreateCommand extends BaseCommand{[a24_0x4c767c(0x184)]=a24_0x4c767c(0x18a);[a24_0x4c767c(0x1b3)]=a24_0x4c767c(0x160);async[a24_0x4c767c(0x17f)](_0x362722){const _0x4cfab7=a24_0x4c767c,{options:_0x117d59,args:_0x5e102a}=_0x362722;console[_0x4cfab7(0x15f)](a24_0x21870b[_0x4cfab7(0x19a)](_0x4cfab7(0x1a0)));let _0x51de26;if(_0x5e102a[_0x4cfab7(0x18d)]>0x0&&_0x5e102a[0x0]){const _0x49714e=_0x5e102a[0x0][_0x4cfab7(0x164)](),_0x17ea73=validateProfileName(_0x49714e);if(_0x17ea73!==!![])return console[_0x4cfab7(0x17e)](a24_0x21870b[_0x4cfab7(0x16d)](_0x17ea73)),0x1;_0x51de26=_0x49714e;}else{const _0x1c7df3=await a24_0x2237cf({'type':'text','name':_0x4cfab7(0x199),'message':_0x4cfab7(0x192),'validate':validateProfileName});if(!_0x1c7df3[_0x4cfab7(0x199)])return console['log'](_0x4cfab7(0x14b)),0x1;_0x51de26=_0x1c7df3[_0x4cfab7(0x199)][_0x4cfab7(0x164)]();}const _0xfddb90=await a24_0x2237cf({'type':_0x4cfab7(0x14d),'name':_0x4cfab7(0x1b3),'message':'Enter\x20description\x20(optional):'}),_0x1c74af=_0xfddb90[_0x4cfab7(0x1b3)]?.[_0x4cfab7(0x164)]()||undefined,_0x10b8bb=_0x117d59['site']||_0x4cfab7(0x148),_0x41ff8e=[{'title':'us\x20\x20\x20-\x20United\x20States','value':_0x4cfab7(0x148)},{'title':_0x4cfab7(0x1b1),'value':'jp01'},{'title':_0x4cfab7(0x17a),'value':_0x4cfab7(0x154)},{'title':'ap02\x20-\x20Korea','value':_0x4cfab7(0x1b2)}];let _0x142b79=_0x41ff8e[_0x4cfab7(0x17b)](_0xc9c2e9=>_0xc9c2e9[_0x4cfab7(0x1a5)]===_0x10b8bb);_0x142b79===-0x1&&_0x10b8bb!=='us01'&&(_0x41ff8e[_0x4cfab7(0x18b)]({'title':_0x10b8bb,'value':_0x10b8bb}),_0x142b79=_0x41ff8e[_0x4cfab7(0x18d)]-0x1);_0x41ff8e[_0x4cfab7(0x18b)]({'title':_0x4cfab7(0x1a4),'value':_0x4cfab7(0x144)});const _0x5a099d=await a24_0x2237cf({'type':_0x4cfab7(0x188),'name':_0x4cfab7(0x17c),'message':_0x4cfab7(0x181)+_0x51de26+'\x27:','choices':_0x41ff8e,'initial':_0x142b79>=0x0?_0x142b79:0x0});if(!_0x5a099d[_0x4cfab7(0x17c)])return console[_0x4cfab7(0x15f)](_0x4cfab7(0x14b)),0x1;let _0x394d76;if(_0x5a099d['site']===_0x4cfab7(0x144)){const _0x3b611d=await a24_0x2237cf({'type':_0x4cfab7(0x14d),'name':_0x4cfab7(0x1b5),'message':_0x4cfab7(0x14e),'initial':_0x4cfab7(0x148),'validate':_0x1ed493=>{const _0xcfdaa3=_0x4cfab7;if(!_0x1ed493||!_0x1ed493['trim']())return _0xcfdaa3(0x15e);if(!/^[a-z0-9-]+$/['test'](_0x1ed493[_0xcfdaa3(0x164)]()))return _0xcfdaa3(0x1ad);return!![];}});if(!_0x3b611d['customSite'])return console[_0x4cfab7(0x15f)](_0x4cfab7(0x14b)),0x1;_0x394d76=_0x3b611d[_0x4cfab7(0x1b5)];}else _0x394d76=_0x5a099d[_0x4cfab7(0x17c)];const _0x18a6b7=resolveSite(_0x394d76);console[_0x4cfab7(0x15f)](_0x4cfab7(0x149)+_0x18a6b7),console[_0x4cfab7(0x15f)](_0x4cfab7(0x157)),console[_0x4cfab7(0x15f)]('\x20\x20'+getConsoleUrl(_0x18a6b7,'/app/mp/ak'));const _0x544d4b=await a24_0x2237cf({'type':'password','name':_0x4cfab7(0x182),'message':_0x4cfab7(0x165),'validate':_0x2ed00a=>{const _0x2bf9db=_0x4cfab7;if(!_0x2ed00a||!_0x2ed00a[_0x2bf9db(0x164)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x544d4b['apiKey'])return console[_0x4cfab7(0x15f)]('\x0aSetup\x20cancelled'),0x1;const _0x69a53=_0x544d4b[_0x4cfab7(0x182)];console[_0x4cfab7(0x15f)](_0x4cfab7(0x168));try{const _0x300b98=TDX[_0x4cfab7(0x166)]({'site':_0x18a6b7,'apiKey':_0x69a53[_0x4cfab7(0x164)](),'logLevel':_0x117d59[_0x4cfab7(0x1af)]??LogLevel[_0x4cfab7(0x1b0)]}),_0x50fc83=await _0x300b98[_0x4cfab7(0x19e)][_0x4cfab7(0x170)]();console[_0x4cfab7(0x15f)](a24_0x21870b[_0x4cfab7(0x14c)]('✓')+_0x4cfab7(0x162)+_0x50fc83[_0x4cfab7(0x171)]+')');const _0x1b3045=await isKeychainAvailable();_0x1b3045?(await saveAPIKeyAsync(_0x69a53['trim'](),_0x18a6b7,_0x51de26),console[_0x4cfab7(0x15f)](a24_0x21870b['green']('✓')+_0x4cfab7(0x16f)+_0x51de26+')')):(console[_0x4cfab7(0x18f)](a24_0x21870b['yellow'](_0x4cfab7(0x189))),console[_0x4cfab7(0x18f)](a24_0x21870b['yellow'](_0x4cfab7(0x172))));const _0x1dd622={'site':_0x18a6b7,..._0x1c74af&&{'description':_0x1c74af}};return saveProfileToUserConfig(_0x51de26,_0x1dd622),console[_0x4cfab7(0x15f)](a24_0x21870b[_0x4cfab7(0x14c)]('✓')+_0x4cfab7(0x16c)+_0x51de26+'\x27\x20created'),console[_0x4cfab7(0x15f)](),console[_0x4cfab7(0x15f)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x4cfab7(0x15f)]('\x20\x20tdx\x20--profile\x20'+_0x51de26+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x4cfab7(0x155)+_0x51de26+_0x4cfab7(0x1a8)),0x0;}catch(_0x3d491a){if(_0x3d491a instanceof HTTPClientError&&_0x3d491a[_0x4cfab7(0x1a9)]===0x191)return printAuthError(_0x3d491a),0x1;return console[_0x4cfab7(0x17e)](a24_0x21870b[_0x4cfab7(0x16d)](_0x4cfab7(0x15d)+(_0x3d491a instanceof Error?_0x3d491a[_0x4cfab7(0x174)]:String(_0x3d491a)))),console[_0x4cfab7(0x17e)](_0x4cfab7(0x1aa)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a24_0x4c767c(0x184)]=a24_0x4c767c(0x150);[a24_0x4c767c(0x1b3)]='Remove\x20a\x20profile';[a24_0x4c767c(0x175)](_0x515e33){const _0x3de24e=a24_0x4c767c,{args:_0x4f3d83}=_0x515e33;if(_0x4f3d83[_0x3de24e(0x18d)]===0x0)return _0x3de24e(0x146);return undefined;}async[a24_0x4c767c(0x17f)](_0x47c7d4){const _0x224ee0=a24_0x4c767c,{args:_0x5ea7b2}=_0x47c7d4,_0xfcbfb1=_0x5ea7b2[0x0];console['log'](a24_0x21870b[_0x224ee0(0x19a)](_0x224ee0(0x193)));if(!profileExists(_0xfcbfb1)){console[_0x224ee0(0x17e)](a24_0x21870b[_0x224ee0(0x16d)](_0x224ee0(0x178)+_0xfcbfb1+_0x224ee0(0x156))),console[_0x224ee0(0x15f)](_0x224ee0(0x197));const _0x4a555f=listProfiles();if(_0x4a555f[_0x224ee0(0x18d)]===0x0)console['log']('\x20\x20(no\x20profiles\x20found)');else for(const _0x3877a8 of _0x4a555f){console[_0x224ee0(0x15f)](_0x224ee0(0x176)+_0x3877a8[_0x224ee0(0x184)]);}return 0x1;}const _0x323a00=await a24_0x2237cf({'type':_0x224ee0(0x194),'name':_0x224ee0(0x194),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0xfcbfb1+'\x27?','initial':![]});if(!_0x323a00[_0x224ee0(0x194)])return console[_0x224ee0(0x15f)]('Removal\x20cancelled'),0x0;try{removeProfileFromUserConfig(_0xfcbfb1),console[_0x224ee0(0x15f)](a24_0x21870b[_0x224ee0(0x14c)]('✓')+_0x224ee0(0x16c)+_0xfcbfb1+'\x27\x20removed\x20from\x20configuration');}catch(_0x5c1170){return console[_0x224ee0(0x17e)](a24_0x21870b[_0x224ee0(0x16d)]('Failed\x20to\x20remove\x20profile:\x20'+(_0x5c1170 instanceof Error?_0x5c1170['message']:String(_0x5c1170)))),0x1;}const _0x3c63de=await isKeychainAvailable();if(_0x3c63de){const _0x505977=await deleteKeychainAPIKey(_0xfcbfb1);_0x505977&&console[_0x224ee0(0x15f)](a24_0x21870b[_0x224ee0(0x14c)]('✓')+'\x20API\x20key\x20removed\x20from\x20system\x20keychain');}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a24_0x4c767c(0x184)]=a24_0x4c767c(0x1a3);[a24_0x4c767c(0x1b3)]=a24_0x4c767c(0x19f);static [a24_0x4c767c(0x198)]=[a24_0x4c767c(0x17c),'database',a24_0x4c767c(0x163),a24_0x4c767c(0x195),a24_0x4c767c(0x180),'description'];[a24_0x4c767c(0x175)](_0x2232a0){const _0xf73d5c=a24_0x4c767c,{args:_0x2fe194,options:_0x433dc3}=_0x2232a0,_0x10f3a8=_0x433dc3[_0xf73d5c(0x142)]||getActiveProfile();if(!_0x10f3a8)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(_0x2fe194[_0xf73d5c(0x18d)]===0x0)return _0xf73d5c(0x17d)+ProfileSetCommand[_0xf73d5c(0x198)]['join'](',\x20');const _0x5f3a29=_0x2fe194[0x0];if(!_0x5f3a29[_0xf73d5c(0x177)]('='))return _0xf73d5c(0x1ab)+ProfileSetCommand['VALID_KEYS'][_0xf73d5c(0x19b)](',\x20');const [_0x2789fc]=_0x5f3a29[_0xf73d5c(0x153)]('=',0x2);if(!ProfileSetCommand[_0xf73d5c(0x198)][_0xf73d5c(0x177)](_0x2789fc))return'Unknown\x20key\x20\x27'+_0x2789fc+_0xf73d5c(0x16b)+ProfileSetCommand[_0xf73d5c(0x198)]['join'](',\x20');return undefined;}async[a24_0x4c767c(0x17f)](_0x1ba08a){const _0x24a35f=a24_0x4c767c,{args:_0x26c884,options:_0x466b08}=_0x1ba08a,_0x15f87d=_0x466b08[_0x24a35f(0x142)]||getActiveProfile(),[_0x2d098e,..._0x20de9c]=_0x26c884[0x0]['split']('='),_0x464cbe=_0x20de9c[_0x24a35f(0x19b)]('=');console[_0x24a35f(0x15f)](a24_0x21870b[_0x24a35f(0x19a)]('tdx:\x20profile\x20set'));if(!profileExists(_0x15f87d)){const _0x12863e=await a24_0x2237cf({'type':_0x24a35f(0x194),'name':_0x24a35f(0x166),'message':_0x24a35f(0x178)+_0x15f87d+_0x24a35f(0x191),'initial':!![]});if(!_0x12863e[_0x24a35f(0x166)])return console[_0x24a35f(0x15f)](_0x24a35f(0x1a6)),0x1;}const _0x24faf6=loadProfile(_0x15f87d),_0x533a57=_0x24faf6?.[_0x24a35f(0x186)]||{};if(_0x2d098e===_0x24a35f(0x17c)){const _0x1beee3=resolveSite(_0x464cbe);console[_0x24a35f(0x15f)](_0x24a35f(0x1b8)+_0x1beee3+_0x24a35f(0x1b6)),console[_0x24a35f(0x15f)](_0x24a35f(0x185)),console[_0x24a35f(0x15f)]('\x20\x20'+getConsoleUrl(_0x1beee3,_0x24a35f(0x167)));const _0x293fd4=await a24_0x2237cf({'type':_0x24a35f(0x1b4),'name':_0x24a35f(0x182),'message':_0x24a35f(0x15a),'validate':_0xd1c756=>{const _0x571a8a=_0x24a35f;if(!_0xd1c756||!_0xd1c756[_0x571a8a(0x164)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x293fd4[_0x24a35f(0x182)])return console['log'](_0x24a35f(0x145)),0x1;console[_0x24a35f(0x15f)](_0x24a35f(0x168));try{const _0x128d22=TDX['create']({'site':_0x1beee3,'apiKey':_0x293fd4['apiKey']['trim'](),'logLevel':_0x466b08[_0x24a35f(0x1af)]??LogLevel[_0x24a35f(0x1b0)]}),_0x3ce0f6=await _0x128d22[_0x24a35f(0x19e)][_0x24a35f(0x170)]();console[_0x24a35f(0x15f)](a24_0x21870b[_0x24a35f(0x14c)]('✓')+_0x24a35f(0x162)+_0x3ce0f6[_0x24a35f(0x171)]+')');const _0x20cf62=await isKeychainAvailable();_0x20cf62?(await saveAPIKeyAsync(_0x293fd4['apiKey']['trim'](),_0x1beee3,_0x15f87d),console[_0x24a35f(0x15f)](a24_0x21870b[_0x24a35f(0x14c)]('✓')+_0x24a35f(0x15c))):console[_0x24a35f(0x18f)](a24_0x21870b[_0x24a35f(0x1a1)](_0x24a35f(0x189))),_0x533a57[_0x24a35f(0x17c)]=_0x1beee3;}catch(_0x42af78){if(_0x42af78 instanceof HTTPClientError&&_0x42af78[_0x24a35f(0x1a9)]===0x191)return printAuthError(_0x42af78),0x1;return console[_0x24a35f(0x17e)](a24_0x21870b['red']('✗\x20Validation\x20failed:\x20'+(_0x42af78 instanceof Error?_0x42af78[_0x24a35f(0x174)]:String(_0x42af78)))),console[_0x24a35f(0x17e)](_0x24a35f(0x14a)),0x1;}}else _0x533a57[_0x2d098e]=_0x464cbe||undefined;return saveProfileToUserConfig(_0x15f87d,_0x533a57),console[_0x24a35f(0x15f)](a24_0x21870b[_0x24a35f(0x14c)]('✓')+_0x24a35f(0x16c)+_0x15f87d+_0x24a35f(0x19c)+_0x2d098e+'='+(_0x464cbe||_0x24a35f(0x196))),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a24_0x4c767c(0x1a2);['description']='Set\x20session\x20profile';['validate'](_0x4be18d){const _0x2d0e9b=a24_0x4c767c,{args:_0x25d715}=_0x4be18d;if(_0x25d715[_0x2d0e9b(0x18d)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async[a24_0x4c767c(0x17f)](_0xa88516){const _0x3b9763=a24_0x4c767c,{args:_0x57d158,options:_0x56ffc3}=_0xa88516,_0x1ea61f=_0x57d158[0x0],_0x54dc09=_0x56ffc3[_0x3b9763(0x161)];cleanExpiredSessions();if(!profileExists(_0x1ea61f)){console[_0x3b9763(0x17e)](a24_0x21870b[_0x3b9763(0x16d)](_0x3b9763(0x178)+_0x1ea61f+_0x3b9763(0x156))),console[_0x3b9763(0x15f)]('\x0aAvailable\x20profiles:');const _0x3dc716=listProfiles();if(_0x3dc716[_0x3b9763(0x18d)]===0x0)console[_0x3b9763(0x15f)](_0x3b9763(0x159));else for(const _0x566059 of _0x3dc716){console[_0x3b9763(0x15f)]('\x20\x20-\x20'+_0x566059[_0x3b9763(0x184)]);}return 0x1;}if(_0x54dc09){const _0x293e1c=a24_0x590ba5[_0x3b9763(0x19b)](getConfigDir(),_0x3b9763(0x143));return saveActiveProfileToUserConfig(_0x1ea61f),console[_0x3b9763(0x15f)](_0x3b9763(0x179)+a24_0x21870b[_0x3b9763(0x14c)](_0x1ea61f)),console[_0x3b9763(0x15f)](a24_0x21870b[_0x3b9763(0x187)](_0x3b9763(0x16a)+_0x293e1c)),0x0;}const _0x3f4bcd=_0x56ffc3[_0x3b9763(0x158)]||getCurrentSessionPID()[_0x3b9763(0x147)]();return saveSessionContext({'profile':_0x1ea61f},_0x56ffc3[_0x3b9763(0x158)]),console['log'](_0x3b9763(0x15b)+a24_0x21870b[_0x3b9763(0x14c)](_0x1ea61f)+'\x20'+a24_0x21870b[_0x3b9763(0x187)](_0x3b9763(0x190)+_0x3f4bcd+')')),console[_0x3b9763(0x15f)](a24_0x21870b[_0x3b9763(0x187)]('\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20'+_0x1ea61f+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}
|
|
1
|
+
const a24_0x47deda=a24_0xdca9;(function(_0x1b35c6,_0x4b7551){const _0xb11ab0=a24_0xdca9,_0x3c98f6=_0x1b35c6();while(!![]){try{const _0x5ea348=parseInt(_0xb11ab0(0xf5))/0x1+-parseInt(_0xb11ab0(0xe0))/0x2*(-parseInt(_0xb11ab0(0x96))/0x3)+-parseInt(_0xb11ab0(0xb3))/0x4+-parseInt(_0xb11ab0(0xf8))/0x5*(parseInt(_0xb11ab0(0xf0))/0x6)+-parseInt(_0xb11ab0(0xf2))/0x7+-parseInt(_0xb11ab0(0xde))/0x8*(-parseInt(_0xb11ab0(0xa1))/0x9)+-parseInt(_0xb11ab0(0xd8))/0xa;if(_0x5ea348===_0x4b7551)break;else _0x3c98f6['push'](_0x3c98f6['shift']());}catch(_0x177a50){_0x3c98f6['push'](_0x3c98f6['shift']());}}}(a24_0x1149,0xb3dc5));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 a24_0x1b7011 from'node:path';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{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 a24_0x54d2ef from'prompts';import a24_0xb78665 from'chalk';function validateProfileName(_0x597d5a){const _0x1351e9=a24_0xdca9;if(!_0x597d5a||!_0x597d5a[_0x1351e9(0xae)]())return _0x1351e9(0xab);const _0x573a80=_0x597d5a[_0x1351e9(0xae)]();if(!/^[a-zA-Z0-9_-]+$/[_0x1351e9(0x9a)](_0x573a80))return _0x1351e9(0x99);if(profileExists(_0x573a80))return _0x1351e9(0xc3)+_0x573a80+_0x1351e9(0xd1);return!![];}export class ProfileCreateCommand extends BaseCommand{['name']=a24_0x47deda(0xac);[a24_0x47deda(0x9b)]='Create\x20a\x20new\x20profile';async[a24_0x47deda(0x90)](_0x5c1984){const _0x9b0dfc=a24_0x47deda,{options:_0x3a275d,args:_0x4db33b}=_0x5c1984;console[_0x9b0dfc(0xcc)](a24_0xb78665[_0x9b0dfc(0xf4)](_0x9b0dfc(0xa5)));let _0x3eca4b;if(_0x4db33b[_0x9b0dfc(0xb4)]>0x0&&_0x4db33b[0x0]){const _0x111632=_0x4db33b[0x0][_0x9b0dfc(0xae)](),_0x1e1625=validateProfileName(_0x111632);if(_0x1e1625!==!![])return console[_0x9b0dfc(0xca)](a24_0xb78665[_0x9b0dfc(0xc6)](_0x1e1625)),0x1;_0x3eca4b=_0x111632;}else{const _0x161569=await a24_0x54d2ef({'type':_0x9b0dfc(0xe6),'name':_0x9b0dfc(0xe9),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x161569[_0x9b0dfc(0xe9)])return console[_0x9b0dfc(0xcc)](_0x9b0dfc(0xa2)),0x1;_0x3eca4b=_0x161569[_0x9b0dfc(0xe9)]['trim']();}const _0x4e1ce3=await a24_0x54d2ef({'type':_0x9b0dfc(0xe6),'name':_0x9b0dfc(0x9b),'message':_0x9b0dfc(0xe3)}),_0x533095=_0x4e1ce3['description']?.['trim']()||undefined,_0x11f17b=_0x3a275d[_0x9b0dfc(0xe1)]||'us01',{choices:_0x25e17d,initialIndex:_0x7ee743}=buildSiteChoices(_0x11f17b),_0x224805=await a24_0x54d2ef({'type':_0x9b0dfc(0xb6),'name':_0x9b0dfc(0xe1),'message':_0x9b0dfc(0xdc)+_0x3eca4b+'\x27:','choices':_0x25e17d,'initial':_0x7ee743});if(!_0x224805[_0x9b0dfc(0xe1)])return console[_0x9b0dfc(0xcc)](_0x9b0dfc(0xa2)),0x1;let _0x2dbeb7;if(_0x224805['site']===_0x9b0dfc(0xef)){const _0x428232=await a24_0x54d2ef({'type':_0x9b0dfc(0xe6),'name':_0x9b0dfc(0xa8),'message':_0x9b0dfc(0xb8),'initial':_0x9b0dfc(0xa7),'validate':_0x33baf6=>{const _0x55a44b=_0x9b0dfc;if(!_0x33baf6||!_0x33baf6[_0x55a44b(0xae)]())return _0x55a44b(0xa9);if(!/^[a-z0-9-]+$/[_0x55a44b(0x9a)](_0x33baf6['trim']()))return _0x55a44b(0xd6);return!![];}});if(!_0x428232[_0x9b0dfc(0xa8)])return console[_0x9b0dfc(0xcc)](_0x9b0dfc(0xa2)),0x1;_0x2dbeb7=_0x428232[_0x9b0dfc(0xa8)];}else _0x2dbeb7=_0x224805[_0x9b0dfc(0xe1)];const _0x26ff4b=resolveSite(_0x2dbeb7);console['log']('\x0aSetting\x20up\x20authentication\x20for\x20site:\x20'+_0x26ff4b),console['log'](_0x9b0dfc(0x92)),console[_0x9b0dfc(0xcc)]('\x20\x20'+getConsoleUrl(_0x26ff4b,_0x9b0dfc(0xeb)));const _0x10aee8=await a24_0x54d2ef({'type':_0x9b0dfc(0xd7),'name':_0x9b0dfc(0xad),'message':_0x9b0dfc(0xfb),'validate':_0x500d92=>{const _0x592e94=_0x9b0dfc;if(!_0x500d92||!_0x500d92[_0x592e94(0xae)]())return _0x592e94(0xdd);return!![];}});if(!_0x10aee8[_0x9b0dfc(0xad)])return console[_0x9b0dfc(0xcc)]('\x0aSetup\x20cancelled'),0x1;const _0x7a59ed=_0x10aee8[_0x9b0dfc(0xad)];console[_0x9b0dfc(0xcc)](_0x9b0dfc(0xc4));try{const _0x527da1=TDX[_0x9b0dfc(0xed)]({'site':_0x26ff4b,'apiKey':_0x7a59ed[_0x9b0dfc(0xae)](),'logLevel':_0x3a275d[_0x9b0dfc(0x8f)]??LogLevel[_0x9b0dfc(0xda)]}),_0x4ced7c=await _0x527da1[_0x9b0dfc(0xbe)]['getUserInfo']();console[_0x9b0dfc(0xcc)](a24_0xb78665[_0x9b0dfc(0xd4)]('✓')+_0x9b0dfc(0xbc)+_0x4ced7c[_0x9b0dfc(0x9e)]+')');const _0x567ab0=await isKeychainAvailable();_0x567ab0?(await saveAPIKeyAsync(_0x7a59ed[_0x9b0dfc(0xae)](),_0x26ff4b,_0x3eca4b),console['log'](a24_0xb78665['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x3eca4b+')')):(console['warn'](a24_0xb78665[_0x9b0dfc(0x97)](_0x9b0dfc(0xe4))),console[_0x9b0dfc(0xc2)](a24_0xb78665[_0x9b0dfc(0x97)](_0x9b0dfc(0x91))));const _0x3b8e7a={'site':_0x26ff4b,..._0x533095&&{'description':_0x533095}};return saveProfileToUserConfig(_0x3eca4b,_0x3b8e7a),console[_0x9b0dfc(0xcc)](a24_0xb78665['green']('✓')+_0x9b0dfc(0xb0)+_0x3eca4b+_0x9b0dfc(0x94)),console[_0x9b0dfc(0xcc)](),console[_0x9b0dfc(0xcc)](_0x9b0dfc(0xcf)),console['log']('\x20\x20tdx\x20--profile\x20'+_0x3eca4b+_0x9b0dfc(0xbd)),console[_0x9b0dfc(0xcc)]('\x20\x20tdx\x20--profile\x20'+_0x3eca4b+_0x9b0dfc(0xc8)),0x0;}catch(_0x4f8c65){if(_0x4f8c65 instanceof HTTPClientError&&_0x4f8c65[_0x9b0dfc(0xb9)]===0x191)return printAuthError(_0x4f8c65),0x1;return console[_0x9b0dfc(0xca)](a24_0xb78665[_0x9b0dfc(0xc6)]('✗\x20Validation\x20failed:\x20'+(_0x4f8c65 instanceof Error?_0x4f8c65['message']:String(_0x4f8c65)))),console[_0x9b0dfc(0xca)]('Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.'),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a24_0x47deda(0xd5)]=a24_0x47deda(0xb5);[a24_0x47deda(0x9b)]=a24_0x47deda(0xe7);[a24_0x47deda(0xb7)](_0x48b7bc){const _0xce2c8b=a24_0x47deda,{args:_0x2880c7}=_0x48b7bc;if(_0x2880c7[_0xce2c8b(0xb4)]===0x0)return _0xce2c8b(0xc5);return undefined;}async['execute'](_0x163cdf){const _0x8158c8=a24_0x47deda,{args:_0xda75cd}=_0x163cdf,_0x22386b=_0xda75cd[0x0];console['log'](a24_0xb78665[_0x8158c8(0xf4)]('tdx:\x20profile\x20remove'));if(!profileExists(_0x22386b)){console[_0x8158c8(0xca)](a24_0xb78665[_0x8158c8(0xc6)](_0x8158c8(0xc3)+_0x22386b+_0x8158c8(0xe2))),console[_0x8158c8(0xcc)](_0x8158c8(0xf3));const _0x5a461b=listProfiles();if(_0x5a461b['length']===0x0)console[_0x8158c8(0xcc)](_0x8158c8(0xba));else for(const _0x463f21 of _0x5a461b){console[_0x8158c8(0xcc)](_0x8158c8(0xc7)+_0x463f21[_0x8158c8(0xd5)]);}return 0x1;}const _0x205844=await a24_0x54d2ef({'type':_0x8158c8(0xfa),'name':_0x8158c8(0xfa),'message':_0x8158c8(0xee)+_0x22386b+'\x27?','initial':![]});if(!_0x205844['confirm'])return console[_0x8158c8(0xcc)]('Removal\x20cancelled'),0x0;try{removeProfileFromUserConfig(_0x22386b),console[_0x8158c8(0xcc)](a24_0xb78665['green']('✓')+_0x8158c8(0xb0)+_0x22386b+_0x8158c8(0xe8));}catch(_0x482fdf){return console['error'](a24_0xb78665[_0x8158c8(0xc6)](_0x8158c8(0xe5)+(_0x482fdf instanceof Error?_0x482fdf['message']:String(_0x482fdf)))),0x1;}const _0xe5edc6=await isKeychainAvailable();if(_0xe5edc6){const _0x3a593c=await deleteKeychainAPIKey(_0x22386b);_0x3a593c&&console[_0x8158c8(0xcc)](a24_0xb78665[_0x8158c8(0xd4)]('✓')+'\x20API\x20key\x20removed\x20from\x20system\x20keychain');}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a24_0x47deda(0xd5)]=a24_0x47deda(0x9c);[a24_0x47deda(0x9b)]=a24_0x47deda(0xa0);static [a24_0x47deda(0xf9)]=[a24_0x47deda(0xe1),a24_0x47deda(0x9d),a24_0x47deda(0xec),a24_0x47deda(0xa4),a24_0x47deda(0xbb),a24_0x47deda(0x9b)];[a24_0x47deda(0xb7)](_0x5340c8){const _0x488daf=a24_0x47deda,{args:_0x3f99a3,options:_0x3e2b9d}=_0x5340c8,_0x4ac138=_0x3e2b9d['profile']||getActiveProfile();if(!_0x4ac138)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(_0x3f99a3[_0x488daf(0xb4)]===0x0)return _0x488daf(0xd3)+ProfileSetCommand[_0x488daf(0xf9)][_0x488daf(0xc9)](',\x20');const _0x5817a6=_0x3f99a3[0x0];if(!_0x5817a6[_0x488daf(0x8e)]('='))return _0x488daf(0xa6)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');const [_0x48ac64]=_0x5817a6[_0x488daf(0xd0)]('=',0x2);if(!ProfileSetCommand[_0x488daf(0xf9)][_0x488daf(0x8e)](_0x48ac64))return'Unknown\x20key\x20\x27'+_0x48ac64+_0x488daf(0x95)+ProfileSetCommand[_0x488daf(0xf9)][_0x488daf(0xc9)](',\x20');return undefined;}async[a24_0x47deda(0x90)](_0x24084e){const _0x2ae79b=a24_0x47deda,{args:_0xd5a53f,options:_0x29c6b7}=_0x24084e,_0x450644=_0x29c6b7['profile']||getActiveProfile(),[_0x29be59,..._0x14a886]=_0xd5a53f[0x0][_0x2ae79b(0xd0)]('='),_0x121533=_0x14a886['join']('=');console['log'](a24_0xb78665['bold'](_0x2ae79b(0xaf)));if(!profileExists(_0x450644)){const _0x705196=await a24_0x54d2ef({'type':_0x2ae79b(0xfa),'name':_0x2ae79b(0xed),'message':'Profile\x20\x27'+_0x450644+_0x2ae79b(0xce),'initial':!![]});if(!_0x705196['create'])return console[_0x2ae79b(0xcc)]('Operation\x20cancelled'),0x1;}const _0x3d3620=loadProfile(_0x450644),_0x3244d1=_0x3d3620?.['config']||{};if(_0x29be59===_0x2ae79b(0xe1)){const _0x482e20=resolveSite(_0x121533);console[_0x2ae79b(0xcc)](_0x2ae79b(0xb1)+_0x482e20+_0x2ae79b(0xcd)),console[_0x2ae79b(0xcc)](_0x2ae79b(0xd2)),console[_0x2ae79b(0xcc)]('\x20\x20'+getConsoleUrl(_0x482e20,'/app/mp/ak'));const _0xd80397=await a24_0x54d2ef({'type':_0x2ae79b(0xd7),'name':'apiKey','message':_0x2ae79b(0xcb),'validate':_0x1a86f9=>{const _0x5c265f=_0x2ae79b;if(!_0x1a86f9||!_0x1a86f9[_0x5c265f(0xae)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0xd80397[_0x2ae79b(0xad)])return console['log'](_0x2ae79b(0xf7)),0x1;console['log']('Validating\x20API\x20key...');try{const _0xb2da17=TDX[_0x2ae79b(0xed)]({'site':_0x482e20,'apiKey':_0xd80397['apiKey'][_0x2ae79b(0xae)](),'logLevel':_0x29c6b7[_0x2ae79b(0x8f)]??LogLevel[_0x2ae79b(0xda)]}),_0x118c35=await _0xb2da17['jobs'][_0x2ae79b(0x93)]();console['log'](a24_0xb78665[_0x2ae79b(0xd4)]('✓')+_0x2ae79b(0xbc)+_0x118c35[_0x2ae79b(0x9e)]+')');const _0x178a16=await isKeychainAvailable();_0x178a16?(await saveAPIKeyAsync(_0xd80397[_0x2ae79b(0xad)][_0x2ae79b(0xae)](),_0x482e20,_0x450644),console[_0x2ae79b(0xcc)](a24_0xb78665[_0x2ae79b(0xd4)]('✓')+_0x2ae79b(0xa3))):console['warn'](a24_0xb78665[_0x2ae79b(0x97)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x3244d1[_0x2ae79b(0xe1)]=_0x482e20;}catch(_0x5a06fb){if(_0x5a06fb instanceof HTTPClientError&&_0x5a06fb[_0x2ae79b(0xb9)]===0x191)return printAuthError(_0x5a06fb),0x1;return console[_0x2ae79b(0xca)](a24_0xb78665[_0x2ae79b(0xc6)](_0x2ae79b(0xb2)+(_0x5a06fb instanceof Error?_0x5a06fb[_0x2ae79b(0xdb)]:String(_0x5a06fb)))),console['error'](_0x2ae79b(0x9f)),0x1;}}else _0x3244d1[_0x29be59]=_0x121533||undefined;return saveProfileToUserConfig(_0x450644,_0x3244d1),console['log'](a24_0xb78665['green']('✓')+_0x2ae79b(0xb0)+_0x450644+_0x2ae79b(0xf1)+_0x29be59+'='+(_0x121533||_0x2ae79b(0xf6))),0x0;}}function a24_0xdca9(_0x55dc0c,_0x3b1cea){_0x55dc0c=_0x55dc0c-0x8e;const _0x11498a=a24_0x1149();let _0xdca945=_0x11498a[_0x55dc0c];return _0xdca945;}function a24_0x1149(){const _0x1d5051=['\x20\x20-\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','join','error','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','log','\x27\x20requires\x20API\x20key\x20validation.','\x27\x20does\x20not\x20exist.\x20Create\x20it?','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','split','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','green','name','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','password','944010FgChkE','\x20--default\x27\x20to\x20save\x20permanently','ERROR','message','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','API\x20key\x20cannot\x20be\x20empty','256XZVJOK','Default\x20profile\x20set\x20to:\x20','1352gYHIEM','site','\x27\x20does\x20not\x20exist.','Enter\x20description\x20(optional):','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Failed\x20to\x20remove\x20profile:\x20','text','Remove\x20a\x20profile','\x27\x20removed\x20from\x20configuration','profileName','toString','/app/mp/ak','parent_segment','create','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','other','9714XFrWoG','\x27\x20updated:\x20','2030553UIWjvM','\x0aAvailable\x20profiles:','bold','1411420mwutyC','(cleared)','\x0aOperation\x20cancelled','3490mmCUlm','VALID_KEYS','confirm','Enter\x20your\x20TD\x20API\x20key:','includes','logLevel','execute','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','You\x20can\x20find\x20your\x20API\x20key\x20at:','getUserInfo','\x27\x20created','\x27.\x0a\x0aValid\x20keys:\x20','4827wsVdPu','yellow','tdx.json','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','test','description','profile:set','database','email','Site\x20was\x20not\x20changed.','Set\x20a\x20profile\x20configuration\x20value','132336tsnNoR','\x0aSetup\x20cancelled','\x20API\x20key\x20saved\x20to\x20system\x20keychain','llm_project','tdx:\x20profile\x20create','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','us01','customSite','Site\x20name\x20cannot\x20be\x20empty','session','Profile\x20name\x20cannot\x20be\x20empty','profile:create','apiKey','trim','tdx:\x20profile\x20set','\x20Profile\x20\x27','Changing\x20site\x20to\x20\x27','✗\x20Validation\x20failed:\x20','2873524eWNZIY','length','profile:remove','select','validate','Enter\x20site\x20name:','status','\x20\x20(no\x20profiles\x20found)','llm_agent','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','(session:\x20','dim','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','warn','Profile\x20\x27','Validating\x20API\x20key...','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','red'];a24_0x1149=function(){return _0x1d5051;};return a24_0x1149();}export class ProfileUseCommand extends BaseCommand{[a24_0x47deda(0xd5)]='profile:use';[a24_0x47deda(0x9b)]='Set\x20session\x20profile';[a24_0x47deda(0xb7)](_0x34ce49){const _0x3eeb37=a24_0x47deda,{args:_0x431d49}=_0x34ce49;if(_0x431d49[_0x3eeb37(0xb4)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async[a24_0x47deda(0x90)](_0x27f89d){const _0x3b2e50=a24_0x47deda,{args:_0x419615,options:_0x4389f9}=_0x27f89d,_0x2b9bdf=_0x419615[0x0],_0x598013=_0x4389f9['default'];cleanExpiredSessions();if(!profileExists(_0x2b9bdf)){console[_0x3b2e50(0xca)](a24_0xb78665['red'](_0x3b2e50(0xc3)+_0x2b9bdf+_0x3b2e50(0xe2))),console[_0x3b2e50(0xcc)]('\x0aAvailable\x20profiles:');const _0x120022=listProfiles();if(_0x120022[_0x3b2e50(0xb4)]===0x0)console[_0x3b2e50(0xcc)](_0x3b2e50(0xba));else for(const _0xf1d704 of _0x120022){console[_0x3b2e50(0xcc)](_0x3b2e50(0xc7)+_0xf1d704[_0x3b2e50(0xd5)]);}return 0x1;}if(_0x598013){const _0x571e56=a24_0x1b7011[_0x3b2e50(0xc9)](getConfigDir(),_0x3b2e50(0x98));return saveActiveProfileToUserConfig(_0x2b9bdf),console[_0x3b2e50(0xcc)](_0x3b2e50(0xdf)+a24_0xb78665[_0x3b2e50(0xd4)](_0x2b9bdf)),console[_0x3b2e50(0xcc)](a24_0xb78665[_0x3b2e50(0xc0)]('\x0aSaved\x20to:\x20'+_0x571e56)),0x0;}const _0x57c209=_0x4389f9[_0x3b2e50(0xaa)]||getCurrentSessionPID()[_0x3b2e50(0xea)]();return saveSessionContext({'profile':_0x2b9bdf},_0x4389f9[_0x3b2e50(0xaa)]),console[_0x3b2e50(0xcc)]('Session\x20profile\x20set\x20to:\x20'+a24_0xb78665[_0x3b2e50(0xd4)](_0x2b9bdf)+'\x20'+a24_0xb78665[_0x3b2e50(0xc0)](_0x3b2e50(0xbf)+_0x57c209+')')),console[_0x3b2e50(0xcc)](a24_0xb78665[_0x3b2e50(0xc0)](_0x3b2e50(0xc1)+_0x2b9bdf+_0x3b2e50(0xd9))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-command.js","sourceRoot":"","sources":["../../src/commands/profile-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,gBAAgB,EAChB,6BAA6B,GAE9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,SAAS,mBAAmB,CAAC,IAAwB;IACnD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1B,OAAO,8BAA8B,CAAC;IACxC,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,kBAAkB,CAA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EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,OAAO,CAAC,OAA6B,CAAC,CAAC;QAEpF,OAAO,CAAC,GAAG,CACT,2BAA2B,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,aAAa,SAAS,GAAG,CAAC,EAAE,CAC9F,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,+BAA+B,WAAW,iCAAiC,CAAC,CAAC,CAAC;QAEpG,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a25_0x6213d9=a25_0x3d6d;(function(_0x2fa43d,_0x469fad){const _0x566382=a25_0x3d6d,_0x2037cf=_0x2fa43d();while(!![]){try{const _0x2715e6=-parseInt(_0x566382(0x1d6))/0x1+parseInt(_0x566382(0x1cb))/0x2+parseInt(_0x566382(0x1ce))/0x3+-parseInt(_0x566382(0x1d7))/0x4*(-parseInt(_0x566382(0x1dc))/0x5)+-parseInt(_0x566382(0x1cd))/0x6*(parseInt(_0x566382(0x1d2))/0x7)+parseInt(_0x566382(0x1c9))/0x8+parseInt(_0x566382(0x1d3))/0x9*(-parseInt(_0x566382(0x1d5))/0xa);if(_0x2715e6===_0x469fad)break;else _0x2037cf['push'](_0x2037cf['shift']());}catch(_0x385934){_0x2037cf['push'](_0x2037cf['shift']());}}}(a25_0x5ca6,0x54d87));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';function a25_0x5ca6(){const _0x13c5ff=['9FKAtfe','map','8473990CTGHwG','460144YvaMuB','20YmQRte','Error:\x20','List\x20all\x20available\x20profiles','name','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','671405HHrIWl','message','error','2460136gkgPEb','config','182908WzMMek','description','348RVQwVn','2047968xAYSYY','profiles','execute','log','11823fnUMym'];a25_0x5ca6=function(){return _0x13c5ff;};return a25_0x5ca6();}function a25_0x3d6d(_0x4ff53c,_0x4fe2a3){_0x4ff53c=_0x4ff53c-0x1c9;const _0x5ca6de=a25_0x5ca6();let _0x3d6d56=_0x5ca6de[_0x4ff53c];return _0x3d6d56;}export class ProfilesCommand extends BaseCommand{[a25_0x6213d9(0x1da)]=a25_0x6213d9(0x1cf);[a25_0x6213d9(0x1cc)]=a25_0x6213d9(0x1d9);async[a25_0x6213d9(0x1d0)](_0x19c6d6){const _0x31bc22=a25_0x6213d9,{options:_0x55fcc9}=_0x19c6d6;try{const _0x50e2db=listProfiles(),_0x52f2a4=getActiveProfile();if(_0x50e2db['length']===0x0)return console['log'](_0x31bc22(0x1db)),console[_0x31bc22(0x1d1)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x31bc22(0x1d1)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x553427=_0x50e2db[_0x31bc22(0x1d4)](_0xc7ada9=>{const _0x16cc2e=_0x31bc22,_0x1d4123=_0xc7ada9[_0x16cc2e(0x1da)]===_0x52f2a4,_0x147b0c=getProfileParams(_0xc7ada9[_0x16cc2e(0x1ca)]);return{'name':_0xc7ada9[_0x16cc2e(0x1da)],'active':_0x1d4123,'scope':_0xc7ada9['scope'],'description':_0xc7ada9[_0x16cc2e(0x1ca)][_0x16cc2e(0x1cc)]||'','params':_0x147b0c};});return await handleSDKOutput(_0x553427,_0x55fcc9),0x0;}catch(_0x558f74){return _0x558f74 instanceof Error&&console[_0x31bc22(0x1de)](_0x31bc22(0x1d8)+_0x558f74[_0x31bc22(0x1dd)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a26_0x21be(){const _0x277d53=['No\x20SQL\x20provided','file','130MGmXuE','\x20[Job\x20ID:\x20','length','execute','site','setJobId','processedRows','join','\x20-\x20','\x20rows\x20','230895njaJZO','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','push','setPhase','options','991984RHRUKB','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','Executing\x20query\x20[','\x20splits','state','Site:\x20','jobId','args','stats','elapsedTimeMillis','Catalog:\x20','60542bbGlRa','...','7423560NsTpvn','1456805BRUtaF','Schema:\x20','Run\x20Trino\x20queries\x20(streaming)','SQL:\x20','totalSplits','1256388ByFqFL','validate','verbose','description','in\x20','Statement\x20','setExtra','6ajqOxs','Executing\x20statement\x20','query','\x0aAll\x20results\x20saved\x20to\x20','error','output','33yTcvOP','1146628vrnxWU','Error:\x20'];a26_0x21be=function(){return _0x277d53;};return a26_0x21be();}const a26_0x3e5df2=a26_0x1724;(function(_0x2aebf1,_0x563d24){const _0x1ec83f=a26_0x1724,_0x30de97=_0x2aebf1();while(!![]){try{const _0x58410c=parseInt(_0x1ec83f(0xb6))/0x1+-parseInt(_0x1ec83f(0x8d))/0x2*(-parseInt(_0x1ec83f(0xa2))/0x3)+-parseInt(_0x1ec83f(0xa3))/0x4+-parseInt(_0x1ec83f(0x90))/0x5*(-parseInt(_0x1ec83f(0x9c))/0x6)+-parseInt(_0x1ec83f(0x95))/0x7+-parseInt(_0x1ec83f(0x8f))/0x8+-parseInt(_0x1ec83f(0xb1))/0x9*(-parseInt(_0x1ec83f(0xa7))/0xa);if(_0x58410c===_0x563d24)break;else _0x30de97['push'](_0x30de97['shift']());}catch(_0x14183c){_0x30de97['push'](_0x30de97['shift']());}}}(a26_0x21be,0x87aeb));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';function a26_0x1724(_0x7e7aea,_0x1ec5cc){_0x7e7aea=_0x7e7aea-0x8d;const _0x21be03=a26_0x21be();let _0x17240d=_0x21be03[_0x7e7aea];return _0x17240d;}export class QueryCommand extends BaseCommand{['name']=a26_0x3e5df2(0x9e);[a26_0x3e5df2(0x98)]=a26_0x3e5df2(0x92);async[a26_0x3e5df2(0xaa)](_0x27a3b6){const _0x22fa48=a26_0x3e5df2,{options:_0x427317,args:_0x3b92e8,tdx:_0x9f8a66}=_0x27a3b6,_0x39ca70=_0x3b92e8[0x0],_0x2e5b84=_0x427317['file'];let _0x44af28;try{if(_0x2e5b84)_0x44af28=readSqlStatementsFromFile(_0x2e5b84);else{if(_0x39ca70==='-')_0x44af28=await readSqlStatementsFromStdin();else{if(_0x39ca70&&isSqlFilePath(_0x39ca70))_0x44af28=readSqlStatementsFromFile(_0x39ca70);else{if(_0x39ca70)_0x44af28=splitSqlStatements(_0x39ca70);else throw new Error(_0x22fa48(0xa5));}}}}catch(_0x4ed465){return console[_0x22fa48(0xa0)](_0x22fa48(0xa4)+_0x4ed465['message']),0x1;}const _0x3c9eb9=_0x427317['database']||'information_schema',_0x3b89fc=_0x427317['catalog'];try{const _0x2d647f=[],_0x3e8855=!!_0x427317['output'];for(let _0xd0008b=0x0;_0xd0008b<_0x44af28['length'];_0xd0008b++){const _0x667bdf=_0x44af28[_0xd0008b],_0x3cd981=_0xd0008b+0x1,_0x40f5e2=_0x44af28[_0x22fa48(0xa9)],_0x4576f0=_0x40f5e2>0x1;_0x427317[_0x22fa48(0x97)]&&(console[_0x22fa48(0xa0)]('\x0a'+(_0x4576f0?_0x22fa48(0x9a)+_0x3cd981+'/'+_0x40f5e2+':':'')),console['error'](_0x22fa48(0xbb)+_0x427317[_0x22fa48(0xab)]),console[_0x22fa48(0xa0)](_0x22fa48(0xc0)+(_0x3b89fc||'td')),console['error'](_0x22fa48(0x91)+_0x3c9eb9),console['error'](_0x22fa48(0x93)+_0x667bdf));const _0x34b528=_0x4576f0?_0x22fa48(0x9d)+_0x3cd981+'/'+_0x40f5e2+_0x22fa48(0x8e):'Executing\x20query...';try{const _0xcbb7d9=await withProgressSpinner(_0x34b528,async _0x19c526=>{const _0x574a92=_0x22fa48,_0x31be57=await _0x9f8a66[_0x574a92(0x9e)][_0x574a92(0xaa)](_0x667bdf,{'catalog':_0x3b89fc,'schema':_0x3c9eb9,'onJobId':_0x3017c0=>{const _0x373ee4=_0x574a92;_0x19c526[_0x373ee4(0xac)](_0x3017c0);},'onProgress':_0x2db2e3=>{const _0x28cb1e=_0x574a92;_0x19c526[_0x28cb1e(0xb4)](_0x28cb1e(0xb8)+_0x2db2e3[_0x28cb1e(0xba)]+']'),_0x19c526[_0x28cb1e(0x9b)](formatRows(_0x2db2e3[_0x28cb1e(0xad)])+_0x28cb1e(0xb0)+_0x2db2e3['completedSplits']+'/'+_0x2db2e3[_0x28cb1e(0x94)]+_0x28cb1e(0xb9));}});return _0x31be57;},{'verbose':_0x427317[_0x22fa48(0x97)]}),_0x3a3c7d=_0xcbb7d9['data'],_0x1da1cc=_0x3a3c7d[_0x22fa48(0xbc)]?_0x22fa48(0xa8)+_0x3a3c7d[_0x22fa48(0xbc)]+']':'',_0x212845=_0x4576f0?_0x22fa48(0x9a)+_0x3cd981+'/'+_0x40f5e2+_0x22fa48(0xaf):'';console[_0x22fa48(0xa0)]('✔\x20'+_0x212845+'Query\x20completed:\x20Processed\x20'+formatRows(_0x3a3c7d[_0x22fa48(0xbe)]['processedRows'])+_0x22fa48(0xb0)+(_0x22fa48(0x99)+formatElapsed(_0x3a3c7d['stats'][_0x22fa48(0xbf)])+_0x1da1cc));if(_0x4576f0&&_0x3e8855){const _0xc29664=resolveOutputOptions(_0x427317),_0x23a864=await formatQueryOutput(_0x3a3c7d,_0xc29664);_0x2d647f[_0x22fa48(0xb3)](_0x23a864);}else await handleQueryOutput(_0x3a3c7d,_0x427317);}catch(_0x15ff0b){const _0xe71491=_0x4576f0?_0x22fa48(0x9a)+_0x3cd981+'/'+_0x40f5e2+':\x0a':'',_0x37345e=_0x15ff0b instanceof SDKError?_0x15ff0b['originalMessage']:_0x15ff0b['message'];return console[_0x22fa48(0xa0)](''+_0xe71491+_0x37345e),0x1;}}if(_0x44af28[_0x22fa48(0xa9)]>0x1&&_0x3e8855&&_0x2d647f[_0x22fa48(0xa9)]>0x0){const _0x3ebc64=_0x2d647f[_0x22fa48(0xae)]('\x0a');writeFileSync(_0x427317[_0x22fa48(0xa1)],_0x3ebc64),console['error'](_0x22fa48(0x9f)+_0x427317[_0x22fa48(0xa1)]);}return 0x0;}catch(_0x2e943b){throw _0x2e943b;}}[a26_0x3e5df2(0x96)](_0x43f5e8){const _0x4ddd81=a26_0x3e5df2,_0x283f63=_0x43f5e8[_0x4ddd81(0xbd)][0x0],_0x49c01e=_0x43f5e8[_0x4ddd81(0xb5)][_0x4ddd81(0xa6)];if(!_0x283f63&&!_0x49c01e)return _0x4ddd81(0xb7);if(_0x283f63&&_0x49c01e)return _0x4ddd81(0xb2);return undefined;}}
|