@treasuredata/tdx 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.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/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +19 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/claude-agent/types.d.ts +26 -0
- package/dist/sdk/claude-agent/types.d.ts.map +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.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x502d7c=a27_0x5363;(function(_0x5109b2,_0x5f0633){const _0x181896=a27_0x5363,_0x2ee712=_0x5109b2();while(!![]){try{const _0xef91a5=parseInt(_0x181896(0x218))/0x1+parseInt(_0x181896(0x1c7))/0x2*(-parseInt(_0x181896(0x19e))/0x3)+parseInt(_0x181896(0x19d))/0x4+parseInt(_0x181896(0x1fd))/0x5+parseInt(_0x181896(0x1d3))/0x6*(parseInt(_0x181896(0x1de))/0x7)+-parseInt(_0x181896(0x1d6))/0x8+parseInt(_0x181896(0x217))/0x9*(parseInt(_0x181896(0x1a2))/0xa);if(_0xef91a5===_0x5f0633)break;else _0x2ee712['push'](_0x2ee712['shift']());}catch(_0x17d7cc){_0x2ee712['push'](_0x2ee712['shift']());}}}(a27_0x2a82,0x8d89c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a27_0x2a82(){const _0x2638af=['\x20\x20Parent\x20segment:\x20','7779050PODZPn','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20Segment\x20name:\x20','segment:show','limit','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x27...','Use:\x20tdx\x20ps\x20view\x20-w','getFolder','Fetching\x20parent\x20segment\x20details...','Parent\x20ID:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','✔\x20Query\x20completed:\x20Processed\x20','message','\x20Opening\x20','log','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Options:','\x20folder','SEGMENT_NOT_FOUND','fullPath','✖\x20Query\x20failed\x20[','segment:folder:list','Target\x20path:\x20','setJobId','Fetching\x20folder\x20details...','in\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','json','Site:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Usage:\x20tdx\x20sg\x20desc\x20<name>','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20folder\x20\x27','type','2648dnFLJL','Create\x20segment\x20folder\x20for\x20organization','Segment\x20ID:\x20','Resolved\x20YAML\x20file:\x20','processedRows','query','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','site','segment:desc','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Fetching\x20SQL\x20for\x20segment...','111258bdOsXA','\x20[Job\x20ID:\x20','INVALID_ARGUMENT','7153816PIexSU','length','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','cause','resolveFolderId','execute','Error:\x20Path\x20or\x20name\x20is\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','7cAJvtR','Fetching\x20segment\x20details...','/e/','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x27\x20with\x20ID:\x20','Resolving\x20\x27','✔\x20Found\x20','Folder\x20name:\x20','Examples:','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment:view','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment','Show\x20child\x20segment\x20schema\x20(column\x20types)','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','segment:sql','Resolving\x20folder\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','format','folderId','segment:folder:create','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','/app/ps/','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20relative\x20path\x20to:\x20','trim','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','766865AoOSLN','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','elapsedTimeMillis','Executing\x20segment\x20query...','stats','replace','Parent\x20segment:\x20','resolveParentId','folder','Resolved\x20type:\x20','Resolved\x20parent\x20ID:\x20','parent','Resolving\x20parent\x20segment\x20\x27','parentId','segment:folder:show','Error:\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','includes','segment:describe','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','verbose','test','Resolving\x20path\x20\x27','folderPath','9CKggsI','645026XMQYpT','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Use:\x20tdx\x20ps\x20sql','name','\x20\x20Cause:\x20','\x20\x20Folder\x20path:\x20','getSegment','jobId','Creating\x20folder\x20\x27','Parent\x20name:\x20','getParent','parentSegment','data','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','error','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segmentId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','resolvePathToResource','Resolving\x20parent\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','getSegmentSQL','code','web','\x20rows\x20','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','988768eAadbD','834nzFyIq','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20show'];a27_0x2a82=function(){return _0x2638af;};return a27_0x2a82();}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 a27_0x2ad0cb from'chalk';async function resolveSegmentTarget(_0x14d7ff,_0x4067aa,_0x4e3a56){const _0x1f390e=a27_0x5363;if(isYamlFilePath(_0x14d7ff))try{const _0x1a55c0=await resolveYamlFilePath(_0x14d7ff);return _0x4e3a56&&(console['error'](_0x1f390e(0x1ca)+_0x14d7ff),console[_0x1f390e(0x18e)](_0x1f390e(0x1a1)+_0x1a55c0[_0x1f390e(0x229)]),console[_0x1f390e(0x18e)](_0x1f390e(0x1a4)+_0x1a55c0['segmentName']),console[_0x1f390e(0x18e)](_0x1f390e(0x223)+(_0x1a55c0[_0x1f390e(0x216)]||'(root)')),console[_0x1f390e(0x18e)]('\x20\x20Full\x20path:\x20'+_0x1a55c0[_0x1f390e(0x1b7)])),_0x1a55c0[_0x1f390e(0x1b7)];}catch(_0x1de3dc){throw new SDKError(ErrorCode[_0x1f390e(0x1d5)],_0x1f390e(0x1dd)+_0x1de3dc[_0x1f390e(0x1b0)]);}if(!_0x4067aa)throw new SDKError(ErrorCode[_0x1f390e(0x1d5)],_0x1f390e(0x1e7));return _0x4067aa+'/'+_0x14d7ff;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x20f);['description']='Show\x20segment\x20or\x20folder\x20details';async[a27_0x502d7c(0x1db)](_0x4fd308){const _0x330eda=a27_0x502d7c,{options:_0x546f98,args:_0x35c2e8,tdx:_0x16209c}=_0x4fd308,_0xa849f8=_0x35c2e8[0x0],_0x7369cd=!_0xa849f8&&!!_0x546f98[_0x330eda(0x229)],_0x570123=_0xa849f8||_0x546f98[_0x330eda(0x229)];if(!_0x570123)return console[_0x330eda(0x18e)](_0x330eda(0x1dc)),console[_0x330eda(0x18e)](_0x330eda(0x1eb)),console[_0x330eda(0x18e)](_0x330eda(0x1e6)),console[_0x330eda(0x18e)](_0x330eda(0x1b3)),console['error'](_0x330eda(0x212)),console['error'](_0x330eda(0x21e)),console[_0x330eda(0x18e)](_0x330eda(0x1ae)),0x1;try{const _0x5e430a=_0x546f98['segmentPath'];let _0xa3c450=_0x570123;!_0x7369cd&&_0x5e430a&&!_0x570123[_0x330eda(0x20e)]('/')&&(_0xa3c450=_0x5e430a+'/'+_0x570123,_0x546f98[_0x330eda(0x213)]&&console['error'](_0x330eda(0x1f9)+_0xa3c450));const _0x5cef80=await withSpinner(_0x330eda(0x215)+_0xa3c450+'\x27...',()=>_0x16209c[_0x330eda(0x1ec)]['resolvePathToResource'](_0xa3c450),{'verbose':_0x546f98[_0x330eda(0x213)]}),_0xf4347c=_0x5cef80[_0x330eda(0x22a)];_0x546f98[_0x330eda(0x213)]&&(console['error'](_0x330eda(0x206)+_0xf4347c['type']),console['error'](_0x330eda(0x1ad)+_0xf4347c[_0x330eda(0x20a)]),_0xf4347c[_0x330eda(0x1f4)]&&console[_0x330eda(0x18e)](_0x330eda(0x1ea)+_0xf4347c[_0x330eda(0x1f4)]),_0xf4347c[_0x330eda(0x191)]&&console[_0x330eda(0x18e)](_0x330eda(0x1c9)+_0xf4347c[_0x330eda(0x191)]));if(_0xf4347c[_0x330eda(0x1c6)]===_0x330eda(0x208)){const _0x18ecd3=await withSpinner(_0x330eda(0x1ac),()=>_0x16209c['segment'][_0x330eda(0x228)](_0xf4347c['parentId']),{'verbose':_0x546f98[_0x330eda(0x213)]});await handleSingleObjectOutput(_0x18ecd3['data'],_0x546f98);}else{if(_0xf4347c[_0x330eda(0x1c6)]===_0x330eda(0x205)){if(!_0xf4347c[_0x330eda(0x1f4)])throw new SDKError(ErrorCode[_0x330eda(0x1c4)],_0x330eda(0x219));const _0x10fc5b=await withSpinner('Fetching\x20folder\x20details...',()=>_0x16209c['segment'][_0x330eda(0x1ab)](_0xf4347c[_0x330eda(0x1f4)]),{'verbose':_0x546f98[_0x330eda(0x213)]});await handleSingleObjectOutput(_0x10fc5b[_0x330eda(0x22a)],_0x546f98);}else{if(_0xf4347c[_0x330eda(0x1c6)]===_0x330eda(0x1ec)){if(!_0xf4347c[_0x330eda(0x191)])throw new SDKError(ErrorCode[_0x330eda(0x1b6)],_0x330eda(0x21d));const _0xf7f1cc=await withSpinner(_0x330eda(0x1df),()=>_0x16209c[_0x330eda(0x1ec)][_0x330eda(0x224)](_0xf4347c['parentId'],_0xf4347c['segmentId']),{'verbose':_0x546f98[_0x330eda(0x213)]});await handleSingleObjectOutput(_0xf7f1cc[_0x330eda(0x22a)],_0x546f98);}}}return 0x0;}catch(_0x1d2b70){if(_0x1d2b70 instanceof SDKError)return console[_0x330eda(0x18e)](_0x330eda(0x20c)+_0x1d2b70[_0x330eda(0x1b0)]),_0x1d2b70[_0x330eda(0x1d9)]&&console[_0x330eda(0x18e)](_0x330eda(0x222)+_0x1d2b70[_0x330eda(0x1d9)]),0x1;throw _0x1d2b70;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x1a5);[a27_0x502d7c(0x210)]=a27_0x502d7c(0x1ee);async[a27_0x502d7c(0x1db)](_0x264d68){const _0x17c6a2=a27_0x502d7c,{options:_0x55f417,args:_0x499f79,tdx:_0x156ba5}=_0x264d68,_0x3c829a=_0x499f79[0x0];if(!_0x3c829a)return console[_0x17c6a2(0x18e)](_0x17c6a2(0x1f6)),console[_0x17c6a2(0x18e)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x17c6a2(0x18e)](_0x17c6a2(0x195)),console[_0x17c6a2(0x18e)](_0x17c6a2(0x1e6)),console['error'](_0x17c6a2(0x20d)),console[_0x17c6a2(0x18e)](_0x17c6a2(0x19c)),0x1;try{const _0x2a16e8=_0x55f417[_0x17c6a2(0x229)],_0xd04508=await resolveSegmentTarget(_0x3c829a,_0x2a16e8,_0x55f417[_0x17c6a2(0x213)]);_0x55f417[_0x17c6a2(0x213)]&&console[_0x17c6a2(0x18e)](_0x17c6a2(0x1ba)+_0xd04508);const _0x2e2948=await withSpinner(_0x17c6a2(0x1e3)+_0x3c829a+_0x17c6a2(0x1a9),()=>_0x156ba5[_0x17c6a2(0x1ec)][_0x17c6a2(0x193)](_0xd04508),{'verbose':_0x55f417[_0x17c6a2(0x213)]}),_0x14f846=_0x2e2948['data'];_0x55f417[_0x17c6a2(0x213)]&&(console['error'](_0x17c6a2(0x206)+_0x14f846[_0x17c6a2(0x1c6)]),console[_0x17c6a2(0x18e)]('Parent\x20ID:\x20'+_0x14f846[_0x17c6a2(0x20a)]));if(_0x14f846[_0x17c6a2(0x1c6)]===_0x17c6a2(0x205))return console[_0x17c6a2(0x18e)](_0x17c6a2(0x1d8)),console['error'](_0x17c6a2(0x21f)),0x1;if(_0x14f846[_0x17c6a2(0x1c6)]==='parent')return console[_0x17c6a2(0x18e)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x17c6a2(0x18e)](_0x17c6a2(0x1a0)),0x1;if(!_0x14f846['segmentId'])throw new SDKError(ErrorCode[_0x17c6a2(0x1b6)],_0x17c6a2(0x21d));const _0xa8a791=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x156ba5[_0x17c6a2(0x1ec)][_0x17c6a2(0x197)](_0x14f846[_0x17c6a2(0x20a)],_0x14f846['segmentId']),{'verbose':_0x55f417['verbose']});let _0x24e3c4=_0xa8a791[_0x17c6a2(0x22a)];const _0x4ab11d=resolveLimit(_0x55f417[_0x17c6a2(0x1a6)],DEFAULT_DISPLAY_LIMIT),_0x5bf5d5=/\bLIMIT\s+\d+/i[_0x17c6a2(0x214)](_0x24e3c4);!_0x5bf5d5&&(_0x24e3c4=_0x24e3c4[_0x17c6a2(0x1fa)]()[_0x17c6a2(0x202)](/;+$/,''),_0x24e3c4=_0x17c6a2(0x1a7)+_0x24e3c4+_0x17c6a2(0x1f1)+_0x4ab11d);_0x55f417[_0x17c6a2(0x213)]&&console['error'](_0x17c6a2(0x19b)+_0x24e3c4);const _0xce04a0=await withProgressSpinner(_0x17c6a2(0x200),async _0x20c3cb=>{const _0x2613b1=_0x17c6a2,_0x468c9e=await _0x156ba5[_0x2613b1(0x1cc)][_0x2613b1(0x1db)](_0x24e3c4,{'catalog':'td','schema':'information_schema','onJobId':_0x36e7b4=>{const _0x456fb8=_0x2613b1;_0x20c3cb[_0x456fb8(0x1bb)](_0x36e7b4);}});return _0x468c9e;},{'verbose':_0x55f417['verbose']}),_0x4f5061=_0xce04a0[_0x17c6a2(0x22a)],_0x17c96c=_0x4f5061[_0x17c6a2(0x225)]?_0x17c6a2(0x1d4)+_0x4f5061[_0x17c6a2(0x225)]+']':'';return console[_0x17c6a2(0x18e)](_0x17c6a2(0x1af)+_0x4f5061[_0x17c6a2(0x201)][_0x17c6a2(0x1cb)]['toLocaleString']()+_0x17c6a2(0x19a)+(_0x17c6a2(0x1bd)+formatElapsed(_0x4f5061['stats'][_0x17c6a2(0x1ff)])+_0x17c96c)),await handleQueryOutput(_0x4f5061,_0x55f417),0x0;}catch(_0x411d6f){if(_0x411d6f instanceof SDKError)return console[_0x17c6a2(0x18e)](_0x17c6a2(0x1b8)+_0x411d6f[_0x17c6a2(0x198)]+']'),console[_0x17c6a2(0x18e)]('\x0a'+_0x411d6f[_0x17c6a2(0x1b0)]),0x1;throw _0x411d6f;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x502d7c(0x1b9);['description']=a27_0x502d7c(0x21c);async['execute'](_0x52af48){const _0x7e777=a27_0x502d7c,{options:_0x41ff45,args:_0x524111,tdx:_0x555c60}=_0x52af48;if(_0x524111[_0x7e777(0x1d7)]===0x0)return console[_0x7e777(0x18e)](_0x7e777(0x1cd)),console[_0x7e777(0x18e)](_0x7e777(0x190)),0x1;const _0x1fca2e=_0x524111[0x0];try{_0x41ff45[_0x7e777(0x213)]&&(console[_0x7e777(0x18e)](_0x7e777(0x1c0)+_0x41ff45[_0x7e777(0x1cf)]),console[_0x7e777(0x18e)](_0x7e777(0x227)+_0x1fca2e));const _0x3c2835=await withSpinner(_0x7e777(0x209)+_0x1fca2e+'\x27...',()=>_0x555c60[_0x7e777(0x1ec)][_0x7e777(0x204)](_0x1fca2e),{'verbose':_0x41ff45[_0x7e777(0x213)]}),_0x485235=_0x3c2835['data'];_0x41ff45[_0x7e777(0x213)]&&console[_0x7e777(0x18e)](_0x7e777(0x207)+_0x485235);const _0x33ebd0=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x1fca2e+_0x7e777(0x1a9),()=>_0x555c60[_0x7e777(0x1ec)]['listFolders'](_0x485235),{'verbose':_0x41ff45[_0x7e777(0x213)]}),_0x15e2d6=_0x33ebd0['data'];return console['error'](_0x7e777(0x1e4)+_0x15e2d6[_0x7e777(0x1d7)]+_0x7e777(0x1b5)+(_0x15e2d6[_0x7e777(0x1d7)]!==0x1?'s':'')),await handleSDKOutput(_0x15e2d6,_0x41ff45),0x0;}catch(_0x2f2bb5){if(_0x2f2bb5 instanceof SDKError)return console[_0x7e777(0x18e)]('Error:\x20'+_0x2f2bb5[_0x7e777(0x1b0)]),_0x2f2bb5[_0x7e777(0x1d9)]&&console[_0x7e777(0x18e)](_0x7e777(0x222)+_0x2f2bb5[_0x7e777(0x1d9)]),0x1;throw _0x2f2bb5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x20b);[a27_0x502d7c(0x210)]='Show\x20segment\x20folder\x20details';async[a27_0x502d7c(0x1db)](_0x17e0b9){const _0x7b720a=a27_0x502d7c,{options:_0x5af944,args:_0x55f2d9,tdx:_0x45f368}=_0x17e0b9;if(_0x55f2d9['length']===0x0)return console[_0x7b720a(0x18e)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x7b720a(0x18e)](_0x7b720a(0x22b)),0x1;try{const {parentId:_0x3f35e2,childId:_0x104f79}=parseSegmentRef(_0x55f2d9[0x0]);_0x5af944[_0x7b720a(0x213)]&&(console['error']('Site:\x20'+_0x5af944[_0x7b720a(0x1cf)]),console['error'](_0x7b720a(0x227)+_0x3f35e2),_0x104f79&&console[_0x7b720a(0x18e)](_0x7b720a(0x1e5)+_0x104f79));if(!_0x104f79)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x9b1e57=await withSpinner(_0x7b720a(0x209)+_0x3f35e2+_0x7b720a(0x1a9),()=>_0x45f368[_0x7b720a(0x1ec)][_0x7b720a(0x204)](_0x3f35e2),{'verbose':_0x5af944[_0x7b720a(0x213)]}),_0x30c8ab=_0x9b1e57[_0x7b720a(0x22a)];_0x5af944[_0x7b720a(0x213)]&&console[_0x7b720a(0x18e)]('Resolved\x20parent\x20ID:\x20'+_0x30c8ab);const _0x75bc93=await withSpinner(_0x7b720a(0x1f0)+_0x104f79+_0x7b720a(0x1a9),()=>_0x45f368[_0x7b720a(0x1ec)][_0x7b720a(0x1da)](_0x30c8ab,_0x104f79),{'verbose':_0x5af944['verbose']}),_0x1b7c1b=_0x75bc93[_0x7b720a(0x22a)];_0x5af944['verbose']&&console[_0x7b720a(0x18e)]('Resolved\x20folder\x20ID:\x20'+_0x1b7c1b);const _0x5384ad=await withSpinner(_0x7b720a(0x1c5)+_0x104f79+_0x7b720a(0x1a9),()=>_0x45f368['segment'][_0x7b720a(0x1ab)](_0x1b7c1b),{'verbose':_0x5af944[_0x7b720a(0x213)]});return await handleSDKOutput([_0x5384ad[_0x7b720a(0x22a)]],_0x5af944),0x0;}catch(_0x1dfacd){if(_0x1dfacd instanceof SDKError)return console[_0x7b720a(0x18e)]('Error:\x20'+_0x1dfacd[_0x7b720a(0x1b0)]),_0x1dfacd[_0x7b720a(0x1d9)]&&console[_0x7b720a(0x18e)]('\x20\x20Cause:\x20'+_0x1dfacd[_0x7b720a(0x1d9)]),0x1;throw _0x1dfacd;}}}function a27_0x5363(_0x4bb5e4,_0x229c4d){_0x4bb5e4=_0x4bb5e4-0x18d;const _0x2a82b9=a27_0x2a82();let _0x5363f9=_0x2a82b9[_0x4bb5e4];return _0x5363f9;}export class SegmentSQLCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x1ef);[a27_0x502d7c(0x210)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x502d7c(0x1db)](_0x174b38){const _0x2fdac7=a27_0x502d7c,{options:_0x45ec9a,args:_0xbaf8f8,tdx:_0x3903b3}=_0x174b38,_0x3c7578=_0xbaf8f8[0x0];if(!_0x3c7578)return console[_0x2fdac7(0x18e)](_0x2fdac7(0x1f6)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x1f2)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x211)),console[_0x2fdac7(0x18e)]('Examples:'),console[_0x2fdac7(0x18e)](_0x2fdac7(0x18f)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x1a3)),0x1;try{const _0x483ef2=_0x45ec9a[_0x2fdac7(0x229)],_0x34d39d=await resolveSegmentTarget(_0x3c7578,_0x483ef2,_0x45ec9a[_0x2fdac7(0x213)]);_0x45ec9a['verbose']&&console[_0x2fdac7(0x18e)](_0x2fdac7(0x1ba)+_0x34d39d);const _0x3a5dbc=await withSpinner(_0x2fdac7(0x1e3)+_0x3c7578+_0x2fdac7(0x1a9),()=>_0x3903b3[_0x2fdac7(0x1ec)][_0x2fdac7(0x193)](_0x34d39d),{'verbose':_0x45ec9a[_0x2fdac7(0x213)]}),_0x20677d=_0x3a5dbc[_0x2fdac7(0x22a)];_0x45ec9a['verbose']&&(console[_0x2fdac7(0x18e)]('Resolved\x20type:\x20'+_0x20677d[_0x2fdac7(0x1c6)]),console[_0x2fdac7(0x18e)](_0x2fdac7(0x1ad)+_0x20677d[_0x2fdac7(0x20a)]));if(_0x20677d[_0x2fdac7(0x1c6)]==='folder')return console['error'](_0x2fdac7(0x21b)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x1e8)),0x1;if(_0x20677d[_0x2fdac7(0x1c6)]==='parent')return console[_0x2fdac7(0x18e)](_0x2fdac7(0x1fe)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x220)),0x1;if(!_0x20677d[_0x2fdac7(0x191)])throw new SDKError(ErrorCode[_0x2fdac7(0x1b6)],_0x2fdac7(0x21d));const _0x454c20=await withSpinner(_0x2fdac7(0x1d2),()=>_0x3903b3[_0x2fdac7(0x1ec)][_0x2fdac7(0x197)](_0x20677d['parentId'],_0x20677d[_0x2fdac7(0x191)]),{'verbose':_0x45ec9a[_0x2fdac7(0x213)]}),_0x3c88d0=_0x454c20[_0x2fdac7(0x22a)];return _0x45ec9a[_0x2fdac7(0x1f3)]===_0x2fdac7(0x1bf)||_0x45ec9a['format']==='jsonl'?await handleSDKOutput([{'sql':_0x3c88d0}],_0x45ec9a):console[_0x2fdac7(0x1b2)](_0x3c88d0),0x0;}catch(_0x2364b1){if(_0x2364b1 instanceof SDKError)return console['error'](_0x2fdac7(0x20c)+_0x2364b1[_0x2fdac7(0x1b0)]),_0x2364b1[_0x2fdac7(0x1d9)]&&console['error'](_0x2fdac7(0x222)+_0x2364b1['cause']),0x1;throw _0x2364b1;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x1f5);[a27_0x502d7c(0x210)]=a27_0x502d7c(0x1c8);async[a27_0x502d7c(0x1db)](_0xe356a8){const _0x5e91de=a27_0x502d7c,{options:_0x119bc8,args:_0x2de190,tdx:_0x22bafa}=_0xe356a8,_0xe5f7f4=_0x119bc8;if(_0x2de190[_0x5e91de(0x1d7)]<0x2)return console[_0x5e91de(0x18e)](_0x5e91de(0x192)),console[_0x5e91de(0x18e)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x23bba8=_0x2de190[0x0],_0x5a6883=_0x2de190[0x1];_0xe5f7f4[_0x5e91de(0x213)]&&(console[_0x5e91de(0x18e)]('Site:\x20'+_0xe5f7f4[_0x5e91de(0x1cf)]),console[_0x5e91de(0x18e)](_0x5e91de(0x203)+_0x23bba8),console[_0x5e91de(0x18e)](_0x5e91de(0x1e5)+_0x5a6883));let _0x13ded3;if(_0xe5f7f4['parentFolder']){const _0x3d2ecb=_0xe5f7f4['parentFolder'],_0x4ee2ca=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x23bba8+'\x27...',()=>_0x22bafa[_0x5e91de(0x1ec)][_0x5e91de(0x204)](_0x23bba8),{'verbose':_0xe5f7f4[_0x5e91de(0x213)]}),_0x1902b1=_0x4ee2ca[_0x5e91de(0x22a)],_0x418a9b=await withSpinner(_0x5e91de(0x194)+_0x3d2ecb+_0x5e91de(0x1a9),()=>_0x22bafa['segment'][_0x5e91de(0x1da)](_0x1902b1,_0x3d2ecb),{'verbose':_0xe5f7f4['verbose']});_0x13ded3=_0x418a9b['data'],_0xe5f7f4['verbose']&&console['error']('Resolved\x20parent\x20folder\x20ID:\x20'+_0x13ded3);}const _0x436806={'name':_0x5a6883,'description':_0xe5f7f4['description'],'parentFolderId':_0x13ded3},_0x590cf9=await withSpinner(_0x5e91de(0x226)+_0x5a6883+_0x5e91de(0x1a9),()=>_0x22bafa['segment']['createFolder'](_0x23bba8,_0x436806),{'verbose':_0xe5f7f4[_0x5e91de(0x213)]}),_0x3330f9=_0x590cf9[_0x5e91de(0x22a)];return console[_0x5e91de(0x18e)]('✔\x20Created\x20folder\x20\x27'+_0x3330f9['name']+_0x5e91de(0x1e2)+_0x3330f9['id']),await handleSDKOutput([_0x3330f9],_0xe5f7f4),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a27_0x502d7c(0x1e9);[a27_0x502d7c(0x210)]=a27_0x502d7c(0x1f8);async[a27_0x502d7c(0x1db)](_0x2bd366){const _0x1ff4d7=a27_0x502d7c,{options:_0x169871,args:_0x4297e5,tdx:_0x217366}=_0x2bd366,_0x2d3e21=_0x4297e5[0x0];if(!_0x2d3e21)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x18d)),console['error'](_0x1ff4d7(0x1fc)),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1b4)),console[_0x1ff4d7(0x18e)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1e6)),console[_0x1ff4d7(0x18e)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1c2)),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1c1)),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1ce)),0x1;try{const _0x2819dc=_0x169871[_0x1ff4d7(0x229)],_0xe49b5a=await resolveSegmentTarget(_0x2d3e21,_0x2819dc,_0x169871['verbose']);_0x169871[_0x1ff4d7(0x213)]&&console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1ba)+_0xe49b5a);const _0x578a33=await withSpinner(_0x1ff4d7(0x1e3)+_0x2d3e21+_0x1ff4d7(0x1a9),()=>_0x217366['segment'][_0x1ff4d7(0x193)](_0xe49b5a),{'verbose':_0x169871['verbose']}),_0x1c8b9b=_0x578a33[_0x1ff4d7(0x22a)];_0x169871['verbose']&&(console[_0x1ff4d7(0x18e)]('Resolved\x20type:\x20'+_0x1c8b9b['type']),console[_0x1ff4d7(0x18e)]('Parent\x20ID:\x20'+_0x1c8b9b['parentId']),_0x1c8b9b[_0x1ff4d7(0x1f4)]&&console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1ea)+_0x1c8b9b['folderId']),_0x1c8b9b[_0x1ff4d7(0x191)]&&console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1c9)+_0x1c8b9b[_0x1ff4d7(0x191)]));if(_0x169871[_0x1ff4d7(0x199)]){if(_0x1c8b9b[_0x1ff4d7(0x1c6)]===_0x1ff4d7(0x205))return console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1d1)),0x1;if(_0x1c8b9b['type']==='parent')return console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x21a)),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1aa)),0x1;if(!_0x1c8b9b[_0x1ff4d7(0x191)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1ff4d7(0x21d));const _0x1f11ee=getConsoleNextUrl(_0x169871['site'],_0x1ff4d7(0x1f7)+_0x1c8b9b['parentId']+'/e/'+_0x1c8b9b['segmentId']);return console[_0x1ff4d7(0x18e)](a27_0x2ad0cb['green']('✔')+_0x1ff4d7(0x1b1)+a27_0x2ad0cb['cyan'](_0x1f11ee)),openBrowser(_0x1f11ee),0x0;}if(_0x1c8b9b[_0x1ff4d7(0x1c6)]==='folder'){if(!_0x1c8b9b[_0x1ff4d7(0x1f4)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2a4b91=await withSpinner(_0x1ff4d7(0x1bc),()=>_0x217366[_0x1ff4d7(0x1ec)][_0x1ff4d7(0x1ab)](_0x1c8b9b['folderId']),{'verbose':_0x169871[_0x1ff4d7(0x213)]});await handleSingleObjectOutput(_0x2a4b91[_0x1ff4d7(0x22a)],_0x169871);}else{if(_0x1c8b9b[_0x1ff4d7(0x1c6)]==='segment'){if(!_0x1c8b9b[_0x1ff4d7(0x191)])throw new SDKError(ErrorCode[_0x1ff4d7(0x1b6)],_0x1ff4d7(0x21d));const _0x244118=await withSpinner(_0x1ff4d7(0x1df),()=>_0x217366[_0x1ff4d7(0x1ec)]['getSegment'](_0x1c8b9b['parentId'],_0x1c8b9b['segmentId']),{'verbose':_0x169871['verbose']}),_0x4d37f1=getConsoleNextUrl(_0x169871[_0x1ff4d7(0x1cf)],_0x1ff4d7(0x1f7)+_0x1c8b9b['parentId']+_0x1ff4d7(0x1e0)+_0x1c8b9b[_0x1ff4d7(0x191)]),_0x1e9a72=_0x244118[_0x1ff4d7(0x22a)];_0x1e9a72['url']=_0x4d37f1,await handleSingleObjectOutput(_0x1e9a72,_0x169871);}else return console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1e1)),console['error']('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x4a1825){if(_0x4a1825 instanceof SDKError)return console[_0x1ff4d7(0x18e)]('Error:\x20'+_0x4a1825[_0x1ff4d7(0x1b0)]),_0x4a1825[_0x1ff4d7(0x1d9)]&&console[_0x1ff4d7(0x18e)]('\x20\x20Cause:\x20'+_0x4a1825['cause']),0x1;throw _0x4a1825;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x1d0);[a27_0x502d7c(0x210)]=a27_0x502d7c(0x1ed);async[a27_0x502d7c(0x1db)](_0xa63ac8){const _0x1e0d9a=a27_0x502d7c,{options:_0x409dcd,args:_0x11e11b,tdx:_0x14e4d3}=_0xa63ac8,_0x20c166=_0x11e11b[0x0];if(!_0x20c166)return console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1f6)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1c3)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x196)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1e6)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1fb)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x19f)),0x1;try{const _0x13754b=_0x409dcd[_0x1e0d9a(0x229)],_0x3ae8c3=await resolveSegmentTarget(_0x20c166,_0x13754b,_0x409dcd[_0x1e0d9a(0x213)]);_0x409dcd[_0x1e0d9a(0x213)]&&console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1ba)+_0x3ae8c3);const _0x2e5c54=await withSpinner(_0x1e0d9a(0x1e3)+_0x20c166+_0x1e0d9a(0x1a9),()=>_0x14e4d3[_0x1e0d9a(0x1ec)][_0x1e0d9a(0x193)](_0x3ae8c3),{'verbose':_0x409dcd['verbose']}),_0x23c2bb=_0x2e5c54[_0x1e0d9a(0x22a)];_0x409dcd['verbose']&&(console[_0x1e0d9a(0x18e)]('Resolved\x20type:\x20'+_0x23c2bb[_0x1e0d9a(0x1c6)]),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1ad)+_0x23c2bb[_0x1e0d9a(0x20a)]));if(_0x23c2bb['type']===_0x1e0d9a(0x205))return console['error'](_0x1e0d9a(0x1be)),console['error'](_0x1e0d9a(0x1e8)),0x1;if(_0x23c2bb[_0x1e0d9a(0x1c6)]===_0x1e0d9a(0x208))return console['error'](_0x1e0d9a(0x1a8)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x23c2bb['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1e0d9a(0x21d));const _0x3ab0a1=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x14e4d3[_0x1e0d9a(0x1ec)][_0x1e0d9a(0x197)](_0x23c2bb[_0x1e0d9a(0x20a)],_0x23c2bb['segmentId']),{'verbose':_0x409dcd['verbose']}),_0x30840a=_0x3ab0a1['data'],_0x1d409d=await executeSchemaQuery(_0x30840a,_0x14e4d3,_0x409dcd);return await handleQueryOutput(_0x1d409d,_0x409dcd),0x0;}catch(_0x592c07){if(_0x592c07 instanceof SDKError)return console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x20c)+_0x592c07['message']),_0x592c07[_0x1e0d9a(0x1d9)]&&console['error'](_0x1e0d9a(0x222)+_0x592c07[_0x1e0d9a(0x1d9)]),0x1;throw _0x592c07;}}}
|
|
1
|
+
const a27_0x2197db=a27_0x4947;(function(_0x1b4cf9,_0x219106){const _0x530ef6=a27_0x4947,_0x1452bd=_0x1b4cf9();while(!![]){try{const _0x2c3325=-parseInt(_0x530ef6(0xbc))/0x1+-parseInt(_0x530ef6(0xe2))/0x2+-parseInt(_0x530ef6(0x96))/0x3*(parseInt(_0x530ef6(0xdc))/0x4)+parseInt(_0x530ef6(0xe1))/0x5*(parseInt(_0x530ef6(0xca))/0x6)+parseInt(_0x530ef6(0xfb))/0x7+-parseInt(_0x530ef6(0xfc))/0x8+-parseInt(_0x530ef6(0x91))/0x9*(-parseInt(_0x530ef6(0xcc))/0xa);if(_0x2c3325===_0x219106)break;else _0x1452bd['push'](_0x1452bd['shift']());}catch(_0x23172f){_0x1452bd['push'](_0x1452bd['shift']());}}}(a27_0x5e46,0xce395));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a27_0x5e46(){const _0x43ebaa=['parentId','Resolved\x20relative\x20path\x20to:\x20','\x27\x20with\x20ID:\x20','format','segment:describe','Target\x20path:\x20','Executing\x20segment\x20query...','Parent\x20ID:\x20','parentFolder','getSegmentSQL','resolvePathToResource','Error:\x20','\x20\x20Folder\x20path:\x20','includes','2604tTUVCX','resolveParentId','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','140zXmXVq','1782718PqpFlo','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','jsonl','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','parent','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Fetching\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','cause','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','(root)','Examples:','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','folder','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Parent\x20segment:\x20','parentSegment','jobId','Resolving\x20path\x20\x27','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','verbose','2190216DGifTh','1069168XTSbeb','INVALID_ARGUMENT','Listing\x20folders\x20for\x20parent\x20\x27','replace','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','processedRows','green','✔\x20Found\x20','name','\x27...','log','Error:\x20Folder\x20reference\x20is\x20required','url','Resolved\x20parent\x20folder\x20ID:\x20','Use:\x20tdx\x20ps\x20view','segmentName','Parent\x20name:\x20','Fetching\x20folder\x20details...','Usage:\x20tdx\x20sg\x20show\x20<name>','type','message','listFolders','Use:\x20tdx\x20ps\x20show','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Segment\x20ID:\x20','Show\x20segment\x20folder\x20details','toLocaleString','Resolving\x20\x27','limit','elapsedTimeMillis','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','✔\x20Created\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','getFolder','\x20rows\x20','✖\x20Query\x20failed\x20[','in\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Resolving\x20folder\x20\x27','json','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Use:\x20tdx\x20ps\x20view\x20-w','segment:show','/app/ps/','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Get\x20SQL\x20query\x20for\x20child\x20segment','11623554zEIEDh','data','resolveFolderId','Fetching\x20segment\x20details...','folderPath','3633fDUooP','Usage:\x20tdx\x20sg\x20sql\x20<name>','Resolving\x20parent\x20folder\x20\x27','SEGMENT_NOT_FOUND','Resolving\x20parent\x20segment\x20\x27','createFolder','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','description','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20Cause:\x20','getParent','Error:\x20Path\x20or\x20name\x20is\x20required','test','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20desc','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','folderId','SQL\x20query:\x0a','fullPath','information_schema','web','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','code','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','site','execute','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20sql','\x20[Job\x20ID:\x20','trim','query','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment:folder:create','Show\x20folder\x20or\x20child\x20segment\x20details','setJobId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segmentId','1047265SKhYNg','length','error','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Fetching\x20parent\x20segment\x20details...','Resolved\x20type:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Site:\x20','segment:sql','getSegment','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Segment\x20name:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','173448rWVQZQ','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','20OtHCmR','\x20\x20Full\x20path:\x20'];a27_0x5e46=function(){return _0x43ebaa;};return a27_0x5e46();}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 a27_0x4947(_0x5d427c,_0x3851fc){_0x5d427c=_0x5d427c-0x6c;const _0x5e46b1=a27_0x5e46();let _0x494723=_0x5e46b1[_0x5d427c];return _0x494723;}import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x476a55 from'chalk';async function resolveSegmentTarget(_0x35530b,_0x4cf27b,_0x4666ad){const _0x1571ea=a27_0x4947;if(isYamlFilePath(_0x35530b))try{const _0x3b8992=await resolveYamlFilePath(_0x35530b);return _0x4666ad&&(console['error'](_0x1571ea(0x79)+_0x35530b),console['error']('\x20\x20Parent\x20segment:\x20'+_0x3b8992['parentSegment']),console[_0x1571ea(0xbe)](_0x1571ea(0xc8)+_0x3b8992[_0x1571ea(0x10b)]),console[_0x1571ea(0xbe)](_0x1571ea(0xda)+(_0x3b8992[_0x1571ea(0x95)]||_0x1571ea(0xf0))),console[_0x1571ea(0xbe)](_0x1571ea(0xcd)+_0x3b8992[_0x1571ea(0xa9)])),_0x3b8992[_0x1571ea(0xa9)];}catch(_0x938b66){throw new SDKError(ErrorCode[_0x1571ea(0xfd)],_0x1571ea(0xc3)+_0x938b66[_0x1571ea(0x6f)]);}if(!_0x4cf27b)throw new SDKError(ErrorCode[_0x1571ea(0xfd)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x4cf27b+'/'+_0x35530b;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0xd2);[a27_0x2197db(0x9d)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x2197db(0xb0)](_0x15015f){const _0x4dca11=a27_0x2197db,{options:_0x15fe73,args:_0x1c72e9,tdx:_0x33dfce}=_0x15015f,_0x5dd671=_0x1c72e9[0x0],_0x1fc3e9=!_0x5dd671&&!!_0x15fe73['parentSegment'],_0x25cfd2=_0x5dd671||_0x15fe73[_0x4dca11(0xf6)];if(!_0x25cfd2)return console[_0x4dca11(0xbe)](_0x4dca11(0xa2)),console[_0x4dca11(0xbe)](_0x4dca11(0x9f)),console[_0x4dca11(0xbe)](_0x4dca11(0xf1)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x4dca11(0xbe)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x4dca11(0xbe)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x4dca11(0x9c)),0x1;try{const _0x5e4ead=_0x15fe73['segmentPath'];let _0x2c059=_0x25cfd2;!_0x1fc3e9&&_0x5e4ead&&!_0x25cfd2[_0x4dca11(0xdb)]('/')&&(_0x2c059=_0x5e4ead+'/'+_0x25cfd2,_0x15fe73[_0x4dca11(0xfa)]&&console[_0x4dca11(0xbe)](_0x4dca11(0xcf)+_0x2c059));const _0x475ac9=await withSpinner(_0x4dca11(0xf8)+_0x2c059+_0x4dca11(0x105),()=>_0x33dfce[_0x4dca11(0x7c)]['resolvePathToResource'](_0x2c059),{'verbose':_0x15fe73[_0x4dca11(0xfa)]}),_0x419cef=_0x475ac9[_0x4dca11(0x92)];_0x15fe73['verbose']&&(console[_0x4dca11(0xbe)](_0x4dca11(0xc1)+_0x419cef['type']),console[_0x4dca11(0xbe)](_0x4dca11(0xd5)+_0x419cef[_0x4dca11(0xce)]),_0x419cef['folderId']&&console['error'](_0x4dca11(0xe5)+_0x419cef[_0x4dca11(0xa7)]),_0x419cef[_0x4dca11(0xbb)]&&console[_0x4dca11(0xbe)](_0x4dca11(0x73)+_0x419cef['segmentId']));if(_0x419cef['type']===_0x4dca11(0xe7)){const _0x4a6a78=await withSpinner(_0x4dca11(0xc0),()=>_0x33dfce['segment'][_0x4dca11(0xa1)](_0x419cef[_0x4dca11(0xce)]),{'verbose':_0x15fe73['verbose']});await handleSingleObjectOutput(_0x4a6a78['data'],_0x15fe73);}else{if(_0x419cef[_0x4dca11(0x6e)]===_0x4dca11(0xf3)){if(!_0x419cef[_0x4dca11(0xa7)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x14ed73=await withSpinner('Fetching\x20folder\x20details...',()=>_0x33dfce[_0x4dca11(0x7c)][_0x4dca11(0x81)](_0x419cef[_0x4dca11(0xa7)]),{'verbose':_0x15fe73['verbose']});await handleSingleObjectOutput(_0x14ed73[_0x4dca11(0x92)],_0x15fe73);}else{if(_0x419cef[_0x4dca11(0x6e)]===_0x4dca11(0x7c)){if(!_0x419cef[_0x4dca11(0xbb)])throw new SDKError(ErrorCode[_0x4dca11(0x99)],_0x4dca11(0x7f));const _0x29ace4=await withSpinner(_0x4dca11(0x94),()=>_0x33dfce['segment'][_0x4dca11(0xc6)](_0x419cef['parentId'],_0x419cef[_0x4dca11(0xbb)]),{'verbose':_0x15fe73[_0x4dca11(0xfa)]});await handleSingleObjectOutput(_0x29ace4[_0x4dca11(0x92)],_0x15fe73);}}}return 0x0;}catch(_0x21cf57){if(_0x21cf57 instanceof SDKError)return console['error'](_0x4dca11(0xd9)+_0x21cf57[_0x4dca11(0x6f)]),_0x21cf57[_0x4dca11(0xed)]&&console[_0x4dca11(0xbe)](_0x4dca11(0xa0)+_0x21cf57[_0x4dca11(0xed)]),0x1;throw _0x21cf57;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0x8d);['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x2197db(0xb0)](_0x16cff5){const _0x1552a9=a27_0x2197db,{options:_0x21c759,args:_0x3b7112,tdx:_0x2a6a02}=_0x16cff5,_0x4c568b=_0x3b7112[0x0];if(!_0x4c568b)return console[_0x1552a9(0xbe)](_0x1552a9(0xe8)),console[_0x1552a9(0xbe)](_0x1552a9(0x6d)),console[_0x1552a9(0xbe)](_0x1552a9(0xba)),console[_0x1552a9(0xbe)](_0x1552a9(0xf1)),console[_0x1552a9(0xbe)](_0x1552a9(0xef)),console[_0x1552a9(0xbe)](_0x1552a9(0xa4)),0x1;try{const _0x32dc15=_0x21c759[_0x1552a9(0xf6)],_0x2061ad=await resolveSegmentTarget(_0x4c568b,_0x32dc15,_0x21c759['verbose']);_0x21c759[_0x1552a9(0xfa)]&&console[_0x1552a9(0xbe)]('Target\x20path:\x20'+_0x2061ad);const _0x571603=await withSpinner(_0x1552a9(0x76)+_0x4c568b+_0x1552a9(0x105),()=>_0x2a6a02[_0x1552a9(0x7c)]['resolvePathToResource'](_0x2061ad),{'verbose':_0x21c759['verbose']}),_0x474d33=_0x571603[_0x1552a9(0x92)];_0x21c759['verbose']&&(console['error'](_0x1552a9(0xc1)+_0x474d33[_0x1552a9(0x6e)]),console[_0x1552a9(0xbe)](_0x1552a9(0xd5)+_0x474d33[_0x1552a9(0xce)]));if(_0x474d33['type']==='folder')return console[_0x1552a9(0xbe)](_0x1552a9(0xcb)),console[_0x1552a9(0xbe)](_0x1552a9(0xf9)),0x1;if(_0x474d33['type']===_0x1552a9(0xe7))return console[_0x1552a9(0xbe)](_0x1552a9(0xa6)),console[_0x1552a9(0xbe)](_0x1552a9(0x71)),0x1;if(!_0x474d33[_0x1552a9(0xbb)])throw new SDKError(ErrorCode[_0x1552a9(0x99)],_0x1552a9(0x7f));const _0xd895ae=await withSpinner(_0x1552a9(0x87),()=>_0x2a6a02['segment'][_0x1552a9(0xd7)](_0x474d33[_0x1552a9(0xce)],_0x474d33['segmentId']),{'verbose':_0x21c759[_0x1552a9(0xfa)]});let _0x49f8de=_0xd895ae[_0x1552a9(0x92)];const _0x578ec4=resolveLimit(_0x21c759[_0x1552a9(0x77)],DEFAULT_DISPLAY_LIMIT),_0x35eac5=/\bLIMIT\s+\d+/i[_0x1552a9(0xa3)](_0x49f8de);!_0x35eac5&&(_0x49f8de=_0x49f8de[_0x1552a9(0xb4)]()[_0x1552a9(0xff)](/;+$/,''),_0x49f8de='SELECT\x20*\x20FROM\x20(\x0a'+_0x49f8de+_0x1552a9(0xee)+_0x578ec4);_0x21c759['verbose']&&console['error'](_0x1552a9(0xa8)+_0x49f8de);const _0x29bccc=await withProgressSpinner(_0x1552a9(0xd4),async _0x2ace4e=>{const _0x291406=_0x1552a9,_0x3dc8ea=await _0x2a6a02[_0x291406(0xb5)]['execute'](_0x49f8de,{'catalog':'td','schema':_0x291406(0xaa),'onJobId':_0xa842d5=>{const _0x4c097e=_0x291406;_0x2ace4e[_0x4c097e(0xb9)](_0xa842d5);}});return _0x3dc8ea;},{'verbose':_0x21c759[_0x1552a9(0xfa)]}),_0x6b24e7=_0x29bccc[_0x1552a9(0x92)],_0x359681=_0x6b24e7[_0x1552a9(0xf7)]?_0x1552a9(0xb3)+_0x6b24e7[_0x1552a9(0xf7)]+']':'';return console[_0x1552a9(0xbe)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x6b24e7['stats'][_0x1552a9(0x101)][_0x1552a9(0x75)]()+_0x1552a9(0x82)+(_0x1552a9(0x84)+formatElapsed(_0x6b24e7['stats'][_0x1552a9(0x78)])+_0x359681)),await handleQueryOutput(_0x6b24e7,_0x21c759),0x0;}catch(_0xf62578){if(_0xf62578 instanceof SDKError)return console['error'](_0x1552a9(0x83)+_0xf62578[_0x1552a9(0xad)]+']'),console['error']('\x0a'+_0xf62578[_0x1552a9(0x6f)]),0x1;throw _0xf62578;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:folder:list';[a27_0x2197db(0x9d)]=a27_0x2197db(0x9e);async[a27_0x2197db(0xb0)](_0x10d283){const _0x48e6b9=a27_0x2197db,{options:_0x3180cc,args:_0xbbcee,tdx:_0x416021}=_0x10d283;if(_0xbbcee[_0x48e6b9(0xbd)]===0x0)return console[_0x48e6b9(0xbe)](_0x48e6b9(0x85)),console[_0x48e6b9(0xbe)](_0x48e6b9(0xdf)),0x1;const _0x3a318b=_0xbbcee[0x0];try{_0x3180cc[_0x48e6b9(0xfa)]&&(console['error'](_0x48e6b9(0xc4)+_0x3180cc[_0x48e6b9(0xaf)]),console[_0x48e6b9(0xbe)](_0x48e6b9(0x10c)+_0x3a318b));const _0x3ec682=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3a318b+_0x48e6b9(0x105),()=>_0x416021[_0x48e6b9(0x7c)][_0x48e6b9(0xdd)](_0x3a318b),{'verbose':_0x3180cc[_0x48e6b9(0xfa)]}),_0x321d96=_0x3ec682[_0x48e6b9(0x92)];_0x3180cc[_0x48e6b9(0xfa)]&&console[_0x48e6b9(0xbe)](_0x48e6b9(0xe6)+_0x321d96);const _0xd7fc6=await withSpinner(_0x48e6b9(0xfe)+_0x3a318b+_0x48e6b9(0x105),()=>_0x416021['segment'][_0x48e6b9(0x70)](_0x321d96),{'verbose':_0x3180cc[_0x48e6b9(0xfa)]}),_0x549662=_0xd7fc6[_0x48e6b9(0x92)];return console[_0x48e6b9(0xbe)](_0x48e6b9(0x103)+_0x549662['length']+'\x20folder'+(_0x549662['length']!==0x1?'s':'')),await handleSDKOutput(_0x549662,_0x3180cc),0x0;}catch(_0xced01b){if(_0xced01b instanceof SDKError)return console[_0x48e6b9(0xbe)]('Error:\x20'+_0xced01b[_0x48e6b9(0x6f)]),_0xced01b[_0x48e6b9(0xed)]&&console[_0x48e6b9(0xbe)]('\x20\x20Cause:\x20'+_0xced01b[_0x48e6b9(0xed)]),0x1;throw _0xced01b;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:folder:show';[a27_0x2197db(0x9d)]=a27_0x2197db(0x74);async['execute'](_0x9c84df){const _0x5086dc=a27_0x2197db,{options:_0x35b1b5,args:_0x3313cd,tdx:_0x66a397}=_0x9c84df;if(_0x3313cd[_0x5086dc(0xbd)]===0x0)return console[_0x5086dc(0xbe)](_0x5086dc(0x107)),console[_0x5086dc(0xbe)](_0x5086dc(0x7d)),0x1;try{const {parentId:_0x2b994c,childId:_0xab7273}=parseSegmentRef(_0x3313cd[0x0]);_0x35b1b5[_0x5086dc(0xfa)]&&(console[_0x5086dc(0xbe)](_0x5086dc(0xc4)+_0x35b1b5[_0x5086dc(0xaf)]),console[_0x5086dc(0xbe)](_0x5086dc(0x10c)+_0x2b994c),_0xab7273&&console[_0x5086dc(0xbe)]('Folder\x20name:\x20'+_0xab7273));if(!_0xab7273)return console['error'](_0x5086dc(0xe9)),0x1;const _0x2942a5=await withSpinner(_0x5086dc(0x9a)+_0x2b994c+_0x5086dc(0x105),()=>_0x66a397['segment']['resolveParentId'](_0x2b994c),{'verbose':_0x35b1b5[_0x5086dc(0xfa)]}),_0xa4c740=_0x2942a5['data'];_0x35b1b5[_0x5086dc(0xfa)]&&console['error'](_0x5086dc(0xe6)+_0xa4c740);const _0x338acd=await withSpinner(_0x5086dc(0x88)+_0xab7273+_0x5086dc(0x105),()=>_0x66a397[_0x5086dc(0x7c)][_0x5086dc(0x93)](_0xa4c740,_0xab7273),{'verbose':_0x35b1b5['verbose']}),_0x52323a=_0x338acd[_0x5086dc(0x92)];_0x35b1b5[_0x5086dc(0xfa)]&&console['error'](_0x5086dc(0x86)+_0x52323a);const _0x2062fa=await withSpinner(_0x5086dc(0xea)+_0xab7273+'\x27...',()=>_0x66a397['segment'][_0x5086dc(0x81)](_0x52323a),{'verbose':_0x35b1b5['verbose']});return await handleSDKOutput([_0x2062fa['data']],_0x35b1b5),0x0;}catch(_0x4cd9e0){if(_0x4cd9e0 instanceof SDKError)return console[_0x5086dc(0xbe)](_0x5086dc(0xd9)+_0x4cd9e0[_0x5086dc(0x6f)]),_0x4cd9e0[_0x5086dc(0xed)]&&console[_0x5086dc(0xbe)](_0x5086dc(0xa0)+_0x4cd9e0[_0x5086dc(0xed)]),0x1;throw _0x4cd9e0;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x2197db(0xc5);[a27_0x2197db(0x9d)]=a27_0x2197db(0x90);async[a27_0x2197db(0xb0)](_0x3510e2){const _0xda11c0=a27_0x2197db,{options:_0x9cb95b,args:_0x2b8646,tdx:_0x488912}=_0x3510e2,_0xc70c6c=_0x2b8646[0x0];if(!_0xc70c6c)return console['error'](_0xda11c0(0xe8)),console[_0xda11c0(0xbe)](_0xda11c0(0x97)),console[_0xda11c0(0xbe)](_0xda11c0(0xac)),console[_0xda11c0(0xbe)](_0xda11c0(0xf1)),console[_0xda11c0(0xbe)](_0xda11c0(0x8a)),console[_0xda11c0(0xbe)](_0xda11c0(0x8f)),0x1;try{const _0x33b2ab=_0x9cb95b[_0xda11c0(0xf6)],_0x376ca3=await resolveSegmentTarget(_0xc70c6c,_0x33b2ab,_0x9cb95b[_0xda11c0(0xfa)]);_0x9cb95b[_0xda11c0(0xfa)]&&console['error'](_0xda11c0(0xd3)+_0x376ca3);const _0x20454a=await withSpinner(_0xda11c0(0x76)+_0xc70c6c+'\x27...',()=>_0x488912[_0xda11c0(0x7c)][_0xda11c0(0xd8)](_0x376ca3),{'verbose':_0x9cb95b[_0xda11c0(0xfa)]}),_0x486f08=_0x20454a['data'];_0x9cb95b[_0xda11c0(0xfa)]&&(console[_0xda11c0(0xbe)](_0xda11c0(0xc1)+_0x486f08[_0xda11c0(0x6e)]),console[_0xda11c0(0xbe)](_0xda11c0(0xd5)+_0x486f08[_0xda11c0(0xce)]));if(_0x486f08[_0xda11c0(0x6e)]===_0xda11c0(0xf3))return console['error'](_0xda11c0(0xf4)),console[_0xda11c0(0xbe)](_0xda11c0(0x72)),0x1;if(_0x486f08[_0xda11c0(0x6e)]===_0xda11c0(0xe7))return console[_0xda11c0(0xbe)](_0xda11c0(0xe3)),console['error'](_0xda11c0(0xb2)),0x1;if(!_0x486f08[_0xda11c0(0xbb)])throw new SDKError(ErrorCode[_0xda11c0(0x99)],_0xda11c0(0x7f));const _0x2e2725=await withSpinner(_0xda11c0(0x87),()=>_0x488912[_0xda11c0(0x7c)][_0xda11c0(0xd7)](_0x486f08[_0xda11c0(0xce)],_0x486f08[_0xda11c0(0xbb)]),{'verbose':_0x9cb95b[_0xda11c0(0xfa)]}),_0x525ab2=_0x2e2725[_0xda11c0(0x92)];return _0x9cb95b['format']===_0xda11c0(0x89)||_0x9cb95b[_0xda11c0(0xd1)]===_0xda11c0(0xe4)?await handleSDKOutput([{'sql':_0x525ab2}],_0x9cb95b):console[_0xda11c0(0x106)](_0x525ab2),0x0;}catch(_0x136981){if(_0x136981 instanceof SDKError)return console[_0xda11c0(0xbe)](_0xda11c0(0xd9)+_0x136981[_0xda11c0(0x6f)]),_0x136981[_0xda11c0(0xed)]&&console['error'](_0xda11c0(0xa0)+_0x136981['cause']),0x1;throw _0x136981;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0xb7);[a27_0x2197db(0x9d)]='Create\x20segment\x20folder\x20for\x20organization';async[a27_0x2197db(0xb0)](_0x3f0283){const _0x258d4a=a27_0x2197db,{options:_0x359dd0,args:_0x3ad79a,tdx:_0x1660d1}=_0x3f0283,_0xb67f5a=_0x359dd0;if(_0x3ad79a[_0x258d4a(0xbd)]<0x2)return console[_0x258d4a(0xbe)](_0x258d4a(0xc2)),console['error'](_0x258d4a(0x100)),0x1;const _0x1819f9=_0x3ad79a[0x0],_0x29c9a7=_0x3ad79a[0x1];_0xb67f5a[_0x258d4a(0xfa)]&&(console['error'](_0x258d4a(0xc4)+_0xb67f5a[_0x258d4a(0xaf)]),console[_0x258d4a(0xbe)](_0x258d4a(0xf5)+_0x1819f9),console[_0x258d4a(0xbe)]('Folder\x20name:\x20'+_0x29c9a7));let _0x37b593;if(_0xb67f5a[_0x258d4a(0xd6)]){const _0x5311f7=_0xb67f5a['parentFolder'],_0x2c5900=await withSpinner(_0x258d4a(0x9a)+_0x1819f9+_0x258d4a(0x105),()=>_0x1660d1[_0x258d4a(0x7c)][_0x258d4a(0xdd)](_0x1819f9),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]}),_0x381ae6=_0x2c5900[_0x258d4a(0x92)],_0x46e7d1=await withSpinner(_0x258d4a(0x98)+_0x5311f7+_0x258d4a(0x105),()=>_0x1660d1[_0x258d4a(0x7c)][_0x258d4a(0x93)](_0x381ae6,_0x5311f7),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]});_0x37b593=_0x46e7d1[_0x258d4a(0x92)],_0xb67f5a['verbose']&&console[_0x258d4a(0xbe)](_0x258d4a(0x109)+_0x37b593);}const _0x37f961={'name':_0x29c9a7,'description':_0xb67f5a[_0x258d4a(0x9d)],'parentFolderId':_0x37b593},_0x453e8d=await withSpinner('Creating\x20folder\x20\x27'+_0x29c9a7+_0x258d4a(0x105),()=>_0x1660d1['segment'][_0x258d4a(0x9b)](_0x1819f9,_0x37f961),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]}),_0x25c0b1=_0x453e8d['data'];return console[_0x258d4a(0xbe)](_0x258d4a(0x7e)+_0x25c0b1[_0x258d4a(0x104)]+_0x258d4a(0xd0)+_0x25c0b1['id']),await handleSDKOutput([_0x25c0b1],_0xb67f5a),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:view';[a27_0x2197db(0x9d)]=a27_0x2197db(0xb8);async['execute'](_0x1ed5ed){const _0x365588=a27_0x2197db,{options:_0x4e0c7d,args:_0x363da3,tdx:_0x309c23}=_0x1ed5ed,_0x3e4212=_0x363da3[0x0];if(!_0x3e4212)return console[_0x365588(0xbe)](_0x365588(0xc7)),console['error'](_0x365588(0xbf)),console[_0x365588(0xbe)](_0x365588(0xec)),console[_0x365588(0xbe)]('Options:'),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x365588(0xbe)](_0x365588(0xf1)),console[_0x365588(0xbe)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x365588(0xbe)](_0x365588(0xae)),console[_0x365588(0xbe)](_0x365588(0xb6)),console[_0x365588(0xbe)](_0x365588(0xb1)),0x1;try{const _0x4eeb48=_0x4e0c7d[_0x365588(0xf6)],_0x54bc23=await resolveSegmentTarget(_0x3e4212,_0x4eeb48,_0x4e0c7d[_0x365588(0xfa)]);_0x4e0c7d[_0x365588(0xfa)]&&console[_0x365588(0xbe)](_0x365588(0xd3)+_0x54bc23);const _0x5c4d4f=await withSpinner(_0x365588(0x76)+_0x3e4212+_0x365588(0x105),()=>_0x309c23['segment']['resolvePathToResource'](_0x54bc23),{'verbose':_0x4e0c7d[_0x365588(0xfa)]}),_0x22374a=_0x5c4d4f[_0x365588(0x92)];_0x4e0c7d[_0x365588(0xfa)]&&(console[_0x365588(0xbe)](_0x365588(0xc1)+_0x22374a[_0x365588(0x6e)]),console[_0x365588(0xbe)](_0x365588(0xd5)+_0x22374a['parentId']),_0x22374a['folderId']&&console[_0x365588(0xbe)](_0x365588(0xe5)+_0x22374a[_0x365588(0xa7)]),_0x22374a[_0x365588(0xbb)]&&console[_0x365588(0xbe)](_0x365588(0x73)+_0x22374a[_0x365588(0xbb)]));if(_0x4e0c7d[_0x365588(0xab)]){if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xf3))return console['error']('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xe7))return console[_0x365588(0xbe)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x365588(0xbe)](_0x365588(0x8c)),0x1;if(!_0x22374a[_0x365588(0xbb)])throw new SDKError(ErrorCode[_0x365588(0x99)],_0x365588(0x7f));const _0x58cc54=getConsoleNextUrl(_0x4e0c7d[_0x365588(0xaf)],_0x365588(0x8e)+_0x22374a[_0x365588(0xce)]+'/e/'+_0x22374a['segmentId']);return console[_0x365588(0xbe)](a27_0x476a55[_0x365588(0x102)]('✔')+'\x20Opening\x20'+a27_0x476a55['cyan'](_0x58cc54)),openBrowser(_0x58cc54),0x0;}if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xf3)){if(!_0x22374a[_0x365588(0xa7)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x365588(0x7b));const _0xab0d6=await withSpinner(_0x365588(0x6c),()=>_0x309c23[_0x365588(0x7c)]['getFolder'](_0x22374a[_0x365588(0xa7)]),{'verbose':_0x4e0c7d[_0x365588(0xfa)]});await handleSingleObjectOutput(_0xab0d6[_0x365588(0x92)],_0x4e0c7d);}else{if(_0x22374a[_0x365588(0x6e)]==='segment'){if(!_0x22374a[_0x365588(0xbb)])throw new SDKError(ErrorCode[_0x365588(0x99)],_0x365588(0x7f));const _0x3d9b4c=await withSpinner('Fetching\x20segment\x20details...',()=>_0x309c23[_0x365588(0x7c)]['getSegment'](_0x22374a[_0x365588(0xce)],_0x22374a[_0x365588(0xbb)]),{'verbose':_0x4e0c7d[_0x365588(0xfa)]}),_0x52a4e7=getConsoleNextUrl(_0x4e0c7d['site'],_0x365588(0x8e)+_0x22374a['parentId']+'/e/'+_0x22374a['segmentId']),_0x257854=_0x3d9b4c[_0x365588(0x92)];_0x257854[_0x365588(0x108)]=_0x52a4e7,await handleSingleObjectOutput(_0x257854,_0x4e0c7d);}else return console[_0x365588(0xbe)](_0x365588(0x7a)),console['error'](_0x365588(0x10a)),0x1;}return 0x0;}catch(_0x5b059a){if(_0x5b059a instanceof SDKError)return console['error'](_0x365588(0xd9)+_0x5b059a[_0x365588(0x6f)]),_0x5b059a[_0x365588(0xed)]&&console[_0x365588(0xbe)](_0x365588(0xa0)+_0x5b059a['cause']),0x1;throw _0x5b059a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:desc';[a27_0x2197db(0x9d)]=a27_0x2197db(0xe0);async['execute'](_0x16525f){const _0xb5cc61=a27_0x2197db,{options:_0x3b103e,args:_0x5af98f,tdx:_0x25cc13}=_0x16525f,_0x2c9f4b=_0x5af98f[0x0];if(!_0x2c9f4b)return console['error'](_0xb5cc61(0xe8)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x8b)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xeb)),console['error'](_0xb5cc61(0xf1)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xde)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x80)),0x1;try{const _0x57a31a=_0x3b103e[_0xb5cc61(0xf6)],_0x58e8a4=await resolveSegmentTarget(_0x2c9f4b,_0x57a31a,_0x3b103e[_0xb5cc61(0xfa)]);_0x3b103e[_0xb5cc61(0xfa)]&&console['error'](_0xb5cc61(0xd3)+_0x58e8a4);const _0x2cd54f=await withSpinner(_0xb5cc61(0x76)+_0x2c9f4b+_0xb5cc61(0x105),()=>_0x25cc13['segment'][_0xb5cc61(0xd8)](_0x58e8a4),{'verbose':_0x3b103e[_0xb5cc61(0xfa)]}),_0x32f9ec=_0x2cd54f[_0xb5cc61(0x92)];_0x3b103e[_0xb5cc61(0xfa)]&&(console['error'](_0xb5cc61(0xc1)+_0x32f9ec[_0xb5cc61(0x6e)]),console['error'](_0xb5cc61(0xd5)+_0x32f9ec[_0xb5cc61(0xce)]));if(_0x32f9ec[_0xb5cc61(0x6e)]==='folder')return console['error'](_0xb5cc61(0xc9)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x72)),0x1;if(_0x32f9ec[_0xb5cc61(0x6e)]===_0xb5cc61(0xe7))return console[_0xb5cc61(0xbe)](_0xb5cc61(0xf2)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xa5)),0x1;if(!_0x32f9ec[_0xb5cc61(0xbb)])throw new SDKError(ErrorCode[_0xb5cc61(0x99)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2ab1a8=await withSpinner(_0xb5cc61(0x87),()=>_0x25cc13[_0xb5cc61(0x7c)][_0xb5cc61(0xd7)](_0x32f9ec['parentId'],_0x32f9ec[_0xb5cc61(0xbb)]),{'verbose':_0x3b103e['verbose']}),_0x1a8c64=_0x2ab1a8[_0xb5cc61(0x92)],_0x3a0dad=await executeSchemaQuery(_0x1a8c64,_0x25cc13,_0x3b103e);return await handleQueryOutput(_0x3a0dad,_0x3b103e),0x0;}catch(_0x1aaddb){if(_0x1aaddb instanceof SDKError)return console[_0xb5cc61(0xbe)](_0xb5cc61(0xd9)+_0x1aaddb[_0xb5cc61(0x6f)]),_0x1aaddb[_0xb5cc61(0xed)]&&console['error'](_0xb5cc61(0xa0)+_0x1aaddb[_0xb5cc61(0xed)]),0x1;throw _0x1aaddb;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x22317a=a28_0x3721;function a28_0x524a(){const _0x526474=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolved\x20folder\x20ID:\x20','execute','2430696pmeqnc','data','Resolving\x20parent\x20segment\x20\x27','folderId','resolveFolderId','Create\x20child\x20segment\x20with\x20filtering\x20rules','8999DlnSBQ','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folder','error','segment','resolveParentId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','name','Target\x20path:\x20','404570nuIBsO','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','3675261HaVppF','verbose','type','1289796xKzvbw','21pRpfWs','invisible','segments','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','5000140EXaExX','length','createSegment','Resolving\x20folder\x20path\x20\x27','\x27...','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','yellow','segmentPath','kind','24472737WUnlPS','10xRjvqs','Parent\x20path:\x20','Resolved\x20relative\x20path\x20to:\x20','description','Site:\x20','Resolving\x20folder\x20\x27','rule','62hctSZK','parent','noCountPopulation'];a28_0x524a=function(){return _0x526474;};return a28_0x524a();}function a28_0x3721(_0x32cae5,_0xf15c51){_0x32cae5=_0x32cae5-0x99;const _0x524a49=a28_0x524a();let _0x3721b5=_0x524a49[_0x32cae5];return _0x3721b5;}(function(_0x1d4231,_0x896bfd){const _0x5fba5=a28_0x3721,_0x52ca3f=_0x1d4231();while(!![]){try{const _0x55f486=-parseInt(_0x5fba5(0xb8))/0x1*(-parseInt(_0x5fba5(0xac))/0x2)+parseInt(_0x5fba5(0xc6))/0x3+parseInt(_0x5fba5(0x9b))/0x4+parseInt(_0x5fba5(0xc3))/0x5+-parseInt(_0x5fba5(0xc9))/0x6+-parseInt(_0x5fba5(0xca))/0x7*(-parseInt(_0x5fba5(0xb2))/0x8)+parseInt(_0x5fba5(0xa4))/0x9*(-parseInt(_0x5fba5(0xa5))/0xa);if(_0x55f486===_0x896bfd)break;else _0x52ca3f['push'](_0x52ca3f['shift']());}catch(_0x8e269){_0x52ca3f['push'](_0x52ca3f['shift']());}}}(a28_0x524a,0xc6545));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x20e808 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x22317a(0xc1)]='segment:create';['description']=a28_0x22317a(0xb7);async[a28_0x22317a(0xb1)](_0x566f38){const _0x22456d=a28_0x22317a;console[_0x22456d(0xbb)](a28_0x20e808['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x22456d(0xbb)](a28_0x20e808[_0x22456d(0xa1)](_0x22456d(0xa0)));const {options:_0x30f7f1,args:_0x1f35ef,tdx:_0xfddde0}=_0x566f38,_0x51247b=_0x30f7f1;if(_0x1f35ef[_0x22456d(0x9c)]===0x0)return console[_0x22456d(0xbb)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x22456d(0xbb)](_0x22456d(0xc0)),console[_0x22456d(0xbb)]('Examples:'),console[_0x22456d(0xbb)](_0x22456d(0xbf)),console['error'](_0x22456d(0xaf)),console[_0x22456d(0xbb)](_0x22456d(0xc4)),0x1;const _0x4d2179=_0x1f35ef[0x0],_0x4e1ee0=_0x30f7f1[_0x22456d(0xa2)];let _0x244763=_0x4d2179;_0x4e1ee0&&!_0x4d2179[_0x22456d(0xc5)]('/')&&(_0x244763=_0x4e1ee0+'/'+_0x4d2179,_0x51247b[_0x22456d(0xc7)]&&console[_0x22456d(0xbb)](_0x22456d(0xa7)+_0x244763));const _0x3e686e=parsePath(_0x244763);if(_0x3e686e[_0x22456d(0x99)]['length']<0x2)return console[_0x22456d(0xbb)](_0x22456d(0x9a)),console[_0x22456d(0xbb)](_0x22456d(0xb9)),0x1;const _0x5bfb4f=_0x3e686e['segments'][0x0],_0x4efa71=getBaseName(_0x244763),_0x10c945=getParentPath(_0x244763);_0x51247b[_0x22456d(0xc7)]&&(console[_0x22456d(0xbb)](_0x22456d(0xa9)+_0x51247b['site']),console[_0x22456d(0xbb)](_0x22456d(0xc2)+_0x244763),console[_0x22456d(0xbb)]('Parent:\x20'+_0x5bfb4f),console[_0x22456d(0xbb)]('Segment\x20name:\x20'+_0x4efa71),console[_0x22456d(0xbb)](_0x22456d(0xa6)+_0x10c945));const _0x4c4aa7=await withSpinner(_0x22456d(0xb4)+_0x5bfb4f+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0xbd)](_0x5bfb4f),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x2415e7=_0x4c4aa7[_0x22456d(0xb3)];let _0x3cdf54;if(_0x3e686e[_0x22456d(0x99)]['length']>0x2){const _0x3d2d23=await withSpinner(_0x22456d(0x9e)+_0x10c945+'\x27...',()=>_0xfddde0[_0x22456d(0xbc)]['resolvePathToResource'](_0x10c945),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x5860f2=_0x3d2d23[_0x22456d(0xb3)];if(_0x5860f2[_0x22456d(0xc8)]!=='folder'&&_0x5860f2[_0x22456d(0xc8)]!==_0x22456d(0xad))return console[_0x22456d(0xbb)](_0x22456d(0xbe)),0x1;_0x3cdf54=_0x5860f2[_0x22456d(0xb5)];}else{if(_0x51247b['folder']){const _0x10b910=await withSpinner(_0x22456d(0xaa)+_0x51247b[_0x22456d(0xba)]+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0xb6)](_0x2415e7,_0x51247b[_0x22456d(0xba)]),{'verbose':_0x51247b['verbose']});_0x3cdf54=_0x10b910['data'];}}_0x51247b[_0x22456d(0xc7)]&&_0x3cdf54&&console[_0x22456d(0xbb)](_0x22456d(0xb0)+_0x3cdf54);const _0x1f40b2=await loadJSONFromOptions(_0x51247b[_0x22456d(0xab)],_0x51247b['ruleFile']),_0x182694={'name':_0x4efa71,'description':_0x51247b[_0x22456d(0xa8)],'rule':_0x1f40b2,'kind':_0x51247b[_0x22456d(0xa3)]!==undefined?parseInt(_0x51247b['kind'],0xa):undefined,'isVisible':_0x51247b[_0x22456d(0xcb)]?![]:undefined,'segmentFolderId':_0x3cdf54,'countPopulation':_0x51247b[_0x22456d(0xae)]?![]:undefined},_0x43331a=await withSpinner('Creating\x20segment\x20\x27'+_0x4efa71+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0x9d)](_0x2415e7,_0x182694),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x356de0=_0x43331a['data'];return console[_0x22456d(0xbb)]('✔\x20Created\x20segment\x20\x27'+_0x356de0[_0x22456d(0xc1)]+'\x27\x20with\x20ID:\x20'+_0x356de0['id']),_0x244763!==_0x4d2179&&console['error']('\x20\x20\x20Path:\x20'+_0x244763),await handleSDKOutput([_0x356de0],_0x51247b),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x3a8d8a=a29_0x1b74;(function(_0xc5867c,_0xd2fd1a){const _0x3be3f1=a29_0x1b74,_0x5d624a=_0xc5867c();while(!![]){try{const _0x6c7f72=-parseInt(_0x3be3f1(0x8a))/0x1+parseInt(_0x3be3f1(0x86))/0x2+parseInt(_0x3be3f1(0x71))/0x3+-parseInt(_0x3be3f1(0x80))/0x4+-parseInt(_0x3be3f1(0x7c))/0x5+-parseInt(_0x3be3f1(0x81))/0x6+parseInt(_0x3be3f1(0x7e))/0x7;if(_0x6c7f72===_0xd2fd1a)break;else _0x5d624a['push'](_0x5d624a['shift']());}catch(_0x2dad92){_0x5d624a['push'](_0x5d624a['shift']());}}}(a29_0x1e86,0x56f9a));function a29_0x1b74(_0x514ba7,_0xfa5cdd){_0x514ba7=_0x514ba7-0x71;const _0x1e86b1=a29_0x1e86();let _0x1b744f=_0x1e86b1[_0x514ba7];return _0x1b744f;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x1e86(){const _0x5d91c2=['1155044GxKQzm','description','\x20field','length','483139SPEvAj','645513KMCnzN','json','segment','verbose','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:fields','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','listFields','jsonl','456795xngnGj','✔\x20Found\x20','2791635kxGwQc','error','40472UQLOYW','1503792qjUKJE','parentSegment','site','Site:\x20','Listing\x20fields\x20for\x20\x27'];a29_0x1e86=function(){return _0x5d91c2;};return a29_0x1e86();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x3a8d8a(0x77);[a29_0x3a8d8a(0x87)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x3595b8){const _0x562d76=a29_0x3a8d8a,{options:_0x16751c,args:_0x4cef08,tdx:_0x5e8543}=_0x3595b8,_0x234753=_0x4cef08[0x0]||_0x16751c[_0x562d76(0x82)];if(!_0x234753)return console[_0x562d76(0x7f)](_0x562d76(0x75)),console['error'](_0x562d76(0x79)),console[_0x562d76(0x7f)](_0x562d76(0x76)),0x1;_0x16751c[_0x562d76(0x74)]&&(console[_0x562d76(0x7f)](_0x562d76(0x84)+_0x16751c[_0x562d76(0x83)]),console[_0x562d76(0x7f)]('Parent\x20segment:\x20'+_0x234753));const _0x3ade0e=await withSpinner(_0x562d76(0x85)+_0x234753+'\x27...',()=>_0x5e8543[_0x562d76(0x73)][_0x562d76(0x7a)](_0x234753),{'verbose':_0x16751c[_0x562d76(0x74)]}),_0x26cce8=_0x3ade0e[_0x562d76(0x78)];console[_0x562d76(0x7f)](_0x562d76(0x7d)+_0x26cce8['length']+_0x562d76(0x88)+(_0x26cce8[_0x562d76(0x89)]!==0x1?'s':''));if(_0x16751c[_0x562d76(0x72)]||_0x16751c[_0x562d76(0x7b)])return await handleSDKOutput(_0x26cce8,_0x16751c),0x0;return displayFieldsHumanReadable(_0x26cce8,_0x234753),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x1eb9b3=a30_0x5d5a;(function(_0x3bfb99,_0x27304a){const _0x27cefb=a30_0x5d5a,_0x44dd34=_0x3bfb99();while(!![]){try{const _0x10bbde=parseInt(_0x27cefb(0x159))/0x1*(parseInt(_0x27cefb(0x175))/0x2)+parseInt(_0x27cefb(0x18e))/0x3+parseInt(_0x27cefb(0x17a))/0x4*(-parseInt(_0x27cefb(0x149))/0x5)+parseInt(_0x27cefb(0x167))/0x6*(-parseInt(_0x27cefb(0x168))/0x7)+parseInt(_0x27cefb(0x190))/0x8+-parseInt(_0x27cefb(0x193))/0x9+-parseInt(_0x27cefb(0x15e))/0xa*(-parseInt(_0x27cefb(0x18a))/0xb);if(_0x10bbde===_0x27304a)break;else _0x44dd34['push'](_0x44dd34['shift']());}catch(_0x322e5a){_0x44dd34['push'](_0x44dd34['shift']());}}}(a30_0x27b1,0xc1650));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a30_0x27b1(){const _0x42207d=['files','journeys','verbose','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)','execute','\x20versions)','\x20files\x20to\x20','Target\x20resource:\x20','absolutePath','length','\x20\x20🎯\x20','segments','yes','51689GLKxkn','Write\x20','site','\x20\x20Target:\x20','3063144gFLCSp','hasChanges','5755472SnkvlK','green','\x20journeys','7858269ySOMNe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','dim','\x20segments','✔\x20Context\x20set:\x20','journeyVersions','pullSegments','isNew','5BdDNvc','parentSegment','\x20changed\x20files','\x20files?','Aborted.','targetDir','resourceName','✔\x20Pulled\x20','segment:pull','cwd','content','message','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','segment','Error:\x20','2JeZDcV','Site:\x20','\x20activations','cyan','relativePath','710PrIzln','dirname','error','filter','name','data','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parent_segment','parentName','102diBoOn','224462vgTrQL','\x20with\x20','red','\x20\x20🗺️\x20\x20','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','diff','session','repeat','Pulling\x20segments\x20from\x20\x27','errorCode','\x20unchanged\x20files','utf-8','778642rQFWiH','\x0aChanges\x20to\x20\x27','\x20new\x20files','counts','no_parent','2569384OPXkwU','✔\x20All\x20files\x20are\x20up\x20to\x20date','description'];a30_0x27b1=function(){return _0x42207d;};return a30_0x27b1();}import a30_0x2ca5a0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x108ba8 from'path';function a30_0x5d5a(_0x194911,_0x511f87){_0x194911=_0x194911-0x144;const _0x27b1c7=a30_0x27b1();let _0x5d5ae9=_0x27b1c7[_0x194911];return _0x5d5ae9;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x1eb9b3(0x162)]=a30_0x1eb9b3(0x151);[a30_0x1eb9b3(0x17c)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x1eb9b3(0x181)](_0x311b2a){const _0xe60ce9=a30_0x1eb9b3,{options:_0xa6b3e7,args:_0x31cafe,tdx:_0x4073dd}=_0x311b2a,_0x4e0792=_0xa6b3e7,_0x2af95d=await resolveTarget({'arg':_0x31cafe[0x0],'contextParent':_0xa6b3e7[_0xe60ce9(0x14a)],'cwd':process[_0xe60ce9(0x152)]()});if(!isSuccessfulResolution(_0x2af95d))return _0x2af95d[_0xe60ce9(0x172)]===_0xe60ce9(0x179)?(console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x164))),console['error'](_0xe60ce9(0x180)),console[_0xe60ce9(0x160)](_0xe60ce9(0x194)),console['error'](_0xe60ce9(0x16d))):(console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16a)](_0xe60ce9(0x158)+_0x2af95d[_0xe60ce9(0x154)]+'\x0a')),_0x2af95d['helpText']&&console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x2af95d['helpText']))),0x1;const _0xe6dda3=_0x2af95d[_0xe60ce9(0x166)],_0x24b80b=_0x2af95d[_0xe60ce9(0x14e)],_0x306f97=_0x2af95d['type']==='file'?_0x2af95d[_0xe60ce9(0x14f)]:undefined;_0x4e0792[_0xe60ce9(0x17f)]&&(console[_0xe60ce9(0x160)](_0xe60ce9(0x15a)+_0x4e0792[_0xe60ce9(0x18c)]),console['error']('Parent\x20segment:\x20'+_0xe6dda3),_0x306f97&&console['error'](_0xe60ce9(0x184)+_0x306f97));const _0x37e50f=await withProgressSpinner(_0xe60ce9(0x171)+_0xe6dda3+'\x27...',_0x4d42cc=>_0x4073dd[_0xe60ce9(0x157)][_0xe60ce9(0x147)](_0xe6dda3,{'targetDir':_0x24b80b,'targetResourceName':_0x306f97,'verbose':_0x4e0792[_0xe60ce9(0x17f)],'progress':{'update':_0x5d4c4c=>{const _0x3e64da=_0xe60ce9;_0x4d42cc['setPhase'](_0x5d4c4c),_0x4e0792[_0x3e64da(0x17f)]&&console['error']('\x20\x20'+_0x5d4c4c);}}}),{'verbose':_0x4e0792[_0xe60ce9(0x17f)]}),_0x1eb3f3=_0x37e50f[_0xe60ce9(0x163)];if(_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x188)]===0x0&&_0x1eb3f3['counts'][_0xe60ce9(0x17e)]===0x0)return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x155)+_0x1eb3f3[_0xe60ce9(0x166)]+'\x27')),0x0;const _0x2e54e9=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x3e3be0=>_0x3e3be0[_0xe60ce9(0x148)]),_0x2e5133=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x458b7d=>!_0x458b7d[_0xe60ce9(0x148)]&&_0x458b7d[_0xe60ce9(0x18f)]),_0x265409=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x21f4b7=>!_0x21f4b7[_0xe60ce9(0x148)]&&!_0x21f4b7[_0xe60ce9(0x18f)]);console[_0xe60ce9(0x160)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1eb3f3['parentName']+'\x27:'),console[_0xe60ce9(0x160)](_0xe60ce9(0x187)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x188)]+_0xe60ce9(0x144))+_0xe60ce9(0x169)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)]['activations']+_0xe60ce9(0x15b)));if(_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x17e)]>0x0){const _0x2bca4a=_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x146)]>_0x1eb3f3[_0xe60ce9(0x178)]['journeys']?'\x20('+_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x146)]+_0xe60ce9(0x182):'';console['error'](_0xe60ce9(0x16b)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x17e)]+_0xe60ce9(0x192))+a30_0x2ca5a0[_0xe60ce9(0x195)](_0x2bca4a));}console['error']('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x191)]('+\x20'+_0x2e54e9[_0xe60ce9(0x186)]+_0xe60ce9(0x177))),console[_0xe60ce9(0x160)]('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x16c)]('~\x20'+_0x2e5133[_0xe60ce9(0x186)]+_0xe60ce9(0x14b))),console['error']('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x195)]('=\x20'+_0x265409[_0xe60ce9(0x186)]+_0xe60ce9(0x173))),console['error'](_0xe60ce9(0x18d)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3['targetDir'])+'\x0a');if(_0x2e5133['length']>0x0)for(const _0x3302b7 of _0x2e5133){console['error'](_0xe60ce9(0x176)+_0x3302b7[_0xe60ce9(0x15d)]+'\x27:'),console['error']('─'[_0xe60ce9(0x170)](0x3c)),console[_0xe60ce9(0x160)](_0x3302b7[_0xe60ce9(0x16e)]),console[_0xe60ce9(0x160)]('─'[_0xe60ce9(0x170)](0x3c));}if(_0x4e0792['dryRun'])return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x156))),0x0;if(_0x2e54e9[_0xe60ce9(0x186)]===0x0&&_0x2e5133[_0xe60ce9(0x186)]===0x0)return console['error'](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x17b))),saveSessionContext({'parent_segment':_0x1eb3f3[_0xe60ce9(0x166)]},_0x4e0792['session']),console[_0xe60ce9(0x160)](a30_0x2ca5a0['green'](_0xe60ce9(0x145)+a30_0x2ca5a0['dim'](_0xe60ce9(0x165))+'\x20=\x20'+a30_0x2ca5a0['cyan'](_0x1eb3f3[_0xe60ce9(0x166)]))),0x0;if(!_0x4e0792[_0xe60ce9(0x189)]){const _0x33f273=await confirmKey(_0xe60ce9(0x18b)+(_0x2e54e9[_0xe60ce9(0x186)]+_0x2e5133['length'])+_0xe60ce9(0x14c));if(!_0x33f273)return console[_0xe60ce9(0x160)](_0xe60ce9(0x14d)),0x1;}for(const _0x536de6 of _0x1eb3f3[_0xe60ce9(0x17d)]){if(_0x536de6[_0xe60ce9(0x148)]||_0x536de6['hasChanges']){const _0x36772a=a30_0x108ba8[_0xe60ce9(0x15f)](_0x536de6['absolutePath']);!existsSync(_0x36772a)&&mkdirSync(_0x36772a,{'recursive':!![]}),writeFileSync(_0x536de6[_0xe60ce9(0x185)],_0x536de6[_0xe60ce9(0x153)],_0xe60ce9(0x174));}}return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x150)+(_0x2e54e9[_0xe60ce9(0x186)]+_0x2e5133['length'])+_0xe60ce9(0x183)+_0x1eb3f3[_0xe60ce9(0x14e)])),saveSessionContext({'parent_segment':_0x1eb3f3['parentName']},_0x4e0792[_0xe60ce9(0x16f)]),console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x145)+a30_0x2ca5a0[_0xe60ce9(0x195)]('parent_segment')+'\x20=\x20'+a30_0x2ca5a0['cyan'](_0x1eb3f3['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x4203c5=a31_0x296a;(function(_0x764411,_0xa0c311){const _0x13eb3c=a31_0x296a,_0x26064c=_0x764411();while(!![]){try{const _0x402ecd=-parseInt(_0x13eb3c(0x17e))/0x1+parseInt(_0x13eb3c(0x1c4))/0x2*(parseInt(_0x13eb3c(0x1fb))/0x3)+-parseInt(_0x13eb3c(0x174))/0x4+-parseInt(_0x13eb3c(0x1e5))/0x5*(-parseInt(_0x13eb3c(0x1f6))/0x6)+-parseInt(_0x13eb3c(0x16e))/0x7*(parseInt(_0x13eb3c(0x1e9))/0x8)+-parseInt(_0x13eb3c(0x17f))/0x9*(-parseInt(_0x13eb3c(0x1e2))/0xa)+parseInt(_0x13eb3c(0x168))/0xb;if(_0x402ecd===_0xa0c311)break;else _0x26064c['push'](_0x26064c['shift']());}catch(_0x23a8b7){_0x26064c['push'](_0x26064c['shift']());}}}(a31_0x5151,0x3f8f6));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a31_0x5151(){const _0x3f01f9=['no_parent','isScoped','7580GcTjyX','endsWith','updatedAt','29105XDcdFm','data','repeat','dryRun','539288ydjLqR','file','Push\x20','get','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)','\x20\x20\x20\x20','listSegments','\x20folders\x20to\x20create','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Folders\x20to\x20create:','filePath','folderPath','282AwesAP','\x20created','yellow','length','📁\x20','99558FVXiZB','results','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','new','yes','toCreate','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Fetching\x20existing\x20segments...','paused','7832968mEzFZc','isNew','blue','createdSegmentIds','execute','parent_name','35aPcxcP','helpText','Fetching\x20connections\x20for\x20name\x20resolution...','cwd','No\x20','filter','1316396lfSWhi','targetDir','created','all','getParent','getJourney','list','createdAt','\x20\x20📊\x20Segments:','Fetching\x20existing\x20folders...','362401SLjwXu','54LZQSuZ','Site:\x20','name','error','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yamlConfig','green','segment\x20or\x20journey','verbose','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','/app/ps/','/j/da/je','listFolders','toUpdate','\x20\x20Source:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','map','\x27...','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Segments:\x20','Aborted.','Source\x20directory:\x20','/e/','type','\x20updated','updated','segment','Changes\x20to\x20journey:','folderId','\x0a✔\x20Push\x20complete','Fetching\x20existing\x20journeys...','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','segment:push','\x20deleted','diff','\x20unchanged','deleted','user','delete','\x0aValidation\x20failed:','journeysOnly','state','journeyBundleName','red','attributes','New\x20journey:','\x20\x20Activations:\x20','dim','unchanged','then','getOutputSchemaWithCache','setPhase','Delete\x20segment:','journeyId','\x0aPush\x20summary\x20for\x20\x27','toString','changed','errorCode','cyan','\x20changes?','Parent\x20segment:\x20','.yml','resolveParentId','nameToId','push','toDelete','segments','description','\x20changed','18AVzFIo','set','folders','journeys','\x20to\x20delete','connection','idToName','site','Fetching\x20parent\x20segment\x20details...','\x20YAML\x20files\x20found','parentFolder','join','\x20new','journeyBundleId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Delete\x20journey:','message','Preparing\x20journeys...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20Activations:','\x20activations]','Fetching\x20existing\x20activations...','New\x20segment:','\x20to\x20create','existingJourney','activations','\x20\x20🗺️\x20\x20Journeys:','journey'];a31_0x5151=function(){return _0x3f01f9;};return a31_0x5151();}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x48dc70 from'chalk';function a31_0x296a(_0x4a831a,_0x53ed55){_0x4a831a=_0x4a831a-0x166;const _0x515193=a31_0x5151();let _0x296afa=_0x515193[_0x4a831a];return _0x296afa;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x4203c5(0x181)]=a31_0x4203c5(0x19f);[a31_0x4203c5(0x1c2)]=a31_0x4203c5(0x1d2);async[a31_0x4203c5(0x16c)](_0x32df3e){const _0x4fc34a=a31_0x4203c5,{options:_0x5d64db,args:_0x3ba77f,tdx:_0x2ad664}=_0x32df3e,_0x43932b=_0x5d64db,_0x4eefda=await resolveTarget({'arg':_0x3ba77f[0x0],'contextParent':_0x5d64db['parentSegment'],'cwd':process[_0x4fc34a(0x171)]()});if(!isSuccessfulResolution(_0x4eefda))return _0x4eefda[_0x4fc34a(0x1b8)]===_0x4fc34a(0x1e0)?(console['error'](a31_0x48dc70['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4fc34a(0x182)](_0x4fc34a(0x1ed)),console[_0x4fc34a(0x182)](_0x4fc34a(0x201)),console[_0x4fc34a(0x182)](_0x4fc34a(0x1f2))):(console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)]('Error:\x20'+_0x4eefda[_0x4fc34a(0x1d4)]+'\x0a')),_0x4eefda[_0x4fc34a(0x16f)]&&console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1b9)](_0x4eefda[_0x4fc34a(0x16f)]))),0x1;if(_0x4eefda[_0x4fc34a(0x196)]===_0x4fc34a(0x16d))return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4eefda[_0x4fc34a(0x175)]+'\x0a')),console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1b9)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x1ccb88=_0x4eefda['parentName'],_0x60b226=_0x4eefda[_0x4fc34a(0x175)],_0xfb5acd=_0x4eefda[_0x4fc34a(0x196)]===_0x4fc34a(0x1ea)?_0x4eefda[_0x4fc34a(0x1f4)]:undefined,_0x19ab3c=getScopedDetails(_0x4eefda),_0x44c92a=_0x19ab3c?.[_0x4fc34a(0x1e1)]??![],_0x432970=_0x19ab3c?.['scopedFolderPath']??'';if(!existsSync(_0x60b226))return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)](_0x4fc34a(0x191)+_0x60b226+'\x0a')),console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1b9)](_0x4fc34a(0x1fd))),0x1;_0x43932b[_0x4fc34a(0x187)]&&(console[_0x4fc34a(0x182)](_0x4fc34a(0x180)+_0x43932b[_0x4fc34a(0x1cb)]),console['error'](_0x4fc34a(0x1bb)+_0x1ccb88),console[_0x4fc34a(0x182)](_0x4fc34a(0x194)+_0x60b226),_0x44c92a&&console['error']('Scoped\x20to\x20folder:\x20'+_0x432970));const _0x13783c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ccb88+_0x4fc34a(0x190),()=>_0x2ad664[_0x4fc34a(0x199)][_0x4fc34a(0x1bd)](_0x1ccb88),{'verbose':_0x43932b[_0x4fc34a(0x187)]}),_0x321572=_0x13783c[_0x4fc34a(0x1e6)],[_0xed2647,_0x309031,_0x17f70b,_0x554be5,_0x142b0]=await Promise[_0x4fc34a(0x177)]([withSpinner(_0x4fc34a(0x1cc),()=>_0x2ad664[_0x4fc34a(0x199)][_0x4fc34a(0x178)](_0x321572),{'verbose':_0x43932b[_0x4fc34a(0x187)]}),withSpinner(_0x4fc34a(0x166),()=>_0x2ad664[_0x4fc34a(0x199)][_0x4fc34a(0x1ef)](_0x321572),{'verbose':_0x43932b[_0x4fc34a(0x187)]}),withSpinner(_0x4fc34a(0x17d),()=>_0x2ad664[_0x4fc34a(0x199)][_0x4fc34a(0x18b)](_0x321572),{'verbose':_0x43932b['verbose']}),withSpinner(_0x4fc34a(0x19d),()=>_0x2ad664[_0x4fc34a(0x1df)]['listJourneysWithDetailsFromParentSegment'](_0x321572,{'includeAllVersions':!![]}),{'verbose':_0x43932b[_0x4fc34a(0x187)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x2ad664['user']['buildUserMaps'](),{'verbose':_0x43932b['verbose']})['then'](_0x109083=>_0x109083['data'])]),_0x53f38b=_0xed2647['data'],_0x150c34=extractRootFolderId(_0x53f38b),_0x4e9626=_0x309031[_0x4fc34a(0x1e6)],_0x5c34c6=_0x17f70b[_0x4fc34a(0x1e6)],{journeys:_0x23e26c,activationStepsById:_0x5d8bd3}=_0x554be5[_0x4fc34a(0x1e6)],_0x4e1223=new Map(_0x23e26c[_0x4fc34a(0x18f)](_0x37c374=>[_0x37c374['id'],_0x37c374])),_0x290a1e=_0x23e26c['map'](_0x847536=>({'id':_0x847536['id'],'name':_0x847536[_0x4fc34a(0x1ab)]['name'],'journeyBundleName':_0x847536['attributes'][_0x4fc34a(0x1a9)]||'','journeyBundleId':_0x847536[_0x4fc34a(0x1ab)][_0x4fc34a(0x1d1)]||'','versionNumber':_0x847536[_0x4fc34a(0x1ab)]['versionNumber'],'description':_0x847536[_0x4fc34a(0x1ab)][_0x4fc34a(0x1c2)],'state':_0x847536['attributes'][_0x4fc34a(0x1a8)],'paused':_0x847536['attributes'][_0x4fc34a(0x167)],'audienceId':_0x847536[_0x4fc34a(0x1ab)]['audienceId'],'folderId':_0x847536['relationships']?.[_0x4fc34a(0x1ce)]?.['data']?.['id'],'createdAt':_0x847536[_0x4fc34a(0x1ab)][_0x4fc34a(0x17b)],'updatedAt':_0x847536[_0x4fc34a(0x1ab)][_0x4fc34a(0x1e4)]})),{emailToId:_0x5b39d9,idToEmail:_0x434486}=_0x142b0,_0x40098a=await withSpinner(_0x4fc34a(0x170),async()=>{const _0x2ab27d=_0x4fc34a,_0xd453c3=await _0x2ad664[_0x2ab27d(0x1c9)][_0x2ab27d(0x17a)]();return buildConnectionMaps(_0xd453c3);},{'verbose':_0x43932b['verbose']})['then'](_0x5bf308=>_0x5bf308[_0x4fc34a(0x1e6)]),_0x1bba53=_0x40098a['nameToId'],_0x3077ce=_0x40098a[_0x4fc34a(0x1ca)],_0x3193db=_0x40098a['nameToType'],_0xc031ec={'emailToIdMap':_0x5b39d9,'connectionNameToIdMap':_0x1bba53,'connectionNameToTypeMap':_0x3193db,'getSchema':_0x47f4e4=>_0x2ad664[_0x4fc34a(0x1c9)][_0x4fc34a(0x1b1)](_0x47f4e4)};let {pathToId:_0x77b1f6,idToPath:_0x61301}=buildFolderMaps(_0x5c34c6);const _0x97d309=buildSegmentLookupMap(_0x4e9626,_0x61301),_0x36fc4b=buildSegmentNameToIdMap(_0x4e9626),_0x4be549=buildJourneyBundleLookupMap(_0x290a1e,_0x61301);let _0xacf714;if(_0xfb5acd){if(!_0xfb5acd[_0x4fc34a(0x1e3)](_0x4fc34a(0x1bc))&&!_0xfb5acd['endsWith']('.yaml'))return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)](_0x4fc34a(0x188)+_0xfb5acd+'\x0a')),0x1;_0xacf714=[_0xfb5acd];}else _0xacf714=findYamlFiles(_0x60b226);if(_0xacf714['length']===0x0)return console[_0x4fc34a(0x182)](a31_0x48dc70['red'](_0x4fc34a(0x183)+_0x60b226+'\x0a')),console['error'](a31_0x48dc70[_0x4fc34a(0x1b9)](_0x4fc34a(0x18e))),0x1;let _0x4375f1,_0x4e0fae;try{const _0x54df05=parseAndClassifyYamlFiles(_0xacf714,_0x60b226,{'skipSegments':_0x43932b[_0x4fc34a(0x1a7)]});_0x4375f1=_0x54df05[_0x4fc34a(0x1c1)],_0x4e0fae=_0x54df05[_0x4fc34a(0x1c7)];const _0x10d18c=validateParsedFiles(_0x54df05,_0x60b226);if(_0x10d18c[_0x4fc34a(0x1f9)]>0x0)return console[_0x4fc34a(0x182)](a31_0x48dc70['red'](_0x4fc34a(0x1a6))),console[_0x4fc34a(0x182)](formatValidationErrors(_0x10d18c)),console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1f8)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x2cc38c){return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)]('Error\x20parsing\x20YAML:\x20'+(_0x2cc38c instanceof Error?_0x2cc38c['message']:_0x2cc38c))),0x1;}if(_0x4375f1['length']===0x0&&_0x4e0fae[_0x4fc34a(0x1f9)]===0x0){const _0x36b58d=_0x43932b[_0x4fc34a(0x1a7)]?_0x4fc34a(0x1df):_0x4fc34a(0x186);return console[_0x4fc34a(0x182)](a31_0x48dc70['yellow'](_0x4fc34a(0x172)+_0x36b58d+_0x4fc34a(0x1cd))),0x0;}const _0x19ebc9=new Map();_0x4e9626['length']>0x0&&!_0x43932b[_0x4fc34a(0x1a7)]&&await withSpinner(_0x4fc34a(0x1d9),async()=>{await batchAsync(_0x4e9626,async _0x159d4a=>{const _0x3461f5=a31_0x296a,_0x30ff09=await _0x2ad664[_0x3461f5(0x199)]['listActivations'](_0x321572,_0x159d4a['id']);_0x19ebc9['set'](_0x159d4a['id'],_0x30ff09);});},{'verbose':_0x43932b['verbose']});const {segmentFiles:_0x3ab41c,foldersToCreate:_0x506afd}=await prepareSegmentFiles(_0x4375f1,{'segmentByFolderAndName':_0x97d309,'activationsBySegmentId':_0x19ebc9,'folderPathToId':_0x77b1f6,'idToEmailMap':_0x434486,'connectionIdToNameMap':_0x3077ce},_0xc031ec,_0x44c92a,_0x432970),_0x3748e7=_0xfb5acd?[]:findSegmentsToDelete(_0x4e9626,_0x4375f1[_0x4fc34a(0x18f)](({yamlConfig:_0x42dec1,folderPath:_0x367cb3})=>({'yamlConfig':_0x42dec1,'folderPath':resolveTDFolderPath(_0x367cb3,_0x44c92a,_0x432970)})),_0x61301,_0x432970,_0x44c92a),{journeyFiles:_0x5b444c,foldersToCreate:_0x31cac5}=await withProgressSpinner(_0x4fc34a(0x1d5),async _0x1557af=>prepareJourneyFiles(_0x4e0fae,{'fetchJourney':async _0x19863a=>_0x2ad664[_0x4fc34a(0x1df)][_0x4fc34a(0x179)](_0x19863a[_0x4fc34a(0x1b4)]),'journeyBundlesByFolderAndName':_0x4be549,'folderPathToId':_0x77b1f6,'idToEmailMap':_0x434486,'connectionIdToNameMap':_0x3077ce,'existingSegments':_0x4e9626,'parentId':_0x321572,'deps':_0x2ad664,'progress':{'update':_0x1b95c1=>{const _0x5513d5=_0x4fc34a;_0x1557af[_0x5513d5(0x1b2)](_0x1b95c1),_0x43932b[_0x5513d5(0x187)]&&console['error']('\x20\x20'+_0x1b95c1);}},'journeyById':_0x4e1223,'activationStepsById':_0x5d8bd3},_0x44c92a,_0x432970),{'verbose':_0x43932b[_0x4fc34a(0x187)]})[_0x4fc34a(0x1b0)](_0x51133e=>_0x51133e[_0x4fc34a(0x1e6)]);for(const _0x44c94d of _0x31cac5){_0x506afd['add'](_0x44c94d);}const _0x26d078=_0xfb5acd?[]:findJourneysToDelete(_0x290a1e,_0x4e0fae['map'](({yamlConfig:_0x96f936,folderPath:_0xa9b83a})=>({'yamlConfig':_0x96f936,'folderPath':resolveTDFolderPath(_0xa9b83a,_0x44c92a,_0x432970)})),_0x61301,_0x432970,_0x44c92a),_0x458b31=calculatePushStats(_0x3ab41c,_0x5b444c,_0x506afd,_0x3748e7,_0x26d078,!!_0x43932b['delete'],!!_0x43932b[_0x4fc34a(0x1a7)]),_0x1d65ab=_0x458b31[_0x4fc34a(0x1c1)][_0x4fc34a(0x1fe)],_0xbef61a=_0x458b31['segments'][_0x4fc34a(0x1b7)],_0x196ee0=_0x458b31[_0x4fc34a(0x1c1)][_0x4fc34a(0x1af)],_0x238904=_0x458b31[_0x4fc34a(0x1c1)][_0x4fc34a(0x1c0)],_0x6a75b4=_0x458b31[_0x4fc34a(0x1c6)][_0x4fc34a(0x200)],_0x189654=_0x458b31[_0x4fc34a(0x1c7)][_0x4fc34a(0x1fe)],_0x5089fa=_0x458b31[_0x4fc34a(0x1c7)][_0x4fc34a(0x1b7)],_0x587cbb=_0x458b31[_0x4fc34a(0x1c7)][_0x4fc34a(0x1af)],_0x503a92=_0x458b31[_0x4fc34a(0x1c7)]['toDelete'],_0x5b2cbe=_0x458b31[_0x4fc34a(0x1dd)][_0x4fc34a(0x177)],_0x52cd04=_0x458b31[_0x4fc34a(0x1dd)][_0x4fc34a(0x200)],_0x217093=_0x458b31['activations'][_0x4fc34a(0x18c)],_0x4e6a62=_0x458b31[_0x4fc34a(0x1dd)][_0x4fc34a(0x1c0)];console[_0x4fc34a(0x182)](_0x4fc34a(0x1b5)+_0x1ccb88+'\x27:');_0x6a75b4[_0x4fc34a(0x1f9)]>0x0&&console['error']('\x20\x20'+a31_0x48dc70['blue'](_0x4fc34a(0x1fa)+_0x6a75b4['length']+_0x4fc34a(0x1f0)));if(!_0x43932b['journeysOnly']){console[_0x4fc34a(0x182)](_0x4fc34a(0x17c)),console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x185)]('+\x20'+_0x1d65ab[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1d0))),console['error']('\x20\x20\x20\x20'+a31_0x48dc70['yellow']('~\x20'+_0xbef61a[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1c3)));if(_0x238904[_0x4fc34a(0x1f9)]>0x0)console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1aa)]('-\x20'+_0x238904[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1c8)));else _0x3748e7[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b[_0x4fc34a(0x1a5)]&&console['error'](_0x4fc34a(0x1ee)+a31_0x48dc70['dim'](_0x3748e7[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1f1)));console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1ae)]('=\x20'+_0x196ee0[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1a2)));}if(_0x5b444c['length']>0x0||_0x26d078['length']>0x0){console[_0x4fc34a(0x182)](_0x4fc34a(0x1de)),console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x185)]('+\x20'+_0x189654['length']+'\x20new')),console['error'](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1f8)]('~\x20'+_0x5089fa[_0x4fc34a(0x1f9)]+'\x20changed'));if(_0x503a92[_0x4fc34a(0x1f9)]>0x0)console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1aa)]('-\x20'+_0x503a92['length']+_0x4fc34a(0x1c8)));else _0x26d078['length']>0x0&&!_0x43932b[_0x4fc34a(0x1a5)]&&console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1ae)](_0x26d078['length']+_0x4fc34a(0x1f1)));console['error'](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1ae)]('=\x20'+_0x587cbb[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1a2)));}_0x5b2cbe[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b[_0x4fc34a(0x1a7)]&&(console[_0x4fc34a(0x182)](''),console[_0x4fc34a(0x182)](_0x4fc34a(0x1d7)),_0x52cd04[_0x4fc34a(0x1f9)]>0x0&&console['error'](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x185)]('+\x20'+_0x52cd04['length']+_0x4fc34a(0x1db))),_0x217093[_0x4fc34a(0x1f9)]>0x0&&console[_0x4fc34a(0x182)]('\x20\x20\x20\x20'+a31_0x48dc70[_0x4fc34a(0x1f8)]('~\x20'+_0x217093[_0x4fc34a(0x1f9)]+'\x20to\x20update')),_0x4e6a62[_0x4fc34a(0x1f9)]>0x0&&console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1aa)]('-\x20'+_0x4e6a62['length']+_0x4fc34a(0x1c8))));console[_0x4fc34a(0x182)](_0x4fc34a(0x18d)+a31_0x48dc70[_0x4fc34a(0x1b9)](_0x60b226)+'\x0a');if(_0x6a75b4['length']>0x0){console[_0x4fc34a(0x182)](_0x4fc34a(0x1f3));for(const _0x45465f of _0x6a75b4){console['error']('\x20\x20'+a31_0x48dc70[_0x4fc34a(0x16a)]('+')+'\x20'+_0x45465f);}console[_0x4fc34a(0x182)]('');}if(_0x1d65ab[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b[_0x4fc34a(0x1a7)])for(const _0x4f36af of _0x1d65ab){const _0x16be26=_0x4f36af['folderPath']?_0x4f36af[_0x4fc34a(0x1f5)]+'/'+_0x4f36af[_0x4fc34a(0x184)][_0x4fc34a(0x181)]:_0x4f36af['yamlConfig'][_0x4fc34a(0x181)],_0xe0a57c=_0x4f36af[_0x4fc34a(0x184)][_0x4fc34a(0x1dd)]?.[_0x4fc34a(0x1f9)]||0x0,_0x4e6f56=_0xe0a57c>0x0?a31_0x48dc70[_0x4fc34a(0x1ae)]('\x20['+_0xe0a57c+'\x20activations]'):'';console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70[_0x4fc34a(0x185)](_0x4fc34a(0x1da))+'\x20'+_0x16be26+_0x4e6f56),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c)),_0x4f36af[_0x4fc34a(0x1a1)]&&console[_0x4fc34a(0x182)](_0x4f36af[_0x4fc34a(0x1a1)]),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}if(_0x238904[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b['journeysOnly'])for(const _0x2f4ab8 of _0x238904){const _0x3fe5b8=_0x2f4ab8['segmentFolderId']?_0x61301[_0x4fc34a(0x1ec)](_0x2f4ab8['segmentFolderId'][_0x4fc34a(0x1b6)]())||'':'',_0x336ae9=_0x3fe5b8?_0x3fe5b8+'/'+_0x2f4ab8[_0x4fc34a(0x181)]:_0x2f4ab8[_0x4fc34a(0x181)],_0x135753=_0x19ebc9[_0x4fc34a(0x1ec)](_0x2f4ab8['id'])||[],_0x368769=_0x135753[_0x4fc34a(0x1f9)]>0x0?a31_0x48dc70[_0x4fc34a(0x1ae)]('\x20['+_0x135753[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1d8)):'';console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70[_0x4fc34a(0x1aa)](_0x4fc34a(0x1b3))+'\x20'+_0x336ae9+_0x368769),console[_0x4fc34a(0x182)]('─'['repeat'](0x3c));const _0x2f5db2=segmentWithActivationsToYaml(_0x2f4ab8,_0x135753,undefined,_0x434486,_0x3077ce),_0x5d933a=segmentToYamlString(_0x2f5db2),_0x25c33e=generateDiff(_0x5d933a,'');console[_0x4fc34a(0x182)](formatDiffWithColors(_0x25c33e)),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}const _0x4bd37f=_0x3ab41c[_0x4fc34a(0x173)](_0x38b7e9=>!_0x38b7e9[_0x4fc34a(0x169)]&&_0x38b7e9[_0x4fc34a(0x1a1)]);if(_0x4bd37f[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b[_0x4fc34a(0x1a7)])for(const _0x25a7b9 of _0x4bd37f){const _0x3933a1=_0x25a7b9[_0x4fc34a(0x1f5)]?_0x25a7b9[_0x4fc34a(0x1f5)]+'/'+_0x25a7b9['yamlConfig'][_0x4fc34a(0x181)]:_0x25a7b9[_0x4fc34a(0x184)][_0x4fc34a(0x181)];console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70[_0x4fc34a(0x1f8)]('Changes\x20to:')+'\x20'+_0x3933a1),console[_0x4fc34a(0x182)]('─'['repeat'](0x3c)),console[_0x4fc34a(0x182)](_0x25a7b9[_0x4fc34a(0x1a1)]),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}if(_0x189654[_0x4fc34a(0x1f9)]>0x0)for(const _0x38c8b7 of _0x189654){const _0x5b83bc=_0x38c8b7[_0x4fc34a(0x1f5)]?_0x38c8b7[_0x4fc34a(0x1f5)]+'/'+_0x38c8b7[_0x4fc34a(0x184)][_0x4fc34a(0x181)]:_0x38c8b7['yamlConfig'][_0x4fc34a(0x181)];console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70['green'](_0x4fc34a(0x1ac))+'\x20'+_0x5b83bc),console['error']('─'['repeat'](0x3c)),_0x38c8b7[_0x4fc34a(0x1a1)]&&console['error'](_0x38c8b7['diff']),console[_0x4fc34a(0x182)]('─'['repeat'](0x3c));}const _0x2f9ae6=_0x5b444c['filter'](_0x795c81=>!_0x795c81[_0x4fc34a(0x169)]&&_0x795c81['diff']);if(_0x2f9ae6[_0x4fc34a(0x1f9)]>0x0)for(const _0x1b9e2a of _0x2f9ae6){const _0x3c4a3c=_0x1b9e2a[_0x4fc34a(0x1f5)]?_0x1b9e2a[_0x4fc34a(0x1f5)]+'/'+_0x1b9e2a[_0x4fc34a(0x184)]['name']:_0x1b9e2a[_0x4fc34a(0x184)][_0x4fc34a(0x181)];console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70['yellow'](_0x4fc34a(0x19a))+'\x20'+_0x3c4a3c),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c)),console[_0x4fc34a(0x182)](_0x1b9e2a[_0x4fc34a(0x1a1)]),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}if(_0x503a92['length']>0x0)for(const _0x4e1c79 of _0x503a92){const _0xa534a2=_0x4e1c79[_0x4fc34a(0x19b)]?_0x61301[_0x4fc34a(0x1ec)](_0x4e1c79[_0x4fc34a(0x19b)])||'':'',_0xb52e84=_0xa534a2?_0xa534a2+'/'+_0x4e1c79['journeyBundleName']:_0x4e1c79[_0x4fc34a(0x1a9)];console['error']('\x0a'+a31_0x48dc70[_0x4fc34a(0x1aa)](_0x4fc34a(0x1d3))+'\x20'+_0xb52e84),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c)),console['error'](a31_0x48dc70[_0x4fc34a(0x1aa)]('(Journey\x20will\x20be\x20deleted)')),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}if(_0x43932b[_0x4fc34a(0x1e8)])return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1f8)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x58b8d5=_0x43932b['journeysOnly']?![]:_0x1d65ab[_0x4fc34a(0x1f9)]>0x0||_0xbef61a[_0x4fc34a(0x1f9)]>0x0||_0x238904[_0x4fc34a(0x1f9)]>0x0,_0x495e4e=_0x189654[_0x4fc34a(0x1f9)]>0x0||_0x5089fa[_0x4fc34a(0x1f9)]>0x0||_0x503a92[_0x4fc34a(0x1f9)]>0x0,_0x26d0d0=_0x43932b['journeysOnly']?![]:_0x5b2cbe[_0x4fc34a(0x1f9)]>0x0,_0xe0e3f9=_0x6a75b4[_0x4fc34a(0x1f9)]>0x0;if(!_0x58b8d5&&!_0x495e4e&&!_0x26d0d0&&!_0xe0e3f9){const _0x53d487=_0x43932b['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x4fc34a(0x19e);console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x185)](_0x53d487));if(_0xfb5acd&&_0x587cbb[_0x4fc34a(0x1f9)]===0x1){const _0x33ff6a=_0x587cbb[0x0];if(_0x33ff6a[_0x4fc34a(0x1dc)]?.['id']){const _0xe9c92b=getConsoleNextUrl(_0x43932b[_0x4fc34a(0x1cb)],_0x4fc34a(0x189)+_0x321572+_0x4fc34a(0x195)+_0x33ff6a[_0x4fc34a(0x1dc)]['id']+_0x4fc34a(0x18a));console[_0x4fc34a(0x182)]('\x20\x20'+a31_0x48dc70[_0x4fc34a(0x1b9)](_0xe9c92b));}}return 0x0;}const _0x43008e=_0x43932b[_0x4fc34a(0x1a7)]?_0x189654['length']+_0x5089fa[_0x4fc34a(0x1f9)]+_0x503a92[_0x4fc34a(0x1f9)]+_0x6a75b4[_0x4fc34a(0x1f9)]:_0x1d65ab[_0x4fc34a(0x1f9)]+_0xbef61a[_0x4fc34a(0x1f9)]+_0x238904[_0x4fc34a(0x1f9)]+_0x189654[_0x4fc34a(0x1f9)]+_0x5089fa[_0x4fc34a(0x1f9)]+_0x503a92[_0x4fc34a(0x1f9)]+_0x6a75b4[_0x4fc34a(0x1f9)]+_0x5b2cbe[_0x4fc34a(0x1f9)];if(!_0x43932b[_0x4fc34a(0x1ff)]&&_0x43008e>0x0){const _0x4fe4af=await confirmKey(_0x4fc34a(0x1eb)+_0x43008e+_0x4fc34a(0x1ba));if(!_0x4fe4af)return console[_0x4fc34a(0x182)](_0x4fc34a(0x193)),0x1;}const _0xfcfed6={'withProgress':async(_0x183e6e,_0x1deb7d)=>{const _0x56d741=_0x4fc34a,_0x4c7c7b=await withSpinner(_0x183e6e,_0x1deb7d,{'verbose':_0x43932b['verbose']});return{'data':_0x4c7c7b[_0x56d741(0x1e6)]};},'logInfo':_0x5d7f8f=>console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x16a)]('✔\x20'+_0x5d7f8f)),'logSuccess':_0x1663d2=>console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x185)]('✔\x20'+_0x1663d2)),'logWarning':_0x4f7212=>console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1f8)]('⚠\x20'+_0x4f7212)),'logDeleted':_0x56936a=>console['error'](a31_0x48dc70[_0x4fc34a(0x1aa)]('✔\x20'+_0x56936a))},_0x1dc4ad={'segment':_0x2ad664[_0x4fc34a(0x199)],'journey':_0x2ad664[_0x4fc34a(0x1df)],'user':_0x2ad664[_0x4fc34a(0x1a4)],'connection':_0x2ad664[_0x4fc34a(0x1c9)]};_0x6a75b4[_0x4fc34a(0x1f9)]>0x0&&(_0x77b1f6=await executePushFolders(_0x1dc4ad,_0x6a75b4,_0x77b1f6,{'parentId':_0x321572},_0xfcfed6));const _0x41bbd7={'rootFolderId':_0x150c34,'folderPathToId':_0x77b1f6,'folderIdToPath':_0x61301,'segmentNameToId':_0x36fc4b,'activationsBySegmentId':_0x19ebc9,'emailToIdMap':_0x5b39d9,'idToEmailMap':_0x434486,'connectionNameToIdMap':_0x40098a[_0x4fc34a(0x1be)],'connectionIdToNameMap':_0x40098a[_0x4fc34a(0x1ca)],'connectionNameToTypeMap':_0x3193db},_0x55cfdf=await executePushSegments(_0x1dc4ad,_0x43932b[_0x4fc34a(0x1a7)]?[]:_0x3ab41c,_0x41bbd7,{'parentId':_0x321572},_0xfcfed6),_0x1295bc=_0x55cfdf[_0x4fc34a(0x176)],_0x2ec254=_0x55cfdf[_0x4fc34a(0x198)],_0x35011f=_0x55cfdf[_0x4fc34a(0x1dd)]['created'],_0x27416f=_0x55cfdf[_0x4fc34a(0x1dd)][_0x4fc34a(0x198)],_0x4f2fba=_0x55cfdf[_0x4fc34a(0x1dd)][_0x4fc34a(0x1a3)],_0x1ae4df=await executePushSegmentDeletions(_0x1dc4ad,_0x43932b[_0x4fc34a(0x1a7)]?[]:_0x238904,_0xfcfed6);let _0x7a65fc=0x0,_0x1bb6fb=0x0,_0x123d78=0x0;const _0xbcc32a=new Map(_0x36fc4b);for(const [_0x37d50e,_0x5b4168]of _0x55cfdf[_0x4fc34a(0x16b)]){_0xbcc32a[_0x4fc34a(0x1c5)](_0x37d50e,_0x5b4168);}if(_0x5b444c['length']>0x0){const _0x248342={..._0x41bbd7,'segmentNameToId':_0xbcc32a,'existingSegments':_0x4e9626,'activationContext':_0xc031ec},_0x162fed=await executePushJourneys(_0x1dc4ad,_0x5b444c,_0x248342,{'parentId':_0x321572,'rootFolderId':_0x150c34,'verbose':_0x43932b[_0x4fc34a(0x187)]},_0xfcfed6);_0x7a65fc=_0x162fed[_0x4fc34a(0x176)],_0x1bb6fb=_0x162fed[_0x4fc34a(0x198)];if(_0xfb5acd&&_0x162fed[_0x4fc34a(0x1fc)]['length']===0x1){const _0xb7f1db=_0x162fed[_0x4fc34a(0x1fc)][0x0];if(_0xb7f1db[_0x4fc34a(0x1b4)]){const _0x38568e=getConsoleNextUrl(_0x43932b[_0x4fc34a(0x1cb)],'/app/ps/'+_0x321572+_0x4fc34a(0x195)+_0xb7f1db[_0x4fc34a(0x1b4)]+'/j/da/je');console[_0x4fc34a(0x182)]('\x20\x20'+a31_0x48dc70[_0x4fc34a(0x1b9)](_0x38568e));}}}for(const _0x4b1666 of _0x503a92){console['error'](a31_0x48dc70[_0x4fc34a(0x1f8)](_0x4fc34a(0x1d6)+_0x4b1666[_0x4fc34a(0x1a9)])),_0x123d78++;}const _0x500be5=[];if(_0x1295bc>0x0)_0x500be5['push'](_0x1295bc+'\x20created');if(_0x2ec254>0x0)_0x500be5['push'](_0x2ec254+_0x4fc34a(0x197));if(_0x1ae4df>0x0)_0x500be5[_0x4fc34a(0x1bf)](_0x1ae4df+_0x4fc34a(0x1a0));const _0x226140=[];if(_0x7a65fc>0x0)_0x226140[_0x4fc34a(0x1bf)](_0x7a65fc+_0x4fc34a(0x1f7));if(_0x1bb6fb>0x0)_0x226140[_0x4fc34a(0x1bf)](_0x1bb6fb+'\x20updated');if(_0x123d78>0x0)_0x226140['push'](_0x123d78+_0x4fc34a(0x1a0));const _0x194e90=[];if(_0x35011f>0x0)_0x194e90[_0x4fc34a(0x1bf)](_0x35011f+_0x4fc34a(0x1f7));if(_0x27416f>0x0)_0x194e90[_0x4fc34a(0x1bf)](_0x27416f+'\x20updated');if(_0x4f2fba>0x0)_0x194e90[_0x4fc34a(0x1bf)](_0x4f2fba+_0x4fc34a(0x1a0));return console['error'](a31_0x48dc70['green'](_0x4fc34a(0x19c))),_0x500be5[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b['journeysOnly']&&console[_0x4fc34a(0x182)](_0x4fc34a(0x192)+_0x500be5[_0x4fc34a(0x1cf)](',\x20')),_0x226140[_0x4fc34a(0x1f9)]>0x0&&console[_0x4fc34a(0x182)]('\x20\x20Journeys:\x20'+_0x226140[_0x4fc34a(0x1cf)](',\x20')),_0x194e90['length']>0x0&&!_0x43932b[_0x4fc34a(0x1a7)]&&console[_0x4fc34a(0x182)](_0x4fc34a(0x1ad)+_0x194e90[_0x4fc34a(0x1cf)](',\x20')),0x0;}}
|
|
1
|
+
const a31_0x625ab3=a31_0x1f3d;(function(_0x17070a,_0x15db42){const _0x167ea4=a31_0x1f3d,_0x18bd36=_0x17070a();while(!![]){try{const _0xca1da4=-parseInt(_0x167ea4(0x23c))/0x1+-parseInt(_0x167ea4(0x1eb))/0x2*(parseInt(_0x167ea4(0x23a))/0x3)+parseInt(_0x167ea4(0x21d))/0x4*(parseInt(_0x167ea4(0x1f4))/0x5)+-parseInt(_0x167ea4(0x1fa))/0x6+-parseInt(_0x167ea4(0x211))/0x7+parseInt(_0x167ea4(0x236))/0x8*(-parseInt(_0x167ea4(0x1c4))/0x9)+parseInt(_0x167ea4(0x21c))/0xa;if(_0xca1da4===_0x15db42)break;else _0x18bd36['push'](_0x18bd36['shift']());}catch(_0x1dcc85){_0x18bd36['push'](_0x18bd36['shift']());}}}(a31_0x214c,0xef342));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 a31_0x460526 from'chalk';function a31_0x214c(){const _0x4db2fa=['Resolving\x20parent\x20segment\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Segments:\x20','nameToId','new','user','getJourney','data','push','\x20\x20Activations:','journeys','.yaml','createdSegmentIds','diff','results','\x20\x20\x20\x20','name','toUpdate','message','7905033sRVOrT','/j/da/je','green','\x20updated','journeyBundleId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Changes\x20to:','paused','Error:\x20','unchanged','\x20\x20🗺️\x20\x20Journeys:','dim','journeysOnly','add','\x20to\x20create','getParent','segmentFolderId','createdAt','parentName','file','New\x20journey:','toDelete','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20to\x20delete','no_parent','folderPath','errorCode','segment:push','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20created','parentSegment','Changes\x20to\x20journey:','join','isNew','type','blue','\x20new','\x20YAML\x20files\x20found','set','2HKjyJB','\x20changed','📁\x20','filter','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)','idToName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','red','error','90gdsuTz','execute','Fetching\x20existing\x20activations...','activations','setPhase','/app/ps/','9408990lBOclW','verbose','Delete\x20segment:','Fetching\x20users\x20for\x20email\x20resolution...','list','Site:\x20','folders','segments','journeyBundleName','(Journey\x20will\x20be\x20deleted)','\x0aValidation\x20failed:','\x20changes?','updated','toString','\x20deleted','parent_name','listFolders','/e/','filePath','all','changed','resolveParentId','segment\x20or\x20journey','5702753vPegOd','site','then','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','getOutputSchemaWithCache','audienceId','Scoped\x20to\x20folder:\x20','listSegments','yellow','repeat','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','53260930lZgNSM','323488UzoIMQ','\x20activations]','state','delete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','folderId','map','existingJourney','journeyId','\x20unchanged','Folders\x20to\x20create:','length','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x27...','dryRun','deleted','\x20to\x20update','Parent\x20segment:\x20','nameToType','segment','connection','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','8KrFtsL','description','\x0aPush\x20summary\x20for\x20\x27','\x20folders\x20to\x20create','2856369UsUDkK','New\x20segment:','1588707MzVkIF','\x20\x20Journeys:\x20','created','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Source:\x20','listJourneysWithDetailsFromParentSegment','cyan','Source\x20directory:\x20','Preparing\x20journeys...','attributes','Error:\x20Directory\x20not\x20found:\x20','yamlConfig','Push\x20','relationships','get','helpText','Fetching\x20existing\x20folders...'];a31_0x214c=function(){return _0x4db2fa;};return a31_0x214c();}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0x1f3d(_0x3ed3bd,_0x2a6633){_0x3ed3bd=_0x3ed3bd-0x1bd;const _0x214c81=a31_0x214c();let _0x1f3d56=_0x214c81[_0x3ed3bd];return _0x1f3d56;}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x625ab3(0x1c1)]=a31_0x625ab3(0x1df);[a31_0x625ab3(0x237)]=a31_0x625ab3(0x1da);async[a31_0x625ab3(0x1f5)](_0x27af5d){const _0x442e75=a31_0x625ab3,{options:_0x6307bf,args:_0x15d764,tdx:_0x6ed082}=_0x27af5d,_0x3559f0=_0x6307bf,_0x39499c=await resolveTarget({'arg':_0x15d764[0x0],'contextParent':_0x6307bf[_0x442e75(0x1e2)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x39499c))return _0x39499c[_0x442e75(0x1de)]===_0x442e75(0x1dc)?(console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x1c9))),console['error'](_0x442e75(0x1ef)),console[_0x442e75(0x1f3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x442e75(0x1f3)](_0x442e75(0x214))):(console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x1cc)+_0x39499c[_0x442e75(0x1c3)]+'\x0a')),_0x39499c[_0x442e75(0x24b)]&&console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x242)](_0x39499c[_0x442e75(0x24b)]))),0x1;if(_0x39499c[_0x442e75(0x1e6)]===_0x442e75(0x209))return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x246)+_0x39499c['targetDir']+'\x0a')),console[_0x442e75(0x1f3)](a31_0x460526['cyan'](_0x442e75(0x22a))),0x1;const _0x25fa43=_0x39499c[_0x442e75(0x1d6)],_0x2c29ea=_0x39499c['targetDir'],_0x40056b=_0x39499c['type']===_0x442e75(0x1d7)?_0x39499c[_0x442e75(0x20c)]:undefined,_0xc6b29f=getScopedDetails(_0x39499c),_0x4e4612=_0xc6b29f?.['isScoped']??![],_0x3a704d=_0xc6b29f?.['scopedFolderPath']??'';if(!existsSync(_0x2c29ea))return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x246)+_0x2c29ea+'\x0a')),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x242)](_0x442e75(0x22a))),0x1;_0x3559f0[_0x442e75(0x1fb)]&&(console['error'](_0x442e75(0x1ff)+_0x3559f0[_0x442e75(0x212)]),console['error'](_0x442e75(0x22f)+_0x25fa43),console[_0x442e75(0x1f3)](_0x442e75(0x243)+_0x2c29ea),_0x4e4612&&console['error'](_0x442e75(0x217)+_0x3a704d));const _0x2462b8=await withSpinner(_0x442e75(0x24d)+_0x25fa43+_0x442e75(0x22b),()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x20f)](_0x25fa43),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),_0x4125d0=_0x2462b8[_0x442e75(0x254)],[_0x210c2d,_0x5b0fea,_0x1b1a2c,_0x232479,_0x2a3ee8]=await Promise[_0x442e75(0x20d)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x6ed082['segment'][_0x442e75(0x1d3)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x218)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner(_0x442e75(0x24c),()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x20a)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x6ed082['journey'][_0x442e75(0x241)](_0x4125d0,{'includeAllVersions':!![]}),{'verbose':_0x3559f0['verbose']}),withSpinner(_0x442e75(0x1fd),()=>_0x6ed082[_0x442e75(0x252)]['buildUserMaps'](),{'verbose':_0x3559f0[_0x442e75(0x1fb)]})['then'](_0x2a43b6=>_0x2a43b6[_0x442e75(0x254)])]),_0x324575=_0x210c2d[_0x442e75(0x254)],_0x2675be=extractRootFolderId(_0x324575),_0x3df0f4=_0x5b0fea['data'],_0x2ae49f=_0x1b1a2c[_0x442e75(0x254)],{journeys:_0x17a6f4,activationStepsById:_0x40be6f}=_0x232479['data'],_0x18bdcd=new Map(_0x17a6f4[_0x442e75(0x224)](_0x2891bb=>[_0x2891bb['id'],_0x2891bb])),_0x98fabf=_0x17a6f4['map'](_0xd1e852=>({'id':_0xd1e852['id'],'name':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1c1)],'journeyBundleName':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x202)]||'','journeyBundleId':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1c8)]||'','versionNumber':_0xd1e852[_0x442e75(0x245)]['versionNumber'],'description':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x237)],'state':_0xd1e852['attributes'][_0x442e75(0x21f)],'paused':_0xd1e852['attributes'][_0x442e75(0x1cb)],'audienceId':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x216)],'folderId':_0xd1e852[_0x442e75(0x249)]?.['parentFolder']?.[_0x442e75(0x254)]?.['id'],'createdAt':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1d5)],'updatedAt':_0xd1e852[_0x442e75(0x245)]['updatedAt']})),{emailToId:_0x1c071a,idToEmail:_0x2511fb}=_0x2a3ee8,_0xf99f15=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x4d4962=_0x442e75,_0x31de26=await _0x6ed082[_0x4d4962(0x232)][_0x4d4962(0x1fe)]();return buildConnectionMaps(_0x31de26);},{'verbose':_0x3559f0['verbose']})[_0x442e75(0x213)](_0x3fd3c0=>_0x3fd3c0[_0x442e75(0x254)]),_0x2aa561=_0xf99f15['nameToId'],_0x551e17=_0xf99f15[_0x442e75(0x1f0)],_0xf9bea7=_0xf99f15[_0x442e75(0x230)],_0x4f4722={'emailToIdMap':_0x1c071a,'connectionNameToIdMap':_0x2aa561,'connectionNameToTypeMap':_0xf9bea7,'getSchema':_0x199721=>_0x6ed082[_0x442e75(0x232)][_0x442e75(0x215)](_0x199721)};let {pathToId:_0x3ab026,idToPath:_0x164f3c}=buildFolderMaps(_0x2ae49f);const _0x429a9d=buildSegmentLookupMap(_0x3df0f4,_0x164f3c),_0x4c8fa9=buildSegmentNameToIdMap(_0x3df0f4),_0x541252=buildJourneyBundleLookupMap(_0x98fabf,_0x164f3c);let _0x137222;if(_0x40056b){if(!_0x40056b['endsWith']('.yml')&&!_0x40056b['endsWith'](_0x442e75(0x258)))return console['error'](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x221)+_0x40056b+'\x0a')),0x1;_0x137222=[_0x40056b];}else _0x137222=findYamlFiles(_0x2c29ea);if(_0x137222['length']===0x0)return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x235)+_0x2c29ea+'\x0a')),console['error'](a31_0x460526['cyan'](_0x442e75(0x1e0))),0x1;let _0x69fe46,_0x5a7250;try{const _0x4ddbfd=parseAndClassifyYamlFiles(_0x137222,_0x2c29ea,{'skipSegments':_0x3559f0[_0x442e75(0x1d0)]});_0x69fe46=_0x4ddbfd['segments'],_0x5a7250=_0x4ddbfd[_0x442e75(0x257)];const _0x2740dc=validateParsedFiles(_0x4ddbfd,_0x2c29ea);if(_0x2740dc[_0x442e75(0x229)]>0x0)return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x204))),console['error'](formatValidationErrors(_0x2740dc)),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x233))),0x1;}catch(_0x1ad06e){return console['error'](a31_0x460526[_0x442e75(0x1f2)]('Error\x20parsing\x20YAML:\x20'+(_0x1ad06e instanceof Error?_0x1ad06e[_0x442e75(0x1c3)]:_0x1ad06e))),0x1;}if(_0x69fe46[_0x442e75(0x229)]===0x0&&_0x5a7250[_0x442e75(0x229)]===0x0){const _0xb93bf9=_0x3559f0['journeysOnly']?_0x442e75(0x234):_0x442e75(0x210);return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)]('No\x20'+_0xb93bf9+_0x442e75(0x1e9))),0x0;}const _0x118a94=new Map();_0x3df0f4[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&await withSpinner(_0x442e75(0x1f6),async()=>{await batchAsync(_0x3df0f4,async _0x4adb04=>{const _0x5830e9=a31_0x1f3d,_0xb8bc1=await _0x6ed082[_0x5830e9(0x231)]['listActivations'](_0x4125d0,_0x4adb04['id']);_0x118a94[_0x5830e9(0x1ea)](_0x4adb04['id'],_0xb8bc1);});},{'verbose':_0x3559f0['verbose']});const {segmentFiles:_0x8f1aa1,foldersToCreate:_0x23cec8}=await prepareSegmentFiles(_0x69fe46,{'segmentByFolderAndName':_0x429a9d,'activationsBySegmentId':_0x118a94,'folderPathToId':_0x3ab026,'idToEmailMap':_0x2511fb,'connectionIdToNameMap':_0x551e17},_0x4f4722,_0x4e4612,_0x3a704d),_0xb4b40e=_0x40056b?[]:findSegmentsToDelete(_0x3df0f4,_0x69fe46[_0x442e75(0x224)](({yamlConfig:_0x435e53,folderPath:_0xcaa047})=>({'yamlConfig':_0x435e53,'folderPath':resolveTDFolderPath(_0xcaa047,_0x4e4612,_0x3a704d)})),_0x164f3c,_0x3a704d,_0x4e4612),{journeyFiles:_0xfc62b0,foldersToCreate:_0x775ebe}=await withProgressSpinner(_0x442e75(0x244),async _0x1df54e=>prepareJourneyFiles(_0x5a7250,{'fetchJourney':async _0x178e4d=>_0x6ed082[_0x442e75(0x234)][_0x442e75(0x253)](_0x178e4d['journeyId']),'journeyBundlesByFolderAndName':_0x541252,'folderPathToId':_0x3ab026,'idToEmailMap':_0x2511fb,'connectionIdToNameMap':_0x551e17,'existingSegments':_0x3df0f4,'parentId':_0x4125d0,'deps':_0x6ed082,'progress':{'update':_0x23f539=>{const _0x3ecc90=_0x442e75;_0x1df54e[_0x3ecc90(0x1f8)](_0x23f539),_0x3559f0[_0x3ecc90(0x1fb)]&&console[_0x3ecc90(0x1f3)]('\x20\x20'+_0x23f539);}},'journeyById':_0x18bdcd,'activationStepsById':_0x40be6f},_0x4e4612,_0x3a704d),{'verbose':_0x3559f0[_0x442e75(0x1fb)]})['then'](_0x5a0c1d=>_0x5a0c1d['data']);for(const _0x23097c of _0x775ebe){_0x23cec8[_0x442e75(0x1d1)](_0x23097c);}const _0x306724=_0x40056b?[]:findJourneysToDelete(_0x98fabf,_0x5a7250[_0x442e75(0x224)](({yamlConfig:_0x43aeed,folderPath:_0x21bb8b})=>({'yamlConfig':_0x43aeed,'folderPath':resolveTDFolderPath(_0x21bb8b,_0x4e4612,_0x3a704d)})),_0x164f3c,_0x3a704d,_0x4e4612),_0xd40c5=calculatePushStats(_0x8f1aa1,_0xfc62b0,_0x23cec8,_0xb4b40e,_0x306724,!!_0x3559f0[_0x442e75(0x220)],!!_0x3559f0[_0x442e75(0x1d0)]),_0x3b2ce7=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x251)],_0x221901=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x20e)],_0x371ec2=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x1cd)],_0x2c1310=_0xd40c5['segments'][_0x442e75(0x1d9)],_0x56cb34=_0xd40c5[_0x442e75(0x200)]['toCreate'],_0x1cbb81=_0xd40c5[_0x442e75(0x257)][_0x442e75(0x251)],_0x272eb5=_0xd40c5['journeys'][_0x442e75(0x20e)],_0x44917d=_0xd40c5['journeys']['unchanged'],_0x2cd0f4=_0xd40c5['journeys']['toDelete'],_0x2e0acb=_0xd40c5[_0x442e75(0x1f7)][_0x442e75(0x20d)],_0x5d6aee=_0xd40c5[_0x442e75(0x1f7)]['toCreate'],_0x3e510a=_0xd40c5[_0x442e75(0x1f7)][_0x442e75(0x1c2)],_0x1b3316=_0xd40c5['activations'][_0x442e75(0x1d9)];console[_0x442e75(0x1f3)](_0x442e75(0x238)+_0x25fa43+'\x27:');_0x56cb34[_0x442e75(0x229)]>0x0&&console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x1e7)](_0x442e75(0x1ed)+_0x56cb34[_0x442e75(0x229)]+_0x442e75(0x239)));if(!_0x3559f0[_0x442e75(0x1d0)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x3b2ce7[_0x442e75(0x229)]+_0x442e75(0x1e8))),console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x219)]('~\x20'+_0x221901['length']+_0x442e75(0x1ec)));if(_0x2c1310[_0x442e75(0x229)]>0x0)console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x2c1310[_0x442e75(0x229)]+_0x442e75(0x1db)));else _0xb4b40e['length']>0x0&&!_0x3559f0[_0x442e75(0x220)]&&console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)](_0xb4b40e[_0x442e75(0x229)]+_0x442e75(0x222)));console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)]('=\x20'+_0x371ec2[_0x442e75(0x229)]+_0x442e75(0x227)));}if(_0xfc62b0[_0x442e75(0x229)]>0x0||_0x306724[_0x442e75(0x229)]>0x0){console[_0x442e75(0x1f3)](_0x442e75(0x1ce)),console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x1cbb81[_0x442e75(0x229)]+_0x442e75(0x1e8))),console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x219)]('~\x20'+_0x272eb5[_0x442e75(0x229)]+_0x442e75(0x1ec)));if(_0x2cd0f4[_0x442e75(0x229)]>0x0)console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x2cd0f4[_0x442e75(0x229)]+_0x442e75(0x1db)));else _0x306724[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x220)]&&console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)](_0x306724[_0x442e75(0x229)]+_0x442e75(0x222)));console['error']('\x20\x20\x20\x20'+a31_0x460526['dim']('=\x20'+_0x44917d[_0x442e75(0x229)]+'\x20unchanged'));}_0x2e0acb[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&(console['error'](''),console[_0x442e75(0x1f3)](_0x442e75(0x256)),_0x5d6aee[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x5d6aee[_0x442e75(0x229)]+_0x442e75(0x1d2))),_0x3e510a[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526['yellow']('~\x20'+_0x3e510a['length']+_0x442e75(0x22e))),_0x1b3316[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x1b3316['length']+_0x442e75(0x1db))));console['error'](_0x442e75(0x240)+a31_0x460526['cyan'](_0x2c29ea)+'\x0a');if(_0x56cb34[_0x442e75(0x229)]>0x0){console[_0x442e75(0x1f3)](_0x442e75(0x228));for(const _0x217bf6 of _0x56cb34){console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x1e7)]('+')+'\x20'+_0x217bf6);}console[_0x442e75(0x1f3)]('');}if(_0x3b2ce7['length']>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x2d1ac3 of _0x3b2ce7){const _0x384f99=_0x2d1ac3[_0x442e75(0x1dd)]?_0x2d1ac3['folderPath']+'/'+_0x2d1ac3[_0x442e75(0x247)]['name']:_0x2d1ac3[_0x442e75(0x247)][_0x442e75(0x1c1)],_0x44a7b4=_0x2d1ac3['yamlConfig']['activations']?.[_0x442e75(0x229)]||0x0,_0x48b689=_0x44a7b4>0x0?a31_0x460526['dim']('\x20['+_0x44a7b4+_0x442e75(0x21e)):'';console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x1c6)](_0x442e75(0x23b))+'\x20'+_0x384f99+_0x48b689),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),_0x2d1ac3[_0x442e75(0x1be)]&&console[_0x442e75(0x1f3)](_0x2d1ac3[_0x442e75(0x1be)]),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}if(_0x2c1310[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x3e7a32 of _0x2c1310){const _0x28d7fd=_0x3e7a32['segmentFolderId']?_0x164f3c[_0x442e75(0x24a)](_0x3e7a32[_0x442e75(0x1d4)][_0x442e75(0x207)]())||'':'',_0x1e257b=_0x28d7fd?_0x28d7fd+'/'+_0x3e7a32[_0x442e75(0x1c1)]:_0x3e7a32[_0x442e75(0x1c1)],_0x407ed4=_0x118a94[_0x442e75(0x24a)](_0x3e7a32['id'])||[],_0x3417c5=_0x407ed4[_0x442e75(0x229)]>0x0?a31_0x460526[_0x442e75(0x1cf)]('\x20['+_0x407ed4[_0x442e75(0x229)]+_0x442e75(0x21e)):'';console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526['red'](_0x442e75(0x1fc))+'\x20'+_0x1e257b+_0x3417c5),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));const _0x2bd1e9=segmentWithActivationsToYaml(_0x3e7a32,_0x407ed4,undefined,_0x2511fb,_0x551e17),_0x3effb9=segmentToYamlString(_0x2bd1e9),_0x7e8839=generateDiff(_0x3effb9,'');console[_0x442e75(0x1f3)](formatDiffWithColors(_0x7e8839)),console[_0x442e75(0x1f3)]('─'['repeat'](0x3c));}const _0x4f64af=_0x8f1aa1[_0x442e75(0x1ee)](_0x2fd02e=>!_0x2fd02e[_0x442e75(0x1e5)]&&_0x2fd02e[_0x442e75(0x1be)]);if(_0x4f64af['length']>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x27a756 of _0x4f64af){const _0x569598=_0x27a756['folderPath']?_0x27a756[_0x442e75(0x1dd)]+'/'+_0x27a756['yamlConfig'][_0x442e75(0x1c1)]:_0x27a756[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526['yellow'](_0x442e75(0x1ca))+'\x20'+_0x569598),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](_0x27a756[_0x442e75(0x1be)]),console['error']('─'[_0x442e75(0x21a)](0x3c));}if(_0x1cbb81[_0x442e75(0x229)]>0x0)for(const _0x2f4ba4 of _0x1cbb81){const _0x57ae3a=_0x2f4ba4[_0x442e75(0x1dd)]?_0x2f4ba4['folderPath']+'/'+_0x2f4ba4[_0x442e75(0x247)][_0x442e75(0x1c1)]:_0x2f4ba4[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x1c6)](_0x442e75(0x1d8))+'\x20'+_0x57ae3a),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),_0x2f4ba4[_0x442e75(0x1be)]&&console[_0x442e75(0x1f3)](_0x2f4ba4[_0x442e75(0x1be)]),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}const _0x48f748=_0xfc62b0[_0x442e75(0x1ee)](_0xb20d0d=>!_0xb20d0d[_0x442e75(0x1e5)]&&_0xb20d0d[_0x442e75(0x1be)]);if(_0x48f748[_0x442e75(0x229)]>0x0)for(const _0x44f9ab of _0x48f748){const _0x4497f6=_0x44f9ab['folderPath']?_0x44f9ab[_0x442e75(0x1dd)]+'/'+_0x44f9ab[_0x442e75(0x247)][_0x442e75(0x1c1)]:_0x44f9ab[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x219)](_0x442e75(0x1e3))+'\x20'+_0x4497f6),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](_0x44f9ab[_0x442e75(0x1be)]),console['error']('─'[_0x442e75(0x21a)](0x3c));}if(_0x2cd0f4[_0x442e75(0x229)]>0x0)for(const _0x571834 of _0x2cd0f4){const _0xb7302c=_0x571834[_0x442e75(0x223)]?_0x164f3c['get'](_0x571834['folderId'])||'':'',_0x3781b2=_0xb7302c?_0xb7302c+'/'+_0x571834[_0x442e75(0x202)]:_0x571834[_0x442e75(0x202)];console['error']('\x0a'+a31_0x460526[_0x442e75(0x1f2)]('Delete\x20journey:')+'\x20'+_0x3781b2),console['error']('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x203))),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}if(_0x3559f0[_0x442e75(0x22c)])return console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x24e))),0x0;const _0x4d2f72=_0x3559f0[_0x442e75(0x1d0)]?![]:_0x3b2ce7[_0x442e75(0x229)]>0x0||_0x221901['length']>0x0||_0x2c1310[_0x442e75(0x229)]>0x0,_0x1ea4f4=_0x1cbb81[_0x442e75(0x229)]>0x0||_0x272eb5[_0x442e75(0x229)]>0x0||_0x2cd0f4[_0x442e75(0x229)]>0x0,_0x2d2fa7=_0x3559f0['journeysOnly']?![]:_0x2e0acb[_0x442e75(0x229)]>0x0,_0xb4c0a9=_0x56cb34['length']>0x0;if(!_0x4d2f72&&!_0x1ea4f4&&!_0x2d2fa7&&!_0xb4c0a9){const _0x1d3a27=_0x3559f0[_0x442e75(0x1d0)]?_0x442e75(0x1f1):_0x442e75(0x23f);console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1c6)](_0x1d3a27));if(_0x40056b&&_0x44917d['length']===0x1){const _0x44c5d0=_0x44917d[0x0];if(_0x44c5d0[_0x442e75(0x225)]?.['id']){const _0x191e96=getConsoleNextUrl(_0x3559f0['site'],_0x442e75(0x1f9)+_0x4125d0+_0x442e75(0x20b)+_0x44c5d0[_0x442e75(0x225)]['id']+_0x442e75(0x1c5));console['error']('\x20\x20'+a31_0x460526[_0x442e75(0x242)](_0x191e96));}}return 0x0;}const _0x152b4c=_0x3559f0[_0x442e75(0x1d0)]?_0x1cbb81['length']+_0x272eb5[_0x442e75(0x229)]+_0x2cd0f4[_0x442e75(0x229)]+_0x56cb34['length']:_0x3b2ce7[_0x442e75(0x229)]+_0x221901['length']+_0x2c1310[_0x442e75(0x229)]+_0x1cbb81[_0x442e75(0x229)]+_0x272eb5[_0x442e75(0x229)]+_0x2cd0f4[_0x442e75(0x229)]+_0x56cb34['length']+_0x2e0acb[_0x442e75(0x229)];if(!_0x3559f0['yes']&&_0x152b4c>0x0){const _0x42dd88=await confirmKey(_0x442e75(0x248)+_0x152b4c+_0x442e75(0x205));if(!_0x42dd88)return console[_0x442e75(0x1f3)]('Aborted.'),0x1;}const _0x1bd359={'withProgress':async(_0x34d816,_0x41455d)=>{const _0x52520d=_0x442e75,_0x348d76=await withSpinner(_0x34d816,_0x41455d,{'verbose':_0x3559f0[_0x52520d(0x1fb)]});return{'data':_0x348d76[_0x52520d(0x254)]};},'logInfo':_0x3bdfa6=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1e7)]('✔\x20'+_0x3bdfa6)),'logSuccess':_0x26f254=>console['error'](a31_0x460526[_0x442e75(0x1c6)]('✔\x20'+_0x26f254)),'logWarning':_0x49e693=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)]('⚠\x20'+_0x49e693)),'logDeleted':_0x144b5c=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)]('✔\x20'+_0x144b5c))},_0x4fb15e={'segment':_0x6ed082[_0x442e75(0x231)],'journey':_0x6ed082[_0x442e75(0x234)],'user':_0x6ed082[_0x442e75(0x252)],'connection':_0x6ed082[_0x442e75(0x232)]};_0x56cb34[_0x442e75(0x229)]>0x0&&(_0x3ab026=await executePushFolders(_0x4fb15e,_0x56cb34,_0x3ab026,{'parentId':_0x4125d0},_0x1bd359));const _0x25bdbe={'rootFolderId':_0x2675be,'folderPathToId':_0x3ab026,'folderIdToPath':_0x164f3c,'segmentNameToId':_0x4c8fa9,'activationsBySegmentId':_0x118a94,'emailToIdMap':_0x1c071a,'idToEmailMap':_0x2511fb,'connectionNameToIdMap':_0xf99f15[_0x442e75(0x250)],'connectionIdToNameMap':_0xf99f15[_0x442e75(0x1f0)],'connectionNameToTypeMap':_0xf9bea7},_0x1e832f=await executePushSegments(_0x4fb15e,_0x3559f0['journeysOnly']?[]:_0x8f1aa1,_0x25bdbe,{'parentId':_0x4125d0},_0x1bd359),_0x2ce961=_0x1e832f[_0x442e75(0x23e)],_0x23cfdf=_0x1e832f[_0x442e75(0x206)],_0x29938d=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x23e)],_0x41b1ee=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x206)],_0x3ad44f=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x22d)],_0x1873e4=await executePushSegmentDeletions(_0x4fb15e,_0x3559f0['journeysOnly']?[]:_0x2c1310,_0x1bd359);let _0x316c79=0x0,_0x404128=0x0,_0x477aec=0x0;const _0x2af236=new Map(_0x4c8fa9);for(const [_0x53796d,_0x5204d2]of _0x1e832f[_0x442e75(0x1bd)]){_0x2af236[_0x442e75(0x1ea)](_0x53796d,_0x5204d2);}if(_0xfc62b0[_0x442e75(0x229)]>0x0){const _0x14dacb={..._0x25bdbe,'segmentNameToId':_0x2af236,'existingSegments':_0x3df0f4,'activationContext':_0x4f4722},_0x189092=await executePushJourneys(_0x4fb15e,_0xfc62b0,_0x14dacb,{'parentId':_0x4125d0,'rootFolderId':_0x2675be,'verbose':_0x3559f0[_0x442e75(0x1fb)]},_0x1bd359);_0x316c79=_0x189092['created'],_0x404128=_0x189092['updated'];if(_0x40056b&&_0x189092[_0x442e75(0x1bf)][_0x442e75(0x229)]===0x1){const _0x1e46c3=_0x189092[_0x442e75(0x1bf)][0x0];if(_0x1e46c3[_0x442e75(0x226)]){const _0x38139a=getConsoleNextUrl(_0x3559f0[_0x442e75(0x212)],_0x442e75(0x1f9)+_0x4125d0+_0x442e75(0x20b)+_0x1e46c3['journeyId']+_0x442e75(0x1c5));console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x242)](_0x38139a));}}}for(const _0x2e6a64 of _0x2cd0f4){console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x21b)+_0x2e6a64['journeyBundleName'])),_0x477aec++;}const _0x15be24=[];if(_0x2ce961>0x0)_0x15be24['push'](_0x2ce961+_0x442e75(0x1e1));if(_0x23cfdf>0x0)_0x15be24['push'](_0x23cfdf+'\x20updated');if(_0x1873e4>0x0)_0x15be24[_0x442e75(0x255)](_0x1873e4+_0x442e75(0x208));const _0xefbbba=[];if(_0x316c79>0x0)_0xefbbba[_0x442e75(0x255)](_0x316c79+'\x20created');if(_0x404128>0x0)_0xefbbba[_0x442e75(0x255)](_0x404128+_0x442e75(0x1c7));if(_0x477aec>0x0)_0xefbbba[_0x442e75(0x255)](_0x477aec+_0x442e75(0x208));const _0x595a25=[];if(_0x29938d>0x0)_0x595a25[_0x442e75(0x255)](_0x29938d+_0x442e75(0x1e1));if(_0x41b1ee>0x0)_0x595a25[_0x442e75(0x255)](_0x41b1ee+_0x442e75(0x1c7));if(_0x3ad44f>0x0)_0x595a25['push'](_0x3ad44f+_0x442e75(0x208));return console['error'](a31_0x460526[_0x442e75(0x1c6)]('\x0a✔\x20Push\x20complete')),_0x15be24[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&console['error'](_0x442e75(0x24f)+_0x15be24[_0x442e75(0x1e4)](',\x20')),_0xefbbba[_0x442e75(0x229)]>0x0&&console[_0x442e75(0x1f3)](_0x442e75(0x23d)+_0xefbbba['join'](',\x20')),_0x595a25[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&console[_0x442e75(0x1f3)]('\x20\x20Activations:\x20'+_0x595a25[_0x442e75(0x1e4)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x3a1a4e=a32_0x3364;(function(_0x220113,_0x1a882b){const _0x4d352b=a32_0x3364,_0x446456=_0x220113();while(!![]){try{const _0x211b7d=parseInt(_0x4d352b(0xb7))/0x1+-parseInt(_0x4d352b(0x94))/0x2*(-parseInt(_0x4d352b(0xb6))/0x3)+-parseInt(_0x4d352b(0x9f))/0x4+-parseInt(_0x4d352b(0x8d))/0x5+parseInt(_0x4d352b(0xb8))/0x6*(-parseInt(_0x4d352b(0x8b))/0x7)+parseInt(_0x4d352b(0x8c))/0x8+parseInt(_0x4d352b(0x95))/0x9;if(_0x211b7d===_0x1a882b)break;else _0x446456['push'](_0x446456['shift']());}catch(_0x187db1){_0x446456['push'](_0x446456['shift']());}}}(a32_0x352f,0x9532a));function a32_0x352f(){const _0x1719d5=['yellow','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','data','includes','Resolving\x20folder\x20\x27','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','verbose','531978MBFkLm','1085334ASOzyj','24NOWToF','updateSegmentById','1901872DSyvxo','4705896Ekwtjm','5836985EDqnzJ','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','length','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','type','8HVxbYJ','12745341vmEdnt','kind','Resolving\x20path\x20\x27','rule','Parent\x20ID:\x20','resolveFolderId','segmentId','Resolved\x20type:\x20','parentId','\x27...','3734916NwZkvs','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','error','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:update','resolvePathToResource','✔\x20Updated\x20segment\x20\x27','Update\x20existing\x20child\x20segment','ruleFile','folder','name','INTERNAL'];a32_0x352f=function(){return _0x1719d5;};return a32_0x352f();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a32_0x3364(_0xa507a0,_0x2324c9){_0xa507a0=_0xa507a0-0x8b;const _0x352fa6=a32_0x352f();let _0x3364b7=_0x352fa6[_0xa507a0];return _0x3364b7;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a32_0x3b0f77 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a32_0x3a1a4e(0xaa)]=a32_0x3a1a4e(0xa4);['description']=a32_0x3a1a4e(0xa7);async[a32_0x3a1a4e(0xaf)](_0x10eece){const _0x1e1867=a32_0x3a1a4e;console[_0x1e1867(0xa2)](a32_0x3b0f77[_0x1e1867(0xac)](_0x1e1867(0x8e))),console['error'](a32_0x3b0f77[_0x1e1867(0xac)](_0x1e1867(0x8f)));const {options:_0x56a71a,args:_0x4fa394,tdx:_0x1e1ff1}=_0x10eece,_0xf17b73=_0x56a71a;if(_0x4fa394[_0x1e1867(0x90)]===0x0)return console['error'](_0x1e1867(0xa3)),console['error'](_0x1e1867(0xa1)),console[_0x1e1867(0xa2)]('Examples:'),console[_0x1e1867(0xa2)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x1e1867(0xa2)](_0x1e1867(0xae)),0x1;const _0x1cf282=_0x4fa394[0x0],_0x520a2c=_0x56a71a['segmentPath'];let _0x518793=_0x1cf282;_0x520a2c&&!_0x1cf282[_0x1e1867(0xb1)]('/')&&(_0x518793=_0x520a2c+'/'+_0x1cf282,_0xf17b73[_0x1e1867(0xb5)]&&console[_0x1e1867(0xa2)](_0x1e1867(0xb4)+_0x518793));const _0x4c03b8=await withSpinner(_0x1e1867(0x97)+_0x518793+_0x1e1867(0x9e),()=>_0x1e1ff1[_0x1e1867(0xad)][_0x1e1867(0xa5)](_0x518793),{'verbose':_0xf17b73[_0x1e1867(0xb5)]}),_0x4ecbe3=_0x4c03b8['data'];_0xf17b73[_0x1e1867(0xb5)]&&console['error'](_0x1e1867(0x9c)+_0x4ecbe3[_0x1e1867(0x93)]);if(_0x4ecbe3[_0x1e1867(0x93)]!==_0x1e1867(0xad))return console[_0x1e1867(0xa2)](_0x1e1867(0x92)+_0x4ecbe3['type']+_0x1e1867(0x91)),console[_0x1e1867(0xa2)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x4ecbe3[_0x1e1867(0x9b)])throw new SDKError(ErrorCode[_0x1e1867(0xab)],_0x1e1867(0xa0));const _0x3b3c79=_0x4ecbe3[_0x1e1867(0x9d)],_0x32620a=_0x4ecbe3[_0x1e1867(0x9b)];_0xf17b73['verbose']&&(console[_0x1e1867(0xa2)](_0x1e1867(0x99)+_0x3b3c79),console['error'](_0x1e1867(0xb3)+_0x32620a));let _0xe867b;if(_0xf17b73[_0x1e1867(0xa9)]){const _0x55c92c=_0xf17b73[_0x1e1867(0xa9)],_0x3bc594=await withSpinner(_0x1e1867(0xb2)+_0x55c92c+_0x1e1867(0x9e),()=>_0x1e1ff1[_0x1e1867(0xad)][_0x1e1867(0x9a)](_0x3b3c79,_0x55c92c),{'verbose':_0xf17b73[_0x1e1867(0xb5)]});_0xe867b=parseInt(_0x3bc594['data'],0xa),_0xf17b73['verbose']&&console['error']('Resolved\x20folder\x20ID:\x20'+_0xe867b);}const _0x45d334=await loadJSONFromOptions(_0xf17b73[_0x1e1867(0x98)],_0xf17b73[_0x1e1867(0xa8)]),_0x33beae={'name':_0xf17b73[_0x1e1867(0xaa)],'description':_0xf17b73['description'],'rule':_0x45d334,'kind':_0xf17b73[_0x1e1867(0x96)]!==undefined?parseInt(_0xf17b73['kind'],0xa):undefined,'segmentFolderId':_0xe867b},_0xebf3f4=await withSpinner('Updating\x20segment\x20\x27'+_0x4ecbe3['segmentName']+'\x27...',()=>_0x1e1ff1['segment'][_0x1e1867(0xb9)](_0x3b3c79,_0x32620a,_0x33beae),{'verbose':_0xf17b73[_0x1e1867(0xb5)]}),_0x42c8f4=_0xebf3f4[_0x1e1867(0xb0)];return console[_0x1e1867(0xa2)](_0x1e1867(0xa6)+_0x42c8f4['name']+'\x27'),_0x518793!==_0x1cf282&&console[_0x1e1867(0xa2)]('\x20\x20\x20Path:\x20'+_0x518793),await handleSDKOutput([_0x42c8f4],_0xf17b73),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a33_0x46cf5b=a33_0x4a1c;(function(_0x3d08c5,_0xb663ae){const _0x2d15bc=a33_0x4a1c,_0x2c69ff=_0x3d08c5();while(!![]){try{const _0x6dcf=parseInt(_0x2d15bc(0x85))/0x1+-parseInt(_0x2d15bc(0x93))/0x2+parseInt(_0x2d15bc(0xb6))/0x3*(-parseInt(_0x2d15bc(0x86))/0x4)+-parseInt(_0x2d15bc(0x8d))/0x5*(-parseInt(_0x2d15bc(0x99))/0x6)+-parseInt(_0x2d15bc(0xaa))/0x7+parseInt(_0x2d15bc(0xa5))/0x8+-parseInt(_0x2d15bc(0xa4))/0x9*(-parseInt(_0x2d15bc(0x91))/0xa);if(_0x6dcf===_0xb663ae)break;else _0x2c69ff['push'](_0x2c69ff['shift']());}catch(_0x556231){_0x2c69ff['push'](_0x2c69ff['shift']());}}}(a33_0x3ed7,0xdec73));function a33_0x4a1c(_0xb66d27,_0x40d15d){_0xb66d27=_0xb66d27-0x7b;const _0x3ed781=a33_0x3ed7();let _0x4a1c79=_0x3ed781[_0xb66d27];return _0x4a1c79;}import{existsSync,statSync}from'fs';import a33_0x5d2d04 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a33_0x3ed7(){const _0x5169b8=['4707peDgQt','13671016mpWMNw','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','folderPath','7264096dnsJWV','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','segmentPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','join','segment','Use:\x20tdx\x20segment\x20use\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','name','green','9tTPvXY','error','site','session','data','cyan','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','isAbsolute','type','parentName','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','617811LgAjCm','827636lgrZzv','fullPath','Site:\x20','segments','\x27...','verbose','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','700FWaroG','segment:use','split','Resolving\x20path\x20\x27','35770YqIEBq','parentId','3538890iFqkQb','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Error:\x20Path\x20is\x20required\x0a','slice','red','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','6126rJbChQ','Examples:','✔\x20Context\x20set\x20to:\x20','config','description','dim','folderId','log','length','Resolved\x20path\x20type:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context'];a33_0x3ed7=function(){return _0x5169b8;};return a33_0x3ed7();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x46cf5b(0xb4)]=a33_0x46cf5b(0x8e);[a33_0x46cf5b(0x9d)]=a33_0x46cf5b(0xad);async['execute'](_0x3ad962){const _0x397078=a33_0x46cf5b,{options:_0x5edc00,args:_0x19eca2,tdx:_0x4d4e67}=_0x3ad962;if(_0x19eca2[_0x397078(0xa1)]===0x0)return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x95))),console[_0x397078(0x7b)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x397078(0x7b)](_0x397078(0x9a)),console[_0x397078(0x7b)](_0x397078(0x80)),console['error'](_0x397078(0x94)),console[_0x397078(0x7b)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x397078(0x7b)](_0x397078(0xae)),0x1;const _0x5794f1=_0x19eca2[0x0],_0x3fc88f=_0x5edc00[_0x397078(0x7d)];try{if(_0x5794f1==='/')return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0xb3))),0x0;if(existsSync(_0x5794f1)&&statSync(_0x5794f1)['isDirectory']()){let _0x1666ba;try{_0x1666ba=findTdxConfig(_0x5794f1);}catch{return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x8c)+_0x5794f1)),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)](_0x397078(0xb2))),0x1;}const _0xce6969=_0x1666ba[_0x397078(0x9c)]['parent_segment'];return saveSessionContext({'segment_path':_0xce6969,'parent_segment':_0xce6969},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04['green'](_0x397078(0x9b)+a33_0x5d2d04[_0x397078(0x7f)](_0xce6969))),0x0;}const _0x3e8a8e=_0x5edc00[_0x397078(0xac)];let _0x3af29e=_0x5794f1;const _0x359fb3=parsePath(_0x5794f1);if(!_0x359fb3[_0x397078(0x81)]){if(!_0x3e8a8e)return console['error'](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0xa6))),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x5794f1==='..'){const _0xb34bb6=_0x3e8a8e[_0x397078(0x8f)]('/')[_0x397078(0x96)](0x0,-0x1)[_0x397078(0xaf)]('/');_0x3af29e=_0xb34bb6||'/';}else _0x5794f1==='.'?_0x3af29e=_0x3e8a8e:_0x3af29e=_0x3e8a8e+'/'+_0x5794f1;_0x5edc00['verbose']&&console['error'](_0x397078(0xa8)+_0x3af29e);}if(_0x3af29e==='/'||_0x3af29e==='')return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3af29e=normalizePath(_0x3af29e);const _0x29263b=parsePath(_0x3af29e)[_0x397078(0x89)];if(_0x29263b[_0x397078(0xa1)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0xb3))),0x0;_0x5edc00[_0x397078(0x8b)]&&(console[_0x397078(0x7b)](_0x397078(0x88)+_0x5edc00[_0x397078(0x7c)]),console[_0x397078(0x7b)]('Target\x20path:\x20'+_0x3af29e));const _0x2f6ca3=await withSpinner(_0x397078(0x90)+_0x3af29e+_0x397078(0x8a),()=>_0x4d4e67['segment'][_0x397078(0xa7)](_0x3af29e),{'verbose':_0x5edc00['verbose']}),_0x174b87=_0x2f6ca3[_0x397078(0x7e)];_0x5edc00[_0x397078(0x8b)]&&(console[_0x397078(0x7b)](_0x397078(0xa2)+_0x174b87[_0x397078(0x82)]),console['error']('Parent\x20ID:\x20'+_0x174b87[_0x397078(0x92)]),_0x174b87[_0x397078(0x9f)]&&console['error']('Folder\x20ID:\x20'+_0x174b87['folderId']));if(_0x174b87[_0x397078(0x82)]===_0x397078(0xb0))return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x84))),console[_0x397078(0x7b)](_0x397078(0x98)),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)](_0x397078(0xb1)+_0x174b87[_0x397078(0x83)]+(_0x174b87[_0x397078(0xa9)]?'/'+_0x174b87['folderPath'][_0x397078(0xaf)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x174b87[_0x397078(0x87)],'parent_segment':_0x174b87[_0x397078(0x83)]},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0x9b)+a33_0x5d2d04['cyan'](_0x174b87[_0x397078(0x87)]))),_0x5edc00['verbose']&&(console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x9e)](_0x397078(0xa3))),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x9e)](_0x397078(0xab)))),0x0;}catch(_0x53c9b6){throw _0x53c9b6;}}}
|