@treasuredata/tdx 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-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/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.d.ts +2 -4
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +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.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +2 -1
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.d.ts +45 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +1 -0
- package/dist/core/version.js.map +1 -0
- 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/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x5122(){const _0x43acc0=['segment:fields','verbose','listFields','\x27...','1192264fLuGBq','length','Parent\x20segment:\x20','✔\x20Found\x20','jsonl','3102556FgpfKJ','data','6507020OelqZX','2272eLKBht','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','site','name','18LXYFAJ','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20field','4254774bwVYIH','3bDaqjV','5NBRWBs','execute','List\x20available\x20fields\x20for\x20segmentation','error','18158WDOBDo','32306791nnTHbR','307714qbkste'];a27_0x5122=function(){return _0x43acc0;};return a27_0x5122();}const a27_0x363a3b=a27_0x2d41;(function(_0x20775f,_0x2fa89d){const _0x21661f=a27_0x2d41,_0x57e13b=_0x20775f();while(!![]){try{const _0x579d04=parseInt(_0x21661f(0x199))/0x1+-parseInt(_0x21661f(0x19e))/0x2*(parseInt(_0x21661f(0x1af))/0x3)+parseInt(_0x21661f(0x1a3))/0x4*(parseInt(_0x21661f(0x1b0))/0x5)+-parseInt(_0x21661f(0x1ae))/0x6+parseInt(_0x21661f(0x197))/0x7*(-parseInt(_0x21661f(0x1a6))/0x8)+parseInt(_0x21661f(0x1ab))/0x9*(-parseInt(_0x21661f(0x1a5))/0xa)+parseInt(_0x21661f(0x198))/0xb;if(_0x579d04===_0x2fa89d)break;else _0x57e13b['push'](_0x57e13b['shift']());}catch(_0x1b7d9b){_0x57e13b['push'](_0x57e13b['shift']());}}}(a27_0x5122,0xa546d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a27_0x2d41(_0x24236c,_0x3c28ea){_0x24236c=_0x24236c-0x197;const _0x51227b=a27_0x5122();let _0x2d41f5=_0x51227b[_0x24236c];return _0x2d41f5;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x363a3b(0x1aa)]=a27_0x363a3b(0x19a);['description']=a27_0x363a3b(0x1b2);async[a27_0x363a3b(0x1b1)](_0x16c7c6){const _0x39d1ef=a27_0x363a3b,{options:_0x16c315,args:_0x4b04ab,tdx:_0xc8efbc}=_0x16c7c6,_0x466bfd=_0x4b04ab[0x0]||_0x16c315['parentSegment'];if(!_0x466bfd)return console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1ac)),console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a7)),console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a8)),0x1;_0x16c315[_0x39d1ef(0x19b)]&&(console[_0x39d1ef(0x1b3)]('Site:\x20'+_0x16c315[_0x39d1ef(0x1a9)]),console['error'](_0x39d1ef(0x1a0)+_0x466bfd));const _0xc9f7d1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x466bfd+_0x39d1ef(0x19d),()=>_0xc8efbc['segment'][_0x39d1ef(0x19c)](_0x466bfd),{'verbose':_0x16c315[_0x39d1ef(0x19b)]}),_0x46648f=_0xc9f7d1[_0x39d1ef(0x1a4)];console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a1)+_0x46648f[_0x39d1ef(0x19f)]+_0x39d1ef(0x1ad)+(_0x46648f['length']!==0x1?'s':''));if(_0x16c315['json']||_0x16c315[_0x39d1ef(0x1a2)])return await handleSDKOutput(_0x46648f,_0x16c315),0x0;return displayFieldsHumanReadable(_0x46648f,_0x466bfd),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0xbf23c7=a28_0x1cb3;(function(_0x2190f1,_0xa1e8d2){const _0x171cbc=a28_0x1cb3,_0x556b5b=_0x2190f1();while(!![]){try{const _0x4deec6=parseInt(_0x171cbc(0xa0))/0x1+parseInt(_0x171cbc(0x96))/0x2+-parseInt(_0x171cbc(0x8f))/0x3*(parseInt(_0x171cbc(0x90))/0x4)+-parseInt(_0x171cbc(0xb9))/0x5*(parseInt(_0x171cbc(0xb5))/0x6)+parseInt(_0x171cbc(0xa4))/0x7+parseInt(_0x171cbc(0x9b))/0x8*(parseInt(_0x171cbc(0xc7))/0x9)+parseInt(_0x171cbc(0xd0))/0xa;if(_0x4deec6===_0xa1e8d2)break;else _0x556b5b['push'](_0x556b5b['shift']());}catch(_0x35cbb9){_0x556b5b['push'](_0x556b5b['shift']());}}}(a28_0x89d0,0x37482));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x1b2128 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x2b733b from'path';function a28_0x89d0(){const _0x59038a=['session','cyan','\x0aPull\x20summary\x20for\x20\x27','\x20new\x20files','\x20changed\x20files','segment:pull','verbose','parentName','dirname','\x20activations','12lfzSOi','✔\x20Context\x20set:\x20','content','absolutePath','531995VrHUSF','\x20files?','cwd','\x20versions)','targetDir','yellow','utf-8','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','length','name','\x20unchanged\x20files','execute','\x20\x20🎯\x20','repeat','1103373ZioUmu','filter','errorCode','error','description','no_parent','green','activations','dryRun','2048730wCOmzc','journeys','site','red','parent_segment','3XlwMnE','880652tUpNNK','Pulling\x20segments\x20from\x20\x27','\x27...','hasChanges','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dim','205956IwWvUk','Site:\x20','\x20=\x20','journeyVersions','\x20files\x20to\x20','16TFEHIe','\x20with\x20','Aborted.','\x20\x20🗺️\x20\x20','\x20segments','104329tgBbzF','isNew','helpText','segment','14147oOvKdn','counts','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20All\x20files\x20are\x20up\x20to\x20date','files','segments','\x20journeys'];a28_0x89d0=function(){return _0x59038a;};return a28_0x89d0();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1cb3(_0x3fd6a6,_0x4f2524){_0x3fd6a6=_0x3fd6a6-0x8b;const _0x89d079=a28_0x89d0();let _0x1cb3b3=_0x89d079[_0x3fd6a6];return _0x1cb3b3;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0xbf23c7(0xc2)]=a28_0xbf23c7(0xb0);[a28_0xbf23c7(0xcb)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a28_0xbf23c7(0xc4)](_0x4183a3){const _0x3b1f6e=a28_0xbf23c7,{options:_0x4867d5,args:_0x5548db,tdx:_0x469067}=_0x4183a3,_0x498aca=_0x4867d5,_0x369e2d=await resolveTarget({'arg':_0x5548db[0x0],'contextParent':_0x4867d5['parentSegment'],'cwd':process[_0x3b1f6e(0xbb)]()});if(!isSuccessfulResolution(_0x369e2d))return _0x369e2d[_0x3b1f6e(0xc9)]===_0x3b1f6e(0xcc)?(console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0xc0))),console[_0x3b1f6e(0xca)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3b1f6e(0xca)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x3b1f6e(0xca)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0x8d)]('Error:\x20'+_0x369e2d['message']+'\x0a')),_0x369e2d[_0x3b1f6e(0xa2)]&&console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xac)](_0x369e2d[_0x3b1f6e(0xa2)]))),0x1;const _0x21ab83=_0x369e2d[_0x3b1f6e(0xb2)],_0x3dcf92=_0x369e2d[_0x3b1f6e(0xbd)];_0x498aca[_0x3b1f6e(0xb1)]&&(console[_0x3b1f6e(0xca)](_0x3b1f6e(0x97)+_0x498aca[_0x3b1f6e(0x8c)]),console[_0x3b1f6e(0xca)]('Parent\x20segment:\x20'+_0x21ab83));const _0x18e1f8=await withProgressSpinner(_0x3b1f6e(0x91)+_0x21ab83+_0x3b1f6e(0x92),_0x47cfeb=>_0x469067[_0x3b1f6e(0xa3)]['pullSegments'](_0x21ab83,{'targetDir':_0x3dcf92,'verbose':_0x498aca[_0x3b1f6e(0xb1)],'progress':{'update':_0x536c32=>{const _0x3fa684=_0x3b1f6e;_0x47cfeb['setPhase'](_0x536c32),_0x498aca[_0x3fa684(0xb1)]&&console[_0x3fa684(0xca)]('\x20\x20'+_0x536c32);}}}),{'verbose':_0x498aca[_0x3b1f6e(0xb1)]}),_0x154191=_0x18e1f8['data'];if(_0x154191[_0x3b1f6e(0xa5)]['segments']===0x0&&_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]===0x0)return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0x94)+_0x154191[_0x3b1f6e(0xb2)]+'\x27')),0x0;const _0x3d39a7=_0x154191['files'][_0x3b1f6e(0xc8)](_0x2c9cf5=>_0x2c9cf5['isNew']),_0x3680ef=_0x154191[_0x3b1f6e(0xa8)][_0x3b1f6e(0xc8)](_0x4ecbee=>!_0x4ecbee['isNew']&&_0x4ecbee[_0x3b1f6e(0x93)]),_0x119423=_0x154191[_0x3b1f6e(0xa8)][_0x3b1f6e(0xc8)](_0xdf84d6=>!_0xdf84d6[_0x3b1f6e(0xa1)]&&!_0xdf84d6[_0x3b1f6e(0x93)]);console[_0x3b1f6e(0xca)](_0x3b1f6e(0xad)+_0x154191[_0x3b1f6e(0xb2)]+'\x27:'),console['error'](_0x3b1f6e(0xc5)+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0xa9)]+_0x3b1f6e(0x9f))+_0x3b1f6e(0x9c)+a28_0x1b2128['cyan'](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0xce)]+_0x3b1f6e(0xb4)));if(_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]>0x0){const _0x2767b1=_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x99)]>_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]?'\x20('+_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x99)]+_0x3b1f6e(0xbc):'';console['error'](_0x3b1f6e(0x9e)+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]+_0x3b1f6e(0xaa))+a28_0x1b2128[_0x3b1f6e(0x95)](_0x2767b1));}console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128['green']('+\x20'+_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xae))),console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128['yellow']('~\x20'+_0x3680ef[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xaf))),console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128[_0x3b1f6e(0x95)]('=\x20'+_0x119423[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xc3))),console[_0x3b1f6e(0xca)]('\x20\x20Target:\x20'+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xbd)])+'\x0a');if(_0x3680ef[_0x3b1f6e(0xc1)]>0x0)for(const _0x3dd7ee of _0x3680ef){console['error']('\x0aChanges\x20to\x20\x27'+_0x3dd7ee['relativePath']+'\x27:'),console[_0x3b1f6e(0xca)]('─'[_0x3b1f6e(0xc6)](0x3c)),console['error'](_0x3dd7ee['diff']),console[_0x3b1f6e(0xca)]('─'['repeat'](0x3c));}if(_0x498aca[_0x3b1f6e(0xcf)])return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0xa6))),0x0;if(_0x3d39a7['length']===0x0&&_0x3680ef[_0x3b1f6e(0xc1)]===0x0)return console['error'](a28_0x1b2128[_0x3b1f6e(0xcd)](_0x3b1f6e(0xa7))),saveSessionContext({'parent_segment':_0x154191[_0x3b1f6e(0xb2)]},_0x498aca[_0x3b1f6e(0xab)]),console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)]('✔\x20Context\x20set:\x20'+a28_0x1b2128[_0x3b1f6e(0x95)](_0x3b1f6e(0x8e))+'\x20=\x20'+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191['parentName']))),0x0;if(!_0x498aca['yes']){const _0x1e1d07=await confirmKey('Write\x20'+(_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3680ef[_0x3b1f6e(0xc1)])+_0x3b1f6e(0xba));if(!_0x1e1d07)return console[_0x3b1f6e(0xca)](_0x3b1f6e(0x9d)),0x1;}for(const _0xeeb4b9 of _0x154191['files']){if(_0xeeb4b9['isNew']||_0xeeb4b9['hasChanges']){const _0x1c90a6=a28_0x2b733b[_0x3b1f6e(0xb3)](_0xeeb4b9[_0x3b1f6e(0xb8)]);!existsSync(_0x1c90a6)&&mkdirSync(_0x1c90a6,{'recursive':!![]}),writeFileSync(_0xeeb4b9['absolutePath'],_0xeeb4b9[_0x3b1f6e(0xb7)],_0x3b1f6e(0xbf));}}return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)]('✔\x20Pulled\x20'+(_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3680ef[_0x3b1f6e(0xc1)])+_0x3b1f6e(0x9a)+_0x154191[_0x3b1f6e(0xbd)])),saveSessionContext({'parent_segment':_0x154191[_0x3b1f6e(0xb2)]},_0x498aca[_0x3b1f6e(0xab)]),console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)](_0x3b1f6e(0xb6)+a28_0x1b2128[_0x3b1f6e(0x95)](_0x3b1f6e(0x8e))+_0x3b1f6e(0x98)+a28_0x1b2128['cyan'](_0x154191[_0x3b1f6e(0xb2)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x44a7ab=a29_0x2997;(function(_0x56788f,_0x841ee1){const _0x3c2c14=a29_0x2997,_0x5d7387=_0x56788f();while(!![]){try{const _0x138549=-parseInt(_0x3c2c14(0x1d0))/0x1*(parseInt(_0x3c2c14(0x1c2))/0x2)+parseInt(_0x3c2c14(0x17c))/0x3+parseInt(_0x3c2c14(0x1d3))/0x4*(parseInt(_0x3c2c14(0x198))/0x5)+-parseInt(_0x3c2c14(0x1eb))/0x6*(parseInt(_0x3c2c14(0x176))/0x7)+-parseInt(_0x3c2c14(0x19c))/0x8*(parseInt(_0x3c2c14(0x17f))/0x9)+-parseInt(_0x3c2c14(0x1db))/0xa*(-parseInt(_0x3c2c14(0x1cb))/0xb)+parseInt(_0x3c2c14(0x1a4))/0xc;if(_0x138549===_0x841ee1)break;else _0x5d7387['push'](_0x5d7387['shift']());}catch(_0x251af0){_0x5d7387['push'](_0x5d7387['shift']());}}}(a29_0xb274,0xe19bd));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a29_0x2997(_0x32f95a,_0x566e4c){_0x32f95a=_0x32f95a-0x16e;const _0xb27404=a29_0xb274();let _0x29970b=_0xb27404[_0x32f95a];return _0x29970b;}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x1fe9af 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_0xb274(){const _0x470023=['getOutputSchemaWithCache','Aborted.','delete','createdSegmentIds','\x20\x20Activations:\x20','\x20\x20Segments:\x20','activations','setPhase','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','verbose','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x0a✔\x20Push\x20complete','filter','results','Changes\x20to\x20journey:','journey','(Journey\x20will\x20be\x20deleted)','dim','segment','no_parent','segmentFolderId','\x20\x20🗺️\x20\x20Journeys:','.yaml','folders','nameToId','data','error','New\x20journey:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','endsWith','join','resolveParentId','\x27...','\x20to\x20update','repeat','journeysOnly','\x20changes?','10570308VoDZMN','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','helpText','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Folders\x20to\x20create:','1338945QvRDPT','segment:push','created','3529422PfDNvm','add','Site:\x20','listJourneysWithDetailsFromParentSegment','yamlConfig','\x20unchanged','list','blue','/app/ps/','listActivations','parent_name','journeys','file','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','No\x20','yellow','Fetching\x20existing\x20journeys...','map','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yml','updatedAt','\x20changed','\x20\x20Activations:','nameToType','push','410HpFMmO','updated','\x0aValidation\x20failed:','all','24NQgBrm','isScoped','Fetching\x20connections\x20for\x20name\x20resolution...','cwd','deleted','toCreate','listFolders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','42637944XkSScr','then','state','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)','red','idToName','Delete\x20journey:','connection','type','message','\x20activations]','diff','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20created','folderId','\x20folders\x20to\x20create','\x20updated','folderPath','Push\x20','\x20to\x20delete','parentName','relationships','site','user','length','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','unchanged','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','60392ibfGDG','journeyId','listSegments','get','yes','Fetching\x20parent\x20segment\x20details...','\x20\x20Journeys:\x20','journeyBundleName','new','44fGRUSR','segments','New\x20segment:','Error:\x20Directory\x20not\x20found:\x20','\x20\x20\x20\x20','24edMcMz','Fetching\x20existing\x20activations...','parentSegment','6068JtpCeL','\x0aPush\x20summary\x20for\x20\x27','Fetching\x20existing\x20segments...','Fetching\x20existing\x20folders...','set','targetDir','toUpdate','/e/','528610sORzWE','/j/da/je','\x20deleted','name','journeyBundleId','Source\x20directory:\x20','versionNumber','toString','segment\x20or\x20journey','\x20\x20📊\x20Segments:','\x20new','toDelete','createdAt','attributes','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','6OJjynz','changed','isNew'];a29_0xb274=function(){return _0x470023;};return a29_0xb274();}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']=a29_0x44a7ab(0x17d);['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x446058){const _0x3da3af=a29_0x44a7ab,{options:_0x526b0a,args:_0x57a34e,tdx:_0x47b0b3}=_0x446058,_0x123038=_0x526b0a,_0x1efac5=await resolveTarget({'arg':_0x57a34e[0x0],'contextParent':_0x526b0a[_0x3da3af(0x1d2)],'cwd':process[_0x3da3af(0x19f)]()});if(!isSuccessfulResolution(_0x1efac5))return _0x1efac5['errorCode']===_0x3da3af(0x201)?(console['error'](a29_0x1fe9af[_0x3da3af(0x18e)](_0x3da3af(0x1b1))),console[_0x3da3af(0x208)](_0x3da3af(0x1a7)),console['error'](_0x3da3af(0x1a3)),console[_0x3da3af(0x208)](_0x3da3af(0x1bf))):(console[_0x3da3af(0x208)](a29_0x1fe9af['red']('Error:\x20'+_0x1efac5[_0x3da3af(0x1ad)]+'\x0a')),_0x1efac5[_0x3da3af(0x178)]&&console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x179)](_0x1efac5['helpText']))),0x1;if(_0x1efac5[_0x3da3af(0x1ac)]===_0x3da3af(0x189))return console[_0x3da3af(0x208)](a29_0x1fe9af['red'](_0x3da3af(0x1ce)+_0x1efac5[_0x3da3af(0x1d8)]+'\x0a')),console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x179)](_0x3da3af(0x1e9))),0x1;const _0x3b4e9d=_0x1efac5[_0x3da3af(0x1b9)],_0x2c9d90=_0x1efac5['targetDir'],_0x1d28b4=_0x1efac5[_0x3da3af(0x1ac)]===_0x3da3af(0x18b)?_0x1efac5[_0x3da3af(0x1b0)]:undefined,_0x29d364=getScopedDetails(_0x1efac5),_0x4df482=_0x29d364?.[_0x3da3af(0x19d)]??![],_0x528da8=_0x29d364?.['scopedFolderPath']??'';if(!existsSync(_0x2c9d90))return console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x1a8)](_0x3da3af(0x1ce)+_0x2c9d90+'\x0a')),console[_0x3da3af(0x208)](a29_0x1fe9af['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x123038[_0x3da3af(0x1f7)]&&(console[_0x3da3af(0x208)](_0x3da3af(0x181)+_0x123038[_0x3da3af(0x1bb)]),console[_0x3da3af(0x208)]('Parent\x20segment:\x20'+_0x3b4e9d),console[_0x3da3af(0x208)](_0x3da3af(0x1e0)+_0x2c9d90),_0x4df482&&console['error']('Scoped\x20to\x20folder:\x20'+_0x528da8));const _0x4df5c0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3b4e9d+_0x3da3af(0x171),()=>_0x47b0b3[_0x3da3af(0x200)][_0x3da3af(0x170)](_0x3b4e9d),{'verbose':_0x123038['verbose']}),_0x1f423a=_0x4df5c0[_0x3da3af(0x207)],[_0x402440,_0x1ef4e6,_0x2a49db,_0x2b67e9,_0x4a636e]=await Promise['all']([withSpinner(_0x3da3af(0x1c7),()=>_0x47b0b3[_0x3da3af(0x200)]['getParent'](_0x1f423a),{'verbose':_0x123038['verbose']}),withSpinner(_0x3da3af(0x1d5),()=>_0x47b0b3[_0x3da3af(0x200)][_0x3da3af(0x1c4)](_0x1f423a),{'verbose':_0x123038[_0x3da3af(0x1f7)]}),withSpinner(_0x3da3af(0x1d6),()=>_0x47b0b3[_0x3da3af(0x200)][_0x3da3af(0x1a2)](_0x1f423a),{'verbose':_0x123038[_0x3da3af(0x1f7)]}),withSpinner(_0x3da3af(0x18f),()=>_0x47b0b3[_0x3da3af(0x1fd)][_0x3da3af(0x182)](_0x1f423a),{'verbose':_0x123038[_0x3da3af(0x1f7)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x47b0b3[_0x3da3af(0x1bc)]['buildUserMaps'](),{'verbose':_0x123038[_0x3da3af(0x1f7)]})[_0x3da3af(0x1a5)](_0x4eb141=>_0x4eb141[_0x3da3af(0x207)])]),_0x4559ed=_0x402440[_0x3da3af(0x207)],_0x5f02a1=extractRootFolderId(_0x4559ed),_0x2714f1=_0x1ef4e6[_0x3da3af(0x207)],_0x288404=_0x2a49db[_0x3da3af(0x207)],{journeys:_0x1a118b,activationStepsById:_0x1dcdf3}=_0x2b67e9[_0x3da3af(0x207)],_0x306c19=new Map(_0x1a118b[_0x3da3af(0x190)](_0x3f8e46=>[_0x3f8e46['id'],_0x3f8e46])),_0x3c8e42=_0x1a118b[_0x3da3af(0x190)](_0x3eae09=>({'id':_0x3eae09['id'],'name':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x1de)],'journeyBundleName':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x1c9)]||'','journeyBundleId':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x1df)]||'','versionNumber':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x1e1)],'description':_0x3eae09[_0x3da3af(0x1e8)]['description'],'state':_0x3eae09['attributes'][_0x3da3af(0x1a6)],'paused':_0x3eae09[_0x3da3af(0x1e8)]['paused'],'audienceId':_0x3eae09[_0x3da3af(0x1e8)]['audienceId'],'folderId':_0x3eae09[_0x3da3af(0x1ba)]?.['parentFolder']?.[_0x3da3af(0x207)]?.['id'],'createdAt':_0x3eae09['attributes'][_0x3da3af(0x1e7)],'updatedAt':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x193)]})),{emailToId:_0x1a6fb8,idToEmail:_0x8d3419}=_0x4a636e,_0x2524da=await withSpinner(_0x3da3af(0x19e),async()=>{const _0x931ba2=_0x3da3af,_0x563641=await _0x47b0b3[_0x931ba2(0x1ab)][_0x931ba2(0x185)]();return buildConnectionMaps(_0x563641);},{'verbose':_0x123038[_0x3da3af(0x1f7)]})[_0x3da3af(0x1a5)](_0xd65c69=>_0xd65c69[_0x3da3af(0x207)]),_0x36ab37=_0x2524da[_0x3da3af(0x206)],_0x386854=_0x2524da[_0x3da3af(0x1a9)],_0xdceb7=_0x2524da[_0x3da3af(0x196)],_0x649a56={'emailToIdMap':_0x1a6fb8,'connectionNameToIdMap':_0x36ab37,'connectionNameToTypeMap':_0xdceb7,'getSchema':_0x30d80e=>_0x47b0b3[_0x3da3af(0x1ab)][_0x3da3af(0x1ee)](_0x30d80e)};let {pathToId:_0x1c5cb9,idToPath:_0x311437}=buildFolderMaps(_0x288404);const _0xdc5a79=buildSegmentLookupMap(_0x2714f1,_0x311437),_0x5f66cb=buildSegmentNameToIdMap(_0x2714f1),_0x3067c5=buildJourneyBundleLookupMap(_0x3c8e42,_0x311437);let _0x2d6a8e;if(_0x1d28b4){if(!_0x1d28b4[_0x3da3af(0x16e)](_0x3da3af(0x192))&&!_0x1d28b4[_0x3da3af(0x16e)](_0x3da3af(0x204)))return console['error'](a29_0x1fe9af[_0x3da3af(0x1a8)](_0x3da3af(0x17a)+_0x1d28b4+'\x0a')),0x1;_0x2d6a8e=[_0x1d28b4];}else _0x2d6a8e=findYamlFiles(_0x2c9d90);if(_0x2d6a8e['length']===0x0)return console[_0x3da3af(0x208)](a29_0x1fe9af['red'](_0x3da3af(0x191)+_0x2c9d90+'\x0a')),console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x179)](_0x3da3af(0x1f6))),0x1;let _0x329aaf,_0x12af83;try{const _0x1fee4a=parseAndClassifyYamlFiles(_0x2d6a8e,_0x2c9d90,{'skipSegments':_0x123038[_0x3da3af(0x174)]});_0x329aaf=_0x1fee4a[_0x3da3af(0x1cc)],_0x12af83=_0x1fee4a[_0x3da3af(0x18a)];const _0x527b38=validateParsedFiles(_0x1fee4a,_0x2c9d90);if(_0x527b38[_0x3da3af(0x1bd)]>0x0)return console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x1a8)](_0x3da3af(0x19a))),console[_0x3da3af(0x208)](formatValidationErrors(_0x527b38)),console['error'](a29_0x1fe9af[_0x3da3af(0x18e)](_0x3da3af(0x18c))),0x1;}catch(_0x1b1527){return console['error'](a29_0x1fe9af['red']('Error\x20parsing\x20YAML:\x20'+(_0x1b1527 instanceof Error?_0x1b1527[_0x3da3af(0x1ad)]:_0x1b1527))),0x1;}if(_0x329aaf[_0x3da3af(0x1bd)]===0x0&&_0x12af83[_0x3da3af(0x1bd)]===0x0){const _0x47b3cc=_0x123038[_0x3da3af(0x174)]?_0x3da3af(0x1fd):_0x3da3af(0x1e3);return console[_0x3da3af(0x208)](a29_0x1fe9af['yellow'](_0x3da3af(0x18d)+_0x47b3cc+'\x20YAML\x20files\x20found')),0x0;}const _0x4beab7=new Map();_0x2714f1[_0x3da3af(0x1bd)]>0x0&&!_0x123038['journeysOnly']&&await withSpinner(_0x3da3af(0x1d1),async()=>{await batchAsync(_0x2714f1,async _0xcc7da=>{const _0x335522=a29_0x2997,_0x2f57b3=await _0x47b0b3[_0x335522(0x200)][_0x335522(0x188)](_0x1f423a,_0xcc7da['id']);_0x4beab7[_0x335522(0x1d7)](_0xcc7da['id'],_0x2f57b3);});},{'verbose':_0x123038[_0x3da3af(0x1f7)]});const {segmentFiles:_0x34ce1f,foldersToCreate:_0x1f95f3}=await prepareSegmentFiles(_0x329aaf,{'segmentByFolderAndName':_0xdc5a79,'activationsBySegmentId':_0x4beab7,'folderPathToId':_0x1c5cb9,'idToEmailMap':_0x8d3419,'connectionIdToNameMap':_0x386854},_0x649a56,_0x4df482,_0x528da8),_0x58b000=_0x1d28b4?[]:findSegmentsToDelete(_0x2714f1,_0x329aaf[_0x3da3af(0x190)](({yamlConfig:_0x363b93,folderPath:_0x4196e6})=>({'yamlConfig':_0x363b93,'folderPath':resolveTDFolderPath(_0x4196e6,_0x4df482,_0x528da8)})),_0x311437,_0x528da8,_0x4df482),{journeyFiles:_0xebe1b3,foldersToCreate:_0x3138de}=await withProgressSpinner('Preparing\x20journeys...',async _0x4fa41a=>prepareJourneyFiles(_0x12af83,{'fetchJourney':async _0x4e66fc=>_0x47b0b3[_0x3da3af(0x1fd)]['getJourney'](_0x4e66fc['journeyId']),'journeyBundlesByFolderAndName':_0x3067c5,'folderPathToId':_0x1c5cb9,'idToEmailMap':_0x8d3419,'connectionIdToNameMap':_0x386854,'existingSegments':_0x2714f1,'parentId':_0x1f423a,'deps':_0x47b0b3,'progress':{'update':_0x4e0621=>{const _0x16adde=_0x3da3af;_0x4fa41a[_0x16adde(0x1f5)](_0x4e0621),_0x123038[_0x16adde(0x1f7)]&&console[_0x16adde(0x208)]('\x20\x20'+_0x4e0621);}},'journeyById':_0x306c19,'activationStepsById':_0x1dcdf3},_0x4df482,_0x528da8),{'verbose':_0x123038[_0x3da3af(0x1f7)]})['then'](_0x36cbc7=>_0x36cbc7[_0x3da3af(0x207)]);for(const _0x2650bc of _0x3138de){_0x1f95f3[_0x3da3af(0x180)](_0x2650bc);}const _0x4b8c64=_0x1d28b4?[]:findJourneysToDelete(_0x3c8e42,_0x12af83[_0x3da3af(0x190)](({yamlConfig:_0x1e5632,folderPath:_0x76b2c6})=>({'yamlConfig':_0x1e5632,'folderPath':resolveTDFolderPath(_0x76b2c6,_0x4df482,_0x528da8)})),_0x311437,_0x528da8,_0x4df482),_0x4f0056=calculatePushStats(_0x34ce1f,_0xebe1b3,_0x1f95f3,_0x58b000,_0x4b8c64,!!_0x123038['delete'],!!_0x123038[_0x3da3af(0x174)]),_0x307353=_0x4f0056[_0x3da3af(0x1cc)]['new'],_0x3be8aa=_0x4f0056[_0x3da3af(0x1cc)][_0x3da3af(0x1ec)],_0x58a4e0=_0x4f0056[_0x3da3af(0x1cc)][_0x3da3af(0x1c0)],_0x387e8d=_0x4f0056[_0x3da3af(0x1cc)][_0x3da3af(0x1e6)],_0x328e88=_0x4f0056[_0x3da3af(0x205)][_0x3da3af(0x1a1)],_0x5c9f2c=_0x4f0056[_0x3da3af(0x18a)][_0x3da3af(0x1ca)],_0x577119=_0x4f0056['journeys'][_0x3da3af(0x1ec)],_0x431f3c=_0x4f0056['journeys']['unchanged'],_0x2da1c1=_0x4f0056['journeys'][_0x3da3af(0x1e6)],_0x26bd33=_0x4f0056[_0x3da3af(0x1f4)][_0x3da3af(0x19b)],_0x133765=_0x4f0056[_0x3da3af(0x1f4)][_0x3da3af(0x1a1)],_0x7594d2=_0x4f0056[_0x3da3af(0x1f4)][_0x3da3af(0x1d9)],_0x2f6212=_0x4f0056[_0x3da3af(0x1f4)][_0x3da3af(0x1e6)];console[_0x3da3af(0x208)](_0x3da3af(0x1d4)+_0x3b4e9d+'\x27:');_0x328e88[_0x3da3af(0x1bd)]>0x0&&console[_0x3da3af(0x208)]('\x20\x20'+a29_0x1fe9af[_0x3da3af(0x186)]('📁\x20'+_0x328e88[_0x3da3af(0x1bd)]+_0x3da3af(0x1b4)));if(!_0x123038[_0x3da3af(0x174)]){console[_0x3da3af(0x208)](_0x3da3af(0x1e4)),console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x1ea)]('+\x20'+_0x307353['length']+_0x3da3af(0x1e5))),console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x18e)]('~\x20'+_0x3be8aa[_0x3da3af(0x1bd)]+_0x3da3af(0x194)));if(_0x387e8d['length']>0x0)console['error']('\x20\x20\x20\x20'+a29_0x1fe9af[_0x3da3af(0x1a8)]('-\x20'+_0x387e8d[_0x3da3af(0x1bd)]+_0x3da3af(0x1b8)));else _0x58b000[_0x3da3af(0x1bd)]>0x0&&!_0x123038[_0x3da3af(0x1f0)]&&console['error'](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x1ff)](_0x58b000['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x1ff)]('=\x20'+_0x58a4e0[_0x3da3af(0x1bd)]+'\x20unchanged'));}if(_0xebe1b3['length']>0x0||_0x4b8c64[_0x3da3af(0x1bd)]>0x0){console[_0x3da3af(0x208)](_0x3da3af(0x203)),console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x1ea)]('+\x20'+_0x5c9f2c[_0x3da3af(0x1bd)]+'\x20new')),console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x18e)]('~\x20'+_0x577119[_0x3da3af(0x1bd)]+_0x3da3af(0x194)));if(_0x2da1c1['length']>0x0)console[_0x3da3af(0x208)]('\x20\x20\x20\x20'+a29_0x1fe9af[_0x3da3af(0x1a8)]('-\x20'+_0x2da1c1['length']+_0x3da3af(0x1b8)));else _0x4b8c64[_0x3da3af(0x1bd)]>0x0&&!_0x123038['delete']&&console['error']('\x20\x20\x20\x20'+a29_0x1fe9af[_0x3da3af(0x1ff)](_0x4b8c64[_0x3da3af(0x1bd)]+_0x3da3af(0x177)));console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af['dim']('=\x20'+_0x431f3c[_0x3da3af(0x1bd)]+_0x3da3af(0x184)));}_0x26bd33[_0x3da3af(0x1bd)]>0x0&&!_0x123038[_0x3da3af(0x174)]&&(console[_0x3da3af(0x208)](''),console[_0x3da3af(0x208)](_0x3da3af(0x195)),_0x133765[_0x3da3af(0x1bd)]>0x0&&console['error']('\x20\x20\x20\x20'+a29_0x1fe9af[_0x3da3af(0x1ea)]('+\x20'+_0x133765[_0x3da3af(0x1bd)]+'\x20to\x20create')),_0x7594d2[_0x3da3af(0x1bd)]>0x0&&console['error'](_0x3da3af(0x1cf)+a29_0x1fe9af['yellow']('~\x20'+_0x7594d2[_0x3da3af(0x1bd)]+_0x3da3af(0x172))),_0x2f6212['length']>0x0&&console[_0x3da3af(0x208)]('\x20\x20\x20\x20'+a29_0x1fe9af['red']('-\x20'+_0x2f6212[_0x3da3af(0x1bd)]+_0x3da3af(0x1b8))));console[_0x3da3af(0x208)]('\x20\x20Source:\x20'+a29_0x1fe9af[_0x3da3af(0x179)](_0x2c9d90)+'\x0a');if(_0x328e88[_0x3da3af(0x1bd)]>0x0){console[_0x3da3af(0x208)](_0x3da3af(0x17b));for(const _0x28c228 of _0x328e88){console['error']('\x20\x20'+a29_0x1fe9af['blue']('+')+'\x20'+_0x28c228);}console[_0x3da3af(0x208)]('');}if(_0x307353[_0x3da3af(0x1bd)]>0x0&&!_0x123038['journeysOnly'])for(const _0x236085 of _0x307353){const _0x5c3282=_0x236085[_0x3da3af(0x1b6)]?_0x236085['folderPath']+'/'+_0x236085['yamlConfig'][_0x3da3af(0x1de)]:_0x236085[_0x3da3af(0x183)]['name'],_0xf68f0a=_0x236085[_0x3da3af(0x183)][_0x3da3af(0x1f4)]?.[_0x3da3af(0x1bd)]||0x0,_0x21b187=_0xf68f0a>0x0?a29_0x1fe9af[_0x3da3af(0x1ff)]('\x20['+_0xf68f0a+_0x3da3af(0x1ae)):'';console['error']('\x0a'+a29_0x1fe9af[_0x3da3af(0x1ea)](_0x3da3af(0x1cd))+'\x20'+_0x5c3282+_0x21b187),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c)),_0x236085['diff']&&console[_0x3da3af(0x208)](_0x236085[_0x3da3af(0x1af)]),console[_0x3da3af(0x208)]('─'['repeat'](0x3c));}if(_0x387e8d[_0x3da3af(0x1bd)]>0x0&&!_0x123038[_0x3da3af(0x174)])for(const _0x586989 of _0x387e8d){const _0x555b01=_0x586989[_0x3da3af(0x202)]?_0x311437['get'](_0x586989[_0x3da3af(0x202)][_0x3da3af(0x1e2)]())||'':'',_0x2d8843=_0x555b01?_0x555b01+'/'+_0x586989[_0x3da3af(0x1de)]:_0x586989['name'],_0x2bd98e=_0x4beab7[_0x3da3af(0x1c5)](_0x586989['id'])||[],_0x37e803=_0x2bd98e[_0x3da3af(0x1bd)]>0x0?a29_0x1fe9af[_0x3da3af(0x1ff)]('\x20['+_0x2bd98e[_0x3da3af(0x1bd)]+_0x3da3af(0x1ae)):'';console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x1a8)]('Delete\x20segment:')+'\x20'+_0x2d8843+_0x37e803),console[_0x3da3af(0x208)]('─'['repeat'](0x3c));const _0x480d8e=segmentWithActivationsToYaml(_0x586989,_0x2bd98e,undefined,_0x8d3419,_0x386854),_0x2dbbac=segmentToYamlString(_0x480d8e),_0x3f0f5d=generateDiff(_0x2dbbac,'');console['error'](formatDiffWithColors(_0x3f0f5d)),console['error']('─'[_0x3da3af(0x173)](0x3c));}const _0x583f30=_0x34ce1f[_0x3da3af(0x1fa)](_0x19d3a1=>!_0x19d3a1[_0x3da3af(0x1ed)]&&_0x19d3a1[_0x3da3af(0x1af)]);if(_0x583f30['length']>0x0&&!_0x123038['journeysOnly'])for(const _0x424043 of _0x583f30){const _0x2a23de=_0x424043['folderPath']?_0x424043['folderPath']+'/'+_0x424043[_0x3da3af(0x183)]['name']:_0x424043[_0x3da3af(0x183)][_0x3da3af(0x1de)];console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x18e)]('Changes\x20to:')+'\x20'+_0x2a23de),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c)),console['error'](_0x424043['diff']),console['error']('─'['repeat'](0x3c));}if(_0x5c9f2c[_0x3da3af(0x1bd)]>0x0)for(const _0x34610f of _0x5c9f2c){const _0x1456a0=_0x34610f[_0x3da3af(0x1b6)]?_0x34610f['folderPath']+'/'+_0x34610f[_0x3da3af(0x183)][_0x3da3af(0x1de)]:_0x34610f['yamlConfig'][_0x3da3af(0x1de)];console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x1ea)](_0x3da3af(0x209))+'\x20'+_0x1456a0),console[_0x3da3af(0x208)]('─'['repeat'](0x3c)),_0x34610f[_0x3da3af(0x1af)]&&console[_0x3da3af(0x208)](_0x34610f[_0x3da3af(0x1af)]),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c));}const _0x3c9fb9=_0xebe1b3[_0x3da3af(0x1fa)](_0x400ed1=>!_0x400ed1[_0x3da3af(0x1ed)]&&_0x400ed1[_0x3da3af(0x1af)]);if(_0x3c9fb9[_0x3da3af(0x1bd)]>0x0)for(const _0x5dc00b of _0x3c9fb9){const _0x41ac83=_0x5dc00b['folderPath']?_0x5dc00b['folderPath']+'/'+_0x5dc00b[_0x3da3af(0x183)][_0x3da3af(0x1de)]:_0x5dc00b[_0x3da3af(0x183)][_0x3da3af(0x1de)];console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x18e)](_0x3da3af(0x1fc))+'\x20'+_0x41ac83),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c)),console[_0x3da3af(0x208)](_0x5dc00b['diff']),console['error']('─'['repeat'](0x3c));}if(_0x2da1c1[_0x3da3af(0x1bd)]>0x0)for(const _0x252779 of _0x2da1c1){const _0x592353=_0x252779['folderId']?_0x311437[_0x3da3af(0x1c5)](_0x252779[_0x3da3af(0x1b3)])||'':'',_0x33332d=_0x592353?_0x592353+'/'+_0x252779['journeyBundleName']:_0x252779[_0x3da3af(0x1c9)];console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x1a8)](_0x3da3af(0x1aa))+'\x20'+_0x33332d),console[_0x3da3af(0x208)]('─'['repeat'](0x3c)),console[_0x3da3af(0x208)](a29_0x1fe9af['red'](_0x3da3af(0x1fe))),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c));}if(_0x123038[_0x3da3af(0x1be)])return console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x18e)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x28dc9b=_0x123038['journeysOnly']?![]:_0x307353[_0x3da3af(0x1bd)]>0x0||_0x3be8aa['length']>0x0||_0x387e8d[_0x3da3af(0x1bd)]>0x0,_0x25464a=_0x5c9f2c[_0x3da3af(0x1bd)]>0x0||_0x577119[_0x3da3af(0x1bd)]>0x0||_0x2da1c1[_0x3da3af(0x1bd)]>0x0,_0x59a5ad=_0x123038[_0x3da3af(0x174)]?![]:_0x26bd33[_0x3da3af(0x1bd)]>0x0,_0x404b06=_0x328e88['length']>0x0;if(!_0x28dc9b&&!_0x25464a&&!_0x59a5ad&&!_0x404b06){const _0x26dd58=_0x123038[_0x3da3af(0x174)]?_0x3da3af(0x1c1):_0x3da3af(0x1f8);console['error'](a29_0x1fe9af[_0x3da3af(0x1ea)](_0x26dd58));if(_0x1d28b4&&_0x431f3c[_0x3da3af(0x1bd)]===0x1){const _0x847428=_0x431f3c[0x0];if(_0x847428['existingJourney']?.['id']){const _0x50302d=getConsoleNextUrl(_0x123038[_0x3da3af(0x1bb)],'/app/ps/'+_0x1f423a+_0x3da3af(0x1da)+_0x847428['existingJourney']['id']+'/j/da/je');console[_0x3da3af(0x208)]('\x20\x20'+a29_0x1fe9af[_0x3da3af(0x179)](_0x50302d));}}return 0x0;}const _0x28f0f7=_0x123038[_0x3da3af(0x174)]?_0x5c9f2c['length']+_0x577119[_0x3da3af(0x1bd)]+_0x2da1c1[_0x3da3af(0x1bd)]+_0x328e88[_0x3da3af(0x1bd)]:_0x307353[_0x3da3af(0x1bd)]+_0x3be8aa[_0x3da3af(0x1bd)]+_0x387e8d['length']+_0x5c9f2c[_0x3da3af(0x1bd)]+_0x577119[_0x3da3af(0x1bd)]+_0x2da1c1[_0x3da3af(0x1bd)]+_0x328e88[_0x3da3af(0x1bd)]+_0x26bd33[_0x3da3af(0x1bd)];if(!_0x123038[_0x3da3af(0x1c6)]&&_0x28f0f7>0x0){const _0x263462=await confirmKey(_0x3da3af(0x1b7)+_0x28f0f7+_0x3da3af(0x175));if(!_0x263462)return console[_0x3da3af(0x208)](_0x3da3af(0x1ef)),0x1;}const _0x33e758={'withProgress':async(_0x3e54a5,_0x3e0d60)=>{const _0x3bb635=_0x3da3af,_0x47f9e1=await withSpinner(_0x3e54a5,_0x3e0d60,{'verbose':_0x123038[_0x3bb635(0x1f7)]});return{'data':_0x47f9e1['data']};},'logInfo':_0x4b0501=>console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x186)]('✔\x20'+_0x4b0501)),'logSuccess':_0x5907e9=>console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x1ea)]('✔\x20'+_0x5907e9)),'logWarning':_0x3c6f01=>console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x18e)]('⚠\x20'+_0x3c6f01)),'logDeleted':_0x2b2f5a=>console[_0x3da3af(0x208)](a29_0x1fe9af['red']('✔\x20'+_0x2b2f5a))},_0x41ac63={'segment':_0x47b0b3[_0x3da3af(0x200)],'journey':_0x47b0b3['journey'],'user':_0x47b0b3[_0x3da3af(0x1bc)],'connection':_0x47b0b3[_0x3da3af(0x1ab)]};_0x328e88['length']>0x0&&(_0x1c5cb9=await executePushFolders(_0x41ac63,_0x328e88,_0x1c5cb9,{'parentId':_0x1f423a},_0x33e758));const _0x461a79={'rootFolderId':_0x5f02a1,'folderPathToId':_0x1c5cb9,'folderIdToPath':_0x311437,'segmentNameToId':_0x5f66cb,'activationsBySegmentId':_0x4beab7,'emailToIdMap':_0x1a6fb8,'idToEmailMap':_0x8d3419,'connectionNameToIdMap':_0x2524da[_0x3da3af(0x206)],'connectionIdToNameMap':_0x2524da[_0x3da3af(0x1a9)],'connectionNameToTypeMap':_0xdceb7},_0x2f6c4b=await executePushSegments(_0x41ac63,_0x123038['journeysOnly']?[]:_0x34ce1f,_0x461a79,{'parentId':_0x1f423a},_0x33e758),_0x192890=_0x2f6c4b['created'],_0x9f1304=_0x2f6c4b[_0x3da3af(0x199)],_0x3f80b9=_0x2f6c4b[_0x3da3af(0x1f4)][_0x3da3af(0x17e)],_0x4050af=_0x2f6c4b[_0x3da3af(0x1f4)][_0x3da3af(0x199)],_0x3116eb=_0x2f6c4b[_0x3da3af(0x1f4)][_0x3da3af(0x1a0)],_0x2782b9=await executePushSegmentDeletions(_0x41ac63,_0x123038[_0x3da3af(0x174)]?[]:_0x387e8d,_0x33e758);let _0x30f78a=0x0,_0xc6df7d=0x0,_0x5056d4=0x0;const _0x4710fb=new Map(_0x5f66cb);for(const [_0x2c7515,_0x4558a3]of _0x2f6c4b[_0x3da3af(0x1f1)]){_0x4710fb[_0x3da3af(0x1d7)](_0x2c7515,_0x4558a3);}if(_0xebe1b3[_0x3da3af(0x1bd)]>0x0){const _0x829948={..._0x461a79,'segmentNameToId':_0x4710fb,'existingSegments':_0x2714f1,'activationContext':_0x649a56},_0x41c463=await executePushJourneys(_0x41ac63,_0xebe1b3,_0x829948,{'parentId':_0x1f423a,'rootFolderId':_0x5f02a1,'verbose':_0x123038['verbose']},_0x33e758);_0x30f78a=_0x41c463['created'],_0xc6df7d=_0x41c463[_0x3da3af(0x199)];if(_0x1d28b4&&_0x41c463[_0x3da3af(0x1fb)][_0x3da3af(0x1bd)]===0x1){const _0xfa1a92=_0x41c463[_0x3da3af(0x1fb)][0x0];if(_0xfa1a92[_0x3da3af(0x1c3)]){const _0x313276=getConsoleNextUrl(_0x123038[_0x3da3af(0x1bb)],_0x3da3af(0x187)+_0x1f423a+_0x3da3af(0x1da)+_0xfa1a92['journeyId']+_0x3da3af(0x1dc));console[_0x3da3af(0x208)]('\x20\x20'+a29_0x1fe9af[_0x3da3af(0x179)](_0x313276));}}}for(const _0x453eb2 of _0x2da1c1){console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x18e)](_0x3da3af(0x20a)+_0x453eb2['journeyBundleName'])),_0x5056d4++;}const _0x1bbc5e=[];if(_0x192890>0x0)_0x1bbc5e['push'](_0x192890+_0x3da3af(0x1b2));if(_0x9f1304>0x0)_0x1bbc5e[_0x3da3af(0x197)](_0x9f1304+_0x3da3af(0x1b5));if(_0x2782b9>0x0)_0x1bbc5e[_0x3da3af(0x197)](_0x2782b9+_0x3da3af(0x1dd));const _0x4ace2f=[];if(_0x30f78a>0x0)_0x4ace2f[_0x3da3af(0x197)](_0x30f78a+_0x3da3af(0x1b2));if(_0xc6df7d>0x0)_0x4ace2f[_0x3da3af(0x197)](_0xc6df7d+'\x20updated');if(_0x5056d4>0x0)_0x4ace2f[_0x3da3af(0x197)](_0x5056d4+_0x3da3af(0x1dd));const _0xd56d92=[];if(_0x3f80b9>0x0)_0xd56d92[_0x3da3af(0x197)](_0x3f80b9+_0x3da3af(0x1b2));if(_0x4050af>0x0)_0xd56d92[_0x3da3af(0x197)](_0x4050af+_0x3da3af(0x1b5));if(_0x3116eb>0x0)_0xd56d92[_0x3da3af(0x197)](_0x3116eb+_0x3da3af(0x1dd));return console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x1ea)](_0x3da3af(0x1f9))),_0x1bbc5e[_0x3da3af(0x1bd)]>0x0&&!_0x123038['journeysOnly']&&console[_0x3da3af(0x208)](_0x3da3af(0x1f3)+_0x1bbc5e[_0x3da3af(0x16f)](',\x20')),_0x4ace2f[_0x3da3af(0x1bd)]>0x0&&console[_0x3da3af(0x208)](_0x3da3af(0x1c8)+_0x4ace2f[_0x3da3af(0x16f)](',\x20')),_0xd56d92[_0x3da3af(0x1bd)]>0x0&&!_0x123038[_0x3da3af(0x174)]&&console[_0x3da3af(0x208)](_0x3da3af(0x1f2)+_0xd56d92[_0x3da3af(0x16f)](',\x20')),0x0;}}
|
|
1
|
+
function a29_0x11e3(){const _0x30fa61=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Delete\x20journey:','\x20\x20Activations:','delete','(Journey\x20will\x20be\x20deleted)','293814XCArNY','folders','\x20activations]','Changes\x20to\x20journey:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20unchanged','isScoped','Parent\x20segment:\x20','red','New\x20journey:','\x20\x20Journeys:\x20','buildUserMaps','message','join','87ZKrTpa','activations','folderPath','push','11qTLbeE','journeyBundleName','isNew','journeyId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Scoped\x20to\x20folder:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','Source\x20directory:\x20','\x20\x20Activations:\x20','unchanged','execute','\x20changes?','/app/ps/','getParent','nameToId','map','updated','results','\x20folders\x20to\x20create','3558TxDWdt','Fetching\x20existing\x20segments...','\x0aValidation\x20failed:','site','list','\x20new','dim','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Preparing\x20journeys...','toDelete','\x20YAML\x20files\x20found','all','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','connection','new','listFolders','No\x20','dryRun','\x20\x20Segments:\x20','error','listActivations','Delete\x20segment:','\x27...','journeys','Resolving\x20parent\x20segment\x20\x27','folderId','journey','segments','attributes','Aborted.','/e/','segment','\x20created','\x20\x20\x20\x20','9HeLezq','type','\x20changed','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20folders...','yamlConfig','.yml','\x20to\x20update','paused','1279180Rthlew','get','toUpdate','journeyBundleId','4RZwMjG','cyan','name','state','blue','📁\x20','changed','no_parent','description','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','526812iFTUck','\x20deleted','\x20to\x20delete','filePath','1215730Sdfxkf','segmentFolderId','toString','set','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','length','createdSegmentIds','parentFolder','repeat','createdAt','updatedAt','Error\x20parsing\x20YAML:\x20','resolveParentId','data','Fetching\x20existing\x20activations...','user','existingJourney','\x0aPush\x20summary\x20for\x20\x27','add','yellow','Site:\x20','Fetching\x20parent\x20segment\x20details...','filter','then','versionNumber','Error:\x20Directory\x20not\x20found:\x20','17768chYFMm','file','Error:\x20','endsWith','New\x20segment:','green','errorCode','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','setPhase','segment\x20or\x20journey','verbose','getJourney','parent_name','Fetching\x20users\x20for\x20email\x20resolution...','\x20\x20📊\x20Segments:','journeysOnly','deleted','helpText','/j/da/je','1469265Axksuc','diff','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20to\x20create','\x20updated','listJourneysWithDetailsFromParentSegment','cwd','toCreate','targetDir','scopedFolderPath','nameToType'];a29_0x11e3=function(){return _0x30fa61;};return a29_0x11e3();}const a29_0x3a669c=a29_0x1808;(function(_0x247488,_0x21a216){const _0x4b31ce=a29_0x1808,_0x30e662=_0x247488();while(!![]){try{const _0x46c2c7=parseInt(_0x4b31ce(0x1e9))/0x1*(-parseInt(_0x4b31ce(0x200))/0x2)+parseInt(_0x4b31ce(0x239))/0x3+-parseInt(_0x4b31ce(0x22f))/0x4*(parseInt(_0x4b31ce(0x22b))/0x5)+parseInt(_0x4b31ce(0x1da))/0x6+parseInt(_0x4b31ce(0x1ca))/0x7+-parseInt(_0x4b31ce(0x1b7))/0x8*(parseInt(_0x4b31ce(0x222))/0x9)+parseInt(_0x4b31ce(0x23d))/0xa*(parseInt(_0x4b31ce(0x1ed))/0xb);if(_0x46c2c7===_0x21a216)break;else _0x30e662['push'](_0x30e662['shift']());}catch(_0x444395){_0x30e662['push'](_0x30e662['shift']());}}}(a29_0x11e3,0x22f6b));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_0x3bbddb from'chalk';function a29_0x1808(_0x2dd087,_0x31d7cb){_0x2dd087=_0x2dd087-0x1a5;const _0x11e382=a29_0x11e3();let _0x180850=_0x11e382[_0x2dd087];return _0x180850;}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_0x3a669c(0x231)]='segment:push';['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a29_0x3a669c(0x1f7)](_0x199a15){const _0x515249=a29_0x3a669c,{options:_0x4fe2c2,args:_0x51de86,tdx:_0x298f1b}=_0x199a15,_0x4ccd95=_0x4fe2c2,_0x43636b=await resolveTarget({'arg':_0x51de86[0x0],'contextParent':_0x4fe2c2['parentSegment'],'cwd':process[_0x515249(0x1d0)]()});if(!isSuccessfulResolution(_0x43636b))return _0x43636b[_0x515249(0x1bd)]===_0x515249(0x236)?(console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x1f1))),console[_0x515249(0x213)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x515249(0x213)](_0x515249(0x1d5)),console['error'](_0x515249(0x1de))):(console['error'](a29_0x3bbddb['red'](_0x515249(0x1b9)+_0x43636b['message']+'\x0a')),_0x43636b[_0x515249(0x1c8)]&&console['error'](a29_0x3bbddb[_0x515249(0x230)](_0x43636b['helpText']))),0x1;if(_0x43636b[_0x515249(0x223)]===_0x515249(0x1c3))return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1b6)+_0x43636b[_0x515249(0x1d2)]+'\x0a')),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x230)](_0x515249(0x241))),0x1;const _0x577a22=_0x43636b['parentName'],_0xfb5e91=_0x43636b[_0x515249(0x1d2)],_0x474ed8=_0x43636b[_0x515249(0x223)]===_0x515249(0x1b8)?_0x43636b[_0x515249(0x23c)]:undefined,_0x4faf87=getScopedDetails(_0x43636b),_0x4eb55c=_0x4faf87?.[_0x515249(0x1e1)]??![],_0x5d8bf7=_0x4faf87?.[_0x515249(0x1d3)]??'';if(!existsSync(_0xfb5e91))return console['error'](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1b6)+_0xfb5e91+'\x0a')),console['error'](a29_0x3bbddb[_0x515249(0x230)](_0x515249(0x241))),0x1;_0x4ccd95[_0x515249(0x1c1)]&&(console[_0x515249(0x213)](_0x515249(0x1b1)+_0x4ccd95[_0x515249(0x203)]),console[_0x515249(0x213)](_0x515249(0x1e2)+_0x577a22),console[_0x515249(0x213)](_0x515249(0x1f4)+_0xfb5e91),_0x4eb55c&&console[_0x515249(0x213)](_0x515249(0x1f2)+_0x5d8bf7));const _0x418425=await withSpinner(_0x515249(0x218)+_0x577a22+_0x515249(0x216),()=>_0x298f1b['segment'][_0x515249(0x1a9)](_0x577a22),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),_0x3ce21d=_0x418425[_0x515249(0x1aa)],[_0x6e30e,_0x18e4d9,_0x25cddd,_0x50e29b,_0x341e91]=await Promise[_0x515249(0x20b)]([withSpinner(_0x515249(0x1b2),()=>_0x298f1b[_0x515249(0x21f)][_0x515249(0x1fa)](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x201),()=>_0x298f1b['segment']['listSegments'](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x226),()=>_0x298f1b['segment'][_0x515249(0x20f)](_0x3ce21d),{'verbose':_0x4ccd95['verbose']}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x298f1b[_0x515249(0x21a)][_0x515249(0x1cf)](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x1c4),()=>_0x298f1b['user'][_0x515249(0x1e6)](),{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x514aba=>_0x514aba['data'])]),_0x2c60aa=_0x6e30e['data'],_0x57b03c=extractRootFolderId(_0x2c60aa),_0x88dfb2=_0x18e4d9[_0x515249(0x1aa)],_0x23b4fe=_0x25cddd[_0x515249(0x1aa)],{journeys:_0x36f1d7,activationStepsById:_0x56b680}=_0x50e29b[_0x515249(0x1aa)],_0x18d68e=new Map(_0x36f1d7['map'](_0x121018=>[_0x121018['id'],_0x121018])),_0xe2ff26=_0x36f1d7[_0x515249(0x1fc)](_0x2d4d8d=>({'id':_0x2d4d8d['id'],'name':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x231)],'journeyBundleName':_0x2d4d8d['attributes'][_0x515249(0x1ee)]||'','journeyBundleId':_0x2d4d8d['attributes'][_0x515249(0x22e)]||'','versionNumber':_0x2d4d8d['attributes'][_0x515249(0x1b5)],'description':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x237)],'state':_0x2d4d8d['attributes'][_0x515249(0x232)],'paused':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x22a)],'audienceId':_0x2d4d8d[_0x515249(0x21c)]['audienceId'],'folderId':_0x2d4d8d['relationships']?.[_0x515249(0x244)]?.[_0x515249(0x1aa)]?.['id'],'createdAt':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x1a6)],'updatedAt':_0x2d4d8d['attributes'][_0x515249(0x1a7)]})),{emailToId:_0x375ae0,idToEmail:_0x1d4c3b}=_0x341e91,_0xf86b85=await withSpinner(_0x515249(0x1f3),async()=>{const _0x5e1480=_0x515249,_0x1d534f=await _0x298f1b[_0x5e1480(0x20d)][_0x5e1480(0x204)]();return buildConnectionMaps(_0x1d534f);},{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x2ef9ee=>_0x2ef9ee[_0x515249(0x1aa)]),_0x308d3b=_0xf86b85[_0x515249(0x1fb)],_0x4b93f7=_0xf86b85['idToName'],_0x1c390c=_0xf86b85[_0x515249(0x1d4)],_0x6d306c={'emailToIdMap':_0x375ae0,'connectionNameToIdMap':_0x308d3b,'connectionNameToTypeMap':_0x1c390c,'getSchema':_0x29ef5c=>_0x298f1b[_0x515249(0x20d)]['getOutputSchemaWithCache'](_0x29ef5c)};let {pathToId:_0xf07735,idToPath:_0x48c8d0}=buildFolderMaps(_0x23b4fe);const _0x47ed5c=buildSegmentLookupMap(_0x88dfb2,_0x48c8d0),_0x5358c4=buildSegmentNameToIdMap(_0x88dfb2),_0x2baf70=buildJourneyBundleLookupMap(_0xe2ff26,_0x48c8d0);let _0x57cbf8;if(_0x474ed8){if(!_0x474ed8['endsWith'](_0x515249(0x228))&&!_0x474ed8[_0x515249(0x1ba)]('.yaml'))return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1cc)+_0x474ed8+'\x0a')),0x1;_0x57cbf8=[_0x474ed8];}else _0x57cbf8=findYamlFiles(_0xfb5e91);if(_0x57cbf8[_0x515249(0x242)]===0x0)return console[_0x515249(0x213)](a29_0x3bbddb['red'](_0x515249(0x1df)+_0xfb5e91+'\x0a')),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x230)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x414b9b,_0x33c5a6;try{const _0x11041c=parseAndClassifyYamlFiles(_0x57cbf8,_0xfb5e91,{'skipSegments':_0x4ccd95[_0x515249(0x1c6)]});_0x414b9b=_0x11041c['segments'],_0x33c5a6=_0x11041c[_0x515249(0x217)];const _0x1fce2b=validateParsedFiles(_0x11041c,_0xfb5e91);if(_0x1fce2b[_0x515249(0x242)]>0x0)return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x202))),console[_0x515249(0x213)](formatValidationErrors(_0x1fce2b)),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xd7bec5){return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1a8)+(_0xd7bec5 instanceof Error?_0xd7bec5[_0x515249(0x1e7)]:_0xd7bec5))),0x1;}if(_0x414b9b[_0x515249(0x242)]===0x0&&_0x33c5a6[_0x515249(0x242)]===0x0){const _0x3d1c09=_0x4ccd95[_0x515249(0x1c6)]?_0x515249(0x21a):_0x515249(0x1c0);return console[_0x515249(0x213)](a29_0x3bbddb['yellow'](_0x515249(0x210)+_0x3d1c09+_0x515249(0x20a))),0x0;}const _0x5bf32d=new Map();_0x88dfb2[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&await withSpinner(_0x515249(0x1ab),async()=>{await batchAsync(_0x88dfb2,async _0x2b6c2e=>{const _0x20eddb=a29_0x1808,_0x2dc4de=await _0x298f1b['segment'][_0x20eddb(0x214)](_0x3ce21d,_0x2b6c2e['id']);_0x5bf32d[_0x20eddb(0x240)](_0x2b6c2e['id'],_0x2dc4de);});},{'verbose':_0x4ccd95[_0x515249(0x1c1)]});const {segmentFiles:_0x3b717d,foldersToCreate:_0x173156}=await prepareSegmentFiles(_0x414b9b,{'segmentByFolderAndName':_0x47ed5c,'activationsBySegmentId':_0x5bf32d,'folderPathToId':_0xf07735,'idToEmailMap':_0x1d4c3b,'connectionIdToNameMap':_0x4b93f7},_0x6d306c,_0x4eb55c,_0x5d8bf7),_0x2bdd7a=_0x474ed8?[]:findSegmentsToDelete(_0x88dfb2,_0x414b9b[_0x515249(0x1fc)](({yamlConfig:_0x47d41d,folderPath:_0x553e8b})=>({'yamlConfig':_0x47d41d,'folderPath':resolveTDFolderPath(_0x553e8b,_0x4eb55c,_0x5d8bf7)})),_0x48c8d0,_0x5d8bf7,_0x4eb55c),{journeyFiles:_0x24fcca,foldersToCreate:_0x201ac3}=await withProgressSpinner(_0x515249(0x208),async _0x5c3585=>prepareJourneyFiles(_0x33c5a6,{'fetchJourney':async _0x525c6e=>_0x298f1b[_0x515249(0x21a)][_0x515249(0x1c2)](_0x525c6e[_0x515249(0x1f0)]),'journeyBundlesByFolderAndName':_0x2baf70,'folderPathToId':_0xf07735,'idToEmailMap':_0x1d4c3b,'connectionIdToNameMap':_0x4b93f7,'existingSegments':_0x88dfb2,'parentId':_0x3ce21d,'deps':_0x298f1b,'progress':{'update':_0x426f23=>{const _0x3b988f=_0x515249;_0x5c3585[_0x3b988f(0x1bf)](_0x426f23),_0x4ccd95['verbose']&&console['error']('\x20\x20'+_0x426f23);}},'journeyById':_0x18d68e,'activationStepsById':_0x56b680},_0x4eb55c,_0x5d8bf7),{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x5ca943=>_0x5ca943[_0x515249(0x1aa)]);for(const _0x4b2b2c of _0x201ac3){_0x173156[_0x515249(0x1af)](_0x4b2b2c);}const _0x2cf22d=_0x474ed8?[]:findJourneysToDelete(_0xe2ff26,_0x33c5a6[_0x515249(0x1fc)](({yamlConfig:_0x4a86a8,folderPath:_0x21f062})=>({'yamlConfig':_0x4a86a8,'folderPath':resolveTDFolderPath(_0x21f062,_0x4eb55c,_0x5d8bf7)})),_0x48c8d0,_0x5d8bf7,_0x4eb55c),_0x59c3f3=calculatePushStats(_0x3b717d,_0x24fcca,_0x173156,_0x2bdd7a,_0x2cf22d,!!_0x4ccd95[_0x515249(0x1d8)],!!_0x4ccd95[_0x515249(0x1c6)]),_0x32ad35=_0x59c3f3['segments'][_0x515249(0x20e)],_0x5e8417=_0x59c3f3[_0x515249(0x21b)]['changed'],_0x20f679=_0x59c3f3[_0x515249(0x21b)]['unchanged'],_0x4c01a5=_0x59c3f3[_0x515249(0x21b)]['toDelete'],_0x3b501b=_0x59c3f3[_0x515249(0x1db)][_0x515249(0x1d1)],_0x14a92d=_0x59c3f3[_0x515249(0x217)][_0x515249(0x20e)],_0x398faf=_0x59c3f3['journeys'][_0x515249(0x235)],_0x57e86e=_0x59c3f3[_0x515249(0x217)][_0x515249(0x1f6)],_0x1bab11=_0x59c3f3['journeys'][_0x515249(0x209)],_0x327864=_0x59c3f3[_0x515249(0x1ea)]['all'],_0x4452bf=_0x59c3f3[_0x515249(0x1ea)][_0x515249(0x1d1)],_0x4e7baa=_0x59c3f3[_0x515249(0x1ea)][_0x515249(0x22d)],_0x146651=_0x59c3f3['activations'][_0x515249(0x209)];console[_0x515249(0x213)](_0x515249(0x1ae)+_0x577a22+'\x27:');_0x3b501b[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x233)](_0x515249(0x234)+_0x3b501b[_0x515249(0x242)]+_0x515249(0x1ff)));if(!_0x4ccd95[_0x515249(0x1c6)]){console[_0x515249(0x213)](_0x515249(0x1c5)),console['error'](_0x515249(0x221)+a29_0x3bbddb['green']('+\x20'+_0x32ad35['length']+_0x515249(0x205))),console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1b0)]('~\x20'+_0x5e8417[_0x515249(0x242)]+_0x515249(0x224)));if(_0x4c01a5[_0x515249(0x242)]>0x0)console['error']('\x20\x20\x20\x20'+a29_0x3bbddb['red']('-\x20'+_0x4c01a5[_0x515249(0x242)]+_0x515249(0x23b)));else _0x2bdd7a[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1d8)]&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)](_0x2bdd7a[_0x515249(0x242)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x206)]('=\x20'+_0x20f679[_0x515249(0x242)]+'\x20unchanged'));}if(_0x24fcca['length']>0x0||_0x2cf22d['length']>0x0){console[_0x515249(0x213)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1bc)]('+\x20'+_0x14a92d[_0x515249(0x242)]+_0x515249(0x205))),console['error'](_0x515249(0x221)+a29_0x3bbddb['yellow']('~\x20'+_0x398faf[_0x515249(0x242)]+_0x515249(0x224)));if(_0x1bab11[_0x515249(0x242)]>0x0)console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x1e3)]('-\x20'+_0x1bab11[_0x515249(0x242)]+_0x515249(0x23b)));else _0x2cf22d[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1d8)]&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)](_0x2cf22d[_0x515249(0x242)]+_0x515249(0x207)));console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)]('=\x20'+_0x57e86e[_0x515249(0x242)]+_0x515249(0x1e0)));}_0x327864[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&(console['error'](''),console[_0x515249(0x213)](_0x515249(0x1d7)),_0x4452bf[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb['green']('+\x20'+_0x4452bf[_0x515249(0x242)]+_0x515249(0x1cd))),_0x4e7baa[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x1b0)]('~\x20'+_0x4e7baa['length']+_0x515249(0x229))),_0x146651[_0x515249(0x242)]>0x0&&console['error'](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1e3)]('-\x20'+_0x146651[_0x515249(0x242)]+'\x20to\x20delete')));console[_0x515249(0x213)]('\x20\x20Source:\x20'+a29_0x3bbddb['cyan'](_0xfb5e91)+'\x0a');if(_0x3b501b['length']>0x0){console[_0x515249(0x213)]('Folders\x20to\x20create:');for(const _0x3f5d4d of _0x3b501b){console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x233)]('+')+'\x20'+_0x3f5d4d);}console['error']('');}if(_0x32ad35[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)])for(const _0x1f3f25 of _0x32ad35){const _0x1a2371=_0x1f3f25[_0x515249(0x1eb)]?_0x1f3f25['folderPath']+'/'+_0x1f3f25[_0x515249(0x227)][_0x515249(0x231)]:_0x1f3f25[_0x515249(0x227)][_0x515249(0x231)],_0x41c355=_0x1f3f25['yamlConfig'][_0x515249(0x1ea)]?.[_0x515249(0x242)]||0x0,_0x48835d=_0x41c355>0x0?a29_0x3bbddb[_0x515249(0x206)]('\x20['+_0x41c355+_0x515249(0x1dc)):'';console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1bc)](_0x515249(0x1bb))+'\x20'+_0x1a2371+_0x48835d),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),_0x1f3f25[_0x515249(0x1cb)]&&console[_0x515249(0x213)](_0x1f3f25[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x4c01a5['length']>0x0&&!_0x4ccd95[_0x515249(0x1c6)])for(const _0x304771 of _0x4c01a5){const _0x3c8aa9=_0x304771[_0x515249(0x23e)]?_0x48c8d0[_0x515249(0x22c)](_0x304771['segmentFolderId'][_0x515249(0x23f)]())||'':'',_0xffd923=_0x3c8aa9?_0x3c8aa9+'/'+_0x304771[_0x515249(0x231)]:_0x304771[_0x515249(0x231)],_0x479760=_0x5bf32d[_0x515249(0x22c)](_0x304771['id'])||[],_0x56125f=_0x479760[_0x515249(0x242)]>0x0?a29_0x3bbddb['dim']('\x20['+_0x479760[_0x515249(0x242)]+_0x515249(0x1dc)):'';console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x215))+'\x20'+_0xffd923+_0x56125f),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));const _0x3968b2=segmentWithActivationsToYaml(_0x304771,_0x479760,undefined,_0x1d4c3b,_0x4b93f7),_0xfe12c1=segmentToYamlString(_0x3968b2),_0x4f4c01=generateDiff(_0xfe12c1,'');console[_0x515249(0x213)](formatDiffWithColors(_0x4f4c01)),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}const _0x5dd79e=_0x3b717d[_0x515249(0x1b3)](_0x373eec=>!_0x373eec[_0x515249(0x1ef)]&&_0x373eec[_0x515249(0x1cb)]);if(_0x5dd79e[_0x515249(0x242)]>0x0&&!_0x4ccd95['journeysOnly'])for(const _0x5651fc of _0x5dd79e){const _0x32452a=_0x5651fc[_0x515249(0x1eb)]?_0x5651fc['folderPath']+'/'+_0x5651fc['yamlConfig']['name']:_0x5651fc['yamlConfig']['name'];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1b0)]('Changes\x20to:')+'\x20'+_0x32452a),console['error']('─'[_0x515249(0x1a5)](0x3c)),console['error'](_0x5651fc[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x14a92d[_0x515249(0x242)]>0x0)for(const _0x40cc67 of _0x14a92d){const _0x4084d6=_0x40cc67[_0x515249(0x1eb)]?_0x40cc67['folderPath']+'/'+_0x40cc67[_0x515249(0x227)][_0x515249(0x231)]:_0x40cc67[_0x515249(0x227)][_0x515249(0x231)];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1bc)](_0x515249(0x1e4))+'\x20'+_0x4084d6),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),_0x40cc67[_0x515249(0x1cb)]&&console[_0x515249(0x213)](_0x40cc67[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}const _0x81a8d8=_0x24fcca[_0x515249(0x1b3)](_0x528fff=>!_0x528fff[_0x515249(0x1ef)]&&_0x528fff[_0x515249(0x1cb)]);if(_0x81a8d8[_0x515249(0x242)]>0x0)for(const _0xcfe54 of _0x81a8d8){const _0x3b0322=_0xcfe54[_0x515249(0x1eb)]?_0xcfe54[_0x515249(0x1eb)]+'/'+_0xcfe54[_0x515249(0x227)][_0x515249(0x231)]:_0xcfe54[_0x515249(0x227)]['name'];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x1dd))+'\x20'+_0x3b0322),console['error']('─'[_0x515249(0x1a5)](0x3c)),console[_0x515249(0x213)](_0xcfe54['diff']),console['error']('─'['repeat'](0x3c));}if(_0x1bab11[_0x515249(0x242)]>0x0)for(const _0x3a1793 of _0x1bab11){const _0x129e79=_0x3a1793[_0x515249(0x219)]?_0x48c8d0['get'](_0x3a1793[_0x515249(0x219)])||'':'',_0x4ca6d2=_0x129e79?_0x129e79+'/'+_0x3a1793[_0x515249(0x1ee)]:_0x3a1793[_0x515249(0x1ee)];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1d6))+'\x20'+_0x4ca6d2),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),console['error'](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1d9))),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x4ccd95[_0x515249(0x211)])return console['error'](a29_0x3bbddb['yellow'](_0x515249(0x1be))),0x0;const _0xc213d7=_0x4ccd95[_0x515249(0x1c6)]?![]:_0x32ad35[_0x515249(0x242)]>0x0||_0x5e8417[_0x515249(0x242)]>0x0||_0x4c01a5['length']>0x0,_0x458dc8=_0x14a92d[_0x515249(0x242)]>0x0||_0x398faf[_0x515249(0x242)]>0x0||_0x1bab11['length']>0x0,_0x2b38f6=_0x4ccd95[_0x515249(0x1c6)]?![]:_0x327864[_0x515249(0x242)]>0x0,_0x4ca074=_0x3b501b[_0x515249(0x242)]>0x0;if(!_0xc213d7&&!_0x458dc8&&!_0x2b38f6&&!_0x4ca074){const _0x4c8df8=_0x4ccd95[_0x515249(0x1c6)]?_0x515249(0x225):_0x515249(0x238);console['error'](a29_0x3bbddb[_0x515249(0x1bc)](_0x4c8df8));if(_0x474ed8&&_0x57e86e[_0x515249(0x242)]===0x1){const _0x410828=_0x57e86e[0x0];if(_0x410828['existingJourney']?.['id']){const _0x407002=getConsoleNextUrl(_0x4ccd95['site'],'/app/ps/'+_0x3ce21d+_0x515249(0x21e)+_0x410828[_0x515249(0x1ad)]['id']+'/j/da/je');console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x230)](_0x407002));}}return 0x0;}const _0x3ecc57=_0x4ccd95[_0x515249(0x1c6)]?_0x14a92d[_0x515249(0x242)]+_0x398faf['length']+_0x1bab11[_0x515249(0x242)]+_0x3b501b['length']:_0x32ad35[_0x515249(0x242)]+_0x5e8417[_0x515249(0x242)]+_0x4c01a5['length']+_0x14a92d[_0x515249(0x242)]+_0x398faf[_0x515249(0x242)]+_0x1bab11[_0x515249(0x242)]+_0x3b501b[_0x515249(0x242)]+_0x327864['length'];if(!_0x4ccd95['yes']&&_0x3ecc57>0x0){const _0x2481ca=await confirmKey('Push\x20'+_0x3ecc57+_0x515249(0x1f8));if(!_0x2481ca)return console[_0x515249(0x213)](_0x515249(0x21d)),0x1;}const _0x30fddf={'withProgress':async(_0x1fec37,_0x5218f7)=>{const _0x23a8ae=_0x515249,_0x3c13c0=await withSpinner(_0x1fec37,_0x5218f7,{'verbose':_0x4ccd95[_0x23a8ae(0x1c1)]});return{'data':_0x3c13c0['data']};},'logInfo':_0x1a75bc=>console['error'](a29_0x3bbddb[_0x515249(0x233)]('✔\x20'+_0x1a75bc)),'logSuccess':_0x2dc798=>console['error'](a29_0x3bbddb[_0x515249(0x1bc)]('✔\x20'+_0x2dc798)),'logWarning':_0x3b15f2=>console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)]('⚠\x20'+_0x3b15f2)),'logDeleted':_0x59c049=>console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)]('✔\x20'+_0x59c049))},_0x4d8878={'segment':_0x298f1b[_0x515249(0x21f)],'journey':_0x298f1b['journey'],'user':_0x298f1b[_0x515249(0x1ac)],'connection':_0x298f1b['connection']};_0x3b501b[_0x515249(0x242)]>0x0&&(_0xf07735=await executePushFolders(_0x4d8878,_0x3b501b,_0xf07735,{'parentId':_0x3ce21d},_0x30fddf));const _0x338256={'rootFolderId':_0x57b03c,'folderPathToId':_0xf07735,'folderIdToPath':_0x48c8d0,'segmentNameToId':_0x5358c4,'activationsBySegmentId':_0x5bf32d,'emailToIdMap':_0x375ae0,'idToEmailMap':_0x1d4c3b,'connectionNameToIdMap':_0xf86b85[_0x515249(0x1fb)],'connectionIdToNameMap':_0xf86b85['idToName'],'connectionNameToTypeMap':_0x1c390c},_0x4ec03b=await executePushSegments(_0x4d8878,_0x4ccd95['journeysOnly']?[]:_0x3b717d,_0x338256,{'parentId':_0x3ce21d},_0x30fddf),_0x3ece40=_0x4ec03b['created'],_0xf0739c=_0x4ec03b[_0x515249(0x1fd)],_0x58edb2=_0x4ec03b[_0x515249(0x1ea)]['created'],_0x296d34=_0x4ec03b[_0x515249(0x1ea)][_0x515249(0x1fd)],_0x513578=_0x4ec03b[_0x515249(0x1ea)][_0x515249(0x1c7)],_0x54ee35=await executePushSegmentDeletions(_0x4d8878,_0x4ccd95[_0x515249(0x1c6)]?[]:_0x4c01a5,_0x30fddf);let _0x3a0ea7=0x0,_0x6c993c=0x0,_0x54140e=0x0;const _0x55ea42=new Map(_0x5358c4);for(const [_0x10a09d,_0xa9a0cf]of _0x4ec03b[_0x515249(0x243)]){_0x55ea42[_0x515249(0x240)](_0x10a09d,_0xa9a0cf);}if(_0x24fcca[_0x515249(0x242)]>0x0){const _0x1bd056={..._0x338256,'segmentNameToId':_0x55ea42,'existingSegments':_0x88dfb2,'activationContext':_0x6d306c},_0x3aa464=await executePushJourneys(_0x4d8878,_0x24fcca,_0x1bd056,{'parentId':_0x3ce21d,'rootFolderId':_0x57b03c,'verbose':_0x4ccd95[_0x515249(0x1c1)]},_0x30fddf);_0x3a0ea7=_0x3aa464['created'],_0x6c993c=_0x3aa464[_0x515249(0x1fd)];if(_0x474ed8&&_0x3aa464['results'][_0x515249(0x242)]===0x1){const _0x5d22fc=_0x3aa464[_0x515249(0x1fe)][0x0];if(_0x5d22fc[_0x515249(0x1f0)]){const _0x22e033=getConsoleNextUrl(_0x4ccd95[_0x515249(0x203)],_0x515249(0x1f9)+_0x3ce21d+_0x515249(0x21e)+_0x5d22fc[_0x515249(0x1f0)]+_0x515249(0x1c9));console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x230)](_0x22e033));}}}for(const _0x5b72ae of _0x1bab11){console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x20c)+_0x5b72ae['journeyBundleName'])),_0x54140e++;}const _0x89ef05=[];if(_0x3ece40>0x0)_0x89ef05[_0x515249(0x1ec)](_0x3ece40+'\x20created');if(_0xf0739c>0x0)_0x89ef05[_0x515249(0x1ec)](_0xf0739c+_0x515249(0x1ce));if(_0x54ee35>0x0)_0x89ef05[_0x515249(0x1ec)](_0x54ee35+_0x515249(0x23a));const _0x4b2743=[];if(_0x3a0ea7>0x0)_0x4b2743[_0x515249(0x1ec)](_0x3a0ea7+_0x515249(0x220));if(_0x6c993c>0x0)_0x4b2743[_0x515249(0x1ec)](_0x6c993c+_0x515249(0x1ce));if(_0x54140e>0x0)_0x4b2743['push'](_0x54140e+_0x515249(0x23a));const _0x38d425=[];if(_0x58edb2>0x0)_0x38d425[_0x515249(0x1ec)](_0x58edb2+'\x20created');if(_0x296d34>0x0)_0x38d425[_0x515249(0x1ec)](_0x296d34+_0x515249(0x1ce));if(_0x513578>0x0)_0x38d425[_0x515249(0x1ec)](_0x513578+_0x515249(0x23a));return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1bc)]('\x0a✔\x20Push\x20complete')),_0x89ef05[_0x515249(0x242)]>0x0&&!_0x4ccd95['journeysOnly']&&console[_0x515249(0x213)](_0x515249(0x212)+_0x89ef05[_0x515249(0x1e8)](',\x20')),_0x4b2743['length']>0x0&&console[_0x515249(0x213)](_0x515249(0x1e5)+_0x4b2743['join'](',\x20')),_0x38d425['length']>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&console['error'](_0x515249(0x1f5)+_0x38d425[_0x515249(0x1e8)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a30_0x181df4=a30_0xd639;(function(_0x154769,_0xe7a9e1){const _0x5ed08f=a30_0xd639,_0x5a4bf4=_0x154769();while(!![]){try{const _0x42c4c8=parseInt(_0x5ed08f(0xb3))/0x1+parseInt(_0x5ed08f(0xbc))/0x2*(parseInt(_0x5ed08f(0xb7))/0x3)+parseInt(_0x5ed08f(0xaf))/0x4+-parseInt(_0x5ed08f(0x9a))/0x5*(parseInt(_0x5ed08f(0x93))/0x6)+parseInt(_0x5ed08f(0xb2))/0x7+parseInt(_0x5ed08f(0x9f))/0x8*(parseInt(_0x5ed08f(0xa4))/0x9)+-parseInt(_0x5ed08f(0xbd))/0xa;if(_0x42c4c8===_0xe7a9e1)break;else _0x5a4bf4['push'](_0x5a4bf4['shift']());}catch(_0x3fdda6){_0x5a4bf4['push'](_0x5a4bf4['shift']());}}}(a30_0x35fa,0xd752a));import{BaseCommand}from'./command.js';function a30_0x35fa(){const _0x22bf9d=['yellow','5666899mNDVLQ','121302tLATVM','error','✔\x20Updated\x20segment\x20\x27','Examples:','114024gcUXuy','includes','Resolving\x20folder\x20\x27','segment:update','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','30GfuRiW','2767540DifhRX','name','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folder','execute','Segment\x20ID:\x20','27498ztlSVM','length','segmentId','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentName','INTERNAL','parentId','1785RMHAgK','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Parent\x20ID:\x20','Resolving\x20path\x20\x27','data','498928zQPjbO','type','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolveFolderId','resolvePathToResource','126ILTUKl','\x20\x20\x20Path:\x20','description','verbose','segment','Error:\x20Cannot\x20update\x20','\x27...','kind','Updating\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolved\x20relative\x20path\x20to:\x20','1682976aWskDj','Resolved\x20folder\x20ID:\x20'];a30_0x35fa=function(){return _0x22bf9d;};return a30_0x35fa();}function a30_0xd639(_0x29f9cd,_0x2a4f7e){_0x29f9cd=_0x29f9cd-0x8e;const _0x35fa2e=a30_0x35fa();let _0xd639ac=_0x35fa2e[_0x29f9cd];return _0xd639ac;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x5b91b0 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x181df4(0x8e)]=a30_0x181df4(0xba);[a30_0x181df4(0xa6)]='Update\x20existing\x20child\x20segment';async[a30_0x181df4(0x91)](_0x16ec6e){const _0x34c7f6=a30_0x181df4;console['error'](a30_0x5b91b0[_0x34c7f6(0xb1)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a30_0x5b91b0[_0x34c7f6(0xb1)](_0x34c7f6(0xad)));const {options:_0x25f3f6,args:_0xb18496,tdx:_0x4d936d}=_0x16ec6e,_0x5c721f=_0x25f3f6;if(_0xb18496[_0x34c7f6(0x94)]===0x0)return console[_0x34c7f6(0xb4)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x34c7f6(0xb4)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x34c7f6(0xb4)](_0x34c7f6(0xb6)),console['error'](_0x34c7f6(0xa1)),console['error'](_0x34c7f6(0x96)),0x1;const _0xc68ad2=_0xb18496[0x0],_0x3f5a78=_0x25f3f6['segmentPath'];let _0x3c7580=_0xc68ad2;_0x3f5a78&&!_0xc68ad2[_0x34c7f6(0xb8)]('/')&&(_0x3c7580=_0x3f5a78+'/'+_0xc68ad2,_0x5c721f[_0x34c7f6(0xa7)]&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xae)+_0x3c7580));const _0x33414f=await withSpinner(_0x34c7f6(0x9d)+_0x3c7580+_0x34c7f6(0xaa),()=>_0x4d936d['segment'][_0x34c7f6(0xa3)](_0x3c7580),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]}),_0x52bf2b=_0x33414f[_0x34c7f6(0x9e)];_0x5c721f[_0x34c7f6(0xa7)]&&console['error']('Resolved\x20type:\x20'+_0x52bf2b[_0x34c7f6(0xa0)]);if(_0x52bf2b['type']!==_0x34c7f6(0xa8))return console[_0x34c7f6(0xb4)](_0x34c7f6(0xa9)+_0x52bf2b[_0x34c7f6(0xa0)]+_0x34c7f6(0xbb)),console['error'](_0x34c7f6(0x9b)),0x1;if(!_0x52bf2b[_0x34c7f6(0x95)])throw new SDKError(ErrorCode[_0x34c7f6(0x98)],_0x34c7f6(0x8f));const _0x1bce85=_0x52bf2b[_0x34c7f6(0x99)],_0xb3893e=_0x52bf2b['segmentId'];_0x5c721f[_0x34c7f6(0xa7)]&&(console[_0x34c7f6(0xb4)](_0x34c7f6(0x9c)+_0x1bce85),console['error'](_0x34c7f6(0x92)+_0xb3893e));let _0x355846;if(_0x5c721f[_0x34c7f6(0x90)]){const _0x4e8799=_0x5c721f['folder'],_0x35489c=await withSpinner(_0x34c7f6(0xb9)+_0x4e8799+'\x27...',()=>_0x4d936d[_0x34c7f6(0xa8)][_0x34c7f6(0xa2)](_0x1bce85,_0x4e8799),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]});_0x355846=parseInt(_0x35489c[_0x34c7f6(0x9e)],0xa),_0x5c721f['verbose']&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xb0)+_0x355846);}const _0x5e955f=await loadJSONFromOptions(_0x5c721f['rule'],_0x5c721f['ruleFile']),_0x3ce591={'name':_0x5c721f['name'],'description':_0x5c721f[_0x34c7f6(0xa6)],'rule':_0x5e955f,'kind':_0x5c721f[_0x34c7f6(0xab)]!==undefined?parseInt(_0x5c721f[_0x34c7f6(0xab)],0xa):undefined,'segmentFolderId':_0x355846},_0x2f083c=await withSpinner(_0x34c7f6(0xac)+_0x52bf2b[_0x34c7f6(0x97)]+_0x34c7f6(0xaa),()=>_0x4d936d[_0x34c7f6(0xa8)]['updateSegmentById'](_0x1bce85,_0xb3893e,_0x3ce591),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]}),_0x4e0960=_0x2f083c[_0x34c7f6(0x9e)];return console[_0x34c7f6(0xb4)](_0x34c7f6(0xb5)+_0x4e0960['name']+'\x27'),_0x3c7580!==_0xc68ad2&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xa5)+_0x3c7580),await handleSDKOutput([_0x4e0960],_0x5c721f),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x12e030=a31_0x4a20;function a31_0x4a20(_0x1035c6,_0x2b9438){_0x1035c6=_0x1035c6-0x14c;const _0x3a68e6=a31_0x3a68();let _0x4a20d9=_0x3a68e6[_0x1035c6];return _0x4a20d9;}(function(_0x1b792d,_0x32f8e1){const _0x477c99=a31_0x4a20,_0x5f5d10=_0x1b792d();while(!![]){try{const _0x1c7d7b=-parseInt(_0x477c99(0x16e))/0x1*(-parseInt(_0x477c99(0x17a))/0x2)+parseInt(_0x477c99(0x170))/0x3*(-parseInt(_0x477c99(0x188))/0x4)+-parseInt(_0x477c99(0x157))/0x5+-parseInt(_0x477c99(0x15e))/0x6*(parseInt(_0x477c99(0x159))/0x7)+parseInt(_0x477c99(0x154))/0x8*(-parseInt(_0x477c99(0x166))/0x9)+parseInt(_0x477c99(0x181))/0xa*(-parseInt(_0x477c99(0x14e))/0xb)+parseInt(_0x477c99(0x16d))/0xc;if(_0x1c7d7b===_0x32f8e1)break;else _0x5f5d10['push'](_0x5f5d10['shift']());}catch(_0x4656cf){_0x5f5d10['push'](_0x5f5d10['shift']());}}}(a31_0x3a68,0x96eeb));import{existsSync,statSync}from'fs';import a31_0x502fa9 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a31_0x12e030(0x14f)]='segment:use';[a31_0x12e030(0x173)]=a31_0x12e030(0x184);async[a31_0x12e030(0x177)](_0x513f1e){const _0x1f0f31=a31_0x12e030,{options:_0x346a59,args:_0x1b86ef,tdx:_0x4f8030}=_0x513f1e;if(_0x1b86ef[_0x1f0f31(0x174)]===0x0)return console['error'](a31_0x502fa9[_0x1f0f31(0x17b)](_0x1f0f31(0x153))),console['error'](_0x1f0f31(0x161)),console[_0x1f0f31(0x16f)](_0x1f0f31(0x16b)),console[_0x1f0f31(0x16f)](_0x1f0f31(0x182)),console[_0x1f0f31(0x16f)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x1f0f31(0x16f)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x1f0f31(0x16f)](_0x1f0f31(0x172)),0x1;const _0x1082cc=_0x1b86ef[0x0],_0x20bc1f=_0x346a59[_0x1f0f31(0x150)];try{if(_0x1082cc==='/')return saveSessionContext({'segment_path':undefined},_0x20bc1f),console[_0x1f0f31(0x15f)](a31_0x502fa9['green'](_0x1f0f31(0x176))),0x0;if(existsSync(_0x1082cc)&&statSync(_0x1082cc)[_0x1f0f31(0x189)]()){let _0x9dd114;try{_0x9dd114=findTdxConfig(_0x1082cc);}catch{return console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x17b)](_0x1f0f31(0x15b)+_0x1082cc)),console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x15a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x3f1aea=_0x9dd114['config']['parent_segment'];return saveSessionContext({'segment_path':_0x3f1aea,'parent_segment':_0x3f1aea},_0x20bc1f),console[_0x1f0f31(0x15f)](a31_0x502fa9[_0x1f0f31(0x165)]('✔\x20Context\x20set\x20to:\x20'+a31_0x502fa9[_0x1f0f31(0x15a)](_0x3f1aea))),0x0;}const _0x462cce=_0x346a59['segmentPath'];let _0xd45a8e=_0x1082cc;const _0x167cc9=parsePath(_0x1082cc);if(!_0x167cc9[_0x1f0f31(0x152)]){if(!_0x462cce)return console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x17b)](_0x1f0f31(0x155))),console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x15a)](_0x1f0f31(0x183))),0x1;if(_0x1082cc==='..'){const _0x1d34e9=_0x462cce[_0x1f0f31(0x168)]('/')[_0x1f0f31(0x15c)](0x0,-0x1)[_0x1f0f31(0x167)]('/');_0xd45a8e=_0x1d34e9||'/';}else _0x1082cc==='.'?_0xd45a8e=_0x462cce:_0xd45a8e=_0x462cce+'/'+_0x1082cc;_0x346a59[_0x1f0f31(0x17f)]&&console[_0x1f0f31(0x16f)](_0x1f0f31(0x151)+_0xd45a8e);}if(_0xd45a8e==='/'||_0xd45a8e==='')return saveSessionContext({'segment_path':undefined},_0x20bc1f),console[_0x1f0f31(0x15f)](a31_0x502fa9['green'](_0x1f0f31(0x176))),0x0;_0xd45a8e=normalizePath(_0xd45a8e);const _0x49ec15=parsePath(_0xd45a8e)[_0x1f0f31(0x186)];if(_0x49ec15[_0x1f0f31(0x174)]===0x0)return saveSessionContext({'segment_path':undefined},_0x20bc1f),console['log'](a31_0x502fa9['green'](_0x1f0f31(0x176))),0x0;_0x346a59[_0x1f0f31(0x17f)]&&(console[_0x1f0f31(0x16f)](_0x1f0f31(0x17e)+_0x346a59['site']),console[_0x1f0f31(0x16f)](_0x1f0f31(0x175)+_0xd45a8e));const _0x2be9a4=await withSpinner(_0x1f0f31(0x180)+_0xd45a8e+_0x1f0f31(0x158),()=>_0x4f8030[_0x1f0f31(0x16c)]['resolvePathToResource'](_0xd45a8e),{'verbose':_0x346a59[_0x1f0f31(0x17f)]}),_0x441413=_0x2be9a4[_0x1f0f31(0x14c)];_0x346a59[_0x1f0f31(0x17f)]&&(console[_0x1f0f31(0x16f)](_0x1f0f31(0x156)+_0x441413[_0x1f0f31(0x160)]),console[_0x1f0f31(0x16f)](_0x1f0f31(0x171)+_0x441413[_0x1f0f31(0x16a)]),_0x441413[_0x1f0f31(0x162)]&&console[_0x1f0f31(0x16f)](_0x1f0f31(0x163)+_0x441413[_0x1f0f31(0x162)]));if(_0x441413[_0x1f0f31(0x160)]==='segment')return console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x17b)](_0x1f0f31(0x17c))),console[_0x1f0f31(0x16f)](_0x1f0f31(0x178)),console['error'](a31_0x502fa9[_0x1f0f31(0x15a)](_0x1f0f31(0x15d)+_0x441413['parentName']+(_0x441413[_0x1f0f31(0x179)]?'/'+_0x441413['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x441413[_0x1f0f31(0x164)],'parent_segment':_0x441413[_0x1f0f31(0x169)]},_0x20bc1f),console[_0x1f0f31(0x15f)](a31_0x502fa9[_0x1f0f31(0x165)](_0x1f0f31(0x187)+a31_0x502fa9[_0x1f0f31(0x15a)](_0x441413[_0x1f0f31(0x164)]))),_0x346a59[_0x1f0f31(0x17f)]&&(console[_0x1f0f31(0x16f)](a31_0x502fa9[_0x1f0f31(0x14d)](_0x1f0f31(0x17d))),console[_0x1f0f31(0x16f)](a31_0x502fa9['dim'](_0x1f0f31(0x185)))),0x0;}catch(_0x56c0a1){throw _0x56c0a1;}}}function a31_0x3a68(){const _0x54f9be=['Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Site:\x20','verbose','Resolving\x20path\x20\x27','10UqHdxG','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','segments','✔\x20Context\x20set\x20to:\x20','146460TIxQYx','isDirectory','data','dim','6906779gzMnvO','name','session','Resolved\x20relative\x20path\x20to:\x20','isAbsolute','Error:\x20Path\x20is\x20required\x0a','248kwrYSe','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Resolved\x20path\x20type:\x20','3357155dZRipX','\x27...','1607648cLFGsV','cyan','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','slice','Use:\x20tdx\x20segment\x20use\x20','18ILmQSt','log','type','Usage:\x20tdx\x20segment\x20use\x20<path>','folderId','Folder\x20ID:\x20','fullPath','green','139554AZarwp','join','split','parentName','parentId','Examples:','segment','35054556vgYaSs','1008149HAIeDk','error','69UFDElV','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','description','length','Target\x20path:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','execute','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','folderPath','2Gygqob','red','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'];a31_0x3a68=function(){return _0x54f9be;};return a31_0x3a68();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x2857e6=a32_0x5af8;function a32_0x5af8(_0x39844b,_0x585324){_0x39844b=_0x39844b-0x11b;const _0x33a663=a32_0x33a6();let _0x5af832=_0x33a663[_0x39844b];return _0x5af832;}(function(_0x592939,_0x4bbac4){const _0x346d61=a32_0x5af8,_0x1ddbc1=_0x592939();while(!![]){try{const _0x3cb0d1=-parseInt(_0x346d61(0x12b))/0x1*(-parseInt(_0x346d61(0x14e))/0x2)+-parseInt(_0x346d61(0x13e))/0x3+parseInt(_0x346d61(0x137))/0x4*(parseInt(_0x346d61(0x11f))/0x5)+parseInt(_0x346d61(0x136))/0x6*(-parseInt(_0x346d61(0x121))/0x7)+-parseInt(_0x346d61(0x11c))/0x8*(-parseInt(_0x346d61(0x120))/0x9)+parseInt(_0x346d61(0x143))/0xa+parseInt(_0x346d61(0x12d))/0xb;if(_0x3cb0d1===_0x4bbac4)break;else _0x1ddbc1['push'](_0x1ddbc1['shift']());}catch(_0x592ac7){_0x1ddbc1['push'](_0x1ddbc1['shift']());}}}(a32_0x33a6,0xb1c3e));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a32_0xf8b574 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a32_0x2857e6(0x14b)]=a32_0x2857e6(0x150);[a32_0x2857e6(0x14c)]=a32_0x2857e6(0x12c);async[a32_0x2857e6(0x147)](_0x32a0dd){const _0x5a9f9a=a32_0x2857e6,{options:_0x182350,args:_0x3d38de}=_0x32a0dd,_0x2ca795=_0x182350,_0x4f18a6=await resolveTarget({'arg':_0x3d38de[0x0],'contextParent':_0x182350['parentSegment'],'cwd':process[_0x5a9f9a(0x122)]()});if(!isSuccessfulResolution(_0x4f18a6))return _0x4f18a6['errorCode']===_0x5a9f9a(0x140)?(console[_0x5a9f9a(0x145)](a32_0xf8b574[_0x5a9f9a(0x13a)](_0x5a9f9a(0x13d))),console[_0x5a9f9a(0x145)](_0x5a9f9a(0x138)),console[_0x5a9f9a(0x145)](_0x5a9f9a(0x11d)),console[_0x5a9f9a(0x145)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a32_0xf8b574[_0x5a9f9a(0x144)]('Error:\x20'+_0x4f18a6[_0x5a9f9a(0x125)]+'\x0a')),_0x4f18a6[_0x5a9f9a(0x11b)]&&console[_0x5a9f9a(0x145)](a32_0xf8b574[_0x5a9f9a(0x149)](_0x4f18a6[_0x5a9f9a(0x11b)]))),0x1;const _0xb3db3d=_0x4f18a6[_0x5a9f9a(0x142)],_0x406c61=_0x4f18a6[_0x5a9f9a(0x12f)]===_0x5a9f9a(0x148)?_0x4f18a6[_0x5a9f9a(0x130)]:undefined;if(!_0x406c61&&!existsSync(_0xb3db3d))return console[_0x5a9f9a(0x145)](a32_0xf8b574[_0x5a9f9a(0x144)]('Error:\x20Directory\x20not\x20found:\x20'+_0xb3db3d+'\x0a')),0x1;let _0x459401;if(_0x406c61){if(!_0x406c61[_0x5a9f9a(0x13f)](_0x5a9f9a(0x12a))&&!_0x406c61['endsWith'](_0x5a9f9a(0x14a)))return console[_0x5a9f9a(0x145)](a32_0xf8b574['red'](_0x5a9f9a(0x129)+_0x406c61+'\x0a')),0x1;_0x459401=[_0x406c61];}else _0x459401=findYamlFiles(_0xb3db3d);if(_0x459401[_0x5a9f9a(0x135)]===0x0)return console['error'](a32_0xf8b574[_0x5a9f9a(0x144)](_0x5a9f9a(0x139)+_0xb3db3d+'\x0a')),0x1;const _0x1ddcbb=validateYamlFiles(_0x459401,_0xb3db3d),_0x3e144b=calculateSummary(_0x1ddcbb);for(const _0x29544e of _0x1ddcbb){if(!isValidationResult(_0x29544e))continue;const {relativePath:_0x4eabc1,source:_0xaa98fd,result:_0x4f4bbb,fileType:_0x3c500c}=_0x29544e,_0x22f12f=_0x3c500c;if(_0x4f4bbb['valid']&&_0x4f4bbb['warnings'][_0x5a9f9a(0x135)]===0x0)_0x2ca795[_0x5a9f9a(0x11e)]&&console[_0x5a9f9a(0x13c)](a32_0xf8b574['green']('✔\x20'+_0x4eabc1)+a32_0xf8b574['dim']('\x20('+_0x22f12f+')'));else _0x4f4bbb[_0x5a9f9a(0x134)]?(console[_0x5a9f9a(0x13c)](a32_0xf8b574[_0x5a9f9a(0x13a)]('⚠\x20'+_0x4eabc1)+a32_0xf8b574['dim']('\x20('+_0x22f12f+'):\x20'+_0x4f4bbb[_0x5a9f9a(0x13b)]['length']+_0x5a9f9a(0x141))),console[_0x5a9f9a(0x13c)](formatValidationResult(_0x4f4bbb,_0xaa98fd,_0x4eabc1))):(console[_0x5a9f9a(0x13c)](a32_0xf8b574['red']('✖\x20'+_0x4eabc1)+a32_0xf8b574['dim']('\x20('+_0x22f12f+'):\x20'+_0x4f4bbb['errors'][_0x5a9f9a(0x135)]+_0x5a9f9a(0x123))),console[_0x5a9f9a(0x13c)](formatValidationResult(_0x4f4bbb,_0xaa98fd,_0x4eabc1)));}return console['log'](''),_0x3e144b[_0x5a9f9a(0x14d)]?(console['log'](a32_0xf8b574[_0x5a9f9a(0x144)](_0x5a9f9a(0x124)+_0x3e144b[_0x5a9f9a(0x133)]+_0x5a9f9a(0x12e)+_0x3e144b['validCount']+_0x5a9f9a(0x126))),_0x3e144b[_0x5a9f9a(0x127)]>0x0&&console[_0x5a9f9a(0x13c)](a32_0xf8b574['yellow'](_0x3e144b[_0x5a9f9a(0x127)]+_0x5a9f9a(0x132))),0x1):(console[_0x5a9f9a(0x13c)](a32_0xf8b574[_0x5a9f9a(0x14f)](_0x5a9f9a(0x128)+_0x3e144b[_0x5a9f9a(0x146)]+_0x5a9f9a(0x131))),_0x3e144b[_0x5a9f9a(0x127)]>0x0&&console[_0x5a9f9a(0x13c)](a32_0xf8b574[_0x5a9f9a(0x13a)](_0x3e144b['warningCount']+'\x20warning(s)\x20found')),0x0);}}function a32_0x33a6(){const _0x3be50d=['cyan','.yaml','name','description','hasErrors','88xgVvBk','green','segment:validate','helpText','808DEtIzA','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','verbose','5IDzKRA','18999mqsaDz','1957669xjacbl','cwd','\x20error(s)','Validation\x20failed:\x20','message','\x20valid','warningCount','✔\x20All\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','.yml','8873XRnHwA','Validate\x20segment\x20and\x20journey\x20YAML\x20files','1427382iPGwOk','\x20file(s)\x20with\x20errors,\x20','type','filePath','\x20file(s)\x20valid','\x20warning(s)\x20found','invalidCount','valid','length','24TjIkvB','2938044iZHPJL','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','warnings','log','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','1642554CQjCnJ','endsWith','no_parent','\x20warning(s)','targetDir','9264160wtqUJr','red','error','validCount','execute','file'];a32_0x33a6=function(){return _0x3be50d;};return a32_0x33a6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a33_0x5b809c=a33_0x3150;function a33_0x12ba(){const _0x3a13f5=['includes','site','\x20top-level\x20items','Set\x20a\x20parent\x20segment\x20context\x20first:','Folder\x20ID:\x20','data','\x20segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','resolvePathToResource','listJourneysFromParentSegment','615968YlZYDr','\x5c$&','781602JeFQCJ','length','localeCompare','\x27...','\x20folder','cause','Parent\x20ID:\x20','test','✔\x20Built\x20tree\x20with\x20','/e/','folderId','jsonl','Folder/pattern\x20arg:\x20','listRecursive','dim','replace',',\x20and\x20','24rPqAih','journeyBundleName','listWithPattern','filter','parentId','535768uoJHuA','web','sort','name','recursive','189725izdfZL','maxDepth','all','Listing\x20folders,\x20segments,\x20and\x20journeys...','44dntuZA','1163491FpcALW','Recursive\x20mode:\x20enabled','27YIDBsl','listUnified','json','3128280TVCwfz','4419990qWbXoV','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Resolving\x20parent\x20segment\x20\x27','/app/ps/','(not\x20set)','description','\x20journey','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Error:\x20','segment','format','error','folder','\x20\x20Cause:\x20','message','map','\x20matching\x20\x27','log','journey','✔\x20Found\x20','(empty)','verbose'];a33_0x12ba=function(){return _0x3a13f5;};return a33_0x12ba();}(function(_0x4e6de8,_0x97eb2a){const _0x5cf563=a33_0x3150,_0x34ee3b=_0x4e6de8();while(!![]){try{const _0x5e64f2=-parseInt(_0x5cf563(0x95))/0x1+-parseInt(_0x5cf563(0xad))/0x2+parseInt(_0x5cf563(0x97))/0x3+-parseInt(_0x5cf563(0xb6))/0x4*(parseInt(_0x5cf563(0xb2))/0x5)+parseInt(_0x5cf563(0xbc))/0x6+parseInt(_0x5cf563(0xb7))/0x7*(-parseInt(_0x5cf563(0xa8))/0x8)+parseInt(_0x5cf563(0xb9))/0x9*(parseInt(_0x5cf563(0xbd))/0xa);if(_0x5e64f2===_0x97eb2a)break;else _0x34ee3b['push'](_0x34ee3b['shift']());}catch(_0x3fde37){_0x34ee3b['push'](_0x34ee3b['shift']());}}}(a33_0x12ba,0x4b339));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x3150(_0x34d3e6,_0x5cc319){_0x34d3e6=_0x34d3e6-0x94;const _0x12ba76=a33_0x12ba();let _0x3150f6=_0x12ba76[_0x34d3e6];return _0x3150f6;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a33_0x48f039 from'chalk';export class SegmentsCommand extends BaseCommand{[a33_0x5b809c(0xb0)]='segments';[a33_0x5b809c(0xc2)]='List\x20folders\x20and\x20child\x20segments';async['execute'](_0x524da1){const _0x68df35=a33_0x5b809c,{options:_0x1bd13f,args:_0x678bb2}=_0x524da1,_0x425582=_0x1bd13f[_0x68df35(0xb1)],_0xf700ef=_0x678bb2[0x0];try{const _0x538c6e=_0x1bd13f['parentSegment'];_0x1bd13f[_0x68df35(0xd2)]&&(console[_0x68df35(0xc8)]('Site:\x20'+_0x1bd13f[_0x68df35(0xd4)]),console[_0x68df35(0xc8)]('Parent\x20segment\x20context:\x20'+(_0x538c6e||_0x68df35(0xc1))),_0xf700ef&&console[_0x68df35(0xc8)](_0x68df35(0xa3)+_0xf700ef),_0x425582&&console['error'](_0x68df35(0xb8)));if(!_0x538c6e)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x68df35(0xc8)](_0x68df35(0xd6)),console[_0x68df35(0xc8)](_0x68df35(0xda)),console[_0x68df35(0xc8)](_0x68df35(0xc4)),console['error'](''),console['error'](_0x68df35(0xbe)),0x1;const _0xcd8366=_0xf700ef&&(_0xf700ef[_0x68df35(0xd3)]('*')||_0xf700ef[_0x68df35(0xd3)]('?'));if(_0xcd8366)return await this[_0x68df35(0xaa)](_0x524da1,_0x538c6e,_0xf700ef);const _0xc0665f=_0xf700ef?_0x538c6e+'/'+_0xf700ef:_0x538c6e;return _0x425582?await this[_0x68df35(0xa4)](_0x524da1,_0xc0665f):await this[_0x68df35(0xba)](_0x524da1,_0xc0665f);}catch(_0x8d6aac){if(_0x8d6aac instanceof SDKError)return console[_0x68df35(0xc8)](_0x68df35(0xc5)+_0x8d6aac[_0x68df35(0xcb)]),_0x8d6aac['cause']&&console[_0x68df35(0xc8)](_0x68df35(0xca)+_0x8d6aac[_0x68df35(0x9c)]),0x1;throw _0x8d6aac;}}async['listWithPattern'](_0x4c78dc,_0x3489fd,_0x3f98c1){const _0x367bbe=a33_0x5b809c,{options:_0x353baf,tdx:_0x156ffc}=_0x4c78dc,_0x1f509c=_0x353baf[_0x367bbe(0xae)],_0x1e9206=await withSpinner(_0x367bbe(0xbf)+_0x3489fd+_0x367bbe(0x9a),()=>_0x156ffc[_0x367bbe(0xc6)][_0x367bbe(0xdb)](_0x3489fd),{'verbose':_0x353baf[_0x367bbe(0xd2)]}),_0x2aaf34=_0x1e9206[_0x367bbe(0xd8)],_0x7b90b1=await withSpinner(_0x367bbe(0xb5),()=>Promise[_0x367bbe(0xb4)]([_0x156ffc[_0x367bbe(0xc6)][_0x367bbe(0xba)](_0x2aaf34[_0x367bbe(0xac)],_0x2aaf34[_0x367bbe(0xa1)]),_0x156ffc[_0x367bbe(0xcf)]['listJourneysFromParentSegment'](_0x2aaf34[_0x367bbe(0xac)])]),{'verbose':_0x353baf[_0x367bbe(0xd2)]}),[_0x34325f,_0x1a1eff]=_0x7b90b1['data'],{folders:_0xd9ce00,segments:_0xd87cfd}=_0x34325f,_0x32165f=_0x3f98c1[_0x367bbe(0xa6)](/[.+^${}()|[\]\\]/g,_0x367bbe(0x96))[_0x367bbe(0xa6)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x425dcb=new RegExp('^'+_0x32165f+'$','i'),_0x24c61b=_0xd9ce00[_0x367bbe(0xab)](_0x2af258=>_0x425dcb[_0x367bbe(0x9e)](_0x2af258['name'])),_0x5dd864=_0xd87cfd[_0x367bbe(0xab)](_0x25797e=>_0x425dcb[_0x367bbe(0x9e)](_0x25797e[_0x367bbe(0xb0)])),_0x3385ab=_0x1a1eff[_0x367bbe(0xab)](_0x582b0f=>_0x425dcb[_0x367bbe(0x9e)](_0x582b0f[_0x367bbe(0xa9)])),_0x550c5a=_0x24c61b[_0x367bbe(0x98)]+_0x5dd864[_0x367bbe(0x98)]+_0x3385ab[_0x367bbe(0x98)];console[_0x367bbe(0xc8)](_0x367bbe(0xd0)+_0x24c61b[_0x367bbe(0x98)]+_0x367bbe(0x9b)+(_0x24c61b['length']!==0x1?'s':'')+',\x20'+_0x5dd864['length']+_0x367bbe(0xd9)+(_0x5dd864[_0x367bbe(0x98)]!==0x1?'s':'')+_0x367bbe(0xa7)+_0x3385ab[_0x367bbe(0x98)]+'\x20journey'+(_0x3385ab[_0x367bbe(0x98)]!==0x1?'s':'')+_0x367bbe(0xcd)+_0x3f98c1+'\x27');const _0x2c35b8=_0x2fb617=>{const _0x17e65a=_0x367bbe;return getConsoleNextUrl(_0x353baf['site'],'/app/ps/'+_0x2aaf34[_0x17e65a(0xac)]+_0x17e65a(0xa0)+_0x2fb617);},_0x1e478b=_0x353baf['format']==='json'||_0x353baf[_0x367bbe(0xc7)]==='jsonl';if(_0x1e478b){const _0x1020a0=[..._0x24c61b[_0x367bbe(0xcc)](_0x27b19e=>({..._0x27b19e,'type':'folder'})),..._0x5dd864[_0x367bbe(0xcc)](_0x5d5d97=>({..._0x5d5d97,'type':_0x367bbe(0xc6),'url':_0x2c35b8(_0x5d5d97['id'])})),..._0x3385ab[_0x367bbe(0xcc)](_0x435bd8=>({..._0x435bd8,'name':_0x435bd8[_0x367bbe(0xa9)],'type':_0x367bbe(0xcf)}))][_0x367bbe(0xaf)]((_0x1cfe7d,_0x12cf10)=>_0x1cfe7d[_0x367bbe(0xb0)][_0x367bbe(0x99)](_0x12cf10[_0x367bbe(0xb0)]));await handleSDKOutput(_0x1020a0,_0x353baf);}else{if(_0x550c5a===0x0)console['log']('No\x20items\x20match\x20pattern:\x20'+_0x3f98c1);else{console[_0x367bbe(0xce)](a33_0x48f039[_0x367bbe(0xa5)]('['+_0x3489fd+']\x20matching\x20\x27'+_0x3f98c1+'\x27'));const _0x54017d=formatFlatList(_0x24c61b,_0x5dd864,{'showMetadata':!![],'showUrl':_0x1f509c,'getSegmentUrl':_0x2c35b8},_0x3385ab);console[_0x367bbe(0xce)](_0x54017d);}}return 0x0;}async[a33_0x5b809c(0xba)](_0x4434fe,_0x331142){const _0x49fa59=a33_0x5b809c,{options:_0x4bcdcd,tdx:_0x4e5097}=_0x4434fe,_0x26c353=_0x4bcdcd[_0x49fa59(0xae)],_0x2b156d=await withSpinner('Resolving\x20path\x20\x27'+_0x331142+_0x49fa59(0x9a),()=>_0x4e5097['segment']['resolvePathToResource'](_0x331142),{'verbose':_0x4bcdcd[_0x49fa59(0xd2)]}),_0x54f9f3=_0x2b156d[_0x49fa59(0xd8)];_0x4bcdcd['verbose']&&(console[_0x49fa59(0xc8)]('Parent\x20ID:\x20'+_0x54f9f3[_0x49fa59(0xac)]),_0x54f9f3['folderId']&&console[_0x49fa59(0xc8)]('Folder\x20ID:\x20'+_0x54f9f3[_0x49fa59(0xa1)]));const _0x702e1c=await withSpinner(_0x49fa59(0xb5),()=>Promise[_0x49fa59(0xb4)]([_0x4e5097[_0x49fa59(0xc6)][_0x49fa59(0xba)](_0x54f9f3[_0x49fa59(0xac)],_0x54f9f3[_0x49fa59(0xa1)]),_0x4e5097['journey'][_0x49fa59(0x94)](_0x54f9f3['parentId'])]),{'verbose':_0x4bcdcd['verbose']}),[_0x2d59b3,_0x53b15f]=_0x702e1c['data'],{folders:_0xbeca7a,segments:_0x4d328a}=_0x2d59b3,_0x554ad5=_0xbeca7a[_0x49fa59(0x98)]+_0x4d328a[_0x49fa59(0x98)]+_0x53b15f[_0x49fa59(0x98)];console['error'](_0x49fa59(0xd0)+_0xbeca7a[_0x49fa59(0x98)]+_0x49fa59(0x9b)+(_0xbeca7a[_0x49fa59(0x98)]!==0x1?'s':'')+',\x20'+_0x4d328a['length']+'\x20segment'+(_0x4d328a[_0x49fa59(0x98)]!==0x1?'s':'')+_0x49fa59(0xa7)+_0x53b15f[_0x49fa59(0x98)]+_0x49fa59(0xc3)+(_0x53b15f[_0x49fa59(0x98)]!==0x1?'s':''));const _0x12e1a0=_0x132ece=>{const _0x232940=_0x49fa59;return getConsoleNextUrl(_0x4bcdcd[_0x232940(0xd4)],_0x232940(0xc0)+_0x54f9f3[_0x232940(0xac)]+'/e/'+_0x132ece);},_0x268b38=_0x550169=>{const _0x4d0878=_0x49fa59;return getConsoleNextUrl(_0x4bcdcd[_0x4d0878(0xd4)],'/app/ps/'+_0x54f9f3[_0x4d0878(0xac)]+_0x4d0878(0xa0)+_0x550169+'/j/da');},_0x1cc8a9=_0x4bcdcd[_0x49fa59(0xc7)]===_0x49fa59(0xbb)||_0x4bcdcd[_0x49fa59(0xc7)]===_0x49fa59(0xa2);if(_0x1cc8a9){const _0x4a4112=[..._0xbeca7a['map'](_0x5e343e=>({..._0x5e343e,'type':_0x49fa59(0xc9)})),..._0x4d328a[_0x49fa59(0xcc)](_0x4e3e09=>({..._0x4e3e09,'type':'segment','url':_0x12e1a0(_0x4e3e09['id'])})),..._0x53b15f[_0x49fa59(0xcc)](_0x2d3bb0=>({..._0x2d3bb0,'name':_0x2d3bb0[_0x49fa59(0xa9)],'type':_0x49fa59(0xcf),'url':_0x268b38(_0x2d3bb0['id'])}))]['sort']((_0x5a886f,_0x5bed66)=>_0x5a886f[_0x49fa59(0xb0)][_0x49fa59(0x99)](_0x5bed66[_0x49fa59(0xb0)]));await handleSDKOutput(_0x4a4112,_0x4bcdcd);}else{if(_0x554ad5===0x0)console[_0x49fa59(0xce)](a33_0x48f039['dim']('['+_0x331142+']')),console[_0x49fa59(0xce)](_0x49fa59(0xd1));else{console[_0x49fa59(0xce)](a33_0x48f039[_0x49fa59(0xa5)]('['+_0x331142+']'));const _0x4d8278=formatFlatList(_0xbeca7a,_0x4d328a,{'showMetadata':!![],'showUrl':_0x26c353,'getSegmentUrl':_0x12e1a0,'getJourneyUrl':_0x268b38},_0x53b15f);console[_0x49fa59(0xce)](_0x4d8278);}}return 0x0;}async[a33_0x5b809c(0xa4)](_0x414264,_0x6db902){const _0x518a88=a33_0x5b809c,{options:_0x158705,tdx:_0x51b241}=_0x414264,_0x1d9c6c=_0x158705[_0x518a88(0xae)],_0x41185e=await withSpinner('Resolving\x20path\x20\x27'+_0x6db902+_0x518a88(0x9a),()=>_0x51b241[_0x518a88(0xc6)][_0x518a88(0xdb)](_0x6db902),{'verbose':_0x158705[_0x518a88(0xd2)]}),_0x506eea=_0x41185e[_0x518a88(0xd8)];_0x158705[_0x518a88(0xd2)]&&(console['error'](_0x518a88(0x9d)+_0x506eea[_0x518a88(0xac)]),_0x506eea['folderId']&&console[_0x518a88(0xc8)](_0x518a88(0xd7)+_0x506eea['folderId']));const _0x8b314c=_0x158705[_0x518a88(0xb3)]||0xa,_0x2bb8a1=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x51b241[_0x518a88(0xc6)][_0x518a88(0xa4)](_0x506eea[_0x518a88(0xac)],_0x506eea['folderId'],0x0,_0x8b314c),{'verbose':_0x158705['verbose']}),_0x5bcb9f=_0x2bb8a1['data'];console['error'](_0x518a88(0x9f)+_0x5bcb9f[_0x518a88(0x98)]+_0x518a88(0xd5));const _0x1bbbae=_0x2c3314=>{const _0x2a8152=_0x518a88;return getConsoleNextUrl(_0x158705[_0x2a8152(0xd4)],_0x2a8152(0xc0)+_0x506eea[_0x2a8152(0xac)]+_0x2a8152(0xa0)+_0x2c3314);};if(_0x158705[_0x518a88(0xc7)]===_0x518a88(0xbb)||_0x158705['format']==='jsonl')await handleSDKOutput(_0x5bcb9f,_0x158705);else{console[_0x518a88(0xce)](a33_0x48f039[_0x518a88(0xa5)]('['+_0x6db902+']'));const _0x397194=formatTree(_0x5bcb9f,{'showMetadata':!![],'showUrl':_0x1d9c6c,'getSegmentUrl':_0x1bbbae});console[_0x518a88(0xce)](_0x397194);}return 0x0;}}
|
|
1
|
+
const a33_0xd12cc9=a33_0x46f4;(function(_0x1487ee,_0x35fe42){const _0x363bdc=a33_0x46f4,_0x822103=_0x1487ee();while(!![]){try{const _0x117934=-parseInt(_0x363bdc(0x171))/0x1*(-parseInt(_0x363bdc(0x139))/0x2)+-parseInt(_0x363bdc(0x132))/0x3+-parseInt(_0x363bdc(0x14a))/0x4+-parseInt(_0x363bdc(0x130))/0x5*(-parseInt(_0x363bdc(0x13e))/0x6)+parseInt(_0x363bdc(0x137))/0x7*(parseInt(_0x363bdc(0x153))/0x8)+parseInt(_0x363bdc(0x163))/0x9+-parseInt(_0x363bdc(0x15d))/0xa;if(_0x117934===_0x35fe42)break;else _0x822103['push'](_0x822103['shift']());}catch(_0x493656){_0x822103['push'](_0x822103['shift']());}}}(a33_0x367c,0xe50c6));import{BaseCommand}from'./command.js';function a33_0x46f4(_0x879ee5,_0x3e4116){_0x879ee5=_0x879ee5-0x12a;const _0x367c75=a33_0x367c();let _0x46f453=_0x367c75[_0x879ee5];return _0x46f453;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a33_0x5888bd from'chalk';export class SegmentsCommand extends BaseCommand{[a33_0xd12cc9(0x165)]=a33_0xd12cc9(0x12b);['description']=a33_0xd12cc9(0x140);async[a33_0xd12cc9(0x16c)](_0x260bde){const _0x56274f=a33_0xd12cc9,{options:_0x4a8505,args:_0xf75e17}=_0x260bde,_0x3bb464=_0x4a8505[_0x56274f(0x136)],_0x343707=_0xf75e17[0x0];try{const _0x19b9f8=_0x4a8505['parentSegment'];_0x4a8505[_0x56274f(0x157)]&&(console[_0x56274f(0x170)](_0x56274f(0x146)+_0x4a8505[_0x56274f(0x12d)]),console[_0x56274f(0x170)](_0x56274f(0x147)+(_0x19b9f8||_0x56274f(0x149))),_0x343707&&console[_0x56274f(0x170)](_0x56274f(0x135)+_0x343707),_0x3bb464&&console[_0x56274f(0x170)](_0x56274f(0x14b)));if(!_0x19b9f8)return console[_0x56274f(0x170)](_0x56274f(0x155)),console['error'](''),console[_0x56274f(0x170)](_0x56274f(0x13d)),console[_0x56274f(0x170)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x56274f(0x170)](_0x56274f(0x12c)),console[_0x56274f(0x170)](''),console['error'](_0x56274f(0x150)),0x1;const _0xa55c3e=_0x343707&&(_0x343707['includes']('*')||_0x343707[_0x56274f(0x159)]('?'));if(_0xa55c3e)return await this['listWithPattern'](_0x260bde,_0x19b9f8,_0x343707);const _0x349a0c=_0x343707?_0x19b9f8+'/'+_0x343707:_0x19b9f8;return _0x3bb464?await this[_0x56274f(0x174)](_0x260bde,_0x349a0c):await this[_0x56274f(0x14d)](_0x260bde,_0x349a0c);}catch(_0x2347e7){if(_0x2347e7 instanceof SDKError)return console[_0x56274f(0x170)](_0x56274f(0x12e)+_0x2347e7[_0x56274f(0x131)]),_0x2347e7[_0x56274f(0x148)]&&console[_0x56274f(0x170)](_0x56274f(0x14e)+_0x2347e7['cause']),0x1;throw _0x2347e7;}}async[a33_0xd12cc9(0x14c)](_0x55b69e,_0x2dd5fb,_0x371be6){const _0xa057ed=a33_0xd12cc9,{options:_0x28f8fc,tdx:_0x250339}=_0x55b69e,_0x5bc3a2=_0x28f8fc[_0xa057ed(0x134)],_0x4d5cce=await withSpinner(_0xa057ed(0x154)+_0x2dd5fb+_0xa057ed(0x144),()=>_0x250339[_0xa057ed(0x152)][_0xa057ed(0x175)](_0x2dd5fb),{'verbose':_0x28f8fc[_0xa057ed(0x157)]}),_0x5eb181=_0x4d5cce[_0xa057ed(0x12a)],_0x29f19b=await withSpinner(_0xa057ed(0x16e),()=>Promise[_0xa057ed(0x167)]([_0x250339['segment'][_0xa057ed(0x14d)](_0x5eb181[_0xa057ed(0x145)],_0x5eb181[_0xa057ed(0x13a)]),_0x250339[_0xa057ed(0x13b)][_0xa057ed(0x13c)](_0x5eb181[_0xa057ed(0x145)])]),{'verbose':_0x28f8fc['verbose']}),[_0xc6dd0,_0x1749d8]=_0x29f19b[_0xa057ed(0x12a)],{folders:_0x5c9b1c,segments:_0x1f4587}=_0xc6dd0,_0x2f1814=_0x371be6[_0xa057ed(0x172)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0xeaa95c=new RegExp('^'+_0x2f1814+'$','i'),_0x139340=_0x5c9b1c['filter'](_0xdd93d1=>_0xeaa95c['test'](_0xdd93d1['name'])),_0x3b9421=_0x1f4587[_0xa057ed(0x15b)](_0x180a80=>_0xeaa95c[_0xa057ed(0x15e)](_0x180a80[_0xa057ed(0x165)])),_0x6edd62=_0x1749d8['filter'](_0x477c9d=>_0xeaa95c[_0xa057ed(0x15e)](_0x477c9d[_0xa057ed(0x161)])),_0x16c294=_0x139340['length']+_0x3b9421[_0xa057ed(0x151)]+_0x6edd62[_0xa057ed(0x151)];console[_0xa057ed(0x170)](_0xa057ed(0x173)+_0x139340[_0xa057ed(0x151)]+_0xa057ed(0x15f)+(_0x139340[_0xa057ed(0x151)]!==0x1?'s':'')+',\x20'+_0x3b9421['length']+_0xa057ed(0x162)+(_0x3b9421[_0xa057ed(0x151)]!==0x1?'s':'')+',\x20and\x20'+_0x6edd62[_0xa057ed(0x151)]+'\x20journey'+(_0x6edd62['length']!==0x1?'s':'')+_0xa057ed(0x143)+_0x371be6+'\x27');const _0x2829d3=_0x5585b3=>{const _0x4a59bc=_0xa057ed;return getConsoleNextUrl(_0x28f8fc['site'],'/app/ps/'+_0x5eb181[_0x4a59bc(0x145)]+_0x4a59bc(0x141)+_0x5585b3);},_0x1ecb1b=_0x28f8fc['format']===_0xa057ed(0x169)||_0x28f8fc[_0xa057ed(0x15c)]===_0xa057ed(0x164);if(_0x1ecb1b){const _0x5d6f37=[..._0x139340['map'](_0x23a3f3=>({..._0x23a3f3,'type':_0xa057ed(0x156)})),..._0x3b9421[_0xa057ed(0x13f)](_0x5e50c0=>({..._0x5e50c0,'type':_0xa057ed(0x152),'url':_0x2829d3(_0x5e50c0['id'])})),..._0x6edd62[_0xa057ed(0x13f)](_0x4803a6=>({..._0x4803a6,'name':_0x4803a6[_0xa057ed(0x161)],'type':_0xa057ed(0x13b)}))]['sort']((_0x5f33d3,_0x47b11b)=>_0x5f33d3[_0xa057ed(0x165)][_0xa057ed(0x160)](_0x47b11b[_0xa057ed(0x165)]));await handleSDKOutput(_0x5d6f37,_0x28f8fc);}else{if(_0x16c294===0x0)console['log'](_0xa057ed(0x176)+_0x371be6);else{console[_0xa057ed(0x16f)](a33_0x5888bd[_0xa057ed(0x16b)]('['+_0x2dd5fb+_0xa057ed(0x16a)+_0x371be6+'\x27'));const _0x3e36f3=formatFlatList(_0x139340,_0x3b9421,{'showMetadata':!![],'showUrl':_0x5bc3a2,'getSegmentUrl':_0x2829d3},_0x6edd62);console['log'](_0x3e36f3);}}return 0x0;}async['listUnified'](_0x384b64,_0x3f581d){const _0x1aced5=a33_0xd12cc9,{options:_0x1ddeaf,tdx:_0x256c7b}=_0x384b64,_0xb22729=_0x1ddeaf['web'],_0x286d00=await withSpinner(_0x1aced5(0x168)+_0x3f581d+_0x1aced5(0x144),()=>_0x256c7b['segment'][_0x1aced5(0x175)](_0x3f581d),{'verbose':_0x1ddeaf[_0x1aced5(0x157)]}),_0x1e4784=_0x286d00['data'];_0x1ddeaf[_0x1aced5(0x157)]&&(console['error']('Parent\x20ID:\x20'+_0x1e4784['parentId']),_0x1e4784['folderId']&&console[_0x1aced5(0x170)](_0x1aced5(0x12f)+_0x1e4784[_0x1aced5(0x13a)]));const _0x114fa6=await withSpinner(_0x1aced5(0x16e),()=>Promise[_0x1aced5(0x167)]([_0x256c7b['segment'][_0x1aced5(0x14d)](_0x1e4784[_0x1aced5(0x145)],_0x1e4784[_0x1aced5(0x13a)]),_0x256c7b['journey']['listJourneysFromParentSegment'](_0x1e4784[_0x1aced5(0x145)])]),{'verbose':_0x1ddeaf[_0x1aced5(0x157)]}),[_0x4ead1d,_0x3c6030]=_0x114fa6['data'],{folders:_0x4fdbb4,segments:_0x1db00f}=_0x4ead1d,_0x188eb6=_0x4fdbb4[_0x1aced5(0x151)]+_0x1db00f[_0x1aced5(0x151)]+_0x3c6030['length'];console[_0x1aced5(0x170)](_0x1aced5(0x173)+_0x4fdbb4[_0x1aced5(0x151)]+'\x20folder'+(_0x4fdbb4[_0x1aced5(0x151)]!==0x1?'s':'')+',\x20'+_0x1db00f[_0x1aced5(0x151)]+_0x1aced5(0x162)+(_0x1db00f[_0x1aced5(0x151)]!==0x1?'s':'')+_0x1aced5(0x138)+_0x3c6030[_0x1aced5(0x151)]+'\x20journey'+(_0x3c6030[_0x1aced5(0x151)]!==0x1?'s':''));const _0x342ce0=_0x43ef5=>{const _0x2c79c3=_0x1aced5;return getConsoleNextUrl(_0x1ddeaf[_0x2c79c3(0x12d)],'/app/ps/'+_0x1e4784[_0x2c79c3(0x145)]+_0x2c79c3(0x141)+_0x43ef5);},_0x3df91b=_0x13849c=>{const _0x1895f8=_0x1aced5;return getConsoleNextUrl(_0x1ddeaf['site'],'/app/ps/'+_0x1e4784[_0x1895f8(0x145)]+_0x1895f8(0x141)+_0x13849c+'/j/da');},_0x2f9f56=_0x1ddeaf[_0x1aced5(0x15c)]===_0x1aced5(0x169)||_0x1ddeaf[_0x1aced5(0x15c)]===_0x1aced5(0x164);if(_0x2f9f56){const _0x535061=[..._0x4fdbb4['map'](_0x229c2e=>({..._0x229c2e,'type':_0x1aced5(0x156)})),..._0x1db00f[_0x1aced5(0x13f)](_0x1f2526=>({..._0x1f2526,'type':'segment','url':_0x342ce0(_0x1f2526['id'])})),..._0x3c6030[_0x1aced5(0x13f)](_0x3a4639=>({..._0x3a4639,'name':_0x3a4639[_0x1aced5(0x161)],'type':_0x1aced5(0x13b),'url':_0x3df91b(_0x3a4639['id'])}))][_0x1aced5(0x15a)]((_0x9d5b79,_0x53c789)=>_0x9d5b79['name'][_0x1aced5(0x160)](_0x53c789[_0x1aced5(0x165)]));await handleSDKOutput(_0x535061,_0x1ddeaf);}else{if(_0x188eb6===0x0)console[_0x1aced5(0x16f)](a33_0x5888bd[_0x1aced5(0x16b)]('['+_0x3f581d+']')),console[_0x1aced5(0x16f)](_0x1aced5(0x142));else{console['log'](a33_0x5888bd[_0x1aced5(0x16b)]('['+_0x3f581d+']'));const _0x2ebc5f=formatFlatList(_0x4fdbb4,_0x1db00f,{'showMetadata':!![],'showUrl':_0xb22729,'getSegmentUrl':_0x342ce0,'getJourneyUrl':_0x3df91b},_0x3c6030);console[_0x1aced5(0x16f)](_0x2ebc5f);}}return 0x0;}async[a33_0xd12cc9(0x174)](_0x13f2c4,_0x41e897){const _0x12b4dc=a33_0xd12cc9,{options:_0x252b33,tdx:_0x12c73b}=_0x13f2c4,_0x2a9d50=_0x252b33[_0x12b4dc(0x134)],_0x52f3f6=await withSpinner(_0x12b4dc(0x168)+_0x41e897+_0x12b4dc(0x144),()=>_0x12c73b[_0x12b4dc(0x152)][_0x12b4dc(0x175)](_0x41e897),{'verbose':_0x252b33[_0x12b4dc(0x157)]}),_0x34b3d8=_0x52f3f6['data'];_0x252b33[_0x12b4dc(0x157)]&&(console[_0x12b4dc(0x170)](_0x12b4dc(0x158)+_0x34b3d8['parentId']),_0x34b3d8[_0x12b4dc(0x13a)]&&console[_0x12b4dc(0x170)](_0x12b4dc(0x12f)+_0x34b3d8[_0x12b4dc(0x13a)]));const _0x28e870=_0x252b33[_0x12b4dc(0x14f)]||0xa,_0x243671=await withSpinner(_0x12b4dc(0x166),()=>_0x12c73b[_0x12b4dc(0x152)][_0x12b4dc(0x174)](_0x34b3d8['parentId'],_0x34b3d8['folderId'],0x0,_0x28e870),{'verbose':_0x252b33[_0x12b4dc(0x157)]}),_0x38d737=_0x243671[_0x12b4dc(0x12a)];console['error'](_0x12b4dc(0x16d)+_0x38d737[_0x12b4dc(0x151)]+'\x20top-level\x20items');const _0x2d08cf=_0x317b83=>{const _0x3a5082=_0x12b4dc;return getConsoleNextUrl(_0x252b33[_0x3a5082(0x12d)],_0x3a5082(0x133)+_0x34b3d8[_0x3a5082(0x145)]+_0x3a5082(0x141)+_0x317b83);};if(_0x252b33['format']===_0x12b4dc(0x169)||_0x252b33[_0x12b4dc(0x15c)]===_0x12b4dc(0x164))await handleSDKOutput(_0x38d737,_0x252b33);else{console[_0x12b4dc(0x16f)](a33_0x5888bd['dim']('['+_0x41e897+']'));const _0x320165=formatTree(_0x38d737,{'showMetadata':!![],'showUrl':_0x2a9d50,'getSegmentUrl':_0x2d08cf});console[_0x12b4dc(0x16f)](_0x320165);}return 0x0;}}function a33_0x367c(){const _0x3d31fc=['37868590pxRIfl','test','\x20folder','localeCompare','journeyBundleName','\x20segment','7923258tQuDsg','jsonl','name','Building\x20hierarchy\x20tree...','all','Resolving\x20path\x20\x27','json',']\x20matching\x20\x27','dim','execute','✔\x20Built\x20tree\x20with\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','log','error','759CbXPeV','replace','✔\x20Found\x20','listRecursive','resolvePathToResource','No\x20items\x20match\x20pattern:\x20','data','segments','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','site','Error:\x20','Folder\x20ID:\x20','3760raIOOD','message','833337uVAGwk','/app/ps/','web','Folder/pattern\x20arg:\x20','recursive','901222uUkedG',',\x20and\x20','4210NrWnjA','folderId','journey','listJourneysFromParentSegment','Set\x20a\x20parent\x20segment\x20context\x20first:','9876eCVjnC','map','List\x20folders\x20and\x20child\x20segments','/e/','(empty)','\x20matching\x20\x27','\x27...','parentId','Site:\x20','Parent\x20segment\x20context:\x20','cause','(not\x20set)','2061892dvbGzr','Recursive\x20mode:\x20enabled','listWithPattern','listUnified','\x20\x20Cause:\x20','maxDepth','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','length','segment','112UQQRaC','Resolving\x20parent\x20segment\x20\x27','Error:\x20No\x20parent\x20segment\x20context\x20set.','folder','verbose','Parent\x20ID:\x20','includes','sort','filter','format'];a33_0x367c=function(){return _0x3d31fc;};return a33_0x367c();}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x177cc9=a34_0x31af;(function(_0x21f336,_0x2c26f5){const _0x646671=a34_0x31af,_0x5f151e=_0x21f336();while(!![]){try{const _0x33332c=parseInt(_0x646671(0x197))/0x1*(parseInt(_0x646671(0x187))/0x2)+parseInt(_0x646671(0x19c))/0x3*(-parseInt(_0x646671(0x1ad))/0x4)+-parseInt(_0x646671(0x19f))/0x5*(parseInt(_0x646671(0x1ab))/0x6)+-parseInt(_0x646671(0x198))/0x7*(-parseInt(_0x646671(0x191))/0x8)+parseInt(_0x646671(0x1ae))/0x9*(-parseInt(_0x646671(0x18c))/0xa)+parseInt(_0x646671(0x184))/0xb*(parseInt(_0x646671(0x193))/0xc)+-parseInt(_0x646671(0x194))/0xd*(parseInt(_0x646671(0x189))/0xe);if(_0x33332c===_0x2c26f5)break;else _0x5f151e['push'](_0x5f151e['shift']());}catch(_0x15c0d3){_0x5f151e['push'](_0x5f151e['shift']());}}}(a34_0x59ab,0x1a674));import{BaseCommand}from'./command.js';function a34_0x59ab(){const _0x587f82=['...','\x20from\x20','description','618990hxdQUg','args','26552zptHiT','1571175ZbRoSu','catalog','Table:\x20','query','cause','11EMlBlF','Database:\x20','Catalog:\x20','402466LBjeMb','site','647276dWftGw','Error:\x20','Querying\x20','10cqlMvr','show','Show\x20table\x20contents','limit','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','767960odAPVU','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','2176320jIYpUV','13oagJRu','\x20\x20Cause:\x20','length','1WQCKxq','7umfwrC','error','\x20row','database','21tcKVCs','verbose','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','5DFsKup','message','data','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','name','Limit:\x20','showTable','✔\x20Retrieved\x20'];a34_0x59ab=function(){return _0x587f82;};return a34_0x59ab();}import{SDKError}from'../sdk/index.js';function a34_0x31af(_0x490e96,_0x4be8db){_0x490e96=_0x490e96-0x183;const _0x59ab4f=a34_0x59ab();let _0x31af07=_0x59ab4f[_0x490e96];return _0x31af07;}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a34_0x177cc9(0x1a4)]=a34_0x177cc9(0x18d);[a34_0x177cc9(0x1aa)]=a34_0x177cc9(0x18e);async['execute'](_0x4fea96){const _0x7b005d=a34_0x177cc9;return this[_0x7b005d(0x1a6)](_0x4fea96);}async[a34_0x177cc9(0x1a6)](_0x28d45e){const _0x1d854a=a34_0x177cc9,{options:_0x1e4f49,args:_0x216a01,tdx:_0x5e29bd}=_0x28d45e;let _0x40810e;try{_0x40810e=parseTableReference(_0x216a01[0x0]);const _0x1357a7=_0x1e4f49[_0x1d854a(0x19b)];!_0x40810e['database']&&_0x1357a7&&(_0x40810e[_0x1d854a(0x19b)]=_0x1357a7);const _0xe450bd=validateTableDescribeReference(_0x40810e);if(_0xe450bd)return console['error'](_0x1d854a(0x18a)+_0xe450bd),console[_0x1d854a(0x199)](_0x1d854a(0x1a2)),console['error'](_0x1d854a(0x1a3)),console[_0x1d854a(0x199)](_0x1d854a(0x190)),0x1;}catch(_0xc784ad){return console[_0x1d854a(0x199)](_0x1d854a(0x18a)+_0xc784ad['message']),console[_0x1d854a(0x199)](_0x1d854a(0x1a2)),console[_0x1d854a(0x199)](_0x1d854a(0x1a3)),console[_0x1d854a(0x199)](_0x1d854a(0x190)),0x1;}const _0x279b64=_0x40810e[_0x1d854a(0x1af)],_0x191154=_0x40810e[_0x1d854a(0x19b)],_0x5f5325=_0x40810e['table'],_0x249c07=resolveLimit(_0x1e4f49[_0x1d854a(0x18f)],DEFAULT_DISPLAY_LIMIT);try{_0x1e4f49[_0x1d854a(0x19d)]&&(console['error']('Site:\x20'+_0x1e4f49[_0x1d854a(0x188)]),_0x279b64&&console[_0x1d854a(0x199)](_0x1d854a(0x186)+_0x279b64),console[_0x1d854a(0x199)](_0x1d854a(0x185)+_0x191154),console[_0x1d854a(0x199)](_0x1d854a(0x1b0)+_0x5f5325),console[_0x1d854a(0x199)](_0x1d854a(0x1a5)+_0x249c07));const _0x1eaef6=_0x279b64?_0x279b64+'.'+_0x191154+'.'+_0x5f5325:_0x191154+'.'+_0x5f5325,_0x557ed6=await withSpinner(_0x1d854a(0x18b)+_0x1eaef6+_0x1d854a(0x1a8),()=>_0x5e29bd[_0x1d854a(0x1b1)][_0x1d854a(0x1a6)](_0x191154,_0x5f5325,_0x249c07,_0x279b64),{'verbose':_0x1e4f49['verbose']}),_0xcf7f0e=_0x557ed6['data'],_0x340238=_0xcf7f0e[_0x1d854a(0x1a1)];return _0x340238['length']===0x0?console[_0x1d854a(0x199)](_0x1d854a(0x192)):console['error'](_0x1d854a(0x1a7)+_0x340238[_0x1d854a(0x196)]+_0x1d854a(0x19a)+(_0x340238[_0x1d854a(0x196)]!==0x1?'s':'')+_0x1d854a(0x1a9)+_0x1eaef6),await handleSDKOutput(_0x340238,_0x1e4f49),0x0;}catch(_0x3191d2){if(_0x3191d2 instanceof SDKError)return console[_0x1d854a(0x199)](_0x1d854a(0x18a)+_0x3191d2[_0x1d854a(0x1a0)]),_0x3191d2[_0x1d854a(0x183)]&&console['error'](_0x1d854a(0x195)+_0x3191d2[_0x1d854a(0x183)]),0x1;throw _0x3191d2;}}['validate'](_0x21b2ae){const _0x20b326=a34_0x177cc9;if(_0x21b2ae[_0x20b326(0x1ac)][_0x20b326(0x196)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x21b2ae[_0x20b326(0x1ac)][_0x20b326(0x196)]>0x1)return _0x20b326(0x19e);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a35_0x29f5(_0x5149ed,_0x3ded8a){_0x5149ed=_0x5149ed-0xad;const _0xfcc3ad=a35_0xfcc3();let _0x29f5b4=_0xfcc3ad[_0x5149ed];return _0x29f5b4;}const a35_0x28d071=a35_0x29f5;(function(_0x5b6077,_0x42acd8){const _0x4f2b4=a35_0x29f5,_0x5ad99d=_0x5b6077();while(!![]){try{const _0x75d1f8=-parseInt(_0x4f2b4(0xda))/0x1+parseInt(_0x4f2b4(0xd0))/0x2+-parseInt(_0x4f2b4(0xc6))/0x3+-parseInt(_0x4f2b4(0xd1))/0x4+-parseInt(_0x4f2b4(0xc0))/0x5*(parseInt(_0x4f2b4(0xb7))/0x6)+parseInt(_0x4f2b4(0xd2))/0x7*(parseInt(_0x4f2b4(0xdb))/0x8)+parseInt(_0x4f2b4(0xb3))/0x9;if(_0x75d1f8===_0x42acd8)break;else _0x5ad99d['push'](_0x5ad99d['shift']());}catch(_0x8ef412){_0x5ad99d['push'](_0x5ad99d['shift']());}}}(a35_0xfcc3,0xe8478));import{BaseCommand}from'./command.js';function a35_0xfcc3(){const _0x40da58=['11001030yEciKm','Error:\x20','listTables','includes','table','Listing\x20tables...','✔\x20Found\x20','Note:\x20\x27','length','5FJKEyG','name','validate','site','\x20\x20Use:\x20tdx\x20tables\x20\x22','message','5172066JARNng','Database:\x20all','Database\x20pattern:\x20','\x20table','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x27\x20across\x20all\x20databases.','verbose','Database\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','1203606ZtCCrX','6480380fIHVQk','13031781SBHWvG','Or\x20use\x20--in\x20flag:','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','error','limit','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','1714169KykMVb','8VPNIZV','database','\x27\x20is\x20ambiguous.','Error:\x20Pattern\x20\x27','✖\x20No\x20tables\x20found','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','48417489qOFLFD','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','cause','tables'];a35_0xfcc3=function(){return _0x40da58;};return a35_0xfcc3();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a35_0x28d071(0xc1)]=a35_0x28d071(0xb6);['description']='List\x20tables\x20in\x20a\x20database';async['execute'](_0x4de578){const _0x518d33=a35_0x28d071,{options:_0x5ca945,args:_0x583a24,tdx:_0xbbdef}=_0x4de578;let _0x16457d;if(_0x583a24[_0x518d33(0xbf)]===0x0)_0x16457d={'database':undefined,'table':undefined,'original':''};else{if(_0x583a24[_0x518d33(0xbf)]===0x1)try{_0x16457d=parseTableReference(_0x583a24[0x0]);if(_0x16457d['table']&&!_0x16457d[_0x518d33(0xad)]&&!_0x16457d[_0x518d33(0xbb)][_0x518d33(0xba)]('*')&&!_0x16457d[_0x518d33(0xbb)][_0x518d33(0xba)]('?'))return console[_0x518d33(0xd5)](_0x518d33(0xaf)+_0x583a24[0x0]+_0x518d33(0xae)),console[_0x518d33(0xd5)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x16457d[_0x518d33(0xbb)]+'\x27?'),console[_0x518d33(0xd5)](_0x518d33(0xc4)+_0x16457d[_0x518d33(0xbb)]+'.*\x22'),console[_0x518d33(0xd5)](_0x518d33(0xd8)+_0x16457d[_0x518d33(0xbb)]),console['error'](_0x518d33(0xd4)+_0x16457d[_0x518d33(0xbb)]),console[_0x518d33(0xd5)](''),console[_0x518d33(0xd5)](_0x518d33(0xbe)+_0x583a24[0x0]+_0x518d33(0xca)+_0x16457d[_0x518d33(0xbb)]+_0x518d33(0xcc)),0x1;}catch(_0x151f21){return console[_0x518d33(0xd5)](_0x518d33(0xb8)+_0x151f21[_0x518d33(0xc5)]),0x1;}else return console[_0x518d33(0xd5)](_0x518d33(0xd7)),console[_0x518d33(0xd5)](_0x518d33(0xcb)),console[_0x518d33(0xd5)](_0x518d33(0xb4)),console[_0x518d33(0xd5)](_0x518d33(0xcf)),console['error'](_0x518d33(0xd9)),console[_0x518d33(0xd5)](_0x518d33(0xd3)),console[_0x518d33(0xd5)](_0x518d33(0xb2)),0x1;}const _0x255cf5=_0x5ca945['database'];!_0x16457d[_0x518d33(0xad)]&&_0x255cf5&&(_0x16457d[_0x518d33(0xad)]=_0x255cf5);try{const _0x63f153=_0x5141cb=>_0x5141cb&&(_0x5141cb[_0x518d33(0xba)]('*')||_0x5141cb[_0x518d33(0xba)]('?')),_0x2ec218=_0x63f153(_0x16457d[_0x518d33(0xad)]);_0x5ca945[_0x518d33(0xcd)]&&(console[_0x518d33(0xd5)]('Site:\x20'+_0x5ca945[_0x518d33(0xc3)]),_0x16457d['database']?_0x2ec218?console[_0x518d33(0xd5)](_0x518d33(0xc8)+_0x16457d[_0x518d33(0xad)]):console['error']('Database:\x20'+_0x16457d[_0x518d33(0xad)]):console['error'](_0x518d33(0xc7)),_0x16457d[_0x518d33(0xbb)]&&console[_0x518d33(0xd5)]('Table\x20pattern:\x20'+_0x16457d[_0x518d33(0xbb)]));const _0x29c4bc=_0x16457d[_0x518d33(0xad)]&&!_0x2ec218?_0x16457d[_0x518d33(0xad)]:undefined,_0x565639=_0x2ec218?_0x16457d[_0x518d33(0xad)]:undefined,_0x59ab76=_0x16457d['table'],_0x570595=resolveLimit(_0x5ca945[_0x518d33(0xd6)],DEFAULT_LISTING_LIMIT),_0x48bd4c=await withSpinner(_0x518d33(0xbc),()=>_0xbbdef['query'][_0x518d33(0xb9)](_0x29c4bc,_0x59ab76,_0x565639,_0x570595),{'verbose':_0x5ca945[_0x518d33(0xcd)]}),_0x1955d4=_0x48bd4c['data'];if(_0x1955d4[_0x518d33(0xbf)]===0x0&&_0x16457d[_0x518d33(0xad)]&&!_0x2ec218)return console[_0x518d33(0xd5)](_0x518d33(0xb0)),console[_0x518d33(0xd5)](_0x518d33(0xce)+_0x16457d[_0x518d33(0xad)]+_0x518d33(0xb1)),0x1;return console['error'](_0x518d33(0xbd)+_0x1955d4[_0x518d33(0xbf)]+_0x518d33(0xc9)+(_0x1955d4['length']!==0x1?'s':'')),await handleSDKOutput(_0x1955d4,{..._0x5ca945,'limit':_0x570595}),0x0;}catch(_0x3c1d44){if(_0x3c1d44 instanceof SDKError)return console[_0x518d33(0xd5)]('Error:\x20'+_0x3c1d44['message']),_0x3c1d44[_0x518d33(0xb5)]&&console[_0x518d33(0xd5)]('\x20\x20Cause:\x20'+_0x3c1d44[_0x518d33(0xb5)]),0x1;throw _0x3c1d44;}}[a35_0x28d071(0xc2)](_0x4d235){return undefined;}}
|