@treasuredata/tdx 0.14.8 → 0.14.9
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/README.md +21 -0
- 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.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js.map +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.d.ts +2 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/colors.js.map +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x33e530=a25_0x3b45;(function(_0x17a158,_0x26b7e3){const _0x4c166f=a25_0x3b45,_0x234988=_0x17a158();while(!![]){try{const _0x30aa09=-parseInt(_0x4c166f(0x223))/0x1+-parseInt(_0x4c166f(0x1f6))/0x2+parseInt(_0x4c166f(0x23e))/0x3+parseInt(_0x4c166f(0x282))/0x4+parseInt(_0x4c166f(0x226))/0x5+parseInt(_0x4c166f(0x280))/0x6+parseInt(_0x4c166f(0x238))/0x7;if(_0x30aa09===_0x26b7e3)break;else _0x234988['push'](_0x234988['shift']());}catch(_0x1efb3f){_0x234988['push'](_0x234988['shift']());}}}(a25_0x1d46,0x29c05));function a25_0x3b45(_0x4ce085,_0x41d1c2){_0x4ce085=_0x4ce085-0x1f0;const _0x1d46c9=a25_0x1d46();let _0x3b452f=_0x1d46c9[_0x4ce085];return _0x3b452f;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a25_0x1d46(){const _0x497220=['\x20\x20Cause:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folder\x20name:\x20','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','254478JMNjxF','replace','jobId','866025vOkMzO','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Fetching\x20folder\x20details...','\x20rows\x20','Fetching\x20parent\x20segment\x20details...','length','segment:desc','SELECT\x20*\x20FROM\x20(\x0a','cause','✔\x20Created\x20folder\x20\x27','jsonl','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolving\x20folder\x20\x27','format','Use:\x20tdx\x20ps\x20view','url','getSegmentSQL','521367jsPfWm','Usage:\x20tdx\x20sg\x20desc\x20<name>','Use:\x20tdx\x20ps\x20show','Usage:\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','getSegment','538584Bjbuqb','Site:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','segmentId','segment:folder:show','includes','Error:\x20','✔\x20Found\x20','green','test','Error:\x20Parent\x20segment\x20name\x20is\x20required','type','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','parentSegment','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolved\x20YAML\x20file:\x20','Resolved\x20parent\x20ID:\x20','segment:folder:create','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','stats','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','elapsedTimeMillis','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Resolving\x20path\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','site','name','Resolving\x20parent\x20segment\x20\x27','fullPath','Creating\x20folder\x20\x27','Fetching\x20SQL\x20for\x20segment...','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20parent\x20folder\x20ID:\x20','description','verbose','createFolder','json','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Parent\x20segment:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','✖\x20Query\x20failed\x20[','query','Resolved\x20relative\x20path\x20to:\x20','SEGMENT_NOT_FOUND','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','error','web','Examples:','setJobId','/app/ps/','SEGMENT_FOLDER_NOT_FOUND','Segment\x20ID:\x20','\x20Opening\x20','resolveParentId','data','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment','\x27...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Fetching\x20segment\x20details...','folder','Parent\x20ID:\x20','code','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','547926PRVVxx','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','300968LMJDuC','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20Full\x20path:\x20','resolveFolderId','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20Path\x20or\x20name\x20is\x20required','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20folder\x20ID:\x20','336572iSMrJQ','Error:\x20Folder\x20reference\x20is\x20required','information_schema','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Segment\x20ID\x20missing\x20from\x20resolved\x20path','execute','Parent\x20name:\x20','parent','✔\x20Query\x20completed:\x20Processed\x20','message','resolvePathToResource','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segmentName','SQL\x20query:\x0a','Resolving\x20\x27','Options:','Show\x20segment\x20folder\x20details','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','folderId','/e/','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','parentFolder','segment:show','Listing\x20folders\x20for\x20parent\x20\x27','Use:\x20tdx\x20ps\x20view\x20-w','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Folder\x20path:\x20','Show\x20segment\x20or\x20folder\x20details','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20type:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Target\x20path:\x20','parentId'];a25_0x1d46=function(){return _0x497220;};return a25_0x1d46();}import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x4b87e8 from'chalk';async function resolveSegmentTarget(_0x24c40c,_0x5dd1a3,_0x37c73a){const _0x407196=a25_0x3b45;if(isYamlFilePath(_0x24c40c))try{const _0x4c8233=await resolveYamlFilePath(_0x24c40c);return _0x37c73a&&(console[_0x407196(0x26d)](_0x407196(0x24f)+_0x24c40c),console[_0x407196(0x26d)]('\x20\x20Parent\x20segment:\x20'+_0x4c8233[_0x407196(0x24c)]),console[_0x407196(0x26d)]('\x20\x20Segment\x20name:\x20'+_0x4c8233[_0x407196(0x202)]),console[_0x407196(0x26d)](_0x407196(0x212)+(_0x4c8233['folderPath']||'(root)')),console[_0x407196(0x26d)](_0x407196(0x1f0)+_0x4c8233[_0x407196(0x25c)])),_0x4c8233[_0x407196(0x25c)];}catch(_0x3ad0e1){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x407196(0x281)+_0x3ad0e1[_0x407196(0x1ff)]);}if(!_0x5dd1a3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x407196(0x1f9));return _0x5dd1a3+'/'+_0x24c40c;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x33e530(0x25a)]='segment:describe';[a25_0x33e530(0x261)]=a25_0x33e530(0x213);async[a25_0x33e530(0x1fb)](_0x350539){const _0x368cbd=a25_0x33e530,{options:_0x36d097,args:_0x466077,tdx:_0x959b48}=_0x350539,_0x23bc75=_0x466077[0x0],_0x30d9d1=!_0x23bc75&&!!_0x36d097[_0x368cbd(0x24c)],_0x3219c3=_0x23bc75||_0x36d097['parentSegment'];if(!_0x3219c3)return console[_0x368cbd(0x26d)](_0x368cbd(0x1f3)),console[_0x368cbd(0x26d)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error']('Examples:'),console[_0x368cbd(0x26d)](_0x368cbd(0x21c)),console['error'](_0x368cbd(0x21d)),console[_0x368cbd(0x26d)](_0x368cbd(0x252)),console[_0x368cbd(0x26d)](_0x368cbd(0x20b)),0x1;try{const _0x286552=_0x36d097['segmentPath'];let _0x247d54=_0x3219c3;!_0x30d9d1&&_0x286552&&!_0x3219c3[_0x368cbd(0x244)]('/')&&(_0x247d54=_0x286552+'/'+_0x3219c3,_0x36d097[_0x368cbd(0x262)]&&console[_0x368cbd(0x26d)](_0x368cbd(0x26a)+_0x247d54));const _0x5f05ca=await withSpinner(_0x368cbd(0x257)+_0x247d54+_0x368cbd(0x279),()=>_0x959b48[_0x368cbd(0x278)]['resolvePathToResource'](_0x247d54),{'verbose':_0x36d097[_0x368cbd(0x262)]}),_0x42b723=_0x5f05ca['data'];_0x36d097['verbose']&&(console[_0x368cbd(0x26d)](_0x368cbd(0x216)+_0x42b723['type']),console['error'](_0x368cbd(0x27d)+_0x42b723['parentId']),_0x42b723[_0x368cbd(0x209)]&&console[_0x368cbd(0x26d)]('Folder\x20ID:\x20'+_0x42b723['folderId']),_0x42b723[_0x368cbd(0x242)]&&console[_0x368cbd(0x26d)](_0x368cbd(0x273)+_0x42b723['segmentId']));if(_0x42b723[_0x368cbd(0x24a)]===_0x368cbd(0x1fd)){const _0x470ee5=await withSpinner(_0x368cbd(0x22a),()=>_0x959b48[_0x368cbd(0x278)]['getParent'](_0x42b723['parentId']),{'verbose':_0x36d097[_0x368cbd(0x262)]});await handleSingleObjectOutput(_0x470ee5[_0x368cbd(0x276)],_0x36d097);}else{if(_0x42b723[_0x368cbd(0x24a)]==='folder'){if(!_0x42b723[_0x368cbd(0x209)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x368cbd(0x1f4));const _0x123ac0=await withSpinner(_0x368cbd(0x228),()=>_0x959b48['segment']['getFolder'](_0x42b723[_0x368cbd(0x209)]),{'verbose':_0x36d097[_0x368cbd(0x262)]});await handleSingleObjectOutput(_0x123ac0['data'],_0x36d097);}else{if(_0x42b723[_0x368cbd(0x24a)]===_0x368cbd(0x278)){if(!_0x42b723['segmentId'])throw new SDKError(ErrorCode[_0x368cbd(0x26b)],_0x368cbd(0x1fa));const _0x3332c2=await withSpinner(_0x368cbd(0x27b),()=>_0x959b48['segment'][_0x368cbd(0x23d)](_0x42b723['parentId'],_0x42b723[_0x368cbd(0x242)]),{'verbose':_0x36d097[_0x368cbd(0x262)]});await handleSingleObjectOutput(_0x3332c2['data'],_0x36d097);}}}return 0x0;}catch(_0x52419c){if(_0x52419c instanceof SDKError)return console[_0x368cbd(0x26d)](_0x368cbd(0x245)+_0x52419c[_0x368cbd(0x1ff)]),_0x52419c[_0x368cbd(0x22e)]&&console[_0x368cbd(0x26d)](_0x368cbd(0x21a)+_0x52419c[_0x368cbd(0x22e)]),0x1;throw _0x52419c;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x33e530(0x25a)]=a25_0x33e530(0x20e);[a25_0x33e530(0x261)]=a25_0x33e530(0x214);async[a25_0x33e530(0x1fb)](_0x30cfc8){const _0x2096ed=a25_0x33e530,{options:_0x2adad6,args:_0x2921d9,tdx:_0x4740a3}=_0x30cfc8,_0x38db63=_0x2921d9[0x0];if(!_0x38db63)return console[_0x2096ed(0x26d)](_0x2096ed(0x211)),console[_0x2096ed(0x26d)](_0x2096ed(0x241)),console[_0x2096ed(0x26d)](_0x2096ed(0x220)),console[_0x2096ed(0x26d)](_0x2096ed(0x26f)),console[_0x2096ed(0x26d)](_0x2096ed(0x227)),console[_0x2096ed(0x26d)](_0x2096ed(0x283)),0x1;try{const _0x2cad9=_0x2adad6[_0x2096ed(0x24c)],_0x136c97=await resolveSegmentTarget(_0x38db63,_0x2cad9,_0x2adad6[_0x2096ed(0x262)]);_0x2adad6['verbose']&&console['error'](_0x2096ed(0x218)+_0x136c97);const _0x4bc8a3=await withSpinner(_0x2096ed(0x204)+_0x38db63+_0x2096ed(0x279),()=>_0x4740a3[_0x2096ed(0x278)][_0x2096ed(0x200)](_0x136c97),{'verbose':_0x2adad6[_0x2096ed(0x262)]}),_0x29f58a=_0x4bc8a3['data'];_0x2adad6['verbose']&&(console[_0x2096ed(0x26d)](_0x2096ed(0x216)+_0x29f58a[_0x2096ed(0x24a)]),console[_0x2096ed(0x26d)](_0x2096ed(0x27d)+_0x29f58a[_0x2096ed(0x219)]));if(_0x29f58a['type']===_0x2096ed(0x27c))return console[_0x2096ed(0x26d)](_0x2096ed(0x284)),console[_0x2096ed(0x26d)](_0x2096ed(0x24e)),0x1;if(_0x29f58a['type']==='parent')return console[_0x2096ed(0x26d)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x2096ed(0x26d)](_0x2096ed(0x23a)),0x1;if(!_0x29f58a['segmentId'])throw new SDKError(ErrorCode[_0x2096ed(0x26b)],_0x2096ed(0x1fa));const _0x2c73f1=await withSpinner(_0x2096ed(0x25e),()=>_0x4740a3['segment'][_0x2096ed(0x237)](_0x29f58a[_0x2096ed(0x219)],_0x29f58a[_0x2096ed(0x242)]),{'verbose':_0x2adad6[_0x2096ed(0x262)]});let _0x47af7a=_0x2c73f1[_0x2096ed(0x276)];const _0x54a52f=resolveLimit(_0x2adad6['limit'],DEFAULT_DISPLAY_LIMIT),_0x2e1202=/\bLIMIT\s+\d+/i[_0x2096ed(0x248)](_0x47af7a);!_0x2e1202&&(_0x47af7a=_0x47af7a['trim']()[_0x2096ed(0x224)](/;+$/,''),_0x47af7a=_0x2096ed(0x22d)+_0x47af7a+_0x2096ed(0x240)+_0x54a52f);_0x2adad6['verbose']&&console[_0x2096ed(0x26d)](_0x2096ed(0x203)+_0x47af7a);const _0x2aa186=await withProgressSpinner('Executing\x20segment\x20query...',async _0x3567c0=>{const _0x4baeb6=_0x2096ed,_0x23c1a7=await _0x4740a3[_0x4baeb6(0x269)][_0x4baeb6(0x1fb)](_0x47af7a,{'catalog':'td','schema':_0x4baeb6(0x1f8),'onJobId':_0x1c39ae=>{const _0x4eb88a=_0x4baeb6;_0x3567c0[_0x4eb88a(0x270)](_0x1c39ae);}});return _0x23c1a7;},{'verbose':_0x2adad6[_0x2096ed(0x262)]}),_0x549ac1=_0x2aa186[_0x2096ed(0x276)],_0x7f11d4=_0x549ac1[_0x2096ed(0x225)]?_0x2096ed(0x231)+_0x549ac1[_0x2096ed(0x225)]+']':'';return console[_0x2096ed(0x26d)](_0x2096ed(0x1fe)+_0x549ac1[_0x2096ed(0x253)]['processedRows']['toLocaleString']()+_0x2096ed(0x229)+('in\x20'+formatElapsed(_0x549ac1['stats'][_0x2096ed(0x255)])+_0x7f11d4)),await handleQueryOutput(_0x549ac1,_0x2adad6),0x0;}catch(_0x463908){if(_0x463908 instanceof SDKError)return console[_0x2096ed(0x26d)](_0x2096ed(0x268)+_0x463908[_0x2096ed(0x27e)]+']'),console[_0x2096ed(0x26d)]('\x0a'+_0x463908['message']),0x1;throw _0x463908;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a25_0x33e530(0x261)]=a25_0x33e530(0x27f);async['execute'](_0x4f51c4){const _0x283f7c=a25_0x33e530,{options:_0x13ba84,args:_0x53bf02,tdx:_0x175b18}=_0x4f51c4;if(_0x53bf02[_0x283f7c(0x22b)]===0x0)return console[_0x283f7c(0x26d)](_0x283f7c(0x249)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x507e80=_0x53bf02[0x0];try{_0x13ba84[_0x283f7c(0x262)]&&(console[_0x283f7c(0x26d)](_0x283f7c(0x23f)+_0x13ba84[_0x283f7c(0x259)]),console[_0x283f7c(0x26d)](_0x283f7c(0x1fc)+_0x507e80));const _0x21514d=await withSpinner(_0x283f7c(0x25b)+_0x507e80+_0x283f7c(0x279),()=>_0x175b18[_0x283f7c(0x278)]['resolveParentId'](_0x507e80),{'verbose':_0x13ba84['verbose']}),_0x3d2d92=_0x21514d['data'];_0x13ba84[_0x283f7c(0x262)]&&console['error'](_0x283f7c(0x250)+_0x3d2d92);const _0x197bfb=await withSpinner(_0x283f7c(0x20f)+_0x507e80+_0x283f7c(0x279),()=>_0x175b18[_0x283f7c(0x278)]['listFolders'](_0x3d2d92),{'verbose':_0x13ba84[_0x283f7c(0x262)]}),_0x27fb73=_0x197bfb[_0x283f7c(0x276)];return console[_0x283f7c(0x26d)](_0x283f7c(0x246)+_0x27fb73['length']+'\x20folder'+(_0x27fb73[_0x283f7c(0x22b)]!==0x1?'s':'')),await handleSDKOutput(_0x27fb73,_0x13ba84),0x0;}catch(_0x4cf9d8){if(_0x4cf9d8 instanceof SDKError)return console['error']('Error:\x20'+_0x4cf9d8[_0x283f7c(0x1ff)]),_0x4cf9d8['cause']&&console[_0x283f7c(0x26d)](_0x283f7c(0x21a)+_0x4cf9d8[_0x283f7c(0x22e)]),0x1;throw _0x4cf9d8;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x33e530(0x25a)]=a25_0x33e530(0x243);['description']=a25_0x33e530(0x206);async[a25_0x33e530(0x1fb)](_0x51ca9f){const _0x5f0bc1=a25_0x33e530,{options:_0x1ea12a,args:_0x3657d9,tdx:_0x17e12d}=_0x51ca9f;if(_0x3657d9[_0x5f0bc1(0x22b)]===0x0)return console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x1f7)),console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x221)),0x1;try{const {parentId:_0x1a1cd4,childId:_0x3e85ec}=parseSegmentRef(_0x3657d9[0x0]);_0x1ea12a['verbose']&&(console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x23f)+_0x1ea12a[_0x5f0bc1(0x259)]),console['error'](_0x5f0bc1(0x1fc)+_0x1a1cd4),_0x3e85ec&&console[_0x5f0bc1(0x26d)]('Folder\x20name:\x20'+_0x3e85ec));if(!_0x3e85ec)return console['error'](_0x5f0bc1(0x207)),0x1;const _0x3aab7c=await withSpinner(_0x5f0bc1(0x25b)+_0x1a1cd4+_0x5f0bc1(0x279),()=>_0x17e12d[_0x5f0bc1(0x278)][_0x5f0bc1(0x275)](_0x1a1cd4),{'verbose':_0x1ea12a[_0x5f0bc1(0x262)]}),_0x2ca78b=_0x3aab7c[_0x5f0bc1(0x276)];_0x1ea12a[_0x5f0bc1(0x262)]&&console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x250)+_0x2ca78b);const _0x213f83=await withSpinner(_0x5f0bc1(0x233)+_0x3e85ec+_0x5f0bc1(0x279),()=>_0x17e12d[_0x5f0bc1(0x278)][_0x5f0bc1(0x1f1)](_0x2ca78b,_0x3e85ec),{'verbose':_0x1ea12a[_0x5f0bc1(0x262)]}),_0xd26760=_0x213f83['data'];_0x1ea12a['verbose']&&console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x1f5)+_0xd26760);const _0x86f09d=await withSpinner('Fetching\x20folder\x20\x27'+_0x3e85ec+'\x27...',()=>_0x17e12d['segment'][_0x5f0bc1(0x21f)](_0xd26760),{'verbose':_0x1ea12a[_0x5f0bc1(0x262)]});return await handleSDKOutput([_0x86f09d[_0x5f0bc1(0x276)]],_0x1ea12a),0x0;}catch(_0x18b732){if(_0x18b732 instanceof SDKError)return console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x245)+_0x18b732[_0x5f0bc1(0x1ff)]),_0x18b732[_0x5f0bc1(0x22e)]&&console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x21a)+_0x18b732[_0x5f0bc1(0x22e)]),0x1;throw _0x18b732;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x33e530(0x25a)]='segment:sql';[a25_0x33e530(0x261)]=a25_0x33e530(0x267);async['execute'](_0x53da19){const _0x38f183=a25_0x33e530,{options:_0x34299d,args:_0xd0d6b1,tdx:_0x24a2bb}=_0x53da19,_0xa8205=_0xd0d6b1[0x0];if(!_0xa8205)return console[_0x38f183(0x26d)](_0x38f183(0x211)),console[_0x38f183(0x26d)](_0x38f183(0x23b)),console[_0x38f183(0x26d)](_0x38f183(0x201)),console[_0x38f183(0x26d)](_0x38f183(0x26f)),console[_0x38f183(0x26d)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x38f183(0x26d)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x42f89a=_0x34299d[_0x38f183(0x24c)],_0x3fa81b=await resolveSegmentTarget(_0xa8205,_0x42f89a,_0x34299d['verbose']);_0x34299d[_0x38f183(0x262)]&&console[_0x38f183(0x26d)](_0x38f183(0x218)+_0x3fa81b);const _0xb3a020=await withSpinner(_0x38f183(0x204)+_0xa8205+_0x38f183(0x279),()=>_0x24a2bb[_0x38f183(0x278)]['resolvePathToResource'](_0x3fa81b),{'verbose':_0x34299d['verbose']}),_0x51155f=_0xb3a020[_0x38f183(0x276)];_0x34299d[_0x38f183(0x262)]&&(console[_0x38f183(0x26d)](_0x38f183(0x216)+_0x51155f[_0x38f183(0x24a)]),console[_0x38f183(0x26d)]('Parent\x20ID:\x20'+_0x51155f['parentId']));if(_0x51155f[_0x38f183(0x24a)]===_0x38f183(0x27c))return console[_0x38f183(0x26d)](_0x38f183(0x265)),console[_0x38f183(0x26d)](_0x38f183(0x217)),0x1;if(_0x51155f['type']===_0x38f183(0x1fd))return console[_0x38f183(0x26d)](_0x38f183(0x215)),console[_0x38f183(0x26d)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x51155f[_0x38f183(0x242)])throw new SDKError(ErrorCode[_0x38f183(0x26b)],_0x38f183(0x1fa));const _0x477f34=await withSpinner(_0x38f183(0x25e),()=>_0x24a2bb[_0x38f183(0x278)][_0x38f183(0x237)](_0x51155f[_0x38f183(0x219)],_0x51155f[_0x38f183(0x242)]),{'verbose':_0x34299d['verbose']}),_0x45818a=_0x477f34[_0x38f183(0x276)];return _0x34299d[_0x38f183(0x234)]===_0x38f183(0x264)||_0x34299d['format']===_0x38f183(0x230)?await handleSDKOutput([{'sql':_0x45818a}],_0x34299d):console['log'](_0x45818a),0x0;}catch(_0x4d324d){if(_0x4d324d instanceof SDKError)return console['error'](_0x38f183(0x245)+_0x4d324d['message']),_0x4d324d[_0x38f183(0x22e)]&&console['error'](_0x38f183(0x21a)+_0x4d324d[_0x38f183(0x22e)]),0x1;throw _0x4d324d;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x33e530(0x25a)]=a25_0x33e530(0x251);[a25_0x33e530(0x261)]='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x33e530(0x1fb)](_0x493ac2){const _0x474047=a25_0x33e530,{options:_0x5d61e1,args:_0x7ea0b0,tdx:_0x238e51}=_0x493ac2,_0x540ab7=_0x5d61e1;if(_0x7ea0b0[_0x474047(0x22b)]<0x2)return console[_0x474047(0x26d)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x474047(0x26d)](_0x474047(0x232)),0x1;const _0x23205f=_0x7ea0b0[0x0],_0x397ac4=_0x7ea0b0[0x1];_0x540ab7['verbose']&&(console[_0x474047(0x26d)](_0x474047(0x23f)+_0x540ab7['site']),console[_0x474047(0x26d)](_0x474047(0x266)+_0x23205f),console['error'](_0x474047(0x21e)+_0x397ac4));let _0x32877f;if(_0x540ab7['parentFolder']){const _0x407e44=_0x540ab7[_0x474047(0x20d)],_0x507b82=await withSpinner(_0x474047(0x25b)+_0x23205f+_0x474047(0x279),()=>_0x238e51['segment'][_0x474047(0x275)](_0x23205f),{'verbose':_0x540ab7['verbose']}),_0x2b78fb=_0x507b82[_0x474047(0x276)],_0x10fd99=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x407e44+_0x474047(0x279),()=>_0x238e51[_0x474047(0x278)][_0x474047(0x1f1)](_0x2b78fb,_0x407e44),{'verbose':_0x540ab7[_0x474047(0x262)]});_0x32877f=_0x10fd99[_0x474047(0x276)],_0x540ab7[_0x474047(0x262)]&&console[_0x474047(0x26d)](_0x474047(0x260)+_0x32877f);}const _0x143d7f={'name':_0x397ac4,'description':_0x540ab7['description'],'parentFolderId':_0x32877f},_0xd5158a=await withSpinner(_0x474047(0x25d)+_0x397ac4+_0x474047(0x279),()=>_0x238e51[_0x474047(0x278)][_0x474047(0x263)](_0x23205f,_0x143d7f),{'verbose':_0x540ab7['verbose']}),_0x5de66f=_0xd5158a[_0x474047(0x276)];return console['error'](_0x474047(0x22f)+_0x5de66f[_0x474047(0x25a)]+'\x27\x20with\x20ID:\x20'+_0x5de66f['id']),await handleSDKOutput([_0x5de66f],_0x540ab7),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x33e530(0x25a)]='segment:view';['description']=a25_0x33e530(0x25f);async['execute'](_0x106f71){const _0x23d8b3=a25_0x33e530,{options:_0x5278c2,args:_0x4b7362,tdx:_0x5e8799}=_0x106f71,_0x3daab6=_0x4b7362[0x0];if(!_0x3daab6)return console[_0x23d8b3(0x26d)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x23d8b3(0x26d)](_0x23d8b3(0x256)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x254)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x205)),console[_0x23d8b3(0x26d)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x23d8b3(0x26d)](_0x23d8b3(0x26f)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x24d)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x24b)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x277)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x14a636=_0x5278c2[_0x23d8b3(0x24c)],_0x1d8bb8=await resolveSegmentTarget(_0x3daab6,_0x14a636,_0x5278c2[_0x23d8b3(0x262)]);_0x5278c2['verbose']&&console[_0x23d8b3(0x26d)]('Target\x20path:\x20'+_0x1d8bb8);const _0x13cbd1=await withSpinner('Resolving\x20\x27'+_0x3daab6+_0x23d8b3(0x279),()=>_0x5e8799[_0x23d8b3(0x278)][_0x23d8b3(0x200)](_0x1d8bb8),{'verbose':_0x5278c2['verbose']}),_0x255076=_0x13cbd1[_0x23d8b3(0x276)];_0x5278c2['verbose']&&(console[_0x23d8b3(0x26d)]('Resolved\x20type:\x20'+_0x255076[_0x23d8b3(0x24a)]),console[_0x23d8b3(0x26d)]('Parent\x20ID:\x20'+_0x255076[_0x23d8b3(0x219)]),_0x255076[_0x23d8b3(0x209)]&&console[_0x23d8b3(0x26d)]('Folder\x20ID:\x20'+_0x255076['folderId']),_0x255076[_0x23d8b3(0x242)]&&console[_0x23d8b3(0x26d)](_0x23d8b3(0x273)+_0x255076['segmentId']));if(_0x5278c2[_0x23d8b3(0x26e)]){if(_0x255076[_0x23d8b3(0x24a)]===_0x23d8b3(0x27c))return console[_0x23d8b3(0x26d)](_0x23d8b3(0x23c)),0x1;if(_0x255076[_0x23d8b3(0x24a)]===_0x23d8b3(0x1fd))return console[_0x23d8b3(0x26d)](_0x23d8b3(0x208)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x210)),0x1;if(!_0x255076[_0x23d8b3(0x242)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4fbca5=getConsoleNextUrl(_0x5278c2[_0x23d8b3(0x259)],_0x23d8b3(0x271)+_0x255076['parentId']+_0x23d8b3(0x20a)+_0x255076['segmentId']);return console['error'](a25_0x4b87e8[_0x23d8b3(0x247)]('✔')+_0x23d8b3(0x274)+a25_0x4b87e8['cyan'](_0x4fbca5)),openBrowser(_0x4fbca5),0x0;}if(_0x255076['type']===_0x23d8b3(0x27c)){if(!_0x255076[_0x23d8b3(0x209)])throw new SDKError(ErrorCode[_0x23d8b3(0x272)],_0x23d8b3(0x1f4));const _0x2b0a79=await withSpinner('Fetching\x20folder\x20details...',()=>_0x5e8799['segment']['getFolder'](_0x255076[_0x23d8b3(0x209)]),{'verbose':_0x5278c2[_0x23d8b3(0x262)]});await handleSingleObjectOutput(_0x2b0a79[_0x23d8b3(0x276)],_0x5278c2);}else{if(_0x255076[_0x23d8b3(0x24a)]===_0x23d8b3(0x278)){if(!_0x255076['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x23d8b3(0x1fa));const _0x1d2b96=await withSpinner(_0x23d8b3(0x27b),()=>_0x5e8799[_0x23d8b3(0x278)][_0x23d8b3(0x23d)](_0x255076[_0x23d8b3(0x219)],_0x255076[_0x23d8b3(0x242)]),{'verbose':_0x5278c2['verbose']}),_0x3af9ca=getConsoleNextUrl(_0x5278c2[_0x23d8b3(0x259)],_0x23d8b3(0x271)+_0x255076[_0x23d8b3(0x219)]+'/e/'+_0x255076['segmentId']),_0x4ec318=_0x1d2b96[_0x23d8b3(0x276)];_0x4ec318[_0x23d8b3(0x236)]=_0x3af9ca,await handleSingleObjectOutput(_0x4ec318,_0x5278c2);}else return console[_0x23d8b3(0x26d)](_0x23d8b3(0x1f2)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x235)),0x1;}return 0x0;}catch(_0x575f61){if(_0x575f61 instanceof SDKError)return console[_0x23d8b3(0x26d)](_0x23d8b3(0x245)+_0x575f61[_0x23d8b3(0x1ff)]),_0x575f61[_0x23d8b3(0x22e)]&&console[_0x23d8b3(0x26d)]('\x20\x20Cause:\x20'+_0x575f61['cause']),0x1;throw _0x575f61;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x33e530(0x25a)]=a25_0x33e530(0x22c);[a25_0x33e530(0x261)]=a25_0x33e530(0x20c);async[a25_0x33e530(0x1fb)](_0x2f81ce){const _0x5c8f97=a25_0x33e530,{options:_0x37fc07,args:_0x45783e,tdx:_0x491c6c}=_0x2f81ce,_0x28e0d4=_0x45783e[0x0];if(!_0x28e0d4)return console[_0x5c8f97(0x26d)](_0x5c8f97(0x211)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x239)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x258)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x26f)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x222)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x27a)),0x1;try{const _0x35a535=_0x37fc07[_0x5c8f97(0x24c)],_0x5a66c7=await resolveSegmentTarget(_0x28e0d4,_0x35a535,_0x37fc07[_0x5c8f97(0x262)]);_0x37fc07[_0x5c8f97(0x262)]&&console[_0x5c8f97(0x26d)]('Target\x20path:\x20'+_0x5a66c7);const _0x3d13d9=await withSpinner(_0x5c8f97(0x204)+_0x28e0d4+'\x27...',()=>_0x491c6c[_0x5c8f97(0x278)][_0x5c8f97(0x200)](_0x5a66c7),{'verbose':_0x37fc07['verbose']}),_0x540d71=_0x3d13d9[_0x5c8f97(0x276)];_0x37fc07['verbose']&&(console['error'](_0x5c8f97(0x216)+_0x540d71[_0x5c8f97(0x24a)]),console[_0x5c8f97(0x26d)]('Parent\x20ID:\x20'+_0x540d71['parentId']));if(_0x540d71[_0x5c8f97(0x24a)]===_0x5c8f97(0x27c))return console['error'](_0x5c8f97(0x26c)),console[_0x5c8f97(0x26d)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x540d71['type']===_0x5c8f97(0x1fd))return console['error'](_0x5c8f97(0x21b)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x540d71[_0x5c8f97(0x242)])throw new SDKError(ErrorCode[_0x5c8f97(0x26b)],_0x5c8f97(0x1fa));const _0xc77a10=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x491c6c[_0x5c8f97(0x278)][_0x5c8f97(0x237)](_0x540d71[_0x5c8f97(0x219)],_0x540d71[_0x5c8f97(0x242)]),{'verbose':_0x37fc07['verbose']}),_0x52423d=_0xc77a10[_0x5c8f97(0x276)],_0x55924c=await executeSchemaQuery(_0x52423d,_0x491c6c,_0x37fc07);return await handleQueryOutput(_0x55924c,_0x37fc07),0x0;}catch(_0x5cebd6){if(_0x5cebd6 instanceof SDKError)return console['error'](_0x5c8f97(0x245)+_0x5cebd6[_0x5c8f97(0x1ff)]),_0x5cebd6[_0x5c8f97(0x22e)]&&console['error'](_0x5c8f97(0x21a)+_0x5cebd6[_0x5c8f97(0x22e)]),0x1;throw _0x5cebd6;}}}
|
|
1
|
+
const a25_0x2f1163=a25_0x1c7e;(function(_0x30b863,_0x39136b){const _0x33e419=a25_0x1c7e,_0x5c2e35=_0x30b863();while(!![]){try{const _0x3b6cb1=parseInt(_0x33e419(0xe0))/0x1*(parseInt(_0x33e419(0xff))/0x2)+parseInt(_0x33e419(0x123))/0x3+-parseInt(_0x33e419(0xef))/0x4*(-parseInt(_0x33e419(0xec))/0x5)+parseInt(_0x33e419(0x15c))/0x6+-parseInt(_0x33e419(0xde))/0x7+-parseInt(_0x33e419(0xdb))/0x8*(-parseInt(_0x33e419(0xe6))/0x9)+parseInt(_0x33e419(0x135))/0xa*(-parseInt(_0x33e419(0x145))/0xb);if(_0x3b6cb1===_0x39136b)break;else _0x5c2e35['push'](_0x5c2e35['shift']());}catch(_0x522cc8){_0x5c2e35['push'](_0x5c2e35['shift']());}}}(a25_0x1619,0xcaf09));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x220c23 from'chalk';function a25_0x1c7e(_0x6fd462,_0x38e462){_0x6fd462=_0x6fd462-0xc5;const _0x161986=a25_0x1619();let _0x1c7ef8=_0x161986[_0x6fd462];return _0x1c7ef8;}async function resolveSegmentTarget(_0x5c68cb,_0x184348,_0x290799){const _0x16f9cb=a25_0x1c7e;if(isYamlFilePath(_0x5c68cb))try{const _0x42d796=await resolveYamlFilePath(_0x5c68cb);return _0x290799&&(console[_0x16f9cb(0xd1)](_0x16f9cb(0xc7)+_0x5c68cb),console[_0x16f9cb(0xd1)]('\x20\x20Parent\x20segment:\x20'+_0x42d796[_0x16f9cb(0x10d)]),console[_0x16f9cb(0xd1)](_0x16f9cb(0x13c)+_0x42d796[_0x16f9cb(0xfd)]),console['error'](_0x16f9cb(0x138)+(_0x42d796[_0x16f9cb(0x122)]||_0x16f9cb(0x15b))),console['error'](_0x16f9cb(0x11b)+_0x42d796[_0x16f9cb(0x101)])),_0x42d796['fullPath'];}catch(_0x221ee0){throw new SDKError(ErrorCode[_0x16f9cb(0x13a)],_0x16f9cb(0xfe)+_0x221ee0[_0x16f9cb(0x146)]);}if(!_0x184348)throw new SDKError(ErrorCode[_0x16f9cb(0x13a)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x184348+'/'+_0x5c68cb;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x2f1163(0xf9)]='segment:describe';[a25_0x2f1163(0xe2)]=a25_0x2f1163(0x10c);async[a25_0x2f1163(0x112)](_0x64ece3){const _0x157331=a25_0x2f1163,{options:_0x20bde8,args:_0x5a4e1b,tdx:_0x4e6c36}=_0x64ece3,_0x4488e0=_0x5a4e1b[0x0],_0xaa29f=!_0x4488e0&&!!_0x20bde8[_0x157331(0x10d)],_0x322856=_0x4488e0||_0x20bde8['parentSegment'];if(!_0x322856)return console[_0x157331(0xd1)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x157331(0xd1)](_0x157331(0x108)),console[_0x157331(0xd1)](_0x157331(0x158)),console[_0x157331(0xd1)](_0x157331(0x132)),console['error'](_0x157331(0xc8)),console[_0x157331(0xd1)](_0x157331(0x10e)),console[_0x157331(0xd1)](_0x157331(0x103)),0x1;try{const _0xf7c261=_0x20bde8[_0x157331(0x149)];let _0x4e2871=_0x322856;!_0xaa29f&&_0xf7c261&&!_0x322856[_0x157331(0x104)]('/')&&(_0x4e2871=_0xf7c261+'/'+_0x322856,_0x20bde8['verbose']&&console[_0x157331(0xd1)](_0x157331(0xe1)+_0x4e2871));const _0xe9b06e=await withSpinner('Resolving\x20path\x20\x27'+_0x4e2871+'\x27...',()=>_0x4e6c36[_0x157331(0x126)][_0x157331(0x102)](_0x4e2871),{'verbose':_0x20bde8['verbose']}),_0x710f74=_0xe9b06e[_0x157331(0xe3)];_0x20bde8[_0x157331(0x157)]&&(console['error'](_0x157331(0x11d)+_0x710f74[_0x157331(0x111)]),console['error']('Parent\x20ID:\x20'+_0x710f74['parentId']),_0x710f74[_0x157331(0x147)]&&console['error'](_0x157331(0x109)+_0x710f74[_0x157331(0x147)]),_0x710f74[_0x157331(0x128)]&&console[_0x157331(0xd1)](_0x157331(0x144)+_0x710f74[_0x157331(0x128)]));if(_0x710f74[_0x157331(0x111)]===_0x157331(0x143)){const _0x50dea4=await withSpinner(_0x157331(0x107),()=>_0x4e6c36[_0x157331(0x126)][_0x157331(0xfb)](_0x710f74[_0x157331(0x117)]),{'verbose':_0x20bde8[_0x157331(0x157)]});await handleSingleObjectOutput(_0x50dea4[_0x157331(0xe3)],_0x20bde8);}else{if(_0x710f74[_0x157331(0x111)]===_0x157331(0x125)){if(!_0x710f74[_0x157331(0x147)])throw new SDKError(ErrorCode[_0x157331(0x121)],_0x157331(0xf2));const _0x4c373b=await withSpinner(_0x157331(0x137),()=>_0x4e6c36['segment'][_0x157331(0xf8)](_0x710f74['folderId']),{'verbose':_0x20bde8['verbose']});await handleSingleObjectOutput(_0x4c373b['data'],_0x20bde8);}else{if(_0x710f74[_0x157331(0x111)]===_0x157331(0x126)){if(!_0x710f74['segmentId'])throw new SDKError(ErrorCode[_0x157331(0xdd)],_0x157331(0x148));const _0x1763fc=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4e6c36[_0x157331(0x126)]['getSegment'](_0x710f74['parentId'],_0x710f74[_0x157331(0x128)]),{'verbose':_0x20bde8['verbose']});await handleSingleObjectOutput(_0x1763fc['data'],_0x20bde8);}}}return 0x0;}catch(_0xfb8c9){if(_0xfb8c9 instanceof SDKError)return console[_0x157331(0xd1)]('Error:\x20'+_0xfb8c9[_0x157331(0x146)]),_0xfb8c9[_0x157331(0x11a)]&&console[_0x157331(0xd1)](_0x157331(0xd6)+_0xfb8c9['cause']),0x1;throw _0xfb8c9;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x2f1163(0xf9)]=a25_0x2f1163(0xd5);['description']=a25_0x2f1163(0x130);async[a25_0x2f1163(0x112)](_0x2a0793){const _0x1ad873=a25_0x2f1163,{options:_0x2cd8a9,args:_0xa430ab,tdx:_0xbf1f3f}=_0x2a0793,_0x33ade3=_0xa430ab[0x0];if(!_0x33ade3)return console['error'](_0x1ad873(0x114)),console[_0x1ad873(0xd1)](_0x1ad873(0xd9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x1ad873(0xd1)](_0x1ad873(0x158)),console[_0x1ad873(0xd1)](_0x1ad873(0xc9)),console[_0x1ad873(0xd1)](_0x1ad873(0xce)),0x1;try{const _0x441251=_0x2cd8a9[_0x1ad873(0x10d)],_0x5138da=await resolveSegmentTarget(_0x33ade3,_0x441251,_0x2cd8a9[_0x1ad873(0x157)]);_0x2cd8a9[_0x1ad873(0x157)]&&console[_0x1ad873(0xd1)]('Target\x20path:\x20'+_0x5138da);const _0x9a8cd0=await withSpinner(_0x1ad873(0x11f)+_0x33ade3+'\x27...',()=>_0xbf1f3f[_0x1ad873(0x126)][_0x1ad873(0x102)](_0x5138da),{'verbose':_0x2cd8a9[_0x1ad873(0x157)]}),_0x3c7076=_0x9a8cd0[_0x1ad873(0xe3)];_0x2cd8a9[_0x1ad873(0x157)]&&(console[_0x1ad873(0xd1)]('Resolved\x20type:\x20'+_0x3c7076[_0x1ad873(0x111)]),console[_0x1ad873(0xd1)](_0x1ad873(0xd2)+_0x3c7076[_0x1ad873(0x117)]));if(_0x3c7076[_0x1ad873(0x111)]===_0x1ad873(0x125))return console[_0x1ad873(0xd1)](_0x1ad873(0x14e)),console['error'](_0x1ad873(0x13f)),0x1;if(_0x3c7076['type']===_0x1ad873(0x143))return console[_0x1ad873(0xd1)](_0x1ad873(0x120)),console[_0x1ad873(0xd1)](_0x1ad873(0x153)),0x1;if(!_0x3c7076[_0x1ad873(0x128)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1ad873(0x148));const _0x3df296=await withSpinner(_0x1ad873(0x129),()=>_0xbf1f3f['segment'][_0x1ad873(0x118)](_0x3c7076['parentId'],_0x3c7076[_0x1ad873(0x128)]),{'verbose':_0x2cd8a9[_0x1ad873(0x157)]});let _0x147946=_0x3df296[_0x1ad873(0xe3)];const _0x343e85=resolveLimit(_0x2cd8a9[_0x1ad873(0x14f)],DEFAULT_DISPLAY_LIMIT),_0x32ea5f=/\bLIMIT\s+\d+/i[_0x1ad873(0xf1)](_0x147946);!_0x32ea5f&&(_0x147946=_0x147946[_0x1ad873(0x151)]()[_0x1ad873(0xc5)](/;+$/,''),_0x147946=_0x1ad873(0x10a)+_0x147946+_0x1ad873(0xf7)+_0x343e85);_0x2cd8a9[_0x1ad873(0x157)]&&console[_0x1ad873(0xd1)](_0x1ad873(0x152)+_0x147946);const _0x527c71=await withProgressSpinner(_0x1ad873(0xe8),async _0x3e8e76=>{const _0x14e430=_0x1ad873,_0x3684ec=await _0xbf1f3f[_0x14e430(0xf6)]['execute'](_0x147946,{'catalog':'td','schema':_0x14e430(0x100),'onJobId':_0x27e0d2=>{const _0x2b1b54=_0x14e430;_0x3e8e76[_0x2b1b54(0xed)](_0x27e0d2);}});return _0x3684ec;},{'verbose':_0x2cd8a9[_0x1ad873(0x157)]}),_0xf81e64=_0x527c71[_0x1ad873(0xe3)],_0x12a870=_0xf81e64['jobId']?_0x1ad873(0x142)+_0xf81e64[_0x1ad873(0x115)]+']':'';return console[_0x1ad873(0xd1)]('✔\x20Query\x20completed:\x20Processed\x20'+_0xf81e64[_0x1ad873(0x15a)]['processedRows'][_0x1ad873(0xfc)]()+'\x20rows\x20'+(_0x1ad873(0xcd)+formatElapsed(_0xf81e64[_0x1ad873(0x15a)]['elapsedTimeMillis'])+_0x12a870)),await handleQueryOutput(_0xf81e64,_0x2cd8a9),0x0;}catch(_0x419901){if(_0x419901 instanceof SDKError)return console['error']('✖\x20Query\x20failed\x20['+_0x419901['code']+']'),console['error']('\x0a'+_0x419901[_0x1ad873(0x146)]),0x1;throw _0x419901;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x2f1163(0xda);['description']=a25_0x2f1163(0x127);async['execute'](_0x4c4403){const _0x19f1a8=a25_0x2f1163,{options:_0x205bfc,args:_0x4a0d67,tdx:_0x3236bd}=_0x4c4403;if(_0x4a0d67[_0x19f1a8(0x124)]===0x0)return console[_0x19f1a8(0xd1)](_0x19f1a8(0xd7)),console[_0x19f1a8(0xd1)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x49ca94=_0x4a0d67[0x0];try{_0x205bfc['verbose']&&(console[_0x19f1a8(0xd1)](_0x19f1a8(0xf4)+_0x205bfc['site']),console[_0x19f1a8(0xd1)](_0x19f1a8(0xe9)+_0x49ca94));const _0x2eedbd=await withSpinner(_0x19f1a8(0x156)+_0x49ca94+_0x19f1a8(0xe7),()=>_0x3236bd[_0x19f1a8(0x126)][_0x19f1a8(0x133)](_0x49ca94),{'verbose':_0x205bfc['verbose']}),_0x23aec5=_0x2eedbd[_0x19f1a8(0xe3)];_0x205bfc['verbose']&&console[_0x19f1a8(0xd1)]('Resolved\x20parent\x20ID:\x20'+_0x23aec5);const _0xb58183=await withSpinner(_0x19f1a8(0x139)+_0x49ca94+_0x19f1a8(0xe7),()=>_0x3236bd[_0x19f1a8(0x126)][_0x19f1a8(0xe5)](_0x23aec5),{'verbose':_0x205bfc[_0x19f1a8(0x157)]}),_0x3b85c0=_0xb58183[_0x19f1a8(0xe3)];return console[_0x19f1a8(0xd1)]('✔\x20Found\x20'+_0x3b85c0[_0x19f1a8(0x124)]+_0x19f1a8(0xf0)+(_0x3b85c0[_0x19f1a8(0x124)]!==0x1?'s':'')),await handleSDKOutput(_0x3b85c0,_0x205bfc),0x0;}catch(_0x26917c){if(_0x26917c instanceof SDKError)return console[_0x19f1a8(0xd1)](_0x19f1a8(0x12a)+_0x26917c[_0x19f1a8(0x146)]),_0x26917c[_0x19f1a8(0x11a)]&&console[_0x19f1a8(0xd1)]('\x20\x20Cause:\x20'+_0x26917c[_0x19f1a8(0x11a)]),0x1;throw _0x26917c;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x2f1163(0xf9)]='segment:folder:show';[a25_0x2f1163(0xe2)]=a25_0x2f1163(0xea);async[a25_0x2f1163(0x112)](_0x32b294){const _0x1514d8=a25_0x2f1163,{options:_0x3ad654,args:_0x2d5bc2,tdx:_0xc6b3c7}=_0x32b294;if(_0x2d5bc2[_0x1514d8(0x124)]===0x0)return console[_0x1514d8(0xd1)](_0x1514d8(0x154)),console[_0x1514d8(0xd1)](_0x1514d8(0x110)),0x1;try{const {parentId:_0x24e925,childId:_0x3886e7}=parseSegmentRef(_0x2d5bc2[0x0]);_0x3ad654['verbose']&&(console['error']('Site:\x20'+_0x3ad654[_0x1514d8(0x113)]),console[_0x1514d8(0xd1)](_0x1514d8(0xe9)+_0x24e925),_0x3886e7&&console[_0x1514d8(0xd1)](_0x1514d8(0xdc)+_0x3886e7));if(!_0x3886e7)return console[_0x1514d8(0xd1)](_0x1514d8(0x12b)),0x1;const _0x22f18e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x24e925+_0x1514d8(0xe7),()=>_0xc6b3c7[_0x1514d8(0x126)][_0x1514d8(0x133)](_0x24e925),{'verbose':_0x3ad654[_0x1514d8(0x157)]}),_0x431c7e=_0x22f18e[_0x1514d8(0xe3)];_0x3ad654[_0x1514d8(0x157)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x431c7e);const _0x5bb07f=await withSpinner(_0x1514d8(0x12d)+_0x3886e7+_0x1514d8(0xe7),()=>_0xc6b3c7['segment']['resolveFolderId'](_0x431c7e,_0x3886e7),{'verbose':_0x3ad654[_0x1514d8(0x157)]}),_0xd0ee7e=_0x5bb07f[_0x1514d8(0xe3)];_0x3ad654[_0x1514d8(0x157)]&&console[_0x1514d8(0xd1)]('Resolved\x20folder\x20ID:\x20'+_0xd0ee7e);const _0x5679ac=await withSpinner(_0x1514d8(0xf5)+_0x3886e7+_0x1514d8(0xe7),()=>_0xc6b3c7[_0x1514d8(0x126)][_0x1514d8(0xf8)](_0xd0ee7e),{'verbose':_0x3ad654[_0x1514d8(0x157)]});return await handleSDKOutput([_0x5679ac[_0x1514d8(0xe3)]],_0x3ad654),0x0;}catch(_0x1de706){if(_0x1de706 instanceof SDKError)return console[_0x1514d8(0xd1)]('Error:\x20'+_0x1de706['message']),_0x1de706[_0x1514d8(0x11a)]&&console['error']('\x20\x20Cause:\x20'+_0x1de706[_0x1514d8(0x11a)]),0x1;throw _0x1de706;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x2f1163(0xf9)]=a25_0x2f1163(0xf3);[a25_0x2f1163(0xe2)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a25_0x2f1163(0x112)](_0x2ac4f3){const _0x387b13=a25_0x2f1163,{options:_0x5db1e9,args:_0x10a4d9,tdx:_0x43ebaf}=_0x2ac4f3,_0x1c43d4=_0x10a4d9[0x0];if(!_0x1c43d4)return console['error'](_0x387b13(0x114)),console['error'](_0x387b13(0xd3)),console[_0x387b13(0xd1)](_0x387b13(0xfa)),console[_0x387b13(0xd1)]('Examples:'),console['error']('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x387b13(0xd1)](_0x387b13(0x155)),0x1;try{const _0x3ac993=_0x5db1e9['parentSegment'],_0x34e3ff=await resolveSegmentTarget(_0x1c43d4,_0x3ac993,_0x5db1e9[_0x387b13(0x157)]);_0x5db1e9[_0x387b13(0x157)]&&console[_0x387b13(0xd1)](_0x387b13(0x12e)+_0x34e3ff);const _0x34deb3=await withSpinner('Resolving\x20\x27'+_0x1c43d4+_0x387b13(0xe7),()=>_0x43ebaf[_0x387b13(0x126)][_0x387b13(0x102)](_0x34e3ff),{'verbose':_0x5db1e9[_0x387b13(0x157)]}),_0x3102b5=_0x34deb3[_0x387b13(0xe3)];_0x5db1e9[_0x387b13(0x157)]&&(console[_0x387b13(0xd1)](_0x387b13(0x11d)+_0x3102b5[_0x387b13(0x111)]),console['error'](_0x387b13(0xd2)+_0x3102b5[_0x387b13(0x117)]));if(_0x3102b5[_0x387b13(0x111)]===_0x387b13(0x125))return console[_0x387b13(0xd1)](_0x387b13(0x14b)),console[_0x387b13(0xd1)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x3102b5[_0x387b13(0x111)]===_0x387b13(0x143))return console[_0x387b13(0xd1)](_0x387b13(0xee)),console[_0x387b13(0xd1)](_0x387b13(0x119)),0x1;if(!_0x3102b5['segmentId'])throw new SDKError(ErrorCode[_0x387b13(0xdd)],_0x387b13(0x148));const _0x2e050a=await withSpinner(_0x387b13(0x129),()=>_0x43ebaf[_0x387b13(0x126)][_0x387b13(0x118)](_0x3102b5[_0x387b13(0x117)],_0x3102b5[_0x387b13(0x128)]),{'verbose':_0x5db1e9[_0x387b13(0x157)]}),_0x56bc1a=_0x2e050a[_0x387b13(0xe3)];return _0x5db1e9[_0x387b13(0x13b)]==='json'||_0x5db1e9[_0x387b13(0x13b)]===_0x387b13(0xca)?await handleSDKOutput([{'sql':_0x56bc1a}],_0x5db1e9):console['log'](_0x56bc1a),0x0;}catch(_0x2066d3){if(_0x2066d3 instanceof SDKError)return console[_0x387b13(0xd1)](_0x387b13(0x12a)+_0x2066d3['message']),_0x2066d3['cause']&&console[_0x387b13(0xd1)](_0x387b13(0xd6)+_0x2066d3['cause']),0x1;throw _0x2066d3;}}}function a25_0x1619(){const _0x4ae57f=['verbose','Examples:','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','stats','(root)','2925438aMTmli','✔\x20Created\x20folder\x20\x27','replace','Resolving\x20parent\x20folder\x20\x27','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','jsonl','web','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','in\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','error','Parent\x20ID:\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','createFolder','segment:show','\x20\x20Cause:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20show\x20<name>','segment:folder:list','1575056QIVDSK','Folder\x20name:\x20','SEGMENT_NOT_FOUND','10696504Vcovll','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','2LssgwA','Resolved\x20relative\x20path\x20to:\x20','description','data','Resolved\x20parent\x20folder\x20ID:\x20','listFolders','9SUqqhr','\x27...','Executing\x20segment\x20query...','Parent\x20name:\x20','Show\x20segment\x20folder\x20details','/app/ps/','25465zryliO','setJobId','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','864WwQoQx','\x20folder','test','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:sql','Site:\x20','Fetching\x20folder\x20\x27','query','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','getFolder','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','getParent','toLocaleString','segmentName','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','775106jfyist','information_schema','fullPath','resolvePathToResource','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','includes','resolveFolderId','getSegment','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20segment\x20describe\x20<path>','Folder\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','Show\x20child\x20segment\x20schema\x20(column\x20types)','Show\x20segment\x20or\x20folder\x20details','parentSegment','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','/e/','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','type','execute','site','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','jobId','Show\x20folder\x20or\x20child\x20segment\x20details','parentId','getSegmentSQL','Use:\x20tdx\x20ps\x20sql','cause','\x20\x20Full\x20path:\x20','Parent\x20segment:\x20','Resolved\x20type:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Resolving\x20\x27','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','SEGMENT_FOLDER_NOT_FOUND','folderPath','928446OTHhgq','length','folder','segment','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','segmentId','Fetching\x20SQL\x20for\x20segment...','Error:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:folder:create','Resolving\x20folder\x20\x27','Target\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','resolveParentId','Use:\x20tdx\x20ps\x20desc','2549090lkIaJh','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20folder\x20details...','\x20\x20Folder\x20path:\x20','Listing\x20folders\x20for\x20parent\x20\x27','INVALID_ARGUMENT','format','\x20\x20Segment\x20name:\x20','parentFolder','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment:desc','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20[Job\x20ID:\x20','parent','Segment\x20ID:\x20','22gouXGK','message','folderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentPath','green','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','segment:view','url','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','limit','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','trim','SQL\x20query:\x0a','Use:\x20tdx\x20ps\x20show','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Resolving\x20parent\x20segment\x20\x27'];a25_0x1619=function(){return _0x4ae57f;};return a25_0x1619();}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x2f1163(0xf9)]=a25_0x2f1163(0x12c);[a25_0x2f1163(0xe2)]='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x2f1163(0x112)](_0x12ab86){const _0x136825=a25_0x2f1163,{options:_0x5e76d8,args:_0x5e06ad,tdx:_0x15d937}=_0x12ab86,_0x33d706=_0x5e76d8;if(_0x5e06ad[_0x136825(0x124)]<0x2)return console[_0x136825(0xd1)](_0x136825(0x136)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x1accf8=_0x5e06ad[0x0],_0x2c2dc3=_0x5e06ad[0x1];_0x33d706[_0x136825(0x157)]&&(console[_0x136825(0xd1)](_0x136825(0xf4)+_0x33d706[_0x136825(0x113)]),console[_0x136825(0xd1)](_0x136825(0x11c)+_0x1accf8),console[_0x136825(0xd1)](_0x136825(0xdc)+_0x2c2dc3));let _0x3ac3b4;if(_0x33d706[_0x136825(0x13d)]){const _0x33308a=_0x33d706[_0x136825(0x13d)],_0x3621ac=await withSpinner(_0x136825(0x156)+_0x1accf8+_0x136825(0xe7),()=>_0x15d937[_0x136825(0x126)]['resolveParentId'](_0x1accf8),{'verbose':_0x33d706[_0x136825(0x157)]}),_0x1a19e2=_0x3621ac[_0x136825(0xe3)],_0x4c38eb=await withSpinner(_0x136825(0xc6)+_0x33308a+_0x136825(0xe7),()=>_0x15d937[_0x136825(0x126)][_0x136825(0x105)](_0x1a19e2,_0x33308a),{'verbose':_0x33d706[_0x136825(0x157)]});_0x3ac3b4=_0x4c38eb[_0x136825(0xe3)],_0x33d706[_0x136825(0x157)]&&console[_0x136825(0xd1)](_0x136825(0xe4)+_0x3ac3b4);}const _0x56df14={'name':_0x2c2dc3,'description':_0x33d706[_0x136825(0xe2)],'parentFolderId':_0x3ac3b4},_0x1eab0d=await withSpinner('Creating\x20folder\x20\x27'+_0x2c2dc3+_0x136825(0xe7),()=>_0x15d937[_0x136825(0x126)][_0x136825(0xd4)](_0x1accf8,_0x56df14),{'verbose':_0x33d706[_0x136825(0x157)]}),_0x50c8b7=_0x1eab0d[_0x136825(0xe3)];return console[_0x136825(0xd1)](_0x136825(0x15d)+_0x50c8b7['name']+'\x27\x20with\x20ID:\x20'+_0x50c8b7['id']),await handleSDKOutput([_0x50c8b7],_0x33d706),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x2f1163(0xf9)]=a25_0x2f1163(0x14c);['description']=a25_0x2f1163(0x116);async[a25_0x2f1163(0x112)](_0x20a073){const _0x1c4973=a25_0x2f1163,{options:_0x4ad956,args:_0x1da76a,tdx:_0x4f536d}=_0x20a073,_0x2feb8a=_0x1da76a[0x0];if(!_0x2feb8a)return console[_0x1c4973(0xd1)](_0x1c4973(0xd8)),console[_0x1c4973(0xd1)](_0x1c4973(0xcc)),console[_0x1c4973(0xd1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x1c4973(0xd1)]('Options:'),console['error'](_0x1c4973(0xcf)),console[_0x1c4973(0xd1)](_0x1c4973(0x158)),console['error'](_0x1c4973(0xdf)),console[_0x1c4973(0xd1)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x1c4973(0xd1)](_0x1c4973(0x159)),console[_0x1c4973(0xd1)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x233f60=_0x4ad956[_0x1c4973(0x10d)],_0x14f229=await resolveSegmentTarget(_0x2feb8a,_0x233f60,_0x4ad956[_0x1c4973(0x157)]);_0x4ad956[_0x1c4973(0x157)]&&console[_0x1c4973(0xd1)](_0x1c4973(0x12e)+_0x14f229);const _0x346af2=await withSpinner(_0x1c4973(0x11f)+_0x2feb8a+_0x1c4973(0xe7),()=>_0x4f536d[_0x1c4973(0x126)][_0x1c4973(0x102)](_0x14f229),{'verbose':_0x4ad956['verbose']}),_0x448171=_0x346af2[_0x1c4973(0xe3)];_0x4ad956[_0x1c4973(0x157)]&&(console['error'](_0x1c4973(0x11d)+_0x448171[_0x1c4973(0x111)]),console[_0x1c4973(0xd1)](_0x1c4973(0xd2)+_0x448171[_0x1c4973(0x117)]),_0x448171[_0x1c4973(0x147)]&&console[_0x1c4973(0xd1)](_0x1c4973(0x109)+_0x448171['folderId']),_0x448171[_0x1c4973(0x128)]&&console['error']('Segment\x20ID:\x20'+_0x448171['segmentId']));if(_0x4ad956[_0x1c4973(0xcb)]){if(_0x448171['type']===_0x1c4973(0x125))return console[_0x1c4973(0xd1)](_0x1c4973(0x13e)),0x1;if(_0x448171[_0x1c4973(0x111)]==='parent')return console[_0x1c4973(0xd1)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x448171[_0x1c4973(0x128)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x428b48=getConsoleNextUrl(_0x4ad956[_0x1c4973(0x113)],_0x1c4973(0xeb)+_0x448171[_0x1c4973(0x117)]+_0x1c4973(0x10f)+_0x448171[_0x1c4973(0x128)]);return console[_0x1c4973(0xd1)](a25_0x220c23[_0x1c4973(0x14a)]('✔')+'\x20Opening\x20'+a25_0x220c23['cyan'](_0x428b48)),openBrowser(_0x428b48),0x0;}if(_0x448171[_0x1c4973(0x111)]==='folder'){if(!_0x448171[_0x1c4973(0x147)])throw new SDKError(ErrorCode[_0x1c4973(0x121)],_0x1c4973(0xf2));const _0x35c72f=await withSpinner(_0x1c4973(0x137),()=>_0x4f536d['segment'][_0x1c4973(0xf8)](_0x448171[_0x1c4973(0x147)]),{'verbose':_0x4ad956[_0x1c4973(0x157)]});await handleSingleObjectOutput(_0x35c72f['data'],_0x4ad956);}else{if(_0x448171[_0x1c4973(0x111)]===_0x1c4973(0x126)){if(!_0x448171[_0x1c4973(0x128)])throw new SDKError(ErrorCode[_0x1c4973(0xdd)],_0x1c4973(0x148));const _0x18a3fd=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4f536d['segment'][_0x1c4973(0x106)](_0x448171[_0x1c4973(0x117)],_0x448171['segmentId']),{'verbose':_0x4ad956[_0x1c4973(0x157)]}),_0x1d84d1=getConsoleNextUrl(_0x4ad956[_0x1c4973(0x113)],_0x1c4973(0xeb)+_0x448171[_0x1c4973(0x117)]+_0x1c4973(0x10f)+_0x448171['segmentId']),_0x2bff08=_0x18a3fd[_0x1c4973(0xe3)];_0x2bff08[_0x1c4973(0x14d)]=_0x1d84d1,await handleSingleObjectOutput(_0x2bff08,_0x4ad956);}else return console[_0x1c4973(0xd1)](_0x1c4973(0x11e)),console[_0x1c4973(0xd1)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x12b346){if(_0x12b346 instanceof SDKError)return console[_0x1c4973(0xd1)]('Error:\x20'+_0x12b346[_0x1c4973(0x146)]),_0x12b346[_0x1c4973(0x11a)]&&console[_0x1c4973(0xd1)](_0x1c4973(0xd6)+_0x12b346[_0x1c4973(0x11a)]),0x1;throw _0x12b346;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x2f1163(0xf9)]=a25_0x2f1163(0x140);[a25_0x2f1163(0xe2)]=a25_0x2f1163(0x10b);async[a25_0x2f1163(0x112)](_0x134929){const _0x2aeae3=a25_0x2f1163,{options:_0x236368,args:_0x297c9b,tdx:_0x20fc12}=_0x134929,_0x1a9235=_0x297c9b[0x0];if(!_0x1a9235)return console[_0x2aeae3(0xd1)](_0x2aeae3(0x114)),console['error'](_0x2aeae3(0x141)),console[_0x2aeae3(0xd1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x2aeae3(0xd1)](_0x2aeae3(0x158)),console[_0x2aeae3(0xd1)](_0x2aeae3(0x131)),console[_0x2aeae3(0xd1)](_0x2aeae3(0x150)),0x1;try{const _0x47d479=_0x236368[_0x2aeae3(0x10d)],_0x467c79=await resolveSegmentTarget(_0x1a9235,_0x47d479,_0x236368[_0x2aeae3(0x157)]);_0x236368[_0x2aeae3(0x157)]&&console[_0x2aeae3(0xd1)]('Target\x20path:\x20'+_0x467c79);const _0x42e306=await withSpinner('Resolving\x20\x27'+_0x1a9235+_0x2aeae3(0xe7),()=>_0x20fc12[_0x2aeae3(0x126)]['resolvePathToResource'](_0x467c79),{'verbose':_0x236368[_0x2aeae3(0x157)]}),_0x15d9af=_0x42e306[_0x2aeae3(0xe3)];_0x236368[_0x2aeae3(0x157)]&&(console[_0x2aeae3(0xd1)](_0x2aeae3(0x11d)+_0x15d9af['type']),console[_0x2aeae3(0xd1)](_0x2aeae3(0xd2)+_0x15d9af[_0x2aeae3(0x117)]));if(_0x15d9af[_0x2aeae3(0x111)]===_0x2aeae3(0x125))return console['error'](_0x2aeae3(0x12f)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x15d9af['type']===_0x2aeae3(0x143))return console[_0x2aeae3(0xd1)](_0x2aeae3(0xd0)),console[_0x2aeae3(0xd1)](_0x2aeae3(0x134)),0x1;if(!_0x15d9af[_0x2aeae3(0x128)])throw new SDKError(ErrorCode[_0x2aeae3(0xdd)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5c3758=await withSpinner(_0x2aeae3(0x129),()=>_0x20fc12[_0x2aeae3(0x126)][_0x2aeae3(0x118)](_0x15d9af[_0x2aeae3(0x117)],_0x15d9af[_0x2aeae3(0x128)]),{'verbose':_0x236368['verbose']}),_0x3c8bd6=_0x5c3758[_0x2aeae3(0xe3)],_0x8f42ec=await executeSchemaQuery(_0x3c8bd6,_0x20fc12,_0x236368);return await handleQueryOutput(_0x8f42ec,_0x236368),0x0;}catch(_0x39be35){if(_0x39be35 instanceof SDKError)return console[_0x2aeae3(0xd1)]('Error:\x20'+_0x39be35[_0x2aeae3(0x146)]),_0x39be35[_0x2aeae3(0x11a)]&&console[_0x2aeae3(0xd1)](_0x2aeae3(0xd6)+_0x39be35['cause']),0x1;throw _0x39be35;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a26_0x4364(){const _0x11cbdf=['data','folder','error','139118VUtakQ','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','kind','resolvePathToResource','yellow','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','execute','type','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','includes','name','noCountPopulation','resolveParentId','Creating\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:create','verbose','Resolved\x20folder\x20ID:\x20','segments','parent','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x27...','length','8wEsleh','Examples:','129803WqbEJJ','site','Resolving\x20folder\x20path\x20\x27','27qKkEds','1333569dHdqnl','Target\x20path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolved\x20relative\x20path\x20to:\x20','rule','✔\x20Created\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Segment\x20name:\x20','invisible','ruleFile','Resolving\x20parent\x20segment\x20\x27','Parent\x20path:\x20','6829112mqHUKh','2686020UtIVQg','4501850HTSlPy','Site:\x20','segment','\x20\x20\x20Path:\x20','9294775yQnXOn'];a26_0x4364=function(){return _0x11cbdf;};return a26_0x4364();}const a26_0x2f7ef0=a26_0x212b;(function(_0x464f3d,_0x221547){const _0x13feb6=a26_0x212b,_0x4eb21b=_0x464f3d();while(!![]){try{const _0x31939c=parseInt(_0x13feb6(0xdc))/0x1+parseInt(_0x13feb6(0xc2))/0x2+-parseInt(_0x13feb6(0xe0))/0x3*(-parseInt(_0x13feb6(0xda))/0x4)+-parseInt(_0x13feb6(0xba))/0x5+-parseInt(_0x13feb6(0xb9))/0x6+-parseInt(_0x13feb6(0xbe))/0x7+-parseInt(_0x13feb6(0xb8))/0x8*(-parseInt(_0x13feb6(0xdf))/0x9);if(_0x31939c===_0x221547)break;else _0x4eb21b['push'](_0x4eb21b['shift']());}catch(_0x5bc11f){_0x4eb21b['push'](_0x4eb21b['shift']());}}}(a26_0x4364,0xeda94));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x2efe16 from'chalk';function a26_0x212b(_0x2dca2a,_0x24e558){_0x2dca2a=_0x2dca2a-0xb8;const _0x4364a5=a26_0x4364();let _0x212b7f=_0x4364a5[_0x2dca2a];return _0x212b7f;}export class SegmentCreateCommand extends BaseCommand{[a26_0x2f7ef0(0xcd)]=a26_0x2f7ef0(0xd2);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a26_0x2f7ef0(0xc9)](_0x2672ff){const _0x29763f=a26_0x2f7ef0;console[_0x29763f(0xc1)](a26_0x2efe16[_0x29763f(0xc7)](_0x29763f(0xe7))),console['error'](a26_0x2efe16[_0x29763f(0xc7)](_0x29763f(0xc8)));const {options:_0x2fc4d7,args:_0x12e402,tdx:_0x3e0738}=_0x2672ff,_0x197296=_0x2fc4d7;if(_0x12e402[_0x29763f(0xd9)]===0x0)return console[_0x29763f(0xc1)](_0x29763f(0xd1)),console[_0x29763f(0xc1)](_0x29763f(0xd7)),console[_0x29763f(0xc1)](_0x29763f(0xdb)),console[_0x29763f(0xc1)](_0x29763f(0xcb)),console[_0x29763f(0xc1)](_0x29763f(0xe6)),console[_0x29763f(0xc1)](_0x29763f(0xe2)),0x1;const _0x1e686c=_0x12e402[0x0],_0x58391e=_0x2fc4d7['segmentPath'];let _0x544435=_0x1e686c;_0x58391e&&!_0x1e686c[_0x29763f(0xcc)]('/')&&(_0x544435=_0x58391e+'/'+_0x1e686c,_0x197296[_0x29763f(0xd3)]&&console[_0x29763f(0xc1)](_0x29763f(0xe3)+_0x544435));const _0x5cb158=parsePath(_0x544435);if(_0x5cb158[_0x29763f(0xd5)][_0x29763f(0xd9)]<0x2)return console[_0x29763f(0xc1)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x29763f(0xc1)](_0x29763f(0xc3)),0x1;const _0x26a1bf=_0x5cb158[_0x29763f(0xd5)][0x0],_0x1fdd36=getBaseName(_0x544435),_0x28516b=getParentPath(_0x544435);_0x197296[_0x29763f(0xd3)]&&(console[_0x29763f(0xc1)](_0x29763f(0xbb)+_0x197296[_0x29763f(0xdd)]),console[_0x29763f(0xc1)](_0x29763f(0xe1)+_0x544435),console['error']('Parent:\x20'+_0x26a1bf),console[_0x29763f(0xc1)](_0x29763f(0xe8)+_0x1fdd36),console[_0x29763f(0xc1)](_0x29763f(0xec)+_0x28516b));const _0x29d21f=await withSpinner(_0x29763f(0xeb)+_0x26a1bf+_0x29763f(0xd8),()=>_0x3e0738[_0x29763f(0xbc)][_0x29763f(0xcf)](_0x26a1bf),{'verbose':_0x197296[_0x29763f(0xd3)]}),_0x492250=_0x29d21f[_0x29763f(0xbf)];let _0x1feb30;if(_0x5cb158[_0x29763f(0xd5)]['length']>0x2){const _0x228664=await withSpinner(_0x29763f(0xde)+_0x28516b+_0x29763f(0xd8),()=>_0x3e0738[_0x29763f(0xbc)][_0x29763f(0xc6)](_0x28516b),{'verbose':_0x197296[_0x29763f(0xd3)]}),_0x2b6aad=_0x228664[_0x29763f(0xbf)];if(_0x2b6aad[_0x29763f(0xca)]!==_0x29763f(0xc0)&&_0x2b6aad[_0x29763f(0xca)]!==_0x29763f(0xd6))return console['error'](_0x29763f(0xc4)),0x1;_0x1feb30=_0x2b6aad['folderId'];}else{if(_0x197296[_0x29763f(0xc0)]){const _0x4d2773=await withSpinner('Resolving\x20folder\x20\x27'+_0x197296[_0x29763f(0xc0)]+_0x29763f(0xd8),()=>_0x3e0738[_0x29763f(0xbc)]['resolveFolderId'](_0x492250,_0x197296[_0x29763f(0xc0)]),{'verbose':_0x197296[_0x29763f(0xd3)]});_0x1feb30=_0x4d2773['data'];}}_0x197296[_0x29763f(0xd3)]&&_0x1feb30&&console[_0x29763f(0xc1)](_0x29763f(0xd4)+_0x1feb30);const _0x352d0e=await loadJSONFromOptions(_0x197296[_0x29763f(0xe4)],_0x197296[_0x29763f(0xea)]),_0x20d109={'name':_0x1fdd36,'description':_0x197296['description'],'rule':_0x352d0e,'kind':_0x197296[_0x29763f(0xc5)]!==undefined?parseInt(_0x197296[_0x29763f(0xc5)],0xa):undefined,'isVisible':_0x197296[_0x29763f(0xe9)]?![]:undefined,'segmentFolderId':_0x1feb30,'countPopulation':_0x197296[_0x29763f(0xce)]?![]:undefined},_0xaed948=await withSpinner(_0x29763f(0xd0)+_0x1fdd36+_0x29763f(0xd8),()=>_0x3e0738[_0x29763f(0xbc)]['createSegment'](_0x492250,_0x20d109),{'verbose':_0x197296[_0x29763f(0xd3)]}),_0x33b5ac=_0xaed948['data'];return console[_0x29763f(0xc1)](_0x29763f(0xe5)+_0x33b5ac[_0x29763f(0xcd)]+'\x27\x20with\x20ID:\x20'+_0x33b5ac['id']),_0x544435!==_0x1e686c&&console[_0x29763f(0xc1)](_0x29763f(0xbd)+_0x544435),await handleSDKOutput([_0x33b5ac],_0x197296),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x249ebb=a27_0x4e5b;(function(_0x3b6b4f,_0x57d29e){const _0x1e7426=a27_0x4e5b,_0x5ca4ab=_0x3b6b4f();while(!![]){try{const _0x1c2682=-parseInt(_0x1e7426(0x1ad))/0x1+-parseInt(_0x1e7426(0x1a7))/0x2+parseInt(_0x1e7426(0x1a5))/0x3+-parseInt(_0x1e7426(0x1b3))/0x4+-parseInt(_0x1e7426(0x1ab))/0x5*(-parseInt(_0x1e7426(0x1b9))/0x6)+-parseInt(_0x1e7426(0x1b8))/0x7+parseInt(_0x1e7426(0x1ac))/0x8;if(_0x1c2682===_0x57d29e)break;else _0x5ca4ab['push'](_0x5ca4ab['shift']());}catch(_0x1e3f10){_0x5ca4ab['push'](_0x5ca4ab['shift']());}}}(a27_0x3112,0x448a2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a27_0x4e5b(_0x556994,_0x488775){_0x556994=_0x556994-0x1a5;const _0x311250=a27_0x3112();let _0x4e5b13=_0x311250[_0x556994];return _0x4e5b13;}function a27_0x3112(){const _0xc02655=['segment:fields','1133613xMLCWM','length','526274PDIoJQ','Listing\x20fields\x20for\x20\x27','✔\x20Found\x20','error','25HfZlnD','7693880bnYnNk','382929uMTKjo','Parent\x20segment:\x20','Site:\x20','verbose','listFields','name','2013836azsYCi','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','parentSegment','\x20field','\x27...','1145956WIEFhW','305238WMBwQD','jsonl','data','Error:\x20Parent\x20segment\x20name\x20is\x20required'];a27_0x3112=function(){return _0xc02655;};return a27_0x3112();}export class SegmentFieldsCommand extends BaseCommand{[a27_0x249ebb(0x1b2)]=a27_0x249ebb(0x1bd);['description']='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x4536b3){const _0x57e5a2=a27_0x249ebb,{options:_0x147763,args:_0x383e2d,tdx:_0x58ceec}=_0x4536b3,_0x35ef14=_0x383e2d[0x0]||_0x147763[_0x57e5a2(0x1b5)];if(!_0x35ef14)return console['error'](_0x57e5a2(0x1bc)),console[_0x57e5a2(0x1aa)](_0x57e5a2(0x1b4)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x147763[_0x57e5a2(0x1b0)]&&(console['error'](_0x57e5a2(0x1af)+_0x147763['site']),console['error'](_0x57e5a2(0x1ae)+_0x35ef14));const _0x3f99c0=await withSpinner(_0x57e5a2(0x1a8)+_0x35ef14+_0x57e5a2(0x1b7),()=>_0x58ceec['segment'][_0x57e5a2(0x1b1)](_0x35ef14),{'verbose':_0x147763[_0x57e5a2(0x1b0)]}),_0x7847f5=_0x3f99c0[_0x57e5a2(0x1bb)];console[_0x57e5a2(0x1aa)](_0x57e5a2(0x1a9)+_0x7847f5[_0x57e5a2(0x1a6)]+_0x57e5a2(0x1b6)+(_0x7847f5['length']!==0x1?'s':''));if(_0x147763['json']||_0x147763[_0x57e5a2(0x1ba)])return await handleSDKOutput(_0x7847f5,_0x147763),0x0;return displayFieldsHumanReadable(_0x7847f5,_0x35ef14),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x3ed71c=a28_0x32cb;(function(_0x2a0c74,_0x26308f){const _0x204d8e=a28_0x32cb,_0x1afbb2=_0x2a0c74();while(!![]){try{const _0x340336=parseInt(_0x204d8e(0x153))/0x1*(-parseInt(_0x204d8e(0x17b))/0x2)+parseInt(_0x204d8e(0x15e))/0x3+parseInt(_0x204d8e(0x177))/0x4*(parseInt(_0x204d8e(0x172))/0x5)+parseInt(_0x204d8e(0x150))/0x6+-parseInt(_0x204d8e(0x155))/0x7*(parseInt(_0x204d8e(0x16b))/0x8)+-parseInt(_0x204d8e(0x168))/0x9+parseInt(_0x204d8e(0x13e))/0xa;if(_0x340336===_0x26308f)break;else _0x1afbb2['push'](_0x1afbb2['shift']());}catch(_0x5367e1){_0x1afbb2['push'](_0x1afbb2['shift']());}}}(a28_0x5389,0x631bb));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x814fba from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x5ea434 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x5389(){const _0xae11f=['parentSegment','Site:\x20','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','message','dim','red','no_parent','dirname','Aborted.','\x20journeys','name','parentName','\x20files?','filter','length','isNew','4349080TEFyTG','\x20with\x20','setPhase','Target\x20resource:\x20','files','green','yes','repeat','journeys','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','execute','diff','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20segments','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)','content','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','counts','3595314sQCqgb','errorCode','Pulling\x20segments\x20from\x20\x27','26wxfgdM','\x20\x20Target:\x20','55643SudkRz','activations','✔\x20Pulled\x20','pullSegments','dryRun','file','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aPull\x20summary\x20for\x20\x27','data','2431833zmUNVh','✔\x20Context\x20set:\x20','\x20new\x20files','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','absolutePath','\x20\x20🗺️\x20\x20','\x0aChanges\x20to\x20\x27','type','Error:\x20','cyan','5357349LJFiwb','relativePath','session','232jfQMSs','targetDir','\x20activations','verbose','\x20=\x20','journeyVersions','helpText','25eHeaxO','parent_segment','\x20changed\x20files','segments','segment:pull','91244ObJsEY','resourceName','\x20unchanged\x20files','hasChanges','55928OKrdFS','utf-8','error'];a28_0x5389=function(){return _0xae11f;};return a28_0x5389();}function a28_0x32cb(_0x113e16,_0x5edf4c){_0x113e16=_0x113e16-0x138;const _0x538953=a28_0x5389();let _0x32cb40=_0x538953[_0x113e16];return _0x32cb40;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0x3ed71c(0x138)]=a28_0x3ed71c(0x176);['description']=a28_0x3ed71c(0x161);async[a28_0x3ed71c(0x148)](_0x15e600){const _0x4220bd=a28_0x3ed71c,{options:_0x36b7ad,args:_0x559620,tdx:_0x54f2b4}=_0x15e600,_0x300f45=_0x36b7ad,_0x560c60=await resolveTarget({'arg':_0x559620[0x0],'contextParent':_0x36b7ad[_0x4220bd(0x17e)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x560c60))return _0x560c60[_0x4220bd(0x151)]===_0x4220bd(0x185)?(console[_0x4220bd(0x17d)](a28_0x814fba[_0x4220bd(0x180)](_0x4220bd(0x14e))),console[_0x4220bd(0x17d)](_0x4220bd(0x14c)),console['error'](_0x4220bd(0x181)),console['error'](_0x4220bd(0x14a))):(console['error'](a28_0x814fba[_0x4220bd(0x184)](_0x4220bd(0x166)+_0x560c60[_0x4220bd(0x182)]+'\x0a')),_0x560c60[_0x4220bd(0x171)]&&console['error'](a28_0x814fba[_0x4220bd(0x167)](_0x560c60[_0x4220bd(0x171)]))),0x1;const _0x3cb7aa=_0x560c60[_0x4220bd(0x139)],_0x3f04f1=_0x560c60[_0x4220bd(0x16c)],_0xf8a1de=_0x560c60[_0x4220bd(0x165)]===_0x4220bd(0x15a)?_0x560c60[_0x4220bd(0x178)]:undefined;_0x300f45[_0x4220bd(0x16e)]&&(console[_0x4220bd(0x17d)](_0x4220bd(0x17f)+_0x300f45['site']),console[_0x4220bd(0x17d)]('Parent\x20segment:\x20'+_0x3cb7aa),_0xf8a1de&&console[_0x4220bd(0x17d)](_0x4220bd(0x141)+_0xf8a1de));const _0x200272=await withProgressSpinner(_0x4220bd(0x152)+_0x3cb7aa+'\x27...',_0x2e038f=>_0x54f2b4['segment'][_0x4220bd(0x158)](_0x3cb7aa,{'targetDir':_0x3f04f1,'targetResourceName':_0xf8a1de,'verbose':_0x300f45[_0x4220bd(0x16e)],'progress':{'update':_0x7416cd=>{const _0x127663=_0x4220bd;_0x2e038f[_0x127663(0x140)](_0x7416cd),_0x300f45[_0x127663(0x16e)]&&console[_0x127663(0x17d)]('\x20\x20'+_0x7416cd);}}}),{'verbose':_0x300f45[_0x4220bd(0x16e)]}),_0x4bf635=_0x200272[_0x4220bd(0x15d)];if(_0x4bf635[_0x4220bd(0x14f)][_0x4220bd(0x175)]===0x0&&_0x4bf635[_0x4220bd(0x14f)][_0x4220bd(0x146)]===0x0)return console[_0x4220bd(0x17d)](a28_0x814fba[_0x4220bd(0x180)](_0x4220bd(0x147)+_0x4bf635[_0x4220bd(0x139)]+'\x27')),0x0;const _0x5e997a=_0x4bf635[_0x4220bd(0x142)][_0x4220bd(0x13b)](_0x454f32=>_0x454f32[_0x4220bd(0x13d)]),_0x1d5c46=_0x4bf635[_0x4220bd(0x142)]['filter'](_0x3f0353=>!_0x3f0353[_0x4220bd(0x13d)]&&_0x3f0353[_0x4220bd(0x17a)]),_0x267aed=_0x4bf635[_0x4220bd(0x142)][_0x4220bd(0x13b)](_0x52867f=>!_0x52867f[_0x4220bd(0x13d)]&&!_0x52867f[_0x4220bd(0x17a)]);console[_0x4220bd(0x17d)](_0x4220bd(0x15c)+_0x4bf635[_0x4220bd(0x139)]+'\x27:'),console['error']('\x20\x20🎯\x20'+a28_0x814fba['cyan'](_0x4bf635['counts']['segments']+_0x4220bd(0x14b))+_0x4220bd(0x13f)+a28_0x814fba[_0x4220bd(0x167)](_0x4bf635[_0x4220bd(0x14f)][_0x4220bd(0x156)]+_0x4220bd(0x16d)));if(_0x4bf635[_0x4220bd(0x14f)]['journeys']>0x0){const _0x31fb19=_0x4bf635['counts'][_0x4220bd(0x170)]>_0x4bf635[_0x4220bd(0x14f)]['journeys']?'\x20('+_0x4bf635['counts'][_0x4220bd(0x170)]+'\x20versions)':'';console[_0x4220bd(0x17d)](_0x4220bd(0x163)+a28_0x814fba[_0x4220bd(0x167)](_0x4bf635[_0x4220bd(0x14f)][_0x4220bd(0x146)]+_0x4220bd(0x188))+a28_0x814fba['dim'](_0x31fb19));}console[_0x4220bd(0x17d)]('\x20\x20'+a28_0x814fba['green']('+\x20'+_0x5e997a[_0x4220bd(0x13c)]+_0x4220bd(0x160))),console[_0x4220bd(0x17d)]('\x20\x20'+a28_0x814fba[_0x4220bd(0x180)]('~\x20'+_0x1d5c46['length']+_0x4220bd(0x174))),console['error']('\x20\x20'+a28_0x814fba[_0x4220bd(0x183)]('=\x20'+_0x267aed[_0x4220bd(0x13c)]+_0x4220bd(0x179))),console[_0x4220bd(0x17d)](_0x4220bd(0x154)+a28_0x814fba[_0x4220bd(0x167)](_0x4bf635[_0x4220bd(0x16c)])+'\x0a');if(_0x1d5c46['length']>0x0)for(const _0x1c3b5b of _0x1d5c46){console[_0x4220bd(0x17d)](_0x4220bd(0x164)+_0x1c3b5b[_0x4220bd(0x169)]+'\x27:'),console[_0x4220bd(0x17d)]('─'[_0x4220bd(0x145)](0x3c)),console[_0x4220bd(0x17d)](_0x1c3b5b[_0x4220bd(0x149)]),console[_0x4220bd(0x17d)]('─'['repeat'](0x3c));}if(_0x300f45[_0x4220bd(0x159)])return console['error'](a28_0x814fba[_0x4220bd(0x180)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5e997a[_0x4220bd(0x13c)]===0x0&&_0x1d5c46[_0x4220bd(0x13c)]===0x0)return console[_0x4220bd(0x17d)](a28_0x814fba[_0x4220bd(0x143)](_0x4220bd(0x15b))),saveSessionContext({'parent_segment':_0x4bf635[_0x4220bd(0x139)]},_0x300f45['session']),console[_0x4220bd(0x17d)](a28_0x814fba[_0x4220bd(0x143)](_0x4220bd(0x15f)+a28_0x814fba[_0x4220bd(0x183)](_0x4220bd(0x173))+_0x4220bd(0x16f)+a28_0x814fba[_0x4220bd(0x167)](_0x4bf635['parentName']))),0x0;if(!_0x300f45[_0x4220bd(0x144)]){const _0x1a38d8=await confirmKey('Write\x20'+(_0x5e997a['length']+_0x1d5c46[_0x4220bd(0x13c)])+_0x4220bd(0x13a));if(!_0x1a38d8)return console['error'](_0x4220bd(0x187)),0x1;}for(const _0x4fc8a1 of _0x4bf635['files']){if(_0x4fc8a1[_0x4220bd(0x13d)]||_0x4fc8a1[_0x4220bd(0x17a)]){const _0x4720e9=a28_0x5ea434[_0x4220bd(0x186)](_0x4fc8a1[_0x4220bd(0x162)]);!existsSync(_0x4720e9)&&mkdirSync(_0x4720e9,{'recursive':!![]}),writeFileSync(_0x4fc8a1[_0x4220bd(0x162)],_0x4fc8a1[_0x4220bd(0x14d)],_0x4220bd(0x17c));}}return console['error'](a28_0x814fba[_0x4220bd(0x143)](_0x4220bd(0x157)+(_0x5e997a[_0x4220bd(0x13c)]+_0x1d5c46[_0x4220bd(0x13c)])+'\x20files\x20to\x20'+_0x4bf635['targetDir'])),saveSessionContext({'parent_segment':_0x4bf635[_0x4220bd(0x139)]},_0x300f45[_0x4220bd(0x16a)]),console[_0x4220bd(0x17d)](a28_0x814fba[_0x4220bd(0x143)](_0x4220bd(0x15f)+a28_0x814fba['dim'](_0x4220bd(0x173))+'\x20=\x20'+a28_0x814fba[_0x4220bd(0x167)](_0x4bf635[_0x4220bd(0x139)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x5bc6b1=a29_0x54ea;(function(_0x16d951,_0x1d825a){const _0x4f5ed6=a29_0x54ea,_0xe3dd89=_0x16d951();while(!![]){try{const _0x314671=parseInt(_0x4f5ed6(0x1f0))/0x1*(parseInt(_0x4f5ed6(0x1b2))/0x2)+-parseInt(_0x4f5ed6(0x19f))/0x3+-parseInt(_0x4f5ed6(0x1f9))/0x4+parseInt(_0x4f5ed6(0x203))/0x5*(-parseInt(_0x4f5ed6(0x22b))/0x6)+parseInt(_0x4f5ed6(0x1dd))/0x7*(-parseInt(_0x4f5ed6(0x214))/0x8)+-parseInt(_0x4f5ed6(0x1bd))/0x9*(-parseInt(_0x4f5ed6(0x1d0))/0xa)+-parseInt(_0x4f5ed6(0x1a9))/0xb*(-parseInt(_0x4f5ed6(0x1b7))/0xc);if(_0x314671===_0x1d825a)break;else _0xe3dd89['push'](_0xe3dd89['shift']());}catch(_0x4503cc){_0xe3dd89['push'](_0xe3dd89['shift']());}}}(a29_0x5e11,0x59cf7));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_0x11d044 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a29_0x54ea(_0x29629f,_0x52e655){_0x29629f=_0x29629f-0x197;const _0x5e11c3=a29_0x5e11();let _0x54eacc=_0x5e11c3[_0x29629f];return _0x54eacc;}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']='segment:push';['description']=a29_0x5bc6b1(0x19d);async[a29_0x5bc6b1(0x227)](_0x369b04){const _0x55bd93=a29_0x5bc6b1,{options:_0x4b6c02,args:_0x344b45,tdx:_0x5724a4}=_0x369b04,_0xd05e91=_0x4b6c02,_0x1e4652=await resolveTarget({'arg':_0x344b45[0x0],'contextParent':_0x4b6c02['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1e4652))return _0x1e4652[_0x55bd93(0x1cc)]===_0x55bd93(0x1d8)?(console[_0x55bd93(0x1ab)](a29_0x11d044['yellow'](_0x55bd93(0x219))),console[_0x55bd93(0x1ab)](_0x55bd93(0x1f5)),console['error'](_0x55bd93(0x1e0)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x1b8)+_0x1e4652[_0x55bd93(0x1cb)]+'\x0a')),_0x1e4652['helpText']&&console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x21d)](_0x1e4652[_0x55bd93(0x1eb)]))),0x1;if(_0x1e4652[_0x55bd93(0x1ac)]===_0x55bd93(0x1d2))return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x223)+_0x1e4652['targetDir']+'\x0a')),console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x21d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x51ebe3=_0x1e4652[_0x55bd93(0x1be)],_0x503009=_0x1e4652[_0x55bd93(0x211)],_0x4c23c1=_0x1e4652['type']==='file'?_0x1e4652[_0x55bd93(0x217)]:undefined,_0x4bb1f4=getScopedDetails(_0x1e4652),_0x58d0cd=_0x4bb1f4?.[_0x55bd93(0x1e7)]??![],_0x51374a=_0x4bb1f4?.['scopedFolderPath']??'';if(!existsSync(_0x503009))return console['error'](a29_0x11d044[_0x55bd93(0x221)]('Error:\x20Directory\x20not\x20found:\x20'+_0x503009+'\x0a')),console['error'](a29_0x11d044[_0x55bd93(0x21d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0xd05e91[_0x55bd93(0x21b)]&&(console[_0x55bd93(0x1ab)]('Site:\x20'+_0xd05e91[_0x55bd93(0x1c3)]),console[_0x55bd93(0x1ab)](_0x55bd93(0x218)+_0x51ebe3),console[_0x55bd93(0x1ab)](_0x55bd93(0x20c)+_0x503009),_0x58d0cd&&console[_0x55bd93(0x1ab)](_0x55bd93(0x19a)+_0x51374a));const _0x1a274f=await withSpinner(_0x55bd93(0x1bb)+_0x51ebe3+'\x27...',()=>_0x5724a4[_0x55bd93(0x205)]['resolveParentId'](_0x51ebe3),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),_0x2775d9=_0x1a274f[_0x55bd93(0x212)],[_0x151a74,_0x2b5bc3,_0x3f7402,_0x24e900,_0x255c10]=await Promise[_0x55bd93(0x1a3)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x5724a4[_0x55bd93(0x205)][_0x55bd93(0x1fa)](_0x2775d9),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),withSpinner(_0x55bd93(0x222),()=>_0x5724a4['segment'][_0x55bd93(0x1ce)](_0x2775d9),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x5724a4['segment']['listFolders'](_0x2775d9),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),withSpinner(_0x55bd93(0x1ed),()=>_0x5724a4[_0x55bd93(0x1f2)]['listJourneysWithDetailsFromParentSegment'](_0x2775d9,{'includeAllVersions':!![]}),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x5724a4['user'][_0x55bd93(0x1a5)](),{'verbose':_0xd05e91['verbose']})[_0x55bd93(0x1b4)](_0x2e5f67=>_0x2e5f67['data'])]),_0xe9a349=_0x151a74['data'],_0x38fa44=extractRootFolderId(_0xe9a349),_0x5ca255=_0x2b5bc3['data'],_0x1e2cdd=_0x3f7402['data'],{journeys:_0x51c183,activationStepsById:_0x4c9399}=_0x24e900[_0x55bd93(0x212)],_0x3f3994=new Map(_0x51c183[_0x55bd93(0x1d6)](_0x155953=>[_0x155953['id'],_0x155953])),_0x1713a2=_0x51c183['map'](_0x34c1ed=>({'id':_0x34c1ed['id'],'name':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1d7)],'journeyBundleName':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1e6)]||'','journeyBundleId':_0x34c1ed['attributes']['journeyBundleId']||'','versionNumber':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1cf)],'description':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1a1)],'state':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1f6)],'paused':_0x34c1ed['attributes'][_0x55bd93(0x1d1)],'audienceId':_0x34c1ed['attributes']['audienceId'],'folderId':_0x34c1ed[_0x55bd93(0x1af)]?.[_0x55bd93(0x1ea)]?.[_0x55bd93(0x212)]?.['id'],'createdAt':_0x34c1ed[_0x55bd93(0x1ec)]['createdAt'],'updatedAt':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x213)]})),{emailToId:_0x2c9624,idToEmail:_0x450788}=_0x255c10,_0x276610=await withSpinner(_0x55bd93(0x21e),async()=>{const _0x481e75=_0x55bd93,_0x7bb18=await _0x5724a4['connection'][_0x481e75(0x209)]();return buildConnectionMaps(_0x7bb18);},{'verbose':_0xd05e91[_0x55bd93(0x21b)]})[_0x55bd93(0x1b4)](_0x4897d5=>_0x4897d5[_0x55bd93(0x212)]),_0x82e01=_0x276610['nameToId'],_0x128629=_0x276610[_0x55bd93(0x1ad)],_0x516111=_0x276610[_0x55bd93(0x210)],_0x318a23={'emailToIdMap':_0x2c9624,'connectionNameToIdMap':_0x82e01,'connectionNameToTypeMap':_0x516111,'getSchema':_0x56cc8c=>_0x5724a4[_0x55bd93(0x1f7)][_0x55bd93(0x201)](_0x56cc8c)};let {pathToId:_0x32d12e,idToPath:_0x2e73a9}=buildFolderMaps(_0x1e2cdd);const _0xfc0b2b=buildSegmentLookupMap(_0x5ca255,_0x2e73a9),_0x5cc728=buildSegmentNameToIdMap(_0x5ca255),_0x3b8ddb=buildJourneyBundleLookupMap(_0x1713a2,_0x2e73a9);let _0x41cc22;if(_0x4c23c1){if(!_0x4c23c1[_0x55bd93(0x1f1)](_0x55bd93(0x1c6))&&!_0x4c23c1[_0x55bd93(0x1f1)](_0x55bd93(0x21c)))return console['error'](a29_0x11d044['red'](_0x55bd93(0x1c2)+_0x4c23c1+'\x0a')),0x1;_0x41cc22=[_0x4c23c1];}else _0x41cc22=findYamlFiles(_0x503009);if(_0x41cc22['length']===0x0)return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x1c4)+_0x503009+'\x0a')),console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x21d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x38122f,_0x1900f2;try{const _0x15b8e3=parseAndClassifyYamlFiles(_0x41cc22,_0x503009,{'skipSegments':_0xd05e91[_0x55bd93(0x1db)]});_0x38122f=_0x15b8e3[_0x55bd93(0x1c7)],_0x1900f2=_0x15b8e3[_0x55bd93(0x199)];const _0xe1f323=validateParsedFiles(_0x15b8e3,_0x503009);if(_0xe1f323[_0x55bd93(0x197)]>0x0)return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)]('\x0aValidation\x20failed:')),console[_0x55bd93(0x1ab)](formatValidationErrors(_0xe1f323)),console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)](_0x55bd93(0x229))),0x1;}catch(_0x35902d){return console[_0x55bd93(0x1ab)](a29_0x11d044['red'](_0x55bd93(0x1f3)+(_0x35902d instanceof Error?_0x35902d['message']:_0x35902d))),0x1;}if(_0x38122f[_0x55bd93(0x197)]===0x0&&_0x1900f2[_0x55bd93(0x197)]===0x0){const _0x21eed8=_0xd05e91[_0x55bd93(0x1db)]?'journey':_0x55bd93(0x1de);return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)]('No\x20'+_0x21eed8+_0x55bd93(0x207))),0x0;}const _0xf620bf=new Map();_0x5ca255[_0x55bd93(0x197)]>0x0&&!_0xd05e91['journeysOnly']&&await withSpinner(_0x55bd93(0x1c8),async()=>{await batchAsync(_0x5ca255,async _0x1452aa=>{const _0x3d9548=a29_0x54ea,_0x486419=await _0x5724a4[_0x3d9548(0x205)][_0x3d9548(0x1e3)](_0x2775d9,_0x1452aa['id']);_0xf620bf['set'](_0x1452aa['id'],_0x486419);});},{'verbose':_0xd05e91['verbose']});const {segmentFiles:_0x50b087,foldersToCreate:_0x51db61}=await prepareSegmentFiles(_0x38122f,{'segmentByFolderAndName':_0xfc0b2b,'activationsBySegmentId':_0xf620bf,'folderPathToId':_0x32d12e,'idToEmailMap':_0x450788,'connectionIdToNameMap':_0x128629},_0x318a23,_0x58d0cd,_0x51374a),_0x577c3b=_0x4c23c1?[]:findSegmentsToDelete(_0x5ca255,_0x38122f[_0x55bd93(0x1d6)](({yamlConfig:_0x50662c,folderPath:_0x3b7c23})=>({'yamlConfig':_0x50662c,'folderPath':resolveTDFolderPath(_0x3b7c23,_0x58d0cd,_0x51374a)})),_0x2e73a9,_0x51374a,_0x58d0cd),{journeyFiles:_0x422465,foldersToCreate:_0x3f3948}=await withProgressSpinner('Preparing\x20journeys...',async _0x2d3f03=>prepareJourneyFiles(_0x1900f2,{'fetchJourney':async _0x106746=>_0x5724a4[_0x55bd93(0x1f2)][_0x55bd93(0x1c1)](_0x106746[_0x55bd93(0x1bc)]),'journeyBundlesByFolderAndName':_0x3b8ddb,'folderPathToId':_0x32d12e,'idToEmailMap':_0x450788,'connectionIdToNameMap':_0x128629,'existingSegments':_0x5ca255,'parentId':_0x2775d9,'deps':_0x5724a4,'progress':{'update':_0x25801a=>{const _0x53dc1a=_0x55bd93;_0x2d3f03[_0x53dc1a(0x1e4)](_0x25801a),_0xd05e91[_0x53dc1a(0x21b)]&&console['error']('\x20\x20'+_0x25801a);}},'journeyById':_0x3f3994,'activationStepsById':_0x4c9399},_0x58d0cd,_0x51374a),{'verbose':_0xd05e91['verbose']})['then'](_0x5b7dd1=>_0x5b7dd1[_0x55bd93(0x212)]);for(const _0x22bd26 of _0x3f3948){_0x51db61[_0x55bd93(0x225)](_0x22bd26);}const _0x24539d=_0x4c23c1?[]:findJourneysToDelete(_0x1713a2,_0x1900f2[_0x55bd93(0x1d6)](({yamlConfig:_0x482fe3,folderPath:_0xbb0837})=>({'yamlConfig':_0x482fe3,'folderPath':resolveTDFolderPath(_0xbb0837,_0x58d0cd,_0x51374a)})),_0x2e73a9,_0x51374a,_0x58d0cd),_0x5f3431=calculatePushStats(_0x50b087,_0x422465,_0x51db61,_0x577c3b,_0x24539d,!!_0xd05e91[_0x55bd93(0x1e9)],!!_0xd05e91['journeysOnly']),_0x417158=_0x5f3431[_0x55bd93(0x1c7)]['new'],_0x472cd0=_0x5f3431[_0x55bd93(0x1c7)][_0x55bd93(0x1cd)],_0x23b739=_0x5f3431['segments'][_0x55bd93(0x224)],_0x37c8b8=_0x5f3431['segments'][_0x55bd93(0x1f4)],_0xce5a5a=_0x5f3431[_0x55bd93(0x1ee)][_0x55bd93(0x1fe)],_0x303f33=_0x5f3431['journeys']['new'],_0x351e61=_0x5f3431[_0x55bd93(0x199)][_0x55bd93(0x1cd)],_0x52c6fd=_0x5f3431[_0x55bd93(0x199)]['unchanged'],_0x447d64=_0x5f3431['journeys']['toDelete'],_0x5bb84f=_0x5f3431[_0x55bd93(0x1c9)][_0x55bd93(0x1a3)],_0x860a3c=_0x5f3431[_0x55bd93(0x1c9)][_0x55bd93(0x1fe)],_0x5359f7=_0x5f3431[_0x55bd93(0x1c9)][_0x55bd93(0x1dc)],_0x6196aa=_0x5f3431[_0x55bd93(0x1c9)][_0x55bd93(0x1f4)];console[_0x55bd93(0x1ab)](_0x55bd93(0x21f)+_0x51ebe3+'\x27:');_0xce5a5a[_0x55bd93(0x197)]>0x0&&console[_0x55bd93(0x1ab)]('\x20\x20'+a29_0x11d044[_0x55bd93(0x20e)]('📁\x20'+_0xce5a5a[_0x55bd93(0x197)]+_0x55bd93(0x1ae)));if(!_0xd05e91[_0x55bd93(0x1db)]){console[_0x55bd93(0x1ab)](_0x55bd93(0x21a)),console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['green']('+\x20'+_0x417158[_0x55bd93(0x197)]+_0x55bd93(0x1c0))),console['error'](_0x55bd93(0x226)+a29_0x11d044[_0x55bd93(0x20d)]('~\x20'+_0x472cd0['length']+_0x55bd93(0x1c5)));if(_0x37c8b8[_0x55bd93(0x197)]>0x0)console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['red']('-\x20'+_0x37c8b8[_0x55bd93(0x197)]+_0x55bd93(0x1b9)));else _0x577c3b[_0x55bd93(0x197)]>0x0&&!_0xd05e91[_0x55bd93(0x1e9)]&&console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['dim'](_0x577c3b[_0x55bd93(0x197)]+_0x55bd93(0x1b5)));console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044[_0x55bd93(0x1f8)]('=\x20'+_0x23b739['length']+'\x20unchanged'));}if(_0x422465[_0x55bd93(0x197)]>0x0||_0x24539d[_0x55bd93(0x197)]>0x0){console[_0x55bd93(0x1ab)](_0x55bd93(0x1aa)),console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['green']('+\x20'+_0x303f33[_0x55bd93(0x197)]+_0x55bd93(0x1c0))),console['error'](_0x55bd93(0x226)+a29_0x11d044['yellow']('~\x20'+_0x351e61[_0x55bd93(0x197)]+'\x20changed'));if(_0x447d64[_0x55bd93(0x197)]>0x0)console['error']('\x20\x20\x20\x20'+a29_0x11d044[_0x55bd93(0x221)]('-\x20'+_0x447d64[_0x55bd93(0x197)]+_0x55bd93(0x1b9)));else _0x24539d[_0x55bd93(0x197)]>0x0&&!_0xd05e91[_0x55bd93(0x1e9)]&&console['error'](_0x55bd93(0x226)+a29_0x11d044[_0x55bd93(0x1f8)](_0x24539d[_0x55bd93(0x197)]+_0x55bd93(0x1b5)));console[_0x55bd93(0x1ab)]('\x20\x20\x20\x20'+a29_0x11d044[_0x55bd93(0x1f8)]('=\x20'+_0x52c6fd[_0x55bd93(0x197)]+_0x55bd93(0x1df)));}_0x5bb84f[_0x55bd93(0x197)]>0x0&&!_0xd05e91['journeysOnly']&&(console[_0x55bd93(0x1ab)](''),console[_0x55bd93(0x1ab)](_0x55bd93(0x1d4)),_0x860a3c['length']>0x0&&console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044[_0x55bd93(0x1d5)]('+\x20'+_0x860a3c[_0x55bd93(0x197)]+_0x55bd93(0x19e))),_0x5359f7[_0x55bd93(0x197)]>0x0&&console[_0x55bd93(0x1ab)]('\x20\x20\x20\x20'+a29_0x11d044[_0x55bd93(0x20d)]('~\x20'+_0x5359f7[_0x55bd93(0x197)]+_0x55bd93(0x1ff))),_0x6196aa[_0x55bd93(0x197)]>0x0&&console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['red']('-\x20'+_0x6196aa[_0x55bd93(0x197)]+_0x55bd93(0x1b9))));console[_0x55bd93(0x1ab)]('\x20\x20Source:\x20'+a29_0x11d044[_0x55bd93(0x21d)](_0x503009)+'\x0a');if(_0xce5a5a[_0x55bd93(0x197)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x4a3590 of _0xce5a5a){console[_0x55bd93(0x1ab)]('\x20\x20'+a29_0x11d044[_0x55bd93(0x20e)]('+')+'\x20'+_0x4a3590);}console[_0x55bd93(0x1ab)]('');}if(_0x417158['length']>0x0&&!_0xd05e91[_0x55bd93(0x1db)])for(const _0x399057 of _0x417158){const _0x4d774b=_0x399057[_0x55bd93(0x1da)]?_0x399057[_0x55bd93(0x1da)]+'/'+_0x399057[_0x55bd93(0x1e8)][_0x55bd93(0x1d7)]:_0x399057[_0x55bd93(0x1e8)]['name'],_0x58057c=_0x399057[_0x55bd93(0x1e8)][_0x55bd93(0x1c9)]?.[_0x55bd93(0x197)]||0x0,_0x430702=_0x58057c>0x0?a29_0x11d044['dim']('\x20['+_0x58057c+'\x20activations]'):'';console['error']('\x0a'+a29_0x11d044[_0x55bd93(0x1d5)](_0x55bd93(0x1e2))+'\x20'+_0x4d774b+_0x430702),console[_0x55bd93(0x1ab)]('─'['repeat'](0x3c)),_0x399057[_0x55bd93(0x1fb)]&&console['error'](_0x399057['diff']),console[_0x55bd93(0x1ab)]('─'['repeat'](0x3c));}if(_0x37c8b8[_0x55bd93(0x197)]>0x0&&!_0xd05e91['journeysOnly'])for(const _0x212c81 of _0x37c8b8){const _0x196190=_0x212c81[_0x55bd93(0x200)]?_0x2e73a9[_0x55bd93(0x1b1)](_0x212c81[_0x55bd93(0x200)][_0x55bd93(0x1ef)]())||'':'',_0x1ceee2=_0x196190?_0x196190+'/'+_0x212c81[_0x55bd93(0x1d7)]:_0x212c81[_0x55bd93(0x1d7)],_0x7276b7=_0xf620bf[_0x55bd93(0x1b1)](_0x212c81['id'])||[],_0x199523=_0x7276b7[_0x55bd93(0x197)]>0x0?a29_0x11d044['dim']('\x20['+_0x7276b7[_0x55bd93(0x197)]+'\x20activations]'):'';console[_0x55bd93(0x1ab)]('\x0a'+a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x19c))+'\x20'+_0x1ceee2+_0x199523),console['error']('─'[_0x55bd93(0x204)](0x3c));const _0x432a37=segmentWithActivationsToYaml(_0x212c81,_0x7276b7,undefined,_0x450788,_0x128629),_0x30dded=segmentToYamlString(_0x432a37),_0x5b9e38=generateDiff(_0x30dded,'');console['error'](formatDiffWithColors(_0x5b9e38)),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}const _0x2075cc=_0x50b087['filter'](_0x275fcb=>!_0x275fcb['isNew']&&_0x275fcb['diff']);if(_0x2075cc[_0x55bd93(0x197)]>0x0&&!_0xd05e91['journeysOnly'])for(const _0x472bfd of _0x2075cc){const _0x5dd3a1=_0x472bfd[_0x55bd93(0x1da)]?_0x472bfd['folderPath']+'/'+_0x472bfd[_0x55bd93(0x1e8)][_0x55bd93(0x1d7)]:_0x472bfd['yamlConfig'][_0x55bd93(0x1d7)];console[_0x55bd93(0x1ab)]('\x0a'+a29_0x11d044[_0x55bd93(0x20d)](_0x55bd93(0x1b3))+'\x20'+_0x5dd3a1),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c)),console[_0x55bd93(0x1ab)](_0x472bfd[_0x55bd93(0x1fb)]),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}if(_0x303f33['length']>0x0)for(const _0x23600d of _0x303f33){const _0x316bff=_0x23600d[_0x55bd93(0x1da)]?_0x23600d['folderPath']+'/'+_0x23600d[_0x55bd93(0x1e8)][_0x55bd93(0x1d7)]:_0x23600d['yamlConfig']['name'];console['error']('\x0a'+a29_0x11d044[_0x55bd93(0x1d5)]('New\x20journey:')+'\x20'+_0x316bff),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c)),_0x23600d[_0x55bd93(0x1fb)]&&console['error'](_0x23600d['diff']),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}const _0x4af3f1=_0x422465[_0x55bd93(0x1b0)](_0x112bc9=>!_0x112bc9[_0x55bd93(0x1fc)]&&_0x112bc9['diff']);if(_0x4af3f1[_0x55bd93(0x197)]>0x0)for(const _0x5a94f1 of _0x4af3f1){const _0x9b3f0=_0x5a94f1[_0x55bd93(0x1da)]?_0x5a94f1[_0x55bd93(0x1da)]+'/'+_0x5a94f1[_0x55bd93(0x1e8)]['name']:_0x5a94f1[_0x55bd93(0x1e8)][_0x55bd93(0x1d7)];console[_0x55bd93(0x1ab)]('\x0a'+a29_0x11d044[_0x55bd93(0x20d)](_0x55bd93(0x228))+'\x20'+_0x9b3f0),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c)),console['error'](_0x5a94f1[_0x55bd93(0x1fb)]),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}if(_0x447d64[_0x55bd93(0x197)]>0x0)for(const _0x46937d of _0x447d64){const _0x26fd5c=_0x46937d[_0x55bd93(0x19b)]?_0x2e73a9[_0x55bd93(0x1b1)](_0x46937d['folderId'])||'':'',_0xed0d17=_0x26fd5c?_0x26fd5c+'/'+_0x46937d[_0x55bd93(0x1e6)]:_0x46937d[_0x55bd93(0x1e6)];console[_0x55bd93(0x1ab)]('\x0a'+a29_0x11d044['red'](_0x55bd93(0x1a0))+'\x20'+_0xed0d17),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c)),console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x1d3))),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}if(_0xd05e91[_0x55bd93(0x1e5)])return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4549fa=_0xd05e91[_0x55bd93(0x1db)]?![]:_0x417158['length']>0x0||_0x472cd0[_0x55bd93(0x197)]>0x0||_0x37c8b8['length']>0x0,_0x18c5cf=_0x303f33[_0x55bd93(0x197)]>0x0||_0x351e61[_0x55bd93(0x197)]>0x0||_0x447d64['length']>0x0,_0x10f566=_0xd05e91['journeysOnly']?![]:_0x5bb84f[_0x55bd93(0x197)]>0x0,_0x3a5f13=_0xce5a5a['length']>0x0;if(!_0x4549fa&&!_0x18c5cf&&!_0x10f566&&!_0x3a5f13){const _0x5e4813=_0xd05e91[_0x55bd93(0x1db)]?_0x55bd93(0x22a):_0x55bd93(0x198);console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x1d5)](_0x5e4813));if(_0x4c23c1&&_0x52c6fd[_0x55bd93(0x197)]===0x1){const _0xe00b1c=_0x52c6fd[0x0];if(_0xe00b1c[_0x55bd93(0x1ba)]?.['id']){const _0x382212=getConsoleNextUrl(_0xd05e91['site'],_0x55bd93(0x215)+_0x2775d9+_0x55bd93(0x1b6)+_0xe00b1c[_0x55bd93(0x1ba)]['id']+'/j/da/je');console[_0x55bd93(0x1ab)]('\x20\x20'+a29_0x11d044[_0x55bd93(0x21d)](_0x382212));}}return 0x0;}const _0x132ea7=_0xd05e91['journeysOnly']?_0x303f33[_0x55bd93(0x197)]+_0x351e61[_0x55bd93(0x197)]+_0x447d64['length']+_0xce5a5a[_0x55bd93(0x197)]:_0x417158[_0x55bd93(0x197)]+_0x472cd0['length']+_0x37c8b8[_0x55bd93(0x197)]+_0x303f33['length']+_0x351e61[_0x55bd93(0x197)]+_0x447d64[_0x55bd93(0x197)]+_0xce5a5a[_0x55bd93(0x197)]+_0x5bb84f[_0x55bd93(0x197)];if(!_0xd05e91['yes']&&_0x132ea7>0x0){const _0x40b86d=await confirmKey(_0x55bd93(0x20b)+_0x132ea7+'\x20changes?');if(!_0x40b86d)return console[_0x55bd93(0x1ab)](_0x55bd93(0x206)),0x1;}const _0x4c66f1={'withProgress':async(_0x457905,_0x260905)=>{const _0x48d8f6=_0x55bd93,_0x4f6657=await withSpinner(_0x457905,_0x260905,{'verbose':_0xd05e91['verbose']});return{'data':_0x4f6657[_0x48d8f6(0x212)]};},'logInfo':_0x10c974=>console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20e)]('✔\x20'+_0x10c974)),'logSuccess':_0x319ec4=>console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x1d5)]('✔\x20'+_0x319ec4)),'logWarning':_0x57ee4a=>console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)]('⚠\x20'+_0x57ee4a)),'logDeleted':_0x368fab=>console[_0x55bd93(0x1ab)](a29_0x11d044['red']('✔\x20'+_0x368fab))},_0x1fc3de={'segment':_0x5724a4[_0x55bd93(0x205)],'journey':_0x5724a4[_0x55bd93(0x1f2)],'user':_0x5724a4[_0x55bd93(0x1d9)],'connection':_0x5724a4[_0x55bd93(0x1f7)]};_0xce5a5a[_0x55bd93(0x197)]>0x0&&(_0x32d12e=await executePushFolders(_0x1fc3de,_0xce5a5a,_0x32d12e,{'parentId':_0x2775d9},_0x4c66f1));const _0x63f437={'rootFolderId':_0x38fa44,'folderPathToId':_0x32d12e,'folderIdToPath':_0x2e73a9,'segmentNameToId':_0x5cc728,'activationsBySegmentId':_0xf620bf,'emailToIdMap':_0x2c9624,'idToEmailMap':_0x450788,'connectionNameToIdMap':_0x276610[_0x55bd93(0x208)],'connectionIdToNameMap':_0x276610[_0x55bd93(0x1ad)],'connectionNameToTypeMap':_0x516111},_0x1b0289=await executePushSegments(_0x1fc3de,_0xd05e91[_0x55bd93(0x1db)]?[]:_0x50b087,_0x63f437,{'parentId':_0x2775d9},_0x4c66f1),_0x141278=_0x1b0289['created'],_0x430c68=_0x1b0289[_0x55bd93(0x1a4)],_0x43fb37=_0x1b0289[_0x55bd93(0x1c9)]['created'],_0x2ee97c=_0x1b0289[_0x55bd93(0x1c9)][_0x55bd93(0x1a4)],_0x53b1c4=_0x1b0289[_0x55bd93(0x1c9)]['deleted'],_0xcc445e=await executePushSegmentDeletions(_0x1fc3de,_0xd05e91['journeysOnly']?[]:_0x37c8b8,_0x4c66f1);let _0x574327=0x0,_0x583cba=0x0,_0x3fe7de=0x0;const _0x41da6a=new Map(_0x5cc728);for(const [_0x1c3158,_0x27df43]of _0x1b0289[_0x55bd93(0x220)]){_0x41da6a[_0x55bd93(0x1e1)](_0x1c3158,_0x27df43);}if(_0x422465[_0x55bd93(0x197)]>0x0){const _0x181c75={..._0x63f437,'segmentNameToId':_0x41da6a,'existingSegments':_0x5ca255,'activationContext':_0x318a23},_0x3c3cd8=await executePushJourneys(_0x1fc3de,_0x422465,_0x181c75,{'parentId':_0x2775d9,'rootFolderId':_0x38fa44,'verbose':_0xd05e91[_0x55bd93(0x21b)]},_0x4c66f1);_0x574327=_0x3c3cd8[_0x55bd93(0x202)],_0x583cba=_0x3c3cd8['updated'];if(_0x4c23c1&&_0x3c3cd8[_0x55bd93(0x1fd)]['length']===0x1){const _0xa38e54=_0x3c3cd8['results'][0x0];if(_0xa38e54[_0x55bd93(0x1bc)]){const _0x52b9e7=getConsoleNextUrl(_0xd05e91[_0x55bd93(0x1c3)],_0x55bd93(0x215)+_0x2775d9+_0x55bd93(0x1b6)+_0xa38e54[_0x55bd93(0x1bc)]+_0x55bd93(0x1bf));console[_0x55bd93(0x1ab)]('\x20\x20'+a29_0x11d044[_0x55bd93(0x21d)](_0x52b9e7));}}}for(const _0x3b27f3 of _0x447d64){console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)](_0x55bd93(0x1ca)+_0x3b27f3[_0x55bd93(0x1e6)])),_0x3fe7de++;}const _0x4df376=[];if(_0x141278>0x0)_0x4df376[_0x55bd93(0x20f)](_0x141278+_0x55bd93(0x1a6));if(_0x430c68>0x0)_0x4df376['push'](_0x430c68+'\x20updated');if(_0xcc445e>0x0)_0x4df376['push'](_0xcc445e+_0x55bd93(0x216));const _0x12c03d=[];if(_0x574327>0x0)_0x12c03d[_0x55bd93(0x20f)](_0x574327+'\x20created');if(_0x583cba>0x0)_0x12c03d['push'](_0x583cba+_0x55bd93(0x1a2));if(_0x3fe7de>0x0)_0x12c03d[_0x55bd93(0x20f)](_0x3fe7de+_0x55bd93(0x216));const _0x1b5451=[];if(_0x43fb37>0x0)_0x1b5451[_0x55bd93(0x20f)](_0x43fb37+_0x55bd93(0x1a6));if(_0x2ee97c>0x0)_0x1b5451['push'](_0x2ee97c+_0x55bd93(0x1a2));if(_0x53b1c4>0x0)_0x1b5451['push'](_0x53b1c4+_0x55bd93(0x216));return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x1d5)](_0x55bd93(0x1a8))),_0x4df376['length']>0x0&&!_0xd05e91['journeysOnly']&&console['error']('\x20\x20Segments:\x20'+_0x4df376[_0x55bd93(0x1a7)](',\x20')),_0x12c03d[_0x55bd93(0x197)]>0x0&&console['error'](_0x55bd93(0x20a)+_0x12c03d[_0x55bd93(0x1a7)](',\x20')),_0x1b5451[_0x55bd93(0x197)]>0x0&&!_0xd05e91[_0x55bd93(0x1db)]&&console[_0x55bd93(0x1ab)]('\x20\x20Activations:\x20'+_0x1b5451[_0x55bd93(0x1a7)](',\x20')),0x0;}}function a29_0x5e11(){const _0x5f0293=['cyan','Fetching\x20connections\x20for\x20name\x20resolution...','\x0aPush\x20summary\x20for\x20\x27','createdSegmentIds','red','Fetching\x20existing\x20segments...','Error:\x20Directory\x20not\x20found:\x20','unchanged','add','\x20\x20\x20\x20','execute','Changes\x20to\x20journey:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','1074qCNTzl','length','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journeys','Scoped\x20to\x20folder:\x20','folderId','Delete\x20segment:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20to\x20create','1351080tSaiVM','Delete\x20journey:','description','\x20updated','all','updated','buildUserMaps','\x20created','join','\x0a✔\x20Push\x20complete','5032159yjZKnG','\x20\x20🗺️\x20\x20Journeys:','error','type','idToName','\x20folders\x20to\x20create','relationships','filter','get','1514akbNaW','Changes\x20to:','then','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','/e/','12ruYFFj','Error:\x20','\x20to\x20delete','existingJourney','Resolving\x20parent\x20segment\x20\x27','journeyId','54801ITWolX','parentName','/j/da/je','\x20new','getJourney','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','site','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20changed','.yml','segments','Fetching\x20existing\x20activations...','activations','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','message','errorCode','changed','listSegments','versionNumber','950ejfiry','paused','parent_name','(Journey\x20will\x20be\x20deleted)','\x20\x20Activations:','green','map','name','no_parent','user','folderPath','journeysOnly','toUpdate','770ryduCy','segment\x20or\x20journey','\x20unchanged','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','set','New\x20segment:','listActivations','setPhase','dryRun','journeyBundleName','isScoped','yamlConfig','delete','parentFolder','helpText','attributes','Fetching\x20existing\x20journeys...','folders','toString','938sxVEcI','endsWith','journey','Error\x20parsing\x20YAML:\x20','toDelete','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)','state','connection','dim','2858488ZEtwTj','getParent','diff','isNew','results','toCreate','\x20to\x20update','segmentFolderId','getOutputSchemaWithCache','created','3425TxrclB','repeat','segment','Aborted.','\x20YAML\x20files\x20found','nameToId','list','\x20\x20Journeys:\x20','Push\x20','Source\x20directory:\x20','yellow','blue','push','nameToType','targetDir','data','updatedAt','6584xRxEKz','/app/ps/','\x20deleted','filePath','Parent\x20segment:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20📊\x20Segments:','verbose','.yaml'];a29_0x5e11=function(){return _0x5f0293;};return a29_0x5e11();}
|
|
1
|
+
const a29_0x4faf25=a29_0x1b27;(function(_0x4d266c,_0x3cec19){const _0xd2a00=a29_0x1b27,_0x7ef093=_0x4d266c();while(!![]){try{const _0x10aaa9=-parseInt(_0xd2a00(0x1f7))/0x1+-parseInt(_0xd2a00(0x231))/0x2+-parseInt(_0xd2a00(0x22b))/0x3*(parseInt(_0xd2a00(0x21e))/0x4)+-parseInt(_0xd2a00(0x25d))/0x5+-parseInt(_0xd2a00(0x218))/0x6*(-parseInt(_0xd2a00(0x222))/0x7)+parseInt(_0xd2a00(0x203))/0x8*(-parseInt(_0xd2a00(0x243))/0x9)+parseInt(_0xd2a00(0x1e9))/0xa;if(_0x10aaa9===_0x3cec19)break;else _0x7ef093['push'](_0x7ef093['shift']());}catch(_0x5d9097){_0x7ef093['push'](_0x7ef093['shift']());}}}(a29_0x5322,0x70a88));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_0x20f492 from'chalk';import{existsSync}from'fs';function a29_0x5322(){const _0x441090=['deleted','filter','cyan','cwd','Preparing\x20journeys...','New\x20segment:','50368neGukD','segments','Error:\x20Directory\x20not\x20found:\x20','Error\x20parsing\x20YAML:\x20','folders','red','Delete\x20journey:','no_parent','Fetching\x20connections\x20for\x20name\x20resolution...','connection','.yml','state','\x20\x20\x20\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','map','\x20created','\x20\x20Journeys:\x20','toString','Source\x20directory:\x20','data','list','30ZadVkI','Scoped\x20to\x20folder:\x20','folderPath','\x20\x20Activations:','\x20YAML\x20files\x20found','segment\x20or\x20journey','88mfPbUy','\x20changes?','helpText','created','665861qHGSeG','unchanged','site','errorCode','No\x20','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)','green','then','add','91659HVnaog','\x20changed','join','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','targetDir','\x27...','1143158uUJKtn','endsWith','diff','\x20updated','Push\x20','Fetching\x20parent\x20segment\x20details...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','listFolders','audienceId','\x0aPush\x20summary\x20for\x20\x27','Fetching\x20users\x20for\x20email\x20resolution...','parentFolder','yes','Fetching\x20existing\x20folders...','Delete\x20segment:','Site:\x20','\x20to\x20delete','results','729EOXLPe','yamlConfig','repeat','verbose','all','set','\x20new','length','delete','.yaml','execute','push','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Parent\x20segment:\x20','nameToId','listActivations','\x20activations]','\x0a✔\x20Push\x20complete','\x0aValidation\x20failed:','error','journeyBundleName','Resolving\x20parent\x20segment\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','resolveParentId','Folders\x20to\x20create:','activations','2011350pYusax','paused','listSegments','updatedAt','\x20\x20Segments:\x20','yellow','scopedFolderPath','\x20\x20Activations:\x20','/app/ps/','name','\x20\x20🗺️\x20\x20Journeys:','\x20deleted','Aborted.','setPhase','isScoped','Fetching\x20existing\x20segments...','toDelete','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','/j/da/je','journey','idToName','isNew','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','dim','relationships','New\x20journey:','updated','getOutputSchemaWithCache','folderId','getJourney','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','changed','attributes','journeysOnly','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','buildUserMaps','file','Fetching\x20existing\x20journeys...','Changes\x20to\x20journey:','journeys','29777870UrsUaf','Error:\x20','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','type','get','toCreate','\x20to\x20create','new','segmentFolderId','segment','existingJourney','message','journeyId','835963KiXriT','user','listJourneysWithDetailsFromParentSegment','blue','filePath','createdSegmentIds'];a29_0x5322=function(){return _0x441090;};return a29_0x5322();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a29_0x1b27(_0x5c3f9c,_0x58bc30){_0x5c3f9c=_0x5c3f9c-0x1d1;const _0x532258=a29_0x5322();let _0x1b27e7=_0x532258[_0x5c3f9c];return _0x1b27e7;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a29_0x4faf25(0x266)]='segment:push';['description']=a29_0x4faf25(0x24f);async[a29_0x4faf25(0x24d)](_0x17d90b){const _0x106f1f=a29_0x4faf25,{options:_0x5e372e,args:_0x2e60b9,tdx:_0x13e022}=_0x17d90b,_0x693a2a=_0x5e372e,_0x59fdd8=await resolveTarget({'arg':_0x2e60b9[0x0],'contextParent':_0x5e372e['parentSegment'],'cwd':process[_0x106f1f(0x200)]()});if(!isSuccessfulResolution(_0x59fdd8))return _0x59fdd8[_0x106f1f(0x225)]===_0x106f1f(0x20a)?(console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x262)](_0x106f1f(0x1e2))),console[_0x106f1f(0x256)](_0x106f1f(0x227)),console[_0x106f1f(0x256)](_0x106f1f(0x1ec)),console['error'](_0x106f1f(0x237))):(console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x208)](_0x106f1f(0x1ea)+_0x59fdd8[_0x106f1f(0x1f5)]+'\x0a')),_0x59fdd8[_0x106f1f(0x220)]&&console['error'](a29_0x20f492['cyan'](_0x59fdd8['helpText']))),0x1;if(_0x59fdd8[_0x106f1f(0x1ed)]==='parent_name')return console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x208)](_0x106f1f(0x205)+_0x59fdd8[_0x106f1f(0x22f)]+'\x0a')),console['error'](a29_0x20f492[_0x106f1f(0x1ff)](_0x106f1f(0x1dd))),0x1;const _0x18a6b6=_0x59fdd8['parentName'],_0x255ca0=_0x59fdd8[_0x106f1f(0x22f)],_0x45e2eb=_0x59fdd8[_0x106f1f(0x1ed)]===_0x106f1f(0x1e5)?_0x59fdd8[_0x106f1f(0x1fb)]:undefined,_0x2cdea4=getScopedDetails(_0x59fdd8),_0x5487a1=_0x2cdea4?.[_0x106f1f(0x26b)]??![],_0x564c94=_0x2cdea4?.[_0x106f1f(0x263)]??'';if(!existsSync(_0x255ca0))return console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x208)](_0x106f1f(0x205)+_0x255ca0+'\x0a')),console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x1ff)](_0x106f1f(0x1dd))),0x1;_0x693a2a[_0x106f1f(0x246)]&&(console[_0x106f1f(0x256)](_0x106f1f(0x240)+_0x693a2a[_0x106f1f(0x224)]),console[_0x106f1f(0x256)](_0x106f1f(0x250)+_0x18a6b6),console[_0x106f1f(0x256)](_0x106f1f(0x215)+_0x255ca0),_0x5487a1&&console[_0x106f1f(0x256)](_0x106f1f(0x219)+_0x564c94));const _0x4b41aa=await withSpinner(_0x106f1f(0x258)+_0x18a6b6+_0x106f1f(0x230),()=>_0x13e022[_0x106f1f(0x1f3)][_0x106f1f(0x25a)](_0x18a6b6),{'verbose':_0x693a2a['verbose']}),_0x233f77=_0x4b41aa[_0x106f1f(0x216)],[_0x21cb39,_0x6faf5,_0x2e1a5b,_0x21a376,_0x5975e0]=await Promise[_0x106f1f(0x247)]([withSpinner(_0x106f1f(0x236),()=>_0x13e022['segment']['getParent'](_0x233f77),{'verbose':_0x693a2a[_0x106f1f(0x246)]}),withSpinner(_0x106f1f(0x26c),()=>_0x13e022[_0x106f1f(0x1f3)][_0x106f1f(0x25f)](_0x233f77),{'verbose':_0x693a2a[_0x106f1f(0x246)]}),withSpinner(_0x106f1f(0x23e),()=>_0x13e022['segment'][_0x106f1f(0x238)](_0x233f77),{'verbose':_0x693a2a[_0x106f1f(0x246)]}),withSpinner(_0x106f1f(0x1e6),()=>_0x13e022[_0x106f1f(0x1d2)][_0x106f1f(0x1f9)](_0x233f77,{'includeAllVersions':!![]}),{'verbose':_0x693a2a[_0x106f1f(0x246)]}),withSpinner(_0x106f1f(0x23b),()=>_0x13e022['user'][_0x106f1f(0x1e4)](),{'verbose':_0x693a2a[_0x106f1f(0x246)]})[_0x106f1f(0x229)](_0x16357d=>_0x16357d[_0x106f1f(0x216)])]),_0x32cf9c=_0x21cb39['data'],_0x149cd4=extractRootFolderId(_0x32cf9c),_0x531b92=_0x6faf5[_0x106f1f(0x216)],_0x1b7bd7=_0x2e1a5b['data'],{journeys:_0x28334a,activationStepsById:_0x14876c}=_0x21a376[_0x106f1f(0x216)],_0x49775e=new Map(_0x28334a[_0x106f1f(0x211)](_0x32d28b=>[_0x32d28b['id'],_0x32d28b])),_0x155fa2=_0x28334a[_0x106f1f(0x211)](_0x51ef67=>({'id':_0x51ef67['id'],'name':_0x51ef67['attributes']['name'],'journeyBundleName':_0x51ef67['attributes']['journeyBundleName']||'','journeyBundleId':_0x51ef67['attributes']['journeyBundleId']||'','versionNumber':_0x51ef67[_0x106f1f(0x1df)]['versionNumber'],'description':_0x51ef67['attributes'][_0x106f1f(0x1eb)],'state':_0x51ef67[_0x106f1f(0x1df)][_0x106f1f(0x20e)],'paused':_0x51ef67[_0x106f1f(0x1df)][_0x106f1f(0x25e)],'audienceId':_0x51ef67[_0x106f1f(0x1df)][_0x106f1f(0x239)],'folderId':_0x51ef67[_0x106f1f(0x1d7)]?.[_0x106f1f(0x23c)]?.[_0x106f1f(0x216)]?.['id'],'createdAt':_0x51ef67[_0x106f1f(0x1df)]['createdAt'],'updatedAt':_0x51ef67[_0x106f1f(0x1df)][_0x106f1f(0x260)]})),{emailToId:_0x288b6f,idToEmail:_0x41ae3d}=_0x5975e0,_0x20f725=await withSpinner(_0x106f1f(0x20b),async()=>{const _0x4d5740=_0x106f1f,_0x5f228a=await _0x13e022['connection'][_0x4d5740(0x217)]();return buildConnectionMaps(_0x5f228a);},{'verbose':_0x693a2a['verbose']})['then'](_0x455cae=>_0x455cae[_0x106f1f(0x216)]),_0x1dd701=_0x20f725[_0x106f1f(0x251)],_0x2f1bdc=_0x20f725[_0x106f1f(0x1d3)],_0x5d636d=_0x20f725['nameToType'],_0x33b1b4={'emailToIdMap':_0x288b6f,'connectionNameToIdMap':_0x1dd701,'connectionNameToTypeMap':_0x5d636d,'getSchema':_0x8c08b8=>_0x13e022[_0x106f1f(0x20c)][_0x106f1f(0x1da)](_0x8c08b8)};let {pathToId:_0x113ffc,idToPath:_0x23825c}=buildFolderMaps(_0x1b7bd7);const _0x516542=buildSegmentLookupMap(_0x531b92,_0x23825c),_0x334aad=buildSegmentNameToIdMap(_0x531b92),_0x97db3c=buildJourneyBundleLookupMap(_0x155fa2,_0x23825c);let _0x1e85bf;if(_0x45e2eb){if(!_0x45e2eb[_0x106f1f(0x232)](_0x106f1f(0x20d))&&!_0x45e2eb['endsWith'](_0x106f1f(0x24c)))return console[_0x106f1f(0x256)](a29_0x20f492['red'](_0x106f1f(0x259)+_0x45e2eb+'\x0a')),0x1;_0x1e85bf=[_0x45e2eb];}else _0x1e85bf=findYamlFiles(_0x255ca0);if(_0x1e85bf['length']===0x0)return console['error'](a29_0x20f492[_0x106f1f(0x208)](_0x106f1f(0x210)+_0x255ca0+'\x0a')),console['error'](a29_0x20f492[_0x106f1f(0x1ff)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x309aa1,_0x5a707c;try{const _0x50cc5d=parseAndClassifyYamlFiles(_0x1e85bf,_0x255ca0,{'skipSegments':_0x693a2a[_0x106f1f(0x1e0)]});_0x309aa1=_0x50cc5d['segments'],_0x5a707c=_0x50cc5d[_0x106f1f(0x1e8)];const _0x4dddba=validateParsedFiles(_0x50cc5d,_0x255ca0);if(_0x4dddba[_0x106f1f(0x24a)]>0x0)return console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x208)](_0x106f1f(0x255))),console[_0x106f1f(0x256)](formatValidationErrors(_0x4dddba)),console[_0x106f1f(0x256)](a29_0x20f492['yellow'](_0x106f1f(0x1e3))),0x1;}catch(_0x127aa2){return console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x208)](_0x106f1f(0x206)+(_0x127aa2 instanceof Error?_0x127aa2[_0x106f1f(0x1f5)]:_0x127aa2))),0x1;}if(_0x309aa1[_0x106f1f(0x24a)]===0x0&&_0x5a707c['length']===0x0){const _0x557c55=_0x693a2a['journeysOnly']?_0x106f1f(0x1d2):_0x106f1f(0x21d);return console['error'](a29_0x20f492[_0x106f1f(0x262)](_0x106f1f(0x226)+_0x557c55+_0x106f1f(0x21c))),0x0;}const _0x36933c=new Map();_0x531b92[_0x106f1f(0x24a)]>0x0&&!_0x693a2a[_0x106f1f(0x1e0)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x531b92,async _0x5f4bc8=>{const _0x587ddf=a29_0x1b27,_0x1c3b6e=await _0x13e022[_0x587ddf(0x1f3)][_0x587ddf(0x252)](_0x233f77,_0x5f4bc8['id']);_0x36933c[_0x587ddf(0x248)](_0x5f4bc8['id'],_0x1c3b6e);});},{'verbose':_0x693a2a[_0x106f1f(0x246)]});const {segmentFiles:_0x2466e5,foldersToCreate:_0xabb994}=await prepareSegmentFiles(_0x309aa1,{'segmentByFolderAndName':_0x516542,'activationsBySegmentId':_0x36933c,'folderPathToId':_0x113ffc,'idToEmailMap':_0x41ae3d,'connectionIdToNameMap':_0x2f1bdc},_0x33b1b4,_0x5487a1,_0x564c94),_0x2737eb=_0x45e2eb?[]:findSegmentsToDelete(_0x531b92,_0x309aa1[_0x106f1f(0x211)](({yamlConfig:_0x40d0be,folderPath:_0x1c5b7a})=>({'yamlConfig':_0x40d0be,'folderPath':resolveTDFolderPath(_0x1c5b7a,_0x5487a1,_0x564c94)})),_0x23825c,_0x564c94,_0x5487a1),{journeyFiles:_0x4d4543,foldersToCreate:_0x34b9a4}=await withProgressSpinner(_0x106f1f(0x201),async _0x4c00f7=>prepareJourneyFiles(_0x5a707c,{'fetchJourney':async _0x42473e=>_0x13e022[_0x106f1f(0x1d2)][_0x106f1f(0x1dc)](_0x42473e['journeyId']),'journeyBundlesByFolderAndName':_0x97db3c,'folderPathToId':_0x113ffc,'idToEmailMap':_0x41ae3d,'connectionIdToNameMap':_0x2f1bdc,'existingSegments':_0x531b92,'parentId':_0x233f77,'deps':_0x13e022,'progress':{'update':_0x59c773=>{const _0x500930=_0x106f1f;_0x4c00f7[_0x500930(0x26a)](_0x59c773),_0x693a2a[_0x500930(0x246)]&&console[_0x500930(0x256)]('\x20\x20'+_0x59c773);}},'journeyById':_0x49775e,'activationStepsById':_0x14876c},_0x5487a1,_0x564c94),{'verbose':_0x693a2a[_0x106f1f(0x246)]})[_0x106f1f(0x229)](_0x3165c8=>_0x3165c8[_0x106f1f(0x216)]);for(const _0x449cee of _0x34b9a4){_0xabb994[_0x106f1f(0x22a)](_0x449cee);}const _0x5bace6=_0x45e2eb?[]:findJourneysToDelete(_0x155fa2,_0x5a707c['map'](({yamlConfig:_0x4547fa,folderPath:_0x310004})=>({'yamlConfig':_0x4547fa,'folderPath':resolveTDFolderPath(_0x310004,_0x5487a1,_0x564c94)})),_0x23825c,_0x564c94,_0x5487a1),_0x3fd217=calculatePushStats(_0x2466e5,_0x4d4543,_0xabb994,_0x2737eb,_0x5bace6,!!_0x693a2a['delete'],!!_0x693a2a[_0x106f1f(0x1e0)]),_0x1f6b51=_0x3fd217['segments'][_0x106f1f(0x1f1)],_0x40c72c=_0x3fd217['segments'][_0x106f1f(0x1de)],_0x548fa1=_0x3fd217[_0x106f1f(0x204)]['unchanged'],_0x1ad03d=_0x3fd217[_0x106f1f(0x204)][_0x106f1f(0x26d)],_0x563f74=_0x3fd217[_0x106f1f(0x207)][_0x106f1f(0x1ef)],_0x24329e=_0x3fd217[_0x106f1f(0x1e8)][_0x106f1f(0x1f1)],_0x456d16=_0x3fd217[_0x106f1f(0x1e8)][_0x106f1f(0x1de)],_0x3b85eb=_0x3fd217[_0x106f1f(0x1e8)][_0x106f1f(0x223)],_0x4797a0=_0x3fd217[_0x106f1f(0x1e8)][_0x106f1f(0x26d)],_0x3a5b94=_0x3fd217['activations'][_0x106f1f(0x247)],_0x360a70=_0x3fd217[_0x106f1f(0x25c)][_0x106f1f(0x1ef)],_0x2294db=_0x3fd217[_0x106f1f(0x25c)]['toUpdate'],_0x19c0aa=_0x3fd217['activations'][_0x106f1f(0x26d)];console[_0x106f1f(0x256)](_0x106f1f(0x23a)+_0x18a6b6+'\x27:');_0x563f74['length']>0x0&&console[_0x106f1f(0x256)]('\x20\x20'+a29_0x20f492[_0x106f1f(0x1fa)]('📁\x20'+_0x563f74[_0x106f1f(0x24a)]+'\x20folders\x20to\x20create'));if(!_0x693a2a[_0x106f1f(0x1e0)]){console[_0x106f1f(0x256)]('\x20\x20📊\x20Segments:'),console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492['green']('+\x20'+_0x1f6b51[_0x106f1f(0x24a)]+_0x106f1f(0x249))),console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492[_0x106f1f(0x262)]('~\x20'+_0x40c72c[_0x106f1f(0x24a)]+_0x106f1f(0x22c)));if(_0x1ad03d[_0x106f1f(0x24a)]>0x0)console['error'](_0x106f1f(0x20f)+a29_0x20f492[_0x106f1f(0x208)]('-\x20'+_0x1ad03d[_0x106f1f(0x24a)]+_0x106f1f(0x241)));else _0x2737eb[_0x106f1f(0x24a)]>0x0&&!_0x693a2a[_0x106f1f(0x24b)]&&console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492['dim'](_0x2737eb[_0x106f1f(0x24a)]+_0x106f1f(0x1d5)));console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492[_0x106f1f(0x1d6)]('=\x20'+_0x548fa1[_0x106f1f(0x24a)]+'\x20unchanged'));}if(_0x4d4543[_0x106f1f(0x24a)]>0x0||_0x5bace6[_0x106f1f(0x24a)]>0x0){console[_0x106f1f(0x256)](_0x106f1f(0x267)),console[_0x106f1f(0x256)]('\x20\x20\x20\x20'+a29_0x20f492[_0x106f1f(0x228)]('+\x20'+_0x24329e[_0x106f1f(0x24a)]+'\x20new')),console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492[_0x106f1f(0x262)]('~\x20'+_0x456d16['length']+_0x106f1f(0x22c)));if(_0x4797a0['length']>0x0)console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492[_0x106f1f(0x208)]('-\x20'+_0x4797a0[_0x106f1f(0x24a)]+_0x106f1f(0x241)));else _0x5bace6[_0x106f1f(0x24a)]>0x0&&!_0x693a2a[_0x106f1f(0x24b)]&&console['error']('\x20\x20\x20\x20'+a29_0x20f492[_0x106f1f(0x1d6)](_0x5bace6['length']+_0x106f1f(0x1d5)));console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492[_0x106f1f(0x1d6)]('=\x20'+_0x3b85eb[_0x106f1f(0x24a)]+'\x20unchanged'));}_0x3a5b94[_0x106f1f(0x24a)]>0x0&&!_0x693a2a[_0x106f1f(0x1e0)]&&(console[_0x106f1f(0x256)](''),console['error'](_0x106f1f(0x21b)),_0x360a70[_0x106f1f(0x24a)]>0x0&&console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492[_0x106f1f(0x228)]('+\x20'+_0x360a70[_0x106f1f(0x24a)]+_0x106f1f(0x1f0))),_0x2294db['length']>0x0&&console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492['yellow']('~\x20'+_0x2294db[_0x106f1f(0x24a)]+'\x20to\x20update')),_0x19c0aa[_0x106f1f(0x24a)]>0x0&&console[_0x106f1f(0x256)](_0x106f1f(0x20f)+a29_0x20f492[_0x106f1f(0x208)]('-\x20'+_0x19c0aa[_0x106f1f(0x24a)]+_0x106f1f(0x241))));console['error']('\x20\x20Source:\x20'+a29_0x20f492[_0x106f1f(0x1ff)](_0x255ca0)+'\x0a');if(_0x563f74['length']>0x0){console[_0x106f1f(0x256)](_0x106f1f(0x25b));for(const _0x22f5bf of _0x563f74){console['error']('\x20\x20'+a29_0x20f492[_0x106f1f(0x1fa)]('+')+'\x20'+_0x22f5bf);}console['error']('');}if(_0x1f6b51['length']>0x0&&!_0x693a2a[_0x106f1f(0x1e0)])for(const _0x382615 of _0x1f6b51){const _0x470ec8=_0x382615[_0x106f1f(0x21a)]?_0x382615[_0x106f1f(0x21a)]+'/'+_0x382615[_0x106f1f(0x244)]['name']:_0x382615[_0x106f1f(0x244)]['name'],_0x46fb6f=_0x382615['yamlConfig'][_0x106f1f(0x25c)]?.[_0x106f1f(0x24a)]||0x0,_0x65495c=_0x46fb6f>0x0?a29_0x20f492['dim']('\x20['+_0x46fb6f+_0x106f1f(0x253)):'';console[_0x106f1f(0x256)]('\x0a'+a29_0x20f492[_0x106f1f(0x228)](_0x106f1f(0x202))+'\x20'+_0x470ec8+_0x65495c),console[_0x106f1f(0x256)]('─'[_0x106f1f(0x245)](0x3c)),_0x382615[_0x106f1f(0x233)]&&console['error'](_0x382615[_0x106f1f(0x233)]),console['error']('─'[_0x106f1f(0x245)](0x3c));}if(_0x1ad03d[_0x106f1f(0x24a)]>0x0&&!_0x693a2a['journeysOnly'])for(const _0x29bd5b of _0x1ad03d){const _0x219423=_0x29bd5b[_0x106f1f(0x1f2)]?_0x23825c[_0x106f1f(0x1ee)](_0x29bd5b['segmentFolderId'][_0x106f1f(0x214)]())||'':'',_0x351d43=_0x219423?_0x219423+'/'+_0x29bd5b[_0x106f1f(0x266)]:_0x29bd5b['name'],_0x4bbe2b=_0x36933c[_0x106f1f(0x1ee)](_0x29bd5b['id'])||[],_0x31b44f=_0x4bbe2b['length']>0x0?a29_0x20f492[_0x106f1f(0x1d6)]('\x20['+_0x4bbe2b['length']+_0x106f1f(0x253)):'';console[_0x106f1f(0x256)]('\x0a'+a29_0x20f492[_0x106f1f(0x208)](_0x106f1f(0x23f))+'\x20'+_0x351d43+_0x31b44f),console['error']('─'['repeat'](0x3c));const _0x3a7745=segmentWithActivationsToYaml(_0x29bd5b,_0x4bbe2b,undefined,_0x41ae3d,_0x2f1bdc),_0x2efa56=segmentToYamlString(_0x3a7745),_0x4bb859=generateDiff(_0x2efa56,'');console[_0x106f1f(0x256)](formatDiffWithColors(_0x4bb859)),console[_0x106f1f(0x256)]('─'['repeat'](0x3c));}const _0x2512ba=_0x2466e5['filter'](_0x2bfcfc=>!_0x2bfcfc[_0x106f1f(0x1d4)]&&_0x2bfcfc['diff']);if(_0x2512ba[_0x106f1f(0x24a)]>0x0&&!_0x693a2a[_0x106f1f(0x1e0)])for(const _0x111436 of _0x2512ba){const _0x344584=_0x111436['folderPath']?_0x111436[_0x106f1f(0x21a)]+'/'+_0x111436[_0x106f1f(0x244)][_0x106f1f(0x266)]:_0x111436[_0x106f1f(0x244)][_0x106f1f(0x266)];console[_0x106f1f(0x256)]('\x0a'+a29_0x20f492['yellow']('Changes\x20to:')+'\x20'+_0x344584),console[_0x106f1f(0x256)]('─'['repeat'](0x3c)),console[_0x106f1f(0x256)](_0x111436[_0x106f1f(0x233)]),console[_0x106f1f(0x256)]('─'['repeat'](0x3c));}if(_0x24329e[_0x106f1f(0x24a)]>0x0)for(const _0x6cadc5 of _0x24329e){const _0x5780f6=_0x6cadc5[_0x106f1f(0x21a)]?_0x6cadc5[_0x106f1f(0x21a)]+'/'+_0x6cadc5[_0x106f1f(0x244)][_0x106f1f(0x266)]:_0x6cadc5[_0x106f1f(0x244)][_0x106f1f(0x266)];console[_0x106f1f(0x256)]('\x0a'+a29_0x20f492[_0x106f1f(0x228)](_0x106f1f(0x1d8))+'\x20'+_0x5780f6),console[_0x106f1f(0x256)]('─'[_0x106f1f(0x245)](0x3c)),_0x6cadc5[_0x106f1f(0x233)]&&console[_0x106f1f(0x256)](_0x6cadc5[_0x106f1f(0x233)]),console[_0x106f1f(0x256)]('─'[_0x106f1f(0x245)](0x3c));}const _0x51138c=_0x4d4543[_0x106f1f(0x1fe)](_0x1673ba=>!_0x1673ba[_0x106f1f(0x1d4)]&&_0x1673ba[_0x106f1f(0x233)]);if(_0x51138c[_0x106f1f(0x24a)]>0x0)for(const _0xbb23a5 of _0x51138c){const _0xde690c=_0xbb23a5[_0x106f1f(0x21a)]?_0xbb23a5[_0x106f1f(0x21a)]+'/'+_0xbb23a5['yamlConfig']['name']:_0xbb23a5['yamlConfig']['name'];console[_0x106f1f(0x256)]('\x0a'+a29_0x20f492[_0x106f1f(0x262)](_0x106f1f(0x1e7))+'\x20'+_0xde690c),console[_0x106f1f(0x256)]('─'[_0x106f1f(0x245)](0x3c)),console[_0x106f1f(0x256)](_0xbb23a5['diff']),console['error']('─'[_0x106f1f(0x245)](0x3c));}if(_0x4797a0[_0x106f1f(0x24a)]>0x0)for(const _0x351d3e of _0x4797a0){const _0x3fc676=_0x351d3e[_0x106f1f(0x1db)]?_0x23825c['get'](_0x351d3e[_0x106f1f(0x1db)])||'':'',_0x5e49d3=_0x3fc676?_0x3fc676+'/'+_0x351d3e[_0x106f1f(0x257)]:_0x351d3e[_0x106f1f(0x257)];console['error']('\x0a'+a29_0x20f492[_0x106f1f(0x208)](_0x106f1f(0x209))+'\x20'+_0x5e49d3),console[_0x106f1f(0x256)]('─'[_0x106f1f(0x245)](0x3c)),console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x208)]('(Journey\x20will\x20be\x20deleted)')),console[_0x106f1f(0x256)]('─'[_0x106f1f(0x245)](0x3c));}if(_0x693a2a['dryRun'])return console[_0x106f1f(0x256)](a29_0x20f492['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4aa4dd=_0x693a2a[_0x106f1f(0x1e0)]?![]:_0x1f6b51[_0x106f1f(0x24a)]>0x0||_0x40c72c['length']>0x0||_0x1ad03d[_0x106f1f(0x24a)]>0x0,_0x3ea7b5=_0x24329e[_0x106f1f(0x24a)]>0x0||_0x456d16[_0x106f1f(0x24a)]>0x0||_0x4797a0[_0x106f1f(0x24a)]>0x0,_0x434b28=_0x693a2a[_0x106f1f(0x1e0)]?![]:_0x3a5b94[_0x106f1f(0x24a)]>0x0,_0x1f2812=_0x563f74['length']>0x0;if(!_0x4aa4dd&&!_0x3ea7b5&&!_0x434b28&&!_0x1f2812){const _0x1182bb=_0x693a2a[_0x106f1f(0x1e0)]?_0x106f1f(0x22e):_0x106f1f(0x26e);console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x228)](_0x1182bb));if(_0x45e2eb&&_0x3b85eb[_0x106f1f(0x24a)]===0x1){const _0x43c686=_0x3b85eb[0x0];if(_0x43c686[_0x106f1f(0x1f4)]?.['id']){const _0x17a212=getConsoleNextUrl(_0x693a2a[_0x106f1f(0x224)],'/app/ps/'+_0x233f77+'/e/'+_0x43c686[_0x106f1f(0x1f4)]['id']+_0x106f1f(0x1d1));console[_0x106f1f(0x256)]('\x20\x20'+a29_0x20f492[_0x106f1f(0x1ff)](_0x17a212));}}return 0x0;}const _0x3f8c7a=_0x693a2a[_0x106f1f(0x1e0)]?_0x24329e['length']+_0x456d16[_0x106f1f(0x24a)]+_0x4797a0['length']+_0x563f74[_0x106f1f(0x24a)]:_0x1f6b51['length']+_0x40c72c['length']+_0x1ad03d[_0x106f1f(0x24a)]+_0x24329e[_0x106f1f(0x24a)]+_0x456d16[_0x106f1f(0x24a)]+_0x4797a0[_0x106f1f(0x24a)]+_0x563f74[_0x106f1f(0x24a)]+_0x3a5b94[_0x106f1f(0x24a)];if(!_0x693a2a[_0x106f1f(0x23d)]&&_0x3f8c7a>0x0){const _0x561444=await confirmKey(_0x106f1f(0x235)+_0x3f8c7a+_0x106f1f(0x21f));if(!_0x561444)return console[_0x106f1f(0x256)](_0x106f1f(0x269)),0x1;}const _0x3c39c4={'withProgress':async(_0x37d683,_0x404219)=>{const _0x48d38f=_0x106f1f,_0x473e4e=await withSpinner(_0x37d683,_0x404219,{'verbose':_0x693a2a[_0x48d38f(0x246)]});return{'data':_0x473e4e['data']};},'logInfo':_0x4daef2=>console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x1fa)]('✔\x20'+_0x4daef2)),'logSuccess':_0x1562e7=>console['error'](a29_0x20f492[_0x106f1f(0x228)]('✔\x20'+_0x1562e7)),'logWarning':_0x35f72d=>console['error'](a29_0x20f492[_0x106f1f(0x262)]('⚠\x20'+_0x35f72d)),'logDeleted':_0x2f8613=>console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x208)]('✔\x20'+_0x2f8613))},_0x4f99a0={'segment':_0x13e022[_0x106f1f(0x1f3)],'journey':_0x13e022[_0x106f1f(0x1d2)],'user':_0x13e022[_0x106f1f(0x1f8)],'connection':_0x13e022[_0x106f1f(0x20c)]};_0x563f74[_0x106f1f(0x24a)]>0x0&&(_0x113ffc=await executePushFolders(_0x4f99a0,_0x563f74,_0x113ffc,{'parentId':_0x233f77},_0x3c39c4));const _0x4c690c={'rootFolderId':_0x149cd4,'folderPathToId':_0x113ffc,'folderIdToPath':_0x23825c,'segmentNameToId':_0x334aad,'activationsBySegmentId':_0x36933c,'emailToIdMap':_0x288b6f,'idToEmailMap':_0x41ae3d,'connectionNameToIdMap':_0x20f725[_0x106f1f(0x251)],'connectionIdToNameMap':_0x20f725[_0x106f1f(0x1d3)],'connectionNameToTypeMap':_0x5d636d},_0x364de2=await executePushSegments(_0x4f99a0,_0x693a2a[_0x106f1f(0x1e0)]?[]:_0x2466e5,_0x4c690c,{'parentId':_0x233f77},_0x3c39c4),_0x4e1601=_0x364de2[_0x106f1f(0x221)],_0x44062f=_0x364de2[_0x106f1f(0x1d9)],_0x492352=_0x364de2[_0x106f1f(0x25c)][_0x106f1f(0x221)],_0x77ee2d=_0x364de2[_0x106f1f(0x25c)][_0x106f1f(0x1d9)],_0x4d9ac5=_0x364de2[_0x106f1f(0x25c)][_0x106f1f(0x1fd)],_0x5eb54b=await executePushSegmentDeletions(_0x4f99a0,_0x693a2a[_0x106f1f(0x1e0)]?[]:_0x1ad03d,_0x3c39c4);let _0x49e9ff=0x0,_0x29aa93=0x0,_0x1a44a2=0x0;const _0x3cd624=new Map(_0x334aad);for(const [_0x519319,_0x3d2e52]of _0x364de2[_0x106f1f(0x1fc)]){_0x3cd624[_0x106f1f(0x248)](_0x519319,_0x3d2e52);}if(_0x4d4543[_0x106f1f(0x24a)]>0x0){const _0x3e6b35={..._0x4c690c,'segmentNameToId':_0x3cd624,'existingSegments':_0x531b92,'activationContext':_0x33b1b4},_0x19d1b6=await executePushJourneys(_0x4f99a0,_0x4d4543,_0x3e6b35,{'parentId':_0x233f77,'rootFolderId':_0x149cd4,'verbose':_0x693a2a[_0x106f1f(0x246)]},_0x3c39c4);_0x49e9ff=_0x19d1b6[_0x106f1f(0x221)],_0x29aa93=_0x19d1b6[_0x106f1f(0x1d9)];if(_0x45e2eb&&_0x19d1b6[_0x106f1f(0x242)][_0x106f1f(0x24a)]===0x1){const _0x5b347e=_0x19d1b6['results'][0x0];if(_0x5b347e[_0x106f1f(0x1f6)]){const _0x1885f8=getConsoleNextUrl(_0x693a2a[_0x106f1f(0x224)],_0x106f1f(0x265)+_0x233f77+'/e/'+_0x5b347e[_0x106f1f(0x1f6)]+_0x106f1f(0x1d1));console['error']('\x20\x20'+a29_0x20f492[_0x106f1f(0x1ff)](_0x1885f8));}}}for(const _0xe8d8a1 of _0x4797a0){console[_0x106f1f(0x256)](a29_0x20f492['yellow'](_0x106f1f(0x1e1)+_0xe8d8a1['journeyBundleName'])),_0x1a44a2++;}const _0x174e2b=[];if(_0x4e1601>0x0)_0x174e2b[_0x106f1f(0x24e)](_0x4e1601+_0x106f1f(0x212));if(_0x44062f>0x0)_0x174e2b[_0x106f1f(0x24e)](_0x44062f+_0x106f1f(0x234));if(_0x5eb54b>0x0)_0x174e2b[_0x106f1f(0x24e)](_0x5eb54b+_0x106f1f(0x268));const _0x16cde8=[];if(_0x49e9ff>0x0)_0x16cde8[_0x106f1f(0x24e)](_0x49e9ff+_0x106f1f(0x212));if(_0x29aa93>0x0)_0x16cde8[_0x106f1f(0x24e)](_0x29aa93+'\x20updated');if(_0x1a44a2>0x0)_0x16cde8[_0x106f1f(0x24e)](_0x1a44a2+'\x20deleted');const _0x6e45d4=[];if(_0x492352>0x0)_0x6e45d4['push'](_0x492352+_0x106f1f(0x212));if(_0x77ee2d>0x0)_0x6e45d4['push'](_0x77ee2d+_0x106f1f(0x234));if(_0x4d9ac5>0x0)_0x6e45d4[_0x106f1f(0x24e)](_0x4d9ac5+_0x106f1f(0x268));return console[_0x106f1f(0x256)](a29_0x20f492[_0x106f1f(0x228)](_0x106f1f(0x254))),_0x174e2b[_0x106f1f(0x24a)]>0x0&&!_0x693a2a[_0x106f1f(0x1e0)]&&console['error'](_0x106f1f(0x261)+_0x174e2b[_0x106f1f(0x22d)](',\x20')),_0x16cde8['length']>0x0&&console[_0x106f1f(0x256)](_0x106f1f(0x213)+_0x16cde8['join'](',\x20')),_0x6e45d4[_0x106f1f(0x24a)]>0x0&&!_0x693a2a[_0x106f1f(0x1e0)]&&console[_0x106f1f(0x256)](_0x106f1f(0x264)+_0x6e45d4[_0x106f1f(0x22d)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x29bbbc=a30_0x22ef;(function(_0x572c6d,_0x13c463){const _0x36080d=a30_0x22ef,_0x309d4e=_0x572c6d();while(!![]){try{const _0xce647a=-parseInt(_0x36080d(0xbc))/0x1*(-parseInt(_0x36080d(0xb3))/0x2)+parseInt(_0x36080d(0xb2))/0x3*(-parseInt(_0x36080d(0xa0))/0x4)+-parseInt(_0x36080d(0x9c))/0x5*(-parseInt(_0x36080d(0xb6))/0x6)+parseInt(_0x36080d(0xaa))/0x7*(parseInt(_0x36080d(0xa8))/0x8)+-parseInt(_0x36080d(0xba))/0x9*(-parseInt(_0x36080d(0xa6))/0xa)+parseInt(_0x36080d(0xb9))/0xb+parseInt(_0x36080d(0x9b))/0xc*(-parseInt(_0x36080d(0x94))/0xd);if(_0xce647a===_0x13c463)break;else _0x309d4e['push'](_0x309d4e['shift']());}catch(_0x3bb26a){_0x309d4e['push'](_0x309d4e['shift']());}}}(a30_0x28ef,0xae528));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a30_0x22ef(_0x4ef763,_0x379612){_0x4ef763=_0x4ef763-0x91;const _0x28ef60=a30_0x28ef();let _0x22ef92=_0x28ef60[_0x4ef763];return _0x22ef92;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a30_0x28ef(){const _0x45cb5d=['verbose','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','2591684sjgPSf','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','name','Parent\x20ID:\x20','segmentId','Updating\x20segment\x20\x27','90670YfMgzK','yellow','8zcUwIj','Examples:','1595741jrStJz','Resolving\x20path\x20\x27','data','parentId','INTERNAL','\x27...','error','Resolved\x20type:\x20','3PiQWGs','93664AHRLuw','segmentPath','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','82902RZlsZZ','Error:\x20Cannot\x20update\x20','kind','10399048Lmdxbs','1206fYVEzX','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','4qDWvEu','description','ruleFile','\x20\x20\x20Path:\x20','Update\x20existing\x20child\x20segment','Resolving\x20folder\x20\x27','folder','6998056pHOuAb','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','segment','updateSegmentById','includes','Segment\x20ID:\x20','type','48INPljf','340rRHcup','segment:update'];a30_0x28ef=function(){return _0x45cb5d;};return a30_0x28ef();}import a30_0x364b52 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x29bbbc(0xa2)]=a30_0x29bbbc(0x9d);[a30_0x29bbbc(0xbd)]=a30_0x29bbbc(0x91);async['execute'](_0x4ae1cb){const _0x49eac9=a30_0x29bbbc;console[_0x49eac9(0xb0)](a30_0x364b52[_0x49eac9(0xa7)](_0x49eac9(0x95))),console[_0x49eac9(0xb0)](a30_0x364b52['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x23a90,args:_0x2634cc,tdx:_0x425d35}=_0x4ae1cb,_0x139ba8=_0x23a90;if(_0x2634cc['length']===0x0)return console['error'](_0x49eac9(0xbb)),console['error']('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x49eac9(0xb0)](_0x49eac9(0xa9)),console[_0x49eac9(0xb0)](_0x49eac9(0xb5)),console[_0x49eac9(0xb0)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x308f6e=_0x2634cc[0x0],_0x3e22fe=_0x23a90[_0x49eac9(0xb4)];let _0x4cf486=_0x308f6e;_0x3e22fe&&!_0x308f6e[_0x49eac9(0x98)]('/')&&(_0x4cf486=_0x3e22fe+'/'+_0x308f6e,_0x139ba8['verbose']&&console[_0x49eac9(0xb0)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4cf486));const _0x1fd22d=await withSpinner(_0x49eac9(0xab)+_0x4cf486+_0x49eac9(0xaf),()=>_0x425d35[_0x49eac9(0x96)]['resolvePathToResource'](_0x4cf486),{'verbose':_0x139ba8[_0x49eac9(0x9e)]}),_0x4c9be1=_0x1fd22d['data'];_0x139ba8[_0x49eac9(0x9e)]&&console['error'](_0x49eac9(0xb1)+_0x4c9be1[_0x49eac9(0x9a)]);if(_0x4c9be1[_0x49eac9(0x9a)]!==_0x49eac9(0x96))return console[_0x49eac9(0xb0)](_0x49eac9(0xb7)+_0x4c9be1[_0x49eac9(0x9a)]+_0x49eac9(0x9f)),console[_0x49eac9(0xb0)](_0x49eac9(0xa1)),0x1;if(!_0x4c9be1[_0x49eac9(0xa4)])throw new SDKError(ErrorCode[_0x49eac9(0xae)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x567ea1=_0x4c9be1[_0x49eac9(0xad)],_0x42bafd=_0x4c9be1[_0x49eac9(0xa4)];_0x139ba8['verbose']&&(console[_0x49eac9(0xb0)](_0x49eac9(0xa3)+_0x567ea1),console[_0x49eac9(0xb0)](_0x49eac9(0x99)+_0x42bafd));let _0x137b7f;if(_0x139ba8[_0x49eac9(0x93)]){const _0x63747=_0x139ba8[_0x49eac9(0x93)],_0x18a207=await withSpinner(_0x49eac9(0x92)+_0x63747+'\x27...',()=>_0x425d35['segment']['resolveFolderId'](_0x567ea1,_0x63747),{'verbose':_0x139ba8[_0x49eac9(0x9e)]});_0x137b7f=parseInt(_0x18a207[_0x49eac9(0xac)],0xa),_0x139ba8[_0x49eac9(0x9e)]&&console[_0x49eac9(0xb0)]('Resolved\x20folder\x20ID:\x20'+_0x137b7f);}const _0x44721c=await loadJSONFromOptions(_0x139ba8['rule'],_0x139ba8[_0x49eac9(0xbe)]),_0x38e4b5={'name':_0x139ba8[_0x49eac9(0xa2)],'description':_0x139ba8[_0x49eac9(0xbd)],'rule':_0x44721c,'kind':_0x139ba8[_0x49eac9(0xb8)]!==undefined?parseInt(_0x139ba8['kind'],0xa):undefined,'segmentFolderId':_0x137b7f},_0x7ed324=await withSpinner(_0x49eac9(0xa5)+_0x4c9be1['segmentName']+'\x27...',()=>_0x425d35[_0x49eac9(0x96)][_0x49eac9(0x97)](_0x567ea1,_0x42bafd,_0x38e4b5),{'verbose':_0x139ba8[_0x49eac9(0x9e)]}),_0x573b56=_0x7ed324[_0x49eac9(0xac)];return console[_0x49eac9(0xb0)]('✔\x20Updated\x20segment\x20\x27'+_0x573b56['name']+'\x27'),_0x4cf486!==_0x308f6e&&console[_0x49eac9(0xb0)](_0x49eac9(0xbf)+_0x4cf486),await handleSDKOutput([_0x573b56],_0x139ba8),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x4ce482=a31_0x349d;(function(_0x154073,_0x358ddd){const _0x4f6bd4=a31_0x349d,_0x25f882=_0x154073();while(!![]){try{const _0x334cae=parseInt(_0x4f6bd4(0x202))/0x1*(parseInt(_0x4f6bd4(0x211))/0x2)+-parseInt(_0x4f6bd4(0x214))/0x3*(-parseInt(_0x4f6bd4(0x21c))/0x4)+-parseInt(_0x4f6bd4(0x21d))/0x5*(-parseInt(_0x4f6bd4(0x1ea))/0x6)+parseInt(_0x4f6bd4(0x20f))/0x7*(parseInt(_0x4f6bd4(0x207))/0x8)+parseInt(_0x4f6bd4(0x1fd))/0x9*(-parseInt(_0x4f6bd4(0x1fb))/0xa)+parseInt(_0x4f6bd4(0x1f1))/0xb+-parseInt(_0x4f6bd4(0x1f4))/0xc;if(_0x334cae===_0x358ddd)break;else _0x25f882['push'](_0x25f882['shift']());}catch(_0x3569dd){_0x25f882['push'](_0x25f882['shift']());}}}(a31_0x22b3,0xa70a9));import{existsSync,statSync}from'fs';import a31_0x43d40 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a31_0x349d(_0x25c415,_0x5a2ada){_0x25c415=_0x25c415-0x1ea;const _0x22b358=a31_0x22b3();let _0x349d3f=_0x22b358[_0x25c415];return _0x349d3f;}import{withSpinner}from'../utils/spinner.js';function a31_0x22b3(){const _0x39e7eb=['43067AbUDsJ','name','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','join','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','8bVKeBV','segment','Parent\x20ID:\x20','parentName','folderId','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segmentPath','verbose','2432087fYJGkX','length','26kYWbAv','cyan','segments','1386657IJFGyd','red','✔\x20Context\x20set\x20to:\x20','log','parent_segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','4YfACnR','745055RbmuUr','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','18XcSCfN','Error:\x20Path\x20is\x20required\x0a','error','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','parentId','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','config','9029823zQcVkC','\x27...','dim','12406248wptJVk','type','Use:\x20tdx\x20segment\x20use\x20','session','Target\x20path:\x20','execute','Examples:','790BCtrsM','Usage:\x20tdx\x20segment\x20use\x20<path>','104742XDLcUK','green','Resolved\x20path\x20type:\x20','isDirectory','slice'];a31_0x22b3=function(){return _0x39e7eb;};return a31_0x22b3();}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a31_0x4ce482(0x203)]='segment:use';['description']=a31_0x4ce482(0x21a);async[a31_0x4ce482(0x1f9)](_0x28bc9e){const _0x4e631c=a31_0x4ce482,{options:_0x17bfd1,args:_0x5281dc,tdx:_0x1b8dae}=_0x28bc9e;if(_0x5281dc[_0x4e631c(0x210)]===0x0)return console[_0x4e631c(0x1ec)](a31_0x43d40[_0x4e631c(0x215)](_0x4e631c(0x1eb))),console[_0x4e631c(0x1ec)](_0x4e631c(0x1fc)),console[_0x4e631c(0x1ec)](_0x4e631c(0x1fa)),console['error'](_0x4e631c(0x206)),console['error'](_0x4e631c(0x21b)),console[_0x4e631c(0x1ec)](_0x4e631c(0x204)),console[_0x4e631c(0x1ec)](_0x4e631c(0x219)),0x1;const _0x551208=_0x5281dc[0x0],_0x5cd14a=_0x17bfd1[_0x4e631c(0x1f7)];try{if(_0x551208==='/')return saveSessionContext({'segment_path':undefined},_0x5cd14a),console[_0x4e631c(0x217)](a31_0x43d40[_0x4e631c(0x1fe)](_0x4e631c(0x20c))),0x0;if(existsSync(_0x551208)&&statSync(_0x551208)[_0x4e631c(0x200)]()){let _0x5cf71d;try{_0x5cf71d=findTdxConfig(_0x551208);}catch{return console[_0x4e631c(0x1ec)](a31_0x43d40[_0x4e631c(0x215)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x551208)),console[_0x4e631c(0x1ec)](a31_0x43d40[_0x4e631c(0x212)](_0x4e631c(0x1ed))),0x1;}const _0x25fed7=_0x5cf71d[_0x4e631c(0x1f0)][_0x4e631c(0x218)];return saveSessionContext({'segment_path':_0x25fed7,'parent_segment':_0x25fed7},_0x5cd14a),console[_0x4e631c(0x217)](a31_0x43d40['green'](_0x4e631c(0x216)+a31_0x43d40[_0x4e631c(0x212)](_0x25fed7))),0x0;}const _0x4578ae=_0x17bfd1[_0x4e631c(0x20d)];let _0x5d1716=_0x551208;const _0x3b186d=parsePath(_0x551208);if(!_0x3b186d['isAbsolute']){if(!_0x4578ae)return console[_0x4e631c(0x1ec)](a31_0x43d40[_0x4e631c(0x215)](_0x4e631c(0x21f))),console[_0x4e631c(0x1ec)](a31_0x43d40['cyan'](_0x4e631c(0x1ef))),0x1;if(_0x551208==='..'){const _0x30d82b=_0x4578ae['split']('/')[_0x4e631c(0x201)](0x0,-0x1)[_0x4e631c(0x205)]('/');_0x5d1716=_0x30d82b||'/';}else _0x551208==='.'?_0x5d1716=_0x4578ae:_0x5d1716=_0x4578ae+'/'+_0x551208;_0x17bfd1['verbose']&&console[_0x4e631c(0x1ec)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5d1716);}if(_0x5d1716==='/'||_0x5d1716==='')return saveSessionContext({'segment_path':undefined},_0x5cd14a),console[_0x4e631c(0x217)](a31_0x43d40['green'](_0x4e631c(0x20c))),0x0;_0x5d1716=normalizePath(_0x5d1716);const _0x305309=parsePath(_0x5d1716)[_0x4e631c(0x213)];if(_0x305309[_0x4e631c(0x210)]===0x0)return saveSessionContext({'segment_path':undefined},_0x5cd14a),console[_0x4e631c(0x217)](a31_0x43d40[_0x4e631c(0x1fe)](_0x4e631c(0x20c))),0x0;_0x17bfd1['verbose']&&(console[_0x4e631c(0x1ec)]('Site:\x20'+_0x17bfd1['site']),console[_0x4e631c(0x1ec)](_0x4e631c(0x1f8)+_0x5d1716));const _0x1153ad=await withSpinner('Resolving\x20path\x20\x27'+_0x5d1716+_0x4e631c(0x1f2),()=>_0x1b8dae['segment']['resolvePathToResource'](_0x5d1716),{'verbose':_0x17bfd1['verbose']}),_0x1e4649=_0x1153ad['data'];_0x17bfd1[_0x4e631c(0x20e)]&&(console[_0x4e631c(0x1ec)](_0x4e631c(0x1ff)+_0x1e4649[_0x4e631c(0x1f5)]),console[_0x4e631c(0x1ec)](_0x4e631c(0x209)+_0x1e4649[_0x4e631c(0x1ee)]),_0x1e4649[_0x4e631c(0x20b)]&&console['error']('Folder\x20ID:\x20'+_0x1e4649[_0x4e631c(0x20b)]));if(_0x1e4649['type']===_0x4e631c(0x208))return console[_0x4e631c(0x1ec)](a31_0x43d40['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a31_0x43d40[_0x4e631c(0x212)](_0x4e631c(0x1f6)+_0x1e4649[_0x4e631c(0x20a)]+(_0x1e4649['folderPath']?'/'+_0x1e4649['folderPath'][_0x4e631c(0x205)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1e4649['fullPath'],'parent_segment':_0x1e4649['parentName']},_0x5cd14a),console[_0x4e631c(0x217)](a31_0x43d40[_0x4e631c(0x1fe)]('✔\x20Context\x20set\x20to:\x20'+a31_0x43d40[_0x4e631c(0x212)](_0x1e4649['fullPath']))),_0x17bfd1[_0x4e631c(0x20e)]&&(console[_0x4e631c(0x1ec)](a31_0x43d40['dim'](_0x4e631c(0x21e))),console[_0x4e631c(0x1ec)](a31_0x43d40[_0x4e631c(0x1f3)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x586d5e){throw _0x586d5e;}}}
|