@treasuredata/tdx 0.14.4 β 0.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +0 -4
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts +1 -1
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.d.ts +18 -0
- package/dist/commands/unset-command.d.ts.map +1 -0
- package/dist/commands/unset-command.js +1 -0
- package/dist/commands/unset-command.js.map +1 -0
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +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.d.ts +18 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +11 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +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.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts +25 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.d.ts +3 -0
- package/dist/utils/spinner.d.ts.map +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/spinner.js.map +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_0x2e3233=a25_0x48cb;(function(_0x48a20a,_0x3859b0){const _0x37a052=a25_0x48cb,_0x5080e0=_0x48a20a();while(!![]){try{const _0x264a59=-parseInt(_0x37a052(0x18c))/0x1*(-parseInt(_0x37a052(0x194))/0x2)+-parseInt(_0x37a052(0x18d))/0x3+-parseInt(_0x37a052(0x1bb))/0x4+parseInt(_0x37a052(0x160))/0x5+parseInt(_0x37a052(0x17e))/0x6+-parseInt(_0x37a052(0x15a))/0x7*(-parseInt(_0x37a052(0x165))/0x8)+parseInt(_0x37a052(0x1c4))/0x9;if(_0x264a59===_0x3859b0)break;else _0x5080e0['push'](_0x5080e0['shift']());}catch(_0x21859b){_0x5080e0['push'](_0x5080e0['shift']());}}}(a25_0x52fb,0x5554c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a25_0x52fb(){const _0x21ff2d=['error','trim','folderPath','Show\x20segment\x20folder\x20details','294vaZhUZ','verbose','Fetching\x20folder\x20\x27','\x20Opening\x20','length','segment:desc','2030865CudPrN','Usage:\x20tdx\x20sg\x20desc\x20<name>','/e/','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20sg\x20show\x20<name>','56696DRygZR','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','/app/ps/','parentFolder','message','β\x20Query\x20failed\x20[','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20sql','segmentName','segment:folder:list','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Parent\x20name:\x20','resolvePathToResource','β\x20Created\x20folder\x20\x27','getSegment','type','green','jsonl','\x27\x20with\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Folder\x20ID:\x20','query','Error:\x20Folder\x20reference\x20is\x20required','Folder\x20name:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','1462308PuHpRE','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','createFolder','parentSegment','description','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','format','β\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','SEGMENT_FOLDER_NOT_FOUND','5qFyZHr','1502487BtUAOL','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20Folder\x20path:\x20','SQL\x20query:\x0a','Executing\x20segment\x20query...','Resolved\x20type:\x20','log','39716lBSxZJ','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20relative\x20path\x20to:\x20','folder','Error:\x20','Use:\x20tdx\x20ps\x20view\x20-w','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','folderId','segment:folder:create','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Show\x20child\x20segment\x20schema\x20(column\x20types)','SEGMENT_NOT_FOUND','name','Listing\x20folders\x20for\x20parent\x20\x27','segment:sql','parent','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20folder','elapsedTimeMillis','Resolving\x20\x27','execute','url','code','Fetching\x20parent\x20segment\x20details...','Create\x20segment\x20folder\x20for\x20organization','segment:folder:show','in\x20','stats','fullPath','includes','jobId','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','(root)','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Fetching\x20segment\x20details...','\x27...','1550456gogsVX','Options:','Site:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolved\x20parent\x20folder\x20ID:\x20','toLocaleString','Examples:','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','segmentId','1720116QMBVtm','Resolving\x20path\x20\x27','\x20\x20Cause:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','web','Show\x20folder\x20or\x20child\x20segment\x20details','getSegmentSQL','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment:show','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:view','INVALID_ARGUMENT','replace','getFolder','Parent\x20segment:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','limit','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20Segment\x20name:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','cause','β\x20Found\x20','Resolved\x20YAML\x20file:\x20','Target\x20path:\x20','parentId','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','resolveParentId','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Fetching\x20folder\x20details...','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment','site','Fetching\x20SQL\x20for\x20segment...','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Use:\x20tdx\x20ps\x20show','Use:\x20tdx\x20ps\x20desc','\x20rows\x20','listFolders','data'];a25_0x52fb=function(){return _0x21ff2d;};return a25_0x52fb();}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';function a25_0x48cb(_0x55c0a3,_0x230bb1){_0x55c0a3=_0x55c0a3-0x14a;const _0x52fb16=a25_0x52fb();let _0x48cb81=_0x52fb16[_0x55c0a3];return _0x48cb81;}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_0x116e5c from'chalk';async function resolveSegmentTarget(_0x39e20f,_0x1e6f63,_0x173259){const _0x34e31e=a25_0x48cb;if(isYamlFilePath(_0x39e20f))try{const _0x3757e5=await resolveYamlFilePath(_0x39e20f);return _0x173259&&(console['error'](_0x34e31e(0x1dc)+_0x39e20f),console['error']('\x20\x20Parent\x20segment:\x20'+_0x3757e5[_0x34e31e(0x183)]),console[_0x34e31e(0x156)](_0x34e31e(0x1d8)+_0x3757e5[_0x34e31e(0x16d)]),console[_0x34e31e(0x156)](_0x34e31e(0x18f)+(_0x3757e5[_0x34e31e(0x158)]||_0x34e31e(0x1b7))),console[_0x34e31e(0x156)](_0x34e31e(0x180)+_0x3757e5['fullPath'])),_0x3757e5[_0x34e31e(0x1b3)];}catch(_0x43473a){throw new SDKError(ErrorCode[_0x34e31e(0x1d1)],_0x34e31e(0x17d)+_0x43473a[_0x34e31e(0x169)]);}if(!_0x1e6f63)throw new SDKError(ErrorCode[_0x34e31e(0x1d1)],_0x34e31e(0x18a));return _0x1e6f63+'/'+_0x39e20f;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x2e3233(0x1a2)]='segment:describe';['description']='Show\x20segment\x20or\x20folder\x20details';async[a25_0x2e3233(0x1ab)](_0x5dd46f){const _0x56c0ae=a25_0x2e3233,{options:_0x122850,args:_0x144771,tdx:_0x5b0e2c}=_0x5dd46f,_0x32bce9=_0x144771[0x0],_0x218956=!_0x32bce9&&!!_0x122850[_0x56c0ae(0x183)],_0x3fe314=_0x32bce9||_0x122850[_0x56c0ae(0x183)];if(!_0x3fe314)return console['error'](_0x56c0ae(0x1d5)),console[_0x56c0ae(0x156)](_0x56c0ae(0x1cb)),console[_0x56c0ae(0x156)](_0x56c0ae(0x1c1)),console[_0x56c0ae(0x156)](_0x56c0ae(0x181)),console['error'](_0x56c0ae(0x189)),console[_0x56c0ae(0x156)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x56c0ae(0x156)](_0x56c0ae(0x1df)),0x1;try{const _0x45f03e=_0x122850['segmentPath'];let _0x21984d=_0x3fe314;!_0x218956&&_0x45f03e&&!_0x3fe314[_0x56c0ae(0x1b4)]('/')&&(_0x21984d=_0x45f03e+'/'+_0x3fe314,_0x122850[_0x56c0ae(0x15b)]&&console[_0x56c0ae(0x156)](_0x56c0ae(0x196)+_0x21984d));const _0xec365b=await withSpinner(_0x56c0ae(0x1c5)+_0x21984d+_0x56c0ae(0x1ba),()=>_0x5b0e2c[_0x56c0ae(0x14c)]['resolvePathToResource'](_0x21984d),{'verbose':_0x122850[_0x56c0ae(0x15b)]}),_0x2bf5f3=_0xec365b['data'];_0x122850[_0x56c0ae(0x15b)]&&(console[_0x56c0ae(0x156)](_0x56c0ae(0x192)+_0x2bf5f3[_0x56c0ae(0x174)]),console['error']('Parent\x20ID:\x20'+_0x2bf5f3[_0x56c0ae(0x1de)]),_0x2bf5f3[_0x56c0ae(0x19d)]&&console[_0x56c0ae(0x156)](_0x56c0ae(0x179)+_0x2bf5f3[_0x56c0ae(0x19d)]),_0x2bf5f3[_0x56c0ae(0x1c3)]&&console['error']('Segment\x20ID:\x20'+_0x2bf5f3['segmentId']));if(_0x2bf5f3[_0x56c0ae(0x174)]===_0x56c0ae(0x1a5)){const _0x21a62f=await withSpinner(_0x56c0ae(0x1ae),()=>_0x5b0e2c[_0x56c0ae(0x14c)]['getParent'](_0x2bf5f3[_0x56c0ae(0x1de)]),{'verbose':_0x122850[_0x56c0ae(0x15b)]});await handleSingleObjectOutput(_0x21a62f[_0x56c0ae(0x155)],_0x122850);}else{if(_0x2bf5f3[_0x56c0ae(0x174)]===_0x56c0ae(0x197)){if(!_0x2bf5f3[_0x56c0ae(0x19d)])throw new SDKError(ErrorCode[_0x56c0ae(0x18b)],_0x56c0ae(0x14f));const _0x4ddb33=await withSpinner(_0x56c0ae(0x14a),()=>_0x5b0e2c[_0x56c0ae(0x14c)][_0x56c0ae(0x1d3)](_0x2bf5f3[_0x56c0ae(0x19d)]),{'verbose':_0x122850[_0x56c0ae(0x15b)]});await handleSingleObjectOutput(_0x4ddb33[_0x56c0ae(0x155)],_0x122850);}else{if(_0x2bf5f3[_0x56c0ae(0x174)]===_0x56c0ae(0x14c)){if(!_0x2bf5f3[_0x56c0ae(0x1c3)])throw new SDKError(ErrorCode[_0x56c0ae(0x1a1)],_0x56c0ae(0x19a));const _0x2155b=await withSpinner(_0x56c0ae(0x1b9),()=>_0x5b0e2c['segment'][_0x56c0ae(0x173)](_0x2bf5f3[_0x56c0ae(0x1de)],_0x2bf5f3['segmentId']),{'verbose':_0x122850[_0x56c0ae(0x15b)]});await handleSingleObjectOutput(_0x2155b[_0x56c0ae(0x155)],_0x122850);}}}return 0x0;}catch(_0x63397a){if(_0x63397a instanceof SDKError)return console[_0x56c0ae(0x156)](_0x56c0ae(0x198)+_0x63397a[_0x56c0ae(0x169)]),_0x63397a['cause']&&console[_0x56c0ae(0x156)](_0x56c0ae(0x1c6)+_0x63397a[_0x56c0ae(0x1da)]),0x1;throw _0x63397a;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x2e3233(0x1a2)]=a25_0x2e3233(0x1cc);['description']=a25_0x2e3233(0x150);async[a25_0x2e3233(0x1ab)](_0x5a9f70){const _0xa097e6=a25_0x2e3233,{options:_0x35f7db,args:_0x5a55a2,tdx:_0x1cdf5d}=_0x5a9f70,_0x5e5553=_0x5a55a2[0x0];if(!_0x5e5553)return console[_0xa097e6(0x156)](_0xa097e6(0x1a7)),console[_0xa097e6(0x156)](_0xa097e6(0x164)),console[_0xa097e6(0x156)](_0xa097e6(0x19c)),console[_0xa097e6(0x156)](_0xa097e6(0x1c1)),console[_0xa097e6(0x156)](_0xa097e6(0x186)),console['error'](_0xa097e6(0x1b8)),0x1;try{const _0x23d796=_0x35f7db[_0xa097e6(0x183)],_0x4d27cf=await resolveSegmentTarget(_0x5e5553,_0x23d796,_0x35f7db[_0xa097e6(0x15b)]);_0x35f7db['verbose']&&console[_0xa097e6(0x156)]('Target\x20path:\x20'+_0x4d27cf);const _0x101173=await withSpinner(_0xa097e6(0x1aa)+_0x5e5553+_0xa097e6(0x1ba),()=>_0x1cdf5d[_0xa097e6(0x14c)][_0xa097e6(0x171)](_0x4d27cf),{'verbose':_0x35f7db['verbose']}),_0x6e778c=_0x101173[_0xa097e6(0x155)];_0x35f7db[_0xa097e6(0x15b)]&&(console['error'](_0xa097e6(0x192)+_0x6e778c[_0xa097e6(0x174)]),console[_0xa097e6(0x156)](_0xa097e6(0x19b)+_0x6e778c[_0xa097e6(0x1de)]));if(_0x6e778c[_0xa097e6(0x174)]===_0xa097e6(0x197))return console[_0xa097e6(0x156)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0xa097e6(0x156)](_0xa097e6(0x1b6)),0x1;if(_0x6e778c[_0xa097e6(0x174)]===_0xa097e6(0x1a5))return console[_0xa097e6(0x156)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0xa097e6(0x156)](_0xa097e6(0x151)),0x1;if(!_0x6e778c[_0xa097e6(0x1c3)])throw new SDKError(ErrorCode[_0xa097e6(0x1a1)],_0xa097e6(0x19a));const _0x46f440=await withSpinner(_0xa097e6(0x14e),()=>_0x1cdf5d[_0xa097e6(0x14c)]['getSegmentSQL'](_0x6e778c['parentId'],_0x6e778c[_0xa097e6(0x1c3)]),{'verbose':_0x35f7db[_0xa097e6(0x15b)]});let _0x17e277=_0x46f440[_0xa097e6(0x155)];const _0x464f3e=resolveLimit(_0x35f7db[_0xa097e6(0x1d6)],DEFAULT_DISPLAY_LIMIT),_0x47e77f=/\bLIMIT\s+\d+/i['test'](_0x17e277);!_0x47e77f&&(_0x17e277=_0x17e277[_0xa097e6(0x157)]()[_0xa097e6(0x1d2)](/;+$/,''),_0x17e277='SELECT\x20*\x20FROM\x20(\x0a'+_0x17e277+_0xa097e6(0x1cd)+_0x464f3e);_0x35f7db[_0xa097e6(0x15b)]&&console['error'](_0xa097e6(0x190)+_0x17e277);const _0x59db8a=await withProgressSpinner(_0xa097e6(0x191),async _0x1bc7f3=>{const _0x2c3aa6=_0xa097e6,_0xdfe0f=await _0x1cdf5d[_0x2c3aa6(0x17a)]['execute'](_0x17e277,{'catalog':'td','schema':'information_schema','onJobId':_0x4b8644=>{_0x1bc7f3['setJobId'](_0x4b8644);}});return _0xdfe0f;},{'verbose':_0x35f7db[_0xa097e6(0x15b)]}),_0x1ebbc=_0x59db8a[_0xa097e6(0x155)],_0x1adfc4=_0x1ebbc[_0xa097e6(0x1b5)]?'\x20[Job\x20ID:\x20'+_0x1ebbc[_0xa097e6(0x1b5)]+']':'';return console[_0xa097e6(0x156)](_0xa097e6(0x188)+_0x1ebbc[_0xa097e6(0x1b2)]['processedRows'][_0xa097e6(0x1c0)]()+_0xa097e6(0x153)+(_0xa097e6(0x1b1)+formatElapsed(_0x1ebbc[_0xa097e6(0x1b2)][_0xa097e6(0x1a9)])+_0x1adfc4)),await handleQueryOutput(_0x1ebbc,_0x35f7db),0x0;}catch(_0x55ab23){if(_0x55ab23 instanceof SDKError)return console['error'](_0xa097e6(0x16a)+_0x55ab23[_0xa097e6(0x1ad)]+']'),console['error']('\x0a'+_0x55ab23[_0xa097e6(0x169)]),0x1;throw _0x55ab23;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x2e3233(0x1a2)]=a25_0x2e3233(0x16e);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x3d57ea){const _0x54a3b8=a25_0x2e3233,{options:_0x395306,args:_0x404314,tdx:_0x2e21ac}=_0x3d57ea;if(_0x404314['length']===0x0)return console['error'](_0x54a3b8(0x1d9)),console[_0x54a3b8(0x156)](_0x54a3b8(0x1cf)),0x1;const _0x12f919=_0x404314[0x0];try{_0x395306['verbose']&&(console[_0x54a3b8(0x156)](_0x54a3b8(0x1bd)+_0x395306[_0x54a3b8(0x14d)]),console[_0x54a3b8(0x156)](_0x54a3b8(0x170)+_0x12f919));const _0x345a41=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x12f919+_0x54a3b8(0x1ba),()=>_0x2e21ac[_0x54a3b8(0x14c)]['resolveParentId'](_0x12f919),{'verbose':_0x395306[_0x54a3b8(0x15b)]}),_0x46d0a1=_0x345a41[_0x54a3b8(0x155)];_0x395306[_0x54a3b8(0x15b)]&&console[_0x54a3b8(0x156)](_0x54a3b8(0x178)+_0x46d0a1);const _0x112396=await withSpinner(_0x54a3b8(0x1a3)+_0x12f919+_0x54a3b8(0x1ba),()=>_0x2e21ac[_0x54a3b8(0x14c)][_0x54a3b8(0x154)](_0x46d0a1),{'verbose':_0x395306['verbose']}),_0x5868a6=_0x112396[_0x54a3b8(0x155)];return console[_0x54a3b8(0x156)](_0x54a3b8(0x1db)+_0x5868a6[_0x54a3b8(0x15e)]+_0x54a3b8(0x1a8)+(_0x5868a6[_0x54a3b8(0x15e)]!==0x1?'s':'')),await handleSDKOutput(_0x5868a6,_0x395306),0x0;}catch(_0x41c28d){if(_0x41c28d instanceof SDKError)return console['error']('Error:\x20'+_0x41c28d['message']),_0x41c28d[_0x54a3b8(0x1da)]&&console[_0x54a3b8(0x156)](_0x54a3b8(0x1c6)+_0x41c28d['cause']),0x1;throw _0x41c28d;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x2e3233(0x1a2)]=a25_0x2e3233(0x1b0);[a25_0x2e3233(0x184)]=a25_0x2e3233(0x159);async[a25_0x2e3233(0x1ab)](_0x4ccac2){const _0x2df14f=a25_0x2e3233,{options:_0x16d4dc,args:_0x2621c8,tdx:_0x5a2ac6}=_0x4ccac2;if(_0x2621c8['length']===0x0)return console[_0x2df14f(0x156)](_0x2df14f(0x17b)),console[_0x2df14f(0x156)](_0x2df14f(0x166)),0x1;try{const {parentId:_0x3fa9db,childId:_0x326722}=parseSegmentRef(_0x2621c8[0x0]);_0x16d4dc[_0x2df14f(0x15b)]&&(console['error'](_0x2df14f(0x1bd)+_0x16d4dc[_0x2df14f(0x14d)]),console[_0x2df14f(0x156)](_0x2df14f(0x170)+_0x3fa9db),_0x326722&&console[_0x2df14f(0x156)](_0x2df14f(0x17c)+_0x326722));if(!_0x326722)return console['error'](_0x2df14f(0x19f)),0x1;const _0x10e70a=await withSpinner(_0x2df14f(0x185)+_0x3fa9db+_0x2df14f(0x1ba),()=>_0x5a2ac6[_0x2df14f(0x14c)][_0x2df14f(0x1e0)](_0x3fa9db),{'verbose':_0x16d4dc[_0x2df14f(0x15b)]}),_0xec4293=_0x10e70a[_0x2df14f(0x155)];_0x16d4dc[_0x2df14f(0x15b)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0xec4293);const _0x3874c1=await withSpinner('Resolving\x20folder\x20\x27'+_0x326722+_0x2df14f(0x1ba),()=>_0x5a2ac6[_0x2df14f(0x14c)]['resolveFolderId'](_0xec4293,_0x326722),{'verbose':_0x16d4dc[_0x2df14f(0x15b)]}),_0x279fa8=_0x3874c1[_0x2df14f(0x155)];_0x16d4dc[_0x2df14f(0x15b)]&&console[_0x2df14f(0x156)]('Resolved\x20folder\x20ID:\x20'+_0x279fa8);const _0x231fcb=await withSpinner(_0x2df14f(0x15c)+_0x326722+_0x2df14f(0x1ba),()=>_0x5a2ac6[_0x2df14f(0x14c)][_0x2df14f(0x1d3)](_0x279fa8),{'verbose':_0x16d4dc[_0x2df14f(0x15b)]});return await handleSDKOutput([_0x231fcb[_0x2df14f(0x155)]],_0x16d4dc),0x0;}catch(_0x17d11d){if(_0x17d11d instanceof SDKError)return console[_0x2df14f(0x156)](_0x2df14f(0x198)+_0x17d11d[_0x2df14f(0x169)]),_0x17d11d[_0x2df14f(0x1da)]&&console['error']('\x20\x20Cause:\x20'+_0x17d11d[_0x2df14f(0x1da)]),0x1;throw _0x17d11d;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x2e3233(0x1a2)]=a25_0x2e3233(0x1a4);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a25_0x2e3233(0x1ab)](_0x565853){const _0x39ce32=a25_0x2e3233,{options:_0x1c3728,args:_0x492353,tdx:_0x1732e6}=_0x565853,_0x3eb649=_0x492353[0x0];if(!_0x3eb649)return console['error'](_0x39ce32(0x1a7)),console[_0x39ce32(0x156)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console['error'](_0x39ce32(0x1c1)),console[_0x39ce32(0x156)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x39ce32(0x156)](_0x39ce32(0x1e1)),0x1;try{const _0x379442=_0x1c3728[_0x39ce32(0x183)],_0xb05209=await resolveSegmentTarget(_0x3eb649,_0x379442,_0x1c3728['verbose']);_0x1c3728[_0x39ce32(0x15b)]&&console[_0x39ce32(0x156)](_0x39ce32(0x1dd)+_0xb05209);const _0x20fc8b=await withSpinner(_0x39ce32(0x1aa)+_0x3eb649+_0x39ce32(0x1ba),()=>_0x1732e6[_0x39ce32(0x14c)][_0x39ce32(0x171)](_0xb05209),{'verbose':_0x1c3728['verbose']}),_0x1d7a3c=_0x20fc8b[_0x39ce32(0x155)];_0x1c3728['verbose']&&(console[_0x39ce32(0x156)](_0x39ce32(0x192)+_0x1d7a3c['type']),console['error']('Parent\x20ID:\x20'+_0x1d7a3c[_0x39ce32(0x1de)]));if(_0x1d7a3c['type']===_0x39ce32(0x197))return console[_0x39ce32(0x156)](_0x39ce32(0x195)),console['error'](_0x39ce32(0x14b)),0x1;if(_0x1d7a3c[_0x39ce32(0x174)]==='parent')return console[_0x39ce32(0x156)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x39ce32(0x156)](_0x39ce32(0x16c)),0x1;if(!_0x1d7a3c[_0x39ce32(0x1c3)])throw new SDKError(ErrorCode[_0x39ce32(0x1a1)],_0x39ce32(0x19a));const _0x12423c=await withSpinner(_0x39ce32(0x14e),()=>_0x1732e6['segment'][_0x39ce32(0x1ca)](_0x1d7a3c['parentId'],_0x1d7a3c['segmentId']),{'verbose':_0x1c3728[_0x39ce32(0x15b)]}),_0x4cd9b0=_0x12423c['data'];return _0x1c3728[_0x39ce32(0x187)]==='json'||_0x1c3728['format']===_0x39ce32(0x176)?await handleSDKOutput([{'sql':_0x4cd9b0}],_0x1c3728):console[_0x39ce32(0x193)](_0x4cd9b0),0x0;}catch(_0x3a6182){if(_0x3a6182 instanceof SDKError)return console['error'](_0x39ce32(0x198)+_0x3a6182['message']),_0x3a6182['cause']&&console[_0x39ce32(0x156)](_0x39ce32(0x1c6)+_0x3a6182[_0x39ce32(0x1da)]),0x1;throw _0x3a6182;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x2e3233(0x19e);[a25_0x2e3233(0x184)]=a25_0x2e3233(0x1af);async[a25_0x2e3233(0x1ab)](_0x34124d){const _0x526bf7=a25_0x2e3233,{options:_0x39fad5,args:_0x72500,tdx:_0x37e25e}=_0x34124d,_0x5a9394=_0x39fad5;if(_0x72500['length']<0x2)return console[_0x526bf7(0x156)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x31dd6e=_0x72500[0x0],_0x4b0fa0=_0x72500[0x1];_0x5a9394[_0x526bf7(0x15b)]&&(console[_0x526bf7(0x156)](_0x526bf7(0x1bd)+_0x5a9394[_0x526bf7(0x14d)]),console[_0x526bf7(0x156)](_0x526bf7(0x1d4)+_0x31dd6e),console[_0x526bf7(0x156)](_0x526bf7(0x17c)+_0x4b0fa0));let _0x5d8308;if(_0x5a9394[_0x526bf7(0x168)]){const _0x22f936=_0x5a9394[_0x526bf7(0x168)],_0x5f0593=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x31dd6e+_0x526bf7(0x1ba),()=>_0x37e25e['segment']['resolveParentId'](_0x31dd6e),{'verbose':_0x5a9394['verbose']}),_0x1ffc5c=_0x5f0593['data'],_0x47732b=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x22f936+_0x526bf7(0x1ba),()=>_0x37e25e['segment']['resolveFolderId'](_0x1ffc5c,_0x22f936),{'verbose':_0x5a9394['verbose']});_0x5d8308=_0x47732b['data'],_0x5a9394[_0x526bf7(0x15b)]&&console[_0x526bf7(0x156)](_0x526bf7(0x1bf)+_0x5d8308);}const _0x207d65={'name':_0x4b0fa0,'description':_0x5a9394[_0x526bf7(0x184)],'parentFolderId':_0x5d8308},_0x4f1761=await withSpinner('Creating\x20folder\x20\x27'+_0x4b0fa0+'\x27...',()=>_0x37e25e[_0x526bf7(0x14c)][_0x526bf7(0x182)](_0x31dd6e,_0x207d65),{'verbose':_0x5a9394[_0x526bf7(0x15b)]}),_0x502a19=_0x4f1761['data'];return console['error'](_0x526bf7(0x172)+_0x502a19[_0x526bf7(0x1a2)]+_0x526bf7(0x177)+_0x502a19['id']),await handleSDKOutput([_0x502a19],_0x5a9394),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x2e3233(0x1a2)]=a25_0x2e3233(0x1d0);['description']=a25_0x2e3233(0x1c9);async[a25_0x2e3233(0x1ab)](_0x400447){const _0x267c32=a25_0x2e3233,{options:_0x4960a9,args:_0x1b7ba1,tdx:_0x58a510}=_0x400447,_0x4f6fd8=_0x1b7ba1[0x0];if(!_0x4f6fd8)return console[_0x267c32(0x156)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x267c32(0x156)](_0x267c32(0x163)),console['error'](_0x267c32(0x1ce)),console[_0x267c32(0x156)](_0x267c32(0x1bc)),console[_0x267c32(0x156)](_0x267c32(0x1d7)),console[_0x267c32(0x156)](_0x267c32(0x1c1)),console[_0x267c32(0x156)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error'](_0x267c32(0x17f)),console[_0x267c32(0x156)](_0x267c32(0x18e)),console[_0x267c32(0x156)](_0x267c32(0x1be)),0x1;try{const _0x2d8ccd=_0x4960a9['parentSegment'],_0x4dd0eb=await resolveSegmentTarget(_0x4f6fd8,_0x2d8ccd,_0x4960a9['verbose']);_0x4960a9['verbose']&&console[_0x267c32(0x156)](_0x267c32(0x1dd)+_0x4dd0eb);const _0x360dfb=await withSpinner(_0x267c32(0x1aa)+_0x4f6fd8+_0x267c32(0x1ba),()=>_0x58a510[_0x267c32(0x14c)][_0x267c32(0x171)](_0x4dd0eb),{'verbose':_0x4960a9[_0x267c32(0x15b)]}),_0x1e989b=_0x360dfb[_0x267c32(0x155)];_0x4960a9['verbose']&&(console[_0x267c32(0x156)](_0x267c32(0x192)+_0x1e989b[_0x267c32(0x174)]),console[_0x267c32(0x156)](_0x267c32(0x19b)+_0x1e989b[_0x267c32(0x1de)]),_0x1e989b[_0x267c32(0x19d)]&&console[_0x267c32(0x156)](_0x267c32(0x179)+_0x1e989b['folderId']),_0x1e989b['segmentId']&&console[_0x267c32(0x156)]('Segment\x20ID:\x20'+_0x1e989b[_0x267c32(0x1c3)]));if(_0x4960a9[_0x267c32(0x1c8)]){if(_0x1e989b[_0x267c32(0x174)]===_0x267c32(0x197))return console[_0x267c32(0x156)](_0x267c32(0x1c2)),0x1;if(_0x1e989b[_0x267c32(0x174)]===_0x267c32(0x1a5))return console['error'](_0x267c32(0x1c7)),console['error'](_0x267c32(0x199)),0x1;if(!_0x1e989b[_0x267c32(0x1c3)])throw new SDKError(ErrorCode[_0x267c32(0x1a1)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x47d162=getConsoleNextUrl(_0x4960a9[_0x267c32(0x14d)],_0x267c32(0x167)+_0x1e989b['parentId']+'/e/'+_0x1e989b[_0x267c32(0x1c3)]);return console[_0x267c32(0x156)](a25_0x116e5c[_0x267c32(0x175)]('β')+_0x267c32(0x15d)+a25_0x116e5c['cyan'](_0x47d162)),openBrowser(_0x47d162),0x0;}if(_0x1e989b[_0x267c32(0x174)]===_0x267c32(0x197)){if(!_0x1e989b[_0x267c32(0x19d)])throw new SDKError(ErrorCode[_0x267c32(0x18b)],_0x267c32(0x14f));const _0xe36b1e=await withSpinner('Fetching\x20folder\x20details...',()=>_0x58a510['segment'][_0x267c32(0x1d3)](_0x1e989b[_0x267c32(0x19d)]),{'verbose':_0x4960a9[_0x267c32(0x15b)]});await handleSingleObjectOutput(_0xe36b1e[_0x267c32(0x155)],_0x4960a9);}else{if(_0x1e989b['type']===_0x267c32(0x14c)){if(!_0x1e989b[_0x267c32(0x1c3)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x30efc9=await withSpinner(_0x267c32(0x1b9),()=>_0x58a510[_0x267c32(0x14c)]['getSegment'](_0x1e989b[_0x267c32(0x1de)],_0x1e989b[_0x267c32(0x1c3)]),{'verbose':_0x4960a9[_0x267c32(0x15b)]}),_0x58870d=getConsoleNextUrl(_0x4960a9[_0x267c32(0x14d)],_0x267c32(0x167)+_0x1e989b[_0x267c32(0x1de)]+_0x267c32(0x162)+_0x1e989b[_0x267c32(0x1c3)]),_0x26ff90=_0x30efc9[_0x267c32(0x155)];_0x26ff90[_0x267c32(0x1ac)]=_0x58870d,await handleSingleObjectOutput(_0x26ff90,_0x4960a9);}else return console['error'](_0x267c32(0x16f)),console[_0x267c32(0x156)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x2df4cc){if(_0x2df4cc instanceof SDKError)return console['error'](_0x267c32(0x198)+_0x2df4cc[_0x267c32(0x169)]),_0x2df4cc[_0x267c32(0x1da)]&&console['error'](_0x267c32(0x1c6)+_0x2df4cc['cause']),0x1;throw _0x2df4cc;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x2e3233(0x1a2)]=a25_0x2e3233(0x15f);[a25_0x2e3233(0x184)]=a25_0x2e3233(0x1a0);async['execute'](_0x565ea4){const _0x56144b=a25_0x2e3233,{options:_0x4e88f0,args:_0x4c2cee,tdx:_0x3634da}=_0x565ea4,_0xf81357=_0x4c2cee[0x0];if(!_0xf81357)return console[_0x56144b(0x156)](_0x56144b(0x1a7)),console[_0x56144b(0x156)](_0x56144b(0x161)),console[_0x56144b(0x156)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x56144b(0x1c1)),console[_0x56144b(0x156)](_0x56144b(0x16b)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3d3d32=_0x4e88f0[_0x56144b(0x183)],_0x559f46=await resolveSegmentTarget(_0xf81357,_0x3d3d32,_0x4e88f0[_0x56144b(0x15b)]);_0x4e88f0[_0x56144b(0x15b)]&&console[_0x56144b(0x156)](_0x56144b(0x1dd)+_0x559f46);const _0xcceb96=await withSpinner(_0x56144b(0x1aa)+_0xf81357+_0x56144b(0x1ba),()=>_0x3634da[_0x56144b(0x14c)][_0x56144b(0x171)](_0x559f46),{'verbose':_0x4e88f0['verbose']}),_0x3e3385=_0xcceb96[_0x56144b(0x155)];_0x4e88f0[_0x56144b(0x15b)]&&(console[_0x56144b(0x156)](_0x56144b(0x192)+_0x3e3385[_0x56144b(0x174)]),console[_0x56144b(0x156)](_0x56144b(0x19b)+_0x3e3385['parentId']));if(_0x3e3385[_0x56144b(0x174)]===_0x56144b(0x197))return console[_0x56144b(0x156)](_0x56144b(0x1a6)),console[_0x56144b(0x156)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x3e3385['type']===_0x56144b(0x1a5))return console[_0x56144b(0x156)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x56144b(0x156)](_0x56144b(0x152)),0x1;if(!_0x3e3385[_0x56144b(0x1c3)])throw new SDKError(ErrorCode[_0x56144b(0x1a1)],_0x56144b(0x19a));const _0x25a8d5=await withSpinner(_0x56144b(0x14e),()=>_0x3634da[_0x56144b(0x14c)][_0x56144b(0x1ca)](_0x3e3385['parentId'],_0x3e3385['segmentId']),{'verbose':_0x4e88f0[_0x56144b(0x15b)]}),_0x1eef4b=_0x25a8d5[_0x56144b(0x155)],_0x31a870=await executeSchemaQuery(_0x1eef4b,_0x3634da,_0x4e88f0);return await handleQueryOutput(_0x31a870,_0x4e88f0),0x0;}catch(_0x462a38){if(_0x462a38 instanceof SDKError)return console[_0x56144b(0x156)]('Error:\x20'+_0x462a38[_0x56144b(0x169)]),_0x462a38[_0x56144b(0x1da)]&&console[_0x56144b(0x156)](_0x56144b(0x1c6)+_0x462a38['cause']),0x1;throw _0x462a38;}}}
|
|
1
|
+
const a25_0x1916b8=a25_0x4534;(function(_0x31d7ef,_0x3c2faa){const _0x30edcf=a25_0x4534,_0x35ea76=_0x31d7ef();while(!![]){try{const _0x54706d=parseInt(_0x30edcf(0x101))/0x1+-parseInt(_0x30edcf(0x77))/0x2*(parseInt(_0x30edcf(0x9a))/0x3)+parseInt(_0x30edcf(0xf5))/0x4*(-parseInt(_0x30edcf(0xc2))/0x5)+parseInt(_0x30edcf(0x78))/0x6*(-parseInt(_0x30edcf(0x73))/0x7)+parseInt(_0x30edcf(0xe4))/0x8*(parseInt(_0x30edcf(0xec))/0x9)+-parseInt(_0x30edcf(0x75))/0xa*(-parseInt(_0x30edcf(0xa6))/0xb)+-parseInt(_0x30edcf(0xac))/0xc*(-parseInt(_0x30edcf(0xbb))/0xd);if(_0x54706d===_0x3c2faa)break;else _0x35ea76['push'](_0x35ea76['shift']());}catch(_0x1f0a53){_0x35ea76['push'](_0x35ea76['shift']());}}}(a25_0x3da2,0xe9466));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';function a25_0x3da2(){const _0x3bcbaa=['web','451644tBLhPO','log','segment:view','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','format','\x27...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','jsonl','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20[Job\x20ID:\x20','Use:\x20tdx\x20ps\x20show','\x20\x20Parent\x20segment:\x20','length','208FHnJpa','Segment\x20ID:\x20','resolveParentId','parentSegment','listFolders','code','Fetching\x20parent\x20segment\x20details...','34535ZyIAcl','limit','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x27\x20with\x20ID:\x20','description','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','site','getSegmentSQL','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Resolving\x20folder\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Target\x20path:\x20','getSegment','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20Opening\x20','setJobId','folder','Resolved\x20relative\x20path\x20to:\x20','parentFolder','Error:\x20Parent\x20segment\x20name\x20is\x20required','cyan','Resolving\x20parent\x20segment\x20\x27','SEGMENT_NOT_FOUND','β\x20Found\x20','Create\x20segment\x20folder\x20for\x20organization','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:show','includes','Resolved\x20type:\x20','segment:folder:list','url','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','2101576CqTrKS','createFolder','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','execute','getFolder','\x20\x20Folder\x20path:\x20','\x20rows\x20','Resolved\x20YAML\x20file:\x20','9yXaZEy','(root)','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20Cause:\x20','Fetching\x20folder\x20details...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Parent\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','692gLiOmv','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','toLocaleString','error','resolvePathToResource','Resolving\x20\x27','/app/ps/','/e/','type','β\x20Query\x20failed\x20[','INVALID_ARGUMENT','fullPath','1762537rLXcYI','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20folder\x20\x27','β\x20Created\x20folder\x20\x27','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','β\x20Query\x20completed:\x20Processed\x20','segment:describe','data','Fetching\x20SQL\x20for\x20segment...','resolveFolderId','segment:folder:create','Resolved\x20parent\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','7xPJDRs','jobId','1224860qSMPsa','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','2bCNZHw','7481688wWLfvV','getParent','Usage:\x20tdx\x20sg\x20show\x20<name>','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','folderId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x20\x20Full\x20path:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','parent','Use:\x20tdx\x20ps\x20view','Resolved\x20parent\x20folder\x20ID:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','cause','SQL\x20query:\x0a','Parent\x20name:\x20','Parent\x20segment:\x20','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20segment\x20details...','\x20\x20Segment\x20name:\x20','Site:\x20','segmentPath','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','segment','Examples:','parentId','Resolving\x20parent\x20folder\x20\x27','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','elapsedTimeMillis','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','query','1364799GWtlhY','Show\x20segment\x20folder\x20details','Resolved\x20folder\x20ID:\x20','verbose','Folder\x20name:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','json','segmentId','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20','segment:desc','110PgPxWl','Use:\x20tdx\x20ps\x20view\x20-w','name','segment:show','Get\x20SQL\x20query\x20for\x20child\x20segment'];a25_0x3da2=function(){return _0x3bcbaa;};return a25_0x3da2();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a25_0x4534(_0x1be596,_0x2eaa46){_0x1be596=_0x1be596-0x67;const _0x3da216=a25_0x3da2();let _0x4534c6=_0x3da216[_0x1be596];return _0x4534c6;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x76439b from'chalk';async function resolveSegmentTarget(_0x2b9f8e,_0x5d9ef9,_0x1b0e52){const _0x2b2c31=a25_0x4534;if(isYamlFilePath(_0x2b9f8e))try{const _0xd879d8=await resolveYamlFilePath(_0x2b9f8e);return _0x1b0e52&&(console[_0x2b2c31(0xf8)](_0x2b2c31(0xeb)+_0x2b9f8e),console[_0x2b2c31(0xf8)](_0x2b2c31(0xb9)+_0xd879d8[_0x2b2c31(0xbe)]),console['error'](_0x2b2c31(0x8c)+_0xd879d8['segmentName']),console[_0x2b2c31(0xf8)](_0x2b2c31(0xe9)+(_0xd879d8['folderPath']||_0x2b2c31(0xed))),console[_0x2b2c31(0xf8)](_0x2b2c31(0x80)+_0xd879d8['fullPath'])),_0xd879d8[_0x2b2c31(0x100)];}catch(_0x25d128){throw new SDKError(ErrorCode[_0x2b2c31(0xff)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x25d128[_0x2b2c31(0x94)]);}if(!_0x5d9ef9)throw new SDKError(ErrorCode[_0x2b2c31(0xff)],_0x2b2c31(0xe3));return _0x5d9ef9+'/'+_0x2b9f8e;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x1916b8(0x6c);['description']=a25_0x1916b8(0x7b);async[a25_0x1916b8(0xe7)](_0xc34875){const _0x28815e=a25_0x1916b8,{options:_0x4575f4,args:_0x1d5ae9,tdx:_0x3f1e82}=_0xc34875,_0x21ee61=_0x1d5ae9[0x0],_0x5b61f6=!_0x21ee61&&!!_0x4575f4[_0x28815e(0xbe)],_0x5116fa=_0x21ee61||_0x4575f4[_0x28815e(0xbe)];if(!_0x5116fa)return console[_0x28815e(0xf8)](_0x28815e(0x102)),console[_0x28815e(0xf8)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x28815e(0xf8)](_0x28815e(0x7e)),console['error'](_0x28815e(0x103)),console[_0x28815e(0xf8)](_0x28815e(0xce)),0x1;try{const _0x1832ff=_0x4575f4[_0x28815e(0x8e)];let _0x182943=_0x5116fa;!_0x5b61f6&&_0x1832ff&&!_0x5116fa[_0x28815e(0xdf)]('/')&&(_0x182943=_0x1832ff+'/'+_0x5116fa,_0x4575f4[_0x28815e(0x9d)]&&console[_0x28815e(0xf8)](_0x28815e(0xd5)+_0x182943));const _0x5aeb5d=await withSpinner('Resolving\x20path\x20\x27'+_0x182943+_0x28815e(0xb2),()=>_0x3f1e82[_0x28815e(0x90)]['resolvePathToResource'](_0x182943),{'verbose':_0x4575f4[_0x28815e(0x9d)]}),_0x332181=_0x5aeb5d['data'];_0x4575f4['verbose']&&(console[_0x28815e(0xf8)](_0x28815e(0xe0)+_0x332181[_0x28815e(0xfd)]),console[_0x28815e(0xf8)](_0x28815e(0xf3)+_0x332181['parentId']),_0x332181[_0x28815e(0x7d)]&&console[_0x28815e(0xf8)]('Folder\x20ID:\x20'+_0x332181[_0x28815e(0x7d)]),_0x332181[_0x28815e(0xa1)]&&console[_0x28815e(0xf8)](_0x28815e(0xbc)+_0x332181[_0x28815e(0xa1)]));if(_0x332181['type']===_0x28815e(0x82)){const _0x21ecd5=await withSpinner(_0x28815e(0xc1),()=>_0x3f1e82['segment'][_0x28815e(0x79)](_0x332181['parentId']),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x21ecd5[_0x28815e(0x6d)],_0x4575f4);}else{if(_0x332181[_0x28815e(0xfd)]===_0x28815e(0xd4)){if(!_0x332181[_0x28815e(0x7d)])throw new SDKError(ErrorCode[_0x28815e(0x8a)],_0x28815e(0xdd));const _0x73226d=await withSpinner(_0x28815e(0xf1),()=>_0x3f1e82[_0x28815e(0x90)][_0x28815e(0xe8)](_0x332181[_0x28815e(0x7d)]),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x73226d[_0x28815e(0x6d)],_0x4575f4);}else{if(_0x332181['type']===_0x28815e(0x90)){if(!_0x332181[_0x28815e(0xa1)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x28815e(0xf4));const _0x93863b=await withSpinner('Fetching\x20segment\x20details...',()=>_0x3f1e82[_0x28815e(0x90)][_0x28815e(0xd0)](_0x332181[_0x28815e(0x92)],_0x332181[_0x28815e(0xa1)]),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x93863b[_0x28815e(0x6d)],_0x4575f4);}}}return 0x0;}catch(_0x2aab77){if(_0x2aab77 instanceof SDKError)return console[_0x28815e(0xf8)](_0x28815e(0xa4)+_0x2aab77[_0x28815e(0x94)]),_0x2aab77[_0x28815e(0x86)]&&console[_0x28815e(0xf8)]('\x20\x20Cause:\x20'+_0x2aab77[_0x28815e(0x86)]),0x1;throw _0x2aab77;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xa9);[a25_0x1916b8(0xc7)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x36ea9e){const _0x27d997=a25_0x1916b8,{options:_0x146ebf,args:_0x1ff14e,tdx:_0x2f56e0}=_0x36ea9e,_0x2628d7=_0x1ff14e[0x0];if(!_0x2628d7)return console['error'](_0x27d997(0x8f)),console[_0x27d997(0xf8)](_0x27d997(0x7a)),console[_0x27d997(0xf8)](_0x27d997(0xf2)),console[_0x27d997(0xf8)](_0x27d997(0x91)),console[_0x27d997(0xf8)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error'](_0x27d997(0x6a)),0x1;try{const _0x60bcac=_0x146ebf[_0x27d997(0xbe)],_0x53b7a0=await resolveSegmentTarget(_0x2628d7,_0x60bcac,_0x146ebf[_0x27d997(0x9d)]);_0x146ebf['verbose']&&console[_0x27d997(0xf8)]('Target\x20path:\x20'+_0x53b7a0);const _0x58e3c9=await withSpinner(_0x27d997(0xfa)+_0x2628d7+_0x27d997(0xb2),()=>_0x2f56e0['segment'][_0x27d997(0xf9)](_0x53b7a0),{'verbose':_0x146ebf[_0x27d997(0x9d)]}),_0x38fb00=_0x58e3c9['data'];_0x146ebf[_0x27d997(0x9d)]&&(console['error'](_0x27d997(0xe0)+_0x38fb00[_0x27d997(0xfd)]),console['error']('Parent\x20ID:\x20'+_0x38fb00[_0x27d997(0x92)]));if(_0x38fb00[_0x27d997(0xfd)]==='folder')return console['error'](_0x27d997(0xaf)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x38fb00['type']===_0x27d997(0x82))return console[_0x27d997(0xf8)](_0x27d997(0xe6)),console[_0x27d997(0xf8)](_0x27d997(0xb8)),0x1;if(!_0x38fb00[_0x27d997(0xa1)])throw new SDKError(ErrorCode[_0x27d997(0xda)],_0x27d997(0xf4));const _0x36a59b=await withSpinner(_0x27d997(0x6e),()=>_0x2f56e0[_0x27d997(0x90)][_0x27d997(0xca)](_0x38fb00[_0x27d997(0x92)],_0x38fb00[_0x27d997(0xa1)]),{'verbose':_0x146ebf[_0x27d997(0x9d)]});let _0x597648=_0x36a59b[_0x27d997(0x6d)];const _0xaf17d6=resolveLimit(_0x146ebf[_0x27d997(0xc3)],DEFAULT_DISPLAY_LIMIT),_0xf7947f=/\bLIMIT\s+\d+/i['test'](_0x597648);!_0xf7947f&&(_0x597648=_0x597648['trim']()['replace'](/;+$/,''),_0x597648='SELECT\x20*\x20FROM\x20(\x0a'+_0x597648+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0xaf17d6);_0x146ebf['verbose']&&console[_0x27d997(0xf8)](_0x27d997(0x87)+_0x597648);const _0x56ad50=await withProgressSpinner('Executing\x20segment\x20query...',async _0x42eb90=>{const _0x46ad8d=_0x27d997,_0x120bc9=await _0x2f56e0[_0x46ad8d(0x99)][_0x46ad8d(0xe7)](_0x597648,{'catalog':'td','schema':'information_schema','onJobId':_0x2ae28c=>{const _0x7f3f4d=_0x46ad8d;_0x42eb90[_0x7f3f4d(0xd3)](_0x2ae28c);}});return _0x120bc9;},{'verbose':_0x146ebf[_0x27d997(0x9d)]}),_0x36d069=_0x56ad50[_0x27d997(0x6d)],_0xddb4ca=_0x36d069[_0x27d997(0x74)]?_0x27d997(0xb7)+_0x36d069['jobId']+']':'';return console[_0x27d997(0xf8)](_0x27d997(0x6b)+_0x36d069['stats']['processedRows'][_0x27d997(0xf7)]()+_0x27d997(0xea)+('in\x20'+formatElapsed(_0x36d069['stats'][_0x27d997(0x96)])+_0xddb4ca)),await handleQueryOutput(_0x36d069,_0x146ebf),0x0;}catch(_0xb06e77){if(_0xb06e77 instanceof SDKError)return console[_0x27d997(0xf8)](_0x27d997(0xfe)+_0xb06e77[_0x27d997(0xc0)]+']'),console[_0x27d997(0xf8)]('\x0a'+_0xb06e77[_0x27d997(0x94)]),0x1;throw _0xb06e77;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x1916b8(0xe1);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0x81);async[a25_0x1916b8(0xe7)](_0x29363b){const _0x5d0c1f=a25_0x1916b8,{options:_0x3e7bd,args:_0x19fe2d,tdx:_0x15cd30}=_0x29363b;if(_0x19fe2d[_0x5d0c1f(0xba)]===0x0)return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xd7)),console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xc5)),0x1;const _0x22e56e=_0x19fe2d[0x0];try{_0x3e7bd[_0x5d0c1f(0x9d)]&&(console[_0x5d0c1f(0xf8)](_0x5d0c1f(0x8d)+_0x3e7bd['site']),console['error'](_0x5d0c1f(0x88)+_0x22e56e));const _0x5c3756=await withSpinner(_0x5d0c1f(0xd9)+_0x22e56e+_0x5d0c1f(0xb2),()=>_0x15cd30['segment'][_0x5d0c1f(0xbd)](_0x22e56e),{'verbose':_0x3e7bd[_0x5d0c1f(0x9d)]}),_0x37541a=_0x5c3756[_0x5d0c1f(0x6d)];_0x3e7bd[_0x5d0c1f(0x9d)]&&console[_0x5d0c1f(0xf8)]('Resolved\x20parent\x20ID:\x20'+_0x37541a);const _0x11a852=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x22e56e+_0x5d0c1f(0xb2),()=>_0x15cd30[_0x5d0c1f(0x90)][_0x5d0c1f(0xbf)](_0x37541a),{'verbose':_0x3e7bd[_0x5d0c1f(0x9d)]}),_0x480f42=_0x11a852[_0x5d0c1f(0x6d)];return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xdb)+_0x480f42[_0x5d0c1f(0xba)]+'\x20folder'+(_0x480f42['length']!==0x1?'s':'')),await handleSDKOutput(_0x480f42,_0x3e7bd),0x0;}catch(_0x754486){if(_0x754486 instanceof SDKError)return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xa4)+_0x754486[_0x5d0c1f(0x94)]),_0x754486['cause']&&console[_0x5d0c1f(0xf8)]('\x20\x20Cause:\x20'+_0x754486[_0x5d0c1f(0x86)]),0x1;throw _0x754486;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xde);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0x9b);async['execute'](_0x14477f){const _0x2f0761=a25_0x1916b8,{options:_0x13711c,args:_0x5a776b,tdx:_0x3468d3}=_0x14477f;if(_0x5a776b[_0x2f0761(0xba)]===0x0)return console['error'](_0x2f0761(0xcb)),console[_0x2f0761(0xf8)](_0x2f0761(0x69)),0x1;try{const {parentId:_0x1fbc59,childId:_0x3759ee}=parseSegmentRef(_0x5a776b[0x0]);_0x13711c['verbose']&&(console[_0x2f0761(0xf8)](_0x2f0761(0x8d)+_0x13711c['site']),console['error']('Parent\x20name:\x20'+_0x1fbc59),_0x3759ee&&console[_0x2f0761(0xf8)](_0x2f0761(0x9e)+_0x3759ee));if(!_0x3759ee)return console[_0x2f0761(0xf8)](_0x2f0761(0x72)),0x1;const _0x126bfd=await withSpinner(_0x2f0761(0xd9)+_0x1fbc59+_0x2f0761(0xb2),()=>_0x3468d3[_0x2f0761(0x90)][_0x2f0761(0xbd)](_0x1fbc59),{'verbose':_0x13711c[_0x2f0761(0x9d)]}),_0x573de5=_0x126bfd[_0x2f0761(0x6d)];_0x13711c[_0x2f0761(0x9d)]&&console['error'](_0x2f0761(0x71)+_0x573de5);const _0x3f83e9=await withSpinner(_0x2f0761(0xcd)+_0x3759ee+_0x2f0761(0xb2),()=>_0x3468d3[_0x2f0761(0x90)][_0x2f0761(0x6f)](_0x573de5,_0x3759ee),{'verbose':_0x13711c['verbose']}),_0x492fe9=_0x3f83e9[_0x2f0761(0x6d)];_0x13711c[_0x2f0761(0x9d)]&&console['error'](_0x2f0761(0x9c)+_0x492fe9);const _0x57b636=await withSpinner(_0x2f0761(0x104)+_0x3759ee+_0x2f0761(0xb2),()=>_0x3468d3['segment']['getFolder'](_0x492fe9),{'verbose':_0x13711c[_0x2f0761(0x9d)]});return await handleSDKOutput([_0x57b636[_0x2f0761(0x6d)]],_0x13711c),0x0;}catch(_0x1a7aa9){if(_0x1a7aa9 instanceof SDKError)return console[_0x2f0761(0xf8)](_0x2f0761(0xa4)+_0x1a7aa9['message']),_0x1a7aa9['cause']&&console[_0x2f0761(0xf8)]('\x20\x20Cause:\x20'+_0x1a7aa9[_0x2f0761(0x86)]),0x1;throw _0x1a7aa9;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x1916b8(0xa8)]='segment:sql';[a25_0x1916b8(0xc7)]=a25_0x1916b8(0xaa);async[a25_0x1916b8(0xe7)](_0x5c363b){const _0xef04e7=a25_0x1916b8,{options:_0x4170cb,args:_0x1f16bf,tdx:_0x1b4813}=_0x5c363b,_0x2032a1=_0x1f16bf[0x0];if(!_0x2032a1)return console['error'](_0xef04e7(0x8f)),console[_0xef04e7(0xf8)](_0xef04e7(0x7f)),console['error'](_0xef04e7(0x95)),console[_0xef04e7(0xf8)]('Examples:'),console[_0xef04e7(0xf8)](_0xef04e7(0xb0)),console[_0xef04e7(0xf8)](_0xef04e7(0xb4)),0x1;try{const _0xd4e160=_0x4170cb[_0xef04e7(0xbe)],_0x33ced3=await resolveSegmentTarget(_0x2032a1,_0xd4e160,_0x4170cb[_0xef04e7(0x9d)]);_0x4170cb[_0xef04e7(0x9d)]&&console['error'](_0xef04e7(0xcf)+_0x33ced3);const _0x14a7dd=await withSpinner('Resolving\x20\x27'+_0x2032a1+_0xef04e7(0xb2),()=>_0x1b4813[_0xef04e7(0x90)]['resolvePathToResource'](_0x33ced3),{'verbose':_0x4170cb['verbose']}),_0x5d99a5=_0x14a7dd[_0xef04e7(0x6d)];_0x4170cb[_0xef04e7(0x9d)]&&(console[_0xef04e7(0xf8)](_0xef04e7(0xe0)+_0x5d99a5['type']),console[_0xef04e7(0xf8)](_0xef04e7(0xf3)+_0x5d99a5['parentId']));if(_0x5d99a5[_0xef04e7(0xfd)]===_0xef04e7(0xd4))return console[_0xef04e7(0xf8)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0xef04e7(0xf8)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x5d99a5[_0xef04e7(0xfd)]==='parent')return console['error'](_0xef04e7(0xee)),console['error']('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x5d99a5['segmentId'])throw new SDKError(ErrorCode[_0xef04e7(0xda)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x923b0e=await withSpinner(_0xef04e7(0x6e),()=>_0x1b4813[_0xef04e7(0x90)][_0xef04e7(0xca)](_0x5d99a5['parentId'],_0x5d99a5[_0xef04e7(0xa1)]),{'verbose':_0x4170cb['verbose']}),_0x5af9ed=_0x923b0e[_0xef04e7(0x6d)];return _0x4170cb[_0xef04e7(0xb1)]===_0xef04e7(0xa0)||_0x4170cb[_0xef04e7(0xb1)]===_0xef04e7(0xb5)?await handleSDKOutput([{'sql':_0x5af9ed}],_0x4170cb):console[_0xef04e7(0xad)](_0x5af9ed),0x0;}catch(_0x22ad14){if(_0x22ad14 instanceof SDKError)return console[_0xef04e7(0xf8)](_0xef04e7(0xa4)+_0x22ad14[_0xef04e7(0x94)]),_0x22ad14[_0xef04e7(0x86)]&&console[_0xef04e7(0xf8)](_0xef04e7(0xf0)+_0x22ad14[_0xef04e7(0x86)]),0x1;throw _0x22ad14;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x1916b8(0x70);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0xdc);async[a25_0x1916b8(0xe7)](_0x2ed3f0){const _0x352e5d=a25_0x1916b8,{options:_0x52d8e1,args:_0x2741e6,tdx:_0x382514}=_0x2ed3f0,_0x1333d0=_0x52d8e1;if(_0x2741e6[_0x352e5d(0xba)]<0x2)return console[_0x352e5d(0xf8)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x352e5d(0xf8)](_0x352e5d(0xef)),0x1;const _0x53ef9e=_0x2741e6[0x0],_0x357548=_0x2741e6[0x1];_0x1333d0[_0x352e5d(0x9d)]&&(console[_0x352e5d(0xf8)](_0x352e5d(0x8d)+_0x1333d0[_0x352e5d(0xc9)]),console[_0x352e5d(0xf8)](_0x352e5d(0x89)+_0x53ef9e),console['error'](_0x352e5d(0x9e)+_0x357548));let _0x50a562;if(_0x1333d0[_0x352e5d(0xd6)]){const _0x26a7b1=_0x1333d0[_0x352e5d(0xd6)],_0x3c48df=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x53ef9e+'\x27...',()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0xbd)](_0x53ef9e),{'verbose':_0x1333d0['verbose']}),_0x54ae79=_0x3c48df[_0x352e5d(0x6d)],_0x1f5a0d=await withSpinner(_0x352e5d(0x93)+_0x26a7b1+_0x352e5d(0xb2),()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0x6f)](_0x54ae79,_0x26a7b1),{'verbose':_0x1333d0['verbose']});_0x50a562=_0x1f5a0d[_0x352e5d(0x6d)],_0x1333d0[_0x352e5d(0x9d)]&&console[_0x352e5d(0xf8)](_0x352e5d(0x84)+_0x50a562);}const _0x499b1d={'name':_0x357548,'description':_0x1333d0[_0x352e5d(0xc7)],'parentFolderId':_0x50a562},_0xdfd127=await withSpinner('Creating\x20folder\x20\x27'+_0x357548+_0x352e5d(0xb2),()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0xe5)](_0x53ef9e,_0x499b1d),{'verbose':_0x1333d0[_0x352e5d(0x9d)]}),_0x931a4c=_0xdfd127[_0x352e5d(0x6d)];return console['error'](_0x352e5d(0x67)+_0x931a4c[_0x352e5d(0xa8)]+_0x352e5d(0xc6)+_0x931a4c['id']),await handleSDKOutput([_0x931a4c],_0x1333d0),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xae);['description']=a25_0x1916b8(0x9f);async[a25_0x1916b8(0xe7)](_0xfb7831){const _0x1c94d0=a25_0x1916b8,{options:_0x5a38b4,args:_0x32a817,tdx:_0x41460e}=_0xfb7831,_0x4b6f1a=_0x32a817[0x0];if(!_0x4b6f1a)return console[_0x1c94d0(0xf8)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1c94d0(0xf8)](_0x1c94d0(0xc4)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xf6)),console[_0x1c94d0(0xf8)]('Options:'),console[_0x1c94d0(0xf8)](_0x1c94d0(0x76)),console[_0x1c94d0(0xf8)](_0x1c94d0(0x91)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xc8)),console[_0x1c94d0(0xf8)](_0x1c94d0(0x7c)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xb3)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xa2)),0x1;try{const _0x3cb7ef=_0x5a38b4[_0x1c94d0(0xbe)],_0x4aa9f4=await resolveSegmentTarget(_0x4b6f1a,_0x3cb7ef,_0x5a38b4['verbose']);_0x5a38b4['verbose']&&console[_0x1c94d0(0xf8)](_0x1c94d0(0xcf)+_0x4aa9f4);const _0x2a4fa5=await withSpinner(_0x1c94d0(0xfa)+_0x4b6f1a+'\x27...',()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xf9)](_0x4aa9f4),{'verbose':_0x5a38b4['verbose']}),_0x549fe2=_0x2a4fa5[_0x1c94d0(0x6d)];_0x5a38b4[_0x1c94d0(0x9d)]&&(console[_0x1c94d0(0xf8)]('Resolved\x20type:\x20'+_0x549fe2[_0x1c94d0(0xfd)]),console['error'](_0x1c94d0(0xf3)+_0x549fe2['parentId']),_0x549fe2['folderId']&&console[_0x1c94d0(0xf8)](_0x1c94d0(0x68)+_0x549fe2[_0x1c94d0(0x7d)]),_0x549fe2[_0x1c94d0(0xa1)]&&console[_0x1c94d0(0xf8)](_0x1c94d0(0xbc)+_0x549fe2[_0x1c94d0(0xa1)]));if(_0x5a38b4[_0x1c94d0(0xab)]){if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0xd4))return console[_0x1c94d0(0xf8)](_0x1c94d0(0xcc)),0x1;if(_0x549fe2[_0x1c94d0(0xfd)]==='parent')return console[_0x1c94d0(0xf8)](_0x1c94d0(0xd1)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xa7)),0x1;if(!_0x549fe2[_0x1c94d0(0xa1)])throw new SDKError(ErrorCode[_0x1c94d0(0xda)],_0x1c94d0(0xf4));const _0x1cdf15=getConsoleNextUrl(_0x5a38b4[_0x1c94d0(0xc9)],_0x1c94d0(0xfb)+_0x549fe2['parentId']+_0x1c94d0(0xfc)+_0x549fe2[_0x1c94d0(0xa1)]);return console['error'](a25_0x76439b['green']('β')+_0x1c94d0(0xd2)+a25_0x76439b[_0x1c94d0(0xd8)](_0x1cdf15)),openBrowser(_0x1cdf15),0x0;}if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0xd4)){if(!_0x549fe2[_0x1c94d0(0x7d)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1c94d0(0xdd));const _0x3185c1=await withSpinner('Fetching\x20folder\x20details...',()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xe8)](_0x549fe2[_0x1c94d0(0x7d)]),{'verbose':_0x5a38b4[_0x1c94d0(0x9d)]});await handleSingleObjectOutput(_0x3185c1[_0x1c94d0(0x6d)],_0x5a38b4);}else{if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0x90)){if(!_0x549fe2[_0x1c94d0(0xa1)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1c94d0(0xf4));const _0x150e2a=await withSpinner(_0x1c94d0(0x8b),()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xd0)](_0x549fe2[_0x1c94d0(0x92)],_0x549fe2[_0x1c94d0(0xa1)]),{'verbose':_0x5a38b4['verbose']}),_0x430c86=getConsoleNextUrl(_0x5a38b4[_0x1c94d0(0xc9)],_0x1c94d0(0xfb)+_0x549fe2['parentId']+_0x1c94d0(0xfc)+_0x549fe2[_0x1c94d0(0xa1)]),_0x2f5682=_0x150e2a[_0x1c94d0(0x6d)];_0x2f5682[_0x1c94d0(0xe2)]=_0x430c86,await handleSingleObjectOutput(_0x2f5682,_0x5a38b4);}else return console[_0x1c94d0(0xf8)](_0x1c94d0(0xa3)),console['error'](_0x1c94d0(0x83)),0x1;}return 0x0;}catch(_0x14db64){if(_0x14db64 instanceof SDKError)return console['error'](_0x1c94d0(0xa4)+_0x14db64[_0x1c94d0(0x94)]),_0x14db64[_0x1c94d0(0x86)]&&console[_0x1c94d0(0xf8)]('\x20\x20Cause:\x20'+_0x14db64['cause']),0x1;throw _0x14db64;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x1916b8(0xa5);['description']=a25_0x1916b8(0x85);async[a25_0x1916b8(0xe7)](_0x4102b1){const _0x3f7fa6=a25_0x1916b8,{options:_0x24eec4,args:_0x2015e0,tdx:_0x261903}=_0x4102b1,_0x15b392=_0x2015e0[0x0];if(!_0x15b392)return console[_0x3f7fa6(0xf8)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0x97)),console[_0x3f7fa6(0xf8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x3f7fa6(0x91)),console[_0x3f7fa6(0xf8)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0x98)),0x1;try{const _0x2e4784=_0x24eec4['parentSegment'],_0x2f02b1=await resolveSegmentTarget(_0x15b392,_0x2e4784,_0x24eec4[_0x3f7fa6(0x9d)]);_0x24eec4['verbose']&&console['error'](_0x3f7fa6(0xcf)+_0x2f02b1);const _0x3d27da=await withSpinner(_0x3f7fa6(0xfa)+_0x15b392+_0x3f7fa6(0xb2),()=>_0x261903['segment']['resolvePathToResource'](_0x2f02b1),{'verbose':_0x24eec4[_0x3f7fa6(0x9d)]}),_0xbfd62c=_0x3d27da[_0x3f7fa6(0x6d)];_0x24eec4['verbose']&&(console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xe0)+_0xbfd62c[_0x3f7fa6(0xfd)]),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xf3)+_0xbfd62c[_0x3f7fa6(0x92)]));if(_0xbfd62c['type']===_0x3f7fa6(0xd4))return console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xb6)),console[_0x3f7fa6(0xf8)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0xbfd62c[_0x3f7fa6(0xfd)]===_0x3f7fa6(0x82))return console[_0x3f7fa6(0xf8)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0xbfd62c[_0x3f7fa6(0xa1)])throw new SDKError(ErrorCode[_0x3f7fa6(0xda)],_0x3f7fa6(0xf4));const _0x2aa8f9=await withSpinner(_0x3f7fa6(0x6e),()=>_0x261903[_0x3f7fa6(0x90)][_0x3f7fa6(0xca)](_0xbfd62c[_0x3f7fa6(0x92)],_0xbfd62c[_0x3f7fa6(0xa1)]),{'verbose':_0x24eec4[_0x3f7fa6(0x9d)]}),_0x2bebfa=_0x2aa8f9['data'],_0x39da7a=await executeSchemaQuery(_0x2bebfa,_0x261903,_0x24eec4);return await handleQueryOutput(_0x39da7a,_0x24eec4),0x0;}catch(_0x4edf03){if(_0x4edf03 instanceof SDKError)return console['error'](_0x3f7fa6(0xa4)+_0x4edf03[_0x3f7fa6(0x94)]),_0x4edf03[_0x3f7fa6(0x86)]&&console['error'](_0x3f7fa6(0xf0)+_0x4edf03[_0x3f7fa6(0x86)]),0x1;throw _0x4edf03;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x6a62b7=a26_0x55f6;(function(_0x3b6036,_0x25b02d){const _0x44a569=a26_0x55f6,_0x4dd445=_0x3b6036();while(!![]){try{const _0xaf5017=parseInt(_0x44a569(0x1ed))/0x1*(parseInt(_0x44a569(0x1f4))/0x2)+-parseInt(_0x44a569(0x1f7))/0x3*(-parseInt(_0x44a569(0x1e9))/0x4)+parseInt(_0x44a569(0x1d8))/0x5+parseInt(_0x44a569(0x1e5))/0x6*(-parseInt(_0x44a569(0x1ca))/0x7)+parseInt(_0x44a569(0x1fa))/0x8*(-parseInt(_0x44a569(0x1d9))/0x9)+-parseInt(_0x44a569(0x1d1))/0xa+parseInt(_0x44a569(0x1e0))/0xb;if(_0xaf5017===_0x25b02d)break;else _0x4dd445['push'](_0x4dd445['shift']());}catch(_0x2ee3db){_0x4dd445['push'](_0x4dd445['shift']());}}}(a26_0x1d18,0xd32e5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a26_0x1d18(){const _0x13c47f=['35WGVBpe','verbose','kind','Segment\x20name:\x20','parent','\x27...','createSegment','13310800SZfPdN','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Creating\x20segment\x20\x27','Resolved\x20relative\x20path\x20to:\x20','description','β\x20Created\x20segment\x20\x27','77070acrysX','396yTktAz','type','site','data','segments','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x20\x20\x20Path:\x20','25078053SyYdXL','resolvePathToResource','segmentPath','length','Resolving\x20parent\x20segment\x20\x27','1446582usPnyt','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','noCountPopulation','Target\x20path:\x20','61204DDLwVf','segment:create','folder','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','11AMIXho','rule','invisible','folderId','Site:\x20','\x27\x20with\x20ID:\x20','Resolved\x20folder\x20ID:\x20','18034udGLVi','yellow','resolveFolderId','282MSyUHJ','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','execute','78392KZmHAx','Resolving\x20folder\x20path\x20\x27','Parent\x20path:\x20','error','includes','Create\x20child\x20segment\x20with\x20filtering\x20rules','ruleFile','name'];a26_0x1d18=function(){return _0x13c47f;};return a26_0x1d18();}import{withSpinner}from'../utils/spinner.js';function a26_0x55f6(_0x4f6b36,_0x36d974){_0x4f6b36=_0x4f6b36-0x1c5;const _0x1d18c2=a26_0x1d18();let _0x55f634=_0x1d18c2[_0x4f6b36];return _0x55f634;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x533031 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x6a62b7(0x1c9)]=a26_0x6a62b7(0x1ea);[a26_0x6a62b7(0x1d6)]=a26_0x6a62b7(0x1c7);async[a26_0x6a62b7(0x1f9)](_0x1a1415){const _0x29e0f9=a26_0x6a62b7;console[_0x29e0f9(0x1c5)](a26_0x533031[_0x29e0f9(0x1f5)]('β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x29e0f9(0x1c5)](a26_0x533031[_0x29e0f9(0x1f5)](_0x29e0f9(0x1e6)));const {options:_0x40914a,args:_0x289d3d,tdx:_0x3b1bea}=_0x1a1415,_0xf512da=_0x40914a;if(_0x289d3d[_0x29e0f9(0x1e3)]===0x0)return console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1d2)),console['error'](_0x29e0f9(0x1d3)),console[_0x29e0f9(0x1c5)]('Examples:'),console[_0x29e0f9(0x1c5)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x29e0f9(0x1ec)),console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1de)),0x1;const _0x595ba0=_0x289d3d[0x0],_0x53bdde=_0x40914a[_0x29e0f9(0x1e2)];let _0x2a7d81=_0x595ba0;_0x53bdde&&!_0x595ba0[_0x29e0f9(0x1c6)]('/')&&(_0x2a7d81=_0x53bdde+'/'+_0x595ba0,_0xf512da[_0x29e0f9(0x1cb)]&&console['error'](_0x29e0f9(0x1d5)+_0x2a7d81));const _0xd56940=parsePath(_0x2a7d81);if(_0xd56940[_0x29e0f9(0x1dd)][_0x29e0f9(0x1e3)]<0x2)return console[_0x29e0f9(0x1c5)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0x29e0f9(0x1f8)),0x1;const _0x3c1370=_0xd56940[_0x29e0f9(0x1dd)][0x0],_0xde6c34=getBaseName(_0x2a7d81),_0x10e3c9=getParentPath(_0x2a7d81);_0xf512da[_0x29e0f9(0x1cb)]&&(console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1f1)+_0xf512da[_0x29e0f9(0x1db)]),console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1e8)+_0x2a7d81),console[_0x29e0f9(0x1c5)]('Parent:\x20'+_0x3c1370),console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1cd)+_0xde6c34),console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1fc)+_0x10e3c9));const _0x3a6c5e=await withSpinner(_0x29e0f9(0x1e4)+_0x3c1370+_0x29e0f9(0x1cf),()=>_0x3b1bea['segment']['resolveParentId'](_0x3c1370),{'verbose':_0xf512da[_0x29e0f9(0x1cb)]}),_0x2d2b23=_0x3a6c5e['data'];let _0x2bf125;if(_0xd56940[_0x29e0f9(0x1dd)][_0x29e0f9(0x1e3)]>0x2){const _0x158868=await withSpinner(_0x29e0f9(0x1fb)+_0x10e3c9+_0x29e0f9(0x1cf),()=>_0x3b1bea['segment'][_0x29e0f9(0x1e1)](_0x10e3c9),{'verbose':_0xf512da['verbose']}),_0x183657=_0x158868[_0x29e0f9(0x1dc)];if(_0x183657[_0x29e0f9(0x1da)]!==_0x29e0f9(0x1eb)&&_0x183657['type']!==_0x29e0f9(0x1ce))return console[_0x29e0f9(0x1c5)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x2bf125=_0x183657[_0x29e0f9(0x1f0)];}else{if(_0xf512da[_0x29e0f9(0x1eb)]){const _0xc92369=await withSpinner('Resolving\x20folder\x20\x27'+_0xf512da[_0x29e0f9(0x1eb)]+_0x29e0f9(0x1cf),()=>_0x3b1bea['segment'][_0x29e0f9(0x1f6)](_0x2d2b23,_0xf512da[_0x29e0f9(0x1eb)]),{'verbose':_0xf512da[_0x29e0f9(0x1cb)]});_0x2bf125=_0xc92369[_0x29e0f9(0x1dc)];}}_0xf512da[_0x29e0f9(0x1cb)]&&_0x2bf125&&console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1f3)+_0x2bf125);const _0x515e47=await loadJSONFromOptions(_0xf512da[_0x29e0f9(0x1ee)],_0xf512da[_0x29e0f9(0x1c8)]),_0xc4ba0a={'name':_0xde6c34,'description':_0xf512da[_0x29e0f9(0x1d6)],'rule':_0x515e47,'kind':_0xf512da[_0x29e0f9(0x1cc)]!==undefined?parseInt(_0xf512da[_0x29e0f9(0x1cc)],0xa):undefined,'isVisible':_0xf512da[_0x29e0f9(0x1ef)]?![]:undefined,'segmentFolderId':_0x2bf125,'countPopulation':_0xf512da[_0x29e0f9(0x1e7)]?![]:undefined},_0x212375=await withSpinner(_0x29e0f9(0x1d4)+_0xde6c34+_0x29e0f9(0x1cf),()=>_0x3b1bea['segment'][_0x29e0f9(0x1d0)](_0x2d2b23,_0xc4ba0a),{'verbose':_0xf512da[_0x29e0f9(0x1cb)]}),_0x246815=_0x212375[_0x29e0f9(0x1dc)];return console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1d7)+_0x246815[_0x29e0f9(0x1c9)]+_0x29e0f9(0x1f2)+_0x246815['id']),_0x2a7d81!==_0x595ba0&&console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1df)+_0x2a7d81),await handleSDKOutput([_0x246815],_0xf512da),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x45ef2a=a27_0x51a7;(function(_0x2e4f80,_0x2097b7){const _0x2f9580=a27_0x51a7,_0x303f28=_0x2e4f80();while(!![]){try{const _0x3489ca=-parseInt(_0x2f9580(0xf0))/0x1+-parseInt(_0x2f9580(0xfb))/0x2*(-parseInt(_0x2f9580(0xfd))/0x3)+parseInt(_0x2f9580(0xf6))/0x4*(-parseInt(_0x2f9580(0xe8))/0x5)+parseInt(_0x2f9580(0xee))/0x6*(parseInt(_0x2f9580(0xf8))/0x7)+parseInt(_0x2f9580(0xf2))/0x8+-parseInt(_0x2f9580(0x100))/0x9*(parseInt(_0x2f9580(0x101))/0xa)+parseInt(_0x2f9580(0xef))/0xb*(-parseInt(_0x2f9580(0xea))/0xc);if(_0x3489ca===_0x2097b7)break;else _0x303f28['push'](_0x303f28['shift']());}catch(_0x4d6bbd){_0x303f28['push'](_0x303f28['shift']());}}}(a27_0x48df,0x90056));import{BaseCommand}from'./command.js';function a27_0x51a7(_0x230b0b,_0x43ae89){_0x230b0b=_0x230b0b-0xe6;const _0x48df25=a27_0x48df();let _0x51a7de=_0x48df25[_0x230b0b];return _0x51a7de;}import{handleSDKOutput}from'../core/command-output.js';function a27_0x48df(){const _0x2b3eac=['site','618PAWqDW','15543nZOPuz','197163mytmzg','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','5838840RcRRpd','json','length','Parent\x20segment:\x20','1716bPymKV','Listing\x20fields\x20for\x20\x27','60067LhGmKJ','execute','listFields','2rjxLte','β\x20Found\x20','3001611fmncaU','verbose','data','144RTRRkt','195360GuZEgG','\x20field','error','11905CCMICr','Error:\x20Parent\x20segment\x20name\x20is\x20required','4188FLxLNS','\x27...','name'];a27_0x48df=function(){return _0x2b3eac;};return a27_0x48df();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x45ef2a(0xec)]='segment:fields';['description']='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x45ef2a(0xf9)](_0x5d35f9){const _0x38a99e=a27_0x45ef2a,{options:_0x1f2ab2,args:_0x128db7,tdx:_0x4d2079}=_0x5d35f9,_0x9e0eea=_0x128db7[0x0]||_0x1f2ab2['parentSegment'];if(!_0x9e0eea)return console[_0x38a99e(0xe7)](_0x38a99e(0xe9)),console[_0x38a99e(0xe7)](_0x38a99e(0xf1)),console[_0x38a99e(0xe7)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x1f2ab2[_0x38a99e(0xfe)]&&(console[_0x38a99e(0xe7)]('Site:\x20'+_0x1f2ab2[_0x38a99e(0xed)]),console['error'](_0x38a99e(0xf5)+_0x9e0eea));const _0x5aafca=await withSpinner(_0x38a99e(0xf7)+_0x9e0eea+_0x38a99e(0xeb),()=>_0x4d2079['segment'][_0x38a99e(0xfa)](_0x9e0eea),{'verbose':_0x1f2ab2['verbose']}),_0x157478=_0x5aafca[_0x38a99e(0xff)];console['error'](_0x38a99e(0xfc)+_0x157478[_0x38a99e(0xf4)]+_0x38a99e(0xe6)+(_0x157478[_0x38a99e(0xf4)]!==0x1?'s':''));if(_0x1f2ab2[_0x38a99e(0xf3)]||_0x1f2ab2['jsonl'])return await handleSDKOutput(_0x157478,_0x1f2ab2),0x0;return displayFieldsHumanReadable(_0x157478,_0x9e0eea),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x5751e8=a28_0x5a64;(function(_0x4a7fc1,_0x5051e8){const _0x39a6ca=a28_0x5a64,_0x5f45a9=_0x4a7fc1();while(!![]){try{const _0x420262=parseInt(_0x39a6ca(0x227))/0x1*(parseInt(_0x39a6ca(0x1e5))/0x2)+-parseInt(_0x39a6ca(0x1fc))/0x3+-parseInt(_0x39a6ca(0x204))/0x4*(-parseInt(_0x39a6ca(0x211))/0x5)+parseInt(_0x39a6ca(0x22b))/0x6+-parseInt(_0x39a6ca(0x200))/0x7+parseInt(_0x39a6ca(0x216))/0x8+parseInt(_0x39a6ca(0x224))/0x9*(-parseInt(_0x39a6ca(0x221))/0xa);if(_0x420262===_0x5051e8)break;else _0x5f45a9['push'](_0x5f45a9['shift']());}catch(_0x24eede){_0x5f45a9['push'](_0x5f45a9['shift']());}}}(a28_0x29b7,0x5fa34));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';function a28_0x5a64(_0x4d95ad,_0x4f6fef){_0x4d95ad=_0x4d95ad-0x1e4;const _0x29b75d=a28_0x29b7();let _0x5a6410=_0x29b75d[_0x4d95ad];return _0x5a6410;}function a28_0x29b7(){const _0x361c80=['repeat','Write\x20','11076hzmGEt','name','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parentName','Pulling\x20segments\x20from\x20\x27','\x20versions)','diff','helpText','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','targetDir','filter','green','segments','yellow','\x27...','length','error','cwd','utf-8','file','hasChanges','parentSegment','\x20\x20π―\x20','881916wElCYb','files','Parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','1484049kKsGIw','content','\x20\x20Target:\x20','no_parent','1579892QaxerC','counts','resourceName','\x0aChanges\x20to\x20\x27','\x20new\x20files','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','setPhase','Site:\x20','journeyVersions','journeys','\x20files?','Aborted.','5itZXMA','verbose','site','description','\x20=\x20','687656XQIUaF','dirname','data','session','dim','\x20segments','\x20journeys','β\x20All\x20files\x20are\x20up\x20to\x20date','\x20activations','relativePath','\x20unchanged\x20files','9276170rCsIhI','β\x20Pulled\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','9cJTetF','β\x20Context\x20set:\x20','pullSegments','134MMOlnk','isNew','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','absolutePath','3613836fwvdfZ','errorCode','cyan','type','parent_segment'];a28_0x29b7=function(){return _0x361c80;};return a28_0x29b7();}import{saveSessionContext}from'../core/session.js';import a28_0x2431f7 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x207d13 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0x5751e8(0x1e6)]='segment:pull';[a28_0x5751e8(0x214)]=a28_0x5751e8(0x223);async[a28_0x5751e8(0x209)](_0x9074ff){const _0x20d4e0=a28_0x5751e8,{options:_0x44b68b,args:_0x31e09,tdx:_0x33f72c}=_0x9074ff,_0x218be7=_0x44b68b,_0x425cbc=await resolveTarget({'arg':_0x31e09[0x0],'contextParent':_0x44b68b[_0x20d4e0(0x1fa)],'cwd':process[_0x20d4e0(0x1f6)]()});if(!isSuccessfulResolution(_0x425cbc))return _0x425cbc[_0x20d4e0(0x22c)]===_0x20d4e0(0x203)?(console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x1f2)](_0x20d4e0(0x229))),console[_0x20d4e0(0x1f5)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x20d4e0(0x20a)),console['error'](_0x20d4e0(0x1ed))):(console[_0x20d4e0(0x1f5)](a28_0x2431f7['red']('Error:\x20'+_0x425cbc['message']+'\x0a')),_0x425cbc[_0x20d4e0(0x1ec)]&&console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x22d)](_0x425cbc['helpText']))),0x1;const _0x3777f3=_0x425cbc[_0x20d4e0(0x1e8)],_0x179869=_0x425cbc['targetDir'],_0x3accbc=_0x425cbc[_0x20d4e0(0x22e)]===_0x20d4e0(0x1f8)?_0x425cbc[_0x20d4e0(0x206)]:undefined;_0x218be7[_0x20d4e0(0x212)]&&(console[_0x20d4e0(0x1f5)](_0x20d4e0(0x20c)+_0x218be7[_0x20d4e0(0x213)]),console[_0x20d4e0(0x1f5)](_0x20d4e0(0x1fe)+_0x3777f3),_0x3accbc&&console[_0x20d4e0(0x1f5)]('Target\x20resource:\x20'+_0x3accbc));const _0x3e0ba8=await withProgressSpinner(_0x20d4e0(0x1e9)+_0x3777f3+_0x20d4e0(0x1f3),_0x278293=>_0x33f72c['segment'][_0x20d4e0(0x226)](_0x3777f3,{'targetDir':_0x179869,'targetResourceName':_0x3accbc,'verbose':_0x218be7[_0x20d4e0(0x212)],'progress':{'update':_0x11b767=>{const _0xfdce80=_0x20d4e0;_0x278293[_0xfdce80(0x20b)](_0x11b767),_0x218be7[_0xfdce80(0x212)]&&console[_0xfdce80(0x1f5)]('\x20\x20'+_0x11b767);}}}),{'verbose':_0x218be7[_0x20d4e0(0x212)]}),_0x45d2cd=_0x3e0ba8[_0x20d4e0(0x218)];if(_0x45d2cd[_0x20d4e0(0x205)][_0x20d4e0(0x1f1)]===0x0&&_0x45d2cd['counts'][_0x20d4e0(0x20e)]===0x0)return console['error'](a28_0x2431f7['yellow'](_0x20d4e0(0x1e7)+_0x45d2cd[_0x20d4e0(0x1e8)]+'\x27')),0x0;const _0x27f665=_0x45d2cd[_0x20d4e0(0x1fd)][_0x20d4e0(0x1ef)](_0x50eea4=>_0x50eea4[_0x20d4e0(0x228)]),_0x559269=_0x45d2cd[_0x20d4e0(0x1fd)][_0x20d4e0(0x1ef)](_0x577a98=>!_0x577a98['isNew']&&_0x577a98[_0x20d4e0(0x1f9)]),_0x582d0a=_0x45d2cd['files']['filter'](_0x47d613=>!_0x47d613[_0x20d4e0(0x228)]&&!_0x47d613['hasChanges']);console[_0x20d4e0(0x1f5)]('\x0aPull\x20summary\x20for\x20\x27'+_0x45d2cd[_0x20d4e0(0x1e8)]+'\x27:'),console[_0x20d4e0(0x1f5)](_0x20d4e0(0x1fb)+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd[_0x20d4e0(0x205)][_0x20d4e0(0x1f1)]+_0x20d4e0(0x21b))+'\x20with\x20'+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd['counts']['activations']+_0x20d4e0(0x21e)));if(_0x45d2cd['counts'][_0x20d4e0(0x20e)]>0x0){const _0x5bb6a4=_0x45d2cd['counts'][_0x20d4e0(0x20d)]>_0x45d2cd[_0x20d4e0(0x205)][_0x20d4e0(0x20e)]?'\x20('+_0x45d2cd[_0x20d4e0(0x205)]['journeyVersions']+_0x20d4e0(0x1ea):'';console[_0x20d4e0(0x1f5)]('\x20\x20πΊοΈ\x20\x20'+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd['counts']['journeys']+_0x20d4e0(0x21c))+a28_0x2431f7[_0x20d4e0(0x21a)](_0x5bb6a4));}console[_0x20d4e0(0x1f5)]('\x20\x20'+a28_0x2431f7[_0x20d4e0(0x1f0)]('+\x20'+_0x27f665[_0x20d4e0(0x1f4)]+_0x20d4e0(0x208))),console[_0x20d4e0(0x1f5)]('\x20\x20'+a28_0x2431f7[_0x20d4e0(0x1f2)]('~\x20'+_0x559269[_0x20d4e0(0x1f4)]+'\x20changed\x20files')),console[_0x20d4e0(0x1f5)]('\x20\x20'+a28_0x2431f7[_0x20d4e0(0x21a)]('=\x20'+_0x582d0a[_0x20d4e0(0x1f4)]+_0x20d4e0(0x220))),console[_0x20d4e0(0x1f5)](_0x20d4e0(0x202)+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd[_0x20d4e0(0x1ee)])+'\x0a');if(_0x559269[_0x20d4e0(0x1f4)]>0x0)for(const _0x36de29 of _0x559269){console['error'](_0x20d4e0(0x207)+_0x36de29[_0x20d4e0(0x21f)]+'\x27:'),console[_0x20d4e0(0x1f5)]('β'[_0x20d4e0(0x230)](0x3c)),console[_0x20d4e0(0x1f5)](_0x36de29[_0x20d4e0(0x1eb)]),console[_0x20d4e0(0x1f5)]('β'['repeat'](0x3c));}if(_0x218be7['dryRun'])return console[_0x20d4e0(0x1f5)](a28_0x2431f7['yellow'](_0x20d4e0(0x1ff))),0x0;if(_0x27f665[_0x20d4e0(0x1f4)]===0x0&&_0x559269[_0x20d4e0(0x1f4)]===0x0)return console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x1f0)](_0x20d4e0(0x21d))),saveSessionContext({'parent_segment':_0x45d2cd['parentName']},_0x218be7[_0x20d4e0(0x219)]),console['error'](a28_0x2431f7[_0x20d4e0(0x1f0)](_0x20d4e0(0x225)+a28_0x2431f7[_0x20d4e0(0x21a)](_0x20d4e0(0x22f))+'\x20=\x20'+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd[_0x20d4e0(0x1e8)]))),0x0;if(!_0x218be7['yes']){const _0x3e67ca=await confirmKey(_0x20d4e0(0x1e4)+(_0x27f665[_0x20d4e0(0x1f4)]+_0x559269['length'])+_0x20d4e0(0x20f));if(!_0x3e67ca)return console[_0x20d4e0(0x1f5)](_0x20d4e0(0x210)),0x1;}for(const _0x28fc1d of _0x45d2cd[_0x20d4e0(0x1fd)]){if(_0x28fc1d['isNew']||_0x28fc1d[_0x20d4e0(0x1f9)]){const _0xce369=a28_0x207d13[_0x20d4e0(0x217)](_0x28fc1d[_0x20d4e0(0x22a)]);!existsSync(_0xce369)&&mkdirSync(_0xce369,{'recursive':!![]}),writeFileSync(_0x28fc1d[_0x20d4e0(0x22a)],_0x28fc1d[_0x20d4e0(0x201)],_0x20d4e0(0x1f7));}}return console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x1f0)](_0x20d4e0(0x222)+(_0x27f665['length']+_0x559269['length'])+'\x20files\x20to\x20'+_0x45d2cd[_0x20d4e0(0x1ee)])),saveSessionContext({'parent_segment':_0x45d2cd[_0x20d4e0(0x1e8)]},_0x218be7['session']),console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x1f0)](_0x20d4e0(0x225)+a28_0x2431f7['dim'](_0x20d4e0(0x22f))+_0x20d4e0(0x215)+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x5b747d=a29_0x1516;(function(_0x360a9a,_0xbffabd){const _0x1d77bb=a29_0x1516,_0x1d2a2a=_0x360a9a();while(!![]){try{const _0x20a3b1=-parseInt(_0x1d77bb(0x255))/0x1+parseInt(_0x1d77bb(0x276))/0x2*(-parseInt(_0x1d77bb(0x27a))/0x3)+parseInt(_0x1d77bb(0x253))/0x4*(parseInt(_0x1d77bb(0x24a))/0x5)+parseInt(_0x1d77bb(0x1fa))/0x6*(-parseInt(_0x1d77bb(0x25c))/0x7)+-parseInt(_0x1d77bb(0x25d))/0x8*(-parseInt(_0x1d77bb(0x211))/0x9)+-parseInt(_0x1d77bb(0x248))/0xa*(parseInt(_0x1d77bb(0x204))/0xb)+parseInt(_0x1d77bb(0x244))/0xc;if(_0x20a3b1===_0xbffabd)break;else _0x1d2a2a['push'](_0x1d2a2a['shift']());}catch(_0x52e6e3){_0x1d2a2a['push'](_0x1d2a2a['shift']());}}}(a29_0x4022,0x48f29));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_0x5e6929 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x4022(){const _0x4a4c50=['β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','user','journeysOnly','(Journey\x20will\x20be\x20deleted)','4245240JUVycD','dim','idToName','changed','11810htIXFl','\x20\x20Activations:\x20','10630pvQAUY','nameToType','repeat','journeys','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','getParent','Error:\x20Directory\x20not\x20found:\x20','paused','New\x20journey:','632mOzODy','segment','2260XVycfB','green','listJourneysWithDetailsFromParentSegment','targetDir','Changes\x20to\x20journey:','journeyBundleId','versionNumber','644BPcDqJ','8upnimx','red','Fetching\x20existing\x20segments...','yamlConfig','\x20new','\x20updated','\x20\x20Source:\x20','getJourney','\x20\x20π\x20Segments:','parent_name','isScoped','file','\x20to\x20update','length','listActivations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','toDelete','results','attributes','No\x20','Fetching\x20users\x20for\x20email\x20resolution...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','journeyId','Parent\x20segment:\x20','scopedFolderPath','698AZmgho','\x20created','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','β\x20All\x20journeys\x20are\x20up\x20to\x20date','3981lWWLFo','\x20activations]','endsWith','yellow','\x0aPush\x20summary\x20for\x20\x27','journeyBundleName','listFolders','journey','Push\x20','\x20\x20Activations:','existingJourney','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)','setPhase','segment:push','relationships','diff','toCreate','\x27...','delete','push','\x0aValidation\x20failed:','message','createdAt','cyan','getOutputSchemaWithCache','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','isNew','parentSegment','toString','24132UWHGZy','Site:\x20','updatedAt','new','verbose','then','segment\x20or\x20journey','\x20unchanged','segments','Error:\x20','176yPDbyL','data','π\x20','\x20\x20πΊοΈ\x20\x20Journeys:','join','get','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/e/','parentFolder','updated','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Preparing\x20journeys...','\x20deleted','4170762padCVf','type','no_parent','cwd','filter','listSegments','\x20changes?','/app/ps/','Scoped\x20to\x20folder:\x20','connection','\x0aβ\x20Push\x20complete','execute','name','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','description','segmentFolderId','/j/da/je','Resolving\x20parent\x20segment\x20\x27','Fetching\x20parent\x20segment\x20details...','\x20\x20Journeys:\x20','map','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','helpText','folderId','nameToId','\x20to\x20delete','yes','\x20\x20\x20\x20','activations','unchanged','resolveParentId','Delete\x20journey:','folderPath','state','Changes\x20to:','site','error','.yaml','\x20changed','blue','Aborted.','buildUserMaps','Fetching\x20existing\x20folders...','createdSegmentIds','list','\x20to\x20create','created'];a29_0x4022=function(){return _0x4a4c50;};return a29_0x4022();}function a29_0x1516(_0x2cdff6,_0x4590d0){_0x2cdff6=_0x2cdff6-0x1e0;const _0x402223=a29_0x4022();let _0x151650=_0x402223[_0x2cdff6];return _0x151650;}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_0x5b747d(0x21d)]=a29_0x5b747d(0x1ea);[a29_0x5b747d(0x21f)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a29_0x5b747d(0x21c)](_0x428954){const _0x4d7d81=a29_0x5b747d,{options:_0x4f8f47,args:_0x375ffa,tdx:_0xbd46d4}=_0x428954,_0x1bfe92=_0x4f8f47,_0x12b503=await resolveTarget({'arg':_0x375ffa[0x0],'contextParent':_0x4f8f47[_0x4d7d81(0x1f8)],'cwd':process[_0x4d7d81(0x214)]()});if(!isSuccessfulResolution(_0x12b503))return _0x12b503['errorCode']===_0x4d7d81(0x213)?(console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x1e0)](_0x4d7d81(0x21e))),console[_0x4d7d81(0x235)](_0x4d7d81(0x1e8)),console[_0x4d7d81(0x235)](_0x4d7d81(0x272)),console[_0x4d7d81(0x235)](_0x4d7d81(0x26c))):(console['error'](a29_0x5e6929[_0x4d7d81(0x25e)](_0x4d7d81(0x203)+_0x12b503['message']+'\x0a')),_0x12b503[_0x4d7d81(0x227)]&&console['error'](a29_0x5e6929[_0x4d7d81(0x1f4)](_0x12b503['helpText']))),0x1;if(_0x12b503[_0x4d7d81(0x212)]===_0x4d7d81(0x266))return console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x25e)](_0x4d7d81(0x250)+_0x12b503[_0x4d7d81(0x258)]+'\x0a')),console['error'](a29_0x5e6929[_0x4d7d81(0x1f4)](_0x4d7d81(0x1f6))),0x1;const _0x45cca4=_0x12b503['parentName'],_0x132cd3=_0x12b503['targetDir'],_0x4c6f5e=_0x12b503[_0x4d7d81(0x212)]===_0x4d7d81(0x268)?_0x12b503['filePath']:undefined,_0x40bd7c=getScopedDetails(_0x12b503),_0x5b1b69=_0x40bd7c?.[_0x4d7d81(0x267)]??![],_0x21fc4d=_0x40bd7c?.[_0x4d7d81(0x275)]??'';if(!existsSync(_0x132cd3))return console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x25e)](_0x4d7d81(0x250)+_0x132cd3+'\x0a')),console['error'](a29_0x5e6929[_0x4d7d81(0x1f4)](_0x4d7d81(0x1f6))),0x1;_0x1bfe92[_0x4d7d81(0x1fe)]&&(console[_0x4d7d81(0x235)](_0x4d7d81(0x1fb)+_0x1bfe92['site']),console[_0x4d7d81(0x235)](_0x4d7d81(0x274)+_0x45cca4),console['error']('Source\x20directory:\x20'+_0x132cd3),_0x5b1b69&&console[_0x4d7d81(0x235)](_0x4d7d81(0x219)+_0x21fc4d));const _0x4920ad=await withSpinner(_0x4d7d81(0x222)+_0x45cca4+_0x4d7d81(0x1ee),()=>_0xbd46d4[_0x4d7d81(0x254)][_0x4d7d81(0x22f)](_0x45cca4),{'verbose':_0x1bfe92['verbose']}),_0x34c916=_0x4920ad[_0x4d7d81(0x205)],[_0x1f064b,_0x3c46bc,_0x2f79ec,_0x2724b1,_0x3262cd]=await Promise['all']([withSpinner(_0x4d7d81(0x223),()=>_0xbd46d4['segment'][_0x4d7d81(0x24f)](_0x34c916),{'verbose':_0x1bfe92[_0x4d7d81(0x1fe)]}),withSpinner(_0x4d7d81(0x25f),()=>_0xbd46d4['segment'][_0x4d7d81(0x216)](_0x34c916),{'verbose':_0x1bfe92[_0x4d7d81(0x1fe)]}),withSpinner(_0x4d7d81(0x23b),()=>_0xbd46d4[_0x4d7d81(0x254)][_0x4d7d81(0x1e3)](_0x34c916),{'verbose':_0x1bfe92[_0x4d7d81(0x1fe)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0xbd46d4[_0x4d7d81(0x1e4)][_0x4d7d81(0x257)](_0x34c916,{'includeAllVersions':!![]}),{'verbose':_0x1bfe92['verbose']}),withSpinner(_0x4d7d81(0x271),()=>_0xbd46d4[_0x4d7d81(0x241)][_0x4d7d81(0x23a)](),{'verbose':_0x1bfe92['verbose']})['then'](_0x4af25e=>_0x4af25e[_0x4d7d81(0x205)])]),_0x30a21d=_0x1f064b[_0x4d7d81(0x205)],_0x2b7c93=extractRootFolderId(_0x30a21d),_0x2da16c=_0x3c46bc[_0x4d7d81(0x205)],_0x42728b=_0x2f79ec[_0x4d7d81(0x205)],{journeys:_0x54fd1e,activationStepsById:_0x17b1ec}=_0x2724b1['data'],_0x2d736a=new Map(_0x54fd1e[_0x4d7d81(0x225)](_0x1d205c=>[_0x1d205c['id'],_0x1d205c])),_0x34025c=_0x54fd1e[_0x4d7d81(0x225)](_0x5ab047=>({'id':_0x5ab047['id'],'name':_0x5ab047[_0x4d7d81(0x26f)][_0x4d7d81(0x21d)],'journeyBundleName':_0x5ab047[_0x4d7d81(0x26f)][_0x4d7d81(0x1e2)]||'','journeyBundleId':_0x5ab047[_0x4d7d81(0x26f)][_0x4d7d81(0x25a)]||'','versionNumber':_0x5ab047[_0x4d7d81(0x26f)][_0x4d7d81(0x25b)],'description':_0x5ab047[_0x4d7d81(0x26f)]['description'],'state':_0x5ab047[_0x4d7d81(0x26f)][_0x4d7d81(0x232)],'paused':_0x5ab047[_0x4d7d81(0x26f)][_0x4d7d81(0x251)],'audienceId':_0x5ab047['attributes']['audienceId'],'folderId':_0x5ab047[_0x4d7d81(0x1eb)]?.[_0x4d7d81(0x20c)]?.[_0x4d7d81(0x205)]?.['id'],'createdAt':_0x5ab047[_0x4d7d81(0x26f)][_0x4d7d81(0x1f3)],'updatedAt':_0x5ab047['attributes'][_0x4d7d81(0x1fc)]})),{emailToId:_0x315eee,idToEmail:_0x580524}=_0x3262cd,_0x1ee79c=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x14fb61=_0x4d7d81,_0x581770=await _0xbd46d4[_0x14fb61(0x21a)][_0x14fb61(0x23d)]();return buildConnectionMaps(_0x581770);},{'verbose':_0x1bfe92[_0x4d7d81(0x1fe)]})[_0x4d7d81(0x1ff)](_0x8f1628=>_0x8f1628[_0x4d7d81(0x205)]),_0x3c91ce=_0x1ee79c[_0x4d7d81(0x229)],_0x3d68fd=_0x1ee79c[_0x4d7d81(0x246)],_0x46c356=_0x1ee79c[_0x4d7d81(0x24b)],_0x48f71b={'emailToIdMap':_0x315eee,'connectionNameToIdMap':_0x3c91ce,'connectionNameToTypeMap':_0x46c356,'getSchema':_0x546913=>_0xbd46d4[_0x4d7d81(0x21a)][_0x4d7d81(0x1f5)](_0x546913)};let {pathToId:_0x2b231f,idToPath:_0x3314ee}=buildFolderMaps(_0x42728b);const _0x5f3847=buildSegmentLookupMap(_0x2da16c,_0x3314ee),_0x459d15=buildSegmentNameToIdMap(_0x2da16c),_0x1b36da=buildJourneyBundleLookupMap(_0x34025c,_0x3314ee);let _0x220268;if(_0x4c6f5e){if(!_0x4c6f5e[_0x4d7d81(0x27c)]('.yml')&&!_0x4c6f5e['endsWith'](_0x4d7d81(0x236)))return console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x25e)](_0x4d7d81(0x226)+_0x4c6f5e+'\x0a')),0x1;_0x220268=[_0x4c6f5e];}else _0x220268=findYamlFiles(_0x132cd3);if(_0x220268[_0x4d7d81(0x26a)]===0x0)return console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x25e)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x132cd3+'\x0a')),console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x1f4)](_0x4d7d81(0x20a))),0x1;let _0x3cbc24,_0x2c7ea4;try{const _0xeb1066=parseAndClassifyYamlFiles(_0x220268,_0x132cd3,{'skipSegments':_0x1bfe92[_0x4d7d81(0x242)]});_0x3cbc24=_0xeb1066[_0x4d7d81(0x202)],_0x2c7ea4=_0xeb1066[_0x4d7d81(0x24d)];const _0x38cf0a=validateParsedFiles(_0xeb1066,_0x132cd3);if(_0x38cf0a[_0x4d7d81(0x26a)]>0x0)return console['error'](a29_0x5e6929['red'](_0x4d7d81(0x1f1))),console[_0x4d7d81(0x235)](formatValidationErrors(_0x38cf0a)),console['error'](a29_0x5e6929[_0x4d7d81(0x1e0)](_0x4d7d81(0x24e))),0x1;}catch(_0xc26426){return console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x25e)]('Error\x20parsing\x20YAML:\x20'+(_0xc26426 instanceof Error?_0xc26426[_0x4d7d81(0x1f2)]:_0xc26426))),0x1;}if(_0x3cbc24[_0x4d7d81(0x26a)]===0x0&&_0x2c7ea4['length']===0x0){const _0x324c12=_0x1bfe92['journeysOnly']?'journey':_0x4d7d81(0x200);return console['error'](a29_0x5e6929[_0x4d7d81(0x1e0)](_0x4d7d81(0x270)+_0x324c12+'\x20YAML\x20files\x20found')),0x0;}const _0x4fb0f3=new Map();_0x2da16c[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92[_0x4d7d81(0x242)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x2da16c,async _0x784fcf=>{const _0x5bab9e=a29_0x1516,_0x18259e=await _0xbd46d4[_0x5bab9e(0x254)][_0x5bab9e(0x26b)](_0x34c916,_0x784fcf['id']);_0x4fb0f3['set'](_0x784fcf['id'],_0x18259e);});},{'verbose':_0x1bfe92['verbose']});const {segmentFiles:_0x304ce2,foldersToCreate:_0x4763a0}=await prepareSegmentFiles(_0x3cbc24,{'segmentByFolderAndName':_0x5f3847,'activationsBySegmentId':_0x4fb0f3,'folderPathToId':_0x2b231f,'idToEmailMap':_0x580524,'connectionIdToNameMap':_0x3d68fd},_0x48f71b,_0x5b1b69,_0x21fc4d),_0x47c4ed=_0x4c6f5e?[]:findSegmentsToDelete(_0x2da16c,_0x3cbc24[_0x4d7d81(0x225)](({yamlConfig:_0x4e4b1f,folderPath:_0x93eb22})=>({'yamlConfig':_0x4e4b1f,'folderPath':resolveTDFolderPath(_0x93eb22,_0x5b1b69,_0x21fc4d)})),_0x3314ee,_0x21fc4d,_0x5b1b69),{journeyFiles:_0x44348f,foldersToCreate:_0x5ee4c0}=await withProgressSpinner(_0x4d7d81(0x20f),async _0xadc146=>prepareJourneyFiles(_0x2c7ea4,{'fetchJourney':async _0x29a2db=>_0xbd46d4[_0x4d7d81(0x1e4)][_0x4d7d81(0x264)](_0x29a2db[_0x4d7d81(0x273)]),'journeyBundlesByFolderAndName':_0x1b36da,'folderPathToId':_0x2b231f,'idToEmailMap':_0x580524,'connectionIdToNameMap':_0x3d68fd,'existingSegments':_0x2da16c,'parentId':_0x34c916,'deps':_0xbd46d4,'progress':{'update':_0x56b32e=>{const _0x17aa26=_0x4d7d81;_0xadc146[_0x17aa26(0x1e9)](_0x56b32e),_0x1bfe92[_0x17aa26(0x1fe)]&&console[_0x17aa26(0x235)]('\x20\x20'+_0x56b32e);}},'journeyById':_0x2d736a,'activationStepsById':_0x17b1ec},_0x5b1b69,_0x21fc4d),{'verbose':_0x1bfe92[_0x4d7d81(0x1fe)]})[_0x4d7d81(0x1ff)](_0x147981=>_0x147981['data']);for(const _0xd2730f of _0x5ee4c0){_0x4763a0['add'](_0xd2730f);}const _0x305e83=_0x4c6f5e?[]:findJourneysToDelete(_0x34025c,_0x2c7ea4['map'](({yamlConfig:_0x4accf1,folderPath:_0x32d2dd})=>({'yamlConfig':_0x4accf1,'folderPath':resolveTDFolderPath(_0x32d2dd,_0x5b1b69,_0x21fc4d)})),_0x3314ee,_0x21fc4d,_0x5b1b69),_0x278d54=calculatePushStats(_0x304ce2,_0x44348f,_0x4763a0,_0x47c4ed,_0x305e83,!!_0x1bfe92[_0x4d7d81(0x1ef)],!!_0x1bfe92[_0x4d7d81(0x242)]),_0x22a617=_0x278d54[_0x4d7d81(0x202)][_0x4d7d81(0x1fd)],_0x5c8952=_0x278d54[_0x4d7d81(0x202)][_0x4d7d81(0x247)],_0x55bf73=_0x278d54[_0x4d7d81(0x202)][_0x4d7d81(0x22e)],_0x1d4b34=_0x278d54[_0x4d7d81(0x202)][_0x4d7d81(0x26d)],_0x3f0754=_0x278d54['folders']['toCreate'],_0x4fc09d=_0x278d54[_0x4d7d81(0x24d)][_0x4d7d81(0x1fd)],_0xb44f5e=_0x278d54[_0x4d7d81(0x24d)][_0x4d7d81(0x247)],_0x2fe622=_0x278d54[_0x4d7d81(0x24d)][_0x4d7d81(0x22e)],_0x437d41=_0x278d54['journeys'][_0x4d7d81(0x26d)],_0x202f55=_0x278d54[_0x4d7d81(0x22d)]['all'],_0x44a84e=_0x278d54[_0x4d7d81(0x22d)][_0x4d7d81(0x1ed)],_0x290ed2=_0x278d54['activations']['toUpdate'],_0x4ef21f=_0x278d54[_0x4d7d81(0x22d)][_0x4d7d81(0x26d)];console[_0x4d7d81(0x235)](_0x4d7d81(0x1e1)+_0x45cca4+'\x27:');_0x3f0754[_0x4d7d81(0x26a)]>0x0&&console[_0x4d7d81(0x235)]('\x20\x20'+a29_0x5e6929[_0x4d7d81(0x238)](_0x4d7d81(0x206)+_0x3f0754['length']+'\x20folders\x20to\x20create'));if(!_0x1bfe92[_0x4d7d81(0x242)]){console[_0x4d7d81(0x235)](_0x4d7d81(0x265)),console[_0x4d7d81(0x235)](_0x4d7d81(0x22c)+a29_0x5e6929[_0x4d7d81(0x256)]('+\x20'+_0x22a617['length']+'\x20new')),console[_0x4d7d81(0x235)](_0x4d7d81(0x22c)+a29_0x5e6929[_0x4d7d81(0x1e0)]('~\x20'+_0x5c8952[_0x4d7d81(0x26a)]+_0x4d7d81(0x237)));if(_0x1d4b34[_0x4d7d81(0x26a)]>0x0)console['error'](_0x4d7d81(0x22c)+a29_0x5e6929[_0x4d7d81(0x25e)]('-\x20'+_0x1d4b34['length']+_0x4d7d81(0x22a)));else _0x47c4ed[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92['delete']&&console[_0x4d7d81(0x235)]('\x20\x20\x20\x20'+a29_0x5e6929[_0x4d7d81(0x245)](_0x47c4ed[_0x4d7d81(0x26a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4d7d81(0x235)](_0x4d7d81(0x22c)+a29_0x5e6929[_0x4d7d81(0x245)]('=\x20'+_0x55bf73['length']+_0x4d7d81(0x201)));}if(_0x44348f[_0x4d7d81(0x26a)]>0x0||_0x305e83[_0x4d7d81(0x26a)]>0x0){console[_0x4d7d81(0x235)](_0x4d7d81(0x207)),console[_0x4d7d81(0x235)](_0x4d7d81(0x22c)+a29_0x5e6929[_0x4d7d81(0x256)]('+\x20'+_0x4fc09d['length']+_0x4d7d81(0x261))),console[_0x4d7d81(0x235)](_0x4d7d81(0x22c)+a29_0x5e6929[_0x4d7d81(0x1e0)]('~\x20'+_0xb44f5e[_0x4d7d81(0x26a)]+_0x4d7d81(0x237)));if(_0x437d41[_0x4d7d81(0x26a)]>0x0)console[_0x4d7d81(0x235)](_0x4d7d81(0x22c)+a29_0x5e6929[_0x4d7d81(0x25e)]('-\x20'+_0x437d41[_0x4d7d81(0x26a)]+'\x20to\x20delete'));else _0x305e83[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92[_0x4d7d81(0x1ef)]&&console['error']('\x20\x20\x20\x20'+a29_0x5e6929[_0x4d7d81(0x245)](_0x305e83[_0x4d7d81(0x26a)]+_0x4d7d81(0x278)));console['error'](_0x4d7d81(0x22c)+a29_0x5e6929['dim']('=\x20'+_0x2fe622[_0x4d7d81(0x26a)]+'\x20unchanged'));}_0x202f55[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92[_0x4d7d81(0x242)]&&(console[_0x4d7d81(0x235)](''),console[_0x4d7d81(0x235)](_0x4d7d81(0x1e6)),_0x44a84e[_0x4d7d81(0x26a)]>0x0&&console[_0x4d7d81(0x235)](_0x4d7d81(0x22c)+a29_0x5e6929[_0x4d7d81(0x256)]('+\x20'+_0x44a84e[_0x4d7d81(0x26a)]+_0x4d7d81(0x23e))),_0x290ed2[_0x4d7d81(0x26a)]>0x0&&console['error'](_0x4d7d81(0x22c)+a29_0x5e6929['yellow']('~\x20'+_0x290ed2[_0x4d7d81(0x26a)]+_0x4d7d81(0x269))),_0x4ef21f[_0x4d7d81(0x26a)]>0x0&&console[_0x4d7d81(0x235)](_0x4d7d81(0x22c)+a29_0x5e6929['red']('-\x20'+_0x4ef21f[_0x4d7d81(0x26a)]+_0x4d7d81(0x22a))));console['error'](_0x4d7d81(0x263)+a29_0x5e6929[_0x4d7d81(0x1f4)](_0x132cd3)+'\x0a');if(_0x3f0754[_0x4d7d81(0x26a)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x5875f6 of _0x3f0754){console[_0x4d7d81(0x235)]('\x20\x20'+a29_0x5e6929['blue']('+')+'\x20'+_0x5875f6);}console[_0x4d7d81(0x235)]('');}if(_0x22a617[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92['journeysOnly'])for(const _0x4205e1 of _0x22a617){const _0x42327e=_0x4205e1[_0x4d7d81(0x231)]?_0x4205e1[_0x4d7d81(0x231)]+'/'+_0x4205e1[_0x4d7d81(0x260)][_0x4d7d81(0x21d)]:_0x4205e1['yamlConfig'][_0x4d7d81(0x21d)],_0x1b8edd=_0x4205e1[_0x4d7d81(0x260)][_0x4d7d81(0x22d)]?.[_0x4d7d81(0x26a)]||0x0,_0x66c479=_0x1b8edd>0x0?a29_0x5e6929['dim']('\x20['+_0x1b8edd+_0x4d7d81(0x27b)):'';console['error']('\x0a'+a29_0x5e6929[_0x4d7d81(0x256)]('New\x20segment:')+'\x20'+_0x42327e+_0x66c479),console['error']('β'[_0x4d7d81(0x24c)](0x3c)),_0x4205e1[_0x4d7d81(0x1ec)]&&console[_0x4d7d81(0x235)](_0x4205e1[_0x4d7d81(0x1ec)]),console[_0x4d7d81(0x235)]('β'[_0x4d7d81(0x24c)](0x3c));}if(_0x1d4b34[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92['journeysOnly'])for(const _0x524700 of _0x1d4b34){const _0x5c48b1=_0x524700[_0x4d7d81(0x220)]?_0x3314ee[_0x4d7d81(0x209)](_0x524700[_0x4d7d81(0x220)][_0x4d7d81(0x1f9)]())||'':'',_0x2099bf=_0x5c48b1?_0x5c48b1+'/'+_0x524700['name']:_0x524700[_0x4d7d81(0x21d)],_0x1a6ed5=_0x4fb0f3[_0x4d7d81(0x209)](_0x524700['id'])||[],_0x298cb9=_0x1a6ed5[_0x4d7d81(0x26a)]>0x0?a29_0x5e6929[_0x4d7d81(0x245)]('\x20['+_0x1a6ed5[_0x4d7d81(0x26a)]+_0x4d7d81(0x27b)):'';console[_0x4d7d81(0x235)]('\x0a'+a29_0x5e6929['red']('Delete\x20segment:')+'\x20'+_0x2099bf+_0x298cb9),console[_0x4d7d81(0x235)]('β'['repeat'](0x3c));const _0x502cc7=segmentWithActivationsToYaml(_0x524700,_0x1a6ed5,undefined,_0x580524,_0x3d68fd),_0x19ba0e=segmentToYamlString(_0x502cc7),_0x47273f=generateDiff(_0x19ba0e,'');console[_0x4d7d81(0x235)](formatDiffWithColors(_0x47273f)),console[_0x4d7d81(0x235)]('β'[_0x4d7d81(0x24c)](0x3c));}const _0x2e97d6=_0x304ce2[_0x4d7d81(0x215)](_0xc7553b=>!_0xc7553b[_0x4d7d81(0x1f7)]&&_0xc7553b[_0x4d7d81(0x1ec)]);if(_0x2e97d6[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92[_0x4d7d81(0x242)])for(const _0x8a37aa of _0x2e97d6){const _0x352172=_0x8a37aa[_0x4d7d81(0x231)]?_0x8a37aa[_0x4d7d81(0x231)]+'/'+_0x8a37aa[_0x4d7d81(0x260)][_0x4d7d81(0x21d)]:_0x8a37aa[_0x4d7d81(0x260)][_0x4d7d81(0x21d)];console[_0x4d7d81(0x235)]('\x0a'+a29_0x5e6929[_0x4d7d81(0x1e0)](_0x4d7d81(0x233))+'\x20'+_0x352172),console[_0x4d7d81(0x235)]('β'['repeat'](0x3c)),console[_0x4d7d81(0x235)](_0x8a37aa['diff']),console[_0x4d7d81(0x235)]('β'[_0x4d7d81(0x24c)](0x3c));}if(_0x4fc09d[_0x4d7d81(0x26a)]>0x0)for(const _0x352d53 of _0x4fc09d){const _0xd39434=_0x352d53[_0x4d7d81(0x231)]?_0x352d53['folderPath']+'/'+_0x352d53[_0x4d7d81(0x260)][_0x4d7d81(0x21d)]:_0x352d53[_0x4d7d81(0x260)][_0x4d7d81(0x21d)];console[_0x4d7d81(0x235)]('\x0a'+a29_0x5e6929[_0x4d7d81(0x256)](_0x4d7d81(0x252))+'\x20'+_0xd39434),console[_0x4d7d81(0x235)]('β'[_0x4d7d81(0x24c)](0x3c)),_0x352d53[_0x4d7d81(0x1ec)]&&console['error'](_0x352d53[_0x4d7d81(0x1ec)]),console[_0x4d7d81(0x235)]('β'[_0x4d7d81(0x24c)](0x3c));}const _0x2c8cee=_0x44348f[_0x4d7d81(0x215)](_0xc32bf1=>!_0xc32bf1[_0x4d7d81(0x1f7)]&&_0xc32bf1['diff']);if(_0x2c8cee[_0x4d7d81(0x26a)]>0x0)for(const _0x4354a6 of _0x2c8cee){const _0x5334ee=_0x4354a6['folderPath']?_0x4354a6[_0x4d7d81(0x231)]+'/'+_0x4354a6[_0x4d7d81(0x260)][_0x4d7d81(0x21d)]:_0x4354a6[_0x4d7d81(0x260)]['name'];console['error']('\x0a'+a29_0x5e6929[_0x4d7d81(0x1e0)](_0x4d7d81(0x259))+'\x20'+_0x5334ee),console[_0x4d7d81(0x235)]('β'[_0x4d7d81(0x24c)](0x3c)),console[_0x4d7d81(0x235)](_0x4354a6['diff']),console['error']('β'[_0x4d7d81(0x24c)](0x3c));}if(_0x437d41['length']>0x0)for(const _0xb9c601 of _0x437d41){const _0x4ab713=_0xb9c601[_0x4d7d81(0x228)]?_0x3314ee[_0x4d7d81(0x209)](_0xb9c601[_0x4d7d81(0x228)])||'':'',_0x27b8d9=_0x4ab713?_0x4ab713+'/'+_0xb9c601[_0x4d7d81(0x1e2)]:_0xb9c601['journeyBundleName'];console[_0x4d7d81(0x235)]('\x0a'+a29_0x5e6929[_0x4d7d81(0x25e)](_0x4d7d81(0x230))+'\x20'+_0x27b8d9),console[_0x4d7d81(0x235)]('β'[_0x4d7d81(0x24c)](0x3c)),console['error'](a29_0x5e6929[_0x4d7d81(0x25e)](_0x4d7d81(0x243))),console[_0x4d7d81(0x235)]('β'['repeat'](0x3c));}if(_0x1bfe92['dryRun'])return console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x1e0)](_0x4d7d81(0x20e))),0x0;const _0x39d039=_0x1bfe92['journeysOnly']?![]:_0x22a617['length']>0x0||_0x5c8952[_0x4d7d81(0x26a)]>0x0||_0x1d4b34['length']>0x0,_0x5eb464=_0x4fc09d[_0x4d7d81(0x26a)]>0x0||_0xb44f5e[_0x4d7d81(0x26a)]>0x0||_0x437d41[_0x4d7d81(0x26a)]>0x0,_0x45aafc=_0x1bfe92[_0x4d7d81(0x242)]?![]:_0x202f55[_0x4d7d81(0x26a)]>0x0,_0x21fcb1=_0x3f0754[_0x4d7d81(0x26a)]>0x0;if(!_0x39d039&&!_0x5eb464&&!_0x45aafc&&!_0x21fcb1){const _0x27b5da=_0x1bfe92['journeysOnly']?_0x4d7d81(0x279):'β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x256)](_0x27b5da));if(_0x4c6f5e&&_0x2fe622[_0x4d7d81(0x26a)]===0x1){const _0x482f3e=_0x2fe622[0x0];if(_0x482f3e['existingJourney']?.['id']){const _0x26e787=getConsoleNextUrl(_0x1bfe92[_0x4d7d81(0x234)],_0x4d7d81(0x218)+_0x34c916+_0x4d7d81(0x20b)+_0x482f3e[_0x4d7d81(0x1e7)]['id']+_0x4d7d81(0x221));console[_0x4d7d81(0x235)]('\x20\x20'+a29_0x5e6929[_0x4d7d81(0x1f4)](_0x26e787));}}return 0x0;}const _0x10898c=_0x1bfe92['journeysOnly']?_0x4fc09d[_0x4d7d81(0x26a)]+_0xb44f5e[_0x4d7d81(0x26a)]+_0x437d41[_0x4d7d81(0x26a)]+_0x3f0754['length']:_0x22a617[_0x4d7d81(0x26a)]+_0x5c8952[_0x4d7d81(0x26a)]+_0x1d4b34[_0x4d7d81(0x26a)]+_0x4fc09d['length']+_0xb44f5e[_0x4d7d81(0x26a)]+_0x437d41[_0x4d7d81(0x26a)]+_0x3f0754[_0x4d7d81(0x26a)]+_0x202f55[_0x4d7d81(0x26a)];if(!_0x1bfe92[_0x4d7d81(0x22b)]&&_0x10898c>0x0){const _0xe2c2ca=await confirmKey(_0x4d7d81(0x1e5)+_0x10898c+_0x4d7d81(0x217));if(!_0xe2c2ca)return console['error'](_0x4d7d81(0x239)),0x1;}const _0x182919={'withProgress':async(_0x225e58,_0x91adca)=>{const _0x2d124b=_0x4d7d81,_0x3822f8=await withSpinner(_0x225e58,_0x91adca,{'verbose':_0x1bfe92[_0x2d124b(0x1fe)]});return{'data':_0x3822f8['data']};},'logInfo':_0x234ceb=>console['error'](a29_0x5e6929[_0x4d7d81(0x238)]('β\x20'+_0x234ceb)),'logSuccess':_0x4aa321=>console['error'](a29_0x5e6929[_0x4d7d81(0x256)]('β\x20'+_0x4aa321)),'logWarning':_0xf92dd5=>console[_0x4d7d81(0x235)](a29_0x5e6929['yellow']('β \x20'+_0xf92dd5)),'logDeleted':_0x2f4c69=>console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x25e)]('β\x20'+_0x2f4c69))},_0x3d2e4d={'segment':_0xbd46d4[_0x4d7d81(0x254)],'journey':_0xbd46d4[_0x4d7d81(0x1e4)],'user':_0xbd46d4[_0x4d7d81(0x241)],'connection':_0xbd46d4[_0x4d7d81(0x21a)]};_0x3f0754['length']>0x0&&(_0x2b231f=await executePushFolders(_0x3d2e4d,_0x3f0754,_0x2b231f,{'parentId':_0x34c916},_0x182919));const _0xf96b52={'rootFolderId':_0x2b7c93,'folderPathToId':_0x2b231f,'folderIdToPath':_0x3314ee,'segmentNameToId':_0x459d15,'activationsBySegmentId':_0x4fb0f3,'emailToIdMap':_0x315eee,'idToEmailMap':_0x580524,'connectionNameToIdMap':_0x1ee79c[_0x4d7d81(0x229)],'connectionIdToNameMap':_0x1ee79c[_0x4d7d81(0x246)],'connectionNameToTypeMap':_0x46c356},_0x2fd90d=await executePushSegments(_0x3d2e4d,_0x1bfe92[_0x4d7d81(0x242)]?[]:_0x304ce2,_0xf96b52,{'parentId':_0x34c916},_0x182919),_0x4e17d8=_0x2fd90d['created'],_0x550ba4=_0x2fd90d[_0x4d7d81(0x20d)],_0xbaef64=_0x2fd90d[_0x4d7d81(0x22d)][_0x4d7d81(0x23f)],_0x431e99=_0x2fd90d['activations'][_0x4d7d81(0x20d)],_0x89a596=_0x2fd90d[_0x4d7d81(0x22d)]['deleted'],_0x2f20d6=await executePushSegmentDeletions(_0x3d2e4d,_0x1bfe92[_0x4d7d81(0x242)]?[]:_0x1d4b34,_0x182919);let _0x4733ac=0x0,_0x3ce15d=0x0,_0x490ad5=0x0;const _0x241295=new Map(_0x459d15);for(const [_0x1ab0a5,_0x27badf]of _0x2fd90d[_0x4d7d81(0x23c)]){_0x241295['set'](_0x1ab0a5,_0x27badf);}if(_0x44348f[_0x4d7d81(0x26a)]>0x0){const _0x24233a={..._0xf96b52,'segmentNameToId':_0x241295,'existingSegments':_0x2da16c,'activationContext':_0x48f71b},_0x1b2b2a=await executePushJourneys(_0x3d2e4d,_0x44348f,_0x24233a,{'parentId':_0x34c916,'rootFolderId':_0x2b7c93,'verbose':_0x1bfe92[_0x4d7d81(0x1fe)]},_0x182919);_0x4733ac=_0x1b2b2a[_0x4d7d81(0x23f)],_0x3ce15d=_0x1b2b2a['updated'];if(_0x4c6f5e&&_0x1b2b2a[_0x4d7d81(0x26e)][_0x4d7d81(0x26a)]===0x1){const _0x644adb=_0x1b2b2a[_0x4d7d81(0x26e)][0x0];if(_0x644adb[_0x4d7d81(0x273)]){const _0x2fb695=getConsoleNextUrl(_0x1bfe92[_0x4d7d81(0x234)],_0x4d7d81(0x218)+_0x34c916+_0x4d7d81(0x20b)+_0x644adb['journeyId']+_0x4d7d81(0x221));console[_0x4d7d81(0x235)]('\x20\x20'+a29_0x5e6929[_0x4d7d81(0x1f4)](_0x2fb695));}}}for(const _0x3a1c58 of _0x437d41){console[_0x4d7d81(0x235)](a29_0x5e6929['yellow'](_0x4d7d81(0x240)+_0x3a1c58['journeyBundleName'])),_0x490ad5++;}const _0x50fa9d=[];if(_0x4e17d8>0x0)_0x50fa9d[_0x4d7d81(0x1f0)](_0x4e17d8+_0x4d7d81(0x277));if(_0x550ba4>0x0)_0x50fa9d['push'](_0x550ba4+_0x4d7d81(0x262));if(_0x2f20d6>0x0)_0x50fa9d[_0x4d7d81(0x1f0)](_0x2f20d6+_0x4d7d81(0x210));const _0x280da2=[];if(_0x4733ac>0x0)_0x280da2['push'](_0x4733ac+_0x4d7d81(0x277));if(_0x3ce15d>0x0)_0x280da2[_0x4d7d81(0x1f0)](_0x3ce15d+_0x4d7d81(0x262));if(_0x490ad5>0x0)_0x280da2[_0x4d7d81(0x1f0)](_0x490ad5+_0x4d7d81(0x210));const _0x5027c8=[];if(_0xbaef64>0x0)_0x5027c8[_0x4d7d81(0x1f0)](_0xbaef64+_0x4d7d81(0x277));if(_0x431e99>0x0)_0x5027c8[_0x4d7d81(0x1f0)](_0x431e99+'\x20updated');if(_0x89a596>0x0)_0x5027c8[_0x4d7d81(0x1f0)](_0x89a596+'\x20deleted');return console[_0x4d7d81(0x235)](a29_0x5e6929[_0x4d7d81(0x256)](_0x4d7d81(0x21b))),_0x50fa9d[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92[_0x4d7d81(0x242)]&&console[_0x4d7d81(0x235)]('\x20\x20Segments:\x20'+_0x50fa9d[_0x4d7d81(0x208)](',\x20')),_0x280da2[_0x4d7d81(0x26a)]>0x0&&console[_0x4d7d81(0x235)](_0x4d7d81(0x224)+_0x280da2[_0x4d7d81(0x208)](',\x20')),_0x5027c8[_0x4d7d81(0x26a)]>0x0&&!_0x1bfe92[_0x4d7d81(0x242)]&&console['error'](_0x4d7d81(0x249)+_0x5027c8[_0x4d7d81(0x208)](',\x20')),0x0;}}
|
|
1
|
+
const a29_0x286f31=a29_0x5032;function a29_0x5032(_0x176864,_0x16307c){_0x176864=_0x176864-0x7a;const _0x45aab8=a29_0x45aa();let _0x50322a=_0x45aab8[_0x176864];return _0x50322a;}(function(_0x3cf8db,_0x1a6194){const _0x327aae=a29_0x5032,_0x45d452=_0x3cf8db();while(!![]){try{const _0x158b6f=-parseInt(_0x327aae(0xaa))/0x1*(-parseInt(_0x327aae(0xdd))/0x2)+-parseInt(_0x327aae(0x90))/0x3*(parseInt(_0x327aae(0xbc))/0x4)+parseInt(_0x327aae(0xae))/0x5*(parseInt(_0x327aae(0xb6))/0x6)+parseInt(_0x327aae(0x106))/0x7*(-parseInt(_0x327aae(0x8c))/0x8)+parseInt(_0x327aae(0x9f))/0x9*(-parseInt(_0x327aae(0xec))/0xa)+parseInt(_0x327aae(0xd9))/0xb+parseInt(_0x327aae(0x87))/0xc;if(_0x158b6f===_0x1a6194)break;else _0x45d452['push'](_0x45d452['shift']());}catch(_0x3c7dfc){_0x45d452['push'](_0x45d452['shift']());}}}(a29_0x45aa,0x7caab));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x7fbe0c from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a29_0x45aa(){const _0x44a96f=['\x20activations]','setPhase','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','journeysOnly','listJourneysWithDetailsFromParentSegment','isNew','description','new','push','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toCreate','delete','journeys','Scoped\x20to\x20folder:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','.yaml','toDelete','653988fOUcyG','length','folders','createdAt','isScoped','4184QjRiDn','Error:\x20Directory\x20not\x20found:\x20','parent_name','endsWith','15SHZCIk','Delete\x20journey:','attributes','\x20changes?','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','activations','Source\x20directory:\x20','existingJourney','Aborted.','filePath','β\x20All\x20journeys\x20are\x20up\x20to\x20date','(Journey\x20will\x20be\x20deleted)','dim','Changes\x20to\x20journey:','9vjUbDC','segments','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','data','join','Fetching\x20connections\x20for\x20name\x20resolution...','resolveParentId','\x20\x20Activations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','then','1vELsOs','segment:push','yellow','versionNumber','130ahkJTp','journeyBundleName','journeyId','unchanged','audienceId','segment\x20or\x20journey','\x20new','Changes\x20to:','74274pIWFot','/j/da/je','connection','segmentFolderId','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','filter','481196UhFWDj','yes','Resolving\x20parent\x20segment\x20\x27','changed','set','green','scopedFolderPath','segment','results','\x20to\x20update','\x20unchanged','Fetching\x20existing\x20journeys...','\x0aβ\x20Push\x20complete','\x20updated','relationships','idToName','\x20folders\x20to\x20create','\x20created','Delete\x20segment:','\x20to\x20delete','folderPath','created','helpText','getJourney','\x20\x20Journeys:\x20','/e/','parentSegment','site','\x20\x20Activations:','10567205SnimDs','type','nameToId','message','1797872DaPdlD','blue','getOutputSchemaWithCache','verbose','\x20\x20π\x20Segments:','buildUserMaps','.yml','red','get','user','repeat','journey','folderId','New\x20journey:','name','5071970nHIVvZ','error','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','yamlConfig','state','\x0aValidation\x20failed:','Fetching\x20parent\x20segment\x20details...','toUpdate','file','\x27...','\x20YAML\x20files\x20found','updatedAt','all','\x20\x20\x20\x20','diff','\x20changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','paused','Push\x20','updated','cwd','Site:\x20','\x20deleted','Fetching\x20existing\x20activations...','\x20\x20Source:\x20','targetDir','8253yYqhtm','Parent\x20segment:\x20','map','cyan','/app/ps/','Fetching\x20existing\x20segments...'];a29_0x45aa=function(){return _0x44a96f;};return a29_0x45aa();}export class SegmentPushCommand extends BaseCommand{[a29_0x286f31(0xeb)]=a29_0x286f31(0xab);[a29_0x286f31(0x7b)]=a29_0x286f31(0xa8);async['execute'](_0x27d89b){const _0x58d216=a29_0x286f31,{options:_0x413651,args:_0xcdf34,tdx:_0x399eaa}=_0x27d89b,_0x319cb7=_0x413651,_0x19cdfa=await resolveTarget({'arg':_0xcdf34[0x0],'contextParent':_0x413651[_0x58d216(0xd6)],'cwd':process[_0x58d216(0x100)]()});if(!isSuccessfulResolution(_0x19cdfa))return _0x19cdfa['errorCode']===_0x58d216(0x94)?(console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0x95))),console[_0x58d216(0xed)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x58d216(0xed)](_0x58d216(0xfc)),console[_0x58d216(0xed)](_0x58d216(0x84))):(console[_0x58d216(0xed)](a29_0x7fbe0c['red']('Error:\x20'+_0x19cdfa[_0x58d216(0xdc)]+'\x0a')),_0x19cdfa[_0x58d216(0xd2)]&&console['error'](a29_0x7fbe0c[_0x58d216(0x109)](_0x19cdfa[_0x58d216(0xd2)]))),0x1;if(_0x19cdfa['type']===_0x58d216(0x8e))return console['error'](a29_0x7fbe0c['red'](_0x58d216(0x8d)+_0x19cdfa[_0x58d216(0x105)]+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0x7f))),0x1;const _0x4ccf37=_0x19cdfa['parentName'],_0x4f20d6=_0x19cdfa['targetDir'],_0xc70a1c=_0x19cdfa[_0x58d216(0xda)]===_0x58d216(0xf4)?_0x19cdfa[_0x58d216(0x9a)]:undefined,_0x5706ec=getScopedDetails(_0x19cdfa),_0x15a0cd=_0x5706ec?.[_0x58d216(0x8b)]??![],_0x1b7f36=_0x5706ec?.[_0x58d216(0xc2)]??'';if(!existsSync(_0x4f20d6))return console[_0x58d216(0xed)](a29_0x7fbe0c['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x4f20d6+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0x7f))),0x1;_0x319cb7['verbose']&&(console['error'](_0x58d216(0x101)+_0x319cb7[_0x58d216(0xd7)]),console[_0x58d216(0xed)](_0x58d216(0x107)+_0x4ccf37),console[_0x58d216(0xed)](_0x58d216(0x97)+_0x4f20d6),_0x15a0cd&&console[_0x58d216(0xed)](_0x58d216(0x83)+_0x1b7f36));const _0x381885=await withSpinner(_0x58d216(0xbe)+_0x4ccf37+_0x58d216(0xf5),()=>_0x399eaa['segment'][_0x58d216(0xa5)](_0x4ccf37),{'verbose':_0x319cb7['verbose']}),_0x91d0a1=_0x381885[_0x58d216(0xa2)],[_0x567b6a,_0x528521,_0x3b2915,_0x30c69f,_0x4f0302]=await Promise[_0x58d216(0xf8)]([withSpinner(_0x58d216(0xf2),()=>_0x399eaa[_0x58d216(0xc3)]['getParent'](_0x91d0a1),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner(_0x58d216(0x10b),()=>_0x399eaa[_0x58d216(0xc3)]['listSegments'](_0x91d0a1),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x399eaa['segment']['listFolders'](_0x91d0a1),{'verbose':_0x319cb7['verbose']}),withSpinner(_0x58d216(0xc7),()=>_0x399eaa['journey'][_0x58d216(0x110)](_0x91d0a1,{'includeAllVersions':!![]}),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x399eaa[_0x58d216(0xe6)][_0x58d216(0xe2)](),{'verbose':_0x319cb7[_0x58d216(0xe0)]})[_0x58d216(0xa9)](_0x159059=>_0x159059['data'])]),_0x3bf602=_0x567b6a['data'],_0x1a2c89=extractRootFolderId(_0x3bf602),_0x5f0e92=_0x528521[_0x58d216(0xa2)],_0x23c4d6=_0x3b2915['data'],{journeys:_0x2de25c,activationStepsById:_0x2cd6f0}=_0x30c69f[_0x58d216(0xa2)],_0x350907=new Map(_0x2de25c[_0x58d216(0x108)](_0xcd70e3=>[_0xcd70e3['id'],_0xcd70e3])),_0x1443e4=_0x2de25c['map'](_0x2bd938=>({'id':_0x2bd938['id'],'name':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xeb)],'journeyBundleName':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xaf)]||'','journeyBundleId':_0x2bd938[_0x58d216(0x92)]['journeyBundleId']||'','versionNumber':_0x2bd938['attributes'][_0x58d216(0xad)],'description':_0x2bd938['attributes'][_0x58d216(0x7b)],'state':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xf0)],'paused':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xfd)],'audienceId':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xb2)],'folderId':_0x2bd938[_0x58d216(0xca)]?.['parentFolder']?.[_0x58d216(0xa2)]?.['id'],'createdAt':_0x2bd938[_0x58d216(0x92)][_0x58d216(0x8a)],'updatedAt':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xf7)]})),{emailToId:_0x477eb4,idToEmail:_0xb51417}=_0x4f0302,_0x19a77d=await withSpinner(_0x58d216(0xa4),async()=>{const _0x4115dc=_0x58d216,_0x22f274=await _0x399eaa[_0x4115dc(0xb8)]['list']();return buildConnectionMaps(_0x22f274);},{'verbose':_0x319cb7['verbose']})[_0x58d216(0xa9)](_0x43ff9f=>_0x43ff9f['data']),_0x5a408c=_0x19a77d['nameToId'],_0x2df1e4=_0x19a77d[_0x58d216(0xcb)],_0x577615=_0x19a77d['nameToType'],_0x58d223={'emailToIdMap':_0x477eb4,'connectionNameToIdMap':_0x5a408c,'connectionNameToTypeMap':_0x577615,'getSchema':_0x114f03=>_0x399eaa['connection'][_0x58d216(0xdf)](_0x114f03)};let {pathToId:_0x10d0aa,idToPath:_0x5d16f2}=buildFolderMaps(_0x23c4d6);const _0x5c23ac=buildSegmentLookupMap(_0x5f0e92,_0x5d16f2),_0x256e2c=buildSegmentNameToIdMap(_0x5f0e92),_0x3ed365=buildJourneyBundleLookupMap(_0x1443e4,_0x5d16f2);let _0x531b4b;if(_0xc70a1c){if(!_0xc70a1c[_0x58d216(0x8f)](_0x58d216(0xe3))&&!_0xc70a1c[_0x58d216(0x8f)](_0x58d216(0x85)))return console[_0x58d216(0xed)](a29_0x7fbe0c['red'](_0x58d216(0x10e)+_0xc70a1c+'\x0a')),0x1;_0x531b4b=[_0xc70a1c];}else _0x531b4b=findYamlFiles(_0x4f20d6);if(_0x531b4b[_0x58d216(0x88)]===0x0)return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4f20d6+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0xee))),0x1;let _0x253d63,_0x55c8e2;try{const _0x2aea0f=parseAndClassifyYamlFiles(_0x531b4b,_0x4f20d6,{'skipSegments':_0x319cb7[_0x58d216(0x10f)]});_0x253d63=_0x2aea0f[_0x58d216(0xa0)],_0x55c8e2=_0x2aea0f[_0x58d216(0x82)];const _0x403527=validateParsedFiles(_0x2aea0f,_0x4f20d6);if(_0x403527[_0x58d216(0x88)]>0x0)return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0xf1))),console[_0x58d216(0xed)](formatValidationErrors(_0x403527)),console['error'](a29_0x7fbe0c[_0x58d216(0xac)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1504a9){return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('Error\x20parsing\x20YAML:\x20'+(_0x1504a9 instanceof Error?_0x1504a9[_0x58d216(0xdc)]:_0x1504a9))),0x1;}if(_0x253d63['length']===0x0&&_0x55c8e2[_0x58d216(0x88)]===0x0){const _0x134342=_0x319cb7['journeysOnly']?_0x58d216(0xe8):_0x58d216(0xb3);return console[_0x58d216(0xed)](a29_0x7fbe0c['yellow']('No\x20'+_0x134342+_0x58d216(0xf6))),0x0;}const _0x401037=new Map();_0x5f0e92['length']>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&await withSpinner(_0x58d216(0x103),async()=>{await batchAsync(_0x5f0e92,async _0x6f161b=>{const _0x54b17c=a29_0x5032,_0xd33def=await _0x399eaa[_0x54b17c(0xc3)]['listActivations'](_0x91d0a1,_0x6f161b['id']);_0x401037[_0x54b17c(0xc0)](_0x6f161b['id'],_0xd33def);});},{'verbose':_0x319cb7[_0x58d216(0xe0)]});const {segmentFiles:_0x5e9c13,foldersToCreate:_0x5e2ea7}=await prepareSegmentFiles(_0x253d63,{'segmentByFolderAndName':_0x5c23ac,'activationsBySegmentId':_0x401037,'folderPathToId':_0x10d0aa,'idToEmailMap':_0xb51417,'connectionIdToNameMap':_0x2df1e4},_0x58d223,_0x15a0cd,_0x1b7f36),_0x17b982=_0xc70a1c?[]:findSegmentsToDelete(_0x5f0e92,_0x253d63[_0x58d216(0x108)](({yamlConfig:_0x43734a,folderPath:_0x25f057})=>({'yamlConfig':_0x43734a,'folderPath':resolveTDFolderPath(_0x25f057,_0x15a0cd,_0x1b7f36)})),_0x5d16f2,_0x1b7f36,_0x15a0cd),{journeyFiles:_0x4df179,foldersToCreate:_0xc3772f}=await withProgressSpinner('Preparing\x20journeys...',async _0x20f955=>prepareJourneyFiles(_0x55c8e2,{'fetchJourney':async _0x35bc58=>_0x399eaa[_0x58d216(0xe8)][_0x58d216(0xd3)](_0x35bc58[_0x58d216(0xb0)]),'journeyBundlesByFolderAndName':_0x3ed365,'folderPathToId':_0x10d0aa,'idToEmailMap':_0xb51417,'connectionIdToNameMap':_0x2df1e4,'existingSegments':_0x5f0e92,'parentId':_0x91d0a1,'deps':_0x399eaa,'progress':{'update':_0x4d8892=>{const _0x556f1e=_0x58d216;_0x20f955[_0x556f1e(0x10d)](_0x4d8892),_0x319cb7[_0x556f1e(0xe0)]&&console['error']('\x20\x20'+_0x4d8892);}},'journeyById':_0x350907,'activationStepsById':_0x2cd6f0},_0x15a0cd,_0x1b7f36),{'verbose':_0x319cb7[_0x58d216(0xe0)]})['then'](_0x21d58d=>_0x21d58d[_0x58d216(0xa2)]);for(const _0x42fca1 of _0xc3772f){_0x5e2ea7['add'](_0x42fca1);}const _0xfed488=_0xc70a1c?[]:findJourneysToDelete(_0x1443e4,_0x55c8e2[_0x58d216(0x108)](({yamlConfig:_0x58e286,folderPath:_0x3b6fa3})=>({'yamlConfig':_0x58e286,'folderPath':resolveTDFolderPath(_0x3b6fa3,_0x15a0cd,_0x1b7f36)})),_0x5d16f2,_0x1b7f36,_0x15a0cd),_0x3a4b5b=calculatePushStats(_0x5e9c13,_0x4df179,_0x5e2ea7,_0x17b982,_0xfed488,!!_0x319cb7[_0x58d216(0x81)],!!_0x319cb7['journeysOnly']),_0x3d724c=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0x7c)],_0x551952=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0xbf)],_0x25023c=_0x3a4b5b[_0x58d216(0xa0)]['unchanged'],_0x3c5349=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0x86)],_0x1126e4=_0x3a4b5b[_0x58d216(0x89)][_0x58d216(0x80)],_0x103929=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0x7c)],_0x211b25=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0xbf)],_0x36c32c=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0xb1)],_0x2ae8e4=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0x86)],_0x530eb4=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0xf8)],_0x4e308c=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0x80)],_0x382d4a=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0xf3)],_0x1fab77=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0x86)];console[_0x58d216(0xed)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4ccf37+'\x27:');_0x1126e4[_0x58d216(0x88)]>0x0&&console['error']('\x20\x20'+a29_0x7fbe0c[_0x58d216(0xde)]('π\x20'+_0x1126e4[_0x58d216(0x88)]+_0x58d216(0xcc)));if(!_0x319cb7[_0x58d216(0x10f)]){console[_0x58d216(0xed)](_0x58d216(0xe1)),console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x3d724c[_0x58d216(0x88)]+_0x58d216(0xb4))),console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x551952[_0x58d216(0x88)]+_0x58d216(0xfb)));if(_0x3c5349[_0x58d216(0x88)]>0x0)console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xe4)]('-\x20'+_0x3c5349[_0x58d216(0x88)]+'\x20to\x20delete'));else _0x17b982[_0x58d216(0x88)]>0x0&&!_0x319cb7['delete']&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c['dim'](_0x17b982[_0x58d216(0x88)]+_0x58d216(0xa1)));console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0x9d)]('=\x20'+_0x25023c[_0x58d216(0x88)]+_0x58d216(0xc6)));}if(_0x4df179[_0x58d216(0x88)]>0x0||_0xfed488['length']>0x0){console[_0x58d216(0xed)]('\x20\x20πΊοΈ\x20\x20Journeys:'),console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x103929[_0x58d216(0x88)]+_0x58d216(0xb4))),console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x211b25[_0x58d216(0x88)]+_0x58d216(0xfb)));if(_0x2ae8e4[_0x58d216(0x88)]>0x0)console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c['red']('-\x20'+_0x2ae8e4[_0x58d216(0x88)]+_0x58d216(0xcf)));else _0xfed488[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x81)]&&console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0x9d)](_0xfed488['length']+_0x58d216(0xa1)));console[_0x58d216(0xed)]('\x20\x20\x20\x20'+a29_0x7fbe0c[_0x58d216(0x9d)]('=\x20'+_0x36c32c[_0x58d216(0x88)]+'\x20unchanged'));}_0x530eb4['length']>0x0&&!_0x319cb7['journeysOnly']&&(console[_0x58d216(0xed)](''),console['error'](_0x58d216(0xd8)),_0x4e308c[_0x58d216(0x88)]>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x4e308c[_0x58d216(0x88)]+'\x20to\x20create')),_0x382d4a['length']>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x382d4a[_0x58d216(0x88)]+_0x58d216(0xc5))),_0x1fab77[_0x58d216(0x88)]>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xe4)]('-\x20'+_0x1fab77[_0x58d216(0x88)]+_0x58d216(0xcf))));console['error'](_0x58d216(0x104)+a29_0x7fbe0c[_0x58d216(0x109)](_0x4f20d6)+'\x0a');if(_0x1126e4[_0x58d216(0x88)]>0x0){console[_0x58d216(0xed)]('Folders\x20to\x20create:');for(const _0x1eecac of _0x1126e4){console['error']('\x20\x20'+a29_0x7fbe0c[_0x58d216(0xde)]('+')+'\x20'+_0x1eecac);}console[_0x58d216(0xed)]('');}if(_0x3d724c['length']>0x0&&!_0x319cb7['journeysOnly'])for(const _0x54f572 of _0x3d724c){const _0x553d86=_0x54f572[_0x58d216(0xd0)]?_0x54f572['folderPath']+'/'+_0x54f572[_0x58d216(0xef)][_0x58d216(0xeb)]:_0x54f572[_0x58d216(0xef)][_0x58d216(0xeb)],_0x936c29=_0x54f572[_0x58d216(0xef)][_0x58d216(0x96)]?.[_0x58d216(0x88)]||0x0,_0x476c0f=_0x936c29>0x0?a29_0x7fbe0c[_0x58d216(0x9d)]('\x20['+_0x936c29+_0x58d216(0x10c)):'';console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c['green']('New\x20segment:')+'\x20'+_0x553d86+_0x476c0f),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),_0x54f572[_0x58d216(0xfa)]&&console[_0x58d216(0xed)](_0x54f572[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x3c5349[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)])for(const _0x28caea of _0x3c5349){const _0x5c33d3=_0x28caea[_0x58d216(0xb9)]?_0x5d16f2['get'](_0x28caea[_0x58d216(0xb9)]['toString']())||'':'',_0x308a16=_0x5c33d3?_0x5c33d3+'/'+_0x28caea[_0x58d216(0xeb)]:_0x28caea[_0x58d216(0xeb)],_0x4afd9e=_0x401037[_0x58d216(0xe5)](_0x28caea['id'])||[],_0x5024cf=_0x4afd9e['length']>0x0?a29_0x7fbe0c[_0x58d216(0x9d)]('\x20['+_0x4afd9e[_0x58d216(0x88)]+_0x58d216(0x10c)):'';console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0xce))+'\x20'+_0x308a16+_0x5024cf),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));const _0x117bea=segmentWithActivationsToYaml(_0x28caea,_0x4afd9e,undefined,_0xb51417,_0x2df1e4),_0x379598=segmentToYamlString(_0x117bea),_0x5ba139=generateDiff(_0x379598,'');console[_0x58d216(0xed)](formatDiffWithColors(_0x5ba139)),console['error']('β'[_0x58d216(0xe7)](0x3c));}const _0x5e34c7=_0x5e9c13[_0x58d216(0xbb)](_0x265094=>!_0x265094[_0x58d216(0x7a)]&&_0x265094['diff']);if(_0x5e34c7[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)])for(const _0x51c060 of _0x5e34c7){const _0x553a81=_0x51c060[_0x58d216(0xd0)]?_0x51c060[_0x58d216(0xd0)]+'/'+_0x51c060[_0x58d216(0xef)][_0x58d216(0xeb)]:_0x51c060[_0x58d216(0xef)]['name'];console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c['yellow'](_0x58d216(0xb5))+'\x20'+_0x553a81),console['error']('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](_0x51c060[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x103929['length']>0x0)for(const _0x45b535 of _0x103929){const _0x6937f5=_0x45b535[_0x58d216(0xd0)]?_0x45b535[_0x58d216(0xd0)]+'/'+_0x45b535['yamlConfig'][_0x58d216(0xeb)]:_0x45b535[_0x58d216(0xef)]['name'];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xc1)](_0x58d216(0xea))+'\x20'+_0x6937f5),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),_0x45b535[_0x58d216(0xfa)]&&console['error'](_0x45b535[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}const _0x5d44cc=_0x4df179[_0x58d216(0xbb)](_0x2c1d40=>!_0x2c1d40[_0x58d216(0x7a)]&&_0x2c1d40[_0x58d216(0xfa)]);if(_0x5d44cc[_0x58d216(0x88)]>0x0)for(const _0x26e342 of _0x5d44cc){const _0x4099f7=_0x26e342[_0x58d216(0xd0)]?_0x26e342[_0x58d216(0xd0)]+'/'+_0x26e342['yamlConfig']['name']:_0x26e342[_0x58d216(0xef)][_0x58d216(0xeb)];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0x9e))+'\x20'+_0x4099f7),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](_0x26e342[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x2ae8e4[_0x58d216(0x88)]>0x0)for(const _0x5b5779 of _0x2ae8e4){const _0xeb0b81=_0x5b5779[_0x58d216(0xe9)]?_0x5d16f2[_0x58d216(0xe5)](_0x5b5779[_0x58d216(0xe9)])||'':'',_0xbe86f5=_0xeb0b81?_0xeb0b81+'/'+_0x5b5779[_0x58d216(0xaf)]:_0x5b5779[_0x58d216(0xaf)];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0x91))+'\x20'+_0xbe86f5),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0x9c))),console['error']('β'[_0x58d216(0xe7)](0x3c));}if(_0x319cb7['dryRun'])return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0xa7))),0x0;const _0x4eafce=_0x319cb7[_0x58d216(0x10f)]?![]:_0x3d724c[_0x58d216(0x88)]>0x0||_0x551952[_0x58d216(0x88)]>0x0||_0x3c5349['length']>0x0,_0x113b35=_0x103929[_0x58d216(0x88)]>0x0||_0x211b25[_0x58d216(0x88)]>0x0||_0x2ae8e4[_0x58d216(0x88)]>0x0,_0x270e3a=_0x319cb7[_0x58d216(0x10f)]?![]:_0x530eb4[_0x58d216(0x88)]>0x0,_0x3fc226=_0x1126e4[_0x58d216(0x88)]>0x0;if(!_0x4eafce&&!_0x113b35&&!_0x270e3a&&!_0x3fc226){const _0x238df0=_0x319cb7[_0x58d216(0x10f)]?_0x58d216(0x9b):_0x58d216(0x7e);console['error'](a29_0x7fbe0c[_0x58d216(0xc1)](_0x238df0));if(_0xc70a1c&&_0x36c32c[_0x58d216(0x88)]===0x1){const _0xc932c9=_0x36c32c[0x0];if(_0xc932c9[_0x58d216(0x98)]?.['id']){const _0xcceed0=getConsoleNextUrl(_0x319cb7[_0x58d216(0xd7)],'/app/ps/'+_0x91d0a1+_0x58d216(0xd5)+_0xc932c9[_0x58d216(0x98)]['id']+'/j/da/je');console[_0x58d216(0xed)]('\x20\x20'+a29_0x7fbe0c[_0x58d216(0x109)](_0xcceed0));}}return 0x0;}const _0x2969c7=_0x319cb7[_0x58d216(0x10f)]?_0x103929[_0x58d216(0x88)]+_0x211b25['length']+_0x2ae8e4[_0x58d216(0x88)]+_0x1126e4[_0x58d216(0x88)]:_0x3d724c[_0x58d216(0x88)]+_0x551952[_0x58d216(0x88)]+_0x3c5349[_0x58d216(0x88)]+_0x103929['length']+_0x211b25['length']+_0x2ae8e4[_0x58d216(0x88)]+_0x1126e4[_0x58d216(0x88)]+_0x530eb4[_0x58d216(0x88)];if(!_0x319cb7[_0x58d216(0xbd)]&&_0x2969c7>0x0){const _0x466a48=await confirmKey(_0x58d216(0xfe)+_0x2969c7+_0x58d216(0x93));if(!_0x466a48)return console['error'](_0x58d216(0x99)),0x1;}const _0x3ee1e7={'withProgress':async(_0x3d19e5,_0x2141cf)=>{const _0x35cee4=_0x58d216,_0x541c95=await withSpinner(_0x3d19e5,_0x2141cf,{'verbose':_0x319cb7[_0x35cee4(0xe0)]});return{'data':_0x541c95['data']};},'logInfo':_0x93fed8=>console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xde)]('β\x20'+_0x93fed8)),'logSuccess':_0x26d59d=>console['error'](a29_0x7fbe0c[_0x58d216(0xc1)]('β\x20'+_0x26d59d)),'logWarning':_0x553e49=>console['error'](a29_0x7fbe0c['yellow']('β \x20'+_0x553e49)),'logDeleted':_0x1ad80a=>console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('β\x20'+_0x1ad80a))},_0x293ae2={'segment':_0x399eaa[_0x58d216(0xc3)],'journey':_0x399eaa[_0x58d216(0xe8)],'user':_0x399eaa['user'],'connection':_0x399eaa['connection']};_0x1126e4['length']>0x0&&(_0x10d0aa=await executePushFolders(_0x293ae2,_0x1126e4,_0x10d0aa,{'parentId':_0x91d0a1},_0x3ee1e7));const _0x205fb1={'rootFolderId':_0x1a2c89,'folderPathToId':_0x10d0aa,'folderIdToPath':_0x5d16f2,'segmentNameToId':_0x256e2c,'activationsBySegmentId':_0x401037,'emailToIdMap':_0x477eb4,'idToEmailMap':_0xb51417,'connectionNameToIdMap':_0x19a77d[_0x58d216(0xdb)],'connectionIdToNameMap':_0x19a77d['idToName'],'connectionNameToTypeMap':_0x577615},_0x126246=await executePushSegments(_0x293ae2,_0x319cb7[_0x58d216(0x10f)]?[]:_0x5e9c13,_0x205fb1,{'parentId':_0x91d0a1},_0x3ee1e7),_0x1a3782=_0x126246[_0x58d216(0xd1)],_0x4a7355=_0x126246['updated'],_0x3c462d=_0x126246[_0x58d216(0x96)]['created'],_0x17695f=_0x126246[_0x58d216(0x96)][_0x58d216(0xff)],_0x417def=_0x126246[_0x58d216(0x96)]['deleted'],_0x40c50a=await executePushSegmentDeletions(_0x293ae2,_0x319cb7[_0x58d216(0x10f)]?[]:_0x3c5349,_0x3ee1e7);let _0x33e7ff=0x0,_0x504d45=0x0,_0x36648b=0x0;const _0x578647=new Map(_0x256e2c);for(const [_0x5ab9db,_0x5cafe3]of _0x126246['createdSegmentIds']){_0x578647['set'](_0x5ab9db,_0x5cafe3);}if(_0x4df179[_0x58d216(0x88)]>0x0){const _0x331b75={..._0x205fb1,'segmentNameToId':_0x578647,'existingSegments':_0x5f0e92,'activationContext':_0x58d223},_0x22a750=await executePushJourneys(_0x293ae2,_0x4df179,_0x331b75,{'parentId':_0x91d0a1,'rootFolderId':_0x1a2c89,'verbose':_0x319cb7['verbose']},_0x3ee1e7);_0x33e7ff=_0x22a750[_0x58d216(0xd1)],_0x504d45=_0x22a750[_0x58d216(0xff)];if(_0xc70a1c&&_0x22a750[_0x58d216(0xc4)]['length']===0x1){const _0x53306b=_0x22a750[_0x58d216(0xc4)][0x0];if(_0x53306b[_0x58d216(0xb0)]){const _0x2ec812=getConsoleNextUrl(_0x319cb7['site'],_0x58d216(0x10a)+_0x91d0a1+_0x58d216(0xd5)+_0x53306b[_0x58d216(0xb0)]+_0x58d216(0xb7));console[_0x58d216(0xed)]('\x20\x20'+a29_0x7fbe0c['cyan'](_0x2ec812));}}}for(const _0x293962 of _0x2ae8e4){console[_0x58d216(0xed)](a29_0x7fbe0c['yellow'](_0x58d216(0xba)+_0x293962[_0x58d216(0xaf)])),_0x36648b++;}const _0x10a2b3=[];if(_0x1a3782>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x1a3782+_0x58d216(0xcd));if(_0x4a7355>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x4a7355+_0x58d216(0xc9));if(_0x40c50a>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x40c50a+_0x58d216(0x102));const _0x917940=[];if(_0x33e7ff>0x0)_0x917940[_0x58d216(0x7d)](_0x33e7ff+_0x58d216(0xcd));if(_0x504d45>0x0)_0x917940[_0x58d216(0x7d)](_0x504d45+'\x20updated');if(_0x36648b>0x0)_0x917940[_0x58d216(0x7d)](_0x36648b+_0x58d216(0x102));const _0x1a4868=[];if(_0x3c462d>0x0)_0x1a4868[_0x58d216(0x7d)](_0x3c462d+_0x58d216(0xcd));if(_0x17695f>0x0)_0x1a4868['push'](_0x17695f+_0x58d216(0xc9));if(_0x417def>0x0)_0x1a4868[_0x58d216(0x7d)](_0x417def+_0x58d216(0x102));return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xc1)](_0x58d216(0xc8))),_0x10a2b3[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&console[_0x58d216(0xed)]('\x20\x20Segments:\x20'+_0x10a2b3[_0x58d216(0xa3)](',\x20')),_0x917940[_0x58d216(0x88)]>0x0&&console['error'](_0x58d216(0xd4)+_0x917940['join'](',\x20')),_0x1a4868[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&console[_0x58d216(0xed)](_0x58d216(0xa6)+_0x1a4868[_0x58d216(0xa3)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x377547=a30_0x5d34;(function(_0x380ea8,_0x352393){const _0x23b36d=a30_0x5d34,_0x133ba8=_0x380ea8();while(!![]){try{const _0x12639e=parseInt(_0x23b36d(0x120))/0x1*(-parseInt(_0x23b36d(0x123))/0x2)+parseInt(_0x23b36d(0x13c))/0x3+-parseInt(_0x23b36d(0x127))/0x4+-parseInt(_0x23b36d(0x12b))/0x5+parseInt(_0x23b36d(0x135))/0x6*(-parseInt(_0x23b36d(0x131))/0x7)+parseInt(_0x23b36d(0x13b))/0x8*(parseInt(_0x23b36d(0x12f))/0x9)+parseInt(_0x23b36d(0x12e))/0xa;if(_0x12639e===_0x352393)break;else _0x133ba8['push'](_0x133ba8['shift']());}catch(_0x1d316b){_0x133ba8['push'](_0x133ba8['shift']());}}}(a30_0x5991,0xaa4f9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a30_0x5d34(_0x764704,_0x2c4f8d){_0x764704=_0x764704-0x119;const _0x599147=a30_0x5991();let _0x5d34b7=_0x599147[_0x764704];return _0x5d34b7;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x106d59 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x377547(0x11f)]=a30_0x377547(0x146);[a30_0x377547(0x140)]='Update\x20existing\x20child\x20segment';async[a30_0x377547(0x128)](_0x7834cc){const _0x324ae0=a30_0x377547;console[_0x324ae0(0x142)](a30_0x106d59['yellow'](_0x324ae0(0x143))),console[_0x324ae0(0x142)](a30_0x106d59[_0x324ae0(0x122)](_0x324ae0(0x139)));const {options:_0x424c85,args:_0x46a4a6,tdx:_0x3e5fa4}=_0x7834cc,_0x4908f0=_0x424c85;if(_0x46a4a6['length']===0x0)return console[_0x324ae0(0x142)](_0x324ae0(0x119)),console['error'](_0x324ae0(0x149)),console[_0x324ae0(0x142)]('Examples:'),console[_0x324ae0(0x142)](_0x324ae0(0x148)),console[_0x324ae0(0x142)](_0x324ae0(0x13a)),0x1;const _0x62f0dc=_0x46a4a6[0x0],_0x25887f=_0x424c85[_0x324ae0(0x133)];let _0x248609=_0x62f0dc;_0x25887f&&!_0x62f0dc[_0x324ae0(0x126)]('/')&&(_0x248609=_0x25887f+'/'+_0x62f0dc,_0x4908f0[_0x324ae0(0x130)]&&console[_0x324ae0(0x142)](_0x324ae0(0x14a)+_0x248609));const _0x44496a=await withSpinner(_0x324ae0(0x11b)+_0x248609+'\x27...',()=>_0x3e5fa4[_0x324ae0(0x12a)]['resolvePathToResource'](_0x248609),{'verbose':_0x4908f0[_0x324ae0(0x130)]}),_0x40ad61=_0x44496a[_0x324ae0(0x11c)];_0x4908f0[_0x324ae0(0x130)]&&console[_0x324ae0(0x142)](_0x324ae0(0x144)+_0x40ad61[_0x324ae0(0x137)]);if(_0x40ad61[_0x324ae0(0x137)]!==_0x324ae0(0x12a))return console[_0x324ae0(0x142)](_0x324ae0(0x13e)+_0x40ad61[_0x324ae0(0x137)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x324ae0(0x142)](_0x324ae0(0x121)),0x1;if(!_0x40ad61[_0x324ae0(0x136)])throw new SDKError(ErrorCode[_0x324ae0(0x141)],_0x324ae0(0x11d));const _0x3f1196=_0x40ad61[_0x324ae0(0x132)],_0x81ff34=_0x40ad61[_0x324ae0(0x136)];_0x4908f0[_0x324ae0(0x130)]&&(console[_0x324ae0(0x142)](_0x324ae0(0x125)+_0x3f1196),console[_0x324ae0(0x142)](_0x324ae0(0x12d)+_0x81ff34));let _0x26d585;if(_0x4908f0[_0x324ae0(0x129)]){const _0x2e6c19=_0x4908f0[_0x324ae0(0x129)],_0x4db826=await withSpinner(_0x324ae0(0x147)+_0x2e6c19+_0x324ae0(0x145),()=>_0x3e5fa4[_0x324ae0(0x12a)][_0x324ae0(0x13d)](_0x3f1196,_0x2e6c19),{'verbose':_0x4908f0['verbose']});_0x26d585=parseInt(_0x4db826[_0x324ae0(0x11c)],0xa),_0x4908f0[_0x324ae0(0x130)]&&console[_0x324ae0(0x142)](_0x324ae0(0x138)+_0x26d585);}const _0x122d13=await loadJSONFromOptions(_0x4908f0[_0x324ae0(0x13f)],_0x4908f0[_0x324ae0(0x124)]),_0x3b695e={'name':_0x4908f0[_0x324ae0(0x11f)],'description':_0x4908f0[_0x324ae0(0x140)],'rule':_0x122d13,'kind':_0x4908f0['kind']!==undefined?parseInt(_0x4908f0[_0x324ae0(0x11a)],0xa):undefined,'segmentFolderId':_0x26d585},_0x2ec965=await withSpinner('Updating\x20segment\x20\x27'+_0x40ad61[_0x324ae0(0x134)]+'\x27...',()=>_0x3e5fa4['segment'][_0x324ae0(0x12c)](_0x3f1196,_0x81ff34,_0x3b695e),{'verbose':_0x4908f0[_0x324ae0(0x130)]}),_0x120e8a=_0x2ec965[_0x324ae0(0x11c)];return console['error'](_0x324ae0(0x11e)+_0x120e8a[_0x324ae0(0x11f)]+'\x27'),_0x248609!==_0x62f0dc&&console[_0x324ae0(0x142)]('\x20\x20\x20Path:\x20'+_0x248609),await handleSDKOutput([_0x120e8a],_0x4908f0),0x0;}}function a30_0x5991(){const _0x10e256=['6fNknpm','segmentId','type','Resolved\x20folder\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','2618920eKFBfD','2593845CqYHLp','resolveFolderId','Error:\x20Cannot\x20update\x20','rule','description','INTERNAL','error','β \x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Resolved\x20type:\x20','\x27...','segment:update','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','kind','Resolving\x20path\x20\x27','data','Segment\x20ID\x20missing\x20from\x20resolved\x20path','β\x20Updated\x20segment\x20\x27','name','26NPcImt','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','yellow','90322rtuRlP','ruleFile','Parent\x20ID:\x20','includes','1706584rgjhRA','execute','folder','segment','6334485JkVXzI','updateSegmentById','Segment\x20ID:\x20','26522210ODJUhY','27nouNGs','verbose','6535263iORfBc','parentId','segmentPath','segmentName'];a30_0x5991=function(){return _0x10e256;};return a30_0x5991();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x3ac643=a31_0x67c1;(function(_0x439436,_0x1622b9){const _0x1cae02=a31_0x67c1,_0x7cb002=_0x439436();while(!![]){try{const _0x111105=parseInt(_0x1cae02(0xa1))/0x1*(parseInt(_0x1cae02(0x94))/0x2)+-parseInt(_0x1cae02(0xad))/0x3+-parseInt(_0x1cae02(0xc1))/0x4+parseInt(_0x1cae02(0xb4))/0x5+-parseInt(_0x1cae02(0xc9))/0x6*(parseInt(_0x1cae02(0xce))/0x7)+-parseInt(_0x1cae02(0xc0))/0x8+-parseInt(_0x1cae02(0xa4))/0x9*(-parseInt(_0x1cae02(0xa2))/0xa);if(_0x111105===_0x1622b9)break;else _0x7cb002['push'](_0x7cb002['shift']());}catch(_0x1818d1){_0x7cb002['push'](_0x7cb002['shift']());}}}(a31_0x8c5e,0xb0d57));import{existsSync,statSync}from'fs';import a31_0x1d81bd from'chalk';import{BaseCommand}from'./command.js';function a31_0x8c5e(){const _0x545345=['parentName','82061qSuhqw','Resolved\x20path\x20type:\x20','10wBoDfd','\x27...','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','execute','cyan','error','segment:use','green','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','144310CyMiYU','50huLQuT','isAbsolute','2008062YZbMJT','segments','fullPath','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','slice','Folder\x20ID:\x20','type','Error:\x20Path\x20is\x20required\x0a','name','2987952oOLDuO','data','log','parent_segment','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Site:\x20','3939840wKzzoC','Resolved\x20relative\x20path\x20to:\x20','parentId','red','isDirectory','resolvePathToResource','description','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','length','verbose','dim','Examples:','2336848TYMKiy','2216368xQMvWt','split','folderPath','join','β\x20Context\x20set\x20to:\x20','session','folderId','Target\x20path:\x20','30tDmpLS','config','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','β\x20Context\x20cleared.\x20Back\x20to\x20root.'];a31_0x8c5e=function(){return _0x545345;};return a31_0x8c5e();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a31_0x67c1(_0x5b1667,_0x21f763){_0x5b1667=_0x5b1667-0x94;const _0x8c5e30=a31_0x8c5e();let _0x67c1e=_0x8c5e30[_0x5b1667];return _0x67c1e;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a31_0x3ac643(0xac)]=a31_0x3ac643(0x9c);[a31_0x3ac643(0xba)]=a31_0x3ac643(0xbb);async[a31_0x3ac643(0x99)](_0x3b5f89){const _0xd86124=a31_0x3ac643,{options:_0x460fe3,args:_0x3bcb66,tdx:_0x324b44}=_0x3b5f89;if(_0x3bcb66[_0xd86124(0xbc)]===0x0)return console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0xb7)](_0xd86124(0xab))),console['error'](_0xd86124(0x9f)),console['error'](_0xd86124(0xbf)),console[_0xd86124(0x9b)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0xd86124(0x9b)](_0xd86124(0x97)),console[_0xd86124(0x9b)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0xd86124(0x9b)](_0xd86124(0xb2)),0x1;const _0x2be0d1=_0x3bcb66[0x0],_0x1f5610=_0x460fe3[_0xd86124(0xc6)];try{if(_0x2be0d1==='/')return saveSessionContext({'segment_path':undefined},_0x1f5610),console[_0xd86124(0xaf)](a31_0x1d81bd[_0xd86124(0x9d)]('β\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x2be0d1)&&statSync(_0x2be0d1)[_0xd86124(0xb8)]()){let _0x1ebb27;try{_0x1ebb27=findTdxConfig(_0x2be0d1);}catch{return console[_0xd86124(0x9b)](a31_0x1d81bd['red'](_0xd86124(0x9e)+_0x2be0d1)),console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0x9a)](_0xd86124(0x96))),0x1;}const _0x59e2db=_0x1ebb27[_0xd86124(0xca)][_0xd86124(0xb0)];return saveSessionContext({'segment_path':_0x59e2db,'parent_segment':_0x59e2db},_0x1f5610),console[_0xd86124(0xaf)](a31_0x1d81bd[_0xd86124(0x9d)](_0xd86124(0xc5)+a31_0x1d81bd['cyan'](_0x59e2db))),0x0;}const _0x4f0ab1=_0x460fe3['segmentPath'];let _0xe3a551=_0x2be0d1;const _0x109976=parsePath(_0x2be0d1);if(!_0x109976[_0xd86124(0xa3)]){if(!_0x4f0ab1)return console[_0xd86124(0x9b)](a31_0x1d81bd['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0x9a)](_0xd86124(0x98))),0x1;if(_0x2be0d1==='..'){const _0x58dbca=_0x4f0ab1[_0xd86124(0xc2)]('/')[_0xd86124(0xa8)](0x0,-0x1)[_0xd86124(0xc4)]('/');_0xe3a551=_0x58dbca||'/';}else _0x2be0d1==='.'?_0xe3a551=_0x4f0ab1:_0xe3a551=_0x4f0ab1+'/'+_0x2be0d1;_0x460fe3[_0xd86124(0xbd)]&&console[_0xd86124(0x9b)](_0xd86124(0xb5)+_0xe3a551);}if(_0xe3a551==='/'||_0xe3a551==='')return saveSessionContext({'segment_path':undefined},_0x1f5610),console[_0xd86124(0xaf)](a31_0x1d81bd[_0xd86124(0x9d)](_0xd86124(0xcc))),0x0;_0xe3a551=normalizePath(_0xe3a551);const _0x512e7f=parsePath(_0xe3a551)[_0xd86124(0xa5)];if(_0x512e7f[_0xd86124(0xbc)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1f5610),console['log'](a31_0x1d81bd[_0xd86124(0x9d)](_0xd86124(0xcc))),0x0;_0x460fe3[_0xd86124(0xbd)]&&(console[_0xd86124(0x9b)](_0xd86124(0xb3)+_0x460fe3['site']),console[_0xd86124(0x9b)](_0xd86124(0xc8)+_0xe3a551));const _0x574117=await withSpinner('Resolving\x20path\x20\x27'+_0xe3a551+_0xd86124(0x95),()=>_0x324b44[_0xd86124(0xb1)][_0xd86124(0xb9)](_0xe3a551),{'verbose':_0x460fe3[_0xd86124(0xbd)]}),_0x5a8350=_0x574117[_0xd86124(0xae)];_0x460fe3[_0xd86124(0xbd)]&&(console[_0xd86124(0x9b)](_0xd86124(0xcf)+_0x5a8350[_0xd86124(0xaa)]),console[_0xd86124(0x9b)]('Parent\x20ID:\x20'+_0x5a8350[_0xd86124(0xb6)]),_0x5a8350[_0xd86124(0xc7)]&&console[_0xd86124(0x9b)](_0xd86124(0xa9)+_0x5a8350[_0xd86124(0xc7)]));if(_0x5a8350['type']==='segment')return console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0xb7)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0xd86124(0x9b)](_0xd86124(0xa7)),console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0x9a)]('Use:\x20tdx\x20segment\x20use\x20'+_0x5a8350[_0xd86124(0xcd)]+(_0x5a8350[_0xd86124(0xc3)]?'/'+_0x5a8350[_0xd86124(0xc3)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5a8350[_0xd86124(0xa6)],'parent_segment':_0x5a8350[_0xd86124(0xcd)]},_0x1f5610),console[_0xd86124(0xaf)](a31_0x1d81bd[_0xd86124(0x9d)]('β\x20Context\x20set\x20to:\x20'+a31_0x1d81bd[_0xd86124(0x9a)](_0x5a8350[_0xd86124(0xa6)]))),_0x460fe3['verbose']&&(console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0xbe)](_0xd86124(0xa0))),console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0xbe)](_0xd86124(0xcb)))),0x0;}catch(_0x396c0b){throw _0x396c0b;}}}
|