@treasuredata/tdx 0.14.5 β 0.14.7
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.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +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_0x3f95e6=a25_0x3463;(function(_0x5a6cc8,_0x1fef0a){const _0x4529de=a25_0x3463,_0xd49418=_0x5a6cc8();while(!![]){try{const _0x3b0d84=-parseInt(_0x4529de(0x1f7))/0x1+parseInt(_0x4529de(0x23f))/0x2+-parseInt(_0x4529de(0x253))/0x3*(-parseInt(_0x4529de(0x1c9))/0x4)+parseInt(_0x4529de(0x1fa))/0x5*(parseInt(_0x4529de(0x25a))/0x6)+-parseInt(_0x4529de(0x250))/0x7*(parseInt(_0x4529de(0x1c8))/0x8)+-parseInt(_0x4529de(0x258))/0x9+parseInt(_0x4529de(0x1d3))/0xa;if(_0x3b0d84===_0x1fef0a)break;else _0xd49418['push'](_0xd49418['shift']());}catch(_0x5e66a2){_0xd49418['push'](_0xd49418['shift']());}}}(a25_0x2b47,0x3b552));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';function a25_0x2b47(){const _0x4f0373=['Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:folder:show','\x20\x20Cause:\x20','parentSegment','segment:show','Fetching\x20parent\x20segment\x20details...','web','Fetching\x20SQL\x20for\x20segment...','\x27\x20with\x20ID:\x20','getSegment','jobId','β\x20Found\x20','SEGMENT_NOT_FOUND','resolveFolderId','Error:\x20Path\x20or\x20name\x20is\x20required','Examples:','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','listFolders','resolvePathToResource','Use:\x20tdx\x20ps\x20view','Resolving\x20parent\x20segment\x20\x27','Folder\x20ID:\x20','Fetching\x20segment\x20details...','setJobId','message','Folder\x20name:\x20','\x20Opening\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','β\x20Query\x20completed:\x20Processed\x20','/e/','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','url','segment:sql','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Fetching\x20folder\x20details...','segmentId','length','in\x20','segment','Error:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolved\x20folder\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','trim','Show\x20folder\x20or\x20child\x20segment\x20details','segment:desc','replace','format','INVALID_ARGUMENT','getFolder','\x20\x20Full\x20path:\x20','330660MULdDD','resolveParentId','segmentName','Creating\x20folder\x20\x27','data','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Parent\x20ID:\x20','Resolving\x20path\x20\x27','Resolving\x20parent\x20folder\x20\x27','Show\x20child\x20segment\x20schema\x20(column\x20types)','execute','Use:\x20tdx\x20ps\x20view\x20-w','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','type','green','7paxYiq','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20parent\x20ID:\x20','3eQQQSE','error','Parent\x20name:\x20','getSegmentSQL','Resolved\x20relative\x20path\x20to:\x20','3565872RTAUxo','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','2257284UPmIRA','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','parent','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','segment:folder:list','test','\x20[Job\x20ID:\x20','1896520FghGmI','389392TNEpwL','(root)','jsonl','Fetching\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentPath','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','log','Site:\x20','Error:\x20Folder\x20reference\x20is\x20required','5729960ORizgH','elapsedTimeMillis','Error:\x20Parent\x20segment\x20name\x20is\x20required','SEGMENT_FOLDER_NOT_FOUND','includes','Target\x20path:\x20','parentId','verbose','\x20\x20Segment\x20name:\x20','SQL\x20query:\x0a','\x20\x20Parent\x20segment:\x20','description','stats','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','information_schema','\x27...','folderPath','Segment\x20ID:\x20','name','createFolder','\x20rows\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','fullPath','Resolved\x20YAML\x20file:\x20','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:view','Folder\x20ID\x20missing\x20from\x20resolved\x20path','β\x20Query\x20failed\x20[','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','cyan','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','/app/ps/','cause','Show\x20segment\x20or\x20folder\x20details','Resolving\x20folder\x20\x27','335589dOobUn','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','segment:describe','5gAmkEa','Resolving\x20\x27','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Use:\x20tdx\x20ps\x20desc','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','site','Use:\x20tdx\x20ps\x20sql','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','folder','SELECT\x20*\x20FROM\x20(\x0a'];a25_0x2b47=function(){return _0x4f0373;};return a25_0x2b47();}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_0x120088 from'chalk';async function resolveSegmentTarget(_0xc12441,_0x200eb2,_0x44e101){const _0xe44981=a25_0x3463;if(isYamlFilePath(_0xc12441))try{const _0x5147d7=await resolveYamlFilePath(_0xc12441);return _0x44e101&&(console[_0xe44981(0x254)](_0xe44981(0x1ea)+_0xc12441),console['error'](_0xe44981(0x1dd)+_0x5147d7[_0xe44981(0x20e)]),console[_0xe44981(0x254)](_0xe44981(0x1db)+_0x5147d7[_0xe44981(0x241)]),console[_0xe44981(0x254)]('\x20\x20Folder\x20path:\x20'+(_0x5147d7[_0xe44981(0x1e3)]||_0xe44981(0x1ca))),console[_0xe44981(0x254)](_0xe44981(0x23e)+_0x5147d7[_0xe44981(0x1e9)])),_0x5147d7[_0xe44981(0x1e9)];}catch(_0x373c31){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe44981(0x1f0)+_0x373c31[_0xe44981(0x223)]);}if(!_0x200eb2)throw new SDKError(ErrorCode[_0xe44981(0x23c)],_0xe44981(0x234));return _0x200eb2+'/'+_0xc12441;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x1f9);['description']=a25_0x3f95e6(0x1f5);async[a25_0x3f95e6(0x24a)](_0x21875d){const _0x1e1883=a25_0x3f95e6,{options:_0x269a87,args:_0x1af22e,tdx:_0x347aca}=_0x21875d,_0x109d22=_0x1af22e[0x0],_0x363054=!_0x109d22&&!!_0x269a87[_0x1e1883(0x20e)],_0x39d12b=_0x109d22||_0x269a87[_0x1e1883(0x20e)];if(!_0x39d12b)return console['error'](_0x1e1883(0x219)),console[_0x1e1883(0x254)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x1e1883(0x254)](_0x1e1883(0x21a)),console[_0x1e1883(0x254)](_0x1e1883(0x259)),console[_0x1e1883(0x254)](_0x1e1883(0x1cd)),console[_0x1e1883(0x254)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x1e1883(0x201)),0x1;try{const _0x5a8692=_0x269a87[_0x1e1883(0x1ce)];let _0xdaf8db=_0x39d12b;!_0x363054&&_0x5a8692&&!_0x39d12b[_0x1e1883(0x1d7)]('/')&&(_0xdaf8db=_0x5a8692+'/'+_0x39d12b,_0x269a87[_0x1e1883(0x1da)]&&console[_0x1e1883(0x254)](_0x1e1883(0x257)+_0xdaf8db));const _0x42f970=await withSpinner(_0x1e1883(0x247)+_0xdaf8db+_0x1e1883(0x1e2),()=>_0x347aca[_0x1e1883(0x232)][_0x1e1883(0x21d)](_0xdaf8db),{'verbose':_0x269a87[_0x1e1883(0x1da)]}),_0x4cde32=_0x42f970[_0x1e1883(0x243)];_0x269a87[_0x1e1883(0x1da)]&&(console[_0x1e1883(0x254)]('Resolved\x20type:\x20'+_0x4cde32['type']),console['error']('Parent\x20ID:\x20'+_0x4cde32[_0x1e1883(0x1d9)]),_0x4cde32[_0x1e1883(0x1fe)]&&console[_0x1e1883(0x254)](_0x1e1883(0x220)+_0x4cde32[_0x1e1883(0x1fe)]),_0x4cde32[_0x1e1883(0x22f)]&&console[_0x1e1883(0x254)](_0x1e1883(0x1e4)+_0x4cde32[_0x1e1883(0x22f)]));if(_0x4cde32['type']===_0x1e1883(0x25c)){const _0x35234c=await withSpinner(_0x1e1883(0x210),()=>_0x347aca[_0x1e1883(0x232)]['getParent'](_0x4cde32['parentId']),{'verbose':_0x269a87[_0x1e1883(0x1da)]});await handleSingleObjectOutput(_0x35234c[_0x1e1883(0x243)],_0x269a87);}else{if(_0x4cde32[_0x1e1883(0x24e)]===_0x1e1883(0x209)){if(!_0x4cde32['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1e1883(0x1ee));const _0x4e8eb9=await withSpinner(_0x1e1883(0x22e),()=>_0x347aca[_0x1e1883(0x232)][_0x1e1883(0x23d)](_0x4cde32[_0x1e1883(0x1fe)]),{'verbose':_0x269a87['verbose']});await handleSingleObjectOutput(_0x4e8eb9[_0x1e1883(0x243)],_0x269a87);}else{if(_0x4cde32[_0x1e1883(0x24e)]===_0x1e1883(0x232)){if(!_0x4cde32[_0x1e1883(0x22f)])throw new SDKError(ErrorCode[_0x1e1883(0x217)],_0x1e1883(0x200));const _0x4990c0=await withSpinner(_0x1e1883(0x221),()=>_0x347aca[_0x1e1883(0x232)][_0x1e1883(0x214)](_0x4cde32['parentId'],_0x4cde32[_0x1e1883(0x22f)]),{'verbose':_0x269a87[_0x1e1883(0x1da)]});await handleSingleObjectOutput(_0x4990c0[_0x1e1883(0x243)],_0x269a87);}}}return 0x0;}catch(_0xa28c6d){if(_0xa28c6d instanceof SDKError)return console[_0x1e1883(0x254)](_0x1e1883(0x233)+_0xa28c6d[_0x1e1883(0x223)]),_0xa28c6d[_0x1e1883(0x1f4)]&&console['error'](_0x1e1883(0x20d)+_0xa28c6d['cause']),0x1;throw _0xa28c6d;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x20f);[a25_0x3f95e6(0x1de)]=a25_0x3f95e6(0x206);async[a25_0x3f95e6(0x24a)](_0x54ae44){const _0x612eb=a25_0x3f95e6,{options:_0x168a0d,args:_0x412e39,tdx:_0x365209}=_0x54ae44,_0x2dff95=_0x412e39[0x0];if(!_0x2dff95)return console[_0x612eb(0x254)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x612eb(0x254)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x612eb(0x254)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x612eb(0x254)]('Examples:'),console[_0x612eb(0x254)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x612eb(0x254)](_0x612eb(0x22d)),0x1;try{const _0x3e704e=_0x168a0d[_0x612eb(0x20e)],_0x4ec11e=await resolveSegmentTarget(_0x2dff95,_0x3e704e,_0x168a0d[_0x612eb(0x1da)]);_0x168a0d[_0x612eb(0x1da)]&&console['error'](_0x612eb(0x1d8)+_0x4ec11e);const _0x1d1ab4=await withSpinner('Resolving\x20\x27'+_0x2dff95+'\x27...',()=>_0x365209[_0x612eb(0x232)][_0x612eb(0x21d)](_0x4ec11e),{'verbose':_0x168a0d['verbose']}),_0xfcf470=_0x1d1ab4[_0x612eb(0x243)];_0x168a0d[_0x612eb(0x1da)]&&(console[_0x612eb(0x254)](_0x612eb(0x1fc)+_0xfcf470[_0x612eb(0x24e)]),console[_0x612eb(0x254)](_0x612eb(0x246)+_0xfcf470[_0x612eb(0x1d9)]));if(_0xfcf470['type']===_0x612eb(0x209))return console[_0x612eb(0x254)](_0x612eb(0x244)),console[_0x612eb(0x254)](_0x612eb(0x21b)),0x1;if(_0xfcf470[_0x612eb(0x24e)]===_0x612eb(0x25c))return console['error'](_0x612eb(0x251)),console[_0x612eb(0x254)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0xfcf470[_0x612eb(0x22f)])throw new SDKError(ErrorCode[_0x612eb(0x217)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2966db=await withSpinner(_0x612eb(0x212),()=>_0x365209[_0x612eb(0x232)][_0x612eb(0x256)](_0xfcf470[_0x612eb(0x1d9)],_0xfcf470[_0x612eb(0x22f)]),{'verbose':_0x168a0d[_0x612eb(0x1da)]});let _0x1bceb0=_0x2966db[_0x612eb(0x243)];const _0x5f1042=resolveLimit(_0x168a0d['limit'],DEFAULT_DISPLAY_LIMIT),_0xf102b1=/\bLIMIT\s+\d+/i[_0x612eb(0x1c6)](_0x1bceb0);!_0xf102b1&&(_0x1bceb0=_0x1bceb0[_0x612eb(0x237)]()[_0x612eb(0x23a)](/;+$/,''),_0x1bceb0=_0x612eb(0x20a)+_0x1bceb0+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5f1042);_0x168a0d[_0x612eb(0x1da)]&&console[_0x612eb(0x254)](_0x612eb(0x1dc)+_0x1bceb0);const _0x2a6161=await withProgressSpinner('Executing\x20segment\x20query...',async _0x28a2d5=>{const _0x1d486c=_0x612eb,_0x463955=await _0x365209['query'][_0x1d486c(0x24a)](_0x1bceb0,{'catalog':'td','schema':_0x1d486c(0x1e1),'onJobId':_0x46a631=>{const _0x42a8b7=_0x1d486c;_0x28a2d5[_0x42a8b7(0x222)](_0x46a631);}});return _0x463955;},{'verbose':_0x168a0d[_0x612eb(0x1da)]}),_0x1d8e9c=_0x2a6161['data'],_0x49c767=_0x1d8e9c['jobId']?_0x612eb(0x1c7)+_0x1d8e9c[_0x612eb(0x215)]+']':'';return console[_0x612eb(0x254)](_0x612eb(0x227)+_0x1d8e9c[_0x612eb(0x1df)]['processedRows']['toLocaleString']()+_0x612eb(0x1e7)+(_0x612eb(0x231)+formatElapsed(_0x1d8e9c['stats'][_0x612eb(0x1d4)])+_0x49c767)),await handleQueryOutput(_0x1d8e9c,_0x168a0d),0x0;}catch(_0x5f017b){if(_0x5f017b instanceof SDKError)return console['error'](_0x612eb(0x1ef)+_0x5f017b['code']+']'),console[_0x612eb(0x254)]('\x0a'+_0x5f017b['message']),0x1;throw _0x5f017b;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x1c5);[a25_0x3f95e6(0x1de)]=a25_0x3f95e6(0x1cf);async['execute'](_0x142cde){const _0x159f20=a25_0x3f95e6,{options:_0x3be13a,args:_0x223933,tdx:_0x1bbd62}=_0x142cde;if(_0x223933[_0x159f20(0x230)]===0x0)return console[_0x159f20(0x254)](_0x159f20(0x1d5)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x38313b=_0x223933[0x0];try{_0x3be13a[_0x159f20(0x1da)]&&(console[_0x159f20(0x254)](_0x159f20(0x1d1)+_0x3be13a[_0x159f20(0x204)]),console[_0x159f20(0x254)](_0x159f20(0x255)+_0x38313b));const _0x366c86=await withSpinner(_0x159f20(0x21f)+_0x38313b+_0x159f20(0x1e2),()=>_0x1bbd62[_0x159f20(0x232)][_0x159f20(0x240)](_0x38313b),{'verbose':_0x3be13a[_0x159f20(0x1da)]}),_0x2f75b8=_0x366c86[_0x159f20(0x243)];_0x3be13a[_0x159f20(0x1da)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x2f75b8);const _0x9327bd=await withSpinner(_0x159f20(0x1eb)+_0x38313b+_0x159f20(0x1e2),()=>_0x1bbd62['segment'][_0x159f20(0x21c)](_0x2f75b8),{'verbose':_0x3be13a[_0x159f20(0x1da)]}),_0x2c936e=_0x9327bd[_0x159f20(0x243)];return console[_0x159f20(0x254)](_0x159f20(0x216)+_0x2c936e[_0x159f20(0x230)]+'\x20folder'+(_0x2c936e[_0x159f20(0x230)]!==0x1?'s':'')),await handleSDKOutput(_0x2c936e,_0x3be13a),0x0;}catch(_0x26efcb){if(_0x26efcb instanceof SDKError)return console[_0x159f20(0x254)](_0x159f20(0x233)+_0x26efcb[_0x159f20(0x223)]),_0x26efcb[_0x159f20(0x1f4)]&&console[_0x159f20(0x254)](_0x159f20(0x20d)+_0x26efcb['cause']),0x1;throw _0x26efcb;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x20c);[a25_0x3f95e6(0x1de)]='Show\x20segment\x20folder\x20details';async[a25_0x3f95e6(0x24a)](_0x352502){const _0x4bb97c=a25_0x3f95e6,{options:_0x287762,args:_0x45580f,tdx:_0x50929a}=_0x352502;if(_0x45580f['length']===0x0)return console[_0x4bb97c(0x254)](_0x4bb97c(0x1d2)),console['error'](_0x4bb97c(0x207)),0x1;try{const {parentId:_0x1fe250,childId:_0x40c843}=parseSegmentRef(_0x45580f[0x0]);_0x287762[_0x4bb97c(0x1da)]&&(console['error'](_0x4bb97c(0x1d1)+_0x287762[_0x4bb97c(0x204)]),console[_0x4bb97c(0x254)](_0x4bb97c(0x255)+_0x1fe250),_0x40c843&&console['error'](_0x4bb97c(0x224)+_0x40c843));if(!_0x40c843)return console[_0x4bb97c(0x254)](_0x4bb97c(0x1f2)),0x1;const _0x4abfe8=await withSpinner(_0x4bb97c(0x21f)+_0x1fe250+_0x4bb97c(0x1e2),()=>_0x50929a[_0x4bb97c(0x232)]['resolveParentId'](_0x1fe250),{'verbose':_0x287762[_0x4bb97c(0x1da)]}),_0x323b2a=_0x4abfe8[_0x4bb97c(0x243)];_0x287762[_0x4bb97c(0x1da)]&&console[_0x4bb97c(0x254)](_0x4bb97c(0x252)+_0x323b2a);const _0x2e9b5a=await withSpinner(_0x4bb97c(0x1f6)+_0x40c843+_0x4bb97c(0x1e2),()=>_0x50929a[_0x4bb97c(0x232)][_0x4bb97c(0x218)](_0x323b2a,_0x40c843),{'verbose':_0x287762[_0x4bb97c(0x1da)]}),_0x7fbc6d=_0x2e9b5a[_0x4bb97c(0x243)];_0x287762[_0x4bb97c(0x1da)]&&console['error'](_0x4bb97c(0x235)+_0x7fbc6d);const _0x18b7ef=await withSpinner(_0x4bb97c(0x1cc)+_0x40c843+_0x4bb97c(0x1e2),()=>_0x50929a[_0x4bb97c(0x232)][_0x4bb97c(0x23d)](_0x7fbc6d),{'verbose':_0x287762[_0x4bb97c(0x1da)]});return await handleSDKOutput([_0x18b7ef[_0x4bb97c(0x243)]],_0x287762),0x0;}catch(_0x398939){if(_0x398939 instanceof SDKError)return console[_0x4bb97c(0x254)](_0x4bb97c(0x233)+_0x398939['message']),_0x398939[_0x4bb97c(0x1f4)]&&console[_0x4bb97c(0x254)]('\x20\x20Cause:\x20'+_0x398939[_0x4bb97c(0x1f4)]),0x1;throw _0x398939;}}}function a25_0x3463(_0x2d8add,_0x554415){_0x2d8add=_0x2d8add-0x1c5;const _0x2b476f=a25_0x2b47();let _0x34632e=_0x2b476f[_0x2d8add];return _0x34632e;}export class SegmentSQLCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x22b);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a25_0x3f95e6(0x24a)](_0x50369a){const _0xf14ecf=a25_0x3f95e6,{options:_0x56cad9,args:_0x432e89,tdx:_0x575854}=_0x50369a,_0x2ded48=_0x432e89[0x0];if(!_0x2ded48)return console[_0xf14ecf(0x254)](_0xf14ecf(0x208)),console[_0xf14ecf(0x254)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0xf14ecf(0x254)](_0xf14ecf(0x21a)),console[_0xf14ecf(0x254)](_0xf14ecf(0x25b)),console['error'](_0xf14ecf(0x245)),0x1;try{const _0x4970bc=_0x56cad9[_0xf14ecf(0x20e)],_0x3b44fc=await resolveSegmentTarget(_0x2ded48,_0x4970bc,_0x56cad9[_0xf14ecf(0x1da)]);_0x56cad9['verbose']&&console[_0xf14ecf(0x254)](_0xf14ecf(0x1d8)+_0x3b44fc);const _0x266ca0=await withSpinner(_0xf14ecf(0x1fb)+_0x2ded48+'\x27...',()=>_0x575854['segment'][_0xf14ecf(0x21d)](_0x3b44fc),{'verbose':_0x56cad9[_0xf14ecf(0x1da)]}),_0x27d8ed=_0x266ca0[_0xf14ecf(0x243)];_0x56cad9[_0xf14ecf(0x1da)]&&(console[_0xf14ecf(0x254)](_0xf14ecf(0x1fc)+_0x27d8ed[_0xf14ecf(0x24e)]),console[_0xf14ecf(0x254)](_0xf14ecf(0x246)+_0x27d8ed[_0xf14ecf(0x1d9)]));if(_0x27d8ed[_0xf14ecf(0x24e)]===_0xf14ecf(0x209))return console[_0xf14ecf(0x254)](_0xf14ecf(0x226)),console[_0xf14ecf(0x254)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x27d8ed['type']===_0xf14ecf(0x25c))return console['error'](_0xf14ecf(0x1ec)),console[_0xf14ecf(0x254)](_0xf14ecf(0x205)),0x1;if(!_0x27d8ed[_0xf14ecf(0x22f)])throw new SDKError(ErrorCode[_0xf14ecf(0x217)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x173c14=await withSpinner(_0xf14ecf(0x212),()=>_0x575854['segment'][_0xf14ecf(0x256)](_0x27d8ed[_0xf14ecf(0x1d9)],_0x27d8ed[_0xf14ecf(0x22f)]),{'verbose':_0x56cad9['verbose']}),_0x57b153=_0x173c14[_0xf14ecf(0x243)];return _0x56cad9[_0xf14ecf(0x23b)]==='json'||_0x56cad9[_0xf14ecf(0x23b)]===_0xf14ecf(0x1cb)?await handleSDKOutput([{'sql':_0x57b153}],_0x56cad9):console[_0xf14ecf(0x1d0)](_0x57b153),0x0;}catch(_0x235eb7){if(_0x235eb7 instanceof SDKError)return console[_0xf14ecf(0x254)](_0xf14ecf(0x233)+_0x235eb7[_0xf14ecf(0x223)]),_0x235eb7['cause']&&console['error'](_0xf14ecf(0x20d)+_0x235eb7[_0xf14ecf(0x1f4)]),0x1;throw _0x235eb7;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]='segment:folder:create';[a25_0x3f95e6(0x1de)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x2f8f3e){const _0x2303b9=a25_0x3f95e6,{options:_0x1b2499,args:_0x15884b,tdx:_0x454187}=_0x2f8f3e,_0x330660=_0x1b2499;if(_0x15884b[_0x2303b9(0x230)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x2303b9(0x22c)),0x1;const _0x547eea=_0x15884b[0x0],_0x21a8ab=_0x15884b[0x1];_0x330660['verbose']&&(console[_0x2303b9(0x254)]('Site:\x20'+_0x330660['site']),console[_0x2303b9(0x254)]('Parent\x20segment:\x20'+_0x547eea),console[_0x2303b9(0x254)](_0x2303b9(0x224)+_0x21a8ab));let _0x3e7657;if(_0x330660['parentFolder']){const _0x2d4c98=_0x330660['parentFolder'],_0x5d4869=await withSpinner(_0x2303b9(0x21f)+_0x547eea+_0x2303b9(0x1e2),()=>_0x454187['segment'][_0x2303b9(0x240)](_0x547eea),{'verbose':_0x330660[_0x2303b9(0x1da)]}),_0x278543=_0x5d4869[_0x2303b9(0x243)],_0xf1957f=await withSpinner(_0x2303b9(0x248)+_0x2d4c98+_0x2303b9(0x1e2),()=>_0x454187[_0x2303b9(0x232)][_0x2303b9(0x218)](_0x278543,_0x2d4c98),{'verbose':_0x330660['verbose']});_0x3e7657=_0xf1957f[_0x2303b9(0x243)],_0x330660[_0x2303b9(0x1da)]&&console[_0x2303b9(0x254)](_0x2303b9(0x236)+_0x3e7657);}const _0x4bedf8={'name':_0x21a8ab,'description':_0x330660[_0x2303b9(0x1de)],'parentFolderId':_0x3e7657},_0x1aac8e=await withSpinner(_0x2303b9(0x242)+_0x21a8ab+'\x27...',()=>_0x454187['segment'][_0x2303b9(0x1e6)](_0x547eea,_0x4bedf8),{'verbose':_0x330660[_0x2303b9(0x1da)]}),_0x46040a=_0x1aac8e['data'];return console[_0x2303b9(0x254)]('β\x20Created\x20folder\x20\x27'+_0x46040a['name']+_0x2303b9(0x213)+_0x46040a['id']),await handleSDKOutput([_0x46040a],_0x330660),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a25_0x3f95e6(0x1ed);[a25_0x3f95e6(0x1de)]=a25_0x3f95e6(0x238);async['execute'](_0x2e0b91){const _0x3bf830=a25_0x3f95e6,{options:_0x59ad4c,args:_0x2846d2,tdx:_0x3ffb06}=_0x2e0b91,_0x59a0fb=_0x2846d2[0x0];if(!_0x59a0fb)return console[_0x3bf830(0x254)](_0x3bf830(0x1f8)),console[_0x3bf830(0x254)](_0x3bf830(0x20b)),console[_0x3bf830(0x254)](_0x3bf830(0x1ff)),console['error']('Options:'),console[_0x3bf830(0x254)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3bf830(0x254)]('Examples:'),console['error'](_0x3bf830(0x1e8)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5eefdb=_0x59ad4c['parentSegment'],_0xd713b0=await resolveSegmentTarget(_0x59a0fb,_0x5eefdb,_0x59ad4c[_0x3bf830(0x1da)]);_0x59ad4c[_0x3bf830(0x1da)]&&console['error'](_0x3bf830(0x1d8)+_0xd713b0);const _0x8e653c=await withSpinner('Resolving\x20\x27'+_0x59a0fb+_0x3bf830(0x1e2),()=>_0x3ffb06[_0x3bf830(0x232)][_0x3bf830(0x21d)](_0xd713b0),{'verbose':_0x59ad4c['verbose']}),_0x19ded9=_0x8e653c[_0x3bf830(0x243)];_0x59ad4c[_0x3bf830(0x1da)]&&(console[_0x3bf830(0x254)](_0x3bf830(0x1fc)+_0x19ded9[_0x3bf830(0x24e)]),console[_0x3bf830(0x254)](_0x3bf830(0x246)+_0x19ded9['parentId']),_0x19ded9[_0x3bf830(0x1fe)]&&console[_0x3bf830(0x254)]('Folder\x20ID:\x20'+_0x19ded9[_0x3bf830(0x1fe)]),_0x19ded9['segmentId']&&console['error']('Segment\x20ID:\x20'+_0x19ded9['segmentId']));if(_0x59ad4c[_0x3bf830(0x211)]){if(_0x19ded9['type']===_0x3bf830(0x209))return console['error'](_0x3bf830(0x1e0)),0x1;if(_0x19ded9[_0x3bf830(0x24e)]==='parent')return console[_0x3bf830(0x254)](_0x3bf830(0x24c)),console[_0x3bf830(0x254)](_0x3bf830(0x24b)),0x1;if(!_0x19ded9[_0x3bf830(0x22f)])throw new SDKError(ErrorCode[_0x3bf830(0x217)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x53f22c=getConsoleNextUrl(_0x59ad4c[_0x3bf830(0x204)],_0x3bf830(0x1f3)+_0x19ded9['parentId']+_0x3bf830(0x228)+_0x19ded9[_0x3bf830(0x22f)]);return console['error'](a25_0x120088[_0x3bf830(0x24f)]('β')+_0x3bf830(0x225)+a25_0x120088[_0x3bf830(0x1f1)](_0x53f22c)),openBrowser(_0x53f22c),0x0;}if(_0x19ded9[_0x3bf830(0x24e)]==='folder'){if(!_0x19ded9[_0x3bf830(0x1fe)])throw new SDKError(ErrorCode[_0x3bf830(0x1d6)],_0x3bf830(0x1ee));const _0x2de59e=await withSpinner(_0x3bf830(0x22e),()=>_0x3ffb06[_0x3bf830(0x232)][_0x3bf830(0x23d)](_0x19ded9['folderId']),{'verbose':_0x59ad4c[_0x3bf830(0x1da)]});await handleSingleObjectOutput(_0x2de59e[_0x3bf830(0x243)],_0x59ad4c);}else{if(_0x19ded9['type']===_0x3bf830(0x232)){if(!_0x19ded9['segmentId'])throw new SDKError(ErrorCode[_0x3bf830(0x217)],_0x3bf830(0x200));const _0xec969a=await withSpinner(_0x3bf830(0x221),()=>_0x3ffb06[_0x3bf830(0x232)][_0x3bf830(0x214)](_0x19ded9[_0x3bf830(0x1d9)],_0x19ded9[_0x3bf830(0x22f)]),{'verbose':_0x59ad4c[_0x3bf830(0x1da)]}),_0x3b7d12=getConsoleNextUrl(_0x59ad4c['site'],_0x3bf830(0x1f3)+_0x19ded9[_0x3bf830(0x1d9)]+'/e/'+_0x19ded9['segmentId']),_0x4d72c7=_0xec969a[_0x3bf830(0x243)];_0x4d72c7[_0x3bf830(0x22a)]=_0x3b7d12,await handleSingleObjectOutput(_0x4d72c7,_0x59ad4c);}else return console[_0x3bf830(0x254)](_0x3bf830(0x25d)),console[_0x3bf830(0x254)](_0x3bf830(0x21e)),0x1;}return 0x0;}catch(_0x1d512c){if(_0x1d512c instanceof SDKError)return console['error']('Error:\x20'+_0x1d512c[_0x3bf830(0x223)]),_0x1d512c[_0x3bf830(0x1f4)]&&console[_0x3bf830(0x254)]('\x20\x20Cause:\x20'+_0x1d512c[_0x3bf830(0x1f4)]),0x1;throw _0x1d512c;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x3f95e6(0x239);['description']=a25_0x3f95e6(0x249);async[a25_0x3f95e6(0x24a)](_0x5203b1){const _0x2454c2=a25_0x3f95e6,{options:_0x3a6a35,args:_0x5358f1,tdx:_0x589d02}=_0x5203b1,_0x4d94d8=_0x5358f1[0x0];if(!_0x4d94d8)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x2454c2(0x254)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x2454c2(0x254)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x2454c2(0x21a)),console[_0x2454c2(0x254)](_0x2454c2(0x229)),console[_0x2454c2(0x254)](_0x2454c2(0x1fd)),0x1;try{const _0xbc9ca9=_0x3a6a35[_0x2454c2(0x20e)],_0xde2f25=await resolveSegmentTarget(_0x4d94d8,_0xbc9ca9,_0x3a6a35[_0x2454c2(0x1da)]);_0x3a6a35[_0x2454c2(0x1da)]&&console[_0x2454c2(0x254)](_0x2454c2(0x1d8)+_0xde2f25);const _0x31d2ea=await withSpinner(_0x2454c2(0x1fb)+_0x4d94d8+_0x2454c2(0x1e2),()=>_0x589d02['segment']['resolvePathToResource'](_0xde2f25),{'verbose':_0x3a6a35[_0x2454c2(0x1da)]}),_0x1c99fc=_0x31d2ea['data'];_0x3a6a35[_0x2454c2(0x1da)]&&(console[_0x2454c2(0x254)](_0x2454c2(0x1fc)+_0x1c99fc[_0x2454c2(0x24e)]),console[_0x2454c2(0x254)](_0x2454c2(0x246)+_0x1c99fc[_0x2454c2(0x1d9)]));if(_0x1c99fc[_0x2454c2(0x24e)]===_0x2454c2(0x209))return console[_0x2454c2(0x254)](_0x2454c2(0x24d)),console[_0x2454c2(0x254)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x1c99fc[_0x2454c2(0x24e)]==='parent')return console[_0x2454c2(0x254)](_0x2454c2(0x203)),console['error'](_0x2454c2(0x202)),0x1;if(!_0x1c99fc[_0x2454c2(0x22f)])throw new SDKError(ErrorCode[_0x2454c2(0x217)],_0x2454c2(0x200));const _0x4b838c=await withSpinner(_0x2454c2(0x212),()=>_0x589d02[_0x2454c2(0x232)][_0x2454c2(0x256)](_0x1c99fc[_0x2454c2(0x1d9)],_0x1c99fc[_0x2454c2(0x22f)]),{'verbose':_0x3a6a35[_0x2454c2(0x1da)]}),_0x2ba750=_0x4b838c[_0x2454c2(0x243)],_0x2f1e64=await executeSchemaQuery(_0x2ba750,_0x589d02,_0x3a6a35);return await handleQueryOutput(_0x2f1e64,_0x3a6a35),0x0;}catch(_0x4a50d1){if(_0x4a50d1 instanceof SDKError)return console[_0x2454c2(0x254)](_0x2454c2(0x233)+_0x4a50d1[_0x2454c2(0x223)]),_0x4a50d1[_0x2454c2(0x1f4)]&&console[_0x2454c2(0x254)](_0x2454c2(0x20d)+_0x4a50d1['cause']),0x1;throw _0x4a50d1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x1fc76f=a26_0x30f7;(function(_0x407407,_0x1e0a78){const _0xffcdb0=a26_0x30f7,_0x5b48b3=_0x407407();while(!![]){try{const _0x3a2431=parseInt(_0xffcdb0(0x1be))/0x1*(parseInt(_0xffcdb0(0x1c3))/0x2)+parseInt(_0xffcdb0(0x1ee))/0x3+parseInt(_0xffcdb0(0x1d7))/0x4*(-parseInt(_0xffcdb0(0x1e5))/0x5)+-parseInt(_0xffcdb0(0x1d9))/0x6+-parseInt(_0xffcdb0(0x1c2))/0x7+parseInt(_0xffcdb0(0x1bc))/0x8*(parseInt(_0xffcdb0(0x1c6))/0x9)+-parseInt(_0xffcdb0(0x1d6))/0xa;if(_0x3a2431===_0x1e0a78)break;else _0x5b48b3['push'](_0x5b48b3['shift']());}catch(_0x1d1328){_0x5b48b3['push'](_0x5b48b3['shift']());}}}(a26_0x23d7,0xa7f4d));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';function a26_0x23d7(){const _0x5bcb91=['resolvePathToResource','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','data','error','\x20\x20\x20Path:\x20','β\x20Created\x20segment\x20\x27','Examples:','Resolving\x20folder\x20\x27','segment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','80595fWbBxo','createSegment','resolveParentId','folderId','segments','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','noCountPopulation','Resolving\x20folder\x20path\x20\x27','site','1172556jaNzrj','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','type','folder','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','8KzdPoe','verbose','4ZxfZXt','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Creating\x20segment\x20\x27','β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','5194616bZMECJ','568010phYNFJ','Site:\x20','rule','3823434duBxDz','Resolved\x20folder\x20ID:\x20','resolveFolderId','execute','kind','name','\x27...','Parent\x20path:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','ruleFile','description','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20relative\x20path\x20to:\x20','length','Parent:\x20','Resolving\x20parent\x20segment\x20\x27','4005470ccxjYB','8MjphWs','yellow','533256kgksFi'];a26_0x23d7=function(){return _0x5bcb91;};return a26_0x23d7();}function a26_0x30f7(_0x5ad204,_0x34ead7){_0x5ad204=_0x5ad204-0x1b9;const _0x23d7af=a26_0x23d7();let _0x30f763=_0x23d7af[_0x5ad204];return _0x30f763;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x38b62c from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x1fc76f(0x1cb)]='segment:create';[a26_0x1fc76f(0x1d0)]=a26_0x1fc76f(0x1dc);async[a26_0x1fc76f(0x1c9)](_0x10adab){const _0x25904f=a26_0x1fc76f;console[_0x25904f(0x1de)](a26_0x38b62c[_0x25904f(0x1d8)](_0x25904f(0x1c1))),console['error'](a26_0x38b62c[_0x25904f(0x1d8)](_0x25904f(0x1bb)));const {options:_0x3806db,args:_0x4e7747,tdx:_0x23aab2}=_0x10adab,_0x167f1d=_0x3806db;if(_0x4e7747[_0x25904f(0x1d3)]===0x0)return console[_0x25904f(0x1de)](_0x25904f(0x1d1)),console[_0x25904f(0x1de)](_0x25904f(0x1e4)),console[_0x25904f(0x1de)](_0x25904f(0x1e1)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x25904f(0x1de)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x25904f(0x1de)](_0x25904f(0x1bf)),0x1;const _0x72d46=_0x4e7747[0x0],_0x420e00=_0x3806db['segmentPath'];let _0x56869d=_0x72d46;_0x420e00&&!_0x72d46['includes']('/')&&(_0x56869d=_0x420e00+'/'+_0x72d46,_0x167f1d['verbose']&&console[_0x25904f(0x1de)](_0x25904f(0x1d2)+_0x56869d));const _0x4daf47=parsePath(_0x56869d);if(_0x4daf47[_0x25904f(0x1e9)][_0x25904f(0x1d3)]<0x2)return console[_0x25904f(0x1de)](_0x25904f(0x1ce)),console['error'](_0x25904f(0x1ea)),0x1;const _0x4b56ed=_0x4daf47[_0x25904f(0x1e9)][0x0],_0x424222=getBaseName(_0x56869d),_0xc304dc=getParentPath(_0x56869d);_0x167f1d['verbose']&&(console[_0x25904f(0x1de)](_0x25904f(0x1c4)+_0x167f1d[_0x25904f(0x1ed)]),console[_0x25904f(0x1de)](_0x25904f(0x1db)+_0x56869d),console[_0x25904f(0x1de)](_0x25904f(0x1d4)+_0x4b56ed),console['error']('Segment\x20name:\x20'+_0x424222),console['error'](_0x25904f(0x1cd)+_0xc304dc));const _0x4f2f78=await withSpinner(_0x25904f(0x1d5)+_0x4b56ed+_0x25904f(0x1cc),()=>_0x23aab2[_0x25904f(0x1e3)][_0x25904f(0x1e7)](_0x4b56ed),{'verbose':_0x167f1d[_0x25904f(0x1bd)]}),_0x352400=_0x4f2f78['data'];let _0x201f2a;if(_0x4daf47[_0x25904f(0x1e9)]['length']>0x2){const _0x3b375a=await withSpinner(_0x25904f(0x1ec)+_0xc304dc+_0x25904f(0x1cc),()=>_0x23aab2[_0x25904f(0x1e3)][_0x25904f(0x1da)](_0xc304dc),{'verbose':_0x167f1d[_0x25904f(0x1bd)]}),_0x5c1eb4=_0x3b375a['data'];if(_0x5c1eb4['type']!==_0x25904f(0x1ba)&&_0x5c1eb4[_0x25904f(0x1b9)]!=='parent')return console['error'](_0x25904f(0x1ef)),0x1;_0x201f2a=_0x5c1eb4[_0x25904f(0x1e8)];}else{if(_0x167f1d[_0x25904f(0x1ba)]){const _0x368ecd=await withSpinner(_0x25904f(0x1e2)+_0x167f1d[_0x25904f(0x1ba)]+_0x25904f(0x1cc),()=>_0x23aab2['segment'][_0x25904f(0x1c8)](_0x352400,_0x167f1d[_0x25904f(0x1ba)]),{'verbose':_0x167f1d['verbose']});_0x201f2a=_0x368ecd[_0x25904f(0x1dd)];}}_0x167f1d[_0x25904f(0x1bd)]&&_0x201f2a&&console['error'](_0x25904f(0x1c7)+_0x201f2a);const _0x250c03=await loadJSONFromOptions(_0x167f1d[_0x25904f(0x1c5)],_0x167f1d[_0x25904f(0x1cf)]),_0x3207f8={'name':_0x424222,'description':_0x167f1d['description'],'rule':_0x250c03,'kind':_0x167f1d['kind']!==undefined?parseInt(_0x167f1d[_0x25904f(0x1ca)],0xa):undefined,'isVisible':_0x167f1d['invisible']?![]:undefined,'segmentFolderId':_0x201f2a,'countPopulation':_0x167f1d[_0x25904f(0x1eb)]?![]:undefined},_0x2a229f=await withSpinner(_0x25904f(0x1c0)+_0x424222+'\x27...',()=>_0x23aab2[_0x25904f(0x1e3)][_0x25904f(0x1e6)](_0x352400,_0x3207f8),{'verbose':_0x167f1d[_0x25904f(0x1bd)]}),_0x545d66=_0x2a229f['data'];return console[_0x25904f(0x1de)](_0x25904f(0x1e0)+_0x545d66[_0x25904f(0x1cb)]+'\x27\x20with\x20ID:\x20'+_0x545d66['id']),_0x56869d!==_0x72d46&&console[_0x25904f(0x1de)](_0x25904f(0x1df)+_0x56869d),await handleSDKOutput([_0x545d66],_0x167f1d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x2d0390=a27_0x11a4;(function(_0x72b521,_0x234a74){const _0xca3be3=a27_0x11a4,_0x53d961=_0x72b521();while(!![]){try{const _0x3756aa=-parseInt(_0xca3be3(0xa3))/0x1+-parseInt(_0xca3be3(0x9d))/0x2*(-parseInt(_0xca3be3(0x9b))/0x3)+-parseInt(_0xca3be3(0xa7))/0x4*(-parseInt(_0xca3be3(0xaf))/0x5)+parseInt(_0xca3be3(0xb0))/0x6*(-parseInt(_0xca3be3(0xb3))/0x7)+-parseInt(_0xca3be3(0x9c))/0x8+-parseInt(_0xca3be3(0xb1))/0x9+-parseInt(_0xca3be3(0xaa))/0xa*(-parseInt(_0xca3be3(0xa0))/0xb);if(_0x3756aa===_0x234a74)break;else _0x53d961['push'](_0x53d961['shift']());}catch(_0x3bedbf){_0x53d961['push'](_0x53d961['shift']());}}}(a27_0x4b5c,0x23fdc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x4b5c(){const _0x3d28cf=['β\x20Found\x20','1595vaVcSy','387570lBjqay','1810413seSyqa','segment','21ziIkyl','json','List\x20available\x20fields\x20for\x20segmentation','Site:\x20','description','239283GkBnnP','1121192sdAaLu','4OdqHpN','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','jsonl','184987gIDXpo','error','verbose','32242ydCbqJ','execute','\x27...','segment:fields','636dppzXm','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Parent\x20segment:\x20','300HnwbQH','length','name','listFields'];a27_0x4b5c=function(){return _0x3d28cf;};return a27_0x4b5c();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a27_0x11a4(_0x17642f,_0x545155){_0x17642f=_0x17642f-0x98;const _0x4b5c9b=a27_0x4b5c();let _0x11a4e3=_0x4b5c9b[_0x17642f];return _0x11a4e3;}export class SegmentFieldsCommand extends BaseCommand{[a27_0x2d0390(0xac)]=a27_0x2d0390(0xa6);[a27_0x2d0390(0x9a)]=a27_0x2d0390(0x98);async[a27_0x2d0390(0xa4)](_0x2e22f0){const _0x240cba=a27_0x2d0390,{options:_0x23960e,args:_0x506f41,tdx:_0x55f489}=_0x2e22f0,_0xd2318=_0x506f41[0x0]||_0x23960e['parentSegment'];if(!_0xd2318)return console[_0x240cba(0xa1)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x240cba(0xa1)](_0x240cba(0x9e)),console[_0x240cba(0xa1)](_0x240cba(0xa8)),0x1;_0x23960e[_0x240cba(0xa2)]&&(console[_0x240cba(0xa1)](_0x240cba(0x99)+_0x23960e['site']),console['error'](_0x240cba(0xa9)+_0xd2318));const _0x2fc198=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0xd2318+_0x240cba(0xa5),()=>_0x55f489[_0x240cba(0xb2)][_0x240cba(0xad)](_0xd2318),{'verbose':_0x23960e[_0x240cba(0xa2)]}),_0x178f5c=_0x2fc198['data'];console[_0x240cba(0xa1)](_0x240cba(0xae)+_0x178f5c[_0x240cba(0xab)]+'\x20field'+(_0x178f5c['length']!==0x1?'s':''));if(_0x23960e[_0x240cba(0xb4)]||_0x23960e[_0x240cba(0x9f)])return await handleSDKOutput(_0x178f5c,_0x23960e),0x0;return displayFieldsHumanReadable(_0x178f5c,_0xd2318),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x8af78c=a28_0x2a7d;(function(_0x252136,_0x828d6c){const _0x15ed33=a28_0x2a7d,_0x2f5e45=_0x252136();while(!![]){try{const _0xa6db64=parseInt(_0x15ed33(0x1d8))/0x1*(parseInt(_0x15ed33(0x1dd))/0x2)+-parseInt(_0x15ed33(0x1c7))/0x3+parseInt(_0x15ed33(0x1b2))/0x4*(-parseInt(_0x15ed33(0x1c6))/0x5)+parseInt(_0x15ed33(0x1d5))/0x6*(-parseInt(_0x15ed33(0x1d7))/0x7)+parseInt(_0x15ed33(0x1b9))/0x8*(parseInt(_0x15ed33(0x197))/0x9)+-parseInt(_0x15ed33(0x1bf))/0xa+parseInt(_0x15ed33(0x19d))/0xb*(parseInt(_0x15ed33(0x1a6))/0xc);if(_0xa6db64===_0x828d6c)break;else _0x2f5e45['push'](_0x2f5e45['shift']());}catch(_0xf809a9){_0x2f5e45['push'](_0x2f5e45['shift']());}}}(a28_0x186f,0xf3a5d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a28_0x186f(){const _0x1df9df=['repeat','\x20versions)','isNew','length','utf-8','\x20unchanged\x20files','parent_segment','data','counts','238494dwuWAM','β\x20Context\x20set:\x20','301pfJKtn','931478iuFiDj','filter','β\x20Pulled\x20','resourceName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','4RsKYQL','yes','file','red','yellow','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','segments','\x20files?','3573NZuFwP','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)','helpText','Pulling\x20segments\x20from\x20\x27','journeys','absolutePath','4969030YRYhmm','\x20\x20π―\x20','session','\x20segments','\x20files\x20to\x20','Parent\x20segment:\x20','error','\x20=\x20','\x20\x20Target:\x20','24wOxLSB','Error:\x20','cyan','activations','targetDir','execute','segment','\x0aChanges\x20to\x20\x27','\x20activations','dim','diff','message','4UweFgJ','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parentName','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','cwd','journeyVersions','31384hLXCEo','Aborted.','Site:\x20','\x20\x20πΊοΈ\x20\x20','segment:pull','hasChanges','3925760TStlwH','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aPull\x20summary\x20for\x20\x27','content','β\x20All\x20files\x20are\x20up\x20to\x20date','verbose','files','5501185OlQLVg','371538esIyxX','Write\x20','\x20new\x20files','parentSegment','relativePath'];a28_0x186f=function(){return _0x1df9df;};return a28_0x186f();}import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x3752e5 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a28_0x2a7d(_0x5ecb23,_0x50ae64){_0x5ecb23=_0x5ecb23-0x195;const _0x186fb5=a28_0x186f();let _0x2a7d54=_0x186fb5[_0x5ecb23];return _0x2a7d54;}import a28_0x47d1a8 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a28_0x8af78c(0x1bd);['description']=a28_0x8af78c(0x1e2);async[a28_0x8af78c(0x1ab)](_0x1d44c9){const _0x540c31=a28_0x8af78c,{options:_0xdd37eb,args:_0x258707,tdx:_0x1dd6d3}=_0x1d44c9,_0x501b97=_0xdd37eb,_0x5c0004=await resolveTarget({'arg':_0x258707[0x0],'contextParent':_0xdd37eb[_0x540c31(0x1ca)],'cwd':process[_0x540c31(0x1b7)]()});if(!isSuccessfulResolution(_0x5c0004))return _0x5c0004['errorCode']==='no_parent'?(console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1e1)](_0x540c31(0x1c0))),console[_0x540c31(0x1a3)](_0x540c31(0x198)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x540c31(0x1a3)](_0x540c31(0x1b4))):(console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1e0)](_0x540c31(0x1a7)+_0x5c0004[_0x540c31(0x1b1)]+'\x0a')),_0x5c0004[_0x540c31(0x199)]&&console[_0x540c31(0x1a3)](a28_0x3752e5['cyan'](_0x5c0004[_0x540c31(0x199)]))),0x1;const _0x41721c=_0x5c0004[_0x540c31(0x1b5)],_0x6e34c5=_0x5c0004['targetDir'],_0x43451b=_0x5c0004['type']===_0x540c31(0x1df)?_0x5c0004[_0x540c31(0x1db)]:undefined;_0x501b97[_0x540c31(0x1c4)]&&(console[_0x540c31(0x1a3)](_0x540c31(0x1bb)+_0x501b97['site']),console[_0x540c31(0x1a3)](_0x540c31(0x1a2)+_0x41721c),_0x43451b&&console['error']('Target\x20resource:\x20'+_0x43451b));const _0x4f6b94=await withProgressSpinner(_0x540c31(0x19a)+_0x41721c+'\x27...',_0x38b40e=>_0x1dd6d3[_0x540c31(0x1ac)]['pullSegments'](_0x41721c,{'targetDir':_0x6e34c5,'targetResourceName':_0x43451b,'verbose':_0x501b97[_0x540c31(0x1c4)],'progress':{'update':_0x39bf0e=>{const _0x315f4d=_0x540c31;_0x38b40e['setPhase'](_0x39bf0e),_0x501b97[_0x315f4d(0x1c4)]&&console['error']('\x20\x20'+_0x39bf0e);}}}),{'verbose':_0x501b97['verbose']}),_0x46aad4=_0x4f6b94[_0x540c31(0x1d3)];if(_0x46aad4['counts'][_0x540c31(0x195)]===0x0&&_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x19b)]===0x0)return console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1e1)](_0x540c31(0x1b6)+_0x46aad4[_0x540c31(0x1b5)]+'\x27')),0x0;const _0x535df3=_0x46aad4[_0x540c31(0x1c5)]['filter'](_0x552c52=>_0x552c52[_0x540c31(0x1ce)]),_0x41be80=_0x46aad4[_0x540c31(0x1c5)]['filter'](_0x4f90db=>!_0x4f90db[_0x540c31(0x1ce)]&&_0x4f90db[_0x540c31(0x1be)]),_0x2f4e82=_0x46aad4[_0x540c31(0x1c5)][_0x540c31(0x1d9)](_0x4c2646=>!_0x4c2646['isNew']&&!_0x4c2646['hasChanges']);console[_0x540c31(0x1a3)](_0x540c31(0x1c1)+_0x46aad4['parentName']+'\x27:'),console[_0x540c31(0x1a3)](_0x540c31(0x19e)+a28_0x3752e5['cyan'](_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x195)]+_0x540c31(0x1a0))+'\x20with\x20'+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x1a9)]+_0x540c31(0x1ae)));if(_0x46aad4[_0x540c31(0x1d4)]['journeys']>0x0){const _0x2c2c4e=_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x1b8)]>_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x19b)]?'\x20('+_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x1b8)]+_0x540c31(0x1cd):'';console['error'](_0x540c31(0x1bc)+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x19b)]+'\x20journeys')+a28_0x3752e5[_0x540c31(0x1af)](_0x2c2c4e));}console[_0x540c31(0x1a3)]('\x20\x20'+a28_0x3752e5[_0x540c31(0x1b3)]('+\x20'+_0x535df3[_0x540c31(0x1cf)]+_0x540c31(0x1c9))),console[_0x540c31(0x1a3)]('\x20\x20'+a28_0x3752e5['yellow']('~\x20'+_0x41be80[_0x540c31(0x1cf)]+'\x20changed\x20files')),console[_0x540c31(0x1a3)]('\x20\x20'+a28_0x3752e5[_0x540c31(0x1af)]('=\x20'+_0x2f4e82['length']+_0x540c31(0x1d1))),console['error'](_0x540c31(0x1a5)+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4[_0x540c31(0x1aa)])+'\x0a');if(_0x41be80[_0x540c31(0x1cf)]>0x0)for(const _0x1ac7d5 of _0x41be80){console[_0x540c31(0x1a3)](_0x540c31(0x1ad)+_0x1ac7d5[_0x540c31(0x1cb)]+'\x27:'),console[_0x540c31(0x1a3)]('β'[_0x540c31(0x1cc)](0x3c)),console['error'](_0x1ac7d5[_0x540c31(0x1b0)]),console[_0x540c31(0x1a3)]('β'[_0x540c31(0x1cc)](0x3c));}if(_0x501b97['dryRun'])return console['error'](a28_0x3752e5[_0x540c31(0x1e1)](_0x540c31(0x1dc))),0x0;if(_0x535df3[_0x540c31(0x1cf)]===0x0&&_0x41be80[_0x540c31(0x1cf)]===0x0)return console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1b3)](_0x540c31(0x1c3))),saveSessionContext({'parent_segment':_0x46aad4['parentName']},_0x501b97['session']),console['error'](a28_0x3752e5[_0x540c31(0x1b3)](_0x540c31(0x1d6)+a28_0x3752e5['dim'](_0x540c31(0x1d2))+_0x540c31(0x1a4)+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4[_0x540c31(0x1b5)]))),0x0;if(!_0x501b97[_0x540c31(0x1de)]){const _0x55efc0=await confirmKey(_0x540c31(0x1c8)+(_0x535df3['length']+_0x41be80[_0x540c31(0x1cf)])+_0x540c31(0x196));if(!_0x55efc0)return console[_0x540c31(0x1a3)](_0x540c31(0x1ba)),0x1;}for(const _0x2b7949 of _0x46aad4[_0x540c31(0x1c5)]){if(_0x2b7949[_0x540c31(0x1ce)]||_0x2b7949['hasChanges']){const _0x5c6213=a28_0x47d1a8['dirname'](_0x2b7949[_0x540c31(0x19c)]);!existsSync(_0x5c6213)&&mkdirSync(_0x5c6213,{'recursive':!![]}),writeFileSync(_0x2b7949[_0x540c31(0x19c)],_0x2b7949[_0x540c31(0x1c2)],_0x540c31(0x1d0));}}return console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1b3)](_0x540c31(0x1da)+(_0x535df3[_0x540c31(0x1cf)]+_0x41be80['length'])+_0x540c31(0x1a1)+_0x46aad4['targetDir'])),saveSessionContext({'parent_segment':_0x46aad4[_0x540c31(0x1b5)]},_0x501b97[_0x540c31(0x19f)]),console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1b3)](_0x540c31(0x1d6)+a28_0x3752e5['dim'](_0x540c31(0x1d2))+_0x540c31(0x1a4)+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4['parentName']))),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_0x3cf4a0=a29_0x5000;(function(_0x1c53b2,_0x183157){const _0x2e2ab2=a29_0x5000,_0x46a5ff=_0x1c53b2();while(!![]){try{const _0x5a4ccc=parseInt(_0x2e2ab2(0x96))/0x1+parseInt(_0x2e2ab2(0x10f))/0x2*(-parseInt(_0x2e2ab2(0xc0))/0x3)+-parseInt(_0x2e2ab2(0xec))/0x4*(parseInt(_0x2e2ab2(0xdd))/0x5)+parseInt(_0x2e2ab2(0xad))/0x6+parseInt(_0x2e2ab2(0xf3))/0x7+-parseInt(_0x2e2ab2(0xd5))/0x8+parseInt(_0x2e2ab2(0x9c))/0x9;if(_0x5a4ccc===_0x183157)break;else _0x46a5ff['push'](_0x46a5ff['shift']());}catch(_0x46b031){_0x46a5ff['push'](_0x46a5ff['shift']());}}}(a29_0x5326,0x8ad44));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';function a29_0x5000(_0x4748cd,_0x231140){_0x4748cd=_0x4748cd-0x85;const _0x53260d=a29_0x5326();let _0x500027=_0x53260d[_0x4748cd];return _0x500027;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a29_0x5326(){const _0x78d223=['cyan','\x20to\x20update','listJourneysWithDetailsFromParentSegment','908626RhnXNu','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20folders\x20to\x20create','relationships','setPhase','parentName','\x20\x20Journeys:\x20','Delete\x20journey:','Fetching\x20existing\x20segments...','\x20to\x20delete','Aborted.','\x20created','Error:\x20','data','Scoped\x20to\x20folder:\x20','changed','\x20deleted','no_parent','red','segments','yellow','toUpdate','\x20YAML\x20files\x20found','.yaml','targetDir','nameToId','Changes\x20to:','isNew','577008WJNQIh','journeyBundleId','add','parent_name','\x20\x20π\x20Segments:','repeat','1004904fUociK','journeyBundleName','\x20unchanged','toDelete','\x20changed','file','set','verbose','Fetching\x20existing\x20journeys...','\x20\x20Activations:','yes','idToName','Delete\x20segment:','getParent','toCreate','createdAt','\x20\x20Segments:\x20','6690720PWtdDb','site','dim','existingJourney','listSegments','then','description','Error\x20parsing\x20YAML:\x20','Error:\x20Directory\x20not\x20found:\x20','folderId','diff','state','filter','New\x20journey:','updated','/app/ps/','Push\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','6VAOcOj','activations','Fetching\x20connections\x20for\x20name\x20resolution...','segment:push','\x20new','get','Site:\x20','segmentFolderId','error','message','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','endsWith','unchanged','join','helpText','\x20activations]','π\x20','deleted','delete','push','\x20\x20Source:\x20','6250632DOnGRA','dryRun','errorCode','\x20updated','yamlConfig','folderPath','getJourney','/j/da/je','16065KcIIYz','audienceId','folders','new','No\x20','filePath','updatedAt','buildUserMaps','parentSegment','journeysOnly','name','all','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment','connection','68yiOLvS','Fetching\x20parent\x20segment\x20details...','toString','type','Fetching\x20existing\x20folders...','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','results','3566052zwjgiN','Fetching\x20users\x20for\x20email\x20resolution...','\x0aValidation\x20failed:','(Journey\x20will\x20be\x20deleted)','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','blue','map','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','/e/','New\x20segment:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','journeys','resolveParentId','created','createdSegmentIds','attributes','\x20\x20\x20\x20','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Activations:\x20','length','journeyId','Folders\x20to\x20create:','journey','listFolders','versionNumber'];a29_0x5326=function(){return _0x78d223;};return a29_0x5326();}import a29_0x1bb08c 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{['name']=a29_0x3cf4a0(0xc3);[a29_0x3cf4a0(0xb3)]=a29_0x3cf4a0(0xf1);async['execute'](_0x10ed41){const _0x22d723=a29_0x3cf4a0,{options:_0x2411ea,args:_0x306b11,tdx:_0x552f9b}=_0x10ed41,_0x359a36=_0x2411ea,_0x27fca0=await resolveTarget({'arg':_0x306b11[0x0],'contextParent':_0x2411ea[_0x22d723(0xe5)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x27fca0))return _0x27fca0[_0x22d723(0xd7)]===_0x22d723(0x8b)?(console['error'](a29_0x1bb08c[_0x22d723(0x8e)](_0x22d723(0xfa))),console[_0x22d723(0xc8)]('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['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x22d723(0xc8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0x86)+_0x27fca0[_0x22d723(0xc9)]+'\x0a')),_0x27fca0['helpText']&&console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x10c)](_0x27fca0[_0x22d723(0xce)]))),0x1;if(_0x27fca0[_0x22d723(0xef)]===_0x22d723(0x99))return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xb5)+_0x27fca0[_0x22d723(0x92)]+'\x0a')),console['error'](a29_0x1bb08c['cyan'](_0x22d723(0xbe))),0x1;const _0x31f66b=_0x27fca0[_0x22d723(0x115)],_0x11dad0=_0x27fca0[_0x22d723(0x92)],_0x5ba0fe=_0x27fca0['type']===_0x22d723(0xa1)?_0x27fca0[_0x22d723(0xe2)]:undefined,_0x55994f=getScopedDetails(_0x27fca0),_0x2edbce=_0x55994f?.['isScoped']??![],_0x492019=_0x55994f?.['scopedFolderPath']??'';if(!existsSync(_0x11dad0))return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xb5)+_0x11dad0+'\x0a')),console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x10c)](_0x22d723(0xbe))),0x1;_0x359a36[_0x22d723(0xa3)]&&(console[_0x22d723(0xc8)](_0x22d723(0xc6)+_0x359a36[_0x22d723(0xae)]),console[_0x22d723(0xc8)]('Parent\x20segment:\x20'+_0x31f66b),console[_0x22d723(0xc8)]('Source\x20directory:\x20'+_0x11dad0),_0x2edbce&&console['error'](_0x22d723(0x88)+_0x492019));const _0x2781c1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x31f66b+'\x27...',()=>_0x552f9b[_0x22d723(0xea)][_0x22d723(0xff)](_0x31f66b),{'verbose':_0x359a36[_0x22d723(0xa3)]}),_0x352506=_0x2781c1[_0x22d723(0x87)],[_0x36831e,_0x4df887,_0x4b2223,_0xa9ccdf,_0x1b645e]=await Promise['all']([withSpinner(_0x22d723(0xed),()=>_0x552f9b[_0x22d723(0xea)][_0x22d723(0xa9)](_0x352506),{'verbose':_0x359a36[_0x22d723(0xa3)]}),withSpinner(_0x22d723(0x118),()=>_0x552f9b[_0x22d723(0xea)][_0x22d723(0xb1)](_0x352506),{'verbose':_0x359a36[_0x22d723(0xa3)]}),withSpinner(_0x22d723(0xf0),()=>_0x552f9b[_0x22d723(0xea)][_0x22d723(0x10a)](_0x352506),{'verbose':_0x359a36[_0x22d723(0xa3)]}),withSpinner(_0x22d723(0xa4),()=>_0x552f9b['journey'][_0x22d723(0x10e)](_0x352506,{'includeAllVersions':!![]}),{'verbose':_0x359a36[_0x22d723(0xa3)]}),withSpinner(_0x22d723(0xf4),()=>_0x552f9b['user'][_0x22d723(0xe4)](),{'verbose':_0x359a36[_0x22d723(0xa3)]})[_0x22d723(0xb2)](_0x51b165=>_0x51b165[_0x22d723(0x87)])]),_0x3e74cf=_0x36831e[_0x22d723(0x87)],_0x2cd532=extractRootFolderId(_0x3e74cf),_0xbd835b=_0x4df887[_0x22d723(0x87)],_0x18194e=_0x4b2223['data'],{journeys:_0xa2d9c4,activationStepsById:_0x49d4b4}=_0xa9ccdf[_0x22d723(0x87)],_0x179714=new Map(_0xa2d9c4[_0x22d723(0xf9)](_0x1e5ff=>[_0x1e5ff['id'],_0x1e5ff])),_0x5567e5=_0xa2d9c4[_0x22d723(0xf9)](_0x229026=>({'id':_0x229026['id'],'name':_0x229026[_0x22d723(0x102)][_0x22d723(0xe7)],'journeyBundleName':_0x229026[_0x22d723(0x102)][_0x22d723(0x9d)]||'','journeyBundleId':_0x229026[_0x22d723(0x102)][_0x22d723(0x97)]||'','versionNumber':_0x229026['attributes'][_0x22d723(0x10b)],'description':_0x229026[_0x22d723(0x102)][_0x22d723(0xb3)],'state':_0x229026[_0x22d723(0x102)][_0x22d723(0xb8)],'paused':_0x229026[_0x22d723(0x102)]['paused'],'audienceId':_0x229026[_0x22d723(0x102)][_0x22d723(0xde)],'folderId':_0x229026[_0x22d723(0x113)]?.['parentFolder']?.[_0x22d723(0x87)]?.['id'],'createdAt':_0x229026[_0x22d723(0x102)][_0x22d723(0xab)],'updatedAt':_0x229026[_0x22d723(0x102)][_0x22d723(0xe3)]})),{emailToId:_0x24e70e,idToEmail:_0x3c3d64}=_0x1b645e,_0x3f3978=await withSpinner(_0x22d723(0xc2),async()=>{const _0x58b4a4=_0x22d723,_0x5b0848=await _0x552f9b[_0x58b4a4(0xeb)]['list']();return buildConnectionMaps(_0x5b0848);},{'verbose':_0x359a36['verbose']})[_0x22d723(0xb2)](_0x379514=>_0x379514[_0x22d723(0x87)]),_0x18de74=_0x3f3978[_0x22d723(0x93)],_0x530b29=_0x3f3978[_0x22d723(0xa7)],_0x3f6071=_0x3f3978['nameToType'],_0x388e84={'emailToIdMap':_0x24e70e,'connectionNameToIdMap':_0x18de74,'connectionNameToTypeMap':_0x3f6071,'getSchema':_0x446915=>_0x552f9b[_0x22d723(0xeb)]['getOutputSchemaWithCache'](_0x446915)};let {pathToId:_0x36b6b3,idToPath:_0x3cce08}=buildFolderMaps(_0x18194e);const _0x159caa=buildSegmentLookupMap(_0xbd835b,_0x3cce08),_0x8459e6=buildSegmentNameToIdMap(_0xbd835b),_0x4c2c33=buildJourneyBundleLookupMap(_0x5567e5,_0x3cce08);let _0x3a0375;if(_0x5ba0fe){if(!_0x5ba0fe[_0x22d723(0xcb)]('.yml')&&!_0x5ba0fe[_0x22d723(0xcb)](_0x22d723(0x91)))return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xfd)+_0x5ba0fe+'\x0a')),0x1;_0x3a0375=[_0x5ba0fe];}else _0x3a0375=findYamlFiles(_0x11dad0);if(_0x3a0375['length']===0x0)return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x11dad0+'\x0a')),console['error'](a29_0x1bb08c[_0x22d723(0x10c)](_0x22d723(0x111))),0x1;let _0xc386c8,_0x11a5e6;try{const _0x53d055=parseAndClassifyYamlFiles(_0x3a0375,_0x11dad0,{'skipSegments':_0x359a36[_0x22d723(0xe6)]});_0xc386c8=_0x53d055[_0x22d723(0x8d)],_0x11a5e6=_0x53d055['journeys'];const _0x3c0ba3=validateParsedFiles(_0x53d055,_0x11dad0);if(_0x3c0ba3['length']>0x0)return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xf5))),console[_0x22d723(0xc8)](formatValidationErrors(_0x3c0ba3)),console['error'](a29_0x1bb08c[_0x22d723(0x8e)](_0x22d723(0x110))),0x1;}catch(_0x56101b){return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xb4)+(_0x56101b instanceof Error?_0x56101b[_0x22d723(0xc9)]:_0x56101b))),0x1;}if(_0xc386c8[_0x22d723(0x106)]===0x0&&_0x11a5e6[_0x22d723(0x106)]===0x0){const _0x53ce43=_0x359a36[_0x22d723(0xe6)]?_0x22d723(0x109):'segment\x20or\x20journey';return console[_0x22d723(0xc8)](a29_0x1bb08c['yellow'](_0x22d723(0xe1)+_0x53ce43+_0x22d723(0x90))),0x0;}const _0x564065=new Map();_0xbd835b[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xe6)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0xbd835b,async _0x392b05=>{const _0x6b7a03=a29_0x5000,_0x5e6f09=await _0x552f9b[_0x6b7a03(0xea)]['listActivations'](_0x352506,_0x392b05['id']);_0x564065['set'](_0x392b05['id'],_0x5e6f09);});},{'verbose':_0x359a36[_0x22d723(0xa3)]});const {segmentFiles:_0x2741a1,foldersToCreate:_0x7403f}=await prepareSegmentFiles(_0xc386c8,{'segmentByFolderAndName':_0x159caa,'activationsBySegmentId':_0x564065,'folderPathToId':_0x36b6b3,'idToEmailMap':_0x3c3d64,'connectionIdToNameMap':_0x530b29},_0x388e84,_0x2edbce,_0x492019),_0x481e4b=_0x5ba0fe?[]:findSegmentsToDelete(_0xbd835b,_0xc386c8[_0x22d723(0xf9)](({yamlConfig:_0x12c4b7,folderPath:_0x271810})=>({'yamlConfig':_0x12c4b7,'folderPath':resolveTDFolderPath(_0x271810,_0x2edbce,_0x492019)})),_0x3cce08,_0x492019,_0x2edbce),{journeyFiles:_0x5b3fa0,foldersToCreate:_0x314a85}=await withProgressSpinner('Preparing\x20journeys...',async _0x3cfe59=>prepareJourneyFiles(_0x11a5e6,{'fetchJourney':async _0x4ac996=>_0x552f9b['journey'][_0x22d723(0xdb)](_0x4ac996[_0x22d723(0x107)]),'journeyBundlesByFolderAndName':_0x4c2c33,'folderPathToId':_0x36b6b3,'idToEmailMap':_0x3c3d64,'connectionIdToNameMap':_0x530b29,'existingSegments':_0xbd835b,'parentId':_0x352506,'deps':_0x552f9b,'progress':{'update':_0x378cf7=>{const _0x62d05d=_0x22d723;_0x3cfe59[_0x62d05d(0x114)](_0x378cf7),_0x359a36[_0x62d05d(0xa3)]&&console[_0x62d05d(0xc8)]('\x20\x20'+_0x378cf7);}},'journeyById':_0x179714,'activationStepsById':_0x49d4b4},_0x2edbce,_0x492019),{'verbose':_0x359a36[_0x22d723(0xa3)]})[_0x22d723(0xb2)](_0x881af7=>_0x881af7[_0x22d723(0x87)]);for(const _0x1326e4 of _0x314a85){_0x7403f[_0x22d723(0x98)](_0x1326e4);}const _0x5fcd8d=_0x5ba0fe?[]:findJourneysToDelete(_0x5567e5,_0x11a5e6[_0x22d723(0xf9)](({yamlConfig:_0x35a973,folderPath:_0xe4467e})=>({'yamlConfig':_0x35a973,'folderPath':resolveTDFolderPath(_0xe4467e,_0x2edbce,_0x492019)})),_0x3cce08,_0x492019,_0x2edbce),_0x3f6761=calculatePushStats(_0x2741a1,_0x5b3fa0,_0x7403f,_0x481e4b,_0x5fcd8d,!!_0x359a36[_0x22d723(0xd2)],!!_0x359a36[_0x22d723(0xe6)]),_0x5e23f8=_0x3f6761['segments'][_0x22d723(0xe0)],_0x3f5911=_0x3f6761[_0x22d723(0x8d)]['changed'],_0x3f6346=_0x3f6761[_0x22d723(0x8d)]['unchanged'],_0x29f518=_0x3f6761[_0x22d723(0x8d)][_0x22d723(0x9f)],_0xf09887=_0x3f6761[_0x22d723(0xdf)]['toCreate'],_0x38c0d5=_0x3f6761[_0x22d723(0xfe)][_0x22d723(0xe0)],_0x2aa424=_0x3f6761[_0x22d723(0xfe)][_0x22d723(0x89)],_0x45a8a2=_0x3f6761[_0x22d723(0xfe)][_0x22d723(0xcc)],_0x491338=_0x3f6761[_0x22d723(0xfe)][_0x22d723(0x9f)],_0x4b2f92=_0x3f6761[_0x22d723(0xc1)][_0x22d723(0xe8)],_0x49d7da=_0x3f6761[_0x22d723(0xc1)][_0x22d723(0xaa)],_0x51fb1a=_0x3f6761[_0x22d723(0xc1)][_0x22d723(0x8f)],_0x977554=_0x3f6761['activations'][_0x22d723(0x9f)];console[_0x22d723(0xc8)](_0x22d723(0x104)+_0x31f66b+'\x27:');_0xf09887[_0x22d723(0x106)]>0x0&&console[_0x22d723(0xc8)]('\x20\x20'+a29_0x1bb08c[_0x22d723(0xf8)](_0x22d723(0xd0)+_0xf09887[_0x22d723(0x106)]+_0x22d723(0x112)));if(!_0x359a36[_0x22d723(0xe6)]){console['error'](_0x22d723(0x9a)),console[_0x22d723(0xc8)]('\x20\x20\x20\x20'+a29_0x1bb08c[_0x22d723(0xbf)]('+\x20'+_0x5e23f8[_0x22d723(0x106)]+'\x20new')),console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c['yellow']('~\x20'+_0x3f5911[_0x22d723(0x106)]+_0x22d723(0xa0)));if(_0x29f518['length']>0x0)console['error']('\x20\x20\x20\x20'+a29_0x1bb08c[_0x22d723(0x8c)]('-\x20'+_0x29f518[_0x22d723(0x106)]+_0x22d723(0x119)));else _0x481e4b[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xd2)]&&console['error'](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xaf)](_0x481e4b[_0x22d723(0x106)]+_0x22d723(0xe9)));console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xaf)]('=\x20'+_0x3f6346[_0x22d723(0x106)]+_0x22d723(0x9e)));}if(_0x5b3fa0[_0x22d723(0x106)]>0x0||_0x5fcd8d[_0x22d723(0x106)]>0x0){console['error']('\x20\x20πΊοΈ\x20\x20Journeys:'),console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xbf)]('+\x20'+_0x38c0d5[_0x22d723(0x106)]+_0x22d723(0xc4))),console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c['yellow']('~\x20'+_0x2aa424[_0x22d723(0x106)]+_0x22d723(0xa0)));if(_0x491338[_0x22d723(0x106)]>0x0)console[_0x22d723(0xc8)]('\x20\x20\x20\x20'+a29_0x1bb08c[_0x22d723(0x8c)]('-\x20'+_0x491338['length']+_0x22d723(0x119)));else _0x5fcd8d[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xd2)]&&console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xaf)](_0x5fcd8d[_0x22d723(0x106)]+_0x22d723(0xe9)));console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c['dim']('=\x20'+_0x45a8a2[_0x22d723(0x106)]+_0x22d723(0x9e)));}_0x4b2f92['length']>0x0&&!_0x359a36['journeysOnly']&&(console[_0x22d723(0xc8)](''),console[_0x22d723(0xc8)](_0x22d723(0xa5)),_0x49d7da['length']>0x0&&console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xbf)]('+\x20'+_0x49d7da['length']+'\x20to\x20create')),_0x51fb1a['length']>0x0&&console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0x8e)]('~\x20'+_0x51fb1a[_0x22d723(0x106)]+_0x22d723(0x10d))),_0x977554[_0x22d723(0x106)]>0x0&&console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c['red']('-\x20'+_0x977554[_0x22d723(0x106)]+_0x22d723(0x119))));console[_0x22d723(0xc8)](_0x22d723(0xd4)+a29_0x1bb08c[_0x22d723(0x10c)](_0x11dad0)+'\x0a');if(_0xf09887[_0x22d723(0x106)]>0x0){console['error'](_0x22d723(0x108));for(const _0x2a0507 of _0xf09887){console['error']('\x20\x20'+a29_0x1bb08c[_0x22d723(0xf8)]('+')+'\x20'+_0x2a0507);}console[_0x22d723(0xc8)]('');}if(_0x5e23f8['length']>0x0&&!_0x359a36['journeysOnly'])for(const _0x48ff4c of _0x5e23f8){const _0x4e6e80=_0x48ff4c[_0x22d723(0xda)]?_0x48ff4c[_0x22d723(0xda)]+'/'+_0x48ff4c[_0x22d723(0xd9)][_0x22d723(0xe7)]:_0x48ff4c[_0x22d723(0xd9)][_0x22d723(0xe7)],_0x5eb2ab=_0x48ff4c[_0x22d723(0xd9)]['activations']?.[_0x22d723(0x106)]||0x0,_0x29bbe5=_0x5eb2ab>0x0?a29_0x1bb08c[_0x22d723(0xaf)]('\x20['+_0x5eb2ab+_0x22d723(0xcf)):'';console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0xbf)](_0x22d723(0xfc))+'\x20'+_0x4e6e80+_0x29bbe5),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c)),_0x48ff4c['diff']&&console[_0x22d723(0xc8)](_0x48ff4c[_0x22d723(0xb7)]),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c));}if(_0x29f518[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xe6)])for(const _0x242f61 of _0x29f518){const _0x9f06db=_0x242f61[_0x22d723(0xc7)]?_0x3cce08['get'](_0x242f61[_0x22d723(0xc7)][_0x22d723(0xee)]())||'':'',_0xdc371d=_0x9f06db?_0x9f06db+'/'+_0x242f61[_0x22d723(0xe7)]:_0x242f61[_0x22d723(0xe7)],_0x504256=_0x564065[_0x22d723(0xc5)](_0x242f61['id'])||[],_0x4eebbb=_0x504256[_0x22d723(0x106)]>0x0?a29_0x1bb08c[_0x22d723(0xaf)]('\x20['+_0x504256['length']+_0x22d723(0xcf)):'';console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xa8))+'\x20'+_0xdc371d+_0x4eebbb),console['error']('β'['repeat'](0x3c));const _0x35feb2=segmentWithActivationsToYaml(_0x242f61,_0x504256,undefined,_0x3c3d64,_0x530b29),_0x2c2a4e=segmentToYamlString(_0x35feb2),_0x1f2825=generateDiff(_0x2c2a4e,'');console[_0x22d723(0xc8)](formatDiffWithColors(_0x1f2825)),console['error']('β'[_0x22d723(0x9b)](0x3c));}const _0x358ae9=_0x2741a1[_0x22d723(0xb9)](_0x534877=>!_0x534877[_0x22d723(0x95)]&&_0x534877[_0x22d723(0xb7)]);if(_0x358ae9[_0x22d723(0x106)]>0x0&&!_0x359a36['journeysOnly'])for(const _0x2e7769 of _0x358ae9){const _0x440187=_0x2e7769[_0x22d723(0xda)]?_0x2e7769[_0x22d723(0xda)]+'/'+_0x2e7769[_0x22d723(0xd9)][_0x22d723(0xe7)]:_0x2e7769[_0x22d723(0xd9)]['name'];console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0x8e)](_0x22d723(0x94))+'\x20'+_0x440187),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c)),console[_0x22d723(0xc8)](_0x2e7769['diff']),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c));}if(_0x38c0d5['length']>0x0)for(const _0x15f5ab of _0x38c0d5){const _0x55f766=_0x15f5ab['folderPath']?_0x15f5ab['folderPath']+'/'+_0x15f5ab[_0x22d723(0xd9)][_0x22d723(0xe7)]:_0x15f5ab[_0x22d723(0xd9)][_0x22d723(0xe7)];console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0xbf)](_0x22d723(0xba))+'\x20'+_0x55f766),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c)),_0x15f5ab[_0x22d723(0xb7)]&&console[_0x22d723(0xc8)](_0x15f5ab[_0x22d723(0xb7)]),console[_0x22d723(0xc8)]('β'['repeat'](0x3c));}const _0x25f582=_0x5b3fa0[_0x22d723(0xb9)](_0x2e81a4=>!_0x2e81a4[_0x22d723(0x95)]&&_0x2e81a4['diff']);if(_0x25f582[_0x22d723(0x106)]>0x0)for(const _0x24e6c1 of _0x25f582){const _0x177962=_0x24e6c1['folderPath']?_0x24e6c1['folderPath']+'/'+_0x24e6c1[_0x22d723(0xd9)][_0x22d723(0xe7)]:_0x24e6c1['yamlConfig'][_0x22d723(0xe7)];console['error']('\x0a'+a29_0x1bb08c['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x177962),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c)),console['error'](_0x24e6c1['diff']),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c));}if(_0x491338['length']>0x0)for(const _0x96658d of _0x491338){const _0x38cd32=_0x96658d[_0x22d723(0xb6)]?_0x3cce08['get'](_0x96658d['folderId'])||'':'',_0x4f542d=_0x38cd32?_0x38cd32+'/'+_0x96658d[_0x22d723(0x9d)]:_0x96658d[_0x22d723(0x9d)];console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0x117))+'\x20'+_0x4f542d),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c)),console[_0x22d723(0xc8)](a29_0x1bb08c['red'](_0x22d723(0xf6))),console[_0x22d723(0xc8)]('β'[_0x22d723(0x9b)](0x3c));}if(_0x359a36[_0x22d723(0xd6)])return console['error'](a29_0x1bb08c['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4a6d92=_0x359a36[_0x22d723(0xe6)]?![]:_0x5e23f8['length']>0x0||_0x3f5911[_0x22d723(0x106)]>0x0||_0x29f518[_0x22d723(0x106)]>0x0,_0x40f6c3=_0x38c0d5['length']>0x0||_0x2aa424[_0x22d723(0x106)]>0x0||_0x491338['length']>0x0,_0x1e8dc1=_0x359a36['journeysOnly']?![]:_0x4b2f92[_0x22d723(0x106)]>0x0,_0x1c87e2=_0xf09887[_0x22d723(0x106)]>0x0;if(!_0x4a6d92&&!_0x40f6c3&&!_0x1e8dc1&&!_0x1c87e2){const _0x1f4b53=_0x359a36['journeysOnly']?'β\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x22d723(0xf7);console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0xbf)](_0x1f4b53));if(_0x5ba0fe&&_0x45a8a2[_0x22d723(0x106)]===0x1){const _0x4079a6=_0x45a8a2[0x0];if(_0x4079a6[_0x22d723(0xb0)]?.['id']){const _0x109cc4=getConsoleNextUrl(_0x359a36['site'],'/app/ps/'+_0x352506+'/e/'+_0x4079a6[_0x22d723(0xb0)]['id']+_0x22d723(0xdc));console[_0x22d723(0xc8)]('\x20\x20'+a29_0x1bb08c[_0x22d723(0x10c)](_0x109cc4));}}return 0x0;}const _0x18831c=_0x359a36[_0x22d723(0xe6)]?_0x38c0d5[_0x22d723(0x106)]+_0x2aa424[_0x22d723(0x106)]+_0x491338[_0x22d723(0x106)]+_0xf09887[_0x22d723(0x106)]:_0x5e23f8[_0x22d723(0x106)]+_0x3f5911['length']+_0x29f518[_0x22d723(0x106)]+_0x38c0d5[_0x22d723(0x106)]+_0x2aa424['length']+_0x491338[_0x22d723(0x106)]+_0xf09887[_0x22d723(0x106)]+_0x4b2f92[_0x22d723(0x106)];if(!_0x359a36[_0x22d723(0xa6)]&&_0x18831c>0x0){const _0x44531a=await confirmKey(_0x22d723(0xbd)+_0x18831c+'\x20changes?');if(!_0x44531a)return console[_0x22d723(0xc8)](_0x22d723(0x11a)),0x1;}const _0x52c60c={'withProgress':async(_0x1bc85c,_0x84673b)=>{const _0x19dcfe=_0x22d723,_0x2ee8ab=await withSpinner(_0x1bc85c,_0x84673b,{'verbose':_0x359a36[_0x19dcfe(0xa3)]});return{'data':_0x2ee8ab[_0x19dcfe(0x87)]};},'logInfo':_0x7231cd=>console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0xf8)]('β\x20'+_0x7231cd)),'logSuccess':_0x9d7bdc=>console['error'](a29_0x1bb08c[_0x22d723(0xbf)]('β\x20'+_0x9d7bdc)),'logWarning':_0x25787b=>console[_0x22d723(0xc8)](a29_0x1bb08c['yellow']('β \x20'+_0x25787b)),'logDeleted':_0x681598=>console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)]('β\x20'+_0x681598))},_0x34948b={'segment':_0x552f9b[_0x22d723(0xea)],'journey':_0x552f9b[_0x22d723(0x109)],'user':_0x552f9b['user'],'connection':_0x552f9b[_0x22d723(0xeb)]};_0xf09887['length']>0x0&&(_0x36b6b3=await executePushFolders(_0x34948b,_0xf09887,_0x36b6b3,{'parentId':_0x352506},_0x52c60c));const _0x2e655d={'rootFolderId':_0x2cd532,'folderPathToId':_0x36b6b3,'folderIdToPath':_0x3cce08,'segmentNameToId':_0x8459e6,'activationsBySegmentId':_0x564065,'emailToIdMap':_0x24e70e,'idToEmailMap':_0x3c3d64,'connectionNameToIdMap':_0x3f3978[_0x22d723(0x93)],'connectionIdToNameMap':_0x3f3978[_0x22d723(0xa7)],'connectionNameToTypeMap':_0x3f6071},_0xbecc56=await executePushSegments(_0x34948b,_0x359a36[_0x22d723(0xe6)]?[]:_0x2741a1,_0x2e655d,{'parentId':_0x352506},_0x52c60c),_0x4c46e0=_0xbecc56[_0x22d723(0x100)],_0x4e35dc=_0xbecc56[_0x22d723(0xbb)],_0x5bbea8=_0xbecc56[_0x22d723(0xc1)][_0x22d723(0x100)],_0x2788d9=_0xbecc56[_0x22d723(0xc1)][_0x22d723(0xbb)],_0x14ac4b=_0xbecc56[_0x22d723(0xc1)][_0x22d723(0xd1)],_0x33583a=await executePushSegmentDeletions(_0x34948b,_0x359a36['journeysOnly']?[]:_0x29f518,_0x52c60c);let _0x364ced=0x0,_0x28f590=0x0,_0x4029de=0x0;const _0x5e7223=new Map(_0x8459e6);for(const [_0x44dbb6,_0x52ad45]of _0xbecc56[_0x22d723(0x101)]){_0x5e7223[_0x22d723(0xa2)](_0x44dbb6,_0x52ad45);}if(_0x5b3fa0['length']>0x0){const _0xcd370c={..._0x2e655d,'segmentNameToId':_0x5e7223,'existingSegments':_0xbd835b,'activationContext':_0x388e84},_0x4780df=await executePushJourneys(_0x34948b,_0x5b3fa0,_0xcd370c,{'parentId':_0x352506,'rootFolderId':_0x2cd532,'verbose':_0x359a36[_0x22d723(0xa3)]},_0x52c60c);_0x364ced=_0x4780df['created'],_0x28f590=_0x4780df['updated'];if(_0x5ba0fe&&_0x4780df[_0x22d723(0xf2)][_0x22d723(0x106)]===0x1){const _0x19f99e=_0x4780df[_0x22d723(0xf2)][0x0];if(_0x19f99e['journeyId']){const _0x3b69a3=getConsoleNextUrl(_0x359a36[_0x22d723(0xae)],_0x22d723(0xbc)+_0x352506+_0x22d723(0xfb)+_0x19f99e[_0x22d723(0x107)]+_0x22d723(0xdc));console[_0x22d723(0xc8)]('\x20\x20'+a29_0x1bb08c[_0x22d723(0x10c)](_0x3b69a3));}}}for(const _0x5134eb of _0x491338){console['error'](a29_0x1bb08c[_0x22d723(0x8e)](_0x22d723(0xca)+_0x5134eb[_0x22d723(0x9d)])),_0x4029de++;}const _0x1045d7=[];if(_0x4c46e0>0x0)_0x1045d7[_0x22d723(0xd3)](_0x4c46e0+_0x22d723(0x85));if(_0x4e35dc>0x0)_0x1045d7['push'](_0x4e35dc+_0x22d723(0xd8));if(_0x33583a>0x0)_0x1045d7[_0x22d723(0xd3)](_0x33583a+_0x22d723(0x8a));const _0x54351f=[];if(_0x364ced>0x0)_0x54351f[_0x22d723(0xd3)](_0x364ced+_0x22d723(0x85));if(_0x28f590>0x0)_0x54351f[_0x22d723(0xd3)](_0x28f590+_0x22d723(0xd8));if(_0x4029de>0x0)_0x54351f[_0x22d723(0xd3)](_0x4029de+_0x22d723(0x8a));const _0x3b3d9d=[];if(_0x5bbea8>0x0)_0x3b3d9d[_0x22d723(0xd3)](_0x5bbea8+_0x22d723(0x85));if(_0x2788d9>0x0)_0x3b3d9d['push'](_0x2788d9+_0x22d723(0xd8));if(_0x14ac4b>0x0)_0x3b3d9d[_0x22d723(0xd3)](_0x14ac4b+'\x20deleted');return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0xbf)]('\x0aβ\x20Push\x20complete')),_0x1045d7[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xe6)]&&console[_0x22d723(0xc8)](_0x22d723(0xac)+_0x1045d7['join'](',\x20')),_0x54351f[_0x22d723(0x106)]>0x0&&console[_0x22d723(0xc8)](_0x22d723(0x116)+_0x54351f['join'](',\x20')),_0x3b3d9d[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xe6)]&&console[_0x22d723(0xc8)](_0x22d723(0x105)+_0x3b3d9d[_0x22d723(0xcd)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x5a94e1=a30_0xd48d;(function(_0x36f338,_0x318950){const _0x25919a=a30_0xd48d,_0x2e5d44=_0x36f338();while(!![]){try{const _0x83fb46=parseInt(_0x25919a(0x138))/0x1+-parseInt(_0x25919a(0x120))/0x2*(parseInt(_0x25919a(0x13d))/0x3)+-parseInt(_0x25919a(0x13c))/0x4*(-parseInt(_0x25919a(0x130))/0x5)+parseInt(_0x25919a(0x12c))/0x6+parseInt(_0x25919a(0x14f))/0x7*(-parseInt(_0x25919a(0x147))/0x8)+-parseInt(_0x25919a(0x13f))/0x9+-parseInt(_0x25919a(0x121))/0xa*(-parseInt(_0x25919a(0x132))/0xb);if(_0x83fb46===_0x318950)break;else _0x2e5d44['push'](_0x2e5d44['shift']());}catch(_0x4adb05){_0x2e5d44['push'](_0x2e5d44['shift']());}}}(a30_0x3bae,0x728e5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a30_0x3bae(){const _0x2ef01a=['20PoBzuB','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','ruleFile','name','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segment:update','folder','\x27...','Resolved\x20folder\x20ID:\x20','error','includes','2237964CgtDiG','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','1616375zdRPMi','Parent\x20ID:\x20','79574tHBMdR','description','yellow','INTERNAL','Resolving\x20path\x20\x27','segmentId','794959eFeAem','resolvePathToResource','rule','Examples:','4QPTfsM','20103dJDYzM','data','2157345roZCwh','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','verbose','Error:\x20Cannot\x20update\x20','type','Segment\x20ID:\x20','parentId','1298696YBSMkg','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentPath','execute','segment','β\x20Updated\x20segment\x20\x27','Resolved\x20type:\x20','28mLnECR','44autOCi'];a30_0x3bae=function(){return _0x2ef01a;};return a30_0x3bae();}function a30_0xd48d(_0x1b32af,_0x5966c9){_0x1b32af=_0x1b32af-0x120;const _0x3bae5a=a30_0x3bae();let _0xd48d7d=_0x3bae5a[_0x1b32af];return _0xd48d7d;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x435a62 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x5a94e1(0x124)]=a30_0x5a94e1(0x126);[a30_0x5a94e1(0x133)]='Update\x20existing\x20child\x20segment';async[a30_0x5a94e1(0x14b)](_0x2c6aeb){const _0x1f79b0=a30_0x5a94e1;console[_0x1f79b0(0x12a)](a30_0x435a62[_0x1f79b0(0x134)]('β \x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a30_0x435a62[_0x1f79b0(0x134)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x4091a5,args:_0x506447,tdx:_0x21a888}=_0x2c6aeb,_0x1c761e=_0x4091a5;if(_0x506447['length']===0x0)return console[_0x1f79b0(0x12a)](_0x1f79b0(0x12d)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x140)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x13b)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x12f)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x122)),0x1;const _0x14bf32=_0x506447[0x0],_0x48a6ad=_0x4091a5[_0x1f79b0(0x14a)];let _0x5ce0b1=_0x14bf32;_0x48a6ad&&!_0x14bf32[_0x1f79b0(0x12b)]('/')&&(_0x5ce0b1=_0x48a6ad+'/'+_0x14bf32,_0x1c761e['verbose']&&console['error'](_0x1f79b0(0x141)+_0x5ce0b1));const _0x4705bd=await withSpinner(_0x1f79b0(0x136)+_0x5ce0b1+_0x1f79b0(0x128),()=>_0x21a888[_0x1f79b0(0x14c)][_0x1f79b0(0x139)](_0x5ce0b1),{'verbose':_0x1c761e['verbose']}),_0x3f0075=_0x4705bd[_0x1f79b0(0x13e)];_0x1c761e[_0x1f79b0(0x142)]&&console[_0x1f79b0(0x12a)](_0x1f79b0(0x14e)+_0x3f0075[_0x1f79b0(0x144)]);if(_0x3f0075[_0x1f79b0(0x144)]!==_0x1f79b0(0x14c))return console[_0x1f79b0(0x12a)](_0x1f79b0(0x143)+_0x3f0075[_0x1f79b0(0x144)]+_0x1f79b0(0x149)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x125)),0x1;if(!_0x3f0075['segmentId'])throw new SDKError(ErrorCode[_0x1f79b0(0x135)],_0x1f79b0(0x12e));const _0x2ea318=_0x3f0075[_0x1f79b0(0x146)],_0x57d978=_0x3f0075[_0x1f79b0(0x137)];_0x1c761e['verbose']&&(console[_0x1f79b0(0x12a)](_0x1f79b0(0x131)+_0x2ea318),console[_0x1f79b0(0x12a)](_0x1f79b0(0x145)+_0x57d978));let _0x210bfb;if(_0x1c761e[_0x1f79b0(0x127)]){const _0x1de917=_0x1c761e['folder'],_0x3f7191=await withSpinner('Resolving\x20folder\x20\x27'+_0x1de917+'\x27...',()=>_0x21a888[_0x1f79b0(0x14c)]['resolveFolderId'](_0x2ea318,_0x1de917),{'verbose':_0x1c761e['verbose']});_0x210bfb=parseInt(_0x3f7191['data'],0xa),_0x1c761e['verbose']&&console[_0x1f79b0(0x12a)](_0x1f79b0(0x129)+_0x210bfb);}const _0x1a5839=await loadJSONFromOptions(_0x1c761e[_0x1f79b0(0x13a)],_0x1c761e[_0x1f79b0(0x123)]),_0x4f8547={'name':_0x1c761e[_0x1f79b0(0x124)],'description':_0x1c761e[_0x1f79b0(0x133)],'rule':_0x1a5839,'kind':_0x1c761e[_0x1f79b0(0x148)]!==undefined?parseInt(_0x1c761e[_0x1f79b0(0x148)],0xa):undefined,'segmentFolderId':_0x210bfb},_0x14ab46=await withSpinner('Updating\x20segment\x20\x27'+_0x3f0075['segmentName']+_0x1f79b0(0x128),()=>_0x21a888[_0x1f79b0(0x14c)]['updateSegmentById'](_0x2ea318,_0x57d978,_0x4f8547),{'verbose':_0x1c761e[_0x1f79b0(0x142)]}),_0x44efdb=_0x14ab46[_0x1f79b0(0x13e)];return console[_0x1f79b0(0x12a)](_0x1f79b0(0x14d)+_0x44efdb[_0x1f79b0(0x124)]+'\x27'),_0x5ce0b1!==_0x14bf32&&console[_0x1f79b0(0x12a)]('\x20\x20\x20Path:\x20'+_0x5ce0b1),await handleSDKOutput([_0x44efdb],_0x1c761e),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x1f5fb9=a31_0x3fd7;(function(_0x4e5010,_0x548795){const _0x266c5d=a31_0x3fd7,_0x14a78e=_0x4e5010();while(!![]){try{const _0x4c869b=parseInt(_0x266c5d(0xfc))/0x1*(-parseInt(_0x266c5d(0xe3))/0x2)+parseInt(_0x266c5d(0x114))/0x3*(parseInt(_0x266c5d(0xf4))/0x4)+parseInt(_0x266c5d(0xeb))/0x5+parseInt(_0x266c5d(0x10c))/0x6+parseInt(_0x266c5d(0x107))/0x7*(-parseInt(_0x266c5d(0xe1))/0x8)+-parseInt(_0x266c5d(0x100))/0x9+parseInt(_0x266c5d(0xed))/0xa;if(_0x4c869b===_0x548795)break;else _0x14a78e['push'](_0x14a78e['shift']());}catch(_0x59a60c){_0x14a78e['push'](_0x14a78e['shift']());}}}(a31_0x149b,0xd825f));import{existsSync,statSync}from'fs';import a31_0x3173de from'chalk';function a31_0x3fd7(_0x38cb83,_0x57ba94){_0x38cb83=_0x38cb83-0xe1;const _0x149bb7=a31_0x149b();let _0x3fd70d=_0x149bb7[_0x38cb83];return _0x3fd70d;}import{BaseCommand}from'./command.js';function a31_0x149b(){const _0x2af5c3=['parentName','description','error','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','log','3OOOBid','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Resolved\x20path\x20type:\x20','session','Error:\x20Path\x20is\x20required\x0a','folderPath','434384QNTGvg','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','350908HBPAVw','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','isDirectory','verbose','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','cyan','Resolving\x20path\x20\x27','7287120dMlCDW','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','10964020SmmQdc','data','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','isAbsolute','red','2647736wIseOk','resolvePathToResource','dim','type','segments','Resolved\x20relative\x20path\x20to:\x20','\x27...','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','8VbzCpa','length','green','config','12413808GPMxGo','β\x20Context\x20set\x20to:\x20','segment','site','folderId','segmentPath','β\x20Context\x20cleared.\x20Back\x20to\x20root.','147myslQR','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','parent_segment','Target\x20path:\x20','9556710JKHKVh','execute','Use:\x20tdx\x20segment\x20use\x20'];a31_0x149b=function(){return _0x2af5c3;};return a31_0x149b();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a31_0x1f5fb9(0x115);[a31_0x1f5fb9(0x110)]=a31_0x1f5fb9(0xe8);async[a31_0x1f5fb9(0x10d)](_0x27369e){const _0xd295a4=a31_0x1f5fb9,{options:_0x1813bb,args:_0x2f3941,tdx:_0x4803c4}=_0x27369e;if(_0x2f3941[_0xd295a4(0xfd)]===0x0)return console['error'](a31_0x3173de[_0xd295a4(0xf3)](_0xd295a4(0x119))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0xd295a4(0xf1)),console[_0xd295a4(0x111)](_0xd295a4(0xe4)),console[_0xd295a4(0x111)](_0xd295a4(0xfb)),console[_0xd295a4(0x111)](_0xd295a4(0xec)),console['error'](_0xd295a4(0xf0)),0x1;const _0x2756fe=_0x2f3941[0x0],_0x2611fb=_0x1813bb[_0xd295a4(0x118)];try{if(_0x2756fe==='/')return saveSessionContext({'segment_path':undefined},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de['green'](_0xd295a4(0x106))),0x0;if(existsSync(_0x2756fe)&&statSync(_0x2756fe)[_0xd295a4(0xe5)]()){let _0x40d008;try{_0x40d008=findTdxConfig(_0x2756fe);}catch{return console['error'](a31_0x3173de[_0xd295a4(0xf3)](_0xd295a4(0x112)+_0x2756fe)),console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xe9)](_0xd295a4(0x108))),0x1;}const _0x1c2338=_0x40d008[_0xd295a4(0xff)][_0xd295a4(0x10a)];return saveSessionContext({'segment_path':_0x1c2338,'parent_segment':_0x1c2338},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de[_0xd295a4(0xfe)]('β\x20Context\x20set\x20to:\x20'+a31_0x3173de['cyan'](_0x1c2338))),0x0;}const _0x43be0b=_0x1813bb[_0xd295a4(0x105)];let _0x4ab791=_0x2756fe;const _0x5ae3e8=parsePath(_0x2756fe);if(!_0x5ae3e8[_0xd295a4(0xf2)]){if(!_0x43be0b)return console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xf3)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xe9)](_0xd295a4(0xe2))),0x1;if(_0x2756fe==='..'){const _0x4f194f=_0x43be0b['split']('/')['slice'](0x0,-0x1)['join']('/');_0x4ab791=_0x4f194f||'/';}else _0x2756fe==='.'?_0x4ab791=_0x43be0b:_0x4ab791=_0x43be0b+'/'+_0x2756fe;_0x1813bb['verbose']&&console['error'](_0xd295a4(0xf9)+_0x4ab791);}if(_0x4ab791==='/'||_0x4ab791==='')return saveSessionContext({'segment_path':undefined},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de[_0xd295a4(0xfe)](_0xd295a4(0x106))),0x0;_0x4ab791=normalizePath(_0x4ab791);const _0x28d6e8=parsePath(_0x4ab791)[_0xd295a4(0xf8)];if(_0x28d6e8['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de[_0xd295a4(0xfe)](_0xd295a4(0x106))),0x0;_0x1813bb[_0xd295a4(0xe6)]&&(console[_0xd295a4(0x111)]('Site:\x20'+_0x1813bb[_0xd295a4(0x103)]),console[_0xd295a4(0x111)](_0xd295a4(0x10b)+_0x4ab791));const _0x28fcea=await withSpinner(_0xd295a4(0xea)+_0x4ab791+_0xd295a4(0xfa),()=>_0x4803c4['segment'][_0xd295a4(0xf5)](_0x4ab791),{'verbose':_0x1813bb[_0xd295a4(0xe6)]}),_0x329120=_0x28fcea[_0xd295a4(0xee)];_0x1813bb['verbose']&&(console[_0xd295a4(0x111)](_0xd295a4(0x117)+_0x329120['type']),console['error']('Parent\x20ID:\x20'+_0x329120['parentId']),_0x329120[_0xd295a4(0x104)]&&console[_0xd295a4(0x111)]('Folder\x20ID:\x20'+_0x329120[_0xd295a4(0x104)]));if(_0x329120[_0xd295a4(0xf7)]===_0xd295a4(0x102))return console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xf3)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0xd295a4(0x111)](_0xd295a4(0x109)),console['error'](a31_0x3173de[_0xd295a4(0xe9)](_0xd295a4(0x10e)+_0x329120[_0xd295a4(0x10f)]+(_0x329120[_0xd295a4(0x11a)]?'/'+_0x329120[_0xd295a4(0x11a)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x329120[_0xd295a4(0xe7)],'parent_segment':_0x329120[_0xd295a4(0x10f)]},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de[_0xd295a4(0xfe)](_0xd295a4(0x101)+a31_0x3173de['cyan'](_0x329120[_0xd295a4(0xe7)]))),_0x1813bb[_0xd295a4(0xe6)]&&(console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xf6)](_0xd295a4(0x116))),console[_0xd295a4(0x111)](a31_0x3173de['dim'](_0xd295a4(0xef)))),0x0;}catch(_0x4bea66){throw _0x4bea66;}}}
|