@treasuredata/tdx 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x20032a=a27_0x4c46;(function(_0x298f50,_0x2c4439){const _0x3f6f8b=a27_0x4c46,_0x46cc70=_0x298f50();while(!![]){try{const _0x5d4151=parseInt(_0x3f6f8b(0x117))/0x1*(-parseInt(_0x3f6f8b(0x1a8))/0x2)+parseInt(_0x3f6f8b(0x185))/0x3*(-parseInt(_0x3f6f8b(0x198))/0x4)+parseInt(_0x3f6f8b(0x12f))/0x5+-parseInt(_0x3f6f8b(0x171))/0x6*(-parseInt(_0x3f6f8b(0x167))/0x7)+parseInt(_0x3f6f8b(0x134))/0x8+-parseInt(_0x3f6f8b(0x13d))/0x9*(-parseInt(_0x3f6f8b(0x15f))/0xa)+-parseInt(_0x3f6f8b(0x1a9))/0xb;if(_0x5d4151===_0x2c4439)break;else _0x46cc70['push'](_0x46cc70['shift']());}catch(_0x5e48c0){_0x46cc70['push'](_0x46cc70['shift']());}}}(a27_0x5a84,0x44058));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 a27_0x2b8c2b from'chalk';async function resolveSegmentTarget(_0x3a3940,_0x34858b,_0x4cd114){const _0x4bbe2f=a27_0x4c46;if(isYamlFilePath(_0x3a3940))try{const _0x6bc3f8=await resolveYamlFilePath(_0x3a3940);return _0x4cd114&&(console[_0x4bbe2f(0x128)](_0x4bbe2f(0x16a)+_0x3a3940),console[_0x4bbe2f(0x128)](_0x4bbe2f(0x1b1)+_0x6bc3f8[_0x4bbe2f(0x187)]),console[_0x4bbe2f(0x128)](_0x4bbe2f(0x10f)+_0x6bc3f8['segmentName']),console[_0x4bbe2f(0x128)](_0x4bbe2f(0x15b)+(_0x6bc3f8[_0x4bbe2f(0x180)]||_0x4bbe2f(0x178))),console[_0x4bbe2f(0x128)]('\x20\x20Full\x20path:\x20'+_0x6bc3f8['fullPath'])),_0x6bc3f8[_0x4bbe2f(0x118)];}catch(_0x431304){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x431304[_0x4bbe2f(0x12d)]);}if(!_0x34858b)throw new SDKError(ErrorCode[_0x4bbe2f(0x13a)],_0x4bbe2f(0x168));return _0x34858b+'/'+_0x3a3940;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x20032a(0x18a)]='segment:describe';[a27_0x20032a(0x142)]=a27_0x20032a(0x194);async[a27_0x20032a(0x152)](_0xd00cf8){const _0x3acd8f=a27_0x20032a,{options:_0x3b7add,args:_0x2a32c1,tdx:_0x1316fb}=_0xd00cf8,_0x5d61d9=_0x2a32c1[0x0],_0xfc8b92=!_0x5d61d9&&!!_0x3b7add[_0x3acd8f(0x187)],_0x52fcf1=_0x5d61d9||_0x3b7add['parentSegment'];if(!_0x52fcf1)return console[_0x3acd8f(0x128)](_0x3acd8f(0x197)),console['error'](_0x3acd8f(0x163)),console[_0x3acd8f(0x128)](_0x3acd8f(0x193)),console[_0x3acd8f(0x128)](_0x3acd8f(0x190)),console[_0x3acd8f(0x128)](_0x3acd8f(0x14f)),console['error'](_0x3acd8f(0x11e)),console[_0x3acd8f(0x128)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x13a81d=_0x3b7add['segmentPath'];let _0x38de79=_0x52fcf1;!_0xfc8b92&&_0x13a81d&&!_0x52fcf1[_0x3acd8f(0x1ac)]('/')&&(_0x38de79=_0x13a81d+'/'+_0x52fcf1,_0x3b7add['verbose']&&console[_0x3acd8f(0x128)]('Resolved\x20relative\x20path\x20to:\x20'+_0x38de79));const _0x5f2b32=await withSpinner('Resolving\x20path\x20\x27'+_0x38de79+'\x27...',()=>_0x1316fb[_0x3acd8f(0x19a)][_0x3acd8f(0x119)](_0x38de79),{'verbose':_0x3b7add['verbose']}),_0x19fe04=_0x5f2b32[_0x3acd8f(0x188)];_0x3b7add['verbose']&&(console[_0x3acd8f(0x128)](_0x3acd8f(0x16d)+_0x19fe04[_0x3acd8f(0x116)]),console['error'](_0x3acd8f(0x11a)+_0x19fe04['parentId']),_0x19fe04[_0x3acd8f(0x13f)]&&console[_0x3acd8f(0x128)]('Folder\x20ID:\x20'+_0x19fe04[_0x3acd8f(0x13f)]),_0x19fe04['segmentId']&&console['error'](_0x3acd8f(0x150)+_0x19fe04[_0x3acd8f(0x192)]));if(_0x19fe04[_0x3acd8f(0x116)]===_0x3acd8f(0x113)){const _0x336021=await withSpinner(_0x3acd8f(0x114),()=>_0x1316fb[_0x3acd8f(0x19a)][_0x3acd8f(0x15d)](_0x19fe04[_0x3acd8f(0x1a1)]),{'verbose':_0x3b7add[_0x3acd8f(0x149)]});await handleSingleObjectOutput(_0x336021['data'],_0x3b7add);}else{if(_0x19fe04[_0x3acd8f(0x116)]===_0x3acd8f(0x17e)){if(!_0x19fe04[_0x3acd8f(0x13f)])throw new SDKError(ErrorCode[_0x3acd8f(0x15c)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1dbc9c=await withSpinner(_0x3acd8f(0x1b2),()=>_0x1316fb[_0x3acd8f(0x19a)][_0x3acd8f(0x1a3)](_0x19fe04['folderId']),{'verbose':_0x3b7add[_0x3acd8f(0x149)]});await handleSingleObjectOutput(_0x1dbc9c[_0x3acd8f(0x188)],_0x3b7add);}else{if(_0x19fe04[_0x3acd8f(0x116)]===_0x3acd8f(0x19a)){if(!_0x19fe04[_0x3acd8f(0x192)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3acd8f(0x189));const _0x24125e=await withSpinner(_0x3acd8f(0x17d),()=>_0x1316fb[_0x3acd8f(0x19a)]['getSegment'](_0x19fe04['parentId'],_0x19fe04[_0x3acd8f(0x192)]),{'verbose':_0x3b7add['verbose']});await handleSingleObjectOutput(_0x24125e[_0x3acd8f(0x188)],_0x3b7add);}}}return 0x0;}catch(_0x310c6d){if(_0x310c6d instanceof SDKError)return console[_0x3acd8f(0x128)](_0x3acd8f(0x148)+_0x310c6d['message']),_0x310c6d[_0x3acd8f(0x160)]&&console['error'](_0x3acd8f(0x174)+_0x310c6d[_0x3acd8f(0x160)]),0x1;throw _0x310c6d;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x182);[a27_0x20032a(0x142)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x20032a(0x152)](_0x42e1f7){const _0x2b50bf=a27_0x20032a,{options:_0x586241,args:_0x53350c,tdx:_0x44e579}=_0x42e1f7,_0x440d28=_0x53350c[0x0];if(!_0x440d28)return console['error'](_0x2b50bf(0x144)),console[_0x2b50bf(0x128)](_0x2b50bf(0x18d)),console['error'](_0x2b50bf(0x14e)),console[_0x2b50bf(0x128)]('Examples:'),console[_0x2b50bf(0x128)](_0x2b50bf(0x136)),console[_0x2b50bf(0x128)](_0x2b50bf(0x19c)),0x1;try{const _0x39bda5=_0x586241['parentSegment'],_0x35a343=await resolveSegmentTarget(_0x440d28,_0x39bda5,_0x586241[_0x2b50bf(0x149)]);_0x586241[_0x2b50bf(0x149)]&&console[_0x2b50bf(0x128)](_0x2b50bf(0x184)+_0x35a343);const _0x102c1d=await withSpinner(_0x2b50bf(0x111)+_0x440d28+'\x27...',()=>_0x44e579[_0x2b50bf(0x19a)][_0x2b50bf(0x119)](_0x35a343),{'verbose':_0x586241[_0x2b50bf(0x149)]}),_0x5a53cd=_0x102c1d['data'];_0x586241[_0x2b50bf(0x149)]&&(console[_0x2b50bf(0x128)](_0x2b50bf(0x16d)+_0x5a53cd[_0x2b50bf(0x116)]),console[_0x2b50bf(0x128)](_0x2b50bf(0x11a)+_0x5a53cd[_0x2b50bf(0x1a1)]));if(_0x5a53cd[_0x2b50bf(0x116)]===_0x2b50bf(0x17e))return console[_0x2b50bf(0x128)](_0x2b50bf(0x19f)),console[_0x2b50bf(0x128)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x5a53cd[_0x2b50bf(0x116)]===_0x2b50bf(0x113))return console['error'](_0x2b50bf(0x17a)),console['error'](_0x2b50bf(0x161)),0x1;if(!_0x5a53cd[_0x2b50bf(0x192)])throw new SDKError(ErrorCode[_0x2b50bf(0x191)],_0x2b50bf(0x189));const _0x3bd532=await withSpinner(_0x2b50bf(0x131),()=>_0x44e579['segment']['getSegmentSQL'](_0x5a53cd[_0x2b50bf(0x1a1)],_0x5a53cd[_0x2b50bf(0x192)]),{'verbose':_0x586241[_0x2b50bf(0x149)]});let _0x2c2d34=_0x3bd532[_0x2b50bf(0x188)];const _0x339d72=resolveLimit(_0x586241[_0x2b50bf(0x173)],DEFAULT_DISPLAY_LIMIT),_0x436f1b=/\bLIMIT\s+\d+/i[_0x2b50bf(0x1ad)](_0x2c2d34);!_0x436f1b&&(_0x2c2d34=_0x2c2d34[_0x2b50bf(0x133)]()[_0x2b50bf(0x129)](/;+$/,''),_0x2c2d34='SELECT\x20*\x20FROM\x20(\x0a'+_0x2c2d34+_0x2b50bf(0x186)+_0x339d72);_0x586241['verbose']&&console[_0x2b50bf(0x128)](_0x2b50bf(0x13c)+_0x2c2d34);const _0x1155e1=await withProgressSpinner(_0x2b50bf(0x19b),async _0x342b68=>{const _0x2177f3=_0x2b50bf,_0x3bb2f4=await _0x44e579[_0x2177f3(0x14a)][_0x2177f3(0x152)](_0x2c2d34,{'catalog':'td','schema':_0x2177f3(0x175),'onJobId':_0x58302a=>{_0x342b68['setJobId'](_0x58302a);}});return _0x3bb2f4;},{'verbose':_0x586241['verbose']}),_0x2710e0=_0x1155e1[_0x2b50bf(0x188)],_0x171b08=_0x2710e0['jobId']?_0x2b50bf(0x132)+_0x2710e0[_0x2b50bf(0x12c)]+']':'';return console[_0x2b50bf(0x128)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x2710e0[_0x2b50bf(0x165)][_0x2b50bf(0x127)][_0x2b50bf(0x151)]()+'\x20rows\x20'+(_0x2b50bf(0x1af)+formatElapsed(_0x2710e0['stats']['elapsedTimeMillis'])+_0x171b08)),await handleQueryOutput(_0x2710e0,_0x586241),0x0;}catch(_0x4b4cff){if(_0x4b4cff instanceof SDKError)return console[_0x2b50bf(0x128)](_0x2b50bf(0x17c)+_0x4b4cff[_0x2b50bf(0x11c)]+']'),console[_0x2b50bf(0x128)]('\x0a'+_0x4b4cff['message']),0x1;throw _0x4b4cff;}}}function a27_0x4c46(_0x2108e9,_0xf0b27c){_0x2108e9=_0x2108e9-0x10f;const _0x5a844b=a27_0x5a84();let _0x4c460a=_0x5a844b[_0x2108e9];return _0x4c460a;}export class SegmentFolderListCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x120);[a27_0x20032a(0x142)]=a27_0x20032a(0x19d);async[a27_0x20032a(0x152)](_0x1ce214){const _0x25c8f7=a27_0x20032a,{options:_0x329dcd,args:_0x4b08a0,tdx:_0x4567a0}=_0x1ce214;if(_0x4b08a0[_0x25c8f7(0x157)]===0x0)return console[_0x25c8f7(0x128)](_0x25c8f7(0x110)),console[_0x25c8f7(0x128)](_0x25c8f7(0x115)),0x1;const _0x5ef3ce=_0x4b08a0[0x0];try{_0x329dcd[_0x25c8f7(0x149)]&&(console['error'](_0x25c8f7(0x1aa)+_0x329dcd[_0x25c8f7(0x181)]),console[_0x25c8f7(0x128)](_0x25c8f7(0x170)+_0x5ef3ce));const _0x48d345=await withSpinner(_0x25c8f7(0x16e)+_0x5ef3ce+_0x25c8f7(0x14c),()=>_0x4567a0['segment']['resolveParentId'](_0x5ef3ce),{'verbose':_0x329dcd['verbose']}),_0x13b54c=_0x48d345[_0x25c8f7(0x188)];_0x329dcd[_0x25c8f7(0x149)]&&console[_0x25c8f7(0x128)](_0x25c8f7(0x140)+_0x13b54c);const _0x32454c=await withSpinner(_0x25c8f7(0x12a)+_0x5ef3ce+_0x25c8f7(0x14c),()=>_0x4567a0[_0x25c8f7(0x19a)][_0x25c8f7(0x18c)](_0x13b54c),{'verbose':_0x329dcd[_0x25c8f7(0x149)]}),_0x1c182b=_0x32454c['data'];return console[_0x25c8f7(0x128)](_0x25c8f7(0x1a6)+_0x1c182b[_0x25c8f7(0x157)]+_0x25c8f7(0x123)+(_0x1c182b[_0x25c8f7(0x157)]!==0x1?'s':'')),await handleSDKOutput(_0x1c182b,_0x329dcd),0x0;}catch(_0x5dbd17){if(_0x5dbd17 instanceof SDKError)return console[_0x25c8f7(0x128)]('Error:\x20'+_0x5dbd17[_0x25c8f7(0x12d)]),_0x5dbd17[_0x25c8f7(0x160)]&&console[_0x25c8f7(0x128)]('\x20\x20Cause:\x20'+_0x5dbd17['cause']),0x1;throw _0x5dbd17;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x143);['description']=a27_0x20032a(0x138);async['execute'](_0x59d29c){const _0x1ab85d=a27_0x20032a,{options:_0x2f16d5,args:_0x56e909,tdx:_0x1a0867}=_0x59d29c;if(_0x56e909['length']===0x0)return console[_0x1ab85d(0x128)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x1ab85d(0x128)](_0x1ab85d(0x158)),0x1;try{const {parentId:_0x48bf28,childId:_0x587b2a}=parseSegmentRef(_0x56e909[0x0]);_0x2f16d5[_0x1ab85d(0x149)]&&(console['error']('Site:\x20'+_0x2f16d5['site']),console[_0x1ab85d(0x128)](_0x1ab85d(0x170)+_0x48bf28),_0x587b2a&&console[_0x1ab85d(0x128)](_0x1ab85d(0x141)+_0x587b2a));if(!_0x587b2a)return console[_0x1ab85d(0x128)](_0x1ab85d(0x1a5)),0x1;const _0x163f3f=await withSpinner(_0x1ab85d(0x16e)+_0x48bf28+_0x1ab85d(0x14c),()=>_0x1a0867[_0x1ab85d(0x19a)]['resolveParentId'](_0x48bf28),{'verbose':_0x2f16d5[_0x1ab85d(0x149)]}),_0x1afb48=_0x163f3f['data'];_0x2f16d5[_0x1ab85d(0x149)]&&console[_0x1ab85d(0x128)](_0x1ab85d(0x140)+_0x1afb48);const _0x3c3663=await withSpinner('Resolving\x20folder\x20\x27'+_0x587b2a+_0x1ab85d(0x14c),()=>_0x1a0867[_0x1ab85d(0x19a)][_0x1ab85d(0x155)](_0x1afb48,_0x587b2a),{'verbose':_0x2f16d5[_0x1ab85d(0x149)]}),_0x1da18c=_0x3c3663[_0x1ab85d(0x188)];_0x2f16d5[_0x1ab85d(0x149)]&&console[_0x1ab85d(0x128)](_0x1ab85d(0x1a4)+_0x1da18c);const _0x1e935e=await withSpinner('Fetching\x20folder\x20\x27'+_0x587b2a+'\x27...',()=>_0x1a0867[_0x1ab85d(0x19a)]['getFolder'](_0x1da18c),{'verbose':_0x2f16d5[_0x1ab85d(0x149)]});return await handleSDKOutput([_0x1e935e[_0x1ab85d(0x188)]],_0x2f16d5),0x0;}catch(_0x3afdb5){if(_0x3afdb5 instanceof SDKError)return console[_0x1ab85d(0x128)](_0x1ab85d(0x148)+_0x3afdb5[_0x1ab85d(0x12d)]),_0x3afdb5['cause']&&console[_0x1ab85d(0x128)](_0x1ab85d(0x174)+_0x3afdb5[_0x1ab85d(0x160)]),0x1;throw _0x3afdb5;}}}function a27_0x5a84(){const _0x14c0ba=['trim','2684472ZicYGk','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Show\x20segment\x20folder\x20details','format','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','SQL\x20query:\x0a','513VjcrrP','createFolder','folderId','Resolved\x20parent\x20ID:\x20','Folder\x20name:\x20','description','segment:folder:show','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','web','Create\x20segment\x20folder\x20for\x20organization','Get\x20SQL\x20query\x20for\x20child\x20segment','Error:\x20','verbose','query','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x27...','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Segment\x20ID:\x20','toLocaleString','execute','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','resolveFolderId','segment:desc','length','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Use:\x20tdx\x20ps\x20view','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20Folder\x20path:\x20','SEGMENT_FOLDER_NOT_FOUND','getParent','Options:','15130YyiRtN','cause','Use:\x20tdx\x20ps\x20show','segment:folder:create','Usage:\x20tdx\x20segment\x20describe\x20<path>','Show\x20folder\x20or\x20child\x20segment\x20details','stats','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','14693zNaEIm','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','jsonl','Resolved\x20YAML\x20file:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','log','Resolved\x20type:\x20','Resolving\x20parent\x20segment\x20\x27','Use:\x20tdx\x20ps\x20view\x20-w','Parent\x20name:\x20','642uXSPWB','getSegmentSQL','limit','\x20\x20Cause:\x20','information_schema','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','(root)','Parent\x20segment:\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','✖\x20Query\x20failed\x20[','Fetching\x20segment\x20details...','folder','Folder\x20ID:\x20','folderPath','site','segment:show','Usage:\x20tdx\x20sg\x20desc\x20<name>','Target\x20path:\x20','3mmHcge','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parentSegment','data','Segment\x20ID\x20missing\x20from\x20resolved\x20path','name','url','listFolders','Usage:\x20tdx\x20sg\x20show\x20<name>','segment:sql','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','SEGMENT_NOT_FOUND','segmentId','Examples:','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Path\x20or\x20name\x20is\x20required','1463108krVavu','segment:view','segment','Executing\x20segment\x20query...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','green','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20sql','parentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','getFolder','Resolved\x20folder\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','✔\x20Found\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','21458cJaoWi','3572789qVaNfY','Site:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','includes','test','/e/','in\x20','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20Parent\x20segment:\x20','Fetching\x20folder\x20details...','\x20\x20Segment\x20name:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolving\x20\x27','getSegment','parent','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','type','3mwSgLT','fullPath','resolvePathToResource','Parent\x20ID:\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','code','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','segment:folder:list','parentFolder','\x20Opening\x20','\x20folder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Creating\x20folder\x20\x27','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','processedRows','error','replace','Listing\x20folders\x20for\x20parent\x20\x27','/app/ps/','jobId','message','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','1774930fKwOLP','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20for\x20segment...','\x20[Job\x20ID:\x20'];a27_0x5a84=function(){return _0x14c0ba;};return a27_0x5a84();}export class SegmentSQLCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x18e);[a27_0x20032a(0x142)]=a27_0x20032a(0x147);async[a27_0x20032a(0x152)](_0x4c2fed){const _0x15cb29=a27_0x20032a,{options:_0x2728c4,args:_0x314284,tdx:_0x448938}=_0x4c2fed,_0x5dab37=_0x314284[0x0];if(!_0x5dab37)return console[_0x15cb29(0x128)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x15cb29(0x128)](_0x15cb29(0x11b)),console[_0x15cb29(0x128)](_0x15cb29(0x195)),console[_0x15cb29(0x128)](_0x15cb29(0x193)),console[_0x15cb29(0x128)](_0x15cb29(0x13b)),console[_0x15cb29(0x128)](_0x15cb29(0x14d)),0x1;try{const _0x2604a4=_0x2728c4['parentSegment'],_0x1a1f57=await resolveSegmentTarget(_0x5dab37,_0x2604a4,_0x2728c4[_0x15cb29(0x149)]);_0x2728c4['verbose']&&console[_0x15cb29(0x128)](_0x15cb29(0x184)+_0x1a1f57);const _0x3f1203=await withSpinner(_0x15cb29(0x111)+_0x5dab37+_0x15cb29(0x14c),()=>_0x448938[_0x15cb29(0x19a)]['resolvePathToResource'](_0x1a1f57),{'verbose':_0x2728c4[_0x15cb29(0x149)]}),_0x495cf6=_0x3f1203[_0x15cb29(0x188)];_0x2728c4[_0x15cb29(0x149)]&&(console[_0x15cb29(0x128)]('Resolved\x20type:\x20'+_0x495cf6[_0x15cb29(0x116)]),console[_0x15cb29(0x128)](_0x15cb29(0x11a)+_0x495cf6['parentId']));if(_0x495cf6[_0x15cb29(0x116)]===_0x15cb29(0x17e))return console[_0x15cb29(0x128)](_0x15cb29(0x1ab)),console[_0x15cb29(0x128)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x495cf6[_0x15cb29(0x116)]===_0x15cb29(0x113))return console[_0x15cb29(0x128)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x15cb29(0x128)](_0x15cb29(0x1a0)),0x1;if(!_0x495cf6[_0x15cb29(0x192)])throw new SDKError(ErrorCode[_0x15cb29(0x191)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x505d41=await withSpinner(_0x15cb29(0x131),()=>_0x448938[_0x15cb29(0x19a)][_0x15cb29(0x172)](_0x495cf6[_0x15cb29(0x1a1)],_0x495cf6[_0x15cb29(0x192)]),{'verbose':_0x2728c4['verbose']}),_0x1ff5da=_0x505d41[_0x15cb29(0x188)];return _0x2728c4[_0x15cb29(0x139)]==='json'||_0x2728c4[_0x15cb29(0x139)]===_0x15cb29(0x169)?await handleSDKOutput([{'sql':_0x1ff5da}],_0x2728c4):console[_0x15cb29(0x16c)](_0x1ff5da),0x0;}catch(_0x20dd3f){if(_0x20dd3f instanceof SDKError)return console[_0x15cb29(0x128)](_0x15cb29(0x148)+_0x20dd3f[_0x15cb29(0x12d)]),_0x20dd3f[_0x15cb29(0x160)]&&console[_0x15cb29(0x128)]('\x20\x20Cause:\x20'+_0x20dd3f[_0x15cb29(0x160)]),0x1;throw _0x20dd3f;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x162);['description']=a27_0x20032a(0x146);async[a27_0x20032a(0x152)](_0x25e30a){const _0x75a921=a27_0x20032a,{options:_0x128f05,args:_0x5db66a,tdx:_0x461d48}=_0x25e30a,_0x2c733d=_0x128f05;if(_0x5db66a[_0x75a921(0x157)]<0x2)return console[_0x75a921(0x128)](_0x75a921(0x176)),console[_0x75a921(0x128)](_0x75a921(0x177)),0x1;const _0x11877a=_0x5db66a[0x0],_0x5e76bf=_0x5db66a[0x1];_0x2c733d[_0x75a921(0x149)]&&(console[_0x75a921(0x128)](_0x75a921(0x1aa)+_0x2c733d['site']),console['error'](_0x75a921(0x179)+_0x11877a),console[_0x75a921(0x128)](_0x75a921(0x141)+_0x5e76bf));let _0x3b1bf5;if(_0x2c733d[_0x75a921(0x121)]){const _0x34af4d=_0x2c733d['parentFolder'],_0x34712d=await withSpinner(_0x75a921(0x16e)+_0x11877a+_0x75a921(0x14c),()=>_0x461d48[_0x75a921(0x19a)][_0x75a921(0x153)](_0x11877a),{'verbose':_0x2c733d[_0x75a921(0x149)]}),_0x592ba4=_0x34712d[_0x75a921(0x188)],_0x571a93=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x34af4d+_0x75a921(0x14c),()=>_0x461d48['segment'][_0x75a921(0x155)](_0x592ba4,_0x34af4d),{'verbose':_0x2c733d['verbose']});_0x3b1bf5=_0x571a93[_0x75a921(0x188)],_0x2c733d['verbose']&&console[_0x75a921(0x128)](_0x75a921(0x1b0)+_0x3b1bf5);}const _0x1bb29d={'name':_0x5e76bf,'description':_0x2c733d[_0x75a921(0x142)],'parentFolderId':_0x3b1bf5},_0xb4d302=await withSpinner(_0x75a921(0x125)+_0x5e76bf+'\x27...',()=>_0x461d48[_0x75a921(0x19a)][_0x75a921(0x13e)](_0x11877a,_0x1bb29d),{'verbose':_0x2c733d[_0x75a921(0x149)]}),_0x1224e0=_0xb4d302[_0x75a921(0x188)];return console[_0x75a921(0x128)](_0x75a921(0x135)+_0x1224e0[_0x75a921(0x18a)]+'\x27\x20with\x20ID:\x20'+_0x1224e0['id']),await handleSDKOutput([_0x1224e0],_0x2c733d),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x199);[a27_0x20032a(0x142)]=a27_0x20032a(0x164);async[a27_0x20032a(0x152)](_0x366d2c){const _0x165520=a27_0x20032a,{options:_0x1095c4,args:_0x6d64cd,tdx:_0x447e16}=_0x366d2c,_0x10427a=_0x6d64cd[0x0];if(!_0x10427a)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x165520(0x128)](_0x165520(0x137)),console[_0x165520(0x128)](_0x165520(0x11d)),console[_0x165520(0x128)](_0x165520(0x15e)),console[_0x165520(0x128)](_0x165520(0x16b)),console[_0x165520(0x128)](_0x165520(0x193)),console[_0x165520(0x128)](_0x165520(0x11f)),console[_0x165520(0x128)](_0x165520(0x14b)),console[_0x165520(0x128)](_0x165520(0x124)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x28140e=_0x1095c4[_0x165520(0x187)],_0x454725=await resolveSegmentTarget(_0x10427a,_0x28140e,_0x1095c4[_0x165520(0x149)]);_0x1095c4['verbose']&&console[_0x165520(0x128)](_0x165520(0x184)+_0x454725);const _0x510e54=await withSpinner(_0x165520(0x111)+_0x10427a+_0x165520(0x14c),()=>_0x447e16[_0x165520(0x19a)]['resolvePathToResource'](_0x454725),{'verbose':_0x1095c4[_0x165520(0x149)]}),_0x5092d1=_0x510e54[_0x165520(0x188)];_0x1095c4['verbose']&&(console[_0x165520(0x128)]('Resolved\x20type:\x20'+_0x5092d1['type']),console[_0x165520(0x128)](_0x165520(0x11a)+_0x5092d1[_0x165520(0x1a1)]),_0x5092d1[_0x165520(0x13f)]&&console[_0x165520(0x128)](_0x165520(0x17f)+_0x5092d1[_0x165520(0x13f)]),_0x5092d1[_0x165520(0x192)]&&console['error'](_0x165520(0x150)+_0x5092d1[_0x165520(0x192)]));if(_0x1095c4[_0x165520(0x145)]){if(_0x5092d1[_0x165520(0x116)]===_0x165520(0x17e))return console[_0x165520(0x128)](_0x165520(0x196)),0x1;if(_0x5092d1[_0x165520(0x116)]===_0x165520(0x113))return console[_0x165520(0x128)](_0x165520(0x17b)),console['error'](_0x165520(0x16f)),0x1;if(!_0x5092d1[_0x165520(0x192)])throw new SDKError(ErrorCode[_0x165520(0x191)],_0x165520(0x189));const _0x1741a8=getConsoleNextUrl(_0x1095c4[_0x165520(0x181)],_0x165520(0x12b)+_0x5092d1[_0x165520(0x1a1)]+_0x165520(0x1ae)+_0x5092d1[_0x165520(0x192)]);return console[_0x165520(0x128)](a27_0x2b8c2b[_0x165520(0x19e)]('✔')+_0x165520(0x122)+a27_0x2b8c2b['cyan'](_0x1741a8)),openBrowser(_0x1741a8),0x0;}if(_0x5092d1[_0x165520(0x116)]===_0x165520(0x17e)){if(!_0x5092d1[_0x165520(0x13f)])throw new SDKError(ErrorCode[_0x165520(0x15c)],_0x165520(0x1a7));const _0xa64f7f=await withSpinner(_0x165520(0x1b2),()=>_0x447e16[_0x165520(0x19a)][_0x165520(0x1a3)](_0x5092d1[_0x165520(0x13f)]),{'verbose':_0x1095c4[_0x165520(0x149)]});await handleSingleObjectOutput(_0xa64f7f[_0x165520(0x188)],_0x1095c4);}else{if(_0x5092d1[_0x165520(0x116)]===_0x165520(0x19a)){if(!_0x5092d1[_0x165520(0x192)])throw new SDKError(ErrorCode[_0x165520(0x191)],_0x165520(0x189));const _0x4e7df9=await withSpinner('Fetching\x20segment\x20details...',()=>_0x447e16[_0x165520(0x19a)][_0x165520(0x112)](_0x5092d1['parentId'],_0x5092d1['segmentId']),{'verbose':_0x1095c4[_0x165520(0x149)]}),_0x53ec71=getConsoleNextUrl(_0x1095c4['site'],_0x165520(0x12b)+_0x5092d1[_0x165520(0x1a1)]+'/e/'+_0x5092d1[_0x165520(0x192)]),_0x49afa2=_0x4e7df9[_0x165520(0x188)];_0x49afa2[_0x165520(0x18b)]=_0x53ec71,await handleSingleObjectOutput(_0x49afa2,_0x1095c4);}else return console[_0x165520(0x128)](_0x165520(0x126)),console[_0x165520(0x128)](_0x165520(0x159)),0x1;}return 0x0;}catch(_0x29b11a){if(_0x29b11a instanceof SDKError)return console[_0x165520(0x128)](_0x165520(0x148)+_0x29b11a[_0x165520(0x12d)]),_0x29b11a['cause']&&console[_0x165520(0x128)](_0x165520(0x174)+_0x29b11a[_0x165520(0x160)]),0x1;throw _0x29b11a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a27_0x20032a(0x156);[a27_0x20032a(0x142)]=a27_0x20032a(0x18f);async[a27_0x20032a(0x152)](_0x1ba060){const _0x51adf4=a27_0x20032a,{options:_0x2215e8,args:_0x42a291,tdx:_0x15221f}=_0x1ba060,_0x24ed86=_0x42a291[0x0];if(!_0x24ed86)return console['error'](_0x51adf4(0x144)),console['error'](_0x51adf4(0x183)),console[_0x51adf4(0x128)](_0x51adf4(0x154)),console[_0x51adf4(0x128)](_0x51adf4(0x193)),console[_0x51adf4(0x128)](_0x51adf4(0x15a)),console['error'](_0x51adf4(0x130)),0x1;try{const _0x19b460=_0x2215e8[_0x51adf4(0x187)],_0x27a710=await resolveSegmentTarget(_0x24ed86,_0x19b460,_0x2215e8['verbose']);_0x2215e8[_0x51adf4(0x149)]&&console[_0x51adf4(0x128)]('Target\x20path:\x20'+_0x27a710);const _0xbb9adb=await withSpinner('Resolving\x20\x27'+_0x24ed86+_0x51adf4(0x14c),()=>_0x15221f[_0x51adf4(0x19a)][_0x51adf4(0x119)](_0x27a710),{'verbose':_0x2215e8[_0x51adf4(0x149)]}),_0x28d337=_0xbb9adb[_0x51adf4(0x188)];_0x2215e8[_0x51adf4(0x149)]&&(console['error']('Resolved\x20type:\x20'+_0x28d337[_0x51adf4(0x116)]),console['error']('Parent\x20ID:\x20'+_0x28d337['parentId']));if(_0x28d337[_0x51adf4(0x116)]===_0x51adf4(0x17e))return console[_0x51adf4(0x128)](_0x51adf4(0x166)),console[_0x51adf4(0x128)](_0x51adf4(0x12e)),0x1;if(_0x28d337[_0x51adf4(0x116)]===_0x51adf4(0x113))return console['error'](_0x51adf4(0x1a2)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x28d337['segmentId'])throw new SDKError(ErrorCode[_0x51adf4(0x191)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1f389a=await withSpinner(_0x51adf4(0x131),()=>_0x15221f[_0x51adf4(0x19a)][_0x51adf4(0x172)](_0x28d337[_0x51adf4(0x1a1)],_0x28d337[_0x51adf4(0x192)]),{'verbose':_0x2215e8['verbose']}),_0x5b1b6b=_0x1f389a[_0x51adf4(0x188)],_0x17cf30=await executeSchemaQuery(_0x5b1b6b,_0x15221f,_0x2215e8);return await handleQueryOutput(_0x17cf30,_0x2215e8),0x0;}catch(_0x36dc9c){if(_0x36dc9c instanceof SDKError)return console[_0x51adf4(0x128)](_0x51adf4(0x148)+_0x36dc9c[_0x51adf4(0x12d)]),_0x36dc9c['cause']&&console[_0x51adf4(0x128)](_0x51adf4(0x174)+_0x36dc9c[_0x51adf4(0x160)]),0x1;throw _0x36dc9c;}}}
|
|
1
|
+
const a27_0x502d7c=a27_0x5363;(function(_0x5109b2,_0x5f0633){const _0x181896=a27_0x5363,_0x2ee712=_0x5109b2();while(!![]){try{const _0xef91a5=parseInt(_0x181896(0x218))/0x1+parseInt(_0x181896(0x1c7))/0x2*(-parseInt(_0x181896(0x19e))/0x3)+parseInt(_0x181896(0x19d))/0x4+parseInt(_0x181896(0x1fd))/0x5+parseInt(_0x181896(0x1d3))/0x6*(parseInt(_0x181896(0x1de))/0x7)+-parseInt(_0x181896(0x1d6))/0x8+parseInt(_0x181896(0x217))/0x9*(parseInt(_0x181896(0x1a2))/0xa);if(_0xef91a5===_0x5f0633)break;else _0x2ee712['push'](_0x2ee712['shift']());}catch(_0x17d7cc){_0x2ee712['push'](_0x2ee712['shift']());}}}(a27_0x2a82,0x8d89c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a27_0x2a82(){const _0x2638af=['\x20\x20Parent\x20segment:\x20','7779050PODZPn','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20Segment\x20name:\x20','segment:show','limit','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x27...','Use:\x20tdx\x20ps\x20view\x20-w','getFolder','Fetching\x20parent\x20segment\x20details...','Parent\x20ID:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','✔\x20Query\x20completed:\x20Processed\x20','message','\x20Opening\x20','log','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Options:','\x20folder','SEGMENT_NOT_FOUND','fullPath','✖\x20Query\x20failed\x20[','segment:folder:list','Target\x20path:\x20','setJobId','Fetching\x20folder\x20details...','in\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','json','Site:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Usage:\x20tdx\x20sg\x20desc\x20<name>','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20folder\x20\x27','type','2648dnFLJL','Create\x20segment\x20folder\x20for\x20organization','Segment\x20ID:\x20','Resolved\x20YAML\x20file:\x20','processedRows','query','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','site','segment:desc','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Fetching\x20SQL\x20for\x20segment...','111258bdOsXA','\x20[Job\x20ID:\x20','INVALID_ARGUMENT','7153816PIexSU','length','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','cause','resolveFolderId','execute','Error:\x20Path\x20or\x20name\x20is\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','7cAJvtR','Fetching\x20segment\x20details...','/e/','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x27\x20with\x20ID:\x20','Resolving\x20\x27','✔\x20Found\x20','Folder\x20name:\x20','Examples:','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment:view','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment','Show\x20child\x20segment\x20schema\x20(column\x20types)','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','segment:sql','Resolving\x20folder\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','format','folderId','segment:folder:create','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','/app/ps/','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20relative\x20path\x20to:\x20','trim','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','766865AoOSLN','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','elapsedTimeMillis','Executing\x20segment\x20query...','stats','replace','Parent\x20segment:\x20','resolveParentId','folder','Resolved\x20type:\x20','Resolved\x20parent\x20ID:\x20','parent','Resolving\x20parent\x20segment\x20\x27','parentId','segment:folder:show','Error:\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','includes','segment:describe','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','verbose','test','Resolving\x20path\x20\x27','folderPath','9CKggsI','645026XMQYpT','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Use:\x20tdx\x20ps\x20sql','name','\x20\x20Cause:\x20','\x20\x20Folder\x20path:\x20','getSegment','jobId','Creating\x20folder\x20\x27','Parent\x20name:\x20','getParent','parentSegment','data','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','error','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segmentId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','resolvePathToResource','Resolving\x20parent\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','getSegmentSQL','code','web','\x20rows\x20','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','988768eAadbD','834nzFyIq','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20show'];a27_0x2a82=function(){return _0x2638af;};return a27_0x2a82();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x2ad0cb from'chalk';async function resolveSegmentTarget(_0x14d7ff,_0x4067aa,_0x4e3a56){const _0x1f390e=a27_0x5363;if(isYamlFilePath(_0x14d7ff))try{const _0x1a55c0=await resolveYamlFilePath(_0x14d7ff);return _0x4e3a56&&(console['error'](_0x1f390e(0x1ca)+_0x14d7ff),console[_0x1f390e(0x18e)](_0x1f390e(0x1a1)+_0x1a55c0[_0x1f390e(0x229)]),console[_0x1f390e(0x18e)](_0x1f390e(0x1a4)+_0x1a55c0['segmentName']),console[_0x1f390e(0x18e)](_0x1f390e(0x223)+(_0x1a55c0[_0x1f390e(0x216)]||'(root)')),console[_0x1f390e(0x18e)]('\x20\x20Full\x20path:\x20'+_0x1a55c0[_0x1f390e(0x1b7)])),_0x1a55c0[_0x1f390e(0x1b7)];}catch(_0x1de3dc){throw new SDKError(ErrorCode[_0x1f390e(0x1d5)],_0x1f390e(0x1dd)+_0x1de3dc[_0x1f390e(0x1b0)]);}if(!_0x4067aa)throw new SDKError(ErrorCode[_0x1f390e(0x1d5)],_0x1f390e(0x1e7));return _0x4067aa+'/'+_0x14d7ff;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x20f);['description']='Show\x20segment\x20or\x20folder\x20details';async[a27_0x502d7c(0x1db)](_0x4fd308){const _0x330eda=a27_0x502d7c,{options:_0x546f98,args:_0x35c2e8,tdx:_0x16209c}=_0x4fd308,_0xa849f8=_0x35c2e8[0x0],_0x7369cd=!_0xa849f8&&!!_0x546f98[_0x330eda(0x229)],_0x570123=_0xa849f8||_0x546f98[_0x330eda(0x229)];if(!_0x570123)return console[_0x330eda(0x18e)](_0x330eda(0x1dc)),console[_0x330eda(0x18e)](_0x330eda(0x1eb)),console[_0x330eda(0x18e)](_0x330eda(0x1e6)),console[_0x330eda(0x18e)](_0x330eda(0x1b3)),console['error'](_0x330eda(0x212)),console['error'](_0x330eda(0x21e)),console[_0x330eda(0x18e)](_0x330eda(0x1ae)),0x1;try{const _0x5e430a=_0x546f98['segmentPath'];let _0xa3c450=_0x570123;!_0x7369cd&&_0x5e430a&&!_0x570123[_0x330eda(0x20e)]('/')&&(_0xa3c450=_0x5e430a+'/'+_0x570123,_0x546f98[_0x330eda(0x213)]&&console['error'](_0x330eda(0x1f9)+_0xa3c450));const _0x5cef80=await withSpinner(_0x330eda(0x215)+_0xa3c450+'\x27...',()=>_0x16209c[_0x330eda(0x1ec)]['resolvePathToResource'](_0xa3c450),{'verbose':_0x546f98[_0x330eda(0x213)]}),_0xf4347c=_0x5cef80[_0x330eda(0x22a)];_0x546f98[_0x330eda(0x213)]&&(console['error'](_0x330eda(0x206)+_0xf4347c['type']),console['error'](_0x330eda(0x1ad)+_0xf4347c[_0x330eda(0x20a)]),_0xf4347c[_0x330eda(0x1f4)]&&console[_0x330eda(0x18e)](_0x330eda(0x1ea)+_0xf4347c[_0x330eda(0x1f4)]),_0xf4347c[_0x330eda(0x191)]&&console[_0x330eda(0x18e)](_0x330eda(0x1c9)+_0xf4347c[_0x330eda(0x191)]));if(_0xf4347c[_0x330eda(0x1c6)]===_0x330eda(0x208)){const _0x18ecd3=await withSpinner(_0x330eda(0x1ac),()=>_0x16209c['segment'][_0x330eda(0x228)](_0xf4347c['parentId']),{'verbose':_0x546f98[_0x330eda(0x213)]});await handleSingleObjectOutput(_0x18ecd3['data'],_0x546f98);}else{if(_0xf4347c[_0x330eda(0x1c6)]===_0x330eda(0x205)){if(!_0xf4347c[_0x330eda(0x1f4)])throw new SDKError(ErrorCode[_0x330eda(0x1c4)],_0x330eda(0x219));const _0x10fc5b=await withSpinner('Fetching\x20folder\x20details...',()=>_0x16209c['segment'][_0x330eda(0x1ab)](_0xf4347c[_0x330eda(0x1f4)]),{'verbose':_0x546f98[_0x330eda(0x213)]});await handleSingleObjectOutput(_0x10fc5b[_0x330eda(0x22a)],_0x546f98);}else{if(_0xf4347c[_0x330eda(0x1c6)]===_0x330eda(0x1ec)){if(!_0xf4347c[_0x330eda(0x191)])throw new SDKError(ErrorCode[_0x330eda(0x1b6)],_0x330eda(0x21d));const _0xf7f1cc=await withSpinner(_0x330eda(0x1df),()=>_0x16209c[_0x330eda(0x1ec)][_0x330eda(0x224)](_0xf4347c['parentId'],_0xf4347c['segmentId']),{'verbose':_0x546f98[_0x330eda(0x213)]});await handleSingleObjectOutput(_0xf7f1cc[_0x330eda(0x22a)],_0x546f98);}}}return 0x0;}catch(_0x1d2b70){if(_0x1d2b70 instanceof SDKError)return console[_0x330eda(0x18e)](_0x330eda(0x20c)+_0x1d2b70[_0x330eda(0x1b0)]),_0x1d2b70[_0x330eda(0x1d9)]&&console[_0x330eda(0x18e)](_0x330eda(0x222)+_0x1d2b70[_0x330eda(0x1d9)]),0x1;throw _0x1d2b70;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x1a5);[a27_0x502d7c(0x210)]=a27_0x502d7c(0x1ee);async[a27_0x502d7c(0x1db)](_0x264d68){const _0x17c6a2=a27_0x502d7c,{options:_0x55f417,args:_0x499f79,tdx:_0x156ba5}=_0x264d68,_0x3c829a=_0x499f79[0x0];if(!_0x3c829a)return console[_0x17c6a2(0x18e)](_0x17c6a2(0x1f6)),console[_0x17c6a2(0x18e)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x17c6a2(0x18e)](_0x17c6a2(0x195)),console[_0x17c6a2(0x18e)](_0x17c6a2(0x1e6)),console['error'](_0x17c6a2(0x20d)),console[_0x17c6a2(0x18e)](_0x17c6a2(0x19c)),0x1;try{const _0x2a16e8=_0x55f417[_0x17c6a2(0x229)],_0xd04508=await resolveSegmentTarget(_0x3c829a,_0x2a16e8,_0x55f417[_0x17c6a2(0x213)]);_0x55f417[_0x17c6a2(0x213)]&&console[_0x17c6a2(0x18e)](_0x17c6a2(0x1ba)+_0xd04508);const _0x2e2948=await withSpinner(_0x17c6a2(0x1e3)+_0x3c829a+_0x17c6a2(0x1a9),()=>_0x156ba5[_0x17c6a2(0x1ec)][_0x17c6a2(0x193)](_0xd04508),{'verbose':_0x55f417[_0x17c6a2(0x213)]}),_0x14f846=_0x2e2948['data'];_0x55f417[_0x17c6a2(0x213)]&&(console['error'](_0x17c6a2(0x206)+_0x14f846[_0x17c6a2(0x1c6)]),console[_0x17c6a2(0x18e)]('Parent\x20ID:\x20'+_0x14f846[_0x17c6a2(0x20a)]));if(_0x14f846[_0x17c6a2(0x1c6)]===_0x17c6a2(0x205))return console[_0x17c6a2(0x18e)](_0x17c6a2(0x1d8)),console['error'](_0x17c6a2(0x21f)),0x1;if(_0x14f846[_0x17c6a2(0x1c6)]==='parent')return console[_0x17c6a2(0x18e)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x17c6a2(0x18e)](_0x17c6a2(0x1a0)),0x1;if(!_0x14f846['segmentId'])throw new SDKError(ErrorCode[_0x17c6a2(0x1b6)],_0x17c6a2(0x21d));const _0xa8a791=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x156ba5[_0x17c6a2(0x1ec)][_0x17c6a2(0x197)](_0x14f846[_0x17c6a2(0x20a)],_0x14f846['segmentId']),{'verbose':_0x55f417['verbose']});let _0x24e3c4=_0xa8a791[_0x17c6a2(0x22a)];const _0x4ab11d=resolveLimit(_0x55f417[_0x17c6a2(0x1a6)],DEFAULT_DISPLAY_LIMIT),_0x5bf5d5=/\bLIMIT\s+\d+/i[_0x17c6a2(0x214)](_0x24e3c4);!_0x5bf5d5&&(_0x24e3c4=_0x24e3c4[_0x17c6a2(0x1fa)]()[_0x17c6a2(0x202)](/;+$/,''),_0x24e3c4=_0x17c6a2(0x1a7)+_0x24e3c4+_0x17c6a2(0x1f1)+_0x4ab11d);_0x55f417[_0x17c6a2(0x213)]&&console['error'](_0x17c6a2(0x19b)+_0x24e3c4);const _0xce04a0=await withProgressSpinner(_0x17c6a2(0x200),async _0x20c3cb=>{const _0x2613b1=_0x17c6a2,_0x468c9e=await _0x156ba5[_0x2613b1(0x1cc)][_0x2613b1(0x1db)](_0x24e3c4,{'catalog':'td','schema':'information_schema','onJobId':_0x36e7b4=>{const _0x456fb8=_0x2613b1;_0x20c3cb[_0x456fb8(0x1bb)](_0x36e7b4);}});return _0x468c9e;},{'verbose':_0x55f417['verbose']}),_0x4f5061=_0xce04a0[_0x17c6a2(0x22a)],_0x17c96c=_0x4f5061[_0x17c6a2(0x225)]?_0x17c6a2(0x1d4)+_0x4f5061[_0x17c6a2(0x225)]+']':'';return console[_0x17c6a2(0x18e)](_0x17c6a2(0x1af)+_0x4f5061[_0x17c6a2(0x201)][_0x17c6a2(0x1cb)]['toLocaleString']()+_0x17c6a2(0x19a)+(_0x17c6a2(0x1bd)+formatElapsed(_0x4f5061['stats'][_0x17c6a2(0x1ff)])+_0x17c96c)),await handleQueryOutput(_0x4f5061,_0x55f417),0x0;}catch(_0x411d6f){if(_0x411d6f instanceof SDKError)return console[_0x17c6a2(0x18e)](_0x17c6a2(0x1b8)+_0x411d6f[_0x17c6a2(0x198)]+']'),console[_0x17c6a2(0x18e)]('\x0a'+_0x411d6f[_0x17c6a2(0x1b0)]),0x1;throw _0x411d6f;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x502d7c(0x1b9);['description']=a27_0x502d7c(0x21c);async['execute'](_0x52af48){const _0x7e777=a27_0x502d7c,{options:_0x41ff45,args:_0x524111,tdx:_0x555c60}=_0x52af48;if(_0x524111[_0x7e777(0x1d7)]===0x0)return console[_0x7e777(0x18e)](_0x7e777(0x1cd)),console[_0x7e777(0x18e)](_0x7e777(0x190)),0x1;const _0x1fca2e=_0x524111[0x0];try{_0x41ff45[_0x7e777(0x213)]&&(console[_0x7e777(0x18e)](_0x7e777(0x1c0)+_0x41ff45[_0x7e777(0x1cf)]),console[_0x7e777(0x18e)](_0x7e777(0x227)+_0x1fca2e));const _0x3c2835=await withSpinner(_0x7e777(0x209)+_0x1fca2e+'\x27...',()=>_0x555c60[_0x7e777(0x1ec)][_0x7e777(0x204)](_0x1fca2e),{'verbose':_0x41ff45[_0x7e777(0x213)]}),_0x485235=_0x3c2835['data'];_0x41ff45[_0x7e777(0x213)]&&console[_0x7e777(0x18e)](_0x7e777(0x207)+_0x485235);const _0x33ebd0=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x1fca2e+_0x7e777(0x1a9),()=>_0x555c60[_0x7e777(0x1ec)]['listFolders'](_0x485235),{'verbose':_0x41ff45[_0x7e777(0x213)]}),_0x15e2d6=_0x33ebd0['data'];return console['error'](_0x7e777(0x1e4)+_0x15e2d6[_0x7e777(0x1d7)]+_0x7e777(0x1b5)+(_0x15e2d6[_0x7e777(0x1d7)]!==0x1?'s':'')),await handleSDKOutput(_0x15e2d6,_0x41ff45),0x0;}catch(_0x2f2bb5){if(_0x2f2bb5 instanceof SDKError)return console[_0x7e777(0x18e)]('Error:\x20'+_0x2f2bb5[_0x7e777(0x1b0)]),_0x2f2bb5[_0x7e777(0x1d9)]&&console[_0x7e777(0x18e)](_0x7e777(0x222)+_0x2f2bb5[_0x7e777(0x1d9)]),0x1;throw _0x2f2bb5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x20b);[a27_0x502d7c(0x210)]='Show\x20segment\x20folder\x20details';async[a27_0x502d7c(0x1db)](_0x17e0b9){const _0x7b720a=a27_0x502d7c,{options:_0x5af944,args:_0x55f2d9,tdx:_0x45f368}=_0x17e0b9;if(_0x55f2d9['length']===0x0)return console[_0x7b720a(0x18e)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x7b720a(0x18e)](_0x7b720a(0x22b)),0x1;try{const {parentId:_0x3f35e2,childId:_0x104f79}=parseSegmentRef(_0x55f2d9[0x0]);_0x5af944[_0x7b720a(0x213)]&&(console['error']('Site:\x20'+_0x5af944[_0x7b720a(0x1cf)]),console['error'](_0x7b720a(0x227)+_0x3f35e2),_0x104f79&&console[_0x7b720a(0x18e)](_0x7b720a(0x1e5)+_0x104f79));if(!_0x104f79)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x9b1e57=await withSpinner(_0x7b720a(0x209)+_0x3f35e2+_0x7b720a(0x1a9),()=>_0x45f368[_0x7b720a(0x1ec)][_0x7b720a(0x204)](_0x3f35e2),{'verbose':_0x5af944[_0x7b720a(0x213)]}),_0x30c8ab=_0x9b1e57[_0x7b720a(0x22a)];_0x5af944[_0x7b720a(0x213)]&&console[_0x7b720a(0x18e)]('Resolved\x20parent\x20ID:\x20'+_0x30c8ab);const _0x75bc93=await withSpinner(_0x7b720a(0x1f0)+_0x104f79+_0x7b720a(0x1a9),()=>_0x45f368[_0x7b720a(0x1ec)][_0x7b720a(0x1da)](_0x30c8ab,_0x104f79),{'verbose':_0x5af944['verbose']}),_0x1b7c1b=_0x75bc93[_0x7b720a(0x22a)];_0x5af944['verbose']&&console[_0x7b720a(0x18e)]('Resolved\x20folder\x20ID:\x20'+_0x1b7c1b);const _0x5384ad=await withSpinner(_0x7b720a(0x1c5)+_0x104f79+_0x7b720a(0x1a9),()=>_0x45f368['segment'][_0x7b720a(0x1ab)](_0x1b7c1b),{'verbose':_0x5af944[_0x7b720a(0x213)]});return await handleSDKOutput([_0x5384ad[_0x7b720a(0x22a)]],_0x5af944),0x0;}catch(_0x1dfacd){if(_0x1dfacd instanceof SDKError)return console[_0x7b720a(0x18e)]('Error:\x20'+_0x1dfacd[_0x7b720a(0x1b0)]),_0x1dfacd[_0x7b720a(0x1d9)]&&console[_0x7b720a(0x18e)]('\x20\x20Cause:\x20'+_0x1dfacd[_0x7b720a(0x1d9)]),0x1;throw _0x1dfacd;}}}function a27_0x5363(_0x4bb5e4,_0x229c4d){_0x4bb5e4=_0x4bb5e4-0x18d;const _0x2a82b9=a27_0x2a82();let _0x5363f9=_0x2a82b9[_0x4bb5e4];return _0x5363f9;}export class SegmentSQLCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x1ef);[a27_0x502d7c(0x210)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x502d7c(0x1db)](_0x174b38){const _0x2fdac7=a27_0x502d7c,{options:_0x45ec9a,args:_0xbaf8f8,tdx:_0x3903b3}=_0x174b38,_0x3c7578=_0xbaf8f8[0x0];if(!_0x3c7578)return console[_0x2fdac7(0x18e)](_0x2fdac7(0x1f6)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x1f2)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x211)),console[_0x2fdac7(0x18e)]('Examples:'),console[_0x2fdac7(0x18e)](_0x2fdac7(0x18f)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x1a3)),0x1;try{const _0x483ef2=_0x45ec9a[_0x2fdac7(0x229)],_0x34d39d=await resolveSegmentTarget(_0x3c7578,_0x483ef2,_0x45ec9a[_0x2fdac7(0x213)]);_0x45ec9a['verbose']&&console[_0x2fdac7(0x18e)](_0x2fdac7(0x1ba)+_0x34d39d);const _0x3a5dbc=await withSpinner(_0x2fdac7(0x1e3)+_0x3c7578+_0x2fdac7(0x1a9),()=>_0x3903b3[_0x2fdac7(0x1ec)][_0x2fdac7(0x193)](_0x34d39d),{'verbose':_0x45ec9a[_0x2fdac7(0x213)]}),_0x20677d=_0x3a5dbc[_0x2fdac7(0x22a)];_0x45ec9a['verbose']&&(console[_0x2fdac7(0x18e)]('Resolved\x20type:\x20'+_0x20677d[_0x2fdac7(0x1c6)]),console[_0x2fdac7(0x18e)](_0x2fdac7(0x1ad)+_0x20677d[_0x2fdac7(0x20a)]));if(_0x20677d[_0x2fdac7(0x1c6)]==='folder')return console['error'](_0x2fdac7(0x21b)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x1e8)),0x1;if(_0x20677d[_0x2fdac7(0x1c6)]==='parent')return console[_0x2fdac7(0x18e)](_0x2fdac7(0x1fe)),console[_0x2fdac7(0x18e)](_0x2fdac7(0x220)),0x1;if(!_0x20677d[_0x2fdac7(0x191)])throw new SDKError(ErrorCode[_0x2fdac7(0x1b6)],_0x2fdac7(0x21d));const _0x454c20=await withSpinner(_0x2fdac7(0x1d2),()=>_0x3903b3[_0x2fdac7(0x1ec)][_0x2fdac7(0x197)](_0x20677d['parentId'],_0x20677d[_0x2fdac7(0x191)]),{'verbose':_0x45ec9a[_0x2fdac7(0x213)]}),_0x3c88d0=_0x454c20[_0x2fdac7(0x22a)];return _0x45ec9a[_0x2fdac7(0x1f3)]===_0x2fdac7(0x1bf)||_0x45ec9a['format']==='jsonl'?await handleSDKOutput([{'sql':_0x3c88d0}],_0x45ec9a):console[_0x2fdac7(0x1b2)](_0x3c88d0),0x0;}catch(_0x2364b1){if(_0x2364b1 instanceof SDKError)return console['error'](_0x2fdac7(0x20c)+_0x2364b1[_0x2fdac7(0x1b0)]),_0x2364b1[_0x2fdac7(0x1d9)]&&console['error'](_0x2fdac7(0x222)+_0x2364b1['cause']),0x1;throw _0x2364b1;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x1f5);[a27_0x502d7c(0x210)]=a27_0x502d7c(0x1c8);async[a27_0x502d7c(0x1db)](_0xe356a8){const _0x5e91de=a27_0x502d7c,{options:_0x119bc8,args:_0x2de190,tdx:_0x22bafa}=_0xe356a8,_0xe5f7f4=_0x119bc8;if(_0x2de190[_0x5e91de(0x1d7)]<0x2)return console[_0x5e91de(0x18e)](_0x5e91de(0x192)),console[_0x5e91de(0x18e)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x23bba8=_0x2de190[0x0],_0x5a6883=_0x2de190[0x1];_0xe5f7f4[_0x5e91de(0x213)]&&(console[_0x5e91de(0x18e)]('Site:\x20'+_0xe5f7f4[_0x5e91de(0x1cf)]),console[_0x5e91de(0x18e)](_0x5e91de(0x203)+_0x23bba8),console[_0x5e91de(0x18e)](_0x5e91de(0x1e5)+_0x5a6883));let _0x13ded3;if(_0xe5f7f4['parentFolder']){const _0x3d2ecb=_0xe5f7f4['parentFolder'],_0x4ee2ca=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x23bba8+'\x27...',()=>_0x22bafa[_0x5e91de(0x1ec)][_0x5e91de(0x204)](_0x23bba8),{'verbose':_0xe5f7f4[_0x5e91de(0x213)]}),_0x1902b1=_0x4ee2ca[_0x5e91de(0x22a)],_0x418a9b=await withSpinner(_0x5e91de(0x194)+_0x3d2ecb+_0x5e91de(0x1a9),()=>_0x22bafa['segment'][_0x5e91de(0x1da)](_0x1902b1,_0x3d2ecb),{'verbose':_0xe5f7f4['verbose']});_0x13ded3=_0x418a9b['data'],_0xe5f7f4['verbose']&&console['error']('Resolved\x20parent\x20folder\x20ID:\x20'+_0x13ded3);}const _0x436806={'name':_0x5a6883,'description':_0xe5f7f4['description'],'parentFolderId':_0x13ded3},_0x590cf9=await withSpinner(_0x5e91de(0x226)+_0x5a6883+_0x5e91de(0x1a9),()=>_0x22bafa['segment']['createFolder'](_0x23bba8,_0x436806),{'verbose':_0xe5f7f4[_0x5e91de(0x213)]}),_0x3330f9=_0x590cf9[_0x5e91de(0x22a)];return console[_0x5e91de(0x18e)]('✔\x20Created\x20folder\x20\x27'+_0x3330f9['name']+_0x5e91de(0x1e2)+_0x3330f9['id']),await handleSDKOutput([_0x3330f9],_0xe5f7f4),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a27_0x502d7c(0x1e9);[a27_0x502d7c(0x210)]=a27_0x502d7c(0x1f8);async[a27_0x502d7c(0x1db)](_0x2bd366){const _0x1ff4d7=a27_0x502d7c,{options:_0x169871,args:_0x4297e5,tdx:_0x217366}=_0x2bd366,_0x2d3e21=_0x4297e5[0x0];if(!_0x2d3e21)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x18d)),console['error'](_0x1ff4d7(0x1fc)),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1b4)),console[_0x1ff4d7(0x18e)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1e6)),console[_0x1ff4d7(0x18e)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1c2)),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1c1)),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1ce)),0x1;try{const _0x2819dc=_0x169871[_0x1ff4d7(0x229)],_0xe49b5a=await resolveSegmentTarget(_0x2d3e21,_0x2819dc,_0x169871['verbose']);_0x169871[_0x1ff4d7(0x213)]&&console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1ba)+_0xe49b5a);const _0x578a33=await withSpinner(_0x1ff4d7(0x1e3)+_0x2d3e21+_0x1ff4d7(0x1a9),()=>_0x217366['segment'][_0x1ff4d7(0x193)](_0xe49b5a),{'verbose':_0x169871['verbose']}),_0x1c8b9b=_0x578a33[_0x1ff4d7(0x22a)];_0x169871['verbose']&&(console[_0x1ff4d7(0x18e)]('Resolved\x20type:\x20'+_0x1c8b9b['type']),console[_0x1ff4d7(0x18e)]('Parent\x20ID:\x20'+_0x1c8b9b['parentId']),_0x1c8b9b[_0x1ff4d7(0x1f4)]&&console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1ea)+_0x1c8b9b['folderId']),_0x1c8b9b[_0x1ff4d7(0x191)]&&console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1c9)+_0x1c8b9b[_0x1ff4d7(0x191)]));if(_0x169871[_0x1ff4d7(0x199)]){if(_0x1c8b9b[_0x1ff4d7(0x1c6)]===_0x1ff4d7(0x205))return console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1d1)),0x1;if(_0x1c8b9b['type']==='parent')return console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x21a)),console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1aa)),0x1;if(!_0x1c8b9b[_0x1ff4d7(0x191)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1ff4d7(0x21d));const _0x1f11ee=getConsoleNextUrl(_0x169871['site'],_0x1ff4d7(0x1f7)+_0x1c8b9b['parentId']+'/e/'+_0x1c8b9b['segmentId']);return console[_0x1ff4d7(0x18e)](a27_0x2ad0cb['green']('✔')+_0x1ff4d7(0x1b1)+a27_0x2ad0cb['cyan'](_0x1f11ee)),openBrowser(_0x1f11ee),0x0;}if(_0x1c8b9b[_0x1ff4d7(0x1c6)]==='folder'){if(!_0x1c8b9b[_0x1ff4d7(0x1f4)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2a4b91=await withSpinner(_0x1ff4d7(0x1bc),()=>_0x217366[_0x1ff4d7(0x1ec)][_0x1ff4d7(0x1ab)](_0x1c8b9b['folderId']),{'verbose':_0x169871[_0x1ff4d7(0x213)]});await handleSingleObjectOutput(_0x2a4b91[_0x1ff4d7(0x22a)],_0x169871);}else{if(_0x1c8b9b[_0x1ff4d7(0x1c6)]==='segment'){if(!_0x1c8b9b[_0x1ff4d7(0x191)])throw new SDKError(ErrorCode[_0x1ff4d7(0x1b6)],_0x1ff4d7(0x21d));const _0x244118=await withSpinner(_0x1ff4d7(0x1df),()=>_0x217366[_0x1ff4d7(0x1ec)]['getSegment'](_0x1c8b9b['parentId'],_0x1c8b9b['segmentId']),{'verbose':_0x169871['verbose']}),_0x4d37f1=getConsoleNextUrl(_0x169871[_0x1ff4d7(0x1cf)],_0x1ff4d7(0x1f7)+_0x1c8b9b['parentId']+_0x1ff4d7(0x1e0)+_0x1c8b9b[_0x1ff4d7(0x191)]),_0x1e9a72=_0x244118[_0x1ff4d7(0x22a)];_0x1e9a72['url']=_0x4d37f1,await handleSingleObjectOutput(_0x1e9a72,_0x169871);}else return console[_0x1ff4d7(0x18e)](_0x1ff4d7(0x1e1)),console['error']('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x4a1825){if(_0x4a1825 instanceof SDKError)return console[_0x1ff4d7(0x18e)]('Error:\x20'+_0x4a1825[_0x1ff4d7(0x1b0)]),_0x4a1825[_0x1ff4d7(0x1d9)]&&console[_0x1ff4d7(0x18e)]('\x20\x20Cause:\x20'+_0x4a1825['cause']),0x1;throw _0x4a1825;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x502d7c(0x221)]=a27_0x502d7c(0x1d0);[a27_0x502d7c(0x210)]=a27_0x502d7c(0x1ed);async[a27_0x502d7c(0x1db)](_0xa63ac8){const _0x1e0d9a=a27_0x502d7c,{options:_0x409dcd,args:_0x11e11b,tdx:_0x14e4d3}=_0xa63ac8,_0x20c166=_0x11e11b[0x0];if(!_0x20c166)return console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1f6)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1c3)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x196)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1e6)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1fb)),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x19f)),0x1;try{const _0x13754b=_0x409dcd[_0x1e0d9a(0x229)],_0x3ae8c3=await resolveSegmentTarget(_0x20c166,_0x13754b,_0x409dcd[_0x1e0d9a(0x213)]);_0x409dcd[_0x1e0d9a(0x213)]&&console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1ba)+_0x3ae8c3);const _0x2e5c54=await withSpinner(_0x1e0d9a(0x1e3)+_0x20c166+_0x1e0d9a(0x1a9),()=>_0x14e4d3[_0x1e0d9a(0x1ec)][_0x1e0d9a(0x193)](_0x3ae8c3),{'verbose':_0x409dcd['verbose']}),_0x23c2bb=_0x2e5c54[_0x1e0d9a(0x22a)];_0x409dcd['verbose']&&(console[_0x1e0d9a(0x18e)]('Resolved\x20type:\x20'+_0x23c2bb[_0x1e0d9a(0x1c6)]),console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x1ad)+_0x23c2bb[_0x1e0d9a(0x20a)]));if(_0x23c2bb['type']===_0x1e0d9a(0x205))return console['error'](_0x1e0d9a(0x1be)),console['error'](_0x1e0d9a(0x1e8)),0x1;if(_0x23c2bb[_0x1e0d9a(0x1c6)]===_0x1e0d9a(0x208))return console['error'](_0x1e0d9a(0x1a8)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x23c2bb['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1e0d9a(0x21d));const _0x3ab0a1=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x14e4d3[_0x1e0d9a(0x1ec)][_0x1e0d9a(0x197)](_0x23c2bb[_0x1e0d9a(0x20a)],_0x23c2bb['segmentId']),{'verbose':_0x409dcd['verbose']}),_0x30840a=_0x3ab0a1['data'],_0x1d409d=await executeSchemaQuery(_0x30840a,_0x14e4d3,_0x409dcd);return await handleQueryOutput(_0x1d409d,_0x409dcd),0x0;}catch(_0x592c07){if(_0x592c07 instanceof SDKError)return console[_0x1e0d9a(0x18e)](_0x1e0d9a(0x20c)+_0x592c07['message']),_0x592c07[_0x1e0d9a(0x1d9)]&&console['error'](_0x1e0d9a(0x222)+_0x592c07[_0x1e0d9a(0x1d9)]),0x1;throw _0x592c07;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x48fd04=a28_0x2395;(function(_0x3b8156,_0x30dda5){const _0x32a860=a28_0x2395,_0x2a54a0=_0x3b8156();while(!![]){try{const _0x53725b=parseInt(_0x32a860(0x1e6))/0x1*(-parseInt(_0x32a860(0x206))/0x2)+-parseInt(_0x32a860(0x1f0))/0x3*(parseInt(_0x32a860(0x1ec))/0x4)+parseInt(_0x32a860(0x1ee))/0x5*(parseInt(_0x32a860(0x207))/0x6)+parseInt(_0x32a860(0x1f5))/0x7+parseInt(_0x32a860(0x1e4))/0x8+-parseInt(_0x32a860(0x1fc))/0x9+parseInt(_0x32a860(0x217))/0xa;if(_0x53725b===_0x30dda5)break;else _0x2a54a0['push'](_0x2a54a0['shift']());}catch(_0x2c9446){_0x2a54a0['push'](_0x2a54a0['shift']());}}}(a28_0x4cdb,0x3d5c4));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a28_0x2395(_0x149ee4,_0x1eabd4){_0x149ee4=_0x149ee4-0x1e3;const _0x4cdba5=a28_0x4cdb();let _0x239554=_0x4cdba5[_0x149ee4];return _0x239554;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a28_0x4cdb(){const _0x88e5bf=['\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','segment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','990444mKNCEf','parent','165kfHFey','Resolving\x20parent\x20segment\x20\x27','6eBEgIU','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20path:\x20','createSegment','folder','2708559IPrmbw','includes','Resolving\x20folder\x20\x27','name','Resolved\x20folder\x20ID:\x20','Examples:','data','2254311AWQJHG','segments','Segment\x20name:\x20','site','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','length','invisible','\x27...','44570ggXubq','59982PCKZiz','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','type','error','noCountPopulation','segmentPath','verbose','Site:\x20','resolvePathToResource','Create\x20child\x20segment\x20with\x20filtering\x20rules','yellow','resolveFolderId','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','kind','folderId','ruleFile','3838880hrTXUY','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','description','2914336sTlTll','✔\x20Created\x20segment\x20\x27','21lVZsCP','rule','resolveParentId'];a28_0x4cdb=function(){return _0x88e5bf;};return a28_0x4cdb();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x3d3e3a from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x48fd04(0x1f8)]='segment:create';[a28_0x48fd04(0x1e3)]=a28_0x48fd04(0x210);async['execute'](_0x2f53f9){const _0x531722=a28_0x48fd04;console['error'](a28_0x3d3e3a['yellow'](_0x531722(0x213))),console['error'](a28_0x3d3e3a[_0x531722(0x211)](_0x531722(0x1e9)));const {options:_0x51e33d,args:_0x50be3d,tdx:_0x2ab69c}=_0x2f53f9,_0x28068c=_0x51e33d;if(_0x50be3d['length']===0x0)return console[_0x531722(0x20a)](_0x531722(0x1f1)),console['error'](_0x531722(0x1eb)),console[_0x531722(0x20a)](_0x531722(0x1fa)),console[_0x531722(0x20a)](_0x531722(0x218)),console['error'](_0x531722(0x202)),console[_0x531722(0x20a)](_0x531722(0x200)),0x1;const _0x4d3d9b=_0x50be3d[0x0],_0x15494b=_0x51e33d[_0x531722(0x20c)];let _0x102fe4=_0x4d3d9b;_0x15494b&&!_0x4d3d9b[_0x531722(0x1f6)]('/')&&(_0x102fe4=_0x15494b+'/'+_0x4d3d9b,_0x28068c['verbose']&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x102fe4));const _0x4c5aa9=parsePath(_0x102fe4);if(_0x4c5aa9[_0x531722(0x1fd)]['length']<0x2)return console[_0x531722(0x20a)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x531722(0x20a)](_0x531722(0x201)),0x1;const _0x1429b3=_0x4c5aa9[_0x531722(0x1fd)][0x0],_0x17a967=getBaseName(_0x102fe4),_0x25441f=getParentPath(_0x102fe4);_0x28068c[_0x531722(0x20d)]&&(console[_0x531722(0x20a)](_0x531722(0x20e)+_0x28068c[_0x531722(0x1ff)]),console[_0x531722(0x20a)]('Target\x20path:\x20'+_0x102fe4),console[_0x531722(0x20a)]('Parent:\x20'+_0x1429b3),console[_0x531722(0x20a)](_0x531722(0x1fe)+_0x17a967),console[_0x531722(0x20a)](_0x531722(0x1f2)+_0x25441f));const _0x28a314=await withSpinner(_0x531722(0x1ef)+_0x1429b3+_0x531722(0x205),()=>_0x2ab69c[_0x531722(0x1ea)][_0x531722(0x1e8)](_0x1429b3),{'verbose':_0x28068c['verbose']}),_0x2569e1=_0x28a314[_0x531722(0x1fb)];let _0x4d57fa;if(_0x4c5aa9['segments'][_0x531722(0x203)]>0x2){const _0x2233dd=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x25441f+_0x531722(0x205),()=>_0x2ab69c['segment'][_0x531722(0x20f)](_0x25441f),{'verbose':_0x28068c['verbose']}),_0x27b2e7=_0x2233dd[_0x531722(0x1fb)];if(_0x27b2e7[_0x531722(0x209)]!==_0x531722(0x1f4)&&_0x27b2e7['type']!==_0x531722(0x1ed))return console[_0x531722(0x20a)](_0x531722(0x208)),0x1;_0x4d57fa=_0x27b2e7[_0x531722(0x215)];}else{if(_0x28068c[_0x531722(0x1f4)]){const _0x196d67=await withSpinner(_0x531722(0x1f7)+_0x28068c[_0x531722(0x1f4)]+'\x27...',()=>_0x2ab69c[_0x531722(0x1ea)][_0x531722(0x212)](_0x2569e1,_0x28068c[_0x531722(0x1f4)]),{'verbose':_0x28068c['verbose']});_0x4d57fa=_0x196d67[_0x531722(0x1fb)];}}_0x28068c[_0x531722(0x20d)]&&_0x4d57fa&&console[_0x531722(0x20a)](_0x531722(0x1f9)+_0x4d57fa);const _0x41947d=await loadJSONFromOptions(_0x28068c[_0x531722(0x1e7)],_0x28068c[_0x531722(0x216)]),_0x9bb9b2={'name':_0x17a967,'description':_0x28068c[_0x531722(0x1e3)],'rule':_0x41947d,'kind':_0x28068c[_0x531722(0x214)]!==undefined?parseInt(_0x28068c['kind'],0xa):undefined,'isVisible':_0x28068c[_0x531722(0x204)]?![]:undefined,'segmentFolderId':_0x4d57fa,'countPopulation':_0x28068c[_0x531722(0x20b)]?![]:undefined},_0xb83a6c=await withSpinner('Creating\x20segment\x20\x27'+_0x17a967+_0x531722(0x205),()=>_0x2ab69c[_0x531722(0x1ea)][_0x531722(0x1f3)](_0x2569e1,_0x9bb9b2),{'verbose':_0x28068c[_0x531722(0x20d)]}),_0x5c20db=_0xb83a6c[_0x531722(0x1fb)];return console[_0x531722(0x20a)](_0x531722(0x1e5)+_0x5c20db[_0x531722(0x1f8)]+'\x27\x20with\x20ID:\x20'+_0x5c20db['id']),_0x102fe4!==_0x4d3d9b&&console[_0x531722(0x20a)]('\x20\x20\x20Path:\x20'+_0x102fe4),await handleSDKOutput([_0x5c20db],_0x28068c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a29_0x37750e=a29_0x566d;(function(_0x39a6d1,_0x195623){const _0x20ef1a=a29_0x566d,_0x58b24b=_0x39a6d1();while(!![]){try{const _0x137055=-parseInt(_0x20ef1a(0x1f9))/0x1*(parseInt(_0x20ef1a(0x203))/0x2)+parseInt(_0x20ef1a(0x202))/0x3+-parseInt(_0x20ef1a(0x204))/0x4*(-parseInt(_0x20ef1a(0x1ef))/0x5)+-parseInt(_0x20ef1a(0x20a))/0x6*(-parseInt(_0x20ef1a(0x1ff))/0x7)+parseInt(_0x20ef1a(0x207))/0x8*(parseInt(_0x20ef1a(0x1f2))/0x9)+parseInt(_0x20ef1a(0x1fb))/0xa+-parseInt(_0x20ef1a(0x20b))/0xb*(parseInt(_0x20ef1a(0x1f8))/0xc);if(_0x137055===_0x195623)break;else _0x58b24b['push'](_0x58b24b['shift']());}catch(_0x35ba41){_0x58b24b['push'](_0x58b24b['shift']());}}}(a29_0x17e8,0x2fc16));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x17e8(){const _0x1b0da8=['description','error','\x27...','execute','408HiwRit','1JBftvb','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2596740JxDTTf','✔\x20Found\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','name','1715MOGZTp','segment','listFields','648060ObaNpa','431142vmBqpn','18468mSOaUh','List\x20available\x20fields\x20for\x20segmentation','Listing\x20fields\x20for\x20\x27','8wLrPNO','verbose','segment:fields','7428psWXao','282832MOIlJC','Site:\x20','json','length','180Nqbyuz','jsonl','\x20field','3061521BSjCQZ','data'];a29_0x17e8=function(){return _0x1b0da8;};return a29_0x17e8();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a29_0x566d(_0x52331f,_0x3d9cdb){_0x52331f=_0x52331f-0x1ec;const _0x17e8ca=a29_0x17e8();let _0x566d8e=_0x17e8ca[_0x52331f];return _0x566d8e;}export class SegmentFieldsCommand extends BaseCommand{[a29_0x37750e(0x1fe)]=a29_0x37750e(0x209);[a29_0x37750e(0x1f4)]=a29_0x37750e(0x205);async[a29_0x37750e(0x1f7)](_0x210bba){const _0x6777f8=a29_0x37750e,{options:_0x3e785c,args:_0x5e0ea5,tdx:_0x1ba36f}=_0x210bba,_0xa334c9=_0x5e0ea5[0x0]||_0x3e785c['parentSegment'];if(!_0xa334c9)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x6777f8(0x1f5)](_0x6777f8(0x1fa)),console[_0x6777f8(0x1f5)](_0x6777f8(0x1fd)),0x1;_0x3e785c['verbose']&&(console[_0x6777f8(0x1f5)](_0x6777f8(0x1ec)+_0x3e785c['site']),console['error']('Parent\x20segment:\x20'+_0xa334c9));const _0x28fb0d=await withSpinner(_0x6777f8(0x206)+_0xa334c9+_0x6777f8(0x1f6),()=>_0x1ba36f[_0x6777f8(0x200)][_0x6777f8(0x201)](_0xa334c9),{'verbose':_0x3e785c[_0x6777f8(0x208)]}),_0x30d348=_0x28fb0d[_0x6777f8(0x1f3)];console[_0x6777f8(0x1f5)](_0x6777f8(0x1fc)+_0x30d348[_0x6777f8(0x1ee)]+_0x6777f8(0x1f1)+(_0x30d348['length']!==0x1?'s':''));if(_0x3e785c[_0x6777f8(0x1ed)]||_0x3e785c[_0x6777f8(0x1f0)])return await handleSDKOutput(_0x30d348,_0x3e785c),0x0;return displayFieldsHumanReadable(_0x30d348,_0xa334c9),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x34457b=a30_0x57af;function a30_0x57af(_0xb488c,_0x4335ea){_0xb488c=_0xb488c-0x16b;const _0x3c7fdf=a30_0x3c7f();let _0x57afb7=_0x3c7fdf[_0xb488c];return _0x57afb7;}(function(_0xa17086,_0x126939){const _0xd9def6=a30_0x57af,_0x193ef1=_0xa17086();while(!![]){try{const _0x35dca1=-parseInt(_0xd9def6(0x1a4))/0x1+parseInt(_0xd9def6(0x176))/0x2+-parseInt(_0xd9def6(0x193))/0x3*(-parseInt(_0xd9def6(0x171))/0x4)+parseInt(_0xd9def6(0x186))/0x5+-parseInt(_0xd9def6(0x191))/0x6*(-parseInt(_0xd9def6(0x190))/0x7)+parseInt(_0xd9def6(0x17d))/0x8*(parseInt(_0xd9def6(0x197))/0x9)+parseInt(_0xd9def6(0x184))/0xa*(-parseInt(_0xd9def6(0x19b))/0xb);if(_0x35dca1===_0x126939)break;else _0x193ef1['push'](_0x193ef1['shift']());}catch(_0x6065f1){_0x193ef1['push'](_0x193ef1['shift']());}}}(a30_0x3c7f,0x3f5a7));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x2e4635 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x4ff755 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a30_0x3c7f(){const _0x12f5de=['474644IlXPec','\x20files\x20to\x20','filter','parent_segment','site','\x0aChanges\x20to\x20\x27','journeyVersions','8Xzzcao','dim','cyan','Aborted.','name','✔\x20All\x20files\x20are\x20up\x20to\x20date','description','311810XFzxVc','verbose','1486100oCFRBv','diff','\x20with\x20','\x20activations','hasChanges','✔\x20Context\x20set:\x20','\x27...','\x20versions)','errorCode','segments','23219GsLVwp','738etukks','repeat','39sbakSw','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','isNew','journeys','4606137quqcDD','setPhase','pullSegments','segment','330QvgDHA','\x20changed\x20files','files','\x20\x20🎯\x20','\x20unchanged\x20files','error','relativePath','resourceName','\x20=\x20','387295CQhhoP','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20\x20🗺️\x20\x20','counts','targetDir','yellow','\x0aPull\x20summary\x20for\x20\x27','no_parent','\x20segments','session','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)','message','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','✔\x20Pulled\x20','utf-8','data','content','Parent\x20segment:\x20','Target\x20resource:\x20','Write\x20','parentName','green','length','absolutePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','cwd','39352oiVgBO','execute','parentSegment','Pulling\x20segments\x20from\x20\x27','\x20files?'];a30_0x3c7f=function(){return _0x12f5de;};return a30_0x3c7f();}export class SegmentPullCommand extends BaseCommand{[a30_0x34457b(0x181)]='segment:pull';[a30_0x34457b(0x183)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x34457b(0x172)](_0x5d0c17){const _0xd76e63=a30_0x34457b,{options:_0x2b08b1,args:_0x4f7862,tdx:_0x4d8644}=_0x5d0c17,_0x496be5=_0x2b08b1,_0xc793fa=await resolveTarget({'arg':_0x4f7862[0x0],'contextParent':_0x2b08b1[_0xd76e63(0x173)],'cwd':process[_0xd76e63(0x170)]()});if(!isSuccessfulResolution(_0xc793fa))return _0xc793fa[_0xd76e63(0x18e)]===_0xd76e63(0x1ab)?(console['error'](a30_0x2e4635[_0xd76e63(0x1a9)](_0xd76e63(0x1b0))),console[_0xd76e63(0x1a0)](_0xd76e63(0x1ae)),console[_0xd76e63(0x1a0)](_0xd76e63(0x16e)),console[_0xd76e63(0x1a0)](_0xd76e63(0x16f))):(console['error'](a30_0x2e4635['red']('Error:\x20'+_0xc793fa[_0xd76e63(0x1af)]+'\x0a')),_0xc793fa['helpText']&&console['error'](a30_0x2e4635['cyan'](_0xc793fa['helpText']))),0x1;const _0x33707d=_0xc793fa[_0xd76e63(0x1b8)],_0x3edd3f=_0xc793fa[_0xd76e63(0x1a8)],_0x409ae5=_0xc793fa['type']==='file'?_0xc793fa[_0xd76e63(0x1a2)]:undefined;_0x496be5[_0xd76e63(0x185)]&&(console[_0xd76e63(0x1a0)]('Site:\x20'+_0x496be5[_0xd76e63(0x17a)]),console[_0xd76e63(0x1a0)](_0xd76e63(0x1b5)+_0x33707d),_0x409ae5&&console['error'](_0xd76e63(0x1b6)+_0x409ae5));const _0x5308ac=await withProgressSpinner(_0xd76e63(0x174)+_0x33707d+_0xd76e63(0x18c),_0x290eb2=>_0x4d8644[_0xd76e63(0x19a)][_0xd76e63(0x199)](_0x33707d,{'targetDir':_0x3edd3f,'targetResourceName':_0x409ae5,'verbose':_0x496be5['verbose'],'progress':{'update':_0x3746fe=>{const _0x4ee8d6=_0xd76e63;_0x290eb2[_0x4ee8d6(0x198)](_0x3746fe),_0x496be5['verbose']&&console[_0x4ee8d6(0x1a0)]('\x20\x20'+_0x3746fe);}}}),{'verbose':_0x496be5[_0xd76e63(0x185)]}),_0x103185=_0x5308ac[_0xd76e63(0x1b3)];if(_0x103185[_0xd76e63(0x1a7)][_0xd76e63(0x18f)]===0x0&&_0x103185['counts'][_0xd76e63(0x196)]===0x0)return console['error'](a30_0x2e4635['yellow'](_0xd76e63(0x1a5)+_0x103185['parentName']+'\x27')),0x0;const _0x55c006=_0x103185[_0xd76e63(0x19d)][_0xd76e63(0x178)](_0x5a5280=>_0x5a5280[_0xd76e63(0x195)]),_0x59bde3=_0x103185[_0xd76e63(0x19d)][_0xd76e63(0x178)](_0xfa7ac9=>!_0xfa7ac9[_0xd76e63(0x195)]&&_0xfa7ac9[_0xd76e63(0x18a)]),_0x1c5331=_0x103185[_0xd76e63(0x19d)][_0xd76e63(0x178)](_0x337ced=>!_0x337ced[_0xd76e63(0x195)]&&!_0x337ced[_0xd76e63(0x18a)]);console[_0xd76e63(0x1a0)](_0xd76e63(0x1aa)+_0x103185[_0xd76e63(0x1b8)]+'\x27:'),console[_0xd76e63(0x1a0)](_0xd76e63(0x19e)+a30_0x2e4635[_0xd76e63(0x17f)](_0x103185[_0xd76e63(0x1a7)]['segments']+_0xd76e63(0x1ac))+_0xd76e63(0x188)+a30_0x2e4635['cyan'](_0x103185[_0xd76e63(0x1a7)]['activations']+_0xd76e63(0x189)));if(_0x103185[_0xd76e63(0x1a7)][_0xd76e63(0x196)]>0x0){const _0xbfe64a=_0x103185['counts']['journeyVersions']>_0x103185[_0xd76e63(0x1a7)]['journeys']?'\x20('+_0x103185[_0xd76e63(0x1a7)][_0xd76e63(0x17c)]+_0xd76e63(0x18d):'';console[_0xd76e63(0x1a0)](_0xd76e63(0x1a6)+a30_0x2e4635['cyan'](_0x103185['counts'][_0xd76e63(0x196)]+'\x20journeys')+a30_0x2e4635[_0xd76e63(0x17e)](_0xbfe64a));}console[_0xd76e63(0x1a0)]('\x20\x20'+a30_0x2e4635[_0xd76e63(0x16b)]('+\x20'+_0x55c006[_0xd76e63(0x16c)]+'\x20new\x20files')),console[_0xd76e63(0x1a0)]('\x20\x20'+a30_0x2e4635[_0xd76e63(0x1a9)]('~\x20'+_0x59bde3[_0xd76e63(0x16c)]+_0xd76e63(0x19c))),console[_0xd76e63(0x1a0)]('\x20\x20'+a30_0x2e4635['dim']('=\x20'+_0x1c5331[_0xd76e63(0x16c)]+_0xd76e63(0x19f))),console[_0xd76e63(0x1a0)]('\x20\x20Target:\x20'+a30_0x2e4635['cyan'](_0x103185[_0xd76e63(0x1a8)])+'\x0a');if(_0x59bde3['length']>0x0)for(const _0x4de924 of _0x59bde3){console[_0xd76e63(0x1a0)](_0xd76e63(0x17b)+_0x4de924[_0xd76e63(0x1a1)]+'\x27:'),console[_0xd76e63(0x1a0)]('─'['repeat'](0x3c)),console[_0xd76e63(0x1a0)](_0x4de924[_0xd76e63(0x187)]),console['error']('─'[_0xd76e63(0x192)](0x3c));}if(_0x496be5['dryRun'])return console[_0xd76e63(0x1a0)](a30_0x2e4635[_0xd76e63(0x1a9)](_0xd76e63(0x194))),0x0;if(_0x55c006[_0xd76e63(0x16c)]===0x0&&_0x59bde3[_0xd76e63(0x16c)]===0x0)return console['error'](a30_0x2e4635[_0xd76e63(0x16b)](_0xd76e63(0x182))),saveSessionContext({'parent_segment':_0x103185[_0xd76e63(0x1b8)]},_0x496be5[_0xd76e63(0x1ad)]),console[_0xd76e63(0x1a0)](a30_0x2e4635[_0xd76e63(0x16b)](_0xd76e63(0x18b)+a30_0x2e4635['dim']('parent_segment')+'\x20=\x20'+a30_0x2e4635[_0xd76e63(0x17f)](_0x103185[_0xd76e63(0x1b8)]))),0x0;if(!_0x496be5['yes']){const _0x5297d2=await confirmKey(_0xd76e63(0x1b7)+(_0x55c006[_0xd76e63(0x16c)]+_0x59bde3['length'])+_0xd76e63(0x175));if(!_0x5297d2)return console[_0xd76e63(0x1a0)](_0xd76e63(0x180)),0x1;}for(const _0x1604a1 of _0x103185['files']){if(_0x1604a1['isNew']||_0x1604a1['hasChanges']){const _0x5b0256=a30_0x4ff755['dirname'](_0x1604a1[_0xd76e63(0x16d)]);!existsSync(_0x5b0256)&&mkdirSync(_0x5b0256,{'recursive':!![]}),writeFileSync(_0x1604a1[_0xd76e63(0x16d)],_0x1604a1[_0xd76e63(0x1b4)],_0xd76e63(0x1b2));}}return console[_0xd76e63(0x1a0)](a30_0x2e4635[_0xd76e63(0x16b)](_0xd76e63(0x1b1)+(_0x55c006['length']+_0x59bde3[_0xd76e63(0x16c)])+_0xd76e63(0x177)+_0x103185[_0xd76e63(0x1a8)])),saveSessionContext({'parent_segment':_0x103185['parentName']},_0x496be5[_0xd76e63(0x1ad)]),console['error'](a30_0x2e4635['green'](_0xd76e63(0x18b)+a30_0x2e4635[_0xd76e63(0x17e)](_0xd76e63(0x179))+_0xd76e63(0x1a3)+a30_0x2e4635[_0xd76e63(0x17f)](_0x103185[_0xd76e63(0x1b8)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0xd6e430=a31_0xe641;(function(_0x3fcf4e,_0x4430c6){const _0x48f756=a31_0xe641,_0x4636ef=_0x3fcf4e();while(!![]){try{const _0x2f1772=parseInt(_0x48f756(0x153))/0x1+-parseInt(_0x48f756(0x11a))/0x2*(-parseInt(_0x48f756(0x15f))/0x3)+parseInt(_0x48f756(0xfc))/0x4*(parseInt(_0x48f756(0x124))/0x5)+-parseInt(_0x48f756(0xf8))/0x6+-parseInt(_0x48f756(0xf0))/0x7+parseInt(_0x48f756(0xf9))/0x8+-parseInt(_0x48f756(0xf5))/0x9;if(_0x2f1772===_0x4430c6)break;else _0x4636ef['push'](_0x4636ef['shift']());}catch(_0x44561e){_0x4636ef['push'](_0x4636ef['shift']());}}}(a31_0x231e,0xbf2ab));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a31_0x231e(){const _0x1fbba8=['getOutputSchemaWithCache','getParent','file','no_parent','set','join','new','/e/','\x0aValidation\x20failed:','(Journey\x20will\x20be\x20deleted)','idToName','\x20to\x20create','segmentFolderId','\x20changed','scopedFolderPath','parentName','/j/da/je','diff','changed','name','dim','1364803yuOgzP','\x20activations]','relationships','journeyBundleName','Parent\x20segment:\x20','\x27...','map','\x20\x20Journeys:\x20','\x20to\x20update','helpText','red','\x20YAML\x20files\x20found','33jkhYKH','Changes\x20to:','Fetching\x20existing\x20segments...','data','toDelete','buildUserMaps','Aborted.','targetDir','add','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','green','attributes','repeat','Fetching\x20connections\x20for\x20name\x20resolution...','filePath','createdSegmentIds','Resolving\x20parent\x20segment\x20\x27','segments','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x0a✔\x20Push\x20complete','listSegments','\x20unchanged','Site:\x20','yes','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','audienceId','Fetching\x20existing\x20journeys...','Error:\x20Directory\x20not\x20found:\x20','push','createdAt','user','delete','\x20new','folders','8826594WkNFnh','blue','\x20\x20\x20\x20','.yaml','type','1427976RxMunb','Preparing\x20journeys...','\x20created','6886014nptHqy','652696WOfNMd','folderPath','unchanged','100244FHPJVv','list','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20\x20Activations:\x20','all','existingJourney','activations','created','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','endsWith','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','verbose','cyan','segment','Fetching\x20users\x20for\x20email\x20resolution...','updatedAt','then','Error:\x20','Error\x20parsing\x20YAML:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','/app/ps/','parent_name','\x20\x20Activations:','length','yamlConfig','yellow','journeys','\x20updated','error','209468vXmqXS','resolveParentId','site','isNew','dryRun','\x20changes?','\x20\x20🗺️\x20\x20Journeys:','Fetching\x20parent\x20segment\x20details...','toCreate','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','150ALMHiw','versionNumber','journey','paused','listFolders','message','toUpdate','\x20to\x20delete','No\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Folders\x20to\x20create:','journeyId','results','connection','description','folderId','updated','Delete\x20segment:','\x20deleted','execute','Push\x20','listActivations','state','Fetching\x20existing\x20folders...','journeysOnly','nameToId'];a31_0x231e=function(){return _0x1fbba8;};return a31_0x231e();}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x122508 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0xe641(_0x25b6ba,_0x2c9ebc){_0x25b6ba=_0x25b6ba-0xec;const _0x231e47=a31_0x231e();let _0xe6411a=_0x231e47[_0x25b6ba];return _0xe6411a;}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0xd6e430(0x151)]='segment:push';[a31_0xd6e430(0x132)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a31_0xd6e430(0x137)](_0x3297ce){const _0x3d8126=a31_0xd6e430,{options:_0x32caa5,args:_0x5d0d09,tdx:_0x37fd5f}=_0x3297ce,_0x1cf44e=_0x32caa5,_0x2d1ef1=await resolveTarget({'arg':_0x5d0d09[0x0],'contextParent':_0x32caa5['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2d1ef1))return _0x2d1ef1['errorCode']===_0x3d8126(0x141)?(console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x116)](_0x3d8126(0x105))),console[_0x3d8126(0x119)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x3d8126(0x119)]('\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[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x10e)+_0x2d1ef1[_0x3d8126(0x129)]+'\x0a')),_0x2d1ef1[_0x3d8126(0x15c)]&&console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x109)](_0x2d1ef1[_0x3d8126(0x15c)]))),0x1;if(_0x2d1ef1[_0x3d8126(0xf4)]===_0x3d8126(0x112))return console['error'](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x17a)+_0x2d1ef1['targetDir']+'\x0a')),console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x109)](_0x3d8126(0x171))),0x1;const _0x295a8e=_0x2d1ef1[_0x3d8126(0x14d)],_0x1f827d=_0x2d1ef1[_0x3d8126(0x166)],_0x1aca53=_0x2d1ef1[_0x3d8126(0xf4)]===_0x3d8126(0x140)?_0x2d1ef1[_0x3d8126(0x16d)]:undefined,_0x4a5fa3=getScopedDetails(_0x2d1ef1),_0x41c5a5=_0x4a5fa3?.['isScoped']??![],_0xb420a6=_0x4a5fa3?.[_0x3d8126(0x14c)]??'';if(!existsSync(_0x1f827d))return console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x17a)+_0x1f827d+'\x0a')),console[_0x3d8126(0x119)](a31_0x122508['cyan'](_0x3d8126(0x171))),0x1;_0x1cf44e[_0x3d8126(0x108)]&&(console['error'](_0x3d8126(0x175)+_0x1cf44e['site']),console[_0x3d8126(0x119)](_0x3d8126(0x157)+_0x295a8e),console[_0x3d8126(0x119)]('Source\x20directory:\x20'+_0x1f827d),_0x41c5a5&&console[_0x3d8126(0x119)]('Scoped\x20to\x20folder:\x20'+_0xb420a6));const _0x535d92=await withSpinner(_0x3d8126(0x16f)+_0x295a8e+_0x3d8126(0x158),()=>_0x37fd5f[_0x3d8126(0x10a)][_0x3d8126(0x11b)](_0x295a8e),{'verbose':_0x1cf44e['verbose']}),_0x47fa64=_0x535d92['data'],[_0x4905b2,_0x3b4a68,_0x4d64a7,_0x2d40b4,_0xdc4e72]=await Promise[_0x3d8126(0x101)]([withSpinner(_0x3d8126(0x121),()=>_0x37fd5f[_0x3d8126(0x10a)][_0x3d8126(0x13f)](_0x47fa64),{'verbose':_0x1cf44e[_0x3d8126(0x108)]}),withSpinner(_0x3d8126(0x161),()=>_0x37fd5f[_0x3d8126(0x10a)][_0x3d8126(0x173)](_0x47fa64),{'verbose':_0x1cf44e[_0x3d8126(0x108)]}),withSpinner(_0x3d8126(0x13b),()=>_0x37fd5f[_0x3d8126(0x10a)][_0x3d8126(0x128)](_0x47fa64),{'verbose':_0x1cf44e['verbose']}),withSpinner(_0x3d8126(0x179),()=>_0x37fd5f[_0x3d8126(0x126)]['listJourneysWithDetailsFromParentSegment'](_0x47fa64,{'includeAllVersions':!![]}),{'verbose':_0x1cf44e[_0x3d8126(0x108)]}),withSpinner(_0x3d8126(0x10b),()=>_0x37fd5f[_0x3d8126(0xec)][_0x3d8126(0x164)](),{'verbose':_0x1cf44e[_0x3d8126(0x108)]})[_0x3d8126(0x10d)](_0xe6546a=>_0xe6546a[_0x3d8126(0x162)])]),_0x469a6f=_0x4905b2['data'],_0x102a86=extractRootFolderId(_0x469a6f),_0x1a2f98=_0x3b4a68[_0x3d8126(0x162)],_0x206908=_0x4d64a7[_0x3d8126(0x162)],{journeys:_0x588822,activationStepsById:_0xea6f95}=_0x2d40b4[_0x3d8126(0x162)],_0x40fc04=new Map(_0x588822[_0x3d8126(0x159)](_0x142724=>[_0x142724['id'],_0x142724])),_0x337a80=_0x588822['map'](_0x3a770a=>({'id':_0x3a770a['id'],'name':_0x3a770a[_0x3d8126(0x16a)]['name'],'journeyBundleName':_0x3a770a['attributes']['journeyBundleName']||'','journeyBundleId':_0x3a770a[_0x3d8126(0x16a)]['journeyBundleId']||'','versionNumber':_0x3a770a[_0x3d8126(0x16a)][_0x3d8126(0x125)],'description':_0x3a770a['attributes'][_0x3d8126(0x132)],'state':_0x3a770a['attributes'][_0x3d8126(0x13a)],'paused':_0x3a770a[_0x3d8126(0x16a)][_0x3d8126(0x127)],'audienceId':_0x3a770a[_0x3d8126(0x16a)][_0x3d8126(0x178)],'folderId':_0x3a770a[_0x3d8126(0x155)]?.['parentFolder']?.[_0x3d8126(0x162)]?.['id'],'createdAt':_0x3a770a['attributes'][_0x3d8126(0x17c)],'updatedAt':_0x3a770a[_0x3d8126(0x16a)][_0x3d8126(0x10c)]})),{emailToId:_0x3c1dbb,idToEmail:_0x12a8af}=_0xdc4e72,_0x584688=await withSpinner(_0x3d8126(0x16c),async()=>{const _0x332aeb=_0x3d8126,_0x4af7a3=await _0x37fd5f[_0x332aeb(0x131)][_0x332aeb(0xfd)]();return buildConnectionMaps(_0x4af7a3);},{'verbose':_0x1cf44e['verbose']})['then'](_0x8936d0=>_0x8936d0[_0x3d8126(0x162)]),_0x32f0bd=_0x584688[_0x3d8126(0x13d)],_0x1fe97b=_0x584688[_0x3d8126(0x148)],_0x16bfdf=_0x584688['nameToType'],_0x890e6e={'emailToIdMap':_0x3c1dbb,'connectionNameToIdMap':_0x32f0bd,'connectionNameToTypeMap':_0x16bfdf,'getSchema':_0x45b377=>_0x37fd5f[_0x3d8126(0x131)][_0x3d8126(0x13e)](_0x45b377)};let {pathToId:_0x314261,idToPath:_0x4d5151}=buildFolderMaps(_0x206908);const _0x4a6b4b=buildSegmentLookupMap(_0x1a2f98,_0x4d5151),_0x1b42cd=buildSegmentNameToIdMap(_0x1a2f98),_0x466606=buildJourneyBundleLookupMap(_0x337a80,_0x4d5151);let _0x46c939;if(_0x1aca53){if(!_0x1aca53[_0x3d8126(0x106)]('.yml')&&!_0x1aca53[_0x3d8126(0x106)](_0x3d8126(0xf3)))return console['error'](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0xfe)+_0x1aca53+'\x0a')),0x1;_0x46c939=[_0x1aca53];}else _0x46c939=findYamlFiles(_0x1f827d);if(_0x46c939['length']===0x0)return console['error'](a31_0x122508['red'](_0x3d8126(0x123)+_0x1f827d+'\x0a')),console['error'](a31_0x122508['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x4fe6ef,_0x2d56d1;try{const _0x49f79a=parseAndClassifyYamlFiles(_0x46c939,_0x1f827d,{'skipSegments':_0x1cf44e['journeysOnly']});_0x4fe6ef=_0x49f79a[_0x3d8126(0x170)],_0x2d56d1=_0x49f79a[_0x3d8126(0x117)];const _0x57f931=validateParsedFiles(_0x49f79a,_0x1f827d);if(_0x57f931[_0x3d8126(0x114)]>0x0)return console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x146))),console['error'](formatValidationErrors(_0x57f931)),console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x116)](_0x3d8126(0xff))),0x1;}catch(_0x52ecca){return console['error'](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x10f)+(_0x52ecca instanceof Error?_0x52ecca[_0x3d8126(0x129)]:_0x52ecca))),0x1;}if(_0x4fe6ef['length']===0x0&&_0x2d56d1['length']===0x0){const _0x1022fc=_0x1cf44e[_0x3d8126(0x13c)]?_0x3d8126(0x126):'segment\x20or\x20journey';return console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x116)](_0x3d8126(0x12c)+_0x1022fc+_0x3d8126(0x15e))),0x0;}const _0xe87194=new Map();_0x1a2f98[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x1a2f98,async _0x188201=>{const _0x1fc608=a31_0xe641,_0x35b3c7=await _0x37fd5f['segment'][_0x1fc608(0x139)](_0x47fa64,_0x188201['id']);_0xe87194[_0x1fc608(0x142)](_0x188201['id'],_0x35b3c7);});},{'verbose':_0x1cf44e[_0x3d8126(0x108)]});const {segmentFiles:_0x199ab8,foldersToCreate:_0x488439}=await prepareSegmentFiles(_0x4fe6ef,{'segmentByFolderAndName':_0x4a6b4b,'activationsBySegmentId':_0xe87194,'folderPathToId':_0x314261,'idToEmailMap':_0x12a8af,'connectionIdToNameMap':_0x1fe97b},_0x890e6e,_0x41c5a5,_0xb420a6),_0x585cfd=_0x1aca53?[]:findSegmentsToDelete(_0x1a2f98,_0x4fe6ef[_0x3d8126(0x159)](({yamlConfig:_0x530dfe,folderPath:_0x3aa869})=>({'yamlConfig':_0x530dfe,'folderPath':resolveTDFolderPath(_0x3aa869,_0x41c5a5,_0xb420a6)})),_0x4d5151,_0xb420a6,_0x41c5a5),{journeyFiles:_0x13fcc4,foldersToCreate:_0x19ca33}=await withProgressSpinner(_0x3d8126(0xf6),async _0x2ab9d0=>prepareJourneyFiles(_0x2d56d1,{'fetchJourney':async _0x570eeb=>_0x37fd5f[_0x3d8126(0x126)]['getJourney'](_0x570eeb['journeyId']),'journeyBundlesByFolderAndName':_0x466606,'folderPathToId':_0x314261,'idToEmailMap':_0x12a8af,'connectionIdToNameMap':_0x1fe97b,'existingSegments':_0x1a2f98,'parentId':_0x47fa64,'deps':_0x37fd5f,'progress':{'update':_0x50fd8a=>{const _0x2c447d=_0x3d8126;_0x2ab9d0['setPhase'](_0x50fd8a),_0x1cf44e['verbose']&&console[_0x2c447d(0x119)]('\x20\x20'+_0x50fd8a);}},'journeyById':_0x40fc04,'activationStepsById':_0xea6f95},_0x41c5a5,_0xb420a6),{'verbose':_0x1cf44e[_0x3d8126(0x108)]})[_0x3d8126(0x10d)](_0x49ec04=>_0x49ec04[_0x3d8126(0x162)]);for(const _0x5e9791 of _0x19ca33){_0x488439[_0x3d8126(0x167)](_0x5e9791);}const _0x5a4736=_0x1aca53?[]:findJourneysToDelete(_0x337a80,_0x2d56d1['map'](({yamlConfig:_0x204e97,folderPath:_0x1fe1d9})=>({'yamlConfig':_0x204e97,'folderPath':resolveTDFolderPath(_0x1fe1d9,_0x41c5a5,_0xb420a6)})),_0x4d5151,_0xb420a6,_0x41c5a5),_0x39ac10=calculatePushStats(_0x199ab8,_0x13fcc4,_0x488439,_0x585cfd,_0x5a4736,!!_0x1cf44e[_0x3d8126(0xed)],!!_0x1cf44e[_0x3d8126(0x13c)]),_0xfc486=_0x39ac10['segments'][_0x3d8126(0x144)],_0x1fb04c=_0x39ac10['segments'][_0x3d8126(0x150)],_0xd0144d=_0x39ac10['segments']['unchanged'],_0x53887f=_0x39ac10[_0x3d8126(0x170)]['toDelete'],_0x2ef8e7=_0x39ac10[_0x3d8126(0xef)][_0x3d8126(0x122)],_0x23b981=_0x39ac10[_0x3d8126(0x117)][_0x3d8126(0x144)],_0x2a51b8=_0x39ac10[_0x3d8126(0x117)][_0x3d8126(0x150)],_0xdc89ae=_0x39ac10[_0x3d8126(0x117)][_0x3d8126(0xfb)],_0x36fbe1=_0x39ac10[_0x3d8126(0x117)][_0x3d8126(0x163)],_0xfd2bf4=_0x39ac10['activations']['all'],_0x4451a7=_0x39ac10[_0x3d8126(0x103)][_0x3d8126(0x122)],_0x1fba6f=_0x39ac10['activations'][_0x3d8126(0x12a)],_0x4d50c0=_0x39ac10[_0x3d8126(0x103)][_0x3d8126(0x163)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x295a8e+'\x27:');_0x2ef8e7[_0x3d8126(0x114)]>0x0&&console[_0x3d8126(0x119)]('\x20\x20'+a31_0x122508['blue']('📁\x20'+_0x2ef8e7[_0x3d8126(0x114)]+'\x20folders\x20to\x20create'));if(!_0x1cf44e['journeysOnly']){console[_0x3d8126(0x119)]('\x20\x20📊\x20Segments:'),console[_0x3d8126(0x119)]('\x20\x20\x20\x20'+a31_0x122508['green']('+\x20'+_0xfc486[_0x3d8126(0x114)]+'\x20new')),console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['yellow']('~\x20'+_0x1fb04c[_0x3d8126(0x114)]+_0x3d8126(0x14b)));if(_0x53887f['length']>0x0)console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508[_0x3d8126(0x15d)]('-\x20'+_0x53887f[_0x3d8126(0x114)]+_0x3d8126(0x12b)));else _0x585cfd[_0x3d8126(0x114)]>0x0&&!_0x1cf44e['delete']&&console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508[_0x3d8126(0x152)](_0x585cfd[_0x3d8126(0x114)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['dim']('=\x20'+_0xd0144d[_0x3d8126(0x114)]+_0x3d8126(0x174)));}if(_0x13fcc4[_0x3d8126(0x114)]>0x0||_0x5a4736[_0x3d8126(0x114)]>0x0){console['error'](_0x3d8126(0x120)),console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['green']('+\x20'+_0x23b981[_0x3d8126(0x114)]+_0x3d8126(0xee))),console['error'](_0x3d8126(0xf2)+a31_0x122508[_0x3d8126(0x116)]('~\x20'+_0x2a51b8[_0x3d8126(0x114)]+_0x3d8126(0x14b)));if(_0x36fbe1['length']>0x0)console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['red']('-\x20'+_0x36fbe1[_0x3d8126(0x114)]+'\x20to\x20delete'));else _0x5a4736[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0xed)]&&console[_0x3d8126(0x119)]('\x20\x20\x20\x20'+a31_0x122508[_0x3d8126(0x152)](_0x5a4736[_0x3d8126(0x114)]+_0x3d8126(0x107)));console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['dim']('=\x20'+_0xdc89ae[_0x3d8126(0x114)]+'\x20unchanged'));}_0xfd2bf4[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)]&&(console[_0x3d8126(0x119)](''),console['error'](_0x3d8126(0x113)),_0x4451a7[_0x3d8126(0x114)]>0x0&&console[_0x3d8126(0x119)]('\x20\x20\x20\x20'+a31_0x122508[_0x3d8126(0x169)]('+\x20'+_0x4451a7[_0x3d8126(0x114)]+_0x3d8126(0x149))),_0x1fba6f['length']>0x0&&console[_0x3d8126(0x119)]('\x20\x20\x20\x20'+a31_0x122508[_0x3d8126(0x116)]('~\x20'+_0x1fba6f[_0x3d8126(0x114)]+_0x3d8126(0x15b))),_0x4d50c0[_0x3d8126(0x114)]>0x0&&console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508[_0x3d8126(0x15d)]('-\x20'+_0x4d50c0[_0x3d8126(0x114)]+'\x20to\x20delete')));console[_0x3d8126(0x119)]('\x20\x20Source:\x20'+a31_0x122508['cyan'](_0x1f827d)+'\x0a');if(_0x2ef8e7[_0x3d8126(0x114)]>0x0){console['error'](_0x3d8126(0x12e));for(const _0x206bf2 of _0x2ef8e7){console[_0x3d8126(0x119)]('\x20\x20'+a31_0x122508[_0x3d8126(0xf1)]('+')+'\x20'+_0x206bf2);}console[_0x3d8126(0x119)]('');}if(_0xfc486[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)])for(const _0x7a08e4 of _0xfc486){const _0x466f26=_0x7a08e4['folderPath']?_0x7a08e4[_0x3d8126(0xfa)]+'/'+_0x7a08e4[_0x3d8126(0x115)][_0x3d8126(0x151)]:_0x7a08e4[_0x3d8126(0x115)][_0x3d8126(0x151)],_0x1b53ca=_0x7a08e4[_0x3d8126(0x115)][_0x3d8126(0x103)]?.[_0x3d8126(0x114)]||0x0,_0x4e293a=_0x1b53ca>0x0?a31_0x122508[_0x3d8126(0x152)]('\x20['+_0x1b53ca+_0x3d8126(0x154)):'';console[_0x3d8126(0x119)]('\x0a'+a31_0x122508[_0x3d8126(0x169)]('New\x20segment:')+'\x20'+_0x466f26+_0x4e293a),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c)),_0x7a08e4[_0x3d8126(0x14f)]&&console['error'](_0x7a08e4[_0x3d8126(0x14f)]),console[_0x3d8126(0x119)]('─'['repeat'](0x3c));}if(_0x53887f[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)])for(const _0x3e57cd of _0x53887f){const _0x3a722e=_0x3e57cd[_0x3d8126(0x14a)]?_0x4d5151['get'](_0x3e57cd['segmentFolderId']['toString']())||'':'',_0x55edf9=_0x3a722e?_0x3a722e+'/'+_0x3e57cd[_0x3d8126(0x151)]:_0x3e57cd['name'],_0x429f4c=_0xe87194['get'](_0x3e57cd['id'])||[],_0x1bf2b6=_0x429f4c['length']>0x0?a31_0x122508['dim']('\x20['+_0x429f4c[_0x3d8126(0x114)]+'\x20activations]'):'';console['error']('\x0a'+a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x135))+'\x20'+_0x55edf9+_0x1bf2b6),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c));const _0x38d0a9=segmentWithActivationsToYaml(_0x3e57cd,_0x429f4c,undefined,_0x12a8af,_0x1fe97b),_0x2cfa4a=segmentToYamlString(_0x38d0a9),_0x3d34d1=generateDiff(_0x2cfa4a,'');console[_0x3d8126(0x119)](formatDiffWithColors(_0x3d34d1)),console[_0x3d8126(0x119)]('─'['repeat'](0x3c));}const _0x4343e5=_0x199ab8['filter'](_0x3149c9=>!_0x3149c9[_0x3d8126(0x11d)]&&_0x3149c9['diff']);if(_0x4343e5[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)])for(const _0x1c3057 of _0x4343e5){const _0x599a1b=_0x1c3057[_0x3d8126(0xfa)]?_0x1c3057['folderPath']+'/'+_0x1c3057[_0x3d8126(0x115)][_0x3d8126(0x151)]:_0x1c3057[_0x3d8126(0x115)]['name'];console[_0x3d8126(0x119)]('\x0a'+a31_0x122508[_0x3d8126(0x116)](_0x3d8126(0x160))+'\x20'+_0x599a1b),console[_0x3d8126(0x119)]('─'['repeat'](0x3c)),console[_0x3d8126(0x119)](_0x1c3057['diff']),console['error']('─'['repeat'](0x3c));}if(_0x23b981['length']>0x0)for(const _0x54dd66 of _0x23b981){const _0x184933=_0x54dd66[_0x3d8126(0xfa)]?_0x54dd66['folderPath']+'/'+_0x54dd66['yamlConfig']['name']:_0x54dd66['yamlConfig'][_0x3d8126(0x151)];console[_0x3d8126(0x119)]('\x0a'+a31_0x122508[_0x3d8126(0x169)]('New\x20journey:')+'\x20'+_0x184933),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c)),_0x54dd66['diff']&&console['error'](_0x54dd66[_0x3d8126(0x14f)]),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c));}const _0x1f48c5=_0x13fcc4['filter'](_0x22209d=>!_0x22209d[_0x3d8126(0x11d)]&&_0x22209d[_0x3d8126(0x14f)]);if(_0x1f48c5[_0x3d8126(0x114)]>0x0)for(const _0x3cfc54 of _0x1f48c5){const _0xafb620=_0x3cfc54[_0x3d8126(0xfa)]?_0x3cfc54[_0x3d8126(0xfa)]+'/'+_0x3cfc54[_0x3d8126(0x115)][_0x3d8126(0x151)]:_0x3cfc54[_0x3d8126(0x115)][_0x3d8126(0x151)];console[_0x3d8126(0x119)]('\x0a'+a31_0x122508[_0x3d8126(0x116)]('Changes\x20to\x20journey:')+'\x20'+_0xafb620),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c)),console[_0x3d8126(0x119)](_0x3cfc54[_0x3d8126(0x14f)]),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c));}if(_0x36fbe1[_0x3d8126(0x114)]>0x0)for(const _0x43834c of _0x36fbe1){const _0xee277a=_0x43834c[_0x3d8126(0x133)]?_0x4d5151['get'](_0x43834c[_0x3d8126(0x133)])||'':'',_0x1b8e77=_0xee277a?_0xee277a+'/'+_0x43834c[_0x3d8126(0x156)]:_0x43834c[_0x3d8126(0x156)];console[_0x3d8126(0x119)]('\x0a'+a31_0x122508['red']('Delete\x20journey:')+'\x20'+_0x1b8e77),console['error']('─'[_0x3d8126(0x16b)](0x3c)),console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x147))),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c));}if(_0x1cf44e[_0x3d8126(0x11e)])return console[_0x3d8126(0x119)](a31_0x122508['yellow'](_0x3d8126(0x177))),0x0;const _0x58e3bf=_0x1cf44e['journeysOnly']?![]:_0xfc486[_0x3d8126(0x114)]>0x0||_0x1fb04c[_0x3d8126(0x114)]>0x0||_0x53887f[_0x3d8126(0x114)]>0x0,_0x13253d=_0x23b981[_0x3d8126(0x114)]>0x0||_0x2a51b8[_0x3d8126(0x114)]>0x0||_0x36fbe1[_0x3d8126(0x114)]>0x0,_0x3034b6=_0x1cf44e['journeysOnly']?![]:_0xfd2bf4[_0x3d8126(0x114)]>0x0,_0x2efb20=_0x2ef8e7['length']>0x0;if(!_0x58e3bf&&!_0x13253d&&!_0x3034b6&&!_0x2efb20){const _0x114b42=_0x1cf44e[_0x3d8126(0x13c)]?_0x3d8126(0x12d):_0x3d8126(0x110);console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x169)](_0x114b42));if(_0x1aca53&&_0xdc89ae[_0x3d8126(0x114)]===0x1){const _0x4eb5d6=_0xdc89ae[0x0];if(_0x4eb5d6[_0x3d8126(0x102)]?.['id']){const _0x191f7a=getConsoleNextUrl(_0x1cf44e[_0x3d8126(0x11c)],_0x3d8126(0x111)+_0x47fa64+_0x3d8126(0x145)+_0x4eb5d6[_0x3d8126(0x102)]['id']+_0x3d8126(0x14e));console[_0x3d8126(0x119)]('\x20\x20'+a31_0x122508[_0x3d8126(0x109)](_0x191f7a));}}return 0x0;}const _0xeb377f=_0x1cf44e[_0x3d8126(0x13c)]?_0x23b981['length']+_0x2a51b8['length']+_0x36fbe1[_0x3d8126(0x114)]+_0x2ef8e7[_0x3d8126(0x114)]:_0xfc486[_0x3d8126(0x114)]+_0x1fb04c[_0x3d8126(0x114)]+_0x53887f['length']+_0x23b981['length']+_0x2a51b8[_0x3d8126(0x114)]+_0x36fbe1[_0x3d8126(0x114)]+_0x2ef8e7[_0x3d8126(0x114)]+_0xfd2bf4[_0x3d8126(0x114)];if(!_0x1cf44e[_0x3d8126(0x176)]&&_0xeb377f>0x0){const _0x1c1249=await confirmKey(_0x3d8126(0x138)+_0xeb377f+_0x3d8126(0x11f));if(!_0x1c1249)return console[_0x3d8126(0x119)](_0x3d8126(0x165)),0x1;}const _0x32d952={'withProgress':async(_0x4a6727,_0x59be0e)=>{const _0x1593b1=_0x3d8126,_0xdfb96f=await withSpinner(_0x4a6727,_0x59be0e,{'verbose':_0x1cf44e[_0x1593b1(0x108)]});return{'data':_0xdfb96f[_0x1593b1(0x162)]};},'logInfo':_0x1adda6=>console['error'](a31_0x122508[_0x3d8126(0xf1)]('✔\x20'+_0x1adda6)),'logSuccess':_0x6f1a3a=>console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x169)]('✔\x20'+_0x6f1a3a)),'logWarning':_0x5e2980=>console['error'](a31_0x122508[_0x3d8126(0x116)]('⚠\x20'+_0x5e2980)),'logDeleted':_0x3bba38=>console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)]('✔\x20'+_0x3bba38))},_0x3c41f0={'segment':_0x37fd5f[_0x3d8126(0x10a)],'journey':_0x37fd5f[_0x3d8126(0x126)],'user':_0x37fd5f[_0x3d8126(0xec)],'connection':_0x37fd5f[_0x3d8126(0x131)]};_0x2ef8e7[_0x3d8126(0x114)]>0x0&&(_0x314261=await executePushFolders(_0x3c41f0,_0x2ef8e7,_0x314261,{'parentId':_0x47fa64},_0x32d952));const _0x28bf0a={'rootFolderId':_0x102a86,'folderPathToId':_0x314261,'folderIdToPath':_0x4d5151,'segmentNameToId':_0x1b42cd,'activationsBySegmentId':_0xe87194,'emailToIdMap':_0x3c1dbb,'idToEmailMap':_0x12a8af,'connectionNameToIdMap':_0x584688[_0x3d8126(0x13d)],'connectionIdToNameMap':_0x584688[_0x3d8126(0x148)],'connectionNameToTypeMap':_0x16bfdf},_0x395532=await executePushSegments(_0x3c41f0,_0x1cf44e[_0x3d8126(0x13c)]?[]:_0x199ab8,_0x28bf0a,{'parentId':_0x47fa64},_0x32d952),_0x417f7a=_0x395532[_0x3d8126(0x104)],_0x59c441=_0x395532[_0x3d8126(0x134)],_0x5f4bc5=_0x395532[_0x3d8126(0x103)]['created'],_0x570b38=_0x395532[_0x3d8126(0x103)][_0x3d8126(0x134)],_0x5ad9b9=_0x395532[_0x3d8126(0x103)]['deleted'],_0x5bc075=await executePushSegmentDeletions(_0x3c41f0,_0x1cf44e[_0x3d8126(0x13c)]?[]:_0x53887f,_0x32d952);let _0x4c6e4b=0x0,_0x227168=0x0,_0xca36a1=0x0;const _0x49f6c8=new Map(_0x1b42cd);for(const [_0x2234dc,_0x328ba0]of _0x395532[_0x3d8126(0x16e)]){_0x49f6c8[_0x3d8126(0x142)](_0x2234dc,_0x328ba0);}if(_0x13fcc4[_0x3d8126(0x114)]>0x0){const _0x4d0008={..._0x28bf0a,'segmentNameToId':_0x49f6c8,'existingSegments':_0x1a2f98,'activationContext':_0x890e6e},_0x374c13=await executePushJourneys(_0x3c41f0,_0x13fcc4,_0x4d0008,{'parentId':_0x47fa64,'rootFolderId':_0x102a86,'verbose':_0x1cf44e[_0x3d8126(0x108)]},_0x32d952);_0x4c6e4b=_0x374c13[_0x3d8126(0x104)],_0x227168=_0x374c13[_0x3d8126(0x134)];if(_0x1aca53&&_0x374c13[_0x3d8126(0x130)][_0x3d8126(0x114)]===0x1){const _0x57829c=_0x374c13['results'][0x0];if(_0x57829c[_0x3d8126(0x12f)]){const _0x168111=getConsoleNextUrl(_0x1cf44e['site'],_0x3d8126(0x111)+_0x47fa64+'/e/'+_0x57829c[_0x3d8126(0x12f)]+'/j/da/je');console['error']('\x20\x20'+a31_0x122508[_0x3d8126(0x109)](_0x168111));}}}for(const _0xa920b4 of _0x36fbe1){console[_0x3d8126(0x119)](a31_0x122508['yellow'](_0x3d8126(0x168)+_0xa920b4[_0x3d8126(0x156)])),_0xca36a1++;}const _0x482667=[];if(_0x417f7a>0x0)_0x482667[_0x3d8126(0x17b)](_0x417f7a+_0x3d8126(0xf7));if(_0x59c441>0x0)_0x482667[_0x3d8126(0x17b)](_0x59c441+'\x20updated');if(_0x5bc075>0x0)_0x482667[_0x3d8126(0x17b)](_0x5bc075+_0x3d8126(0x136));const _0x1e1fdb=[];if(_0x4c6e4b>0x0)_0x1e1fdb[_0x3d8126(0x17b)](_0x4c6e4b+_0x3d8126(0xf7));if(_0x227168>0x0)_0x1e1fdb[_0x3d8126(0x17b)](_0x227168+_0x3d8126(0x118));if(_0xca36a1>0x0)_0x1e1fdb[_0x3d8126(0x17b)](_0xca36a1+_0x3d8126(0x136));const _0x452e89=[];if(_0x5f4bc5>0x0)_0x452e89['push'](_0x5f4bc5+_0x3d8126(0xf7));if(_0x570b38>0x0)_0x452e89[_0x3d8126(0x17b)](_0x570b38+'\x20updated');if(_0x5ad9b9>0x0)_0x452e89['push'](_0x5ad9b9+'\x20deleted');return console[_0x3d8126(0x119)](a31_0x122508['green'](_0x3d8126(0x172))),_0x482667['length']>0x0&&!_0x1cf44e[_0x3d8126(0x13c)]&&console[_0x3d8126(0x119)]('\x20\x20Segments:\x20'+_0x482667['join'](',\x20')),_0x1e1fdb[_0x3d8126(0x114)]>0x0&&console[_0x3d8126(0x119)](_0x3d8126(0x15a)+_0x1e1fdb[_0x3d8126(0x143)](',\x20')),_0x452e89[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)]&&console[_0x3d8126(0x119)](_0x3d8126(0x100)+_0x452e89[_0x3d8126(0x143)](',\x20')),0x0;}}
|
|
1
|
+
const a31_0x4203c5=a31_0x296a;(function(_0x764411,_0xa0c311){const _0x13eb3c=a31_0x296a,_0x26064c=_0x764411();while(!![]){try{const _0x402ecd=-parseInt(_0x13eb3c(0x17e))/0x1+parseInt(_0x13eb3c(0x1c4))/0x2*(parseInt(_0x13eb3c(0x1fb))/0x3)+-parseInt(_0x13eb3c(0x174))/0x4+-parseInt(_0x13eb3c(0x1e5))/0x5*(-parseInt(_0x13eb3c(0x1f6))/0x6)+-parseInt(_0x13eb3c(0x16e))/0x7*(parseInt(_0x13eb3c(0x1e9))/0x8)+-parseInt(_0x13eb3c(0x17f))/0x9*(-parseInt(_0x13eb3c(0x1e2))/0xa)+parseInt(_0x13eb3c(0x168))/0xb;if(_0x402ecd===_0xa0c311)break;else _0x26064c['push'](_0x26064c['shift']());}catch(_0x23a8b7){_0x26064c['push'](_0x26064c['shift']());}}}(a31_0x5151,0x3f8f6));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a31_0x5151(){const _0x3f01f9=['no_parent','isScoped','7580GcTjyX','endsWith','updatedAt','29105XDcdFm','data','repeat','dryRun','539288ydjLqR','file','Push\x20','get','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x20\x20\x20\x20','listSegments','\x20folders\x20to\x20create','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Folders\x20to\x20create:','filePath','folderPath','282AwesAP','\x20created','yellow','length','📁\x20','99558FVXiZB','results','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','new','yes','toCreate','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Fetching\x20existing\x20segments...','paused','7832968mEzFZc','isNew','blue','createdSegmentIds','execute','parent_name','35aPcxcP','helpText','Fetching\x20connections\x20for\x20name\x20resolution...','cwd','No\x20','filter','1316396lfSWhi','targetDir','created','all','getParent','getJourney','list','createdAt','\x20\x20📊\x20Segments:','Fetching\x20existing\x20folders...','362401SLjwXu','54LZQSuZ','Site:\x20','name','error','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yamlConfig','green','segment\x20or\x20journey','verbose','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','/app/ps/','/j/da/je','listFolders','toUpdate','\x20\x20Source:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','map','\x27...','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Segments:\x20','Aborted.','Source\x20directory:\x20','/e/','type','\x20updated','updated','segment','Changes\x20to\x20journey:','folderId','\x0a✔\x20Push\x20complete','Fetching\x20existing\x20journeys...','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','segment:push','\x20deleted','diff','\x20unchanged','deleted','user','delete','\x0aValidation\x20failed:','journeysOnly','state','journeyBundleName','red','attributes','New\x20journey:','\x20\x20Activations:\x20','dim','unchanged','then','getOutputSchemaWithCache','setPhase','Delete\x20segment:','journeyId','\x0aPush\x20summary\x20for\x20\x27','toString','changed','errorCode','cyan','\x20changes?','Parent\x20segment:\x20','.yml','resolveParentId','nameToId','push','toDelete','segments','description','\x20changed','18AVzFIo','set','folders','journeys','\x20to\x20delete','connection','idToName','site','Fetching\x20parent\x20segment\x20details...','\x20YAML\x20files\x20found','parentFolder','join','\x20new','journeyBundleId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Delete\x20journey:','message','Preparing\x20journeys...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20Activations:','\x20activations]','Fetching\x20existing\x20activations...','New\x20segment:','\x20to\x20create','existingJourney','activations','\x20\x20🗺️\x20\x20Journeys:','journey'];a31_0x5151=function(){return _0x3f01f9;};return a31_0x5151();}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x48dc70 from'chalk';function a31_0x296a(_0x4a831a,_0x53ed55){_0x4a831a=_0x4a831a-0x166;const _0x515193=a31_0x5151();let _0x296afa=_0x515193[_0x4a831a];return _0x296afa;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x4203c5(0x181)]=a31_0x4203c5(0x19f);[a31_0x4203c5(0x1c2)]=a31_0x4203c5(0x1d2);async[a31_0x4203c5(0x16c)](_0x32df3e){const _0x4fc34a=a31_0x4203c5,{options:_0x5d64db,args:_0x3ba77f,tdx:_0x2ad664}=_0x32df3e,_0x43932b=_0x5d64db,_0x4eefda=await resolveTarget({'arg':_0x3ba77f[0x0],'contextParent':_0x5d64db['parentSegment'],'cwd':process[_0x4fc34a(0x171)]()});if(!isSuccessfulResolution(_0x4eefda))return _0x4eefda[_0x4fc34a(0x1b8)]===_0x4fc34a(0x1e0)?(console['error'](a31_0x48dc70['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4fc34a(0x182)](_0x4fc34a(0x1ed)),console[_0x4fc34a(0x182)](_0x4fc34a(0x201)),console[_0x4fc34a(0x182)](_0x4fc34a(0x1f2))):(console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)]('Error:\x20'+_0x4eefda[_0x4fc34a(0x1d4)]+'\x0a')),_0x4eefda[_0x4fc34a(0x16f)]&&console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1b9)](_0x4eefda[_0x4fc34a(0x16f)]))),0x1;if(_0x4eefda[_0x4fc34a(0x196)]===_0x4fc34a(0x16d))return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4eefda[_0x4fc34a(0x175)]+'\x0a')),console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1b9)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x1ccb88=_0x4eefda['parentName'],_0x60b226=_0x4eefda[_0x4fc34a(0x175)],_0xfb5acd=_0x4eefda[_0x4fc34a(0x196)]===_0x4fc34a(0x1ea)?_0x4eefda[_0x4fc34a(0x1f4)]:undefined,_0x19ab3c=getScopedDetails(_0x4eefda),_0x44c92a=_0x19ab3c?.[_0x4fc34a(0x1e1)]??![],_0x432970=_0x19ab3c?.['scopedFolderPath']??'';if(!existsSync(_0x60b226))return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)](_0x4fc34a(0x191)+_0x60b226+'\x0a')),console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1b9)](_0x4fc34a(0x1fd))),0x1;_0x43932b[_0x4fc34a(0x187)]&&(console[_0x4fc34a(0x182)](_0x4fc34a(0x180)+_0x43932b[_0x4fc34a(0x1cb)]),console['error'](_0x4fc34a(0x1bb)+_0x1ccb88),console[_0x4fc34a(0x182)](_0x4fc34a(0x194)+_0x60b226),_0x44c92a&&console['error']('Scoped\x20to\x20folder:\x20'+_0x432970));const _0x13783c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ccb88+_0x4fc34a(0x190),()=>_0x2ad664[_0x4fc34a(0x199)][_0x4fc34a(0x1bd)](_0x1ccb88),{'verbose':_0x43932b[_0x4fc34a(0x187)]}),_0x321572=_0x13783c[_0x4fc34a(0x1e6)],[_0xed2647,_0x309031,_0x17f70b,_0x554be5,_0x142b0]=await Promise[_0x4fc34a(0x177)]([withSpinner(_0x4fc34a(0x1cc),()=>_0x2ad664[_0x4fc34a(0x199)][_0x4fc34a(0x178)](_0x321572),{'verbose':_0x43932b[_0x4fc34a(0x187)]}),withSpinner(_0x4fc34a(0x166),()=>_0x2ad664[_0x4fc34a(0x199)][_0x4fc34a(0x1ef)](_0x321572),{'verbose':_0x43932b[_0x4fc34a(0x187)]}),withSpinner(_0x4fc34a(0x17d),()=>_0x2ad664[_0x4fc34a(0x199)][_0x4fc34a(0x18b)](_0x321572),{'verbose':_0x43932b['verbose']}),withSpinner(_0x4fc34a(0x19d),()=>_0x2ad664[_0x4fc34a(0x1df)]['listJourneysWithDetailsFromParentSegment'](_0x321572,{'includeAllVersions':!![]}),{'verbose':_0x43932b[_0x4fc34a(0x187)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x2ad664['user']['buildUserMaps'](),{'verbose':_0x43932b['verbose']})['then'](_0x109083=>_0x109083['data'])]),_0x53f38b=_0xed2647['data'],_0x150c34=extractRootFolderId(_0x53f38b),_0x4e9626=_0x309031[_0x4fc34a(0x1e6)],_0x5c34c6=_0x17f70b[_0x4fc34a(0x1e6)],{journeys:_0x23e26c,activationStepsById:_0x5d8bd3}=_0x554be5[_0x4fc34a(0x1e6)],_0x4e1223=new Map(_0x23e26c[_0x4fc34a(0x18f)](_0x37c374=>[_0x37c374['id'],_0x37c374])),_0x290a1e=_0x23e26c['map'](_0x847536=>({'id':_0x847536['id'],'name':_0x847536[_0x4fc34a(0x1ab)]['name'],'journeyBundleName':_0x847536['attributes'][_0x4fc34a(0x1a9)]||'','journeyBundleId':_0x847536[_0x4fc34a(0x1ab)][_0x4fc34a(0x1d1)]||'','versionNumber':_0x847536[_0x4fc34a(0x1ab)]['versionNumber'],'description':_0x847536[_0x4fc34a(0x1ab)][_0x4fc34a(0x1c2)],'state':_0x847536['attributes'][_0x4fc34a(0x1a8)],'paused':_0x847536['attributes'][_0x4fc34a(0x167)],'audienceId':_0x847536[_0x4fc34a(0x1ab)]['audienceId'],'folderId':_0x847536['relationships']?.[_0x4fc34a(0x1ce)]?.['data']?.['id'],'createdAt':_0x847536[_0x4fc34a(0x1ab)][_0x4fc34a(0x17b)],'updatedAt':_0x847536[_0x4fc34a(0x1ab)][_0x4fc34a(0x1e4)]})),{emailToId:_0x5b39d9,idToEmail:_0x434486}=_0x142b0,_0x40098a=await withSpinner(_0x4fc34a(0x170),async()=>{const _0x2ab27d=_0x4fc34a,_0xd453c3=await _0x2ad664[_0x2ab27d(0x1c9)][_0x2ab27d(0x17a)]();return buildConnectionMaps(_0xd453c3);},{'verbose':_0x43932b['verbose']})['then'](_0x5bf308=>_0x5bf308[_0x4fc34a(0x1e6)]),_0x1bba53=_0x40098a['nameToId'],_0x3077ce=_0x40098a[_0x4fc34a(0x1ca)],_0x3193db=_0x40098a['nameToType'],_0xc031ec={'emailToIdMap':_0x5b39d9,'connectionNameToIdMap':_0x1bba53,'connectionNameToTypeMap':_0x3193db,'getSchema':_0x47f4e4=>_0x2ad664[_0x4fc34a(0x1c9)][_0x4fc34a(0x1b1)](_0x47f4e4)};let {pathToId:_0x77b1f6,idToPath:_0x61301}=buildFolderMaps(_0x5c34c6);const _0x97d309=buildSegmentLookupMap(_0x4e9626,_0x61301),_0x36fc4b=buildSegmentNameToIdMap(_0x4e9626),_0x4be549=buildJourneyBundleLookupMap(_0x290a1e,_0x61301);let _0xacf714;if(_0xfb5acd){if(!_0xfb5acd[_0x4fc34a(0x1e3)](_0x4fc34a(0x1bc))&&!_0xfb5acd['endsWith']('.yaml'))return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)](_0x4fc34a(0x188)+_0xfb5acd+'\x0a')),0x1;_0xacf714=[_0xfb5acd];}else _0xacf714=findYamlFiles(_0x60b226);if(_0xacf714['length']===0x0)return console[_0x4fc34a(0x182)](a31_0x48dc70['red'](_0x4fc34a(0x183)+_0x60b226+'\x0a')),console['error'](a31_0x48dc70[_0x4fc34a(0x1b9)](_0x4fc34a(0x18e))),0x1;let _0x4375f1,_0x4e0fae;try{const _0x54df05=parseAndClassifyYamlFiles(_0xacf714,_0x60b226,{'skipSegments':_0x43932b[_0x4fc34a(0x1a7)]});_0x4375f1=_0x54df05[_0x4fc34a(0x1c1)],_0x4e0fae=_0x54df05[_0x4fc34a(0x1c7)];const _0x10d18c=validateParsedFiles(_0x54df05,_0x60b226);if(_0x10d18c[_0x4fc34a(0x1f9)]>0x0)return console[_0x4fc34a(0x182)](a31_0x48dc70['red'](_0x4fc34a(0x1a6))),console[_0x4fc34a(0x182)](formatValidationErrors(_0x10d18c)),console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1f8)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x2cc38c){return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1aa)]('Error\x20parsing\x20YAML:\x20'+(_0x2cc38c instanceof Error?_0x2cc38c['message']:_0x2cc38c))),0x1;}if(_0x4375f1['length']===0x0&&_0x4e0fae[_0x4fc34a(0x1f9)]===0x0){const _0x36b58d=_0x43932b[_0x4fc34a(0x1a7)]?_0x4fc34a(0x1df):_0x4fc34a(0x186);return console[_0x4fc34a(0x182)](a31_0x48dc70['yellow'](_0x4fc34a(0x172)+_0x36b58d+_0x4fc34a(0x1cd))),0x0;}const _0x19ebc9=new Map();_0x4e9626['length']>0x0&&!_0x43932b[_0x4fc34a(0x1a7)]&&await withSpinner(_0x4fc34a(0x1d9),async()=>{await batchAsync(_0x4e9626,async _0x159d4a=>{const _0x3461f5=a31_0x296a,_0x30ff09=await _0x2ad664[_0x3461f5(0x199)]['listActivations'](_0x321572,_0x159d4a['id']);_0x19ebc9['set'](_0x159d4a['id'],_0x30ff09);});},{'verbose':_0x43932b['verbose']});const {segmentFiles:_0x3ab41c,foldersToCreate:_0x506afd}=await prepareSegmentFiles(_0x4375f1,{'segmentByFolderAndName':_0x97d309,'activationsBySegmentId':_0x19ebc9,'folderPathToId':_0x77b1f6,'idToEmailMap':_0x434486,'connectionIdToNameMap':_0x3077ce},_0xc031ec,_0x44c92a,_0x432970),_0x3748e7=_0xfb5acd?[]:findSegmentsToDelete(_0x4e9626,_0x4375f1[_0x4fc34a(0x18f)](({yamlConfig:_0x42dec1,folderPath:_0x367cb3})=>({'yamlConfig':_0x42dec1,'folderPath':resolveTDFolderPath(_0x367cb3,_0x44c92a,_0x432970)})),_0x61301,_0x432970,_0x44c92a),{journeyFiles:_0x5b444c,foldersToCreate:_0x31cac5}=await withProgressSpinner(_0x4fc34a(0x1d5),async _0x1557af=>prepareJourneyFiles(_0x4e0fae,{'fetchJourney':async _0x19863a=>_0x2ad664[_0x4fc34a(0x1df)][_0x4fc34a(0x179)](_0x19863a[_0x4fc34a(0x1b4)]),'journeyBundlesByFolderAndName':_0x4be549,'folderPathToId':_0x77b1f6,'idToEmailMap':_0x434486,'connectionIdToNameMap':_0x3077ce,'existingSegments':_0x4e9626,'parentId':_0x321572,'deps':_0x2ad664,'progress':{'update':_0x1b95c1=>{const _0x5513d5=_0x4fc34a;_0x1557af[_0x5513d5(0x1b2)](_0x1b95c1),_0x43932b[_0x5513d5(0x187)]&&console['error']('\x20\x20'+_0x1b95c1);}},'journeyById':_0x4e1223,'activationStepsById':_0x5d8bd3},_0x44c92a,_0x432970),{'verbose':_0x43932b[_0x4fc34a(0x187)]})[_0x4fc34a(0x1b0)](_0x51133e=>_0x51133e[_0x4fc34a(0x1e6)]);for(const _0x44c94d of _0x31cac5){_0x506afd['add'](_0x44c94d);}const _0x26d078=_0xfb5acd?[]:findJourneysToDelete(_0x290a1e,_0x4e0fae['map'](({yamlConfig:_0x96f936,folderPath:_0xa9b83a})=>({'yamlConfig':_0x96f936,'folderPath':resolveTDFolderPath(_0xa9b83a,_0x44c92a,_0x432970)})),_0x61301,_0x432970,_0x44c92a),_0x458b31=calculatePushStats(_0x3ab41c,_0x5b444c,_0x506afd,_0x3748e7,_0x26d078,!!_0x43932b['delete'],!!_0x43932b[_0x4fc34a(0x1a7)]),_0x1d65ab=_0x458b31[_0x4fc34a(0x1c1)][_0x4fc34a(0x1fe)],_0xbef61a=_0x458b31['segments'][_0x4fc34a(0x1b7)],_0x196ee0=_0x458b31[_0x4fc34a(0x1c1)][_0x4fc34a(0x1af)],_0x238904=_0x458b31[_0x4fc34a(0x1c1)][_0x4fc34a(0x1c0)],_0x6a75b4=_0x458b31[_0x4fc34a(0x1c6)][_0x4fc34a(0x200)],_0x189654=_0x458b31[_0x4fc34a(0x1c7)][_0x4fc34a(0x1fe)],_0x5089fa=_0x458b31[_0x4fc34a(0x1c7)][_0x4fc34a(0x1b7)],_0x587cbb=_0x458b31[_0x4fc34a(0x1c7)][_0x4fc34a(0x1af)],_0x503a92=_0x458b31[_0x4fc34a(0x1c7)]['toDelete'],_0x5b2cbe=_0x458b31[_0x4fc34a(0x1dd)][_0x4fc34a(0x177)],_0x52cd04=_0x458b31[_0x4fc34a(0x1dd)][_0x4fc34a(0x200)],_0x217093=_0x458b31['activations'][_0x4fc34a(0x18c)],_0x4e6a62=_0x458b31[_0x4fc34a(0x1dd)][_0x4fc34a(0x1c0)];console[_0x4fc34a(0x182)](_0x4fc34a(0x1b5)+_0x1ccb88+'\x27:');_0x6a75b4[_0x4fc34a(0x1f9)]>0x0&&console['error']('\x20\x20'+a31_0x48dc70['blue'](_0x4fc34a(0x1fa)+_0x6a75b4['length']+_0x4fc34a(0x1f0)));if(!_0x43932b['journeysOnly']){console[_0x4fc34a(0x182)](_0x4fc34a(0x17c)),console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x185)]('+\x20'+_0x1d65ab[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1d0))),console['error']('\x20\x20\x20\x20'+a31_0x48dc70['yellow']('~\x20'+_0xbef61a[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1c3)));if(_0x238904[_0x4fc34a(0x1f9)]>0x0)console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1aa)]('-\x20'+_0x238904[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1c8)));else _0x3748e7[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b[_0x4fc34a(0x1a5)]&&console['error'](_0x4fc34a(0x1ee)+a31_0x48dc70['dim'](_0x3748e7[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1f1)));console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1ae)]('=\x20'+_0x196ee0[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1a2)));}if(_0x5b444c['length']>0x0||_0x26d078['length']>0x0){console[_0x4fc34a(0x182)](_0x4fc34a(0x1de)),console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x185)]('+\x20'+_0x189654['length']+'\x20new')),console['error'](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1f8)]('~\x20'+_0x5089fa[_0x4fc34a(0x1f9)]+'\x20changed'));if(_0x503a92[_0x4fc34a(0x1f9)]>0x0)console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1aa)]('-\x20'+_0x503a92['length']+_0x4fc34a(0x1c8)));else _0x26d078['length']>0x0&&!_0x43932b[_0x4fc34a(0x1a5)]&&console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1ae)](_0x26d078['length']+_0x4fc34a(0x1f1)));console['error'](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1ae)]('=\x20'+_0x587cbb[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1a2)));}_0x5b2cbe[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b[_0x4fc34a(0x1a7)]&&(console[_0x4fc34a(0x182)](''),console[_0x4fc34a(0x182)](_0x4fc34a(0x1d7)),_0x52cd04[_0x4fc34a(0x1f9)]>0x0&&console['error'](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x185)]('+\x20'+_0x52cd04['length']+_0x4fc34a(0x1db))),_0x217093[_0x4fc34a(0x1f9)]>0x0&&console[_0x4fc34a(0x182)]('\x20\x20\x20\x20'+a31_0x48dc70[_0x4fc34a(0x1f8)]('~\x20'+_0x217093[_0x4fc34a(0x1f9)]+'\x20to\x20update')),_0x4e6a62[_0x4fc34a(0x1f9)]>0x0&&console[_0x4fc34a(0x182)](_0x4fc34a(0x1ee)+a31_0x48dc70[_0x4fc34a(0x1aa)]('-\x20'+_0x4e6a62['length']+_0x4fc34a(0x1c8))));console[_0x4fc34a(0x182)](_0x4fc34a(0x18d)+a31_0x48dc70[_0x4fc34a(0x1b9)](_0x60b226)+'\x0a');if(_0x6a75b4['length']>0x0){console[_0x4fc34a(0x182)](_0x4fc34a(0x1f3));for(const _0x45465f of _0x6a75b4){console['error']('\x20\x20'+a31_0x48dc70[_0x4fc34a(0x16a)]('+')+'\x20'+_0x45465f);}console[_0x4fc34a(0x182)]('');}if(_0x1d65ab[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b[_0x4fc34a(0x1a7)])for(const _0x4f36af of _0x1d65ab){const _0x16be26=_0x4f36af['folderPath']?_0x4f36af[_0x4fc34a(0x1f5)]+'/'+_0x4f36af[_0x4fc34a(0x184)][_0x4fc34a(0x181)]:_0x4f36af['yamlConfig'][_0x4fc34a(0x181)],_0xe0a57c=_0x4f36af[_0x4fc34a(0x184)][_0x4fc34a(0x1dd)]?.[_0x4fc34a(0x1f9)]||0x0,_0x4e6f56=_0xe0a57c>0x0?a31_0x48dc70[_0x4fc34a(0x1ae)]('\x20['+_0xe0a57c+'\x20activations]'):'';console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70[_0x4fc34a(0x185)](_0x4fc34a(0x1da))+'\x20'+_0x16be26+_0x4e6f56),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c)),_0x4f36af[_0x4fc34a(0x1a1)]&&console[_0x4fc34a(0x182)](_0x4f36af[_0x4fc34a(0x1a1)]),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}if(_0x238904[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b['journeysOnly'])for(const _0x2f4ab8 of _0x238904){const _0x3fe5b8=_0x2f4ab8['segmentFolderId']?_0x61301[_0x4fc34a(0x1ec)](_0x2f4ab8['segmentFolderId'][_0x4fc34a(0x1b6)]())||'':'',_0x336ae9=_0x3fe5b8?_0x3fe5b8+'/'+_0x2f4ab8[_0x4fc34a(0x181)]:_0x2f4ab8[_0x4fc34a(0x181)],_0x135753=_0x19ebc9[_0x4fc34a(0x1ec)](_0x2f4ab8['id'])||[],_0x368769=_0x135753[_0x4fc34a(0x1f9)]>0x0?a31_0x48dc70[_0x4fc34a(0x1ae)]('\x20['+_0x135753[_0x4fc34a(0x1f9)]+_0x4fc34a(0x1d8)):'';console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70[_0x4fc34a(0x1aa)](_0x4fc34a(0x1b3))+'\x20'+_0x336ae9+_0x368769),console[_0x4fc34a(0x182)]('─'['repeat'](0x3c));const _0x2f5db2=segmentWithActivationsToYaml(_0x2f4ab8,_0x135753,undefined,_0x434486,_0x3077ce),_0x5d933a=segmentToYamlString(_0x2f5db2),_0x25c33e=generateDiff(_0x5d933a,'');console[_0x4fc34a(0x182)](formatDiffWithColors(_0x25c33e)),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}const _0x4bd37f=_0x3ab41c[_0x4fc34a(0x173)](_0x38b7e9=>!_0x38b7e9[_0x4fc34a(0x169)]&&_0x38b7e9[_0x4fc34a(0x1a1)]);if(_0x4bd37f[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b[_0x4fc34a(0x1a7)])for(const _0x25a7b9 of _0x4bd37f){const _0x3933a1=_0x25a7b9[_0x4fc34a(0x1f5)]?_0x25a7b9[_0x4fc34a(0x1f5)]+'/'+_0x25a7b9['yamlConfig'][_0x4fc34a(0x181)]:_0x25a7b9[_0x4fc34a(0x184)][_0x4fc34a(0x181)];console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70[_0x4fc34a(0x1f8)]('Changes\x20to:')+'\x20'+_0x3933a1),console[_0x4fc34a(0x182)]('─'['repeat'](0x3c)),console[_0x4fc34a(0x182)](_0x25a7b9[_0x4fc34a(0x1a1)]),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}if(_0x189654[_0x4fc34a(0x1f9)]>0x0)for(const _0x38c8b7 of _0x189654){const _0x5b83bc=_0x38c8b7[_0x4fc34a(0x1f5)]?_0x38c8b7[_0x4fc34a(0x1f5)]+'/'+_0x38c8b7[_0x4fc34a(0x184)][_0x4fc34a(0x181)]:_0x38c8b7['yamlConfig'][_0x4fc34a(0x181)];console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70['green'](_0x4fc34a(0x1ac))+'\x20'+_0x5b83bc),console['error']('─'['repeat'](0x3c)),_0x38c8b7[_0x4fc34a(0x1a1)]&&console['error'](_0x38c8b7['diff']),console[_0x4fc34a(0x182)]('─'['repeat'](0x3c));}const _0x2f9ae6=_0x5b444c['filter'](_0x795c81=>!_0x795c81[_0x4fc34a(0x169)]&&_0x795c81['diff']);if(_0x2f9ae6[_0x4fc34a(0x1f9)]>0x0)for(const _0x1b9e2a of _0x2f9ae6){const _0x3c4a3c=_0x1b9e2a[_0x4fc34a(0x1f5)]?_0x1b9e2a[_0x4fc34a(0x1f5)]+'/'+_0x1b9e2a[_0x4fc34a(0x184)]['name']:_0x1b9e2a[_0x4fc34a(0x184)][_0x4fc34a(0x181)];console[_0x4fc34a(0x182)]('\x0a'+a31_0x48dc70['yellow'](_0x4fc34a(0x19a))+'\x20'+_0x3c4a3c),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c)),console[_0x4fc34a(0x182)](_0x1b9e2a[_0x4fc34a(0x1a1)]),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}if(_0x503a92['length']>0x0)for(const _0x4e1c79 of _0x503a92){const _0xa534a2=_0x4e1c79[_0x4fc34a(0x19b)]?_0x61301[_0x4fc34a(0x1ec)](_0x4e1c79[_0x4fc34a(0x19b)])||'':'',_0xb52e84=_0xa534a2?_0xa534a2+'/'+_0x4e1c79['journeyBundleName']:_0x4e1c79[_0x4fc34a(0x1a9)];console['error']('\x0a'+a31_0x48dc70[_0x4fc34a(0x1aa)](_0x4fc34a(0x1d3))+'\x20'+_0xb52e84),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c)),console['error'](a31_0x48dc70[_0x4fc34a(0x1aa)]('(Journey\x20will\x20be\x20deleted)')),console[_0x4fc34a(0x182)]('─'[_0x4fc34a(0x1e7)](0x3c));}if(_0x43932b[_0x4fc34a(0x1e8)])return console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1f8)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x58b8d5=_0x43932b['journeysOnly']?![]:_0x1d65ab[_0x4fc34a(0x1f9)]>0x0||_0xbef61a[_0x4fc34a(0x1f9)]>0x0||_0x238904[_0x4fc34a(0x1f9)]>0x0,_0x495e4e=_0x189654[_0x4fc34a(0x1f9)]>0x0||_0x5089fa[_0x4fc34a(0x1f9)]>0x0||_0x503a92[_0x4fc34a(0x1f9)]>0x0,_0x26d0d0=_0x43932b['journeysOnly']?![]:_0x5b2cbe[_0x4fc34a(0x1f9)]>0x0,_0xe0e3f9=_0x6a75b4[_0x4fc34a(0x1f9)]>0x0;if(!_0x58b8d5&&!_0x495e4e&&!_0x26d0d0&&!_0xe0e3f9){const _0x53d487=_0x43932b['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x4fc34a(0x19e);console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x185)](_0x53d487));if(_0xfb5acd&&_0x587cbb[_0x4fc34a(0x1f9)]===0x1){const _0x33ff6a=_0x587cbb[0x0];if(_0x33ff6a[_0x4fc34a(0x1dc)]?.['id']){const _0xe9c92b=getConsoleNextUrl(_0x43932b[_0x4fc34a(0x1cb)],_0x4fc34a(0x189)+_0x321572+_0x4fc34a(0x195)+_0x33ff6a[_0x4fc34a(0x1dc)]['id']+_0x4fc34a(0x18a));console[_0x4fc34a(0x182)]('\x20\x20'+a31_0x48dc70[_0x4fc34a(0x1b9)](_0xe9c92b));}}return 0x0;}const _0x43008e=_0x43932b[_0x4fc34a(0x1a7)]?_0x189654['length']+_0x5089fa[_0x4fc34a(0x1f9)]+_0x503a92[_0x4fc34a(0x1f9)]+_0x6a75b4[_0x4fc34a(0x1f9)]:_0x1d65ab[_0x4fc34a(0x1f9)]+_0xbef61a[_0x4fc34a(0x1f9)]+_0x238904[_0x4fc34a(0x1f9)]+_0x189654[_0x4fc34a(0x1f9)]+_0x5089fa[_0x4fc34a(0x1f9)]+_0x503a92[_0x4fc34a(0x1f9)]+_0x6a75b4[_0x4fc34a(0x1f9)]+_0x5b2cbe[_0x4fc34a(0x1f9)];if(!_0x43932b[_0x4fc34a(0x1ff)]&&_0x43008e>0x0){const _0x4fe4af=await confirmKey(_0x4fc34a(0x1eb)+_0x43008e+_0x4fc34a(0x1ba));if(!_0x4fe4af)return console[_0x4fc34a(0x182)](_0x4fc34a(0x193)),0x1;}const _0xfcfed6={'withProgress':async(_0x183e6e,_0x1deb7d)=>{const _0x56d741=_0x4fc34a,_0x4c7c7b=await withSpinner(_0x183e6e,_0x1deb7d,{'verbose':_0x43932b['verbose']});return{'data':_0x4c7c7b[_0x56d741(0x1e6)]};},'logInfo':_0x5d7f8f=>console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x16a)]('✔\x20'+_0x5d7f8f)),'logSuccess':_0x1663d2=>console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x185)]('✔\x20'+_0x1663d2)),'logWarning':_0x4f7212=>console[_0x4fc34a(0x182)](a31_0x48dc70[_0x4fc34a(0x1f8)]('⚠\x20'+_0x4f7212)),'logDeleted':_0x56936a=>console['error'](a31_0x48dc70[_0x4fc34a(0x1aa)]('✔\x20'+_0x56936a))},_0x1dc4ad={'segment':_0x2ad664[_0x4fc34a(0x199)],'journey':_0x2ad664[_0x4fc34a(0x1df)],'user':_0x2ad664[_0x4fc34a(0x1a4)],'connection':_0x2ad664[_0x4fc34a(0x1c9)]};_0x6a75b4[_0x4fc34a(0x1f9)]>0x0&&(_0x77b1f6=await executePushFolders(_0x1dc4ad,_0x6a75b4,_0x77b1f6,{'parentId':_0x321572},_0xfcfed6));const _0x41bbd7={'rootFolderId':_0x150c34,'folderPathToId':_0x77b1f6,'folderIdToPath':_0x61301,'segmentNameToId':_0x36fc4b,'activationsBySegmentId':_0x19ebc9,'emailToIdMap':_0x5b39d9,'idToEmailMap':_0x434486,'connectionNameToIdMap':_0x40098a[_0x4fc34a(0x1be)],'connectionIdToNameMap':_0x40098a[_0x4fc34a(0x1ca)],'connectionNameToTypeMap':_0x3193db},_0x55cfdf=await executePushSegments(_0x1dc4ad,_0x43932b[_0x4fc34a(0x1a7)]?[]:_0x3ab41c,_0x41bbd7,{'parentId':_0x321572},_0xfcfed6),_0x1295bc=_0x55cfdf[_0x4fc34a(0x176)],_0x2ec254=_0x55cfdf[_0x4fc34a(0x198)],_0x35011f=_0x55cfdf[_0x4fc34a(0x1dd)]['created'],_0x27416f=_0x55cfdf[_0x4fc34a(0x1dd)][_0x4fc34a(0x198)],_0x4f2fba=_0x55cfdf[_0x4fc34a(0x1dd)][_0x4fc34a(0x1a3)],_0x1ae4df=await executePushSegmentDeletions(_0x1dc4ad,_0x43932b[_0x4fc34a(0x1a7)]?[]:_0x238904,_0xfcfed6);let _0x7a65fc=0x0,_0x1bb6fb=0x0,_0x123d78=0x0;const _0xbcc32a=new Map(_0x36fc4b);for(const [_0x37d50e,_0x5b4168]of _0x55cfdf[_0x4fc34a(0x16b)]){_0xbcc32a[_0x4fc34a(0x1c5)](_0x37d50e,_0x5b4168);}if(_0x5b444c['length']>0x0){const _0x248342={..._0x41bbd7,'segmentNameToId':_0xbcc32a,'existingSegments':_0x4e9626,'activationContext':_0xc031ec},_0x162fed=await executePushJourneys(_0x1dc4ad,_0x5b444c,_0x248342,{'parentId':_0x321572,'rootFolderId':_0x150c34,'verbose':_0x43932b[_0x4fc34a(0x187)]},_0xfcfed6);_0x7a65fc=_0x162fed[_0x4fc34a(0x176)],_0x1bb6fb=_0x162fed[_0x4fc34a(0x198)];if(_0xfb5acd&&_0x162fed[_0x4fc34a(0x1fc)]['length']===0x1){const _0xb7f1db=_0x162fed[_0x4fc34a(0x1fc)][0x0];if(_0xb7f1db[_0x4fc34a(0x1b4)]){const _0x38568e=getConsoleNextUrl(_0x43932b[_0x4fc34a(0x1cb)],'/app/ps/'+_0x321572+_0x4fc34a(0x195)+_0xb7f1db[_0x4fc34a(0x1b4)]+'/j/da/je');console[_0x4fc34a(0x182)]('\x20\x20'+a31_0x48dc70[_0x4fc34a(0x1b9)](_0x38568e));}}}for(const _0x4b1666 of _0x503a92){console['error'](a31_0x48dc70[_0x4fc34a(0x1f8)](_0x4fc34a(0x1d6)+_0x4b1666[_0x4fc34a(0x1a9)])),_0x123d78++;}const _0x500be5=[];if(_0x1295bc>0x0)_0x500be5['push'](_0x1295bc+'\x20created');if(_0x2ec254>0x0)_0x500be5['push'](_0x2ec254+_0x4fc34a(0x197));if(_0x1ae4df>0x0)_0x500be5[_0x4fc34a(0x1bf)](_0x1ae4df+_0x4fc34a(0x1a0));const _0x226140=[];if(_0x7a65fc>0x0)_0x226140[_0x4fc34a(0x1bf)](_0x7a65fc+_0x4fc34a(0x1f7));if(_0x1bb6fb>0x0)_0x226140[_0x4fc34a(0x1bf)](_0x1bb6fb+'\x20updated');if(_0x123d78>0x0)_0x226140['push'](_0x123d78+_0x4fc34a(0x1a0));const _0x194e90=[];if(_0x35011f>0x0)_0x194e90[_0x4fc34a(0x1bf)](_0x35011f+_0x4fc34a(0x1f7));if(_0x27416f>0x0)_0x194e90[_0x4fc34a(0x1bf)](_0x27416f+'\x20updated');if(_0x4f2fba>0x0)_0x194e90[_0x4fc34a(0x1bf)](_0x4f2fba+_0x4fc34a(0x1a0));return console['error'](a31_0x48dc70['green'](_0x4fc34a(0x19c))),_0x500be5[_0x4fc34a(0x1f9)]>0x0&&!_0x43932b['journeysOnly']&&console[_0x4fc34a(0x182)](_0x4fc34a(0x192)+_0x500be5[_0x4fc34a(0x1cf)](',\x20')),_0x226140[_0x4fc34a(0x1f9)]>0x0&&console[_0x4fc34a(0x182)]('\x20\x20Journeys:\x20'+_0x226140[_0x4fc34a(0x1cf)](',\x20')),_0x194e90['length']>0x0&&!_0x43932b[_0x4fc34a(0x1a7)]&&console[_0x4fc34a(0x182)](_0x4fc34a(0x1ad)+_0x194e90[_0x4fc34a(0x1cf)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x15cba0=a32_0x58a2;function a32_0xf976(){const _0x56ad2=['kind','✔\x20Updated\x20segment\x20\x27','rule','execute','segmentId','276941TOXILV','7377568UCFDqs','yellow','18483476mKZPaL','\x27...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentName','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','4777050vwKEzH','verbose','segment','Resolving\x20path\x20\x27','INTERNAL','7uXEPPI','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20folder\x20\x27','segment:update','Update\x20existing\x20child\x20segment','2ECsLzV','folder','1262468LGMQap','Segment\x20ID\x20missing\x20from\x20resolved\x20path','resolveFolderId','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','187794CdpNWj','600fvyLXQ','ruleFile','type','length','data','Error:\x20Cannot\x20update\x20','name','Segment\x20ID:\x20','Resolved\x20folder\x20ID:\x20','error','Resolved\x20type:\x20','description','40465UPITxi','segmentPath','3RhCKpe','resolvePathToResource'];a32_0xf976=function(){return _0x56ad2;};return a32_0xf976();}(function(_0x4f4361,_0x15e109){const _0x1a84b2=a32_0x58a2,_0x4a3345=_0x4f4361();while(!![]){try{const _0x421e14=-parseInt(_0x1a84b2(0x199))/0x1*(parseInt(_0x1a84b2(0x1ab))/0x2)+-parseInt(_0x1a84b2(0x192))/0x3*(parseInt(_0x1a84b2(0x1ad))/0x4)+-parseInt(_0x1a84b2(0x190))/0x5*(-parseInt(_0x1a84b2(0x184))/0x6)+-parseInt(_0x1a84b2(0x1a6))/0x7*(parseInt(_0x1a84b2(0x19a))/0x8)+-parseInt(_0x1a84b2(0x1b2))/0x9+-parseInt(_0x1a84b2(0x1a1))/0xa+parseInt(_0x1a84b2(0x19c))/0xb;if(_0x421e14===_0x15e109)break;else _0x4a3345['push'](_0x4a3345['shift']());}catch(_0x3b7fe7){_0x4a3345['push'](_0x4a3345['shift']());}}}(a32_0xf976,0x74483));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';import a32_0x319c1e from'chalk';function a32_0x58a2(_0x19b10c,_0x27efeb){_0x19b10c=_0x19b10c-0x184;const _0xf97633=a32_0xf976();let _0x58a242=_0xf97633[_0x19b10c];return _0x58a242;}export class SegmentUpdateCommand extends BaseCommand{[a32_0x15cba0(0x18a)]=a32_0x15cba0(0x1a9);[a32_0x15cba0(0x18f)]=a32_0x15cba0(0x1aa);async[a32_0x15cba0(0x197)](_0x40a034){const _0x480e77=a32_0x15cba0;console[_0x480e77(0x18d)](a32_0x319c1e[_0x480e77(0x19b)](_0x480e77(0x1b1))),console[_0x480e77(0x18d)](a32_0x319c1e[_0x480e77(0x19b)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x2bf6a3,args:_0x8b6f1c,tdx:_0x4b63c4}=_0x40a034,_0x532999=_0x2bf6a3;if(_0x8b6f1c[_0x480e77(0x187)]===0x0)return console[_0x480e77(0x18d)](_0x480e77(0x19e)),console[_0x480e77(0x18d)](_0x480e77(0x1a7)),console['error']('Examples:'),console[_0x480e77(0x18d)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x480e77(0x18d)](_0x480e77(0x1b0)),0x1;const _0x493483=_0x8b6f1c[0x0],_0x335615=_0x2bf6a3[_0x480e77(0x191)];let _0x3c492d=_0x493483;_0x335615&&!_0x493483['includes']('/')&&(_0x3c492d=_0x335615+'/'+_0x493483,_0x532999[_0x480e77(0x1a2)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x3c492d));const _0x334c86=await withSpinner(_0x480e77(0x1a4)+_0x3c492d+_0x480e77(0x19d),()=>_0x4b63c4[_0x480e77(0x1a3)][_0x480e77(0x193)](_0x3c492d),{'verbose':_0x532999[_0x480e77(0x1a2)]}),_0x239e66=_0x334c86[_0x480e77(0x188)];_0x532999[_0x480e77(0x1a2)]&&console['error'](_0x480e77(0x18e)+_0x239e66['type']);if(_0x239e66[_0x480e77(0x186)]!==_0x480e77(0x1a3))return console[_0x480e77(0x18d)](_0x480e77(0x189)+_0x239e66[_0x480e77(0x186)]+_0x480e77(0x1a0)),console[_0x480e77(0x18d)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x239e66[_0x480e77(0x198)])throw new SDKError(ErrorCode[_0x480e77(0x1a5)],_0x480e77(0x1ae));const _0x4f46d=_0x239e66['parentId'],_0x504db4=_0x239e66['segmentId'];_0x532999['verbose']&&(console[_0x480e77(0x18d)]('Parent\x20ID:\x20'+_0x4f46d),console['error'](_0x480e77(0x18b)+_0x504db4));let _0x228316;if(_0x532999[_0x480e77(0x1ac)]){const _0x5ab061=_0x532999[_0x480e77(0x1ac)],_0x437b14=await withSpinner(_0x480e77(0x1a8)+_0x5ab061+_0x480e77(0x19d),()=>_0x4b63c4['segment'][_0x480e77(0x1af)](_0x4f46d,_0x5ab061),{'verbose':_0x532999['verbose']});_0x228316=parseInt(_0x437b14[_0x480e77(0x188)],0xa),_0x532999[_0x480e77(0x1a2)]&&console['error'](_0x480e77(0x18c)+_0x228316);}const _0xeeacea=await loadJSONFromOptions(_0x532999[_0x480e77(0x196)],_0x532999[_0x480e77(0x185)]),_0x18091d={'name':_0x532999[_0x480e77(0x18a)],'description':_0x532999['description'],'rule':_0xeeacea,'kind':_0x532999['kind']!==undefined?parseInt(_0x532999[_0x480e77(0x194)],0xa):undefined,'segmentFolderId':_0x228316},_0x209f63=await withSpinner('Updating\x20segment\x20\x27'+_0x239e66[_0x480e77(0x19f)]+_0x480e77(0x19d),()=>_0x4b63c4[_0x480e77(0x1a3)]['updateSegmentById'](_0x4f46d,_0x504db4,_0x18091d),{'verbose':_0x532999[_0x480e77(0x1a2)]}),_0x35e550=_0x209f63[_0x480e77(0x188)];return console[_0x480e77(0x18d)](_0x480e77(0x195)+_0x35e550[_0x480e77(0x18a)]+'\x27'),_0x3c492d!==_0x493483&&console[_0x480e77(0x18d)]('\x20\x20\x20Path:\x20'+_0x3c492d),await handleSDKOutput([_0x35e550],_0x532999),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a33_0x457c(){const _0x202e8d=['Resolved\x20path\x20type:\x20','parent_segment','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','segment','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','site','Resolving\x20path\x20\x27','cyan','4407004vVulrm','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','dim','5799150QELqMV','segment:use','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','✔\x20Context\x20set\x20to:\x20','29941703mFSJTn','8spDyqI','2073960wTcdOa','4644CberQd','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','execute','Use:\x20tdx\x20segment\x20use\x20','Site:\x20','data','fullPath','split','session','verbose','folderPath','name','resolvePathToResource','red','isDirectory','Resolved\x20relative\x20path\x20to:\x20','parentName','folderId','4409154joKOEn','description','1716jgWNTy','\x27...','isAbsolute','log','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','join','10TXSOVz','2534OZIBsW','53fbSzGc','length','error','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Error:\x20Path\x20is\x20required\x0a','segments','slice','Examples:','Usage:\x20tdx\x20segment\x20use\x20<path>','type'];a33_0x457c=function(){return _0x202e8d;};return a33_0x457c();}const a33_0x755f1d=a33_0x3c3d;(function(_0x5b5861,_0x17f993){const _0x9f4129=a33_0x3c3d,_0x547989=_0x5b5861();while(!![]){try{const _0x36811a=-parseInt(_0x9f4129(0x1aa))/0x1*(parseInt(_0x9f4129(0x1a9))/0x2)+parseInt(_0x9f4129(0x1c8))/0x3*(-parseInt(_0x9f4129(0x1a2))/0x4)+parseInt(_0x9f4129(0x1c7))/0x5+-parseInt(_0x9f4129(0x1a0))/0x6+parseInt(_0x9f4129(0x1bd))/0x7*(-parseInt(_0x9f4129(0x1c6))/0x8)+-parseInt(_0x9f4129(0x1c0))/0x9+parseInt(_0x9f4129(0x1a8))/0xa*(parseInt(_0x9f4129(0x1c5))/0xb);if(_0x36811a===_0x17f993)break;else _0x547989['push'](_0x547989['shift']());}catch(_0x2b2afd){_0x547989['push'](_0x547989['shift']());}}}(a33_0x457c,0x60dc5));import{existsSync,statSync}from'fs';import a33_0x56420e from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a33_0x3c3d(_0x53dd77,_0x14a659){_0x53dd77=_0x53dd77-0x18f;const _0x457cce=a33_0x457c();let _0x3c3d10=_0x457cce[_0x53dd77];return _0x3c3d10;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x755f1d(0x199)]=a33_0x755f1d(0x1c1);[a33_0x755f1d(0x1a1)]=a33_0x755f1d(0x1b6);async[a33_0x755f1d(0x190)](_0x49a0e8){const _0x453aed=a33_0x755f1d,{options:_0x2af7af,args:_0x1038d7,tdx:_0x306d6d}=_0x49a0e8;if(_0x1038d7[_0x453aed(0x1ab)]===0x0)return console[_0x453aed(0x1ac)](a33_0x56420e[_0x453aed(0x19b)](_0x453aed(0x1ae))),console[_0x453aed(0x1ac)](_0x453aed(0x1b2)),console[_0x453aed(0x1ac)](_0x453aed(0x1b1)),console[_0x453aed(0x1ac)](_0x453aed(0x1c3)),console[_0x453aed(0x1ac)](_0x453aed(0x1b9)),console[_0x453aed(0x1ac)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error']('\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 _0x316b58=_0x1038d7[0x0],_0x3e59af=_0x2af7af[_0x453aed(0x196)];try{if(_0x316b58==='/')return saveSessionContext({'segment_path':undefined},_0x3e59af),console['log'](a33_0x56420e['green'](_0x453aed(0x1a6))),0x0;if(existsSync(_0x316b58)&&statSync(_0x316b58)[_0x453aed(0x19c)]()){let _0x5780d3;try{_0x5780d3=findTdxConfig(_0x316b58);}catch{return console[_0x453aed(0x1ac)](a33_0x56420e[_0x453aed(0x19b)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x316b58)),console[_0x453aed(0x1ac)](a33_0x56420e['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0xc7d21=_0x5780d3['config'][_0x453aed(0x1b5)];return saveSessionContext({'segment_path':_0xc7d21,'parent_segment':_0xc7d21},_0x3e59af),console['log'](a33_0x56420e[_0x453aed(0x1b8)](_0x453aed(0x1c4)+a33_0x56420e[_0x453aed(0x1bc)](_0xc7d21))),0x0;}const _0x2ae4cc=_0x2af7af['segmentPath'];let _0x6c0659=_0x316b58;const _0x1dcd72=parsePath(_0x316b58);if(!_0x1dcd72[_0x453aed(0x1a4)]){if(!_0x2ae4cc)return console[_0x453aed(0x1ac)](a33_0x56420e['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x453aed(0x1ac)](a33_0x56420e[_0x453aed(0x1bc)](_0x453aed(0x1be))),0x1;if(_0x316b58==='..'){const _0x15ed66=_0x2ae4cc[_0x453aed(0x195)]('/')[_0x453aed(0x1b0)](0x0,-0x1)[_0x453aed(0x1a7)]('/');_0x6c0659=_0x15ed66||'/';}else _0x316b58==='.'?_0x6c0659=_0x2ae4cc:_0x6c0659=_0x2ae4cc+'/'+_0x316b58;_0x2af7af['verbose']&&console['error'](_0x453aed(0x19d)+_0x6c0659);}if(_0x6c0659==='/'||_0x6c0659==='')return saveSessionContext({'segment_path':undefined},_0x3e59af),console['log'](a33_0x56420e[_0x453aed(0x1b8)](_0x453aed(0x1a6))),0x0;_0x6c0659=normalizePath(_0x6c0659);const _0xe7a47e=parsePath(_0x6c0659)[_0x453aed(0x1af)];if(_0xe7a47e['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3e59af),console[_0x453aed(0x1a5)](a33_0x56420e[_0x453aed(0x1b8)](_0x453aed(0x1a6))),0x0;_0x2af7af['verbose']&&(console[_0x453aed(0x1ac)](_0x453aed(0x192)+_0x2af7af[_0x453aed(0x1ba)]),console['error']('Target\x20path:\x20'+_0x6c0659));const _0x2c209b=await withSpinner(_0x453aed(0x1bb)+_0x6c0659+_0x453aed(0x1a3),()=>_0x306d6d[_0x453aed(0x1b7)][_0x453aed(0x19a)](_0x6c0659),{'verbose':_0x2af7af[_0x453aed(0x197)]}),_0x10df78=_0x2c209b[_0x453aed(0x193)];_0x2af7af[_0x453aed(0x197)]&&(console[_0x453aed(0x1ac)](_0x453aed(0x1b4)+_0x10df78['type']),console[_0x453aed(0x1ac)]('Parent\x20ID:\x20'+_0x10df78['parentId']),_0x10df78[_0x453aed(0x19f)]&&console[_0x453aed(0x1ac)]('Folder\x20ID:\x20'+_0x10df78[_0x453aed(0x19f)]));if(_0x10df78[_0x453aed(0x1b3)]===_0x453aed(0x1b7))return console['error'](a33_0x56420e[_0x453aed(0x19b)](_0x453aed(0x18f))),console['error'](_0x453aed(0x1c2)),console[_0x453aed(0x1ac)](a33_0x56420e[_0x453aed(0x1bc)](_0x453aed(0x191)+_0x10df78[_0x453aed(0x19e)]+(_0x10df78[_0x453aed(0x198)]?'/'+_0x10df78[_0x453aed(0x198)][_0x453aed(0x1a7)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x10df78[_0x453aed(0x194)],'parent_segment':_0x10df78[_0x453aed(0x19e)]},_0x3e59af),console[_0x453aed(0x1a5)](a33_0x56420e[_0x453aed(0x1b8)](_0x453aed(0x1c4)+a33_0x56420e[_0x453aed(0x1bc)](_0x10df78[_0x453aed(0x194)]))),_0x2af7af[_0x453aed(0x197)]&&(console['error'](a33_0x56420e[_0x453aed(0x1bf)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x453aed(0x1ac)](a33_0x56420e['dim'](_0x453aed(0x1ad)))),0x0;}catch(_0x47dc61){throw _0x47dc61;}}}
|