@treasuredata/tdx 0.14.1 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/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.d.ts +15 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +13 -2
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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.d.ts.map +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js.map +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.d.ts +60 -0
- package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js.map +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 +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x2a638c=a25_0x1f88;(function(_0x2a563f,_0x2a95e3){const _0x22b731=a25_0x1f88,_0x1d812e=_0x2a563f();while(!![]){try{const _0x3b5802=parseInt(_0x22b731(0x1a7))/0x1+parseInt(_0x22b731(0x142))/0x2*(-parseInt(_0x22b731(0x1bb))/0x3)+-parseInt(_0x22b731(0x18e))/0x4*(-parseInt(_0x22b731(0x1af))/0x5)+parseInt(_0x22b731(0x1ac))/0x6+parseInt(_0x22b731(0x148))/0x7+parseInt(_0x22b731(0x19a))/0x8+parseInt(_0x22b731(0x14d))/0x9*(-parseInt(_0x22b731(0x1c0))/0xa);if(_0x3b5802===_0x2a95e3)break;else _0x1d812e['push'](_0x1d812e['shift']());}catch(_0x42591d){_0x1d812e['push'](_0x1d812e['shift']());}}}(a25_0x4907,0xbecd7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x4ce361 from'chalk';async function resolveSegmentTarget(_0x338a32,_0x58681c,_0x49d37b){const _0x559b0d=a25_0x1f88;if(isYamlFilePath(_0x338a32))try{const _0x4efc81=await resolveYamlFilePath(_0x338a32);return _0x49d37b&&(console[_0x559b0d(0x143)](_0x559b0d(0x1dc)+_0x338a32),console[_0x559b0d(0x143)](_0x559b0d(0x1a5)+_0x4efc81[_0x559b0d(0x1b1)]),console[_0x559b0d(0x143)](_0x559b0d(0x189)+_0x4efc81['segmentName']),console['error'](_0x559b0d(0x178)+(_0x4efc81[_0x559b0d(0x190)]||_0x559b0d(0x1ce))),console[_0x559b0d(0x143)](_0x559b0d(0x181)+_0x4efc81['fullPath'])),_0x4efc81['fullPath'];}catch(_0x39dfc4){throw new SDKError(ErrorCode[_0x559b0d(0x166)],_0x559b0d(0x187)+_0x39dfc4[_0x559b0d(0x144)]);}if(!_0x58681c)throw new SDKError(ErrorCode[_0x559b0d(0x166)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x58681c+'/'+_0x338a32;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x182);[a25_0x2a638c(0x1d3)]='Show\x20segment\x20or\x20folder\x20details';async[a25_0x2a638c(0x1b5)](_0x26cd58){const _0x4774bb=a25_0x2a638c,{options:_0x40329e,args:_0xf54f93,tdx:_0x266fe4}=_0x26cd58,_0x552581=_0xf54f93[0x0],_0x4fc5d8=!_0x552581&&!!_0x40329e[_0x4774bb(0x1b1)],_0x3ccb95=_0x552581||_0x40329e['parentSegment'];if(!_0x3ccb95)return console[_0x4774bb(0x143)](_0x4774bb(0x15f)),console[_0x4774bb(0x143)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x4774bb(0x143)](_0x4774bb(0x16e)),console[_0x4774bb(0x143)](_0x4774bb(0x175)),console[_0x4774bb(0x143)](_0x4774bb(0x1d9)),console['error'](_0x4774bb(0x159)),console[_0x4774bb(0x143)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0xab400f=_0x40329e[_0x4774bb(0x15a)];let _0x3b0eaf=_0x3ccb95;!_0x4fc5d8&&_0xab400f&&!_0x3ccb95['includes']('/')&&(_0x3b0eaf=_0xab400f+'/'+_0x3ccb95,_0x40329e['verbose']&&console['error'](_0x4774bb(0x161)+_0x3b0eaf));const _0x4ee453=await withSpinner(_0x4774bb(0x19e)+_0x3b0eaf+_0x4774bb(0x1db),()=>_0x266fe4[_0x4774bb(0x184)][_0x4774bb(0x1a0)](_0x3b0eaf),{'verbose':_0x40329e[_0x4774bb(0x1d0)]}),_0x555b13=_0x4ee453['data'];_0x40329e[_0x4774bb(0x1d0)]&&(console[_0x4774bb(0x143)]('Resolved\x20type:\x20'+_0x555b13[_0x4774bb(0x15c)]),console['error'](_0x4774bb(0x191)+_0x555b13[_0x4774bb(0x177)]),_0x555b13[_0x4774bb(0x1ca)]&&console[_0x4774bb(0x143)](_0x4774bb(0x145)+_0x555b13[_0x4774bb(0x1ca)]),_0x555b13[_0x4774bb(0x185)]&&console['error'](_0x4774bb(0x1a1)+_0x555b13[_0x4774bb(0x185)]));if(_0x555b13[_0x4774bb(0x15c)]===_0x4774bb(0x1ad)){const _0x424eb5=await withSpinner(_0x4774bb(0x1c1),()=>_0x266fe4[_0x4774bb(0x184)][_0x4774bb(0x14e)](_0x555b13[_0x4774bb(0x177)]),{'verbose':_0x40329e[_0x4774bb(0x1d0)]});await handleSingleObjectOutput(_0x424eb5[_0x4774bb(0x19b)],_0x40329e);}else{if(_0x555b13['type']===_0x4774bb(0x17a)){if(!_0x555b13[_0x4774bb(0x1ca)])throw new SDKError(ErrorCode[_0x4774bb(0x152)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0xc1298c=await withSpinner('Fetching\x20folder\x20details...',()=>_0x266fe4[_0x4774bb(0x184)][_0x4774bb(0x1ab)](_0x555b13[_0x4774bb(0x1ca)]),{'verbose':_0x40329e['verbose']});await handleSingleObjectOutput(_0xc1298c['data'],_0x40329e);}else{if(_0x555b13[_0x4774bb(0x15c)]==='segment'){if(!_0x555b13[_0x4774bb(0x185)])throw new SDKError(ErrorCode[_0x4774bb(0x1a3)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x41b0a9=await withSpinner('Fetching\x20segment\x20details...',()=>_0x266fe4['segment'][_0x4774bb(0x1c3)](_0x555b13['parentId'],_0x555b13[_0x4774bb(0x185)]),{'verbose':_0x40329e[_0x4774bb(0x1d0)]});await handleSingleObjectOutput(_0x41b0a9[_0x4774bb(0x19b)],_0x40329e);}}}return 0x0;}catch(_0x407577){if(_0x407577 instanceof SDKError)return console[_0x4774bb(0x143)](_0x4774bb(0x188)+_0x407577[_0x4774bb(0x144)]),_0x407577[_0x4774bb(0x147)]&&console['error']('\x20\x20Cause:\x20'+_0x407577[_0x4774bb(0x147)]),0x1;throw _0x407577;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x15e);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x1be);async[a25_0x2a638c(0x1b5)](_0x52134b){const _0x237518=a25_0x2a638c,{options:_0x333b67,args:_0x369f34,tdx:_0x308feb}=_0x52134b,_0x4fe484=_0x369f34[0x0];if(!_0x4fe484)return console['error'](_0x237518(0x16a)),console[_0x237518(0x143)](_0x237518(0x160)),console[_0x237518(0x143)](_0x237518(0x1cb)),console[_0x237518(0x143)](_0x237518(0x16e)),console[_0x237518(0x143)](_0x237518(0x149)),console[_0x237518(0x143)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x4e8bab=_0x333b67[_0x237518(0x1b1)],_0x22af90=await resolveSegmentTarget(_0x4fe484,_0x4e8bab,_0x333b67[_0x237518(0x1d0)]);_0x333b67[_0x237518(0x1d0)]&&console[_0x237518(0x143)]('Target\x20path:\x20'+_0x22af90);const _0x4d2ff2=await withSpinner('Resolving\x20\x27'+_0x4fe484+_0x237518(0x1db),()=>_0x308feb[_0x237518(0x184)][_0x237518(0x1a0)](_0x22af90),{'verbose':_0x333b67[_0x237518(0x1d0)]}),_0x10077f=_0x4d2ff2[_0x237518(0x19b)];_0x333b67[_0x237518(0x1d0)]&&(console[_0x237518(0x143)]('Resolved\x20type:\x20'+_0x10077f['type']),console['error'](_0x237518(0x191)+_0x10077f['parentId']));if(_0x10077f[_0x237518(0x15c)]==='folder')return console['error'](_0x237518(0x1bf)),console['error'](_0x237518(0x1c7)),0x1;if(_0x10077f[_0x237518(0x15c)]===_0x237518(0x1ad))return console[_0x237518(0x143)](_0x237518(0x16d)),console[_0x237518(0x143)](_0x237518(0x164)),0x1;if(!_0x10077f[_0x237518(0x185)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x237518(0x1b9));const _0x3485db=await withSpinner(_0x237518(0x174),()=>_0x308feb[_0x237518(0x184)][_0x237518(0x19f)](_0x10077f[_0x237518(0x177)],_0x10077f[_0x237518(0x185)]),{'verbose':_0x333b67[_0x237518(0x1d0)]});let _0x31a01d=_0x3485db[_0x237518(0x19b)];const _0x5a5609=resolveLimit(_0x333b67['limit'],DEFAULT_DISPLAY_LIMIT),_0x3b84ae=/\bLIMIT\s+\d+/i[_0x237518(0x146)](_0x31a01d);!_0x3b84ae&&(_0x31a01d=_0x31a01d[_0x237518(0x17f)]()[_0x237518(0x1ae)](/;+$/,''),_0x31a01d='SELECT\x20*\x20FROM\x20(\x0a'+_0x31a01d+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5a5609);_0x333b67[_0x237518(0x1d0)]&&console[_0x237518(0x143)](_0x237518(0x1c6)+_0x31a01d);const _0x5b9429=await withProgressSpinner(_0x237518(0x1b4),async _0x5bb781=>{const _0xf7415a=_0x237518,_0x24ed84=await _0x308feb[_0xf7415a(0x180)][_0xf7415a(0x1b5)](_0x31a01d,{'catalog':'td','schema':_0xf7415a(0x186),'onJobId':_0x3f1aca=>{_0x5bb781['setJobId'](_0x3f1aca);}});return _0x24ed84;},{'verbose':_0x333b67[_0x237518(0x1d0)]}),_0x1af73f=_0x5b9429[_0x237518(0x19b)],_0xbf164b=_0x1af73f['jobId']?'\x20[Job\x20ID:\x20'+_0x1af73f['jobId']+']':'';return console[_0x237518(0x143)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x1af73f['stats'][_0x237518(0x158)]['toLocaleString']()+'\x20rows\x20'+(_0x237518(0x1bd)+formatElapsed(_0x1af73f['stats'][_0x237518(0x1a6)])+_0xbf164b)),await handleQueryOutput(_0x1af73f,_0x333b67),0x0;}catch(_0x186a75){if(_0x186a75 instanceof SDKError)return console[_0x237518(0x143)]('✖\x20Query\x20failed\x20['+_0x186a75[_0x237518(0x1b2)]+']'),console[_0x237518(0x143)]('\x0a'+_0x186a75[_0x237518(0x144)]),0x1;throw _0x186a75;}}}function a25_0x1f88(_0x261088,_0x3cb517){_0x261088=_0x261088-0x142;const _0x4907d0=a25_0x4907();let _0x1f8898=_0x4907d0[_0x261088];return _0x1f8898;}export class SegmentFolderListCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x169);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x1d1);async['execute'](_0x35d530){const _0x2e18e5=a25_0x2a638c,{options:_0x3fc8e6,args:_0x41d9bc,tdx:_0x3f1a04}=_0x35d530;if(_0x41d9bc[_0x2e18e5(0x15d)]===0x0)return console[_0x2e18e5(0x143)](_0x2e18e5(0x1d5)),console[_0x2e18e5(0x143)](_0x2e18e5(0x150)),0x1;const _0x467483=_0x41d9bc[0x0];try{_0x3fc8e6[_0x2e18e5(0x1d0)]&&(console[_0x2e18e5(0x143)]('Site:\x20'+_0x3fc8e6['site']),console[_0x2e18e5(0x143)]('Parent\x20name:\x20'+_0x467483));const _0x4e2a28=await withSpinner(_0x2e18e5(0x16f)+_0x467483+_0x2e18e5(0x1db),()=>_0x3f1a04[_0x2e18e5(0x184)]['resolveParentId'](_0x467483),{'verbose':_0x3fc8e6[_0x2e18e5(0x1d0)]}),_0x2f2dd3=_0x4e2a28[_0x2e18e5(0x19b)];_0x3fc8e6[_0x2e18e5(0x1d0)]&&console['error'](_0x2e18e5(0x1ba)+_0x2f2dd3);const _0xcfa803=await withSpinner(_0x2e18e5(0x1cc)+_0x467483+_0x2e18e5(0x1db),()=>_0x3f1a04[_0x2e18e5(0x184)][_0x2e18e5(0x172)](_0x2f2dd3),{'verbose':_0x3fc8e6[_0x2e18e5(0x1d0)]}),_0x3a09e0=_0xcfa803['data'];return console['error'](_0x2e18e5(0x171)+_0x3a09e0['length']+'\x20folder'+(_0x3a09e0[_0x2e18e5(0x15d)]!==0x1?'s':'')),await handleSDKOutput(_0x3a09e0,_0x3fc8e6),0x0;}catch(_0x40e625){if(_0x40e625 instanceof SDKError)return console[_0x2e18e5(0x143)]('Error:\x20'+_0x40e625[_0x2e18e5(0x144)]),_0x40e625[_0x2e18e5(0x147)]&&console[_0x2e18e5(0x143)](_0x2e18e5(0x18c)+_0x40e625[_0x2e18e5(0x147)]),0x1;throw _0x40e625;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x1d8);[a25_0x2a638c(0x1d3)]='Show\x20segment\x20folder\x20details';async['execute'](_0x4315ab){const _0x37737e=a25_0x2a638c,{options:_0x37499f,args:_0x30a3d4,tdx:_0x43ad17}=_0x4315ab;if(_0x30a3d4['length']===0x0)return console[_0x37737e(0x143)](_0x37737e(0x14b)),console[_0x37737e(0x143)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x3e939e,childId:_0x57d894}=parseSegmentRef(_0x30a3d4[0x0]);_0x37499f[_0x37737e(0x1d0)]&&(console['error'](_0x37737e(0x1bc)+_0x37499f[_0x37737e(0x157)]),console[_0x37737e(0x143)](_0x37737e(0x1c2)+_0x3e939e),_0x57d894&&console[_0x37737e(0x143)](_0x37737e(0x194)+_0x57d894));if(!_0x57d894)return console[_0x37737e(0x143)](_0x37737e(0x1a2)),0x1;const _0x37653d=await withSpinner(_0x37737e(0x16f)+_0x3e939e+_0x37737e(0x1db),()=>_0x43ad17[_0x37737e(0x184)][_0x37737e(0x179)](_0x3e939e),{'verbose':_0x37499f[_0x37737e(0x1d0)]}),_0x5b486b=_0x37653d['data'];_0x37499f['verbose']&&console['error'](_0x37737e(0x1ba)+_0x5b486b);const _0x5cfe94=await withSpinner('Resolving\x20folder\x20\x27'+_0x57d894+_0x37737e(0x1db),()=>_0x43ad17['segment'][_0x37737e(0x17b)](_0x5b486b,_0x57d894),{'verbose':_0x37499f[_0x37737e(0x1d0)]}),_0x4f0e1d=_0x5cfe94['data'];_0x37499f[_0x37737e(0x1d0)]&&console[_0x37737e(0x143)]('Resolved\x20folder\x20ID:\x20'+_0x4f0e1d);const _0x530eff=await withSpinner('Fetching\x20folder\x20\x27'+_0x57d894+_0x37737e(0x1db),()=>_0x43ad17[_0x37737e(0x184)][_0x37737e(0x1ab)](_0x4f0e1d),{'verbose':_0x37499f['verbose']});return await handleSDKOutput([_0x530eff[_0x37737e(0x19b)]],_0x37499f),0x0;}catch(_0x235826){if(_0x235826 instanceof SDKError)return console[_0x37737e(0x143)](_0x37737e(0x188)+_0x235826['message']),_0x235826[_0x37737e(0x147)]&&console[_0x37737e(0x143)](_0x37737e(0x18c)+_0x235826['cause']),0x1;throw _0x235826;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x199);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x14f);async[a25_0x2a638c(0x1b5)](_0x95df5a){const _0x1e0bd4=a25_0x2a638c,{options:_0xb9849f,args:_0x2c73c2,tdx:_0x34f3a2}=_0x95df5a,_0x2571b9=_0x2c73c2[0x0];if(!_0x2571b9)return console[_0x1e0bd4(0x143)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x183)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x16e)),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x1c5)),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x14c)),0x1;try{const _0x330085=_0xb9849f['parentSegment'],_0xd87f3=await resolveSegmentTarget(_0x2571b9,_0x330085,_0xb9849f[_0x1e0bd4(0x1d0)]);_0xb9849f[_0x1e0bd4(0x1d0)]&&console['error'](_0x1e0bd4(0x18b)+_0xd87f3);const _0x2625d3=await withSpinner(_0x1e0bd4(0x15b)+_0x2571b9+'\x27...',()=>_0x34f3a2['segment'][_0x1e0bd4(0x1a0)](_0xd87f3),{'verbose':_0xb9849f['verbose']}),_0x402b33=_0x2625d3['data'];_0xb9849f['verbose']&&(console['error'](_0x1e0bd4(0x165)+_0x402b33[_0x1e0bd4(0x15c)]),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x191)+_0x402b33[_0x1e0bd4(0x177)]));if(_0x402b33[_0x1e0bd4(0x15c)]===_0x1e0bd4(0x17a))return console['error'](_0x1e0bd4(0x1d4)),console['error'](_0x1e0bd4(0x17c)),0x1;if(_0x402b33[_0x1e0bd4(0x15c)]===_0x1e0bd4(0x1ad))return console['error'](_0x1e0bd4(0x1c4)),console[_0x1e0bd4(0x143)](_0x1e0bd4(0x1a4)),0x1;if(!_0x402b33[_0x1e0bd4(0x185)])throw new SDKError(ErrorCode[_0x1e0bd4(0x1a3)],_0x1e0bd4(0x1b9));const _0x56ad5e=await withSpinner(_0x1e0bd4(0x174),()=>_0x34f3a2[_0x1e0bd4(0x184)][_0x1e0bd4(0x19f)](_0x402b33[_0x1e0bd4(0x177)],_0x402b33[_0x1e0bd4(0x185)]),{'verbose':_0xb9849f[_0x1e0bd4(0x1d0)]}),_0x142ed5=_0x56ad5e[_0x1e0bd4(0x19b)];return _0xb9849f[_0x1e0bd4(0x1c8)]===_0x1e0bd4(0x1aa)||_0xb9849f[_0x1e0bd4(0x1c8)]===_0x1e0bd4(0x162)?await handleSDKOutput([{'sql':_0x142ed5}],_0xb9849f):console[_0x1e0bd4(0x195)](_0x142ed5),0x0;}catch(_0x18964a){if(_0x18964a instanceof SDKError)return console[_0x1e0bd4(0x143)](_0x1e0bd4(0x188)+_0x18964a[_0x1e0bd4(0x144)]),_0x18964a[_0x1e0bd4(0x147)]&&console[_0x1e0bd4(0x143)](_0x1e0bd4(0x18c)+_0x18964a[_0x1e0bd4(0x147)]),0x1;throw _0x18964a;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x2a638c(0x168)]=a25_0x2a638c(0x1b0);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x1cd);async[a25_0x2a638c(0x1b5)](_0x44221e){const _0x4c6bf9=a25_0x2a638c,{options:_0xc3581e,args:_0x956850,tdx:_0x28ba95}=_0x44221e,_0x1b8245=_0xc3581e;if(_0x956850[_0x4c6bf9(0x15d)]<0x2)return console[_0x4c6bf9(0x143)](_0x4c6bf9(0x1de)),console[_0x4c6bf9(0x143)](_0x4c6bf9(0x18f)),0x1;const _0x3baefc=_0x956850[0x0],_0x4eaa3b=_0x956850[0x1];_0x1b8245[_0x4c6bf9(0x1d0)]&&(console[_0x4c6bf9(0x143)](_0x4c6bf9(0x1bc)+_0x1b8245[_0x4c6bf9(0x157)]),console[_0x4c6bf9(0x143)](_0x4c6bf9(0x1b6)+_0x3baefc),console['error'](_0x4c6bf9(0x194)+_0x4eaa3b));let _0x31e341;if(_0x1b8245['parentFolder']){const _0x371d7d=_0x1b8245[_0x4c6bf9(0x1da)],_0x3b3c5e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3baefc+_0x4c6bf9(0x1db),()=>_0x28ba95[_0x4c6bf9(0x184)]['resolveParentId'](_0x3baefc),{'verbose':_0x1b8245['verbose']}),_0x56bad2=_0x3b3c5e['data'],_0x3095ed=await withSpinner(_0x4c6bf9(0x196)+_0x371d7d+'\x27...',()=>_0x28ba95['segment'][_0x4c6bf9(0x17b)](_0x56bad2,_0x371d7d),{'verbose':_0x1b8245[_0x4c6bf9(0x1d0)]});_0x31e341=_0x3095ed[_0x4c6bf9(0x19b)],_0x1b8245[_0x4c6bf9(0x1d0)]&&console[_0x4c6bf9(0x143)](_0x4c6bf9(0x173)+_0x31e341);}const _0x4b85dc={'name':_0x4eaa3b,'description':_0x1b8245[_0x4c6bf9(0x1d3)],'parentFolderId':_0x31e341},_0x2a1a90=await withSpinner('Creating\x20folder\x20\x27'+_0x4eaa3b+_0x4c6bf9(0x1db),()=>_0x28ba95['segment'][_0x4c6bf9(0x17d)](_0x3baefc,_0x4b85dc),{'verbose':_0x1b8245[_0x4c6bf9(0x1d0)]}),_0x33022b=_0x2a1a90[_0x4c6bf9(0x19b)];return console[_0x4c6bf9(0x143)](_0x4c6bf9(0x153)+_0x33022b[_0x4c6bf9(0x168)]+_0x4c6bf9(0x192)+_0x33022b['id']),await handleSDKOutput([_0x33022b],_0x1b8245),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a25_0x2a638c(0x197);[a25_0x2a638c(0x1d3)]=a25_0x2a638c(0x154);async[a25_0x2a638c(0x1b5)](_0x557e6c){const _0xbe8be8=a25_0x2a638c,{options:_0x3d630e,args:_0x3e0d13,tdx:_0x4a1ba1}=_0x557e6c,_0x56d41a=_0x3e0d13[0x0];if(!_0x56d41a)return console[_0xbe8be8(0x143)](_0xbe8be8(0x1c9)),console[_0xbe8be8(0x143)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0xbe8be8(0x170)),console[_0xbe8be8(0x143)](_0xbe8be8(0x19d)),console[_0xbe8be8(0x143)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0xbe8be8(0x16e)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0xbe8be8(0x143)](_0xbe8be8(0x198)),console[_0xbe8be8(0x143)](_0xbe8be8(0x167)),console['error'](_0xbe8be8(0x16c)),0x1;try{const _0x6e5393=_0x3d630e[_0xbe8be8(0x1b1)],_0x41ebae=await resolveSegmentTarget(_0x56d41a,_0x6e5393,_0x3d630e[_0xbe8be8(0x1d0)]);_0x3d630e['verbose']&&console['error']('Target\x20path:\x20'+_0x41ebae);const _0x5710c6=await withSpinner(_0xbe8be8(0x15b)+_0x56d41a+_0xbe8be8(0x1db),()=>_0x4a1ba1[_0xbe8be8(0x184)][_0xbe8be8(0x1a0)](_0x41ebae),{'verbose':_0x3d630e[_0xbe8be8(0x1d0)]}),_0xecee3a=_0x5710c6[_0xbe8be8(0x19b)];_0x3d630e['verbose']&&(console[_0xbe8be8(0x143)](_0xbe8be8(0x165)+_0xecee3a[_0xbe8be8(0x15c)]),console['error'](_0xbe8be8(0x191)+_0xecee3a['parentId']),_0xecee3a[_0xbe8be8(0x1ca)]&&console[_0xbe8be8(0x143)](_0xbe8be8(0x145)+_0xecee3a['folderId']),_0xecee3a['segmentId']&&console[_0xbe8be8(0x143)](_0xbe8be8(0x1a1)+_0xecee3a['segmentId']));if(_0x3d630e[_0xbe8be8(0x155)]){if(_0xecee3a['type']===_0xbe8be8(0x17a))return console[_0xbe8be8(0x143)](_0xbe8be8(0x1a8)),0x1;if(_0xecee3a[_0xbe8be8(0x15c)]===_0xbe8be8(0x1ad))return console['error']('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0xbe8be8(0x143)](_0xbe8be8(0x151)),0x1;if(!_0xecee3a['segmentId'])throw new SDKError(ErrorCode[_0xbe8be8(0x1a3)],_0xbe8be8(0x1b9));const _0x3a474d=getConsoleNextUrl(_0x3d630e['site'],_0xbe8be8(0x1d6)+_0xecee3a['parentId']+'/e/'+_0xecee3a[_0xbe8be8(0x185)]);return console[_0xbe8be8(0x143)](a25_0x4ce361['green']('✔')+_0xbe8be8(0x1b7)+a25_0x4ce361[_0xbe8be8(0x16b)](_0x3a474d)),openBrowser(_0x3a474d),0x0;}if(_0xecee3a[_0xbe8be8(0x15c)]===_0xbe8be8(0x17a)){if(!_0xecee3a[_0xbe8be8(0x1ca)])throw new SDKError(ErrorCode[_0xbe8be8(0x152)],_0xbe8be8(0x176));const _0x3d8cc6=await withSpinner(_0xbe8be8(0x14a),()=>_0x4a1ba1[_0xbe8be8(0x184)][_0xbe8be8(0x1ab)](_0xecee3a[_0xbe8be8(0x1ca)]),{'verbose':_0x3d630e[_0xbe8be8(0x1d0)]});await handleSingleObjectOutput(_0x3d8cc6[_0xbe8be8(0x19b)],_0x3d630e);}else{if(_0xecee3a[_0xbe8be8(0x15c)]==='segment'){if(!_0xecee3a[_0xbe8be8(0x185)])throw new SDKError(ErrorCode[_0xbe8be8(0x1a3)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x104660=await withSpinner(_0xbe8be8(0x163),()=>_0x4a1ba1[_0xbe8be8(0x184)][_0xbe8be8(0x1c3)](_0xecee3a[_0xbe8be8(0x177)],_0xecee3a[_0xbe8be8(0x185)]),{'verbose':_0x3d630e['verbose']}),_0x40395c=getConsoleNextUrl(_0x3d630e[_0xbe8be8(0x157)],'/app/ps/'+_0xecee3a['parentId']+_0xbe8be8(0x18d)+_0xecee3a[_0xbe8be8(0x185)]),_0xaadbd9=_0x104660[_0xbe8be8(0x19b)];_0xaadbd9[_0xbe8be8(0x156)]=_0x40395c,await handleSingleObjectOutput(_0xaadbd9,_0x3d630e);}else return console[_0xbe8be8(0x143)](_0xbe8be8(0x1b3)),console[_0xbe8be8(0x143)](_0xbe8be8(0x1d7)),0x1;}return 0x0;}catch(_0xf88a2a){if(_0xf88a2a instanceof SDKError)return console[_0xbe8be8(0x143)](_0xbe8be8(0x188)+_0xf88a2a[_0xbe8be8(0x144)]),_0xf88a2a[_0xbe8be8(0x147)]&&console[_0xbe8be8(0x143)](_0xbe8be8(0x18c)+_0xf88a2a[_0xbe8be8(0x147)]),0x1;throw _0xf88a2a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x2a638c(0x19c);['description']=a25_0x2a638c(0x1d2);async[a25_0x2a638c(0x1b5)](_0x9ce07){const _0x29535b=a25_0x2a638c,{options:_0x2684d5,args:_0x48bc14,tdx:_0x11344e}=_0x9ce07,_0x2e8dac=_0x48bc14[0x0];if(!_0x2e8dac)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x29535b(0x143)](_0x29535b(0x193)),console[_0x29535b(0x143)](_0x29535b(0x1b8)),console[_0x29535b(0x143)](_0x29535b(0x16e)),console[_0x29535b(0x143)](_0x29535b(0x17e)),console['error'](_0x29535b(0x1cf)),0x1;try{const _0xb47861=_0x2684d5[_0x29535b(0x1b1)],_0x2cee9e=await resolveSegmentTarget(_0x2e8dac,_0xb47861,_0x2684d5['verbose']);_0x2684d5['verbose']&&console[_0x29535b(0x143)](_0x29535b(0x18b)+_0x2cee9e);const _0x48a76c=await withSpinner(_0x29535b(0x15b)+_0x2e8dac+_0x29535b(0x1db),()=>_0x11344e[_0x29535b(0x184)][_0x29535b(0x1a0)](_0x2cee9e),{'verbose':_0x2684d5[_0x29535b(0x1d0)]}),_0x10c666=_0x48a76c['data'];_0x2684d5[_0x29535b(0x1d0)]&&(console[_0x29535b(0x143)](_0x29535b(0x165)+_0x10c666[_0x29535b(0x15c)]),console[_0x29535b(0x143)]('Parent\x20ID:\x20'+_0x10c666[_0x29535b(0x177)]));if(_0x10c666[_0x29535b(0x15c)]===_0x29535b(0x17a))return console[_0x29535b(0x143)](_0x29535b(0x18a)),console[_0x29535b(0x143)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x10c666[_0x29535b(0x15c)]===_0x29535b(0x1ad))return console[_0x29535b(0x143)](_0x29535b(0x1dd)),console[_0x29535b(0x143)](_0x29535b(0x1a9)),0x1;if(!_0x10c666[_0x29535b(0x185)])throw new SDKError(ErrorCode[_0x29535b(0x1a3)],_0x29535b(0x1b9));const _0x516935=await withSpinner(_0x29535b(0x174),()=>_0x11344e[_0x29535b(0x184)][_0x29535b(0x19f)](_0x10c666['parentId'],_0x10c666[_0x29535b(0x185)]),{'verbose':_0x2684d5['verbose']}),_0x521c14=_0x516935[_0x29535b(0x19b)],_0x59aa21=await executeSchemaQuery(_0x521c14,_0x11344e,_0x2684d5);return await handleQueryOutput(_0x59aa21,_0x2684d5),0x0;}catch(_0x1de02f){if(_0x1de02f instanceof SDKError)return console[_0x29535b(0x143)](_0x29535b(0x188)+_0x1de02f[_0x29535b(0x144)]),_0x1de02f[_0x29535b(0x147)]&&console[_0x29535b(0x143)](_0x29535b(0x18c)+_0x1de02f['cause']),0x1;throw _0x1de02f;}}}function a25_0x4907(){const _0x1cfe31=['\x27...','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','2HdnOcp','error','message','Folder\x20ID:\x20','test','cause','2860900oGAKhH','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Fetching\x20folder\x20details...','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','19520199kbMave','getParent','Get\x20SQL\x20query\x20for\x20child\x20segment','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Use:\x20tdx\x20ps\x20view\x20-w','SEGMENT_FOLDER_NOT_FOUND','✔\x20Created\x20folder\x20\x27','Show\x20folder\x20or\x20child\x20segment\x20details','web','url','site','processedRows','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segmentPath','Resolving\x20\x27','type','length','segment:show','Error:\x20Path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20show\x20<name>','Resolved\x20relative\x20path\x20to:\x20','jsonl','Fetching\x20segment\x20details...','Use:\x20tdx\x20ps\x20show','Resolved\x20type:\x20','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','name','segment:folder:list','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','cyan','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Examples:','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','✔\x20Found\x20','listFolders','Resolved\x20parent\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parentId','\x20\x20Folder\x20path:\x20','resolveParentId','folder','resolveFolderId','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','createFolder','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','trim','query','\x20\x20Full\x20path:\x20','segment:describe','Usage:\x20tdx\x20sg\x20sql\x20<name>','segment','segmentId','information_schema','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20','\x20\x20Segment\x20name:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Target\x20path:\x20','\x20\x20Cause:\x20','/e/','570172zwslqu','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','folderPath','Parent\x20ID:\x20','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','Folder\x20name:\x20','log','Resolving\x20parent\x20folder\x20\x27','segment:view','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','segment:sql','7736640qQEanh','data','segment:desc','Options:','Resolving\x20path\x20\x27','getSegmentSQL','resolvePathToResource','Segment\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','SEGMENT_NOT_FOUND','Use:\x20tdx\x20ps\x20sql','\x20\x20Parent\x20segment:\x20','elapsedTimeMillis','1464882JKyoOV','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20ps\x20desc','json','getFolder','208392PyqjGg','parent','replace','25zYHRCy','segment:folder:create','parentSegment','code','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Executing\x20segment\x20query...','execute','Parent\x20segment:\x20','\x20Opening\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','1913013gepWwf','Site:\x20','in\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','10xekefn','Fetching\x20parent\x20segment\x20details...','Parent\x20name:\x20','getSegment','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','SQL\x20query:\x0a','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','format','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Listing\x20folders\x20for\x20parent\x20\x27','Create\x20segment\x20folder\x20for\x20organization','(root)','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','verbose','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Show\x20child\x20segment\x20schema\x20(column\x20types)','description','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Parent\x20segment\x20name\x20is\x20required','/app/ps/','Use:\x20tdx\x20ps\x20view','segment:folder:show','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentFolder'];a25_0x4907=function(){return _0x1cfe31;};return a25_0x4907();}
|
|
1
|
+
const a25_0x288065=a25_0x561c;(function(_0x1911e8,_0x330b18){const _0x2686ad=a25_0x561c,_0x5b6cc3=_0x1911e8();while(!![]){try{const _0x10fdaa=parseInt(_0x2686ad(0x1c7))/0x1+-parseInt(_0x2686ad(0x221))/0x2+parseInt(_0x2686ad(0x229))/0x3+parseInt(_0x2686ad(0x201))/0x4*(-parseInt(_0x2686ad(0x21a))/0x5)+-parseInt(_0x2686ad(0x1e5))/0x6*(parseInt(_0x2686ad(0x215))/0x7)+parseInt(_0x2686ad(0x1e3))/0x8+parseInt(_0x2686ad(0x1bd))/0x9;if(_0x10fdaa===_0x330b18)break;else _0x5b6cc3['push'](_0x5b6cc3['shift']());}catch(_0x48d37e){_0x5b6cc3['push'](_0x5b6cc3['shift']());}}}(a25_0x3390,0x49b00));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x3e730a from'chalk';async function resolveSegmentTarget(_0x38ac81,_0x470330,_0x5a0800){const _0x16e07c=a25_0x561c;if(isYamlFilePath(_0x38ac81))try{const _0x31ab08=await resolveYamlFilePath(_0x38ac81);return _0x5a0800&&(console[_0x16e07c(0x202)](_0x16e07c(0x1ee)+_0x38ac81),console[_0x16e07c(0x202)](_0x16e07c(0x1ed)+_0x31ab08[_0x16e07c(0x21b)]),console[_0x16e07c(0x202)](_0x16e07c(0x21f)+_0x31ab08['segmentName']),console[_0x16e07c(0x202)]('\x20\x20Folder\x20path:\x20'+(_0x31ab08['folderPath']||_0x16e07c(0x1bf))),console[_0x16e07c(0x202)]('\x20\x20Full\x20path:\x20'+_0x31ab08[_0x16e07c(0x1dc)])),_0x31ab08[_0x16e07c(0x1dc)];}catch(_0x9d9f10){throw new SDKError(ErrorCode[_0x16e07c(0x1d8)],_0x16e07c(0x242)+_0x9d9f10['message']);}if(!_0x470330)throw new SDKError(ErrorCode[_0x16e07c(0x1d8)],_0x16e07c(0x217));return _0x470330+'/'+_0x38ac81;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:describe';['description']=a25_0x288065(0x234);async[a25_0x288065(0x222)](_0x159c23){const _0x175344=a25_0x288065,{options:_0xcb18d7,args:_0x5b8c7e,tdx:_0x177bff}=_0x159c23,_0x1caa22=_0x5b8c7e[0x0],_0x160cb4=!_0x1caa22&&!!_0xcb18d7[_0x175344(0x21b)],_0xb9b95d=_0x1caa22||_0xcb18d7[_0x175344(0x21b)];if(!_0xb9b95d)return console[_0x175344(0x202)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x175344(0x202)](_0x175344(0x20d)),console[_0x175344(0x202)](_0x175344(0x211)),console[_0x175344(0x202)](_0x175344(0x1f2)),console[_0x175344(0x202)](_0x175344(0x246)),console[_0x175344(0x202)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x175344(0x202)](_0x175344(0x23d)),0x1;try{const _0x384af8=_0xcb18d7['segmentPath'];let _0x2b7af6=_0xb9b95d;!_0x160cb4&&_0x384af8&&!_0xb9b95d['includes']('/')&&(_0x2b7af6=_0x384af8+'/'+_0xb9b95d,_0xcb18d7['verbose']&&console[_0x175344(0x202)](_0x175344(0x1d2)+_0x2b7af6));const _0x5d70a8=await withSpinner(_0x175344(0x22f)+_0x2b7af6+_0x175344(0x1f4),()=>_0x177bff[_0x175344(0x20c)][_0x175344(0x1c6)](_0x2b7af6),{'verbose':_0xcb18d7[_0x175344(0x1e0)]}),_0x2f1ff8=_0x5d70a8[_0x175344(0x23a)];_0xcb18d7['verbose']&&(console[_0x175344(0x202)]('Resolved\x20type:\x20'+_0x2f1ff8['type']),console[_0x175344(0x202)](_0x175344(0x22c)+_0x2f1ff8[_0x175344(0x24e)]),_0x2f1ff8[_0x175344(0x243)]&&console[_0x175344(0x202)](_0x175344(0x1e2)+_0x2f1ff8[_0x175344(0x243)]),_0x2f1ff8[_0x175344(0x1ba)]&&console['error']('Segment\x20ID:\x20'+_0x2f1ff8[_0x175344(0x1ba)]));if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x255)){const _0x2faf37=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x177bff['segment'][_0x175344(0x1cc)](_0x2f1ff8['parentId']),{'verbose':_0xcb18d7[_0x175344(0x1e0)]});await handleSingleObjectOutput(_0x2faf37[_0x175344(0x23a)],_0xcb18d7);}else{if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x227)){if(!_0x2f1ff8[_0x175344(0x243)])throw new SDKError(ErrorCode[_0x175344(0x216)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5f2ca5=await withSpinner(_0x175344(0x1d1),()=>_0x177bff[_0x175344(0x20c)][_0x175344(0x1dd)](_0x2f1ff8['folderId']),{'verbose':_0xcb18d7[_0x175344(0x1e0)]});await handleSingleObjectOutput(_0x5f2ca5['data'],_0xcb18d7);}else{if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x20c)){if(!_0x2f1ff8[_0x175344(0x1ba)])throw new SDKError(ErrorCode[_0x175344(0x251)],_0x175344(0x23e));const _0x548ef3=await withSpinner('Fetching\x20segment\x20details...',()=>_0x177bff[_0x175344(0x20c)]['getSegment'](_0x2f1ff8[_0x175344(0x24e)],_0x2f1ff8['segmentId']),{'verbose':_0xcb18d7['verbose']});await handleSingleObjectOutput(_0x548ef3[_0x175344(0x23a)],_0xcb18d7);}}}return 0x0;}catch(_0x3b82dc){if(_0x3b82dc instanceof SDKError)return console['error'](_0x175344(0x1c5)+_0x3b82dc[_0x175344(0x256)]),_0x3b82dc[_0x175344(0x232)]&&console[_0x175344(0x202)]('\x20\x20Cause:\x20'+_0x3b82dc[_0x175344(0x232)]),0x1;throw _0x3b82dc;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:show';['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a25_0x288065(0x222)](_0x3a9e93){const _0x1e8107=a25_0x288065,{options:_0x5ae287,args:_0x87f429,tdx:_0xdc1ee9}=_0x3a9e93,_0x9aad9f=_0x87f429[0x0];if(!_0x9aad9f)return console[_0x1e8107(0x202)](_0x1e8107(0x24d)),console['error'](_0x1e8107(0x1c8)),console[_0x1e8107(0x202)](_0x1e8107(0x1de)),console[_0x1e8107(0x202)](_0x1e8107(0x211)),console[_0x1e8107(0x202)](_0x1e8107(0x213)),console[_0x1e8107(0x202)](_0x1e8107(0x23f)),0x1;try{const _0x365e08=_0x5ae287[_0x1e8107(0x21b)],_0x1863af=await resolveSegmentTarget(_0x9aad9f,_0x365e08,_0x5ae287[_0x1e8107(0x1e0)]);_0x5ae287['verbose']&&console[_0x1e8107(0x202)](_0x1e8107(0x1fb)+_0x1863af);const _0x146ccd=await withSpinner(_0x1e8107(0x1ce)+_0x9aad9f+_0x1e8107(0x1f4),()=>_0xdc1ee9[_0x1e8107(0x20c)][_0x1e8107(0x1c6)](_0x1863af),{'verbose':_0x5ae287['verbose']}),_0x3351ea=_0x146ccd[_0x1e8107(0x23a)];_0x5ae287[_0x1e8107(0x1e0)]&&(console[_0x1e8107(0x202)](_0x1e8107(0x1f1)+_0x3351ea[_0x1e8107(0x1c1)]),console[_0x1e8107(0x202)](_0x1e8107(0x22c)+_0x3351ea[_0x1e8107(0x24e)]));if(_0x3351ea['type']===_0x1e8107(0x227))return console['error'](_0x1e8107(0x1e4)),console[_0x1e8107(0x202)](_0x1e8107(0x1d4)),0x1;if(_0x3351ea[_0x1e8107(0x1c1)]===_0x1e8107(0x255))return console[_0x1e8107(0x202)](_0x1e8107(0x205)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x3351ea['segmentId'])throw new SDKError(ErrorCode[_0x1e8107(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2e6f18=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0xdc1ee9[_0x1e8107(0x20c)][_0x1e8107(0x1cf)](_0x3351ea[_0x1e8107(0x24e)],_0x3351ea[_0x1e8107(0x1ba)]),{'verbose':_0x5ae287[_0x1e8107(0x1e0)]});let _0x4d1cff=_0x2e6f18['data'];const _0x1c4d8c=resolveLimit(_0x5ae287['limit'],DEFAULT_DISPLAY_LIMIT),_0x87c235=/\bLIMIT\s+\d+/i[_0x1e8107(0x241)](_0x4d1cff);!_0x87c235&&(_0x4d1cff=_0x4d1cff[_0x1e8107(0x248)]()[_0x1e8107(0x239)](/;+$/,''),_0x4d1cff='SELECT\x20*\x20FROM\x20(\x0a'+_0x4d1cff+_0x1e8107(0x1c0)+_0x1c4d8c);_0x5ae287[_0x1e8107(0x1e0)]&&console[_0x1e8107(0x202)](_0x1e8107(0x1fc)+_0x4d1cff);const _0x357cb9=await withProgressSpinner(_0x1e8107(0x1ec),async _0xebec26=>{const _0x60c046=_0x1e8107,_0x1bba4b=await _0xdc1ee9[_0x60c046(0x22d)][_0x60c046(0x222)](_0x4d1cff,{'catalog':'td','schema':'information_schema','onJobId':_0x55acc7=>{const _0x24c358=_0x60c046;_0xebec26[_0x24c358(0x1da)](_0x55acc7);}});return _0x1bba4b;},{'verbose':_0x5ae287[_0x1e8107(0x1e0)]}),_0x52b71b=_0x357cb9[_0x1e8107(0x23a)],_0x1086bc=_0x52b71b[_0x1e8107(0x230)]?_0x1e8107(0x1c9)+_0x52b71b[_0x1e8107(0x230)]+']':'';return console['error'](_0x1e8107(0x219)+_0x52b71b[_0x1e8107(0x24f)]['processedRows'][_0x1e8107(0x1f7)]()+_0x1e8107(0x1e6)+(_0x1e8107(0x226)+formatElapsed(_0x52b71b[_0x1e8107(0x24f)][_0x1e8107(0x231)])+_0x1086bc)),await handleQueryOutput(_0x52b71b,_0x5ae287),0x0;}catch(_0x2516d4){if(_0x2516d4 instanceof SDKError)return console[_0x1e8107(0x202)](_0x1e8107(0x24a)+_0x2516d4[_0x1e8107(0x1d0)]+']'),console[_0x1e8107(0x202)]('\x0a'+_0x2516d4[_0x1e8107(0x256)]),0x1;throw _0x2516d4;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1f9);[a25_0x288065(0x1e8)]=a25_0x288065(0x1fa);async[a25_0x288065(0x222)](_0x3e9d03){const _0x24a281=a25_0x288065,{options:_0x12c926,args:_0x1e6038,tdx:_0x42e274}=_0x3e9d03;if(_0x1e6038[_0x24a281(0x210)]===0x0)return console['error'](_0x24a281(0x1ca)),console['error'](_0x24a281(0x20e)),0x1;const _0x1dc154=_0x1e6038[0x0];try{_0x12c926[_0x24a281(0x1e0)]&&(console['error'](_0x24a281(0x1d6)+_0x12c926[_0x24a281(0x235)]),console[_0x24a281(0x202)](_0x24a281(0x21d)+_0x1dc154));const _0x5bc0a8=await withSpinner(_0x24a281(0x250)+_0x1dc154+_0x24a281(0x1f4),()=>_0x42e274[_0x24a281(0x20c)][_0x24a281(0x21e)](_0x1dc154),{'verbose':_0x12c926['verbose']}),_0x2b724f=_0x5bc0a8['data'];_0x12c926[_0x24a281(0x1e0)]&&console[_0x24a281(0x202)](_0x24a281(0x220)+_0x2b724f);const _0x5738e4=await withSpinner(_0x24a281(0x1e7)+_0x1dc154+_0x24a281(0x1f4),()=>_0x42e274['segment'][_0x24a281(0x206)](_0x2b724f),{'verbose':_0x12c926[_0x24a281(0x1e0)]}),_0x41500f=_0x5738e4[_0x24a281(0x23a)];return console[_0x24a281(0x202)](_0x24a281(0x24c)+_0x41500f['length']+_0x24a281(0x237)+(_0x41500f[_0x24a281(0x210)]!==0x1?'s':'')),await handleSDKOutput(_0x41500f,_0x12c926),0x0;}catch(_0x28cdfc){if(_0x28cdfc instanceof SDKError)return console[_0x24a281(0x202)](_0x24a281(0x1c5)+_0x28cdfc[_0x24a281(0x256)]),_0x28cdfc[_0x24a281(0x232)]&&console[_0x24a281(0x202)](_0x24a281(0x1ff)+_0x28cdfc[_0x24a281(0x232)]),0x1;throw _0x28cdfc;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:folder:show';['description']=a25_0x288065(0x1c3);async[a25_0x288065(0x222)](_0x236bc7){const _0x32ade6=a25_0x288065,{options:_0x1e3408,args:_0x113c7b,tdx:_0x4a47a3}=_0x236bc7;if(_0x113c7b[_0x32ade6(0x210)]===0x0)return console[_0x32ade6(0x202)](_0x32ade6(0x1f0)),console['error'](_0x32ade6(0x253)),0x1;try{const {parentId:_0xf38790,childId:_0x5176a8}=parseSegmentRef(_0x113c7b[0x0]);_0x1e3408['verbose']&&(console[_0x32ade6(0x202)](_0x32ade6(0x1d6)+_0x1e3408['site']),console[_0x32ade6(0x202)](_0x32ade6(0x21d)+_0xf38790),_0x5176a8&&console[_0x32ade6(0x202)](_0x32ade6(0x23b)+_0x5176a8));if(!_0x5176a8)return console[_0x32ade6(0x202)](_0x32ade6(0x1ea)),0x1;const _0x4cfc9a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf38790+_0x32ade6(0x1f4),()=>_0x4a47a3[_0x32ade6(0x20c)][_0x32ade6(0x21e)](_0xf38790),{'verbose':_0x1e3408[_0x32ade6(0x1e0)]}),_0x8c003=_0x4cfc9a['data'];_0x1e3408[_0x32ade6(0x1e0)]&&console[_0x32ade6(0x202)](_0x32ade6(0x220)+_0x8c003);const _0x487055=await withSpinner(_0x32ade6(0x257)+_0x5176a8+_0x32ade6(0x1f4),()=>_0x4a47a3[_0x32ade6(0x20c)][_0x32ade6(0x224)](_0x8c003,_0x5176a8),{'verbose':_0x1e3408[_0x32ade6(0x1e0)]}),_0x23726e=_0x487055['data'];_0x1e3408[_0x32ade6(0x1e0)]&&console[_0x32ade6(0x202)](_0x32ade6(0x1f3)+_0x23726e);const _0x312c46=await withSpinner(_0x32ade6(0x209)+_0x5176a8+'\x27...',()=>_0x4a47a3[_0x32ade6(0x20c)]['getFolder'](_0x23726e),{'verbose':_0x1e3408['verbose']});return await handleSDKOutput([_0x312c46['data']],_0x1e3408),0x0;}catch(_0x374fd4){if(_0x374fd4 instanceof SDKError)return console[_0x32ade6(0x202)](_0x32ade6(0x1c5)+_0x374fd4[_0x32ade6(0x256)]),_0x374fd4['cause']&&console[_0x32ade6(0x202)](_0x32ade6(0x1ff)+_0x374fd4[_0x32ade6(0x232)]),0x1;throw _0x374fd4;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1e1);[a25_0x288065(0x1e8)]=a25_0x288065(0x1f6);async[a25_0x288065(0x222)](_0x4631fa){const _0x5d660d=a25_0x288065,{options:_0x20b2cc,args:_0x1f1b3e,tdx:_0x56a761}=_0x4631fa,_0x528dbf=_0x1f1b3e[0x0];if(!_0x528dbf)return console[_0x5d660d(0x202)](_0x5d660d(0x24d)),console[_0x5d660d(0x202)](_0x5d660d(0x204)),console[_0x5d660d(0x202)](_0x5d660d(0x245)),console[_0x5d660d(0x202)]('Examples:'),console[_0x5d660d(0x202)](_0x5d660d(0x1c2)),console['error'](_0x5d660d(0x247)),0x1;try{const _0x4b694d=_0x20b2cc[_0x5d660d(0x21b)],_0x1c45b0=await resolveSegmentTarget(_0x528dbf,_0x4b694d,_0x20b2cc[_0x5d660d(0x1e0)]);_0x20b2cc[_0x5d660d(0x1e0)]&&console[_0x5d660d(0x202)](_0x5d660d(0x1fb)+_0x1c45b0);const _0x257987=await withSpinner(_0x5d660d(0x1ce)+_0x528dbf+_0x5d660d(0x1f4),()=>_0x56a761[_0x5d660d(0x20c)]['resolvePathToResource'](_0x1c45b0),{'verbose':_0x20b2cc[_0x5d660d(0x1e0)]}),_0x463f2d=_0x257987[_0x5d660d(0x23a)];_0x20b2cc[_0x5d660d(0x1e0)]&&(console['error'](_0x5d660d(0x1f1)+_0x463f2d[_0x5d660d(0x1c1)]),console[_0x5d660d(0x202)](_0x5d660d(0x22c)+_0x463f2d['parentId']));if(_0x463f2d[_0x5d660d(0x1c1)]===_0x5d660d(0x227))return console[_0x5d660d(0x202)](_0x5d660d(0x207)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x463f2d['type']===_0x5d660d(0x255))return console[_0x5d660d(0x202)](_0x5d660d(0x1cb)),console[_0x5d660d(0x202)](_0x5d660d(0x252)),0x1;if(!_0x463f2d['segmentId'])throw new SDKError(ErrorCode[_0x5d660d(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x43d052=await withSpinner(_0x5d660d(0x214),()=>_0x56a761['segment'][_0x5d660d(0x1cf)](_0x463f2d['parentId'],_0x463f2d[_0x5d660d(0x1ba)]),{'verbose':_0x20b2cc[_0x5d660d(0x1e0)]}),_0x5551c3=_0x43d052['data'];return _0x20b2cc['format']===_0x5d660d(0x1f8)||_0x20b2cc['format']==='jsonl'?await handleSDKOutput([{'sql':_0x5551c3}],_0x20b2cc):console[_0x5d660d(0x1be)](_0x5551c3),0x0;}catch(_0x3abf40){if(_0x3abf40 instanceof SDKError)return console[_0x5d660d(0x202)](_0x5d660d(0x1c5)+_0x3abf40['message']),_0x3abf40['cause']&&console[_0x5d660d(0x202)](_0x5d660d(0x1ff)+_0x3abf40[_0x5d660d(0x232)]),0x1;throw _0x3abf40;}}}function a25_0x561c(_0x1f2e15,_0x2c7ece){_0x1f2e15=_0x1f2e15-0x1ba;const _0x3390d2=a25_0x3390();let _0x561ccc=_0x3390d2[_0x1f2e15];return _0x561ccc;}function a25_0x3390(){const _0xaaf216=['Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','18AywYBH','\x20rows\x20','Listing\x20folders\x20for\x20parent\x20\x27','description','segment:folder:create','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','/app/ps/','Executing\x20segment\x20query...','\x20\x20Parent\x20segment:\x20','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolved\x20folder\x20ID:\x20','\x27...','✔\x20Created\x20folder\x20\x27','Get\x20SQL\x20query\x20for\x20child\x20segment','toLocaleString','json','segment:folder:list','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Target\x20path:\x20','SQL\x20query:\x0a','/e/','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Cause:\x20','Creating\x20folder\x20\x27','4qduKCL','error','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','listFolders','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','getSegment','Fetching\x20folder\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','segment','Usage:\x20tdx\x20segment\x20describe\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','length','Examples:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Fetching\x20SQL\x20for\x20segment...','813491AUBTKB','SEGMENT_FOLDER_NOT_FOUND','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','✔\x20Query\x20completed:\x20Processed\x20','467165eyoeEd','parentSegment','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Parent\x20name:\x20','resolveParentId','\x20\x20Segment\x20name:\x20','Resolved\x20parent\x20ID:\x20','398588LzTIif','execute','Options:','resolveFolderId','Resolving\x20parent\x20folder\x20\x27','in\x20','folder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','1281207RzKmEL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','green','Parent\x20ID:\x20','query','Segment\x20ID:\x20','Resolving\x20path\x20\x27','jobId','elapsedTimeMillis','cause','name','Show\x20segment\x20or\x20folder\x20details','site','parentFolder','\x20folder','Fetching\x20segment\x20details...','replace','data','Folder\x20name:\x20','\x20Opening\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','test','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','folderId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\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','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','trim','Usage:\x20tdx\x20sg\x20desc\x20<name>','✖\x20Query\x20failed\x20[','Show\x20folder\x20or\x20child\x20segment\x20details','✔\x20Found\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','parentId','stats','Resolving\x20parent\x20segment\x20\x27','SEGMENT_NOT_FOUND','Use:\x20tdx\x20ps\x20sql','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Use:\x20tdx\x20ps\x20view','parent','message','Resolving\x20folder\x20\x27','segmentId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','cyan','1436589UZhtsa','log','(root)','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','type','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20','resolvePathToResource','272570OYIAAP','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20[Job\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','getParent','Create\x20segment\x20folder\x20for\x20organization','Resolving\x20\x27','getSegmentSQL','code','Fetching\x20folder\x20details...','Resolved\x20relative\x20path\x20to:\x20','url','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment:desc','Site:\x20','Resolved\x20parent\x20folder\x20ID:\x20','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','setJobId','Parent\x20segment:\x20','fullPath','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x27\x20with\x20ID:\x20','verbose','segment:sql','Folder\x20ID:\x20','671440ktdJhU'];a25_0x3390=function(){return _0xaaf216;};return a25_0x3390();}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x288065(0x1e9);[a25_0x288065(0x1e8)]=a25_0x288065(0x1cd);async[a25_0x288065(0x222)](_0x5d4598){const _0x25807b=a25_0x288065,{options:_0x68defc,args:_0x12be7b,tdx:_0x4bb95d}=_0x5d4598,_0xb3406b=_0x68defc;if(_0x12be7b[_0x25807b(0x210)]<0x2)return console['error'](_0x25807b(0x244)),console[_0x25807b(0x202)](_0x25807b(0x1bb)),0x1;const _0x53e814=_0x12be7b[0x0],_0x100f43=_0x12be7b[0x1];_0xb3406b[_0x25807b(0x1e0)]&&(console['error'](_0x25807b(0x1d6)+_0xb3406b[_0x25807b(0x235)]),console['error'](_0x25807b(0x1db)+_0x53e814),console[_0x25807b(0x202)]('Folder\x20name:\x20'+_0x100f43));let _0x541d79;if(_0xb3406b['parentFolder']){const _0xf3b569=_0xb3406b[_0x25807b(0x236)],_0x52ab34=await withSpinner(_0x25807b(0x250)+_0x53e814+_0x25807b(0x1f4),()=>_0x4bb95d['segment']['resolveParentId'](_0x53e814),{'verbose':_0xb3406b[_0x25807b(0x1e0)]}),_0x5c3d80=_0x52ab34[_0x25807b(0x23a)],_0x123f26=await withSpinner(_0x25807b(0x225)+_0xf3b569+_0x25807b(0x1f4),()=>_0x4bb95d[_0x25807b(0x20c)]['resolveFolderId'](_0x5c3d80,_0xf3b569),{'verbose':_0xb3406b[_0x25807b(0x1e0)]});_0x541d79=_0x123f26[_0x25807b(0x23a)],_0xb3406b[_0x25807b(0x1e0)]&&console['error'](_0x25807b(0x1d7)+_0x541d79);}const _0x9a1b44={'name':_0x100f43,'description':_0xb3406b['description'],'parentFolderId':_0x541d79},_0x4656b1=await withSpinner(_0x25807b(0x200)+_0x100f43+_0x25807b(0x1f4),()=>_0x4bb95d[_0x25807b(0x20c)]['createFolder'](_0x53e814,_0x9a1b44),{'verbose':_0xb3406b[_0x25807b(0x1e0)]}),_0x50e522=_0x4656b1['data'];return console[_0x25807b(0x202)](_0x25807b(0x1f5)+_0x50e522[_0x25807b(0x233)]+_0x25807b(0x1df)+_0x50e522['id']),await handleSDKOutput([_0x50e522],_0xb3406b),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:view';[a25_0x288065(0x1e8)]=a25_0x288065(0x24b);async[a25_0x288065(0x222)](_0xc79376){const _0x474c9e=a25_0x288065,{options:_0x3a1052,args:_0x456311,tdx:_0x54ea9d}=_0xc79376,_0xf9cc2=_0x456311[0x0];if(!_0xf9cc2)return console[_0x474c9e(0x202)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x474c9e(0x202)](_0x474c9e(0x203)),console['error'](_0x474c9e(0x22a)),console[_0x474c9e(0x202)](_0x474c9e(0x223)),console['error'](_0x474c9e(0x20a)),console[_0x474c9e(0x202)]('Examples:'),console['error'](_0x474c9e(0x1ef)),console[_0x474c9e(0x202)](_0x474c9e(0x21c)),console['error'](_0x474c9e(0x240)),console[_0x474c9e(0x202)](_0x474c9e(0x1c4)),0x1;try{const _0x329212=_0x3a1052[_0x474c9e(0x21b)],_0x1b2181=await resolveSegmentTarget(_0xf9cc2,_0x329212,_0x3a1052[_0x474c9e(0x1e0)]);_0x3a1052[_0x474c9e(0x1e0)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1fb)+_0x1b2181);const _0x4a67f1=await withSpinner(_0x474c9e(0x1ce)+_0xf9cc2+_0x474c9e(0x1f4),()=>_0x54ea9d['segment']['resolvePathToResource'](_0x1b2181),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]}),_0x38b0a2=_0x4a67f1[_0x474c9e(0x23a)];_0x3a1052[_0x474c9e(0x1e0)]&&(console['error']('Resolved\x20type:\x20'+_0x38b0a2[_0x474c9e(0x1c1)]),console[_0x474c9e(0x202)](_0x474c9e(0x22c)+_0x38b0a2[_0x474c9e(0x24e)]),_0x38b0a2[_0x474c9e(0x243)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1e2)+_0x38b0a2[_0x474c9e(0x243)]),_0x38b0a2['segmentId']&&console['error'](_0x474c9e(0x22e)+_0x38b0a2[_0x474c9e(0x1ba)]));if(_0x3a1052['web']){if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x227))return console[_0x474c9e(0x202)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x255))return console['error'](_0x474c9e(0x1fe)),console['error']('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x38b0a2[_0x474c9e(0x1ba)])throw new SDKError(ErrorCode[_0x474c9e(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4404e4=getConsoleNextUrl(_0x3a1052['site'],_0x474c9e(0x1eb)+_0x38b0a2[_0x474c9e(0x24e)]+'/e/'+_0x38b0a2[_0x474c9e(0x1ba)]);return console[_0x474c9e(0x202)](a25_0x3e730a[_0x474c9e(0x22b)]('✔')+_0x474c9e(0x23c)+a25_0x3e730a[_0x474c9e(0x1bc)](_0x4404e4)),openBrowser(_0x4404e4),0x0;}if(_0x38b0a2['type']===_0x474c9e(0x227)){if(!_0x38b0a2['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4c82ba=await withSpinner(_0x474c9e(0x1d1),()=>_0x54ea9d['segment'][_0x474c9e(0x1dd)](_0x38b0a2[_0x474c9e(0x243)]),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]});await handleSingleObjectOutput(_0x4c82ba['data'],_0x3a1052);}else{if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x20c)){if(!_0x38b0a2[_0x474c9e(0x1ba)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x474c9e(0x23e));const _0x47e318=await withSpinner(_0x474c9e(0x238),()=>_0x54ea9d[_0x474c9e(0x20c)][_0x474c9e(0x208)](_0x38b0a2[_0x474c9e(0x24e)],_0x38b0a2[_0x474c9e(0x1ba)]),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]}),_0x208781=getConsoleNextUrl(_0x3a1052[_0x474c9e(0x235)],_0x474c9e(0x1eb)+_0x38b0a2['parentId']+_0x474c9e(0x1fd)+_0x38b0a2[_0x474c9e(0x1ba)]),_0x132be2=_0x47e318[_0x474c9e(0x23a)];_0x132be2[_0x474c9e(0x1d3)]=_0x208781,await handleSingleObjectOutput(_0x132be2,_0x3a1052);}else return console[_0x474c9e(0x202)](_0x474c9e(0x20b)),console[_0x474c9e(0x202)](_0x474c9e(0x254)),0x1;}return 0x0;}catch(_0xd8b2e){if(_0xd8b2e instanceof SDKError)return console[_0x474c9e(0x202)]('Error:\x20'+_0xd8b2e['message']),_0xd8b2e[_0x474c9e(0x232)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1ff)+_0xd8b2e[_0x474c9e(0x232)]),0x1;throw _0xd8b2e;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1d5);[a25_0x288065(0x1e8)]=a25_0x288065(0x20f);async[a25_0x288065(0x222)](_0x2a3d1b){const _0x488397=a25_0x288065,{options:_0x130154,args:_0x354c3a,tdx:_0x497d7c}=_0x2a3d1b,_0x19a9c5=_0x354c3a[0x0];if(!_0x19a9c5)return console['error'](_0x488397(0x24d)),console[_0x488397(0x202)](_0x488397(0x249)),console['error'](_0x488397(0x212)),console['error'](_0x488397(0x211)),console[_0x488397(0x202)](_0x488397(0x1d9)),console[_0x488397(0x202)](_0x488397(0x218)),0x1;try{const _0x30027b=_0x130154[_0x488397(0x21b)],_0x52798f=await resolveSegmentTarget(_0x19a9c5,_0x30027b,_0x130154[_0x488397(0x1e0)]);_0x130154[_0x488397(0x1e0)]&&console['error'](_0x488397(0x1fb)+_0x52798f);const _0x2b92f2=await withSpinner(_0x488397(0x1ce)+_0x19a9c5+'\x27...',()=>_0x497d7c['segment'][_0x488397(0x1c6)](_0x52798f),{'verbose':_0x130154['verbose']}),_0x17a1bd=_0x2b92f2[_0x488397(0x23a)];_0x130154['verbose']&&(console[_0x488397(0x202)](_0x488397(0x1f1)+_0x17a1bd[_0x488397(0x1c1)]),console[_0x488397(0x202)](_0x488397(0x22c)+_0x17a1bd['parentId']));if(_0x17a1bd[_0x488397(0x1c1)]===_0x488397(0x227))return console[_0x488397(0x202)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0x488397(0x228)),0x1;if(_0x17a1bd[_0x488397(0x1c1)]===_0x488397(0x255))return console[_0x488397(0x202)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x17a1bd[_0x488397(0x1ba)])throw new SDKError(ErrorCode[_0x488397(0x251)],_0x488397(0x23e));const _0x122a79=await withSpinner(_0x488397(0x214),()=>_0x497d7c['segment'][_0x488397(0x1cf)](_0x17a1bd[_0x488397(0x24e)],_0x17a1bd['segmentId']),{'verbose':_0x130154['verbose']}),_0x443c1d=_0x122a79[_0x488397(0x23a)],_0x3b7aff=await executeSchemaQuery(_0x443c1d,_0x497d7c,_0x130154);return await handleQueryOutput(_0x3b7aff,_0x130154),0x0;}catch(_0x1bd040){if(_0x1bd040 instanceof SDKError)return console[_0x488397(0x202)](_0x488397(0x1c5)+_0x1bd040[_0x488397(0x256)]),_0x1bd040[_0x488397(0x232)]&&console[_0x488397(0x202)](_0x488397(0x1ff)+_0x1bd040['cause']),0x1;throw _0x1bd040;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x5e6a(_0x1d674d,_0x18c0f5){_0x1d674d=_0x1d674d-0x136;const _0x50adf8=a26_0x50ad();let _0x5e6ac3=_0x50adf8[_0x1d674d];return _0x5e6ac3;}const a26_0x3c5b1f=a26_0x5e6a;(function(_0x4cac37,_0x121ff5){const _0x7995ad=a26_0x5e6a,_0x6a379f=_0x4cac37();while(!![]){try{const _0x5409a8=parseInt(_0x7995ad(0x138))/0x1+-parseInt(_0x7995ad(0x137))/0x2*(-parseInt(_0x7995ad(0x13f))/0x3)+parseInt(_0x7995ad(0x160))/0x4*(-parseInt(_0x7995ad(0x154))/0x5)+parseInt(_0x7995ad(0x141))/0x6*(-parseInt(_0x7995ad(0x14f))/0x7)+parseInt(_0x7995ad(0x152))/0x8+-parseInt(_0x7995ad(0x13e))/0x9+-parseInt(_0x7995ad(0x167))/0xa*(-parseInt(_0x7995ad(0x164))/0xb);if(_0x5409a8===_0x121ff5)break;else _0x6a379f['push'](_0x6a379f['shift']());}catch(_0x2d7be6){_0x6a379f['push'](_0x6a379f['shift']());}}}(a26_0x50ad,0x97d91));function a26_0x50ad(){const _0x872b3f=['Target\x20path:\x20','length','18978322ZcIYDh','error','Resolving\x20folder\x20path\x20\x27','10klhGNp','\x27...','verbose','noCountPopulation','✔\x20Created\x20segment\x20\x27','invisible','Site:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','site','14ViwMvf','858028PqQHxW','Creating\x20segment\x20\x27','Parent\x20path:\x20','segments','segment','name','8272917NtTyjC','28479kBhKdG','createSegment','282mCeEoL','resolveFolderId','yellow','type','parent','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent:\x20','execute','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','kind','rule','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','147427EOClrB','segment:create','resolveParentId','892360wyqGEX','folder','295fXOSKQ','Segment\x20name:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Create\x20child\x20segment\x20with\x20filtering\x20rules','data','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','ruleFile','\x20\x20\x20Path:\x20','folderId','description','15612xqtOVY','Resolved\x20relative\x20path\x20to:\x20'];a26_0x50ad=function(){return _0x872b3f;};return a26_0x50ad();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x1b64ae from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x3c5b1f(0x13d)]=a26_0x3c5b1f(0x150);['description']=a26_0x3c5b1f(0x157);async[a26_0x3c5b1f(0x149)](_0x1e2311){const _0x5f243d=a26_0x3c5b1f;console[_0x5f243d(0x165)](a26_0x1b64ae[_0x5f243d(0x143)](_0x5f243d(0x159))),console['error'](a26_0x1b64ae['yellow'](_0x5f243d(0x14e)));const {options:_0x3bdcc1,args:_0x250983,tdx:_0x34a0ce}=_0x1e2311,_0x214eb5=_0x3bdcc1;if(_0x250983['length']===0x0)return console['error'](_0x5f243d(0x15a)),console['error'](_0x5f243d(0x156)),console[_0x5f243d(0x165)]('Examples:'),console[_0x5f243d(0x165)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x5f243d(0x165)](_0x5f243d(0x14a)),console[_0x5f243d(0x165)](_0x5f243d(0x147)),0x1;const _0x3c9090=_0x250983[0x0],_0x2c10fc=_0x3bdcc1['segmentPath'];let _0x5de42f=_0x3c9090;_0x2c10fc&&!_0x3c9090['includes']('/')&&(_0x5de42f=_0x2c10fc+'/'+_0x3c9090,_0x214eb5[_0x5f243d(0x169)]&&console['error'](_0x5f243d(0x161)+_0x5de42f));const _0x5bbe45=parsePath(_0x5de42f);if(_0x5bbe45[_0x5f243d(0x13b)][_0x5f243d(0x163)]<0x2)return console['error'](_0x5f243d(0x16e)),console[_0x5f243d(0x165)](_0x5f243d(0x146)),0x1;const _0x2306c9=_0x5bbe45[_0x5f243d(0x13b)][0x0],_0x43a5b4=getBaseName(_0x5de42f),_0x3a78af=getParentPath(_0x5de42f);_0x214eb5[_0x5f243d(0x169)]&&(console[_0x5f243d(0x165)](_0x5f243d(0x16d)+_0x214eb5[_0x5f243d(0x136)]),console['error'](_0x5f243d(0x162)+_0x5de42f),console[_0x5f243d(0x165)](_0x5f243d(0x148)+_0x2306c9),console[_0x5f243d(0x165)](_0x5f243d(0x155)+_0x43a5b4),console[_0x5f243d(0x165)](_0x5f243d(0x13a)+_0x3a78af));const _0x28b160=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2306c9+'\x27...',()=>_0x34a0ce[_0x5f243d(0x13c)][_0x5f243d(0x151)](_0x2306c9),{'verbose':_0x214eb5[_0x5f243d(0x169)]}),_0x3e2ba7=_0x28b160[_0x5f243d(0x158)];let _0x26d32e;if(_0x5bbe45[_0x5f243d(0x13b)][_0x5f243d(0x163)]>0x2){const _0x2494fb=await withSpinner(_0x5f243d(0x166)+_0x3a78af+_0x5f243d(0x168),()=>_0x34a0ce[_0x5f243d(0x13c)]['resolvePathToResource'](_0x3a78af),{'verbose':_0x214eb5[_0x5f243d(0x169)]}),_0x2373c1=_0x2494fb[_0x5f243d(0x158)];if(_0x2373c1['type']!=='folder'&&_0x2373c1[_0x5f243d(0x144)]!==_0x5f243d(0x145))return console[_0x5f243d(0x165)](_0x5f243d(0x14b)),0x1;_0x26d32e=_0x2373c1[_0x5f243d(0x15e)];}else{if(_0x214eb5[_0x5f243d(0x153)]){const _0x443ef1=await withSpinner('Resolving\x20folder\x20\x27'+_0x214eb5['folder']+_0x5f243d(0x168),()=>_0x34a0ce[_0x5f243d(0x13c)][_0x5f243d(0x142)](_0x3e2ba7,_0x214eb5[_0x5f243d(0x153)]),{'verbose':_0x214eb5['verbose']});_0x26d32e=_0x443ef1[_0x5f243d(0x158)];}}_0x214eb5['verbose']&&_0x26d32e&&console['error'](_0x5f243d(0x15b)+_0x26d32e);const _0x40a6c1=await loadJSONFromOptions(_0x214eb5[_0x5f243d(0x14d)],_0x214eb5[_0x5f243d(0x15c)]),_0x2032bd={'name':_0x43a5b4,'description':_0x214eb5[_0x5f243d(0x15f)],'rule':_0x40a6c1,'kind':_0x214eb5[_0x5f243d(0x14c)]!==undefined?parseInt(_0x214eb5[_0x5f243d(0x14c)],0xa):undefined,'isVisible':_0x214eb5[_0x5f243d(0x16c)]?![]:undefined,'segmentFolderId':_0x26d32e,'countPopulation':_0x214eb5[_0x5f243d(0x16a)]?![]:undefined},_0x43035d=await withSpinner(_0x5f243d(0x139)+_0x43a5b4+_0x5f243d(0x168),()=>_0x34a0ce['segment'][_0x5f243d(0x140)](_0x3e2ba7,_0x2032bd),{'verbose':_0x214eb5['verbose']}),_0x69967b=_0x43035d[_0x5f243d(0x158)];return console[_0x5f243d(0x165)](_0x5f243d(0x16b)+_0x69967b[_0x5f243d(0x13d)]+'\x27\x20with\x20ID:\x20'+_0x69967b['id']),_0x5de42f!==_0x3c9090&&console[_0x5f243d(0x165)](_0x5f243d(0x15d)+_0x5de42f),await handleSDKOutput([_0x69967b],_0x214eb5),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x1bf3b0=a27_0x1cc8;(function(_0x3d60c8,_0x294b35){const _0x45363b=a27_0x1cc8,_0x47cec0=_0x3d60c8();while(!![]){try{const _0x1050ad=parseInt(_0x45363b(0x1ae))/0x1*(-parseInt(_0x45363b(0x1a4))/0x2)+-parseInt(_0x45363b(0x1b0))/0x3+parseInt(_0x45363b(0x1bc))/0x4*(-parseInt(_0x45363b(0x1ab))/0x5)+-parseInt(_0x45363b(0x1b2))/0x6+parseInt(_0x45363b(0x1a8))/0x7*(parseInt(_0x45363b(0x1b7))/0x8)+-parseInt(_0x45363b(0x1a9))/0x9*(-parseInt(_0x45363b(0x1b1))/0xa)+parseInt(_0x45363b(0x1b6))/0xb;if(_0x1050ad===_0x294b35)break;else _0x47cec0['push'](_0x47cec0['shift']());}catch(_0xf63f87){_0x47cec0['push'](_0x47cec0['shift']());}}}(a27_0x2b90,0x4110e));function a27_0x2b90(){const _0x1de37d=['2ozigxO','site','json','data','3021081aQLWnW','9aDCUKB','Parent\x20segment:\x20','5zwVuzS','description','segment:fields','98876lLsLwL','Error:\x20Parent\x20segment\x20name\x20is\x20required','37269dCfvet','1645690QarRxe','647058jLqKZL','\x27...','execute','parentSegment','1331693Cvcodc','8SQGiQi','\x20field','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Site:\x20','926252CHDSmn','length','verbose','error','✔\x20Found\x20','jsonl','listFields'];a27_0x2b90=function(){return _0x1de37d;};return a27_0x2b90();}function a27_0x1cc8(_0x4c5d4e,_0x5e32c9){_0x4c5d4e=_0x4c5d4e-0x1a3;const _0x2b9094=a27_0x2b90();let _0x1cc813=_0x2b9094[_0x4c5d4e];return _0x1cc813;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a27_0x1bf3b0(0x1ad);[a27_0x1bf3b0(0x1ac)]='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x1bf3b0(0x1b4)](_0x4eae07){const _0x50eeda=a27_0x1bf3b0,{options:_0x4bfe2b,args:_0x7f00e9,tdx:_0x3e2c4c}=_0x4eae07,_0x51204a=_0x7f00e9[0x0]||_0x4bfe2b[_0x50eeda(0x1b5)];if(!_0x51204a)return console[_0x50eeda(0x1bf)](_0x50eeda(0x1af)),console[_0x50eeda(0x1bf)](_0x50eeda(0x1b9)),console[_0x50eeda(0x1bf)](_0x50eeda(0x1ba)),0x1;_0x4bfe2b[_0x50eeda(0x1be)]&&(console[_0x50eeda(0x1bf)](_0x50eeda(0x1bb)+_0x4bfe2b[_0x50eeda(0x1a5)]),console[_0x50eeda(0x1bf)](_0x50eeda(0x1aa)+_0x51204a));const _0x5d6bb1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x51204a+_0x50eeda(0x1b3),()=>_0x3e2c4c['segment'][_0x50eeda(0x1a3)](_0x51204a),{'verbose':_0x4bfe2b[_0x50eeda(0x1be)]}),_0x260343=_0x5d6bb1[_0x50eeda(0x1a7)];console[_0x50eeda(0x1bf)](_0x50eeda(0x1c0)+_0x260343[_0x50eeda(0x1bd)]+_0x50eeda(0x1b8)+(_0x260343[_0x50eeda(0x1bd)]!==0x1?'s':''));if(_0x4bfe2b[_0x50eeda(0x1a6)]||_0x4bfe2b[_0x50eeda(0x1c1)])return await handleSDKOutput(_0x260343,_0x4bfe2b),0x0;return displayFieldsHumanReadable(_0x260343,_0x51204a),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a28_0x255f(){const _0xb97d66=['content','journeyVersions','8xlFVrG','Error:\x20','error','cwd','Target\x20resource:\x20','\x20unchanged\x20files','✔\x20Context\x20set:\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Site:\x20','Pulling\x20segments\x20from\x20\x27','isNew','dryRun','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x27...','36990QJdFDV','\x0aPull\x20summary\x20for\x20\x27','\x20segments','yellow','segment','621004JNWKur','\x20with\x20','red','message','\x0aChanges\x20to\x20\x27','\x20changed\x20files','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','1344246sljtrc','absolutePath','\x20\x20🗺️\x20\x20','relativePath','\x20new\x20files','5CVmfMo','6XhFibw','parentSegment','verbose','Parent\x20segment:\x20','4llUEcC','green','pullSegments','session','parent_segment','hasChanges','targetDir','data','2679488xtjfxg','2648940HeAOmk','11xmsZoB','file','dim','Write\x20','segments','dirname','parentName','Aborted.','counts','\x20\x20Target:\x20','132380cOvNsY','\x20versions)','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)','1439beLDRU','description','helpText','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','utf-8','files','errorCode','filter','activations','\x20files\x20to\x20','repeat','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','length','\x20\x20🎯\x20','journeys'];a28_0x255f=function(){return _0xb97d66;};return a28_0x255f();}const a28_0x59b5e4=a28_0xbc2e;(function(_0x581d92,_0x2ae7b4){const _0x5876f4=a28_0xbc2e,_0x32718a=_0x581d92();while(!![]){try{const _0x25796c=-parseInt(_0x5876f4(0x1fb))/0x1*(parseInt(_0x5876f4(0x233))/0x2)+-parseInt(_0x5876f4(0x22f))/0x3*(-parseInt(_0x5876f4(0x222))/0x4)+-parseInt(_0x5876f4(0x22e))/0x5*(parseInt(_0x5876f4(0x229))/0x6)+-parseInt(_0x5876f4(0x23b))/0x7*(-parseInt(_0x5876f4(0x20d))/0x8)+-parseInt(_0x5876f4(0x21d))/0x9+parseInt(_0x5876f4(0x1f8))/0xa+parseInt(_0x5876f4(0x23d))/0xb*(-parseInt(_0x5876f4(0x23c))/0xc);if(_0x25796c===_0x2ae7b4)break;else _0x32718a['push'](_0x32718a['shift']());}catch(_0x1390e0){_0x32718a['push'](_0x32718a['shift']());}}}(a28_0x255f,0x3e31e));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a28_0xbc2e(_0x486375,_0x5a8c25){_0x486375=_0x486375-0x1f3;const _0x255f6a=a28_0x255f();let _0xbc2ec3=_0x255f6a[_0x486375];return _0xbc2ec3;}import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x7d6aa0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x121ed6 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a28_0x59b5e4(0x1fc)]=a28_0x59b5e4(0x228);async['execute'](_0x2df472){const _0x1891a2=a28_0x59b5e4,{options:_0x4f8dd6,args:_0x24c966,tdx:_0x376b8e}=_0x2df472,_0x370165=_0x4f8dd6,_0x5a3891=await resolveTarget({'arg':_0x24c966[0x0],'contextParent':_0x4f8dd6[_0x1891a2(0x230)],'cwd':process[_0x1891a2(0x210)]()});if(!isSuccessfulResolution(_0x5a3891))return _0x5a3891[_0x1891a2(0x202)]==='no_parent'?(console['error'](a28_0x7d6aa0[_0x1891a2(0x220)](_0x1891a2(0x215))),console['error'](_0x1891a2(0x1fa)),console[_0x1891a2(0x20f)](_0x1891a2(0x1ff)),console[_0x1891a2(0x20f)](_0x1891a2(0x21b))):(console[_0x1891a2(0x20f)](a28_0x7d6aa0[_0x1891a2(0x224)](_0x1891a2(0x20e)+_0x5a3891[_0x1891a2(0x225)]+'\x0a')),_0x5a3891[_0x1891a2(0x1fd)]&&console[_0x1891a2(0x20f)](a28_0x7d6aa0['cyan'](_0x5a3891['helpText']))),0x1;const _0x21aaf3=_0x5a3891[_0x1891a2(0x1f4)],_0x43aea7=_0x5a3891[_0x1891a2(0x239)],_0x551b4b=_0x5a3891['type']===_0x1891a2(0x23e)?_0x5a3891['resourceName']:undefined;_0x370165[_0x1891a2(0x231)]&&(console[_0x1891a2(0x20f)](_0x1891a2(0x216)+_0x370165['site']),console['error'](_0x1891a2(0x232)+_0x21aaf3),_0x551b4b&&console['error'](_0x1891a2(0x211)+_0x551b4b));const _0x32c443=await withProgressSpinner(_0x1891a2(0x217)+_0x21aaf3+_0x1891a2(0x21c),_0x3d8d87=>_0x376b8e[_0x1891a2(0x221)][_0x1891a2(0x235)](_0x21aaf3,{'targetDir':_0x43aea7,'targetResourceName':_0x551b4b,'verbose':_0x370165[_0x1891a2(0x231)],'progress':{'update':_0xcee9ad=>{const _0x1cb098=_0x1891a2;_0x3d8d87['setPhase'](_0xcee9ad),_0x370165[_0x1cb098(0x231)]&&console['error']('\x20\x20'+_0xcee9ad);}}}),{'verbose':_0x370165[_0x1891a2(0x231)]}),_0x2a7382=_0x32c443[_0x1891a2(0x23a)];if(_0x2a7382['counts']['segments']===0x0&&_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x20a)]===0x0)return console[_0x1891a2(0x20f)](a28_0x7d6aa0['yellow'](_0x1891a2(0x214)+_0x2a7382[_0x1891a2(0x1f4)]+'\x27')),0x0;const _0x4c1249=_0x2a7382[_0x1891a2(0x201)][_0x1891a2(0x203)](_0x39966c=>_0x39966c[_0x1891a2(0x218)]),_0x5df05a=_0x2a7382[_0x1891a2(0x201)]['filter'](_0x1404f3=>!_0x1404f3[_0x1891a2(0x218)]&&_0x1404f3[_0x1891a2(0x238)]),_0x5231fc=_0x2a7382[_0x1891a2(0x201)][_0x1891a2(0x203)](_0x17916a=>!_0x17916a[_0x1891a2(0x218)]&&!_0x17916a[_0x1891a2(0x238)]);console[_0x1891a2(0x20f)](_0x1891a2(0x21e)+_0x2a7382['parentName']+'\x27:'),console[_0x1891a2(0x20f)](_0x1891a2(0x209)+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x241)]+_0x1891a2(0x21f))+_0x1891a2(0x223)+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x204)]+'\x20activations'));if(_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x20a)]>0x0){const _0x32c7ea=_0x2a7382['counts']['journeyVersions']>_0x2a7382['counts'][_0x1891a2(0x20a)]?'\x20('+_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x20c)]+_0x1891a2(0x1f9):'';console[_0x1891a2(0x20f)](_0x1891a2(0x22b)+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382['counts'][_0x1891a2(0x20a)]+'\x20journeys')+a28_0x7d6aa0[_0x1891a2(0x23f)](_0x32c7ea));}console['error']('\x20\x20'+a28_0x7d6aa0[_0x1891a2(0x234)]('+\x20'+_0x4c1249[_0x1891a2(0x208)]+_0x1891a2(0x22d))),console['error']('\x20\x20'+a28_0x7d6aa0['yellow']('~\x20'+_0x5df05a[_0x1891a2(0x208)]+_0x1891a2(0x227))),console[_0x1891a2(0x20f)]('\x20\x20'+a28_0x7d6aa0[_0x1891a2(0x23f)]('=\x20'+_0x5231fc[_0x1891a2(0x208)]+_0x1891a2(0x212))),console['error'](_0x1891a2(0x1f7)+a28_0x7d6aa0['cyan'](_0x2a7382[_0x1891a2(0x239)])+'\x0a');if(_0x5df05a['length']>0x0)for(const _0x1262d4 of _0x5df05a){console[_0x1891a2(0x20f)](_0x1891a2(0x226)+_0x1262d4[_0x1891a2(0x22c)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x1262d4['diff']),console['error']('─'[_0x1891a2(0x206)](0x3c));}if(_0x370165[_0x1891a2(0x219)])return console[_0x1891a2(0x20f)](a28_0x7d6aa0[_0x1891a2(0x220)](_0x1891a2(0x207))),0x0;if(_0x4c1249[_0x1891a2(0x208)]===0x0&&_0x5df05a[_0x1891a2(0x208)]===0x0)return console[_0x1891a2(0x20f)](a28_0x7d6aa0['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2a7382[_0x1891a2(0x1f4)]},_0x370165[_0x1891a2(0x236)]),console[_0x1891a2(0x20f)](a28_0x7d6aa0[_0x1891a2(0x234)](_0x1891a2(0x213)+a28_0x7d6aa0[_0x1891a2(0x23f)](_0x1891a2(0x237))+'\x20=\x20'+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382['parentName']))),0x0;if(!_0x370165['yes']){const _0x11dd62=await confirmKey(_0x1891a2(0x240)+(_0x4c1249[_0x1891a2(0x208)]+_0x5df05a[_0x1891a2(0x208)])+_0x1891a2(0x21a));if(!_0x11dd62)return console[_0x1891a2(0x20f)](_0x1891a2(0x1f5)),0x1;}for(const _0x2f6df9 of _0x2a7382['files']){if(_0x2f6df9[_0x1891a2(0x218)]||_0x2f6df9['hasChanges']){const _0x28a4ed=a28_0x121ed6[_0x1891a2(0x1f3)](_0x2f6df9[_0x1891a2(0x22a)]);!existsSync(_0x28a4ed)&&mkdirSync(_0x28a4ed,{'recursive':!![]}),writeFileSync(_0x2f6df9[_0x1891a2(0x22a)],_0x2f6df9[_0x1891a2(0x20b)],_0x1891a2(0x200));}}return console[_0x1891a2(0x20f)](a28_0x7d6aa0[_0x1891a2(0x234)]('✔\x20Pulled\x20'+(_0x4c1249[_0x1891a2(0x208)]+_0x5df05a['length'])+_0x1891a2(0x205)+_0x2a7382[_0x1891a2(0x239)])),saveSessionContext({'parent_segment':_0x2a7382[_0x1891a2(0x1f4)]},_0x370165[_0x1891a2(0x236)]),console[_0x1891a2(0x20f)](a28_0x7d6aa0['green'](_0x1891a2(0x213)+a28_0x7d6aa0[_0x1891a2(0x23f)](_0x1891a2(0x237))+'\x20=\x20'+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382[_0x1891a2(0x1f4)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x1f8ccc=a29_0x5696;(function(_0x79a4a0,_0x3a1fdd){const _0x54d018=a29_0x5696,_0xbbcd25=_0x79a4a0();while(!![]){try{const _0x5e3986=parseInt(_0x54d018(0x1ad))/0x1+-parseInt(_0x54d018(0x176))/0x2*(parseInt(_0x54d018(0x183))/0x3)+-parseInt(_0x54d018(0x14e))/0x4+-parseInt(_0x54d018(0x146))/0x5*(-parseInt(_0x54d018(0x1be))/0x6)+-parseInt(_0x54d018(0x13e))/0x7*(-parseInt(_0x54d018(0x1cc))/0x8)+-parseInt(_0x54d018(0x1c7))/0x9+parseInt(_0x54d018(0x162))/0xa*(parseInt(_0x54d018(0x17a))/0xb);if(_0x5e3986===_0x3a1fdd)break;else _0xbbcd25['push'](_0xbbcd25['shift']());}catch(_0x2459f0){_0xbbcd25['push'](_0xbbcd25['shift']());}}}(a29_0x59a4,0x883d2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a29_0x59a4(){const _0x1b22c7=['8MJEqDs','no_parent','updated','yamlConfig','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20to\x20create','verbose','\x20\x20Source:\x20','new','folderId','Fetching\x20existing\x20activations...','segment\x20or\x20journey','2531368RhHije','segments','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20delete','getParent','idToName','\x20changes?','3145255kzQuVI','listSegments','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','state','Fetching\x20connections\x20for\x20name\x20resolution...','connection','file','site','467616vjoDsr','isNew','audienceId','activations','attributes','journeyBundleId','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)','\x27...','helpText','push','get','length','\x20\x20\x20\x20','diff','Scoped\x20to\x20folder:\x20','toString','Fetching\x20existing\x20journeys...','Fetching\x20parent\x20segment\x20details...','Site:\x20','\x20\x20Activations:\x20','271790nkMhXY','targetDir','createdSegmentIds','nameToType','listJourneysWithDetailsFromParentSegment','segment:push','.yml','repeat','\x20deleted','blue','toCreate','Changes\x20to:','existingJourney','list','\x20\x20📊\x20Segments:','\x20activations]','parentFolder','parentSegment','No\x20','listActivations','2dzWnXq','\x20changed','\x20updated','dryRun','220FUJoYh','\x20created','journeyId','all','segment','journeysOnly','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','paused','journeyBundleName','1702185HxEttH','type','folderPath','/j/da/je','\x20\x20Segments:\x20','buildUserMaps','then','getOutputSchemaWithCache','journeys','yes','green','add','yellow','updatedAt','Push\x20','errorCode','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','description','filePath','New\x20journey:','results','map','set','isScoped','message','Parent\x20segment:\x20','(Journey\x20will\x20be\x20deleted)','\x20to\x20update','error','changed','Error\x20parsing\x20YAML:\x20','listFolders','\x20folders\x20to\x20create','cyan','Preparing\x20journeys...','createdAt','dim','user','delete','deleted','endsWith','/app/ps/','493811Piwrif','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Activations:','\x0aValidation\x20failed:','Fetching\x20existing\x20segments...','\x20unchanged','\x0a✔\x20Push\x20complete','segmentFolderId','created','toUpdate','parent_name','Resolving\x20parent\x20segment\x20\x27','\x20\x20Journeys:\x20','Aborted.','nameToId','join','unchanged','6KEmqNr','toDelete','filter','setPhase','resolveParentId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','name','red','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','7071597wyhArZ','\x20new','journey','Delete\x20journey:','data'];a29_0x59a4=function(){return _0x1b22c7;};return a29_0x59a4();}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x2fe6bf from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a29_0x5696(_0x589b9f,_0x21f363){_0x589b9f=_0x589b9f-0x13a;const _0x59a45d=a29_0x59a4();let _0x56967d=_0x59a45d[_0x589b9f];return _0x56967d;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a29_0x1f8ccc(0x167);[a29_0x1f8ccc(0x194)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x2950c8){const _0x414698=a29_0x1f8ccc,{options:_0x1f5451,args:_0x430ad2,tdx:_0x20ba0d}=_0x2950c8,_0x1ba50a=_0x1f5451,_0x16aadb=await resolveTarget({'arg':_0x430ad2[0x0],'contextParent':_0x1f5451[_0x414698(0x173)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x16aadb))return _0x16aadb[_0x414698(0x192)]===_0x414698(0x1cd)?(console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18f)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x414698(0x154)),console[_0x414698(0x19f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a29_0x2fe6bf[_0x414698(0x1c5)]('Error:\x20'+_0x16aadb['message']+'\x0a')),_0x16aadb['helpText']&&console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1a4)](_0x16aadb[_0x414698(0x156)]))),0x1;if(_0x16aadb['type']===_0x414698(0x1b7))return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x1ae)+_0x16aadb[_0x414698(0x163)]+'\x0a')),console['error'](a29_0x2fe6bf[_0x414698(0x1a4)](_0x414698(0x1c3))),0x1;const _0x5ea2a1=_0x16aadb['parentName'],_0x5dc5f6=_0x16aadb[_0x414698(0x163)],_0x11a00a=_0x16aadb[_0x414698(0x184)]===_0x414698(0x14c)?_0x16aadb[_0x414698(0x195)]:undefined,_0x372446=getScopedDetails(_0x16aadb),_0x2c17f7=_0x372446?.[_0x414698(0x19a)]??![],_0x2e3016=_0x372446?.['scopedFolderPath']??'';if(!existsSync(_0x5dc5f6))return console['error'](a29_0x2fe6bf[_0x414698(0x1c5)]('Error:\x20Directory\x20not\x20found:\x20'+_0x5dc5f6+'\x0a')),console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1a4)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x1ba50a[_0x414698(0x1d3)]&&(console[_0x414698(0x19f)](_0x414698(0x160)+_0x1ba50a[_0x414698(0x14d)]),console[_0x414698(0x19f)](_0x414698(0x19c)+_0x5ea2a1),console[_0x414698(0x19f)]('Source\x20directory:\x20'+_0x5dc5f6),_0x2c17f7&&console['error'](_0x414698(0x15c)+_0x2e3016));const _0x348790=await withSpinner(_0x414698(0x1b8)+_0x5ea2a1+_0x414698(0x155),()=>_0x20ba0d[_0x414698(0x17e)][_0x414698(0x1c2)](_0x5ea2a1),{'verbose':_0x1ba50a['verbose']}),_0x4641ea=_0x348790[_0x414698(0x1cb)],[_0x358ce9,_0x4509ae,_0x514054,_0x52e371,_0x3765a0]=await Promise[_0x414698(0x17d)]([withSpinner(_0x414698(0x15f),()=>_0x20ba0d[_0x414698(0x17e)][_0x414698(0x143)](_0x4641ea),{'verbose':_0x1ba50a[_0x414698(0x1d3)]}),withSpinner(_0x414698(0x1b1),()=>_0x20ba0d[_0x414698(0x17e)][_0x414698(0x147)](_0x4641ea),{'verbose':_0x1ba50a[_0x414698(0x1d3)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x20ba0d[_0x414698(0x17e)][_0x414698(0x1a2)](_0x4641ea),{'verbose':_0x1ba50a[_0x414698(0x1d3)]}),withSpinner(_0x414698(0x15e),()=>_0x20ba0d['journey'][_0x414698(0x166)](_0x4641ea,{'includeAllVersions':!![]}),{'verbose':_0x1ba50a[_0x414698(0x1d3)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x20ba0d['user'][_0x414698(0x188)](),{'verbose':_0x1ba50a['verbose']})[_0x414698(0x189)](_0x180dd1=>_0x180dd1[_0x414698(0x1cb)])]),_0xcca274=_0x358ce9[_0x414698(0x1cb)],_0x273078=extractRootFolderId(_0xcca274),_0xff9bd4=_0x4509ae[_0x414698(0x1cb)],_0x49cf76=_0x514054[_0x414698(0x1cb)],{journeys:_0x12474c,activationStepsById:_0x3f0166}=_0x52e371['data'],_0x368f51=new Map(_0x12474c[_0x414698(0x198)](_0x2023d8=>[_0x2023d8['id'],_0x2023d8])),_0x2559ea=_0x12474c['map'](_0x329e58=>({'id':_0x329e58['id'],'name':_0x329e58[_0x414698(0x152)][_0x414698(0x1c4)],'journeyBundleName':_0x329e58['attributes']['journeyBundleName']||'','journeyBundleId':_0x329e58['attributes'][_0x414698(0x153)]||'','versionNumber':_0x329e58[_0x414698(0x152)]['versionNumber'],'description':_0x329e58[_0x414698(0x152)][_0x414698(0x194)],'state':_0x329e58[_0x414698(0x152)][_0x414698(0x149)],'paused':_0x329e58['attributes'][_0x414698(0x181)],'audienceId':_0x329e58[_0x414698(0x152)][_0x414698(0x150)],'folderId':_0x329e58['relationships']?.[_0x414698(0x172)]?.['data']?.['id'],'createdAt':_0x329e58['attributes'][_0x414698(0x1a6)],'updatedAt':_0x329e58['attributes'][_0x414698(0x190)]})),{emailToId:_0x1cd4c1,idToEmail:_0x51dd35}=_0x3765a0,_0x18c1a6=await withSpinner(_0x414698(0x14a),async()=>{const _0x4278fc=_0x414698,_0x2333a9=await _0x20ba0d[_0x4278fc(0x14b)][_0x4278fc(0x16f)]();return buildConnectionMaps(_0x2333a9);},{'verbose':_0x1ba50a[_0x414698(0x1d3)]})[_0x414698(0x189)](_0x2fde04=>_0x2fde04[_0x414698(0x1cb)]),_0x1f3280=_0x18c1a6['nameToId'],_0x59b7b2=_0x18c1a6['idToName'],_0x1638de=_0x18c1a6[_0x414698(0x165)],_0x364106={'emailToIdMap':_0x1cd4c1,'connectionNameToIdMap':_0x1f3280,'connectionNameToTypeMap':_0x1638de,'getSchema':_0x3a5e64=>_0x20ba0d[_0x414698(0x14b)][_0x414698(0x18a)](_0x3a5e64)};let {pathToId:_0x187631,idToPath:_0x2b8de2}=buildFolderMaps(_0x49cf76);const _0x22217e=buildSegmentLookupMap(_0xff9bd4,_0x2b8de2),_0x27fad2=buildSegmentNameToIdMap(_0xff9bd4),_0x58ff1e=buildJourneyBundleLookupMap(_0x2559ea,_0x2b8de2);let _0xf85777;if(_0x11a00a){if(!_0x11a00a[_0x414698(0x1ab)](_0x414698(0x168))&&!_0x11a00a[_0x414698(0x1ab)]('.yaml'))return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x140)+_0x11a00a+'\x0a')),0x1;_0xf85777=[_0x11a00a];}else _0xf85777=findYamlFiles(_0x5dc5f6);if(_0xf85777['length']===0x0)return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x180)+_0x5dc5f6+'\x0a')),console['error'](a29_0x2fe6bf['cyan'](_0x414698(0x141))),0x1;let _0x99a3f,_0x2c0786;try{const _0x393e29=parseAndClassifyYamlFiles(_0xf85777,_0x5dc5f6,{'skipSegments':_0x1ba50a['journeysOnly']});_0x99a3f=_0x393e29['segments'],_0x2c0786=_0x393e29[_0x414698(0x18b)];const _0x59d5b9=validateParsedFiles(_0x393e29,_0x5dc5f6);if(_0x59d5b9[_0x414698(0x159)]>0x0)return console[_0x414698(0x19f)](a29_0x2fe6bf['red'](_0x414698(0x1b0))),console[_0x414698(0x19f)](formatValidationErrors(_0x59d5b9)),console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18f)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1e65e6){return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x1a1)+(_0x1e65e6 instanceof Error?_0x1e65e6[_0x414698(0x19b)]:_0x1e65e6))),0x1;}if(_0x99a3f[_0x414698(0x159)]===0x0&&_0x2c0786[_0x414698(0x159)]===0x0){const _0x5b22d8=_0x1ba50a[_0x414698(0x17f)]?_0x414698(0x1c9):_0x414698(0x13d);return console['error'](a29_0x2fe6bf['yellow'](_0x414698(0x174)+_0x5b22d8+'\x20YAML\x20files\x20found')),0x0;}const _0x36621c=new Map();_0xff9bd4['length']>0x0&&!_0x1ba50a[_0x414698(0x17f)]&&await withSpinner(_0x414698(0x13c),async()=>{await batchAsync(_0xff9bd4,async _0x2f0112=>{const _0x7bc07f=a29_0x5696,_0x270da3=await _0x20ba0d[_0x7bc07f(0x17e)][_0x7bc07f(0x175)](_0x4641ea,_0x2f0112['id']);_0x36621c['set'](_0x2f0112['id'],_0x270da3);});},{'verbose':_0x1ba50a[_0x414698(0x1d3)]});const {segmentFiles:_0x4390d1,foldersToCreate:_0x327ede}=await prepareSegmentFiles(_0x99a3f,{'segmentByFolderAndName':_0x22217e,'activationsBySegmentId':_0x36621c,'folderPathToId':_0x187631,'idToEmailMap':_0x51dd35,'connectionIdToNameMap':_0x59b7b2},_0x364106,_0x2c17f7,_0x2e3016),_0x27b9b7=_0x11a00a?[]:findSegmentsToDelete(_0xff9bd4,_0x99a3f['map'](({yamlConfig:_0x2398c6,folderPath:_0x4aae3c})=>({'yamlConfig':_0x2398c6,'folderPath':resolveTDFolderPath(_0x4aae3c,_0x2c17f7,_0x2e3016)})),_0x2b8de2,_0x2e3016,_0x2c17f7),{journeyFiles:_0x4fa044,foldersToCreate:_0x387122}=await withProgressSpinner(_0x414698(0x1a5),async _0x9b8ec2=>prepareJourneyFiles(_0x2c0786,{'fetchJourney':async _0x4f15ec=>_0x20ba0d['journey']['getJourney'](_0x4f15ec[_0x414698(0x17c)]),'journeyBundlesByFolderAndName':_0x58ff1e,'folderPathToId':_0x187631,'idToEmailMap':_0x51dd35,'connectionIdToNameMap':_0x59b7b2,'existingSegments':_0xff9bd4,'parentId':_0x4641ea,'deps':_0x20ba0d,'progress':{'update':_0x5155ed=>{const _0x321c4d=_0x414698;_0x9b8ec2[_0x321c4d(0x1c1)](_0x5155ed),_0x1ba50a['verbose']&&console['error']('\x20\x20'+_0x5155ed);}},'journeyById':_0x368f51,'activationStepsById':_0x3f0166},_0x2c17f7,_0x2e3016),{'verbose':_0x1ba50a[_0x414698(0x1d3)]})[_0x414698(0x189)](_0x3e0ac5=>_0x3e0ac5['data']);for(const _0x2f9520 of _0x387122){_0x327ede[_0x414698(0x18e)](_0x2f9520);}const _0x2763e6=_0x11a00a?[]:findJourneysToDelete(_0x2559ea,_0x2c0786[_0x414698(0x198)](({yamlConfig:_0x2c9c74,folderPath:_0x5b2865})=>({'yamlConfig':_0x2c9c74,'folderPath':resolveTDFolderPath(_0x5b2865,_0x2c17f7,_0x2e3016)})),_0x2b8de2,_0x2e3016,_0x2c17f7),_0x57459f=calculatePushStats(_0x4390d1,_0x4fa044,_0x327ede,_0x27b9b7,_0x2763e6,!!_0x1ba50a[_0x414698(0x1a9)],!!_0x1ba50a[_0x414698(0x17f)]),_0x364118=_0x57459f[_0x414698(0x13f)][_0x414698(0x13a)],_0x11a125=_0x57459f[_0x414698(0x13f)]['changed'],_0x4f82d9=_0x57459f['segments'][_0x414698(0x1bd)],_0x53d1df=_0x57459f[_0x414698(0x13f)][_0x414698(0x1bf)],_0x3c0501=_0x57459f['folders'][_0x414698(0x16c)],_0x480ff9=_0x57459f[_0x414698(0x18b)][_0x414698(0x13a)],_0x16a26f=_0x57459f['journeys'][_0x414698(0x1a0)],_0x2697f8=_0x57459f[_0x414698(0x18b)]['unchanged'],_0xfc142a=_0x57459f['journeys'][_0x414698(0x1bf)],_0xebb201=_0x57459f[_0x414698(0x151)][_0x414698(0x17d)],_0x50656e=_0x57459f['activations'][_0x414698(0x16c)],_0x51a00f=_0x57459f['activations'][_0x414698(0x1b6)],_0x3ad0f2=_0x57459f['activations'][_0x414698(0x1bf)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x5ea2a1+'\x27:');_0x3c0501[_0x414698(0x159)]>0x0&&console[_0x414698(0x19f)]('\x20\x20'+a29_0x2fe6bf[_0x414698(0x16b)]('📁\x20'+_0x3c0501['length']+_0x414698(0x1a3)));if(!_0x1ba50a['journeysOnly']){console['error'](_0x414698(0x170)),console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf[_0x414698(0x18d)]('+\x20'+_0x364118['length']+_0x414698(0x1c8))),console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf['yellow']('~\x20'+_0x11a125[_0x414698(0x159)]+_0x414698(0x177)));if(_0x53d1df[_0x414698(0x159)]>0x0)console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x1c5)]('-\x20'+_0x53d1df['length']+_0x414698(0x142)));else _0x27b9b7[_0x414698(0x159)]>0x0&&!_0x1ba50a[_0x414698(0x1a9)]&&console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x1a7)](_0x27b9b7[_0x414698(0x159)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x1a7)]('=\x20'+_0x4f82d9[_0x414698(0x159)]+_0x414698(0x1b2)));}if(_0x4fa044[_0x414698(0x159)]>0x0||_0x2763e6[_0x414698(0x159)]>0x0){console[_0x414698(0x19f)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf['green']('+\x20'+_0x480ff9[_0x414698(0x159)]+_0x414698(0x1c8))),console[_0x414698(0x19f)](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x18f)]('~\x20'+_0x16a26f[_0x414698(0x159)]+_0x414698(0x177)));if(_0xfc142a[_0x414698(0x159)]>0x0)console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf[_0x414698(0x1c5)]('-\x20'+_0xfc142a[_0x414698(0x159)]+_0x414698(0x142)));else _0x2763e6[_0x414698(0x159)]>0x0&&!_0x1ba50a['delete']&&console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf[_0x414698(0x1a7)](_0x2763e6['length']+_0x414698(0x1c6)));console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf['dim']('=\x20'+_0x2697f8[_0x414698(0x159)]+_0x414698(0x1b2)));}_0xebb201[_0x414698(0x159)]>0x0&&!_0x1ba50a[_0x414698(0x17f)]&&(console[_0x414698(0x19f)](''),console[_0x414698(0x19f)](_0x414698(0x1af)),_0x50656e['length']>0x0&&console['error'](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x18d)]('+\x20'+_0x50656e[_0x414698(0x159)]+_0x414698(0x1d2))),_0x51a00f['length']>0x0&&console['error'](_0x414698(0x15a)+a29_0x2fe6bf[_0x414698(0x18f)]('~\x20'+_0x51a00f[_0x414698(0x159)]+_0x414698(0x19e))),_0x3ad0f2['length']>0x0&&console[_0x414698(0x19f)]('\x20\x20\x20\x20'+a29_0x2fe6bf[_0x414698(0x1c5)]('-\x20'+_0x3ad0f2[_0x414698(0x159)]+_0x414698(0x142))));console['error'](_0x414698(0x1d4)+a29_0x2fe6bf['cyan'](_0x5dc5f6)+'\x0a');if(_0x3c0501[_0x414698(0x159)]>0x0){console[_0x414698(0x19f)]('Folders\x20to\x20create:');for(const _0x708864 of _0x3c0501){console['error']('\x20\x20'+a29_0x2fe6bf['blue']('+')+'\x20'+_0x708864);}console['error']('');}if(_0x364118['length']>0x0&&!_0x1ba50a[_0x414698(0x17f)])for(const _0x34811e of _0x364118){const _0x1ba56e=_0x34811e['folderPath']?_0x34811e[_0x414698(0x185)]+'/'+_0x34811e['yamlConfig'][_0x414698(0x1c4)]:_0x34811e[_0x414698(0x1cf)]['name'],_0x1af8c9=_0x34811e[_0x414698(0x1cf)][_0x414698(0x151)]?.[_0x414698(0x159)]||0x0,_0x4b7457=_0x1af8c9>0x0?a29_0x2fe6bf[_0x414698(0x1a7)]('\x20['+_0x1af8c9+_0x414698(0x171)):'';console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf[_0x414698(0x18d)]('New\x20segment:')+'\x20'+_0x1ba56e+_0x4b7457),console[_0x414698(0x19f)]('─'[_0x414698(0x169)](0x3c)),_0x34811e[_0x414698(0x15b)]&&console['error'](_0x34811e[_0x414698(0x15b)]),console[_0x414698(0x19f)]('─'['repeat'](0x3c));}if(_0x53d1df[_0x414698(0x159)]>0x0&&!_0x1ba50a['journeysOnly'])for(const _0x4c6e39 of _0x53d1df){const _0x293a05=_0x4c6e39['segmentFolderId']?_0x2b8de2[_0x414698(0x158)](_0x4c6e39[_0x414698(0x1b4)][_0x414698(0x15d)]())||'':'',_0x3a2e37=_0x293a05?_0x293a05+'/'+_0x4c6e39[_0x414698(0x1c4)]:_0x4c6e39[_0x414698(0x1c4)],_0x9c5774=_0x36621c['get'](_0x4c6e39['id'])||[],_0x5239cf=_0x9c5774[_0x414698(0x159)]>0x0?a29_0x2fe6bf[_0x414698(0x1a7)]('\x20['+_0x9c5774[_0x414698(0x159)]+_0x414698(0x171)):'';console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf['red']('Delete\x20segment:')+'\x20'+_0x3a2e37+_0x5239cf),console[_0x414698(0x19f)]('─'['repeat'](0x3c));const _0x3849e1=segmentWithActivationsToYaml(_0x4c6e39,_0x9c5774,undefined,_0x51dd35,_0x59b7b2),_0x4fa997=segmentToYamlString(_0x3849e1),_0x5b1ee2=generateDiff(_0x4fa997,'');console[_0x414698(0x19f)](formatDiffWithColors(_0x5b1ee2)),console['error']('─'[_0x414698(0x169)](0x3c));}const _0x5b7f65=_0x4390d1[_0x414698(0x1c0)](_0x31dc42=>!_0x31dc42['isNew']&&_0x31dc42['diff']);if(_0x5b7f65[_0x414698(0x159)]>0x0&&!_0x1ba50a['journeysOnly'])for(const _0x1b6876 of _0x5b7f65){const _0x2f959c=_0x1b6876[_0x414698(0x185)]?_0x1b6876[_0x414698(0x185)]+'/'+_0x1b6876[_0x414698(0x1cf)][_0x414698(0x1c4)]:_0x1b6876['yamlConfig'][_0x414698(0x1c4)];console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf[_0x414698(0x18f)](_0x414698(0x16d))+'\x20'+_0x2f959c),console[_0x414698(0x19f)]('─'[_0x414698(0x169)](0x3c)),console[_0x414698(0x19f)](_0x1b6876[_0x414698(0x15b)]),console[_0x414698(0x19f)]('─'[_0x414698(0x169)](0x3c));}if(_0x480ff9[_0x414698(0x159)]>0x0)for(const _0x37bd38 of _0x480ff9){const _0x3f00eb=_0x37bd38[_0x414698(0x185)]?_0x37bd38[_0x414698(0x185)]+'/'+_0x37bd38[_0x414698(0x1cf)][_0x414698(0x1c4)]:_0x37bd38[_0x414698(0x1cf)][_0x414698(0x1c4)];console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf[_0x414698(0x18d)](_0x414698(0x196))+'\x20'+_0x3f00eb),console[_0x414698(0x19f)]('─'[_0x414698(0x169)](0x3c)),_0x37bd38[_0x414698(0x15b)]&&console[_0x414698(0x19f)](_0x37bd38[_0x414698(0x15b)]),console[_0x414698(0x19f)]('─'[_0x414698(0x169)](0x3c));}const _0x27d569=_0x4fa044[_0x414698(0x1c0)](_0x121da8=>!_0x121da8[_0x414698(0x14f)]&&_0x121da8['diff']);if(_0x27d569[_0x414698(0x159)]>0x0)for(const _0x19b4e9 of _0x27d569){const _0x3cfeb8=_0x19b4e9[_0x414698(0x185)]?_0x19b4e9[_0x414698(0x185)]+'/'+_0x19b4e9['yamlConfig'][_0x414698(0x1c4)]:_0x19b4e9[_0x414698(0x1cf)][_0x414698(0x1c4)];console[_0x414698(0x19f)]('\x0a'+a29_0x2fe6bf[_0x414698(0x18f)]('Changes\x20to\x20journey:')+'\x20'+_0x3cfeb8),console[_0x414698(0x19f)]('─'[_0x414698(0x169)](0x3c)),console[_0x414698(0x19f)](_0x19b4e9[_0x414698(0x15b)]),console[_0x414698(0x19f)]('─'['repeat'](0x3c));}if(_0xfc142a['length']>0x0)for(const _0x3b8db0 of _0xfc142a){const _0x496bd7=_0x3b8db0[_0x414698(0x13b)]?_0x2b8de2[_0x414698(0x158)](_0x3b8db0[_0x414698(0x13b)])||'':'',_0xeb31ac=_0x496bd7?_0x496bd7+'/'+_0x3b8db0[_0x414698(0x182)]:_0x3b8db0['journeyBundleName'];console['error']('\x0a'+a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x1ca))+'\x20'+_0xeb31ac),console[_0x414698(0x19f)]('─'['repeat'](0x3c)),console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)](_0x414698(0x19d))),console['error']('─'[_0x414698(0x169)](0x3c));}if(_0x1ba50a[_0x414698(0x179)])return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18f)](_0x414698(0x148))),0x0;const _0x1525e3=_0x1ba50a[_0x414698(0x17f)]?![]:_0x364118[_0x414698(0x159)]>0x0||_0x11a125['length']>0x0||_0x53d1df[_0x414698(0x159)]>0x0,_0x535e12=_0x480ff9[_0x414698(0x159)]>0x0||_0x16a26f[_0x414698(0x159)]>0x0||_0xfc142a[_0x414698(0x159)]>0x0,_0x508a11=_0x1ba50a[_0x414698(0x17f)]?![]:_0xebb201[_0x414698(0x159)]>0x0,_0x278fd1=_0x3c0501['length']>0x0;if(!_0x1525e3&&!_0x535e12&&!_0x508a11&&!_0x278fd1){const _0x863e30=_0x1ba50a[_0x414698(0x17f)]?_0x414698(0x1d0):_0x414698(0x193);console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18d)](_0x863e30));if(_0x11a00a&&_0x2697f8[_0x414698(0x159)]===0x1){const _0xe75426=_0x2697f8[0x0];if(_0xe75426['existingJourney']?.['id']){const _0xb23463=getConsoleNextUrl(_0x1ba50a['site'],_0x414698(0x1ac)+_0x4641ea+'/e/'+_0xe75426[_0x414698(0x16e)]['id']+_0x414698(0x186));console[_0x414698(0x19f)]('\x20\x20'+a29_0x2fe6bf['cyan'](_0xb23463));}}return 0x0;}const _0x5598df=_0x1ba50a[_0x414698(0x17f)]?_0x480ff9[_0x414698(0x159)]+_0x16a26f[_0x414698(0x159)]+_0xfc142a[_0x414698(0x159)]+_0x3c0501[_0x414698(0x159)]:_0x364118[_0x414698(0x159)]+_0x11a125[_0x414698(0x159)]+_0x53d1df['length']+_0x480ff9[_0x414698(0x159)]+_0x16a26f[_0x414698(0x159)]+_0xfc142a['length']+_0x3c0501[_0x414698(0x159)]+_0xebb201[_0x414698(0x159)];if(!_0x1ba50a[_0x414698(0x18c)]&&_0x5598df>0x0){const _0x29475b=await confirmKey(_0x414698(0x191)+_0x5598df+_0x414698(0x145));if(!_0x29475b)return console[_0x414698(0x19f)](_0x414698(0x1ba)),0x1;}const _0x572b1c={'withProgress':async(_0x279af7,_0x5d89b3)=>{const _0x51fb7d=_0x414698,_0x28ce1a=await withSpinner(_0x279af7,_0x5d89b3,{'verbose':_0x1ba50a['verbose']});return{'data':_0x28ce1a[_0x51fb7d(0x1cb)]};},'logInfo':_0x4e6d31=>console['error'](a29_0x2fe6bf[_0x414698(0x16b)]('✔\x20'+_0x4e6d31)),'logSuccess':_0x1417a9=>console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18d)]('✔\x20'+_0x1417a9)),'logWarning':_0x521b42=>console[_0x414698(0x19f)](a29_0x2fe6bf['yellow']('⚠\x20'+_0x521b42)),'logDeleted':_0x2a0e47=>console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x1c5)]('✔\x20'+_0x2a0e47))},_0x2d589a={'segment':_0x20ba0d[_0x414698(0x17e)],'journey':_0x20ba0d[_0x414698(0x1c9)],'user':_0x20ba0d[_0x414698(0x1a8)],'connection':_0x20ba0d['connection']};_0x3c0501[_0x414698(0x159)]>0x0&&(_0x187631=await executePushFolders(_0x2d589a,_0x3c0501,_0x187631,{'parentId':_0x4641ea},_0x572b1c));const _0x1960c5={'rootFolderId':_0x273078,'folderPathToId':_0x187631,'folderIdToPath':_0x2b8de2,'segmentNameToId':_0x27fad2,'activationsBySegmentId':_0x36621c,'emailToIdMap':_0x1cd4c1,'idToEmailMap':_0x51dd35,'connectionNameToIdMap':_0x18c1a6[_0x414698(0x1bb)],'connectionIdToNameMap':_0x18c1a6[_0x414698(0x144)],'connectionNameToTypeMap':_0x1638de},_0x39e8b1=await executePushSegments(_0x2d589a,_0x1ba50a[_0x414698(0x17f)]?[]:_0x4390d1,_0x1960c5,{'parentId':_0x4641ea},_0x572b1c),_0x179de5=_0x39e8b1['created'],_0x17db5d=_0x39e8b1[_0x414698(0x1ce)],_0xfb8fdc=_0x39e8b1[_0x414698(0x151)][_0x414698(0x1b5)],_0x30a578=_0x39e8b1[_0x414698(0x151)][_0x414698(0x1ce)],_0x48940c=_0x39e8b1[_0x414698(0x151)][_0x414698(0x1aa)],_0x509aed=await executePushSegmentDeletions(_0x2d589a,_0x1ba50a[_0x414698(0x17f)]?[]:_0x53d1df,_0x572b1c);let _0xd7a393=0x0,_0x2ac205=0x0,_0x21d0f7=0x0;const _0x161e90=new Map(_0x27fad2);for(const [_0x3a9882,_0x3fc7c0]of _0x39e8b1[_0x414698(0x164)]){_0x161e90[_0x414698(0x199)](_0x3a9882,_0x3fc7c0);}if(_0x4fa044[_0x414698(0x159)]>0x0){const _0x57a780={..._0x1960c5,'segmentNameToId':_0x161e90,'existingSegments':_0xff9bd4,'activationContext':_0x364106},_0xcac1c1=await executePushJourneys(_0x2d589a,_0x4fa044,_0x57a780,{'parentId':_0x4641ea,'rootFolderId':_0x273078,'verbose':_0x1ba50a[_0x414698(0x1d3)]},_0x572b1c);_0xd7a393=_0xcac1c1[_0x414698(0x1b5)],_0x2ac205=_0xcac1c1[_0x414698(0x1ce)];if(_0x11a00a&&_0xcac1c1[_0x414698(0x197)]['length']===0x1){const _0x4ef8d0=_0xcac1c1[_0x414698(0x197)][0x0];if(_0x4ef8d0[_0x414698(0x17c)]){const _0x462967=getConsoleNextUrl(_0x1ba50a[_0x414698(0x14d)],_0x414698(0x1ac)+_0x4641ea+'/e/'+_0x4ef8d0['journeyId']+_0x414698(0x186));console['error']('\x20\x20'+a29_0x2fe6bf['cyan'](_0x462967));}}}for(const _0x3368b4 of _0xfc142a){console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18f)](_0x414698(0x1d1)+_0x3368b4[_0x414698(0x182)])),_0x21d0f7++;}const _0x33fbb8=[];if(_0x179de5>0x0)_0x33fbb8[_0x414698(0x157)](_0x179de5+_0x414698(0x17b));if(_0x17db5d>0x0)_0x33fbb8[_0x414698(0x157)](_0x17db5d+_0x414698(0x178));if(_0x509aed>0x0)_0x33fbb8[_0x414698(0x157)](_0x509aed+_0x414698(0x16a));const _0x555d81=[];if(_0xd7a393>0x0)_0x555d81[_0x414698(0x157)](_0xd7a393+_0x414698(0x17b));if(_0x2ac205>0x0)_0x555d81[_0x414698(0x157)](_0x2ac205+_0x414698(0x178));if(_0x21d0f7>0x0)_0x555d81[_0x414698(0x157)](_0x21d0f7+_0x414698(0x16a));const _0xbb9318=[];if(_0xfb8fdc>0x0)_0xbb9318[_0x414698(0x157)](_0xfb8fdc+_0x414698(0x17b));if(_0x30a578>0x0)_0xbb9318[_0x414698(0x157)](_0x30a578+_0x414698(0x178));if(_0x48940c>0x0)_0xbb9318[_0x414698(0x157)](_0x48940c+'\x20deleted');return console[_0x414698(0x19f)](a29_0x2fe6bf[_0x414698(0x18d)](_0x414698(0x1b3))),_0x33fbb8['length']>0x0&&!_0x1ba50a[_0x414698(0x17f)]&&console[_0x414698(0x19f)](_0x414698(0x187)+_0x33fbb8['join'](',\x20')),_0x555d81[_0x414698(0x159)]>0x0&&console[_0x414698(0x19f)](_0x414698(0x1b9)+_0x555d81[_0x414698(0x1bc)](',\x20')),_0xbb9318[_0x414698(0x159)]>0x0&&!_0x1ba50a[_0x414698(0x17f)]&&console[_0x414698(0x19f)](_0x414698(0x161)+_0xbb9318[_0x414698(0x1bc)](',\x20')),0x0;}}
|
|
1
|
+
const a29_0x1aaedb=a29_0x34e3;(function(_0x49e24e,_0xb6d422){const _0x480d08=a29_0x34e3,_0x257466=_0x49e24e();while(!![]){try{const _0x2f0d66=-parseInt(_0x480d08(0x112))/0x1*(-parseInt(_0x480d08(0x8a))/0x2)+-parseInt(_0x480d08(0xb5))/0x3*(parseInt(_0x480d08(0x124))/0x4)+parseInt(_0x480d08(0xbb))/0x5*(-parseInt(_0x480d08(0x106))/0x6)+parseInt(_0x480d08(0xe6))/0x7+parseInt(_0x480d08(0xbd))/0x8*(-parseInt(_0x480d08(0xd1))/0x9)+parseInt(_0x480d08(0x94))/0xa*(-parseInt(_0x480d08(0xdc))/0xb)+parseInt(_0x480d08(0x123))/0xc;if(_0x2f0d66===_0xb6d422)break;else _0x257466['push'](_0x257466['shift']());}catch(_0x43a38d){_0x257466['push'](_0x257466['shift']());}}}(a29_0x1fb6,0xcfddc));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x34e3(_0xf0de1e,_0x5f2a2b){_0xf0de1e=_0xf0de1e-0x86;const _0x1fb613=a29_0x1fb6();let _0x34e35c=_0x1fb613[_0xf0de1e];return _0x34e35c;}import{batchAsync}from'../utils/async.js';function a29_0x1fb6(){const _0x545402=['\x20folders\x20to\x20create','1759359pzXczf','resolveParentId','name','\x20\x20\x20\x20','Fetching\x20users\x20for\x20email\x20resolution...','Folders\x20to\x20create:','delete','set','.yml','all','Fetching\x20parent\x20segment\x20details...','📁\x20','helpText','results','message','New\x20journey:','data','idToName','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','dim','\x20to\x20delete','Fetching\x20existing\x20journeys...','join','journeyId','dryRun','\x20deleted','endsWith','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','setPhase','\x20changes?','\x20unchanged','toDelete','540lmFypz','/e/','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','user','updated','errorCode','Scoped\x20to\x20folder:\x20','Fetching\x20existing\x20folders...','\x20new','repeat','journeyBundleId','\x20changed','1126847YosrEp','yes','getParent','/j/da/je','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','new','\x20\x20🗺️\x20\x20Journeys:','connection','cwd','\x0aValidation\x20failed:','Parent\x20segment:\x20','cyan','description','journey','paused','Fetching\x20existing\x20activations...','relationships','37925628MmUEXJ','748MAzYlz','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)','Error\x20parsing\x20YAML:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','diff','add','2CZjiIJ','nameToType','\x20\x20Journeys:\x20','Error:\x20Directory\x20not\x20found:\x20','\x0a✔\x20Push\x20complete','\x20to\x20update','Fetching\x20connections\x20for\x20name\x20resolution...','length','Changes\x20to:','deleted','113770MDWXSz','state','New\x20segment:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Delete\x20segment:','yamlConfig','No\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','journeysOnly','red','existingJourney','toString','getJourney','blue','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','listJourneysWithDetailsFromParentSegment','getOutputSchemaWithCache','green','get','yellow','\x20created','Error:\x20','\x20YAML\x20files\x20found','Fetching\x20existing\x20segments...','toUpdate','filter','activations','map','isNew','buildUserMaps','journeys','site','23184onDXkr','segmentFolderId','Push\x20','Changes\x20to\x20journey:','.yaml','Delete\x20journey:','2095TMAEeI','listFolders','5608GgTGLW','segment','folderId','versionNumber','type','\x20updated','filePath','parentFolder','changed','parentName','\x20\x20Activations:','\x20activations]','audienceId','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aPush\x20summary\x20for\x20\x27','segments','listActivations','listSegments','Aborted.','error','20268ZvJarZ','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Source:\x20','journeyBundleName','toCreate','nameToId','then','no_parent','folders','verbose','\x20to\x20create','605XnjiXc','Resolving\x20parent\x20segment\x20\x27','push','folderPath','attributes','parent_name','created','(Journey\x20will\x20be\x20deleted)','/app/ps/'];a29_0x1fb6=function(){return _0x545402;};return a29_0x1fb6();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x41437a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a29_0x1aaedb(0xe8)]='segment:push';[a29_0x1aaedb(0x11e)]=a29_0x1aaedb(0x97);async['execute'](_0x1b86bc){const _0x518948=a29_0x1aaedb,{options:_0x2135c2,args:_0x589a59,tdx:_0x424321}=_0x1b86bc,_0x4b34ba=_0x2135c2,_0x28762e=await resolveTarget({'arg':_0x589a59[0x0],'contextParent':_0x2135c2['parentSegment'],'cwd':process[_0x518948(0x11a)]()});if(!isSuccessfulResolution(_0x28762e))return _0x28762e[_0x518948(0x10b)]===_0x518948(0xd8)?(console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x518948(0xd0)](_0x518948(0x125)),console[_0x518948(0xd0)](_0x518948(0x108)),console[_0x518948(0xd0)](_0x518948(0x9c))):(console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0xaa)+_0x28762e[_0x518948(0xf4)]+'\x0a')),_0x28762e[_0x518948(0xf2)]&&console['error'](a29_0x41437a['cyan'](_0x28762e['helpText']))),0x1;if(_0x28762e[_0x518948(0xc1)]===_0x518948(0xe1))return console['error'](a29_0x41437a['red'](_0x518948(0x8d)+_0x28762e['targetDir']+'\x0a')),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x11d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xb86f41=_0x28762e[_0x518948(0xc6)],_0x1ce4f7=_0x28762e['targetDir'],_0x1ea3f8=_0x28762e[_0x518948(0xc1)]==='file'?_0x28762e[_0x518948(0xc3)]:undefined,_0x4eb4d8=getScopedDetails(_0x28762e),_0x1e5a93=_0x4eb4d8?.['isScoped']??![],_0x25429c=_0x4eb4d8?.['scopedFolderPath']??'';if(!existsSync(_0x1ce4f7))return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x8d)+_0x1ce4f7+'\x0a')),console['error'](a29_0x41437a[_0x518948(0x11d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x4b34ba[_0x518948(0xda)]&&(console[_0x518948(0xd0)]('Site:\x20'+_0x4b34ba[_0x518948(0xb4)]),console[_0x518948(0xd0)](_0x518948(0x11c)+_0xb86f41),console[_0x518948(0xd0)]('Source\x20directory:\x20'+_0x1ce4f7),_0x1e5a93&&console[_0x518948(0xd0)](_0x518948(0x10c)+_0x25429c));const _0xa09d2d=await withSpinner(_0x518948(0xdd)+_0xb86f41+'\x27...',()=>_0x424321[_0x518948(0xbe)][_0x518948(0xe7)](_0xb86f41),{'verbose':_0x4b34ba['verbose']}),_0x39c6a2=_0xa09d2d['data'],[_0x405b34,_0x367368,_0x4835c7,_0x2f69e8,_0x472523]=await Promise[_0x518948(0xef)]([withSpinner(_0x518948(0xf0),()=>_0x424321['segment'][_0x518948(0x114)](_0x39c6a2),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0xac),()=>_0x424321[_0x518948(0xbe)][_0x518948(0xce)](_0x39c6a2),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0x10d),()=>_0x424321[_0x518948(0xbe)][_0x518948(0xbc)](_0x39c6a2),{'verbose':_0x4b34ba['verbose']}),withSpinner(_0x518948(0xfb),()=>_0x424321['journey'][_0x518948(0xa4)](_0x39c6a2,{'includeAllVersions':!![]}),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0xea),()=>_0x424321[_0x518948(0x109)][_0x518948(0xb2)](),{'verbose':_0x4b34ba[_0x518948(0xda)]})['then'](_0x269074=>_0x269074[_0x518948(0xf6)])]),_0xd07a0d=_0x405b34[_0x518948(0xf6)],_0x4b7a36=extractRootFolderId(_0xd07a0d),_0x371b81=_0x367368[_0x518948(0xf6)],_0x14438c=_0x4835c7['data'],{journeys:_0x52b3d2,activationStepsById:_0x105872}=_0x2f69e8['data'],_0x46c8e1=new Map(_0x52b3d2[_0x518948(0xb0)](_0x3b7b9d=>[_0x3b7b9d['id'],_0x3b7b9d])),_0x46f229=_0x52b3d2[_0x518948(0xb0)](_0xd7e947=>({'id':_0xd7e947['id'],'name':_0xd7e947[_0x518948(0xe0)]['name'],'journeyBundleName':_0xd7e947['attributes'][_0x518948(0xd4)]||'','journeyBundleId':_0xd7e947['attributes'][_0x518948(0x110)]||'','versionNumber':_0xd7e947[_0x518948(0xe0)][_0x518948(0xc0)],'description':_0xd7e947['attributes'][_0x518948(0x11e)],'state':_0xd7e947[_0x518948(0xe0)][_0x518948(0x95)],'paused':_0xd7e947[_0x518948(0xe0)][_0x518948(0x120)],'audienceId':_0xd7e947['attributes'][_0x518948(0xc9)],'folderId':_0xd7e947[_0x518948(0x122)]?.[_0x518948(0xc4)]?.[_0x518948(0xf6)]?.['id'],'createdAt':_0xd7e947[_0x518948(0xe0)]['createdAt'],'updatedAt':_0xd7e947[_0x518948(0xe0)]['updatedAt']})),{emailToId:_0x145a24,idToEmail:_0x7c5a05}=_0x472523,_0x10426c=await withSpinner(_0x518948(0x90),async()=>{const _0x15aa0a=_0x518948,_0x4d6aae=await _0x424321[_0x15aa0a(0x119)]['list']();return buildConnectionMaps(_0x4d6aae);},{'verbose':_0x4b34ba['verbose']})[_0x518948(0xd7)](_0x5f2b52=>_0x5f2b52[_0x518948(0xf6)]),_0x6c537d=_0x10426c[_0x518948(0xd6)],_0x246193=_0x10426c[_0x518948(0xf7)],_0x19d89f=_0x10426c[_0x518948(0x8b)],_0x37da93={'emailToIdMap':_0x145a24,'connectionNameToIdMap':_0x6c537d,'connectionNameToTypeMap':_0x19d89f,'getSchema':_0x361e23=>_0x424321[_0x518948(0x119)][_0x518948(0xa5)](_0x361e23)};let {pathToId:_0x46f139,idToPath:_0x253b15}=buildFolderMaps(_0x14438c);const _0xd620aa=buildSegmentLookupMap(_0x371b81,_0x253b15),_0x729cdc=buildSegmentNameToIdMap(_0x371b81),_0x16ff36=buildJourneyBundleLookupMap(_0x46f229,_0x253b15);let _0xa6c3e3;if(_0x1ea3f8){if(!_0x1ea3f8[_0x518948(0x100)](_0x518948(0xee))&&!_0x1ea3f8[_0x518948(0x100)](_0x518948(0xb9)))return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x116)+_0x1ea3f8+'\x0a')),0x1;_0xa6c3e3=[_0x1ea3f8];}else _0xa6c3e3=findYamlFiles(_0x1ce4f7);if(_0xa6c3e3['length']===0x0)return console[_0x518948(0xd0)](a29_0x41437a['red'](_0x518948(0xa3)+_0x1ce4f7+'\x0a')),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x11d)](_0x518948(0xf8))),0x1;let _0x3c727e,_0x373c4c;try{const _0x232888=parseAndClassifyYamlFiles(_0xa6c3e3,_0x1ce4f7,{'skipSegments':_0x4b34ba[_0x518948(0x9d)]});_0x3c727e=_0x232888[_0x518948(0xcc)],_0x373c4c=_0x232888['journeys'];const _0x3f70f3=validateParsedFiles(_0x232888,_0x1ce4f7);if(_0x3f70f3[_0x518948(0x91)]>0x0)return console['error'](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x11b))),console[_0x518948(0xd0)](formatValidationErrors(_0x3f70f3)),console['error'](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x87))),0x1;}catch(_0x30f82d){return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x86)+(_0x30f82d instanceof Error?_0x30f82d[_0x518948(0xf4)]:_0x30f82d))),0x1;}if(_0x3c727e[_0x518948(0x91)]===0x0&&_0x373c4c[_0x518948(0x91)]===0x0){const _0x332330=_0x4b34ba[_0x518948(0x9d)]?_0x518948(0x11f):'segment\x20or\x20journey';return console['error'](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x9a)+_0x332330+_0x518948(0xab))),0x0;}const _0x495d66=new Map();_0x371b81[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&await withSpinner(_0x518948(0x121),async()=>{await batchAsync(_0x371b81,async _0x4ab78b=>{const _0x1f4c1c=a29_0x34e3,_0x58d426=await _0x424321[_0x1f4c1c(0xbe)][_0x1f4c1c(0xcd)](_0x39c6a2,_0x4ab78b['id']);_0x495d66[_0x1f4c1c(0xed)](_0x4ab78b['id'],_0x58d426);});},{'verbose':_0x4b34ba[_0x518948(0xda)]});const {segmentFiles:_0x2a5e49,foldersToCreate:_0x20e931}=await prepareSegmentFiles(_0x3c727e,{'segmentByFolderAndName':_0xd620aa,'activationsBySegmentId':_0x495d66,'folderPathToId':_0x46f139,'idToEmailMap':_0x7c5a05,'connectionIdToNameMap':_0x246193},_0x37da93,_0x1e5a93,_0x25429c),_0x11cd80=_0x1ea3f8?[]:findSegmentsToDelete(_0x371b81,_0x3c727e[_0x518948(0xb0)](({yamlConfig:_0x4fd741,folderPath:_0x158eb8})=>({'yamlConfig':_0x4fd741,'folderPath':resolveTDFolderPath(_0x158eb8,_0x1e5a93,_0x25429c)})),_0x253b15,_0x25429c,_0x1e5a93),{journeyFiles:_0x1ea6d5,foldersToCreate:_0x83cd9d}=await withProgressSpinner('Preparing\x20journeys...',async _0x223637=>prepareJourneyFiles(_0x373c4c,{'fetchJourney':async _0x925d1d=>_0x424321[_0x518948(0x11f)][_0x518948(0xa1)](_0x925d1d[_0x518948(0xfd)]),'journeyBundlesByFolderAndName':_0x16ff36,'folderPathToId':_0x46f139,'idToEmailMap':_0x7c5a05,'connectionIdToNameMap':_0x246193,'existingSegments':_0x371b81,'parentId':_0x39c6a2,'deps':_0x424321,'progress':{'update':_0x5572ef=>{const _0x51814a=_0x518948;_0x223637[_0x51814a(0x102)](_0x5572ef),_0x4b34ba[_0x51814a(0xda)]&&console[_0x51814a(0xd0)]('\x20\x20'+_0x5572ef);}},'journeyById':_0x46c8e1,'activationStepsById':_0x105872},_0x1e5a93,_0x25429c),{'verbose':_0x4b34ba[_0x518948(0xda)]})[_0x518948(0xd7)](_0x3b6311=>_0x3b6311[_0x518948(0xf6)]);for(const _0x1b3b48 of _0x83cd9d){_0x20e931[_0x518948(0x89)](_0x1b3b48);}const _0xebf947=_0x1ea3f8?[]:findJourneysToDelete(_0x46f229,_0x373c4c[_0x518948(0xb0)](({yamlConfig:_0x5ed124,folderPath:_0x3e277a})=>({'yamlConfig':_0x5ed124,'folderPath':resolveTDFolderPath(_0x3e277a,_0x1e5a93,_0x25429c)})),_0x253b15,_0x25429c,_0x1e5a93),_0x302570=calculatePushStats(_0x2a5e49,_0x1ea6d5,_0x20e931,_0x11cd80,_0xebf947,!!_0x4b34ba[_0x518948(0xec)],!!_0x4b34ba[_0x518948(0x9d)]),_0x5b340c=_0x302570['segments'][_0x518948(0x117)],_0x2ac72d=_0x302570[_0x518948(0xcc)]['changed'],_0x29941c=_0x302570['segments']['unchanged'],_0x3ce5cf=_0x302570['segments']['toDelete'],_0x25c233=_0x302570[_0x518948(0xd9)][_0x518948(0xd5)],_0x1a7544=_0x302570[_0x518948(0xb3)][_0x518948(0x117)],_0x74bc24=_0x302570[_0x518948(0xb3)][_0x518948(0xc5)],_0x3ca522=_0x302570['journeys']['unchanged'],_0x597227=_0x302570['journeys'][_0x518948(0x105)],_0x1a5035=_0x302570[_0x518948(0xaf)]['all'],_0xaae605=_0x302570[_0x518948(0xaf)][_0x518948(0xd5)],_0x137c4e=_0x302570[_0x518948(0xaf)][_0x518948(0xad)],_0x4f93f6=_0x302570[_0x518948(0xaf)][_0x518948(0x105)];console['error'](_0x518948(0xcb)+_0xb86f41+'\x27:');_0x25c233[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a[_0x518948(0xa2)](_0x518948(0xf1)+_0x25c233[_0x518948(0x91)]+_0x518948(0xe5)));if(!_0x4b34ba[_0x518948(0x9d)]){console[_0x518948(0xd0)]('\x20\x20📊\x20Segments:'),console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0x5b340c[_0x518948(0x91)]+_0x518948(0x10e))),console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a['yellow']('~\x20'+_0x2ac72d[_0x518948(0x91)]+'\x20changed'));if(_0x3ce5cf[_0x518948(0x91)]>0x0)console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a['red']('-\x20'+_0x3ce5cf[_0x518948(0x91)]+'\x20to\x20delete'));else _0x11cd80[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0xec)]&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)](_0x11cd80[_0x518948(0x91)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)]('=\x20'+_0x29941c['length']+_0x518948(0x104)));}if(_0x1ea6d5[_0x518948(0x91)]>0x0||_0xebf947[_0x518948(0x91)]>0x0){console[_0x518948(0xd0)](_0x518948(0x118)),console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0x1a7544[_0x518948(0x91)]+_0x518948(0x10e))),console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xa8)]('~\x20'+_0x74bc24[_0x518948(0x91)]+_0x518948(0x111)));if(_0x597227['length']>0x0)console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0x9e)]('-\x20'+_0x597227[_0x518948(0x91)]+_0x518948(0xfa)));else _0xebf947[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0xec)]&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)](_0xebf947[_0x518948(0x91)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xf9)]('=\x20'+_0x3ca522[_0x518948(0x91)]+'\x20unchanged'));}_0x1a5035['length']>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&(console['error'](''),console[_0x518948(0xd0)](_0x518948(0xc7)),_0xaae605[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0xaae605[_0x518948(0x91)]+_0x518948(0xdb))),_0x137c4e[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa8)]('~\x20'+_0x137c4e[_0x518948(0x91)]+_0x518948(0x8f))),_0x4f93f6[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0x9e)]('-\x20'+_0x4f93f6['length']+_0x518948(0xfa))));console[_0x518948(0xd0)](_0x518948(0xd3)+a29_0x41437a[_0x518948(0x11d)](_0x1ce4f7)+'\x0a');if(_0x25c233['length']>0x0){console[_0x518948(0xd0)](_0x518948(0xeb));for(const _0x1b6601 of _0x25c233){console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a[_0x518948(0xa2)]('+')+'\x20'+_0x1b6601);}console['error']('');}if(_0x5b340c[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)])for(const _0x3d7c97 of _0x5b340c){const _0x133ca7=_0x3d7c97[_0x518948(0xdf)]?_0x3d7c97[_0x518948(0xdf)]+'/'+_0x3d7c97[_0x518948(0x99)][_0x518948(0xe8)]:_0x3d7c97[_0x518948(0x99)]['name'],_0x453bca=_0x3d7c97[_0x518948(0x99)][_0x518948(0xaf)]?.[_0x518948(0x91)]||0x0,_0x5745dc=_0x453bca>0x0?a29_0x41437a['dim']('\x20['+_0x453bca+'\x20activations]'):'';console[_0x518948(0xd0)]('\x0a'+a29_0x41437a[_0x518948(0xa6)](_0x518948(0x96))+'\x20'+_0x133ca7+_0x5745dc),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c)),_0x3d7c97[_0x518948(0x88)]&&console['error'](_0x3d7c97[_0x518948(0x88)]),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}if(_0x3ce5cf['length']>0x0&&!_0x4b34ba['journeysOnly'])for(const _0x1a6cd0 of _0x3ce5cf){const _0x2ae34a=_0x1a6cd0[_0x518948(0xb6)]?_0x253b15[_0x518948(0xa7)](_0x1a6cd0[_0x518948(0xb6)][_0x518948(0xa0)]())||'':'',_0x4d2582=_0x2ae34a?_0x2ae34a+'/'+_0x1a6cd0['name']:_0x1a6cd0[_0x518948(0xe8)],_0x16e402=_0x495d66[_0x518948(0xa7)](_0x1a6cd0['id'])||[],_0x531330=_0x16e402[_0x518948(0x91)]>0x0?a29_0x41437a['dim']('\x20['+_0x16e402['length']+_0x518948(0xc8)):'';console[_0x518948(0xd0)]('\x0a'+a29_0x41437a[_0x518948(0x9e)](_0x518948(0x98))+'\x20'+_0x4d2582+_0x531330),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));const _0x214578=segmentWithActivationsToYaml(_0x1a6cd0,_0x16e402,undefined,_0x7c5a05,_0x246193),_0x5a862c=segmentToYamlString(_0x214578),_0x311952=generateDiff(_0x5a862c,'');console[_0x518948(0xd0)](formatDiffWithColors(_0x311952)),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}const _0x4663b2=_0x2a5e49['filter'](_0x206eec=>!_0x206eec[_0x518948(0xb1)]&&_0x206eec[_0x518948(0x88)]);if(_0x4663b2[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)])for(const _0x28ed3b of _0x4663b2){const _0x56e5cd=_0x28ed3b[_0x518948(0xdf)]?_0x28ed3b[_0x518948(0xdf)]+'/'+_0x28ed3b[_0x518948(0x99)][_0x518948(0xe8)]:_0x28ed3b[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a['yellow'](_0x518948(0x92))+'\x20'+_0x56e5cd),console[_0x518948(0xd0)]('─'['repeat'](0x3c)),console[_0x518948(0xd0)](_0x28ed3b[_0x518948(0x88)]),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}if(_0x1a7544[_0x518948(0x91)]>0x0)for(const _0x166982 of _0x1a7544){const _0x483292=_0x166982[_0x518948(0xdf)]?_0x166982[_0x518948(0xdf)]+'/'+_0x166982['yamlConfig']['name']:_0x166982[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a[_0x518948(0xa6)](_0x518948(0xf5))+'\x20'+_0x483292),console[_0x518948(0xd0)]('─'['repeat'](0x3c)),_0x166982[_0x518948(0x88)]&&console[_0x518948(0xd0)](_0x166982['diff']),console[_0x518948(0xd0)]('─'['repeat'](0x3c));}const _0x574fac=_0x1ea6d5[_0x518948(0xae)](_0x3bae4a=>!_0x3bae4a[_0x518948(0xb1)]&&_0x3bae4a['diff']);if(_0x574fac[_0x518948(0x91)]>0x0)for(const _0x4dac8a of _0x574fac){const _0xa86708=_0x4dac8a[_0x518948(0xdf)]?_0x4dac8a[_0x518948(0xdf)]+'/'+_0x4dac8a[_0x518948(0x99)][_0x518948(0xe8)]:_0x4dac8a[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a[_0x518948(0xa8)](_0x518948(0xb8))+'\x20'+_0xa86708),console['error']('─'['repeat'](0x3c)),console['error'](_0x4dac8a['diff']),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}if(_0x597227[_0x518948(0x91)]>0x0)for(const _0x2026a5 of _0x597227){const _0x2e345b=_0x2026a5[_0x518948(0xbf)]?_0x253b15[_0x518948(0xa7)](_0x2026a5[_0x518948(0xbf)])||'':'',_0x2e4535=_0x2e345b?_0x2e345b+'/'+_0x2026a5[_0x518948(0xd4)]:_0x2026a5['journeyBundleName'];console[_0x518948(0xd0)]('\x0a'+a29_0x41437a['red'](_0x518948(0xba))+'\x20'+_0x2e4535),console[_0x518948(0xd0)]('─'['repeat'](0x3c)),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0xe3))),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}if(_0x4b34ba[_0x518948(0xfe)])return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x9b))),0x0;const _0x179ff7=_0x4b34ba[_0x518948(0x9d)]?![]:_0x5b340c[_0x518948(0x91)]>0x0||_0x2ac72d[_0x518948(0x91)]>0x0||_0x3ce5cf[_0x518948(0x91)]>0x0,_0x356d57=_0x1a7544[_0x518948(0x91)]>0x0||_0x74bc24[_0x518948(0x91)]>0x0||_0x597227[_0x518948(0x91)]>0x0,_0x4ce680=_0x4b34ba[_0x518948(0x9d)]?![]:_0x1a5035[_0x518948(0x91)]>0x0,_0x552a5f=_0x25c233[_0x518948(0x91)]>0x0;if(!_0x179ff7&&!_0x356d57&&!_0x4ce680&&!_0x552a5f){const _0x523706=_0x4b34ba['journeysOnly']?_0x518948(0xca):_0x518948(0xd2);console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa6)](_0x523706));if(_0x1ea3f8&&_0x3ca522['length']===0x1){const _0x5377a2=_0x3ca522[0x0];if(_0x5377a2[_0x518948(0x9f)]?.['id']){const _0xa54812=getConsoleNextUrl(_0x4b34ba[_0x518948(0xb4)],'/app/ps/'+_0x39c6a2+_0x518948(0x107)+_0x5377a2[_0x518948(0x9f)]['id']+_0x518948(0x115));console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a['cyan'](_0xa54812));}}return 0x0;}const _0x2010b7=_0x4b34ba[_0x518948(0x9d)]?_0x1a7544[_0x518948(0x91)]+_0x74bc24[_0x518948(0x91)]+_0x597227['length']+_0x25c233[_0x518948(0x91)]:_0x5b340c[_0x518948(0x91)]+_0x2ac72d[_0x518948(0x91)]+_0x3ce5cf[_0x518948(0x91)]+_0x1a7544[_0x518948(0x91)]+_0x74bc24[_0x518948(0x91)]+_0x597227[_0x518948(0x91)]+_0x25c233[_0x518948(0x91)]+_0x1a5035['length'];if(!_0x4b34ba[_0x518948(0x113)]&&_0x2010b7>0x0){const _0x115faa=await confirmKey(_0x518948(0xb7)+_0x2010b7+_0x518948(0x103));if(!_0x115faa)return console[_0x518948(0xd0)](_0x518948(0xcf)),0x1;}const _0x261f6b={'withProgress':async(_0x481da8,_0x3f6bf8)=>{const _0x294a55=_0x518948,_0x23d9c8=await withSpinner(_0x481da8,_0x3f6bf8,{'verbose':_0x4b34ba[_0x294a55(0xda)]});return{'data':_0x23d9c8[_0x294a55(0xf6)]};},'logInfo':_0x4d0a4c=>console[_0x518948(0xd0)](a29_0x41437a['blue']('✔\x20'+_0x4d0a4c)),'logSuccess':_0x333b42=>console['error'](a29_0x41437a['green']('✔\x20'+_0x333b42)),'logWarning':_0x14c67a=>console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)]('⚠\x20'+_0x14c67a)),'logDeleted':_0x1923f3=>console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)]('✔\x20'+_0x1923f3))},_0x3415f4={'segment':_0x424321['segment'],'journey':_0x424321[_0x518948(0x11f)],'user':_0x424321[_0x518948(0x109)],'connection':_0x424321[_0x518948(0x119)]};_0x25c233['length']>0x0&&(_0x46f139=await executePushFolders(_0x3415f4,_0x25c233,_0x46f139,{'parentId':_0x39c6a2},_0x261f6b));const _0x407b02={'rootFolderId':_0x4b7a36,'folderPathToId':_0x46f139,'folderIdToPath':_0x253b15,'segmentNameToId':_0x729cdc,'activationsBySegmentId':_0x495d66,'emailToIdMap':_0x145a24,'idToEmailMap':_0x7c5a05,'connectionNameToIdMap':_0x10426c[_0x518948(0xd6)],'connectionIdToNameMap':_0x10426c[_0x518948(0xf7)],'connectionNameToTypeMap':_0x19d89f},_0x319af7=await executePushSegments(_0x3415f4,_0x4b34ba[_0x518948(0x9d)]?[]:_0x2a5e49,_0x407b02,{'parentId':_0x39c6a2},_0x261f6b),_0x5177d4=_0x319af7[_0x518948(0xe2)],_0x511627=_0x319af7[_0x518948(0x10a)],_0x4045e3=_0x319af7['activations'][_0x518948(0xe2)],_0x40688d=_0x319af7[_0x518948(0xaf)][_0x518948(0x10a)],_0x493d33=_0x319af7[_0x518948(0xaf)][_0x518948(0x93)],_0x515328=await executePushSegmentDeletions(_0x3415f4,_0x4b34ba[_0x518948(0x9d)]?[]:_0x3ce5cf,_0x261f6b);let _0x2b944f=0x0,_0x3c7994=0x0,_0x546f29=0x0;const _0x26a477=new Map(_0x729cdc);for(const [_0x9f5684,_0x3a29e2]of _0x319af7['createdSegmentIds']){_0x26a477[_0x518948(0xed)](_0x9f5684,_0x3a29e2);}if(_0x1ea6d5[_0x518948(0x91)]>0x0){const _0x5a2787={..._0x407b02,'segmentNameToId':_0x26a477,'existingSegments':_0x371b81,'activationContext':_0x37da93},_0x24a290=await executePushJourneys(_0x3415f4,_0x1ea6d5,_0x5a2787,{'parentId':_0x39c6a2,'rootFolderId':_0x4b7a36,'verbose':_0x4b34ba[_0x518948(0xda)]},_0x261f6b);_0x2b944f=_0x24a290[_0x518948(0xe2)],_0x3c7994=_0x24a290[_0x518948(0x10a)];if(_0x1ea3f8&&_0x24a290[_0x518948(0xf3)][_0x518948(0x91)]===0x1){const _0x553910=_0x24a290['results'][0x0];if(_0x553910[_0x518948(0xfd)]){const _0x37aecb=getConsoleNextUrl(_0x4b34ba['site'],_0x518948(0xe4)+_0x39c6a2+'/e/'+_0x553910['journeyId']+'/j/da/je');console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a['cyan'](_0x37aecb));}}}for(const _0x59fba4 of _0x597227){console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x101)+_0x59fba4[_0x518948(0xd4)])),_0x546f29++;}const _0x518ee0=[];if(_0x5177d4>0x0)_0x518ee0[_0x518948(0xde)](_0x5177d4+_0x518948(0xa9));if(_0x511627>0x0)_0x518ee0['push'](_0x511627+_0x518948(0xc2));if(_0x515328>0x0)_0x518ee0[_0x518948(0xde)](_0x515328+'\x20deleted');const _0x115bb3=[];if(_0x2b944f>0x0)_0x115bb3[_0x518948(0xde)](_0x2b944f+'\x20created');if(_0x3c7994>0x0)_0x115bb3['push'](_0x3c7994+_0x518948(0xc2));if(_0x546f29>0x0)_0x115bb3[_0x518948(0xde)](_0x546f29+_0x518948(0xff));const _0x484924=[];if(_0x4045e3>0x0)_0x484924['push'](_0x4045e3+_0x518948(0xa9));if(_0x40688d>0x0)_0x484924['push'](_0x40688d+_0x518948(0xc2));if(_0x493d33>0x0)_0x484924[_0x518948(0xde)](_0x493d33+_0x518948(0xff));return console['error'](a29_0x41437a['green'](_0x518948(0x8e))),_0x518ee0[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&console[_0x518948(0xd0)]('\x20\x20Segments:\x20'+_0x518ee0[_0x518948(0xfc)](',\x20')),_0x115bb3[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0x8c)+_0x115bb3[_0x518948(0xfc)](',\x20')),_0x484924[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&console[_0x518948(0xd0)]('\x20\x20Activations:\x20'+_0x484924[_0x518948(0xfc)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a30_0x1e0c(){const _0x3e3566=['data','Error:\x20Cannot\x20update\x20','Updating\x20segment\x20\x27','7446224NEvkmc','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','folder','segment:update','2915066pywVha','length','error','2220094nmHHpA','\x20\x20\x20Path:\x20','ruleFile','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','30OFaOXG','parentId','1105225kXvsEI','rule','INTERNAL','name','\x27...','segment','description','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolveFolderId','Examples:','4LUKNun','24282770BsvTPK','updateSegmentById','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent\x20ID:\x20','resolvePathToResource','Update\x20existing\x20child\x20segment','Segment\x20ID:\x20','type','verbose','yellow','3268299sRokdl','724840iItloW','9gQnXxt','Resolving\x20folder\x20\x27'];a30_0x1e0c=function(){return _0x3e3566;};return a30_0x1e0c();}const a30_0x5868ca=a30_0x3328;(function(_0x5be571,_0x3c4dfb){const _0x4954dd=a30_0x3328,_0x4a4ddc=_0x5be571();while(!![]){try{const _0xff60df=parseInt(_0x4954dd(0x1d5))/0x1+parseInt(_0x4954dd(0x1b7))/0x2+parseInt(_0x4954dd(0x1d4))/0x3*(parseInt(_0x4954dd(0x1c9))/0x4)+-parseInt(_0x4954dd(0x1bf))/0x5*(parseInt(_0x4954dd(0x1bd))/0x6)+parseInt(_0x4954dd(0x1b4))/0x7+parseInt(_0x4954dd(0x1ad))/0x8+-parseInt(_0x4954dd(0x1d6))/0x9*(parseInt(_0x4954dd(0x1ca))/0xa);if(_0xff60df===_0x3c4dfb)break;else _0x4a4ddc['push'](_0x4a4ddc['shift']());}catch(_0xf6af0e){_0x4a4ddc['push'](_0x4a4ddc['shift']());}}}(a30_0x1e0c,0xb42f2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a30_0x3328(_0xa8b8c3,_0x5b7d57){_0xa8b8c3=_0xa8b8c3-0x1ac;const _0x1e0c44=a30_0x1e0c();let _0x332805=_0x1e0c44[_0xa8b8c3];return _0x332805;}import a30_0x11072f from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a30_0x5868ca(0x1b3);[a30_0x5868ca(0x1c5)]=a30_0x5868ca(0x1cf);async['execute'](_0x35d870){const _0x4a0c0e=a30_0x5868ca;console[_0x4a0c0e(0x1b6)](a30_0x11072f[_0x4a0c0e(0x1d3)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x4a0c0e(0x1b6)](a30_0x11072f[_0x4a0c0e(0x1d3)](_0x4a0c0e(0x1bc)));const {options:_0x197fd5,args:_0x5cf358,tdx:_0x143b5a}=_0x35d870,_0x89d606=_0x197fd5;if(_0x5cf358[_0x4a0c0e(0x1b5)]===0x0)return console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1ba)),console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1ae)),console['error'](_0x4a0c0e(0x1c8)),console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1c6)),console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1cc)),0x1;const _0x593159=_0x5cf358[0x0],_0x39d533=_0x197fd5['segmentPath'];let _0xb473df=_0x593159;_0x39d533&&!_0x593159['includes']('/')&&(_0xb473df=_0x39d533+'/'+_0x593159,_0x89d606[_0x4a0c0e(0x1d2)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0xb473df));const _0x3d0ee4=await withSpinner(_0x4a0c0e(0x1bb)+_0xb473df+_0x4a0c0e(0x1c3),()=>_0x143b5a['segment'][_0x4a0c0e(0x1ce)](_0xb473df),{'verbose':_0x89d606[_0x4a0c0e(0x1d2)]}),_0x3bd4d1=_0x3d0ee4[_0x4a0c0e(0x1d8)];_0x89d606[_0x4a0c0e(0x1d2)]&&console[_0x4a0c0e(0x1b6)]('Resolved\x20type:\x20'+_0x3bd4d1[_0x4a0c0e(0x1d1)]);if(_0x3bd4d1[_0x4a0c0e(0x1d1)]!==_0x4a0c0e(0x1c4))return console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1d9)+_0x3bd4d1[_0x4a0c0e(0x1d1)]+_0x4a0c0e(0x1b1)),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3bd4d1[_0x4a0c0e(0x1af)])throw new SDKError(ErrorCode[_0x4a0c0e(0x1c1)],_0x4a0c0e(0x1b0));const _0x5b53e5=_0x3bd4d1[_0x4a0c0e(0x1be)],_0x5bed86=_0x3bd4d1[_0x4a0c0e(0x1af)];_0x89d606[_0x4a0c0e(0x1d2)]&&(console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1cd)+_0x5b53e5),console['error'](_0x4a0c0e(0x1d0)+_0x5bed86));let _0xdaa0a;if(_0x89d606[_0x4a0c0e(0x1b2)]){const _0x32eac3=_0x89d606['folder'],_0x5835c4=await withSpinner(_0x4a0c0e(0x1d7)+_0x32eac3+_0x4a0c0e(0x1c3),()=>_0x143b5a[_0x4a0c0e(0x1c4)][_0x4a0c0e(0x1c7)](_0x5b53e5,_0x32eac3),{'verbose':_0x89d606[_0x4a0c0e(0x1d2)]});_0xdaa0a=parseInt(_0x5835c4[_0x4a0c0e(0x1d8)],0xa),_0x89d606[_0x4a0c0e(0x1d2)]&&console[_0x4a0c0e(0x1b6)]('Resolved\x20folder\x20ID:\x20'+_0xdaa0a);}const _0x3e09ed=await loadJSONFromOptions(_0x89d606[_0x4a0c0e(0x1c0)],_0x89d606[_0x4a0c0e(0x1b9)]),_0x1461aa={'name':_0x89d606['name'],'description':_0x89d606[_0x4a0c0e(0x1c5)],'rule':_0x3e09ed,'kind':_0x89d606['kind']!==undefined?parseInt(_0x89d606['kind'],0xa):undefined,'segmentFolderId':_0xdaa0a},_0x198c1b=await withSpinner(_0x4a0c0e(0x1ac)+_0x3bd4d1['segmentName']+_0x4a0c0e(0x1c3),()=>_0x143b5a['segment'][_0x4a0c0e(0x1cb)](_0x5b53e5,_0x5bed86,_0x1461aa),{'verbose':_0x89d606[_0x4a0c0e(0x1d2)]}),_0x15ee85=_0x198c1b[_0x4a0c0e(0x1d8)];return console['error']('✔\x20Updated\x20segment\x20\x27'+_0x15ee85[_0x4a0c0e(0x1c2)]+'\x27'),_0xb473df!==_0x593159&&console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1b8)+_0xb473df),await handleSDKOutput([_0x15ee85],_0x89d606),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a31_0x4338(){const _0x509c05=['1377528AhMSBh','Resolved\x20path\x20type:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','segment:use','dim','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','fullPath','isAbsolute','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','split','isDirectory','folderId','config','✔\x20Context\x20set\x20to:\x20','Resolving\x20path\x20\x27','1641824vXkAkb','parentName','cyan','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','folderPath','green','red','Resolved\x20relative\x20path\x20to:\x20','join','session','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','type','Folder\x20ID:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','2983430sOGVwy','segmentPath','32CKfNjy','log','segments','723790tJoeWY','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','length','execute','\x27...','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','463206pXXIDB','612948LfBOfx','1TraukU','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use:\x20tdx\x20segment\x20use\x20','verbose','parent_segment','36FGaNDS','Site:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Usage:\x20tdx\x20segment\x20use\x20<path>','Parent\x20ID:\x20','2405223LYAMcO','Target\x20path:\x20','error','data'];a31_0x4338=function(){return _0x509c05;};return a31_0x4338();}const a31_0x311253=a31_0x28f8;(function(_0x4670eb,_0x594b1f){const _0x4f7b63=a31_0x28f8,_0x119a04=_0x4670eb();while(!![]){try{const _0x39f11f=parseInt(_0x4f7b63(0xd2))/0x1*(-parseInt(_0x4f7b63(0xd0))/0x2)+parseInt(_0x4f7b63(0xdc))/0x3+-parseInt(_0x4f7b63(0xf0))/0x4+parseInt(_0x4f7b63(0xc5))/0x5+-parseInt(_0x4f7b63(0xe0))/0x6+parseInt(_0x4f7b63(0xd1))/0x7*(-parseInt(_0x4f7b63(0xc7))/0x8)+-parseInt(_0x4f7b63(0xd7))/0x9*(-parseInt(_0x4f7b63(0xca))/0xa);if(_0x39f11f===_0x594b1f)break;else _0x119a04['push'](_0x119a04['shift']());}catch(_0x337c33){_0x119a04['push'](_0x119a04['shift']());}}}(a31_0x4338,0x71c78));function a31_0x28f8(_0x4c34b2,_0x57299e){_0x4c34b2=_0x4c34b2-0xc1;const _0x4338d3=a31_0x4338();let _0x28f867=_0x4338d3[_0x4c34b2];return _0x28f867;}import{existsSync,statSync}from'fs';import a31_0x162a24 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a31_0x311253(0xe3);['description']=a31_0x311253(0xd9);async[a31_0x311253(0xcd)](_0x5ab65a){const _0x208929=a31_0x311253,{options:_0x1c42fb,args:_0x55187d,tdx:_0x165d26}=_0x5ab65a;if(_0x55187d['length']===0x0)return console['error'](a31_0x162a24[_0x208929(0xf6)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x208929(0xde)](_0x208929(0xda)),console[_0x208929(0xde)]('Examples:'),console[_0x208929(0xde)](_0x208929(0xcf)),console[_0x208929(0xde)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x208929(0xde)](_0x208929(0xe8)),console[_0x208929(0xde)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x1c53ff=_0x55187d[0x0],_0xa60065=_0x1c42fb[_0x208929(0xf9)];try{if(_0x1c53ff==='/')return saveSessionContext({'segment_path':undefined},_0xa60065),console['log'](a31_0x162a24[_0x208929(0xf5)](_0x208929(0xc4))),0x0;if(existsSync(_0x1c53ff)&&statSync(_0x1c53ff)[_0x208929(0xeb)]()){let _0x456599;try{_0x456599=findTdxConfig(_0x1c53ff);}catch{return console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xf6)](_0x208929(0xcb)+_0x1c53ff)),console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xf2)](_0x208929(0xe9))),0x1;}const _0x2dbf58=_0x456599[_0x208929(0xed)][_0x208929(0xd6)];return saveSessionContext({'segment_path':_0x2dbf58,'parent_segment':_0x2dbf58},_0xa60065),console[_0x208929(0xc8)](a31_0x162a24['green'](_0x208929(0xee)+a31_0x162a24['cyan'](_0x2dbf58))),0x0;}const _0x7ba3c3=_0x1c42fb[_0x208929(0xc6)];let _0x28c60e=_0x1c53ff;const _0x5172bd=parsePath(_0x1c53ff);if(!_0x5172bd[_0x208929(0xe7)]){if(!_0x7ba3c3)return console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xf6)](_0x208929(0xe2))),console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xf2)](_0x208929(0xc1))),0x1;if(_0x1c53ff==='..'){const _0x5da158=_0x7ba3c3[_0x208929(0xea)]('/')['slice'](0x0,-0x1)[_0x208929(0xf8)]('/');_0x28c60e=_0x5da158||'/';}else _0x1c53ff==='.'?_0x28c60e=_0x7ba3c3:_0x28c60e=_0x7ba3c3+'/'+_0x1c53ff;_0x1c42fb[_0x208929(0xd5)]&&console[_0x208929(0xde)](_0x208929(0xf7)+_0x28c60e);}if(_0x28c60e==='/'||_0x28c60e==='')return saveSessionContext({'segment_path':undefined},_0xa60065),console[_0x208929(0xc8)](a31_0x162a24['green'](_0x208929(0xc4))),0x0;_0x28c60e=normalizePath(_0x28c60e);const _0x4acc8c=parsePath(_0x28c60e)[_0x208929(0xc9)];if(_0x4acc8c[_0x208929(0xcc)]===0x0)return saveSessionContext({'segment_path':undefined},_0xa60065),console[_0x208929(0xc8)](a31_0x162a24[_0x208929(0xf5)](_0x208929(0xc4))),0x0;_0x1c42fb[_0x208929(0xd5)]&&(console['error'](_0x208929(0xd8)+_0x1c42fb['site']),console[_0x208929(0xde)](_0x208929(0xdd)+_0x28c60e));const _0x1063c7=await withSpinner(_0x208929(0xef)+_0x28c60e+_0x208929(0xce),()=>_0x165d26['segment']['resolvePathToResource'](_0x28c60e),{'verbose':_0x1c42fb[_0x208929(0xd5)]}),_0x3a8d0c=_0x1063c7[_0x208929(0xdf)];_0x1c42fb[_0x208929(0xd5)]&&(console[_0x208929(0xde)](_0x208929(0xe1)+_0x3a8d0c[_0x208929(0xc2)]),console[_0x208929(0xde)](_0x208929(0xdb)+_0x3a8d0c['parentId']),_0x3a8d0c[_0x208929(0xec)]&&console[_0x208929(0xde)](_0x208929(0xc3)+_0x3a8d0c['folderId']));if(_0x3a8d0c[_0x208929(0xc2)]==='segment')return console['error'](a31_0x162a24[_0x208929(0xf6)](_0x208929(0xe5))),console['error'](_0x208929(0xd3)),console['error'](a31_0x162a24[_0x208929(0xf2)](_0x208929(0xd4)+_0x3a8d0c[_0x208929(0xf1)]+(_0x3a8d0c['folderPath']?'/'+_0x3a8d0c[_0x208929(0xf4)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3a8d0c[_0x208929(0xe6)],'parent_segment':_0x3a8d0c[_0x208929(0xf1)]},_0xa60065),console[_0x208929(0xc8)](a31_0x162a24[_0x208929(0xf5)]('✔\x20Context\x20set\x20to:\x20'+a31_0x162a24['cyan'](_0x3a8d0c[_0x208929(0xe6)]))),_0x1c42fb[_0x208929(0xd5)]&&(console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xe4)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xe4)](_0x208929(0xf3)))),0x0;}catch(_0x13f813){throw _0x13f813;}}}
|