@treasuredata/tdx 0.14.3 β 0.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +0 -4
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts +1 -1
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.d.ts +18 -0
- package/dist/commands/unset-command.d.ts.map +1 -0
- package/dist/commands/unset-command.js +1 -0
- package/dist/commands/unset-command.js.map +1 -0
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +18 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +11 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts +25 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.d.ts +3 -0
- package/dist/utils/spinner.d.ts.map +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/spinner.js.map +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x288065=a25_0x561c;(function(_0x1911e8,_0x330b18){const _0x2686ad=a25_0x561c,_0x5b6cc3=_0x1911e8();while(!![]){try{const _0x10fdaa=parseInt(_0x2686ad(0x1c7))/0x1+-parseInt(_0x2686ad(0x221))/0x2+parseInt(_0x2686ad(0x229))/0x3+parseInt(_0x2686ad(0x201))/0x4*(-parseInt(_0x2686ad(0x21a))/0x5)+-parseInt(_0x2686ad(0x1e5))/0x6*(parseInt(_0x2686ad(0x215))/0x7)+parseInt(_0x2686ad(0x1e3))/0x8+parseInt(_0x2686ad(0x1bd))/0x9;if(_0x10fdaa===_0x330b18)break;else _0x5b6cc3['push'](_0x5b6cc3['shift']());}catch(_0x48d37e){_0x5b6cc3['push'](_0x5b6cc3['shift']());}}}(a25_0x3390,0x49b00));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x3e730a from'chalk';async function resolveSegmentTarget(_0x38ac81,_0x470330,_0x5a0800){const _0x16e07c=a25_0x561c;if(isYamlFilePath(_0x38ac81))try{const _0x31ab08=await resolveYamlFilePath(_0x38ac81);return _0x5a0800&&(console[_0x16e07c(0x202)](_0x16e07c(0x1ee)+_0x38ac81),console[_0x16e07c(0x202)](_0x16e07c(0x1ed)+_0x31ab08[_0x16e07c(0x21b)]),console[_0x16e07c(0x202)](_0x16e07c(0x21f)+_0x31ab08['segmentName']),console[_0x16e07c(0x202)]('\x20\x20Folder\x20path:\x20'+(_0x31ab08['folderPath']||_0x16e07c(0x1bf))),console[_0x16e07c(0x202)]('\x20\x20Full\x20path:\x20'+_0x31ab08[_0x16e07c(0x1dc)])),_0x31ab08[_0x16e07c(0x1dc)];}catch(_0x9d9f10){throw new SDKError(ErrorCode[_0x16e07c(0x1d8)],_0x16e07c(0x242)+_0x9d9f10['message']);}if(!_0x470330)throw new SDKError(ErrorCode[_0x16e07c(0x1d8)],_0x16e07c(0x217));return _0x470330+'/'+_0x38ac81;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:describe';['description']=a25_0x288065(0x234);async[a25_0x288065(0x222)](_0x159c23){const _0x175344=a25_0x288065,{options:_0xcb18d7,args:_0x5b8c7e,tdx:_0x177bff}=_0x159c23,_0x1caa22=_0x5b8c7e[0x0],_0x160cb4=!_0x1caa22&&!!_0xcb18d7[_0x175344(0x21b)],_0xb9b95d=_0x1caa22||_0xcb18d7[_0x175344(0x21b)];if(!_0xb9b95d)return console[_0x175344(0x202)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x175344(0x202)](_0x175344(0x20d)),console[_0x175344(0x202)](_0x175344(0x211)),console[_0x175344(0x202)](_0x175344(0x1f2)),console[_0x175344(0x202)](_0x175344(0x246)),console[_0x175344(0x202)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x175344(0x202)](_0x175344(0x23d)),0x1;try{const _0x384af8=_0xcb18d7['segmentPath'];let _0x2b7af6=_0xb9b95d;!_0x160cb4&&_0x384af8&&!_0xb9b95d['includes']('/')&&(_0x2b7af6=_0x384af8+'/'+_0xb9b95d,_0xcb18d7['verbose']&&console[_0x175344(0x202)](_0x175344(0x1d2)+_0x2b7af6));const _0x5d70a8=await withSpinner(_0x175344(0x22f)+_0x2b7af6+_0x175344(0x1f4),()=>_0x177bff[_0x175344(0x20c)][_0x175344(0x1c6)](_0x2b7af6),{'verbose':_0xcb18d7[_0x175344(0x1e0)]}),_0x2f1ff8=_0x5d70a8[_0x175344(0x23a)];_0xcb18d7['verbose']&&(console[_0x175344(0x202)]('Resolved\x20type:\x20'+_0x2f1ff8['type']),console[_0x175344(0x202)](_0x175344(0x22c)+_0x2f1ff8[_0x175344(0x24e)]),_0x2f1ff8[_0x175344(0x243)]&&console[_0x175344(0x202)](_0x175344(0x1e2)+_0x2f1ff8[_0x175344(0x243)]),_0x2f1ff8[_0x175344(0x1ba)]&&console['error']('Segment\x20ID:\x20'+_0x2f1ff8[_0x175344(0x1ba)]));if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x255)){const _0x2faf37=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x177bff['segment'][_0x175344(0x1cc)](_0x2f1ff8['parentId']),{'verbose':_0xcb18d7[_0x175344(0x1e0)]});await handleSingleObjectOutput(_0x2faf37[_0x175344(0x23a)],_0xcb18d7);}else{if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x227)){if(!_0x2f1ff8[_0x175344(0x243)])throw new SDKError(ErrorCode[_0x175344(0x216)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5f2ca5=await withSpinner(_0x175344(0x1d1),()=>_0x177bff[_0x175344(0x20c)][_0x175344(0x1dd)](_0x2f1ff8['folderId']),{'verbose':_0xcb18d7[_0x175344(0x1e0)]});await handleSingleObjectOutput(_0x5f2ca5['data'],_0xcb18d7);}else{if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x20c)){if(!_0x2f1ff8[_0x175344(0x1ba)])throw new SDKError(ErrorCode[_0x175344(0x251)],_0x175344(0x23e));const _0x548ef3=await withSpinner('Fetching\x20segment\x20details...',()=>_0x177bff[_0x175344(0x20c)]['getSegment'](_0x2f1ff8[_0x175344(0x24e)],_0x2f1ff8['segmentId']),{'verbose':_0xcb18d7['verbose']});await handleSingleObjectOutput(_0x548ef3[_0x175344(0x23a)],_0xcb18d7);}}}return 0x0;}catch(_0x3b82dc){if(_0x3b82dc instanceof SDKError)return console['error'](_0x175344(0x1c5)+_0x3b82dc[_0x175344(0x256)]),_0x3b82dc[_0x175344(0x232)]&&console[_0x175344(0x202)]('\x20\x20Cause:\x20'+_0x3b82dc[_0x175344(0x232)]),0x1;throw _0x3b82dc;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:show';['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a25_0x288065(0x222)](_0x3a9e93){const _0x1e8107=a25_0x288065,{options:_0x5ae287,args:_0x87f429,tdx:_0xdc1ee9}=_0x3a9e93,_0x9aad9f=_0x87f429[0x0];if(!_0x9aad9f)return console[_0x1e8107(0x202)](_0x1e8107(0x24d)),console['error'](_0x1e8107(0x1c8)),console[_0x1e8107(0x202)](_0x1e8107(0x1de)),console[_0x1e8107(0x202)](_0x1e8107(0x211)),console[_0x1e8107(0x202)](_0x1e8107(0x213)),console[_0x1e8107(0x202)](_0x1e8107(0x23f)),0x1;try{const _0x365e08=_0x5ae287[_0x1e8107(0x21b)],_0x1863af=await resolveSegmentTarget(_0x9aad9f,_0x365e08,_0x5ae287[_0x1e8107(0x1e0)]);_0x5ae287['verbose']&&console[_0x1e8107(0x202)](_0x1e8107(0x1fb)+_0x1863af);const _0x146ccd=await withSpinner(_0x1e8107(0x1ce)+_0x9aad9f+_0x1e8107(0x1f4),()=>_0xdc1ee9[_0x1e8107(0x20c)][_0x1e8107(0x1c6)](_0x1863af),{'verbose':_0x5ae287['verbose']}),_0x3351ea=_0x146ccd[_0x1e8107(0x23a)];_0x5ae287[_0x1e8107(0x1e0)]&&(console[_0x1e8107(0x202)](_0x1e8107(0x1f1)+_0x3351ea[_0x1e8107(0x1c1)]),console[_0x1e8107(0x202)](_0x1e8107(0x22c)+_0x3351ea[_0x1e8107(0x24e)]));if(_0x3351ea['type']===_0x1e8107(0x227))return console['error'](_0x1e8107(0x1e4)),console[_0x1e8107(0x202)](_0x1e8107(0x1d4)),0x1;if(_0x3351ea[_0x1e8107(0x1c1)]===_0x1e8107(0x255))return console[_0x1e8107(0x202)](_0x1e8107(0x205)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x3351ea['segmentId'])throw new SDKError(ErrorCode[_0x1e8107(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2e6f18=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0xdc1ee9[_0x1e8107(0x20c)][_0x1e8107(0x1cf)](_0x3351ea[_0x1e8107(0x24e)],_0x3351ea[_0x1e8107(0x1ba)]),{'verbose':_0x5ae287[_0x1e8107(0x1e0)]});let _0x4d1cff=_0x2e6f18['data'];const _0x1c4d8c=resolveLimit(_0x5ae287['limit'],DEFAULT_DISPLAY_LIMIT),_0x87c235=/\bLIMIT\s+\d+/i[_0x1e8107(0x241)](_0x4d1cff);!_0x87c235&&(_0x4d1cff=_0x4d1cff[_0x1e8107(0x248)]()[_0x1e8107(0x239)](/;+$/,''),_0x4d1cff='SELECT\x20*\x20FROM\x20(\x0a'+_0x4d1cff+_0x1e8107(0x1c0)+_0x1c4d8c);_0x5ae287[_0x1e8107(0x1e0)]&&console[_0x1e8107(0x202)](_0x1e8107(0x1fc)+_0x4d1cff);const _0x357cb9=await withProgressSpinner(_0x1e8107(0x1ec),async _0xebec26=>{const _0x60c046=_0x1e8107,_0x1bba4b=await _0xdc1ee9[_0x60c046(0x22d)][_0x60c046(0x222)](_0x4d1cff,{'catalog':'td','schema':'information_schema','onJobId':_0x55acc7=>{const _0x24c358=_0x60c046;_0xebec26[_0x24c358(0x1da)](_0x55acc7);}});return _0x1bba4b;},{'verbose':_0x5ae287[_0x1e8107(0x1e0)]}),_0x52b71b=_0x357cb9[_0x1e8107(0x23a)],_0x1086bc=_0x52b71b[_0x1e8107(0x230)]?_0x1e8107(0x1c9)+_0x52b71b[_0x1e8107(0x230)]+']':'';return console['error'](_0x1e8107(0x219)+_0x52b71b[_0x1e8107(0x24f)]['processedRows'][_0x1e8107(0x1f7)]()+_0x1e8107(0x1e6)+(_0x1e8107(0x226)+formatElapsed(_0x52b71b[_0x1e8107(0x24f)][_0x1e8107(0x231)])+_0x1086bc)),await handleQueryOutput(_0x52b71b,_0x5ae287),0x0;}catch(_0x2516d4){if(_0x2516d4 instanceof SDKError)return console[_0x1e8107(0x202)](_0x1e8107(0x24a)+_0x2516d4[_0x1e8107(0x1d0)]+']'),console[_0x1e8107(0x202)]('\x0a'+_0x2516d4[_0x1e8107(0x256)]),0x1;throw _0x2516d4;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1f9);[a25_0x288065(0x1e8)]=a25_0x288065(0x1fa);async[a25_0x288065(0x222)](_0x3e9d03){const _0x24a281=a25_0x288065,{options:_0x12c926,args:_0x1e6038,tdx:_0x42e274}=_0x3e9d03;if(_0x1e6038[_0x24a281(0x210)]===0x0)return console['error'](_0x24a281(0x1ca)),console['error'](_0x24a281(0x20e)),0x1;const _0x1dc154=_0x1e6038[0x0];try{_0x12c926[_0x24a281(0x1e0)]&&(console['error'](_0x24a281(0x1d6)+_0x12c926[_0x24a281(0x235)]),console[_0x24a281(0x202)](_0x24a281(0x21d)+_0x1dc154));const _0x5bc0a8=await withSpinner(_0x24a281(0x250)+_0x1dc154+_0x24a281(0x1f4),()=>_0x42e274[_0x24a281(0x20c)][_0x24a281(0x21e)](_0x1dc154),{'verbose':_0x12c926['verbose']}),_0x2b724f=_0x5bc0a8['data'];_0x12c926[_0x24a281(0x1e0)]&&console[_0x24a281(0x202)](_0x24a281(0x220)+_0x2b724f);const _0x5738e4=await withSpinner(_0x24a281(0x1e7)+_0x1dc154+_0x24a281(0x1f4),()=>_0x42e274['segment'][_0x24a281(0x206)](_0x2b724f),{'verbose':_0x12c926[_0x24a281(0x1e0)]}),_0x41500f=_0x5738e4[_0x24a281(0x23a)];return console[_0x24a281(0x202)](_0x24a281(0x24c)+_0x41500f['length']+_0x24a281(0x237)+(_0x41500f[_0x24a281(0x210)]!==0x1?'s':'')),await handleSDKOutput(_0x41500f,_0x12c926),0x0;}catch(_0x28cdfc){if(_0x28cdfc instanceof SDKError)return console[_0x24a281(0x202)](_0x24a281(0x1c5)+_0x28cdfc[_0x24a281(0x256)]),_0x28cdfc[_0x24a281(0x232)]&&console[_0x24a281(0x202)](_0x24a281(0x1ff)+_0x28cdfc[_0x24a281(0x232)]),0x1;throw _0x28cdfc;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:folder:show';['description']=a25_0x288065(0x1c3);async[a25_0x288065(0x222)](_0x236bc7){const _0x32ade6=a25_0x288065,{options:_0x1e3408,args:_0x113c7b,tdx:_0x4a47a3}=_0x236bc7;if(_0x113c7b[_0x32ade6(0x210)]===0x0)return console[_0x32ade6(0x202)](_0x32ade6(0x1f0)),console['error'](_0x32ade6(0x253)),0x1;try{const {parentId:_0xf38790,childId:_0x5176a8}=parseSegmentRef(_0x113c7b[0x0]);_0x1e3408['verbose']&&(console[_0x32ade6(0x202)](_0x32ade6(0x1d6)+_0x1e3408['site']),console[_0x32ade6(0x202)](_0x32ade6(0x21d)+_0xf38790),_0x5176a8&&console[_0x32ade6(0x202)](_0x32ade6(0x23b)+_0x5176a8));if(!_0x5176a8)return console[_0x32ade6(0x202)](_0x32ade6(0x1ea)),0x1;const _0x4cfc9a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf38790+_0x32ade6(0x1f4),()=>_0x4a47a3[_0x32ade6(0x20c)][_0x32ade6(0x21e)](_0xf38790),{'verbose':_0x1e3408[_0x32ade6(0x1e0)]}),_0x8c003=_0x4cfc9a['data'];_0x1e3408[_0x32ade6(0x1e0)]&&console[_0x32ade6(0x202)](_0x32ade6(0x220)+_0x8c003);const _0x487055=await withSpinner(_0x32ade6(0x257)+_0x5176a8+_0x32ade6(0x1f4),()=>_0x4a47a3[_0x32ade6(0x20c)][_0x32ade6(0x224)](_0x8c003,_0x5176a8),{'verbose':_0x1e3408[_0x32ade6(0x1e0)]}),_0x23726e=_0x487055['data'];_0x1e3408[_0x32ade6(0x1e0)]&&console[_0x32ade6(0x202)](_0x32ade6(0x1f3)+_0x23726e);const _0x312c46=await withSpinner(_0x32ade6(0x209)+_0x5176a8+'\x27...',()=>_0x4a47a3[_0x32ade6(0x20c)]['getFolder'](_0x23726e),{'verbose':_0x1e3408['verbose']});return await handleSDKOutput([_0x312c46['data']],_0x1e3408),0x0;}catch(_0x374fd4){if(_0x374fd4 instanceof SDKError)return console[_0x32ade6(0x202)](_0x32ade6(0x1c5)+_0x374fd4[_0x32ade6(0x256)]),_0x374fd4['cause']&&console[_0x32ade6(0x202)](_0x32ade6(0x1ff)+_0x374fd4[_0x32ade6(0x232)]),0x1;throw _0x374fd4;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1e1);[a25_0x288065(0x1e8)]=a25_0x288065(0x1f6);async[a25_0x288065(0x222)](_0x4631fa){const _0x5d660d=a25_0x288065,{options:_0x20b2cc,args:_0x1f1b3e,tdx:_0x56a761}=_0x4631fa,_0x528dbf=_0x1f1b3e[0x0];if(!_0x528dbf)return console[_0x5d660d(0x202)](_0x5d660d(0x24d)),console[_0x5d660d(0x202)](_0x5d660d(0x204)),console[_0x5d660d(0x202)](_0x5d660d(0x245)),console[_0x5d660d(0x202)]('Examples:'),console[_0x5d660d(0x202)](_0x5d660d(0x1c2)),console['error'](_0x5d660d(0x247)),0x1;try{const _0x4b694d=_0x20b2cc[_0x5d660d(0x21b)],_0x1c45b0=await resolveSegmentTarget(_0x528dbf,_0x4b694d,_0x20b2cc[_0x5d660d(0x1e0)]);_0x20b2cc[_0x5d660d(0x1e0)]&&console[_0x5d660d(0x202)](_0x5d660d(0x1fb)+_0x1c45b0);const _0x257987=await withSpinner(_0x5d660d(0x1ce)+_0x528dbf+_0x5d660d(0x1f4),()=>_0x56a761[_0x5d660d(0x20c)]['resolvePathToResource'](_0x1c45b0),{'verbose':_0x20b2cc[_0x5d660d(0x1e0)]}),_0x463f2d=_0x257987[_0x5d660d(0x23a)];_0x20b2cc[_0x5d660d(0x1e0)]&&(console['error'](_0x5d660d(0x1f1)+_0x463f2d[_0x5d660d(0x1c1)]),console[_0x5d660d(0x202)](_0x5d660d(0x22c)+_0x463f2d['parentId']));if(_0x463f2d[_0x5d660d(0x1c1)]===_0x5d660d(0x227))return console[_0x5d660d(0x202)](_0x5d660d(0x207)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x463f2d['type']===_0x5d660d(0x255))return console[_0x5d660d(0x202)](_0x5d660d(0x1cb)),console[_0x5d660d(0x202)](_0x5d660d(0x252)),0x1;if(!_0x463f2d['segmentId'])throw new SDKError(ErrorCode[_0x5d660d(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x43d052=await withSpinner(_0x5d660d(0x214),()=>_0x56a761['segment'][_0x5d660d(0x1cf)](_0x463f2d['parentId'],_0x463f2d[_0x5d660d(0x1ba)]),{'verbose':_0x20b2cc[_0x5d660d(0x1e0)]}),_0x5551c3=_0x43d052['data'];return _0x20b2cc['format']===_0x5d660d(0x1f8)||_0x20b2cc['format']==='jsonl'?await handleSDKOutput([{'sql':_0x5551c3}],_0x20b2cc):console[_0x5d660d(0x1be)](_0x5551c3),0x0;}catch(_0x3abf40){if(_0x3abf40 instanceof SDKError)return console[_0x5d660d(0x202)](_0x5d660d(0x1c5)+_0x3abf40['message']),_0x3abf40['cause']&&console[_0x5d660d(0x202)](_0x5d660d(0x1ff)+_0x3abf40[_0x5d660d(0x232)]),0x1;throw _0x3abf40;}}}function a25_0x561c(_0x1f2e15,_0x2c7ece){_0x1f2e15=_0x1f2e15-0x1ba;const _0x3390d2=a25_0x3390();let _0x561ccc=_0x3390d2[_0x1f2e15];return _0x561ccc;}function a25_0x3390(){const _0xaaf216=['Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','18AywYBH','\x20rows\x20','Listing\x20folders\x20for\x20parent\x20\x27','description','segment:folder:create','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','/app/ps/','Executing\x20segment\x20query...','\x20\x20Parent\x20segment:\x20','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolved\x20folder\x20ID:\x20','\x27...','β\x20Created\x20folder\x20\x27','Get\x20SQL\x20query\x20for\x20child\x20segment','toLocaleString','json','segment:folder:list','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Target\x20path:\x20','SQL\x20query:\x0a','/e/','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Cause:\x20','Creating\x20folder\x20\x27','4qduKCL','error','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','listFolders','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','getSegment','Fetching\x20folder\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','segment','Usage:\x20tdx\x20segment\x20describe\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','length','Examples:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Fetching\x20SQL\x20for\x20segment...','813491AUBTKB','SEGMENT_FOLDER_NOT_FOUND','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','β\x20Query\x20completed:\x20Processed\x20','467165eyoeEd','parentSegment','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Parent\x20name:\x20','resolveParentId','\x20\x20Segment\x20name:\x20','Resolved\x20parent\x20ID:\x20','398588LzTIif','execute','Options:','resolveFolderId','Resolving\x20parent\x20folder\x20\x27','in\x20','folder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','1281207RzKmEL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','green','Parent\x20ID:\x20','query','Segment\x20ID:\x20','Resolving\x20path\x20\x27','jobId','elapsedTimeMillis','cause','name','Show\x20segment\x20or\x20folder\x20details','site','parentFolder','\x20folder','Fetching\x20segment\x20details...','replace','data','Folder\x20name:\x20','\x20Opening\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','test','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','folderId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','trim','Usage:\x20tdx\x20sg\x20desc\x20<name>','β\x20Query\x20failed\x20[','Show\x20folder\x20or\x20child\x20segment\x20details','β\x20Found\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','parentId','stats','Resolving\x20parent\x20segment\x20\x27','SEGMENT_NOT_FOUND','Use:\x20tdx\x20ps\x20sql','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Use:\x20tdx\x20ps\x20view','parent','message','Resolving\x20folder\x20\x27','segmentId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','cyan','1436589UZhtsa','log','(root)','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','type','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20','resolvePathToResource','272570OYIAAP','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20[Job\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','getParent','Create\x20segment\x20folder\x20for\x20organization','Resolving\x20\x27','getSegmentSQL','code','Fetching\x20folder\x20details...','Resolved\x20relative\x20path\x20to:\x20','url','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment:desc','Site:\x20','Resolved\x20parent\x20folder\x20ID:\x20','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','setJobId','Parent\x20segment:\x20','fullPath','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x27\x20with\x20ID:\x20','verbose','segment:sql','Folder\x20ID:\x20','671440ktdJhU'];a25_0x3390=function(){return _0xaaf216;};return a25_0x3390();}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x288065(0x1e9);[a25_0x288065(0x1e8)]=a25_0x288065(0x1cd);async[a25_0x288065(0x222)](_0x5d4598){const _0x25807b=a25_0x288065,{options:_0x68defc,args:_0x12be7b,tdx:_0x4bb95d}=_0x5d4598,_0xb3406b=_0x68defc;if(_0x12be7b[_0x25807b(0x210)]<0x2)return console['error'](_0x25807b(0x244)),console[_0x25807b(0x202)](_0x25807b(0x1bb)),0x1;const _0x53e814=_0x12be7b[0x0],_0x100f43=_0x12be7b[0x1];_0xb3406b[_0x25807b(0x1e0)]&&(console['error'](_0x25807b(0x1d6)+_0xb3406b[_0x25807b(0x235)]),console['error'](_0x25807b(0x1db)+_0x53e814),console[_0x25807b(0x202)]('Folder\x20name:\x20'+_0x100f43));let _0x541d79;if(_0xb3406b['parentFolder']){const _0xf3b569=_0xb3406b[_0x25807b(0x236)],_0x52ab34=await withSpinner(_0x25807b(0x250)+_0x53e814+_0x25807b(0x1f4),()=>_0x4bb95d['segment']['resolveParentId'](_0x53e814),{'verbose':_0xb3406b[_0x25807b(0x1e0)]}),_0x5c3d80=_0x52ab34[_0x25807b(0x23a)],_0x123f26=await withSpinner(_0x25807b(0x225)+_0xf3b569+_0x25807b(0x1f4),()=>_0x4bb95d[_0x25807b(0x20c)]['resolveFolderId'](_0x5c3d80,_0xf3b569),{'verbose':_0xb3406b[_0x25807b(0x1e0)]});_0x541d79=_0x123f26[_0x25807b(0x23a)],_0xb3406b[_0x25807b(0x1e0)]&&console['error'](_0x25807b(0x1d7)+_0x541d79);}const _0x9a1b44={'name':_0x100f43,'description':_0xb3406b['description'],'parentFolderId':_0x541d79},_0x4656b1=await withSpinner(_0x25807b(0x200)+_0x100f43+_0x25807b(0x1f4),()=>_0x4bb95d[_0x25807b(0x20c)]['createFolder'](_0x53e814,_0x9a1b44),{'verbose':_0xb3406b[_0x25807b(0x1e0)]}),_0x50e522=_0x4656b1['data'];return console[_0x25807b(0x202)](_0x25807b(0x1f5)+_0x50e522[_0x25807b(0x233)]+_0x25807b(0x1df)+_0x50e522['id']),await handleSDKOutput([_0x50e522],_0xb3406b),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:view';[a25_0x288065(0x1e8)]=a25_0x288065(0x24b);async[a25_0x288065(0x222)](_0xc79376){const _0x474c9e=a25_0x288065,{options:_0x3a1052,args:_0x456311,tdx:_0x54ea9d}=_0xc79376,_0xf9cc2=_0x456311[0x0];if(!_0xf9cc2)return console[_0x474c9e(0x202)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x474c9e(0x202)](_0x474c9e(0x203)),console['error'](_0x474c9e(0x22a)),console[_0x474c9e(0x202)](_0x474c9e(0x223)),console['error'](_0x474c9e(0x20a)),console[_0x474c9e(0x202)]('Examples:'),console['error'](_0x474c9e(0x1ef)),console[_0x474c9e(0x202)](_0x474c9e(0x21c)),console['error'](_0x474c9e(0x240)),console[_0x474c9e(0x202)](_0x474c9e(0x1c4)),0x1;try{const _0x329212=_0x3a1052[_0x474c9e(0x21b)],_0x1b2181=await resolveSegmentTarget(_0xf9cc2,_0x329212,_0x3a1052[_0x474c9e(0x1e0)]);_0x3a1052[_0x474c9e(0x1e0)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1fb)+_0x1b2181);const _0x4a67f1=await withSpinner(_0x474c9e(0x1ce)+_0xf9cc2+_0x474c9e(0x1f4),()=>_0x54ea9d['segment']['resolvePathToResource'](_0x1b2181),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]}),_0x38b0a2=_0x4a67f1[_0x474c9e(0x23a)];_0x3a1052[_0x474c9e(0x1e0)]&&(console['error']('Resolved\x20type:\x20'+_0x38b0a2[_0x474c9e(0x1c1)]),console[_0x474c9e(0x202)](_0x474c9e(0x22c)+_0x38b0a2[_0x474c9e(0x24e)]),_0x38b0a2[_0x474c9e(0x243)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1e2)+_0x38b0a2[_0x474c9e(0x243)]),_0x38b0a2['segmentId']&&console['error'](_0x474c9e(0x22e)+_0x38b0a2[_0x474c9e(0x1ba)]));if(_0x3a1052['web']){if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x227))return console[_0x474c9e(0x202)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x255))return console['error'](_0x474c9e(0x1fe)),console['error']('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x38b0a2[_0x474c9e(0x1ba)])throw new SDKError(ErrorCode[_0x474c9e(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4404e4=getConsoleNextUrl(_0x3a1052['site'],_0x474c9e(0x1eb)+_0x38b0a2[_0x474c9e(0x24e)]+'/e/'+_0x38b0a2[_0x474c9e(0x1ba)]);return console[_0x474c9e(0x202)](a25_0x3e730a[_0x474c9e(0x22b)]('β')+_0x474c9e(0x23c)+a25_0x3e730a[_0x474c9e(0x1bc)](_0x4404e4)),openBrowser(_0x4404e4),0x0;}if(_0x38b0a2['type']===_0x474c9e(0x227)){if(!_0x38b0a2['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4c82ba=await withSpinner(_0x474c9e(0x1d1),()=>_0x54ea9d['segment'][_0x474c9e(0x1dd)](_0x38b0a2[_0x474c9e(0x243)]),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]});await handleSingleObjectOutput(_0x4c82ba['data'],_0x3a1052);}else{if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x20c)){if(!_0x38b0a2[_0x474c9e(0x1ba)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x474c9e(0x23e));const _0x47e318=await withSpinner(_0x474c9e(0x238),()=>_0x54ea9d[_0x474c9e(0x20c)][_0x474c9e(0x208)](_0x38b0a2[_0x474c9e(0x24e)],_0x38b0a2[_0x474c9e(0x1ba)]),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]}),_0x208781=getConsoleNextUrl(_0x3a1052[_0x474c9e(0x235)],_0x474c9e(0x1eb)+_0x38b0a2['parentId']+_0x474c9e(0x1fd)+_0x38b0a2[_0x474c9e(0x1ba)]),_0x132be2=_0x47e318[_0x474c9e(0x23a)];_0x132be2[_0x474c9e(0x1d3)]=_0x208781,await handleSingleObjectOutput(_0x132be2,_0x3a1052);}else return console[_0x474c9e(0x202)](_0x474c9e(0x20b)),console[_0x474c9e(0x202)](_0x474c9e(0x254)),0x1;}return 0x0;}catch(_0xd8b2e){if(_0xd8b2e instanceof SDKError)return console[_0x474c9e(0x202)]('Error:\x20'+_0xd8b2e['message']),_0xd8b2e[_0x474c9e(0x232)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1ff)+_0xd8b2e[_0x474c9e(0x232)]),0x1;throw _0xd8b2e;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1d5);[a25_0x288065(0x1e8)]=a25_0x288065(0x20f);async[a25_0x288065(0x222)](_0x2a3d1b){const _0x488397=a25_0x288065,{options:_0x130154,args:_0x354c3a,tdx:_0x497d7c}=_0x2a3d1b,_0x19a9c5=_0x354c3a[0x0];if(!_0x19a9c5)return console['error'](_0x488397(0x24d)),console[_0x488397(0x202)](_0x488397(0x249)),console['error'](_0x488397(0x212)),console['error'](_0x488397(0x211)),console[_0x488397(0x202)](_0x488397(0x1d9)),console[_0x488397(0x202)](_0x488397(0x218)),0x1;try{const _0x30027b=_0x130154[_0x488397(0x21b)],_0x52798f=await resolveSegmentTarget(_0x19a9c5,_0x30027b,_0x130154[_0x488397(0x1e0)]);_0x130154[_0x488397(0x1e0)]&&console['error'](_0x488397(0x1fb)+_0x52798f);const _0x2b92f2=await withSpinner(_0x488397(0x1ce)+_0x19a9c5+'\x27...',()=>_0x497d7c['segment'][_0x488397(0x1c6)](_0x52798f),{'verbose':_0x130154['verbose']}),_0x17a1bd=_0x2b92f2[_0x488397(0x23a)];_0x130154['verbose']&&(console[_0x488397(0x202)](_0x488397(0x1f1)+_0x17a1bd[_0x488397(0x1c1)]),console[_0x488397(0x202)](_0x488397(0x22c)+_0x17a1bd['parentId']));if(_0x17a1bd[_0x488397(0x1c1)]===_0x488397(0x227))return console[_0x488397(0x202)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0x488397(0x228)),0x1;if(_0x17a1bd[_0x488397(0x1c1)]===_0x488397(0x255))return console[_0x488397(0x202)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x17a1bd[_0x488397(0x1ba)])throw new SDKError(ErrorCode[_0x488397(0x251)],_0x488397(0x23e));const _0x122a79=await withSpinner(_0x488397(0x214),()=>_0x497d7c['segment'][_0x488397(0x1cf)](_0x17a1bd[_0x488397(0x24e)],_0x17a1bd['segmentId']),{'verbose':_0x130154['verbose']}),_0x443c1d=_0x122a79[_0x488397(0x23a)],_0x3b7aff=await executeSchemaQuery(_0x443c1d,_0x497d7c,_0x130154);return await handleQueryOutput(_0x3b7aff,_0x130154),0x0;}catch(_0x1bd040){if(_0x1bd040 instanceof SDKError)return console[_0x488397(0x202)](_0x488397(0x1c5)+_0x1bd040[_0x488397(0x256)]),_0x1bd040[_0x488397(0x232)]&&console[_0x488397(0x202)](_0x488397(0x1ff)+_0x1bd040['cause']),0x1;throw _0x1bd040;}}}
|
|
1
|
+
const a25_0x1916b8=a25_0x4534;(function(_0x31d7ef,_0x3c2faa){const _0x30edcf=a25_0x4534,_0x35ea76=_0x31d7ef();while(!![]){try{const _0x54706d=parseInt(_0x30edcf(0x101))/0x1+-parseInt(_0x30edcf(0x77))/0x2*(parseInt(_0x30edcf(0x9a))/0x3)+parseInt(_0x30edcf(0xf5))/0x4*(-parseInt(_0x30edcf(0xc2))/0x5)+parseInt(_0x30edcf(0x78))/0x6*(-parseInt(_0x30edcf(0x73))/0x7)+parseInt(_0x30edcf(0xe4))/0x8*(parseInt(_0x30edcf(0xec))/0x9)+-parseInt(_0x30edcf(0x75))/0xa*(-parseInt(_0x30edcf(0xa6))/0xb)+-parseInt(_0x30edcf(0xac))/0xc*(-parseInt(_0x30edcf(0xbb))/0xd);if(_0x54706d===_0x3c2faa)break;else _0x35ea76['push'](_0x35ea76['shift']());}catch(_0x1f0a53){_0x35ea76['push'](_0x35ea76['shift']());}}}(a25_0x3da2,0xe9466));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';function a25_0x3da2(){const _0x3bcbaa=['web','451644tBLhPO','log','segment:view','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','format','\x27...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','jsonl','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20[Job\x20ID:\x20','Use:\x20tdx\x20ps\x20show','\x20\x20Parent\x20segment:\x20','length','208FHnJpa','Segment\x20ID:\x20','resolveParentId','parentSegment','listFolders','code','Fetching\x20parent\x20segment\x20details...','34535ZyIAcl','limit','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x27\x20with\x20ID:\x20','description','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','site','getSegmentSQL','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Resolving\x20folder\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Target\x20path:\x20','getSegment','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20Opening\x20','setJobId','folder','Resolved\x20relative\x20path\x20to:\x20','parentFolder','Error:\x20Parent\x20segment\x20name\x20is\x20required','cyan','Resolving\x20parent\x20segment\x20\x27','SEGMENT_NOT_FOUND','β\x20Found\x20','Create\x20segment\x20folder\x20for\x20organization','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:show','includes','Resolved\x20type:\x20','segment:folder:list','url','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','2101576CqTrKS','createFolder','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','execute','getFolder','\x20\x20Folder\x20path:\x20','\x20rows\x20','Resolved\x20YAML\x20file:\x20','9yXaZEy','(root)','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20Cause:\x20','Fetching\x20folder\x20details...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Parent\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','692gLiOmv','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','toLocaleString','error','resolvePathToResource','Resolving\x20\x27','/app/ps/','/e/','type','β\x20Query\x20failed\x20[','INVALID_ARGUMENT','fullPath','1762537rLXcYI','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20folder\x20\x27','β\x20Created\x20folder\x20\x27','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','β\x20Query\x20completed:\x20Processed\x20','segment:describe','data','Fetching\x20SQL\x20for\x20segment...','resolveFolderId','segment:folder:create','Resolved\x20parent\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','7xPJDRs','jobId','1224860qSMPsa','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','2bCNZHw','7481688wWLfvV','getParent','Usage:\x20tdx\x20sg\x20show\x20<name>','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','folderId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x20\x20Full\x20path:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','parent','Use:\x20tdx\x20ps\x20view','Resolved\x20parent\x20folder\x20ID:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','cause','SQL\x20query:\x0a','Parent\x20name:\x20','Parent\x20segment:\x20','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20segment\x20details...','\x20\x20Segment\x20name:\x20','Site:\x20','segmentPath','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','segment','Examples:','parentId','Resolving\x20parent\x20folder\x20\x27','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','elapsedTimeMillis','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','query','1364799GWtlhY','Show\x20segment\x20folder\x20details','Resolved\x20folder\x20ID:\x20','verbose','Folder\x20name:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','json','segmentId','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20','segment:desc','110PgPxWl','Use:\x20tdx\x20ps\x20view\x20-w','name','segment:show','Get\x20SQL\x20query\x20for\x20child\x20segment'];a25_0x3da2=function(){return _0x3bcbaa;};return a25_0x3da2();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a25_0x4534(_0x1be596,_0x2eaa46){_0x1be596=_0x1be596-0x67;const _0x3da216=a25_0x3da2();let _0x4534c6=_0x3da216[_0x1be596];return _0x4534c6;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x76439b from'chalk';async function resolveSegmentTarget(_0x2b9f8e,_0x5d9ef9,_0x1b0e52){const _0x2b2c31=a25_0x4534;if(isYamlFilePath(_0x2b9f8e))try{const _0xd879d8=await resolveYamlFilePath(_0x2b9f8e);return _0x1b0e52&&(console[_0x2b2c31(0xf8)](_0x2b2c31(0xeb)+_0x2b9f8e),console[_0x2b2c31(0xf8)](_0x2b2c31(0xb9)+_0xd879d8[_0x2b2c31(0xbe)]),console['error'](_0x2b2c31(0x8c)+_0xd879d8['segmentName']),console[_0x2b2c31(0xf8)](_0x2b2c31(0xe9)+(_0xd879d8['folderPath']||_0x2b2c31(0xed))),console[_0x2b2c31(0xf8)](_0x2b2c31(0x80)+_0xd879d8['fullPath'])),_0xd879d8[_0x2b2c31(0x100)];}catch(_0x25d128){throw new SDKError(ErrorCode[_0x2b2c31(0xff)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x25d128[_0x2b2c31(0x94)]);}if(!_0x5d9ef9)throw new SDKError(ErrorCode[_0x2b2c31(0xff)],_0x2b2c31(0xe3));return _0x5d9ef9+'/'+_0x2b9f8e;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x1916b8(0x6c);['description']=a25_0x1916b8(0x7b);async[a25_0x1916b8(0xe7)](_0xc34875){const _0x28815e=a25_0x1916b8,{options:_0x4575f4,args:_0x1d5ae9,tdx:_0x3f1e82}=_0xc34875,_0x21ee61=_0x1d5ae9[0x0],_0x5b61f6=!_0x21ee61&&!!_0x4575f4[_0x28815e(0xbe)],_0x5116fa=_0x21ee61||_0x4575f4[_0x28815e(0xbe)];if(!_0x5116fa)return console[_0x28815e(0xf8)](_0x28815e(0x102)),console[_0x28815e(0xf8)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x28815e(0xf8)](_0x28815e(0x7e)),console['error'](_0x28815e(0x103)),console[_0x28815e(0xf8)](_0x28815e(0xce)),0x1;try{const _0x1832ff=_0x4575f4[_0x28815e(0x8e)];let _0x182943=_0x5116fa;!_0x5b61f6&&_0x1832ff&&!_0x5116fa[_0x28815e(0xdf)]('/')&&(_0x182943=_0x1832ff+'/'+_0x5116fa,_0x4575f4[_0x28815e(0x9d)]&&console[_0x28815e(0xf8)](_0x28815e(0xd5)+_0x182943));const _0x5aeb5d=await withSpinner('Resolving\x20path\x20\x27'+_0x182943+_0x28815e(0xb2),()=>_0x3f1e82[_0x28815e(0x90)]['resolvePathToResource'](_0x182943),{'verbose':_0x4575f4[_0x28815e(0x9d)]}),_0x332181=_0x5aeb5d['data'];_0x4575f4['verbose']&&(console[_0x28815e(0xf8)](_0x28815e(0xe0)+_0x332181[_0x28815e(0xfd)]),console[_0x28815e(0xf8)](_0x28815e(0xf3)+_0x332181['parentId']),_0x332181[_0x28815e(0x7d)]&&console[_0x28815e(0xf8)]('Folder\x20ID:\x20'+_0x332181[_0x28815e(0x7d)]),_0x332181[_0x28815e(0xa1)]&&console[_0x28815e(0xf8)](_0x28815e(0xbc)+_0x332181[_0x28815e(0xa1)]));if(_0x332181['type']===_0x28815e(0x82)){const _0x21ecd5=await withSpinner(_0x28815e(0xc1),()=>_0x3f1e82['segment'][_0x28815e(0x79)](_0x332181['parentId']),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x21ecd5[_0x28815e(0x6d)],_0x4575f4);}else{if(_0x332181[_0x28815e(0xfd)]===_0x28815e(0xd4)){if(!_0x332181[_0x28815e(0x7d)])throw new SDKError(ErrorCode[_0x28815e(0x8a)],_0x28815e(0xdd));const _0x73226d=await withSpinner(_0x28815e(0xf1),()=>_0x3f1e82[_0x28815e(0x90)][_0x28815e(0xe8)](_0x332181[_0x28815e(0x7d)]),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x73226d[_0x28815e(0x6d)],_0x4575f4);}else{if(_0x332181['type']===_0x28815e(0x90)){if(!_0x332181[_0x28815e(0xa1)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x28815e(0xf4));const _0x93863b=await withSpinner('Fetching\x20segment\x20details...',()=>_0x3f1e82[_0x28815e(0x90)][_0x28815e(0xd0)](_0x332181[_0x28815e(0x92)],_0x332181[_0x28815e(0xa1)]),{'verbose':_0x4575f4[_0x28815e(0x9d)]});await handleSingleObjectOutput(_0x93863b[_0x28815e(0x6d)],_0x4575f4);}}}return 0x0;}catch(_0x2aab77){if(_0x2aab77 instanceof SDKError)return console[_0x28815e(0xf8)](_0x28815e(0xa4)+_0x2aab77[_0x28815e(0x94)]),_0x2aab77[_0x28815e(0x86)]&&console[_0x28815e(0xf8)]('\x20\x20Cause:\x20'+_0x2aab77[_0x28815e(0x86)]),0x1;throw _0x2aab77;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xa9);[a25_0x1916b8(0xc7)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x36ea9e){const _0x27d997=a25_0x1916b8,{options:_0x146ebf,args:_0x1ff14e,tdx:_0x2f56e0}=_0x36ea9e,_0x2628d7=_0x1ff14e[0x0];if(!_0x2628d7)return console['error'](_0x27d997(0x8f)),console[_0x27d997(0xf8)](_0x27d997(0x7a)),console[_0x27d997(0xf8)](_0x27d997(0xf2)),console[_0x27d997(0xf8)](_0x27d997(0x91)),console[_0x27d997(0xf8)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error'](_0x27d997(0x6a)),0x1;try{const _0x60bcac=_0x146ebf[_0x27d997(0xbe)],_0x53b7a0=await resolveSegmentTarget(_0x2628d7,_0x60bcac,_0x146ebf[_0x27d997(0x9d)]);_0x146ebf['verbose']&&console[_0x27d997(0xf8)]('Target\x20path:\x20'+_0x53b7a0);const _0x58e3c9=await withSpinner(_0x27d997(0xfa)+_0x2628d7+_0x27d997(0xb2),()=>_0x2f56e0['segment'][_0x27d997(0xf9)](_0x53b7a0),{'verbose':_0x146ebf[_0x27d997(0x9d)]}),_0x38fb00=_0x58e3c9['data'];_0x146ebf[_0x27d997(0x9d)]&&(console['error'](_0x27d997(0xe0)+_0x38fb00[_0x27d997(0xfd)]),console['error']('Parent\x20ID:\x20'+_0x38fb00[_0x27d997(0x92)]));if(_0x38fb00[_0x27d997(0xfd)]==='folder')return console['error'](_0x27d997(0xaf)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x38fb00['type']===_0x27d997(0x82))return console[_0x27d997(0xf8)](_0x27d997(0xe6)),console[_0x27d997(0xf8)](_0x27d997(0xb8)),0x1;if(!_0x38fb00[_0x27d997(0xa1)])throw new SDKError(ErrorCode[_0x27d997(0xda)],_0x27d997(0xf4));const _0x36a59b=await withSpinner(_0x27d997(0x6e),()=>_0x2f56e0[_0x27d997(0x90)][_0x27d997(0xca)](_0x38fb00[_0x27d997(0x92)],_0x38fb00[_0x27d997(0xa1)]),{'verbose':_0x146ebf[_0x27d997(0x9d)]});let _0x597648=_0x36a59b[_0x27d997(0x6d)];const _0xaf17d6=resolveLimit(_0x146ebf[_0x27d997(0xc3)],DEFAULT_DISPLAY_LIMIT),_0xf7947f=/\bLIMIT\s+\d+/i['test'](_0x597648);!_0xf7947f&&(_0x597648=_0x597648['trim']()['replace'](/;+$/,''),_0x597648='SELECT\x20*\x20FROM\x20(\x0a'+_0x597648+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0xaf17d6);_0x146ebf['verbose']&&console[_0x27d997(0xf8)](_0x27d997(0x87)+_0x597648);const _0x56ad50=await withProgressSpinner('Executing\x20segment\x20query...',async _0x42eb90=>{const _0x46ad8d=_0x27d997,_0x120bc9=await _0x2f56e0[_0x46ad8d(0x99)][_0x46ad8d(0xe7)](_0x597648,{'catalog':'td','schema':'information_schema','onJobId':_0x2ae28c=>{const _0x7f3f4d=_0x46ad8d;_0x42eb90[_0x7f3f4d(0xd3)](_0x2ae28c);}});return _0x120bc9;},{'verbose':_0x146ebf[_0x27d997(0x9d)]}),_0x36d069=_0x56ad50[_0x27d997(0x6d)],_0xddb4ca=_0x36d069[_0x27d997(0x74)]?_0x27d997(0xb7)+_0x36d069['jobId']+']':'';return console[_0x27d997(0xf8)](_0x27d997(0x6b)+_0x36d069['stats']['processedRows'][_0x27d997(0xf7)]()+_0x27d997(0xea)+('in\x20'+formatElapsed(_0x36d069['stats'][_0x27d997(0x96)])+_0xddb4ca)),await handleQueryOutput(_0x36d069,_0x146ebf),0x0;}catch(_0xb06e77){if(_0xb06e77 instanceof SDKError)return console[_0x27d997(0xf8)](_0x27d997(0xfe)+_0xb06e77[_0x27d997(0xc0)]+']'),console[_0x27d997(0xf8)]('\x0a'+_0xb06e77[_0x27d997(0x94)]),0x1;throw _0xb06e77;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x1916b8(0xe1);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0x81);async[a25_0x1916b8(0xe7)](_0x29363b){const _0x5d0c1f=a25_0x1916b8,{options:_0x3e7bd,args:_0x19fe2d,tdx:_0x15cd30}=_0x29363b;if(_0x19fe2d[_0x5d0c1f(0xba)]===0x0)return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xd7)),console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xc5)),0x1;const _0x22e56e=_0x19fe2d[0x0];try{_0x3e7bd[_0x5d0c1f(0x9d)]&&(console[_0x5d0c1f(0xf8)](_0x5d0c1f(0x8d)+_0x3e7bd['site']),console['error'](_0x5d0c1f(0x88)+_0x22e56e));const _0x5c3756=await withSpinner(_0x5d0c1f(0xd9)+_0x22e56e+_0x5d0c1f(0xb2),()=>_0x15cd30['segment'][_0x5d0c1f(0xbd)](_0x22e56e),{'verbose':_0x3e7bd[_0x5d0c1f(0x9d)]}),_0x37541a=_0x5c3756[_0x5d0c1f(0x6d)];_0x3e7bd[_0x5d0c1f(0x9d)]&&console[_0x5d0c1f(0xf8)]('Resolved\x20parent\x20ID:\x20'+_0x37541a);const _0x11a852=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x22e56e+_0x5d0c1f(0xb2),()=>_0x15cd30[_0x5d0c1f(0x90)][_0x5d0c1f(0xbf)](_0x37541a),{'verbose':_0x3e7bd[_0x5d0c1f(0x9d)]}),_0x480f42=_0x11a852[_0x5d0c1f(0x6d)];return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xdb)+_0x480f42[_0x5d0c1f(0xba)]+'\x20folder'+(_0x480f42['length']!==0x1?'s':'')),await handleSDKOutput(_0x480f42,_0x3e7bd),0x0;}catch(_0x754486){if(_0x754486 instanceof SDKError)return console[_0x5d0c1f(0xf8)](_0x5d0c1f(0xa4)+_0x754486[_0x5d0c1f(0x94)]),_0x754486['cause']&&console[_0x5d0c1f(0xf8)]('\x20\x20Cause:\x20'+_0x754486[_0x5d0c1f(0x86)]),0x1;throw _0x754486;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xde);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0x9b);async['execute'](_0x14477f){const _0x2f0761=a25_0x1916b8,{options:_0x13711c,args:_0x5a776b,tdx:_0x3468d3}=_0x14477f;if(_0x5a776b[_0x2f0761(0xba)]===0x0)return console['error'](_0x2f0761(0xcb)),console[_0x2f0761(0xf8)](_0x2f0761(0x69)),0x1;try{const {parentId:_0x1fbc59,childId:_0x3759ee}=parseSegmentRef(_0x5a776b[0x0]);_0x13711c['verbose']&&(console[_0x2f0761(0xf8)](_0x2f0761(0x8d)+_0x13711c['site']),console['error']('Parent\x20name:\x20'+_0x1fbc59),_0x3759ee&&console[_0x2f0761(0xf8)](_0x2f0761(0x9e)+_0x3759ee));if(!_0x3759ee)return console[_0x2f0761(0xf8)](_0x2f0761(0x72)),0x1;const _0x126bfd=await withSpinner(_0x2f0761(0xd9)+_0x1fbc59+_0x2f0761(0xb2),()=>_0x3468d3[_0x2f0761(0x90)][_0x2f0761(0xbd)](_0x1fbc59),{'verbose':_0x13711c[_0x2f0761(0x9d)]}),_0x573de5=_0x126bfd[_0x2f0761(0x6d)];_0x13711c[_0x2f0761(0x9d)]&&console['error'](_0x2f0761(0x71)+_0x573de5);const _0x3f83e9=await withSpinner(_0x2f0761(0xcd)+_0x3759ee+_0x2f0761(0xb2),()=>_0x3468d3[_0x2f0761(0x90)][_0x2f0761(0x6f)](_0x573de5,_0x3759ee),{'verbose':_0x13711c['verbose']}),_0x492fe9=_0x3f83e9[_0x2f0761(0x6d)];_0x13711c[_0x2f0761(0x9d)]&&console['error'](_0x2f0761(0x9c)+_0x492fe9);const _0x57b636=await withSpinner(_0x2f0761(0x104)+_0x3759ee+_0x2f0761(0xb2),()=>_0x3468d3['segment']['getFolder'](_0x492fe9),{'verbose':_0x13711c[_0x2f0761(0x9d)]});return await handleSDKOutput([_0x57b636[_0x2f0761(0x6d)]],_0x13711c),0x0;}catch(_0x1a7aa9){if(_0x1a7aa9 instanceof SDKError)return console[_0x2f0761(0xf8)](_0x2f0761(0xa4)+_0x1a7aa9['message']),_0x1a7aa9['cause']&&console[_0x2f0761(0xf8)]('\x20\x20Cause:\x20'+_0x1a7aa9[_0x2f0761(0x86)]),0x1;throw _0x1a7aa9;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x1916b8(0xa8)]='segment:sql';[a25_0x1916b8(0xc7)]=a25_0x1916b8(0xaa);async[a25_0x1916b8(0xe7)](_0x5c363b){const _0xef04e7=a25_0x1916b8,{options:_0x4170cb,args:_0x1f16bf,tdx:_0x1b4813}=_0x5c363b,_0x2032a1=_0x1f16bf[0x0];if(!_0x2032a1)return console['error'](_0xef04e7(0x8f)),console[_0xef04e7(0xf8)](_0xef04e7(0x7f)),console['error'](_0xef04e7(0x95)),console[_0xef04e7(0xf8)]('Examples:'),console[_0xef04e7(0xf8)](_0xef04e7(0xb0)),console[_0xef04e7(0xf8)](_0xef04e7(0xb4)),0x1;try{const _0xd4e160=_0x4170cb[_0xef04e7(0xbe)],_0x33ced3=await resolveSegmentTarget(_0x2032a1,_0xd4e160,_0x4170cb[_0xef04e7(0x9d)]);_0x4170cb[_0xef04e7(0x9d)]&&console['error'](_0xef04e7(0xcf)+_0x33ced3);const _0x14a7dd=await withSpinner('Resolving\x20\x27'+_0x2032a1+_0xef04e7(0xb2),()=>_0x1b4813[_0xef04e7(0x90)]['resolvePathToResource'](_0x33ced3),{'verbose':_0x4170cb['verbose']}),_0x5d99a5=_0x14a7dd[_0xef04e7(0x6d)];_0x4170cb[_0xef04e7(0x9d)]&&(console[_0xef04e7(0xf8)](_0xef04e7(0xe0)+_0x5d99a5['type']),console[_0xef04e7(0xf8)](_0xef04e7(0xf3)+_0x5d99a5['parentId']));if(_0x5d99a5[_0xef04e7(0xfd)]===_0xef04e7(0xd4))return console[_0xef04e7(0xf8)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0xef04e7(0xf8)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x5d99a5[_0xef04e7(0xfd)]==='parent')return console['error'](_0xef04e7(0xee)),console['error']('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x5d99a5['segmentId'])throw new SDKError(ErrorCode[_0xef04e7(0xda)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x923b0e=await withSpinner(_0xef04e7(0x6e),()=>_0x1b4813[_0xef04e7(0x90)][_0xef04e7(0xca)](_0x5d99a5['parentId'],_0x5d99a5[_0xef04e7(0xa1)]),{'verbose':_0x4170cb['verbose']}),_0x5af9ed=_0x923b0e[_0xef04e7(0x6d)];return _0x4170cb[_0xef04e7(0xb1)]===_0xef04e7(0xa0)||_0x4170cb[_0xef04e7(0xb1)]===_0xef04e7(0xb5)?await handleSDKOutput([{'sql':_0x5af9ed}],_0x4170cb):console[_0xef04e7(0xad)](_0x5af9ed),0x0;}catch(_0x22ad14){if(_0x22ad14 instanceof SDKError)return console[_0xef04e7(0xf8)](_0xef04e7(0xa4)+_0x22ad14[_0xef04e7(0x94)]),_0x22ad14[_0xef04e7(0x86)]&&console[_0xef04e7(0xf8)](_0xef04e7(0xf0)+_0x22ad14[_0xef04e7(0x86)]),0x1;throw _0x22ad14;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x1916b8(0x70);[a25_0x1916b8(0xc7)]=a25_0x1916b8(0xdc);async[a25_0x1916b8(0xe7)](_0x2ed3f0){const _0x352e5d=a25_0x1916b8,{options:_0x52d8e1,args:_0x2741e6,tdx:_0x382514}=_0x2ed3f0,_0x1333d0=_0x52d8e1;if(_0x2741e6[_0x352e5d(0xba)]<0x2)return console[_0x352e5d(0xf8)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x352e5d(0xf8)](_0x352e5d(0xef)),0x1;const _0x53ef9e=_0x2741e6[0x0],_0x357548=_0x2741e6[0x1];_0x1333d0[_0x352e5d(0x9d)]&&(console[_0x352e5d(0xf8)](_0x352e5d(0x8d)+_0x1333d0[_0x352e5d(0xc9)]),console[_0x352e5d(0xf8)](_0x352e5d(0x89)+_0x53ef9e),console['error'](_0x352e5d(0x9e)+_0x357548));let _0x50a562;if(_0x1333d0[_0x352e5d(0xd6)]){const _0x26a7b1=_0x1333d0[_0x352e5d(0xd6)],_0x3c48df=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x53ef9e+'\x27...',()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0xbd)](_0x53ef9e),{'verbose':_0x1333d0['verbose']}),_0x54ae79=_0x3c48df[_0x352e5d(0x6d)],_0x1f5a0d=await withSpinner(_0x352e5d(0x93)+_0x26a7b1+_0x352e5d(0xb2),()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0x6f)](_0x54ae79,_0x26a7b1),{'verbose':_0x1333d0['verbose']});_0x50a562=_0x1f5a0d[_0x352e5d(0x6d)],_0x1333d0[_0x352e5d(0x9d)]&&console[_0x352e5d(0xf8)](_0x352e5d(0x84)+_0x50a562);}const _0x499b1d={'name':_0x357548,'description':_0x1333d0[_0x352e5d(0xc7)],'parentFolderId':_0x50a562},_0xdfd127=await withSpinner('Creating\x20folder\x20\x27'+_0x357548+_0x352e5d(0xb2),()=>_0x382514[_0x352e5d(0x90)][_0x352e5d(0xe5)](_0x53ef9e,_0x499b1d),{'verbose':_0x1333d0[_0x352e5d(0x9d)]}),_0x931a4c=_0xdfd127[_0x352e5d(0x6d)];return console['error'](_0x352e5d(0x67)+_0x931a4c[_0x352e5d(0xa8)]+_0x352e5d(0xc6)+_0x931a4c['id']),await handleSDKOutput([_0x931a4c],_0x1333d0),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x1916b8(0xa8)]=a25_0x1916b8(0xae);['description']=a25_0x1916b8(0x9f);async[a25_0x1916b8(0xe7)](_0xfb7831){const _0x1c94d0=a25_0x1916b8,{options:_0x5a38b4,args:_0x32a817,tdx:_0x41460e}=_0xfb7831,_0x4b6f1a=_0x32a817[0x0];if(!_0x4b6f1a)return console[_0x1c94d0(0xf8)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1c94d0(0xf8)](_0x1c94d0(0xc4)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xf6)),console[_0x1c94d0(0xf8)]('Options:'),console[_0x1c94d0(0xf8)](_0x1c94d0(0x76)),console[_0x1c94d0(0xf8)](_0x1c94d0(0x91)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xc8)),console[_0x1c94d0(0xf8)](_0x1c94d0(0x7c)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xb3)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xa2)),0x1;try{const _0x3cb7ef=_0x5a38b4[_0x1c94d0(0xbe)],_0x4aa9f4=await resolveSegmentTarget(_0x4b6f1a,_0x3cb7ef,_0x5a38b4['verbose']);_0x5a38b4['verbose']&&console[_0x1c94d0(0xf8)](_0x1c94d0(0xcf)+_0x4aa9f4);const _0x2a4fa5=await withSpinner(_0x1c94d0(0xfa)+_0x4b6f1a+'\x27...',()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xf9)](_0x4aa9f4),{'verbose':_0x5a38b4['verbose']}),_0x549fe2=_0x2a4fa5[_0x1c94d0(0x6d)];_0x5a38b4[_0x1c94d0(0x9d)]&&(console[_0x1c94d0(0xf8)]('Resolved\x20type:\x20'+_0x549fe2[_0x1c94d0(0xfd)]),console['error'](_0x1c94d0(0xf3)+_0x549fe2['parentId']),_0x549fe2['folderId']&&console[_0x1c94d0(0xf8)](_0x1c94d0(0x68)+_0x549fe2[_0x1c94d0(0x7d)]),_0x549fe2[_0x1c94d0(0xa1)]&&console[_0x1c94d0(0xf8)](_0x1c94d0(0xbc)+_0x549fe2[_0x1c94d0(0xa1)]));if(_0x5a38b4[_0x1c94d0(0xab)]){if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0xd4))return console[_0x1c94d0(0xf8)](_0x1c94d0(0xcc)),0x1;if(_0x549fe2[_0x1c94d0(0xfd)]==='parent')return console[_0x1c94d0(0xf8)](_0x1c94d0(0xd1)),console[_0x1c94d0(0xf8)](_0x1c94d0(0xa7)),0x1;if(!_0x549fe2[_0x1c94d0(0xa1)])throw new SDKError(ErrorCode[_0x1c94d0(0xda)],_0x1c94d0(0xf4));const _0x1cdf15=getConsoleNextUrl(_0x5a38b4[_0x1c94d0(0xc9)],_0x1c94d0(0xfb)+_0x549fe2['parentId']+_0x1c94d0(0xfc)+_0x549fe2[_0x1c94d0(0xa1)]);return console['error'](a25_0x76439b['green']('β')+_0x1c94d0(0xd2)+a25_0x76439b[_0x1c94d0(0xd8)](_0x1cdf15)),openBrowser(_0x1cdf15),0x0;}if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0xd4)){if(!_0x549fe2[_0x1c94d0(0x7d)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1c94d0(0xdd));const _0x3185c1=await withSpinner('Fetching\x20folder\x20details...',()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xe8)](_0x549fe2[_0x1c94d0(0x7d)]),{'verbose':_0x5a38b4[_0x1c94d0(0x9d)]});await handleSingleObjectOutput(_0x3185c1[_0x1c94d0(0x6d)],_0x5a38b4);}else{if(_0x549fe2[_0x1c94d0(0xfd)]===_0x1c94d0(0x90)){if(!_0x549fe2[_0x1c94d0(0xa1)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1c94d0(0xf4));const _0x150e2a=await withSpinner(_0x1c94d0(0x8b),()=>_0x41460e[_0x1c94d0(0x90)][_0x1c94d0(0xd0)](_0x549fe2[_0x1c94d0(0x92)],_0x549fe2[_0x1c94d0(0xa1)]),{'verbose':_0x5a38b4['verbose']}),_0x430c86=getConsoleNextUrl(_0x5a38b4[_0x1c94d0(0xc9)],_0x1c94d0(0xfb)+_0x549fe2['parentId']+_0x1c94d0(0xfc)+_0x549fe2[_0x1c94d0(0xa1)]),_0x2f5682=_0x150e2a[_0x1c94d0(0x6d)];_0x2f5682[_0x1c94d0(0xe2)]=_0x430c86,await handleSingleObjectOutput(_0x2f5682,_0x5a38b4);}else return console[_0x1c94d0(0xf8)](_0x1c94d0(0xa3)),console['error'](_0x1c94d0(0x83)),0x1;}return 0x0;}catch(_0x14db64){if(_0x14db64 instanceof SDKError)return console['error'](_0x1c94d0(0xa4)+_0x14db64[_0x1c94d0(0x94)]),_0x14db64[_0x1c94d0(0x86)]&&console[_0x1c94d0(0xf8)]('\x20\x20Cause:\x20'+_0x14db64['cause']),0x1;throw _0x14db64;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x1916b8(0xa5);['description']=a25_0x1916b8(0x85);async[a25_0x1916b8(0xe7)](_0x4102b1){const _0x3f7fa6=a25_0x1916b8,{options:_0x24eec4,args:_0x2015e0,tdx:_0x261903}=_0x4102b1,_0x15b392=_0x2015e0[0x0];if(!_0x15b392)return console[_0x3f7fa6(0xf8)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0x97)),console[_0x3f7fa6(0xf8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x3f7fa6(0x91)),console[_0x3f7fa6(0xf8)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0x98)),0x1;try{const _0x2e4784=_0x24eec4['parentSegment'],_0x2f02b1=await resolveSegmentTarget(_0x15b392,_0x2e4784,_0x24eec4[_0x3f7fa6(0x9d)]);_0x24eec4['verbose']&&console['error'](_0x3f7fa6(0xcf)+_0x2f02b1);const _0x3d27da=await withSpinner(_0x3f7fa6(0xfa)+_0x15b392+_0x3f7fa6(0xb2),()=>_0x261903['segment']['resolvePathToResource'](_0x2f02b1),{'verbose':_0x24eec4[_0x3f7fa6(0x9d)]}),_0xbfd62c=_0x3d27da[_0x3f7fa6(0x6d)];_0x24eec4['verbose']&&(console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xe0)+_0xbfd62c[_0x3f7fa6(0xfd)]),console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xf3)+_0xbfd62c[_0x3f7fa6(0x92)]));if(_0xbfd62c['type']===_0x3f7fa6(0xd4))return console[_0x3f7fa6(0xf8)](_0x3f7fa6(0xb6)),console[_0x3f7fa6(0xf8)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0xbfd62c[_0x3f7fa6(0xfd)]===_0x3f7fa6(0x82))return console[_0x3f7fa6(0xf8)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0xbfd62c[_0x3f7fa6(0xa1)])throw new SDKError(ErrorCode[_0x3f7fa6(0xda)],_0x3f7fa6(0xf4));const _0x2aa8f9=await withSpinner(_0x3f7fa6(0x6e),()=>_0x261903[_0x3f7fa6(0x90)][_0x3f7fa6(0xca)](_0xbfd62c[_0x3f7fa6(0x92)],_0xbfd62c[_0x3f7fa6(0xa1)]),{'verbose':_0x24eec4[_0x3f7fa6(0x9d)]}),_0x2bebfa=_0x2aa8f9['data'],_0x39da7a=await executeSchemaQuery(_0x2bebfa,_0x261903,_0x24eec4);return await handleQueryOutput(_0x39da7a,_0x24eec4),0x0;}catch(_0x4edf03){if(_0x4edf03 instanceof SDKError)return console['error'](_0x3f7fa6(0xa4)+_0x4edf03[_0x3f7fa6(0x94)]),_0x4edf03[_0x3f7fa6(0x86)]&&console['error'](_0x3f7fa6(0xf0)+_0x4edf03[_0x3f7fa6(0x86)]),0x1;throw _0x4edf03;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0x6a62b7=a26_0x55f6;(function(_0x3b6036,_0x25b02d){const _0x44a569=a26_0x55f6,_0x4dd445=_0x3b6036();while(!![]){try{const _0xaf5017=parseInt(_0x44a569(0x1ed))/0x1*(parseInt(_0x44a569(0x1f4))/0x2)+-parseInt(_0x44a569(0x1f7))/0x3*(-parseInt(_0x44a569(0x1e9))/0x4)+parseInt(_0x44a569(0x1d8))/0x5+parseInt(_0x44a569(0x1e5))/0x6*(-parseInt(_0x44a569(0x1ca))/0x7)+parseInt(_0x44a569(0x1fa))/0x8*(-parseInt(_0x44a569(0x1d9))/0x9)+-parseInt(_0x44a569(0x1d1))/0xa+parseInt(_0x44a569(0x1e0))/0xb;if(_0xaf5017===_0x25b02d)break;else _0x4dd445['push'](_0x4dd445['shift']());}catch(_0x2ee3db){_0x4dd445['push'](_0x4dd445['shift']());}}}(a26_0x1d18,0xd32e5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a26_0x1d18(){const _0x13c47f=['35WGVBpe','verbose','kind','Segment\x20name:\x20','parent','\x27...','createSegment','13310800SZfPdN','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Creating\x20segment\x20\x27','Resolved\x20relative\x20path\x20to:\x20','description','β\x20Created\x20segment\x20\x27','77070acrysX','396yTktAz','type','site','data','segments','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x20\x20\x20Path:\x20','25078053SyYdXL','resolvePathToResource','segmentPath','length','Resolving\x20parent\x20segment\x20\x27','1446582usPnyt','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','noCountPopulation','Target\x20path:\x20','61204DDLwVf','segment:create','folder','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','11AMIXho','rule','invisible','folderId','Site:\x20','\x27\x20with\x20ID:\x20','Resolved\x20folder\x20ID:\x20','18034udGLVi','yellow','resolveFolderId','282MSyUHJ','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','execute','78392KZmHAx','Resolving\x20folder\x20path\x20\x27','Parent\x20path:\x20','error','includes','Create\x20child\x20segment\x20with\x20filtering\x20rules','ruleFile','name'];a26_0x1d18=function(){return _0x13c47f;};return a26_0x1d18();}import{withSpinner}from'../utils/spinner.js';function a26_0x55f6(_0x4f6b36,_0x36d974){_0x4f6b36=_0x4f6b36-0x1c5;const _0x1d18c2=a26_0x1d18();let _0x55f634=_0x1d18c2[_0x4f6b36];return _0x55f634;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x533031 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x6a62b7(0x1c9)]=a26_0x6a62b7(0x1ea);[a26_0x6a62b7(0x1d6)]=a26_0x6a62b7(0x1c7);async[a26_0x6a62b7(0x1f9)](_0x1a1415){const _0x29e0f9=a26_0x6a62b7;console[_0x29e0f9(0x1c5)](a26_0x533031[_0x29e0f9(0x1f5)]('β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x29e0f9(0x1c5)](a26_0x533031[_0x29e0f9(0x1f5)](_0x29e0f9(0x1e6)));const {options:_0x40914a,args:_0x289d3d,tdx:_0x3b1bea}=_0x1a1415,_0xf512da=_0x40914a;if(_0x289d3d[_0x29e0f9(0x1e3)]===0x0)return console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1d2)),console['error'](_0x29e0f9(0x1d3)),console[_0x29e0f9(0x1c5)]('Examples:'),console[_0x29e0f9(0x1c5)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x29e0f9(0x1ec)),console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1de)),0x1;const _0x595ba0=_0x289d3d[0x0],_0x53bdde=_0x40914a[_0x29e0f9(0x1e2)];let _0x2a7d81=_0x595ba0;_0x53bdde&&!_0x595ba0[_0x29e0f9(0x1c6)]('/')&&(_0x2a7d81=_0x53bdde+'/'+_0x595ba0,_0xf512da[_0x29e0f9(0x1cb)]&&console['error'](_0x29e0f9(0x1d5)+_0x2a7d81));const _0xd56940=parsePath(_0x2a7d81);if(_0xd56940[_0x29e0f9(0x1dd)][_0x29e0f9(0x1e3)]<0x2)return console[_0x29e0f9(0x1c5)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0x29e0f9(0x1f8)),0x1;const _0x3c1370=_0xd56940[_0x29e0f9(0x1dd)][0x0],_0xde6c34=getBaseName(_0x2a7d81),_0x10e3c9=getParentPath(_0x2a7d81);_0xf512da[_0x29e0f9(0x1cb)]&&(console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1f1)+_0xf512da[_0x29e0f9(0x1db)]),console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1e8)+_0x2a7d81),console[_0x29e0f9(0x1c5)]('Parent:\x20'+_0x3c1370),console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1cd)+_0xde6c34),console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1fc)+_0x10e3c9));const _0x3a6c5e=await withSpinner(_0x29e0f9(0x1e4)+_0x3c1370+_0x29e0f9(0x1cf),()=>_0x3b1bea['segment']['resolveParentId'](_0x3c1370),{'verbose':_0xf512da[_0x29e0f9(0x1cb)]}),_0x2d2b23=_0x3a6c5e['data'];let _0x2bf125;if(_0xd56940[_0x29e0f9(0x1dd)][_0x29e0f9(0x1e3)]>0x2){const _0x158868=await withSpinner(_0x29e0f9(0x1fb)+_0x10e3c9+_0x29e0f9(0x1cf),()=>_0x3b1bea['segment'][_0x29e0f9(0x1e1)](_0x10e3c9),{'verbose':_0xf512da['verbose']}),_0x183657=_0x158868[_0x29e0f9(0x1dc)];if(_0x183657[_0x29e0f9(0x1da)]!==_0x29e0f9(0x1eb)&&_0x183657['type']!==_0x29e0f9(0x1ce))return console[_0x29e0f9(0x1c5)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x2bf125=_0x183657[_0x29e0f9(0x1f0)];}else{if(_0xf512da[_0x29e0f9(0x1eb)]){const _0xc92369=await withSpinner('Resolving\x20folder\x20\x27'+_0xf512da[_0x29e0f9(0x1eb)]+_0x29e0f9(0x1cf),()=>_0x3b1bea['segment'][_0x29e0f9(0x1f6)](_0x2d2b23,_0xf512da[_0x29e0f9(0x1eb)]),{'verbose':_0xf512da[_0x29e0f9(0x1cb)]});_0x2bf125=_0xc92369[_0x29e0f9(0x1dc)];}}_0xf512da[_0x29e0f9(0x1cb)]&&_0x2bf125&&console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1f3)+_0x2bf125);const _0x515e47=await loadJSONFromOptions(_0xf512da[_0x29e0f9(0x1ee)],_0xf512da[_0x29e0f9(0x1c8)]),_0xc4ba0a={'name':_0xde6c34,'description':_0xf512da[_0x29e0f9(0x1d6)],'rule':_0x515e47,'kind':_0xf512da[_0x29e0f9(0x1cc)]!==undefined?parseInt(_0xf512da[_0x29e0f9(0x1cc)],0xa):undefined,'isVisible':_0xf512da[_0x29e0f9(0x1ef)]?![]:undefined,'segmentFolderId':_0x2bf125,'countPopulation':_0xf512da[_0x29e0f9(0x1e7)]?![]:undefined},_0x212375=await withSpinner(_0x29e0f9(0x1d4)+_0xde6c34+_0x29e0f9(0x1cf),()=>_0x3b1bea['segment'][_0x29e0f9(0x1d0)](_0x2d2b23,_0xc4ba0a),{'verbose':_0xf512da[_0x29e0f9(0x1cb)]}),_0x246815=_0x212375[_0x29e0f9(0x1dc)];return console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1d7)+_0x246815[_0x29e0f9(0x1c9)]+_0x29e0f9(0x1f2)+_0x246815['id']),_0x2a7d81!==_0x595ba0&&console[_0x29e0f9(0x1c5)](_0x29e0f9(0x1df)+_0x2a7d81),await handleSDKOutput([_0x246815],_0xf512da),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x45ef2a=a27_0x51a7;(function(_0x2e4f80,_0x2097b7){const _0x2f9580=a27_0x51a7,_0x303f28=_0x2e4f80();while(!![]){try{const _0x3489ca=-parseInt(_0x2f9580(0xf0))/0x1+-parseInt(_0x2f9580(0xfb))/0x2*(-parseInt(_0x2f9580(0xfd))/0x3)+parseInt(_0x2f9580(0xf6))/0x4*(-parseInt(_0x2f9580(0xe8))/0x5)+parseInt(_0x2f9580(0xee))/0x6*(parseInt(_0x2f9580(0xf8))/0x7)+parseInt(_0x2f9580(0xf2))/0x8+-parseInt(_0x2f9580(0x100))/0x9*(parseInt(_0x2f9580(0x101))/0xa)+parseInt(_0x2f9580(0xef))/0xb*(-parseInt(_0x2f9580(0xea))/0xc);if(_0x3489ca===_0x2097b7)break;else _0x303f28['push'](_0x303f28['shift']());}catch(_0x4d6bbd){_0x303f28['push'](_0x303f28['shift']());}}}(a27_0x48df,0x90056));import{BaseCommand}from'./command.js';function a27_0x51a7(_0x230b0b,_0x43ae89){_0x230b0b=_0x230b0b-0xe6;const _0x48df25=a27_0x48df();let _0x51a7de=_0x48df25[_0x230b0b];return _0x51a7de;}import{handleSDKOutput}from'../core/command-output.js';function a27_0x48df(){const _0x2b3eac=['site','618PAWqDW','15543nZOPuz','197163mytmzg','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','5838840RcRRpd','json','length','Parent\x20segment:\x20','1716bPymKV','Listing\x20fields\x20for\x20\x27','60067LhGmKJ','execute','listFields','2rjxLte','β\x20Found\x20','3001611fmncaU','verbose','data','144RTRRkt','195360GuZEgG','\x20field','error','11905CCMICr','Error:\x20Parent\x20segment\x20name\x20is\x20required','4188FLxLNS','\x27...','name'];a27_0x48df=function(){return _0x2b3eac;};return a27_0x48df();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x45ef2a(0xec)]='segment:fields';['description']='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x45ef2a(0xf9)](_0x5d35f9){const _0x38a99e=a27_0x45ef2a,{options:_0x1f2ab2,args:_0x128db7,tdx:_0x4d2079}=_0x5d35f9,_0x9e0eea=_0x128db7[0x0]||_0x1f2ab2['parentSegment'];if(!_0x9e0eea)return console[_0x38a99e(0xe7)](_0x38a99e(0xe9)),console[_0x38a99e(0xe7)](_0x38a99e(0xf1)),console[_0x38a99e(0xe7)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x1f2ab2[_0x38a99e(0xfe)]&&(console[_0x38a99e(0xe7)]('Site:\x20'+_0x1f2ab2[_0x38a99e(0xed)]),console['error'](_0x38a99e(0xf5)+_0x9e0eea));const _0x5aafca=await withSpinner(_0x38a99e(0xf7)+_0x9e0eea+_0x38a99e(0xeb),()=>_0x4d2079['segment'][_0x38a99e(0xfa)](_0x9e0eea),{'verbose':_0x1f2ab2['verbose']}),_0x157478=_0x5aafca[_0x38a99e(0xff)];console['error'](_0x38a99e(0xfc)+_0x157478[_0x38a99e(0xf4)]+_0x38a99e(0xe6)+(_0x157478[_0x38a99e(0xf4)]!==0x1?'s':''));if(_0x1f2ab2[_0x38a99e(0xf3)]||_0x1f2ab2['jsonl'])return await handleSDKOutput(_0x157478,_0x1f2ab2),0x0;return displayFieldsHumanReadable(_0x157478,_0x9e0eea),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a28_0x5751e8=a28_0x5a64;(function(_0x4a7fc1,_0x5051e8){const _0x39a6ca=a28_0x5a64,_0x5f45a9=_0x4a7fc1();while(!![]){try{const _0x420262=parseInt(_0x39a6ca(0x227))/0x1*(parseInt(_0x39a6ca(0x1e5))/0x2)+-parseInt(_0x39a6ca(0x1fc))/0x3+-parseInt(_0x39a6ca(0x204))/0x4*(-parseInt(_0x39a6ca(0x211))/0x5)+parseInt(_0x39a6ca(0x22b))/0x6+-parseInt(_0x39a6ca(0x200))/0x7+parseInt(_0x39a6ca(0x216))/0x8+parseInt(_0x39a6ca(0x224))/0x9*(-parseInt(_0x39a6ca(0x221))/0xa);if(_0x420262===_0x5051e8)break;else _0x5f45a9['push'](_0x5f45a9['shift']());}catch(_0x24eede){_0x5f45a9['push'](_0x5f45a9['shift']());}}}(a28_0x29b7,0x5fa34));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';function a28_0x5a64(_0x4d95ad,_0x4f6fef){_0x4d95ad=_0x4d95ad-0x1e4;const _0x29b75d=a28_0x29b7();let _0x5a6410=_0x29b75d[_0x4d95ad];return _0x5a6410;}function a28_0x29b7(){const _0x361c80=['repeat','Write\x20','11076hzmGEt','name','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parentName','Pulling\x20segments\x20from\x20\x27','\x20versions)','diff','helpText','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','targetDir','filter','green','segments','yellow','\x27...','length','error','cwd','utf-8','file','hasChanges','parentSegment','\x20\x20π―\x20','881916wElCYb','files','Parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','1484049kKsGIw','content','\x20\x20Target:\x20','no_parent','1579892QaxerC','counts','resourceName','\x0aChanges\x20to\x20\x27','\x20new\x20files','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','setPhase','Site:\x20','journeyVersions','journeys','\x20files?','Aborted.','5itZXMA','verbose','site','description','\x20=\x20','687656XQIUaF','dirname','data','session','dim','\x20segments','\x20journeys','β\x20All\x20files\x20are\x20up\x20to\x20date','\x20activations','relativePath','\x20unchanged\x20files','9276170rCsIhI','β\x20Pulled\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','9cJTetF','β\x20Context\x20set:\x20','pullSegments','134MMOlnk','isNew','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','absolutePath','3613836fwvdfZ','errorCode','cyan','type','parent_segment'];a28_0x29b7=function(){return _0x361c80;};return a28_0x29b7();}import{saveSessionContext}from'../core/session.js';import a28_0x2431f7 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x207d13 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0x5751e8(0x1e6)]='segment:pull';[a28_0x5751e8(0x214)]=a28_0x5751e8(0x223);async[a28_0x5751e8(0x209)](_0x9074ff){const _0x20d4e0=a28_0x5751e8,{options:_0x44b68b,args:_0x31e09,tdx:_0x33f72c}=_0x9074ff,_0x218be7=_0x44b68b,_0x425cbc=await resolveTarget({'arg':_0x31e09[0x0],'contextParent':_0x44b68b[_0x20d4e0(0x1fa)],'cwd':process[_0x20d4e0(0x1f6)]()});if(!isSuccessfulResolution(_0x425cbc))return _0x425cbc[_0x20d4e0(0x22c)]===_0x20d4e0(0x203)?(console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x1f2)](_0x20d4e0(0x229))),console[_0x20d4e0(0x1f5)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x20d4e0(0x20a)),console['error'](_0x20d4e0(0x1ed))):(console[_0x20d4e0(0x1f5)](a28_0x2431f7['red']('Error:\x20'+_0x425cbc['message']+'\x0a')),_0x425cbc[_0x20d4e0(0x1ec)]&&console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x22d)](_0x425cbc['helpText']))),0x1;const _0x3777f3=_0x425cbc[_0x20d4e0(0x1e8)],_0x179869=_0x425cbc['targetDir'],_0x3accbc=_0x425cbc[_0x20d4e0(0x22e)]===_0x20d4e0(0x1f8)?_0x425cbc[_0x20d4e0(0x206)]:undefined;_0x218be7[_0x20d4e0(0x212)]&&(console[_0x20d4e0(0x1f5)](_0x20d4e0(0x20c)+_0x218be7[_0x20d4e0(0x213)]),console[_0x20d4e0(0x1f5)](_0x20d4e0(0x1fe)+_0x3777f3),_0x3accbc&&console[_0x20d4e0(0x1f5)]('Target\x20resource:\x20'+_0x3accbc));const _0x3e0ba8=await withProgressSpinner(_0x20d4e0(0x1e9)+_0x3777f3+_0x20d4e0(0x1f3),_0x278293=>_0x33f72c['segment'][_0x20d4e0(0x226)](_0x3777f3,{'targetDir':_0x179869,'targetResourceName':_0x3accbc,'verbose':_0x218be7[_0x20d4e0(0x212)],'progress':{'update':_0x11b767=>{const _0xfdce80=_0x20d4e0;_0x278293[_0xfdce80(0x20b)](_0x11b767),_0x218be7[_0xfdce80(0x212)]&&console[_0xfdce80(0x1f5)]('\x20\x20'+_0x11b767);}}}),{'verbose':_0x218be7[_0x20d4e0(0x212)]}),_0x45d2cd=_0x3e0ba8[_0x20d4e0(0x218)];if(_0x45d2cd[_0x20d4e0(0x205)][_0x20d4e0(0x1f1)]===0x0&&_0x45d2cd['counts'][_0x20d4e0(0x20e)]===0x0)return console['error'](a28_0x2431f7['yellow'](_0x20d4e0(0x1e7)+_0x45d2cd[_0x20d4e0(0x1e8)]+'\x27')),0x0;const _0x27f665=_0x45d2cd[_0x20d4e0(0x1fd)][_0x20d4e0(0x1ef)](_0x50eea4=>_0x50eea4[_0x20d4e0(0x228)]),_0x559269=_0x45d2cd[_0x20d4e0(0x1fd)][_0x20d4e0(0x1ef)](_0x577a98=>!_0x577a98['isNew']&&_0x577a98[_0x20d4e0(0x1f9)]),_0x582d0a=_0x45d2cd['files']['filter'](_0x47d613=>!_0x47d613[_0x20d4e0(0x228)]&&!_0x47d613['hasChanges']);console[_0x20d4e0(0x1f5)]('\x0aPull\x20summary\x20for\x20\x27'+_0x45d2cd[_0x20d4e0(0x1e8)]+'\x27:'),console[_0x20d4e0(0x1f5)](_0x20d4e0(0x1fb)+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd[_0x20d4e0(0x205)][_0x20d4e0(0x1f1)]+_0x20d4e0(0x21b))+'\x20with\x20'+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd['counts']['activations']+_0x20d4e0(0x21e)));if(_0x45d2cd['counts'][_0x20d4e0(0x20e)]>0x0){const _0x5bb6a4=_0x45d2cd['counts'][_0x20d4e0(0x20d)]>_0x45d2cd[_0x20d4e0(0x205)][_0x20d4e0(0x20e)]?'\x20('+_0x45d2cd[_0x20d4e0(0x205)]['journeyVersions']+_0x20d4e0(0x1ea):'';console[_0x20d4e0(0x1f5)]('\x20\x20πΊοΈ\x20\x20'+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd['counts']['journeys']+_0x20d4e0(0x21c))+a28_0x2431f7[_0x20d4e0(0x21a)](_0x5bb6a4));}console[_0x20d4e0(0x1f5)]('\x20\x20'+a28_0x2431f7[_0x20d4e0(0x1f0)]('+\x20'+_0x27f665[_0x20d4e0(0x1f4)]+_0x20d4e0(0x208))),console[_0x20d4e0(0x1f5)]('\x20\x20'+a28_0x2431f7[_0x20d4e0(0x1f2)]('~\x20'+_0x559269[_0x20d4e0(0x1f4)]+'\x20changed\x20files')),console[_0x20d4e0(0x1f5)]('\x20\x20'+a28_0x2431f7[_0x20d4e0(0x21a)]('=\x20'+_0x582d0a[_0x20d4e0(0x1f4)]+_0x20d4e0(0x220))),console[_0x20d4e0(0x1f5)](_0x20d4e0(0x202)+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd[_0x20d4e0(0x1ee)])+'\x0a');if(_0x559269[_0x20d4e0(0x1f4)]>0x0)for(const _0x36de29 of _0x559269){console['error'](_0x20d4e0(0x207)+_0x36de29[_0x20d4e0(0x21f)]+'\x27:'),console[_0x20d4e0(0x1f5)]('β'[_0x20d4e0(0x230)](0x3c)),console[_0x20d4e0(0x1f5)](_0x36de29[_0x20d4e0(0x1eb)]),console[_0x20d4e0(0x1f5)]('β'['repeat'](0x3c));}if(_0x218be7['dryRun'])return console[_0x20d4e0(0x1f5)](a28_0x2431f7['yellow'](_0x20d4e0(0x1ff))),0x0;if(_0x27f665[_0x20d4e0(0x1f4)]===0x0&&_0x559269[_0x20d4e0(0x1f4)]===0x0)return console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x1f0)](_0x20d4e0(0x21d))),saveSessionContext({'parent_segment':_0x45d2cd['parentName']},_0x218be7[_0x20d4e0(0x219)]),console['error'](a28_0x2431f7[_0x20d4e0(0x1f0)](_0x20d4e0(0x225)+a28_0x2431f7[_0x20d4e0(0x21a)](_0x20d4e0(0x22f))+'\x20=\x20'+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd[_0x20d4e0(0x1e8)]))),0x0;if(!_0x218be7['yes']){const _0x3e67ca=await confirmKey(_0x20d4e0(0x1e4)+(_0x27f665[_0x20d4e0(0x1f4)]+_0x559269['length'])+_0x20d4e0(0x20f));if(!_0x3e67ca)return console[_0x20d4e0(0x1f5)](_0x20d4e0(0x210)),0x1;}for(const _0x28fc1d of _0x45d2cd[_0x20d4e0(0x1fd)]){if(_0x28fc1d['isNew']||_0x28fc1d[_0x20d4e0(0x1f9)]){const _0xce369=a28_0x207d13[_0x20d4e0(0x217)](_0x28fc1d[_0x20d4e0(0x22a)]);!existsSync(_0xce369)&&mkdirSync(_0xce369,{'recursive':!![]}),writeFileSync(_0x28fc1d[_0x20d4e0(0x22a)],_0x28fc1d[_0x20d4e0(0x201)],_0x20d4e0(0x1f7));}}return console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x1f0)](_0x20d4e0(0x222)+(_0x27f665['length']+_0x559269['length'])+'\x20files\x20to\x20'+_0x45d2cd[_0x20d4e0(0x1ee)])),saveSessionContext({'parent_segment':_0x45d2cd[_0x20d4e0(0x1e8)]},_0x218be7['session']),console[_0x20d4e0(0x1f5)](a28_0x2431f7[_0x20d4e0(0x1f0)](_0x20d4e0(0x225)+a28_0x2431f7['dim'](_0x20d4e0(0x22f))+_0x20d4e0(0x215)+a28_0x2431f7[_0x20d4e0(0x22d)](_0x45d2cd['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x1aaedb=a29_0x34e3;(function(_0x49e24e,_0xb6d422){const _0x480d08=a29_0x34e3,_0x257466=_0x49e24e();while(!![]){try{const _0x2f0d66=-parseInt(_0x480d08(0x112))/0x1*(-parseInt(_0x480d08(0x8a))/0x2)+-parseInt(_0x480d08(0xb5))/0x3*(parseInt(_0x480d08(0x124))/0x4)+parseInt(_0x480d08(0xbb))/0x5*(-parseInt(_0x480d08(0x106))/0x6)+parseInt(_0x480d08(0xe6))/0x7+parseInt(_0x480d08(0xbd))/0x8*(-parseInt(_0x480d08(0xd1))/0x9)+parseInt(_0x480d08(0x94))/0xa*(-parseInt(_0x480d08(0xdc))/0xb)+parseInt(_0x480d08(0x123))/0xc;if(_0x2f0d66===_0xb6d422)break;else _0x257466['push'](_0x257466['shift']());}catch(_0x43a38d){_0x257466['push'](_0x257466['shift']());}}}(a29_0x1fb6,0xcfddc));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x34e3(_0xf0de1e,_0x5f2a2b){_0xf0de1e=_0xf0de1e-0x86;const _0x1fb613=a29_0x1fb6();let _0x34e35c=_0x1fb613[_0xf0de1e];return _0x34e35c;}import{batchAsync}from'../utils/async.js';function a29_0x1fb6(){const _0x545402=['\x20folders\x20to\x20create','1759359pzXczf','resolveParentId','name','\x20\x20\x20\x20','Fetching\x20users\x20for\x20email\x20resolution...','Folders\x20to\x20create:','delete','set','.yml','all','Fetching\x20parent\x20segment\x20details...','π\x20','helpText','results','message','New\x20journey:','data','idToName','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','dim','\x20to\x20delete','Fetching\x20existing\x20journeys...','join','journeyId','dryRun','\x20deleted','endsWith','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','setPhase','\x20changes?','\x20unchanged','toDelete','540lmFypz','/e/','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','user','updated','errorCode','Scoped\x20to\x20folder:\x20','Fetching\x20existing\x20folders...','\x20new','repeat','journeyBundleId','\x20changed','1126847YosrEp','yes','getParent','/j/da/je','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','new','\x20\x20πΊοΈ\x20\x20Journeys:','connection','cwd','\x0aValidation\x20failed:','Parent\x20segment:\x20','cyan','description','journey','paused','Fetching\x20existing\x20activations...','relationships','37925628MmUEXJ','748MAzYlz','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Error\x20parsing\x20YAML:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','diff','add','2CZjiIJ','nameToType','\x20\x20Journeys:\x20','Error:\x20Directory\x20not\x20found:\x20','\x0aβ\x20Push\x20complete','\x20to\x20update','Fetching\x20connections\x20for\x20name\x20resolution...','length','Changes\x20to:','deleted','113770MDWXSz','state','New\x20segment:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Delete\x20segment:','yamlConfig','No\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','journeysOnly','red','existingJourney','toString','getJourney','blue','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','listJourneysWithDetailsFromParentSegment','getOutputSchemaWithCache','green','get','yellow','\x20created','Error:\x20','\x20YAML\x20files\x20found','Fetching\x20existing\x20segments...','toUpdate','filter','activations','map','isNew','buildUserMaps','journeys','site','23184onDXkr','segmentFolderId','Push\x20','Changes\x20to\x20journey:','.yaml','Delete\x20journey:','2095TMAEeI','listFolders','5608GgTGLW','segment','folderId','versionNumber','type','\x20updated','filePath','parentFolder','changed','parentName','\x20\x20Activations:','\x20activations]','audienceId','β\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aPush\x20summary\x20for\x20\x27','segments','listActivations','listSegments','Aborted.','error','20268ZvJarZ','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Source:\x20','journeyBundleName','toCreate','nameToId','then','no_parent','folders','verbose','\x20to\x20create','605XnjiXc','Resolving\x20parent\x20segment\x20\x27','push','folderPath','attributes','parent_name','created','(Journey\x20will\x20be\x20deleted)','/app/ps/'];a29_0x1fb6=function(){return _0x545402;};return a29_0x1fb6();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x41437a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a29_0x1aaedb(0xe8)]='segment:push';[a29_0x1aaedb(0x11e)]=a29_0x1aaedb(0x97);async['execute'](_0x1b86bc){const _0x518948=a29_0x1aaedb,{options:_0x2135c2,args:_0x589a59,tdx:_0x424321}=_0x1b86bc,_0x4b34ba=_0x2135c2,_0x28762e=await resolveTarget({'arg':_0x589a59[0x0],'contextParent':_0x2135c2['parentSegment'],'cwd':process[_0x518948(0x11a)]()});if(!isSuccessfulResolution(_0x28762e))return _0x28762e[_0x518948(0x10b)]===_0x518948(0xd8)?(console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x518948(0xd0)](_0x518948(0x125)),console[_0x518948(0xd0)](_0x518948(0x108)),console[_0x518948(0xd0)](_0x518948(0x9c))):(console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0xaa)+_0x28762e[_0x518948(0xf4)]+'\x0a')),_0x28762e[_0x518948(0xf2)]&&console['error'](a29_0x41437a['cyan'](_0x28762e['helpText']))),0x1;if(_0x28762e[_0x518948(0xc1)]===_0x518948(0xe1))return console['error'](a29_0x41437a['red'](_0x518948(0x8d)+_0x28762e['targetDir']+'\x0a')),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x11d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xb86f41=_0x28762e[_0x518948(0xc6)],_0x1ce4f7=_0x28762e['targetDir'],_0x1ea3f8=_0x28762e[_0x518948(0xc1)]==='file'?_0x28762e[_0x518948(0xc3)]:undefined,_0x4eb4d8=getScopedDetails(_0x28762e),_0x1e5a93=_0x4eb4d8?.['isScoped']??![],_0x25429c=_0x4eb4d8?.['scopedFolderPath']??'';if(!existsSync(_0x1ce4f7))return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x8d)+_0x1ce4f7+'\x0a')),console['error'](a29_0x41437a[_0x518948(0x11d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x4b34ba[_0x518948(0xda)]&&(console[_0x518948(0xd0)]('Site:\x20'+_0x4b34ba[_0x518948(0xb4)]),console[_0x518948(0xd0)](_0x518948(0x11c)+_0xb86f41),console[_0x518948(0xd0)]('Source\x20directory:\x20'+_0x1ce4f7),_0x1e5a93&&console[_0x518948(0xd0)](_0x518948(0x10c)+_0x25429c));const _0xa09d2d=await withSpinner(_0x518948(0xdd)+_0xb86f41+'\x27...',()=>_0x424321[_0x518948(0xbe)][_0x518948(0xe7)](_0xb86f41),{'verbose':_0x4b34ba['verbose']}),_0x39c6a2=_0xa09d2d['data'],[_0x405b34,_0x367368,_0x4835c7,_0x2f69e8,_0x472523]=await Promise[_0x518948(0xef)]([withSpinner(_0x518948(0xf0),()=>_0x424321['segment'][_0x518948(0x114)](_0x39c6a2),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0xac),()=>_0x424321[_0x518948(0xbe)][_0x518948(0xce)](_0x39c6a2),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0x10d),()=>_0x424321[_0x518948(0xbe)][_0x518948(0xbc)](_0x39c6a2),{'verbose':_0x4b34ba['verbose']}),withSpinner(_0x518948(0xfb),()=>_0x424321['journey'][_0x518948(0xa4)](_0x39c6a2,{'includeAllVersions':!![]}),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0xea),()=>_0x424321[_0x518948(0x109)][_0x518948(0xb2)](),{'verbose':_0x4b34ba[_0x518948(0xda)]})['then'](_0x269074=>_0x269074[_0x518948(0xf6)])]),_0xd07a0d=_0x405b34[_0x518948(0xf6)],_0x4b7a36=extractRootFolderId(_0xd07a0d),_0x371b81=_0x367368[_0x518948(0xf6)],_0x14438c=_0x4835c7['data'],{journeys:_0x52b3d2,activationStepsById:_0x105872}=_0x2f69e8['data'],_0x46c8e1=new Map(_0x52b3d2[_0x518948(0xb0)](_0x3b7b9d=>[_0x3b7b9d['id'],_0x3b7b9d])),_0x46f229=_0x52b3d2[_0x518948(0xb0)](_0xd7e947=>({'id':_0xd7e947['id'],'name':_0xd7e947[_0x518948(0xe0)]['name'],'journeyBundleName':_0xd7e947['attributes'][_0x518948(0xd4)]||'','journeyBundleId':_0xd7e947['attributes'][_0x518948(0x110)]||'','versionNumber':_0xd7e947[_0x518948(0xe0)][_0x518948(0xc0)],'description':_0xd7e947['attributes'][_0x518948(0x11e)],'state':_0xd7e947[_0x518948(0xe0)][_0x518948(0x95)],'paused':_0xd7e947[_0x518948(0xe0)][_0x518948(0x120)],'audienceId':_0xd7e947['attributes'][_0x518948(0xc9)],'folderId':_0xd7e947[_0x518948(0x122)]?.[_0x518948(0xc4)]?.[_0x518948(0xf6)]?.['id'],'createdAt':_0xd7e947[_0x518948(0xe0)]['createdAt'],'updatedAt':_0xd7e947[_0x518948(0xe0)]['updatedAt']})),{emailToId:_0x145a24,idToEmail:_0x7c5a05}=_0x472523,_0x10426c=await withSpinner(_0x518948(0x90),async()=>{const _0x15aa0a=_0x518948,_0x4d6aae=await _0x424321[_0x15aa0a(0x119)]['list']();return buildConnectionMaps(_0x4d6aae);},{'verbose':_0x4b34ba['verbose']})[_0x518948(0xd7)](_0x5f2b52=>_0x5f2b52[_0x518948(0xf6)]),_0x6c537d=_0x10426c[_0x518948(0xd6)],_0x246193=_0x10426c[_0x518948(0xf7)],_0x19d89f=_0x10426c[_0x518948(0x8b)],_0x37da93={'emailToIdMap':_0x145a24,'connectionNameToIdMap':_0x6c537d,'connectionNameToTypeMap':_0x19d89f,'getSchema':_0x361e23=>_0x424321[_0x518948(0x119)][_0x518948(0xa5)](_0x361e23)};let {pathToId:_0x46f139,idToPath:_0x253b15}=buildFolderMaps(_0x14438c);const _0xd620aa=buildSegmentLookupMap(_0x371b81,_0x253b15),_0x729cdc=buildSegmentNameToIdMap(_0x371b81),_0x16ff36=buildJourneyBundleLookupMap(_0x46f229,_0x253b15);let _0xa6c3e3;if(_0x1ea3f8){if(!_0x1ea3f8[_0x518948(0x100)](_0x518948(0xee))&&!_0x1ea3f8[_0x518948(0x100)](_0x518948(0xb9)))return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x116)+_0x1ea3f8+'\x0a')),0x1;_0xa6c3e3=[_0x1ea3f8];}else _0xa6c3e3=findYamlFiles(_0x1ce4f7);if(_0xa6c3e3['length']===0x0)return console[_0x518948(0xd0)](a29_0x41437a['red'](_0x518948(0xa3)+_0x1ce4f7+'\x0a')),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x11d)](_0x518948(0xf8))),0x1;let _0x3c727e,_0x373c4c;try{const _0x232888=parseAndClassifyYamlFiles(_0xa6c3e3,_0x1ce4f7,{'skipSegments':_0x4b34ba[_0x518948(0x9d)]});_0x3c727e=_0x232888[_0x518948(0xcc)],_0x373c4c=_0x232888['journeys'];const _0x3f70f3=validateParsedFiles(_0x232888,_0x1ce4f7);if(_0x3f70f3[_0x518948(0x91)]>0x0)return console['error'](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x11b))),console[_0x518948(0xd0)](formatValidationErrors(_0x3f70f3)),console['error'](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x87))),0x1;}catch(_0x30f82d){return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x86)+(_0x30f82d instanceof Error?_0x30f82d[_0x518948(0xf4)]:_0x30f82d))),0x1;}if(_0x3c727e[_0x518948(0x91)]===0x0&&_0x373c4c[_0x518948(0x91)]===0x0){const _0x332330=_0x4b34ba[_0x518948(0x9d)]?_0x518948(0x11f):'segment\x20or\x20journey';return console['error'](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x9a)+_0x332330+_0x518948(0xab))),0x0;}const _0x495d66=new Map();_0x371b81[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&await withSpinner(_0x518948(0x121),async()=>{await batchAsync(_0x371b81,async _0x4ab78b=>{const _0x1f4c1c=a29_0x34e3,_0x58d426=await _0x424321[_0x1f4c1c(0xbe)][_0x1f4c1c(0xcd)](_0x39c6a2,_0x4ab78b['id']);_0x495d66[_0x1f4c1c(0xed)](_0x4ab78b['id'],_0x58d426);});},{'verbose':_0x4b34ba[_0x518948(0xda)]});const {segmentFiles:_0x2a5e49,foldersToCreate:_0x20e931}=await prepareSegmentFiles(_0x3c727e,{'segmentByFolderAndName':_0xd620aa,'activationsBySegmentId':_0x495d66,'folderPathToId':_0x46f139,'idToEmailMap':_0x7c5a05,'connectionIdToNameMap':_0x246193},_0x37da93,_0x1e5a93,_0x25429c),_0x11cd80=_0x1ea3f8?[]:findSegmentsToDelete(_0x371b81,_0x3c727e[_0x518948(0xb0)](({yamlConfig:_0x4fd741,folderPath:_0x158eb8})=>({'yamlConfig':_0x4fd741,'folderPath':resolveTDFolderPath(_0x158eb8,_0x1e5a93,_0x25429c)})),_0x253b15,_0x25429c,_0x1e5a93),{journeyFiles:_0x1ea6d5,foldersToCreate:_0x83cd9d}=await withProgressSpinner('Preparing\x20journeys...',async _0x223637=>prepareJourneyFiles(_0x373c4c,{'fetchJourney':async _0x925d1d=>_0x424321[_0x518948(0x11f)][_0x518948(0xa1)](_0x925d1d[_0x518948(0xfd)]),'journeyBundlesByFolderAndName':_0x16ff36,'folderPathToId':_0x46f139,'idToEmailMap':_0x7c5a05,'connectionIdToNameMap':_0x246193,'existingSegments':_0x371b81,'parentId':_0x39c6a2,'deps':_0x424321,'progress':{'update':_0x5572ef=>{const _0x51814a=_0x518948;_0x223637[_0x51814a(0x102)](_0x5572ef),_0x4b34ba[_0x51814a(0xda)]&&console[_0x51814a(0xd0)]('\x20\x20'+_0x5572ef);}},'journeyById':_0x46c8e1,'activationStepsById':_0x105872},_0x1e5a93,_0x25429c),{'verbose':_0x4b34ba[_0x518948(0xda)]})[_0x518948(0xd7)](_0x3b6311=>_0x3b6311[_0x518948(0xf6)]);for(const _0x1b3b48 of _0x83cd9d){_0x20e931[_0x518948(0x89)](_0x1b3b48);}const _0xebf947=_0x1ea3f8?[]:findJourneysToDelete(_0x46f229,_0x373c4c[_0x518948(0xb0)](({yamlConfig:_0x5ed124,folderPath:_0x3e277a})=>({'yamlConfig':_0x5ed124,'folderPath':resolveTDFolderPath(_0x3e277a,_0x1e5a93,_0x25429c)})),_0x253b15,_0x25429c,_0x1e5a93),_0x302570=calculatePushStats(_0x2a5e49,_0x1ea6d5,_0x20e931,_0x11cd80,_0xebf947,!!_0x4b34ba[_0x518948(0xec)],!!_0x4b34ba[_0x518948(0x9d)]),_0x5b340c=_0x302570['segments'][_0x518948(0x117)],_0x2ac72d=_0x302570[_0x518948(0xcc)]['changed'],_0x29941c=_0x302570['segments']['unchanged'],_0x3ce5cf=_0x302570['segments']['toDelete'],_0x25c233=_0x302570[_0x518948(0xd9)][_0x518948(0xd5)],_0x1a7544=_0x302570[_0x518948(0xb3)][_0x518948(0x117)],_0x74bc24=_0x302570[_0x518948(0xb3)][_0x518948(0xc5)],_0x3ca522=_0x302570['journeys']['unchanged'],_0x597227=_0x302570['journeys'][_0x518948(0x105)],_0x1a5035=_0x302570[_0x518948(0xaf)]['all'],_0xaae605=_0x302570[_0x518948(0xaf)][_0x518948(0xd5)],_0x137c4e=_0x302570[_0x518948(0xaf)][_0x518948(0xad)],_0x4f93f6=_0x302570[_0x518948(0xaf)][_0x518948(0x105)];console['error'](_0x518948(0xcb)+_0xb86f41+'\x27:');_0x25c233[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a[_0x518948(0xa2)](_0x518948(0xf1)+_0x25c233[_0x518948(0x91)]+_0x518948(0xe5)));if(!_0x4b34ba[_0x518948(0x9d)]){console[_0x518948(0xd0)]('\x20\x20π\x20Segments:'),console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0x5b340c[_0x518948(0x91)]+_0x518948(0x10e))),console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a['yellow']('~\x20'+_0x2ac72d[_0x518948(0x91)]+'\x20changed'));if(_0x3ce5cf[_0x518948(0x91)]>0x0)console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a['red']('-\x20'+_0x3ce5cf[_0x518948(0x91)]+'\x20to\x20delete'));else _0x11cd80[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0xec)]&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)](_0x11cd80[_0x518948(0x91)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)]('=\x20'+_0x29941c['length']+_0x518948(0x104)));}if(_0x1ea6d5[_0x518948(0x91)]>0x0||_0xebf947[_0x518948(0x91)]>0x0){console[_0x518948(0xd0)](_0x518948(0x118)),console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0x1a7544[_0x518948(0x91)]+_0x518948(0x10e))),console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xa8)]('~\x20'+_0x74bc24[_0x518948(0x91)]+_0x518948(0x111)));if(_0x597227['length']>0x0)console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0x9e)]('-\x20'+_0x597227[_0x518948(0x91)]+_0x518948(0xfa)));else _0xebf947[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0xec)]&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)](_0xebf947[_0x518948(0x91)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xf9)]('=\x20'+_0x3ca522[_0x518948(0x91)]+'\x20unchanged'));}_0x1a5035['length']>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&(console['error'](''),console[_0x518948(0xd0)](_0x518948(0xc7)),_0xaae605[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0xaae605[_0x518948(0x91)]+_0x518948(0xdb))),_0x137c4e[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa8)]('~\x20'+_0x137c4e[_0x518948(0x91)]+_0x518948(0x8f))),_0x4f93f6[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0x9e)]('-\x20'+_0x4f93f6['length']+_0x518948(0xfa))));console[_0x518948(0xd0)](_0x518948(0xd3)+a29_0x41437a[_0x518948(0x11d)](_0x1ce4f7)+'\x0a');if(_0x25c233['length']>0x0){console[_0x518948(0xd0)](_0x518948(0xeb));for(const _0x1b6601 of _0x25c233){console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a[_0x518948(0xa2)]('+')+'\x20'+_0x1b6601);}console['error']('');}if(_0x5b340c[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)])for(const _0x3d7c97 of _0x5b340c){const _0x133ca7=_0x3d7c97[_0x518948(0xdf)]?_0x3d7c97[_0x518948(0xdf)]+'/'+_0x3d7c97[_0x518948(0x99)][_0x518948(0xe8)]:_0x3d7c97[_0x518948(0x99)]['name'],_0x453bca=_0x3d7c97[_0x518948(0x99)][_0x518948(0xaf)]?.[_0x518948(0x91)]||0x0,_0x5745dc=_0x453bca>0x0?a29_0x41437a['dim']('\x20['+_0x453bca+'\x20activations]'):'';console[_0x518948(0xd0)]('\x0a'+a29_0x41437a[_0x518948(0xa6)](_0x518948(0x96))+'\x20'+_0x133ca7+_0x5745dc),console[_0x518948(0xd0)]('β'[_0x518948(0x10f)](0x3c)),_0x3d7c97[_0x518948(0x88)]&&console['error'](_0x3d7c97[_0x518948(0x88)]),console[_0x518948(0xd0)]('β'[_0x518948(0x10f)](0x3c));}if(_0x3ce5cf['length']>0x0&&!_0x4b34ba['journeysOnly'])for(const _0x1a6cd0 of _0x3ce5cf){const _0x2ae34a=_0x1a6cd0[_0x518948(0xb6)]?_0x253b15[_0x518948(0xa7)](_0x1a6cd0[_0x518948(0xb6)][_0x518948(0xa0)]())||'':'',_0x4d2582=_0x2ae34a?_0x2ae34a+'/'+_0x1a6cd0['name']:_0x1a6cd0[_0x518948(0xe8)],_0x16e402=_0x495d66[_0x518948(0xa7)](_0x1a6cd0['id'])||[],_0x531330=_0x16e402[_0x518948(0x91)]>0x0?a29_0x41437a['dim']('\x20['+_0x16e402['length']+_0x518948(0xc8)):'';console[_0x518948(0xd0)]('\x0a'+a29_0x41437a[_0x518948(0x9e)](_0x518948(0x98))+'\x20'+_0x4d2582+_0x531330),console[_0x518948(0xd0)]('β'[_0x518948(0x10f)](0x3c));const _0x214578=segmentWithActivationsToYaml(_0x1a6cd0,_0x16e402,undefined,_0x7c5a05,_0x246193),_0x5a862c=segmentToYamlString(_0x214578),_0x311952=generateDiff(_0x5a862c,'');console[_0x518948(0xd0)](formatDiffWithColors(_0x311952)),console[_0x518948(0xd0)]('β'[_0x518948(0x10f)](0x3c));}const _0x4663b2=_0x2a5e49['filter'](_0x206eec=>!_0x206eec[_0x518948(0xb1)]&&_0x206eec[_0x518948(0x88)]);if(_0x4663b2[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)])for(const _0x28ed3b of _0x4663b2){const _0x56e5cd=_0x28ed3b[_0x518948(0xdf)]?_0x28ed3b[_0x518948(0xdf)]+'/'+_0x28ed3b[_0x518948(0x99)][_0x518948(0xe8)]:_0x28ed3b[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a['yellow'](_0x518948(0x92))+'\x20'+_0x56e5cd),console[_0x518948(0xd0)]('β'['repeat'](0x3c)),console[_0x518948(0xd0)](_0x28ed3b[_0x518948(0x88)]),console[_0x518948(0xd0)]('β'[_0x518948(0x10f)](0x3c));}if(_0x1a7544[_0x518948(0x91)]>0x0)for(const _0x166982 of _0x1a7544){const _0x483292=_0x166982[_0x518948(0xdf)]?_0x166982[_0x518948(0xdf)]+'/'+_0x166982['yamlConfig']['name']:_0x166982[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a[_0x518948(0xa6)](_0x518948(0xf5))+'\x20'+_0x483292),console[_0x518948(0xd0)]('β'['repeat'](0x3c)),_0x166982[_0x518948(0x88)]&&console[_0x518948(0xd0)](_0x166982['diff']),console[_0x518948(0xd0)]('β'['repeat'](0x3c));}const _0x574fac=_0x1ea6d5[_0x518948(0xae)](_0x3bae4a=>!_0x3bae4a[_0x518948(0xb1)]&&_0x3bae4a['diff']);if(_0x574fac[_0x518948(0x91)]>0x0)for(const _0x4dac8a of _0x574fac){const _0xa86708=_0x4dac8a[_0x518948(0xdf)]?_0x4dac8a[_0x518948(0xdf)]+'/'+_0x4dac8a[_0x518948(0x99)][_0x518948(0xe8)]:_0x4dac8a[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a[_0x518948(0xa8)](_0x518948(0xb8))+'\x20'+_0xa86708),console['error']('β'['repeat'](0x3c)),console['error'](_0x4dac8a['diff']),console[_0x518948(0xd0)]('β'[_0x518948(0x10f)](0x3c));}if(_0x597227[_0x518948(0x91)]>0x0)for(const _0x2026a5 of _0x597227){const _0x2e345b=_0x2026a5[_0x518948(0xbf)]?_0x253b15[_0x518948(0xa7)](_0x2026a5[_0x518948(0xbf)])||'':'',_0x2e4535=_0x2e345b?_0x2e345b+'/'+_0x2026a5[_0x518948(0xd4)]:_0x2026a5['journeyBundleName'];console[_0x518948(0xd0)]('\x0a'+a29_0x41437a['red'](_0x518948(0xba))+'\x20'+_0x2e4535),console[_0x518948(0xd0)]('β'['repeat'](0x3c)),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0xe3))),console[_0x518948(0xd0)]('β'[_0x518948(0x10f)](0x3c));}if(_0x4b34ba[_0x518948(0xfe)])return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x9b))),0x0;const _0x179ff7=_0x4b34ba[_0x518948(0x9d)]?![]:_0x5b340c[_0x518948(0x91)]>0x0||_0x2ac72d[_0x518948(0x91)]>0x0||_0x3ce5cf[_0x518948(0x91)]>0x0,_0x356d57=_0x1a7544[_0x518948(0x91)]>0x0||_0x74bc24[_0x518948(0x91)]>0x0||_0x597227[_0x518948(0x91)]>0x0,_0x4ce680=_0x4b34ba[_0x518948(0x9d)]?![]:_0x1a5035[_0x518948(0x91)]>0x0,_0x552a5f=_0x25c233[_0x518948(0x91)]>0x0;if(!_0x179ff7&&!_0x356d57&&!_0x4ce680&&!_0x552a5f){const _0x523706=_0x4b34ba['journeysOnly']?_0x518948(0xca):_0x518948(0xd2);console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa6)](_0x523706));if(_0x1ea3f8&&_0x3ca522['length']===0x1){const _0x5377a2=_0x3ca522[0x0];if(_0x5377a2[_0x518948(0x9f)]?.['id']){const _0xa54812=getConsoleNextUrl(_0x4b34ba[_0x518948(0xb4)],'/app/ps/'+_0x39c6a2+_0x518948(0x107)+_0x5377a2[_0x518948(0x9f)]['id']+_0x518948(0x115));console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a['cyan'](_0xa54812));}}return 0x0;}const _0x2010b7=_0x4b34ba[_0x518948(0x9d)]?_0x1a7544[_0x518948(0x91)]+_0x74bc24[_0x518948(0x91)]+_0x597227['length']+_0x25c233[_0x518948(0x91)]:_0x5b340c[_0x518948(0x91)]+_0x2ac72d[_0x518948(0x91)]+_0x3ce5cf[_0x518948(0x91)]+_0x1a7544[_0x518948(0x91)]+_0x74bc24[_0x518948(0x91)]+_0x597227[_0x518948(0x91)]+_0x25c233[_0x518948(0x91)]+_0x1a5035['length'];if(!_0x4b34ba[_0x518948(0x113)]&&_0x2010b7>0x0){const _0x115faa=await confirmKey(_0x518948(0xb7)+_0x2010b7+_0x518948(0x103));if(!_0x115faa)return console[_0x518948(0xd0)](_0x518948(0xcf)),0x1;}const _0x261f6b={'withProgress':async(_0x481da8,_0x3f6bf8)=>{const _0x294a55=_0x518948,_0x23d9c8=await withSpinner(_0x481da8,_0x3f6bf8,{'verbose':_0x4b34ba[_0x294a55(0xda)]});return{'data':_0x23d9c8[_0x294a55(0xf6)]};},'logInfo':_0x4d0a4c=>console[_0x518948(0xd0)](a29_0x41437a['blue']('β\x20'+_0x4d0a4c)),'logSuccess':_0x333b42=>console['error'](a29_0x41437a['green']('β\x20'+_0x333b42)),'logWarning':_0x14c67a=>console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)]('β \x20'+_0x14c67a)),'logDeleted':_0x1923f3=>console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)]('β\x20'+_0x1923f3))},_0x3415f4={'segment':_0x424321['segment'],'journey':_0x424321[_0x518948(0x11f)],'user':_0x424321[_0x518948(0x109)],'connection':_0x424321[_0x518948(0x119)]};_0x25c233['length']>0x0&&(_0x46f139=await executePushFolders(_0x3415f4,_0x25c233,_0x46f139,{'parentId':_0x39c6a2},_0x261f6b));const _0x407b02={'rootFolderId':_0x4b7a36,'folderPathToId':_0x46f139,'folderIdToPath':_0x253b15,'segmentNameToId':_0x729cdc,'activationsBySegmentId':_0x495d66,'emailToIdMap':_0x145a24,'idToEmailMap':_0x7c5a05,'connectionNameToIdMap':_0x10426c[_0x518948(0xd6)],'connectionIdToNameMap':_0x10426c[_0x518948(0xf7)],'connectionNameToTypeMap':_0x19d89f},_0x319af7=await executePushSegments(_0x3415f4,_0x4b34ba[_0x518948(0x9d)]?[]:_0x2a5e49,_0x407b02,{'parentId':_0x39c6a2},_0x261f6b),_0x5177d4=_0x319af7[_0x518948(0xe2)],_0x511627=_0x319af7[_0x518948(0x10a)],_0x4045e3=_0x319af7['activations'][_0x518948(0xe2)],_0x40688d=_0x319af7[_0x518948(0xaf)][_0x518948(0x10a)],_0x493d33=_0x319af7[_0x518948(0xaf)][_0x518948(0x93)],_0x515328=await executePushSegmentDeletions(_0x3415f4,_0x4b34ba[_0x518948(0x9d)]?[]:_0x3ce5cf,_0x261f6b);let _0x2b944f=0x0,_0x3c7994=0x0,_0x546f29=0x0;const _0x26a477=new Map(_0x729cdc);for(const [_0x9f5684,_0x3a29e2]of _0x319af7['createdSegmentIds']){_0x26a477[_0x518948(0xed)](_0x9f5684,_0x3a29e2);}if(_0x1ea6d5[_0x518948(0x91)]>0x0){const _0x5a2787={..._0x407b02,'segmentNameToId':_0x26a477,'existingSegments':_0x371b81,'activationContext':_0x37da93},_0x24a290=await executePushJourneys(_0x3415f4,_0x1ea6d5,_0x5a2787,{'parentId':_0x39c6a2,'rootFolderId':_0x4b7a36,'verbose':_0x4b34ba[_0x518948(0xda)]},_0x261f6b);_0x2b944f=_0x24a290[_0x518948(0xe2)],_0x3c7994=_0x24a290[_0x518948(0x10a)];if(_0x1ea3f8&&_0x24a290[_0x518948(0xf3)][_0x518948(0x91)]===0x1){const _0x553910=_0x24a290['results'][0x0];if(_0x553910[_0x518948(0xfd)]){const _0x37aecb=getConsoleNextUrl(_0x4b34ba['site'],_0x518948(0xe4)+_0x39c6a2+'/e/'+_0x553910['journeyId']+'/j/da/je');console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a['cyan'](_0x37aecb));}}}for(const _0x59fba4 of _0x597227){console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x101)+_0x59fba4[_0x518948(0xd4)])),_0x546f29++;}const _0x518ee0=[];if(_0x5177d4>0x0)_0x518ee0[_0x518948(0xde)](_0x5177d4+_0x518948(0xa9));if(_0x511627>0x0)_0x518ee0['push'](_0x511627+_0x518948(0xc2));if(_0x515328>0x0)_0x518ee0[_0x518948(0xde)](_0x515328+'\x20deleted');const _0x115bb3=[];if(_0x2b944f>0x0)_0x115bb3[_0x518948(0xde)](_0x2b944f+'\x20created');if(_0x3c7994>0x0)_0x115bb3['push'](_0x3c7994+_0x518948(0xc2));if(_0x546f29>0x0)_0x115bb3[_0x518948(0xde)](_0x546f29+_0x518948(0xff));const _0x484924=[];if(_0x4045e3>0x0)_0x484924['push'](_0x4045e3+_0x518948(0xa9));if(_0x40688d>0x0)_0x484924['push'](_0x40688d+_0x518948(0xc2));if(_0x493d33>0x0)_0x484924[_0x518948(0xde)](_0x493d33+_0x518948(0xff));return console['error'](a29_0x41437a['green'](_0x518948(0x8e))),_0x518ee0[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&console[_0x518948(0xd0)]('\x20\x20Segments:\x20'+_0x518ee0[_0x518948(0xfc)](',\x20')),_0x115bb3[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0x8c)+_0x115bb3[_0x518948(0xfc)](',\x20')),_0x484924[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&console[_0x518948(0xd0)]('\x20\x20Activations:\x20'+_0x484924[_0x518948(0xfc)](',\x20')),0x0;}}
|
|
1
|
+
const a29_0x286f31=a29_0x5032;function a29_0x5032(_0x176864,_0x16307c){_0x176864=_0x176864-0x7a;const _0x45aab8=a29_0x45aa();let _0x50322a=_0x45aab8[_0x176864];return _0x50322a;}(function(_0x3cf8db,_0x1a6194){const _0x327aae=a29_0x5032,_0x45d452=_0x3cf8db();while(!![]){try{const _0x158b6f=-parseInt(_0x327aae(0xaa))/0x1*(-parseInt(_0x327aae(0xdd))/0x2)+-parseInt(_0x327aae(0x90))/0x3*(parseInt(_0x327aae(0xbc))/0x4)+parseInt(_0x327aae(0xae))/0x5*(parseInt(_0x327aae(0xb6))/0x6)+parseInt(_0x327aae(0x106))/0x7*(-parseInt(_0x327aae(0x8c))/0x8)+parseInt(_0x327aae(0x9f))/0x9*(-parseInt(_0x327aae(0xec))/0xa)+parseInt(_0x327aae(0xd9))/0xb+parseInt(_0x327aae(0x87))/0xc;if(_0x158b6f===_0x1a6194)break;else _0x45d452['push'](_0x45d452['shift']());}catch(_0x3c7dfc){_0x45d452['push'](_0x45d452['shift']());}}}(a29_0x45aa,0x7caab));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x7fbe0c from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a29_0x45aa(){const _0x44a96f=['\x20activations]','setPhase','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','journeysOnly','listJourneysWithDetailsFromParentSegment','isNew','description','new','push','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toCreate','delete','journeys','Scoped\x20to\x20folder:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','.yaml','toDelete','653988fOUcyG','length','folders','createdAt','isScoped','4184QjRiDn','Error:\x20Directory\x20not\x20found:\x20','parent_name','endsWith','15SHZCIk','Delete\x20journey:','attributes','\x20changes?','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','activations','Source\x20directory:\x20','existingJourney','Aborted.','filePath','β\x20All\x20journeys\x20are\x20up\x20to\x20date','(Journey\x20will\x20be\x20deleted)','dim','Changes\x20to\x20journey:','9vjUbDC','segments','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','data','join','Fetching\x20connections\x20for\x20name\x20resolution...','resolveParentId','\x20\x20Activations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','then','1vELsOs','segment:push','yellow','versionNumber','130ahkJTp','journeyBundleName','journeyId','unchanged','audienceId','segment\x20or\x20journey','\x20new','Changes\x20to:','74274pIWFot','/j/da/je','connection','segmentFolderId','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','filter','481196UhFWDj','yes','Resolving\x20parent\x20segment\x20\x27','changed','set','green','scopedFolderPath','segment','results','\x20to\x20update','\x20unchanged','Fetching\x20existing\x20journeys...','\x0aβ\x20Push\x20complete','\x20updated','relationships','idToName','\x20folders\x20to\x20create','\x20created','Delete\x20segment:','\x20to\x20delete','folderPath','created','helpText','getJourney','\x20\x20Journeys:\x20','/e/','parentSegment','site','\x20\x20Activations:','10567205SnimDs','type','nameToId','message','1797872DaPdlD','blue','getOutputSchemaWithCache','verbose','\x20\x20π\x20Segments:','buildUserMaps','.yml','red','get','user','repeat','journey','folderId','New\x20journey:','name','5071970nHIVvZ','error','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','yamlConfig','state','\x0aValidation\x20failed:','Fetching\x20parent\x20segment\x20details...','toUpdate','file','\x27...','\x20YAML\x20files\x20found','updatedAt','all','\x20\x20\x20\x20','diff','\x20changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','paused','Push\x20','updated','cwd','Site:\x20','\x20deleted','Fetching\x20existing\x20activations...','\x20\x20Source:\x20','targetDir','8253yYqhtm','Parent\x20segment:\x20','map','cyan','/app/ps/','Fetching\x20existing\x20segments...'];a29_0x45aa=function(){return _0x44a96f;};return a29_0x45aa();}export class SegmentPushCommand extends BaseCommand{[a29_0x286f31(0xeb)]=a29_0x286f31(0xab);[a29_0x286f31(0x7b)]=a29_0x286f31(0xa8);async['execute'](_0x27d89b){const _0x58d216=a29_0x286f31,{options:_0x413651,args:_0xcdf34,tdx:_0x399eaa}=_0x27d89b,_0x319cb7=_0x413651,_0x19cdfa=await resolveTarget({'arg':_0xcdf34[0x0],'contextParent':_0x413651[_0x58d216(0xd6)],'cwd':process[_0x58d216(0x100)]()});if(!isSuccessfulResolution(_0x19cdfa))return _0x19cdfa['errorCode']===_0x58d216(0x94)?(console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0x95))),console[_0x58d216(0xed)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x58d216(0xed)](_0x58d216(0xfc)),console[_0x58d216(0xed)](_0x58d216(0x84))):(console[_0x58d216(0xed)](a29_0x7fbe0c['red']('Error:\x20'+_0x19cdfa[_0x58d216(0xdc)]+'\x0a')),_0x19cdfa[_0x58d216(0xd2)]&&console['error'](a29_0x7fbe0c[_0x58d216(0x109)](_0x19cdfa[_0x58d216(0xd2)]))),0x1;if(_0x19cdfa['type']===_0x58d216(0x8e))return console['error'](a29_0x7fbe0c['red'](_0x58d216(0x8d)+_0x19cdfa[_0x58d216(0x105)]+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0x7f))),0x1;const _0x4ccf37=_0x19cdfa['parentName'],_0x4f20d6=_0x19cdfa['targetDir'],_0xc70a1c=_0x19cdfa[_0x58d216(0xda)]===_0x58d216(0xf4)?_0x19cdfa[_0x58d216(0x9a)]:undefined,_0x5706ec=getScopedDetails(_0x19cdfa),_0x15a0cd=_0x5706ec?.[_0x58d216(0x8b)]??![],_0x1b7f36=_0x5706ec?.[_0x58d216(0xc2)]??'';if(!existsSync(_0x4f20d6))return console[_0x58d216(0xed)](a29_0x7fbe0c['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x4f20d6+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0x7f))),0x1;_0x319cb7['verbose']&&(console['error'](_0x58d216(0x101)+_0x319cb7[_0x58d216(0xd7)]),console[_0x58d216(0xed)](_0x58d216(0x107)+_0x4ccf37),console[_0x58d216(0xed)](_0x58d216(0x97)+_0x4f20d6),_0x15a0cd&&console[_0x58d216(0xed)](_0x58d216(0x83)+_0x1b7f36));const _0x381885=await withSpinner(_0x58d216(0xbe)+_0x4ccf37+_0x58d216(0xf5),()=>_0x399eaa['segment'][_0x58d216(0xa5)](_0x4ccf37),{'verbose':_0x319cb7['verbose']}),_0x91d0a1=_0x381885[_0x58d216(0xa2)],[_0x567b6a,_0x528521,_0x3b2915,_0x30c69f,_0x4f0302]=await Promise[_0x58d216(0xf8)]([withSpinner(_0x58d216(0xf2),()=>_0x399eaa[_0x58d216(0xc3)]['getParent'](_0x91d0a1),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner(_0x58d216(0x10b),()=>_0x399eaa[_0x58d216(0xc3)]['listSegments'](_0x91d0a1),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x399eaa['segment']['listFolders'](_0x91d0a1),{'verbose':_0x319cb7['verbose']}),withSpinner(_0x58d216(0xc7),()=>_0x399eaa['journey'][_0x58d216(0x110)](_0x91d0a1,{'includeAllVersions':!![]}),{'verbose':_0x319cb7[_0x58d216(0xe0)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x399eaa[_0x58d216(0xe6)][_0x58d216(0xe2)](),{'verbose':_0x319cb7[_0x58d216(0xe0)]})[_0x58d216(0xa9)](_0x159059=>_0x159059['data'])]),_0x3bf602=_0x567b6a['data'],_0x1a2c89=extractRootFolderId(_0x3bf602),_0x5f0e92=_0x528521[_0x58d216(0xa2)],_0x23c4d6=_0x3b2915['data'],{journeys:_0x2de25c,activationStepsById:_0x2cd6f0}=_0x30c69f[_0x58d216(0xa2)],_0x350907=new Map(_0x2de25c[_0x58d216(0x108)](_0xcd70e3=>[_0xcd70e3['id'],_0xcd70e3])),_0x1443e4=_0x2de25c['map'](_0x2bd938=>({'id':_0x2bd938['id'],'name':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xeb)],'journeyBundleName':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xaf)]||'','journeyBundleId':_0x2bd938[_0x58d216(0x92)]['journeyBundleId']||'','versionNumber':_0x2bd938['attributes'][_0x58d216(0xad)],'description':_0x2bd938['attributes'][_0x58d216(0x7b)],'state':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xf0)],'paused':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xfd)],'audienceId':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xb2)],'folderId':_0x2bd938[_0x58d216(0xca)]?.['parentFolder']?.[_0x58d216(0xa2)]?.['id'],'createdAt':_0x2bd938[_0x58d216(0x92)][_0x58d216(0x8a)],'updatedAt':_0x2bd938[_0x58d216(0x92)][_0x58d216(0xf7)]})),{emailToId:_0x477eb4,idToEmail:_0xb51417}=_0x4f0302,_0x19a77d=await withSpinner(_0x58d216(0xa4),async()=>{const _0x4115dc=_0x58d216,_0x22f274=await _0x399eaa[_0x4115dc(0xb8)]['list']();return buildConnectionMaps(_0x22f274);},{'verbose':_0x319cb7['verbose']})[_0x58d216(0xa9)](_0x43ff9f=>_0x43ff9f['data']),_0x5a408c=_0x19a77d['nameToId'],_0x2df1e4=_0x19a77d[_0x58d216(0xcb)],_0x577615=_0x19a77d['nameToType'],_0x58d223={'emailToIdMap':_0x477eb4,'connectionNameToIdMap':_0x5a408c,'connectionNameToTypeMap':_0x577615,'getSchema':_0x114f03=>_0x399eaa['connection'][_0x58d216(0xdf)](_0x114f03)};let {pathToId:_0x10d0aa,idToPath:_0x5d16f2}=buildFolderMaps(_0x23c4d6);const _0x5c23ac=buildSegmentLookupMap(_0x5f0e92,_0x5d16f2),_0x256e2c=buildSegmentNameToIdMap(_0x5f0e92),_0x3ed365=buildJourneyBundleLookupMap(_0x1443e4,_0x5d16f2);let _0x531b4b;if(_0xc70a1c){if(!_0xc70a1c[_0x58d216(0x8f)](_0x58d216(0xe3))&&!_0xc70a1c[_0x58d216(0x8f)](_0x58d216(0x85)))return console[_0x58d216(0xed)](a29_0x7fbe0c['red'](_0x58d216(0x10e)+_0xc70a1c+'\x0a')),0x1;_0x531b4b=[_0xc70a1c];}else _0x531b4b=findYamlFiles(_0x4f20d6);if(_0x531b4b[_0x58d216(0x88)]===0x0)return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4f20d6+'\x0a')),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0x109)](_0x58d216(0xee))),0x1;let _0x253d63,_0x55c8e2;try{const _0x2aea0f=parseAndClassifyYamlFiles(_0x531b4b,_0x4f20d6,{'skipSegments':_0x319cb7[_0x58d216(0x10f)]});_0x253d63=_0x2aea0f[_0x58d216(0xa0)],_0x55c8e2=_0x2aea0f[_0x58d216(0x82)];const _0x403527=validateParsedFiles(_0x2aea0f,_0x4f20d6);if(_0x403527[_0x58d216(0x88)]>0x0)return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0xf1))),console[_0x58d216(0xed)](formatValidationErrors(_0x403527)),console['error'](a29_0x7fbe0c[_0x58d216(0xac)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1504a9){return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('Error\x20parsing\x20YAML:\x20'+(_0x1504a9 instanceof Error?_0x1504a9[_0x58d216(0xdc)]:_0x1504a9))),0x1;}if(_0x253d63['length']===0x0&&_0x55c8e2[_0x58d216(0x88)]===0x0){const _0x134342=_0x319cb7['journeysOnly']?_0x58d216(0xe8):_0x58d216(0xb3);return console[_0x58d216(0xed)](a29_0x7fbe0c['yellow']('No\x20'+_0x134342+_0x58d216(0xf6))),0x0;}const _0x401037=new Map();_0x5f0e92['length']>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&await withSpinner(_0x58d216(0x103),async()=>{await batchAsync(_0x5f0e92,async _0x6f161b=>{const _0x54b17c=a29_0x5032,_0xd33def=await _0x399eaa[_0x54b17c(0xc3)]['listActivations'](_0x91d0a1,_0x6f161b['id']);_0x401037[_0x54b17c(0xc0)](_0x6f161b['id'],_0xd33def);});},{'verbose':_0x319cb7[_0x58d216(0xe0)]});const {segmentFiles:_0x5e9c13,foldersToCreate:_0x5e2ea7}=await prepareSegmentFiles(_0x253d63,{'segmentByFolderAndName':_0x5c23ac,'activationsBySegmentId':_0x401037,'folderPathToId':_0x10d0aa,'idToEmailMap':_0xb51417,'connectionIdToNameMap':_0x2df1e4},_0x58d223,_0x15a0cd,_0x1b7f36),_0x17b982=_0xc70a1c?[]:findSegmentsToDelete(_0x5f0e92,_0x253d63[_0x58d216(0x108)](({yamlConfig:_0x43734a,folderPath:_0x25f057})=>({'yamlConfig':_0x43734a,'folderPath':resolveTDFolderPath(_0x25f057,_0x15a0cd,_0x1b7f36)})),_0x5d16f2,_0x1b7f36,_0x15a0cd),{journeyFiles:_0x4df179,foldersToCreate:_0xc3772f}=await withProgressSpinner('Preparing\x20journeys...',async _0x20f955=>prepareJourneyFiles(_0x55c8e2,{'fetchJourney':async _0x35bc58=>_0x399eaa[_0x58d216(0xe8)][_0x58d216(0xd3)](_0x35bc58[_0x58d216(0xb0)]),'journeyBundlesByFolderAndName':_0x3ed365,'folderPathToId':_0x10d0aa,'idToEmailMap':_0xb51417,'connectionIdToNameMap':_0x2df1e4,'existingSegments':_0x5f0e92,'parentId':_0x91d0a1,'deps':_0x399eaa,'progress':{'update':_0x4d8892=>{const _0x556f1e=_0x58d216;_0x20f955[_0x556f1e(0x10d)](_0x4d8892),_0x319cb7[_0x556f1e(0xe0)]&&console['error']('\x20\x20'+_0x4d8892);}},'journeyById':_0x350907,'activationStepsById':_0x2cd6f0},_0x15a0cd,_0x1b7f36),{'verbose':_0x319cb7[_0x58d216(0xe0)]})['then'](_0x21d58d=>_0x21d58d[_0x58d216(0xa2)]);for(const _0x42fca1 of _0xc3772f){_0x5e2ea7['add'](_0x42fca1);}const _0xfed488=_0xc70a1c?[]:findJourneysToDelete(_0x1443e4,_0x55c8e2[_0x58d216(0x108)](({yamlConfig:_0x58e286,folderPath:_0x3b6fa3})=>({'yamlConfig':_0x58e286,'folderPath':resolveTDFolderPath(_0x3b6fa3,_0x15a0cd,_0x1b7f36)})),_0x5d16f2,_0x1b7f36,_0x15a0cd),_0x3a4b5b=calculatePushStats(_0x5e9c13,_0x4df179,_0x5e2ea7,_0x17b982,_0xfed488,!!_0x319cb7[_0x58d216(0x81)],!!_0x319cb7['journeysOnly']),_0x3d724c=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0x7c)],_0x551952=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0xbf)],_0x25023c=_0x3a4b5b[_0x58d216(0xa0)]['unchanged'],_0x3c5349=_0x3a4b5b[_0x58d216(0xa0)][_0x58d216(0x86)],_0x1126e4=_0x3a4b5b[_0x58d216(0x89)][_0x58d216(0x80)],_0x103929=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0x7c)],_0x211b25=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0xbf)],_0x36c32c=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0xb1)],_0x2ae8e4=_0x3a4b5b[_0x58d216(0x82)][_0x58d216(0x86)],_0x530eb4=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0xf8)],_0x4e308c=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0x80)],_0x382d4a=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0xf3)],_0x1fab77=_0x3a4b5b[_0x58d216(0x96)][_0x58d216(0x86)];console[_0x58d216(0xed)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4ccf37+'\x27:');_0x1126e4[_0x58d216(0x88)]>0x0&&console['error']('\x20\x20'+a29_0x7fbe0c[_0x58d216(0xde)]('π\x20'+_0x1126e4[_0x58d216(0x88)]+_0x58d216(0xcc)));if(!_0x319cb7[_0x58d216(0x10f)]){console[_0x58d216(0xed)](_0x58d216(0xe1)),console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x3d724c[_0x58d216(0x88)]+_0x58d216(0xb4))),console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x551952[_0x58d216(0x88)]+_0x58d216(0xfb)));if(_0x3c5349[_0x58d216(0x88)]>0x0)console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xe4)]('-\x20'+_0x3c5349[_0x58d216(0x88)]+'\x20to\x20delete'));else _0x17b982[_0x58d216(0x88)]>0x0&&!_0x319cb7['delete']&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c['dim'](_0x17b982[_0x58d216(0x88)]+_0x58d216(0xa1)));console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0x9d)]('=\x20'+_0x25023c[_0x58d216(0x88)]+_0x58d216(0xc6)));}if(_0x4df179[_0x58d216(0x88)]>0x0||_0xfed488['length']>0x0){console[_0x58d216(0xed)]('\x20\x20πΊοΈ\x20\x20Journeys:'),console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x103929[_0x58d216(0x88)]+_0x58d216(0xb4))),console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x211b25[_0x58d216(0x88)]+_0x58d216(0xfb)));if(_0x2ae8e4[_0x58d216(0x88)]>0x0)console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c['red']('-\x20'+_0x2ae8e4[_0x58d216(0x88)]+_0x58d216(0xcf)));else _0xfed488[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x81)]&&console['error'](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0x9d)](_0xfed488['length']+_0x58d216(0xa1)));console[_0x58d216(0xed)]('\x20\x20\x20\x20'+a29_0x7fbe0c[_0x58d216(0x9d)]('=\x20'+_0x36c32c[_0x58d216(0x88)]+'\x20unchanged'));}_0x530eb4['length']>0x0&&!_0x319cb7['journeysOnly']&&(console[_0x58d216(0xed)](''),console['error'](_0x58d216(0xd8)),_0x4e308c[_0x58d216(0x88)]>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xc1)]('+\x20'+_0x4e308c[_0x58d216(0x88)]+'\x20to\x20create')),_0x382d4a['length']>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xac)]('~\x20'+_0x382d4a[_0x58d216(0x88)]+_0x58d216(0xc5))),_0x1fab77[_0x58d216(0x88)]>0x0&&console[_0x58d216(0xed)](_0x58d216(0xf9)+a29_0x7fbe0c[_0x58d216(0xe4)]('-\x20'+_0x1fab77[_0x58d216(0x88)]+_0x58d216(0xcf))));console['error'](_0x58d216(0x104)+a29_0x7fbe0c[_0x58d216(0x109)](_0x4f20d6)+'\x0a');if(_0x1126e4[_0x58d216(0x88)]>0x0){console[_0x58d216(0xed)]('Folders\x20to\x20create:');for(const _0x1eecac of _0x1126e4){console['error']('\x20\x20'+a29_0x7fbe0c[_0x58d216(0xde)]('+')+'\x20'+_0x1eecac);}console[_0x58d216(0xed)]('');}if(_0x3d724c['length']>0x0&&!_0x319cb7['journeysOnly'])for(const _0x54f572 of _0x3d724c){const _0x553d86=_0x54f572[_0x58d216(0xd0)]?_0x54f572['folderPath']+'/'+_0x54f572[_0x58d216(0xef)][_0x58d216(0xeb)]:_0x54f572[_0x58d216(0xef)][_0x58d216(0xeb)],_0x936c29=_0x54f572[_0x58d216(0xef)][_0x58d216(0x96)]?.[_0x58d216(0x88)]||0x0,_0x476c0f=_0x936c29>0x0?a29_0x7fbe0c[_0x58d216(0x9d)]('\x20['+_0x936c29+_0x58d216(0x10c)):'';console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c['green']('New\x20segment:')+'\x20'+_0x553d86+_0x476c0f),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),_0x54f572[_0x58d216(0xfa)]&&console[_0x58d216(0xed)](_0x54f572[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x3c5349[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)])for(const _0x28caea of _0x3c5349){const _0x5c33d3=_0x28caea[_0x58d216(0xb9)]?_0x5d16f2['get'](_0x28caea[_0x58d216(0xb9)]['toString']())||'':'',_0x308a16=_0x5c33d3?_0x5c33d3+'/'+_0x28caea[_0x58d216(0xeb)]:_0x28caea[_0x58d216(0xeb)],_0x4afd9e=_0x401037[_0x58d216(0xe5)](_0x28caea['id'])||[],_0x5024cf=_0x4afd9e['length']>0x0?a29_0x7fbe0c[_0x58d216(0x9d)]('\x20['+_0x4afd9e[_0x58d216(0x88)]+_0x58d216(0x10c)):'';console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0xce))+'\x20'+_0x308a16+_0x5024cf),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));const _0x117bea=segmentWithActivationsToYaml(_0x28caea,_0x4afd9e,undefined,_0xb51417,_0x2df1e4),_0x379598=segmentToYamlString(_0x117bea),_0x5ba139=generateDiff(_0x379598,'');console[_0x58d216(0xed)](formatDiffWithColors(_0x5ba139)),console['error']('β'[_0x58d216(0xe7)](0x3c));}const _0x5e34c7=_0x5e9c13[_0x58d216(0xbb)](_0x265094=>!_0x265094[_0x58d216(0x7a)]&&_0x265094['diff']);if(_0x5e34c7[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)])for(const _0x51c060 of _0x5e34c7){const _0x553a81=_0x51c060[_0x58d216(0xd0)]?_0x51c060[_0x58d216(0xd0)]+'/'+_0x51c060[_0x58d216(0xef)][_0x58d216(0xeb)]:_0x51c060[_0x58d216(0xef)]['name'];console[_0x58d216(0xed)]('\x0a'+a29_0x7fbe0c['yellow'](_0x58d216(0xb5))+'\x20'+_0x553a81),console['error']('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](_0x51c060[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x103929['length']>0x0)for(const _0x45b535 of _0x103929){const _0x6937f5=_0x45b535[_0x58d216(0xd0)]?_0x45b535[_0x58d216(0xd0)]+'/'+_0x45b535['yamlConfig'][_0x58d216(0xeb)]:_0x45b535[_0x58d216(0xef)]['name'];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xc1)](_0x58d216(0xea))+'\x20'+_0x6937f5),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),_0x45b535[_0x58d216(0xfa)]&&console['error'](_0x45b535[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}const _0x5d44cc=_0x4df179[_0x58d216(0xbb)](_0x2c1d40=>!_0x2c1d40[_0x58d216(0x7a)]&&_0x2c1d40[_0x58d216(0xfa)]);if(_0x5d44cc[_0x58d216(0x88)]>0x0)for(const _0x26e342 of _0x5d44cc){const _0x4099f7=_0x26e342[_0x58d216(0xd0)]?_0x26e342[_0x58d216(0xd0)]+'/'+_0x26e342['yamlConfig']['name']:_0x26e342[_0x58d216(0xef)][_0x58d216(0xeb)];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0x9e))+'\x20'+_0x4099f7),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](_0x26e342[_0x58d216(0xfa)]),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c));}if(_0x2ae8e4[_0x58d216(0x88)]>0x0)for(const _0x5b5779 of _0x2ae8e4){const _0xeb0b81=_0x5b5779[_0x58d216(0xe9)]?_0x5d16f2[_0x58d216(0xe5)](_0x5b5779[_0x58d216(0xe9)])||'':'',_0xbe86f5=_0xeb0b81?_0xeb0b81+'/'+_0x5b5779[_0x58d216(0xaf)]:_0x5b5779[_0x58d216(0xaf)];console['error']('\x0a'+a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0x91))+'\x20'+_0xbe86f5),console[_0x58d216(0xed)]('β'[_0x58d216(0xe7)](0x3c)),console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)](_0x58d216(0x9c))),console['error']('β'[_0x58d216(0xe7)](0x3c));}if(_0x319cb7['dryRun'])return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xac)](_0x58d216(0xa7))),0x0;const _0x4eafce=_0x319cb7[_0x58d216(0x10f)]?![]:_0x3d724c[_0x58d216(0x88)]>0x0||_0x551952[_0x58d216(0x88)]>0x0||_0x3c5349['length']>0x0,_0x113b35=_0x103929[_0x58d216(0x88)]>0x0||_0x211b25[_0x58d216(0x88)]>0x0||_0x2ae8e4[_0x58d216(0x88)]>0x0,_0x270e3a=_0x319cb7[_0x58d216(0x10f)]?![]:_0x530eb4[_0x58d216(0x88)]>0x0,_0x3fc226=_0x1126e4[_0x58d216(0x88)]>0x0;if(!_0x4eafce&&!_0x113b35&&!_0x270e3a&&!_0x3fc226){const _0x238df0=_0x319cb7[_0x58d216(0x10f)]?_0x58d216(0x9b):_0x58d216(0x7e);console['error'](a29_0x7fbe0c[_0x58d216(0xc1)](_0x238df0));if(_0xc70a1c&&_0x36c32c[_0x58d216(0x88)]===0x1){const _0xc932c9=_0x36c32c[0x0];if(_0xc932c9[_0x58d216(0x98)]?.['id']){const _0xcceed0=getConsoleNextUrl(_0x319cb7[_0x58d216(0xd7)],'/app/ps/'+_0x91d0a1+_0x58d216(0xd5)+_0xc932c9[_0x58d216(0x98)]['id']+'/j/da/je');console[_0x58d216(0xed)]('\x20\x20'+a29_0x7fbe0c[_0x58d216(0x109)](_0xcceed0));}}return 0x0;}const _0x2969c7=_0x319cb7[_0x58d216(0x10f)]?_0x103929[_0x58d216(0x88)]+_0x211b25['length']+_0x2ae8e4[_0x58d216(0x88)]+_0x1126e4[_0x58d216(0x88)]:_0x3d724c[_0x58d216(0x88)]+_0x551952[_0x58d216(0x88)]+_0x3c5349[_0x58d216(0x88)]+_0x103929['length']+_0x211b25['length']+_0x2ae8e4[_0x58d216(0x88)]+_0x1126e4[_0x58d216(0x88)]+_0x530eb4[_0x58d216(0x88)];if(!_0x319cb7[_0x58d216(0xbd)]&&_0x2969c7>0x0){const _0x466a48=await confirmKey(_0x58d216(0xfe)+_0x2969c7+_0x58d216(0x93));if(!_0x466a48)return console['error'](_0x58d216(0x99)),0x1;}const _0x3ee1e7={'withProgress':async(_0x3d19e5,_0x2141cf)=>{const _0x35cee4=_0x58d216,_0x541c95=await withSpinner(_0x3d19e5,_0x2141cf,{'verbose':_0x319cb7[_0x35cee4(0xe0)]});return{'data':_0x541c95['data']};},'logInfo':_0x93fed8=>console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xde)]('β\x20'+_0x93fed8)),'logSuccess':_0x26d59d=>console['error'](a29_0x7fbe0c[_0x58d216(0xc1)]('β\x20'+_0x26d59d)),'logWarning':_0x553e49=>console['error'](a29_0x7fbe0c['yellow']('β \x20'+_0x553e49)),'logDeleted':_0x1ad80a=>console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xe4)]('β\x20'+_0x1ad80a))},_0x293ae2={'segment':_0x399eaa[_0x58d216(0xc3)],'journey':_0x399eaa[_0x58d216(0xe8)],'user':_0x399eaa['user'],'connection':_0x399eaa['connection']};_0x1126e4['length']>0x0&&(_0x10d0aa=await executePushFolders(_0x293ae2,_0x1126e4,_0x10d0aa,{'parentId':_0x91d0a1},_0x3ee1e7));const _0x205fb1={'rootFolderId':_0x1a2c89,'folderPathToId':_0x10d0aa,'folderIdToPath':_0x5d16f2,'segmentNameToId':_0x256e2c,'activationsBySegmentId':_0x401037,'emailToIdMap':_0x477eb4,'idToEmailMap':_0xb51417,'connectionNameToIdMap':_0x19a77d[_0x58d216(0xdb)],'connectionIdToNameMap':_0x19a77d['idToName'],'connectionNameToTypeMap':_0x577615},_0x126246=await executePushSegments(_0x293ae2,_0x319cb7[_0x58d216(0x10f)]?[]:_0x5e9c13,_0x205fb1,{'parentId':_0x91d0a1},_0x3ee1e7),_0x1a3782=_0x126246[_0x58d216(0xd1)],_0x4a7355=_0x126246['updated'],_0x3c462d=_0x126246[_0x58d216(0x96)]['created'],_0x17695f=_0x126246[_0x58d216(0x96)][_0x58d216(0xff)],_0x417def=_0x126246[_0x58d216(0x96)]['deleted'],_0x40c50a=await executePushSegmentDeletions(_0x293ae2,_0x319cb7[_0x58d216(0x10f)]?[]:_0x3c5349,_0x3ee1e7);let _0x33e7ff=0x0,_0x504d45=0x0,_0x36648b=0x0;const _0x578647=new Map(_0x256e2c);for(const [_0x5ab9db,_0x5cafe3]of _0x126246['createdSegmentIds']){_0x578647['set'](_0x5ab9db,_0x5cafe3);}if(_0x4df179[_0x58d216(0x88)]>0x0){const _0x331b75={..._0x205fb1,'segmentNameToId':_0x578647,'existingSegments':_0x5f0e92,'activationContext':_0x58d223},_0x22a750=await executePushJourneys(_0x293ae2,_0x4df179,_0x331b75,{'parentId':_0x91d0a1,'rootFolderId':_0x1a2c89,'verbose':_0x319cb7['verbose']},_0x3ee1e7);_0x33e7ff=_0x22a750[_0x58d216(0xd1)],_0x504d45=_0x22a750[_0x58d216(0xff)];if(_0xc70a1c&&_0x22a750[_0x58d216(0xc4)]['length']===0x1){const _0x53306b=_0x22a750[_0x58d216(0xc4)][0x0];if(_0x53306b[_0x58d216(0xb0)]){const _0x2ec812=getConsoleNextUrl(_0x319cb7['site'],_0x58d216(0x10a)+_0x91d0a1+_0x58d216(0xd5)+_0x53306b[_0x58d216(0xb0)]+_0x58d216(0xb7));console[_0x58d216(0xed)]('\x20\x20'+a29_0x7fbe0c['cyan'](_0x2ec812));}}}for(const _0x293962 of _0x2ae8e4){console[_0x58d216(0xed)](a29_0x7fbe0c['yellow'](_0x58d216(0xba)+_0x293962[_0x58d216(0xaf)])),_0x36648b++;}const _0x10a2b3=[];if(_0x1a3782>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x1a3782+_0x58d216(0xcd));if(_0x4a7355>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x4a7355+_0x58d216(0xc9));if(_0x40c50a>0x0)_0x10a2b3[_0x58d216(0x7d)](_0x40c50a+_0x58d216(0x102));const _0x917940=[];if(_0x33e7ff>0x0)_0x917940[_0x58d216(0x7d)](_0x33e7ff+_0x58d216(0xcd));if(_0x504d45>0x0)_0x917940[_0x58d216(0x7d)](_0x504d45+'\x20updated');if(_0x36648b>0x0)_0x917940[_0x58d216(0x7d)](_0x36648b+_0x58d216(0x102));const _0x1a4868=[];if(_0x3c462d>0x0)_0x1a4868[_0x58d216(0x7d)](_0x3c462d+_0x58d216(0xcd));if(_0x17695f>0x0)_0x1a4868['push'](_0x17695f+_0x58d216(0xc9));if(_0x417def>0x0)_0x1a4868[_0x58d216(0x7d)](_0x417def+_0x58d216(0x102));return console[_0x58d216(0xed)](a29_0x7fbe0c[_0x58d216(0xc1)](_0x58d216(0xc8))),_0x10a2b3[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&console[_0x58d216(0xed)]('\x20\x20Segments:\x20'+_0x10a2b3[_0x58d216(0xa3)](',\x20')),_0x917940[_0x58d216(0x88)]>0x0&&console['error'](_0x58d216(0xd4)+_0x917940['join'](',\x20')),_0x1a4868[_0x58d216(0x88)]>0x0&&!_0x319cb7[_0x58d216(0x10f)]&&console[_0x58d216(0xed)](_0x58d216(0xa6)+_0x1a4868[_0x58d216(0xa3)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a30_0x377547=a30_0x5d34;(function(_0x380ea8,_0x352393){const _0x23b36d=a30_0x5d34,_0x133ba8=_0x380ea8();while(!![]){try{const _0x12639e=parseInt(_0x23b36d(0x120))/0x1*(-parseInt(_0x23b36d(0x123))/0x2)+parseInt(_0x23b36d(0x13c))/0x3+-parseInt(_0x23b36d(0x127))/0x4+-parseInt(_0x23b36d(0x12b))/0x5+parseInt(_0x23b36d(0x135))/0x6*(-parseInt(_0x23b36d(0x131))/0x7)+parseInt(_0x23b36d(0x13b))/0x8*(parseInt(_0x23b36d(0x12f))/0x9)+parseInt(_0x23b36d(0x12e))/0xa;if(_0x12639e===_0x352393)break;else _0x133ba8['push'](_0x133ba8['shift']());}catch(_0x1d316b){_0x133ba8['push'](_0x133ba8['shift']());}}}(a30_0x5991,0xaa4f9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a30_0x5d34(_0x764704,_0x2c4f8d){_0x764704=_0x764704-0x119;const _0x599147=a30_0x5991();let _0x5d34b7=_0x599147[_0x764704];return _0x5d34b7;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x106d59 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x377547(0x11f)]=a30_0x377547(0x146);[a30_0x377547(0x140)]='Update\x20existing\x20child\x20segment';async[a30_0x377547(0x128)](_0x7834cc){const _0x324ae0=a30_0x377547;console[_0x324ae0(0x142)](a30_0x106d59['yellow'](_0x324ae0(0x143))),console[_0x324ae0(0x142)](a30_0x106d59[_0x324ae0(0x122)](_0x324ae0(0x139)));const {options:_0x424c85,args:_0x46a4a6,tdx:_0x3e5fa4}=_0x7834cc,_0x4908f0=_0x424c85;if(_0x46a4a6['length']===0x0)return console[_0x324ae0(0x142)](_0x324ae0(0x119)),console['error'](_0x324ae0(0x149)),console[_0x324ae0(0x142)]('Examples:'),console[_0x324ae0(0x142)](_0x324ae0(0x148)),console[_0x324ae0(0x142)](_0x324ae0(0x13a)),0x1;const _0x62f0dc=_0x46a4a6[0x0],_0x25887f=_0x424c85[_0x324ae0(0x133)];let _0x248609=_0x62f0dc;_0x25887f&&!_0x62f0dc[_0x324ae0(0x126)]('/')&&(_0x248609=_0x25887f+'/'+_0x62f0dc,_0x4908f0[_0x324ae0(0x130)]&&console[_0x324ae0(0x142)](_0x324ae0(0x14a)+_0x248609));const _0x44496a=await withSpinner(_0x324ae0(0x11b)+_0x248609+'\x27...',()=>_0x3e5fa4[_0x324ae0(0x12a)]['resolvePathToResource'](_0x248609),{'verbose':_0x4908f0[_0x324ae0(0x130)]}),_0x40ad61=_0x44496a[_0x324ae0(0x11c)];_0x4908f0[_0x324ae0(0x130)]&&console[_0x324ae0(0x142)](_0x324ae0(0x144)+_0x40ad61[_0x324ae0(0x137)]);if(_0x40ad61[_0x324ae0(0x137)]!==_0x324ae0(0x12a))return console[_0x324ae0(0x142)](_0x324ae0(0x13e)+_0x40ad61[_0x324ae0(0x137)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x324ae0(0x142)](_0x324ae0(0x121)),0x1;if(!_0x40ad61[_0x324ae0(0x136)])throw new SDKError(ErrorCode[_0x324ae0(0x141)],_0x324ae0(0x11d));const _0x3f1196=_0x40ad61[_0x324ae0(0x132)],_0x81ff34=_0x40ad61[_0x324ae0(0x136)];_0x4908f0[_0x324ae0(0x130)]&&(console[_0x324ae0(0x142)](_0x324ae0(0x125)+_0x3f1196),console[_0x324ae0(0x142)](_0x324ae0(0x12d)+_0x81ff34));let _0x26d585;if(_0x4908f0[_0x324ae0(0x129)]){const _0x2e6c19=_0x4908f0[_0x324ae0(0x129)],_0x4db826=await withSpinner(_0x324ae0(0x147)+_0x2e6c19+_0x324ae0(0x145),()=>_0x3e5fa4[_0x324ae0(0x12a)][_0x324ae0(0x13d)](_0x3f1196,_0x2e6c19),{'verbose':_0x4908f0['verbose']});_0x26d585=parseInt(_0x4db826[_0x324ae0(0x11c)],0xa),_0x4908f0[_0x324ae0(0x130)]&&console[_0x324ae0(0x142)](_0x324ae0(0x138)+_0x26d585);}const _0x122d13=await loadJSONFromOptions(_0x4908f0[_0x324ae0(0x13f)],_0x4908f0[_0x324ae0(0x124)]),_0x3b695e={'name':_0x4908f0[_0x324ae0(0x11f)],'description':_0x4908f0[_0x324ae0(0x140)],'rule':_0x122d13,'kind':_0x4908f0['kind']!==undefined?parseInt(_0x4908f0[_0x324ae0(0x11a)],0xa):undefined,'segmentFolderId':_0x26d585},_0x2ec965=await withSpinner('Updating\x20segment\x20\x27'+_0x40ad61[_0x324ae0(0x134)]+'\x27...',()=>_0x3e5fa4['segment'][_0x324ae0(0x12c)](_0x3f1196,_0x81ff34,_0x3b695e),{'verbose':_0x4908f0[_0x324ae0(0x130)]}),_0x120e8a=_0x2ec965[_0x324ae0(0x11c)];return console['error'](_0x324ae0(0x11e)+_0x120e8a[_0x324ae0(0x11f)]+'\x27'),_0x248609!==_0x62f0dc&&console[_0x324ae0(0x142)]('\x20\x20\x20Path:\x20'+_0x248609),await handleSDKOutput([_0x120e8a],_0x4908f0),0x0;}}function a30_0x5991(){const _0x10e256=['6fNknpm','segmentId','type','Resolved\x20folder\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','2618920eKFBfD','2593845CqYHLp','resolveFolderId','Error:\x20Cannot\x20update\x20','rule','description','INTERNAL','error','β \x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Resolved\x20type:\x20','\x27...','segment:update','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','kind','Resolving\x20path\x20\x27','data','Segment\x20ID\x20missing\x20from\x20resolved\x20path','β\x20Updated\x20segment\x20\x27','name','26NPcImt','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','yellow','90322rtuRlP','ruleFile','Parent\x20ID:\x20','includes','1706584rgjhRA','execute','folder','segment','6334485JkVXzI','updateSegmentById','Segment\x20ID:\x20','26522210ODJUhY','27nouNGs','verbose','6535263iORfBc','parentId','segmentPath','segmentName'];a30_0x5991=function(){return _0x10e256;};return a30_0x5991();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a31_0x3ac643=a31_0x67c1;(function(_0x439436,_0x1622b9){const _0x1cae02=a31_0x67c1,_0x7cb002=_0x439436();while(!![]){try{const _0x111105=parseInt(_0x1cae02(0xa1))/0x1*(parseInt(_0x1cae02(0x94))/0x2)+-parseInt(_0x1cae02(0xad))/0x3+-parseInt(_0x1cae02(0xc1))/0x4+parseInt(_0x1cae02(0xb4))/0x5+-parseInt(_0x1cae02(0xc9))/0x6*(parseInt(_0x1cae02(0xce))/0x7)+-parseInt(_0x1cae02(0xc0))/0x8+-parseInt(_0x1cae02(0xa4))/0x9*(-parseInt(_0x1cae02(0xa2))/0xa);if(_0x111105===_0x1622b9)break;else _0x7cb002['push'](_0x7cb002['shift']());}catch(_0x1818d1){_0x7cb002['push'](_0x7cb002['shift']());}}}(a31_0x8c5e,0xb0d57));import{existsSync,statSync}from'fs';import a31_0x1d81bd from'chalk';import{BaseCommand}from'./command.js';function a31_0x8c5e(){const _0x545345=['parentName','82061qSuhqw','Resolved\x20path\x20type:\x20','10wBoDfd','\x27...','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','execute','cyan','error','segment:use','green','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','144310CyMiYU','50huLQuT','isAbsolute','2008062YZbMJT','segments','fullPath','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','slice','Folder\x20ID:\x20','type','Error:\x20Path\x20is\x20required\x0a','name','2987952oOLDuO','data','log','parent_segment','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Site:\x20','3939840wKzzoC','Resolved\x20relative\x20path\x20to:\x20','parentId','red','isDirectory','resolvePathToResource','description','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','length','verbose','dim','Examples:','2336848TYMKiy','2216368xQMvWt','split','folderPath','join','β\x20Context\x20set\x20to:\x20','session','folderId','Target\x20path:\x20','30tDmpLS','config','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','β\x20Context\x20cleared.\x20Back\x20to\x20root.'];a31_0x8c5e=function(){return _0x545345;};return a31_0x8c5e();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a31_0x67c1(_0x5b1667,_0x21f763){_0x5b1667=_0x5b1667-0x94;const _0x8c5e30=a31_0x8c5e();let _0x67c1e=_0x8c5e30[_0x5b1667];return _0x67c1e;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a31_0x3ac643(0xac)]=a31_0x3ac643(0x9c);[a31_0x3ac643(0xba)]=a31_0x3ac643(0xbb);async[a31_0x3ac643(0x99)](_0x3b5f89){const _0xd86124=a31_0x3ac643,{options:_0x460fe3,args:_0x3bcb66,tdx:_0x324b44}=_0x3b5f89;if(_0x3bcb66[_0xd86124(0xbc)]===0x0)return console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0xb7)](_0xd86124(0xab))),console['error'](_0xd86124(0x9f)),console['error'](_0xd86124(0xbf)),console[_0xd86124(0x9b)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0xd86124(0x9b)](_0xd86124(0x97)),console[_0xd86124(0x9b)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0xd86124(0x9b)](_0xd86124(0xb2)),0x1;const _0x2be0d1=_0x3bcb66[0x0],_0x1f5610=_0x460fe3[_0xd86124(0xc6)];try{if(_0x2be0d1==='/')return saveSessionContext({'segment_path':undefined},_0x1f5610),console[_0xd86124(0xaf)](a31_0x1d81bd[_0xd86124(0x9d)]('β\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x2be0d1)&&statSync(_0x2be0d1)[_0xd86124(0xb8)]()){let _0x1ebb27;try{_0x1ebb27=findTdxConfig(_0x2be0d1);}catch{return console[_0xd86124(0x9b)](a31_0x1d81bd['red'](_0xd86124(0x9e)+_0x2be0d1)),console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0x9a)](_0xd86124(0x96))),0x1;}const _0x59e2db=_0x1ebb27[_0xd86124(0xca)][_0xd86124(0xb0)];return saveSessionContext({'segment_path':_0x59e2db,'parent_segment':_0x59e2db},_0x1f5610),console[_0xd86124(0xaf)](a31_0x1d81bd[_0xd86124(0x9d)](_0xd86124(0xc5)+a31_0x1d81bd['cyan'](_0x59e2db))),0x0;}const _0x4f0ab1=_0x460fe3['segmentPath'];let _0xe3a551=_0x2be0d1;const _0x109976=parsePath(_0x2be0d1);if(!_0x109976[_0xd86124(0xa3)]){if(!_0x4f0ab1)return console[_0xd86124(0x9b)](a31_0x1d81bd['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0x9a)](_0xd86124(0x98))),0x1;if(_0x2be0d1==='..'){const _0x58dbca=_0x4f0ab1[_0xd86124(0xc2)]('/')[_0xd86124(0xa8)](0x0,-0x1)[_0xd86124(0xc4)]('/');_0xe3a551=_0x58dbca||'/';}else _0x2be0d1==='.'?_0xe3a551=_0x4f0ab1:_0xe3a551=_0x4f0ab1+'/'+_0x2be0d1;_0x460fe3[_0xd86124(0xbd)]&&console[_0xd86124(0x9b)](_0xd86124(0xb5)+_0xe3a551);}if(_0xe3a551==='/'||_0xe3a551==='')return saveSessionContext({'segment_path':undefined},_0x1f5610),console[_0xd86124(0xaf)](a31_0x1d81bd[_0xd86124(0x9d)](_0xd86124(0xcc))),0x0;_0xe3a551=normalizePath(_0xe3a551);const _0x512e7f=parsePath(_0xe3a551)[_0xd86124(0xa5)];if(_0x512e7f[_0xd86124(0xbc)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1f5610),console['log'](a31_0x1d81bd[_0xd86124(0x9d)](_0xd86124(0xcc))),0x0;_0x460fe3[_0xd86124(0xbd)]&&(console[_0xd86124(0x9b)](_0xd86124(0xb3)+_0x460fe3['site']),console[_0xd86124(0x9b)](_0xd86124(0xc8)+_0xe3a551));const _0x574117=await withSpinner('Resolving\x20path\x20\x27'+_0xe3a551+_0xd86124(0x95),()=>_0x324b44[_0xd86124(0xb1)][_0xd86124(0xb9)](_0xe3a551),{'verbose':_0x460fe3[_0xd86124(0xbd)]}),_0x5a8350=_0x574117[_0xd86124(0xae)];_0x460fe3[_0xd86124(0xbd)]&&(console[_0xd86124(0x9b)](_0xd86124(0xcf)+_0x5a8350[_0xd86124(0xaa)]),console[_0xd86124(0x9b)]('Parent\x20ID:\x20'+_0x5a8350[_0xd86124(0xb6)]),_0x5a8350[_0xd86124(0xc7)]&&console[_0xd86124(0x9b)](_0xd86124(0xa9)+_0x5a8350[_0xd86124(0xc7)]));if(_0x5a8350['type']==='segment')return console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0xb7)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0xd86124(0x9b)](_0xd86124(0xa7)),console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0x9a)]('Use:\x20tdx\x20segment\x20use\x20'+_0x5a8350[_0xd86124(0xcd)]+(_0x5a8350[_0xd86124(0xc3)]?'/'+_0x5a8350[_0xd86124(0xc3)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5a8350[_0xd86124(0xa6)],'parent_segment':_0x5a8350[_0xd86124(0xcd)]},_0x1f5610),console[_0xd86124(0xaf)](a31_0x1d81bd[_0xd86124(0x9d)]('β\x20Context\x20set\x20to:\x20'+a31_0x1d81bd[_0xd86124(0x9a)](_0x5a8350[_0xd86124(0xa6)]))),_0x460fe3['verbose']&&(console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0xbe)](_0xd86124(0xa0))),console[_0xd86124(0x9b)](a31_0x1d81bd[_0xd86124(0xbe)](_0xd86124(0xcb)))),0x0;}catch(_0x396c0b){throw _0x396c0b;}}}
|