@treasuredata/tdx 0.14.6 → 0.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- 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.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/tdx +10 -0
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x9e26f2=a25_0x775b;(function(_0x397e36,_0x34975e){const _0xb8d1b0=a25_0x775b,_0x116bb8=_0x397e36();while(!![]){try{const _0x31b702=parseInt(_0xb8d1b0(0xe1))/0x1+parseInt(_0xb8d1b0(0xb3))/0x2*(-parseInt(_0xb8d1b0(0xe9))/0x3)+-parseInt(_0xb8d1b0(0x9f))/0x4*(parseInt(_0xb8d1b0(0xea))/0x5)+-parseInt(_0xb8d1b0(0x118))/0x6*(parseInt(_0xb8d1b0(0xc3))/0x7)+-parseInt(_0xb8d1b0(0xef))/0x8+-parseInt(_0xb8d1b0(0xd3))/0x9*(-parseInt(_0xb8d1b0(0xb9))/0xa)+parseInt(_0xb8d1b0(0xfa))/0xb;if(_0x31b702===_0x34975e)break;else _0x116bb8['push'](_0x116bb8['shift']());}catch(_0x948514){_0x116bb8['push'](_0x116bb8['shift']());}}}(a25_0x2862,0x2c465));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';function a25_0x2862(){const _0x2c2ccd=['Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20desc','Usage:\x20tdx\x20segment\x20describe\x20<path>','Use:\x20tdx\x20ps\x20show','setJobId','\x20Opening\x20','Error:\x20Folder\x20reference\x20is\x20required','segment','getParent','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Resolved\x20folder\x20ID:\x20','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x27...','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','in\x20','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20parent\x20folder\x20\x27','Fetching\x20folder\x20details...','site','23716onRKWa','✔\x20Query\x20completed:\x20Processed\x20','execute','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','✔\x20Found\x20','elapsedTimeMillis','/app/ps/','folderId','\x20\x20Folder\x20path:\x20','listFolders','jsonl','toLocaleString','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','segmentName','processedRows','\x20\x20Full\x20path:\x20','resolveFolderId','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','2KjEOtI','Get\x20SQL\x20query\x20for\x20child\x20segment','segment:folder:create','segment:sql','segmentId','SEGMENT_NOT_FOUND','10ajdbmW','message','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','(root)','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Parent\x20ID:\x20','getSegmentSQL','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegment','resolveParentId','502628wqOuvD','SELECT\x20*\x20FROM\x20(\x0a','web','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentSegment','parent','Usage:\x20tdx\x20sg\x20show\x20<name>','description','Resolving\x20path\x20\x27','log','\x20[Job\x20ID:\x20','Use:\x20tdx\x20ps\x20view\x20-w','Site:\x20','test','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','2160711RuDVmj','Parent\x20segment:\x20','Resolving\x20\x27','name','verbose','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','data','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Fetching\x20folder\x20\x27','stats','replace','fullPath','✔\x20Created\x20folder\x20\x27','326434BmprfB','includes','getFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','resolvePathToResource','green','length','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','697044GDUlOF','295wQmxMo','INVALID_ARGUMENT','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentId','518064uPRhMV','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20','folder','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','parentFolder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:show','information_schema','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','6038659fFxrnL','Resolving\x20parent\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','cause','json','Target\x20path:\x20','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','segmentPath','\x20\x20Cause:\x20','segment:folder:list','url','limit','Listing\x20folders\x20for\x20parent\x20\x27','Options:','Executing\x20segment\x20query...','createFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Resolved\x20type:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20sql\x20<name>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:show','type','/e/','\x27\x20with\x20ID:\x20','\x20\x20Parent\x20segment:\x20','Resolved\x20parent\x20folder\x20ID:\x20','code','24dKMEaq','Parent\x20name:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20sql','Folder\x20name:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','SQL\x20query:\x0a','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','jobId','error','Usage:\x20tdx\x20sg\x20desc\x20<name>','Creating\x20folder\x20\x27','\x20\x20Segment\x20name:\x20'];a25_0x2862=function(){return _0x2c2ccd;};return a25_0x2862();}import{openBrowser}from'../utils/process.js';import a25_0x17ea3a from'chalk';async function resolveSegmentTarget(_0x2ae3b7,_0x1e9547,_0x30d133){const _0x52ec91=a25_0x775b;if(isYamlFilePath(_0x2ae3b7))try{const _0x473b67=await resolveYamlFilePath(_0x2ae3b7);return _0x30d133&&(console[_0x52ec91(0x81)]('Resolved\x20YAML\x20file:\x20'+_0x2ae3b7),console[_0x52ec91(0x81)](_0x52ec91(0x115)+_0x473b67[_0x52ec91(0xc7)]),console[_0x52ec91(0x81)](_0x52ec91(0x84)+_0x473b67[_0x52ec91(0xad)]),console['error'](_0x52ec91(0xa7)+(_0x473b67['folderPath']||_0x52ec91(0xbc))),console[_0x52ec91(0x81)](_0x52ec91(0xaf)+_0x473b67['fullPath'])),_0x473b67[_0x52ec91(0xdf)];}catch(_0x3aeb2c){throw new SDKError(ErrorCode[_0x52ec91(0xeb)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x3aeb2c[_0x52ec91(0xba)]);}if(!_0x1e9547)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x52ec91(0xda));return _0x1e9547+'/'+_0x2ae3b7;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:describe';[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0x87);async['execute'](_0x25e723){const _0x185354=a25_0x9e26f2,{options:_0x1e5283,args:_0x298bb7,tdx:_0x4caf7d}=_0x25e723,_0x333800=_0x298bb7[0x0],_0x1f772e=!_0x333800&&!!_0x1e5283[_0x185354(0xc7)],_0x12d37e=_0x333800||_0x1e5283[_0x185354(0xc7)];if(!_0x12d37e)return console[_0x185354(0x81)](_0x185354(0x99)),console[_0x185354(0x81)](_0x185354(0x89)),console[_0x185354(0x81)](_0x185354(0xec)),console['error'](_0x185354(0xe4)),console[_0x185354(0x81)](_0x185354(0xed)),console[_0x185354(0x81)](_0x185354(0xe8)),console[_0x185354(0x81)](_0x185354(0xbd)),0x1;try{const _0x25368a=_0x1e5283[_0x185354(0x103)];let _0x569b0f=_0x12d37e;!_0x1f772e&&_0x25368a&&!_0x12d37e[_0x185354(0xe2)]('/')&&(_0x569b0f=_0x25368a+'/'+_0x12d37e,_0x1e5283['verbose']&&console[_0x185354(0x81)]('Resolved\x20relative\x20path\x20to:\x20'+_0x569b0f));const _0x162284=await withSpinner(_0x185354(0xcb)+_0x569b0f+'\x27...',()=>_0x4caf7d['segment'][_0x185354(0xe5)](_0x569b0f),{'verbose':_0x1e5283[_0x185354(0xd7)]}),_0x2c0838=_0x162284[_0x185354(0xd9)];_0x1e5283[_0x185354(0xd7)]&&(console[_0x185354(0x81)](_0x185354(0x10d)+_0x2c0838['type']),console['error'](_0x185354(0xbe)+_0x2c0838[_0x185354(0xee)]),_0x2c0838['folderId']&&console['error'](_0x185354(0x100)+_0x2c0838[_0x185354(0xa6)]),_0x2c0838['segmentId']&&console[_0x185354(0x81)](_0x185354(0x92)+_0x2c0838['segmentId']));if(_0x2c0838[_0x185354(0x112)]===_0x185354(0xc8)){const _0x4f6a02=await withSpinner(_0x185354(0x102),()=>_0x4caf7d[_0x185354(0x8e)][_0x185354(0x8f)](_0x2c0838[_0x185354(0xee)]),{'verbose':_0x1e5283[_0x185354(0xd7)]});await handleSingleObjectOutput(_0x4f6a02[_0x185354(0xd9)],_0x1e5283);}else{if(_0x2c0838['type']===_0x185354(0xf2)){if(!_0x2c0838['folderId'])throw new SDKError(ErrorCode[_0x185354(0x98)],_0x185354(0xf6));const _0x415136=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4caf7d[_0x185354(0x8e)][_0x185354(0xe3)](_0x2c0838[_0x185354(0xa6)]),{'verbose':_0x1e5283[_0x185354(0xd7)]});await handleSingleObjectOutput(_0x415136['data'],_0x1e5283);}else{if(_0x2c0838['type']===_0x185354(0x8e)){if(!_0x2c0838[_0x185354(0xb7)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x185354(0xab));const _0x26e24c=await withSpinner(_0x185354(0xb1),()=>_0x4caf7d[_0x185354(0x8e)]['getSegment'](_0x2c0838[_0x185354(0xee)],_0x2c0838[_0x185354(0xb7)]),{'verbose':_0x1e5283['verbose']});await handleSingleObjectOutput(_0x26e24c[_0x185354(0xd9)],_0x1e5283);}}}return 0x0;}catch(_0x9f993){if(_0x9f993 instanceof SDKError)return console[_0x185354(0x81)](_0x185354(0xf1)+_0x9f993['message']),_0x9f993[_0x185354(0xfd)]&&console[_0x185354(0x81)](_0x185354(0x104)+_0x9f993[_0x185354(0xfd)]),0x1;throw _0x9f993;}}}export class SegmentShowCommand extends BaseCommand{['name']=a25_0x9e26f2(0x111);[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0xa2);async['execute'](_0x817226){const _0x4891be=a25_0x9e26f2,{options:_0x8982,args:_0x19fb06,tdx:_0x2729cf}=_0x817226,_0x8a3bed=_0x19fb06[0x0];if(!_0x8a3bed)return console[_0x4891be(0x81)](_0x4891be(0xfc)),console[_0x4891be(0x81)](_0x4891be(0xc9)),console['error'](_0x4891be(0xdb)),console[_0x4891be(0x81)]('Examples:'),console[_0x4891be(0x81)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x4891be(0x81)](_0x4891be(0xb2)),0x1;try{const _0x335455=_0x8982[_0x4891be(0xc7)],_0x50bc03=await resolveSegmentTarget(_0x8a3bed,_0x335455,_0x8982[_0x4891be(0xd7)]);_0x8982[_0x4891be(0xd7)]&&console[_0x4891be(0x81)](_0x4891be(0xff)+_0x50bc03);const _0x4ad76d=await withSpinner(_0x4891be(0xd5)+_0x8a3bed+_0x4891be(0x94),()=>_0x2729cf[_0x4891be(0x8e)][_0x4891be(0xe5)](_0x50bc03),{'verbose':_0x8982[_0x4891be(0xd7)]}),_0x592ee5=_0x4ad76d['data'];_0x8982[_0x4891be(0xd7)]&&(console[_0x4891be(0x81)](_0x4891be(0x10d)+_0x592ee5['type']),console[_0x4891be(0x81)](_0x4891be(0xbe)+_0x592ee5[_0x4891be(0xee)]));if(_0x592ee5[_0x4891be(0x112)]===_0x4891be(0xf2))return console[_0x4891be(0x81)](_0x4891be(0x96)),console['error'](_0x4891be(0x9b)),0x1;if(_0x592ee5[_0x4891be(0x112)]===_0x4891be(0xc8))return console[_0x4891be(0x81)](_0x4891be(0xc6)),console[_0x4891be(0x81)](_0x4891be(0x8a)),0x1;if(!_0x592ee5[_0x4891be(0xb7)])throw new SDKError(ErrorCode[_0x4891be(0xb8)],_0x4891be(0xab));const _0xaeaee9=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2729cf['segment']['getSegmentSQL'](_0x592ee5[_0x4891be(0xee)],_0x592ee5[_0x4891be(0xb7)]),{'verbose':_0x8982['verbose']});let _0x4ac0e1=_0xaeaee9[_0x4891be(0xd9)];const _0x45c405=resolveLimit(_0x8982[_0x4891be(0x107)],DEFAULT_DISPLAY_LIMIT),_0x194a68=/\bLIMIT\s+\d+/i[_0x4891be(0xd0)](_0x4ac0e1);!_0x194a68&&(_0x4ac0e1=_0x4ac0e1['trim']()[_0x4891be(0xde)](/;+$/,''),_0x4ac0e1=_0x4891be(0xc4)+_0x4ac0e1+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x45c405);_0x8982[_0x4891be(0xd7)]&&console['error'](_0x4891be(0x7e)+_0x4ac0e1);const _0x3aa86b=await withProgressSpinner(_0x4891be(0x10a),async _0x6e2c98=>{const _0x1375a7=_0x4891be,_0x4e4a1d=await _0x2729cf['query']['execute'](_0x4ac0e1,{'catalog':'td','schema':_0x1375a7(0xf8),'onJobId':_0x1e062f=>{const _0x32347b=_0x1375a7;_0x6e2c98[_0x32347b(0x8b)](_0x1e062f);}});return _0x4e4a1d;},{'verbose':_0x8982[_0x4891be(0xd7)]}),_0x30aa31=_0x3aa86b[_0x4891be(0xd9)],_0x45f1e6=_0x30aa31[_0x4891be(0x80)]?_0x4891be(0xcd)+_0x30aa31[_0x4891be(0x80)]+']':'';return console[_0x4891be(0x81)](_0x4891be(0xa0)+_0x30aa31[_0x4891be(0xdd)][_0x4891be(0xae)][_0x4891be(0xaa)]()+'\x20rows\x20'+(_0x4891be(0x97)+formatElapsed(_0x30aa31['stats'][_0x4891be(0xa4)])+_0x45f1e6)),await handleQueryOutput(_0x30aa31,_0x8982),0x0;}catch(_0x42cc4c){if(_0x42cc4c instanceof SDKError)return console[_0x4891be(0x81)]('✖\x20Query\x20failed\x20['+_0x42cc4c[_0x4891be(0x117)]+']'),console[_0x4891be(0x81)]('\x0a'+_0x42cc4c[_0x4891be(0xba)]),0x1;throw _0x42cc4c;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0x105);['description']=a25_0x9e26f2(0xf0);async[a25_0x9e26f2(0xa1)](_0x26df20){const _0x2a800a=a25_0x9e26f2,{options:_0x246528,args:_0x9a1ecf,tdx:_0x3bdf3f}=_0x26df20;if(_0x9a1ecf['length']===0x0)return console['error'](_0x2a800a(0xc0)),console['error'](_0x2a800a(0x110)),0x1;const _0x8fbd5d=_0x9a1ecf[0x0];try{_0x246528[_0x2a800a(0xd7)]&&(console[_0x2a800a(0x81)](_0x2a800a(0xcf)+_0x246528[_0x2a800a(0x9e)]),console[_0x2a800a(0x81)](_0x2a800a(0x119)+_0x8fbd5d));const _0x47c0af=await withSpinner(_0x2a800a(0xfb)+_0x8fbd5d+_0x2a800a(0x94),()=>_0x3bdf3f['segment'][_0x2a800a(0xc2)](_0x8fbd5d),{'verbose':_0x246528[_0x2a800a(0xd7)]}),_0x2659cb=_0x47c0af['data'];_0x246528['verbose']&&console[_0x2a800a(0x81)](_0x2a800a(0x101)+_0x2659cb);const _0x17b4a8=await withSpinner(_0x2a800a(0x108)+_0x8fbd5d+_0x2a800a(0x94),()=>_0x3bdf3f['segment'][_0x2a800a(0xa8)](_0x2659cb),{'verbose':_0x246528[_0x2a800a(0xd7)]}),_0x4a9793=_0x17b4a8[_0x2a800a(0xd9)];return console['error'](_0x2a800a(0xa3)+_0x4a9793[_0x2a800a(0xe7)]+'\x20folder'+(_0x4a9793[_0x2a800a(0xe7)]!==0x1?'s':'')),await handleSDKOutput(_0x4a9793,_0x246528),0x0;}catch(_0x1c0a5e){if(_0x1c0a5e instanceof SDKError)return console[_0x2a800a(0x81)](_0x2a800a(0xf1)+_0x1c0a5e[_0x2a800a(0xba)]),_0x1c0a5e[_0x2a800a(0xfd)]&&console[_0x2a800a(0x81)]('\x20\x20Cause:\x20'+_0x1c0a5e[_0x2a800a(0xfd)]),0x1;throw _0x1c0a5e;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xf7);[a25_0x9e26f2(0xca)]='Show\x20segment\x20folder\x20details';async[a25_0x9e26f2(0xa1)](_0x289036){const _0x37fdd6=a25_0x9e26f2,{options:_0x199a94,args:_0x16b4dd,tdx:_0x5b58ce}=_0x289036;if(_0x16b4dd['length']===0x0)return console[_0x37fdd6(0x81)](_0x37fdd6(0x8d)),console['error'](_0x37fdd6(0xd1)),0x1;try{const {parentId:_0x2e7e,childId:_0x422f23}=parseSegmentRef(_0x16b4dd[0x0]);_0x199a94[_0x37fdd6(0xd7)]&&(console[_0x37fdd6(0x81)](_0x37fdd6(0xcf)+_0x199a94[_0x37fdd6(0x9e)]),console[_0x37fdd6(0x81)](_0x37fdd6(0x119)+_0x2e7e),_0x422f23&&console['error']('Folder\x20name:\x20'+_0x422f23));if(!_0x422f23)return console[_0x37fdd6(0x81)](_0x37fdd6(0x95)),0x1;const _0x47cebd=await withSpinner(_0x37fdd6(0xfb)+_0x2e7e+_0x37fdd6(0x94),()=>_0x5b58ce[_0x37fdd6(0x8e)][_0x37fdd6(0xc2)](_0x2e7e),{'verbose':_0x199a94[_0x37fdd6(0xd7)]}),_0x1946bb=_0x47cebd[_0x37fdd6(0xd9)];_0x199a94[_0x37fdd6(0xd7)]&&console[_0x37fdd6(0x81)]('Resolved\x20parent\x20ID:\x20'+_0x1946bb);const _0x219025=await withSpinner('Resolving\x20folder\x20\x27'+_0x422f23+_0x37fdd6(0x94),()=>_0x5b58ce[_0x37fdd6(0x8e)][_0x37fdd6(0xb0)](_0x1946bb,_0x422f23),{'verbose':_0x199a94['verbose']}),_0x2323ff=_0x219025['data'];_0x199a94[_0x37fdd6(0xd7)]&&console['error'](_0x37fdd6(0x91)+_0x2323ff);const _0x452e36=await withSpinner(_0x37fdd6(0xdc)+_0x422f23+_0x37fdd6(0x94),()=>_0x5b58ce['segment'][_0x37fdd6(0xe3)](_0x2323ff),{'verbose':_0x199a94['verbose']});return await handleSDKOutput([_0x452e36[_0x37fdd6(0xd9)]],_0x199a94),0x0;}catch(_0x3b204d){if(_0x3b204d instanceof SDKError)return console[_0x37fdd6(0x81)](_0x37fdd6(0xf1)+_0x3b204d[_0x37fdd6(0xba)]),_0x3b204d[_0x37fdd6(0xfd)]&&console['error'](_0x37fdd6(0x104)+_0x3b204d[_0x37fdd6(0xfd)]),0x1;throw _0x3b204d;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xb6);[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0xb4);async[a25_0x9e26f2(0xa1)](_0x3a40d2){const _0x5c41ec=a25_0x9e26f2,{options:_0x29f6ca,args:_0x6850ad,tdx:_0x42d634}=_0x3a40d2,_0x4f4462=_0x6850ad[0x0];if(!_0x4f4462)return console[_0x5c41ec(0x81)](_0x5c41ec(0xfc)),console[_0x5c41ec(0x81)](_0x5c41ec(0x10f)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x5c41ec(0x81)](_0x5c41ec(0xec)),console[_0x5c41ec(0x81)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x5c41ec(0x81)](_0x5c41ec(0xbb)),0x1;try{const _0x449432=_0x29f6ca[_0x5c41ec(0xc7)],_0x1530af=await resolveSegmentTarget(_0x4f4462,_0x449432,_0x29f6ca[_0x5c41ec(0xd7)]);_0x29f6ca[_0x5c41ec(0xd7)]&&console[_0x5c41ec(0x81)]('Target\x20path:\x20'+_0x1530af);const _0x421684=await withSpinner(_0x5c41ec(0xd5)+_0x4f4462+_0x5c41ec(0x94),()=>_0x42d634['segment'][_0x5c41ec(0xe5)](_0x1530af),{'verbose':_0x29f6ca[_0x5c41ec(0xd7)]}),_0x1bca3f=_0x421684[_0x5c41ec(0xd9)];_0x29f6ca[_0x5c41ec(0xd7)]&&(console[_0x5c41ec(0x81)](_0x5c41ec(0x10d)+_0x1bca3f[_0x5c41ec(0x112)]),console[_0x5c41ec(0x81)](_0x5c41ec(0xbe)+_0x1bca3f[_0x5c41ec(0xee)]));if(_0x1bca3f[_0x5c41ec(0x112)]===_0x5c41ec(0xf2))return console[_0x5c41ec(0x81)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console['error'](_0x5c41ec(0x7c)),0x1;if(_0x1bca3f[_0x5c41ec(0x112)]===_0x5c41ec(0xc8))return console[_0x5c41ec(0x81)](_0x5c41ec(0x9a)),console['error'](_0x5c41ec(0x11b)),0x1;if(!_0x1bca3f[_0x5c41ec(0xb7)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5c41ec(0xab));const _0x3641b1=await withSpinner(_0x5c41ec(0x85),()=>_0x42d634[_0x5c41ec(0x8e)][_0x5c41ec(0xbf)](_0x1bca3f[_0x5c41ec(0xee)],_0x1bca3f[_0x5c41ec(0xb7)]),{'verbose':_0x29f6ca['verbose']}),_0x203597=_0x3641b1[_0x5c41ec(0xd9)];return _0x29f6ca['format']===_0x5c41ec(0xfe)||_0x29f6ca[_0x5c41ec(0xd2)]===_0x5c41ec(0xa9)?await handleSDKOutput([{'sql':_0x203597}],_0x29f6ca):console[_0x5c41ec(0xcc)](_0x203597),0x0;}catch(_0x3b9dc8){if(_0x3b9dc8 instanceof SDKError)return console[_0x5c41ec(0x81)]('Error:\x20'+_0x3b9dc8[_0x5c41ec(0xba)]),_0x3b9dc8[_0x5c41ec(0xfd)]&&console[_0x5c41ec(0x81)](_0x5c41ec(0x104)+_0x3b9dc8['cause']),0x1;throw _0x3b9dc8;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xb5);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x9e26f2(0xa1)](_0x3cab72){const _0x53c3cf=a25_0x9e26f2,{options:_0x2d1e96,args:_0x59c873,tdx:_0x30888c}=_0x3cab72,_0x596dbb=_0x2d1e96;if(_0x59c873['length']<0x2)return console[_0x53c3cf(0x81)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x53c3cf(0x81)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3d2a48=_0x59c873[0x0],_0x4d28d4=_0x59c873[0x1];_0x596dbb['verbose']&&(console[_0x53c3cf(0x81)](_0x53c3cf(0xcf)+_0x596dbb[_0x53c3cf(0x9e)]),console['error'](_0x53c3cf(0xd4)+_0x3d2a48),console['error'](_0x53c3cf(0x7b)+_0x4d28d4));let _0x4ff18b;if(_0x596dbb[_0x53c3cf(0xf5)]){const _0xfa94a7=_0x596dbb['parentFolder'],_0x41bf6d=await withSpinner(_0x53c3cf(0xfb)+_0x3d2a48+_0x53c3cf(0x94),()=>_0x30888c[_0x53c3cf(0x8e)][_0x53c3cf(0xc2)](_0x3d2a48),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]}),_0x102330=_0x41bf6d['data'],_0x5ef361=await withSpinner(_0x53c3cf(0x9c)+_0xfa94a7+_0x53c3cf(0x94),()=>_0x30888c['segment']['resolveFolderId'](_0x102330,_0xfa94a7),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]});_0x4ff18b=_0x5ef361[_0x53c3cf(0xd9)],_0x596dbb[_0x53c3cf(0xd7)]&&console[_0x53c3cf(0x81)](_0x53c3cf(0x116)+_0x4ff18b);}const _0x18d619={'name':_0x4d28d4,'description':_0x596dbb[_0x53c3cf(0xca)],'parentFolderId':_0x4ff18b},_0x93305f=await withSpinner(_0x53c3cf(0x83)+_0x4d28d4+_0x53c3cf(0x94),()=>_0x30888c[_0x53c3cf(0x8e)][_0x53c3cf(0x10b)](_0x3d2a48,_0x18d619),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]}),_0x543f83=_0x93305f[_0x53c3cf(0xd9)];return console['error'](_0x53c3cf(0xe0)+_0x543f83[_0x53c3cf(0xd6)]+_0x53c3cf(0x114)+_0x543f83['id']),await handleSDKOutput([_0x543f83],_0x596dbb),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:view';['description']=a25_0x9e26f2(0xf3);async['execute'](_0x238db1){const _0x47fa2c=a25_0x9e26f2,{options:_0x5dd2e2,args:_0x290435,tdx:_0x2c829e}=_0x238db1,_0x1d400a=_0x290435[0x0];if(!_0x1d400a)return console['error'](_0x47fa2c(0x10e)),console[_0x47fa2c(0x81)](_0x47fa2c(0x7f)),console['error'](_0x47fa2c(0xf4)),console[_0x47fa2c(0x81)](_0x47fa2c(0x109)),console['error'](_0x47fa2c(0xf9)),console[_0x47fa2c(0x81)](_0x47fa2c(0xec)),console[_0x47fa2c(0x81)](_0x47fa2c(0x90)),console[_0x47fa2c(0x81)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x47fa2c(0x81)](_0x47fa2c(0x86)),console[_0x47fa2c(0x81)](_0x47fa2c(0x93)),0x1;try{const _0x37dd82=_0x5dd2e2['parentSegment'],_0x3e0f9b=await resolveSegmentTarget(_0x1d400a,_0x37dd82,_0x5dd2e2[_0x47fa2c(0xd7)]);_0x5dd2e2[_0x47fa2c(0xd7)]&&console['error']('Target\x20path:\x20'+_0x3e0f9b);const _0x2ebe18=await withSpinner(_0x47fa2c(0xd5)+_0x1d400a+_0x47fa2c(0x94),()=>_0x2c829e['segment'][_0x47fa2c(0xe5)](_0x3e0f9b),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]}),_0x4ada32=_0x2ebe18[_0x47fa2c(0xd9)];_0x5dd2e2[_0x47fa2c(0xd7)]&&(console['error'](_0x47fa2c(0x10d)+_0x4ada32[_0x47fa2c(0x112)]),console['error'](_0x47fa2c(0xbe)+_0x4ada32['parentId']),_0x4ada32[_0x47fa2c(0xa6)]&&console[_0x47fa2c(0x81)](_0x47fa2c(0x100)+_0x4ada32['folderId']),_0x4ada32['segmentId']&&console[_0x47fa2c(0x81)](_0x47fa2c(0x92)+_0x4ada32[_0x47fa2c(0xb7)]));if(_0x5dd2e2[_0x47fa2c(0xc5)]){if(_0x4ada32[_0x47fa2c(0x112)]==='folder')return console[_0x47fa2c(0x81)](_0x47fa2c(0x7d)),0x1;if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0xc8))return console[_0x47fa2c(0x81)](_0x47fa2c(0xd8)),console[_0x47fa2c(0x81)](_0x47fa2c(0xce)),0x1;if(!_0x4ada32['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x47fa2c(0xab));const _0x2ad42d=getConsoleNextUrl(_0x5dd2e2[_0x47fa2c(0x9e)],_0x47fa2c(0xa5)+_0x4ada32[_0x47fa2c(0xee)]+_0x47fa2c(0x113)+_0x4ada32[_0x47fa2c(0xb7)]);return console[_0x47fa2c(0x81)](a25_0x17ea3a[_0x47fa2c(0xe6)]('✔')+_0x47fa2c(0x8c)+a25_0x17ea3a['cyan'](_0x2ad42d)),openBrowser(_0x2ad42d),0x0;}if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0xf2)){if(!_0x4ada32[_0x47fa2c(0xa6)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x19c730=await withSpinner(_0x47fa2c(0x9d),()=>_0x2c829e[_0x47fa2c(0x8e)][_0x47fa2c(0xe3)](_0x4ada32[_0x47fa2c(0xa6)]),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]});await handleSingleObjectOutput(_0x19c730[_0x47fa2c(0xd9)],_0x5dd2e2);}else{if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0x8e)){if(!_0x4ada32[_0x47fa2c(0xb7)])throw new SDKError(ErrorCode[_0x47fa2c(0xb8)],_0x47fa2c(0xab));const _0x1a55e6=await withSpinner(_0x47fa2c(0xb1),()=>_0x2c829e['segment'][_0x47fa2c(0xc1)](_0x4ada32[_0x47fa2c(0xee)],_0x4ada32[_0x47fa2c(0xb7)]),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]}),_0x597338=getConsoleNextUrl(_0x5dd2e2[_0x47fa2c(0x9e)],_0x47fa2c(0xa5)+_0x4ada32[_0x47fa2c(0xee)]+_0x47fa2c(0x113)+_0x4ada32[_0x47fa2c(0xb7)]),_0x7b07c0=_0x1a55e6['data'];_0x7b07c0[_0x47fa2c(0x106)]=_0x597338,await handleSingleObjectOutput(_0x7b07c0,_0x5dd2e2);}else return console['error'](_0x47fa2c(0x11a)),console[_0x47fa2c(0x81)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x319dd1){if(_0x319dd1 instanceof SDKError)return console['error']('Error:\x20'+_0x319dd1[_0x47fa2c(0xba)]),_0x319dd1['cause']&&console[_0x47fa2c(0x81)](_0x47fa2c(0x104)+_0x319dd1[_0x47fa2c(0xfd)]),0x1;throw _0x319dd1;}}}function a25_0x775b(_0x3f663e,_0x5733e6){_0x3f663e=_0x3f663e-0x7b;const _0x286277=a25_0x2862();let _0x775bce=_0x286277[_0x3f663e];return _0x775bce;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:desc';[a25_0x9e26f2(0xca)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x1b681a){const _0x19150c=a25_0x9e26f2,{options:_0x49e236,args:_0x23109e,tdx:_0xf70622}=_0x1b681a,_0x37e1e9=_0x23109e[0x0];if(!_0x37e1e9)return console[_0x19150c(0x81)](_0x19150c(0xfc)),console[_0x19150c(0x81)](_0x19150c(0x82)),console[_0x19150c(0x81)](_0x19150c(0x10c)),console[_0x19150c(0x81)](_0x19150c(0xec)),console[_0x19150c(0x81)](_0x19150c(0xac)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x22c16d=_0x49e236[_0x19150c(0xc7)],_0x4847be=await resolveSegmentTarget(_0x37e1e9,_0x22c16d,_0x49e236[_0x19150c(0xd7)]);_0x49e236[_0x19150c(0xd7)]&&console['error']('Target\x20path:\x20'+_0x4847be);const _0x29d331=await withSpinner(_0x19150c(0xd5)+_0x37e1e9+_0x19150c(0x94),()=>_0xf70622[_0x19150c(0x8e)]['resolvePathToResource'](_0x4847be),{'verbose':_0x49e236[_0x19150c(0xd7)]}),_0x386677=_0x29d331['data'];_0x49e236[_0x19150c(0xd7)]&&(console[_0x19150c(0x81)](_0x19150c(0x10d)+_0x386677['type']),console[_0x19150c(0x81)](_0x19150c(0xbe)+_0x386677[_0x19150c(0xee)]));if(_0x386677[_0x19150c(0x112)]==='folder')return console[_0x19150c(0x81)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x386677[_0x19150c(0x112)]===_0x19150c(0xc8))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x19150c(0x81)](_0x19150c(0x88)),0x1;if(!_0x386677[_0x19150c(0xb7)])throw new SDKError(ErrorCode[_0x19150c(0xb8)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3504de=await withSpinner(_0x19150c(0x85),()=>_0xf70622['segment']['getSegmentSQL'](_0x386677[_0x19150c(0xee)],_0x386677['segmentId']),{'verbose':_0x49e236['verbose']}),_0x47f54e=_0x3504de[_0x19150c(0xd9)],_0xc631ae=await executeSchemaQuery(_0x47f54e,_0xf70622,_0x49e236);return await handleQueryOutput(_0xc631ae,_0x49e236),0x0;}catch(_0x5b795c){if(_0x5b795c instanceof SDKError)return console['error']('Error:\x20'+_0x5b795c[_0x19150c(0xba)]),_0x5b795c[_0x19150c(0xfd)]&&console[_0x19150c(0x81)](_0x19150c(0x104)+_0x5b795c[_0x19150c(0xfd)]),0x1;throw _0x5b795c;}}}
|
|
1
|
+
const a25_0x33e530=a25_0x3b45;(function(_0x17a158,_0x26b7e3){const _0x4c166f=a25_0x3b45,_0x234988=_0x17a158();while(!![]){try{const _0x30aa09=-parseInt(_0x4c166f(0x223))/0x1+-parseInt(_0x4c166f(0x1f6))/0x2+parseInt(_0x4c166f(0x23e))/0x3+parseInt(_0x4c166f(0x282))/0x4+parseInt(_0x4c166f(0x226))/0x5+parseInt(_0x4c166f(0x280))/0x6+parseInt(_0x4c166f(0x238))/0x7;if(_0x30aa09===_0x26b7e3)break;else _0x234988['push'](_0x234988['shift']());}catch(_0x1efb3f){_0x234988['push'](_0x234988['shift']());}}}(a25_0x1d46,0x29c05));function a25_0x3b45(_0x4ce085,_0x41d1c2){_0x4ce085=_0x4ce085-0x1f0;const _0x1d46c9=a25_0x1d46();let _0x3b452f=_0x1d46c9[_0x4ce085];return _0x3b452f;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a25_0x1d46(){const _0x497220=['\x20\x20Cause:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folder\x20name:\x20','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','254478JMNjxF','replace','jobId','866025vOkMzO','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Fetching\x20folder\x20details...','\x20rows\x20','Fetching\x20parent\x20segment\x20details...','length','segment:desc','SELECT\x20*\x20FROM\x20(\x0a','cause','✔\x20Created\x20folder\x20\x27','jsonl','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolving\x20folder\x20\x27','format','Use:\x20tdx\x20ps\x20view','url','getSegmentSQL','521367jsPfWm','Usage:\x20tdx\x20sg\x20desc\x20<name>','Use:\x20tdx\x20ps\x20show','Usage:\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','getSegment','538584Bjbuqb','Site:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','segmentId','segment:folder:show','includes','Error:\x20','✔\x20Found\x20','green','test','Error:\x20Parent\x20segment\x20name\x20is\x20required','type','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','parentSegment','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolved\x20YAML\x20file:\x20','Resolved\x20parent\x20ID:\x20','segment:folder:create','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','stats','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','elapsedTimeMillis','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Resolving\x20path\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','site','name','Resolving\x20parent\x20segment\x20\x27','fullPath','Creating\x20folder\x20\x27','Fetching\x20SQL\x20for\x20segment...','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20parent\x20folder\x20ID:\x20','description','verbose','createFolder','json','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Parent\x20segment:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','✖\x20Query\x20failed\x20[','query','Resolved\x20relative\x20path\x20to:\x20','SEGMENT_NOT_FOUND','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','error','web','Examples:','setJobId','/app/ps/','SEGMENT_FOLDER_NOT_FOUND','Segment\x20ID:\x20','\x20Opening\x20','resolveParentId','data','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment','\x27...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Fetching\x20segment\x20details...','folder','Parent\x20ID:\x20','code','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','547926PRVVxx','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','300968LMJDuC','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20Full\x20path:\x20','resolveFolderId','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20Path\x20or\x20name\x20is\x20required','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20folder\x20ID:\x20','336572iSMrJQ','Error:\x20Folder\x20reference\x20is\x20required','information_schema','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Segment\x20ID\x20missing\x20from\x20resolved\x20path','execute','Parent\x20name:\x20','parent','✔\x20Query\x20completed:\x20Processed\x20','message','resolvePathToResource','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segmentName','SQL\x20query:\x0a','Resolving\x20\x27','Options:','Show\x20segment\x20folder\x20details','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','folderId','/e/','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','parentFolder','segment:show','Listing\x20folders\x20for\x20parent\x20\x27','Use:\x20tdx\x20ps\x20view\x20-w','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Folder\x20path:\x20','Show\x20segment\x20or\x20folder\x20details','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20type:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Target\x20path:\x20','parentId'];a25_0x1d46=function(){return _0x497220;};return a25_0x1d46();}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_0x4b87e8 from'chalk';async function resolveSegmentTarget(_0x24c40c,_0x5dd1a3,_0x37c73a){const _0x407196=a25_0x3b45;if(isYamlFilePath(_0x24c40c))try{const _0x4c8233=await resolveYamlFilePath(_0x24c40c);return _0x37c73a&&(console[_0x407196(0x26d)](_0x407196(0x24f)+_0x24c40c),console[_0x407196(0x26d)]('\x20\x20Parent\x20segment:\x20'+_0x4c8233[_0x407196(0x24c)]),console[_0x407196(0x26d)]('\x20\x20Segment\x20name:\x20'+_0x4c8233[_0x407196(0x202)]),console[_0x407196(0x26d)](_0x407196(0x212)+(_0x4c8233['folderPath']||'(root)')),console[_0x407196(0x26d)](_0x407196(0x1f0)+_0x4c8233[_0x407196(0x25c)])),_0x4c8233[_0x407196(0x25c)];}catch(_0x3ad0e1){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x407196(0x281)+_0x3ad0e1[_0x407196(0x1ff)]);}if(!_0x5dd1a3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x407196(0x1f9));return _0x5dd1a3+'/'+_0x24c40c;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x33e530(0x25a)]='segment:describe';[a25_0x33e530(0x261)]=a25_0x33e530(0x213);async[a25_0x33e530(0x1fb)](_0x350539){const _0x368cbd=a25_0x33e530,{options:_0x36d097,args:_0x466077,tdx:_0x959b48}=_0x350539,_0x23bc75=_0x466077[0x0],_0x30d9d1=!_0x23bc75&&!!_0x36d097[_0x368cbd(0x24c)],_0x3219c3=_0x23bc75||_0x36d097['parentSegment'];if(!_0x3219c3)return console[_0x368cbd(0x26d)](_0x368cbd(0x1f3)),console[_0x368cbd(0x26d)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error']('Examples:'),console[_0x368cbd(0x26d)](_0x368cbd(0x21c)),console['error'](_0x368cbd(0x21d)),console[_0x368cbd(0x26d)](_0x368cbd(0x252)),console[_0x368cbd(0x26d)](_0x368cbd(0x20b)),0x1;try{const _0x286552=_0x36d097['segmentPath'];let _0x247d54=_0x3219c3;!_0x30d9d1&&_0x286552&&!_0x3219c3[_0x368cbd(0x244)]('/')&&(_0x247d54=_0x286552+'/'+_0x3219c3,_0x36d097[_0x368cbd(0x262)]&&console[_0x368cbd(0x26d)](_0x368cbd(0x26a)+_0x247d54));const _0x5f05ca=await withSpinner(_0x368cbd(0x257)+_0x247d54+_0x368cbd(0x279),()=>_0x959b48[_0x368cbd(0x278)]['resolvePathToResource'](_0x247d54),{'verbose':_0x36d097[_0x368cbd(0x262)]}),_0x42b723=_0x5f05ca['data'];_0x36d097['verbose']&&(console[_0x368cbd(0x26d)](_0x368cbd(0x216)+_0x42b723['type']),console['error'](_0x368cbd(0x27d)+_0x42b723['parentId']),_0x42b723[_0x368cbd(0x209)]&&console[_0x368cbd(0x26d)]('Folder\x20ID:\x20'+_0x42b723['folderId']),_0x42b723[_0x368cbd(0x242)]&&console[_0x368cbd(0x26d)](_0x368cbd(0x273)+_0x42b723['segmentId']));if(_0x42b723[_0x368cbd(0x24a)]===_0x368cbd(0x1fd)){const _0x470ee5=await withSpinner(_0x368cbd(0x22a),()=>_0x959b48[_0x368cbd(0x278)]['getParent'](_0x42b723['parentId']),{'verbose':_0x36d097[_0x368cbd(0x262)]});await handleSingleObjectOutput(_0x470ee5[_0x368cbd(0x276)],_0x36d097);}else{if(_0x42b723[_0x368cbd(0x24a)]==='folder'){if(!_0x42b723[_0x368cbd(0x209)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x368cbd(0x1f4));const _0x123ac0=await withSpinner(_0x368cbd(0x228),()=>_0x959b48['segment']['getFolder'](_0x42b723[_0x368cbd(0x209)]),{'verbose':_0x36d097[_0x368cbd(0x262)]});await handleSingleObjectOutput(_0x123ac0['data'],_0x36d097);}else{if(_0x42b723[_0x368cbd(0x24a)]===_0x368cbd(0x278)){if(!_0x42b723['segmentId'])throw new SDKError(ErrorCode[_0x368cbd(0x26b)],_0x368cbd(0x1fa));const _0x3332c2=await withSpinner(_0x368cbd(0x27b),()=>_0x959b48['segment'][_0x368cbd(0x23d)](_0x42b723['parentId'],_0x42b723[_0x368cbd(0x242)]),{'verbose':_0x36d097[_0x368cbd(0x262)]});await handleSingleObjectOutput(_0x3332c2['data'],_0x36d097);}}}return 0x0;}catch(_0x52419c){if(_0x52419c instanceof SDKError)return console[_0x368cbd(0x26d)](_0x368cbd(0x245)+_0x52419c[_0x368cbd(0x1ff)]),_0x52419c[_0x368cbd(0x22e)]&&console[_0x368cbd(0x26d)](_0x368cbd(0x21a)+_0x52419c[_0x368cbd(0x22e)]),0x1;throw _0x52419c;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x33e530(0x25a)]=a25_0x33e530(0x20e);[a25_0x33e530(0x261)]=a25_0x33e530(0x214);async[a25_0x33e530(0x1fb)](_0x30cfc8){const _0x2096ed=a25_0x33e530,{options:_0x2adad6,args:_0x2921d9,tdx:_0x4740a3}=_0x30cfc8,_0x38db63=_0x2921d9[0x0];if(!_0x38db63)return console[_0x2096ed(0x26d)](_0x2096ed(0x211)),console[_0x2096ed(0x26d)](_0x2096ed(0x241)),console[_0x2096ed(0x26d)](_0x2096ed(0x220)),console[_0x2096ed(0x26d)](_0x2096ed(0x26f)),console[_0x2096ed(0x26d)](_0x2096ed(0x227)),console[_0x2096ed(0x26d)](_0x2096ed(0x283)),0x1;try{const _0x2cad9=_0x2adad6[_0x2096ed(0x24c)],_0x136c97=await resolveSegmentTarget(_0x38db63,_0x2cad9,_0x2adad6[_0x2096ed(0x262)]);_0x2adad6['verbose']&&console['error'](_0x2096ed(0x218)+_0x136c97);const _0x4bc8a3=await withSpinner(_0x2096ed(0x204)+_0x38db63+_0x2096ed(0x279),()=>_0x4740a3[_0x2096ed(0x278)][_0x2096ed(0x200)](_0x136c97),{'verbose':_0x2adad6[_0x2096ed(0x262)]}),_0x29f58a=_0x4bc8a3['data'];_0x2adad6['verbose']&&(console[_0x2096ed(0x26d)](_0x2096ed(0x216)+_0x29f58a[_0x2096ed(0x24a)]),console[_0x2096ed(0x26d)](_0x2096ed(0x27d)+_0x29f58a[_0x2096ed(0x219)]));if(_0x29f58a['type']===_0x2096ed(0x27c))return console[_0x2096ed(0x26d)](_0x2096ed(0x284)),console[_0x2096ed(0x26d)](_0x2096ed(0x24e)),0x1;if(_0x29f58a['type']==='parent')return console[_0x2096ed(0x26d)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x2096ed(0x26d)](_0x2096ed(0x23a)),0x1;if(!_0x29f58a['segmentId'])throw new SDKError(ErrorCode[_0x2096ed(0x26b)],_0x2096ed(0x1fa));const _0x2c73f1=await withSpinner(_0x2096ed(0x25e),()=>_0x4740a3['segment'][_0x2096ed(0x237)](_0x29f58a[_0x2096ed(0x219)],_0x29f58a[_0x2096ed(0x242)]),{'verbose':_0x2adad6[_0x2096ed(0x262)]});let _0x47af7a=_0x2c73f1[_0x2096ed(0x276)];const _0x54a52f=resolveLimit(_0x2adad6['limit'],DEFAULT_DISPLAY_LIMIT),_0x2e1202=/\bLIMIT\s+\d+/i[_0x2096ed(0x248)](_0x47af7a);!_0x2e1202&&(_0x47af7a=_0x47af7a['trim']()[_0x2096ed(0x224)](/;+$/,''),_0x47af7a=_0x2096ed(0x22d)+_0x47af7a+_0x2096ed(0x240)+_0x54a52f);_0x2adad6['verbose']&&console[_0x2096ed(0x26d)](_0x2096ed(0x203)+_0x47af7a);const _0x2aa186=await withProgressSpinner('Executing\x20segment\x20query...',async _0x3567c0=>{const _0x4baeb6=_0x2096ed,_0x23c1a7=await _0x4740a3[_0x4baeb6(0x269)][_0x4baeb6(0x1fb)](_0x47af7a,{'catalog':'td','schema':_0x4baeb6(0x1f8),'onJobId':_0x1c39ae=>{const _0x4eb88a=_0x4baeb6;_0x3567c0[_0x4eb88a(0x270)](_0x1c39ae);}});return _0x23c1a7;},{'verbose':_0x2adad6[_0x2096ed(0x262)]}),_0x549ac1=_0x2aa186[_0x2096ed(0x276)],_0x7f11d4=_0x549ac1[_0x2096ed(0x225)]?_0x2096ed(0x231)+_0x549ac1[_0x2096ed(0x225)]+']':'';return console[_0x2096ed(0x26d)](_0x2096ed(0x1fe)+_0x549ac1[_0x2096ed(0x253)]['processedRows']['toLocaleString']()+_0x2096ed(0x229)+('in\x20'+formatElapsed(_0x549ac1['stats'][_0x2096ed(0x255)])+_0x7f11d4)),await handleQueryOutput(_0x549ac1,_0x2adad6),0x0;}catch(_0x463908){if(_0x463908 instanceof SDKError)return console[_0x2096ed(0x26d)](_0x2096ed(0x268)+_0x463908[_0x2096ed(0x27e)]+']'),console[_0x2096ed(0x26d)]('\x0a'+_0x463908['message']),0x1;throw _0x463908;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a25_0x33e530(0x261)]=a25_0x33e530(0x27f);async['execute'](_0x4f51c4){const _0x283f7c=a25_0x33e530,{options:_0x13ba84,args:_0x53bf02,tdx:_0x175b18}=_0x4f51c4;if(_0x53bf02[_0x283f7c(0x22b)]===0x0)return console[_0x283f7c(0x26d)](_0x283f7c(0x249)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x507e80=_0x53bf02[0x0];try{_0x13ba84[_0x283f7c(0x262)]&&(console[_0x283f7c(0x26d)](_0x283f7c(0x23f)+_0x13ba84[_0x283f7c(0x259)]),console[_0x283f7c(0x26d)](_0x283f7c(0x1fc)+_0x507e80));const _0x21514d=await withSpinner(_0x283f7c(0x25b)+_0x507e80+_0x283f7c(0x279),()=>_0x175b18[_0x283f7c(0x278)]['resolveParentId'](_0x507e80),{'verbose':_0x13ba84['verbose']}),_0x3d2d92=_0x21514d['data'];_0x13ba84[_0x283f7c(0x262)]&&console['error'](_0x283f7c(0x250)+_0x3d2d92);const _0x197bfb=await withSpinner(_0x283f7c(0x20f)+_0x507e80+_0x283f7c(0x279),()=>_0x175b18[_0x283f7c(0x278)]['listFolders'](_0x3d2d92),{'verbose':_0x13ba84[_0x283f7c(0x262)]}),_0x27fb73=_0x197bfb[_0x283f7c(0x276)];return console[_0x283f7c(0x26d)](_0x283f7c(0x246)+_0x27fb73['length']+'\x20folder'+(_0x27fb73[_0x283f7c(0x22b)]!==0x1?'s':'')),await handleSDKOutput(_0x27fb73,_0x13ba84),0x0;}catch(_0x4cf9d8){if(_0x4cf9d8 instanceof SDKError)return console['error']('Error:\x20'+_0x4cf9d8[_0x283f7c(0x1ff)]),_0x4cf9d8['cause']&&console[_0x283f7c(0x26d)](_0x283f7c(0x21a)+_0x4cf9d8[_0x283f7c(0x22e)]),0x1;throw _0x4cf9d8;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x33e530(0x25a)]=a25_0x33e530(0x243);['description']=a25_0x33e530(0x206);async[a25_0x33e530(0x1fb)](_0x51ca9f){const _0x5f0bc1=a25_0x33e530,{options:_0x1ea12a,args:_0x3657d9,tdx:_0x17e12d}=_0x51ca9f;if(_0x3657d9[_0x5f0bc1(0x22b)]===0x0)return console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x1f7)),console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x221)),0x1;try{const {parentId:_0x1a1cd4,childId:_0x3e85ec}=parseSegmentRef(_0x3657d9[0x0]);_0x1ea12a['verbose']&&(console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x23f)+_0x1ea12a[_0x5f0bc1(0x259)]),console['error'](_0x5f0bc1(0x1fc)+_0x1a1cd4),_0x3e85ec&&console[_0x5f0bc1(0x26d)]('Folder\x20name:\x20'+_0x3e85ec));if(!_0x3e85ec)return console['error'](_0x5f0bc1(0x207)),0x1;const _0x3aab7c=await withSpinner(_0x5f0bc1(0x25b)+_0x1a1cd4+_0x5f0bc1(0x279),()=>_0x17e12d[_0x5f0bc1(0x278)][_0x5f0bc1(0x275)](_0x1a1cd4),{'verbose':_0x1ea12a[_0x5f0bc1(0x262)]}),_0x2ca78b=_0x3aab7c[_0x5f0bc1(0x276)];_0x1ea12a[_0x5f0bc1(0x262)]&&console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x250)+_0x2ca78b);const _0x213f83=await withSpinner(_0x5f0bc1(0x233)+_0x3e85ec+_0x5f0bc1(0x279),()=>_0x17e12d[_0x5f0bc1(0x278)][_0x5f0bc1(0x1f1)](_0x2ca78b,_0x3e85ec),{'verbose':_0x1ea12a[_0x5f0bc1(0x262)]}),_0xd26760=_0x213f83['data'];_0x1ea12a['verbose']&&console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x1f5)+_0xd26760);const _0x86f09d=await withSpinner('Fetching\x20folder\x20\x27'+_0x3e85ec+'\x27...',()=>_0x17e12d['segment'][_0x5f0bc1(0x21f)](_0xd26760),{'verbose':_0x1ea12a[_0x5f0bc1(0x262)]});return await handleSDKOutput([_0x86f09d[_0x5f0bc1(0x276)]],_0x1ea12a),0x0;}catch(_0x18b732){if(_0x18b732 instanceof SDKError)return console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x245)+_0x18b732[_0x5f0bc1(0x1ff)]),_0x18b732[_0x5f0bc1(0x22e)]&&console[_0x5f0bc1(0x26d)](_0x5f0bc1(0x21a)+_0x18b732[_0x5f0bc1(0x22e)]),0x1;throw _0x18b732;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x33e530(0x25a)]='segment:sql';[a25_0x33e530(0x261)]=a25_0x33e530(0x267);async['execute'](_0x53da19){const _0x38f183=a25_0x33e530,{options:_0x34299d,args:_0xd0d6b1,tdx:_0x24a2bb}=_0x53da19,_0xa8205=_0xd0d6b1[0x0];if(!_0xa8205)return console[_0x38f183(0x26d)](_0x38f183(0x211)),console[_0x38f183(0x26d)](_0x38f183(0x23b)),console[_0x38f183(0x26d)](_0x38f183(0x201)),console[_0x38f183(0x26d)](_0x38f183(0x26f)),console[_0x38f183(0x26d)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x38f183(0x26d)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x42f89a=_0x34299d[_0x38f183(0x24c)],_0x3fa81b=await resolveSegmentTarget(_0xa8205,_0x42f89a,_0x34299d['verbose']);_0x34299d[_0x38f183(0x262)]&&console[_0x38f183(0x26d)](_0x38f183(0x218)+_0x3fa81b);const _0xb3a020=await withSpinner(_0x38f183(0x204)+_0xa8205+_0x38f183(0x279),()=>_0x24a2bb[_0x38f183(0x278)]['resolvePathToResource'](_0x3fa81b),{'verbose':_0x34299d['verbose']}),_0x51155f=_0xb3a020[_0x38f183(0x276)];_0x34299d[_0x38f183(0x262)]&&(console[_0x38f183(0x26d)](_0x38f183(0x216)+_0x51155f[_0x38f183(0x24a)]),console[_0x38f183(0x26d)]('Parent\x20ID:\x20'+_0x51155f['parentId']));if(_0x51155f[_0x38f183(0x24a)]===_0x38f183(0x27c))return console[_0x38f183(0x26d)](_0x38f183(0x265)),console[_0x38f183(0x26d)](_0x38f183(0x217)),0x1;if(_0x51155f['type']===_0x38f183(0x1fd))return console[_0x38f183(0x26d)](_0x38f183(0x215)),console[_0x38f183(0x26d)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x51155f[_0x38f183(0x242)])throw new SDKError(ErrorCode[_0x38f183(0x26b)],_0x38f183(0x1fa));const _0x477f34=await withSpinner(_0x38f183(0x25e),()=>_0x24a2bb[_0x38f183(0x278)][_0x38f183(0x237)](_0x51155f[_0x38f183(0x219)],_0x51155f[_0x38f183(0x242)]),{'verbose':_0x34299d['verbose']}),_0x45818a=_0x477f34[_0x38f183(0x276)];return _0x34299d[_0x38f183(0x234)]===_0x38f183(0x264)||_0x34299d['format']===_0x38f183(0x230)?await handleSDKOutput([{'sql':_0x45818a}],_0x34299d):console['log'](_0x45818a),0x0;}catch(_0x4d324d){if(_0x4d324d instanceof SDKError)return console['error'](_0x38f183(0x245)+_0x4d324d['message']),_0x4d324d[_0x38f183(0x22e)]&&console['error'](_0x38f183(0x21a)+_0x4d324d[_0x38f183(0x22e)]),0x1;throw _0x4d324d;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x33e530(0x25a)]=a25_0x33e530(0x251);[a25_0x33e530(0x261)]='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x33e530(0x1fb)](_0x493ac2){const _0x474047=a25_0x33e530,{options:_0x5d61e1,args:_0x7ea0b0,tdx:_0x238e51}=_0x493ac2,_0x540ab7=_0x5d61e1;if(_0x7ea0b0[_0x474047(0x22b)]<0x2)return console[_0x474047(0x26d)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x474047(0x26d)](_0x474047(0x232)),0x1;const _0x23205f=_0x7ea0b0[0x0],_0x397ac4=_0x7ea0b0[0x1];_0x540ab7['verbose']&&(console[_0x474047(0x26d)](_0x474047(0x23f)+_0x540ab7['site']),console[_0x474047(0x26d)](_0x474047(0x266)+_0x23205f),console['error'](_0x474047(0x21e)+_0x397ac4));let _0x32877f;if(_0x540ab7['parentFolder']){const _0x407e44=_0x540ab7[_0x474047(0x20d)],_0x507b82=await withSpinner(_0x474047(0x25b)+_0x23205f+_0x474047(0x279),()=>_0x238e51['segment'][_0x474047(0x275)](_0x23205f),{'verbose':_0x540ab7['verbose']}),_0x2b78fb=_0x507b82[_0x474047(0x276)],_0x10fd99=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x407e44+_0x474047(0x279),()=>_0x238e51[_0x474047(0x278)][_0x474047(0x1f1)](_0x2b78fb,_0x407e44),{'verbose':_0x540ab7[_0x474047(0x262)]});_0x32877f=_0x10fd99[_0x474047(0x276)],_0x540ab7[_0x474047(0x262)]&&console[_0x474047(0x26d)](_0x474047(0x260)+_0x32877f);}const _0x143d7f={'name':_0x397ac4,'description':_0x540ab7['description'],'parentFolderId':_0x32877f},_0xd5158a=await withSpinner(_0x474047(0x25d)+_0x397ac4+_0x474047(0x279),()=>_0x238e51[_0x474047(0x278)][_0x474047(0x263)](_0x23205f,_0x143d7f),{'verbose':_0x540ab7['verbose']}),_0x5de66f=_0xd5158a[_0x474047(0x276)];return console['error'](_0x474047(0x22f)+_0x5de66f[_0x474047(0x25a)]+'\x27\x20with\x20ID:\x20'+_0x5de66f['id']),await handleSDKOutput([_0x5de66f],_0x540ab7),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x33e530(0x25a)]='segment:view';['description']=a25_0x33e530(0x25f);async['execute'](_0x106f71){const _0x23d8b3=a25_0x33e530,{options:_0x5278c2,args:_0x4b7362,tdx:_0x5e8799}=_0x106f71,_0x3daab6=_0x4b7362[0x0];if(!_0x3daab6)return console[_0x23d8b3(0x26d)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x23d8b3(0x26d)](_0x23d8b3(0x256)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x254)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x205)),console[_0x23d8b3(0x26d)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x23d8b3(0x26d)](_0x23d8b3(0x26f)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x24d)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x24b)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x277)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x14a636=_0x5278c2[_0x23d8b3(0x24c)],_0x1d8bb8=await resolveSegmentTarget(_0x3daab6,_0x14a636,_0x5278c2[_0x23d8b3(0x262)]);_0x5278c2['verbose']&&console[_0x23d8b3(0x26d)]('Target\x20path:\x20'+_0x1d8bb8);const _0x13cbd1=await withSpinner('Resolving\x20\x27'+_0x3daab6+_0x23d8b3(0x279),()=>_0x5e8799[_0x23d8b3(0x278)][_0x23d8b3(0x200)](_0x1d8bb8),{'verbose':_0x5278c2['verbose']}),_0x255076=_0x13cbd1[_0x23d8b3(0x276)];_0x5278c2['verbose']&&(console[_0x23d8b3(0x26d)]('Resolved\x20type:\x20'+_0x255076[_0x23d8b3(0x24a)]),console[_0x23d8b3(0x26d)]('Parent\x20ID:\x20'+_0x255076[_0x23d8b3(0x219)]),_0x255076[_0x23d8b3(0x209)]&&console[_0x23d8b3(0x26d)]('Folder\x20ID:\x20'+_0x255076['folderId']),_0x255076[_0x23d8b3(0x242)]&&console[_0x23d8b3(0x26d)](_0x23d8b3(0x273)+_0x255076['segmentId']));if(_0x5278c2[_0x23d8b3(0x26e)]){if(_0x255076[_0x23d8b3(0x24a)]===_0x23d8b3(0x27c))return console[_0x23d8b3(0x26d)](_0x23d8b3(0x23c)),0x1;if(_0x255076[_0x23d8b3(0x24a)]===_0x23d8b3(0x1fd))return console[_0x23d8b3(0x26d)](_0x23d8b3(0x208)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x210)),0x1;if(!_0x255076[_0x23d8b3(0x242)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4fbca5=getConsoleNextUrl(_0x5278c2[_0x23d8b3(0x259)],_0x23d8b3(0x271)+_0x255076['parentId']+_0x23d8b3(0x20a)+_0x255076['segmentId']);return console['error'](a25_0x4b87e8[_0x23d8b3(0x247)]('✔')+_0x23d8b3(0x274)+a25_0x4b87e8['cyan'](_0x4fbca5)),openBrowser(_0x4fbca5),0x0;}if(_0x255076['type']===_0x23d8b3(0x27c)){if(!_0x255076[_0x23d8b3(0x209)])throw new SDKError(ErrorCode[_0x23d8b3(0x272)],_0x23d8b3(0x1f4));const _0x2b0a79=await withSpinner('Fetching\x20folder\x20details...',()=>_0x5e8799['segment']['getFolder'](_0x255076[_0x23d8b3(0x209)]),{'verbose':_0x5278c2[_0x23d8b3(0x262)]});await handleSingleObjectOutput(_0x2b0a79[_0x23d8b3(0x276)],_0x5278c2);}else{if(_0x255076[_0x23d8b3(0x24a)]===_0x23d8b3(0x278)){if(!_0x255076['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x23d8b3(0x1fa));const _0x1d2b96=await withSpinner(_0x23d8b3(0x27b),()=>_0x5e8799[_0x23d8b3(0x278)][_0x23d8b3(0x23d)](_0x255076[_0x23d8b3(0x219)],_0x255076[_0x23d8b3(0x242)]),{'verbose':_0x5278c2['verbose']}),_0x3af9ca=getConsoleNextUrl(_0x5278c2[_0x23d8b3(0x259)],_0x23d8b3(0x271)+_0x255076[_0x23d8b3(0x219)]+'/e/'+_0x255076['segmentId']),_0x4ec318=_0x1d2b96[_0x23d8b3(0x276)];_0x4ec318[_0x23d8b3(0x236)]=_0x3af9ca,await handleSingleObjectOutput(_0x4ec318,_0x5278c2);}else return console[_0x23d8b3(0x26d)](_0x23d8b3(0x1f2)),console[_0x23d8b3(0x26d)](_0x23d8b3(0x235)),0x1;}return 0x0;}catch(_0x575f61){if(_0x575f61 instanceof SDKError)return console[_0x23d8b3(0x26d)](_0x23d8b3(0x245)+_0x575f61[_0x23d8b3(0x1ff)]),_0x575f61[_0x23d8b3(0x22e)]&&console[_0x23d8b3(0x26d)]('\x20\x20Cause:\x20'+_0x575f61['cause']),0x1;throw _0x575f61;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x33e530(0x25a)]=a25_0x33e530(0x22c);[a25_0x33e530(0x261)]=a25_0x33e530(0x20c);async[a25_0x33e530(0x1fb)](_0x2f81ce){const _0x5c8f97=a25_0x33e530,{options:_0x37fc07,args:_0x45783e,tdx:_0x491c6c}=_0x2f81ce,_0x28e0d4=_0x45783e[0x0];if(!_0x28e0d4)return console[_0x5c8f97(0x26d)](_0x5c8f97(0x211)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x239)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x258)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x26f)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x222)),console[_0x5c8f97(0x26d)](_0x5c8f97(0x27a)),0x1;try{const _0x35a535=_0x37fc07[_0x5c8f97(0x24c)],_0x5a66c7=await resolveSegmentTarget(_0x28e0d4,_0x35a535,_0x37fc07[_0x5c8f97(0x262)]);_0x37fc07[_0x5c8f97(0x262)]&&console[_0x5c8f97(0x26d)]('Target\x20path:\x20'+_0x5a66c7);const _0x3d13d9=await withSpinner(_0x5c8f97(0x204)+_0x28e0d4+'\x27...',()=>_0x491c6c[_0x5c8f97(0x278)][_0x5c8f97(0x200)](_0x5a66c7),{'verbose':_0x37fc07['verbose']}),_0x540d71=_0x3d13d9[_0x5c8f97(0x276)];_0x37fc07['verbose']&&(console['error'](_0x5c8f97(0x216)+_0x540d71[_0x5c8f97(0x24a)]),console[_0x5c8f97(0x26d)]('Parent\x20ID:\x20'+_0x540d71['parentId']));if(_0x540d71[_0x5c8f97(0x24a)]===_0x5c8f97(0x27c))return console['error'](_0x5c8f97(0x26c)),console[_0x5c8f97(0x26d)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x540d71['type']===_0x5c8f97(0x1fd))return console['error'](_0x5c8f97(0x21b)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x540d71[_0x5c8f97(0x242)])throw new SDKError(ErrorCode[_0x5c8f97(0x26b)],_0x5c8f97(0x1fa));const _0xc77a10=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x491c6c[_0x5c8f97(0x278)][_0x5c8f97(0x237)](_0x540d71[_0x5c8f97(0x219)],_0x540d71[_0x5c8f97(0x242)]),{'verbose':_0x37fc07['verbose']}),_0x52423d=_0xc77a10[_0x5c8f97(0x276)],_0x55924c=await executeSchemaQuery(_0x52423d,_0x491c6c,_0x37fc07);return await handleQueryOutput(_0x55924c,_0x37fc07),0x0;}catch(_0x5cebd6){if(_0x5cebd6 instanceof SDKError)return console['error'](_0x5c8f97(0x245)+_0x5cebd6[_0x5c8f97(0x1ff)]),_0x5cebd6[_0x5c8f97(0x22e)]&&console['error'](_0x5c8f97(0x21a)+_0x5cebd6[_0x5c8f97(0x22e)]),0x1;throw _0x5cebd6;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x33c3(_0x475f0a,_0x1623df){_0x475f0a=_0x475f0a-0x18a;const _0x151a90=a26_0x151a();let _0x33c3a8=_0x151a90[_0x475f0a];return _0x33c3a8;}const a26_0x361ee9=a26_0x33c3;(function(_0x4b5066,_0x1d7256){const _0x386699=a26_0x33c3,_0x719dde=_0x4b5066();while(!![]){try{const _0x39104b=-parseInt(_0x386699(0x1b7))/0x1*(-parseInt(_0x386699(0x1a3))/0x2)+parseInt(_0x386699(0x192))/0x3*(-parseInt(_0x386699(0x1ab))/0x4)+-parseInt(_0x386699(0x1a8))/0x5+-parseInt(_0x386699(0x18f))/0x6*(-parseInt(_0x386699(0x198))/0x7)+-parseInt(_0x386699(0x1be))/0x8*(parseInt(_0x386699(0x1b0))/0x9)+parseInt(_0x386699(0x191))/0xa*(-parseInt(_0x386699(0x194))/0xb)+parseInt(_0x386699(0x1a5))/0xc;if(_0x39104b===_0x1d7256)break;else _0x719dde['push'](_0x719dde['shift']());}catch(_0x46c51f){_0x719dde['push'](_0x719dde['shift']());}}}(a26_0x151a,0x31f88));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a26_0x151a(){const _0x546342=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','850584IetUuS','Resolving\x20parent\x20segment\x20\x27','954790GJNmBf','798375DmwWzh','Resolving\x20folder\x20\x27','22XCUfYu','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','includes','Site:\x20','14JVtrAi','✔\x20Created\x20segment\x20\x27','error','kind','rule','folder','yellow','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x27...','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Examples:','124588eqyVta','Parent\x20path:\x20','7971972pBzywL','Resolving\x20folder\x20path\x20\x27','verbose','1611070PsAVqa','Creating\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','4goajVD','type','site','resolveParentId','segment','72cigthD','length','name','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','noCountPopulation','parent','segmentPath','1zhdpny','\x27\x20with\x20ID:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segments','invisible','description','26176GDbPAt','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Segment\x20name:\x20','data','Parent:\x20','Resolved\x20relative\x20path\x20to:\x20','execute','\x20\x20\x20Path:\x20'];a26_0x151a=function(){return _0x546342;};return a26_0x151a();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x1f61b1 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a26_0x361ee9(0x1bd)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a26_0x361ee9(0x18c)](_0x5e16a1){const _0x33b72b=a26_0x361ee9;console['error'](a26_0x1f61b1[_0x33b72b(0x19e)](_0x33b72b(0x19f))),console['error'](a26_0x1f61b1[_0x33b72b(0x19e)](_0x33b72b(0x195)));const {options:_0x1526e7,args:_0x2807c8,tdx:_0x39b4c3}=_0x5e16a1,_0x31a9fa=_0x1526e7;if(_0x2807c8[_0x33b72b(0x1b1)]===0x0)return console[_0x33b72b(0x19a)](_0x33b72b(0x1b3)),console[_0x33b72b(0x19a)](_0x33b72b(0x1aa)),console['error'](_0x33b72b(0x1a2)),console[_0x33b72b(0x19a)](_0x33b72b(0x1bf)),console[_0x33b72b(0x19a)](_0x33b72b(0x18e)),console[_0x33b72b(0x19a)](_0x33b72b(0x1a1)),0x1;const _0x3a9745=_0x2807c8[0x0],_0x9a9545=_0x1526e7[_0x33b72b(0x1b6)];let _0x51117b=_0x3a9745;_0x9a9545&&!_0x3a9745[_0x33b72b(0x196)]('/')&&(_0x51117b=_0x9a9545+'/'+_0x3a9745,_0x31a9fa['verbose']&&console[_0x33b72b(0x19a)](_0x33b72b(0x18b)+_0x51117b));const _0x1b3feb=parsePath(_0x51117b);if(_0x1b3feb[_0x33b72b(0x1bb)][_0x33b72b(0x1b1)]<0x2)return console[_0x33b72b(0x19a)](_0x33b72b(0x1b9)),console[_0x33b72b(0x19a)](_0x33b72b(0x1ba)),0x1;const _0x189357=_0x1b3feb['segments'][0x0],_0x1f1dc4=getBaseName(_0x51117b),_0x28ea38=getParentPath(_0x51117b);_0x31a9fa[_0x33b72b(0x1a7)]&&(console[_0x33b72b(0x19a)](_0x33b72b(0x197)+_0x31a9fa[_0x33b72b(0x1ad)]),console[_0x33b72b(0x19a)]('Target\x20path:\x20'+_0x51117b),console[_0x33b72b(0x19a)](_0x33b72b(0x18a)+_0x189357),console[_0x33b72b(0x19a)](_0x33b72b(0x1c0)+_0x1f1dc4),console[_0x33b72b(0x19a)](_0x33b72b(0x1a4)+_0x28ea38));const _0x120cac=await withSpinner(_0x33b72b(0x190)+_0x189357+_0x33b72b(0x1a0),()=>_0x39b4c3['segment'][_0x33b72b(0x1ae)](_0x189357),{'verbose':_0x31a9fa[_0x33b72b(0x1a7)]}),_0x27fcb7=_0x120cac[_0x33b72b(0x1c1)];let _0x2f22da;if(_0x1b3feb[_0x33b72b(0x1bb)][_0x33b72b(0x1b1)]>0x2){const _0x5ec81a=await withSpinner(_0x33b72b(0x1a6)+_0x28ea38+_0x33b72b(0x1a0),()=>_0x39b4c3[_0x33b72b(0x1af)]['resolvePathToResource'](_0x28ea38),{'verbose':_0x31a9fa[_0x33b72b(0x1a7)]}),_0x5e47f2=_0x5ec81a['data'];if(_0x5e47f2['type']!==_0x33b72b(0x19d)&&_0x5e47f2[_0x33b72b(0x1ac)]!==_0x33b72b(0x1b5))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x2f22da=_0x5e47f2['folderId'];}else{if(_0x31a9fa[_0x33b72b(0x19d)]){const _0x5bce38=await withSpinner(_0x33b72b(0x193)+_0x31a9fa[_0x33b72b(0x19d)]+_0x33b72b(0x1a0),()=>_0x39b4c3[_0x33b72b(0x1af)]['resolveFolderId'](_0x27fcb7,_0x31a9fa[_0x33b72b(0x19d)]),{'verbose':_0x31a9fa[_0x33b72b(0x1a7)]});_0x2f22da=_0x5bce38['data'];}}_0x31a9fa[_0x33b72b(0x1a7)]&&_0x2f22da&&console[_0x33b72b(0x19a)]('Resolved\x20folder\x20ID:\x20'+_0x2f22da);const _0x7382a6=await loadJSONFromOptions(_0x31a9fa[_0x33b72b(0x19c)],_0x31a9fa['ruleFile']),_0x47d3c6={'name':_0x1f1dc4,'description':_0x31a9fa[_0x33b72b(0x1bd)],'rule':_0x7382a6,'kind':_0x31a9fa[_0x33b72b(0x19b)]!==undefined?parseInt(_0x31a9fa[_0x33b72b(0x19b)],0xa):undefined,'isVisible':_0x31a9fa[_0x33b72b(0x1bc)]?![]:undefined,'segmentFolderId':_0x2f22da,'countPopulation':_0x31a9fa[_0x33b72b(0x1b4)]?![]:undefined},_0x527ec0=await withSpinner(_0x33b72b(0x1a9)+_0x1f1dc4+_0x33b72b(0x1a0),()=>_0x39b4c3[_0x33b72b(0x1af)]['createSegment'](_0x27fcb7,_0x47d3c6),{'verbose':_0x31a9fa['verbose']}),_0x22e00a=_0x527ec0[_0x33b72b(0x1c1)];return console[_0x33b72b(0x19a)](_0x33b72b(0x199)+_0x22e00a[_0x33b72b(0x1b2)]+_0x33b72b(0x1b8)+_0x22e00a['id']),_0x51117b!==_0x3a9745&&console[_0x33b72b(0x19a)](_0x33b72b(0x18d)+_0x51117b),await handleSDKOutput([_0x22e00a],_0x31a9fa),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x1deceb=a27_0x5511;function a27_0x5511(_0xe004c7,_0x501671){_0xe004c7=_0xe004c7-0x15d;const _0x579705=a27_0x5797();let _0x5511eb=_0x579705[_0xe004c7];return _0x5511eb;}(function(_0x11f7bb,_0x3d5488){const _0x2b2273=a27_0x5511,_0x1ae559=_0x11f7bb();while(!![]){try{const _0x5bd79c=-parseInt(_0x2b2273(0x175))/0x1+-parseInt(_0x2b2273(0x162))/0x2*(parseInt(_0x2b2273(0x165))/0x3)+parseInt(_0x2b2273(0x160))/0x4*(parseInt(_0x2b2273(0x16e))/0x5)+-parseInt(_0x2b2273(0x169))/0x6+parseInt(_0x2b2273(0x16b))/0x7*(parseInt(_0x2b2273(0x173))/0x8)+parseInt(_0x2b2273(0x176))/0x9*(-parseInt(_0x2b2273(0x161))/0xa)+parseInt(_0x2b2273(0x15e))/0xb*(parseInt(_0x2b2273(0x167))/0xc);if(_0x5bd79c===_0x3d5488)break;else _0x1ae559['push'](_0x1ae559['shift']());}catch(_0x270339){_0x1ae559['push'](_0x1ae559['shift']());}}}(a27_0x5797,0x1d642));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a27_0x5797(){const _0x68ed6e=['404208XWbOsV','verbose','data','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','description','448349apSZqt','listFields','807780JUYohC','40zWONkn','122TClrZA','error','length','945ixNegj','Error:\x20Parent\x20segment\x20name\x20is\x20required','48EonxAY','Listing\x20fields\x20for\x20\x27','122904KyodOv','site','217scOnBy','segment:fields','json','5nprEXN','name','segment','parentSegment','Site:\x20','51480qvFdVs','Parent\x20segment:\x20','224733qkflaR'];a27_0x5797=function(){return _0x68ed6e;};return a27_0x5797();}export class SegmentFieldsCommand extends BaseCommand{[a27_0x1deceb(0x16f)]=a27_0x1deceb(0x16c);[a27_0x1deceb(0x15d)]=a27_0x1deceb(0x179);async['execute'](_0x2391ca){const _0x52a7f3=a27_0x1deceb,{options:_0x9951a4,args:_0x539000,tdx:_0x14c498}=_0x2391ca,_0x11fea2=_0x539000[0x0]||_0x9951a4[_0x52a7f3(0x171)];if(!_0x11fea2)return console['error'](_0x52a7f3(0x166)),console[_0x52a7f3(0x163)](_0x52a7f3(0x17a)),console[_0x52a7f3(0x163)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x9951a4[_0x52a7f3(0x177)]&&(console[_0x52a7f3(0x163)](_0x52a7f3(0x172)+_0x9951a4[_0x52a7f3(0x16a)]),console[_0x52a7f3(0x163)](_0x52a7f3(0x174)+_0x11fea2));const _0x42e095=await withSpinner(_0x52a7f3(0x168)+_0x11fea2+'\x27...',()=>_0x14c498[_0x52a7f3(0x170)][_0x52a7f3(0x15f)](_0x11fea2),{'verbose':_0x9951a4[_0x52a7f3(0x177)]}),_0x8c22dc=_0x42e095[_0x52a7f3(0x178)];console[_0x52a7f3(0x163)]('✔\x20Found\x20'+_0x8c22dc[_0x52a7f3(0x164)]+'\x20field'+(_0x8c22dc[_0x52a7f3(0x164)]!==0x1?'s':''));if(_0x9951a4[_0x52a7f3(0x16d)]||_0x9951a4['jsonl'])return await handleSDKOutput(_0x8c22dc,_0x9951a4),0x0;return displayFieldsHumanReadable(_0x8c22dc,_0x11fea2),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x464e79=a28_0x4e06;(function(_0x1270c3,_0x402b00){const _0xd56b52=a28_0x4e06,_0x2d97f5=_0x1270c3();while(!![]){try{const _0x53f2bc=parseInt(_0xd56b52(0xd3))/0x1*(-parseInt(_0xd56b52(0xa6))/0x2)+parseInt(_0xd56b52(0xa7))/0x3*(-parseInt(_0xd56b52(0xa2))/0x4)+parseInt(_0xd56b52(0xe5))/0x5*(parseInt(_0xd56b52(0xe0))/0x6)+parseInt(_0xd56b52(0xcf))/0x7*(-parseInt(_0xd56b52(0xd8))/0x8)+-parseInt(_0xd56b52(0xbe))/0x9*(-parseInt(_0xd56b52(0xda))/0xa)+parseInt(_0xd56b52(0xb9))/0xb+parseInt(_0xd56b52(0xc0))/0xc;if(_0x53f2bc===_0x402b00)break;else _0x2d97f5['push'](_0x2d97f5['shift']());}catch(_0x35aeca){_0x2d97f5['push'](_0x2d97f5['shift']());}}}(a28_0x2883,0x9be41));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a28_0x2883(){const _0x2dd613=['journeys','red','data','dim','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)','segment','Pulling\x20segments\x20from\x20\x27','10095118lOElBT','\x20unchanged\x20files','Error:\x20','hasChanges','cyan','1079127XMdaoz','no_parent','3698088kBrogb','repeat','error','Site:\x20','\x0aChanges\x20to\x20\x27','dirname','Target\x20resource:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Target:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20segments','Aborted.','relativePath','\x20journeys','✔\x20Context\x20set:\x20','14PrvEfs','\x20with\x20','activations','files','11GwHUlI','resourceName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parent_segment','type','2862064dVcsgr','filter','10YLjjbG','journeyVersions','description','\x0aPull\x20summary\x20for\x20\x27','name','segments','6eisJXf','targetDir','yes','site','verbose','3833395NdzjzP','✔\x20Pulled\x20','errorCode','green','\x20=\x20','isNew','session','944gyJwyB','parentSegment','yellow','length','58046PnpRNI','5583jZbGOo','absolutePath','\x20files\x20to\x20','\x20\x20🗺️\x20\x20','parentName','\x20activations','\x20files?','\x20new\x20files','helpText','\x20versions)','counts'];a28_0x2883=function(){return _0x2dd613;};return a28_0x2883();}import a28_0x159601 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x91f806 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x4e06(_0x2ad3e2,_0x342383){_0x2ad3e2=_0x2ad3e2-0xa2;const _0x28831d=a28_0x2883();let _0x4e060d=_0x28831d[_0x2ad3e2];return _0x4e060d;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0x464e79(0xde)]='segment:pull';[a28_0x464e79(0xdc)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x18cc40){const _0x47f93e=a28_0x464e79,{options:_0x57ae07,args:_0x283aff,tdx:_0x2aa7a3}=_0x18cc40,_0x2b6e7f=_0x57ae07,_0x2d20f6=await resolveTarget({'arg':_0x283aff[0x0],'contextParent':_0x57ae07[_0x47f93e(0xa3)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2d20f6))return _0x2d20f6[_0x47f93e(0xe7)]===_0x47f93e(0xbf)?(console[_0x47f93e(0xc2)](a28_0x159601[_0x47f93e(0xa4)](_0x47f93e(0xc7))),console[_0x47f93e(0xc2)](_0x47f93e(0xb6)),console[_0x47f93e(0xc2)](_0x47f93e(0xc9)),console['error'](_0x47f93e(0xd5))):(console[_0x47f93e(0xc2)](a28_0x159601[_0x47f93e(0xb3)](_0x47f93e(0xbb)+_0x2d20f6['message']+'\x0a')),_0x2d20f6[_0x47f93e(0xaf)]&&console[_0x47f93e(0xc2)](a28_0x159601['cyan'](_0x2d20f6[_0x47f93e(0xaf)]))),0x1;const _0x29c488=_0x2d20f6[_0x47f93e(0xab)],_0x1674e7=_0x2d20f6['targetDir'],_0x223bf6=_0x2d20f6[_0x47f93e(0xd7)]==='file'?_0x2d20f6[_0x47f93e(0xd4)]:undefined;_0x2b6e7f[_0x47f93e(0xe4)]&&(console['error'](_0x47f93e(0xc3)+_0x2b6e7f[_0x47f93e(0xe3)]),console[_0x47f93e(0xc2)]('Parent\x20segment:\x20'+_0x29c488),_0x223bf6&&console[_0x47f93e(0xc2)](_0x47f93e(0xc6)+_0x223bf6));const _0xce968=await withProgressSpinner(_0x47f93e(0xb8)+_0x29c488+'\x27...',_0x1a4c38=>_0x2aa7a3[_0x47f93e(0xb7)]['pullSegments'](_0x29c488,{'targetDir':_0x1674e7,'targetResourceName':_0x223bf6,'verbose':_0x2b6e7f['verbose'],'progress':{'update':_0x4b7899=>{const _0x44389e=_0x47f93e;_0x1a4c38['setPhase'](_0x4b7899),_0x2b6e7f[_0x44389e(0xe4)]&&console[_0x44389e(0xc2)]('\x20\x20'+_0x4b7899);}}}),{'verbose':_0x2b6e7f[_0x47f93e(0xe4)]}),_0x438bec=_0xce968[_0x47f93e(0xb4)];if(_0x438bec[_0x47f93e(0xb1)][_0x47f93e(0xdf)]===0x0&&_0x438bec['counts'][_0x47f93e(0xb2)]===0x0)return console['error'](a28_0x159601[_0x47f93e(0xa4)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x438bec['parentName']+'\x27')),0x0;const _0x56a5f9=_0x438bec[_0x47f93e(0xd2)][_0x47f93e(0xd9)](_0x33128a=>_0x33128a[_0x47f93e(0xea)]),_0x1df307=_0x438bec['files'][_0x47f93e(0xd9)](_0x2c1ec2=>!_0x2c1ec2[_0x47f93e(0xea)]&&_0x2c1ec2[_0x47f93e(0xbc)]),_0x8e4864=_0x438bec[_0x47f93e(0xd2)][_0x47f93e(0xd9)](_0x123513=>!_0x123513[_0x47f93e(0xea)]&&!_0x123513[_0x47f93e(0xbc)]);console['error'](_0x47f93e(0xdd)+_0x438bec[_0x47f93e(0xab)]+'\x27:'),console[_0x47f93e(0xc2)]('\x20\x20🎯\x20'+a28_0x159601[_0x47f93e(0xbd)](_0x438bec['counts'][_0x47f93e(0xdf)]+_0x47f93e(0xca))+_0x47f93e(0xd0)+a28_0x159601[_0x47f93e(0xbd)](_0x438bec[_0x47f93e(0xb1)][_0x47f93e(0xd1)]+_0x47f93e(0xac)));if(_0x438bec[_0x47f93e(0xb1)][_0x47f93e(0xb2)]>0x0){const _0x37e27a=_0x438bec[_0x47f93e(0xb1)][_0x47f93e(0xdb)]>_0x438bec[_0x47f93e(0xb1)][_0x47f93e(0xb2)]?'\x20('+_0x438bec[_0x47f93e(0xb1)][_0x47f93e(0xdb)]+_0x47f93e(0xb0):'';console[_0x47f93e(0xc2)](_0x47f93e(0xaa)+a28_0x159601['cyan'](_0x438bec['counts'][_0x47f93e(0xb2)]+_0x47f93e(0xcd))+a28_0x159601['dim'](_0x37e27a));}console[_0x47f93e(0xc2)]('\x20\x20'+a28_0x159601[_0x47f93e(0xe8)]('+\x20'+_0x56a5f9[_0x47f93e(0xa5)]+_0x47f93e(0xae))),console[_0x47f93e(0xc2)]('\x20\x20'+a28_0x159601['yellow']('~\x20'+_0x1df307[_0x47f93e(0xa5)]+'\x20changed\x20files')),console[_0x47f93e(0xc2)]('\x20\x20'+a28_0x159601[_0x47f93e(0xb5)]('=\x20'+_0x8e4864[_0x47f93e(0xa5)]+_0x47f93e(0xba))),console[_0x47f93e(0xc2)](_0x47f93e(0xc8)+a28_0x159601[_0x47f93e(0xbd)](_0x438bec[_0x47f93e(0xe1)])+'\x0a');if(_0x1df307['length']>0x0)for(const _0x2c714c of _0x1df307){console[_0x47f93e(0xc2)](_0x47f93e(0xc4)+_0x2c714c[_0x47f93e(0xcc)]+'\x27:'),console['error']('─'[_0x47f93e(0xc1)](0x3c)),console[_0x47f93e(0xc2)](_0x2c714c['diff']),console[_0x47f93e(0xc2)]('─'[_0x47f93e(0xc1)](0x3c));}if(_0x2b6e7f['dryRun'])return console[_0x47f93e(0xc2)](a28_0x159601[_0x47f93e(0xa4)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x56a5f9[_0x47f93e(0xa5)]===0x0&&_0x1df307[_0x47f93e(0xa5)]===0x0)return console['error'](a28_0x159601['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x438bec[_0x47f93e(0xab)]},_0x2b6e7f[_0x47f93e(0xeb)]),console[_0x47f93e(0xc2)](a28_0x159601['green'](_0x47f93e(0xce)+a28_0x159601[_0x47f93e(0xb5)](_0x47f93e(0xd6))+_0x47f93e(0xe9)+a28_0x159601[_0x47f93e(0xbd)](_0x438bec[_0x47f93e(0xab)]))),0x0;if(!_0x2b6e7f[_0x47f93e(0xe2)]){const _0x3327e1=await confirmKey('Write\x20'+(_0x56a5f9[_0x47f93e(0xa5)]+_0x1df307[_0x47f93e(0xa5)])+_0x47f93e(0xad));if(!_0x3327e1)return console[_0x47f93e(0xc2)](_0x47f93e(0xcb)),0x1;}for(const _0x2f5ffe of _0x438bec['files']){if(_0x2f5ffe[_0x47f93e(0xea)]||_0x2f5ffe[_0x47f93e(0xbc)]){const _0x4ab9e3=a28_0x91f806[_0x47f93e(0xc5)](_0x2f5ffe[_0x47f93e(0xa8)]);!existsSync(_0x4ab9e3)&&mkdirSync(_0x4ab9e3,{'recursive':!![]}),writeFileSync(_0x2f5ffe['absolutePath'],_0x2f5ffe['content'],'utf-8');}}return console[_0x47f93e(0xc2)](a28_0x159601[_0x47f93e(0xe8)](_0x47f93e(0xe6)+(_0x56a5f9['length']+_0x1df307['length'])+_0x47f93e(0xa9)+_0x438bec[_0x47f93e(0xe1)])),saveSessionContext({'parent_segment':_0x438bec[_0x47f93e(0xab)]},_0x2b6e7f[_0x47f93e(0xeb)]),console['error'](a28_0x159601[_0x47f93e(0xe8)](_0x47f93e(0xce)+a28_0x159601[_0x47f93e(0xb5)](_0x47f93e(0xd6))+'\x20=\x20'+a28_0x159601[_0x47f93e(0xbd)](_0x438bec[_0x47f93e(0xab)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x148b94=a29_0x23d3;(function(_0x56a632,_0x500ee8){const _0xabb299=a29_0x23d3,_0x169cde=_0x56a632();while(!![]){try{const _0x22b2f6=-parseInt(_0xabb299(0x17a))/0x1*(-parseInt(_0xabb299(0x1c3))/0x2)+parseInt(_0xabb299(0x1d8))/0x3+-parseInt(_0xabb299(0x205))/0x4*(-parseInt(_0xabb299(0x1a3))/0x5)+parseInt(_0xabb299(0x1a0))/0x6*(-parseInt(_0xabb299(0x1f0))/0x7)+parseInt(_0xabb299(0x1aa))/0x8+parseInt(_0xabb299(0x1f1))/0x9*(-parseInt(_0xabb299(0x179))/0xa)+-parseInt(_0xabb299(0x1a8))/0xb*(parseInt(_0xabb299(0x1eb))/0xc);if(_0x22b2f6===_0x500ee8)break;else _0x169cde['push'](_0x169cde['shift']());}catch(_0x44a1e2){_0x169cde['push'](_0x169cde['shift']());}}}(a29_0x26fe,0x2d04c));import{BaseCommand}from'./command.js';function a29_0x23d3(_0x5a4147,_0x44d5bb){_0x5a4147=_0x5a4147-0x16f;const _0x26fe0c=a29_0x26fe();let _0x23d3bf=_0x26fe0c[_0x5a4147];return _0x23d3bf;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x26fe(){const _0x3aa820=['red','scopedFolderPath','user','name','\x20unchanged','endsWith','error','\x20activations]','\x20\x20📊\x20Segments:','getParent','folderPath','toCreate','getOutputSchemaWithCache','dryRun','Changes\x20to:','4TXCZQi','\x20created','createdSegmentIds','/e/','Delete\x20segment:','unchanged','results','\x20to\x20update','join','push','cyan','message','parentFolder','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','new','855790zZTwEe','1jCZTPh','data','\x20YAML\x20files\x20found','\x20to\x20delete','yellow','then','\x20\x20Activations:','changed','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','repeat','helpText','get','Push\x20','segmentFolderId','Scoped\x20to\x20folder:\x20','Error\x20parsing\x20YAML:\x20','dim','errorCode','parentName','createdAt','Site:\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','isNew','Fetching\x20existing\x20journeys...','Parent\x20segment:\x20','paused','Source\x20directory:\x20','\x20changes?','/j/da/je','\x20updated','Changes\x20to\x20journey:','Fetching\x20existing\x20segments...','deleted','segment:push','\x20\x20Journeys:\x20','idToName','Fetching\x20existing\x20folders...','Error:\x20Directory\x20not\x20found:\x20','30KXPBNf','parentSegment','updated','435555mudkCo','activations','existingJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','add','20317pLFrAu','green','2058808gGNZMV','nameToType','targetDir','set','📁\x20','\x20folders\x20to\x20create','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','length','\x20changed','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)','segments','\x0aPush\x20summary\x20for\x20\x27','blue','delete','journeysOnly','(Journey\x20will\x20be\x20deleted)','\x20\x20Source:\x20','type','site','\x0aValidation\x20failed:','map','getJourney','30034bruwey','.yml','\x27...','filePath','filter','listSegments','diff','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Fetching\x20parent\x20segment\x20details...','journeys','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','resolveParentId','Fetching\x20users\x20for\x20email\x20resolution...','toString','file','journeyBundleName','\x20\x20Activations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','listActivations','all','yamlConfig','1001355QoEFZG','execute','versionNumber','journeyId','verbose','folderId','journey','segment','/app/ps/','.yaml','Error:\x20','yes','Fetching\x20connections\x20for\x20name\x20resolution...','buildUserMaps','listJourneysWithDetailsFromParentSegment','\x20new','attributes','Delete\x20journey:','listFolders','1164nLQodS','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','created','toDelete','\x20deleted','341782YQQhaI','9SqGASK','\x20\x20\x20\x20','connection','parent_name','audienceId'];a29_0x26fe=function(){return _0x3aa820;};return a29_0x26fe();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x59382d 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_0x148b94(0x1f9)]=a29_0x148b94(0x19b);[a29_0x148b94(0x1b3)]=a29_0x148b94(0x1ec);async[a29_0x148b94(0x1d9)](_0x3ee347){const _0x2fb0ec=a29_0x148b94,{options:_0x53f071,args:_0x15c851,tdx:_0x569999}=_0x3ee347,_0x4965b1=_0x53f071,_0x166c0a=await resolveTarget({'arg':_0x15c851[0x0],'contextParent':_0x53f071[_0x2fb0ec(0x1a1)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x166c0a))return _0x166c0a[_0x2fb0ec(0x18b)]==='no_parent'?(console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x1b1))),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1b6)),console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x18f))):(console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1e2)+_0x166c0a['message']+'\x0a')),_0x166c0a[_0x2fb0ec(0x184)]&&console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x166c0a[_0x2fb0ec(0x184)]))),0x1;if(_0x166c0a['type']===_0x2fb0ec(0x1f4))return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x19f)+_0x166c0a[_0x2fb0ec(0x1ac)]+'\x0a')),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x2fb0ec(0x1b2))),0x1;const _0x3d98e4=_0x166c0a[_0x2fb0ec(0x18c)],_0x4bf7c2=_0x166c0a[_0x2fb0ec(0x1ac)],_0x3a3ef3=_0x166c0a[_0x2fb0ec(0x1be)]===_0x2fb0ec(0x1d1)?_0x166c0a[_0x2fb0ec(0x1c6)]:undefined,_0x3f8d0a=getScopedDetails(_0x166c0a),_0xf26547=_0x3f8d0a?.['isScoped']??![],_0xdc5e4a=_0x3f8d0a?.[_0x2fb0ec(0x1f7)]??'';if(!existsSync(_0x4bf7c2))return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x19f)+_0x4bf7c2+'\x0a')),console['error'](a29_0x59382d['cyan'](_0x2fb0ec(0x1b2))),0x1;_0x4965b1[_0x2fb0ec(0x1dc)]&&(console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x18e)+_0x4965b1[_0x2fb0ec(0x1bf)]),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x192)+_0x3d98e4),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x194)+_0x4bf7c2),_0xf26547&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x188)+_0xdc5e4a));const _0xfa23ed=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3d98e4+_0x2fb0ec(0x1c5),()=>_0x569999['segment'][_0x2fb0ec(0x1ce)](_0x3d98e4),{'verbose':_0x4965b1['verbose']}),_0x3a25f2=_0xfa23ed[_0x2fb0ec(0x17b)],[_0x46782b,_0x324d08,_0x1c0160,_0x385815,_0xdc1e5a]=await Promise[_0x2fb0ec(0x1d6)]([withSpinner(_0x2fb0ec(0x1cb),()=>_0x569999['segment'][_0x2fb0ec(0x1ff)](_0x3a25f2),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x199),()=>_0x569999['segment'][_0x2fb0ec(0x1c8)](_0x3a25f2),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x19e),()=>_0x569999[_0x2fb0ec(0x1df)][_0x2fb0ec(0x1ea)](_0x3a25f2),{'verbose':_0x4965b1['verbose']}),withSpinner(_0x2fb0ec(0x191),()=>_0x569999[_0x2fb0ec(0x1de)][_0x2fb0ec(0x1e6)](_0x3a25f2,{'includeAllVersions':!![]}),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x1cf),()=>_0x569999['user'][_0x2fb0ec(0x1e5)](),{'verbose':_0x4965b1['verbose']})['then'](_0x51ba97=>_0x51ba97[_0x2fb0ec(0x17b)])]),_0x44c899=_0x46782b['data'],_0x6336e=extractRootFolderId(_0x44c899),_0x534f9f=_0x324d08[_0x2fb0ec(0x17b)],_0x49ae2b=_0x1c0160['data'],{journeys:_0x6811c,activationStepsById:_0xfa96e}=_0x385815[_0x2fb0ec(0x17b)],_0x31fbb1=new Map(_0x6811c[_0x2fb0ec(0x1c1)](_0x20e1be=>[_0x20e1be['id'],_0x20e1be])),_0x3bb89c=_0x6811c['map'](_0xed34a0=>({'id':_0xed34a0['id'],'name':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1f9)],'journeyBundleName':_0xed34a0[_0x2fb0ec(0x1e8)]['journeyBundleName']||'','journeyBundleId':_0xed34a0[_0x2fb0ec(0x1e8)]['journeyBundleId']||'','versionNumber':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1da)],'description':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1b3)],'state':_0xed34a0['attributes']['state'],'paused':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x193)],'audienceId':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1f5)],'folderId':_0xed34a0['relationships']?.[_0x2fb0ec(0x176)]?.[_0x2fb0ec(0x17b)]?.['id'],'createdAt':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x18d)],'updatedAt':_0xed34a0[_0x2fb0ec(0x1e8)]['updatedAt']})),{emailToId:_0x52d75b,idToEmail:_0x2796c7}=_0xdc1e5a,_0x24a71a=await withSpinner(_0x2fb0ec(0x1e4),async()=>{const _0x236b8d=_0x2fb0ec,_0x32d319=await _0x569999[_0x236b8d(0x1f3)]['list']();return buildConnectionMaps(_0x32d319);},{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]})[_0x2fb0ec(0x17f)](_0x1add43=>_0x1add43[_0x2fb0ec(0x17b)]),_0x22262c=_0x24a71a['nameToId'],_0x2d4dd6=_0x24a71a[_0x2fb0ec(0x19d)],_0x4156d7=_0x24a71a[_0x2fb0ec(0x1ab)],_0x3b642d={'emailToIdMap':_0x52d75b,'connectionNameToIdMap':_0x22262c,'connectionNameToTypeMap':_0x4156d7,'getSchema':_0x3be2c3=>_0x569999['connection'][_0x2fb0ec(0x202)](_0x3be2c3)};let {pathToId:_0xd75346,idToPath:_0x4ad80e}=buildFolderMaps(_0x49ae2b);const _0x184ea0=buildSegmentLookupMap(_0x534f9f,_0x4ad80e),_0xb2eb32=buildSegmentNameToIdMap(_0x534f9f),_0x5db5b4=buildJourneyBundleLookupMap(_0x3bb89c,_0x4ad80e);let _0x5dc204;if(_0x3a3ef3){if(!_0x3a3ef3[_0x2fb0ec(0x1fb)](_0x2fb0ec(0x1c4))&&!_0x3a3ef3[_0x2fb0ec(0x1fb)](_0x2fb0ec(0x1e1)))return console['error'](a29_0x59382d[_0x2fb0ec(0x1f6)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3a3ef3+'\x0a')),0x1;_0x5dc204=[_0x3a3ef3];}else _0x5dc204=findYamlFiles(_0x4bf7c2);if(_0x5dc204['length']===0x0)return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1a6)+_0x4bf7c2+'\x0a')),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x2fb0ec(0x177))),0x1;let _0x4bb2d6,_0x30f8d1;try{const _0x2ce79f=parseAndClassifyYamlFiles(_0x5dc204,_0x4bf7c2,{'skipSegments':_0x4965b1[_0x2fb0ec(0x1bb)]});_0x4bb2d6=_0x2ce79f[_0x2fb0ec(0x1b7)],_0x30f8d1=_0x2ce79f['journeys'];const _0x55d7f8=validateParsedFiles(_0x2ce79f,_0x4bf7c2);if(_0x55d7f8[_0x2fb0ec(0x1b4)]>0x0)return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1c0))),console[_0x2fb0ec(0x1fc)](formatValidationErrors(_0x55d7f8)),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x40b3d4){return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x189)+(_0x40b3d4 instanceof Error?_0x40b3d4[_0x2fb0ec(0x175)]:_0x40b3d4))),0x1;}if(_0x4bb2d6[_0x2fb0ec(0x1b4)]===0x0&&_0x30f8d1[_0x2fb0ec(0x1b4)]===0x0){const _0x9cfa3a=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x2fb0ec(0x1de):'segment\x20or\x20journey';return console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow']('No\x20'+_0x9cfa3a+_0x2fb0ec(0x17c))),0x0;}const _0x12f2f4=new Map();_0x534f9f['length']>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x534f9f,async _0x2193b9=>{const _0x9ce622=a29_0x23d3,_0xd364d8=await _0x569999['segment'][_0x9ce622(0x1d5)](_0x3a25f2,_0x2193b9['id']);_0x12f2f4[_0x9ce622(0x1ad)](_0x2193b9['id'],_0xd364d8);});},{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]});const {segmentFiles:_0x15922b,foldersToCreate:_0x26cec3}=await prepareSegmentFiles(_0x4bb2d6,{'segmentByFolderAndName':_0x184ea0,'activationsBySegmentId':_0x12f2f4,'folderPathToId':_0xd75346,'idToEmailMap':_0x2796c7,'connectionIdToNameMap':_0x2d4dd6},_0x3b642d,_0xf26547,_0xdc5e4a),_0x176964=_0x3a3ef3?[]:findSegmentsToDelete(_0x534f9f,_0x4bb2d6['map'](({yamlConfig:_0xaf9ee1,folderPath:_0x2ad6e8})=>({'yamlConfig':_0xaf9ee1,'folderPath':resolveTDFolderPath(_0x2ad6e8,_0xf26547,_0xdc5e4a)})),_0x4ad80e,_0xdc5e4a,_0xf26547),{journeyFiles:_0x167354,foldersToCreate:_0x38e6f7}=await withProgressSpinner('Preparing\x20journeys...',async _0x5ab300=>prepareJourneyFiles(_0x30f8d1,{'fetchJourney':async _0x3fa2d9=>_0x569999['journey'][_0x2fb0ec(0x1c2)](_0x3fa2d9[_0x2fb0ec(0x1db)]),'journeyBundlesByFolderAndName':_0x5db5b4,'folderPathToId':_0xd75346,'idToEmailMap':_0x2796c7,'connectionIdToNameMap':_0x2d4dd6,'existingSegments':_0x534f9f,'parentId':_0x3a25f2,'deps':_0x569999,'progress':{'update':_0x59d6b0=>{const _0x184fe8=_0x2fb0ec;_0x5ab300['setPhase'](_0x59d6b0),_0x4965b1[_0x184fe8(0x1dc)]&&console[_0x184fe8(0x1fc)]('\x20\x20'+_0x59d6b0);}},'journeyById':_0x31fbb1,'activationStepsById':_0xfa96e},_0xf26547,_0xdc5e4a),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]})[_0x2fb0ec(0x17f)](_0x4ef57f=>_0x4ef57f['data']);for(const _0x190ef3 of _0x38e6f7){_0x26cec3[_0x2fb0ec(0x1a7)](_0x190ef3);}const _0x3c419d=_0x3a3ef3?[]:findJourneysToDelete(_0x3bb89c,_0x30f8d1[_0x2fb0ec(0x1c1)](({yamlConfig:_0x57421d,folderPath:_0x2539c6})=>({'yamlConfig':_0x57421d,'folderPath':resolveTDFolderPath(_0x2539c6,_0xf26547,_0xdc5e4a)})),_0x4ad80e,_0xdc5e4a,_0xf26547),_0x23c23a=calculatePushStats(_0x15922b,_0x167354,_0x26cec3,_0x176964,_0x3c419d,!!_0x4965b1[_0x2fb0ec(0x1ba)],!!_0x4965b1[_0x2fb0ec(0x1bb)]),_0x302f14=_0x23c23a['segments']['new'],_0x317b65=_0x23c23a[_0x2fb0ec(0x1b7)]['changed'],_0x395f41=_0x23c23a[_0x2fb0ec(0x1b7)][_0x2fb0ec(0x16f)],_0x72c0b0=_0x23c23a[_0x2fb0ec(0x1b7)][_0x2fb0ec(0x1ee)],_0x52e2ad=_0x23c23a['folders'][_0x2fb0ec(0x201)],_0x43db94=_0x23c23a['journeys'][_0x2fb0ec(0x178)],_0x5486ed=_0x23c23a[_0x2fb0ec(0x1cc)][_0x2fb0ec(0x181)],_0x337794=_0x23c23a[_0x2fb0ec(0x1cc)]['unchanged'],_0x2bea55=_0x23c23a['journeys'][_0x2fb0ec(0x1ee)],_0x1d455c=_0x23c23a['activations'][_0x2fb0ec(0x1d6)],_0x175787=_0x23c23a[_0x2fb0ec(0x1a4)]['toCreate'],_0x17e8fb=_0x23c23a[_0x2fb0ec(0x1a4)]['toUpdate'],_0x2aaa8e=_0x23c23a[_0x2fb0ec(0x1a4)]['toDelete'];console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1b8)+_0x3d98e4+'\x27:');_0x52e2ad['length']>0x0&&console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x1b9)](_0x2fb0ec(0x1ae)+_0x52e2ad[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1af)));if(!_0x4965b1[_0x2fb0ec(0x1bb)]){console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1fe)),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1a9)]('+\x20'+_0x302f14[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1e7))),console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20'+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x317b65[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b5)));if(_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0)console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1f6)]('-\x20'+_0x72c0b0[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d)));else _0x176964[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1ba)]&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x18a)](_0x176964[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b0)));console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d['dim']('=\x20'+_0x395f41['length']+_0x2fb0ec(0x1fa)));}if(_0x167354[_0x2fb0ec(0x1b4)]>0x0||_0x3c419d['length']>0x0){console[_0x2fb0ec(0x1fc)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d['green']('+\x20'+_0x43db94[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1e7))),console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b5)));if(_0x2bea55['length']>0x0)console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1f6)]('-\x20'+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d)));else _0x3c419d[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['delete']&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x18a)](_0x3c419d[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b0)));console['error']('\x20\x20\x20\x20'+a29_0x59382d[_0x2fb0ec(0x18a)]('=\x20'+_0x337794[_0x2fb0ec(0x1b4)]+'\x20unchanged'));}_0x1d455c[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly']&&(console[_0x2fb0ec(0x1fc)](''),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x180)),_0x175787['length']>0x0&&console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1a9)]('+\x20'+_0x175787['length']+'\x20to\x20create')),_0x17e8fb['length']>0x0&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x17e8fb[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x171))),_0x2aaa8e[_0x2fb0ec(0x1b4)]>0x0&&console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20'+a29_0x59382d['red']('-\x20'+_0x2aaa8e[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d))));console['error'](_0x2fb0ec(0x1bd)+a29_0x59382d[_0x2fb0ec(0x174)](_0x4bf7c2)+'\x0a');if(_0x52e2ad['length']>0x0){console[_0x2fb0ec(0x1fc)]('Folders\x20to\x20create:');for(const _0x4f5ff5 of _0x52e2ad){console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d['blue']('+')+'\x20'+_0x4f5ff5);}console[_0x2fb0ec(0x1fc)]('');}if(_0x302f14[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)])for(const _0x50a931 of _0x302f14){const _0x1b4d5a=_0x50a931['folderPath']?_0x50a931[_0x2fb0ec(0x200)]+'/'+_0x50a931[_0x2fb0ec(0x1d7)]['name']:_0x50a931[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)],_0x494c2e=_0x50a931[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1a4)]?.[_0x2fb0ec(0x1b4)]||0x0,_0xa8670=_0x494c2e>0x0?a29_0x59382d[_0x2fb0ec(0x18a)]('\x20['+_0x494c2e+_0x2fb0ec(0x1fd)):'';console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1a9)]('New\x20segment:')+'\x20'+_0x1b4d5a+_0xa8670),console['error']('─'[_0x2fb0ec(0x183)](0x3c)),_0x50a931['diff']&&console[_0x2fb0ec(0x1fc)](_0x50a931[_0x2fb0ec(0x1c9)]),console[_0x2fb0ec(0x1fc)]('─'['repeat'](0x3c));}if(_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly'])for(const _0x111d34 of _0x72c0b0){const _0xa388b9=_0x111d34[_0x2fb0ec(0x187)]?_0x4ad80e[_0x2fb0ec(0x185)](_0x111d34[_0x2fb0ec(0x187)][_0x2fb0ec(0x1d0)]())||'':'',_0x22a271=_0xa388b9?_0xa388b9+'/'+_0x111d34['name']:_0x111d34[_0x2fb0ec(0x1f9)],_0x3b75da=_0x12f2f4[_0x2fb0ec(0x185)](_0x111d34['id'])||[],_0x464757=_0x3b75da[_0x2fb0ec(0x1b4)]>0x0?a29_0x59382d['dim']('\x20['+_0x3b75da['length']+_0x2fb0ec(0x1fd)):'';console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x209))+'\x20'+_0x22a271+_0x464757),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c));const _0x3e203f=segmentWithActivationsToYaml(_0x111d34,_0x3b75da,undefined,_0x2796c7,_0x2d4dd6),_0x382ce4=segmentToYamlString(_0x3e203f),_0x141764=generateDiff(_0x382ce4,'');console[_0x2fb0ec(0x1fc)](formatDiffWithColors(_0x141764)),console['error']('─'['repeat'](0x3c));}const _0x46b6ae=_0x15922b[_0x2fb0ec(0x1c7)](_0x590fbe=>!_0x590fbe[_0x2fb0ec(0x190)]&&_0x590fbe[_0x2fb0ec(0x1c9)]);if(_0x46b6ae[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)])for(const _0x3129e1 of _0x46b6ae){const _0x317872=_0x3129e1[_0x2fb0ec(0x200)]?_0x3129e1['folderPath']+'/'+_0x3129e1[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x3129e1[_0x2fb0ec(0x1d7)]['name'];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x204))+'\x20'+_0x317872),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c)),console[_0x2fb0ec(0x1fc)](_0x3129e1[_0x2fb0ec(0x1c9)]),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c));}if(_0x43db94[_0x2fb0ec(0x1b4)]>0x0)for(const _0x1de433 of _0x43db94){const _0x4caa01=_0x1de433[_0x2fb0ec(0x200)]?_0x1de433[_0x2fb0ec(0x200)]+'/'+_0x1de433[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x1de433[_0x2fb0ec(0x1d7)]['name'];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1a9)]('New\x20journey:')+'\x20'+_0x4caa01),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c)),_0x1de433['diff']&&console[_0x2fb0ec(0x1fc)](_0x1de433[_0x2fb0ec(0x1c9)]),console['error']('─'[_0x2fb0ec(0x183)](0x3c));}const _0x31bdaf=_0x167354[_0x2fb0ec(0x1c7)](_0x39d6d4=>!_0x39d6d4[_0x2fb0ec(0x190)]&&_0x39d6d4[_0x2fb0ec(0x1c9)]);if(_0x31bdaf['length']>0x0)for(const _0x7d3c11 of _0x31bdaf){const _0x5ef378=_0x7d3c11[_0x2fb0ec(0x200)]?_0x7d3c11[_0x2fb0ec(0x200)]+'/'+_0x7d3c11[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x7d3c11[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x198))+'\x20'+_0x5ef378),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c)),console[_0x2fb0ec(0x1fc)](_0x7d3c11['diff']),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c));}if(_0x2bea55['length']>0x0)for(const _0xbf8851 of _0x2bea55){const _0x36510b=_0xbf8851[_0x2fb0ec(0x1dd)]?_0x4ad80e[_0x2fb0ec(0x185)](_0xbf8851[_0x2fb0ec(0x1dd)])||'':'',_0x13f538=_0x36510b?_0x36510b+'/'+_0xbf8851[_0x2fb0ec(0x1d2)]:_0xbf8851[_0x2fb0ec(0x1d2)];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1e9))+'\x20'+_0x13f538),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c)),console['error'](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1bc))),console['error']('─'[_0x2fb0ec(0x183)](0x3c));}if(_0x4965b1[_0x2fb0ec(0x203)])return console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow'](_0x2fb0ec(0x1d4))),0x0;const _0x37880a=_0x4965b1[_0x2fb0ec(0x1bb)]?![]:_0x302f14[_0x2fb0ec(0x1b4)]>0x0||_0x317b65[_0x2fb0ec(0x1b4)]>0x0||_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0,_0x586451=_0x43db94['length']>0x0||_0x5486ed[_0x2fb0ec(0x1b4)]>0x0||_0x2bea55[_0x2fb0ec(0x1b4)]>0x0,_0x89e42d=_0x4965b1['journeysOnly']?![]:_0x1d455c[_0x2fb0ec(0x1b4)]>0x0,_0x300288=_0x52e2ad[_0x2fb0ec(0x1b4)]>0x0;if(!_0x37880a&&!_0x586451&&!_0x89e42d&&!_0x300288){const _0x2f8b20=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x2fb0ec(0x182):_0x2fb0ec(0x1cd);console['error'](a29_0x59382d[_0x2fb0ec(0x1a9)](_0x2f8b20));if(_0x3a3ef3&&_0x337794[_0x2fb0ec(0x1b4)]===0x1){const _0x1820da=_0x337794[0x0];if(_0x1820da['existingJourney']?.['id']){const _0x2e0957=getConsoleNextUrl(_0x4965b1[_0x2fb0ec(0x1bf)],_0x2fb0ec(0x1e0)+_0x3a25f2+_0x2fb0ec(0x208)+_0x1820da[_0x2fb0ec(0x1a5)]['id']+'/j/da/je');console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x174)](_0x2e0957));}}return 0x0;}const _0x2efd75=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x43db94[_0x2fb0ec(0x1b4)]+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x52e2ad[_0x2fb0ec(0x1b4)]:_0x302f14[_0x2fb0ec(0x1b4)]+_0x317b65[_0x2fb0ec(0x1b4)]+_0x72c0b0[_0x2fb0ec(0x1b4)]+_0x43db94[_0x2fb0ec(0x1b4)]+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x52e2ad['length']+_0x1d455c[_0x2fb0ec(0x1b4)];if(!_0x4965b1[_0x2fb0ec(0x1e3)]&&_0x2efd75>0x0){const _0xa0aee0=await confirmKey(_0x2fb0ec(0x186)+_0x2efd75+_0x2fb0ec(0x195));if(!_0xa0aee0)return console[_0x2fb0ec(0x1fc)]('Aborted.'),0x1;}const _0x59c15a={'withProgress':async(_0x17e598,_0x5c42cd)=>{const _0xa88e9f=_0x2fb0ec,_0x5beb94=await withSpinner(_0x17e598,_0x5c42cd,{'verbose':_0x4965b1['verbose']});return{'data':_0x5beb94[_0xa88e9f(0x17b)]};},'logInfo':_0x17ed71=>console['error'](a29_0x59382d[_0x2fb0ec(0x1b9)]('✔\x20'+_0x17ed71)),'logSuccess':_0x20f885=>console['error'](a29_0x59382d['green']('✔\x20'+_0x20f885)),'logWarning':_0x3ea156=>console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)]('⚠\x20'+_0x3ea156)),'logDeleted':_0x1f5849=>console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)]('✔\x20'+_0x1f5849))},_0x21aa4f={'segment':_0x569999[_0x2fb0ec(0x1df)],'journey':_0x569999[_0x2fb0ec(0x1de)],'user':_0x569999[_0x2fb0ec(0x1f8)],'connection':_0x569999[_0x2fb0ec(0x1f3)]};_0x52e2ad['length']>0x0&&(_0xd75346=await executePushFolders(_0x21aa4f,_0x52e2ad,_0xd75346,{'parentId':_0x3a25f2},_0x59c15a));const _0x2673b3={'rootFolderId':_0x6336e,'folderPathToId':_0xd75346,'folderIdToPath':_0x4ad80e,'segmentNameToId':_0xb2eb32,'activationsBySegmentId':_0x12f2f4,'emailToIdMap':_0x52d75b,'idToEmailMap':_0x2796c7,'connectionNameToIdMap':_0x24a71a['nameToId'],'connectionIdToNameMap':_0x24a71a[_0x2fb0ec(0x19d)],'connectionNameToTypeMap':_0x4156d7},_0x511020=await executePushSegments(_0x21aa4f,_0x4965b1[_0x2fb0ec(0x1bb)]?[]:_0x15922b,_0x2673b3,{'parentId':_0x3a25f2},_0x59c15a),_0x592d93=_0x511020[_0x2fb0ec(0x1ed)],_0x44a950=_0x511020[_0x2fb0ec(0x1a2)],_0x395c66=_0x511020[_0x2fb0ec(0x1a4)][_0x2fb0ec(0x1ed)],_0x17a1c0=_0x511020[_0x2fb0ec(0x1a4)][_0x2fb0ec(0x1a2)],_0x4f7300=_0x511020['activations'][_0x2fb0ec(0x19a)],_0x5148a6=await executePushSegmentDeletions(_0x21aa4f,_0x4965b1[_0x2fb0ec(0x1bb)]?[]:_0x72c0b0,_0x59c15a);let _0x3e0031=0x0,_0x179d50=0x0,_0x56a0b8=0x0;const _0xd5614b=new Map(_0xb2eb32);for(const [_0x1f07e8,_0x4684d8]of _0x511020[_0x2fb0ec(0x207)]){_0xd5614b[_0x2fb0ec(0x1ad)](_0x1f07e8,_0x4684d8);}if(_0x167354[_0x2fb0ec(0x1b4)]>0x0){const _0x2fa1e2={..._0x2673b3,'segmentNameToId':_0xd5614b,'existingSegments':_0x534f9f,'activationContext':_0x3b642d},_0x356d77=await executePushJourneys(_0x21aa4f,_0x167354,_0x2fa1e2,{'parentId':_0x3a25f2,'rootFolderId':_0x6336e,'verbose':_0x4965b1['verbose']},_0x59c15a);_0x3e0031=_0x356d77[_0x2fb0ec(0x1ed)],_0x179d50=_0x356d77[_0x2fb0ec(0x1a2)];if(_0x3a3ef3&&_0x356d77[_0x2fb0ec(0x170)][_0x2fb0ec(0x1b4)]===0x1){const _0x12ffab=_0x356d77[_0x2fb0ec(0x170)][0x0];if(_0x12ffab['journeyId']){const _0x93a861=getConsoleNextUrl(_0x4965b1['site'],'/app/ps/'+_0x3a25f2+_0x2fb0ec(0x208)+_0x12ffab[_0x2fb0ec(0x1db)]+_0x2fb0ec(0x196));console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x174)](_0x93a861));}}}for(const _0x40750b of _0x2bea55){console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow'](_0x2fb0ec(0x1ca)+_0x40750b['journeyBundleName'])),_0x56a0b8++;}const _0x3569d4=[];if(_0x592d93>0x0)_0x3569d4[_0x2fb0ec(0x173)](_0x592d93+'\x20created');if(_0x44a950>0x0)_0x3569d4['push'](_0x44a950+'\x20updated');if(_0x5148a6>0x0)_0x3569d4['push'](_0x5148a6+'\x20deleted');const _0x4ec1ec=[];if(_0x3e0031>0x0)_0x4ec1ec['push'](_0x3e0031+'\x20created');if(_0x179d50>0x0)_0x4ec1ec[_0x2fb0ec(0x173)](_0x179d50+_0x2fb0ec(0x197));if(_0x56a0b8>0x0)_0x4ec1ec[_0x2fb0ec(0x173)](_0x56a0b8+_0x2fb0ec(0x1ef));const _0x46665c=[];if(_0x395c66>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x395c66+_0x2fb0ec(0x206));if(_0x17a1c0>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x17a1c0+'\x20updated');if(_0x4f7300>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x4f7300+_0x2fb0ec(0x1ef));return console[_0x2fb0ec(0x1fc)](a29_0x59382d['green']('\x0a✔\x20Push\x20complete')),_0x3569d4[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly']&&console['error']('\x20\x20Segments:\x20'+_0x3569d4[_0x2fb0ec(0x172)](',\x20')),_0x4ec1ec['length']>0x0&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x19c)+_0x4ec1ec[_0x2fb0ec(0x172)](',\x20')),_0x46665c[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)]&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1d3)+_0x46665c[_0x2fb0ec(0x172)](',\x20')),0x0;}}
|
|
1
|
+
const a29_0x5bc6b1=a29_0x54ea;(function(_0x16d951,_0x1d825a){const _0x4f5ed6=a29_0x54ea,_0xe3dd89=_0x16d951();while(!![]){try{const _0x314671=parseInt(_0x4f5ed6(0x1f0))/0x1*(parseInt(_0x4f5ed6(0x1b2))/0x2)+-parseInt(_0x4f5ed6(0x19f))/0x3+-parseInt(_0x4f5ed6(0x1f9))/0x4+parseInt(_0x4f5ed6(0x203))/0x5*(-parseInt(_0x4f5ed6(0x22b))/0x6)+parseInt(_0x4f5ed6(0x1dd))/0x7*(-parseInt(_0x4f5ed6(0x214))/0x8)+-parseInt(_0x4f5ed6(0x1bd))/0x9*(-parseInt(_0x4f5ed6(0x1d0))/0xa)+-parseInt(_0x4f5ed6(0x1a9))/0xb*(-parseInt(_0x4f5ed6(0x1b7))/0xc);if(_0x314671===_0x1d825a)break;else _0xe3dd89['push'](_0xe3dd89['shift']());}catch(_0x4503cc){_0xe3dd89['push'](_0xe3dd89['shift']());}}}(a29_0x5e11,0x59cf7));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_0x11d044 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a29_0x54ea(_0x29629f,_0x52e655){_0x29629f=_0x29629f-0x197;const _0x5e11c3=a29_0x5e11();let _0x54eacc=_0x5e11c3[_0x29629f];return _0x54eacc;}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{['name']='segment:push';['description']=a29_0x5bc6b1(0x19d);async[a29_0x5bc6b1(0x227)](_0x369b04){const _0x55bd93=a29_0x5bc6b1,{options:_0x4b6c02,args:_0x344b45,tdx:_0x5724a4}=_0x369b04,_0xd05e91=_0x4b6c02,_0x1e4652=await resolveTarget({'arg':_0x344b45[0x0],'contextParent':_0x4b6c02['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1e4652))return _0x1e4652[_0x55bd93(0x1cc)]===_0x55bd93(0x1d8)?(console[_0x55bd93(0x1ab)](a29_0x11d044['yellow'](_0x55bd93(0x219))),console[_0x55bd93(0x1ab)](_0x55bd93(0x1f5)),console['error'](_0x55bd93(0x1e0)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x1b8)+_0x1e4652[_0x55bd93(0x1cb)]+'\x0a')),_0x1e4652['helpText']&&console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x21d)](_0x1e4652[_0x55bd93(0x1eb)]))),0x1;if(_0x1e4652[_0x55bd93(0x1ac)]===_0x55bd93(0x1d2))return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x223)+_0x1e4652['targetDir']+'\x0a')),console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x21d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x51ebe3=_0x1e4652[_0x55bd93(0x1be)],_0x503009=_0x1e4652[_0x55bd93(0x211)],_0x4c23c1=_0x1e4652['type']==='file'?_0x1e4652[_0x55bd93(0x217)]:undefined,_0x4bb1f4=getScopedDetails(_0x1e4652),_0x58d0cd=_0x4bb1f4?.[_0x55bd93(0x1e7)]??![],_0x51374a=_0x4bb1f4?.['scopedFolderPath']??'';if(!existsSync(_0x503009))return console['error'](a29_0x11d044[_0x55bd93(0x221)]('Error:\x20Directory\x20not\x20found:\x20'+_0x503009+'\x0a')),console['error'](a29_0x11d044[_0x55bd93(0x21d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0xd05e91[_0x55bd93(0x21b)]&&(console[_0x55bd93(0x1ab)]('Site:\x20'+_0xd05e91[_0x55bd93(0x1c3)]),console[_0x55bd93(0x1ab)](_0x55bd93(0x218)+_0x51ebe3),console[_0x55bd93(0x1ab)](_0x55bd93(0x20c)+_0x503009),_0x58d0cd&&console[_0x55bd93(0x1ab)](_0x55bd93(0x19a)+_0x51374a));const _0x1a274f=await withSpinner(_0x55bd93(0x1bb)+_0x51ebe3+'\x27...',()=>_0x5724a4[_0x55bd93(0x205)]['resolveParentId'](_0x51ebe3),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),_0x2775d9=_0x1a274f[_0x55bd93(0x212)],[_0x151a74,_0x2b5bc3,_0x3f7402,_0x24e900,_0x255c10]=await Promise[_0x55bd93(0x1a3)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x5724a4[_0x55bd93(0x205)][_0x55bd93(0x1fa)](_0x2775d9),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),withSpinner(_0x55bd93(0x222),()=>_0x5724a4['segment'][_0x55bd93(0x1ce)](_0x2775d9),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x5724a4['segment']['listFolders'](_0x2775d9),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),withSpinner(_0x55bd93(0x1ed),()=>_0x5724a4[_0x55bd93(0x1f2)]['listJourneysWithDetailsFromParentSegment'](_0x2775d9,{'includeAllVersions':!![]}),{'verbose':_0xd05e91[_0x55bd93(0x21b)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x5724a4['user'][_0x55bd93(0x1a5)](),{'verbose':_0xd05e91['verbose']})[_0x55bd93(0x1b4)](_0x2e5f67=>_0x2e5f67['data'])]),_0xe9a349=_0x151a74['data'],_0x38fa44=extractRootFolderId(_0xe9a349),_0x5ca255=_0x2b5bc3['data'],_0x1e2cdd=_0x3f7402['data'],{journeys:_0x51c183,activationStepsById:_0x4c9399}=_0x24e900[_0x55bd93(0x212)],_0x3f3994=new Map(_0x51c183[_0x55bd93(0x1d6)](_0x155953=>[_0x155953['id'],_0x155953])),_0x1713a2=_0x51c183['map'](_0x34c1ed=>({'id':_0x34c1ed['id'],'name':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1d7)],'journeyBundleName':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1e6)]||'','journeyBundleId':_0x34c1ed['attributes']['journeyBundleId']||'','versionNumber':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1cf)],'description':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1a1)],'state':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x1f6)],'paused':_0x34c1ed['attributes'][_0x55bd93(0x1d1)],'audienceId':_0x34c1ed['attributes']['audienceId'],'folderId':_0x34c1ed[_0x55bd93(0x1af)]?.[_0x55bd93(0x1ea)]?.[_0x55bd93(0x212)]?.['id'],'createdAt':_0x34c1ed[_0x55bd93(0x1ec)]['createdAt'],'updatedAt':_0x34c1ed[_0x55bd93(0x1ec)][_0x55bd93(0x213)]})),{emailToId:_0x2c9624,idToEmail:_0x450788}=_0x255c10,_0x276610=await withSpinner(_0x55bd93(0x21e),async()=>{const _0x481e75=_0x55bd93,_0x7bb18=await _0x5724a4['connection'][_0x481e75(0x209)]();return buildConnectionMaps(_0x7bb18);},{'verbose':_0xd05e91[_0x55bd93(0x21b)]})[_0x55bd93(0x1b4)](_0x4897d5=>_0x4897d5[_0x55bd93(0x212)]),_0x82e01=_0x276610['nameToId'],_0x128629=_0x276610[_0x55bd93(0x1ad)],_0x516111=_0x276610[_0x55bd93(0x210)],_0x318a23={'emailToIdMap':_0x2c9624,'connectionNameToIdMap':_0x82e01,'connectionNameToTypeMap':_0x516111,'getSchema':_0x56cc8c=>_0x5724a4[_0x55bd93(0x1f7)][_0x55bd93(0x201)](_0x56cc8c)};let {pathToId:_0x32d12e,idToPath:_0x2e73a9}=buildFolderMaps(_0x1e2cdd);const _0xfc0b2b=buildSegmentLookupMap(_0x5ca255,_0x2e73a9),_0x5cc728=buildSegmentNameToIdMap(_0x5ca255),_0x3b8ddb=buildJourneyBundleLookupMap(_0x1713a2,_0x2e73a9);let _0x41cc22;if(_0x4c23c1){if(!_0x4c23c1[_0x55bd93(0x1f1)](_0x55bd93(0x1c6))&&!_0x4c23c1[_0x55bd93(0x1f1)](_0x55bd93(0x21c)))return console['error'](a29_0x11d044['red'](_0x55bd93(0x1c2)+_0x4c23c1+'\x0a')),0x1;_0x41cc22=[_0x4c23c1];}else _0x41cc22=findYamlFiles(_0x503009);if(_0x41cc22['length']===0x0)return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x1c4)+_0x503009+'\x0a')),console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x21d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x38122f,_0x1900f2;try{const _0x15b8e3=parseAndClassifyYamlFiles(_0x41cc22,_0x503009,{'skipSegments':_0xd05e91[_0x55bd93(0x1db)]});_0x38122f=_0x15b8e3[_0x55bd93(0x1c7)],_0x1900f2=_0x15b8e3[_0x55bd93(0x199)];const _0xe1f323=validateParsedFiles(_0x15b8e3,_0x503009);if(_0xe1f323[_0x55bd93(0x197)]>0x0)return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)]('\x0aValidation\x20failed:')),console[_0x55bd93(0x1ab)](formatValidationErrors(_0xe1f323)),console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)](_0x55bd93(0x229))),0x1;}catch(_0x35902d){return console[_0x55bd93(0x1ab)](a29_0x11d044['red'](_0x55bd93(0x1f3)+(_0x35902d instanceof Error?_0x35902d['message']:_0x35902d))),0x1;}if(_0x38122f[_0x55bd93(0x197)]===0x0&&_0x1900f2[_0x55bd93(0x197)]===0x0){const _0x21eed8=_0xd05e91[_0x55bd93(0x1db)]?'journey':_0x55bd93(0x1de);return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)]('No\x20'+_0x21eed8+_0x55bd93(0x207))),0x0;}const _0xf620bf=new Map();_0x5ca255[_0x55bd93(0x197)]>0x0&&!_0xd05e91['journeysOnly']&&await withSpinner(_0x55bd93(0x1c8),async()=>{await batchAsync(_0x5ca255,async _0x1452aa=>{const _0x3d9548=a29_0x54ea,_0x486419=await _0x5724a4[_0x3d9548(0x205)][_0x3d9548(0x1e3)](_0x2775d9,_0x1452aa['id']);_0xf620bf['set'](_0x1452aa['id'],_0x486419);});},{'verbose':_0xd05e91['verbose']});const {segmentFiles:_0x50b087,foldersToCreate:_0x51db61}=await prepareSegmentFiles(_0x38122f,{'segmentByFolderAndName':_0xfc0b2b,'activationsBySegmentId':_0xf620bf,'folderPathToId':_0x32d12e,'idToEmailMap':_0x450788,'connectionIdToNameMap':_0x128629},_0x318a23,_0x58d0cd,_0x51374a),_0x577c3b=_0x4c23c1?[]:findSegmentsToDelete(_0x5ca255,_0x38122f[_0x55bd93(0x1d6)](({yamlConfig:_0x50662c,folderPath:_0x3b7c23})=>({'yamlConfig':_0x50662c,'folderPath':resolveTDFolderPath(_0x3b7c23,_0x58d0cd,_0x51374a)})),_0x2e73a9,_0x51374a,_0x58d0cd),{journeyFiles:_0x422465,foldersToCreate:_0x3f3948}=await withProgressSpinner('Preparing\x20journeys...',async _0x2d3f03=>prepareJourneyFiles(_0x1900f2,{'fetchJourney':async _0x106746=>_0x5724a4[_0x55bd93(0x1f2)][_0x55bd93(0x1c1)](_0x106746[_0x55bd93(0x1bc)]),'journeyBundlesByFolderAndName':_0x3b8ddb,'folderPathToId':_0x32d12e,'idToEmailMap':_0x450788,'connectionIdToNameMap':_0x128629,'existingSegments':_0x5ca255,'parentId':_0x2775d9,'deps':_0x5724a4,'progress':{'update':_0x25801a=>{const _0x53dc1a=_0x55bd93;_0x2d3f03[_0x53dc1a(0x1e4)](_0x25801a),_0xd05e91[_0x53dc1a(0x21b)]&&console['error']('\x20\x20'+_0x25801a);}},'journeyById':_0x3f3994,'activationStepsById':_0x4c9399},_0x58d0cd,_0x51374a),{'verbose':_0xd05e91['verbose']})['then'](_0x5b7dd1=>_0x5b7dd1[_0x55bd93(0x212)]);for(const _0x22bd26 of _0x3f3948){_0x51db61[_0x55bd93(0x225)](_0x22bd26);}const _0x24539d=_0x4c23c1?[]:findJourneysToDelete(_0x1713a2,_0x1900f2[_0x55bd93(0x1d6)](({yamlConfig:_0x482fe3,folderPath:_0xbb0837})=>({'yamlConfig':_0x482fe3,'folderPath':resolveTDFolderPath(_0xbb0837,_0x58d0cd,_0x51374a)})),_0x2e73a9,_0x51374a,_0x58d0cd),_0x5f3431=calculatePushStats(_0x50b087,_0x422465,_0x51db61,_0x577c3b,_0x24539d,!!_0xd05e91[_0x55bd93(0x1e9)],!!_0xd05e91['journeysOnly']),_0x417158=_0x5f3431[_0x55bd93(0x1c7)]['new'],_0x472cd0=_0x5f3431[_0x55bd93(0x1c7)][_0x55bd93(0x1cd)],_0x23b739=_0x5f3431['segments'][_0x55bd93(0x224)],_0x37c8b8=_0x5f3431['segments'][_0x55bd93(0x1f4)],_0xce5a5a=_0x5f3431[_0x55bd93(0x1ee)][_0x55bd93(0x1fe)],_0x303f33=_0x5f3431['journeys']['new'],_0x351e61=_0x5f3431[_0x55bd93(0x199)][_0x55bd93(0x1cd)],_0x52c6fd=_0x5f3431[_0x55bd93(0x199)]['unchanged'],_0x447d64=_0x5f3431['journeys']['toDelete'],_0x5bb84f=_0x5f3431[_0x55bd93(0x1c9)][_0x55bd93(0x1a3)],_0x860a3c=_0x5f3431[_0x55bd93(0x1c9)][_0x55bd93(0x1fe)],_0x5359f7=_0x5f3431[_0x55bd93(0x1c9)][_0x55bd93(0x1dc)],_0x6196aa=_0x5f3431[_0x55bd93(0x1c9)][_0x55bd93(0x1f4)];console[_0x55bd93(0x1ab)](_0x55bd93(0x21f)+_0x51ebe3+'\x27:');_0xce5a5a[_0x55bd93(0x197)]>0x0&&console[_0x55bd93(0x1ab)]('\x20\x20'+a29_0x11d044[_0x55bd93(0x20e)]('📁\x20'+_0xce5a5a[_0x55bd93(0x197)]+_0x55bd93(0x1ae)));if(!_0xd05e91[_0x55bd93(0x1db)]){console[_0x55bd93(0x1ab)](_0x55bd93(0x21a)),console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['green']('+\x20'+_0x417158[_0x55bd93(0x197)]+_0x55bd93(0x1c0))),console['error'](_0x55bd93(0x226)+a29_0x11d044[_0x55bd93(0x20d)]('~\x20'+_0x472cd0['length']+_0x55bd93(0x1c5)));if(_0x37c8b8[_0x55bd93(0x197)]>0x0)console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['red']('-\x20'+_0x37c8b8[_0x55bd93(0x197)]+_0x55bd93(0x1b9)));else _0x577c3b[_0x55bd93(0x197)]>0x0&&!_0xd05e91[_0x55bd93(0x1e9)]&&console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['dim'](_0x577c3b[_0x55bd93(0x197)]+_0x55bd93(0x1b5)));console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044[_0x55bd93(0x1f8)]('=\x20'+_0x23b739['length']+'\x20unchanged'));}if(_0x422465[_0x55bd93(0x197)]>0x0||_0x24539d[_0x55bd93(0x197)]>0x0){console[_0x55bd93(0x1ab)](_0x55bd93(0x1aa)),console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['green']('+\x20'+_0x303f33[_0x55bd93(0x197)]+_0x55bd93(0x1c0))),console['error'](_0x55bd93(0x226)+a29_0x11d044['yellow']('~\x20'+_0x351e61[_0x55bd93(0x197)]+'\x20changed'));if(_0x447d64[_0x55bd93(0x197)]>0x0)console['error']('\x20\x20\x20\x20'+a29_0x11d044[_0x55bd93(0x221)]('-\x20'+_0x447d64[_0x55bd93(0x197)]+_0x55bd93(0x1b9)));else _0x24539d[_0x55bd93(0x197)]>0x0&&!_0xd05e91[_0x55bd93(0x1e9)]&&console['error'](_0x55bd93(0x226)+a29_0x11d044[_0x55bd93(0x1f8)](_0x24539d[_0x55bd93(0x197)]+_0x55bd93(0x1b5)));console[_0x55bd93(0x1ab)]('\x20\x20\x20\x20'+a29_0x11d044[_0x55bd93(0x1f8)]('=\x20'+_0x52c6fd[_0x55bd93(0x197)]+_0x55bd93(0x1df)));}_0x5bb84f[_0x55bd93(0x197)]>0x0&&!_0xd05e91['journeysOnly']&&(console[_0x55bd93(0x1ab)](''),console[_0x55bd93(0x1ab)](_0x55bd93(0x1d4)),_0x860a3c['length']>0x0&&console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044[_0x55bd93(0x1d5)]('+\x20'+_0x860a3c[_0x55bd93(0x197)]+_0x55bd93(0x19e))),_0x5359f7[_0x55bd93(0x197)]>0x0&&console[_0x55bd93(0x1ab)]('\x20\x20\x20\x20'+a29_0x11d044[_0x55bd93(0x20d)]('~\x20'+_0x5359f7[_0x55bd93(0x197)]+_0x55bd93(0x1ff))),_0x6196aa[_0x55bd93(0x197)]>0x0&&console[_0x55bd93(0x1ab)](_0x55bd93(0x226)+a29_0x11d044['red']('-\x20'+_0x6196aa[_0x55bd93(0x197)]+_0x55bd93(0x1b9))));console[_0x55bd93(0x1ab)]('\x20\x20Source:\x20'+a29_0x11d044[_0x55bd93(0x21d)](_0x503009)+'\x0a');if(_0xce5a5a[_0x55bd93(0x197)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x4a3590 of _0xce5a5a){console[_0x55bd93(0x1ab)]('\x20\x20'+a29_0x11d044[_0x55bd93(0x20e)]('+')+'\x20'+_0x4a3590);}console[_0x55bd93(0x1ab)]('');}if(_0x417158['length']>0x0&&!_0xd05e91[_0x55bd93(0x1db)])for(const _0x399057 of _0x417158){const _0x4d774b=_0x399057[_0x55bd93(0x1da)]?_0x399057[_0x55bd93(0x1da)]+'/'+_0x399057[_0x55bd93(0x1e8)][_0x55bd93(0x1d7)]:_0x399057[_0x55bd93(0x1e8)]['name'],_0x58057c=_0x399057[_0x55bd93(0x1e8)][_0x55bd93(0x1c9)]?.[_0x55bd93(0x197)]||0x0,_0x430702=_0x58057c>0x0?a29_0x11d044['dim']('\x20['+_0x58057c+'\x20activations]'):'';console['error']('\x0a'+a29_0x11d044[_0x55bd93(0x1d5)](_0x55bd93(0x1e2))+'\x20'+_0x4d774b+_0x430702),console[_0x55bd93(0x1ab)]('─'['repeat'](0x3c)),_0x399057[_0x55bd93(0x1fb)]&&console['error'](_0x399057['diff']),console[_0x55bd93(0x1ab)]('─'['repeat'](0x3c));}if(_0x37c8b8[_0x55bd93(0x197)]>0x0&&!_0xd05e91['journeysOnly'])for(const _0x212c81 of _0x37c8b8){const _0x196190=_0x212c81[_0x55bd93(0x200)]?_0x2e73a9[_0x55bd93(0x1b1)](_0x212c81[_0x55bd93(0x200)][_0x55bd93(0x1ef)]())||'':'',_0x1ceee2=_0x196190?_0x196190+'/'+_0x212c81[_0x55bd93(0x1d7)]:_0x212c81[_0x55bd93(0x1d7)],_0x7276b7=_0xf620bf[_0x55bd93(0x1b1)](_0x212c81['id'])||[],_0x199523=_0x7276b7[_0x55bd93(0x197)]>0x0?a29_0x11d044['dim']('\x20['+_0x7276b7[_0x55bd93(0x197)]+'\x20activations]'):'';console[_0x55bd93(0x1ab)]('\x0a'+a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x19c))+'\x20'+_0x1ceee2+_0x199523),console['error']('─'[_0x55bd93(0x204)](0x3c));const _0x432a37=segmentWithActivationsToYaml(_0x212c81,_0x7276b7,undefined,_0x450788,_0x128629),_0x30dded=segmentToYamlString(_0x432a37),_0x5b9e38=generateDiff(_0x30dded,'');console['error'](formatDiffWithColors(_0x5b9e38)),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}const _0x2075cc=_0x50b087['filter'](_0x275fcb=>!_0x275fcb['isNew']&&_0x275fcb['diff']);if(_0x2075cc[_0x55bd93(0x197)]>0x0&&!_0xd05e91['journeysOnly'])for(const _0x472bfd of _0x2075cc){const _0x5dd3a1=_0x472bfd[_0x55bd93(0x1da)]?_0x472bfd['folderPath']+'/'+_0x472bfd[_0x55bd93(0x1e8)][_0x55bd93(0x1d7)]:_0x472bfd['yamlConfig'][_0x55bd93(0x1d7)];console[_0x55bd93(0x1ab)]('\x0a'+a29_0x11d044[_0x55bd93(0x20d)](_0x55bd93(0x1b3))+'\x20'+_0x5dd3a1),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c)),console[_0x55bd93(0x1ab)](_0x472bfd[_0x55bd93(0x1fb)]),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}if(_0x303f33['length']>0x0)for(const _0x23600d of _0x303f33){const _0x316bff=_0x23600d[_0x55bd93(0x1da)]?_0x23600d['folderPath']+'/'+_0x23600d[_0x55bd93(0x1e8)][_0x55bd93(0x1d7)]:_0x23600d['yamlConfig']['name'];console['error']('\x0a'+a29_0x11d044[_0x55bd93(0x1d5)]('New\x20journey:')+'\x20'+_0x316bff),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c)),_0x23600d[_0x55bd93(0x1fb)]&&console['error'](_0x23600d['diff']),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}const _0x4af3f1=_0x422465[_0x55bd93(0x1b0)](_0x112bc9=>!_0x112bc9[_0x55bd93(0x1fc)]&&_0x112bc9['diff']);if(_0x4af3f1[_0x55bd93(0x197)]>0x0)for(const _0x5a94f1 of _0x4af3f1){const _0x9b3f0=_0x5a94f1[_0x55bd93(0x1da)]?_0x5a94f1[_0x55bd93(0x1da)]+'/'+_0x5a94f1[_0x55bd93(0x1e8)]['name']:_0x5a94f1[_0x55bd93(0x1e8)][_0x55bd93(0x1d7)];console[_0x55bd93(0x1ab)]('\x0a'+a29_0x11d044[_0x55bd93(0x20d)](_0x55bd93(0x228))+'\x20'+_0x9b3f0),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c)),console['error'](_0x5a94f1[_0x55bd93(0x1fb)]),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}if(_0x447d64[_0x55bd93(0x197)]>0x0)for(const _0x46937d of _0x447d64){const _0x26fd5c=_0x46937d[_0x55bd93(0x19b)]?_0x2e73a9[_0x55bd93(0x1b1)](_0x46937d['folderId'])||'':'',_0xed0d17=_0x26fd5c?_0x26fd5c+'/'+_0x46937d[_0x55bd93(0x1e6)]:_0x46937d[_0x55bd93(0x1e6)];console[_0x55bd93(0x1ab)]('\x0a'+a29_0x11d044['red'](_0x55bd93(0x1a0))+'\x20'+_0xed0d17),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c)),console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x221)](_0x55bd93(0x1d3))),console[_0x55bd93(0x1ab)]('─'[_0x55bd93(0x204)](0x3c));}if(_0xd05e91[_0x55bd93(0x1e5)])return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4549fa=_0xd05e91[_0x55bd93(0x1db)]?![]:_0x417158['length']>0x0||_0x472cd0[_0x55bd93(0x197)]>0x0||_0x37c8b8['length']>0x0,_0x18c5cf=_0x303f33[_0x55bd93(0x197)]>0x0||_0x351e61[_0x55bd93(0x197)]>0x0||_0x447d64['length']>0x0,_0x10f566=_0xd05e91['journeysOnly']?![]:_0x5bb84f[_0x55bd93(0x197)]>0x0,_0x3a5f13=_0xce5a5a['length']>0x0;if(!_0x4549fa&&!_0x18c5cf&&!_0x10f566&&!_0x3a5f13){const _0x5e4813=_0xd05e91[_0x55bd93(0x1db)]?_0x55bd93(0x22a):_0x55bd93(0x198);console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x1d5)](_0x5e4813));if(_0x4c23c1&&_0x52c6fd[_0x55bd93(0x197)]===0x1){const _0xe00b1c=_0x52c6fd[0x0];if(_0xe00b1c[_0x55bd93(0x1ba)]?.['id']){const _0x382212=getConsoleNextUrl(_0xd05e91['site'],_0x55bd93(0x215)+_0x2775d9+_0x55bd93(0x1b6)+_0xe00b1c[_0x55bd93(0x1ba)]['id']+'/j/da/je');console[_0x55bd93(0x1ab)]('\x20\x20'+a29_0x11d044[_0x55bd93(0x21d)](_0x382212));}}return 0x0;}const _0x132ea7=_0xd05e91['journeysOnly']?_0x303f33[_0x55bd93(0x197)]+_0x351e61[_0x55bd93(0x197)]+_0x447d64['length']+_0xce5a5a[_0x55bd93(0x197)]:_0x417158[_0x55bd93(0x197)]+_0x472cd0['length']+_0x37c8b8[_0x55bd93(0x197)]+_0x303f33['length']+_0x351e61[_0x55bd93(0x197)]+_0x447d64[_0x55bd93(0x197)]+_0xce5a5a[_0x55bd93(0x197)]+_0x5bb84f[_0x55bd93(0x197)];if(!_0xd05e91['yes']&&_0x132ea7>0x0){const _0x40b86d=await confirmKey(_0x55bd93(0x20b)+_0x132ea7+'\x20changes?');if(!_0x40b86d)return console[_0x55bd93(0x1ab)](_0x55bd93(0x206)),0x1;}const _0x4c66f1={'withProgress':async(_0x457905,_0x260905)=>{const _0x48d8f6=_0x55bd93,_0x4f6657=await withSpinner(_0x457905,_0x260905,{'verbose':_0xd05e91['verbose']});return{'data':_0x4f6657[_0x48d8f6(0x212)]};},'logInfo':_0x10c974=>console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20e)]('✔\x20'+_0x10c974)),'logSuccess':_0x319ec4=>console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x1d5)]('✔\x20'+_0x319ec4)),'logWarning':_0x57ee4a=>console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)]('⚠\x20'+_0x57ee4a)),'logDeleted':_0x368fab=>console[_0x55bd93(0x1ab)](a29_0x11d044['red']('✔\x20'+_0x368fab))},_0x1fc3de={'segment':_0x5724a4[_0x55bd93(0x205)],'journey':_0x5724a4[_0x55bd93(0x1f2)],'user':_0x5724a4[_0x55bd93(0x1d9)],'connection':_0x5724a4[_0x55bd93(0x1f7)]};_0xce5a5a[_0x55bd93(0x197)]>0x0&&(_0x32d12e=await executePushFolders(_0x1fc3de,_0xce5a5a,_0x32d12e,{'parentId':_0x2775d9},_0x4c66f1));const _0x63f437={'rootFolderId':_0x38fa44,'folderPathToId':_0x32d12e,'folderIdToPath':_0x2e73a9,'segmentNameToId':_0x5cc728,'activationsBySegmentId':_0xf620bf,'emailToIdMap':_0x2c9624,'idToEmailMap':_0x450788,'connectionNameToIdMap':_0x276610[_0x55bd93(0x208)],'connectionIdToNameMap':_0x276610[_0x55bd93(0x1ad)],'connectionNameToTypeMap':_0x516111},_0x1b0289=await executePushSegments(_0x1fc3de,_0xd05e91[_0x55bd93(0x1db)]?[]:_0x50b087,_0x63f437,{'parentId':_0x2775d9},_0x4c66f1),_0x141278=_0x1b0289['created'],_0x430c68=_0x1b0289[_0x55bd93(0x1a4)],_0x43fb37=_0x1b0289[_0x55bd93(0x1c9)]['created'],_0x2ee97c=_0x1b0289[_0x55bd93(0x1c9)][_0x55bd93(0x1a4)],_0x53b1c4=_0x1b0289[_0x55bd93(0x1c9)]['deleted'],_0xcc445e=await executePushSegmentDeletions(_0x1fc3de,_0xd05e91['journeysOnly']?[]:_0x37c8b8,_0x4c66f1);let _0x574327=0x0,_0x583cba=0x0,_0x3fe7de=0x0;const _0x41da6a=new Map(_0x5cc728);for(const [_0x1c3158,_0x27df43]of _0x1b0289[_0x55bd93(0x220)]){_0x41da6a[_0x55bd93(0x1e1)](_0x1c3158,_0x27df43);}if(_0x422465[_0x55bd93(0x197)]>0x0){const _0x181c75={..._0x63f437,'segmentNameToId':_0x41da6a,'existingSegments':_0x5ca255,'activationContext':_0x318a23},_0x3c3cd8=await executePushJourneys(_0x1fc3de,_0x422465,_0x181c75,{'parentId':_0x2775d9,'rootFolderId':_0x38fa44,'verbose':_0xd05e91[_0x55bd93(0x21b)]},_0x4c66f1);_0x574327=_0x3c3cd8[_0x55bd93(0x202)],_0x583cba=_0x3c3cd8['updated'];if(_0x4c23c1&&_0x3c3cd8[_0x55bd93(0x1fd)]['length']===0x1){const _0xa38e54=_0x3c3cd8['results'][0x0];if(_0xa38e54[_0x55bd93(0x1bc)]){const _0x52b9e7=getConsoleNextUrl(_0xd05e91[_0x55bd93(0x1c3)],_0x55bd93(0x215)+_0x2775d9+_0x55bd93(0x1b6)+_0xa38e54[_0x55bd93(0x1bc)]+_0x55bd93(0x1bf));console[_0x55bd93(0x1ab)]('\x20\x20'+a29_0x11d044[_0x55bd93(0x21d)](_0x52b9e7));}}}for(const _0x3b27f3 of _0x447d64){console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x20d)](_0x55bd93(0x1ca)+_0x3b27f3[_0x55bd93(0x1e6)])),_0x3fe7de++;}const _0x4df376=[];if(_0x141278>0x0)_0x4df376[_0x55bd93(0x20f)](_0x141278+_0x55bd93(0x1a6));if(_0x430c68>0x0)_0x4df376['push'](_0x430c68+'\x20updated');if(_0xcc445e>0x0)_0x4df376['push'](_0xcc445e+_0x55bd93(0x216));const _0x12c03d=[];if(_0x574327>0x0)_0x12c03d[_0x55bd93(0x20f)](_0x574327+'\x20created');if(_0x583cba>0x0)_0x12c03d['push'](_0x583cba+_0x55bd93(0x1a2));if(_0x3fe7de>0x0)_0x12c03d[_0x55bd93(0x20f)](_0x3fe7de+_0x55bd93(0x216));const _0x1b5451=[];if(_0x43fb37>0x0)_0x1b5451[_0x55bd93(0x20f)](_0x43fb37+_0x55bd93(0x1a6));if(_0x2ee97c>0x0)_0x1b5451['push'](_0x2ee97c+_0x55bd93(0x1a2));if(_0x53b1c4>0x0)_0x1b5451['push'](_0x53b1c4+_0x55bd93(0x216));return console[_0x55bd93(0x1ab)](a29_0x11d044[_0x55bd93(0x1d5)](_0x55bd93(0x1a8))),_0x4df376['length']>0x0&&!_0xd05e91['journeysOnly']&&console['error']('\x20\x20Segments:\x20'+_0x4df376[_0x55bd93(0x1a7)](',\x20')),_0x12c03d[_0x55bd93(0x197)]>0x0&&console['error'](_0x55bd93(0x20a)+_0x12c03d[_0x55bd93(0x1a7)](',\x20')),_0x1b5451[_0x55bd93(0x197)]>0x0&&!_0xd05e91[_0x55bd93(0x1db)]&&console[_0x55bd93(0x1ab)]('\x20\x20Activations:\x20'+_0x1b5451[_0x55bd93(0x1a7)](',\x20')),0x0;}}function a29_0x5e11(){const _0x5f0293=['cyan','Fetching\x20connections\x20for\x20name\x20resolution...','\x0aPush\x20summary\x20for\x20\x27','createdSegmentIds','red','Fetching\x20existing\x20segments...','Error:\x20Directory\x20not\x20found:\x20','unchanged','add','\x20\x20\x20\x20','execute','Changes\x20to\x20journey:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','1074qCNTzl','length','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journeys','Scoped\x20to\x20folder:\x20','folderId','Delete\x20segment:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20to\x20create','1351080tSaiVM','Delete\x20journey:','description','\x20updated','all','updated','buildUserMaps','\x20created','join','\x0a✔\x20Push\x20complete','5032159yjZKnG','\x20\x20🗺️\x20\x20Journeys:','error','type','idToName','\x20folders\x20to\x20create','relationships','filter','get','1514akbNaW','Changes\x20to:','then','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','/e/','12ruYFFj','Error:\x20','\x20to\x20delete','existingJourney','Resolving\x20parent\x20segment\x20\x27','journeyId','54801ITWolX','parentName','/j/da/je','\x20new','getJourney','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','site','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20changed','.yml','segments','Fetching\x20existing\x20activations...','activations','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','message','errorCode','changed','listSegments','versionNumber','950ejfiry','paused','parent_name','(Journey\x20will\x20be\x20deleted)','\x20\x20Activations:','green','map','name','no_parent','user','folderPath','journeysOnly','toUpdate','770ryduCy','segment\x20or\x20journey','\x20unchanged','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','set','New\x20segment:','listActivations','setPhase','dryRun','journeyBundleName','isScoped','yamlConfig','delete','parentFolder','helpText','attributes','Fetching\x20existing\x20journeys...','folders','toString','938sxVEcI','endsWith','journey','Error\x20parsing\x20YAML:\x20','toDelete','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)','state','connection','dim','2858488ZEtwTj','getParent','diff','isNew','results','toCreate','\x20to\x20update','segmentFolderId','getOutputSchemaWithCache','created','3425TxrclB','repeat','segment','Aborted.','\x20YAML\x20files\x20found','nameToId','list','\x20\x20Journeys:\x20','Push\x20','Source\x20directory:\x20','yellow','blue','push','nameToType','targetDir','data','updatedAt','6584xRxEKz','/app/ps/','\x20deleted','filePath','Parent\x20segment:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20📊\x20Segments:','verbose','.yaml'];a29_0x5e11=function(){return _0x5f0293;};return a29_0x5e11();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x1ff081=a30_0x8ae7;(function(_0x1191fd,_0xebcb7f){const _0x48fb59=a30_0x8ae7,_0x7cd082=_0x1191fd();while(!![]){try{const _0x5ba01f=-parseInt(_0x48fb59(0x1e2))/0x1*(-parseInt(_0x48fb59(0x1dd))/0x2)+-parseInt(_0x48fb59(0x1de))/0x3+-parseInt(_0x48fb59(0x1f2))/0x4*(-parseInt(_0x48fb59(0x1ce))/0x5)+-parseInt(_0x48fb59(0x1d1))/0x6*(-parseInt(_0x48fb59(0x1ed))/0x7)+-parseInt(_0x48fb59(0x1e3))/0x8+-parseInt(_0x48fb59(0x1d3))/0x9+-parseInt(_0x48fb59(0x1cc))/0xa*(-parseInt(_0x48fb59(0x1f4))/0xb);if(_0x5ba01f===_0xebcb7f)break;else _0x7cd082['push'](_0x7cd082['shift']());}catch(_0x54582a){_0x7cd082['push'](_0x7cd082['shift']());}}}(a30_0x236f,0xe5101));function a30_0x236f(){const _0x302c1b=['execute','verbose','INTERNAL','Resolved\x20folder\x20ID:\x20','yellow','3385698naqjGN','2586510pDjdce','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','segmentId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','1JPKDKl','342288BuamgK','Resolving\x20folder\x20\x27','ruleFile','Resolving\x20path\x20\x27','kind','segment','segment:update','segmentName','type','parentId','30226oWAabJ','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','Updating\x20segment\x20\x27','error','44180YNVjWT','Segment\x20ID:\x20','1166uOIwtM','Error:\x20Cannot\x20update\x20','\x20\x20\x20Path:\x20','\x27...','resolvePathToResource','100960BZwtkt','segmentPath','5iAYOeL','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folder','306ByFlyD','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','10359819amqeUK','updateSegmentById','name','data','length'];a30_0x236f=function(){return _0x302c1b;};return a30_0x236f();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a30_0x8ae7(_0x133b3b,_0x1e91a0){_0x133b3b=_0x133b3b-0x1ca;const _0x236f0c=a30_0x236f();let _0x8ae761=_0x236f0c[_0x133b3b];return _0x8ae761;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x59bf83 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x1ff081(0x1d5)]=a30_0x1ff081(0x1e9);[a30_0x1ff081(0x1ef)]='Update\x20existing\x20child\x20segment';async[a30_0x1ff081(0x1d8)](_0x482029){const _0x5143a3=a30_0x1ff081;console[_0x5143a3(0x1f1)](a30_0x59bf83[_0x5143a3(0x1dc)](_0x5143a3(0x1df))),console[_0x5143a3(0x1f1)](a30_0x59bf83[_0x5143a3(0x1dc)](_0x5143a3(0x1ee)));const {options:_0x548334,args:_0xb8d5f4,tdx:_0x2990a6}=_0x482029,_0x1965b7=_0x548334;if(_0xb8d5f4[_0x5143a3(0x1d7)]===0x0)return console[_0x5143a3(0x1f1)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x5143a3(0x1f1)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x5143a3(0x1f1)]('Examples:'),console[_0x5143a3(0x1f1)](_0x5143a3(0x1e1)),console[_0x5143a3(0x1f1)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x40e36b=_0xb8d5f4[0x0],_0x508482=_0x548334[_0x5143a3(0x1cd)];let _0x49d03d=_0x40e36b;_0x508482&&!_0x40e36b['includes']('/')&&(_0x49d03d=_0x508482+'/'+_0x40e36b,_0x1965b7['verbose']&&console[_0x5143a3(0x1f1)]('Resolved\x20relative\x20path\x20to:\x20'+_0x49d03d));const _0x4aab86=await withSpinner(_0x5143a3(0x1e6)+_0x49d03d+_0x5143a3(0x1ca),()=>_0x2990a6[_0x5143a3(0x1e8)][_0x5143a3(0x1cb)](_0x49d03d),{'verbose':_0x1965b7[_0x5143a3(0x1d9)]}),_0x169332=_0x4aab86['data'];_0x1965b7[_0x5143a3(0x1d9)]&&console['error']('Resolved\x20type:\x20'+_0x169332[_0x5143a3(0x1eb)]);if(_0x169332[_0x5143a3(0x1eb)]!==_0x5143a3(0x1e8))return console['error'](_0x5143a3(0x1f5)+_0x169332[_0x5143a3(0x1eb)]+_0x5143a3(0x1d2)),console[_0x5143a3(0x1f1)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x169332[_0x5143a3(0x1e0)])throw new SDKError(ErrorCode[_0x5143a3(0x1da)],_0x5143a3(0x1cf));const _0x3d01b2=_0x169332[_0x5143a3(0x1ec)],_0x3e9c9d=_0x169332[_0x5143a3(0x1e0)];_0x1965b7[_0x5143a3(0x1d9)]&&(console[_0x5143a3(0x1f1)]('Parent\x20ID:\x20'+_0x3d01b2),console[_0x5143a3(0x1f1)](_0x5143a3(0x1f3)+_0x3e9c9d));let _0x59a641;if(_0x1965b7[_0x5143a3(0x1d0)]){const _0x1b479c=_0x1965b7[_0x5143a3(0x1d0)],_0xea64c5=await withSpinner(_0x5143a3(0x1e4)+_0x1b479c+_0x5143a3(0x1ca),()=>_0x2990a6[_0x5143a3(0x1e8)]['resolveFolderId'](_0x3d01b2,_0x1b479c),{'verbose':_0x1965b7[_0x5143a3(0x1d9)]});_0x59a641=parseInt(_0xea64c5[_0x5143a3(0x1d6)],0xa),_0x1965b7[_0x5143a3(0x1d9)]&&console[_0x5143a3(0x1f1)](_0x5143a3(0x1db)+_0x59a641);}const _0x266e05=await loadJSONFromOptions(_0x1965b7['rule'],_0x1965b7[_0x5143a3(0x1e5)]),_0x535e48={'name':_0x1965b7['name'],'description':_0x1965b7['description'],'rule':_0x266e05,'kind':_0x1965b7[_0x5143a3(0x1e7)]!==undefined?parseInt(_0x1965b7['kind'],0xa):undefined,'segmentFolderId':_0x59a641},_0x1be4ef=await withSpinner(_0x5143a3(0x1f0)+_0x169332[_0x5143a3(0x1ea)]+_0x5143a3(0x1ca),()=>_0x2990a6[_0x5143a3(0x1e8)][_0x5143a3(0x1d4)](_0x3d01b2,_0x3e9c9d,_0x535e48),{'verbose':_0x1965b7['verbose']}),_0x10fd46=_0x1be4ef[_0x5143a3(0x1d6)];return console[_0x5143a3(0x1f1)]('✔\x20Updated\x20segment\x20\x27'+_0x10fd46[_0x5143a3(0x1d5)]+'\x27'),_0x49d03d!==_0x40e36b&&console[_0x5143a3(0x1f1)](_0x5143a3(0x1f6)+_0x49d03d),await handleSDKOutput([_0x10fd46],_0x1965b7),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x18595d=a31_0x362f;(function(_0x8bcd9c,_0x414ecf){const _0x4da606=a31_0x362f,_0xa8b502=_0x8bcd9c();while(!![]){try{const _0x5c2c38=-parseInt(_0x4da606(0xc8))/0x1*(-parseInt(_0x4da606(0xc3))/0x2)+-parseInt(_0x4da606(0xd6))/0x3+parseInt(_0x4da606(0xb1))/0x4*(parseInt(_0x4da606(0xcb))/0x5)+-parseInt(_0x4da606(0xc0))/0x6+parseInt(_0x4da606(0xc6))/0x7+parseInt(_0x4da606(0xde))/0x8*(parseInt(_0x4da606(0xab))/0x9)+parseInt(_0x4da606(0xc9))/0xa*(-parseInt(_0x4da606(0xba))/0xb);if(_0x5c2c38===_0x414ecf)break;else _0xa8b502['push'](_0xa8b502['shift']());}catch(_0x179263){_0xa8b502['push'](_0xa8b502['shift']());}}}(a31_0x186e,0x60350));import{existsSync,statSync}from'fs';import a31_0xc78a93 from'chalk';function a31_0x362f(_0x2cd5a4,_0x2fb673){_0x2cd5a4=_0x2cd5a4-0xa6;const _0x186ee3=a31_0x186e();let _0x362f2c=_0x186ee3[_0x2cd5a4];return _0x362f2c;}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a31_0x186e(){const _0x3d3789=['Usage:\x20tdx\x20segment\x20use\x20<path>','51928jOTeIc','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','config','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','✔\x20Context\x20set\x20to:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Folder\x20ID:\x20','type','1915969wIALTi','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','folderId','execute','segmentPath','data','660282vOVdui','green','\x27...','366670rgVqrY','Examples:','length','3747422TgNzdr','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','2dADmfz','40fBKDGU','dim','50EDisLr','parent_segment','Site:\x20','segment','Use:\x20tdx\x20segment\x20use\x20','cyan','red','error','Error:\x20Path\x20is\x20required\x0a','verbose','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','167643tacNtY','name','Resolved\x20path\x20type:\x20','parentName','log','site','join','parentId','224872OlkmjY','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','description','Parent\x20ID:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segments','72BUUOOZ','split','Resolved\x20relative\x20path\x20to:\x20','slice','isDirectory'];a31_0x186e=function(){return _0x3d3789;};return a31_0x186e();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a31_0x18595d(0xd7)]='segment:use';[a31_0x18595d(0xa7)]=a31_0x18595d(0xb3);async[a31_0x18595d(0xbd)](_0x169809){const _0x33a052=a31_0x18595d,{options:_0x13e7d1,args:_0xdcc658,tdx:_0x1957c7}=_0x169809;if(_0xdcc658[_0x33a052(0xc5)]===0x0)return console[_0x33a052(0xd2)](a31_0xc78a93[_0x33a052(0xd1)](_0x33a052(0xd3))),console[_0x33a052(0xd2)](_0x33a052(0xb0)),console[_0x33a052(0xd2)](_0x33a052(0xc4)),console[_0x33a052(0xd2)](_0x33a052(0xbb)),console[_0x33a052(0xd2)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x33a052(0xd2)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x33a052(0xd2)](_0x33a052(0xb2)),0x1;const _0x3eb89c=_0xdcc658[0x0],_0x2bc83b=_0x13e7d1['session'];try{if(_0x3eb89c==='/')return saveSessionContext({'segment_path':undefined},_0x2bc83b),console['log'](a31_0xc78a93[_0x33a052(0xc1)](_0x33a052(0xd5))),0x0;if(existsSync(_0x3eb89c)&&statSync(_0x3eb89c)[_0x33a052(0xaf)]()){let _0x3a127f;try{_0x3a127f=findTdxConfig(_0x3eb89c);}catch{return console[_0x33a052(0xd2)](a31_0xc78a93[_0x33a052(0xd1)](_0x33a052(0xa9)+_0x3eb89c)),console[_0x33a052(0xd2)](a31_0xc78a93[_0x33a052(0xd0)](_0x33a052(0xb7))),0x1;}const _0x5ca641=_0x3a127f[_0x33a052(0xb4)][_0x33a052(0xcc)];return saveSessionContext({'segment_path':_0x5ca641,'parent_segment':_0x5ca641},_0x2bc83b),console['log'](a31_0xc78a93[_0x33a052(0xc1)](_0x33a052(0xb6)+a31_0xc78a93['cyan'](_0x5ca641))),0x0;}const _0x3b41fe=_0x13e7d1[_0x33a052(0xbe)];let _0x24284b=_0x3eb89c;const _0x2229c4=parsePath(_0x3eb89c);if(!_0x2229c4['isAbsolute']){if(!_0x3b41fe)return console[_0x33a052(0xd2)](a31_0xc78a93[_0x33a052(0xd1)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console['error'](a31_0xc78a93[_0x33a052(0xd0)](_0x33a052(0xdf))),0x1;if(_0x3eb89c==='..'){const _0xd4d95c=_0x3b41fe[_0x33a052(0xac)]('/')[_0x33a052(0xae)](0x0,-0x1)[_0x33a052(0xdc)]('/');_0x24284b=_0xd4d95c||'/';}else _0x3eb89c==='.'?_0x24284b=_0x3b41fe:_0x24284b=_0x3b41fe+'/'+_0x3eb89c;_0x13e7d1[_0x33a052(0xd4)]&&console[_0x33a052(0xd2)](_0x33a052(0xad)+_0x24284b);}if(_0x24284b==='/'||_0x24284b==='')return saveSessionContext({'segment_path':undefined},_0x2bc83b),console[_0x33a052(0xda)](a31_0xc78a93[_0x33a052(0xc1)](_0x33a052(0xd5))),0x0;_0x24284b=normalizePath(_0x24284b);const _0x357356=parsePath(_0x24284b)[_0x33a052(0xaa)];if(_0x357356['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x2bc83b),console['log'](a31_0xc78a93[_0x33a052(0xc1)](_0x33a052(0xd5))),0x0;_0x13e7d1[_0x33a052(0xd4)]&&(console[_0x33a052(0xd2)](_0x33a052(0xcd)+_0x13e7d1[_0x33a052(0xdb)]),console[_0x33a052(0xd2)]('Target\x20path:\x20'+_0x24284b));const _0x424759=await withSpinner('Resolving\x20path\x20\x27'+_0x24284b+_0x33a052(0xc2),()=>_0x1957c7[_0x33a052(0xce)]['resolvePathToResource'](_0x24284b),{'verbose':_0x13e7d1[_0x33a052(0xd4)]}),_0x54d1c0=_0x424759[_0x33a052(0xbf)];_0x13e7d1[_0x33a052(0xd4)]&&(console['error'](_0x33a052(0xd8)+_0x54d1c0['type']),console[_0x33a052(0xd2)](_0x33a052(0xa8)+_0x54d1c0[_0x33a052(0xdd)]),_0x54d1c0[_0x33a052(0xbc)]&&console[_0x33a052(0xd2)](_0x33a052(0xb8)+_0x54d1c0['folderId']));if(_0x54d1c0[_0x33a052(0xb9)]===_0x33a052(0xce))return console['error'](a31_0xc78a93[_0x33a052(0xd1)](_0x33a052(0xa6))),console[_0x33a052(0xd2)](_0x33a052(0xc7)),console[_0x33a052(0xd2)](a31_0xc78a93[_0x33a052(0xd0)](_0x33a052(0xcf)+_0x54d1c0[_0x33a052(0xd9)]+(_0x54d1c0['folderPath']?'/'+_0x54d1c0['folderPath'][_0x33a052(0xdc)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x54d1c0['fullPath'],'parent_segment':_0x54d1c0['parentName']},_0x2bc83b),console[_0x33a052(0xda)](a31_0xc78a93[_0x33a052(0xc1)]('✔\x20Context\x20set\x20to:\x20'+a31_0xc78a93[_0x33a052(0xd0)](_0x54d1c0['fullPath']))),_0x13e7d1['verbose']&&(console[_0x33a052(0xd2)](a31_0xc78a93[_0x33a052(0xca)](_0x33a052(0xb5))),console[_0x33a052(0xd2)](a31_0xc78a93[_0x33a052(0xca)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x10dedb){throw _0x10dedb;}}}
|