@treasuredata/tdx 0.14.0 β 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +1 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts +3 -4
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +2 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +86 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -0
- package/dist/proxy/passthrough-server.js +1 -0
- package/dist/proxy/passthrough-server.js.map +1 -0
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +99 -0
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -0
- package/dist/proxy/sse-usage-parser.js +1 -0
- package/dist/proxy/sse-usage-parser.js.map +1 -0
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +5 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x51372c=a25_0x576d;(function(_0x5e13ef,_0x3d0335){const _0x2cebe0=a25_0x576d,_0x5d9921=_0x5e13ef();while(!![]){try{const _0x354abb=parseInt(_0x2cebe0(0x1e2))/0x1+parseInt(_0x2cebe0(0x1fa))/0x2+-parseInt(_0x2cebe0(0x1ad))/0x3*(parseInt(_0x2cebe0(0x1f8))/0x4)+parseInt(_0x2cebe0(0x18a))/0x5*(-parseInt(_0x2cebe0(0x195))/0x6)+-parseInt(_0x2cebe0(0x1ff))/0x7*(parseInt(_0x2cebe0(0x1ca))/0x8)+parseInt(_0x2cebe0(0x189))/0x9*(-parseInt(_0x2cebe0(0x17f))/0xa)+parseInt(_0x2cebe0(0x187))/0xb*(parseInt(_0x2cebe0(0x184))/0xc);if(_0x354abb===_0x3d0335)break;else _0x5d9921['push'](_0x5d9921['shift']());}catch(_0xa47837){_0x5d9921['push'](_0x5d9921['shift']());}}}(a25_0x2d9a,0x27d12));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a25_0x576d(_0x237b90,_0x5c1121){_0x237b90=_0x237b90-0x164;const _0x2d9a15=a25_0x2d9a();let _0x576d1e=_0x2d9a15[_0x237b90];return _0x576d1e;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x4b6697 from'chalk';function a25_0x2d9a(){const _0xcc5c28=['format','/e/','416770mcOFyh','execute','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','getParent','3926616TQCzqf','replace','Get\x20SQL\x20query\x20for\x20child\x20segment','11OlLPhb','includes','45VcCPrG','70FIjUIT','Resolved\x20type:\x20','SEGMENT_FOLDER_NOT_FOUND','segment:desc','Fetching\x20folder\x20details...','Show\x20segment\x20folder\x20details','Resolved\x20relative\x20path\x20to:\x20','Creating\x20folder\x20\x27','Show\x20segment\x20or\x20folder\x20details','folder','stats','14868TKaTQA','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','SQL\x20query:\x0a','β\x20Query\x20failed\x20[','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','getFolder','resolvePathToResource','setJobId','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Fetching\x20segment\x20details...','getSegmentSQL','Usage:\x20tdx\x20sg\x20desc\x20<name>','message','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Target\x20path:\x20','segment:view','686439tgNLEN','\x20\x20Folder\x20path:\x20','SEGMENT_NOT_FOUND','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Show\x20folder\x20or\x20child\x20segment\x20details','Site:\x20','fullPath','Fetching\x20folder\x20\x27','Create\x20segment\x20folder\x20for\x20organization','listFolders','trim','createFolder','Examples:','segmentName','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20','\x27...','getSegment','type','Folder\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','β\x20Found\x20','log','Folder\x20name:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','SELECT\x20*\x20FROM\x20(\x0a','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','18704PIGUuN','segment:show','(root)','\x20Opening\x20','segmentPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','segment:folder:list','Error:\x20Folder\x20reference\x20is\x20required','segment:folder:show','code','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment:describe','Parent\x20name:\x20','segmentId','jobId','\x20[Job\x20ID:\x20','url','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20view','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','limit','folderId','parent','291632xhMfzn','verbose','resolveFolderId','site','segment','parentId','Resolving\x20\x27','length','processedRows','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x27\x20with\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Fetching\x20SQL\x20for\x20segment...','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Parent\x20segment:\x20','Parent\x20segment:\x20','segment:folder:create','data','INVALID_ARGUMENT','/app/ps/','\x20\x20Full\x20path:\x20','4KGOSQh','cause','509212hnvdSj','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','in\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','714fftFzR','web','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolving\x20parent\x20segment\x20\x27','jsonl','Usage:\x20tdx\x20sg\x20show\x20<name>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','description','parentSegment','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Options:','Resolving\x20path\x20\x27','error','Resolving\x20folder\x20\x27','query','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolveParentId','name','toLocaleString','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Use:\x20tdx\x20ps\x20show'];a25_0x2d9a=function(){return _0xcc5c28;};return a25_0x2d9a();}async function resolveSegmentTarget(_0x91e1ce,_0x19b93d,_0x83f668){const _0xa78e39=a25_0x576d;if(isYamlFilePath(_0x91e1ce))try{const _0x2da7cc=await resolveYamlFilePath(_0x91e1ce);return _0x83f668&&(console[_0xa78e39(0x171)](_0xa78e39(0x196)+_0x91e1ce),console['error'](_0xa78e39(0x1f1)+_0x2da7cc[_0xa78e39(0x16d)]),console[_0xa78e39(0x171)]('\x20\x20Segment\x20name:\x20'+_0x2da7cc[_0xa78e39(0x1ba)]),console[_0xa78e39(0x171)](_0xa78e39(0x1ae)+(_0x2da7cc['folderPath']||_0xa78e39(0x1cc))),console[_0xa78e39(0x171)](_0xa78e39(0x1f7)+_0x2da7cc[_0xa78e39(0x1b3)])),_0x2da7cc[_0xa78e39(0x1b3)];}catch(_0xfebbe5){throw new SDKError(ErrorCode[_0xa78e39(0x1f5)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xfebbe5[_0xa78e39(0x1a9)]);}if(!_0x19b93d)throw new SDKError(ErrorCode[_0xa78e39(0x1f5)],_0xa78e39(0x1c9));return _0x19b93d+'/'+_0x91e1ce;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x51372c(0x1d5);[a25_0x51372c(0x16c)]=a25_0x51372c(0x192);async[a25_0x51372c(0x180)](_0x45a417){const _0x128010=a25_0x51372c,{options:_0x2f2152,args:_0x3b8222,tdx:_0x42b344}=_0x45a417,_0x29aab5=_0x3b8222[0x0],_0x20f6ef=!_0x29aab5&&!!_0x2f2152['parentSegment'],_0x16a6d6=_0x29aab5||_0x2f2152[_0x128010(0x16d)];if(!_0x16a6d6)return console[_0x128010(0x171)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x128010(0x171)](_0x128010(0x1d4)),console[_0x128010(0x171)](_0x128010(0x1b9)),console[_0x128010(0x171)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x128010(0x171)](_0x128010(0x1bb)),console[_0x128010(0x171)](_0x128010(0x174)),console[_0x128010(0x171)](_0x128010(0x1dd)),0x1;try{const _0x3b438c=_0x2f2152[_0x128010(0x1ce)];let _0x3906ef=_0x16a6d6;!_0x20f6ef&&_0x3b438c&&!_0x16a6d6[_0x128010(0x188)]('/')&&(_0x3906ef=_0x3b438c+'/'+_0x16a6d6,_0x2f2152[_0x128010(0x1e3)]&&console[_0x128010(0x171)](_0x128010(0x190)+_0x3906ef));const _0x1d7656=await withSpinner(_0x128010(0x170)+_0x3906ef+_0x128010(0x1be),()=>_0x42b344[_0x128010(0x1e6)][_0x128010(0x1a2)](_0x3906ef),{'verbose':_0x2f2152[_0x128010(0x1e3)]}),_0x1de92f=_0x1d7656[_0x128010(0x1f4)];_0x2f2152[_0x128010(0x1e3)]&&(console['error'](_0x128010(0x18b)+_0x1de92f[_0x128010(0x1c0)]),console[_0x128010(0x171)](_0x128010(0x1a4)+_0x1de92f[_0x128010(0x1e7)]),_0x1de92f[_0x128010(0x1e0)]&&console[_0x128010(0x171)](_0x128010(0x1c1)+_0x1de92f['folderId']),_0x1de92f[_0x128010(0x1d7)]&&console['error'](_0x128010(0x19e)+_0x1de92f[_0x128010(0x1d7)]));if(_0x1de92f['type']===_0x128010(0x1e1)){const _0x5d0834=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x42b344[_0x128010(0x1e6)][_0x128010(0x183)](_0x1de92f[_0x128010(0x1e7)]),{'verbose':_0x2f2152[_0x128010(0x1e3)]});await handleSingleObjectOutput(_0x5d0834[_0x128010(0x1f4)],_0x2f2152);}else{if(_0x1de92f[_0x128010(0x1c0)]===_0x128010(0x193)){if(!_0x1de92f[_0x128010(0x1e0)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x6b6f1=await withSpinner(_0x128010(0x18e),()=>_0x42b344[_0x128010(0x1e6)][_0x128010(0x1a1)](_0x1de92f[_0x128010(0x1e0)]),{'verbose':_0x2f2152[_0x128010(0x1e3)]});await handleSingleObjectOutput(_0x6b6f1[_0x128010(0x1f4)],_0x2f2152);}else{if(_0x1de92f[_0x128010(0x1c0)]===_0x128010(0x1e6)){if(!_0x1de92f['segmentId'])throw new SDKError(ErrorCode[_0x128010(0x1af)],_0x128010(0x1b0));const _0x58a185=await withSpinner(_0x128010(0x1a6),()=>_0x42b344['segment'][_0x128010(0x1bf)](_0x1de92f[_0x128010(0x1e7)],_0x1de92f[_0x128010(0x1d7)]),{'verbose':_0x2f2152['verbose']});await handleSingleObjectOutput(_0x58a185[_0x128010(0x1f4)],_0x2f2152);}}}return 0x0;}catch(_0x2b9e1){if(_0x2b9e1 instanceof SDKError)return console['error']('Error:\x20'+_0x2b9e1['message']),_0x2b9e1[_0x128010(0x1f9)]&&console[_0x128010(0x171)](_0x128010(0x165)+_0x2b9e1[_0x128010(0x1f9)]),0x1;throw _0x2b9e1;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x51372c(0x178)]=a25_0x51372c(0x1cb);[a25_0x51372c(0x16c)]=a25_0x51372c(0x16e);async['execute'](_0x2abea1){const _0x49c208=a25_0x51372c,{options:_0xbabf09,args:_0x434686,tdx:_0x5b12ba}=_0x2abea1,_0xc7dcb0=_0x434686[0x0];if(!_0xc7dcb0)return console[_0x49c208(0x171)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x49c208(0x16a)),console['error'](_0x49c208(0x1ed)),console[_0x49c208(0x171)](_0x49c208(0x1b9)),console[_0x49c208(0x171)](_0x49c208(0x182)),console[_0x49c208(0x171)](_0x49c208(0x197)),0x1;try{const _0x478098=_0xbabf09[_0x49c208(0x16d)],_0xfc3e4c=await resolveSegmentTarget(_0xc7dcb0,_0x478098,_0xbabf09[_0x49c208(0x1e3)]);_0xbabf09[_0x49c208(0x1e3)]&&console[_0x49c208(0x171)](_0x49c208(0x1ab)+_0xfc3e4c);const _0x2365cb=await withSpinner(_0x49c208(0x1e8)+_0xc7dcb0+_0x49c208(0x1be),()=>_0x5b12ba[_0x49c208(0x1e6)][_0x49c208(0x1a2)](_0xfc3e4c),{'verbose':_0xbabf09[_0x49c208(0x1e3)]}),_0x730793=_0x2365cb[_0x49c208(0x1f4)];_0xbabf09['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x730793['type']),console['error'](_0x49c208(0x1a4)+_0x730793['parentId']));if(_0x730793['type']==='folder')return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x49c208(0x171)](_0x49c208(0x1eb)),0x1;if(_0x730793[_0x49c208(0x1c0)]==='parent')return console[_0x49c208(0x171)](_0x49c208(0x1ef)),console['error'](_0x49c208(0x17c)),0x1;if(!_0x730793[_0x49c208(0x1d7)])throw new SDKError(ErrorCode[_0x49c208(0x1af)],_0x49c208(0x1b0));const _0x2f7bd6=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5b12ba[_0x49c208(0x1e6)][_0x49c208(0x1a7)](_0x730793['parentId'],_0x730793[_0x49c208(0x1d7)]),{'verbose':_0xbabf09[_0x49c208(0x1e3)]});let _0xf919ab=_0x2f7bd6['data'];const _0x1cb878=resolveLimit(_0xbabf09[_0x49c208(0x1df)],DEFAULT_DISPLAY_LIMIT),_0x1916e7=/\bLIMIT\s+\d+/i['test'](_0xf919ab);!_0x1916e7&&(_0xf919ab=_0xf919ab[_0x49c208(0x1b7)]()[_0x49c208(0x185)](/;+$/,''),_0xf919ab=_0x49c208(0x1c8)+_0xf919ab+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1cb878);_0xbabf09[_0x49c208(0x1e3)]&&console[_0x49c208(0x171)](_0x49c208(0x19c)+_0xf919ab);const _0x5503ca=await withProgressSpinner('Executing\x20segment\x20query...',async _0x1ccb1c=>{const _0x2a47ba=_0x49c208,_0x416909=await _0x5b12ba[_0x2a47ba(0x173)][_0x2a47ba(0x180)](_0xf919ab,{'catalog':'td','schema':'information_schema','onJobId':_0x76434c=>{const _0x1456d5=_0x2a47ba;_0x1ccb1c[_0x1456d5(0x1a3)](_0x76434c);}});return _0x416909;},{'verbose':_0xbabf09[_0x49c208(0x1e3)]}),_0x461cbc=_0x5503ca[_0x49c208(0x1f4)],_0x4f8042=_0x461cbc['jobId']?_0x49c208(0x1d9)+_0x461cbc[_0x49c208(0x1d8)]+']':'';return console['error']('β\x20Query\x20completed:\x20Processed\x20'+_0x461cbc[_0x49c208(0x194)][_0x49c208(0x1ea)][_0x49c208(0x179)]()+'\x20rows\x20'+(_0x49c208(0x1fd)+formatElapsed(_0x461cbc[_0x49c208(0x194)]['elapsedTimeMillis'])+_0x4f8042)),await handleQueryOutput(_0x461cbc,_0xbabf09),0x0;}catch(_0xfe09b1){if(_0xfe09b1 instanceof SDKError)return console[_0x49c208(0x171)](_0x49c208(0x19d)+_0xfe09b1[_0x49c208(0x1d3)]+']'),console['error']('\x0a'+_0xfe09b1[_0x49c208(0x1a9)]),0x1;throw _0xfe09b1;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x51372c(0x1d0);['description']=a25_0x51372c(0x17a);async['execute'](_0x3009e8){const _0x1809b8=a25_0x51372c,{options:_0x88bb51,args:_0x271e35,tdx:_0x169329}=_0x3009e8;if(_0x271e35[_0x1809b8(0x1e9)]===0x0)return console[_0x1809b8(0x171)](_0x1809b8(0x198)),console[_0x1809b8(0x171)](_0x1809b8(0x1fc)),0x1;const _0x5d2791=_0x271e35[0x0];try{_0x88bb51[_0x1809b8(0x1e3)]&&(console[_0x1809b8(0x171)]('Site:\x20'+_0x88bb51['site']),console[_0x1809b8(0x171)](_0x1809b8(0x1d6)+_0x5d2791));const _0xb3b14f=await withSpinner(_0x1809b8(0x168)+_0x5d2791+_0x1809b8(0x1be),()=>_0x169329[_0x1809b8(0x1e6)][_0x1809b8(0x177)](_0x5d2791),{'verbose':_0x88bb51[_0x1809b8(0x1e3)]}),_0x2415f3=_0xb3b14f['data'];_0x88bb51[_0x1809b8(0x1e3)]&&console[_0x1809b8(0x171)]('Resolved\x20parent\x20ID:\x20'+_0x2415f3);const _0x1683f6=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x5d2791+_0x1809b8(0x1be),()=>_0x169329[_0x1809b8(0x1e6)][_0x1809b8(0x1b6)](_0x2415f3),{'verbose':_0x88bb51['verbose']}),_0x4ac7a2=_0x1683f6[_0x1809b8(0x1f4)];return console[_0x1809b8(0x171)](_0x1809b8(0x1c4)+_0x4ac7a2[_0x1809b8(0x1e9)]+'\x20folder'+(_0x4ac7a2[_0x1809b8(0x1e9)]!==0x1?'s':'')),await handleSDKOutput(_0x4ac7a2,_0x88bb51),0x0;}catch(_0x17fcf4){if(_0x17fcf4 instanceof SDKError)return console[_0x1809b8(0x171)](_0x1809b8(0x1bd)+_0x17fcf4[_0x1809b8(0x1a9)]),_0x17fcf4[_0x1809b8(0x1f9)]&&console[_0x1809b8(0x171)](_0x1809b8(0x165)+_0x17fcf4['cause']),0x1;throw _0x17fcf4;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a25_0x51372c(0x1d2);[a25_0x51372c(0x16c)]=a25_0x51372c(0x18f);async[a25_0x51372c(0x180)](_0x235af6){const _0x223079=a25_0x51372c,{options:_0x152d6c,args:_0xb10d00,tdx:_0x97f7ed}=_0x235af6;if(_0xb10d00[_0x223079(0x1e9)]===0x0)return console[_0x223079(0x171)](_0x223079(0x1d1)),console[_0x223079(0x171)](_0x223079(0x1a5)),0x1;try{const {parentId:_0x25d5a0,childId:_0x3df6a7}=parseSegmentRef(_0xb10d00[0x0]);_0x152d6c[_0x223079(0x1e3)]&&(console[_0x223079(0x171)]('Site:\x20'+_0x152d6c[_0x223079(0x1e5)]),console['error'](_0x223079(0x1d6)+_0x25d5a0),_0x3df6a7&&console[_0x223079(0x171)](_0x223079(0x1c6)+_0x3df6a7));if(!_0x3df6a7)return console[_0x223079(0x171)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0xf6507e=await withSpinner(_0x223079(0x168)+_0x25d5a0+_0x223079(0x1be),()=>_0x97f7ed[_0x223079(0x1e6)][_0x223079(0x177)](_0x25d5a0),{'verbose':_0x152d6c['verbose']}),_0x58996f=_0xf6507e['data'];_0x152d6c[_0x223079(0x1e3)]&&console[_0x223079(0x171)]('Resolved\x20parent\x20ID:\x20'+_0x58996f);const _0x33ab5c=await withSpinner(_0x223079(0x172)+_0x3df6a7+_0x223079(0x1be),()=>_0x97f7ed[_0x223079(0x1e6)]['resolveFolderId'](_0x58996f,_0x3df6a7),{'verbose':_0x152d6c['verbose']}),_0x5175b3=_0x33ab5c['data'];_0x152d6c[_0x223079(0x1e3)]&&console['error'](_0x223079(0x175)+_0x5175b3);const _0x201fb8=await withSpinner(_0x223079(0x1b4)+_0x3df6a7+_0x223079(0x1be),()=>_0x97f7ed[_0x223079(0x1e6)][_0x223079(0x1a1)](_0x5175b3),{'verbose':_0x152d6c[_0x223079(0x1e3)]});return await handleSDKOutput([_0x201fb8[_0x223079(0x1f4)]],_0x152d6c),0x0;}catch(_0x239ccd){if(_0x239ccd instanceof SDKError)return console[_0x223079(0x171)](_0x223079(0x1bd)+_0x239ccd['message']),_0x239ccd['cause']&&console['error'](_0x223079(0x165)+_0x239ccd[_0x223079(0x1f9)]),0x1;throw _0x239ccd;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';['description']=a25_0x51372c(0x186);async['execute'](_0x280cb8){const _0x541c38=a25_0x51372c,{options:_0x2d69e9,args:_0x477149,tdx:_0x7b13d2}=_0x280cb8,_0x58ca52=_0x477149[0x0];if(!_0x58ca52)return console[_0x541c38(0x171)](_0x541c38(0x1fe)),console[_0x541c38(0x171)](_0x541c38(0x199)),console['error'](_0x541c38(0x164)),console[_0x541c38(0x171)](_0x541c38(0x1b9)),console['error'](_0x541c38(0x1a0)),console[_0x541c38(0x171)](_0x541c38(0x19a)),0x1;try{const _0x5316e4=_0x2d69e9[_0x541c38(0x16d)],_0x3abd4b=await resolveSegmentTarget(_0x58ca52,_0x5316e4,_0x2d69e9[_0x541c38(0x1e3)]);_0x2d69e9[_0x541c38(0x1e3)]&&console[_0x541c38(0x171)](_0x541c38(0x1ab)+_0x3abd4b);const _0x166eaf=await withSpinner('Resolving\x20\x27'+_0x58ca52+'\x27...',()=>_0x7b13d2[_0x541c38(0x1e6)][_0x541c38(0x1a2)](_0x3abd4b),{'verbose':_0x2d69e9[_0x541c38(0x1e3)]}),_0x592f2c=_0x166eaf[_0x541c38(0x1f4)];_0x2d69e9[_0x541c38(0x1e3)]&&(console[_0x541c38(0x171)]('Resolved\x20type:\x20'+_0x592f2c['type']),console['error']('Parent\x20ID:\x20'+_0x592f2c[_0x541c38(0x1e7)]));if(_0x592f2c[_0x541c38(0x1c0)]===_0x541c38(0x193))return console[_0x541c38(0x171)](_0x541c38(0x1c3)),console[_0x541c38(0x171)](_0x541c38(0x1bc)),0x1;if(_0x592f2c['type']===_0x541c38(0x1e1))return console[_0x541c38(0x171)](_0x541c38(0x1f0)),console[_0x541c38(0x171)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x592f2c[_0x541c38(0x1d7)])throw new SDKError(ErrorCode[_0x541c38(0x1af)],_0x541c38(0x1b0));const _0x1d3ad3=await withSpinner(_0x541c38(0x1ee),()=>_0x7b13d2[_0x541c38(0x1e6)][_0x541c38(0x1a7)](_0x592f2c[_0x541c38(0x1e7)],_0x592f2c['segmentId']),{'verbose':_0x2d69e9[_0x541c38(0x1e3)]}),_0x3c295b=_0x1d3ad3['data'];return _0x2d69e9[_0x541c38(0x17d)]==='json'||_0x2d69e9[_0x541c38(0x17d)]===_0x541c38(0x169)?await handleSDKOutput([{'sql':_0x3c295b}],_0x2d69e9):console[_0x541c38(0x1c5)](_0x3c295b),0x0;}catch(_0xeadd7b){if(_0xeadd7b instanceof SDKError)return console['error'](_0x541c38(0x1bd)+_0xeadd7b[_0x541c38(0x1a9)]),_0xeadd7b[_0x541c38(0x1f9)]&&console[_0x541c38(0x171)]('\x20\x20Cause:\x20'+_0xeadd7b['cause']),0x1;throw _0xeadd7b;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x51372c(0x178)]=a25_0x51372c(0x1f3);[a25_0x51372c(0x16c)]=a25_0x51372c(0x1b5);async['execute'](_0x1a7971){const _0x14b041=a25_0x51372c,{options:_0x1581c6,args:_0x18d405,tdx:_0x2c1b2c}=_0x1a7971,_0xe34fe1=_0x1581c6;if(_0x18d405[_0x14b041(0x1e9)]<0x2)return console[_0x14b041(0x171)](_0x14b041(0x17b)),console[_0x14b041(0x171)](_0x14b041(0x176)),0x1;const _0x5e4328=_0x18d405[0x0],_0x41ce2f=_0x18d405[0x1];_0xe34fe1[_0x14b041(0x1e3)]&&(console[_0x14b041(0x171)](_0x14b041(0x1b2)+_0xe34fe1['site']),console['error'](_0x14b041(0x1f2)+_0x5e4328),console['error'](_0x14b041(0x1c6)+_0x41ce2f));let _0x40ef8a;if(_0xe34fe1['parentFolder']){const _0xba671=_0xe34fe1['parentFolder'],_0x3a99e9=await withSpinner(_0x14b041(0x168)+_0x5e4328+'\x27...',()=>_0x2c1b2c['segment'][_0x14b041(0x177)](_0x5e4328),{'verbose':_0xe34fe1[_0x14b041(0x1e3)]}),_0x14f66a=_0x3a99e9[_0x14b041(0x1f4)],_0x4920ba=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0xba671+_0x14b041(0x1be),()=>_0x2c1b2c[_0x14b041(0x1e6)][_0x14b041(0x1e4)](_0x14f66a,_0xba671),{'verbose':_0xe34fe1[_0x14b041(0x1e3)]});_0x40ef8a=_0x4920ba[_0x14b041(0x1f4)],_0xe34fe1[_0x14b041(0x1e3)]&&console[_0x14b041(0x171)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x40ef8a);}const _0x22d62f={'name':_0x41ce2f,'description':_0xe34fe1[_0x14b041(0x16c)],'parentFolderId':_0x40ef8a},_0x27264d=await withSpinner(_0x14b041(0x191)+_0x41ce2f+_0x14b041(0x1be),()=>_0x2c1b2c[_0x14b041(0x1e6)][_0x14b041(0x1b8)](_0x5e4328,_0x22d62f),{'verbose':_0xe34fe1[_0x14b041(0x1e3)]}),_0x3baaf3=_0x27264d[_0x14b041(0x1f4)];return console[_0x14b041(0x171)]('β\x20Created\x20folder\x20\x27'+_0x3baaf3['name']+_0x14b041(0x1ec)+_0x3baaf3['id']),await handleSDKOutput([_0x3baaf3],_0xe34fe1),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x51372c(0x178)]=a25_0x51372c(0x1ac);[a25_0x51372c(0x16c)]=a25_0x51372c(0x1b1);async['execute'](_0xbe412e){const _0x9f26c2=a25_0x51372c,{options:_0x38af00,args:_0x40a739,tdx:_0x304b6d}=_0xbe412e,_0x31ce19=_0x40a739[0x0];if(!_0x31ce19)return console['error'](_0x9f26c2(0x1de)),console[_0x9f26c2(0x171)](_0x9f26c2(0x1fb)),console[_0x9f26c2(0x171)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console['error'](_0x9f26c2(0x16f)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x9f26c2(0x1b9)),console[_0x9f26c2(0x171)](_0x9f26c2(0x1aa)),console[_0x9f26c2(0x171)](_0x9f26c2(0x19f)),console[_0x9f26c2(0x171)](_0x9f26c2(0x19b)),console[_0x9f26c2(0x171)](_0x9f26c2(0x166)),0x1;try{const _0x454ccb=_0x38af00[_0x9f26c2(0x16d)],_0x21e1bf=await resolveSegmentTarget(_0x31ce19,_0x454ccb,_0x38af00['verbose']);_0x38af00[_0x9f26c2(0x1e3)]&&console[_0x9f26c2(0x171)](_0x9f26c2(0x1ab)+_0x21e1bf);const _0x3d3307=await withSpinner(_0x9f26c2(0x1e8)+_0x31ce19+_0x9f26c2(0x1be),()=>_0x304b6d[_0x9f26c2(0x1e6)][_0x9f26c2(0x1a2)](_0x21e1bf),{'verbose':_0x38af00[_0x9f26c2(0x1e3)]}),_0x220e42=_0x3d3307[_0x9f26c2(0x1f4)];_0x38af00[_0x9f26c2(0x1e3)]&&(console[_0x9f26c2(0x171)](_0x9f26c2(0x18b)+_0x220e42[_0x9f26c2(0x1c0)]),console[_0x9f26c2(0x171)](_0x9f26c2(0x1a4)+_0x220e42[_0x9f26c2(0x1e7)]),_0x220e42[_0x9f26c2(0x1e0)]&&console[_0x9f26c2(0x171)](_0x9f26c2(0x1c1)+_0x220e42['folderId']),_0x220e42[_0x9f26c2(0x1d7)]&&console[_0x9f26c2(0x171)]('Segment\x20ID:\x20'+_0x220e42[_0x9f26c2(0x1d7)]));if(_0x38af00[_0x9f26c2(0x200)]){if(_0x220e42[_0x9f26c2(0x1c0)]===_0x9f26c2(0x193))return console[_0x9f26c2(0x171)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x220e42[_0x9f26c2(0x1c0)]==='parent')return console[_0x9f26c2(0x171)](_0x9f26c2(0x1c2)),console[_0x9f26c2(0x171)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x220e42[_0x9f26c2(0x1d7)])throw new SDKError(ErrorCode[_0x9f26c2(0x1af)],_0x9f26c2(0x1b0));const _0x1978bd=getConsoleNextUrl(_0x38af00['site'],_0x9f26c2(0x1f6)+_0x220e42[_0x9f26c2(0x1e7)]+_0x9f26c2(0x17e)+_0x220e42['segmentId']);return console[_0x9f26c2(0x171)](a25_0x4b6697['green']('β')+_0x9f26c2(0x1cd)+a25_0x4b6697['cyan'](_0x1978bd)),openBrowser(_0x1978bd),0x0;}if(_0x220e42[_0x9f26c2(0x1c0)]===_0x9f26c2(0x193)){if(!_0x220e42[_0x9f26c2(0x1e0)])throw new SDKError(ErrorCode[_0x9f26c2(0x18c)],_0x9f26c2(0x16b));const _0x47015c=await withSpinner(_0x9f26c2(0x18e),()=>_0x304b6d[_0x9f26c2(0x1e6)][_0x9f26c2(0x1a1)](_0x220e42[_0x9f26c2(0x1e0)]),{'verbose':_0x38af00['verbose']});await handleSingleObjectOutput(_0x47015c[_0x9f26c2(0x1f4)],_0x38af00);}else{if(_0x220e42[_0x9f26c2(0x1c0)]===_0x9f26c2(0x1e6)){if(!_0x220e42[_0x9f26c2(0x1d7)])throw new SDKError(ErrorCode[_0x9f26c2(0x1af)],_0x9f26c2(0x1b0));const _0x103063=await withSpinner(_0x9f26c2(0x1a6),()=>_0x304b6d['segment'][_0x9f26c2(0x1bf)](_0x220e42['parentId'],_0x220e42[_0x9f26c2(0x1d7)]),{'verbose':_0x38af00[_0x9f26c2(0x1e3)]}),_0x48f555=getConsoleNextUrl(_0x38af00['site'],'/app/ps/'+_0x220e42[_0x9f26c2(0x1e7)]+_0x9f26c2(0x17e)+_0x220e42[_0x9f26c2(0x1d7)]),_0x3422e6=_0x103063[_0x9f26c2(0x1f4)];_0x3422e6[_0x9f26c2(0x1da)]=_0x48f555,await handleSingleObjectOutput(_0x3422e6,_0x38af00);}else return console[_0x9f26c2(0x171)](_0x9f26c2(0x1c7)),console[_0x9f26c2(0x171)](_0x9f26c2(0x1dc)),0x1;}return 0x0;}catch(_0x44971a){if(_0x44971a instanceof SDKError)return console[_0x9f26c2(0x171)](_0x9f26c2(0x1bd)+_0x44971a[_0x9f26c2(0x1a9)]),_0x44971a[_0x9f26c2(0x1f9)]&&console['error'](_0x9f26c2(0x165)+_0x44971a[_0x9f26c2(0x1f9)]),0x1;throw _0x44971a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x51372c(0x18d);[a25_0x51372c(0x16c)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x335266){const _0x127268=a25_0x51372c,{options:_0x2a3546,args:_0x2adf5a,tdx:_0x32e3a0}=_0x335266,_0x1655a2=_0x2adf5a[0x0];if(!_0x1655a2)return console[_0x127268(0x171)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x127268(0x171)](_0x127268(0x1a8)),console[_0x127268(0x171)](_0x127268(0x1cf)),console[_0x127268(0x171)]('Examples:'),console[_0x127268(0x171)](_0x127268(0x1db)),console[_0x127268(0x171)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x32fd53=_0x2a3546[_0x127268(0x16d)],_0x46a856=await resolveSegmentTarget(_0x1655a2,_0x32fd53,_0x2a3546[_0x127268(0x1e3)]);_0x2a3546[_0x127268(0x1e3)]&&console[_0x127268(0x171)]('Target\x20path:\x20'+_0x46a856);const _0x2069d0=await withSpinner(_0x127268(0x1e8)+_0x1655a2+_0x127268(0x1be),()=>_0x32e3a0[_0x127268(0x1e6)][_0x127268(0x1a2)](_0x46a856),{'verbose':_0x2a3546['verbose']}),_0x40a4b1=_0x2069d0[_0x127268(0x1f4)];_0x2a3546[_0x127268(0x1e3)]&&(console['error'](_0x127268(0x18b)+_0x40a4b1['type']),console['error']('Parent\x20ID:\x20'+_0x40a4b1[_0x127268(0x1e7)]));if(_0x40a4b1['type']==='folder')return console[_0x127268(0x171)](_0x127268(0x167)),console['error'](_0x127268(0x1bc)),0x1;if(_0x40a4b1['type']===_0x127268(0x1e1))return console[_0x127268(0x171)](_0x127268(0x181)),console[_0x127268(0x171)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x40a4b1[_0x127268(0x1d7)])throw new SDKError(ErrorCode[_0x127268(0x1af)],_0x127268(0x1b0));const _0x31e51=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x32e3a0[_0x127268(0x1e6)][_0x127268(0x1a7)](_0x40a4b1[_0x127268(0x1e7)],_0x40a4b1[_0x127268(0x1d7)]),{'verbose':_0x2a3546[_0x127268(0x1e3)]}),_0x2b979b=_0x31e51[_0x127268(0x1f4)],_0x165c99=await executeSchemaQuery(_0x2b979b,_0x32e3a0,_0x2a3546);return await handleQueryOutput(_0x165c99,_0x2a3546),0x0;}catch(_0x29a757){if(_0x29a757 instanceof SDKError)return console[_0x127268(0x171)](_0x127268(0x1bd)+_0x29a757[_0x127268(0x1a9)]),_0x29a757[_0x127268(0x1f9)]&&console['error'](_0x127268(0x165)+_0x29a757[_0x127268(0x1f9)]),0x1;throw _0x29a757;}}}
|
|
1
|
+
const a25_0x2a638c=a25_0x1f88;(function(_0x2a563f,_0x2a95e3){const _0x22b731=a25_0x1f88,_0x1d812e=_0x2a563f();while(!![]){try{const _0x3b5802=parseInt(_0x22b731(0x1a7))/0x1+parseInt(_0x22b731(0x142))/0x2*(-parseInt(_0x22b731(0x1bb))/0x3)+-parseInt(_0x22b731(0x18e))/0x4*(-parseInt(_0x22b731(0x1af))/0x5)+parseInt(_0x22b731(0x1ac))/0x6+parseInt(_0x22b731(0x148))/0x7+parseInt(_0x22b731(0x19a))/0x8+parseInt(_0x22b731(0x14d))/0x9*(-parseInt(_0x22b731(0x1c0))/0xa);if(_0x3b5802===_0x2a95e3)break;else _0x1d812e['push'](_0x1d812e['shift']());}catch(_0x42591d){_0x1d812e['push'](_0x1d812e['shift']());}}}(a25_0x4907,0xbecd7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x4ce361 from'chalk';async function resolveSegmentTarget(_0x338a32,_0x58681c,_0x49d37b){const _0x559b0d=a25_0x1f88;if(isYamlFilePath(_0x338a32))try{const _0x4efc81=await resolveYamlFilePath(_0x338a32);return _0x49d37b&&(console[_0x559b0d(0x143)](_0x559b0d(0x1dc)+_0x338a32),console[_0x559b0d(0x143)](_0x559b0d(0x1a5)+_0x4efc81[_0x559b0d(0x1b1)]),console[_0x559b0d(0x143)](_0x559b0d(0x189)+_0x4efc81['segmentName']),console['error'](_0x559b0d(0x178)+(_0x4efc81[_0x559b0d(0x190)]||_0x559b0d(0x1ce))),console[_0x559b0d(0x143)](_0x559b0d(0x181)+_0x4efc81['fullPath'])),_0x4efc81['fullPath'];}catch(_0x39dfc4){throw new SDKError(ErrorCode[_0x559b0d(0x166)],_0x559b0d(0x187)+_0x39dfc4[_0x559b0d(0x144)]);}if(!_0x58681c)throw new SDKError(ErrorCode[_0x559b0d(0x166)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x58681c+'/'+_0x338a32;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x182);[a25_0x2a638c(0x1d3)]='Show\x20segment\x20or\x20folder\x20details';async[a25_0x2a638c(0x1b5)](_0x26cd58){const _0x4774bb=a25_0x2a638c,{options:_0x40329e,args:_0xf54f93,tdx:_0x266fe4}=_0x26cd58,_0x552581=_0xf54f93[0x0],_0x4fc5d8=!_0x552581&&!!_0x40329e[_0x4774bb(0x1b1)],_0x3ccb95=_0x552581||_0x40329e['parentSegment'];if(!_0x3ccb95)return console[_0x4774bb(0x143)](_0x4774bb(0x15f)),console[_0x4774bb(0x143)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x4774bb(0x143)](_0x4774bb(0x16e)),console[_0x4774bb(0x143)](_0x4774bb(0x175)),console[_0x4774bb(0x143)](_0x4774bb(0x1d9)),console['error'](_0x4774bb(0x159)),console[_0x4774bb(0x143)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0xab400f=_0x40329e[_0x4774bb(0x15a)];let _0x3b0eaf=_0x3ccb95;!_0x4fc5d8&&_0xab400f&&!_0x3ccb95['includes']('/')&&(_0x3b0eaf=_0xab400f+'/'+_0x3ccb95,_0x40329e['verbose']&&console['error'](_0x4774bb(0x161)+_0x3b0eaf));const _0x4ee453=await withSpinner(_0x4774bb(0x19e)+_0x3b0eaf+_0x4774bb(0x1db),()=>_0x266fe4[_0x4774bb(0x184)][_0x4774bb(0x1a0)](_0x3b0eaf),{'verbose':_0x40329e[_0x4774bb(0x1d0)]}),_0x555b13=_0x4ee453['data'];_0x40329e[_0x4774bb(0x1d0)]&&(console[_0x4774bb(0x143)]('Resolved\x20type:\x20'+_0x555b13[_0x4774bb(0x15c)]),console['error'](_0x4774bb(0x191)+_0x555b13[_0x4774bb(0x177)]),_0x555b13[_0x4774bb(0x1ca)]&&console[_0x4774bb(0x143)](_0x4774bb(0x145)+_0x555b13[_0x4774bb(0x1ca)]),_0x555b13[_0x4774bb(0x185)]&&console['error'](_0x4774bb(0x1a1)+_0x555b13[_0x4774bb(0x185)]));if(_0x555b13[_0x4774bb(0x15c)]===_0x4774bb(0x1ad)){const _0x424eb5=await withSpinner(_0x4774bb(0x1c1),()=>_0x266fe4[_0x4774bb(0x184)][_0x4774bb(0x14e)](_0x555b13[_0x4774bb(0x177)]),{'verbose':_0x40329e[_0x4774bb(0x1d0)]});await handleSingleObjectOutput(_0x424eb5[_0x4774bb(0x19b)],_0x40329e);}else{if(_0x555b13['type']===_0x4774bb(0x17a)){if(!_0x555b13[_0x4774bb(0x1ca)])throw new SDKError(ErrorCode[_0x4774bb(0x152)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0xc1298c=await withSpinner('Fetching\x20folder\x20details...',()=>_0x266fe4[_0x4774bb(0x184)][_0x4774bb(0x1ab)](_0x555b13[_0x4774bb(0x1ca)]),{'verbose':_0x40329e['verbose']});await handleSingleObjectOutput(_0xc1298c['data'],_0x40329e);}else{if(_0x555b13[_0x4774bb(0x15c)]==='segment'){if(!_0x555b13[_0x4774bb(0x185)])throw new SDKError(ErrorCode[_0x4774bb(0x1a3)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x41b0a9=await withSpinner('Fetching\x20segment\x20details...',()=>_0x266fe4['segment'][_0x4774bb(0x1c3)](_0x555b13['parentId'],_0x555b13[_0x4774bb(0x185)]),{'verbose':_0x40329e[_0x4774bb(0x1d0)]});await handleSingleObjectOutput(_0x41b0a9[_0x4774bb(0x19b)],_0x40329e);}}}return 0x0;}catch(_0x407577){if(_0x407577 instanceof SDKError)return console[_0x4774bb(0x143)](_0x4774bb(0x188)+_0x407577[_0x4774bb(0x144)]),_0x407577[_0x4774bb(0x147)]&&console['error']('\x20\x20Cause:\x20'+_0x407577[_0x4774bb(0x147)]),0x1;throw _0x407577;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x15e);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x1be);async[a25_0x2a638c(0x1b5)](_0x52134b){const _0x237518=a25_0x2a638c,{options:_0x333b67,args:_0x369f34,tdx:_0x308feb}=_0x52134b,_0x4fe484=_0x369f34[0x0];if(!_0x4fe484)return console['error'](_0x237518(0x16a)),console[_0x237518(0x143)](_0x237518(0x160)),console[_0x237518(0x143)](_0x237518(0x1cb)),console[_0x237518(0x143)](_0x237518(0x16e)),console[_0x237518(0x143)](_0x237518(0x149)),console[_0x237518(0x143)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x4e8bab=_0x333b67[_0x237518(0x1b1)],_0x22af90=await resolveSegmentTarget(_0x4fe484,_0x4e8bab,_0x333b67[_0x237518(0x1d0)]);_0x333b67[_0x237518(0x1d0)]&&console[_0x237518(0x143)]('Target\x20path:\x20'+_0x22af90);const _0x4d2ff2=await withSpinner('Resolving\x20\x27'+_0x4fe484+_0x237518(0x1db),()=>_0x308feb[_0x237518(0x184)][_0x237518(0x1a0)](_0x22af90),{'verbose':_0x333b67[_0x237518(0x1d0)]}),_0x10077f=_0x4d2ff2[_0x237518(0x19b)];_0x333b67[_0x237518(0x1d0)]&&(console[_0x237518(0x143)]('Resolved\x20type:\x20'+_0x10077f['type']),console['error'](_0x237518(0x191)+_0x10077f['parentId']));if(_0x10077f[_0x237518(0x15c)]==='folder')return console['error'](_0x237518(0x1bf)),console['error'](_0x237518(0x1c7)),0x1;if(_0x10077f[_0x237518(0x15c)]===_0x237518(0x1ad))return console[_0x237518(0x143)](_0x237518(0x16d)),console[_0x237518(0x143)](_0x237518(0x164)),0x1;if(!_0x10077f[_0x237518(0x185)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x237518(0x1b9));const _0x3485db=await withSpinner(_0x237518(0x174),()=>_0x308feb[_0x237518(0x184)][_0x237518(0x19f)](_0x10077f[_0x237518(0x177)],_0x10077f[_0x237518(0x185)]),{'verbose':_0x333b67[_0x237518(0x1d0)]});let _0x31a01d=_0x3485db[_0x237518(0x19b)];const _0x5a5609=resolveLimit(_0x333b67['limit'],DEFAULT_DISPLAY_LIMIT),_0x3b84ae=/\bLIMIT\s+\d+/i[_0x237518(0x146)](_0x31a01d);!_0x3b84ae&&(_0x31a01d=_0x31a01d[_0x237518(0x17f)]()[_0x237518(0x1ae)](/;+$/,''),_0x31a01d='SELECT\x20*\x20FROM\x20(\x0a'+_0x31a01d+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5a5609);_0x333b67[_0x237518(0x1d0)]&&console[_0x237518(0x143)](_0x237518(0x1c6)+_0x31a01d);const _0x5b9429=await withProgressSpinner(_0x237518(0x1b4),async _0x5bb781=>{const _0xf7415a=_0x237518,_0x24ed84=await _0x308feb[_0xf7415a(0x180)][_0xf7415a(0x1b5)](_0x31a01d,{'catalog':'td','schema':_0xf7415a(0x186),'onJobId':_0x3f1aca=>{_0x5bb781['setJobId'](_0x3f1aca);}});return _0x24ed84;},{'verbose':_0x333b67[_0x237518(0x1d0)]}),_0x1af73f=_0x5b9429[_0x237518(0x19b)],_0xbf164b=_0x1af73f['jobId']?'\x20[Job\x20ID:\x20'+_0x1af73f['jobId']+']':'';return console[_0x237518(0x143)]('β\x20Query\x20completed:\x20Processed\x20'+_0x1af73f['stats'][_0x237518(0x158)]['toLocaleString']()+'\x20rows\x20'+(_0x237518(0x1bd)+formatElapsed(_0x1af73f['stats'][_0x237518(0x1a6)])+_0xbf164b)),await handleQueryOutput(_0x1af73f,_0x333b67),0x0;}catch(_0x186a75){if(_0x186a75 instanceof SDKError)return console[_0x237518(0x143)]('β\x20Query\x20failed\x20['+_0x186a75[_0x237518(0x1b2)]+']'),console[_0x237518(0x143)]('\x0a'+_0x186a75[_0x237518(0x144)]),0x1;throw _0x186a75;}}}function a25_0x1f88(_0x261088,_0x3cb517){_0x261088=_0x261088-0x142;const _0x4907d0=a25_0x4907();let _0x1f8898=_0x4907d0[_0x261088];return _0x1f8898;}export class SegmentFolderListCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x169);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x1d1);async['execute'](_0x35d530){const _0x2e18e5=a25_0x2a638c,{options:_0x3fc8e6,args:_0x41d9bc,tdx:_0x3f1a04}=_0x35d530;if(_0x41d9bc[_0x2e18e5(0x15d)]===0x0)return console[_0x2e18e5(0x143)](_0x2e18e5(0x1d5)),console[_0x2e18e5(0x143)](_0x2e18e5(0x150)),0x1;const _0x467483=_0x41d9bc[0x0];try{_0x3fc8e6[_0x2e18e5(0x1d0)]&&(console[_0x2e18e5(0x143)]('Site:\x20'+_0x3fc8e6['site']),console[_0x2e18e5(0x143)]('Parent\x20name:\x20'+_0x467483));const _0x4e2a28=await withSpinner(_0x2e18e5(0x16f)+_0x467483+_0x2e18e5(0x1db),()=>_0x3f1a04[_0x2e18e5(0x184)]['resolveParentId'](_0x467483),{'verbose':_0x3fc8e6[_0x2e18e5(0x1d0)]}),_0x2f2dd3=_0x4e2a28[_0x2e18e5(0x19b)];_0x3fc8e6[_0x2e18e5(0x1d0)]&&console['error'](_0x2e18e5(0x1ba)+_0x2f2dd3);const _0xcfa803=await withSpinner(_0x2e18e5(0x1cc)+_0x467483+_0x2e18e5(0x1db),()=>_0x3f1a04[_0x2e18e5(0x184)][_0x2e18e5(0x172)](_0x2f2dd3),{'verbose':_0x3fc8e6[_0x2e18e5(0x1d0)]}),_0x3a09e0=_0xcfa803['data'];return console['error'](_0x2e18e5(0x171)+_0x3a09e0['length']+'\x20folder'+(_0x3a09e0[_0x2e18e5(0x15d)]!==0x1?'s':'')),await handleSDKOutput(_0x3a09e0,_0x3fc8e6),0x0;}catch(_0x40e625){if(_0x40e625 instanceof SDKError)return console[_0x2e18e5(0x143)]('Error:\x20'+_0x40e625[_0x2e18e5(0x144)]),_0x40e625[_0x2e18e5(0x147)]&&console[_0x2e18e5(0x143)](_0x2e18e5(0x18c)+_0x40e625[_0x2e18e5(0x147)]),0x1;throw _0x40e625;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x1d8);[a25_0x2a638c(0x1d3)]='Show\x20segment\x20folder\x20details';async['execute'](_0x4315ab){const _0x37737e=a25_0x2a638c,{options:_0x37499f,args:_0x30a3d4,tdx:_0x43ad17}=_0x4315ab;if(_0x30a3d4['length']===0x0)return console[_0x37737e(0x143)](_0x37737e(0x14b)),console[_0x37737e(0x143)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x3e939e,childId:_0x57d894}=parseSegmentRef(_0x30a3d4[0x0]);_0x37499f[_0x37737e(0x1d0)]&&(console['error'](_0x37737e(0x1bc)+_0x37499f[_0x37737e(0x157)]),console[_0x37737e(0x143)](_0x37737e(0x1c2)+_0x3e939e),_0x57d894&&console[_0x37737e(0x143)](_0x37737e(0x194)+_0x57d894));if(!_0x57d894)return console[_0x37737e(0x143)](_0x37737e(0x1a2)),0x1;const _0x37653d=await withSpinner(_0x37737e(0x16f)+_0x3e939e+_0x37737e(0x1db),()=>_0x43ad17[_0x37737e(0x184)][_0x37737e(0x179)](_0x3e939e),{'verbose':_0x37499f[_0x37737e(0x1d0)]}),_0x5b486b=_0x37653d['data'];_0x37499f['verbose']&&console['error'](_0x37737e(0x1ba)+_0x5b486b);const _0x5cfe94=await withSpinner('Resolving\x20folder\x20\x27'+_0x57d894+_0x37737e(0x1db),()=>_0x43ad17['segment'][_0x37737e(0x17b)](_0x5b486b,_0x57d894),{'verbose':_0x37499f[_0x37737e(0x1d0)]}),_0x4f0e1d=_0x5cfe94['data'];_0x37499f[_0x37737e(0x1d0)]&&console[_0x37737e(0x143)]('Resolved\x20folder\x20ID:\x20'+_0x4f0e1d);const _0x530eff=await withSpinner('Fetching\x20folder\x20\x27'+_0x57d894+_0x37737e(0x1db),()=>_0x43ad17[_0x37737e(0x184)][_0x37737e(0x1ab)](_0x4f0e1d),{'verbose':_0x37499f['verbose']});return await handleSDKOutput([_0x530eff[_0x37737e(0x19b)]],_0x37499f),0x0;}catch(_0x235826){if(_0x235826 instanceof SDKError)return console[_0x37737e(0x143)](_0x37737e(0x188)+_0x235826['message']),_0x235826[_0x37737e(0x147)]&&console[_0x37737e(0x143)](_0x37737e(0x18c)+_0x235826['cause']),0x1;throw _0x235826;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x199);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x14f);async[a25_0x2a638c(0x1b5)](_0x95df5a){const _0x1e0bd4=a25_0x2a638c,{options:_0xb9849f,args:_0x2c73c2,tdx:_0x34f3a2}=_0x95df5a,_0x2571b9=_0x2c73c2[0x0];if(!_0x2571b9)return console[_0x1e0bd4(0x143)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x183)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x16e)),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x1c5)),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x14c)),0x1;try{const _0x330085=_0xb9849f['parentSegment'],_0xd87f3=await resolveSegmentTarget(_0x2571b9,_0x330085,_0xb9849f[_0x1e0bd4(0x1d0)]);_0xb9849f[_0x1e0bd4(0x1d0)]&&console['error'](_0x1e0bd4(0x18b)+_0xd87f3);const _0x2625d3=await withSpinner(_0x1e0bd4(0x15b)+_0x2571b9+'\x27...',()=>_0x34f3a2['segment'][_0x1e0bd4(0x1a0)](_0xd87f3),{'verbose':_0xb9849f['verbose']}),_0x402b33=_0x2625d3['data'];_0xb9849f['verbose']&&(console['error'](_0x1e0bd4(0x165)+_0x402b33[_0x1e0bd4(0x15c)]),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x191)+_0x402b33[_0x1e0bd4(0x177)]));if(_0x402b33[_0x1e0bd4(0x15c)]===_0x1e0bd4(0x17a))return console['error'](_0x1e0bd4(0x1d4)),console['error'](_0x1e0bd4(0x17c)),0x1;if(_0x402b33[_0x1e0bd4(0x15c)]===_0x1e0bd4(0x1ad))return console['error'](_0x1e0bd4(0x1c4)),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x1a4)),0x1;if(!_0x402b33[_0x1e0bd4(0x185)])throw new SDKError(ErrorCode[_0x1e0bd4(0x1a3)],_0x1e0bd4(0x1b9));const _0x56ad5e=await withSpinner(_0x1e0bd4(0x174),()=>_0x34f3a2[_0x1e0bd4(0x184)][_0x1e0bd4(0x19f)](_0x402b33[_0x1e0bd4(0x177)],_0x402b33[_0x1e0bd4(0x185)]),{'verbose':_0xb9849f[_0x1e0bd4(0x1d0)]}),_0x142ed5=_0x56ad5e[_0x1e0bd4(0x19b)];return _0xb9849f[_0x1e0bd4(0x1c8)]===_0x1e0bd4(0x1aa)||_0xb9849f[_0x1e0bd4(0x1c8)]===_0x1e0bd4(0x162)?await handleSDKOutput([{'sql':_0x142ed5}],_0xb9849f):console[_0x1e0bd4(0x195)](_0x142ed5),0x0;}catch(_0x18964a){if(_0x18964a instanceof SDKError)return console[_0x1e0bd4(0x143)](_0x1e0bd4(0x188)+_0x18964a[_0x1e0bd4(0x144)]),_0x18964a[_0x1e0bd4(0x147)]&&console[_0x1e0bd4(0x143)](_0x1e0bd4(0x18c)+_0x18964a[_0x1e0bd4(0x147)]),0x1;throw _0x18964a;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x1b0);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x1cd);async[a25_0x2a638c(0x1b5)](_0x44221e){const _0x4c6bf9=a25_0x2a638c,{options:_0xc3581e,args:_0x956850,tdx:_0x28ba95}=_0x44221e,_0x1b8245=_0xc3581e;if(_0x956850[_0x4c6bf9(0x15d)]<0x2)return console[_0x4c6bf9(0x143)](_0x4c6bf9(0x1de)),console[_0x4c6bf9(0x143)](_0x4c6bf9(0x18f)),0x1;const _0x3baefc=_0x956850[0x0],_0x4eaa3b=_0x956850[0x1];_0x1b8245[_0x4c6bf9(0x1d0)]&&(console[_0x4c6bf9(0x143)](_0x4c6bf9(0x1bc)+_0x1b8245[_0x4c6bf9(0x157)]),console[_0x4c6bf9(0x143)](_0x4c6bf9(0x1b6)+_0x3baefc),console['error'](_0x4c6bf9(0x194)+_0x4eaa3b));let _0x31e341;if(_0x1b8245['parentFolder']){const _0x371d7d=_0x1b8245[_0x4c6bf9(0x1da)],_0x3b3c5e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3baefc+_0x4c6bf9(0x1db),()=>_0x28ba95[_0x4c6bf9(0x184)]['resolveParentId'](_0x3baefc),{'verbose':_0x1b8245['verbose']}),_0x56bad2=_0x3b3c5e['data'],_0x3095ed=await withSpinner(_0x4c6bf9(0x196)+_0x371d7d+'\x27...',()=>_0x28ba95['segment'][_0x4c6bf9(0x17b)](_0x56bad2,_0x371d7d),{'verbose':_0x1b8245[_0x4c6bf9(0x1d0)]});_0x31e341=_0x3095ed[_0x4c6bf9(0x19b)],_0x1b8245[_0x4c6bf9(0x1d0)]&&console[_0x4c6bf9(0x143)](_0x4c6bf9(0x173)+_0x31e341);}const _0x4b85dc={'name':_0x4eaa3b,'description':_0x1b8245[_0x4c6bf9(0x1d3)],'parentFolderId':_0x31e341},_0x2a1a90=await withSpinner('Creating\x20folder\x20\x27'+_0x4eaa3b+_0x4c6bf9(0x1db),()=>_0x28ba95['segment'][_0x4c6bf9(0x17d)](_0x3baefc,_0x4b85dc),{'verbose':_0x1b8245[_0x4c6bf9(0x1d0)]}),_0x33022b=_0x2a1a90[_0x4c6bf9(0x19b)];return console[_0x4c6bf9(0x143)](_0x4c6bf9(0x153)+_0x33022b[_0x4c6bf9(0x168)]+_0x4c6bf9(0x192)+_0x33022b['id']),await handleSDKOutput([_0x33022b],_0x1b8245),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a25_0x2a638c(0x197);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x154);async[a25_0x2a638c(0x1b5)](_0x557e6c){const _0xbe8be8=a25_0x2a638c,{options:_0x3d630e,args:_0x3e0d13,tdx:_0x4a1ba1}=_0x557e6c,_0x56d41a=_0x3e0d13[0x0];if(!_0x56d41a)return console[_0xbe8be8(0x143)](_0xbe8be8(0x1c9)),console[_0xbe8be8(0x143)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0xbe8be8(0x170)),console[_0xbe8be8(0x143)](_0xbe8be8(0x19d)),console[_0xbe8be8(0x143)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0xbe8be8(0x16e)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0xbe8be8(0x143)](_0xbe8be8(0x198)),console[_0xbe8be8(0x143)](_0xbe8be8(0x167)),console['error'](_0xbe8be8(0x16c)),0x1;try{const _0x6e5393=_0x3d630e[_0xbe8be8(0x1b1)],_0x41ebae=await resolveSegmentTarget(_0x56d41a,_0x6e5393,_0x3d630e[_0xbe8be8(0x1d0)]);_0x3d630e['verbose']&&console['error']('Target\x20path:\x20'+_0x41ebae);const _0x5710c6=await withSpinner(_0xbe8be8(0x15b)+_0x56d41a+_0xbe8be8(0x1db),()=>_0x4a1ba1[_0xbe8be8(0x184)][_0xbe8be8(0x1a0)](_0x41ebae),{'verbose':_0x3d630e[_0xbe8be8(0x1d0)]}),_0xecee3a=_0x5710c6[_0xbe8be8(0x19b)];_0x3d630e['verbose']&&(console[_0xbe8be8(0x143)](_0xbe8be8(0x165)+_0xecee3a[_0xbe8be8(0x15c)]),console['error'](_0xbe8be8(0x191)+_0xecee3a['parentId']),_0xecee3a[_0xbe8be8(0x1ca)]&&console[_0xbe8be8(0x143)](_0xbe8be8(0x145)+_0xecee3a['folderId']),_0xecee3a['segmentId']&&console[_0xbe8be8(0x143)](_0xbe8be8(0x1a1)+_0xecee3a['segmentId']));if(_0x3d630e[_0xbe8be8(0x155)]){if(_0xecee3a['type']===_0xbe8be8(0x17a))return console[_0xbe8be8(0x143)](_0xbe8be8(0x1a8)),0x1;if(_0xecee3a[_0xbe8be8(0x15c)]===_0xbe8be8(0x1ad))return console['error']('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0xbe8be8(0x143)](_0xbe8be8(0x151)),0x1;if(!_0xecee3a['segmentId'])throw new SDKError(ErrorCode[_0xbe8be8(0x1a3)],_0xbe8be8(0x1b9));const _0x3a474d=getConsoleNextUrl(_0x3d630e['site'],_0xbe8be8(0x1d6)+_0xecee3a['parentId']+'/e/'+_0xecee3a[_0xbe8be8(0x185)]);return console[_0xbe8be8(0x143)](a25_0x4ce361['green']('β')+_0xbe8be8(0x1b7)+a25_0x4ce361[_0xbe8be8(0x16b)](_0x3a474d)),openBrowser(_0x3a474d),0x0;}if(_0xecee3a[_0xbe8be8(0x15c)]===_0xbe8be8(0x17a)){if(!_0xecee3a[_0xbe8be8(0x1ca)])throw new SDKError(ErrorCode[_0xbe8be8(0x152)],_0xbe8be8(0x176));const _0x3d8cc6=await withSpinner(_0xbe8be8(0x14a),()=>_0x4a1ba1[_0xbe8be8(0x184)][_0xbe8be8(0x1ab)](_0xecee3a[_0xbe8be8(0x1ca)]),{'verbose':_0x3d630e[_0xbe8be8(0x1d0)]});await handleSingleObjectOutput(_0x3d8cc6[_0xbe8be8(0x19b)],_0x3d630e);}else{if(_0xecee3a[_0xbe8be8(0x15c)]==='segment'){if(!_0xecee3a[_0xbe8be8(0x185)])throw new SDKError(ErrorCode[_0xbe8be8(0x1a3)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x104660=await withSpinner(_0xbe8be8(0x163),()=>_0x4a1ba1[_0xbe8be8(0x184)][_0xbe8be8(0x1c3)](_0xecee3a[_0xbe8be8(0x177)],_0xecee3a[_0xbe8be8(0x185)]),{'verbose':_0x3d630e['verbose']}),_0x40395c=getConsoleNextUrl(_0x3d630e[_0xbe8be8(0x157)],'/app/ps/'+_0xecee3a['parentId']+_0xbe8be8(0x18d)+_0xecee3a[_0xbe8be8(0x185)]),_0xaadbd9=_0x104660[_0xbe8be8(0x19b)];_0xaadbd9[_0xbe8be8(0x156)]=_0x40395c,await handleSingleObjectOutput(_0xaadbd9,_0x3d630e);}else return console[_0xbe8be8(0x143)](_0xbe8be8(0x1b3)),console[_0xbe8be8(0x143)](_0xbe8be8(0x1d7)),0x1;}return 0x0;}catch(_0xf88a2a){if(_0xf88a2a instanceof SDKError)return console[_0xbe8be8(0x143)](_0xbe8be8(0x188)+_0xf88a2a[_0xbe8be8(0x144)]),_0xf88a2a[_0xbe8be8(0x147)]&&console[_0xbe8be8(0x143)](_0xbe8be8(0x18c)+_0xf88a2a[_0xbe8be8(0x147)]),0x1;throw _0xf88a2a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x2a638c(0x19c);['description']=a25_0x2a638c(0x1d2);async[a25_0x2a638c(0x1b5)](_0x9ce07){const _0x29535b=a25_0x2a638c,{options:_0x2684d5,args:_0x48bc14,tdx:_0x11344e}=_0x9ce07,_0x2e8dac=_0x48bc14[0x0];if(!_0x2e8dac)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x29535b(0x143)](_0x29535b(0x193)),console[_0x29535b(0x143)](_0x29535b(0x1b8)),console[_0x29535b(0x143)](_0x29535b(0x16e)),console[_0x29535b(0x143)](_0x29535b(0x17e)),console['error'](_0x29535b(0x1cf)),0x1;try{const _0xb47861=_0x2684d5[_0x29535b(0x1b1)],_0x2cee9e=await resolveSegmentTarget(_0x2e8dac,_0xb47861,_0x2684d5['verbose']);_0x2684d5['verbose']&&console[_0x29535b(0x143)](_0x29535b(0x18b)+_0x2cee9e);const _0x48a76c=await withSpinner(_0x29535b(0x15b)+_0x2e8dac+_0x29535b(0x1db),()=>_0x11344e[_0x29535b(0x184)][_0x29535b(0x1a0)](_0x2cee9e),{'verbose':_0x2684d5[_0x29535b(0x1d0)]}),_0x10c666=_0x48a76c['data'];_0x2684d5[_0x29535b(0x1d0)]&&(console[_0x29535b(0x143)](_0x29535b(0x165)+_0x10c666[_0x29535b(0x15c)]),console[_0x29535b(0x143)]('Parent\x20ID:\x20'+_0x10c666[_0x29535b(0x177)]));if(_0x10c666[_0x29535b(0x15c)]===_0x29535b(0x17a))return console[_0x29535b(0x143)](_0x29535b(0x18a)),console[_0x29535b(0x143)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x10c666[_0x29535b(0x15c)]===_0x29535b(0x1ad))return console[_0x29535b(0x143)](_0x29535b(0x1dd)),console[_0x29535b(0x143)](_0x29535b(0x1a9)),0x1;if(!_0x10c666[_0x29535b(0x185)])throw new SDKError(ErrorCode[_0x29535b(0x1a3)],_0x29535b(0x1b9));const _0x516935=await withSpinner(_0x29535b(0x174),()=>_0x11344e[_0x29535b(0x184)][_0x29535b(0x19f)](_0x10c666['parentId'],_0x10c666[_0x29535b(0x185)]),{'verbose':_0x2684d5['verbose']}),_0x521c14=_0x516935[_0x29535b(0x19b)],_0x59aa21=await executeSchemaQuery(_0x521c14,_0x11344e,_0x2684d5);return await handleQueryOutput(_0x59aa21,_0x2684d5),0x0;}catch(_0x1de02f){if(_0x1de02f instanceof SDKError)return console[_0x29535b(0x143)](_0x29535b(0x188)+_0x1de02f[_0x29535b(0x144)]),_0x1de02f[_0x29535b(0x147)]&&console[_0x29535b(0x143)](_0x29535b(0x18c)+_0x1de02f['cause']),0x1;throw _0x1de02f;}}}function a25_0x4907(){const _0x1cfe31=['\x27...','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','2HdnOcp','error','message','Folder\x20ID:\x20','test','cause','2860900oGAKhH','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Fetching\x20folder\x20details...','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','19520199kbMave','getParent','Get\x20SQL\x20query\x20for\x20child\x20segment','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Use:\x20tdx\x20ps\x20view\x20-w','SEGMENT_FOLDER_NOT_FOUND','β\x20Created\x20folder\x20\x27','Show\x20folder\x20or\x20child\x20segment\x20details','web','url','site','processedRows','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segmentPath','Resolving\x20\x27','type','length','segment:show','Error:\x20Path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20show\x20<name>','Resolved\x20relative\x20path\x20to:\x20','jsonl','Fetching\x20segment\x20details...','Use:\x20tdx\x20ps\x20show','Resolved\x20type:\x20','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','name','segment:folder:list','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','cyan','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Examples:','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','β\x20Found\x20','listFolders','Resolved\x20parent\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parentId','\x20\x20Folder\x20path:\x20','resolveParentId','folder','resolveFolderId','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','createFolder','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','trim','query','\x20\x20Full\x20path:\x20','segment:describe','Usage:\x20tdx\x20sg\x20sql\x20<name>','segment','segmentId','information_schema','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20','\x20\x20Segment\x20name:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Target\x20path:\x20','\x20\x20Cause:\x20','/e/','570172zwslqu','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','folderPath','Parent\x20ID:\x20','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','Folder\x20name:\x20','log','Resolving\x20parent\x20folder\x20\x27','segment:view','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','segment:sql','7736640qQEanh','data','segment:desc','Options:','Resolving\x20path\x20\x27','getSegmentSQL','resolvePathToResource','Segment\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','SEGMENT_NOT_FOUND','Use:\x20tdx\x20ps\x20sql','\x20\x20Parent\x20segment:\x20','elapsedTimeMillis','1464882JKyoOV','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20ps\x20desc','json','getFolder','208392PyqjGg','parent','replace','25zYHRCy','segment:folder:create','parentSegment','code','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Executing\x20segment\x20query...','execute','Parent\x20segment:\x20','\x20Opening\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','1913013gepWwf','Site:\x20','in\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','10xekefn','Fetching\x20parent\x20segment\x20details...','Parent\x20name:\x20','getSegment','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','SQL\x20query:\x0a','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','format','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Listing\x20folders\x20for\x20parent\x20\x27','Create\x20segment\x20folder\x20for\x20organization','(root)','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','verbose','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Show\x20child\x20segment\x20schema\x20(column\x20types)','description','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Parent\x20segment\x20name\x20is\x20required','/app/ps/','Use:\x20tdx\x20ps\x20view','segment:folder:show','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentFolder'];a25_0x4907=function(){return _0x1cfe31;};return a25_0x4907();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x46b8f7=a26_0x49b8;(function(_0x22d7d6,_0x2c6f96){const _0x4ea57b=a26_0x49b8,_0x570a49=_0x22d7d6();while(!![]){try{const _0x21baaf=-parseInt(_0x4ea57b(0x157))/0x1*(parseInt(_0x4ea57b(0x158))/0x2)+parseInt(_0x4ea57b(0x180))/0x3*(parseInt(_0x4ea57b(0x162))/0x4)+-parseInt(_0x4ea57b(0x163))/0x5*(parseInt(_0x4ea57b(0x188))/0x6)+parseInt(_0x4ea57b(0x166))/0x7*(-parseInt(_0x4ea57b(0x165))/0x8)+-parseInt(_0x4ea57b(0x17b))/0x9*(parseInt(_0x4ea57b(0x178))/0xa)+-parseInt(_0x4ea57b(0x167))/0xb*(parseInt(_0x4ea57b(0x16c))/0xc)+-parseInt(_0x4ea57b(0x16a))/0xd*(-parseInt(_0x4ea57b(0x168))/0xe);if(_0x21baaf===_0x2c6f96)break;else _0x570a49['push'](_0x570a49['shift']());}catch(_0x2f7446){_0x570a49['push'](_0x570a49['shift']());}}}(a26_0x5a24,0x718cd));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x3833cd from'chalk';function a26_0x5a24(){const _0x55f321=['\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','site','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Resolved\x20relative\x20path\x20to:\x20','error','Site:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','resolveFolderId','921020fFQGkM','yellow','kind','27IIdqwu','resolveParentId','Examples:','createSegment','verbose','1530021fXaoVn','β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Create\x20child\x20segment\x20with\x20filtering\x20rules','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segments','segmentPath','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment','2130dpsCKY','data','parent','264577AEAMps','2yWdyWU','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','β\x20Created\x20segment\x20\x27','folder','name','ruleFile','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','length','\x27...','4pctURN','4315gQChiM','Target\x20path:\x20','25208JpoTdT','1876bBeUMP','11mCFLsA','8731478drbGmS','Creating\x20segment\x20\x27','39jKEoZQ','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','2690652ASnLmZ'];a26_0x5a24=function(){return _0x55f321;};return a26_0x5a24();}function a26_0x49b8(_0x5b5f71,_0x4b495d){_0x5b5f71=_0x5b5f71-0x155;const _0x5a2412=a26_0x5a24();let _0x49b830=_0x5a2412[_0x5b5f71];return _0x49b830;}export class SegmentCreateCommand extends BaseCommand{[a26_0x46b8f7(0x15d)]='segment:create';['description']=a26_0x46b8f7(0x182);async['execute'](_0x475356){const _0x9a2b0d=a26_0x46b8f7;console[_0x9a2b0d(0x171)](a26_0x3833cd['yellow'](_0x9a2b0d(0x181))),console['error'](a26_0x3833cd[_0x9a2b0d(0x179)](_0x9a2b0d(0x173)));const {options:_0x249b76,args:_0x3a0f09,tdx:_0x2237b4}=_0x475356,_0x55e80d=_0x249b76;if(_0x3a0f09[_0x9a2b0d(0x160)]===0x0)return console[_0x9a2b0d(0x171)](_0x9a2b0d(0x186)),console[_0x9a2b0d(0x171)](_0x9a2b0d(0x16b)),console['error'](_0x9a2b0d(0x17d)),console[_0x9a2b0d(0x171)](_0x9a2b0d(0x159)),console[_0x9a2b0d(0x171)](_0x9a2b0d(0x15f)),console[_0x9a2b0d(0x171)](_0x9a2b0d(0x16d)),0x1;const _0x31d2b3=_0x3a0f09[0x0],_0x55e22f=_0x249b76[_0x9a2b0d(0x185)];let _0x4786a1=_0x31d2b3;_0x55e22f&&!_0x31d2b3['includes']('/')&&(_0x4786a1=_0x55e22f+'/'+_0x31d2b3,_0x55e80d[_0x9a2b0d(0x17f)]&&console['error'](_0x9a2b0d(0x170)+_0x4786a1));const _0x204db7=parsePath(_0x4786a1);if(_0x204db7[_0x9a2b0d(0x184)][_0x9a2b0d(0x160)]<0x2)return console[_0x9a2b0d(0x171)](_0x9a2b0d(0x183)),console[_0x9a2b0d(0x171)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x13fa2f=_0x204db7[_0x9a2b0d(0x184)][0x0],_0x5b761d=getBaseName(_0x4786a1),_0x2f8218=getParentPath(_0x4786a1);_0x55e80d[_0x9a2b0d(0x17f)]&&(console[_0x9a2b0d(0x171)](_0x9a2b0d(0x172)+_0x55e80d[_0x9a2b0d(0x16e)]),console[_0x9a2b0d(0x171)](_0x9a2b0d(0x164)+_0x4786a1),console[_0x9a2b0d(0x171)]('Parent:\x20'+_0x13fa2f),console[_0x9a2b0d(0x171)]('Segment\x20name:\x20'+_0x5b761d),console['error'](_0x9a2b0d(0x15a)+_0x2f8218));const _0x119318=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x13fa2f+_0x9a2b0d(0x161),()=>_0x2237b4[_0x9a2b0d(0x187)][_0x9a2b0d(0x17c)](_0x13fa2f),{'verbose':_0x55e80d[_0x9a2b0d(0x17f)]}),_0x17a4d9=_0x119318['data'];let _0x6eff21;if(_0x204db7[_0x9a2b0d(0x184)][_0x9a2b0d(0x160)]>0x2){const _0x3d86e6=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x2f8218+'\x27...',()=>_0x2237b4[_0x9a2b0d(0x187)]['resolvePathToResource'](_0x2f8218),{'verbose':_0x55e80d['verbose']}),_0x1e691a=_0x3d86e6[_0x9a2b0d(0x155)];if(_0x1e691a['type']!==_0x9a2b0d(0x15c)&&_0x1e691a['type']!==_0x9a2b0d(0x156))return console[_0x9a2b0d(0x171)](_0x9a2b0d(0x16f)),0x1;_0x6eff21=_0x1e691a['folderId'];}else{if(_0x55e80d['folder']){const _0x24962c=await withSpinner(_0x9a2b0d(0x176)+_0x55e80d['folder']+_0x9a2b0d(0x161),()=>_0x2237b4['segment'][_0x9a2b0d(0x177)](_0x17a4d9,_0x55e80d[_0x9a2b0d(0x15c)]),{'verbose':_0x55e80d['verbose']});_0x6eff21=_0x24962c[_0x9a2b0d(0x155)];}}_0x55e80d[_0x9a2b0d(0x17f)]&&_0x6eff21&&console[_0x9a2b0d(0x171)]('Resolved\x20folder\x20ID:\x20'+_0x6eff21);const _0x4c55de=await loadJSONFromOptions(_0x55e80d['rule'],_0x55e80d[_0x9a2b0d(0x15e)]),_0x120591={'name':_0x5b761d,'description':_0x55e80d[_0x9a2b0d(0x174)],'rule':_0x4c55de,'kind':_0x55e80d[_0x9a2b0d(0x17a)]!==undefined?parseInt(_0x55e80d[_0x9a2b0d(0x17a)],0xa):undefined,'isVisible':_0x55e80d['invisible']?![]:undefined,'segmentFolderId':_0x6eff21,'countPopulation':_0x55e80d['noCountPopulation']?![]:undefined},_0x52b1c0=await withSpinner(_0x9a2b0d(0x169)+_0x5b761d+_0x9a2b0d(0x161),()=>_0x2237b4[_0x9a2b0d(0x187)][_0x9a2b0d(0x17e)](_0x17a4d9,_0x120591),{'verbose':_0x55e80d[_0x9a2b0d(0x17f)]}),_0x4bb13a=_0x52b1c0[_0x9a2b0d(0x155)];return console[_0x9a2b0d(0x171)](_0x9a2b0d(0x15b)+_0x4bb13a[_0x9a2b0d(0x15d)]+'\x27\x20with\x20ID:\x20'+_0x4bb13a['id']),_0x4786a1!==_0x31d2b3&&console[_0x9a2b0d(0x171)](_0x9a2b0d(0x175)+_0x4786a1),await handleSDKOutput([_0x4bb13a],_0x55e80d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x1f7344=a27_0x5151;function a27_0x315b(){const _0x462939=['execute','β\x20Found\x20','13830780HBgpYJ','7729656VuFBpU','205pvElSo','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Site:\x20','1838598AXmZFN','3617352CWIVYc','732888PfXoby','length','Parent\x20segment:\x20','listFields','jsonl','\x27...','json','18076UnWhML','error','description','data','segment:fields','Listing\x20fields\x20for\x20\x27','verbose','7EjfIKo','List\x20available\x20fields\x20for\x20segmentation','site','name','41BFiEjH','60812zVTyco'];a27_0x315b=function(){return _0x462939;};return a27_0x315b();}(function(_0x30443f,_0x27b021){const _0x48780c=a27_0x5151,_0x2a8468=_0x30443f();while(!![]){try{const _0x4bdc12=-parseInt(_0x48780c(0x19a))/0x1*(parseInt(_0x48780c(0x1ac))/0x2)+parseInt(_0x48780c(0x1a4))/0x3+-parseInt(_0x48780c(0x19b))/0x4*(-parseInt(_0x48780c(0x1a0))/0x5)+parseInt(_0x48780c(0x1a3))/0x6*(-parseInt(_0x48780c(0x1b3))/0x7)+parseInt(_0x48780c(0x19f))/0x8+-parseInt(_0x48780c(0x1a5))/0x9+-parseInt(_0x48780c(0x19e))/0xa;if(_0x4bdc12===_0x27b021)break;else _0x2a8468['push'](_0x2a8468['shift']());}catch(_0xa941e){_0x2a8468['push'](_0x2a8468['shift']());}}}(a27_0x315b,0x9f9f5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x5151(_0x328f4d,_0x11c4fc){_0x328f4d=_0x328f4d-0x198;const _0x315bdc=a27_0x315b();let _0x51517e=_0x315bdc[_0x328f4d];return _0x51517e;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x1f7344(0x199)]=a27_0x1f7344(0x1b0);[a27_0x1f7344(0x1ae)]=a27_0x1f7344(0x1b4);async[a27_0x1f7344(0x19c)](_0x196c6e){const _0x4e9b6f=a27_0x1f7344,{options:_0x216973,args:_0x2b114d,tdx:_0x529ecb}=_0x196c6e,_0x6accd5=_0x2b114d[0x0]||_0x216973['parentSegment'];if(!_0x6accd5)return console[_0x4e9b6f(0x1ad)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x4e9b6f(0x1ad)](_0x4e9b6f(0x1a1)),console[_0x4e9b6f(0x1ad)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x216973['verbose']&&(console[_0x4e9b6f(0x1ad)](_0x4e9b6f(0x1a2)+_0x216973[_0x4e9b6f(0x198)]),console[_0x4e9b6f(0x1ad)](_0x4e9b6f(0x1a7)+_0x6accd5));const _0x4b659b=await withSpinner(_0x4e9b6f(0x1b1)+_0x6accd5+_0x4e9b6f(0x1aa),()=>_0x529ecb['segment'][_0x4e9b6f(0x1a8)](_0x6accd5),{'verbose':_0x216973[_0x4e9b6f(0x1b2)]}),_0x216876=_0x4b659b[_0x4e9b6f(0x1af)];console[_0x4e9b6f(0x1ad)](_0x4e9b6f(0x19d)+_0x216876[_0x4e9b6f(0x1a6)]+'\x20field'+(_0x216876[_0x4e9b6f(0x1a6)]!==0x1?'s':''));if(_0x216973[_0x4e9b6f(0x1ab)]||_0x216973[_0x4e9b6f(0x1a9)])return await handleSDKOutput(_0x216876,_0x216973),0x0;return displayFieldsHumanReadable(_0x216876,_0x6accd5),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x333140=a28_0x47f3;function a28_0x1743(){const _0x21ff10=['activations','journeys','utf-8','Target\x20resource:\x20','\x0aPull\x20summary\x20for\x20\x27','cwd','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20activations','parent_segment','verbose','repeat','targetDir','\x20\x20Target:\x20','setPhase','type','segments','5687hKxteq','session','helpText','cyan','10154406yxQmTg','execute','filter','data','error','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Pulling\x20segments\x20from\x20\x27','diff','9QjOXxq','\x27...','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','dim','message','Error:\x20','\x20segments','\x20=\x20','\x20\x20πΊοΈ\x20\x20','parentSegment','hasChanges','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','199202rPcNDu','absolutePath','red','description','Site:\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','green','content','isNew','length','β\x20Context\x20set:\x20','8cXLGWO','2326164xVOgaB','4443129oxAKSs','files','errorCode','\x20new\x20files','\x0aChanges\x20to\x20\x27','7635670yzJfce','β\x20Pulled\x20','9fknuiV','\x20files?','resourceName','\x20unchanged\x20files','dryRun','8510IrOXZs','relativePath','name','Parent\x20segment:\x20','journeyVersions','yellow','parentName','counts','5879265nOanzQ','Write\x20','\x20with\x20'];a28_0x1743=function(){return _0x21ff10;};return a28_0x1743();}(function(_0x2d8201,_0x4fc2a4){const _0x1f95c9=a28_0x47f3,_0x269992=_0x2d8201();while(!![]){try{const _0x33db9c=-parseInt(_0x1f95c9(0x13d))/0x1*(-parseInt(_0x1f95c9(0x129))/0x2)+-parseInt(_0x1f95c9(0x11c))/0x3*(parseInt(_0x1f95c9(0x135))/0x4)+parseInt(_0x1f95c9(0x14a))/0x5+parseInt(_0x1f95c9(0x114))/0x6+-parseInt(_0x1f95c9(0x13b))/0x7+parseInt(_0x1f95c9(0x134))/0x8*(-parseInt(_0x1f95c9(0x136))/0x9)+-parseInt(_0x1f95c9(0x142))/0xa*(-parseInt(_0x1f95c9(0x110))/0xb);if(_0x33db9c===_0x4fc2a4)break;else _0x269992['push'](_0x269992['shift']());}catch(_0x43fed8){_0x269992['push'](_0x269992['shift']());}}}(a28_0x1743,0xd5bfc));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a28_0x47f3(_0x47c895,_0x3047da){_0x47c895=_0x47c895-0x100;const _0x17438e=a28_0x1743();let _0x47f329=_0x17438e[_0x47c895];return _0x47f329;}import a28_0x4ca8fd from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x2ac1b9 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0x333140(0x144)]='segment:pull';[a28_0x333140(0x12c)]=a28_0x333140(0x119);async[a28_0x333140(0x115)](_0x5656dc){const _0x3754f3=a28_0x333140,{options:_0x41eea3,args:_0x8f1c7b,tdx:_0x59720a}=_0x5656dc,_0x41b319=_0x41eea3,_0x53a6e2=await resolveTarget({'arg':_0x8f1c7b[0x0],'contextParent':_0x41eea3[_0x3754f3(0x126)],'cwd':process[_0x3754f3(0x105)]()});if(!isSuccessfulResolution(_0x53a6e2))return _0x53a6e2[_0x3754f3(0x138)]==='no_parent'?(console[_0x3754f3(0x118)](a28_0x4ca8fd[_0x3754f3(0x147)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3754f3(0x12e)),console[_0x3754f3(0x118)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console['error'](_0x3754f3(0x11f))):(console[_0x3754f3(0x118)](a28_0x4ca8fd[_0x3754f3(0x12b)](_0x3754f3(0x122)+_0x53a6e2[_0x3754f3(0x121)]+'\x0a')),_0x53a6e2[_0x3754f3(0x112)]&&console[_0x3754f3(0x118)](a28_0x4ca8fd[_0x3754f3(0x113)](_0x53a6e2[_0x3754f3(0x112)]))),0x1;const _0x4b14f4=_0x53a6e2[_0x3754f3(0x148)],_0x44e705=_0x53a6e2[_0x3754f3(0x10b)],_0x5b9eeb=_0x53a6e2[_0x3754f3(0x10e)]==='file'?_0x53a6e2[_0x3754f3(0x13f)]:undefined;_0x41b319[_0x3754f3(0x109)]&&(console[_0x3754f3(0x118)](_0x3754f3(0x12d)+_0x41b319['site']),console[_0x3754f3(0x118)](_0x3754f3(0x145)+_0x4b14f4),_0x5b9eeb&&console[_0x3754f3(0x118)](_0x3754f3(0x103)+_0x5b9eeb));const _0x544b4d=await withProgressSpinner(_0x3754f3(0x11a)+_0x4b14f4+_0x3754f3(0x11d),_0x28b0ef=>_0x59720a[_0x3754f3(0x11e)]['pullSegments'](_0x4b14f4,{'targetDir':_0x44e705,'targetResourceName':_0x5b9eeb,'verbose':_0x41b319[_0x3754f3(0x109)],'progress':{'update':_0x2d1dc1=>{const _0x5f5c56=_0x3754f3;_0x28b0ef[_0x5f5c56(0x10d)](_0x2d1dc1),_0x41b319['verbose']&&console[_0x5f5c56(0x118)]('\x20\x20'+_0x2d1dc1);}}}),{'verbose':_0x41b319[_0x3754f3(0x109)]}),_0x1406c8=_0x544b4d[_0x3754f3(0x117)];if(_0x1406c8['counts']['segments']===0x0&&_0x1406c8[_0x3754f3(0x149)][_0x3754f3(0x101)]===0x0)return console['error'](a28_0x4ca8fd[_0x3754f3(0x147)](_0x3754f3(0x106)+_0x1406c8['parentName']+'\x27')),0x0;const _0x5c020e=_0x1406c8[_0x3754f3(0x137)][_0x3754f3(0x116)](_0xe782df=>_0xe782df[_0x3754f3(0x131)]),_0x3431ee=_0x1406c8[_0x3754f3(0x137)][_0x3754f3(0x116)](_0x4ffa37=>!_0x4ffa37[_0x3754f3(0x131)]&&_0x4ffa37[_0x3754f3(0x127)]),_0x41cce6=_0x1406c8[_0x3754f3(0x137)][_0x3754f3(0x116)](_0x310ac0=>!_0x310ac0[_0x3754f3(0x131)]&&!_0x310ac0[_0x3754f3(0x127)]);console['error'](_0x3754f3(0x104)+_0x1406c8['parentName']+'\x27:'),console['error']('\x20\x20π―\x20'+a28_0x4ca8fd['cyan'](_0x1406c8['counts'][_0x3754f3(0x10f)]+_0x3754f3(0x123))+_0x3754f3(0x14c)+a28_0x4ca8fd['cyan'](_0x1406c8[_0x3754f3(0x149)][_0x3754f3(0x100)]+_0x3754f3(0x107)));if(_0x1406c8[_0x3754f3(0x149)][_0x3754f3(0x101)]>0x0){const _0x5ad6e7=_0x1406c8[_0x3754f3(0x149)][_0x3754f3(0x146)]>_0x1406c8['counts'][_0x3754f3(0x101)]?'\x20('+_0x1406c8[_0x3754f3(0x149)][_0x3754f3(0x146)]+'\x20versions)':'';console[_0x3754f3(0x118)](_0x3754f3(0x125)+a28_0x4ca8fd[_0x3754f3(0x113)](_0x1406c8['counts'][_0x3754f3(0x101)]+'\x20journeys')+a28_0x4ca8fd['dim'](_0x5ad6e7));}console['error']('\x20\x20'+a28_0x4ca8fd['green']('+\x20'+_0x5c020e[_0x3754f3(0x132)]+_0x3754f3(0x139))),console['error']('\x20\x20'+a28_0x4ca8fd[_0x3754f3(0x147)]('~\x20'+_0x3431ee['length']+'\x20changed\x20files')),console['error']('\x20\x20'+a28_0x4ca8fd[_0x3754f3(0x120)]('=\x20'+_0x41cce6[_0x3754f3(0x132)]+_0x3754f3(0x140))),console[_0x3754f3(0x118)](_0x3754f3(0x10c)+a28_0x4ca8fd[_0x3754f3(0x113)](_0x1406c8['targetDir'])+'\x0a');if(_0x3431ee[_0x3754f3(0x132)]>0x0)for(const _0x5be0c4 of _0x3431ee){console['error'](_0x3754f3(0x13a)+_0x5be0c4[_0x3754f3(0x143)]+'\x27:'),console[_0x3754f3(0x118)]('β'[_0x3754f3(0x10a)](0x3c)),console[_0x3754f3(0x118)](_0x5be0c4[_0x3754f3(0x11b)]),console[_0x3754f3(0x118)]('β'[_0x3754f3(0x10a)](0x3c));}if(_0x41b319[_0x3754f3(0x141)])return console['error'](a28_0x4ca8fd['yellow'](_0x3754f3(0x128))),0x0;if(_0x5c020e['length']===0x0&&_0x3431ee[_0x3754f3(0x132)]===0x0)return console[_0x3754f3(0x118)](a28_0x4ca8fd[_0x3754f3(0x12f)]('β\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1406c8['parentName']},_0x41b319[_0x3754f3(0x111)]),console[_0x3754f3(0x118)](a28_0x4ca8fd[_0x3754f3(0x12f)](_0x3754f3(0x133)+a28_0x4ca8fd[_0x3754f3(0x120)](_0x3754f3(0x108))+_0x3754f3(0x124)+a28_0x4ca8fd[_0x3754f3(0x113)](_0x1406c8[_0x3754f3(0x148)]))),0x0;if(!_0x41b319['yes']){const _0x1033e4=await confirmKey(_0x3754f3(0x14b)+(_0x5c020e['length']+_0x3431ee[_0x3754f3(0x132)])+_0x3754f3(0x13e));if(!_0x1033e4)return console[_0x3754f3(0x118)]('Aborted.'),0x1;}for(const _0x3d2153 of _0x1406c8[_0x3754f3(0x137)]){if(_0x3d2153[_0x3754f3(0x131)]||_0x3d2153[_0x3754f3(0x127)]){const _0x2e54b6=a28_0x2ac1b9['dirname'](_0x3d2153['absolutePath']);!existsSync(_0x2e54b6)&&mkdirSync(_0x2e54b6,{'recursive':!![]}),writeFileSync(_0x3d2153[_0x3754f3(0x12a)],_0x3d2153[_0x3754f3(0x130)],_0x3754f3(0x102));}}return console['error'](a28_0x4ca8fd[_0x3754f3(0x12f)](_0x3754f3(0x13c)+(_0x5c020e[_0x3754f3(0x132)]+_0x3431ee[_0x3754f3(0x132)])+'\x20files\x20to\x20'+_0x1406c8['targetDir'])),saveSessionContext({'parent_segment':_0x1406c8[_0x3754f3(0x148)]},_0x41b319[_0x3754f3(0x111)]),console[_0x3754f3(0x118)](a28_0x4ca8fd['green']('β\x20Context\x20set:\x20'+a28_0x4ca8fd[_0x3754f3(0x120)]('parent_segment')+_0x3754f3(0x124)+a28_0x4ca8fd['cyan'](_0x1406c8[_0x3754f3(0x148)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x59cde6=a29_0x229b;(function(_0x20bf58,_0x46f8c3){const _0x1c4689=a29_0x229b,_0x23aef4=_0x20bf58();while(!![]){try{const _0x1288ee=parseInt(_0x1c4689(0x15b))/0x1+-parseInt(_0x1c4689(0x129))/0x2+-parseInt(_0x1c4689(0x109))/0x3+parseInt(_0x1c4689(0x15e))/0x4+-parseInt(_0x1c4689(0x137))/0x5*(parseInt(_0x1c4689(0x136))/0x6)+parseInt(_0x1c4689(0xdd))/0x7+parseInt(_0x1c4689(0x110))/0x8*(parseInt(_0x1c4689(0x152))/0x9);if(_0x1288ee===_0x46f8c3)break;else _0x23aef4['push'](_0x23aef4['shift']());}catch(_0x414fbd){_0x23aef4['push'](_0x23aef4['shift']());}}}(a29_0x1cbb,0xc7449));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x3d1326 from'chalk';import{existsSync}from'fs';function a29_0x1cbb(){const _0x2347d3=['\x0aPush\x20summary\x20for\x20\x27','\x20to\x20update','600XfXPIr','12665xlsFkF','Error:\x20','getOutputSchemaWithCache','\x20\x20Activations:','verbose','delete','activations','toDelete','get','new','journeyId','\x20deleted','nameToType','error','results','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','audienceId','createdSegmentIds','listActivations','unchanged','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parentFolder','folderPath','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','all','join','file','8361ccilpy','getParent','No\x20','length','\x20new','connection','Scoped\x20to\x20folder:\x20','user','add','1587296eICXBC','Changes\x20to\x20journey:','no_parent','4860040wpMQMd','(Journey\x20will\x20be\x20deleted)','then','\x20to\x20create','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','buildUserMaps','getJourney','idToName','createdAt','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','repeat','Fetching\x20existing\x20folders...','\x0aβ\x20Push\x20complete','.yaml','toCreate','red','\x20changed','yamlConfig','\x20\x20\x20\x20','journeyBundleId','map','\x20\x20Journeys:\x20','site','resolveParentId','filter','scopedFolderPath','3112830aNWQfv','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x0aValidation\x20failed:','message','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','dryRun','New\x20segment:','existingJourney','deleted','Parent\x20segment:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','list','endsWith','isNew','Fetching\x20existing\x20segments...','listSegments','Fetching\x20connections\x20for\x20name\x20resolution...','Resolving\x20parent\x20segment\x20\x27','updated','nameToId','\x20folders\x20to\x20create','\x20\x20Source:\x20','\x27...','state','type','filePath','helpText','journey','setPhase','data','journeysOnly','push','journeys','Push\x20','blue','attributes','Delete\x20segment:','\x20activations]','green','segments','errorCode','\x20created','updatedAt','segmentFolderId','4774680qsqtsD','\x20to\x20delete','cyan','/j/da/je','execute','\x20\x20π\x20Segments:','yellow','7376CUsLYh','name','changed','Source\x20directory:\x20','description','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Error:\x20Directory\x20not\x20found:\x20','Folders\x20to\x20create:','Site:\x20','dim','isScoped','segment\x20or\x20journey','segment:push','Fetching\x20existing\x20journeys...','created','Fetching\x20users\x20for\x20email\x20resolution...','Fetching\x20existing\x20activations...','.yml','parentSegment','\x20unchanged','folders','\x20changes?','\x20\x20Activations:\x20','targetDir','2884946gaRmtJ','journeyBundleName','relationships','diff','\x20YAML\x20files\x20found','set','toUpdate','\x20updated','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','paused','/e/'];a29_0x1cbb=function(){return _0x2347d3;};return a29_0x1cbb();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x229b(_0x5257ff,_0x325ee2){_0x5257ff=_0x5257ff-0xcd;const _0x1cbb75=a29_0x1cbb();let _0x229b27=_0x1cbb75[_0x5257ff];return _0x229b27;}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a29_0x59cde6(0x111)]=a29_0x59cde6(0x11d);[a29_0x59cde6(0x114)]=a29_0x59cde6(0x115);async[a29_0x59cde6(0x10d)](_0x14ae8a){const _0x4249f8=a29_0x59cde6,{options:_0x43530b,args:_0x4c7cd1,tdx:_0x6c92c5}=_0x14ae8a,_0x29e51d=_0x43530b,_0x96c6e1=await resolveTarget({'arg':_0x4c7cd1[0x0],'contextParent':_0x43530b[_0x4249f8(0x123)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x96c6e1))return _0x96c6e1[_0x4249f8(0x105)]===_0x4249f8(0x15d)?(console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x14b))),console[_0x4249f8(0x144)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x4249f8(0x144)](_0x4249f8(0x168)),console[_0x4249f8(0x144)](_0x4249f8(0x116))):(console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xd2)](_0x4249f8(0x138)+_0x96c6e1[_0x4249f8(0xe0)]+'\x0a')),_0x96c6e1[_0x4249f8(0xf7)]&&console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10b)](_0x96c6e1['helpText']))),0x1;if(_0x96c6e1[_0x4249f8(0xf5)]==='parent_name')return console[_0x4249f8(0x144)](a29_0x3d1326['red'](_0x4249f8(0x117)+_0x96c6e1[_0x4249f8(0x128)]+'\x0a')),console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10b)](_0x4249f8(0x146))),0x1;const _0x9fe777=_0x96c6e1['parentName'],_0x5d9a03=_0x96c6e1[_0x4249f8(0x128)],_0x2596ca=_0x96c6e1[_0x4249f8(0xf5)]===_0x4249f8(0x151)?_0x96c6e1[_0x4249f8(0xf6)]:undefined,_0x2faa3e=getScopedDetails(_0x96c6e1),_0x46b05e=_0x2faa3e?.[_0x4249f8(0x11b)]??![],_0x5cad96=_0x2faa3e?.[_0x4249f8(0xdc)]??'';if(!existsSync(_0x5d9a03))return console['error'](a29_0x3d1326['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x5d9a03+'\x0a')),console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10b)](_0x4249f8(0x146))),0x1;_0x29e51d[_0x4249f8(0x13b)]&&(console[_0x4249f8(0x144)](_0x4249f8(0x119)+_0x29e51d[_0x4249f8(0xd9)]),console[_0x4249f8(0x144)](_0x4249f8(0xe6)+_0x9fe777),console['error'](_0x4249f8(0x113)+_0x5d9a03),_0x46b05e&&console[_0x4249f8(0x144)](_0x4249f8(0x158)+_0x5cad96));const _0x5d9085=await withSpinner(_0x4249f8(0xee)+_0x9fe777+_0x4249f8(0xf3),()=>_0x6c92c5[_0x4249f8(0x167)][_0x4249f8(0xda)](_0x9fe777),{'verbose':_0x29e51d[_0x4249f8(0x13b)]}),_0x4fd2bf=_0x5d9085[_0x4249f8(0xfa)],[_0x526739,_0xa94930,_0x5ef1bc,_0x59dda0,_0x5e2e1d]=await Promise[_0x4249f8(0x14f)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x6c92c5[_0x4249f8(0x167)][_0x4249f8(0x153)](_0x4fd2bf),{'verbose':_0x29e51d['verbose']}),withSpinner(_0x4249f8(0xeb),()=>_0x6c92c5[_0x4249f8(0x167)][_0x4249f8(0xec)](_0x4fd2bf),{'verbose':_0x29e51d[_0x4249f8(0x13b)]}),withSpinner(_0x4249f8(0xce),()=>_0x6c92c5[_0x4249f8(0x167)]['listFolders'](_0x4fd2bf),{'verbose':_0x29e51d['verbose']}),withSpinner(_0x4249f8(0x11e),()=>_0x6c92c5[_0x4249f8(0xf8)]['listJourneysWithDetailsFromParentSegment'](_0x4fd2bf,{'includeAllVersions':!![]}),{'verbose':_0x29e51d[_0x4249f8(0x13b)]}),withSpinner(_0x4249f8(0x120),()=>_0x6c92c5[_0x4249f8(0x159)][_0x4249f8(0x163)](),{'verbose':_0x29e51d[_0x4249f8(0x13b)]})['then'](_0x2dc2cf=>_0x2dc2cf[_0x4249f8(0xfa)])]),_0x812c45=_0x526739[_0x4249f8(0xfa)],_0x55f0b5=extractRootFolderId(_0x812c45),_0x4b6408=_0xa94930[_0x4249f8(0xfa)],_0xbf3c9d=_0x5ef1bc['data'],{journeys:_0x3c245e,activationStepsById:_0x271470}=_0x59dda0[_0x4249f8(0xfa)],_0x13b423=new Map(_0x3c245e['map'](_0x1808f1=>[_0x1808f1['id'],_0x1808f1])),_0x4d7a85=_0x3c245e['map'](_0x245cc1=>({'id':_0x245cc1['id'],'name':_0x245cc1['attributes']['name'],'journeyBundleName':_0x245cc1[_0x4249f8(0x100)]['journeyBundleName']||'','journeyBundleId':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0xd6)]||'','versionNumber':_0x245cc1[_0x4249f8(0x100)]['versionNumber'],'description':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0x114)],'state':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0xf4)],'paused':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0x132)],'audienceId':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0x147)],'folderId':_0x245cc1[_0x4249f8(0x12b)]?.[_0x4249f8(0x14c)]?.[_0x4249f8(0xfa)]?.['id'],'createdAt':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0x166)],'updatedAt':_0x245cc1['attributes'][_0x4249f8(0x107)]})),{emailToId:_0x1f0df2,idToEmail:_0x531083}=_0x5e2e1d,_0xa43306=await withSpinner(_0x4249f8(0xed),async()=>{const _0x52bf8a=_0x4249f8,_0x4939f0=await _0x6c92c5['connection'][_0x52bf8a(0xe8)]();return buildConnectionMaps(_0x4939f0);},{'verbose':_0x29e51d['verbose']})[_0x4249f8(0x160)](_0x4adcab=>_0x4adcab['data']),_0x34f46f=_0xa43306['nameToId'],_0x4d3f32=_0xa43306[_0x4249f8(0x165)],_0x42b4a6=_0xa43306[_0x4249f8(0x143)],_0x44c6a9={'emailToIdMap':_0x1f0df2,'connectionNameToIdMap':_0x34f46f,'connectionNameToTypeMap':_0x42b4a6,'getSchema':_0x4b47eb=>_0x6c92c5[_0x4249f8(0x157)][_0x4249f8(0x139)](_0x4b47eb)};let {pathToId:_0x46af59,idToPath:_0x31a015}=buildFolderMaps(_0xbf3c9d);const _0x39bf37=buildSegmentLookupMap(_0x4b6408,_0x31a015),_0x287e03=buildSegmentNameToIdMap(_0x4b6408),_0x2c50b2=buildJourneyBundleLookupMap(_0x4d7a85,_0x31a015);let _0x1a6863;if(_0x2596ca){if(!_0x2596ca[_0x4249f8(0xe9)](_0x4249f8(0x122))&&!_0x2596ca[_0x4249f8(0xe9)](_0x4249f8(0xd0)))return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xd2)](_0x4249f8(0xe7)+_0x2596ca+'\x0a')),0x1;_0x1a6863=[_0x2596ca];}else _0x1a6863=findYamlFiles(_0x5d9a03);if(_0x1a6863[_0x4249f8(0x155)]===0x0)return console[_0x4249f8(0x144)](a29_0x3d1326['red'](_0x4249f8(0x162)+_0x5d9a03+'\x0a')),console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10b)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x1fd2f1,_0x3db54b;try{const _0x41aab9=parseAndClassifyYamlFiles(_0x1a6863,_0x5d9a03,{'skipSegments':_0x29e51d['journeysOnly']});_0x1fd2f1=_0x41aab9[_0x4249f8(0x104)],_0x3db54b=_0x41aab9['journeys'];const _0x25798d=validateParsedFiles(_0x41aab9,_0x5d9a03);if(_0x25798d[_0x4249f8(0x155)]>0x0)return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xd2)](_0x4249f8(0xdf))),console[_0x4249f8(0x144)](formatValidationErrors(_0x25798d)),console['error'](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x131))),0x1;}catch(_0x51301f){return console['error'](a29_0x3d1326[_0x4249f8(0xd2)]('Error\x20parsing\x20YAML:\x20'+(_0x51301f instanceof Error?_0x51301f[_0x4249f8(0xe0)]:_0x51301f))),0x1;}if(_0x1fd2f1['length']===0x0&&_0x3db54b[_0x4249f8(0x155)]===0x0){const _0xb78615=_0x29e51d[_0x4249f8(0xfb)]?'journey':_0x4249f8(0x11c);return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x154)+_0xb78615+_0x4249f8(0x12d))),0x0;}const _0x5c1e54=new Map();_0x4b6408[_0x4249f8(0x155)]>0x0&&!_0x29e51d['journeysOnly']&&await withSpinner(_0x4249f8(0x121),async()=>{await batchAsync(_0x4b6408,async _0x1d1b83=>{const _0x4f6c88=a29_0x229b,_0x35b565=await _0x6c92c5[_0x4f6c88(0x167)][_0x4f6c88(0x149)](_0x4fd2bf,_0x1d1b83['id']);_0x5c1e54[_0x4f6c88(0x12e)](_0x1d1b83['id'],_0x35b565);});},{'verbose':_0x29e51d['verbose']});const {segmentFiles:_0x4af029,foldersToCreate:_0xdfa388}=await prepareSegmentFiles(_0x1fd2f1,{'segmentByFolderAndName':_0x39bf37,'activationsBySegmentId':_0x5c1e54,'folderPathToId':_0x46af59,'idToEmailMap':_0x531083,'connectionIdToNameMap':_0x4d3f32},_0x44c6a9,_0x46b05e,_0x5cad96),_0x4da3b2=_0x2596ca?[]:findSegmentsToDelete(_0x4b6408,_0x1fd2f1[_0x4249f8(0xd7)](({yamlConfig:_0x2dbaa5,folderPath:_0x300f97})=>({'yamlConfig':_0x2dbaa5,'folderPath':resolveTDFolderPath(_0x300f97,_0x46b05e,_0x5cad96)})),_0x31a015,_0x5cad96,_0x46b05e),{journeyFiles:_0x125f28,foldersToCreate:_0x3dcef7}=await withProgressSpinner('Preparing\x20journeys...',async _0x5073ec=>prepareJourneyFiles(_0x3db54b,{'fetchJourney':async _0x3eaa33=>_0x6c92c5[_0x4249f8(0xf8)][_0x4249f8(0x164)](_0x3eaa33[_0x4249f8(0x141)]),'journeyBundlesByFolderAndName':_0x2c50b2,'folderPathToId':_0x46af59,'idToEmailMap':_0x531083,'connectionIdToNameMap':_0x4d3f32,'existingSegments':_0x4b6408,'parentId':_0x4fd2bf,'deps':_0x6c92c5,'progress':{'update':_0x215d8d=>{const _0x45ae69=_0x4249f8;_0x5073ec[_0x45ae69(0xf9)](_0x215d8d),_0x29e51d[_0x45ae69(0x13b)]&&console[_0x45ae69(0x144)]('\x20\x20'+_0x215d8d);}},'journeyById':_0x13b423,'activationStepsById':_0x271470},_0x46b05e,_0x5cad96),{'verbose':_0x29e51d[_0x4249f8(0x13b)]})[_0x4249f8(0x160)](_0x310ace=>_0x310ace['data']);for(const _0xf374a9 of _0x3dcef7){_0xdfa388[_0x4249f8(0x15a)](_0xf374a9);}const _0x30ae41=_0x2596ca?[]:findJourneysToDelete(_0x4d7a85,_0x3db54b[_0x4249f8(0xd7)](({yamlConfig:_0x563b03,folderPath:_0x3f21c7})=>({'yamlConfig':_0x563b03,'folderPath':resolveTDFolderPath(_0x3f21c7,_0x46b05e,_0x5cad96)})),_0x31a015,_0x5cad96,_0x46b05e),_0x2d8190=calculatePushStats(_0x4af029,_0x125f28,_0xdfa388,_0x4da3b2,_0x30ae41,!!_0x29e51d[_0x4249f8(0x13c)],!!_0x29e51d['journeysOnly']),_0x756bc1=_0x2d8190[_0x4249f8(0x104)][_0x4249f8(0x140)],_0x5df296=_0x2d8190[_0x4249f8(0x104)][_0x4249f8(0x112)],_0x12175e=_0x2d8190['segments'][_0x4249f8(0x14a)],_0x648382=_0x2d8190[_0x4249f8(0x104)][_0x4249f8(0x13e)],_0x3464b9=_0x2d8190[_0x4249f8(0x125)]['toCreate'],_0x130db1=_0x2d8190[_0x4249f8(0xfd)][_0x4249f8(0x140)],_0x584fc3=_0x2d8190[_0x4249f8(0xfd)][_0x4249f8(0x112)],_0x408b51=_0x2d8190[_0x4249f8(0xfd)][_0x4249f8(0x14a)],_0x2a954b=_0x2d8190['journeys'][_0x4249f8(0x13e)],_0x5e94e9=_0x2d8190[_0x4249f8(0x13d)][_0x4249f8(0x14f)],_0x5c6afd=_0x2d8190[_0x4249f8(0x13d)][_0x4249f8(0xd1)],_0x2a574c=_0x2d8190['activations'][_0x4249f8(0x12f)],_0x21f6c0=_0x2d8190[_0x4249f8(0x13d)]['toDelete'];console[_0x4249f8(0x144)](_0x4249f8(0x134)+_0x9fe777+'\x27:');_0x3464b9[_0x4249f8(0x155)]>0x0&&console[_0x4249f8(0x144)]('\x20\x20'+a29_0x3d1326[_0x4249f8(0xff)]('π\x20'+_0x3464b9[_0x4249f8(0x155)]+_0x4249f8(0xf1)));if(!_0x29e51d[_0x4249f8(0xfb)]){console[_0x4249f8(0x144)](_0x4249f8(0x10e)),console['error'](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x103)]('+\x20'+_0x756bc1[_0x4249f8(0x155)]+_0x4249f8(0x156))),console['error'](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x10f)]('~\x20'+_0x5df296[_0x4249f8(0x155)]+_0x4249f8(0xd3)));if(_0x648382['length']>0x0)console[_0x4249f8(0x144)]('\x20\x20\x20\x20'+a29_0x3d1326['red']('-\x20'+_0x648382[_0x4249f8(0x155)]+_0x4249f8(0x10a)));else _0x4da3b2[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0x13c)]&&console['error'](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x11a)](_0x4da3b2[_0x4249f8(0x155)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326['dim']('=\x20'+_0x12175e[_0x4249f8(0x155)]+_0x4249f8(0x124)));}if(_0x125f28[_0x4249f8(0x155)]>0x0||_0x30ae41[_0x4249f8(0x155)]>0x0){console[_0x4249f8(0x144)]('\x20\x20πΊοΈ\x20\x20Journeys:'),console['error'](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x103)]('+\x20'+_0x130db1[_0x4249f8(0x155)]+_0x4249f8(0x156))),console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x10f)]('~\x20'+_0x584fc3[_0x4249f8(0x155)]+_0x4249f8(0xd3)));if(_0x2a954b[_0x4249f8(0x155)]>0x0)console[_0x4249f8(0x144)]('\x20\x20\x20\x20'+a29_0x3d1326[_0x4249f8(0xd2)]('-\x20'+_0x2a954b[_0x4249f8(0x155)]+_0x4249f8(0x10a)));else _0x30ae41[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0x13c)]&&console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x11a)](_0x30ae41[_0x4249f8(0x155)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x11a)]('=\x20'+_0x408b51[_0x4249f8(0x155)]+_0x4249f8(0x124)));}_0x5e94e9[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)]&&(console[_0x4249f8(0x144)](''),console[_0x4249f8(0x144)](_0x4249f8(0x13a)),_0x5c6afd[_0x4249f8(0x155)]>0x0&&console[_0x4249f8(0x144)]('\x20\x20\x20\x20'+a29_0x3d1326[_0x4249f8(0x103)]('+\x20'+_0x5c6afd[_0x4249f8(0x155)]+_0x4249f8(0x161))),_0x2a574c['length']>0x0&&console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x10f)]('~\x20'+_0x2a574c['length']+_0x4249f8(0x135))),_0x21f6c0['length']>0x0&&console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0xd2)]('-\x20'+_0x21f6c0[_0x4249f8(0x155)]+_0x4249f8(0x10a))));console['error'](_0x4249f8(0xf2)+a29_0x3d1326[_0x4249f8(0x10b)](_0x5d9a03)+'\x0a');if(_0x3464b9[_0x4249f8(0x155)]>0x0){console[_0x4249f8(0x144)](_0x4249f8(0x118));for(const _0x5a5f75 of _0x3464b9){console[_0x4249f8(0x144)]('\x20\x20'+a29_0x3d1326[_0x4249f8(0xff)]('+')+'\x20'+_0x5a5f75);}console[_0x4249f8(0x144)]('');}if(_0x756bc1[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)])for(const _0x15aa80 of _0x756bc1){const _0x46e0f0=_0x15aa80[_0x4249f8(0x14d)]?_0x15aa80['folderPath']+'/'+_0x15aa80[_0x4249f8(0xd4)][_0x4249f8(0x111)]:_0x15aa80[_0x4249f8(0xd4)][_0x4249f8(0x111)],_0x5d0219=_0x15aa80[_0x4249f8(0xd4)]['activations']?.['length']||0x0,_0x2881c9=_0x5d0219>0x0?a29_0x3d1326[_0x4249f8(0x11a)]('\x20['+_0x5d0219+_0x4249f8(0x102)):'';console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0x103)](_0x4249f8(0xe3))+'\x20'+_0x46e0f0+_0x2881c9),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c)),_0x15aa80[_0x4249f8(0x12c)]&&console[_0x4249f8(0x144)](_0x15aa80[_0x4249f8(0x12c)]),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c));}if(_0x648382[_0x4249f8(0x155)]>0x0&&!_0x29e51d['journeysOnly'])for(const _0x2eea5f of _0x648382){const _0xd496b3=_0x2eea5f[_0x4249f8(0x108)]?_0x31a015[_0x4249f8(0x13f)](_0x2eea5f['segmentFolderId']['toString']())||'':'',_0x5c6754=_0xd496b3?_0xd496b3+'/'+_0x2eea5f[_0x4249f8(0x111)]:_0x2eea5f['name'],_0x2aa466=_0x5c1e54[_0x4249f8(0x13f)](_0x2eea5f['id'])||[],_0x4886aa=_0x2aa466[_0x4249f8(0x155)]>0x0?a29_0x3d1326[_0x4249f8(0x11a)]('\x20['+_0x2aa466[_0x4249f8(0x155)]+_0x4249f8(0x102)):'';console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0xd2)](_0x4249f8(0x101))+'\x20'+_0x5c6754+_0x4886aa),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c));const _0x56356b=segmentWithActivationsToYaml(_0x2eea5f,_0x2aa466,undefined,_0x531083,_0x4d3f32),_0xb0061d=segmentToYamlString(_0x56356b),_0x51aaf4=generateDiff(_0xb0061d,'');console[_0x4249f8(0x144)](formatDiffWithColors(_0x51aaf4)),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c));}const _0x38f5b5=_0x4af029['filter'](_0x43f8f1=>!_0x43f8f1['isNew']&&_0x43f8f1[_0x4249f8(0x12c)]);if(_0x38f5b5[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)])for(const _0x360e01 of _0x38f5b5){const _0x4b5f30=_0x360e01[_0x4249f8(0x14d)]?_0x360e01[_0x4249f8(0x14d)]+'/'+_0x360e01[_0x4249f8(0xd4)][_0x4249f8(0x111)]:_0x360e01[_0x4249f8(0xd4)][_0x4249f8(0x111)];console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326['yellow']('Changes\x20to:')+'\x20'+_0x4b5f30),console['error']('β'['repeat'](0x3c)),console[_0x4249f8(0x144)](_0x360e01[_0x4249f8(0x12c)]),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c));}if(_0x130db1[_0x4249f8(0x155)]>0x0)for(const _0x40dbfb of _0x130db1){const _0x477f2a=_0x40dbfb[_0x4249f8(0x14d)]?_0x40dbfb[_0x4249f8(0x14d)]+'/'+_0x40dbfb[_0x4249f8(0xd4)]['name']:_0x40dbfb['yamlConfig']['name'];console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0x103)]('New\x20journey:')+'\x20'+_0x477f2a),console[_0x4249f8(0x144)]('β'['repeat'](0x3c)),_0x40dbfb[_0x4249f8(0x12c)]&&console[_0x4249f8(0x144)](_0x40dbfb[_0x4249f8(0x12c)]),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c));}const _0x41b962=_0x125f28[_0x4249f8(0xdb)](_0x22d0c0=>!_0x22d0c0[_0x4249f8(0xea)]&&_0x22d0c0[_0x4249f8(0x12c)]);if(_0x41b962[_0x4249f8(0x155)]>0x0)for(const _0x38bed0 of _0x41b962){const _0x35b289=_0x38bed0['folderPath']?_0x38bed0[_0x4249f8(0x14d)]+'/'+_0x38bed0[_0x4249f8(0xd4)][_0x4249f8(0x111)]:_0x38bed0['yamlConfig'][_0x4249f8(0x111)];console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x15c))+'\x20'+_0x35b289),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c)),console[_0x4249f8(0x144)](_0x38bed0[_0x4249f8(0x12c)]),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c));}if(_0x2a954b[_0x4249f8(0x155)]>0x0)for(const _0x4cbbfc of _0x2a954b){const _0x10c037=_0x4cbbfc['folderId']?_0x31a015[_0x4249f8(0x13f)](_0x4cbbfc['folderId'])||'':'',_0x39d3dd=_0x10c037?_0x10c037+'/'+_0x4cbbfc['journeyBundleName']:_0x4cbbfc[_0x4249f8(0x12a)];console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0xd2)]('Delete\x20journey:')+'\x20'+_0x39d3dd),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c)),console[_0x4249f8(0x144)](a29_0x3d1326['red'](_0x4249f8(0x15f))),console[_0x4249f8(0x144)]('β'[_0x4249f8(0xcd)](0x3c));}if(_0x29e51d[_0x4249f8(0xe2)])return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x14e))),0x0;const _0x23b840=_0x29e51d[_0x4249f8(0xfb)]?![]:_0x756bc1['length']>0x0||_0x5df296[_0x4249f8(0x155)]>0x0||_0x648382[_0x4249f8(0x155)]>0x0,_0x15fe25=_0x130db1['length']>0x0||_0x584fc3['length']>0x0||_0x2a954b[_0x4249f8(0x155)]>0x0,_0xbfc707=_0x29e51d[_0x4249f8(0xfb)]?![]:_0x5e94e9[_0x4249f8(0x155)]>0x0,_0x258f68=_0x3464b9[_0x4249f8(0x155)]>0x0;if(!_0x23b840&&!_0x15fe25&&!_0xbfc707&&!_0x258f68){const _0x59efd6=_0x29e51d[_0x4249f8(0xfb)]?'β\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x4249f8(0xde);console[_0x4249f8(0x144)](a29_0x3d1326['green'](_0x59efd6));if(_0x2596ca&&_0x408b51[_0x4249f8(0x155)]===0x1){const _0x262c43=_0x408b51[0x0];if(_0x262c43[_0x4249f8(0xe4)]?.['id']){const _0x55001a=getConsoleNextUrl(_0x29e51d[_0x4249f8(0xd9)],'/app/ps/'+_0x4fd2bf+_0x4249f8(0x133)+_0x262c43[_0x4249f8(0xe4)]['id']+_0x4249f8(0x10c));console[_0x4249f8(0x144)]('\x20\x20'+a29_0x3d1326['cyan'](_0x55001a));}}return 0x0;}const _0x4fe248=_0x29e51d['journeysOnly']?_0x130db1['length']+_0x584fc3[_0x4249f8(0x155)]+_0x2a954b['length']+_0x3464b9[_0x4249f8(0x155)]:_0x756bc1[_0x4249f8(0x155)]+_0x5df296[_0x4249f8(0x155)]+_0x648382[_0x4249f8(0x155)]+_0x130db1[_0x4249f8(0x155)]+_0x584fc3[_0x4249f8(0x155)]+_0x2a954b[_0x4249f8(0x155)]+_0x3464b9[_0x4249f8(0x155)]+_0x5e94e9['length'];if(!_0x29e51d['yes']&&_0x4fe248>0x0){const _0x517fc4=await confirmKey(_0x4249f8(0xfe)+_0x4fe248+_0x4249f8(0x126));if(!_0x517fc4)return console[_0x4249f8(0x144)]('Aborted.'),0x1;}const _0x2c893c={'withProgress':async(_0x2f125b,_0x3b714c)=>{const _0x245377=_0x4249f8,_0x463ec1=await withSpinner(_0x2f125b,_0x3b714c,{'verbose':_0x29e51d[_0x245377(0x13b)]});return{'data':_0x463ec1['data']};},'logInfo':_0x531d7d=>console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xff)]('β\x20'+_0x531d7d)),'logSuccess':_0x42b709=>console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x103)]('β\x20'+_0x42b709)),'logWarning':_0x204930=>console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)]('β \x20'+_0x204930)),'logDeleted':_0x53398c=>console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xd2)]('β\x20'+_0x53398c))},_0x53fd17={'segment':_0x6c92c5[_0x4249f8(0x167)],'journey':_0x6c92c5[_0x4249f8(0xf8)],'user':_0x6c92c5[_0x4249f8(0x159)],'connection':_0x6c92c5[_0x4249f8(0x157)]};_0x3464b9[_0x4249f8(0x155)]>0x0&&(_0x46af59=await executePushFolders(_0x53fd17,_0x3464b9,_0x46af59,{'parentId':_0x4fd2bf},_0x2c893c));const _0x49de39={'rootFolderId':_0x55f0b5,'folderPathToId':_0x46af59,'folderIdToPath':_0x31a015,'segmentNameToId':_0x287e03,'activationsBySegmentId':_0x5c1e54,'emailToIdMap':_0x1f0df2,'idToEmailMap':_0x531083,'connectionNameToIdMap':_0xa43306[_0x4249f8(0xf0)],'connectionIdToNameMap':_0xa43306[_0x4249f8(0x165)],'connectionNameToTypeMap':_0x42b4a6},_0x1a94db=await executePushSegments(_0x53fd17,_0x29e51d[_0x4249f8(0xfb)]?[]:_0x4af029,_0x49de39,{'parentId':_0x4fd2bf},_0x2c893c),_0x4e1309=_0x1a94db[_0x4249f8(0x11f)],_0xfd4487=_0x1a94db[_0x4249f8(0xef)],_0x5095ce=_0x1a94db[_0x4249f8(0x13d)]['created'],_0x5896c1=_0x1a94db['activations']['updated'],_0x4c6e72=_0x1a94db['activations'][_0x4249f8(0xe5)],_0x5cc45b=await executePushSegmentDeletions(_0x53fd17,_0x29e51d[_0x4249f8(0xfb)]?[]:_0x648382,_0x2c893c);let _0x36eab3=0x0,_0x3cd094=0x0,_0x315d23=0x0;const _0xaa150a=new Map(_0x287e03);for(const [_0x193721,_0x331651]of _0x1a94db[_0x4249f8(0x148)]){_0xaa150a[_0x4249f8(0x12e)](_0x193721,_0x331651);}if(_0x125f28[_0x4249f8(0x155)]>0x0){const _0x4fda71={..._0x49de39,'segmentNameToId':_0xaa150a,'existingSegments':_0x4b6408,'activationContext':_0x44c6a9},_0x1d8153=await executePushJourneys(_0x53fd17,_0x125f28,_0x4fda71,{'parentId':_0x4fd2bf,'rootFolderId':_0x55f0b5,'verbose':_0x29e51d[_0x4249f8(0x13b)]},_0x2c893c);_0x36eab3=_0x1d8153[_0x4249f8(0x11f)],_0x3cd094=_0x1d8153[_0x4249f8(0xef)];if(_0x2596ca&&_0x1d8153['results'][_0x4249f8(0x155)]===0x1){const _0x3b5dab=_0x1d8153[_0x4249f8(0x145)][0x0];if(_0x3b5dab[_0x4249f8(0x141)]){const _0x269f31=getConsoleNextUrl(_0x29e51d[_0x4249f8(0xd9)],'/app/ps/'+_0x4fd2bf+_0x4249f8(0x133)+_0x3b5dab[_0x4249f8(0x141)]+_0x4249f8(0x10c));console['error']('\x20\x20'+a29_0x3d1326[_0x4249f8(0x10b)](_0x269f31));}}}for(const _0x3b037a of _0x2a954b){console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0xe1)+_0x3b037a[_0x4249f8(0x12a)])),_0x315d23++;}const _0x5627b9=[];if(_0x4e1309>0x0)_0x5627b9[_0x4249f8(0xfc)](_0x4e1309+_0x4249f8(0x106));if(_0xfd4487>0x0)_0x5627b9[_0x4249f8(0xfc)](_0xfd4487+_0x4249f8(0x130));if(_0x5cc45b>0x0)_0x5627b9[_0x4249f8(0xfc)](_0x5cc45b+'\x20deleted');const _0x1ba87e=[];if(_0x36eab3>0x0)_0x1ba87e[_0x4249f8(0xfc)](_0x36eab3+_0x4249f8(0x106));if(_0x3cd094>0x0)_0x1ba87e['push'](_0x3cd094+'\x20updated');if(_0x315d23>0x0)_0x1ba87e[_0x4249f8(0xfc)](_0x315d23+_0x4249f8(0x142));const _0x40ab2a=[];if(_0x5095ce>0x0)_0x40ab2a[_0x4249f8(0xfc)](_0x5095ce+_0x4249f8(0x106));if(_0x5896c1>0x0)_0x40ab2a['push'](_0x5896c1+_0x4249f8(0x130));if(_0x4c6e72>0x0)_0x40ab2a[_0x4249f8(0xfc)](_0x4c6e72+_0x4249f8(0x142));return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x103)](_0x4249f8(0xcf))),_0x5627b9[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)]&&console[_0x4249f8(0x144)]('\x20\x20Segments:\x20'+_0x5627b9[_0x4249f8(0x150)](',\x20')),_0x1ba87e[_0x4249f8(0x155)]>0x0&&console[_0x4249f8(0x144)](_0x4249f8(0xd8)+_0x1ba87e[_0x4249f8(0x150)](',\x20')),_0x40ab2a[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)]&&console[_0x4249f8(0x144)](_0x4249f8(0x127)+_0x40ab2a[_0x4249f8(0x150)](',\x20')),0x0;}}
|
|
1
|
+
const a29_0x1f8ccc=a29_0x5696;(function(_0x79a4a0,_0x3a1fdd){const _0x54d018=a29_0x5696,_0xbbcd25=_0x79a4a0();while(!![]){try{const _0x5e3986=parseInt(_0x54d018(0x1ad))/0x1+-parseInt(_0x54d018(0x176))/0x2*(parseInt(_0x54d018(0x183))/0x3)+-parseInt(_0x54d018(0x14e))/0x4+-parseInt(_0x54d018(0x146))/0x5*(-parseInt(_0x54d018(0x1be))/0x6)+-parseInt(_0x54d018(0x13e))/0x7*(-parseInt(_0x54d018(0x1cc))/0x8)+-parseInt(_0x54d018(0x1c7))/0x9+parseInt(_0x54d018(0x162))/0xa*(parseInt(_0x54d018(0x17a))/0xb);if(_0x5e3986===_0x3a1fdd)break;else _0xbbcd25['push'](_0xbbcd25['shift']());}catch(_0x2459f0){_0xbbcd25['push'](_0xbbcd25['shift']());}}}(a29_0x59a4,0x883d2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a29_0x59a4(){const _0x1b22c7=['8MJEqDs','no_parent','updated','yamlConfig','β\x20All\x20journeys\x20are\x20up\x20to\x20date','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20to\x20create','verbose','\x20\x20Source:\x20','new','folderId','Fetching\x20existing\x20activations...','segment\x20or\x20journey','2531368RhHije','segments','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20delete','getParent','idToName','\x20changes?','3145255kzQuVI','listSegments','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','state','Fetching\x20connections\x20for\x20name\x20resolution...','connection','file','site','467616vjoDsr','isNew','audienceId','activations','attributes','journeyBundleId','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x27...','helpText','push','get','length','\x20\x20\x20\x20','diff','Scoped\x20to\x20folder:\x20','toString','Fetching\x20existing\x20journeys...','Fetching\x20parent\x20segment\x20details...','Site:\x20','\x20\x20Activations:\x20','271790nkMhXY','targetDir','createdSegmentIds','nameToType','listJourneysWithDetailsFromParentSegment','segment:push','.yml','repeat','\x20deleted','blue','toCreate','Changes\x20to:','existingJourney','list','\x20\x20π\x20Segments:','\x20activations]','parentFolder','parentSegment','No\x20','listActivations','2dzWnXq','\x20changed','\x20updated','dryRun','220FUJoYh','\x20created','journeyId','all','segment','journeysOnly','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','paused','journeyBundleName','1702185HxEttH','type','folderPath','/j/da/je','\x20\x20Segments:\x20','buildUserMaps','then','getOutputSchemaWithCache','journeys','yes','green','add','yellow','updatedAt','Push\x20','errorCode','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','description','filePath','New\x20journey:','results','map','set','isScoped','message','Parent\x20segment:\x20','(Journey\x20will\x20be\x20deleted)','\x20to\x20update','error','changed','Error\x20parsing\x20YAML:\x20','listFolders','\x20folders\x20to\x20create','cyan','Preparing\x20journeys...','createdAt','dim','user','delete','deleted','endsWith','/app/ps/','493811Piwrif','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Activations:','\x0aValidation\x20failed:','Fetching\x20existing\x20segments...','\x20unchanged','\x0aβ\x20Push\x20complete','segmentFolderId','created','toUpdate','parent_name','Resolving\x20parent\x20segment\x20\x27','\x20\x20Journeys:\x20','Aborted.','nameToId','join','unchanged','6KEmqNr','toDelete','filter','setPhase','resolveParentId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','name','red','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','7071597wyhArZ','\x20new','journey','Delete\x20journey:','data'];a29_0x59a4=function(){return _0x1b22c7;};return a29_0x59a4();}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x2fe6bf from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a29_0x5696(_0x589b9f,_0x21f363){_0x589b9f=_0x589b9f-0x13a;const _0x59a45d=a29_0x59a4();let _0x56967d=_0x59a45d[_0x589b9f];return _0x56967d;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a29_0x1f8ccc(0x167);[a29_0x1f8ccc(0x194)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x2950c8){const _0x414698=a29_0x1f8ccc,{options:_0x1f5451,args:_0x430ad2,tdx:_0x20ba0d}=_0x2950c8,_0x1ba50a=_0x1f5451,_0x16aadb=await resolveTarget({'arg':_0x430ad2[0x0],'contextParent':_0x1f5451[_0x414698(0x173)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x16aadb))return _0x16aadb[_0x414698(0x192)]===_0x414698(0x1cd)?(console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18f)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x414698(0x154)),console[_0x414698(0x19f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a29_0x2fe6bf[_0x414698(0x1c5)]('Error:\x20'+_0x16aadb['message']+'\x0a')),_0x16aadb['helpText']&&console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1a4)](_0x16aadb[_0x414698(0x156)]))),0x1;if(_0x16aadb['type']===_0x414698(0x1b7))return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x1ae)+_0x16aadb[_0x414698(0x163)]+'\x0a')),console['error'](a29_0x2fe6bf[_0x414698(0x1a4)](_0x414698(0x1c3))),0x1;const _0x5ea2a1=_0x16aadb['parentName'],_0x5dc5f6=_0x16aadb[_0x414698(0x163)],_0x11a00a=_0x16aadb[_0x414698(0x184)]===_0x414698(0x14c)?_0x16aadb[_0x414698(0x195)]:undefined,_0x372446=getScopedDetails(_0x16aadb),_0x2c17f7=_0x372446?.[_0x414698(0x19a)]??![],_0x2e3016=_0x372446?.['scopedFolderPath']??'';if(!existsSync(_0x5dc5f6))return console['error'](a29_0x2fe6bf[_0x414698(0x1c5)]('Error:\x20Directory\x20not\x20found:\x20'+_0x5dc5f6+'\x0a')),console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1a4)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x1ba50a[_0x414698(0x1d3)]&&(console[_0x414698(0x19f)](_0x414698(0x160)+_0x1ba50a[_0x414698(0x14d)]),console[_0x414698(0x19f)](_0x414698(0x19c)+_0x5ea2a1),console[_0x414698(0x19f)]('Source\x20directory:\x20'+_0x5dc5f6),_0x2c17f7&&console['error'](_0x414698(0x15c)+_0x2e3016));const _0x348790=await withSpinner(_0x414698(0x1b8)+_0x5ea2a1+_0x414698(0x155),()=>_0x20ba0d[_0x414698(0x17e)][_0x414698(0x1c2)](_0x5ea2a1),{'verbose':_0x1ba50a['verbose']}),_0x4641ea=_0x348790[_0x414698(0x1cb)],[_0x358ce9,_0x4509ae,_0x514054,_0x52e371,_0x3765a0]=await Promise[_0x414698(0x17d)]([withSpinner(_0x414698(0x15f),()=>_0x20ba0d[_0x414698(0x17e)][_0x414698(0x143)](_0x4641ea),{'verbose':_0x1ba50a[_0x414698(0x1d3)]}),withSpinner(_0x414698(0x1b1),()=>_0x20ba0d[_0x414698(0x17e)][_0x414698(0x147)](_0x4641ea),{'verbose':_0x1ba50a[_0x414698(0x1d3)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x20ba0d[_0x414698(0x17e)][_0x414698(0x1a2)](_0x4641ea),{'verbose':_0x1ba50a[_0x414698(0x1d3)]}),withSpinner(_0x414698(0x15e),()=>_0x20ba0d['journey'][_0x414698(0x166)](_0x4641ea,{'includeAllVersions':!![]}),{'verbose':_0x1ba50a[_0x414698(0x1d3)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x20ba0d['user'][_0x414698(0x188)](),{'verbose':_0x1ba50a['verbose']})[_0x414698(0x189)](_0x180dd1=>_0x180dd1[_0x414698(0x1cb)])]),_0xcca274=_0x358ce9[_0x414698(0x1cb)],_0x273078=extractRootFolderId(_0xcca274),_0xff9bd4=_0x4509ae[_0x414698(0x1cb)],_0x49cf76=_0x514054[_0x414698(0x1cb)],{journeys:_0x12474c,activationStepsById:_0x3f0166}=_0x52e371['data'],_0x368f51=new Map(_0x12474c[_0x414698(0x198)](_0x2023d8=>[_0x2023d8['id'],_0x2023d8])),_0x2559ea=_0x12474c['map'](_0x329e58=>({'id':_0x329e58['id'],'name':_0x329e58[_0x414698(0x152)][_0x414698(0x1c4)],'journeyBundleName':_0x329e58['attributes']['journeyBundleName']||'','journeyBundleId':_0x329e58['attributes'][_0x414698(0x153)]||'','versionNumber':_0x329e58[_0x414698(0x152)]['versionNumber'],'description':_0x329e58[_0x414698(0x152)][_0x414698(0x194)],'state':_0x329e58[_0x414698(0x152)][_0x414698(0x149)],'paused':_0x329e58['attributes'][_0x414698(0x181)],'audienceId':_0x329e58[_0x414698(0x152)][_0x414698(0x150)],'folderId':_0x329e58['relationships']?.[_0x414698(0x172)]?.['data']?.['id'],'createdAt':_0x329e58['attributes'][_0x414698(0x1a6)],'updatedAt':_0x329e58['attributes'][_0x414698(0x190)]})),{emailToId:_0x1cd4c1,idToEmail:_0x51dd35}=_0x3765a0,_0x18c1a6=await withSpinner(_0x414698(0x14a),async()=>{const _0x4278fc=_0x414698,_0x2333a9=await _0x20ba0d[_0x4278fc(0x14b)][_0x4278fc(0x16f)]();return buildConnectionMaps(_0x2333a9);},{'verbose':_0x1ba50a[_0x414698(0x1d3)]})[_0x414698(0x189)](_0x2fde04=>_0x2fde04[_0x414698(0x1cb)]),_0x1f3280=_0x18c1a6['nameToId'],_0x59b7b2=_0x18c1a6['idToName'],_0x1638de=_0x18c1a6[_0x414698(0x165)],_0x364106={'emailToIdMap':_0x1cd4c1,'connectionNameToIdMap':_0x1f3280,'connectionNameToTypeMap':_0x1638de,'getSchema':_0x3a5e64=>_0x20ba0d[_0x414698(0x14b)][_0x414698(0x18a)](_0x3a5e64)};let {pathToId:_0x187631,idToPath:_0x2b8de2}=buildFolderMaps(_0x49cf76);const _0x22217e=buildSegmentLookupMap(_0xff9bd4,_0x2b8de2),_0x27fad2=buildSegmentNameToIdMap(_0xff9bd4),_0x58ff1e=buildJourneyBundleLookupMap(_0x2559ea,_0x2b8de2);let _0xf85777;if(_0x11a00a){if(!_0x11a00a[_0x414698(0x1ab)](_0x414698(0x168))&&!_0x11a00a[_0x414698(0x1ab)]('.yaml'))return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x140)+_0x11a00a+'\x0a')),0x1;_0xf85777=[_0x11a00a];}else _0xf85777=findYamlFiles(_0x5dc5f6);if(_0xf85777['length']===0x0)return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x180)+_0x5dc5f6+'\x0a')),console['error'](a29_0x2fe6bf['cyan'](_0x414698(0x141))),0x1;let _0x99a3f,_0x2c0786;try{const _0x393e29=parseAndClassifyYamlFiles(_0xf85777,_0x5dc5f6,{'skipSegments':_0x1ba50a['journeysOnly']});_0x99a3f=_0x393e29['segments'],_0x2c0786=_0x393e29[_0x414698(0x18b)];const _0x59d5b9=validateParsedFiles(_0x393e29,_0x5dc5f6);if(_0x59d5b9[_0x414698(0x159)]>0x0)return console[_0x414698(0x19f)](a29_0x2fe6bf['red'](_0x414698(0x1b0))),console[_0x414698(0x19f)](formatValidationErrors(_0x59d5b9)),console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18f)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1e65e6){return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x1a1)+(_0x1e65e6 instanceof Error?_0x1e65e6[_0x414698(0x19b)]:_0x1e65e6))),0x1;}if(_0x99a3f[_0x414698(0x159)]===0x0&&_0x2c0786[_0x414698(0x159)]===0x0){const _0x5b22d8=_0x1ba50a[_0x414698(0x17f)]?_0x414698(0x1c9):_0x414698(0x13d);return console['error'](a29_0x2fe6bf['yellow'](_0x414698(0x174)+_0x5b22d8+'\x20YAML\x20files\x20found')),0x0;}const _0x36621c=new Map();_0xff9bd4['length']>0x0&&!_0x1ba50a[_0x414698(0x17f)]&&await withSpinner(_0x414698(0x13c),async()=>{await batchAsync(_0xff9bd4,async _0x2f0112=>{const _0x7bc07f=a29_0x5696,_0x270da3=await _0x20ba0d[_0x7bc07f(0x17e)][_0x7bc07f(0x175)](_0x4641ea,_0x2f0112['id']);_0x36621c['set'](_0x2f0112['id'],_0x270da3);});},{'verbose':_0x1ba50a[_0x414698(0x1d3)]});const {segmentFiles:_0x4390d1,foldersToCreate:_0x327ede}=await prepareSegmentFiles(_0x99a3f,{'segmentByFolderAndName':_0x22217e,'activationsBySegmentId':_0x36621c,'folderPathToId':_0x187631,'idToEmailMap':_0x51dd35,'connectionIdToNameMap':_0x59b7b2},_0x364106,_0x2c17f7,_0x2e3016),_0x27b9b7=_0x11a00a?[]:findSegmentsToDelete(_0xff9bd4,_0x99a3f['map'](({yamlConfig:_0x2398c6,folderPath:_0x4aae3c})=>({'yamlConfig':_0x2398c6,'folderPath':resolveTDFolderPath(_0x4aae3c,_0x2c17f7,_0x2e3016)})),_0x2b8de2,_0x2e3016,_0x2c17f7),{journeyFiles:_0x4fa044,foldersToCreate:_0x387122}=await withProgressSpinner(_0x414698(0x1a5),async _0x9b8ec2=>prepareJourneyFiles(_0x2c0786,{'fetchJourney':async _0x4f15ec=>_0x20ba0d['journey']['getJourney'](_0x4f15ec[_0x414698(0x17c)]),'journeyBundlesByFolderAndName':_0x58ff1e,'folderPathToId':_0x187631,'idToEmailMap':_0x51dd35,'connectionIdToNameMap':_0x59b7b2,'existingSegments':_0xff9bd4,'parentId':_0x4641ea,'deps':_0x20ba0d,'progress':{'update':_0x5155ed=>{const _0x321c4d=_0x414698;_0x9b8ec2[_0x321c4d(0x1c1)](_0x5155ed),_0x1ba50a['verbose']&&console['error']('\x20\x20'+_0x5155ed);}},'journeyById':_0x368f51,'activationStepsById':_0x3f0166},_0x2c17f7,_0x2e3016),{'verbose':_0x1ba50a[_0x414698(0x1d3)]})[_0x414698(0x189)](_0x3e0ac5=>_0x3e0ac5['data']);for(const _0x2f9520 of _0x387122){_0x327ede[_0x414698(0x18e)](_0x2f9520);}const _0x2763e6=_0x11a00a?[]:findJourneysToDelete(_0x2559ea,_0x2c0786[_0x414698(0x198)](({yamlConfig:_0x2c9c74,folderPath:_0x5b2865})=>({'yamlConfig':_0x2c9c74,'folderPath':resolveTDFolderPath(_0x5b2865,_0x2c17f7,_0x2e3016)})),_0x2b8de2,_0x2e3016,_0x2c17f7),_0x57459f=calculatePushStats(_0x4390d1,_0x4fa044,_0x327ede,_0x27b9b7,_0x2763e6,!!_0x1ba50a[_0x414698(0x1a9)],!!_0x1ba50a[_0x414698(0x17f)]),_0x364118=_0x57459f[_0x414698(0x13f)][_0x414698(0x13a)],_0x11a125=_0x57459f[_0x414698(0x13f)]['changed'],_0x4f82d9=_0x57459f['segments'][_0x414698(0x1bd)],_0x53d1df=_0x57459f[_0x414698(0x13f)][_0x414698(0x1bf)],_0x3c0501=_0x57459f['folders'][_0x414698(0x16c)],_0x480ff9=_0x57459f[_0x414698(0x18b)][_0x414698(0x13a)],_0x16a26f=_0x57459f['journeys'][_0x414698(0x1a0)],_0x2697f8=_0x57459f[_0x414698(0x18b)]['unchanged'],_0xfc142a=_0x57459f['journeys'][_0x414698(0x1bf)],_0xebb201=_0x57459f[_0x414698(0x151)][_0x414698(0x17d)],_0x50656e=_0x57459f['activations'][_0x414698(0x16c)],_0x51a00f=_0x57459f['activations'][_0x414698(0x1b6)],_0x3ad0f2=_0x57459f['activations'][_0x414698(0x1bf)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x5ea2a1+'\x27:');_0x3c0501[_0x414698(0x159)]>0x0&&console[_0x414698(0x19f)]('\x20\x20'+a29_0x2fe6bf[_0x414698(0x16b)]('π\x20'+_0x3c0501['length']+_0x414698(0x1a3)));if(!_0x1ba50a['journeysOnly']){console['error'](_0x414698(0x170)),console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf[_0x414698(0x18d)]('+\x20'+_0x364118['length']+_0x414698(0x1c8))),console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf['yellow']('~\x20'+_0x11a125[_0x414698(0x159)]+_0x414698(0x177)));if(_0x53d1df[_0x414698(0x159)]>0x0)console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x1c5)]('-\x20'+_0x53d1df['length']+_0x414698(0x142)));else _0x27b9b7[_0x414698(0x159)]>0x0&&!_0x1ba50a[_0x414698(0x1a9)]&&console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x1a7)](_0x27b9b7[_0x414698(0x159)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x1a7)]('=\x20'+_0x4f82d9[_0x414698(0x159)]+_0x414698(0x1b2)));}if(_0x4fa044[_0x414698(0x159)]>0x0||_0x2763e6[_0x414698(0x159)]>0x0){console[_0x414698(0x19f)]('\x20\x20πΊοΈ\x20\x20Journeys:'),console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf['green']('+\x20'+_0x480ff9[_0x414698(0x159)]+_0x414698(0x1c8))),console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x18f)]('~\x20'+_0x16a26f[_0x414698(0x159)]+_0x414698(0x177)));if(_0xfc142a[_0x414698(0x159)]>0x0)console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf[_0x414698(0x1c5)]('-\x20'+_0xfc142a[_0x414698(0x159)]+_0x414698(0x142)));else _0x2763e6[_0x414698(0x159)]>0x0&&!_0x1ba50a['delete']&&console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf[_0x414698(0x1a7)](_0x2763e6['length']+_0x414698(0x1c6)));console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf['dim']('=\x20'+_0x2697f8[_0x414698(0x159)]+_0x414698(0x1b2)));}_0xebb201[_0x414698(0x159)]>0x0&&!_0x1ba50a[_0x414698(0x17f)]&&(console[_0x414698(0x19f)](''),console[_0x414698(0x19f)](_0x414698(0x1af)),_0x50656e['length']>0x0&&console['error'](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x18d)]('+\x20'+_0x50656e[_0x414698(0x159)]+_0x414698(0x1d2))),_0x51a00f['length']>0x0&&console['error'](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x18f)]('~\x20'+_0x51a00f[_0x414698(0x159)]+_0x414698(0x19e))),_0x3ad0f2['length']>0x0&&console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf[_0x414698(0x1c5)]('-\x20'+_0x3ad0f2[_0x414698(0x159)]+_0x414698(0x142))));console['error'](_0x414698(0x1d4)+a29_0x2fe6bf['cyan'](_0x5dc5f6)+'\x0a');if(_0x3c0501[_0x414698(0x159)]>0x0){console[_0x414698(0x19f)]('Folders\x20to\x20create:');for(const _0x708864 of _0x3c0501){console['error']('\x20\x20'+a29_0x2fe6bf['blue']('+')+'\x20'+_0x708864);}console['error']('');}if(_0x364118['length']>0x0&&!_0x1ba50a[_0x414698(0x17f)])for(const _0x34811e of _0x364118){const _0x1ba56e=_0x34811e['folderPath']?_0x34811e[_0x414698(0x185)]+'/'+_0x34811e['yamlConfig'][_0x414698(0x1c4)]:_0x34811e[_0x414698(0x1cf)]['name'],_0x1af8c9=_0x34811e[_0x414698(0x1cf)][_0x414698(0x151)]?.[_0x414698(0x159)]||0x0,_0x4b7457=_0x1af8c9>0x0?a29_0x2fe6bf[_0x414698(0x1a7)]('\x20['+_0x1af8c9+_0x414698(0x171)):'';console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf[_0x414698(0x18d)]('New\x20segment:')+'\x20'+_0x1ba56e+_0x4b7457),console[_0x414698(0x19f)]('β'[_0x414698(0x169)](0x3c)),_0x34811e[_0x414698(0x15b)]&&console['error'](_0x34811e[_0x414698(0x15b)]),console[_0x414698(0x19f)]('β'['repeat'](0x3c));}if(_0x53d1df[_0x414698(0x159)]>0x0&&!_0x1ba50a['journeysOnly'])for(const _0x4c6e39 of _0x53d1df){const _0x293a05=_0x4c6e39['segmentFolderId']?_0x2b8de2[_0x414698(0x158)](_0x4c6e39[_0x414698(0x1b4)][_0x414698(0x15d)]())||'':'',_0x3a2e37=_0x293a05?_0x293a05+'/'+_0x4c6e39[_0x414698(0x1c4)]:_0x4c6e39[_0x414698(0x1c4)],_0x9c5774=_0x36621c['get'](_0x4c6e39['id'])||[],_0x5239cf=_0x9c5774[_0x414698(0x159)]>0x0?a29_0x2fe6bf[_0x414698(0x1a7)]('\x20['+_0x9c5774[_0x414698(0x159)]+_0x414698(0x171)):'';console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf['red']('Delete\x20segment:')+'\x20'+_0x3a2e37+_0x5239cf),console[_0x414698(0x19f)]('β'['repeat'](0x3c));const _0x3849e1=segmentWithActivationsToYaml(_0x4c6e39,_0x9c5774,undefined,_0x51dd35,_0x59b7b2),_0x4fa997=segmentToYamlString(_0x3849e1),_0x5b1ee2=generateDiff(_0x4fa997,'');console[_0x414698(0x19f)](formatDiffWithColors(_0x5b1ee2)),console['error']('β'[_0x414698(0x169)](0x3c));}const _0x5b7f65=_0x4390d1[_0x414698(0x1c0)](_0x31dc42=>!_0x31dc42['isNew']&&_0x31dc42['diff']);if(_0x5b7f65[_0x414698(0x159)]>0x0&&!_0x1ba50a['journeysOnly'])for(const _0x1b6876 of _0x5b7f65){const _0x2f959c=_0x1b6876[_0x414698(0x185)]?_0x1b6876[_0x414698(0x185)]+'/'+_0x1b6876[_0x414698(0x1cf)][_0x414698(0x1c4)]:_0x1b6876['yamlConfig'][_0x414698(0x1c4)];console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf[_0x414698(0x18f)](_0x414698(0x16d))+'\x20'+_0x2f959c),console[_0x414698(0x19f)]('β'[_0x414698(0x169)](0x3c)),console[_0x414698(0x19f)](_0x1b6876[_0x414698(0x15b)]),console[_0x414698(0x19f)]('β'[_0x414698(0x169)](0x3c));}if(_0x480ff9[_0x414698(0x159)]>0x0)for(const _0x37bd38 of _0x480ff9){const _0x3f00eb=_0x37bd38[_0x414698(0x185)]?_0x37bd38[_0x414698(0x185)]+'/'+_0x37bd38[_0x414698(0x1cf)][_0x414698(0x1c4)]:_0x37bd38[_0x414698(0x1cf)][_0x414698(0x1c4)];console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf[_0x414698(0x18d)](_0x414698(0x196))+'\x20'+_0x3f00eb),console[_0x414698(0x19f)]('β'[_0x414698(0x169)](0x3c)),_0x37bd38[_0x414698(0x15b)]&&console[_0x414698(0x19f)](_0x37bd38[_0x414698(0x15b)]),console[_0x414698(0x19f)]('β'[_0x414698(0x169)](0x3c));}const _0x27d569=_0x4fa044[_0x414698(0x1c0)](_0x121da8=>!_0x121da8[_0x414698(0x14f)]&&_0x121da8['diff']);if(_0x27d569[_0x414698(0x159)]>0x0)for(const _0x19b4e9 of _0x27d569){const _0x3cfeb8=_0x19b4e9[_0x414698(0x185)]?_0x19b4e9[_0x414698(0x185)]+'/'+_0x19b4e9['yamlConfig'][_0x414698(0x1c4)]:_0x19b4e9[_0x414698(0x1cf)][_0x414698(0x1c4)];console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf[_0x414698(0x18f)]('Changes\x20to\x20journey:')+'\x20'+_0x3cfeb8),console[_0x414698(0x19f)]('β'[_0x414698(0x169)](0x3c)),console[_0x414698(0x19f)](_0x19b4e9[_0x414698(0x15b)]),console[_0x414698(0x19f)]('β'['repeat'](0x3c));}if(_0xfc142a['length']>0x0)for(const _0x3b8db0 of _0xfc142a){const _0x496bd7=_0x3b8db0[_0x414698(0x13b)]?_0x2b8de2[_0x414698(0x158)](_0x3b8db0[_0x414698(0x13b)])||'':'',_0xeb31ac=_0x496bd7?_0x496bd7+'/'+_0x3b8db0[_0x414698(0x182)]:_0x3b8db0['journeyBundleName'];console['error']('\x0a'+a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x1ca))+'\x20'+_0xeb31ac),console[_0x414698(0x19f)]('β'['repeat'](0x3c)),console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x19d))),console['error']('β'[_0x414698(0x169)](0x3c));}if(_0x1ba50a[_0x414698(0x179)])return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18f)](_0x414698(0x148))),0x0;const _0x1525e3=_0x1ba50a[_0x414698(0x17f)]?![]:_0x364118[_0x414698(0x159)]>0x0||_0x11a125['length']>0x0||_0x53d1df[_0x414698(0x159)]>0x0,_0x535e12=_0x480ff9[_0x414698(0x159)]>0x0||_0x16a26f[_0x414698(0x159)]>0x0||_0xfc142a[_0x414698(0x159)]>0x0,_0x508a11=_0x1ba50a[_0x414698(0x17f)]?![]:_0xebb201[_0x414698(0x159)]>0x0,_0x278fd1=_0x3c0501['length']>0x0;if(!_0x1525e3&&!_0x535e12&&!_0x508a11&&!_0x278fd1){const _0x863e30=_0x1ba50a[_0x414698(0x17f)]?_0x414698(0x1d0):_0x414698(0x193);console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18d)](_0x863e30));if(_0x11a00a&&_0x2697f8[_0x414698(0x159)]===0x1){const _0xe75426=_0x2697f8[0x0];if(_0xe75426['existingJourney']?.['id']){const _0xb23463=getConsoleNextUrl(_0x1ba50a['site'],_0x414698(0x1ac)+_0x4641ea+'/e/'+_0xe75426[_0x414698(0x16e)]['id']+_0x414698(0x186));console[_0x414698(0x19f)]('\x20\x20'+a29_0x2fe6bf['cyan'](_0xb23463));}}return 0x0;}const _0x5598df=_0x1ba50a[_0x414698(0x17f)]?_0x480ff9[_0x414698(0x159)]+_0x16a26f[_0x414698(0x159)]+_0xfc142a[_0x414698(0x159)]+_0x3c0501[_0x414698(0x159)]:_0x364118[_0x414698(0x159)]+_0x11a125[_0x414698(0x159)]+_0x53d1df['length']+_0x480ff9[_0x414698(0x159)]+_0x16a26f[_0x414698(0x159)]+_0xfc142a['length']+_0x3c0501[_0x414698(0x159)]+_0xebb201[_0x414698(0x159)];if(!_0x1ba50a[_0x414698(0x18c)]&&_0x5598df>0x0){const _0x29475b=await confirmKey(_0x414698(0x191)+_0x5598df+_0x414698(0x145));if(!_0x29475b)return console[_0x414698(0x19f)](_0x414698(0x1ba)),0x1;}const _0x572b1c={'withProgress':async(_0x279af7,_0x5d89b3)=>{const _0x51fb7d=_0x414698,_0x28ce1a=await withSpinner(_0x279af7,_0x5d89b3,{'verbose':_0x1ba50a['verbose']});return{'data':_0x28ce1a[_0x51fb7d(0x1cb)]};},'logInfo':_0x4e6d31=>console['error'](a29_0x2fe6bf[_0x414698(0x16b)]('β\x20'+_0x4e6d31)),'logSuccess':_0x1417a9=>console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18d)]('β\x20'+_0x1417a9)),'logWarning':_0x521b42=>console[_0x414698(0x19f)](a29_0x2fe6bf['yellow']('β \x20'+_0x521b42)),'logDeleted':_0x2a0e47=>console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)]('β\x20'+_0x2a0e47))},_0x2d589a={'segment':_0x20ba0d[_0x414698(0x17e)],'journey':_0x20ba0d[_0x414698(0x1c9)],'user':_0x20ba0d[_0x414698(0x1a8)],'connection':_0x20ba0d['connection']};_0x3c0501[_0x414698(0x159)]>0x0&&(_0x187631=await executePushFolders(_0x2d589a,_0x3c0501,_0x187631,{'parentId':_0x4641ea},_0x572b1c));const _0x1960c5={'rootFolderId':_0x273078,'folderPathToId':_0x187631,'folderIdToPath':_0x2b8de2,'segmentNameToId':_0x27fad2,'activationsBySegmentId':_0x36621c,'emailToIdMap':_0x1cd4c1,'idToEmailMap':_0x51dd35,'connectionNameToIdMap':_0x18c1a6[_0x414698(0x1bb)],'connectionIdToNameMap':_0x18c1a6[_0x414698(0x144)],'connectionNameToTypeMap':_0x1638de},_0x39e8b1=await executePushSegments(_0x2d589a,_0x1ba50a[_0x414698(0x17f)]?[]:_0x4390d1,_0x1960c5,{'parentId':_0x4641ea},_0x572b1c),_0x179de5=_0x39e8b1['created'],_0x17db5d=_0x39e8b1[_0x414698(0x1ce)],_0xfb8fdc=_0x39e8b1[_0x414698(0x151)][_0x414698(0x1b5)],_0x30a578=_0x39e8b1[_0x414698(0x151)][_0x414698(0x1ce)],_0x48940c=_0x39e8b1[_0x414698(0x151)][_0x414698(0x1aa)],_0x509aed=await executePushSegmentDeletions(_0x2d589a,_0x1ba50a[_0x414698(0x17f)]?[]:_0x53d1df,_0x572b1c);let _0xd7a393=0x0,_0x2ac205=0x0,_0x21d0f7=0x0;const _0x161e90=new Map(_0x27fad2);for(const [_0x3a9882,_0x3fc7c0]of _0x39e8b1[_0x414698(0x164)]){_0x161e90[_0x414698(0x199)](_0x3a9882,_0x3fc7c0);}if(_0x4fa044[_0x414698(0x159)]>0x0){const _0x57a780={..._0x1960c5,'segmentNameToId':_0x161e90,'existingSegments':_0xff9bd4,'activationContext':_0x364106},_0xcac1c1=await executePushJourneys(_0x2d589a,_0x4fa044,_0x57a780,{'parentId':_0x4641ea,'rootFolderId':_0x273078,'verbose':_0x1ba50a[_0x414698(0x1d3)]},_0x572b1c);_0xd7a393=_0xcac1c1[_0x414698(0x1b5)],_0x2ac205=_0xcac1c1[_0x414698(0x1ce)];if(_0x11a00a&&_0xcac1c1[_0x414698(0x197)]['length']===0x1){const _0x4ef8d0=_0xcac1c1[_0x414698(0x197)][0x0];if(_0x4ef8d0[_0x414698(0x17c)]){const _0x462967=getConsoleNextUrl(_0x1ba50a[_0x414698(0x14d)],_0x414698(0x1ac)+_0x4641ea+'/e/'+_0x4ef8d0['journeyId']+_0x414698(0x186));console['error']('\x20\x20'+a29_0x2fe6bf['cyan'](_0x462967));}}}for(const _0x3368b4 of _0xfc142a){console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18f)](_0x414698(0x1d1)+_0x3368b4[_0x414698(0x182)])),_0x21d0f7++;}const _0x33fbb8=[];if(_0x179de5>0x0)_0x33fbb8[_0x414698(0x157)](_0x179de5+_0x414698(0x17b));if(_0x17db5d>0x0)_0x33fbb8[_0x414698(0x157)](_0x17db5d+_0x414698(0x178));if(_0x509aed>0x0)_0x33fbb8[_0x414698(0x157)](_0x509aed+_0x414698(0x16a));const _0x555d81=[];if(_0xd7a393>0x0)_0x555d81[_0x414698(0x157)](_0xd7a393+_0x414698(0x17b));if(_0x2ac205>0x0)_0x555d81[_0x414698(0x157)](_0x2ac205+_0x414698(0x178));if(_0x21d0f7>0x0)_0x555d81[_0x414698(0x157)](_0x21d0f7+_0x414698(0x16a));const _0xbb9318=[];if(_0xfb8fdc>0x0)_0xbb9318[_0x414698(0x157)](_0xfb8fdc+_0x414698(0x17b));if(_0x30a578>0x0)_0xbb9318[_0x414698(0x157)](_0x30a578+_0x414698(0x178));if(_0x48940c>0x0)_0xbb9318[_0x414698(0x157)](_0x48940c+'\x20deleted');return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18d)](_0x414698(0x1b3))),_0x33fbb8['length']>0x0&&!_0x1ba50a[_0x414698(0x17f)]&&console[_0x414698(0x19f)](_0x414698(0x187)+_0x33fbb8['join'](',\x20')),_0x555d81[_0x414698(0x159)]>0x0&&console[_0x414698(0x19f)](_0x414698(0x1b9)+_0x555d81[_0x414698(0x1bc)](',\x20')),_0xbb9318[_0x414698(0x159)]>0x0&&!_0x1ba50a[_0x414698(0x17f)]&&console[_0x414698(0x19f)](_0x414698(0x161)+_0xbb9318[_0x414698(0x1bc)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x23e37c=a30_0x1b3c;(function(_0x22f78f,_0x1ad4ed){const _0x18d132=a30_0x1b3c,_0x5d949b=_0x22f78f();while(!![]){try{const _0x22be40=parseInt(_0x18d132(0xa1))/0x1*(-parseInt(_0x18d132(0xa8))/0x2)+parseInt(_0x18d132(0xb8))/0x3*(-parseInt(_0x18d132(0xac))/0x4)+-parseInt(_0x18d132(0xad))/0x5+parseInt(_0x18d132(0x9a))/0x6*(parseInt(_0x18d132(0xaa))/0x7)+parseInt(_0x18d132(0x96))/0x8*(-parseInt(_0x18d132(0xb3))/0x9)+parseInt(_0x18d132(0x9e))/0xa+parseInt(_0x18d132(0xa0))/0xb*(parseInt(_0x18d132(0xa9))/0xc);if(_0x22be40===_0x1ad4ed)break;else _0x5d949b['push'](_0x5d949b['shift']());}catch(_0xba1fe6){_0x5d949b['push'](_0x5d949b['shift']());}}}(a30_0x5574,0xdc4a5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a30_0x5574(){const _0x534384=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segment','Segment\x20ID:\x20','resolvePathToResource','Error:\x20Cannot\x20update\x20','description','verbose','segmentPath','Resolving\x20path\x20\x27','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','type','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','16OaHRqP','Resolved\x20relative\x20path\x20to:\x20','segmentName','ruleFile','7075254iqqTJO','execute','Parent\x20ID:\x20','name','12879810FfljMd','β\x20Updated\x20segment\x20\x27','2332dFdKay','1283479jFtrnO','yellow','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:update','Resolved\x20type:\x20','data','2QhymTc','113808CinUpd','7UfCVhB','INTERNAL','264wXDuJf','775540EZtdRe','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','segmentId','rule','Update\x20existing\x20child\x20segment','3938013DhKaRx','\x27...','updateSegmentById','error','length','57354tPcVyJ'];a30_0x5574=function(){return _0x534384;};return a30_0x5574();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a30_0x1b3c(_0x3caa43,_0xb0ad03){_0x3caa43=_0x3caa43-0x96;const _0x5574bf=a30_0x5574();let _0x1b3c11=_0x5574bf[_0x3caa43];return _0x1b3c11;}import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x295ca7 from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a30_0x23e37c(0xa5);[a30_0x23e37c(0xbe)]=a30_0x23e37c(0xb2);async[a30_0x23e37c(0x9b)](_0x518531){const _0x234d79=a30_0x23e37c;console['error'](a30_0x295ca7[_0x234d79(0xa2)]('β \x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x234d79(0xb6)](a30_0x295ca7[_0x234d79(0xa2)](_0x234d79(0xc4)));const {options:_0x37e474,args:_0x5d5240,tdx:_0x3797ee}=_0x518531,_0x88ec51=_0x37e474;if(_0x5d5240[_0x234d79(0xb7)]===0x0)return console[_0x234d79(0xb6)](_0x234d79(0xa4)),console['error']('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x234d79(0xb6)]('Examples:'),console['error'](_0x234d79(0xa3)),console['error'](_0x234d79(0xb9)),0x1;const _0x355d78=_0x5d5240[0x0],_0x1c4b73=_0x37e474[_0x234d79(0xc0)];let _0x2ac186=_0x355d78;_0x1c4b73&&!_0x355d78['includes']('/')&&(_0x2ac186=_0x1c4b73+'/'+_0x355d78,_0x88ec51[_0x234d79(0xbf)]&&console['error'](_0x234d79(0x97)+_0x2ac186));const _0x58ad00=await withSpinner(_0x234d79(0xc1)+_0x2ac186+_0x234d79(0xb4),()=>_0x3797ee[_0x234d79(0xba)][_0x234d79(0xbc)](_0x2ac186),{'verbose':_0x88ec51[_0x234d79(0xbf)]}),_0x3bc3e7=_0x58ad00[_0x234d79(0xa7)];_0x88ec51[_0x234d79(0xbf)]&&console[_0x234d79(0xb6)](_0x234d79(0xa6)+_0x3bc3e7[_0x234d79(0xc3)]);if(_0x3bc3e7[_0x234d79(0xc3)]!==_0x234d79(0xba))return console['error'](_0x234d79(0xbd)+_0x3bc3e7[_0x234d79(0xc3)]+_0x234d79(0xc2)),console[_0x234d79(0xb6)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3bc3e7[_0x234d79(0xb0)])throw new SDKError(ErrorCode[_0x234d79(0xab)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3ff767=_0x3bc3e7['parentId'],_0x555753=_0x3bc3e7['segmentId'];_0x88ec51[_0x234d79(0xbf)]&&(console[_0x234d79(0xb6)](_0x234d79(0x9c)+_0x3ff767),console['error'](_0x234d79(0xbb)+_0x555753));let _0x3c26e3;if(_0x88ec51['folder']){const _0x517217=_0x88ec51['folder'],_0x335fa6=await withSpinner(_0x234d79(0xaf)+_0x517217+_0x234d79(0xb4),()=>_0x3797ee[_0x234d79(0xba)]['resolveFolderId'](_0x3ff767,_0x517217),{'verbose':_0x88ec51[_0x234d79(0xbf)]});_0x3c26e3=parseInt(_0x335fa6[_0x234d79(0xa7)],0xa),_0x88ec51[_0x234d79(0xbf)]&&console[_0x234d79(0xb6)]('Resolved\x20folder\x20ID:\x20'+_0x3c26e3);}const _0x564a40=await loadJSONFromOptions(_0x88ec51[_0x234d79(0xb1)],_0x88ec51[_0x234d79(0x99)]),_0x21c294={'name':_0x88ec51[_0x234d79(0x9d)],'description':_0x88ec51[_0x234d79(0xbe)],'rule':_0x564a40,'kind':_0x88ec51['kind']!==undefined?parseInt(_0x88ec51['kind'],0xa):undefined,'segmentFolderId':_0x3c26e3},_0x5d4d2b=await withSpinner('Updating\x20segment\x20\x27'+_0x3bc3e7[_0x234d79(0x98)]+'\x27...',()=>_0x3797ee[_0x234d79(0xba)][_0x234d79(0xb5)](_0x3ff767,_0x555753,_0x21c294),{'verbose':_0x88ec51[_0x234d79(0xbf)]}),_0x464806=_0x5d4d2b['data'];return console['error'](_0x234d79(0x9f)+_0x464806['name']+'\x27'),_0x2ac186!==_0x355d78&&console[_0x234d79(0xb6)](_0x234d79(0xae)+_0x2ac186),await handleSDKOutput([_0x464806],_0x88ec51),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x137062=a31_0x2976;(function(_0x1a9715,_0x40fab1){const _0x430c35=a31_0x2976,_0xc818d5=_0x1a9715();while(!![]){try{const _0x54bff=parseInt(_0x430c35(0x158))/0x1+-parseInt(_0x430c35(0x146))/0x2+-parseInt(_0x430c35(0x140))/0x3+parseInt(_0x430c35(0x15e))/0x4+parseInt(_0x430c35(0x16a))/0x5+-parseInt(_0x430c35(0x159))/0x6+parseInt(_0x430c35(0x164))/0x7;if(_0x54bff===_0x40fab1)break;else _0xc818d5['push'](_0xc818d5['shift']());}catch(_0x1dcdaf){_0xc818d5['push'](_0xc818d5['shift']());}}}(a31_0x47fd,0x8f41d));import{existsSync,statSync}from'fs';function a31_0x47fd(){const _0x205f98=['Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segments','data','description','13542074ThHvrO','execute','config','Resolved\x20path\x20type:\x20','site','β\x20Context\x20cleared.\x20Back\x20to\x20root.','2268485vXUHyd','session','log','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','slice','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','2912490LVuBOl','cyan','green','parentName','fullPath','Resolving\x20path\x20\x27','1415164GkrcMG','folderId','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Parent\x20ID:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','resolvePathToResource','Examples:','segment','Site:\x20','folderPath','join','error','red','type','verbose','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','895559HMrRki','6459804QyQCMx','isAbsolute','β\x20Context\x20set\x20to:\x20','dim','length','231956jVSqNL','Folder\x20ID:\x20'];a31_0x47fd=function(){return _0x205f98;};return a31_0x47fd();}import a31_0x53a4aa from'chalk';function a31_0x2976(_0x2a2f41,_0xb29a6a){_0x2a2f41=_0x2a2f41-0x13f;const _0x47fd3d=a31_0x47fd();let _0x29764a=_0x47fd3d[_0x2a2f41];return _0x29764a;}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a31_0x137062(0x148);[a31_0x137062(0x163)]=a31_0x137062(0x14b);async[a31_0x137062(0x165)](_0x35d74a){const _0x2ffe9c=a31_0x137062,{options:_0x358fc3,args:_0x40fbf7,tdx:_0x40f0b1}=_0x35d74a;if(_0x40fbf7[_0x2ffe9c(0x15d)]===0x0)return console[_0x2ffe9c(0x152)](a31_0x53a4aa[_0x2ffe9c(0x153)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x2ffe9c(0x152)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x2ffe9c(0x152)](_0x2ffe9c(0x14d)),console[_0x2ffe9c(0x152)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x2ffe9c(0x152)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x2ffe9c(0x152)](_0x2ffe9c(0x156)),console[_0x2ffe9c(0x152)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x7d3935=_0x40fbf7[0x0],_0x4f6d40=_0x358fc3[_0x2ffe9c(0x16b)];try{if(_0x7d3935==='/')return saveSessionContext({'segment_path':undefined},_0x4f6d40),console[_0x2ffe9c(0x16c)](a31_0x53a4aa[_0x2ffe9c(0x142)]('β\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x7d3935)&&statSync(_0x7d3935)['isDirectory']()){let _0x1a02bc;try{_0x1a02bc=findTdxConfig(_0x7d3935);}catch{return console[_0x2ffe9c(0x152)](a31_0x53a4aa[_0x2ffe9c(0x153)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x7d3935)),console[_0x2ffe9c(0x152)](a31_0x53a4aa[_0x2ffe9c(0x141)](_0x2ffe9c(0x16d))),0x1;}const _0x102a05=_0x1a02bc[_0x2ffe9c(0x166)]['parent_segment'];return saveSessionContext({'segment_path':_0x102a05,'parent_segment':_0x102a05},_0x4f6d40),console['log'](a31_0x53a4aa[_0x2ffe9c(0x142)]('β\x20Context\x20set\x20to:\x20'+a31_0x53a4aa[_0x2ffe9c(0x141)](_0x102a05))),0x0;}const _0x5708dc=_0x358fc3['segmentPath'];let _0x5c293d=_0x7d3935;const _0x283fd6=parsePath(_0x7d3935);if(!_0x283fd6[_0x2ffe9c(0x15a)]){if(!_0x5708dc)return console['error'](a31_0x53a4aa['red'](_0x2ffe9c(0x13f))),console[_0x2ffe9c(0x152)](a31_0x53a4aa[_0x2ffe9c(0x141)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x7d3935==='..'){const _0x17ef32=_0x5708dc['split']('/')[_0x2ffe9c(0x16e)](0x0,-0x1)[_0x2ffe9c(0x151)]('/');_0x5c293d=_0x17ef32||'/';}else _0x7d3935==='.'?_0x5c293d=_0x5708dc:_0x5c293d=_0x5708dc+'/'+_0x7d3935;_0x358fc3[_0x2ffe9c(0x155)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x5c293d);}if(_0x5c293d==='/'||_0x5c293d==='')return saveSessionContext({'segment_path':undefined},_0x4f6d40),console['log'](a31_0x53a4aa[_0x2ffe9c(0x142)](_0x2ffe9c(0x169))),0x0;_0x5c293d=normalizePath(_0x5c293d);const _0xca539=parsePath(_0x5c293d)[_0x2ffe9c(0x161)];if(_0xca539['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x4f6d40),console[_0x2ffe9c(0x16c)](a31_0x53a4aa['green'](_0x2ffe9c(0x169))),0x0;_0x358fc3[_0x2ffe9c(0x155)]&&(console[_0x2ffe9c(0x152)](_0x2ffe9c(0x14f)+_0x358fc3[_0x2ffe9c(0x168)]),console[_0x2ffe9c(0x152)]('Target\x20path:\x20'+_0x5c293d));const _0x3d88b4=await withSpinner(_0x2ffe9c(0x145)+_0x5c293d+'\x27...',()=>_0x40f0b1[_0x2ffe9c(0x14e)][_0x2ffe9c(0x14c)](_0x5c293d),{'verbose':_0x358fc3[_0x2ffe9c(0x155)]}),_0x3b3030=_0x3d88b4[_0x2ffe9c(0x162)];_0x358fc3['verbose']&&(console[_0x2ffe9c(0x152)](_0x2ffe9c(0x167)+_0x3b3030[_0x2ffe9c(0x154)]),console['error'](_0x2ffe9c(0x14a)+_0x3b3030['parentId']),_0x3b3030[_0x2ffe9c(0x147)]&&console[_0x2ffe9c(0x152)](_0x2ffe9c(0x15f)+_0x3b3030[_0x2ffe9c(0x147)]));if(_0x3b3030[_0x2ffe9c(0x154)]==='segment')return console[_0x2ffe9c(0x152)](a31_0x53a4aa[_0x2ffe9c(0x153)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x2ffe9c(0x152)](_0x2ffe9c(0x160)),console[_0x2ffe9c(0x152)](a31_0x53a4aa[_0x2ffe9c(0x141)]('Use:\x20tdx\x20segment\x20use\x20'+_0x3b3030[_0x2ffe9c(0x143)]+(_0x3b3030['folderPath']?'/'+_0x3b3030[_0x2ffe9c(0x150)][_0x2ffe9c(0x151)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3b3030['fullPath'],'parent_segment':_0x3b3030[_0x2ffe9c(0x143)]},_0x4f6d40),console['log'](a31_0x53a4aa[_0x2ffe9c(0x142)](_0x2ffe9c(0x15b)+a31_0x53a4aa[_0x2ffe9c(0x141)](_0x3b3030[_0x2ffe9c(0x144)]))),_0x358fc3[_0x2ffe9c(0x155)]&&(console[_0x2ffe9c(0x152)](a31_0x53a4aa[_0x2ffe9c(0x15c)](_0x2ffe9c(0x149))),console[_0x2ffe9c(0x152)](a31_0x53a4aa['dim'](_0x2ffe9c(0x157)))),0x0;}catch(_0x327010){throw _0x327010;}}}
|