@treasuredata/tdx 0.14.5 β 0.14.6
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.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +0 -4
- 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.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.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.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.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.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +3 -2
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.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.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.d.ts +21 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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_0x1916b8=a25_0x4534;(function(_0x31d7ef,_0x3c2faa){const _0x30edcf=a25_0x4534,_0x35ea76=_0x31d7ef();while(!![]){try{const _0x54706d=parseInt(_0x30edcf(0x101))/0x1+-parseInt(_0x30edcf(0x77))/0x2*(parseInt(_0x30edcf(0x9a))/0x3)+parseInt(_0x30edcf(0xf5))/0x4*(-parseInt(_0x30edcf(0xc2))/0x5)+parseInt(_0x30edcf(0x78))/0x6*(-parseInt(_0x30edcf(0x73))/0x7)+parseInt(_0x30edcf(0xe4))/0x8*(parseInt(_0x30edcf(0xec))/0x9)+-parseInt(_0x30edcf(0x75))/0xa*(-parseInt(_0x30edcf(0xa6))/0xb)+-parseInt(_0x30edcf(0xac))/0xc*(-parseInt(_0x30edcf(0xbb))/0xd);if(_0x54706d===_0x3c2faa)break;else _0x35ea76['push'](_0x35ea76['shift']());}catch(_0x1f0a53){_0x35ea76['push'](_0x35ea76['shift']());}}}(a25_0x3da2,0xe9466));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';function a25_0x3da2(){const _0x3bcbaa=['web','451644tBLhPO','log','segment:view','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','format','\x27...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','jsonl','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20[Job\x20ID:\x20','Use:\x20tdx\x20ps\x20show','\x20\x20Parent\x20segment:\x20','length','208FHnJpa','Segment\x20ID:\x20','resolveParentId','parentSegment','listFolders','code','Fetching\x20parent\x20segment\x20details...','34535ZyIAcl','limit','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x27\x20with\x20ID:\x20','description','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','site','getSegmentSQL','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Resolving\x20folder\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Target\x20path:\x20','getSegment','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20Opening\x20','setJobId','folder','Resolved\x20relative\x20path\x20to:\x20','parentFolder','Error:\x20Parent\x20segment\x20name\x20is\x20required','cyan','Resolving\x20parent\x20segment\x20\x27','SEGMENT_NOT_FOUND','β\x20Found\x20','Create\x20segment\x20folder\x20for\x20organization','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:show','includes','Resolved\x20type:\x20','segment:folder:list','url','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','2101576CqTrKS','createFolder','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','execute','getFolder','\x20\x20Folder\x20path:\x20','\x20rows\x20','Resolved\x20YAML\x20file:\x20','9yXaZEy','(root)','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20Cause:\x20','Fetching\x20folder\x20details...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Parent\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','692gLiOmv','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','toLocaleString','error','resolvePathToResource','Resolving\x20\x27','/app/ps/','/e/','type','β\x20Query\x20failed\x20[','INVALID_ARGUMENT','fullPath','1762537rLXcYI','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20folder\x20\x27','β\x20Created\x20folder\x20\x27','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','β\x20Query\x20completed:\x20Processed\x20','segment:describe','data','Fetching\x20SQL\x20for\x20segment...','resolveFolderId','segment:folder:create','Resolved\x20parent\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','7xPJDRs','jobId','1224860qSMPsa','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','2bCNZHw','7481688wWLfvV','getParent','Usage:\x20tdx\x20sg\x20show\x20<name>','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','folderId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x20\x20Full\x20path:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','parent','Use:\x20tdx\x20ps\x20view','Resolved\x20parent\x20folder\x20ID:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','cause','SQL\x20query:\x0a','Parent\x20name:\x20','Parent\x20segment:\x20','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20segment\x20details...','\x20\x20Segment\x20name:\x20','Site:\x20','segmentPath','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','segment','Examples:','parentId','Resolving\x20parent\x20folder\x20\x27','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','elapsedTimeMillis','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','query','1364799GWtlhY','Show\x20segment\x20folder\x20details','Resolved\x20folder\x20ID:\x20','verbose','Folder\x20name:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','json','segmentId','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20','segment:desc','110PgPxWl','Use:\x20tdx\x20ps\x20view\x20-w','name','segment:show','Get\x20SQL\x20query\x20for\x20child\x20segment'];a25_0x3da2=function(){return _0x3bcbaa;};return a25_0x3da2();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a25_0x4534(_0x1be596,_0x2eaa46){_0x1be596=_0x1be596-0x67;const _0x3da216=a25_0x3da2();let _0x4534c6=_0x3da216[_0x1be596];return _0x4534c6;}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_0x76439b from'chalk';async function resolveSegmentTarget(_0x2b9f8e,_0x5d9ef9,_0x1b0e52){const _0x2b2c31=a25_0x4534;if(isYamlFilePath(_0x2b9f8e))try{const _0xd879d8=await resolveYamlFilePath(_0x2b9f8e);return _0x1b0e52&&(console[_0x2b2c31(0xf8)](_0x2b2c31(0xeb)+_0x2b9f8e),console[_0x2b2c31(0xf8)](_0x2b2c31(0xb9)+_0xd879d8[_0x2b2c31(0xbe)]),console['error'](_0x2b2c31(0x8c)+_0xd879d8['segmentName']),console[_0x2b2c31(0xf8)](_0x2b2c31(0xe9)+(_0xd879d8['folderPath']||_0x2b2c31(0xed))),console[_0x2b2c31(0xf8)](_0x2b2c31(0x80)+_0xd879d8['fullPath'])),_0xd879d8[_0x2b2c31(0x100)];}catch(_0x25d128){throw new SDKError(ErrorCode[_0x2b2c31(0xff)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x25d128[_0x2b2c31(0x94)]);}if(!_0x5d9ef9)throw new SDKError(ErrorCode[_0x2b2c31(0xff)],_0x2b2c31(0xe3));return _0x5d9ef9+'/'+_0x2b9f8e;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x1916b8(0x6c);['description']=a25_0x1916b8(0x7b);async[a25_0x1916b8(0xe7)](_0xc34875){const _0x28815e=a25_0x1916b8,{options:_0x4575f4,args:_0x1d5ae9,tdx:_0x3f1e82}=_0xc34875,_0x21ee61=_0x1d5ae9[0x0],_0x5b61f6=!_0x21ee61&&!!_0x4575f4[_0x28815e(0xbe)],_0x5116fa=_0x21ee61||_0x4575f4[_0x28815e(0xbe)];if(!_0x5116fa)return console[_0x28815e(0xf8)](_0x28815e(0x102)),console[_0x28815e(0xf8)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x28815e(0xf8)](_0x28815e(0x7e)),console['error'](_0x28815e(0x103)),console[_0x28815e(0xf8)](_0x28815e(0xce)),0x1;try{const _0x1832ff=_0x4575f4[_0x28815e(0x8e)];let _0x182943=_0x5116fa;!_0x5b61f6&&_0x1832ff&&!_0x5116fa[_0x28815e(0xdf)]('/')&&(_0x182943=_0x1832ff+'/'+_0x5116fa,_0x4575f4[_0x28815e(0x9d)]&&console[_0x28815e(0xf8)](_0x28815e(0xd5)+_0x182943));const _0x5aeb5d=await withSpinner('Resolving\x20path\x20\x27'+_0x182943+_0x28815e(0xb2),()=>_0x3f1e82[_0x28815e(0x90)]['resolvePathToResource'](_0x182943),{'verbose':_0x4575f4[_0x28815e(0x9d)]}),_0x332181=_0x5aeb5d['data'];_0x4575f4['verbose']&&(console[_0x28815e(0xf8)](_0x28815e(0xe0)+_0x332181[_0x28815e(0xfd)]),console[_0x28815e(0xf8)](_0x28815e(0xf3)+_0x332181['parentId']),_0x332181[_0x28815e(0x7d)]&&console[_0x28815e(0xf8)]('Folder\x20ID:\x20'+_0x332181[_0x28815e(0x7d)]),_0x332181[_0x28815e(0xa1)]&&console[_0x28815e(0xf8)](_0x28815e(0xbc)+_0x332181[_0x28815e(0xa1)]));if(_0x332181['type']===_0x28815e(0x82)){const _0x21ecd5=await withSpinner(_0x28815e(0xc1),()=>_0x3f1e82['segment'][_0x28815e(0x79)](_0x332181['parentId']),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x21ecd5[_0x28815e(0x6d)],_0x4575f4);}else{if(_0x332181[_0x28815e(0xfd)]===_0x28815e(0xd4)){if(!_0x332181[_0x28815e(0x7d)])throw new SDKError(ErrorCode[_0x28815e(0x8a)],_0x28815e(0xdd));const _0x73226d=await withSpinner(_0x28815e(0xf1),()=>_0x3f1e82[_0x28815e(0x90)][_0x28815e(0xe8)](_0x332181[_0x28815e(0x7d)]),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x73226d[_0x28815e(0x6d)],_0x4575f4);}else{if(_0x332181['type']===_0x28815e(0x90)){if(!_0x332181[_0x28815e(0xa1)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x28815e(0xf4));const _0x93863b=await withSpinner('Fetching\x20segment\x20details...',()=>_0x3f1e82[_0x28815e(0x90)][_0x28815e(0xd0)](_0x332181[_0x28815e(0x92)],_0x332181[_0x28815e(0xa1)]),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x93863b[_0x28815e(0x6d)],_0x4575f4);}}}return 0x0;}catch(_0x2aab77){if(_0x2aab77 instanceof SDKError)return console[_0x28815e(0xf8)](_0x28815e(0xa4)+_0x2aab77[_0x28815e(0x94)]),_0x2aab77[_0x28815e(0x86)]&&console[_0x28815e(0xf8)]('\x20\x20Cause:\x20'+_0x2aab77[_0x28815e(0x86)]),0x1;throw _0x2aab77;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xa9);[a25_0x1916b8(0xc7)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x36ea9e){const _0x27d997=a25_0x1916b8,{options:_0x146ebf,args:_0x1ff14e,tdx:_0x2f56e0}=_0x36ea9e,_0x2628d7=_0x1ff14e[0x0];if(!_0x2628d7)return console['error'](_0x27d997(0x8f)),console[_0x27d997(0xf8)](_0x27d997(0x7a)),console[_0x27d997(0xf8)](_0x27d997(0xf2)),console[_0x27d997(0xf8)](_0x27d997(0x91)),console[_0x27d997(0xf8)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error'](_0x27d997(0x6a)),0x1;try{const _0x60bcac=_0x146ebf[_0x27d997(0xbe)],_0x53b7a0=await resolveSegmentTarget(_0x2628d7,_0x60bcac,_0x146ebf[_0x27d997(0x9d)]);_0x146ebf['verbose']&&console[_0x27d997(0xf8)]('Target\x20path:\x20'+_0x53b7a0);const _0x58e3c9=await withSpinner(_0x27d997(0xfa)+_0x2628d7+_0x27d997(0xb2),()=>_0x2f56e0['segment'][_0x27d997(0xf9)](_0x53b7a0),{'verbose':_0x146ebf[_0x27d997(0x9d)]}),_0x38fb00=_0x58e3c9['data'];_0x146ebf[_0x27d997(0x9d)]&&(console['error'](_0x27d997(0xe0)+_0x38fb00[_0x27d997(0xfd)]),console['error']('Parent\x20ID:\x20'+_0x38fb00[_0x27d997(0x92)]));if(_0x38fb00[_0x27d997(0xfd)]==='folder')return console['error'](_0x27d997(0xaf)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x38fb00['type']===_0x27d997(0x82))return console[_0x27d997(0xf8)](_0x27d997(0xe6)),console[_0x27d997(0xf8)](_0x27d997(0xb8)),0x1;if(!_0x38fb00[_0x27d997(0xa1)])throw new SDKError(ErrorCode[_0x27d997(0xda)],_0x27d997(0xf4));const _0x36a59b=await withSpinner(_0x27d997(0x6e),()=>_0x2f56e0[_0x27d997(0x90)][_0x27d997(0xca)](_0x38fb00[_0x27d997(0x92)],_0x38fb00[_0x27d997(0xa1)]),{'verbose':_0x146ebf[_0x27d997(0x9d)]});let _0x597648=_0x36a59b[_0x27d997(0x6d)];const _0xaf17d6=resolveLimit(_0x146ebf[_0x27d997(0xc3)],DEFAULT_DISPLAY_LIMIT),_0xf7947f=/\bLIMIT\s+\d+/i['test'](_0x597648);!_0xf7947f&&(_0x597648=_0x597648['trim']()['replace'](/;+$/,''),_0x597648='SELECT\x20*\x20FROM\x20(\x0a'+_0x597648+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0xaf17d6);_0x146ebf['verbose']&&console[_0x27d997(0xf8)](_0x27d997(0x87)+_0x597648);const _0x56ad50=await withProgressSpinner('Executing\x20segment\x20query...',async _0x42eb90=>{const _0x46ad8d=_0x27d997,_0x120bc9=await _0x2f56e0[_0x46ad8d(0x99)][_0x46ad8d(0xe7)](_0x597648,{'catalog':'td','schema':'information_schema','onJobId':_0x2ae28c=>{const _0x7f3f4d=_0x46ad8d;_0x42eb90[_0x7f3f4d(0xd3)](_0x2ae28c);}});return _0x120bc9;},{'verbose':_0x146ebf[_0x27d997(0x9d)]}),_0x36d069=_0x56ad50[_0x27d997(0x6d)],_0xddb4ca=_0x36d069[_0x27d997(0x74)]?_0x27d997(0xb7)+_0x36d069['jobId']+']':'';return console[_0x27d997(0xf8)](_0x27d997(0x6b)+_0x36d069['stats']['processedRows'][_0x27d997(0xf7)]()+_0x27d997(0xea)+('in\x20'+formatElapsed(_0x36d069['stats'][_0x27d997(0x96)])+_0xddb4ca)),await handleQueryOutput(_0x36d069,_0x146ebf),0x0;}catch(_0xb06e77){if(_0xb06e77 instanceof SDKError)return console[_0x27d997(0xf8)](_0x27d997(0xfe)+_0xb06e77[_0x27d997(0xc0)]+']'),console[_0x27d997(0xf8)]('\x0a'+_0xb06e77[_0x27d997(0x94)]),0x1;throw _0xb06e77;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x1916b8(0xe1);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0x81);async[a25_0x1916b8(0xe7)](_0x29363b){const _0x5d0c1f=a25_0x1916b8,{options:_0x3e7bd,args:_0x19fe2d,tdx:_0x15cd30}=_0x29363b;if(_0x19fe2d[_0x5d0c1f(0xba)]===0x0)return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xd7)),console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xc5)),0x1;const _0x22e56e=_0x19fe2d[0x0];try{_0x3e7bd[_0x5d0c1f(0x9d)]&&(console[_0x5d0c1f(0xf8)](_0x5d0c1f(0x8d)+_0x3e7bd['site']),console['error'](_0x5d0c1f(0x88)+_0x22e56e));const _0x5c3756=await withSpinner(_0x5d0c1f(0xd9)+_0x22e56e+_0x5d0c1f(0xb2),()=>_0x15cd30['segment'][_0x5d0c1f(0xbd)](_0x22e56e),{'verbose':_0x3e7bd[_0x5d0c1f(0x9d)]}),_0x37541a=_0x5c3756[_0x5d0c1f(0x6d)];_0x3e7bd[_0x5d0c1f(0x9d)]&&console[_0x5d0c1f(0xf8)]('Resolved\x20parent\x20ID:\x20'+_0x37541a);const _0x11a852=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x22e56e+_0x5d0c1f(0xb2),()=>_0x15cd30[_0x5d0c1f(0x90)][_0x5d0c1f(0xbf)](_0x37541a),{'verbose':_0x3e7bd[_0x5d0c1f(0x9d)]}),_0x480f42=_0x11a852[_0x5d0c1f(0x6d)];return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xdb)+_0x480f42[_0x5d0c1f(0xba)]+'\x20folder'+(_0x480f42['length']!==0x1?'s':'')),await handleSDKOutput(_0x480f42,_0x3e7bd),0x0;}catch(_0x754486){if(_0x754486 instanceof SDKError)return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xa4)+_0x754486[_0x5d0c1f(0x94)]),_0x754486['cause']&&console[_0x5d0c1f(0xf8)]('\x20\x20Cause:\x20'+_0x754486[_0x5d0c1f(0x86)]),0x1;throw _0x754486;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xde);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0x9b);async['execute'](_0x14477f){const _0x2f0761=a25_0x1916b8,{options:_0x13711c,args:_0x5a776b,tdx:_0x3468d3}=_0x14477f;if(_0x5a776b[_0x2f0761(0xba)]===0x0)return console['error'](_0x2f0761(0xcb)),console[_0x2f0761(0xf8)](_0x2f0761(0x69)),0x1;try{const {parentId:_0x1fbc59,childId:_0x3759ee}=parseSegmentRef(_0x5a776b[0x0]);_0x13711c['verbose']&&(console[_0x2f0761(0xf8)](_0x2f0761(0x8d)+_0x13711c['site']),console['error']('Parent\x20name:\x20'+_0x1fbc59),_0x3759ee&&console[_0x2f0761(0xf8)](_0x2f0761(0x9e)+_0x3759ee));if(!_0x3759ee)return console[_0x2f0761(0xf8)](_0x2f0761(0x72)),0x1;const _0x126bfd=await withSpinner(_0x2f0761(0xd9)+_0x1fbc59+_0x2f0761(0xb2),()=>_0x3468d3[_0x2f0761(0x90)][_0x2f0761(0xbd)](_0x1fbc59),{'verbose':_0x13711c[_0x2f0761(0x9d)]}),_0x573de5=_0x126bfd[_0x2f0761(0x6d)];_0x13711c[_0x2f0761(0x9d)]&&console['error'](_0x2f0761(0x71)+_0x573de5);const _0x3f83e9=await withSpinner(_0x2f0761(0xcd)+_0x3759ee+_0x2f0761(0xb2),()=>_0x3468d3[_0x2f0761(0x90)][_0x2f0761(0x6f)](_0x573de5,_0x3759ee),{'verbose':_0x13711c['verbose']}),_0x492fe9=_0x3f83e9[_0x2f0761(0x6d)];_0x13711c[_0x2f0761(0x9d)]&&console['error'](_0x2f0761(0x9c)+_0x492fe9);const _0x57b636=await withSpinner(_0x2f0761(0x104)+_0x3759ee+_0x2f0761(0xb2),()=>_0x3468d3['segment']['getFolder'](_0x492fe9),{'verbose':_0x13711c[_0x2f0761(0x9d)]});return await handleSDKOutput([_0x57b636[_0x2f0761(0x6d)]],_0x13711c),0x0;}catch(_0x1a7aa9){if(_0x1a7aa9 instanceof SDKError)return console[_0x2f0761(0xf8)](_0x2f0761(0xa4)+_0x1a7aa9['message']),_0x1a7aa9['cause']&&console[_0x2f0761(0xf8)]('\x20\x20Cause:\x20'+_0x1a7aa9[_0x2f0761(0x86)]),0x1;throw _0x1a7aa9;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x1916b8(0xa8)]='segment:sql';[a25_0x1916b8(0xc7)]=a25_0x1916b8(0xaa);async[a25_0x1916b8(0xe7)](_0x5c363b){const _0xef04e7=a25_0x1916b8,{options:_0x4170cb,args:_0x1f16bf,tdx:_0x1b4813}=_0x5c363b,_0x2032a1=_0x1f16bf[0x0];if(!_0x2032a1)return console['error'](_0xef04e7(0x8f)),console[_0xef04e7(0xf8)](_0xef04e7(0x7f)),console['error'](_0xef04e7(0x95)),console[_0xef04e7(0xf8)]('Examples:'),console[_0xef04e7(0xf8)](_0xef04e7(0xb0)),console[_0xef04e7(0xf8)](_0xef04e7(0xb4)),0x1;try{const _0xd4e160=_0x4170cb[_0xef04e7(0xbe)],_0x33ced3=await resolveSegmentTarget(_0x2032a1,_0xd4e160,_0x4170cb[_0xef04e7(0x9d)]);_0x4170cb[_0xef04e7(0x9d)]&&console['error'](_0xef04e7(0xcf)+_0x33ced3);const _0x14a7dd=await withSpinner('Resolving\x20\x27'+_0x2032a1+_0xef04e7(0xb2),()=>_0x1b4813[_0xef04e7(0x90)]['resolvePathToResource'](_0x33ced3),{'verbose':_0x4170cb['verbose']}),_0x5d99a5=_0x14a7dd[_0xef04e7(0x6d)];_0x4170cb[_0xef04e7(0x9d)]&&(console[_0xef04e7(0xf8)](_0xef04e7(0xe0)+_0x5d99a5['type']),console[_0xef04e7(0xf8)](_0xef04e7(0xf3)+_0x5d99a5['parentId']));if(_0x5d99a5[_0xef04e7(0xfd)]===_0xef04e7(0xd4))return console[_0xef04e7(0xf8)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0xef04e7(0xf8)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x5d99a5[_0xef04e7(0xfd)]==='parent')return console['error'](_0xef04e7(0xee)),console['error']('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x5d99a5['segmentId'])throw new SDKError(ErrorCode[_0xef04e7(0xda)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x923b0e=await withSpinner(_0xef04e7(0x6e),()=>_0x1b4813[_0xef04e7(0x90)][_0xef04e7(0xca)](_0x5d99a5['parentId'],_0x5d99a5[_0xef04e7(0xa1)]),{'verbose':_0x4170cb['verbose']}),_0x5af9ed=_0x923b0e[_0xef04e7(0x6d)];return _0x4170cb[_0xef04e7(0xb1)]===_0xef04e7(0xa0)||_0x4170cb[_0xef04e7(0xb1)]===_0xef04e7(0xb5)?await handleSDKOutput([{'sql':_0x5af9ed}],_0x4170cb):console[_0xef04e7(0xad)](_0x5af9ed),0x0;}catch(_0x22ad14){if(_0x22ad14 instanceof SDKError)return console[_0xef04e7(0xf8)](_0xef04e7(0xa4)+_0x22ad14[_0xef04e7(0x94)]),_0x22ad14[_0xef04e7(0x86)]&&console[_0xef04e7(0xf8)](_0xef04e7(0xf0)+_0x22ad14[_0xef04e7(0x86)]),0x1;throw _0x22ad14;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x1916b8(0x70);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0xdc);async[a25_0x1916b8(0xe7)](_0x2ed3f0){const _0x352e5d=a25_0x1916b8,{options:_0x52d8e1,args:_0x2741e6,tdx:_0x382514}=_0x2ed3f0,_0x1333d0=_0x52d8e1;if(_0x2741e6[_0x352e5d(0xba)]<0x2)return console[_0x352e5d(0xf8)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x352e5d(0xf8)](_0x352e5d(0xef)),0x1;const _0x53ef9e=_0x2741e6[0x0],_0x357548=_0x2741e6[0x1];_0x1333d0[_0x352e5d(0x9d)]&&(console[_0x352e5d(0xf8)](_0x352e5d(0x8d)+_0x1333d0[_0x352e5d(0xc9)]),console[_0x352e5d(0xf8)](_0x352e5d(0x89)+_0x53ef9e),console['error'](_0x352e5d(0x9e)+_0x357548));let _0x50a562;if(_0x1333d0[_0x352e5d(0xd6)]){const _0x26a7b1=_0x1333d0[_0x352e5d(0xd6)],_0x3c48df=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x53ef9e+'\x27...',()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0xbd)](_0x53ef9e),{'verbose':_0x1333d0['verbose']}),_0x54ae79=_0x3c48df[_0x352e5d(0x6d)],_0x1f5a0d=await withSpinner(_0x352e5d(0x93)+_0x26a7b1+_0x352e5d(0xb2),()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0x6f)](_0x54ae79,_0x26a7b1),{'verbose':_0x1333d0['verbose']});_0x50a562=_0x1f5a0d[_0x352e5d(0x6d)],_0x1333d0[_0x352e5d(0x9d)]&&console[_0x352e5d(0xf8)](_0x352e5d(0x84)+_0x50a562);}const _0x499b1d={'name':_0x357548,'description':_0x1333d0[_0x352e5d(0xc7)],'parentFolderId':_0x50a562},_0xdfd127=await withSpinner('Creating\x20folder\x20\x27'+_0x357548+_0x352e5d(0xb2),()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0xe5)](_0x53ef9e,_0x499b1d),{'verbose':_0x1333d0[_0x352e5d(0x9d)]}),_0x931a4c=_0xdfd127[_0x352e5d(0x6d)];return console['error'](_0x352e5d(0x67)+_0x931a4c[_0x352e5d(0xa8)]+_0x352e5d(0xc6)+_0x931a4c['id']),await handleSDKOutput([_0x931a4c],_0x1333d0),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xae);['description']=a25_0x1916b8(0x9f);async[a25_0x1916b8(0xe7)](_0xfb7831){const _0x1c94d0=a25_0x1916b8,{options:_0x5a38b4,args:_0x32a817,tdx:_0x41460e}=_0xfb7831,_0x4b6f1a=_0x32a817[0x0];if(!_0x4b6f1a)return console[_0x1c94d0(0xf8)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1c94d0(0xf8)](_0x1c94d0(0xc4)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xf6)),console[_0x1c94d0(0xf8)]('Options:'),console[_0x1c94d0(0xf8)](_0x1c94d0(0x76)),console[_0x1c94d0(0xf8)](_0x1c94d0(0x91)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xc8)),console[_0x1c94d0(0xf8)](_0x1c94d0(0x7c)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xb3)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xa2)),0x1;try{const _0x3cb7ef=_0x5a38b4[_0x1c94d0(0xbe)],_0x4aa9f4=await resolveSegmentTarget(_0x4b6f1a,_0x3cb7ef,_0x5a38b4['verbose']);_0x5a38b4['verbose']&&console[_0x1c94d0(0xf8)](_0x1c94d0(0xcf)+_0x4aa9f4);const _0x2a4fa5=await withSpinner(_0x1c94d0(0xfa)+_0x4b6f1a+'\x27...',()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xf9)](_0x4aa9f4),{'verbose':_0x5a38b4['verbose']}),_0x549fe2=_0x2a4fa5[_0x1c94d0(0x6d)];_0x5a38b4[_0x1c94d0(0x9d)]&&(console[_0x1c94d0(0xf8)]('Resolved\x20type:\x20'+_0x549fe2[_0x1c94d0(0xfd)]),console['error'](_0x1c94d0(0xf3)+_0x549fe2['parentId']),_0x549fe2['folderId']&&console[_0x1c94d0(0xf8)](_0x1c94d0(0x68)+_0x549fe2[_0x1c94d0(0x7d)]),_0x549fe2[_0x1c94d0(0xa1)]&&console[_0x1c94d0(0xf8)](_0x1c94d0(0xbc)+_0x549fe2[_0x1c94d0(0xa1)]));if(_0x5a38b4[_0x1c94d0(0xab)]){if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0xd4))return console[_0x1c94d0(0xf8)](_0x1c94d0(0xcc)),0x1;if(_0x549fe2[_0x1c94d0(0xfd)]==='parent')return console[_0x1c94d0(0xf8)](_0x1c94d0(0xd1)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xa7)),0x1;if(!_0x549fe2[_0x1c94d0(0xa1)])throw new SDKError(ErrorCode[_0x1c94d0(0xda)],_0x1c94d0(0xf4));const _0x1cdf15=getConsoleNextUrl(_0x5a38b4[_0x1c94d0(0xc9)],_0x1c94d0(0xfb)+_0x549fe2['parentId']+_0x1c94d0(0xfc)+_0x549fe2[_0x1c94d0(0xa1)]);return console['error'](a25_0x76439b['green']('β')+_0x1c94d0(0xd2)+a25_0x76439b[_0x1c94d0(0xd8)](_0x1cdf15)),openBrowser(_0x1cdf15),0x0;}if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0xd4)){if(!_0x549fe2[_0x1c94d0(0x7d)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1c94d0(0xdd));const _0x3185c1=await withSpinner('Fetching\x20folder\x20details...',()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xe8)](_0x549fe2[_0x1c94d0(0x7d)]),{'verbose':_0x5a38b4[_0x1c94d0(0x9d)]});await handleSingleObjectOutput(_0x3185c1[_0x1c94d0(0x6d)],_0x5a38b4);}else{if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0x90)){if(!_0x549fe2[_0x1c94d0(0xa1)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1c94d0(0xf4));const _0x150e2a=await withSpinner(_0x1c94d0(0x8b),()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xd0)](_0x549fe2[_0x1c94d0(0x92)],_0x549fe2[_0x1c94d0(0xa1)]),{'verbose':_0x5a38b4['verbose']}),_0x430c86=getConsoleNextUrl(_0x5a38b4[_0x1c94d0(0xc9)],_0x1c94d0(0xfb)+_0x549fe2['parentId']+_0x1c94d0(0xfc)+_0x549fe2[_0x1c94d0(0xa1)]),_0x2f5682=_0x150e2a[_0x1c94d0(0x6d)];_0x2f5682[_0x1c94d0(0xe2)]=_0x430c86,await handleSingleObjectOutput(_0x2f5682,_0x5a38b4);}else return console[_0x1c94d0(0xf8)](_0x1c94d0(0xa3)),console['error'](_0x1c94d0(0x83)),0x1;}return 0x0;}catch(_0x14db64){if(_0x14db64 instanceof SDKError)return console['error'](_0x1c94d0(0xa4)+_0x14db64[_0x1c94d0(0x94)]),_0x14db64[_0x1c94d0(0x86)]&&console[_0x1c94d0(0xf8)]('\x20\x20Cause:\x20'+_0x14db64['cause']),0x1;throw _0x14db64;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x1916b8(0xa5);['description']=a25_0x1916b8(0x85);async[a25_0x1916b8(0xe7)](_0x4102b1){const _0x3f7fa6=a25_0x1916b8,{options:_0x24eec4,args:_0x2015e0,tdx:_0x261903}=_0x4102b1,_0x15b392=_0x2015e0[0x0];if(!_0x15b392)return console[_0x3f7fa6(0xf8)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0x97)),console[_0x3f7fa6(0xf8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x3f7fa6(0x91)),console[_0x3f7fa6(0xf8)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0x98)),0x1;try{const _0x2e4784=_0x24eec4['parentSegment'],_0x2f02b1=await resolveSegmentTarget(_0x15b392,_0x2e4784,_0x24eec4[_0x3f7fa6(0x9d)]);_0x24eec4['verbose']&&console['error'](_0x3f7fa6(0xcf)+_0x2f02b1);const _0x3d27da=await withSpinner(_0x3f7fa6(0xfa)+_0x15b392+_0x3f7fa6(0xb2),()=>_0x261903['segment']['resolvePathToResource'](_0x2f02b1),{'verbose':_0x24eec4[_0x3f7fa6(0x9d)]}),_0xbfd62c=_0x3d27da[_0x3f7fa6(0x6d)];_0x24eec4['verbose']&&(console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xe0)+_0xbfd62c[_0x3f7fa6(0xfd)]),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xf3)+_0xbfd62c[_0x3f7fa6(0x92)]));if(_0xbfd62c['type']===_0x3f7fa6(0xd4))return console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xb6)),console[_0x3f7fa6(0xf8)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0xbfd62c[_0x3f7fa6(0xfd)]===_0x3f7fa6(0x82))return console[_0x3f7fa6(0xf8)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0xbfd62c[_0x3f7fa6(0xa1)])throw new SDKError(ErrorCode[_0x3f7fa6(0xda)],_0x3f7fa6(0xf4));const _0x2aa8f9=await withSpinner(_0x3f7fa6(0x6e),()=>_0x261903[_0x3f7fa6(0x90)][_0x3f7fa6(0xca)](_0xbfd62c[_0x3f7fa6(0x92)],_0xbfd62c[_0x3f7fa6(0xa1)]),{'verbose':_0x24eec4[_0x3f7fa6(0x9d)]}),_0x2bebfa=_0x2aa8f9['data'],_0x39da7a=await executeSchemaQuery(_0x2bebfa,_0x261903,_0x24eec4);return await handleQueryOutput(_0x39da7a,_0x24eec4),0x0;}catch(_0x4edf03){if(_0x4edf03 instanceof SDKError)return console['error'](_0x3f7fa6(0xa4)+_0x4edf03[_0x3f7fa6(0x94)]),_0x4edf03[_0x3f7fa6(0x86)]&&console['error'](_0x3f7fa6(0xf0)+_0x4edf03[_0x3f7fa6(0x86)]),0x1;throw _0x4edf03;}}}
|
|
1
|
+
const a25_0x9e26f2=a25_0x775b;(function(_0x397e36,_0x34975e){const _0xb8d1b0=a25_0x775b,_0x116bb8=_0x397e36();while(!![]){try{const _0x31b702=parseInt(_0xb8d1b0(0xe1))/0x1+parseInt(_0xb8d1b0(0xb3))/0x2*(-parseInt(_0xb8d1b0(0xe9))/0x3)+-parseInt(_0xb8d1b0(0x9f))/0x4*(parseInt(_0xb8d1b0(0xea))/0x5)+-parseInt(_0xb8d1b0(0x118))/0x6*(parseInt(_0xb8d1b0(0xc3))/0x7)+-parseInt(_0xb8d1b0(0xef))/0x8+-parseInt(_0xb8d1b0(0xd3))/0x9*(-parseInt(_0xb8d1b0(0xb9))/0xa)+parseInt(_0xb8d1b0(0xfa))/0xb;if(_0x31b702===_0x34975e)break;else _0x116bb8['push'](_0x116bb8['shift']());}catch(_0x948514){_0x116bb8['push'](_0x116bb8['shift']());}}}(a25_0x2862,0x2c465));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';function a25_0x2862(){const _0x2c2ccd=['Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20desc','Usage:\x20tdx\x20segment\x20describe\x20<path>','Use:\x20tdx\x20ps\x20show','setJobId','\x20Opening\x20','Error:\x20Folder\x20reference\x20is\x20required','segment','getParent','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Resolved\x20folder\x20ID:\x20','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x27...','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','in\x20','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20parent\x20folder\x20\x27','Fetching\x20folder\x20details...','site','23716onRKWa','β\x20Query\x20completed:\x20Processed\x20','execute','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','β\x20Found\x20','elapsedTimeMillis','/app/ps/','folderId','\x20\x20Folder\x20path:\x20','listFolders','jsonl','toLocaleString','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','segmentName','processedRows','\x20\x20Full\x20path:\x20','resolveFolderId','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','2KjEOtI','Get\x20SQL\x20query\x20for\x20child\x20segment','segment:folder:create','segment:sql','segmentId','SEGMENT_NOT_FOUND','10ajdbmW','message','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','(root)','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Parent\x20ID:\x20','getSegmentSQL','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegment','resolveParentId','502628wqOuvD','SELECT\x20*\x20FROM\x20(\x0a','web','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentSegment','parent','Usage:\x20tdx\x20sg\x20show\x20<name>','description','Resolving\x20path\x20\x27','log','\x20[Job\x20ID:\x20','Use:\x20tdx\x20ps\x20view\x20-w','Site:\x20','test','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','2160711RuDVmj','Parent\x20segment:\x20','Resolving\x20\x27','name','verbose','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','data','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Fetching\x20folder\x20\x27','stats','replace','fullPath','β\x20Created\x20folder\x20\x27','326434BmprfB','includes','getFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','resolvePathToResource','green','length','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','697044GDUlOF','295wQmxMo','INVALID_ARGUMENT','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentId','518064uPRhMV','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20','folder','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','parentFolder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:show','information_schema','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','6038659fFxrnL','Resolving\x20parent\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','cause','json','Target\x20path:\x20','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','segmentPath','\x20\x20Cause:\x20','segment:folder:list','url','limit','Listing\x20folders\x20for\x20parent\x20\x27','Options:','Executing\x20segment\x20query...','createFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Resolved\x20type:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20sql\x20<name>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:show','type','/e/','\x27\x20with\x20ID:\x20','\x20\x20Parent\x20segment:\x20','Resolved\x20parent\x20folder\x20ID:\x20','code','24dKMEaq','Parent\x20name:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20sql','Folder\x20name:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','SQL\x20query:\x0a','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','jobId','error','Usage:\x20tdx\x20sg\x20desc\x20<name>','Creating\x20folder\x20\x27','\x20\x20Segment\x20name:\x20'];a25_0x2862=function(){return _0x2c2ccd;};return a25_0x2862();}import{openBrowser}from'../utils/process.js';import a25_0x17ea3a from'chalk';async function resolveSegmentTarget(_0x2ae3b7,_0x1e9547,_0x30d133){const _0x52ec91=a25_0x775b;if(isYamlFilePath(_0x2ae3b7))try{const _0x473b67=await resolveYamlFilePath(_0x2ae3b7);return _0x30d133&&(console[_0x52ec91(0x81)]('Resolved\x20YAML\x20file:\x20'+_0x2ae3b7),console[_0x52ec91(0x81)](_0x52ec91(0x115)+_0x473b67[_0x52ec91(0xc7)]),console[_0x52ec91(0x81)](_0x52ec91(0x84)+_0x473b67[_0x52ec91(0xad)]),console['error'](_0x52ec91(0xa7)+(_0x473b67['folderPath']||_0x52ec91(0xbc))),console[_0x52ec91(0x81)](_0x52ec91(0xaf)+_0x473b67['fullPath'])),_0x473b67[_0x52ec91(0xdf)];}catch(_0x3aeb2c){throw new SDKError(ErrorCode[_0x52ec91(0xeb)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x3aeb2c[_0x52ec91(0xba)]);}if(!_0x1e9547)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x52ec91(0xda));return _0x1e9547+'/'+_0x2ae3b7;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:describe';[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0x87);async['execute'](_0x25e723){const _0x185354=a25_0x9e26f2,{options:_0x1e5283,args:_0x298bb7,tdx:_0x4caf7d}=_0x25e723,_0x333800=_0x298bb7[0x0],_0x1f772e=!_0x333800&&!!_0x1e5283[_0x185354(0xc7)],_0x12d37e=_0x333800||_0x1e5283[_0x185354(0xc7)];if(!_0x12d37e)return console[_0x185354(0x81)](_0x185354(0x99)),console[_0x185354(0x81)](_0x185354(0x89)),console[_0x185354(0x81)](_0x185354(0xec)),console['error'](_0x185354(0xe4)),console[_0x185354(0x81)](_0x185354(0xed)),console[_0x185354(0x81)](_0x185354(0xe8)),console[_0x185354(0x81)](_0x185354(0xbd)),0x1;try{const _0x25368a=_0x1e5283[_0x185354(0x103)];let _0x569b0f=_0x12d37e;!_0x1f772e&&_0x25368a&&!_0x12d37e[_0x185354(0xe2)]('/')&&(_0x569b0f=_0x25368a+'/'+_0x12d37e,_0x1e5283['verbose']&&console[_0x185354(0x81)]('Resolved\x20relative\x20path\x20to:\x20'+_0x569b0f));const _0x162284=await withSpinner(_0x185354(0xcb)+_0x569b0f+'\x27...',()=>_0x4caf7d['segment'][_0x185354(0xe5)](_0x569b0f),{'verbose':_0x1e5283[_0x185354(0xd7)]}),_0x2c0838=_0x162284[_0x185354(0xd9)];_0x1e5283[_0x185354(0xd7)]&&(console[_0x185354(0x81)](_0x185354(0x10d)+_0x2c0838['type']),console['error'](_0x185354(0xbe)+_0x2c0838[_0x185354(0xee)]),_0x2c0838['folderId']&&console['error'](_0x185354(0x100)+_0x2c0838[_0x185354(0xa6)]),_0x2c0838['segmentId']&&console[_0x185354(0x81)](_0x185354(0x92)+_0x2c0838['segmentId']));if(_0x2c0838[_0x185354(0x112)]===_0x185354(0xc8)){const _0x4f6a02=await withSpinner(_0x185354(0x102),()=>_0x4caf7d[_0x185354(0x8e)][_0x185354(0x8f)](_0x2c0838[_0x185354(0xee)]),{'verbose':_0x1e5283[_0x185354(0xd7)]});await handleSingleObjectOutput(_0x4f6a02[_0x185354(0xd9)],_0x1e5283);}else{if(_0x2c0838['type']===_0x185354(0xf2)){if(!_0x2c0838['folderId'])throw new SDKError(ErrorCode[_0x185354(0x98)],_0x185354(0xf6));const _0x415136=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4caf7d[_0x185354(0x8e)][_0x185354(0xe3)](_0x2c0838[_0x185354(0xa6)]),{'verbose':_0x1e5283[_0x185354(0xd7)]});await handleSingleObjectOutput(_0x415136['data'],_0x1e5283);}else{if(_0x2c0838['type']===_0x185354(0x8e)){if(!_0x2c0838[_0x185354(0xb7)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x185354(0xab));const _0x26e24c=await withSpinner(_0x185354(0xb1),()=>_0x4caf7d[_0x185354(0x8e)]['getSegment'](_0x2c0838[_0x185354(0xee)],_0x2c0838[_0x185354(0xb7)]),{'verbose':_0x1e5283['verbose']});await handleSingleObjectOutput(_0x26e24c[_0x185354(0xd9)],_0x1e5283);}}}return 0x0;}catch(_0x9f993){if(_0x9f993 instanceof SDKError)return console[_0x185354(0x81)](_0x185354(0xf1)+_0x9f993['message']),_0x9f993[_0x185354(0xfd)]&&console[_0x185354(0x81)](_0x185354(0x104)+_0x9f993[_0x185354(0xfd)]),0x1;throw _0x9f993;}}}export class SegmentShowCommand extends BaseCommand{['name']=a25_0x9e26f2(0x111);[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0xa2);async['execute'](_0x817226){const _0x4891be=a25_0x9e26f2,{options:_0x8982,args:_0x19fb06,tdx:_0x2729cf}=_0x817226,_0x8a3bed=_0x19fb06[0x0];if(!_0x8a3bed)return console[_0x4891be(0x81)](_0x4891be(0xfc)),console[_0x4891be(0x81)](_0x4891be(0xc9)),console['error'](_0x4891be(0xdb)),console[_0x4891be(0x81)]('Examples:'),console[_0x4891be(0x81)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x4891be(0x81)](_0x4891be(0xb2)),0x1;try{const _0x335455=_0x8982[_0x4891be(0xc7)],_0x50bc03=await resolveSegmentTarget(_0x8a3bed,_0x335455,_0x8982[_0x4891be(0xd7)]);_0x8982[_0x4891be(0xd7)]&&console[_0x4891be(0x81)](_0x4891be(0xff)+_0x50bc03);const _0x4ad76d=await withSpinner(_0x4891be(0xd5)+_0x8a3bed+_0x4891be(0x94),()=>_0x2729cf[_0x4891be(0x8e)][_0x4891be(0xe5)](_0x50bc03),{'verbose':_0x8982[_0x4891be(0xd7)]}),_0x592ee5=_0x4ad76d['data'];_0x8982[_0x4891be(0xd7)]&&(console[_0x4891be(0x81)](_0x4891be(0x10d)+_0x592ee5['type']),console[_0x4891be(0x81)](_0x4891be(0xbe)+_0x592ee5[_0x4891be(0xee)]));if(_0x592ee5[_0x4891be(0x112)]===_0x4891be(0xf2))return console[_0x4891be(0x81)](_0x4891be(0x96)),console['error'](_0x4891be(0x9b)),0x1;if(_0x592ee5[_0x4891be(0x112)]===_0x4891be(0xc8))return console[_0x4891be(0x81)](_0x4891be(0xc6)),console[_0x4891be(0x81)](_0x4891be(0x8a)),0x1;if(!_0x592ee5[_0x4891be(0xb7)])throw new SDKError(ErrorCode[_0x4891be(0xb8)],_0x4891be(0xab));const _0xaeaee9=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2729cf['segment']['getSegmentSQL'](_0x592ee5[_0x4891be(0xee)],_0x592ee5[_0x4891be(0xb7)]),{'verbose':_0x8982['verbose']});let _0x4ac0e1=_0xaeaee9[_0x4891be(0xd9)];const _0x45c405=resolveLimit(_0x8982[_0x4891be(0x107)],DEFAULT_DISPLAY_LIMIT),_0x194a68=/\bLIMIT\s+\d+/i[_0x4891be(0xd0)](_0x4ac0e1);!_0x194a68&&(_0x4ac0e1=_0x4ac0e1['trim']()[_0x4891be(0xde)](/;+$/,''),_0x4ac0e1=_0x4891be(0xc4)+_0x4ac0e1+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x45c405);_0x8982[_0x4891be(0xd7)]&&console['error'](_0x4891be(0x7e)+_0x4ac0e1);const _0x3aa86b=await withProgressSpinner(_0x4891be(0x10a),async _0x6e2c98=>{const _0x1375a7=_0x4891be,_0x4e4a1d=await _0x2729cf['query']['execute'](_0x4ac0e1,{'catalog':'td','schema':_0x1375a7(0xf8),'onJobId':_0x1e062f=>{const _0x32347b=_0x1375a7;_0x6e2c98[_0x32347b(0x8b)](_0x1e062f);}});return _0x4e4a1d;},{'verbose':_0x8982[_0x4891be(0xd7)]}),_0x30aa31=_0x3aa86b[_0x4891be(0xd9)],_0x45f1e6=_0x30aa31[_0x4891be(0x80)]?_0x4891be(0xcd)+_0x30aa31[_0x4891be(0x80)]+']':'';return console[_0x4891be(0x81)](_0x4891be(0xa0)+_0x30aa31[_0x4891be(0xdd)][_0x4891be(0xae)][_0x4891be(0xaa)]()+'\x20rows\x20'+(_0x4891be(0x97)+formatElapsed(_0x30aa31['stats'][_0x4891be(0xa4)])+_0x45f1e6)),await handleQueryOutput(_0x30aa31,_0x8982),0x0;}catch(_0x42cc4c){if(_0x42cc4c instanceof SDKError)return console[_0x4891be(0x81)]('β\x20Query\x20failed\x20['+_0x42cc4c[_0x4891be(0x117)]+']'),console[_0x4891be(0x81)]('\x0a'+_0x42cc4c[_0x4891be(0xba)]),0x1;throw _0x42cc4c;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0x105);['description']=a25_0x9e26f2(0xf0);async[a25_0x9e26f2(0xa1)](_0x26df20){const _0x2a800a=a25_0x9e26f2,{options:_0x246528,args:_0x9a1ecf,tdx:_0x3bdf3f}=_0x26df20;if(_0x9a1ecf['length']===0x0)return console['error'](_0x2a800a(0xc0)),console['error'](_0x2a800a(0x110)),0x1;const _0x8fbd5d=_0x9a1ecf[0x0];try{_0x246528[_0x2a800a(0xd7)]&&(console[_0x2a800a(0x81)](_0x2a800a(0xcf)+_0x246528[_0x2a800a(0x9e)]),console[_0x2a800a(0x81)](_0x2a800a(0x119)+_0x8fbd5d));const _0x47c0af=await withSpinner(_0x2a800a(0xfb)+_0x8fbd5d+_0x2a800a(0x94),()=>_0x3bdf3f['segment'][_0x2a800a(0xc2)](_0x8fbd5d),{'verbose':_0x246528[_0x2a800a(0xd7)]}),_0x2659cb=_0x47c0af['data'];_0x246528['verbose']&&console[_0x2a800a(0x81)](_0x2a800a(0x101)+_0x2659cb);const _0x17b4a8=await withSpinner(_0x2a800a(0x108)+_0x8fbd5d+_0x2a800a(0x94),()=>_0x3bdf3f['segment'][_0x2a800a(0xa8)](_0x2659cb),{'verbose':_0x246528[_0x2a800a(0xd7)]}),_0x4a9793=_0x17b4a8[_0x2a800a(0xd9)];return console['error'](_0x2a800a(0xa3)+_0x4a9793[_0x2a800a(0xe7)]+'\x20folder'+(_0x4a9793[_0x2a800a(0xe7)]!==0x1?'s':'')),await handleSDKOutput(_0x4a9793,_0x246528),0x0;}catch(_0x1c0a5e){if(_0x1c0a5e instanceof SDKError)return console[_0x2a800a(0x81)](_0x2a800a(0xf1)+_0x1c0a5e[_0x2a800a(0xba)]),_0x1c0a5e[_0x2a800a(0xfd)]&&console[_0x2a800a(0x81)]('\x20\x20Cause:\x20'+_0x1c0a5e[_0x2a800a(0xfd)]),0x1;throw _0x1c0a5e;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xf7);[a25_0x9e26f2(0xca)]='Show\x20segment\x20folder\x20details';async[a25_0x9e26f2(0xa1)](_0x289036){const _0x37fdd6=a25_0x9e26f2,{options:_0x199a94,args:_0x16b4dd,tdx:_0x5b58ce}=_0x289036;if(_0x16b4dd['length']===0x0)return console[_0x37fdd6(0x81)](_0x37fdd6(0x8d)),console['error'](_0x37fdd6(0xd1)),0x1;try{const {parentId:_0x2e7e,childId:_0x422f23}=parseSegmentRef(_0x16b4dd[0x0]);_0x199a94[_0x37fdd6(0xd7)]&&(console[_0x37fdd6(0x81)](_0x37fdd6(0xcf)+_0x199a94[_0x37fdd6(0x9e)]),console[_0x37fdd6(0x81)](_0x37fdd6(0x119)+_0x2e7e),_0x422f23&&console['error']('Folder\x20name:\x20'+_0x422f23));if(!_0x422f23)return console[_0x37fdd6(0x81)](_0x37fdd6(0x95)),0x1;const _0x47cebd=await withSpinner(_0x37fdd6(0xfb)+_0x2e7e+_0x37fdd6(0x94),()=>_0x5b58ce[_0x37fdd6(0x8e)][_0x37fdd6(0xc2)](_0x2e7e),{'verbose':_0x199a94[_0x37fdd6(0xd7)]}),_0x1946bb=_0x47cebd[_0x37fdd6(0xd9)];_0x199a94[_0x37fdd6(0xd7)]&&console[_0x37fdd6(0x81)]('Resolved\x20parent\x20ID:\x20'+_0x1946bb);const _0x219025=await withSpinner('Resolving\x20folder\x20\x27'+_0x422f23+_0x37fdd6(0x94),()=>_0x5b58ce[_0x37fdd6(0x8e)][_0x37fdd6(0xb0)](_0x1946bb,_0x422f23),{'verbose':_0x199a94['verbose']}),_0x2323ff=_0x219025['data'];_0x199a94[_0x37fdd6(0xd7)]&&console['error'](_0x37fdd6(0x91)+_0x2323ff);const _0x452e36=await withSpinner(_0x37fdd6(0xdc)+_0x422f23+_0x37fdd6(0x94),()=>_0x5b58ce['segment'][_0x37fdd6(0xe3)](_0x2323ff),{'verbose':_0x199a94['verbose']});return await handleSDKOutput([_0x452e36[_0x37fdd6(0xd9)]],_0x199a94),0x0;}catch(_0x3b204d){if(_0x3b204d instanceof SDKError)return console[_0x37fdd6(0x81)](_0x37fdd6(0xf1)+_0x3b204d[_0x37fdd6(0xba)]),_0x3b204d[_0x37fdd6(0xfd)]&&console['error'](_0x37fdd6(0x104)+_0x3b204d[_0x37fdd6(0xfd)]),0x1;throw _0x3b204d;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xb6);[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0xb4);async[a25_0x9e26f2(0xa1)](_0x3a40d2){const _0x5c41ec=a25_0x9e26f2,{options:_0x29f6ca,args:_0x6850ad,tdx:_0x42d634}=_0x3a40d2,_0x4f4462=_0x6850ad[0x0];if(!_0x4f4462)return console[_0x5c41ec(0x81)](_0x5c41ec(0xfc)),console[_0x5c41ec(0x81)](_0x5c41ec(0x10f)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x5c41ec(0x81)](_0x5c41ec(0xec)),console[_0x5c41ec(0x81)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x5c41ec(0x81)](_0x5c41ec(0xbb)),0x1;try{const _0x449432=_0x29f6ca[_0x5c41ec(0xc7)],_0x1530af=await resolveSegmentTarget(_0x4f4462,_0x449432,_0x29f6ca[_0x5c41ec(0xd7)]);_0x29f6ca[_0x5c41ec(0xd7)]&&console[_0x5c41ec(0x81)]('Target\x20path:\x20'+_0x1530af);const _0x421684=await withSpinner(_0x5c41ec(0xd5)+_0x4f4462+_0x5c41ec(0x94),()=>_0x42d634['segment'][_0x5c41ec(0xe5)](_0x1530af),{'verbose':_0x29f6ca[_0x5c41ec(0xd7)]}),_0x1bca3f=_0x421684[_0x5c41ec(0xd9)];_0x29f6ca[_0x5c41ec(0xd7)]&&(console[_0x5c41ec(0x81)](_0x5c41ec(0x10d)+_0x1bca3f[_0x5c41ec(0x112)]),console[_0x5c41ec(0x81)](_0x5c41ec(0xbe)+_0x1bca3f[_0x5c41ec(0xee)]));if(_0x1bca3f[_0x5c41ec(0x112)]===_0x5c41ec(0xf2))return console[_0x5c41ec(0x81)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console['error'](_0x5c41ec(0x7c)),0x1;if(_0x1bca3f[_0x5c41ec(0x112)]===_0x5c41ec(0xc8))return console[_0x5c41ec(0x81)](_0x5c41ec(0x9a)),console['error'](_0x5c41ec(0x11b)),0x1;if(!_0x1bca3f[_0x5c41ec(0xb7)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5c41ec(0xab));const _0x3641b1=await withSpinner(_0x5c41ec(0x85),()=>_0x42d634[_0x5c41ec(0x8e)][_0x5c41ec(0xbf)](_0x1bca3f[_0x5c41ec(0xee)],_0x1bca3f[_0x5c41ec(0xb7)]),{'verbose':_0x29f6ca['verbose']}),_0x203597=_0x3641b1[_0x5c41ec(0xd9)];return _0x29f6ca['format']===_0x5c41ec(0xfe)||_0x29f6ca[_0x5c41ec(0xd2)]===_0x5c41ec(0xa9)?await handleSDKOutput([{'sql':_0x203597}],_0x29f6ca):console[_0x5c41ec(0xcc)](_0x203597),0x0;}catch(_0x3b9dc8){if(_0x3b9dc8 instanceof SDKError)return console[_0x5c41ec(0x81)]('Error:\x20'+_0x3b9dc8[_0x5c41ec(0xba)]),_0x3b9dc8[_0x5c41ec(0xfd)]&&console[_0x5c41ec(0x81)](_0x5c41ec(0x104)+_0x3b9dc8['cause']),0x1;throw _0x3b9dc8;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xb5);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x9e26f2(0xa1)](_0x3cab72){const _0x53c3cf=a25_0x9e26f2,{options:_0x2d1e96,args:_0x59c873,tdx:_0x30888c}=_0x3cab72,_0x596dbb=_0x2d1e96;if(_0x59c873['length']<0x2)return console[_0x53c3cf(0x81)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x53c3cf(0x81)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3d2a48=_0x59c873[0x0],_0x4d28d4=_0x59c873[0x1];_0x596dbb['verbose']&&(console[_0x53c3cf(0x81)](_0x53c3cf(0xcf)+_0x596dbb[_0x53c3cf(0x9e)]),console['error'](_0x53c3cf(0xd4)+_0x3d2a48),console['error'](_0x53c3cf(0x7b)+_0x4d28d4));let _0x4ff18b;if(_0x596dbb[_0x53c3cf(0xf5)]){const _0xfa94a7=_0x596dbb['parentFolder'],_0x41bf6d=await withSpinner(_0x53c3cf(0xfb)+_0x3d2a48+_0x53c3cf(0x94),()=>_0x30888c[_0x53c3cf(0x8e)][_0x53c3cf(0xc2)](_0x3d2a48),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]}),_0x102330=_0x41bf6d['data'],_0x5ef361=await withSpinner(_0x53c3cf(0x9c)+_0xfa94a7+_0x53c3cf(0x94),()=>_0x30888c['segment']['resolveFolderId'](_0x102330,_0xfa94a7),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]});_0x4ff18b=_0x5ef361[_0x53c3cf(0xd9)],_0x596dbb[_0x53c3cf(0xd7)]&&console[_0x53c3cf(0x81)](_0x53c3cf(0x116)+_0x4ff18b);}const _0x18d619={'name':_0x4d28d4,'description':_0x596dbb[_0x53c3cf(0xca)],'parentFolderId':_0x4ff18b},_0x93305f=await withSpinner(_0x53c3cf(0x83)+_0x4d28d4+_0x53c3cf(0x94),()=>_0x30888c[_0x53c3cf(0x8e)][_0x53c3cf(0x10b)](_0x3d2a48,_0x18d619),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]}),_0x543f83=_0x93305f[_0x53c3cf(0xd9)];return console['error'](_0x53c3cf(0xe0)+_0x543f83[_0x53c3cf(0xd6)]+_0x53c3cf(0x114)+_0x543f83['id']),await handleSDKOutput([_0x543f83],_0x596dbb),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:view';['description']=a25_0x9e26f2(0xf3);async['execute'](_0x238db1){const _0x47fa2c=a25_0x9e26f2,{options:_0x5dd2e2,args:_0x290435,tdx:_0x2c829e}=_0x238db1,_0x1d400a=_0x290435[0x0];if(!_0x1d400a)return console['error'](_0x47fa2c(0x10e)),console[_0x47fa2c(0x81)](_0x47fa2c(0x7f)),console['error'](_0x47fa2c(0xf4)),console[_0x47fa2c(0x81)](_0x47fa2c(0x109)),console['error'](_0x47fa2c(0xf9)),console[_0x47fa2c(0x81)](_0x47fa2c(0xec)),console[_0x47fa2c(0x81)](_0x47fa2c(0x90)),console[_0x47fa2c(0x81)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x47fa2c(0x81)](_0x47fa2c(0x86)),console[_0x47fa2c(0x81)](_0x47fa2c(0x93)),0x1;try{const _0x37dd82=_0x5dd2e2['parentSegment'],_0x3e0f9b=await resolveSegmentTarget(_0x1d400a,_0x37dd82,_0x5dd2e2[_0x47fa2c(0xd7)]);_0x5dd2e2[_0x47fa2c(0xd7)]&&console['error']('Target\x20path:\x20'+_0x3e0f9b);const _0x2ebe18=await withSpinner(_0x47fa2c(0xd5)+_0x1d400a+_0x47fa2c(0x94),()=>_0x2c829e['segment'][_0x47fa2c(0xe5)](_0x3e0f9b),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]}),_0x4ada32=_0x2ebe18[_0x47fa2c(0xd9)];_0x5dd2e2[_0x47fa2c(0xd7)]&&(console['error'](_0x47fa2c(0x10d)+_0x4ada32[_0x47fa2c(0x112)]),console['error'](_0x47fa2c(0xbe)+_0x4ada32['parentId']),_0x4ada32[_0x47fa2c(0xa6)]&&console[_0x47fa2c(0x81)](_0x47fa2c(0x100)+_0x4ada32['folderId']),_0x4ada32['segmentId']&&console[_0x47fa2c(0x81)](_0x47fa2c(0x92)+_0x4ada32[_0x47fa2c(0xb7)]));if(_0x5dd2e2[_0x47fa2c(0xc5)]){if(_0x4ada32[_0x47fa2c(0x112)]==='folder')return console[_0x47fa2c(0x81)](_0x47fa2c(0x7d)),0x1;if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0xc8))return console[_0x47fa2c(0x81)](_0x47fa2c(0xd8)),console[_0x47fa2c(0x81)](_0x47fa2c(0xce)),0x1;if(!_0x4ada32['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x47fa2c(0xab));const _0x2ad42d=getConsoleNextUrl(_0x5dd2e2[_0x47fa2c(0x9e)],_0x47fa2c(0xa5)+_0x4ada32[_0x47fa2c(0xee)]+_0x47fa2c(0x113)+_0x4ada32[_0x47fa2c(0xb7)]);return console[_0x47fa2c(0x81)](a25_0x17ea3a[_0x47fa2c(0xe6)]('β')+_0x47fa2c(0x8c)+a25_0x17ea3a['cyan'](_0x2ad42d)),openBrowser(_0x2ad42d),0x0;}if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0xf2)){if(!_0x4ada32[_0x47fa2c(0xa6)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x19c730=await withSpinner(_0x47fa2c(0x9d),()=>_0x2c829e[_0x47fa2c(0x8e)][_0x47fa2c(0xe3)](_0x4ada32[_0x47fa2c(0xa6)]),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]});await handleSingleObjectOutput(_0x19c730[_0x47fa2c(0xd9)],_0x5dd2e2);}else{if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0x8e)){if(!_0x4ada32[_0x47fa2c(0xb7)])throw new SDKError(ErrorCode[_0x47fa2c(0xb8)],_0x47fa2c(0xab));const _0x1a55e6=await withSpinner(_0x47fa2c(0xb1),()=>_0x2c829e['segment'][_0x47fa2c(0xc1)](_0x4ada32[_0x47fa2c(0xee)],_0x4ada32[_0x47fa2c(0xb7)]),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]}),_0x597338=getConsoleNextUrl(_0x5dd2e2[_0x47fa2c(0x9e)],_0x47fa2c(0xa5)+_0x4ada32[_0x47fa2c(0xee)]+_0x47fa2c(0x113)+_0x4ada32[_0x47fa2c(0xb7)]),_0x7b07c0=_0x1a55e6['data'];_0x7b07c0[_0x47fa2c(0x106)]=_0x597338,await handleSingleObjectOutput(_0x7b07c0,_0x5dd2e2);}else return console['error'](_0x47fa2c(0x11a)),console[_0x47fa2c(0x81)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x319dd1){if(_0x319dd1 instanceof SDKError)return console['error']('Error:\x20'+_0x319dd1[_0x47fa2c(0xba)]),_0x319dd1['cause']&&console[_0x47fa2c(0x81)](_0x47fa2c(0x104)+_0x319dd1[_0x47fa2c(0xfd)]),0x1;throw _0x319dd1;}}}function a25_0x775b(_0x3f663e,_0x5733e6){_0x3f663e=_0x3f663e-0x7b;const _0x286277=a25_0x2862();let _0x775bce=_0x286277[_0x3f663e];return _0x775bce;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:desc';[a25_0x9e26f2(0xca)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x1b681a){const _0x19150c=a25_0x9e26f2,{options:_0x49e236,args:_0x23109e,tdx:_0xf70622}=_0x1b681a,_0x37e1e9=_0x23109e[0x0];if(!_0x37e1e9)return console[_0x19150c(0x81)](_0x19150c(0xfc)),console[_0x19150c(0x81)](_0x19150c(0x82)),console[_0x19150c(0x81)](_0x19150c(0x10c)),console[_0x19150c(0x81)](_0x19150c(0xec)),console[_0x19150c(0x81)](_0x19150c(0xac)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x22c16d=_0x49e236[_0x19150c(0xc7)],_0x4847be=await resolveSegmentTarget(_0x37e1e9,_0x22c16d,_0x49e236[_0x19150c(0xd7)]);_0x49e236[_0x19150c(0xd7)]&&console['error']('Target\x20path:\x20'+_0x4847be);const _0x29d331=await withSpinner(_0x19150c(0xd5)+_0x37e1e9+_0x19150c(0x94),()=>_0xf70622[_0x19150c(0x8e)]['resolvePathToResource'](_0x4847be),{'verbose':_0x49e236[_0x19150c(0xd7)]}),_0x386677=_0x29d331['data'];_0x49e236[_0x19150c(0xd7)]&&(console[_0x19150c(0x81)](_0x19150c(0x10d)+_0x386677['type']),console[_0x19150c(0x81)](_0x19150c(0xbe)+_0x386677[_0x19150c(0xee)]));if(_0x386677[_0x19150c(0x112)]==='folder')return console[_0x19150c(0x81)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x386677[_0x19150c(0x112)]===_0x19150c(0xc8))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x19150c(0x81)](_0x19150c(0x88)),0x1;if(!_0x386677[_0x19150c(0xb7)])throw new SDKError(ErrorCode[_0x19150c(0xb8)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3504de=await withSpinner(_0x19150c(0x85),()=>_0xf70622['segment']['getSegmentSQL'](_0x386677[_0x19150c(0xee)],_0x386677['segmentId']),{'verbose':_0x49e236['verbose']}),_0x47f54e=_0x3504de[_0x19150c(0xd9)],_0xc631ae=await executeSchemaQuery(_0x47f54e,_0xf70622,_0x49e236);return await handleQueryOutput(_0xc631ae,_0x49e236),0x0;}catch(_0x5b795c){if(_0x5b795c instanceof SDKError)return console['error']('Error:\x20'+_0x5b795c[_0x19150c(0xba)]),_0x5b795c[_0x19150c(0xfd)]&&console[_0x19150c(0x81)](_0x19150c(0x104)+_0x5b795c[_0x19150c(0xfd)]),0x1;throw _0x5b795c;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x4e4376=a26_0xbf7a;(function(_0x604bd7,_0x4942f9){const _0x14fa03=a26_0xbf7a,_0x2057c0=_0x604bd7();while(!![]){try{const _0x5eafd6=-parseInt(_0x14fa03(0x157))/0x1*(-parseInt(_0x14fa03(0x15f))/0x2)+parseInt(_0x14fa03(0x14c))/0x3*(parseInt(_0x14fa03(0x141))/0x4)+parseInt(_0x14fa03(0x151))/0x5*(-parseInt(_0x14fa03(0x159))/0x6)+parseInt(_0x14fa03(0x161))/0x7+parseInt(_0x14fa03(0x154))/0x8+parseInt(_0x14fa03(0x136))/0x9*(parseInt(_0x14fa03(0x160))/0xa)+-parseInt(_0x14fa03(0x164))/0xb*(parseInt(_0x14fa03(0x165))/0xc);if(_0x5eafd6===_0x4942f9)break;else _0x2057c0['push'](_0x2057c0['shift']());}catch(_0x4becc8){_0x2057c0['push'](_0x2057c0['shift']());}}}(a26_0x46b1,0x8c77f));import{BaseCommand}from'./command.js';function a26_0xbf7a(_0x21ea74,_0x7846c3){_0x21ea74=_0x21ea74-0x136;const _0x46b1ea=a26_0x46b1();let _0xbf7a87=_0x46b1ea[_0x21ea74];return _0xbf7a87;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x46b1(){const _0x44100a=['β\x20Created\x20segment\x20\x27','yellow','segments','createSegment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','\x27\x20with\x20ID:\x20','220407ZokpWb','ruleFile','\x27...','Segment\x20name:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','1946445Pukkya','execute','Examples:','6351448ibToxW','Site:\x20','rule','270BCnupw','description','6avZRAY','kind','folder','includes','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20folder\x20ID:\x20','3458TcPalZ','676230VAvdjU','366030vhPEdo','folderId','data','121vLNKlY','2393772YxPhbx','error','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','99TDYZwG','length','Target\x20path:\x20','parent','type','name','verbose','segment','resolvePathToResource','\x20\x20\x20Path:\x20','β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','60daqdtw','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','noCountPopulation'];a26_0x46b1=function(){return _0x44100a;};return a26_0x46b1();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x261f06 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x4e4376(0x13b)]='segment:create';['description']=a26_0x4e4376(0x15d);async[a26_0x4e4376(0x152)](_0x17c2e5){const _0x57a373=a26_0x4e4376;console['error'](a26_0x261f06[_0x57a373(0x145)](_0x57a373(0x140))),console[_0x57a373(0x166)](a26_0x261f06['yellow'](_0x57a373(0x167)));const {options:_0x156504,args:_0x59210a,tdx:_0x5a4b30}=_0x17c2e5,_0x23226b=_0x156504;if(_0x59210a[_0x57a373(0x137)]===0x0)return console[_0x57a373(0x166)](_0x57a373(0x148)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x57a373(0x166)](_0x57a373(0x153)),console['error'](_0x57a373(0x14a)),console['error'](_0x57a373(0x150)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x4e57fa=_0x59210a[0x0],_0x3db204=_0x156504['segmentPath'];let _0x3fbb52=_0x4e57fa;_0x3db204&&!_0x4e57fa[_0x57a373(0x15c)]('/')&&(_0x3fbb52=_0x3db204+'/'+_0x4e57fa,_0x23226b[_0x57a373(0x13c)]&&console[_0x57a373(0x166)]('Resolved\x20relative\x20path\x20to:\x20'+_0x3fbb52));const _0x18b181=parsePath(_0x3fbb52);if(_0x18b181['segments'][_0x57a373(0x137)]<0x2)return console[_0x57a373(0x166)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x57a373(0x166)](_0x57a373(0x142)),0x1;const _0x3e5062=_0x18b181[_0x57a373(0x146)][0x0],_0x34f43b=getBaseName(_0x3fbb52),_0x458d6e=getParentPath(_0x3fbb52);_0x23226b[_0x57a373(0x13c)]&&(console[_0x57a373(0x166)](_0x57a373(0x155)+_0x23226b['site']),console[_0x57a373(0x166)](_0x57a373(0x138)+_0x3fbb52),console[_0x57a373(0x166)](_0x57a373(0x149)+_0x3e5062),console['error'](_0x57a373(0x14f)+_0x34f43b),console[_0x57a373(0x166)]('Parent\x20path:\x20'+_0x458d6e));const _0x38a671=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3e5062+'\x27...',()=>_0x5a4b30[_0x57a373(0x13d)]['resolveParentId'](_0x3e5062),{'verbose':_0x23226b[_0x57a373(0x13c)]}),_0x499f31=_0x38a671[_0x57a373(0x163)];let _0x37148b;if(_0x18b181['segments'][_0x57a373(0x137)]>0x2){const _0x3fe54f=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x458d6e+_0x57a373(0x14e),()=>_0x5a4b30[_0x57a373(0x13d)][_0x57a373(0x13e)](_0x458d6e),{'verbose':_0x23226b['verbose']}),_0x5cf050=_0x3fe54f[_0x57a373(0x163)];if(_0x5cf050['type']!==_0x57a373(0x15b)&&_0x5cf050[_0x57a373(0x13a)]!==_0x57a373(0x139))return console[_0x57a373(0x166)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x37148b=_0x5cf050[_0x57a373(0x162)];}else{if(_0x23226b[_0x57a373(0x15b)]){const _0x1b0309=await withSpinner('Resolving\x20folder\x20\x27'+_0x23226b[_0x57a373(0x15b)]+'\x27...',()=>_0x5a4b30['segment']['resolveFolderId'](_0x499f31,_0x23226b[_0x57a373(0x15b)]),{'verbose':_0x23226b[_0x57a373(0x13c)]});_0x37148b=_0x1b0309[_0x57a373(0x163)];}}_0x23226b[_0x57a373(0x13c)]&&_0x37148b&&console[_0x57a373(0x166)](_0x57a373(0x15e)+_0x37148b);const _0x308bfe=await loadJSONFromOptions(_0x23226b[_0x57a373(0x156)],_0x23226b[_0x57a373(0x14d)]),_0x22a751={'name':_0x34f43b,'description':_0x23226b[_0x57a373(0x158)],'rule':_0x308bfe,'kind':_0x23226b[_0x57a373(0x15a)]!==undefined?parseInt(_0x23226b['kind'],0xa):undefined,'isVisible':_0x23226b['invisible']?![]:undefined,'segmentFolderId':_0x37148b,'countPopulation':_0x23226b[_0x57a373(0x143)]?![]:undefined},_0x6f0fe6=await withSpinner('Creating\x20segment\x20\x27'+_0x34f43b+_0x57a373(0x14e),()=>_0x5a4b30[_0x57a373(0x13d)][_0x57a373(0x147)](_0x499f31,_0x22a751),{'verbose':_0x23226b[_0x57a373(0x13c)]}),_0x34fd20=_0x6f0fe6[_0x57a373(0x163)];return console[_0x57a373(0x166)](_0x57a373(0x144)+_0x34fd20['name']+_0x57a373(0x14b)+_0x34fd20['id']),_0x3fbb52!==_0x4e57fa&&console[_0x57a373(0x166)](_0x57a373(0x13f)+_0x3fbb52),await handleSDKOutput([_0x34fd20],_0x23226b),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x1f038d=a27_0x40f8;function a27_0x34fc(){const _0x2e6b43=['segment','site','191OUMJRJ','error','json','description','\x20field','jsonl','parentSegment','14KvgNIh','execute','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','1873390TStVXB','229848vDWTtO','Site:\x20','length','1389264rGCeqS','verbose','3849904UxAaUt','12vsOVjz','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','13277560FquebR','Parent\x20segment:\x20','data','469917rawtrj','3802iBbCFd'];a27_0x34fc=function(){return _0x2e6b43;};return a27_0x34fc();}function a27_0x40f8(_0x86b4fa,_0x5366d9){_0x86b4fa=_0x86b4fa-0x155;const _0x34fc58=a27_0x34fc();let _0x40f8d3=_0x34fc58[_0x86b4fa];return _0x40f8d3;}(function(_0x573500,_0x4b024e){const _0x41da3e=a27_0x40f8,_0x7eed83=_0x573500();while(!![]){try{const _0x18f811=parseInt(_0x41da3e(0x158))/0x1*(parseInt(_0x41da3e(0x155))/0x2)+parseInt(_0x41da3e(0x163))/0x3+-parseInt(_0x41da3e(0x169))/0x4*(parseInt(_0x41da3e(0x162))/0x5)+-parseInt(_0x41da3e(0x166))/0x6*(parseInt(_0x41da3e(0x15f))/0x7)+parseInt(_0x41da3e(0x168))/0x8+-parseInt(_0x41da3e(0x16f))/0x9+parseInt(_0x41da3e(0x16c))/0xa;if(_0x18f811===_0x4b024e)break;else _0x7eed83['push'](_0x7eed83['shift']());}catch(_0xc3b615){_0x7eed83['push'](_0x7eed83['shift']());}}}(a27_0x34fc,0x94c56));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a27_0x1f038d(0x15b)]='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x1f038d(0x160)](_0x12d17c){const _0x53b2e9=a27_0x1f038d,{options:_0x4d1126,args:_0x3b27b9,tdx:_0x35aa6d}=_0x12d17c,_0x23ff17=_0x3b27b9[0x0]||_0x4d1126[_0x53b2e9(0x15e)];if(!_0x23ff17)return console['error'](_0x53b2e9(0x16a)),console['error'](_0x53b2e9(0x161)),console['error'](_0x53b2e9(0x16b)),0x1;_0x4d1126[_0x53b2e9(0x167)]&&(console[_0x53b2e9(0x159)](_0x53b2e9(0x164)+_0x4d1126[_0x53b2e9(0x157)]),console[_0x53b2e9(0x159)](_0x53b2e9(0x16d)+_0x23ff17));const _0x5a6c8a=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x23ff17+'\x27...',()=>_0x35aa6d[_0x53b2e9(0x156)]['listFields'](_0x23ff17),{'verbose':_0x4d1126[_0x53b2e9(0x167)]}),_0x1dc428=_0x5a6c8a[_0x53b2e9(0x16e)];console[_0x53b2e9(0x159)]('β\x20Found\x20'+_0x1dc428[_0x53b2e9(0x165)]+_0x53b2e9(0x15c)+(_0x1dc428[_0x53b2e9(0x165)]!==0x1?'s':''));if(_0x4d1126[_0x53b2e9(0x15a)]||_0x4d1126[_0x53b2e9(0x15d)])return await handleSDKOutput(_0x1dc428,_0x4d1126),0x0;return displayFieldsHumanReadable(_0x1dc428,_0x23ff17),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x4da49e=a28_0x8f85;function a28_0x8f85(_0x4e0936,_0x2354fc){_0x4e0936=_0x4e0936-0x82;const _0x3a6cd0=a28_0x3a6c();let _0x8f8587=_0x3a6cd0[_0x4e0936];return _0x8f8587;}(function(_0x356b47,_0x229131){const _0x32c66a=a28_0x8f85,_0x153a76=_0x356b47();while(!![]){try{const _0x53952b=parseInt(_0x32c66a(0x8d))/0x1+parseInt(_0x32c66a(0xb1))/0x2*(parseInt(_0x32c66a(0x8f))/0x3)+parseInt(_0x32c66a(0xab))/0x4+-parseInt(_0x32c66a(0xae))/0x5*(parseInt(_0x32c66a(0xa3))/0x6)+-parseInt(_0x32c66a(0xa2))/0x7+parseInt(_0x32c66a(0x96))/0x8+-parseInt(_0x32c66a(0xb2))/0x9*(-parseInt(_0x32c66a(0x95))/0xa);if(_0x53952b===_0x229131)break;else _0x153a76['push'](_0x153a76['shift']());}catch(_0x89b9a2){_0x153a76['push'](_0x153a76['shift']());}}}(a28_0x3a6c,0xc5d7c));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x5c8c61 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0xb69ade from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x3a6c(){const _0x5850d7=['content','counts','site','activations','\x20\x20Target:\x20','\x20changed\x20files','segments','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','filter','dryRun','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Write\x20','\x20activations','\x0aPull\x20summary\x20for\x20\x27','yes','helpText','session','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20journeys','\x20new\x20files','isNew','error','Aborted.','parentSegment','segment','execute','parent_segment','setPhase','utf-8','yellow','absolutePath','file','\x20segments','639833RYaRVy','cyan','255pbdASu','parentName','β\x20Context\x20set:\x20','\x20versions)','\x20files\x20to\x20','β\x20Pulled\x20','1540vMrILq','3563984PPMCsa','verbose','pullSegments','diff','journeys','red','files','Site:\x20','\x27...','repeat','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','description','7088480WPfdxL','1326eofVBl','hasChanges','resourceName','errorCode','\x20\x20π―\x20','green','relativePath','targetDir','5140552dRHXoY','\x20\x20πΊοΈ\x20\x20','length','34495sBmqls','Target\x20resource:\x20','journeyVersions','560uGdHSe','55719TXzguf','\x20=\x20','β\x20All\x20files\x20are\x20up\x20to\x20date','type','dirname','\x20unchanged\x20files'];a28_0x3a6c=function(){return _0x5850d7;};return a28_0x3a6c();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a28_0x4da49e(0xa1)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a28_0x4da49e(0x85)](_0x12e862){const _0x10b38b=a28_0x4da49e,{options:_0xc29031,args:_0x1f214a,tdx:_0x200948}=_0x12e862,_0x8d5fc7=_0xc29031,_0x5d4830=await resolveTarget({'arg':_0x1f214a[0x0],'contextParent':_0xc29031[_0x10b38b(0x83)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5d4830))return _0x5d4830[_0x10b38b(0xa6)]==='no_parent'?(console['error'](a28_0x5c8c61[_0x10b38b(0x89)](_0x10b38b(0xc3))),console[_0x10b38b(0xd1)]('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)'),console[_0x10b38b(0xd1)](_0x10b38b(0xc0)),console['error'](_0x10b38b(0xcd))):(console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0x9b)](_0x10b38b(0xbf)+_0x5d4830['message']+'\x0a')),_0x5d4830['helpText']&&console['error'](a28_0x5c8c61[_0x10b38b(0x8e)](_0x5d4830[_0x10b38b(0xc8)]))),0x1;const _0x12a33c=_0x5d4830['parentName'],_0x34cea9=_0x5d4830['targetDir'],_0x19e035=_0x5d4830[_0x10b38b(0xb5)]===_0x10b38b(0x8b)?_0x5d4830[_0x10b38b(0xa5)]:undefined;_0x8d5fc7[_0x10b38b(0x97)]&&(console[_0x10b38b(0xd1)](_0x10b38b(0x9d)+_0x8d5fc7[_0x10b38b(0xba)]),console[_0x10b38b(0xd1)]('Parent\x20segment:\x20'+_0x12a33c),_0x19e035&&console[_0x10b38b(0xd1)](_0x10b38b(0xaf)+_0x19e035));const _0x3d7659=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x12a33c+_0x10b38b(0x9e),_0x45246a=>_0x200948[_0x10b38b(0x84)][_0x10b38b(0x98)](_0x12a33c,{'targetDir':_0x34cea9,'targetResourceName':_0x19e035,'verbose':_0x8d5fc7[_0x10b38b(0x97)],'progress':{'update':_0x223f8c=>{const _0x26fcb5=_0x10b38b;_0x45246a[_0x26fcb5(0x87)](_0x223f8c),_0x8d5fc7[_0x26fcb5(0x97)]&&console[_0x26fcb5(0xd1)]('\x20\x20'+_0x223f8c);}}}),{'verbose':_0x8d5fc7['verbose']}),_0x14568f=_0x3d7659['data'];if(_0x14568f[_0x10b38b(0xb9)]['segments']===0x0&&_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0x9a)]===0x0)return console['error'](a28_0x5c8c61[_0x10b38b(0x89)](_0x10b38b(0xa0)+_0x14568f[_0x10b38b(0x90)]+'\x27')),0x0;const _0x1146c4=_0x14568f[_0x10b38b(0x9c)]['filter'](_0x5baeb5=>_0x5baeb5[_0x10b38b(0xd0)]),_0x50a896=_0x14568f['files'][_0x10b38b(0xc1)](_0x24e7f8=>!_0x24e7f8[_0x10b38b(0xd0)]&&_0x24e7f8[_0x10b38b(0xa4)]),_0x3a6eb7=_0x14568f[_0x10b38b(0x9c)]['filter'](_0x5cf96d=>!_0x5cf96d[_0x10b38b(0xd0)]&&!_0x5cf96d['hasChanges']);console[_0x10b38b(0xd1)](_0x10b38b(0xc6)+_0x14568f[_0x10b38b(0x90)]+'\x27:'),console['error'](_0x10b38b(0xa7)+a28_0x5c8c61[_0x10b38b(0x8e)](_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0xbe)]+_0x10b38b(0x8c))+'\x20with\x20'+a28_0x5c8c61[_0x10b38b(0x8e)](_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0xbb)]+_0x10b38b(0xc5)));if(_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0x9a)]>0x0){const _0x2bdf09=_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0xb0)]>_0x14568f[_0x10b38b(0xb9)]['journeys']?'\x20('+_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0xb0)]+_0x10b38b(0x92):'';console['error'](_0x10b38b(0xac)+a28_0x5c8c61[_0x10b38b(0x8e)](_0x14568f['counts'][_0x10b38b(0x9a)]+_0x10b38b(0xce))+a28_0x5c8c61['dim'](_0x2bdf09));}console[_0x10b38b(0xd1)]('\x20\x20'+a28_0x5c8c61[_0x10b38b(0xa8)]('+\x20'+_0x1146c4['length']+_0x10b38b(0xcf))),console[_0x10b38b(0xd1)]('\x20\x20'+a28_0x5c8c61[_0x10b38b(0x89)]('~\x20'+_0x50a896['length']+_0x10b38b(0xbd))),console['error']('\x20\x20'+a28_0x5c8c61[_0x10b38b(0xcb)]('=\x20'+_0x3a6eb7[_0x10b38b(0xad)]+_0x10b38b(0xb7))),console['error'](_0x10b38b(0xbc)+a28_0x5c8c61[_0x10b38b(0x8e)](_0x14568f[_0x10b38b(0xaa)])+'\x0a');if(_0x50a896[_0x10b38b(0xad)]>0x0)for(const _0x3f6526 of _0x50a896){console[_0x10b38b(0xd1)]('\x0aChanges\x20to\x20\x27'+_0x3f6526[_0x10b38b(0xa9)]+'\x27:'),console[_0x10b38b(0xd1)]('β'['repeat'](0x3c)),console[_0x10b38b(0xd1)](_0x3f6526[_0x10b38b(0x99)]),console[_0x10b38b(0xd1)]('β'[_0x10b38b(0x9f)](0x3c));}if(_0x8d5fc7[_0x10b38b(0xc2)])return console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0x89)](_0x10b38b(0xca))),0x0;if(_0x1146c4[_0x10b38b(0xad)]===0x0&&_0x50a896[_0x10b38b(0xad)]===0x0)return console[_0x10b38b(0xd1)](a28_0x5c8c61['green'](_0x10b38b(0xb4))),saveSessionContext({'parent_segment':_0x14568f[_0x10b38b(0x90)]},_0x8d5fc7[_0x10b38b(0xc9)]),console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0xa8)](_0x10b38b(0x91)+a28_0x5c8c61[_0x10b38b(0xcb)](_0x10b38b(0x86))+'\x20=\x20'+a28_0x5c8c61['cyan'](_0x14568f[_0x10b38b(0x90)]))),0x0;if(!_0x8d5fc7[_0x10b38b(0xc7)]){const _0x2b74df=await confirmKey(_0x10b38b(0xc4)+(_0x1146c4[_0x10b38b(0xad)]+_0x50a896[_0x10b38b(0xad)])+_0x10b38b(0xcc));if(!_0x2b74df)return console[_0x10b38b(0xd1)](_0x10b38b(0x82)),0x1;}for(const _0x4d3506 of _0x14568f[_0x10b38b(0x9c)]){if(_0x4d3506[_0x10b38b(0xd0)]||_0x4d3506[_0x10b38b(0xa4)]){const _0x41c35b=a28_0xb69ade[_0x10b38b(0xb6)](_0x4d3506[_0x10b38b(0x8a)]);!existsSync(_0x41c35b)&&mkdirSync(_0x41c35b,{'recursive':!![]}),writeFileSync(_0x4d3506[_0x10b38b(0x8a)],_0x4d3506[_0x10b38b(0xb8)],_0x10b38b(0x88));}}return console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0xa8)](_0x10b38b(0x94)+(_0x1146c4[_0x10b38b(0xad)]+_0x50a896[_0x10b38b(0xad)])+_0x10b38b(0x93)+_0x14568f[_0x10b38b(0xaa)])),saveSessionContext({'parent_segment':_0x14568f[_0x10b38b(0x90)]},_0x8d5fc7['session']),console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0xa8)](_0x10b38b(0x91)+a28_0x5c8c61[_0x10b38b(0xcb)](_0x10b38b(0x86))+_0x10b38b(0xb3)+a28_0x5c8c61['cyan'](_0x14568f[_0x10b38b(0x90)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x286f31=a29_0x5032;function a29_0x5032(_0x176864,_0x16307c){_0x176864=_0x176864-0x7a;const _0x45aab8=a29_0x45aa();let _0x50322a=_0x45aab8[_0x176864];return _0x50322a;}(function(_0x3cf8db,_0x1a6194){const _0x327aae=a29_0x5032,_0x45d452=_0x3cf8db();while(!![]){try{const _0x158b6f=-parseInt(_0x327aae(0xaa))/0x1*(-parseInt(_0x327aae(0xdd))/0x2)+-parseInt(_0x327aae(0x90))/0x3*(parseInt(_0x327aae(0xbc))/0x4)+parseInt(_0x327aae(0xae))/0x5*(parseInt(_0x327aae(0xb6))/0x6)+parseInt(_0x327aae(0x106))/0x7*(-parseInt(_0x327aae(0x8c))/0x8)+parseInt(_0x327aae(0x9f))/0x9*(-parseInt(_0x327aae(0xec))/0xa)+parseInt(_0x327aae(0xd9))/0xb+parseInt(_0x327aae(0x87))/0xc;if(_0x158b6f===_0x1a6194)break;else _0x45d452['push'](_0x45d452['shift']());}catch(_0x3c7dfc){_0x45d452['push'](_0x45d452['shift']());}}}(a29_0x45aa,0x7caab));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_0x7fbe0c 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';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';function a29_0x45aa(){const _0x44a96f=['\x20activations]','setPhase','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','journeysOnly','listJourneysWithDetailsFromParentSegment','isNew','description','new','push','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toCreate','delete','journeys','Scoped\x20to\x20folder:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','.yaml','toDelete','653988fOUcyG','length','folders','createdAt','isScoped','4184QjRiDn','Error:\x20Directory\x20not\x20found:\x20','parent_name','endsWith','15SHZCIk','Delete\x20journey:','attributes','\x20changes?','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','activations','Source\x20directory:\x20','existingJourney','Aborted.','filePath','β\x20All\x20journeys\x20are\x20up\x20to\x20date','(Journey\x20will\x20be\x20deleted)','dim','Changes\x20to\x20journey:','9vjUbDC','segments','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','data','join','Fetching\x20connections\x20for\x20name\x20resolution...','resolveParentId','\x20\x20Activations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','then','1vELsOs','segment:push','yellow','versionNumber','130ahkJTp','journeyBundleName','journeyId','unchanged','audienceId','segment\x20or\x20journey','\x20new','Changes\x20to:','74274pIWFot','/j/da/je','connection','segmentFolderId','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','filter','481196UhFWDj','yes','Resolving\x20parent\x20segment\x20\x27','changed','set','green','scopedFolderPath','segment','results','\x20to\x20update','\x20unchanged','Fetching\x20existing\x20journeys...','\x0aβ\x20Push\x20complete','\x20updated','relationships','idToName','\x20folders\x20to\x20create','\x20created','Delete\x20segment:','\x20to\x20delete','folderPath','created','helpText','getJourney','\x20\x20Journeys:\x20','/e/','parentSegment','site','\x20\x20Activations:','10567205SnimDs','type','nameToId','message','1797872DaPdlD','blue','getOutputSchemaWithCache','verbose','\x20\x20π\x20Segments:','buildUserMaps','.yml','red','get','user','repeat','journey','folderId','New\x20journey:','name','5071970nHIVvZ','error','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','yamlConfig','state','\x0aValidation\x20failed:','Fetching\x20parent\x20segment\x20details...','toUpdate','file','\x27...','\x20YAML\x20files\x20found','updatedAt','all','\x20\x20\x20\x20','diff','\x20changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','paused','Push\x20','updated','cwd','Site:\x20','\x20deleted','Fetching\x20existing\x20activations...','\x20\x20Source:\x20','targetDir','8253yYqhtm','Parent\x20segment:\x20','map','cyan','/app/ps/','Fetching\x20existing\x20segments...'];a29_0x45aa=function(){return _0x44a96f;};return a29_0x45aa();}export class SegmentPushCommand extends BaseCommand{[a29_0x286f31(0xeb)]=a29_0x286f31(0xab);[a29_0x286f31(0x7b)]=a29_0x286f31(0xa8);async['execute'](_0x27d89b){const _0x58d216=a29_0x286f31,{options:_0x413651,args:_0xcdf34,tdx:_0x399eaa}=_0x27d89b,_0x319cb7=_0x413651,_0x19cdfa=await resolveTarget({'arg':_0xcdf34[0x0],'contextParent':_0x413651[_0x58d216(0xd6)],'cwd':process[_0x58d216(0x100)]()});if(!isSuccessfulResolution(_0x19cdfa))return _0x19cdfa['errorCode']===_0x58d216(0x94)?(console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0x95))),console[_0x58d216(0xed)]('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[_0x58d216(0xed)](_0x58d216(0xfc)),console[_0x58d216(0xed)](_0x58d216(0x84))):(console[_0x58d216(0xed)](a29_0x7fbe0c['red']('Error:\x20'+_0x19cdfa[_0x58d216(0xdc)]+'\x0a')),_0x19cdfa[_0x58d216(0xd2)]&&console['error'](a29_0x7fbe0c[_0x58d216(0x109)](_0x19cdfa[_0x58d216(0xd2)]))),0x1;if(_0x19cdfa['type']===_0x58d216(0x8e))return console['error'](a29_0x7fbe0c['red'](_0x58d216(0x8d)+_0x19cdfa[_0x58d216(0x105)]+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0x7f))),0x1;const _0x4ccf37=_0x19cdfa['parentName'],_0x4f20d6=_0x19cdfa['targetDir'],_0xc70a1c=_0x19cdfa[_0x58d216(0xda)]===_0x58d216(0xf4)?_0x19cdfa[_0x58d216(0x9a)]:undefined,_0x5706ec=getScopedDetails(_0x19cdfa),_0x15a0cd=_0x5706ec?.[_0x58d216(0x8b)]??![],_0x1b7f36=_0x5706ec?.[_0x58d216(0xc2)]??'';if(!existsSync(_0x4f20d6))return console[_0x58d216(0xed)](a29_0x7fbe0c['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x4f20d6+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0x7f))),0x1;_0x319cb7['verbose']&&(console['error'](_0x58d216(0x101)+_0x319cb7[_0x58d216(0xd7)]),console[_0x58d216(0xed)](_0x58d216(0x107)+_0x4ccf37),console[_0x58d216(0xed)](_0x58d216(0x97)+_0x4f20d6),_0x15a0cd&&console[_0x58d216(0xed)](_0x58d216(0x83)+_0x1b7f36));const _0x381885=await withSpinner(_0x58d216(0xbe)+_0x4ccf37+_0x58d216(0xf5),()=>_0x399eaa['segment'][_0x58d216(0xa5)](_0x4ccf37),{'verbose':_0x319cb7['verbose']}),_0x91d0a1=_0x381885[_0x58d216(0xa2)],[_0x567b6a,_0x528521,_0x3b2915,_0x30c69f,_0x4f0302]=await Promise[_0x58d216(0xf8)]([withSpinner(_0x58d216(0xf2),()=>_0x399eaa[_0x58d216(0xc3)]['getParent'](_0x91d0a1),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner(_0x58d216(0x10b),()=>_0x399eaa[_0x58d216(0xc3)]['listSegments'](_0x91d0a1),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x399eaa['segment']['listFolders'](_0x91d0a1),{'verbose':_0x319cb7['verbose']}),withSpinner(_0x58d216(0xc7),()=>_0x399eaa['journey'][_0x58d216(0x110)](_0x91d0a1,{'includeAllVersions':!![]}),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x399eaa[_0x58d216(0xe6)][_0x58d216(0xe2)](),{'verbose':_0x319cb7[_0x58d216(0xe0)]})[_0x58d216(0xa9)](_0x159059=>_0x159059['data'])]),_0x3bf602=_0x567b6a['data'],_0x1a2c89=extractRootFolderId(_0x3bf602),_0x5f0e92=_0x528521[_0x58d216(0xa2)],_0x23c4d6=_0x3b2915['data'],{journeys:_0x2de25c,activationStepsById:_0x2cd6f0}=_0x30c69f[_0x58d216(0xa2)],_0x350907=new Map(_0x2de25c[_0x58d216(0x108)](_0xcd70e3=>[_0xcd70e3['id'],_0xcd70e3])),_0x1443e4=_0x2de25c['map'](_0x2bd938=>({'id':_0x2bd938['id'],'name':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xeb)],'journeyBundleName':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xaf)]||'','journeyBundleId':_0x2bd938[_0x58d216(0x92)]['journeyBundleId']||'','versionNumber':_0x2bd938['attributes'][_0x58d216(0xad)],'description':_0x2bd938['attributes'][_0x58d216(0x7b)],'state':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xf0)],'paused':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xfd)],'audienceId':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xb2)],'folderId':_0x2bd938[_0x58d216(0xca)]?.['parentFolder']?.[_0x58d216(0xa2)]?.['id'],'createdAt':_0x2bd938[_0x58d216(0x92)][_0x58d216(0x8a)],'updatedAt':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xf7)]})),{emailToId:_0x477eb4,idToEmail:_0xb51417}=_0x4f0302,_0x19a77d=await withSpinner(_0x58d216(0xa4),async()=>{const _0x4115dc=_0x58d216,_0x22f274=await _0x399eaa[_0x4115dc(0xb8)]['list']();return buildConnectionMaps(_0x22f274);},{'verbose':_0x319cb7['verbose']})[_0x58d216(0xa9)](_0x43ff9f=>_0x43ff9f['data']),_0x5a408c=_0x19a77d['nameToId'],_0x2df1e4=_0x19a77d[_0x58d216(0xcb)],_0x577615=_0x19a77d['nameToType'],_0x58d223={'emailToIdMap':_0x477eb4,'connectionNameToIdMap':_0x5a408c,'connectionNameToTypeMap':_0x577615,'getSchema':_0x114f03=>_0x399eaa['connection'][_0x58d216(0xdf)](_0x114f03)};let {pathToId:_0x10d0aa,idToPath:_0x5d16f2}=buildFolderMaps(_0x23c4d6);const _0x5c23ac=buildSegmentLookupMap(_0x5f0e92,_0x5d16f2),_0x256e2c=buildSegmentNameToIdMap(_0x5f0e92),_0x3ed365=buildJourneyBundleLookupMap(_0x1443e4,_0x5d16f2);let _0x531b4b;if(_0xc70a1c){if(!_0xc70a1c[_0x58d216(0x8f)](_0x58d216(0xe3))&&!_0xc70a1c[_0x58d216(0x8f)](_0x58d216(0x85)))return console[_0x58d216(0xed)](a29_0x7fbe0c['red'](_0x58d216(0x10e)+_0xc70a1c+'\x0a')),0x1;_0x531b4b=[_0xc70a1c];}else _0x531b4b=findYamlFiles(_0x4f20d6);if(_0x531b4b[_0x58d216(0x88)]===0x0)return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4f20d6+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0xee))),0x1;let _0x253d63,_0x55c8e2;try{const _0x2aea0f=parseAndClassifyYamlFiles(_0x531b4b,_0x4f20d6,{'skipSegments':_0x319cb7[_0x58d216(0x10f)]});_0x253d63=_0x2aea0f[_0x58d216(0xa0)],_0x55c8e2=_0x2aea0f[_0x58d216(0x82)];const _0x403527=validateParsedFiles(_0x2aea0f,_0x4f20d6);if(_0x403527[_0x58d216(0x88)]>0x0)return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0xf1))),console[_0x58d216(0xed)](formatValidationErrors(_0x403527)),console['error'](a29_0x7fbe0c[_0x58d216(0xac)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1504a9){return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('Error\x20parsing\x20YAML:\x20'+(_0x1504a9 instanceof Error?_0x1504a9[_0x58d216(0xdc)]:_0x1504a9))),0x1;}if(_0x253d63['length']===0x0&&_0x55c8e2[_0x58d216(0x88)]===0x0){const _0x134342=_0x319cb7['journeysOnly']?_0x58d216(0xe8):_0x58d216(0xb3);return console[_0x58d216(0xed)](a29_0x7fbe0c['yellow']('No\x20'+_0x134342+_0x58d216(0xf6))),0x0;}const _0x401037=new Map();_0x5f0e92['length']>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&await withSpinner(_0x58d216(0x103),async()=>{await batchAsync(_0x5f0e92,async _0x6f161b=>{const _0x54b17c=a29_0x5032,_0xd33def=await _0x399eaa[_0x54b17c(0xc3)]['listActivations'](_0x91d0a1,_0x6f161b['id']);_0x401037[_0x54b17c(0xc0)](_0x6f161b['id'],_0xd33def);});},{'verbose':_0x319cb7[_0x58d216(0xe0)]});const {segmentFiles:_0x5e9c13,foldersToCreate:_0x5e2ea7}=await prepareSegmentFiles(_0x253d63,{'segmentByFolderAndName':_0x5c23ac,'activationsBySegmentId':_0x401037,'folderPathToId':_0x10d0aa,'idToEmailMap':_0xb51417,'connectionIdToNameMap':_0x2df1e4},_0x58d223,_0x15a0cd,_0x1b7f36),_0x17b982=_0xc70a1c?[]:findSegmentsToDelete(_0x5f0e92,_0x253d63[_0x58d216(0x108)](({yamlConfig:_0x43734a,folderPath:_0x25f057})=>({'yamlConfig':_0x43734a,'folderPath':resolveTDFolderPath(_0x25f057,_0x15a0cd,_0x1b7f36)})),_0x5d16f2,_0x1b7f36,_0x15a0cd),{journeyFiles:_0x4df179,foldersToCreate:_0xc3772f}=await withProgressSpinner('Preparing\x20journeys...',async _0x20f955=>prepareJourneyFiles(_0x55c8e2,{'fetchJourney':async _0x35bc58=>_0x399eaa[_0x58d216(0xe8)][_0x58d216(0xd3)](_0x35bc58[_0x58d216(0xb0)]),'journeyBundlesByFolderAndName':_0x3ed365,'folderPathToId':_0x10d0aa,'idToEmailMap':_0xb51417,'connectionIdToNameMap':_0x2df1e4,'existingSegments':_0x5f0e92,'parentId':_0x91d0a1,'deps':_0x399eaa,'progress':{'update':_0x4d8892=>{const _0x556f1e=_0x58d216;_0x20f955[_0x556f1e(0x10d)](_0x4d8892),_0x319cb7[_0x556f1e(0xe0)]&&console['error']('\x20\x20'+_0x4d8892);}},'journeyById':_0x350907,'activationStepsById':_0x2cd6f0},_0x15a0cd,_0x1b7f36),{'verbose':_0x319cb7[_0x58d216(0xe0)]})['then'](_0x21d58d=>_0x21d58d[_0x58d216(0xa2)]);for(const _0x42fca1 of _0xc3772f){_0x5e2ea7['add'](_0x42fca1);}const _0xfed488=_0xc70a1c?[]:findJourneysToDelete(_0x1443e4,_0x55c8e2[_0x58d216(0x108)](({yamlConfig:_0x58e286,folderPath:_0x3b6fa3})=>({'yamlConfig':_0x58e286,'folderPath':resolveTDFolderPath(_0x3b6fa3,_0x15a0cd,_0x1b7f36)})),_0x5d16f2,_0x1b7f36,_0x15a0cd),_0x3a4b5b=calculatePushStats(_0x5e9c13,_0x4df179,_0x5e2ea7,_0x17b982,_0xfed488,!!_0x319cb7[_0x58d216(0x81)],!!_0x319cb7['journeysOnly']),_0x3d724c=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0x7c)],_0x551952=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0xbf)],_0x25023c=_0x3a4b5b[_0x58d216(0xa0)]['unchanged'],_0x3c5349=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0x86)],_0x1126e4=_0x3a4b5b[_0x58d216(0x89)][_0x58d216(0x80)],_0x103929=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0x7c)],_0x211b25=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0xbf)],_0x36c32c=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0xb1)],_0x2ae8e4=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0x86)],_0x530eb4=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0xf8)],_0x4e308c=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0x80)],_0x382d4a=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0xf3)],_0x1fab77=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0x86)];console[_0x58d216(0xed)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4ccf37+'\x27:');_0x1126e4[_0x58d216(0x88)]>0x0&&console['error']('\x20\x20'+a29_0x7fbe0c[_0x58d216(0xde)]('π\x20'+_0x1126e4[_0x58d216(0x88)]+_0x58d216(0xcc)));if(!_0x319cb7[_0x58d216(0x10f)]){console[_0x58d216(0xed)](_0x58d216(0xe1)),console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x3d724c[_0x58d216(0x88)]+_0x58d216(0xb4))),console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x551952[_0x58d216(0x88)]+_0x58d216(0xfb)));if(_0x3c5349[_0x58d216(0x88)]>0x0)console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xe4)]('-\x20'+_0x3c5349[_0x58d216(0x88)]+'\x20to\x20delete'));else _0x17b982[_0x58d216(0x88)]>0x0&&!_0x319cb7['delete']&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c['dim'](_0x17b982[_0x58d216(0x88)]+_0x58d216(0xa1)));console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0x9d)]('=\x20'+_0x25023c[_0x58d216(0x88)]+_0x58d216(0xc6)));}if(_0x4df179[_0x58d216(0x88)]>0x0||_0xfed488['length']>0x0){console[_0x58d216(0xed)]('\x20\x20πΊοΈ\x20\x20Journeys:'),console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x103929[_0x58d216(0x88)]+_0x58d216(0xb4))),console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x211b25[_0x58d216(0x88)]+_0x58d216(0xfb)));if(_0x2ae8e4[_0x58d216(0x88)]>0x0)console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c['red']('-\x20'+_0x2ae8e4[_0x58d216(0x88)]+_0x58d216(0xcf)));else _0xfed488[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x81)]&&console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0x9d)](_0xfed488['length']+_0x58d216(0xa1)));console[_0x58d216(0xed)]('\x20\x20\x20\x20'+a29_0x7fbe0c[_0x58d216(0x9d)]('=\x20'+_0x36c32c[_0x58d216(0x88)]+'\x20unchanged'));}_0x530eb4['length']>0x0&&!_0x319cb7['journeysOnly']&&(console[_0x58d216(0xed)](''),console['error'](_0x58d216(0xd8)),_0x4e308c[_0x58d216(0x88)]>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x4e308c[_0x58d216(0x88)]+'\x20to\x20create')),_0x382d4a['length']>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x382d4a[_0x58d216(0x88)]+_0x58d216(0xc5))),_0x1fab77[_0x58d216(0x88)]>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xe4)]('-\x20'+_0x1fab77[_0x58d216(0x88)]+_0x58d216(0xcf))));console['error'](_0x58d216(0x104)+a29_0x7fbe0c[_0x58d216(0x109)](_0x4f20d6)+'\x0a');if(_0x1126e4[_0x58d216(0x88)]>0x0){console[_0x58d216(0xed)]('Folders\x20to\x20create:');for(const _0x1eecac of _0x1126e4){console['error']('\x20\x20'+a29_0x7fbe0c[_0x58d216(0xde)]('+')+'\x20'+_0x1eecac);}console[_0x58d216(0xed)]('');}if(_0x3d724c['length']>0x0&&!_0x319cb7['journeysOnly'])for(const _0x54f572 of _0x3d724c){const _0x553d86=_0x54f572[_0x58d216(0xd0)]?_0x54f572['folderPath']+'/'+_0x54f572[_0x58d216(0xef)][_0x58d216(0xeb)]:_0x54f572[_0x58d216(0xef)][_0x58d216(0xeb)],_0x936c29=_0x54f572[_0x58d216(0xef)][_0x58d216(0x96)]?.[_0x58d216(0x88)]||0x0,_0x476c0f=_0x936c29>0x0?a29_0x7fbe0c[_0x58d216(0x9d)]('\x20['+_0x936c29+_0x58d216(0x10c)):'';console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c['green']('New\x20segment:')+'\x20'+_0x553d86+_0x476c0f),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),_0x54f572[_0x58d216(0xfa)]&&console[_0x58d216(0xed)](_0x54f572[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x3c5349[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)])for(const _0x28caea of _0x3c5349){const _0x5c33d3=_0x28caea[_0x58d216(0xb9)]?_0x5d16f2['get'](_0x28caea[_0x58d216(0xb9)]['toString']())||'':'',_0x308a16=_0x5c33d3?_0x5c33d3+'/'+_0x28caea[_0x58d216(0xeb)]:_0x28caea[_0x58d216(0xeb)],_0x4afd9e=_0x401037[_0x58d216(0xe5)](_0x28caea['id'])||[],_0x5024cf=_0x4afd9e['length']>0x0?a29_0x7fbe0c[_0x58d216(0x9d)]('\x20['+_0x4afd9e[_0x58d216(0x88)]+_0x58d216(0x10c)):'';console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0xce))+'\x20'+_0x308a16+_0x5024cf),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));const _0x117bea=segmentWithActivationsToYaml(_0x28caea,_0x4afd9e,undefined,_0xb51417,_0x2df1e4),_0x379598=segmentToYamlString(_0x117bea),_0x5ba139=generateDiff(_0x379598,'');console[_0x58d216(0xed)](formatDiffWithColors(_0x5ba139)),console['error']('β'[_0x58d216(0xe7)](0x3c));}const _0x5e34c7=_0x5e9c13[_0x58d216(0xbb)](_0x265094=>!_0x265094[_0x58d216(0x7a)]&&_0x265094['diff']);if(_0x5e34c7[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)])for(const _0x51c060 of _0x5e34c7){const _0x553a81=_0x51c060[_0x58d216(0xd0)]?_0x51c060[_0x58d216(0xd0)]+'/'+_0x51c060[_0x58d216(0xef)][_0x58d216(0xeb)]:_0x51c060[_0x58d216(0xef)]['name'];console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c['yellow'](_0x58d216(0xb5))+'\x20'+_0x553a81),console['error']('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](_0x51c060[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x103929['length']>0x0)for(const _0x45b535 of _0x103929){const _0x6937f5=_0x45b535[_0x58d216(0xd0)]?_0x45b535[_0x58d216(0xd0)]+'/'+_0x45b535['yamlConfig'][_0x58d216(0xeb)]:_0x45b535[_0x58d216(0xef)]['name'];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xc1)](_0x58d216(0xea))+'\x20'+_0x6937f5),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),_0x45b535[_0x58d216(0xfa)]&&console['error'](_0x45b535[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}const _0x5d44cc=_0x4df179[_0x58d216(0xbb)](_0x2c1d40=>!_0x2c1d40[_0x58d216(0x7a)]&&_0x2c1d40[_0x58d216(0xfa)]);if(_0x5d44cc[_0x58d216(0x88)]>0x0)for(const _0x26e342 of _0x5d44cc){const _0x4099f7=_0x26e342[_0x58d216(0xd0)]?_0x26e342[_0x58d216(0xd0)]+'/'+_0x26e342['yamlConfig']['name']:_0x26e342[_0x58d216(0xef)][_0x58d216(0xeb)];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0x9e))+'\x20'+_0x4099f7),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](_0x26e342[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x2ae8e4[_0x58d216(0x88)]>0x0)for(const _0x5b5779 of _0x2ae8e4){const _0xeb0b81=_0x5b5779[_0x58d216(0xe9)]?_0x5d16f2[_0x58d216(0xe5)](_0x5b5779[_0x58d216(0xe9)])||'':'',_0xbe86f5=_0xeb0b81?_0xeb0b81+'/'+_0x5b5779[_0x58d216(0xaf)]:_0x5b5779[_0x58d216(0xaf)];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0x91))+'\x20'+_0xbe86f5),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0x9c))),console['error']('β'[_0x58d216(0xe7)](0x3c));}if(_0x319cb7['dryRun'])return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0xa7))),0x0;const _0x4eafce=_0x319cb7[_0x58d216(0x10f)]?![]:_0x3d724c[_0x58d216(0x88)]>0x0||_0x551952[_0x58d216(0x88)]>0x0||_0x3c5349['length']>0x0,_0x113b35=_0x103929[_0x58d216(0x88)]>0x0||_0x211b25[_0x58d216(0x88)]>0x0||_0x2ae8e4[_0x58d216(0x88)]>0x0,_0x270e3a=_0x319cb7[_0x58d216(0x10f)]?![]:_0x530eb4[_0x58d216(0x88)]>0x0,_0x3fc226=_0x1126e4[_0x58d216(0x88)]>0x0;if(!_0x4eafce&&!_0x113b35&&!_0x270e3a&&!_0x3fc226){const _0x238df0=_0x319cb7[_0x58d216(0x10f)]?_0x58d216(0x9b):_0x58d216(0x7e);console['error'](a29_0x7fbe0c[_0x58d216(0xc1)](_0x238df0));if(_0xc70a1c&&_0x36c32c[_0x58d216(0x88)]===0x1){const _0xc932c9=_0x36c32c[0x0];if(_0xc932c9[_0x58d216(0x98)]?.['id']){const _0xcceed0=getConsoleNextUrl(_0x319cb7[_0x58d216(0xd7)],'/app/ps/'+_0x91d0a1+_0x58d216(0xd5)+_0xc932c9[_0x58d216(0x98)]['id']+'/j/da/je');console[_0x58d216(0xed)]('\x20\x20'+a29_0x7fbe0c[_0x58d216(0x109)](_0xcceed0));}}return 0x0;}const _0x2969c7=_0x319cb7[_0x58d216(0x10f)]?_0x103929[_0x58d216(0x88)]+_0x211b25['length']+_0x2ae8e4[_0x58d216(0x88)]+_0x1126e4[_0x58d216(0x88)]:_0x3d724c[_0x58d216(0x88)]+_0x551952[_0x58d216(0x88)]+_0x3c5349[_0x58d216(0x88)]+_0x103929['length']+_0x211b25['length']+_0x2ae8e4[_0x58d216(0x88)]+_0x1126e4[_0x58d216(0x88)]+_0x530eb4[_0x58d216(0x88)];if(!_0x319cb7[_0x58d216(0xbd)]&&_0x2969c7>0x0){const _0x466a48=await confirmKey(_0x58d216(0xfe)+_0x2969c7+_0x58d216(0x93));if(!_0x466a48)return console['error'](_0x58d216(0x99)),0x1;}const _0x3ee1e7={'withProgress':async(_0x3d19e5,_0x2141cf)=>{const _0x35cee4=_0x58d216,_0x541c95=await withSpinner(_0x3d19e5,_0x2141cf,{'verbose':_0x319cb7[_0x35cee4(0xe0)]});return{'data':_0x541c95['data']};},'logInfo':_0x93fed8=>console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xde)]('β\x20'+_0x93fed8)),'logSuccess':_0x26d59d=>console['error'](a29_0x7fbe0c[_0x58d216(0xc1)]('β\x20'+_0x26d59d)),'logWarning':_0x553e49=>console['error'](a29_0x7fbe0c['yellow']('β \x20'+_0x553e49)),'logDeleted':_0x1ad80a=>console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('β\x20'+_0x1ad80a))},_0x293ae2={'segment':_0x399eaa[_0x58d216(0xc3)],'journey':_0x399eaa[_0x58d216(0xe8)],'user':_0x399eaa['user'],'connection':_0x399eaa['connection']};_0x1126e4['length']>0x0&&(_0x10d0aa=await executePushFolders(_0x293ae2,_0x1126e4,_0x10d0aa,{'parentId':_0x91d0a1},_0x3ee1e7));const _0x205fb1={'rootFolderId':_0x1a2c89,'folderPathToId':_0x10d0aa,'folderIdToPath':_0x5d16f2,'segmentNameToId':_0x256e2c,'activationsBySegmentId':_0x401037,'emailToIdMap':_0x477eb4,'idToEmailMap':_0xb51417,'connectionNameToIdMap':_0x19a77d[_0x58d216(0xdb)],'connectionIdToNameMap':_0x19a77d['idToName'],'connectionNameToTypeMap':_0x577615},_0x126246=await executePushSegments(_0x293ae2,_0x319cb7[_0x58d216(0x10f)]?[]:_0x5e9c13,_0x205fb1,{'parentId':_0x91d0a1},_0x3ee1e7),_0x1a3782=_0x126246[_0x58d216(0xd1)],_0x4a7355=_0x126246['updated'],_0x3c462d=_0x126246[_0x58d216(0x96)]['created'],_0x17695f=_0x126246[_0x58d216(0x96)][_0x58d216(0xff)],_0x417def=_0x126246[_0x58d216(0x96)]['deleted'],_0x40c50a=await executePushSegmentDeletions(_0x293ae2,_0x319cb7[_0x58d216(0x10f)]?[]:_0x3c5349,_0x3ee1e7);let _0x33e7ff=0x0,_0x504d45=0x0,_0x36648b=0x0;const _0x578647=new Map(_0x256e2c);for(const [_0x5ab9db,_0x5cafe3]of _0x126246['createdSegmentIds']){_0x578647['set'](_0x5ab9db,_0x5cafe3);}if(_0x4df179[_0x58d216(0x88)]>0x0){const _0x331b75={..._0x205fb1,'segmentNameToId':_0x578647,'existingSegments':_0x5f0e92,'activationContext':_0x58d223},_0x22a750=await executePushJourneys(_0x293ae2,_0x4df179,_0x331b75,{'parentId':_0x91d0a1,'rootFolderId':_0x1a2c89,'verbose':_0x319cb7['verbose']},_0x3ee1e7);_0x33e7ff=_0x22a750[_0x58d216(0xd1)],_0x504d45=_0x22a750[_0x58d216(0xff)];if(_0xc70a1c&&_0x22a750[_0x58d216(0xc4)]['length']===0x1){const _0x53306b=_0x22a750[_0x58d216(0xc4)][0x0];if(_0x53306b[_0x58d216(0xb0)]){const _0x2ec812=getConsoleNextUrl(_0x319cb7['site'],_0x58d216(0x10a)+_0x91d0a1+_0x58d216(0xd5)+_0x53306b[_0x58d216(0xb0)]+_0x58d216(0xb7));console[_0x58d216(0xed)]('\x20\x20'+a29_0x7fbe0c['cyan'](_0x2ec812));}}}for(const _0x293962 of _0x2ae8e4){console[_0x58d216(0xed)](a29_0x7fbe0c['yellow'](_0x58d216(0xba)+_0x293962[_0x58d216(0xaf)])),_0x36648b++;}const _0x10a2b3=[];if(_0x1a3782>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x1a3782+_0x58d216(0xcd));if(_0x4a7355>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x4a7355+_0x58d216(0xc9));if(_0x40c50a>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x40c50a+_0x58d216(0x102));const _0x917940=[];if(_0x33e7ff>0x0)_0x917940[_0x58d216(0x7d)](_0x33e7ff+_0x58d216(0xcd));if(_0x504d45>0x0)_0x917940[_0x58d216(0x7d)](_0x504d45+'\x20updated');if(_0x36648b>0x0)_0x917940[_0x58d216(0x7d)](_0x36648b+_0x58d216(0x102));const _0x1a4868=[];if(_0x3c462d>0x0)_0x1a4868[_0x58d216(0x7d)](_0x3c462d+_0x58d216(0xcd));if(_0x17695f>0x0)_0x1a4868['push'](_0x17695f+_0x58d216(0xc9));if(_0x417def>0x0)_0x1a4868[_0x58d216(0x7d)](_0x417def+_0x58d216(0x102));return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xc1)](_0x58d216(0xc8))),_0x10a2b3[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&console[_0x58d216(0xed)]('\x20\x20Segments:\x20'+_0x10a2b3[_0x58d216(0xa3)](',\x20')),_0x917940[_0x58d216(0x88)]>0x0&&console['error'](_0x58d216(0xd4)+_0x917940['join'](',\x20')),_0x1a4868[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&console[_0x58d216(0xed)](_0x58d216(0xa6)+_0x1a4868[_0x58d216(0xa3)](',\x20')),0x0;}}
|
|
1
|
+
const a29_0x148b94=a29_0x23d3;(function(_0x56a632,_0x500ee8){const _0xabb299=a29_0x23d3,_0x169cde=_0x56a632();while(!![]){try{const _0x22b2f6=-parseInt(_0xabb299(0x17a))/0x1*(-parseInt(_0xabb299(0x1c3))/0x2)+parseInt(_0xabb299(0x1d8))/0x3+-parseInt(_0xabb299(0x205))/0x4*(-parseInt(_0xabb299(0x1a3))/0x5)+parseInt(_0xabb299(0x1a0))/0x6*(-parseInt(_0xabb299(0x1f0))/0x7)+parseInt(_0xabb299(0x1aa))/0x8+parseInt(_0xabb299(0x1f1))/0x9*(-parseInt(_0xabb299(0x179))/0xa)+-parseInt(_0xabb299(0x1a8))/0xb*(parseInt(_0xabb299(0x1eb))/0xc);if(_0x22b2f6===_0x500ee8)break;else _0x169cde['push'](_0x169cde['shift']());}catch(_0x44a1e2){_0x169cde['push'](_0x169cde['shift']());}}}(a29_0x26fe,0x2d04c));import{BaseCommand}from'./command.js';function a29_0x23d3(_0x5a4147,_0x44d5bb){_0x5a4147=_0x5a4147-0x16f;const _0x26fe0c=a29_0x26fe();let _0x23d3bf=_0x26fe0c[_0x5a4147];return _0x23d3bf;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x26fe(){const _0x3aa820=['red','scopedFolderPath','user','name','\x20unchanged','endsWith','error','\x20activations]','\x20\x20π\x20Segments:','getParent','folderPath','toCreate','getOutputSchemaWithCache','dryRun','Changes\x20to:','4TXCZQi','\x20created','createdSegmentIds','/e/','Delete\x20segment:','unchanged','results','\x20to\x20update','join','push','cyan','message','parentFolder','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','new','855790zZTwEe','1jCZTPh','data','\x20YAML\x20files\x20found','\x20to\x20delete','yellow','then','\x20\x20Activations:','changed','β\x20All\x20journeys\x20are\x20up\x20to\x20date','repeat','helpText','get','Push\x20','segmentFolderId','Scoped\x20to\x20folder:\x20','Error\x20parsing\x20YAML:\x20','dim','errorCode','parentName','createdAt','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','isNew','Fetching\x20existing\x20journeys...','Parent\x20segment:\x20','paused','Source\x20directory:\x20','\x20changes?','/j/da/je','\x20updated','Changes\x20to\x20journey:','Fetching\x20existing\x20segments...','deleted','segment:push','\x20\x20Journeys:\x20','idToName','Fetching\x20existing\x20folders...','Error:\x20Directory\x20not\x20found:\x20','30KXPBNf','parentSegment','updated','435555mudkCo','activations','existingJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','add','20317pLFrAu','green','2058808gGNZMV','nameToType','targetDir','set','π\x20','\x20folders\x20to\x20create','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','length','\x20changed','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)','segments','\x0aPush\x20summary\x20for\x20\x27','blue','delete','journeysOnly','(Journey\x20will\x20be\x20deleted)','\x20\x20Source:\x20','type','site','\x0aValidation\x20failed:','map','getJourney','30034bruwey','.yml','\x27...','filePath','filter','listSegments','diff','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Fetching\x20parent\x20segment\x20details...','journeys','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','resolveParentId','Fetching\x20users\x20for\x20email\x20resolution...','toString','file','journeyBundleName','\x20\x20Activations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','listActivations','all','yamlConfig','1001355QoEFZG','execute','versionNumber','journeyId','verbose','folderId','journey','segment','/app/ps/','.yaml','Error:\x20','yes','Fetching\x20connections\x20for\x20name\x20resolution...','buildUserMaps','listJourneysWithDetailsFromParentSegment','\x20new','attributes','Delete\x20journey:','listFolders','1164nLQodS','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','created','toDelete','\x20deleted','341782YQQhaI','9SqGASK','\x20\x20\x20\x20','connection','parent_name','audienceId'];a29_0x26fe=function(){return _0x3aa820;};return a29_0x26fe();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x59382d 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';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{[a29_0x148b94(0x1f9)]=a29_0x148b94(0x19b);[a29_0x148b94(0x1b3)]=a29_0x148b94(0x1ec);async[a29_0x148b94(0x1d9)](_0x3ee347){const _0x2fb0ec=a29_0x148b94,{options:_0x53f071,args:_0x15c851,tdx:_0x569999}=_0x3ee347,_0x4965b1=_0x53f071,_0x166c0a=await resolveTarget({'arg':_0x15c851[0x0],'contextParent':_0x53f071[_0x2fb0ec(0x1a1)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x166c0a))return _0x166c0a[_0x2fb0ec(0x18b)]==='no_parent'?(console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x1b1))),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1b6)),console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x18f))):(console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1e2)+_0x166c0a['message']+'\x0a')),_0x166c0a[_0x2fb0ec(0x184)]&&console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x166c0a[_0x2fb0ec(0x184)]))),0x1;if(_0x166c0a['type']===_0x2fb0ec(0x1f4))return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x19f)+_0x166c0a[_0x2fb0ec(0x1ac)]+'\x0a')),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x2fb0ec(0x1b2))),0x1;const _0x3d98e4=_0x166c0a[_0x2fb0ec(0x18c)],_0x4bf7c2=_0x166c0a[_0x2fb0ec(0x1ac)],_0x3a3ef3=_0x166c0a[_0x2fb0ec(0x1be)]===_0x2fb0ec(0x1d1)?_0x166c0a[_0x2fb0ec(0x1c6)]:undefined,_0x3f8d0a=getScopedDetails(_0x166c0a),_0xf26547=_0x3f8d0a?.['isScoped']??![],_0xdc5e4a=_0x3f8d0a?.[_0x2fb0ec(0x1f7)]??'';if(!existsSync(_0x4bf7c2))return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x19f)+_0x4bf7c2+'\x0a')),console['error'](a29_0x59382d['cyan'](_0x2fb0ec(0x1b2))),0x1;_0x4965b1[_0x2fb0ec(0x1dc)]&&(console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x18e)+_0x4965b1[_0x2fb0ec(0x1bf)]),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x192)+_0x3d98e4),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x194)+_0x4bf7c2),_0xf26547&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x188)+_0xdc5e4a));const _0xfa23ed=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3d98e4+_0x2fb0ec(0x1c5),()=>_0x569999['segment'][_0x2fb0ec(0x1ce)](_0x3d98e4),{'verbose':_0x4965b1['verbose']}),_0x3a25f2=_0xfa23ed[_0x2fb0ec(0x17b)],[_0x46782b,_0x324d08,_0x1c0160,_0x385815,_0xdc1e5a]=await Promise[_0x2fb0ec(0x1d6)]([withSpinner(_0x2fb0ec(0x1cb),()=>_0x569999['segment'][_0x2fb0ec(0x1ff)](_0x3a25f2),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x199),()=>_0x569999['segment'][_0x2fb0ec(0x1c8)](_0x3a25f2),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x19e),()=>_0x569999[_0x2fb0ec(0x1df)][_0x2fb0ec(0x1ea)](_0x3a25f2),{'verbose':_0x4965b1['verbose']}),withSpinner(_0x2fb0ec(0x191),()=>_0x569999[_0x2fb0ec(0x1de)][_0x2fb0ec(0x1e6)](_0x3a25f2,{'includeAllVersions':!![]}),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x1cf),()=>_0x569999['user'][_0x2fb0ec(0x1e5)](),{'verbose':_0x4965b1['verbose']})['then'](_0x51ba97=>_0x51ba97[_0x2fb0ec(0x17b)])]),_0x44c899=_0x46782b['data'],_0x6336e=extractRootFolderId(_0x44c899),_0x534f9f=_0x324d08[_0x2fb0ec(0x17b)],_0x49ae2b=_0x1c0160['data'],{journeys:_0x6811c,activationStepsById:_0xfa96e}=_0x385815[_0x2fb0ec(0x17b)],_0x31fbb1=new Map(_0x6811c[_0x2fb0ec(0x1c1)](_0x20e1be=>[_0x20e1be['id'],_0x20e1be])),_0x3bb89c=_0x6811c['map'](_0xed34a0=>({'id':_0xed34a0['id'],'name':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1f9)],'journeyBundleName':_0xed34a0[_0x2fb0ec(0x1e8)]['journeyBundleName']||'','journeyBundleId':_0xed34a0[_0x2fb0ec(0x1e8)]['journeyBundleId']||'','versionNumber':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1da)],'description':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1b3)],'state':_0xed34a0['attributes']['state'],'paused':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x193)],'audienceId':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1f5)],'folderId':_0xed34a0['relationships']?.[_0x2fb0ec(0x176)]?.[_0x2fb0ec(0x17b)]?.['id'],'createdAt':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x18d)],'updatedAt':_0xed34a0[_0x2fb0ec(0x1e8)]['updatedAt']})),{emailToId:_0x52d75b,idToEmail:_0x2796c7}=_0xdc1e5a,_0x24a71a=await withSpinner(_0x2fb0ec(0x1e4),async()=>{const _0x236b8d=_0x2fb0ec,_0x32d319=await _0x569999[_0x236b8d(0x1f3)]['list']();return buildConnectionMaps(_0x32d319);},{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]})[_0x2fb0ec(0x17f)](_0x1add43=>_0x1add43[_0x2fb0ec(0x17b)]),_0x22262c=_0x24a71a['nameToId'],_0x2d4dd6=_0x24a71a[_0x2fb0ec(0x19d)],_0x4156d7=_0x24a71a[_0x2fb0ec(0x1ab)],_0x3b642d={'emailToIdMap':_0x52d75b,'connectionNameToIdMap':_0x22262c,'connectionNameToTypeMap':_0x4156d7,'getSchema':_0x3be2c3=>_0x569999['connection'][_0x2fb0ec(0x202)](_0x3be2c3)};let {pathToId:_0xd75346,idToPath:_0x4ad80e}=buildFolderMaps(_0x49ae2b);const _0x184ea0=buildSegmentLookupMap(_0x534f9f,_0x4ad80e),_0xb2eb32=buildSegmentNameToIdMap(_0x534f9f),_0x5db5b4=buildJourneyBundleLookupMap(_0x3bb89c,_0x4ad80e);let _0x5dc204;if(_0x3a3ef3){if(!_0x3a3ef3[_0x2fb0ec(0x1fb)](_0x2fb0ec(0x1c4))&&!_0x3a3ef3[_0x2fb0ec(0x1fb)](_0x2fb0ec(0x1e1)))return console['error'](a29_0x59382d[_0x2fb0ec(0x1f6)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3a3ef3+'\x0a')),0x1;_0x5dc204=[_0x3a3ef3];}else _0x5dc204=findYamlFiles(_0x4bf7c2);if(_0x5dc204['length']===0x0)return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1a6)+_0x4bf7c2+'\x0a')),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x2fb0ec(0x177))),0x1;let _0x4bb2d6,_0x30f8d1;try{const _0x2ce79f=parseAndClassifyYamlFiles(_0x5dc204,_0x4bf7c2,{'skipSegments':_0x4965b1[_0x2fb0ec(0x1bb)]});_0x4bb2d6=_0x2ce79f[_0x2fb0ec(0x1b7)],_0x30f8d1=_0x2ce79f['journeys'];const _0x55d7f8=validateParsedFiles(_0x2ce79f,_0x4bf7c2);if(_0x55d7f8[_0x2fb0ec(0x1b4)]>0x0)return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1c0))),console[_0x2fb0ec(0x1fc)](formatValidationErrors(_0x55d7f8)),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x40b3d4){return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x189)+(_0x40b3d4 instanceof Error?_0x40b3d4[_0x2fb0ec(0x175)]:_0x40b3d4))),0x1;}if(_0x4bb2d6[_0x2fb0ec(0x1b4)]===0x0&&_0x30f8d1[_0x2fb0ec(0x1b4)]===0x0){const _0x9cfa3a=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x2fb0ec(0x1de):'segment\x20or\x20journey';return console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow']('No\x20'+_0x9cfa3a+_0x2fb0ec(0x17c))),0x0;}const _0x12f2f4=new Map();_0x534f9f['length']>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x534f9f,async _0x2193b9=>{const _0x9ce622=a29_0x23d3,_0xd364d8=await _0x569999['segment'][_0x9ce622(0x1d5)](_0x3a25f2,_0x2193b9['id']);_0x12f2f4[_0x9ce622(0x1ad)](_0x2193b9['id'],_0xd364d8);});},{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]});const {segmentFiles:_0x15922b,foldersToCreate:_0x26cec3}=await prepareSegmentFiles(_0x4bb2d6,{'segmentByFolderAndName':_0x184ea0,'activationsBySegmentId':_0x12f2f4,'folderPathToId':_0xd75346,'idToEmailMap':_0x2796c7,'connectionIdToNameMap':_0x2d4dd6},_0x3b642d,_0xf26547,_0xdc5e4a),_0x176964=_0x3a3ef3?[]:findSegmentsToDelete(_0x534f9f,_0x4bb2d6['map'](({yamlConfig:_0xaf9ee1,folderPath:_0x2ad6e8})=>({'yamlConfig':_0xaf9ee1,'folderPath':resolveTDFolderPath(_0x2ad6e8,_0xf26547,_0xdc5e4a)})),_0x4ad80e,_0xdc5e4a,_0xf26547),{journeyFiles:_0x167354,foldersToCreate:_0x38e6f7}=await withProgressSpinner('Preparing\x20journeys...',async _0x5ab300=>prepareJourneyFiles(_0x30f8d1,{'fetchJourney':async _0x3fa2d9=>_0x569999['journey'][_0x2fb0ec(0x1c2)](_0x3fa2d9[_0x2fb0ec(0x1db)]),'journeyBundlesByFolderAndName':_0x5db5b4,'folderPathToId':_0xd75346,'idToEmailMap':_0x2796c7,'connectionIdToNameMap':_0x2d4dd6,'existingSegments':_0x534f9f,'parentId':_0x3a25f2,'deps':_0x569999,'progress':{'update':_0x59d6b0=>{const _0x184fe8=_0x2fb0ec;_0x5ab300['setPhase'](_0x59d6b0),_0x4965b1[_0x184fe8(0x1dc)]&&console[_0x184fe8(0x1fc)]('\x20\x20'+_0x59d6b0);}},'journeyById':_0x31fbb1,'activationStepsById':_0xfa96e},_0xf26547,_0xdc5e4a),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]})[_0x2fb0ec(0x17f)](_0x4ef57f=>_0x4ef57f['data']);for(const _0x190ef3 of _0x38e6f7){_0x26cec3[_0x2fb0ec(0x1a7)](_0x190ef3);}const _0x3c419d=_0x3a3ef3?[]:findJourneysToDelete(_0x3bb89c,_0x30f8d1[_0x2fb0ec(0x1c1)](({yamlConfig:_0x57421d,folderPath:_0x2539c6})=>({'yamlConfig':_0x57421d,'folderPath':resolveTDFolderPath(_0x2539c6,_0xf26547,_0xdc5e4a)})),_0x4ad80e,_0xdc5e4a,_0xf26547),_0x23c23a=calculatePushStats(_0x15922b,_0x167354,_0x26cec3,_0x176964,_0x3c419d,!!_0x4965b1[_0x2fb0ec(0x1ba)],!!_0x4965b1[_0x2fb0ec(0x1bb)]),_0x302f14=_0x23c23a['segments']['new'],_0x317b65=_0x23c23a[_0x2fb0ec(0x1b7)]['changed'],_0x395f41=_0x23c23a[_0x2fb0ec(0x1b7)][_0x2fb0ec(0x16f)],_0x72c0b0=_0x23c23a[_0x2fb0ec(0x1b7)][_0x2fb0ec(0x1ee)],_0x52e2ad=_0x23c23a['folders'][_0x2fb0ec(0x201)],_0x43db94=_0x23c23a['journeys'][_0x2fb0ec(0x178)],_0x5486ed=_0x23c23a[_0x2fb0ec(0x1cc)][_0x2fb0ec(0x181)],_0x337794=_0x23c23a[_0x2fb0ec(0x1cc)]['unchanged'],_0x2bea55=_0x23c23a['journeys'][_0x2fb0ec(0x1ee)],_0x1d455c=_0x23c23a['activations'][_0x2fb0ec(0x1d6)],_0x175787=_0x23c23a[_0x2fb0ec(0x1a4)]['toCreate'],_0x17e8fb=_0x23c23a[_0x2fb0ec(0x1a4)]['toUpdate'],_0x2aaa8e=_0x23c23a[_0x2fb0ec(0x1a4)]['toDelete'];console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1b8)+_0x3d98e4+'\x27:');_0x52e2ad['length']>0x0&&console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x1b9)](_0x2fb0ec(0x1ae)+_0x52e2ad[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1af)));if(!_0x4965b1[_0x2fb0ec(0x1bb)]){console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1fe)),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1a9)]('+\x20'+_0x302f14[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1e7))),console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20'+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x317b65[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b5)));if(_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0)console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1f6)]('-\x20'+_0x72c0b0[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d)));else _0x176964[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1ba)]&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x18a)](_0x176964[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b0)));console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d['dim']('=\x20'+_0x395f41['length']+_0x2fb0ec(0x1fa)));}if(_0x167354[_0x2fb0ec(0x1b4)]>0x0||_0x3c419d['length']>0x0){console[_0x2fb0ec(0x1fc)]('\x20\x20πΊοΈ\x20\x20Journeys:'),console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d['green']('+\x20'+_0x43db94[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1e7))),console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b5)));if(_0x2bea55['length']>0x0)console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1f6)]('-\x20'+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d)));else _0x3c419d[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['delete']&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x18a)](_0x3c419d[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b0)));console['error']('\x20\x20\x20\x20'+a29_0x59382d[_0x2fb0ec(0x18a)]('=\x20'+_0x337794[_0x2fb0ec(0x1b4)]+'\x20unchanged'));}_0x1d455c[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly']&&(console[_0x2fb0ec(0x1fc)](''),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x180)),_0x175787['length']>0x0&&console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1a9)]('+\x20'+_0x175787['length']+'\x20to\x20create')),_0x17e8fb['length']>0x0&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x17e8fb[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x171))),_0x2aaa8e[_0x2fb0ec(0x1b4)]>0x0&&console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20'+a29_0x59382d['red']('-\x20'+_0x2aaa8e[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d))));console['error'](_0x2fb0ec(0x1bd)+a29_0x59382d[_0x2fb0ec(0x174)](_0x4bf7c2)+'\x0a');if(_0x52e2ad['length']>0x0){console[_0x2fb0ec(0x1fc)]('Folders\x20to\x20create:');for(const _0x4f5ff5 of _0x52e2ad){console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d['blue']('+')+'\x20'+_0x4f5ff5);}console[_0x2fb0ec(0x1fc)]('');}if(_0x302f14[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)])for(const _0x50a931 of _0x302f14){const _0x1b4d5a=_0x50a931['folderPath']?_0x50a931[_0x2fb0ec(0x200)]+'/'+_0x50a931[_0x2fb0ec(0x1d7)]['name']:_0x50a931[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)],_0x494c2e=_0x50a931[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1a4)]?.[_0x2fb0ec(0x1b4)]||0x0,_0xa8670=_0x494c2e>0x0?a29_0x59382d[_0x2fb0ec(0x18a)]('\x20['+_0x494c2e+_0x2fb0ec(0x1fd)):'';console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1a9)]('New\x20segment:')+'\x20'+_0x1b4d5a+_0xa8670),console['error']('β'[_0x2fb0ec(0x183)](0x3c)),_0x50a931['diff']&&console[_0x2fb0ec(0x1fc)](_0x50a931[_0x2fb0ec(0x1c9)]),console[_0x2fb0ec(0x1fc)]('β'['repeat'](0x3c));}if(_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly'])for(const _0x111d34 of _0x72c0b0){const _0xa388b9=_0x111d34[_0x2fb0ec(0x187)]?_0x4ad80e[_0x2fb0ec(0x185)](_0x111d34[_0x2fb0ec(0x187)][_0x2fb0ec(0x1d0)]())||'':'',_0x22a271=_0xa388b9?_0xa388b9+'/'+_0x111d34['name']:_0x111d34[_0x2fb0ec(0x1f9)],_0x3b75da=_0x12f2f4[_0x2fb0ec(0x185)](_0x111d34['id'])||[],_0x464757=_0x3b75da[_0x2fb0ec(0x1b4)]>0x0?a29_0x59382d['dim']('\x20['+_0x3b75da['length']+_0x2fb0ec(0x1fd)):'';console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x209))+'\x20'+_0x22a271+_0x464757),console[_0x2fb0ec(0x1fc)]('β'[_0x2fb0ec(0x183)](0x3c));const _0x3e203f=segmentWithActivationsToYaml(_0x111d34,_0x3b75da,undefined,_0x2796c7,_0x2d4dd6),_0x382ce4=segmentToYamlString(_0x3e203f),_0x141764=generateDiff(_0x382ce4,'');console[_0x2fb0ec(0x1fc)](formatDiffWithColors(_0x141764)),console['error']('β'['repeat'](0x3c));}const _0x46b6ae=_0x15922b[_0x2fb0ec(0x1c7)](_0x590fbe=>!_0x590fbe[_0x2fb0ec(0x190)]&&_0x590fbe[_0x2fb0ec(0x1c9)]);if(_0x46b6ae[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)])for(const _0x3129e1 of _0x46b6ae){const _0x317872=_0x3129e1[_0x2fb0ec(0x200)]?_0x3129e1['folderPath']+'/'+_0x3129e1[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x3129e1[_0x2fb0ec(0x1d7)]['name'];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x204))+'\x20'+_0x317872),console[_0x2fb0ec(0x1fc)]('β'[_0x2fb0ec(0x183)](0x3c)),console[_0x2fb0ec(0x1fc)](_0x3129e1[_0x2fb0ec(0x1c9)]),console[_0x2fb0ec(0x1fc)]('β'[_0x2fb0ec(0x183)](0x3c));}if(_0x43db94[_0x2fb0ec(0x1b4)]>0x0)for(const _0x1de433 of _0x43db94){const _0x4caa01=_0x1de433[_0x2fb0ec(0x200)]?_0x1de433[_0x2fb0ec(0x200)]+'/'+_0x1de433[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x1de433[_0x2fb0ec(0x1d7)]['name'];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1a9)]('New\x20journey:')+'\x20'+_0x4caa01),console[_0x2fb0ec(0x1fc)]('β'[_0x2fb0ec(0x183)](0x3c)),_0x1de433['diff']&&console[_0x2fb0ec(0x1fc)](_0x1de433[_0x2fb0ec(0x1c9)]),console['error']('β'[_0x2fb0ec(0x183)](0x3c));}const _0x31bdaf=_0x167354[_0x2fb0ec(0x1c7)](_0x39d6d4=>!_0x39d6d4[_0x2fb0ec(0x190)]&&_0x39d6d4[_0x2fb0ec(0x1c9)]);if(_0x31bdaf['length']>0x0)for(const _0x7d3c11 of _0x31bdaf){const _0x5ef378=_0x7d3c11[_0x2fb0ec(0x200)]?_0x7d3c11[_0x2fb0ec(0x200)]+'/'+_0x7d3c11[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x7d3c11[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x198))+'\x20'+_0x5ef378),console[_0x2fb0ec(0x1fc)]('β'[_0x2fb0ec(0x183)](0x3c)),console[_0x2fb0ec(0x1fc)](_0x7d3c11['diff']),console[_0x2fb0ec(0x1fc)]('β'[_0x2fb0ec(0x183)](0x3c));}if(_0x2bea55['length']>0x0)for(const _0xbf8851 of _0x2bea55){const _0x36510b=_0xbf8851[_0x2fb0ec(0x1dd)]?_0x4ad80e[_0x2fb0ec(0x185)](_0xbf8851[_0x2fb0ec(0x1dd)])||'':'',_0x13f538=_0x36510b?_0x36510b+'/'+_0xbf8851[_0x2fb0ec(0x1d2)]:_0xbf8851[_0x2fb0ec(0x1d2)];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1e9))+'\x20'+_0x13f538),console[_0x2fb0ec(0x1fc)]('β'[_0x2fb0ec(0x183)](0x3c)),console['error'](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1bc))),console['error']('β'[_0x2fb0ec(0x183)](0x3c));}if(_0x4965b1[_0x2fb0ec(0x203)])return console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow'](_0x2fb0ec(0x1d4))),0x0;const _0x37880a=_0x4965b1[_0x2fb0ec(0x1bb)]?![]:_0x302f14[_0x2fb0ec(0x1b4)]>0x0||_0x317b65[_0x2fb0ec(0x1b4)]>0x0||_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0,_0x586451=_0x43db94['length']>0x0||_0x5486ed[_0x2fb0ec(0x1b4)]>0x0||_0x2bea55[_0x2fb0ec(0x1b4)]>0x0,_0x89e42d=_0x4965b1['journeysOnly']?![]:_0x1d455c[_0x2fb0ec(0x1b4)]>0x0,_0x300288=_0x52e2ad[_0x2fb0ec(0x1b4)]>0x0;if(!_0x37880a&&!_0x586451&&!_0x89e42d&&!_0x300288){const _0x2f8b20=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x2fb0ec(0x182):_0x2fb0ec(0x1cd);console['error'](a29_0x59382d[_0x2fb0ec(0x1a9)](_0x2f8b20));if(_0x3a3ef3&&_0x337794[_0x2fb0ec(0x1b4)]===0x1){const _0x1820da=_0x337794[0x0];if(_0x1820da['existingJourney']?.['id']){const _0x2e0957=getConsoleNextUrl(_0x4965b1[_0x2fb0ec(0x1bf)],_0x2fb0ec(0x1e0)+_0x3a25f2+_0x2fb0ec(0x208)+_0x1820da[_0x2fb0ec(0x1a5)]['id']+'/j/da/je');console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x174)](_0x2e0957));}}return 0x0;}const _0x2efd75=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x43db94[_0x2fb0ec(0x1b4)]+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x52e2ad[_0x2fb0ec(0x1b4)]:_0x302f14[_0x2fb0ec(0x1b4)]+_0x317b65[_0x2fb0ec(0x1b4)]+_0x72c0b0[_0x2fb0ec(0x1b4)]+_0x43db94[_0x2fb0ec(0x1b4)]+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x52e2ad['length']+_0x1d455c[_0x2fb0ec(0x1b4)];if(!_0x4965b1[_0x2fb0ec(0x1e3)]&&_0x2efd75>0x0){const _0xa0aee0=await confirmKey(_0x2fb0ec(0x186)+_0x2efd75+_0x2fb0ec(0x195));if(!_0xa0aee0)return console[_0x2fb0ec(0x1fc)]('Aborted.'),0x1;}const _0x59c15a={'withProgress':async(_0x17e598,_0x5c42cd)=>{const _0xa88e9f=_0x2fb0ec,_0x5beb94=await withSpinner(_0x17e598,_0x5c42cd,{'verbose':_0x4965b1['verbose']});return{'data':_0x5beb94[_0xa88e9f(0x17b)]};},'logInfo':_0x17ed71=>console['error'](a29_0x59382d[_0x2fb0ec(0x1b9)]('β\x20'+_0x17ed71)),'logSuccess':_0x20f885=>console['error'](a29_0x59382d['green']('β\x20'+_0x20f885)),'logWarning':_0x3ea156=>console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)]('β \x20'+_0x3ea156)),'logDeleted':_0x1f5849=>console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)]('β\x20'+_0x1f5849))},_0x21aa4f={'segment':_0x569999[_0x2fb0ec(0x1df)],'journey':_0x569999[_0x2fb0ec(0x1de)],'user':_0x569999[_0x2fb0ec(0x1f8)],'connection':_0x569999[_0x2fb0ec(0x1f3)]};_0x52e2ad['length']>0x0&&(_0xd75346=await executePushFolders(_0x21aa4f,_0x52e2ad,_0xd75346,{'parentId':_0x3a25f2},_0x59c15a));const _0x2673b3={'rootFolderId':_0x6336e,'folderPathToId':_0xd75346,'folderIdToPath':_0x4ad80e,'segmentNameToId':_0xb2eb32,'activationsBySegmentId':_0x12f2f4,'emailToIdMap':_0x52d75b,'idToEmailMap':_0x2796c7,'connectionNameToIdMap':_0x24a71a['nameToId'],'connectionIdToNameMap':_0x24a71a[_0x2fb0ec(0x19d)],'connectionNameToTypeMap':_0x4156d7},_0x511020=await executePushSegments(_0x21aa4f,_0x4965b1[_0x2fb0ec(0x1bb)]?[]:_0x15922b,_0x2673b3,{'parentId':_0x3a25f2},_0x59c15a),_0x592d93=_0x511020[_0x2fb0ec(0x1ed)],_0x44a950=_0x511020[_0x2fb0ec(0x1a2)],_0x395c66=_0x511020[_0x2fb0ec(0x1a4)][_0x2fb0ec(0x1ed)],_0x17a1c0=_0x511020[_0x2fb0ec(0x1a4)][_0x2fb0ec(0x1a2)],_0x4f7300=_0x511020['activations'][_0x2fb0ec(0x19a)],_0x5148a6=await executePushSegmentDeletions(_0x21aa4f,_0x4965b1[_0x2fb0ec(0x1bb)]?[]:_0x72c0b0,_0x59c15a);let _0x3e0031=0x0,_0x179d50=0x0,_0x56a0b8=0x0;const _0xd5614b=new Map(_0xb2eb32);for(const [_0x1f07e8,_0x4684d8]of _0x511020[_0x2fb0ec(0x207)]){_0xd5614b[_0x2fb0ec(0x1ad)](_0x1f07e8,_0x4684d8);}if(_0x167354[_0x2fb0ec(0x1b4)]>0x0){const _0x2fa1e2={..._0x2673b3,'segmentNameToId':_0xd5614b,'existingSegments':_0x534f9f,'activationContext':_0x3b642d},_0x356d77=await executePushJourneys(_0x21aa4f,_0x167354,_0x2fa1e2,{'parentId':_0x3a25f2,'rootFolderId':_0x6336e,'verbose':_0x4965b1['verbose']},_0x59c15a);_0x3e0031=_0x356d77[_0x2fb0ec(0x1ed)],_0x179d50=_0x356d77[_0x2fb0ec(0x1a2)];if(_0x3a3ef3&&_0x356d77[_0x2fb0ec(0x170)][_0x2fb0ec(0x1b4)]===0x1){const _0x12ffab=_0x356d77[_0x2fb0ec(0x170)][0x0];if(_0x12ffab['journeyId']){const _0x93a861=getConsoleNextUrl(_0x4965b1['site'],'/app/ps/'+_0x3a25f2+_0x2fb0ec(0x208)+_0x12ffab[_0x2fb0ec(0x1db)]+_0x2fb0ec(0x196));console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x174)](_0x93a861));}}}for(const _0x40750b of _0x2bea55){console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow'](_0x2fb0ec(0x1ca)+_0x40750b['journeyBundleName'])),_0x56a0b8++;}const _0x3569d4=[];if(_0x592d93>0x0)_0x3569d4[_0x2fb0ec(0x173)](_0x592d93+'\x20created');if(_0x44a950>0x0)_0x3569d4['push'](_0x44a950+'\x20updated');if(_0x5148a6>0x0)_0x3569d4['push'](_0x5148a6+'\x20deleted');const _0x4ec1ec=[];if(_0x3e0031>0x0)_0x4ec1ec['push'](_0x3e0031+'\x20created');if(_0x179d50>0x0)_0x4ec1ec[_0x2fb0ec(0x173)](_0x179d50+_0x2fb0ec(0x197));if(_0x56a0b8>0x0)_0x4ec1ec[_0x2fb0ec(0x173)](_0x56a0b8+_0x2fb0ec(0x1ef));const _0x46665c=[];if(_0x395c66>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x395c66+_0x2fb0ec(0x206));if(_0x17a1c0>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x17a1c0+'\x20updated');if(_0x4f7300>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x4f7300+_0x2fb0ec(0x1ef));return console[_0x2fb0ec(0x1fc)](a29_0x59382d['green']('\x0aβ\x20Push\x20complete')),_0x3569d4[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly']&&console['error']('\x20\x20Segments:\x20'+_0x3569d4[_0x2fb0ec(0x172)](',\x20')),_0x4ec1ec['length']>0x0&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x19c)+_0x4ec1ec[_0x2fb0ec(0x172)](',\x20')),_0x46665c[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)]&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1d3)+_0x46665c[_0x2fb0ec(0x172)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0xdafc2a=a30_0x3e04;(function(_0x47a2df,_0xaba7e3){const _0x151c63=a30_0x3e04,_0x1df8a=_0x47a2df();while(!![]){try{const _0x46e279=parseInt(_0x151c63(0x13c))/0x1*(parseInt(_0x151c63(0x14a))/0x2)+-parseInt(_0x151c63(0x122))/0x3+-parseInt(_0x151c63(0x128))/0x4+-parseInt(_0x151c63(0x152))/0x5*(parseInt(_0x151c63(0x145))/0x6)+-parseInt(_0x151c63(0x137))/0x7*(-parseInt(_0x151c63(0x12e))/0x8)+parseInt(_0x151c63(0x146))/0x9*(-parseInt(_0x151c63(0x148))/0xa)+parseInt(_0x151c63(0x133))/0xb*(parseInt(_0x151c63(0x127))/0xc);if(_0x46e279===_0xaba7e3)break;else _0x1df8a['push'](_0x1df8a['shift']());}catch(_0x4c5d4a){_0x1df8a['push'](_0x1df8a['shift']());}}}(a30_0x238e,0xe4e74));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{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x312428 from'chalk';function a30_0x238e(){const _0x15d51b=['Resolving\x20folder\x20\x27','kind','1312256lNhKFU','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','error','Parent\x20ID:\x20','228745yhTkrS','segment:update','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','7IphcZy','rule','segment','execute','segmentId','679223iwdKrU','resolvePathToResource','β\x20Updated\x20segment\x20\x27','parentId','Examples:','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','segmentPath','Resolved\x20folder\x20ID:\x20','12eYdfDW','549bbwYKm','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','55610HbiJym','updateSegmentById','4MIBhYq','yellow','length','\x20\x20\x20Path:\x20','Segment\x20ID:\x20','folder','ruleFile','type','432325DRBJPq','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','1180944TAtMPV','Updating\x20segment\x20\x27','Error:\x20Cannot\x20update\x20','resolveFolderId','name','1068yfuIQk','6119384tUPrZD','Resolved\x20type:\x20','\x27...','description'];a30_0x238e=function(){return _0x15d51b;};return a30_0x238e();}function a30_0x3e04(_0x5e5307,_0x50e513){_0x5e5307=_0x5e5307-0x121;const _0x238e62=a30_0x238e();let _0x3e04db=_0x238e62[_0x5e5307];return _0x3e04db;}export class SegmentUpdateCommand extends BaseCommand{[a30_0xdafc2a(0x126)]=a30_0xdafc2a(0x134);[a30_0xdafc2a(0x12b)]='Update\x20existing\x20child\x20segment';async[a30_0xdafc2a(0x13a)](_0x564cd2){const _0x74f605=a30_0xdafc2a;console[_0x74f605(0x131)](a30_0x312428['yellow']('β \x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x74f605(0x131)](a30_0x312428[_0x74f605(0x14b)](_0x74f605(0x121)));const {options:_0x40e4bb,args:_0xbab58a,tdx:_0x3f5901}=_0x564cd2,_0x1dd898=_0x40e4bb;if(_0xbab58a[_0x74f605(0x14c)]===0x0)return console[_0x74f605(0x131)](_0x74f605(0x136)),console[_0x74f605(0x131)](_0x74f605(0x12f)),console['error'](_0x74f605(0x140)),console[_0x74f605(0x131)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3e20e4=_0xbab58a[0x0],_0x1d7d6f=_0x40e4bb[_0x74f605(0x143)];let _0x902b6e=_0x3e20e4;_0x1d7d6f&&!_0x3e20e4['includes']('/')&&(_0x902b6e=_0x1d7d6f+'/'+_0x3e20e4,_0x1dd898[_0x74f605(0x135)]&&console['error'](_0x74f605(0x130)+_0x902b6e));const _0x59545c=await withSpinner(_0x74f605(0x142)+_0x902b6e+_0x74f605(0x12a),()=>_0x3f5901['segment'][_0x74f605(0x13d)](_0x902b6e),{'verbose':_0x1dd898[_0x74f605(0x135)]}),_0x2e6381=_0x59545c['data'];_0x1dd898[_0x74f605(0x135)]&&console[_0x74f605(0x131)](_0x74f605(0x129)+_0x2e6381['type']);if(_0x2e6381[_0x74f605(0x151)]!=='segment')return console[_0x74f605(0x131)](_0x74f605(0x124)+_0x2e6381['type']+_0x74f605(0x147)),console['error'](_0x74f605(0x141)),0x1;if(!_0x2e6381['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x30cd70=_0x2e6381[_0x74f605(0x13f)],_0x1d8d97=_0x2e6381[_0x74f605(0x13b)];_0x1dd898[_0x74f605(0x135)]&&(console[_0x74f605(0x131)](_0x74f605(0x132)+_0x30cd70),console[_0x74f605(0x131)](_0x74f605(0x14e)+_0x1d8d97));let _0x568d03;if(_0x1dd898['folder']){const _0x2d7fd0=_0x1dd898[_0x74f605(0x14f)],_0xbfa751=await withSpinner(_0x74f605(0x12c)+_0x2d7fd0+_0x74f605(0x12a),()=>_0x3f5901['segment'][_0x74f605(0x125)](_0x30cd70,_0x2d7fd0),{'verbose':_0x1dd898['verbose']});_0x568d03=parseInt(_0xbfa751['data'],0xa),_0x1dd898[_0x74f605(0x135)]&&console['error'](_0x74f605(0x144)+_0x568d03);}const _0x6692a8=await loadJSONFromOptions(_0x1dd898[_0x74f605(0x138)],_0x1dd898[_0x74f605(0x150)]),_0x5b8fb0={'name':_0x1dd898['name'],'description':_0x1dd898['description'],'rule':_0x6692a8,'kind':_0x1dd898['kind']!==undefined?parseInt(_0x1dd898[_0x74f605(0x12d)],0xa):undefined,'segmentFolderId':_0x568d03},_0xcd318a=await withSpinner(_0x74f605(0x123)+_0x2e6381['segmentName']+'\x27...',()=>_0x3f5901[_0x74f605(0x139)][_0x74f605(0x149)](_0x30cd70,_0x1d8d97,_0x5b8fb0),{'verbose':_0x1dd898[_0x74f605(0x135)]}),_0x51648a=_0xcd318a['data'];return console['error'](_0x74f605(0x13e)+_0x51648a[_0x74f605(0x126)]+'\x27'),_0x902b6e!==_0x3e20e4&&console[_0x74f605(0x131)](_0x74f605(0x14d)+_0x902b6e),await handleSDKOutput([_0x51648a],_0x1dd898),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x1f8d2f=a31_0x184d;(function(_0x5c43e6,_0xe55e10){const _0x133afc=a31_0x184d,_0x8e9e=_0x5c43e6();while(!![]){try{const _0x378326=-parseInt(_0x133afc(0xd4))/0x1*(-parseInt(_0x133afc(0xc4))/0x2)+-parseInt(_0x133afc(0xea))/0x3*(-parseInt(_0x133afc(0xf4))/0x4)+-parseInt(_0x133afc(0xcb))/0x5+parseInt(_0x133afc(0xd2))/0x6*(-parseInt(_0x133afc(0xf2))/0x7)+parseInt(_0x133afc(0xd7))/0x8*(parseInt(_0x133afc(0xc3))/0x9)+-parseInt(_0x133afc(0xd0))/0xa+parseInt(_0x133afc(0xcd))/0xb;if(_0x378326===_0xe55e10)break;else _0x8e9e['push'](_0x8e9e['shift']());}catch(_0x3b6f7b){_0x8e9e['push'](_0x8e9e['shift']());}}}(a31_0x1963,0x849bf));function a31_0x184d(_0x15c7d7,_0x79724d){_0x15c7d7=_0x15c7d7-0xc1;const _0x1963e5=a31_0x1963();let _0x184d3f=_0x1963e5[_0x15c7d7];return _0x184d3f;}import{existsSync,statSync}from'fs';import a31_0x277721 from'chalk';function a31_0x1963(){const _0x5b756a=['error','Use:\x20tdx\x20segment\x20use\x20','segmentPath','Parent\x20ID:\x20','\x27...','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','171jvBGFa','green','cyan','β\x20Context\x20cleared.\x20Back\x20to\x20root.','session','name','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Usage:\x20tdx\x20segment\x20use\x20<path>','17437MpDwKb','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','58132aYADnj','Resolved\x20relative\x20path\x20to:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','description','Site:\x20','join','segment:use','type','Examples:','parentName','fullPath','14913PsweOh','18128TBqhMn','red','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','length','folderPath','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','2945720oxdquW','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','9059347RONUxt','Folder\x20ID:\x20','folderId','8995460wSLwUu','verbose','1830RRdqAg','dim','91QkmdcI','log','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','1520FlEPXP','β\x20Context\x20set\x20to:\x20','data','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','execute','resolvePathToResource','slice','isDirectory','isAbsolute','segment','segments','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','parentId'];a31_0x1963=function(){return _0x5b756a;};return a31_0x1963();}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{[a31_0x1f8d2f(0xef)]=a31_0x1f8d2f(0xfb);[a31_0x1f8d2f(0xf8)]=a31_0x1f8d2f(0xf0);async[a31_0x1f8d2f(0xdb)](_0xffd8b4){const _0x2a83df=a31_0x1f8d2f,{options:_0x58714e,args:_0x2f380b,tdx:_0x557497}=_0xffd8b4;if(_0x2f380b['length']===0x0)return console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xc5)]('Error:\x20Path\x20is\x20required\x0a')),console['error'](_0x2a83df(0xf1)),console[_0x2a83df(0xe4)](_0x2a83df(0xfd)),console[_0x2a83df(0xe4)](_0x2a83df(0xc6)),console[_0x2a83df(0xe4)](_0x2a83df(0xc7)),console[_0x2a83df(0xe4)](_0x2a83df(0xe2)),console[_0x2a83df(0xe4)](_0x2a83df(0xf3)),0x1;const _0x50ea3a=_0x2f380b[0x0],_0x8778fc=_0x58714e[_0x2a83df(0xee)];try{if(_0x50ea3a==='/')return saveSessionContext({'segment_path':undefined},_0x8778fc),console[_0x2a83df(0xd5)](a31_0x277721[_0x2a83df(0xeb)](_0x2a83df(0xed))),0x0;if(existsSync(_0x50ea3a)&&statSync(_0x50ea3a)[_0x2a83df(0xde)]()){let _0x192d23;try{_0x192d23=findTdxConfig(_0x50ea3a);}catch{return console[_0x2a83df(0xe4)](a31_0x277721['red'](_0x2a83df(0xf6)+_0x50ea3a)),console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xec)](_0x2a83df(0xda))),0x1;}const _0x54394e=_0x192d23['config']['parent_segment'];return saveSessionContext({'segment_path':_0x54394e,'parent_segment':_0x54394e},_0x8778fc),console[_0x2a83df(0xd5)](a31_0x277721['green']('β\x20Context\x20set\x20to:\x20'+a31_0x277721[_0x2a83df(0xec)](_0x54394e))),0x0;}const _0x30444d=_0x58714e[_0x2a83df(0xe6)];let _0x5afd7b=_0x50ea3a;const _0x4bbae1=parsePath(_0x50ea3a);if(!_0x4bbae1[_0x2a83df(0xdf)]){if(!_0x30444d)return console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xc5)](_0x2a83df(0xd6))),console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xec)](_0x2a83df(0xf7))),0x1;if(_0x50ea3a==='..'){const _0x1826a1=_0x30444d['split']('/')[_0x2a83df(0xdd)](0x0,-0x1)[_0x2a83df(0xfa)]('/');_0x5afd7b=_0x1826a1||'/';}else _0x50ea3a==='.'?_0x5afd7b=_0x30444d:_0x5afd7b=_0x30444d+'/'+_0x50ea3a;_0x58714e[_0x2a83df(0xd1)]&&console['error'](_0x2a83df(0xf5)+_0x5afd7b);}if(_0x5afd7b==='/'||_0x5afd7b==='')return saveSessionContext({'segment_path':undefined},_0x8778fc),console['log'](a31_0x277721[_0x2a83df(0xeb)](_0x2a83df(0xed))),0x0;_0x5afd7b=normalizePath(_0x5afd7b);const _0x137e45=parsePath(_0x5afd7b)[_0x2a83df(0xe1)];if(_0x137e45[_0x2a83df(0xc8)]===0x0)return saveSessionContext({'segment_path':undefined},_0x8778fc),console[_0x2a83df(0xd5)](a31_0x277721[_0x2a83df(0xeb)](_0x2a83df(0xed))),0x0;_0x58714e[_0x2a83df(0xd1)]&&(console[_0x2a83df(0xe4)](_0x2a83df(0xf9)+_0x58714e['site']),console[_0x2a83df(0xe4)]('Target\x20path:\x20'+_0x5afd7b));const _0x1cfa0b=await withSpinner('Resolving\x20path\x20\x27'+_0x5afd7b+_0x2a83df(0xe8),()=>_0x557497[_0x2a83df(0xe0)][_0x2a83df(0xdc)](_0x5afd7b),{'verbose':_0x58714e['verbose']}),_0x12abff=_0x1cfa0b[_0x2a83df(0xd9)];_0x58714e[_0x2a83df(0xd1)]&&(console[_0x2a83df(0xe4)]('Resolved\x20path\x20type:\x20'+_0x12abff[_0x2a83df(0xfc)]),console['error'](_0x2a83df(0xe7)+_0x12abff[_0x2a83df(0xe3)]),_0x12abff[_0x2a83df(0xcf)]&&console[_0x2a83df(0xe4)](_0x2a83df(0xce)+_0x12abff[_0x2a83df(0xcf)]));if(_0x12abff[_0x2a83df(0xfc)]===_0x2a83df(0xe0))return console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xc5)](_0x2a83df(0xe9))),console[_0x2a83df(0xe4)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xec)](_0x2a83df(0xe5)+_0x12abff['parentName']+(_0x12abff[_0x2a83df(0xc9)]?'/'+_0x12abff[_0x2a83df(0xc9)][_0x2a83df(0xfa)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x12abff[_0x2a83df(0xc2)],'parent_segment':_0x12abff[_0x2a83df(0xc1)]},_0x8778fc),console[_0x2a83df(0xd5)](a31_0x277721['green'](_0x2a83df(0xd8)+a31_0x277721[_0x2a83df(0xec)](_0x12abff[_0x2a83df(0xc2)]))),_0x58714e[_0x2a83df(0xd1)]&&(console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xd3)](_0x2a83df(0xcc))),console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xd3)](_0x2a83df(0xca)))),0x0;}catch(_0x5374c0){throw _0x5374c0;}}}
|